@activepieces/piece-google-drive 0.9.0 → 0.9.1
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 +32 -32
package/src/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";var V0=Object.create;var Fo=Object.defineProperty;var G0=Object.getOwnPropertyDescriptor;var H0=Object.getOwnPropertyNames;var W0=Object.getPrototypeOf,Z0=Object.prototype.hasOwnProperty;var i=(t,e)=>Fo(t,"name",{value:e,configurable:!0});var St=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var L=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Rs=(t,e)=>{for(var r in e)Fo(t,r,{get:e[r],enumerable:!0})},qh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of H0(e))!Z0.call(t,o)&&o!==r&&Fo(t,o,{get:()=>e[o],enumerable:!(n=G0(e,o))||n.enumerable});return t};var ue=(t,e,r)=>(r=t!=null?V0(W0(t)):{},qh(e||!t||!t.__esModule?Fo(r,"default",{value:t,enumerable:!0}):r,t)),K0=t=>qh(Fo({},"__esModule",{value:!0}),t);var fy=L((py,Js)=>{(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"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",d="(?:[0-9a-f]+::?)+",m={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${d})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${d})|(?:::)(?:${d})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function h(P,S){if(P.indexOf("::")!==P.lastIndexOf("::"))return null;let D=0,E=-1,u=(P.match(m.zoneIndex)||[])[0],f,c;for(u&&(u=u.substring(1),P=P.replace(/%.+$/,""));(E=P.indexOf(":",E+1))>=0;)D++;if(P.substr(0,2)==="::"&&D--,P.substr(-2,2)==="::"&&D--,D>S)return null;for(c=S-D,f=":";c--;)f+="0:";return P=P.replace("::",f),P[0]===":"&&(P=P.slice(1)),P[P.length-1]===":"&&(P=P.slice(0,-1)),S=(function(){let y=P.split(":"),l=[];for(let b=0;b<y.length;b++)l.push(parseInt(y[b],16));return l})(),{parts:S,zoneId:u}}i(h,"expandIPv6");function v(P,S,D,E){if(P.length!==S.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let u=0,f;for(;E>0;){if(f=D-E,f<0&&(f=0),P[u]>>f!==S[u]>>f)return!1;E-=D,u+=1}return!0}i(v,"matchCIDR");function _(P){if(o.test(P))return parseInt(P,16);if(P[0]==="0"&&!isNaN(parseInt(P[1],10))){if(n.test(P))return parseInt(P,8);throw new Error(`ipaddr: cannot parse ${P} as octal`)}return parseInt(P,10)}i(_,"parseIntAuto");function x(P,S){for(;P.length<S;)P=`0${P}`;return P}i(x,"padPart");let T={};T.IPv4=(function(){function P(S){if(S.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let D,E;for(D=0;D<S.length;D++)if(E=S[D],!(0<=E&&E<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=S}return i(P,"IPv4"),P.prototype.SpecialRanges={unspecified:[[new P([0,0,0,0]),8]],broadcast:[[new P([255,255,255,255]),32]],multicast:[[new P([224,0,0,0]),4]],linkLocal:[[new P([169,254,0,0]),16]],loopback:[[new P([127,0,0,0]),8]],carrierGradeNat:[[new P([100,64,0,0]),10]],private:[[new P([10,0,0,0]),8],[new P([172,16,0,0]),12],[new P([192,168,0,0]),16]],reserved:[[new P([192,0,0,0]),24],[new P([192,0,2,0]),24],[new P([192,88,99,0]),24],[new P([198,18,0,0]),15],[new P([198,51,100,0]),24],[new P([203,0,113,0]),24],[new P([240,0,0,0]),4]],as112:[[new P([192,175,48,0]),24],[new P([192,31,196,0]),24]],amt:[[new P([192,52,193,0]),24]]},P.prototype.kind=function(){return"ipv4"},P.prototype.match=function(S,D){let E;if(D===void 0&&(E=S,S=E[0],D=E[1]),S.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return v(this.octets,S.octets,8,D)},P.prototype.prefixLengthFromSubnetMask=function(){let S=0,D=!1,E={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},u,f,c;for(u=3;u>=0;u-=1)if(f=this.octets[u],f in E){if(c=E[f],D&&c!==0)return null;c!==8&&(D=!0),S+=c}else return null;return 32-S},P.prototype.range=function(){return T.subnetMatch(this,this.SpecialRanges)},P.prototype.toByteArray=function(){return this.octets.slice(0)},P.prototype.toIPv4MappedAddress=function(){return T.IPv6.parse(`::ffff:${this.toString()}`)},P.prototype.toNormalizedString=function(){return this.toString()},P.prototype.toString=function(){return this.octets.join(".")},P})(),T.IPv4.broadcastAddressFromCIDR=function(P){try{let S=this.parseCIDR(P),D=S[0].toByteArray(),E=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],f=0;for(;f<4;)u.push(parseInt(D[f],10)|parseInt(E[f],10)^255),f++;return new this(u)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},T.IPv4.isIPv4=function(P){return this.parser(P)!==null},T.IPv4.isValid=function(P){try{return new this(this.parser(P)),!0}catch{return!1}},T.IPv4.isValidCIDR=function(P){try{return this.parseCIDR(P),!0}catch{return!1}},T.IPv4.isValidFourPartDecimal=function(P){return!!(T.IPv4.isValid(P)&&P.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},T.IPv4.isValidCIDRFourPartDecimal=function(P){let S=P.match(/^(.+)\/(\d+)$/);return!T.IPv4.isValidCIDR(P)||!S?!1:T.IPv4.isValidFourPartDecimal(S[1])},T.IPv4.networkAddressFromCIDR=function(P){let S,D,E,u,f;try{for(S=this.parseCIDR(P),E=S[0].toByteArray(),f=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],D=0;D<4;)u.push(parseInt(E[D],10)&parseInt(f[D],10)),D++;return new this(u)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},T.IPv4.parse=function(P){let S=this.parser(P);if(S===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(S)},T.IPv4.parseCIDR=function(P){let S;if(S=P.match(/^(.+)\/(\d+)$/)){let D=parseInt(S[2]);if(D>=0&&D<=32){let E=[this.parse(S[1]),D];return Object.defineProperty(E,"toString",{value:i(function(){return this.join("/")},"value")}),E}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},T.IPv4.parser=function(P){let S,D,E;if(S=P.match(r.fourOctet))return(function(){let u=S.slice(1,6),f=[];for(let c=0;c<u.length;c++)D=u[c],f.push(_(D));return f})();if(S=P.match(r.longValue)){if(E=_(S[1]),E>4294967295||E<0)throw new Error("ipaddr: address outside defined range");return(function(){let u=[],f;for(f=0;f<=24;f+=8)u.push(E>>f&255);return u})().reverse()}else return(S=P.match(r.twoOctet))?(function(){let u=S.slice(1,4),f=[];if(E=_(u[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return f.push(_(u[0])),f.push(E>>16&255),f.push(E>>8&255),f.push(E&255),f})():(S=P.match(r.threeOctet))?(function(){let u=S.slice(1,5),f=[];if(E=_(u[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return f.push(_(u[0])),f.push(_(u[1])),f.push(E>>8&255),f.push(E&255),f})():null},T.IPv4.subnetMaskFromPrefixLength=function(P){if(P=parseInt(P),P<0||P>32)throw new Error("ipaddr: invalid IPv4 prefix length");let S=[0,0,0,0],D=0,E=Math.floor(P/8);for(;D<E;)S[D]=255,D++;return E<4&&(S[E]=Math.pow(2,P%8)-1<<8-P%8),new this(S)},T.IPv6=(function(){function P(S,D){let E,u;if(S.length===16)for(this.parts=[],E=0;E<=14;E+=2)this.parts.push(S[E]<<8|S[E+1]);else if(S.length===8)this.parts=S;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(E=0;E<this.parts.length;E++)if(u=this.parts[E],!(0<=u&&u<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");D&&(this.zoneId=D)}return i(P,"IPv6"),P.prototype.SpecialRanges={unspecified:[new P([0,0,0,0,0,0,0,0]),128],linkLocal:[new P([65152,0,0,0,0,0,0,0]),10],multicast:[new P([65280,0,0,0,0,0,0,0]),8],loopback:[new P([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new P([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new P([0,0,0,0,0,65535,0,0]),96],discard:[new P([256,0,0,0,0,0,0,0]),64],rfc6145:[new P([0,0,0,0,65535,0,0,0]),96],rfc6052:[new P([100,65435,0,0,0,0,0,0]),96],"6to4":[new P([8194,0,0,0,0,0,0,0]),16],teredo:[new P([8193,0,0,0,0,0,0,0]),32],benchmarking:[new P([8193,2,0,0,0,0,0,0]),48],amt:[new P([8193,3,0,0,0,0,0,0]),32],as112v6:[[new P([8193,4,274,0,0,0,0,0]),48],[new P([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new P([8193,16,0,0,0,0,0,0]),28],orchid2:[new P([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new P([8193,48,0,0,0,0,0,0]),28],reserved:[[new P([8193,0,0,0,0,0,0,0]),23],[new P([8193,3512,0,0,0,0,0,0]),32]]},P.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},P.prototype.kind=function(){return"ipv6"},P.prototype.match=function(S,D){let E;if(D===void 0&&(E=S,S=E[0],D=E[1]),S.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return v(this.parts,S.parts,16,D)},P.prototype.prefixLengthFromSubnetMask=function(){let S=0,D=!1,E={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},u,f;for(let c=7;c>=0;c-=1)if(u=this.parts[c],u in E){if(f=E[u],D&&f!==0)return null;f!==16&&(D=!0),S+=f}else return null;return 128-S},P.prototype.range=function(){return T.subnetMatch(this,this.SpecialRanges)},P.prototype.toByteArray=function(){let S,D=[],E=this.parts;for(let u=0;u<E.length;u++)S=E[u],D.push(S>>8),D.push(S&255);return D},P.prototype.toFixedLengthString=function(){let S=(function(){let E=[];for(let u=0;u<this.parts.length;u++)E.push(x(this.parts[u].toString(16),4));return E}).call(this).join(":"),D="";return this.zoneId&&(D=`%${this.zoneId}`),S+D},P.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let S=this.parts.slice(-2),D=S[0],E=S[1];return new T.IPv4([D>>8,D&255,E>>8,E&255])},P.prototype.toNormalizedString=function(){let S=(function(){let E=[];for(let u=0;u<this.parts.length;u++)E.push(this.parts[u].toString(16));return E}).call(this).join(":"),D="";return this.zoneId&&(D=`%${this.zoneId}`),S+D},P.prototype.toRFC5952String=function(){let S=/((^|:)(0(:|$)){2,})/g,D=this.toNormalizedString(),E=0,u=-1,f;for(;f=S.exec(D);)f[0].length>u&&(E=f.index,u=f[0].length);return u<0?D:`${D.substring(0,E)}::${D.substring(E+u)}`},P.prototype.toString=function(){return this.toRFC5952String()},P})(),T.IPv6.broadcastAddressFromCIDR=function(P){try{let S=this.parseCIDR(P),D=S[0].toByteArray(),E=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],f=0;for(;f<16;)u.push(parseInt(D[f],10)|parseInt(E[f],10)^255),f++;return new this(u)}catch(S){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${S})`)}},T.IPv6.isIPv6=function(P){return this.parser(P)!==null},T.IPv6.isValid=function(P){if(typeof P=="string"&&P.indexOf(":")===-1)return!1;try{let S=this.parser(P);return new this(S.parts,S.zoneId),!0}catch{return!1}},T.IPv6.isValidCIDR=function(P){if(typeof P=="string"&&P.indexOf(":")===-1)return!1;try{return this.parseCIDR(P),!0}catch{return!1}},T.IPv6.networkAddressFromCIDR=function(P){let S,D,E,u,f;try{for(S=this.parseCIDR(P),E=S[0].toByteArray(),f=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],D=0;D<16;)u.push(parseInt(E[D],10)&parseInt(f[D],10)),D++;return new this(u)}catch(c){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${c})`)}},T.IPv6.parse=function(P){let S=this.parser(P);if(S.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(S.parts,S.zoneId)},T.IPv6.parseCIDR=function(P){let S,D,E;if((D=P.match(/^(.+)\/(\d+)$/))&&(S=parseInt(D[2]),S>=0&&S<=128))return E=[this.parse(D[1]),S],Object.defineProperty(E,"toString",{value:i(function(){return this.join("/")},"value")}),E;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},T.IPv6.parser=function(P){let S,D,E,u,f,c;if(E=P.match(m.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(m.native.test(P))return h(P,8);if((E=P.match(m.transitional))&&(c=E[6]||"",S=E[1],E[1].endsWith("::")||(S=S.slice(0,-1)),S=h(S+c,6),S.parts)){for(f=[parseInt(E[2]),parseInt(E[3]),parseInt(E[4]),parseInt(E[5])],D=0;D<f.length;D++)if(u=f[D],!(0<=u&&u<=255))return null;return S.parts.push(f[0]<<8|f[1]),S.parts.push(f[2]<<8|f[3]),{parts:S.parts,zoneId:S.zoneId}}return null},T.IPv6.subnetMaskFromPrefixLength=function(P){if(P=parseInt(P),P<0||P>128)throw new Error("ipaddr: invalid IPv6 prefix length");let S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],D=0,E=Math.floor(P/8);for(;D<E;)S[D]=255,D++;return E<16&&(S[E]=Math.pow(2,P%8)-1<<8-P%8),new this(S)},T.fromByteArray=function(P){let S=P.length;if(S===4)return new T.IPv4(P);if(S===16)return new T.IPv6(P);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},T.isValid=function(P){return T.IPv6.isValid(P)||T.IPv4.isValid(P)},T.isValidCIDR=function(P){return T.IPv6.isValidCIDR(P)||T.IPv4.isValidCIDR(P)},T.parse=function(P){if(T.IPv6.isValid(P))return T.IPv6.parse(P);if(T.IPv4.isValid(P))return T.IPv4.parse(P);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},T.parseCIDR=function(P){try{return T.IPv6.parseCIDR(P)}catch{try{return T.IPv4.parseCIDR(P)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},T.process=function(P){let S=this.parse(P);return S.kind()==="ipv6"&&S.isIPv4MappedAddress()?S.toIPv4Address():S},T.subnetMatch=function(P,S,D){let E,u,f,c;D==null&&(D="unicast");for(u in S)if(Object.prototype.hasOwnProperty.call(S,u)){for(f=S[u],f[0]&&!(f[0]instanceof Array)&&(f=[f]),E=0;E<f.length;E++)if(c=f[E],P.kind()===c[0].kind()&&P.match.apply(P,c))return u}return D},typeof Js<"u"&&Js.exports?Js.exports=T:t.ipaddr=T})(py)});var gv=L((z9,hv)=>{var mv=require("stream").Stream,kO=require("util");hv.exports=Er;function Er(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(Er,"DelayedStream");kO.inherits(Er,mv);Er.create=function(t,e){var r=new this;e=e||{};for(var n in e)r[n]=e[n];r.source=t;var o=t.emit;return t.emit=function(){return r._handleEmit(arguments),o.apply(t,arguments)},t.on("error",function(){}),r.pauseStream&&t.pause(),r};Object.defineProperty(Er.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});Er.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Er.prototype.resume=function(){this._released||this.release(),this.source.resume()};Er.prototype.pause=function(){this.source.pause()};Er.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};Er.prototype.pipe=function(){var t=mv.prototype.pipe.apply(this,arguments);return this.resume(),t};Er.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)};Er.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 wv=L((M9,_v)=>{var zO=require("util"),vv=require("stream").Stream,yv=gv();_v.exports=pt;function pt(){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}i(pt,"CombinedStream");zO.inherits(pt,vv);pt.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};pt.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};pt.prototype.append=function(t){var e=pt.isStreamLike(t);if(e){if(!(t instanceof yv)){var r=yv.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};pt.prototype.pipe=function(t,e){return vv.prototype.pipe.call(this,t,e),this.resume(),t};pt.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}};pt.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=pt.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};pt.prototype._pipeNext=function(t){this._currentStream=t;var e=pt.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()};pt.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};pt.prototype.write=function(t){this.emit("data",t)};pt.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};pt.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")};pt.prototype.end=function(){this._reset(),this.emit("end")};pt.prototype.destroy=function(){this._reset(),this.emit("close")};pt.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};pt.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};pt.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)};pt.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var bv=L((L9,Pv)=>{"use strict";Pv.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 mn=L(Lt=>{"use strict";var tu=bv(),UO=require("path").extname,Tv=/^\s*([^;\s]*)(?:;|\s|$)/,MO=/^text\//i;Lt.charset=Sv;Lt.charsets={lookup:Sv};Lt.contentType=FO;Lt.extension=LO;Lt.extensions=Object.create(null);Lt.lookup=jO;Lt.types=Object.create(null);qO(Lt.extensions,Lt.types);function Sv(t){if(!t||typeof t!="string")return!1;var e=Tv.exec(t),r=e&&tu[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&MO.test(e[1])?"UTF-8":!1}i(Sv,"charset");function FO(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Lt.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Lt.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}i(FO,"contentType");function LO(t){if(!t||typeof t!="string")return!1;var e=Tv.exec(t),r=e&&Lt.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(LO,"extension");function jO(t){if(!t||typeof t!="string")return!1;var e=UO("x."+t).toLowerCase().substr(1);return e&&Lt.types[e]||!1}i(jO,"lookup");function qO(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(tu).forEach(i(function(o){var s=tu[o],d=s.extensions;if(!(!d||!d.length)){t[o]=d;for(var m=0;m<d.length;m++){var h=d[m];if(e[h]){var v=r.indexOf(tu[e[h]].source),_=r.indexOf(s.source);if(e[h]!=="application/octet-stream"&&(v>_||v===_&&e[h].substr(0,12)==="application/"))continue}e[h]=o}}},"forEachMimeType"))}i(qO,"populateMaps")});var xv=L((B9,Ev)=>{Ev.exports=BO;function BO(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}i(BO,"defer")});var pd=L((G9,Av)=>{var Iv=xv();Av.exports=VO;function VO(t){var e=!1;return Iv(function(){e=!0}),i(function(n,o){e?t(n,o):Iv(i(function(){t(n,o)},"nextTick_callback"))},"async_callback")}i(VO,"async")});var fd=L((W9,Rv)=>{Rv.exports=GO;function GO(t){Object.keys(t.jobs).forEach(HO.bind(t)),t.jobs={}}i(GO,"abort");function HO(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}i(HO,"clean")});var md=L((K9,$v)=>{var Dv=pd(),WO=fd();$v.exports=ZO;function ZO(t,e,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=KO(e,o,t[o],function(s,d){o in r.jobs&&(delete r.jobs[o],s?WO(r):r.results[o]=d,n(s,r.results))})}i(ZO,"iterate");function KO(t,e,r,n){var o;return t.length==2?o=t(r,Dv(n)):o=t(r,e,Dv(n)),o}i(KO,"runJob")});var hd=L((Y9,Ov)=>{Ov.exports=JO;function JO(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(o,s){return e(t[o],t[s])}),n}i(JO,"state")});var gd=L((Q9,Cv)=>{var YO=fd(),XO=pd();Cv.exports=QO;function QO(t){Object.keys(this.jobs).length&&(this.index=this.size,YO(this),XO(t)(null,this.results))}i(QO,"terminator")});var kv=L((tY,Nv)=>{var eC=md(),tC=hd(),rC=gd();Nv.exports=nC;function nC(t,e,r){for(var n=tC(t);n.index<(n.keyedList||t).length;)eC(t,e,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return rC.bind(n,r)}i(nC,"parallel")});var yd=L((nY,ru)=>{var zv=md(),iC=hd(),oC=gd();ru.exports=aC;ru.exports.ascending=Uv;ru.exports.descending=sC;function aC(t,e,r,n){var o=iC(t,r);return zv(t,e,o,i(function s(d,m){if(d){n(d,m);return}if(o.index++,o.index<(o.keyedList||t).length){zv(t,e,o,s);return}n(null,o.results)},"iteratorHandler")),oC.bind(o,n)}i(aC,"serialOrdered");function Uv(t,e){return t<e?-1:t>e?1:0}i(Uv,"ascending");function sC(t,e){return-1*Uv(t,e)}i(sC,"descending")});var Fv=L((oY,Mv)=>{var uC=yd();Mv.exports=cC;function cC(t,e,r){return uC(t,e,null,r)}i(cC,"serial")});var jv=L((sY,Lv)=>{Lv.exports={parallel:kv(),serial:Fv(),serialOrdered:yd()}});var vd=L((uY,qv)=>{"use strict";qv.exports=Object});var Vv=L((cY,Bv)=>{"use strict";Bv.exports=Error});var Hv=L((lY,Gv)=>{"use strict";Gv.exports=EvalError});var Zv=L((dY,Wv)=>{"use strict";Wv.exports=RangeError});var Jv=L((pY,Kv)=>{"use strict";Kv.exports=ReferenceError});var Xv=L((fY,Yv)=>{"use strict";Yv.exports=SyntaxError});var jn=L((mY,Qv)=>{"use strict";Qv.exports=TypeError});var t_=L((hY,e_)=>{"use strict";e_.exports=URIError});var n_=L((gY,r_)=>{"use strict";r_.exports=Math.abs});var o_=L((yY,i_)=>{"use strict";i_.exports=Math.floor});var s_=L((vY,a_)=>{"use strict";a_.exports=Math.max});var c_=L((_Y,u_)=>{"use strict";u_.exports=Math.min});var d_=L((wY,l_)=>{"use strict";l_.exports=Math.pow});var f_=L((PY,p_)=>{"use strict";p_.exports=Math.round});var h_=L((bY,m_)=>{"use strict";m_.exports=Number.isNaN||i(function(e){return e!==e},"isNaN")});var y_=L((SY,g_)=>{"use strict";var lC=h_();g_.exports=i(function(e){return lC(e)||e===0?e:e<0?-1:1},"sign")});var __=L((xY,v_)=>{"use strict";v_.exports=Object.getOwnPropertyDescriptor});var _d=L((IY,w_)=>{"use strict";var nu=__();if(nu)try{nu([],"length")}catch{nu=null}w_.exports=nu});var b_=L((AY,P_)=>{"use strict";var iu=Object.defineProperty||!1;if(iu)try{iu({},"a",{value:1})}catch{iu=!1}P_.exports=iu});var wd=L((RY,T_)=>{"use strict";T_.exports=i(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 o=42;e[r]=o;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 d=Object.getOwnPropertySymbols(e);if(d.length!==1||d[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var m=Object.getOwnPropertyDescriptor(e,r);if(m.value!==o||m.enumerable!==!0)return!1}return!0},"hasSymbols")});var x_=L(($Y,E_)=>{"use strict";var S_=typeof Symbol<"u"&&Symbol,dC=wd();E_.exports=i(function(){return typeof S_!="function"||typeof Symbol!="function"||typeof S_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:dC()},"hasNativeSymbols")});var Pd=L((CY,I_)=>{"use strict";I_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var bd=L((NY,A_)=>{"use strict";var pC=vd();A_.exports=pC.getPrototypeOf||null});var $_=L((kY,D_)=>{"use strict";var fC="Function.prototype.bind called on incompatible ",mC=Object.prototype.toString,hC=Math.max,gC="[object Function]",R_=i(function(e,r){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},"concatty"),yC=i(function(e,r){for(var n=[],o=r||0,s=0;o<e.length;o+=1,s+=1)n[s]=e[o];return n},"slicy"),vC=i(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");D_.exports=i(function(e){var r=this;if(typeof r!="function"||mC.apply(r)!==gC)throw new TypeError(fC+r);for(var n=yC(arguments,1),o,s=i(function(){if(this instanceof o){var _=r.apply(this,R_(n,arguments));return Object(_)===_?_:this}return r.apply(e,R_(n,arguments))},"binder"),d=hC(0,r.length-n.length),m=[],h=0;h<d;h++)m[h]="$"+h;if(o=Function("binder","return function ("+vC(m,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var v=i(function(){},"Empty");v.prototype=r.prototype,o.prototype=new v,v.prototype=null}return o},"bind")});var Ji=L((UY,O_)=>{"use strict";var _C=$_();O_.exports=Function.prototype.bind||_C});var ou=L((MY,C_)=>{"use strict";C_.exports=Function.prototype.call});var Td=L((FY,N_)=>{"use strict";N_.exports=Function.prototype.apply});var z_=L((LY,k_)=>{"use strict";k_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var M_=L((jY,U_)=>{"use strict";var wC=Ji(),PC=Td(),bC=ou(),TC=z_();U_.exports=TC||wC.call(bC,PC)});var Sd=L((qY,F_)=>{"use strict";var SC=Ji(),EC=jn(),xC=ou(),IC=M_();F_.exports=i(function(e){if(e.length<1||typeof e[0]!="function")throw new EC("a function is required");return IC(SC,xC,e)},"callBindBasic")});var G_=L((VY,V_)=>{"use strict";var AC=Sd(),L_=_d(),q_;try{q_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ed=!!q_&&L_&&L_(Object.prototype,"__proto__"),B_=Object,j_=B_.getPrototypeOf;V_.exports=Ed&&typeof Ed.get=="function"?AC([Ed.get]):typeof j_=="function"?i(function(e){return j_(e==null?e:B_(e))},"getDunder"):!1});var J_=L((HY,K_)=>{"use strict";var H_=Pd(),W_=bd(),Z_=G_();K_.exports=H_?i(function(e){return H_(e)},"getProto"):W_?i(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return W_(e)},"getProto"):Z_?i(function(e){return Z_(e)},"getProto"):null});var xd=L((ZY,Y_)=>{"use strict";var RC=Function.prototype.call,DC=Object.prototype.hasOwnProperty,$C=Ji();Y_.exports=$C.call(RC,DC)});var ca=L((KY,nw)=>{"use strict";var Le,OC=vd(),CC=Vv(),NC=Hv(),kC=Zv(),zC=Jv(),eo=Xv(),Qi=jn(),UC=t_(),MC=n_(),FC=o_(),LC=s_(),jC=c_(),qC=d_(),BC=f_(),VC=y_(),tw=Function,Id=i(function(t){try{return tw('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),aa=_d(),GC=b_(),Ad=i(function(){throw new Qi},"throwTypeError"),HC=aa?(function(){try{return arguments.callee,Ad}catch{try{return aa(arguments,"callee").get}catch{return Ad}}})():Ad,Yi=x_()(),xt=J_(),WC=bd(),ZC=Pd(),rw=Td(),sa=ou(),Xi={},KC=typeof Uint8Array>"u"||!xt?Le:xt(Uint8Array),ci={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Le:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Le:ArrayBuffer,"%ArrayIteratorPrototype%":Yi&&xt?xt([][Symbol.iterator]()):Le,"%AsyncFromSyncIteratorPrototype%":Le,"%AsyncFunction%":Xi,"%AsyncGenerator%":Xi,"%AsyncGeneratorFunction%":Xi,"%AsyncIteratorPrototype%":Xi,"%Atomics%":typeof Atomics>"u"?Le:Atomics,"%BigInt%":typeof BigInt>"u"?Le:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Le:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Le:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Le:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":CC,"%eval%":eval,"%EvalError%":NC,"%Float16Array%":typeof Float16Array>"u"?Le:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Le:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Le:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Le:FinalizationRegistry,"%Function%":tw,"%GeneratorFunction%":Xi,"%Int8Array%":typeof Int8Array>"u"?Le:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Le:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Le:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Yi&&xt?xt(xt([][Symbol.iterator]())):Le,"%JSON%":typeof JSON=="object"?JSON:Le,"%Map%":typeof Map>"u"?Le:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Yi||!xt?Le:xt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":OC,"%Object.getOwnPropertyDescriptor%":aa,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Le:Promise,"%Proxy%":typeof Proxy>"u"?Le:Proxy,"%RangeError%":kC,"%ReferenceError%":zC,"%Reflect%":typeof Reflect>"u"?Le:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Le:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Yi||!xt?Le:xt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Le:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Yi&&xt?xt(""[Symbol.iterator]()):Le,"%Symbol%":Yi?Symbol:Le,"%SyntaxError%":eo,"%ThrowTypeError%":HC,"%TypedArray%":KC,"%TypeError%":Qi,"%Uint8Array%":typeof Uint8Array>"u"?Le:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Le:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Le:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Le:Uint32Array,"%URIError%":UC,"%WeakMap%":typeof WeakMap>"u"?Le:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Le:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Le:WeakSet,"%Function.prototype.call%":sa,"%Function.prototype.apply%":rw,"%Object.defineProperty%":GC,"%Object.getPrototypeOf%":WC,"%Math.abs%":MC,"%Math.floor%":FC,"%Math.max%":LC,"%Math.min%":jC,"%Math.pow%":qC,"%Math.round%":BC,"%Math.sign%":VC,"%Reflect.getPrototypeOf%":ZC};if(xt)try{null.error}catch(t){X_=xt(xt(t)),ci["%Error.prototype%"]=X_}var X_,JC=i(function t(e){var r;if(e==="%AsyncFunction%")r=Id("async function () {}");else if(e==="%GeneratorFunction%")r=Id("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Id("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&xt&&(r=xt(o.prototype))}return ci[e]=r,r},"doEval"),Q_={__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"]},ua=Ji(),au=xd(),YC=ua.call(sa,Array.prototype.concat),XC=ua.call(rw,Array.prototype.splice),ew=ua.call(sa,String.prototype.replace),su=ua.call(sa,String.prototype.slice),QC=ua.call(sa,RegExp.prototype.exec),eN=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,tN=/\\(\\)?/g,rN=i(function(e){var r=su(e,0,1),n=su(e,-1);if(r==="%"&&n!=="%")throw new eo("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new eo("invalid intrinsic syntax, expected opening `%`");var o=[];return ew(e,eN,function(s,d,m,h){o[o.length]=m?ew(h,tN,"$1"):d||s}),o},"stringToPath"),nN=i(function(e,r){var n=e,o;if(au(Q_,n)&&(o=Q_[n],n="%"+o[0]+"%"),au(ci,n)){var s=ci[n];if(s===Xi&&(s=JC(n)),typeof s>"u"&&!r)throw new Qi("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new eo("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");nw.exports=i(function(e,r){if(typeof e!="string"||e.length===0)throw new Qi("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Qi('"allowMissing" argument must be a boolean');if(QC(/^%?[^%]*%?$/,e)===null)throw new eo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=rN(e),o=n.length>0?n[0]:"",s=nN("%"+o+"%",r),d=s.name,m=s.value,h=!1,v=s.alias;v&&(o=v[0],XC(n,YC([0,1],v)));for(var _=1,x=!0;_<n.length;_+=1){var T=n[_],P=su(T,0,1),S=su(T,-1);if((P==='"'||P==="'"||P==="`"||S==='"'||S==="'"||S==="`")&&P!==S)throw new eo("property names with quotes must have matching quotes");if((T==="constructor"||!x)&&(h=!0),o+="."+T,d="%"+o+"%",au(ci,d))m=ci[d];else if(m!=null){if(!(T in m)){if(!r)throw new Qi("base intrinsic for "+e+" exists, but the property is not available.");return}if(aa&&_+1>=n.length){var D=aa(m,T);x=!!D,x&&"get"in D&&!("originalValue"in D.get)?m=D.get:m=m[T]}else x=au(m,T),m=m[T];x&&!h&&(ci[d]=m)}}return m},"GetIntrinsic")});var ow=L((YY,iw)=>{"use strict";var iN=wd();iw.exports=i(function(){return iN()&&!!Symbol.toStringTag},"hasToStringTagShams")});var uw=L((QY,sw)=>{"use strict";var oN=ca(),aw=oN("%Object.defineProperty%",!0),aN=ow()(),sN=xd(),uN=jn(),uu=aN?Symbol.toStringTag:null;sw.exports=i(function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new uN("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");uu&&(n||!sN(e,uu))&&(aw?aw(e,uu,{configurable:!o,enumerable:!1,value:r,writable:!1}):e[uu]=r)},"setToStringTag")});var lw=L((tX,cw)=>{"use strict";var cN=Function.prototype.call,lN=Object.prototype.hasOwnProperty,dN=Ji();cw.exports=dN.call(cN,lN)});var pw=L((rX,dw)=>{"use strict";dw.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var la=L((nX,mw)=>{"use strict";var Od=wv(),pN=require("util"),Rd=require("path"),fN=require("http"),mN=require("https"),hN=require("url").parse,gN=require("fs"),yN=require("stream").Stream,vN=require("crypto"),Dd=mn(),_N=jv(),wN=uw(),qn=lw(),$d=pw();function fw(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(fw,"escapeHeaderParam");function He(t){if(!(this instanceof He))return new He(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Od.call(this),t=t||{};for(var e in t)this[e]=t[e]}i(He,"FormData");pN.inherits(He,Od);He.LINE_BREAK=`\r
|
|
2
|
-
`;He.DEFAULT_CONTENT_TYPE="application/octet-stream";He.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Od.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 o=this._multiPartHeader(t,e,r),s=this._multiPartFooter();n(o),n(e),n(s),this._trackLength(o,e,r)};He.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)+He.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&qn(e,"httpVersion"))&&!(e instanceof yN))&&(r.knownLength||this._valuesToMeasure.push(e))};He.prototype._lengthRetriever=function(t,e){qn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):gN.stat(t.path,function(r,n){if(r){e(r);return}var o=n.size-(t.start?t.start:0);e(null,o)}):qn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):qn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};He.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),o=this._getContentType(e,r),s="",d={"Content-Disposition":["form-data",'name="'+fw(t)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&$d(d,r.header);var m;for(var h in d)if(qn(d,h)){if(m=d[h],m==null)continue;Array.isArray(m)||(m=[m]),m.length&&(s+=h+": "+m.join("; ")+He.LINE_BREAK)}return"--"+this.getBoundary()+He.LINE_BREAK+s+He.LINE_BREAK};He.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=Rd.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=Rd.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&qn(t,"httpVersion")&&(r=Rd.basename(t.client._httpMessage.path||"")),r)return'filename="'+fw(r)+'"'};He.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&&qn(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=He.DEFAULT_CONTENT_TYPE),r};He.prototype._multiPartFooter=function(){return function(t){var e=He.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};He.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+He.LINE_BREAK};He.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)qn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};He.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};He.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};He.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(He.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};He.prototype._generateBoundary=function(){this._boundary="--------------------------"+vN.randomBytes(12).toString("hex")};He.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};He.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};He.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}_N.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(o){e+=o}),t(null,e)})};He.prototype.submit=function(t,e){var r,n,o={method:"post"};return typeof t=="string"?(t=hN(t),n=$d({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},o)):(n=$d(t,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=mN.request(n):r=fN.request(n),this.getLength(function(s,d){if(s&&s!=="Unknown stream"){this._error(s);return}if(d&&r.setHeader("Content-Length",d),this.pipe(r),e){var m,h=i(function(v,_){return r.removeListener("error",h),r.removeListener("response",m),e.call(this,v,_)},"callback");m=h.bind(this,null),r.on("error",h),r.on("response",m)}}.bind(this)),r};He.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};He.prototype.toString=function(){return"[object FormData]"};wN(He.prototype,"FormData");mw.exports=He});var da=L((xX,Sw)=>{"use strict";var cu=Object.prototype.hasOwnProperty,Tw=Object.prototype.toString,yw=Object.defineProperty,vw=Object.getOwnPropertyDescriptor,_w=i(function(e){return typeof Array.isArray=="function"?Array.isArray(e):Tw.call(e)==="[object Array]"},"isArray"),ww=i(function(e){if(!e||Tw.call(e)!=="[object Object]")return!1;var r=cu.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&cu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var o;for(o in e);return typeof o>"u"||cu.call(e,o)},"isPlainObject"),Pw=i(function(e,r){yw&&r.name==="__proto__"?yw(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),bw=i(function(e,r){if(r==="__proto__")if(cu.call(e,r)){if(vw)return vw(e,r).value}else return;return e[r]},"getProperty");Sw.exports=i(function t(){var e,r,n,o,s,d,m=arguments[0],h=1,v=arguments.length,_=!1;for(typeof m=="boolean"&&(_=m,m=arguments[1]||{},h=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});h<v;++h)if(e=arguments[h],e!=null)for(r in e)n=bw(m,r),o=bw(e,r),m!==o&&(_&&o&&(ww(o)||(s=_w(o)))?(s?(s=!1,d=n&&_w(n)?n:[]):d=n&&ww(n)?n:{},Pw(m,{name:r,newValue:t(_,d,o)})):typeof o<"u"&&Pw(m,{name:r,newValue:o}));return m},"extend")});var Ew=L((AX,RN)=>{RN.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 Iw=L((RX,xw)=>{"use strict";var DN=Ew();xw.exports={pkg:DN}});var kd=L(pr=>{"use strict";var Rw=pr&&pr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pr,"__esModule",{value:!0});pr.GaxiosError=pr.GAXIOS_ERROR_SYMBOL=void 0;pr.defaultErrorRedactor=Dw;var Aw=Rw(da()),$N=Rw(Iw()),Cd=$N.default.pkg;pr.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Cd.name}-gaxios-error`);var Nd=class t extends Error{static{i(this,"GaxiosError")}config;response;code;status;error;[pr.GAXIOS_ERROR_SYMBOL]=Cd.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&pr.GAXIOS_ERROR_SYMBOL in e&&e[pr.GAXIOS_ERROR_SYMBOL]===Cd.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,r,n,o){if(super(e,{cause:o}),this.config=r,this.response=n,this.error=o instanceof Error?o:void 0,this.config=(0,Aw.default)(!0,{},r),this.response&&(this.response.config=(0,Aw.default)(!0,{},this.response.config)),this.response){try{this.response.data=ON(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}o instanceof DOMException?this.code=o.name:o&&typeof o=="object"&&"code"in o&&(typeof o.code=="string"||typeof o.code=="number")&&(this.code=o.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 o="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 d=[];for(let m of e.data.error.errors)typeof m=="object"&&"message"in m&&typeof m.message=="string"&&d.push(m.message);return Object.assign({message:d.join(`
|
|
3
|
-
`)||n,code:s,status:o},e.data.error)}return Object.assign({message:n,code:s,status:o},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};pr.GaxiosError=Nd;function ON(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}}i(ON,"translateData");function Dw(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((d,m)=>{(/^authentication$/i.test(m)||/^authorization$/i.test(m)||/secret/i.test(m))&&s.set(m,e)})}i(r,"redactHeaders");function n(s,d){if(typeof s=="object"&&s!==null&&typeof s[d]=="string"){let m=s[d];(/grant_type=/i.test(m)||/assertion=/i.test(m)||/secret/i.test(m))&&(s[d]=e)}}i(n,"redactString");function o(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((d,m)=>{(["grant_type","assertion"].includes(m)||/secret/.test(m))&&s.set(m,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return i(o,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),o(t.config.data),n(t.config,"body"),o(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&&(Dw({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),o(t.response.data))),t}i(Dw,"defaultErrorRedactor")});var Ow=L(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.getRetryConfig=CN;async function CN(t){let e=$w(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||NN)(t))return{shouldRetry:!1,config:t.config};let o=kN(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,o):new Promise(d=>{setTimeout(d,o)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}i(CN,"getRetryConfig");function NN(t){let e=$w(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,o]of e.statusCodesToRetry){let s=t.response.status;if(s>=n&&s<=o){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}i(NN,"shouldRetryRequest");function $w(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}i($w,"getConfig");function kN(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)}i(kN,"getNextRetryDelay")});var Md=L(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.GaxiosInterceptorManager=void 0;var Ud=class extends Set{static{i(this,"GaxiosInterceptorManager")}};lu.GaxiosInterceptorManager=Ud});var Nw=L((zX,Cw)=>{var to=1e3,ro=to*60,no=ro*60,li=no*24,zN=li*7,UN=li*365.25;Cw.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return MN(t);if(r==="number"&&isFinite(t))return e.long?LN(t):FN(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function MN(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*UN;case"weeks":case"week":case"w":return r*zN;case"days":case"day":case"d":return r*li;case"hours":case"hour":case"hrs":case"hr":case"h":return r*no;case"minutes":case"minute":case"mins":case"min":case"m":return r*ro;case"seconds":case"second":case"secs":case"sec":case"s":return r*to;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}i(MN,"parse");function FN(t){var e=Math.abs(t);return e>=li?Math.round(t/li)+"d":e>=no?Math.round(t/no)+"h":e>=ro?Math.round(t/ro)+"m":e>=to?Math.round(t/to)+"s":t+"ms"}i(FN,"fmtShort");function LN(t){var e=Math.abs(t);return e>=li?du(t,e,li,"day"):e>=no?du(t,e,no,"hour"):e>=ro?du(t,e,ro,"minute"):e>=to?du(t,e,to,"second"):t+" ms"}i(LN,"fmtLong");function du(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}i(du,"plural")});var Fd=L((MX,kw)=>{function jN(t){r.debug=r,r.default=r,r.coerce=h,r.disable=d,r.enable=o,r.enabled=m,r.humanize=Nw(),r.destroy=v,Object.keys(t).forEach(_=>{r[_]=t[_]}),r.names=[],r.skips=[],r.formatters={};function e(_){let x=0;for(let T=0;T<_.length;T++)x=(x<<5)-x+_.charCodeAt(T),x|=0;return r.colors[Math.abs(x)%r.colors.length]}i(e,"selectColor"),r.selectColor=e;function r(_){let x,T=null,P,S;function D(...E){if(!D.enabled)return;let u=D,f=Number(new Date),c=f-(x||f);u.diff=c,u.prev=x,u.curr=f,x=f,E[0]=r.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let y=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(b,g)=>{if(b==="%%")return"%";y++;let ae=r.formatters[g];if(typeof ae=="function"){let re=E[y];b=ae.call(u,re),E.splice(y,1),y--}return b}),r.formatArgs.call(u,E),(u.log||r.log).apply(u,E)}return i(D,"debug"),D.namespace=_,D.useColors=r.useColors(),D.color=r.selectColor(_),D.extend=n,D.destroy=r.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:i(()=>T!==null?T:(P!==r.namespaces&&(P=r.namespaces,S=r.enabled(_)),S),"get"),set:i(E=>{T=E},"set")}),typeof r.init=="function"&&r.init(D),D}i(r,"createDebug");function n(_,x){let T=r(this.namespace+(typeof x>"u"?":":x)+_);return T.log=this.log,T}i(n,"extend");function o(_){r.save(_),r.namespaces=_,r.names=[],r.skips=[];let x=(typeof _=="string"?_:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let T of x)T[0]==="-"?r.skips.push(T.slice(1)):r.names.push(T)}i(o,"enable");function s(_,x){let T=0,P=0,S=-1,D=0;for(;T<_.length;)if(P<x.length&&(x[P]===_[T]||x[P]==="*"))x[P]==="*"?(S=P,D=T,P++):(T++,P++);else if(S!==-1)P=S+1,D++,T=D;else return!1;for(;P<x.length&&x[P]==="*";)P++;return P===x.length}i(s,"matchesTemplate");function d(){let _=[...r.names,...r.skips.map(x=>"-"+x)].join(",");return r.enable(""),_}i(d,"disable");function m(_){for(let x of r.skips)if(s(_,x))return!1;for(let x of r.names)if(s(_,x))return!0;return!1}i(m,"enabled");function h(_){return _ instanceof Error?_.stack||_.message:_}i(h,"coerce");function v(){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 i(v,"destroy"),r.enable(r.load()),r}i(jN,"setup");kw.exports=jN});var zw=L((jt,pu)=>{jt.formatArgs=BN;jt.save=VN;jt.load=GN;jt.useColors=qN;jt.storage=HN();jt.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`."))}})();jt.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 qN(){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+)/)}i(qN,"useColors");function BN(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+pu.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,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}i(BN,"formatArgs");jt.log=console.debug||console.log||(()=>{});function VN(t){try{t?jt.storage.setItem("debug",t):jt.storage.removeItem("debug")}catch{}}i(VN,"save");function GN(){let t;try{t=jt.storage.getItem("debug")||jt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}i(GN,"load");function HN(){try{return localStorage}catch{}}i(HN,"localstorage");pu.exports=Fd()(jt);var{formatters:WN}=pu.exports;WN.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Mw=L((jX,Uw)=>{"use strict";Uw.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),o=e.indexOf("--");return n!==-1&&(o===-1||n<o)}});var jw=L((qX,Lw)=>{"use strict";var ZN=require("os"),Fw=require("tty"),fr=Mw(),{env:It}=process,Bn;fr("no-color")||fr("no-colors")||fr("color=false")||fr("color=never")?Bn=0:(fr("color")||fr("colors")||fr("color=true")||fr("color=always"))&&(Bn=1);"FORCE_COLOR"in It&&(It.FORCE_COLOR==="true"?Bn=1:It.FORCE_COLOR==="false"?Bn=0:Bn=It.FORCE_COLOR.length===0?1:Math.min(parseInt(It.FORCE_COLOR,10),3));function Ld(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}i(Ld,"translateLevel");function jd(t,e){if(Bn===0)return 0;if(fr("color=16m")||fr("color=full")||fr("color=truecolor"))return 3;if(fr("color=256"))return 2;if(t&&!e&&Bn===void 0)return 0;let r=Bn||0;if(It.TERM==="dumb")return r;if(process.platform==="win32"){let n=ZN.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in It)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in It)||It.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in It)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(It.TEAMCITY_VERSION)?1:0;if(It.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in It){let n=parseInt((It.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(It.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(It.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(It.TERM)||"COLORTERM"in It?1:r}i(jd,"supportsColor");function KN(t){let e=jd(t,t&&t.isTTY);return Ld(e)}i(KN,"getSupportLevel");Lw.exports={supportsColor:KN,stdout:Ld(jd(!0,Fw.isatty(1))),stderr:Ld(jd(!0,Fw.isatty(2)))}});var Bw=L((At,mu)=>{var JN=require("tty"),fu=require("util");At.init=nk;At.log=ek;At.formatArgs=XN;At.save=tk;At.load=rk;At.useColors=YN;At.destroy=fu.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");At.colors=[6,2,3,4,5,1];try{let t=jw();t&&(t.stderr||t).level>=2&&(At.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{}At.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,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 YN(){return"colors"in At.inspectOpts?!!At.inspectOpts.colors:JN.isatty(process.stderr.fd)}i(YN,"useColors");function XN(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
1
|
+
"use strict";var H0=Object.create;var Fo=Object.defineProperty;var W0=Object.getOwnPropertyDescriptor;var Z0=Object.getOwnPropertyNames;var K0=Object.getPrototypeOf,J0=Object.prototype.hasOwnProperty;var i=(t,e)=>Fo(t,"name",{value:e,configurable:!0});var St=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var L=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Rs=(t,e)=>{for(var r in e)Fo(t,r,{get:e[r],enumerable:!0})},qh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Z0(e))!J0.call(t,o)&&o!==r&&Fo(t,o,{get:()=>e[o],enumerable:!(n=W0(e,o))||n.enumerable});return t};var ue=(t,e,r)=>(r=t!=null?H0(K0(t)):{},qh(e||!t||!t.__esModule?Fo(r,"default",{value:t,enumerable:!0}):r,t)),Y0=t=>qh(Fo({},"__esModule",{value:!0}),t);var fy=L((py,Js)=>{(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"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",d="(?:[0-9a-f]+::?)+",m={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${d})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${d})|(?:::)(?:${d})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function h(P,S){if(P.indexOf("::")!==P.lastIndexOf("::"))return null;let D=0,E=-1,u=(P.match(m.zoneIndex)||[])[0],f,c;for(u&&(u=u.substring(1),P=P.replace(/%.+$/,""));(E=P.indexOf(":",E+1))>=0;)D++;if(P.substr(0,2)==="::"&&D--,P.substr(-2,2)==="::"&&D--,D>S)return null;for(c=S-D,f=":";c--;)f+="0:";return P=P.replace("::",f),P[0]===":"&&(P=P.slice(1)),P[P.length-1]===":"&&(P=P.slice(0,-1)),S=(function(){let y=P.split(":"),l=[];for(let b=0;b<y.length;b++)l.push(parseInt(y[b],16));return l})(),{parts:S,zoneId:u}}i(h,"expandIPv6");function v(P,S,D,E){if(P.length!==S.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let u=0,f;for(;E>0;){if(f=D-E,f<0&&(f=0),P[u]>>f!==S[u]>>f)return!1;E-=D,u+=1}return!0}i(v,"matchCIDR");function _(P){if(o.test(P))return parseInt(P,16);if(P[0]==="0"&&!isNaN(parseInt(P[1],10))){if(n.test(P))return parseInt(P,8);throw new Error(`ipaddr: cannot parse ${P} as octal`)}return parseInt(P,10)}i(_,"parseIntAuto");function x(P,S){for(;P.length<S;)P=`0${P}`;return P}i(x,"padPart");let T={};T.IPv4=(function(){function P(S){if(S.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let D,E;for(D=0;D<S.length;D++)if(E=S[D],!(0<=E&&E<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=S}return i(P,"IPv4"),P.prototype.SpecialRanges={unspecified:[[new P([0,0,0,0]),8]],broadcast:[[new P([255,255,255,255]),32]],multicast:[[new P([224,0,0,0]),4]],linkLocal:[[new P([169,254,0,0]),16]],loopback:[[new P([127,0,0,0]),8]],carrierGradeNat:[[new P([100,64,0,0]),10]],private:[[new P([10,0,0,0]),8],[new P([172,16,0,0]),12],[new P([192,168,0,0]),16]],reserved:[[new P([192,0,0,0]),24],[new P([192,0,2,0]),24],[new P([192,88,99,0]),24],[new P([198,18,0,0]),15],[new P([198,51,100,0]),24],[new P([203,0,113,0]),24],[new P([240,0,0,0]),4]],as112:[[new P([192,175,48,0]),24],[new P([192,31,196,0]),24]],amt:[[new P([192,52,193,0]),24]]},P.prototype.kind=function(){return"ipv4"},P.prototype.match=function(S,D){let E;if(D===void 0&&(E=S,S=E[0],D=E[1]),S.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return v(this.octets,S.octets,8,D)},P.prototype.prefixLengthFromSubnetMask=function(){let S=0,D=!1,E={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},u,f,c;for(u=3;u>=0;u-=1)if(f=this.octets[u],f in E){if(c=E[f],D&&c!==0)return null;c!==8&&(D=!0),S+=c}else return null;return 32-S},P.prototype.range=function(){return T.subnetMatch(this,this.SpecialRanges)},P.prototype.toByteArray=function(){return this.octets.slice(0)},P.prototype.toIPv4MappedAddress=function(){return T.IPv6.parse(`::ffff:${this.toString()}`)},P.prototype.toNormalizedString=function(){return this.toString()},P.prototype.toString=function(){return this.octets.join(".")},P})(),T.IPv4.broadcastAddressFromCIDR=function(P){try{let S=this.parseCIDR(P),D=S[0].toByteArray(),E=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],f=0;for(;f<4;)u.push(parseInt(D[f],10)|parseInt(E[f],10)^255),f++;return new this(u)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},T.IPv4.isIPv4=function(P){return this.parser(P)!==null},T.IPv4.isValid=function(P){try{return new this(this.parser(P)),!0}catch{return!1}},T.IPv4.isValidCIDR=function(P){try{return this.parseCIDR(P),!0}catch{return!1}},T.IPv4.isValidFourPartDecimal=function(P){return!!(T.IPv4.isValid(P)&&P.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},T.IPv4.isValidCIDRFourPartDecimal=function(P){let S=P.match(/^(.+)\/(\d+)$/);return!T.IPv4.isValidCIDR(P)||!S?!1:T.IPv4.isValidFourPartDecimal(S[1])},T.IPv4.networkAddressFromCIDR=function(P){let S,D,E,u,f;try{for(S=this.parseCIDR(P),E=S[0].toByteArray(),f=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],D=0;D<4;)u.push(parseInt(E[D],10)&parseInt(f[D],10)),D++;return new this(u)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},T.IPv4.parse=function(P){let S=this.parser(P);if(S===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(S)},T.IPv4.parseCIDR=function(P){let S;if(S=P.match(/^(.+)\/(\d+)$/)){let D=parseInt(S[2]);if(D>=0&&D<=32){let E=[this.parse(S[1]),D];return Object.defineProperty(E,"toString",{value:i(function(){return this.join("/")},"value")}),E}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},T.IPv4.parser=function(P){let S,D,E;if(S=P.match(r.fourOctet))return(function(){let u=S.slice(1,6),f=[];for(let c=0;c<u.length;c++)D=u[c],f.push(_(D));return f})();if(S=P.match(r.longValue)){if(E=_(S[1]),E>4294967295||E<0)throw new Error("ipaddr: address outside defined range");return(function(){let u=[],f;for(f=0;f<=24;f+=8)u.push(E>>f&255);return u})().reverse()}else return(S=P.match(r.twoOctet))?(function(){let u=S.slice(1,4),f=[];if(E=_(u[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return f.push(_(u[0])),f.push(E>>16&255),f.push(E>>8&255),f.push(E&255),f})():(S=P.match(r.threeOctet))?(function(){let u=S.slice(1,5),f=[];if(E=_(u[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return f.push(_(u[0])),f.push(_(u[1])),f.push(E>>8&255),f.push(E&255),f})():null},T.IPv4.subnetMaskFromPrefixLength=function(P){if(P=parseInt(P),P<0||P>32)throw new Error("ipaddr: invalid IPv4 prefix length");let S=[0,0,0,0],D=0,E=Math.floor(P/8);for(;D<E;)S[D]=255,D++;return E<4&&(S[E]=Math.pow(2,P%8)-1<<8-P%8),new this(S)},T.IPv6=(function(){function P(S,D){let E,u;if(S.length===16)for(this.parts=[],E=0;E<=14;E+=2)this.parts.push(S[E]<<8|S[E+1]);else if(S.length===8)this.parts=S;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(E=0;E<this.parts.length;E++)if(u=this.parts[E],!(0<=u&&u<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");D&&(this.zoneId=D)}return i(P,"IPv6"),P.prototype.SpecialRanges={unspecified:[new P([0,0,0,0,0,0,0,0]),128],linkLocal:[new P([65152,0,0,0,0,0,0,0]),10],multicast:[new P([65280,0,0,0,0,0,0,0]),8],loopback:[new P([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new P([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new P([0,0,0,0,0,65535,0,0]),96],discard:[new P([256,0,0,0,0,0,0,0]),64],rfc6145:[new P([0,0,0,0,65535,0,0,0]),96],rfc6052:[new P([100,65435,0,0,0,0,0,0]),96],"6to4":[new P([8194,0,0,0,0,0,0,0]),16],teredo:[new P([8193,0,0,0,0,0,0,0]),32],benchmarking:[new P([8193,2,0,0,0,0,0,0]),48],amt:[new P([8193,3,0,0,0,0,0,0]),32],as112v6:[[new P([8193,4,274,0,0,0,0,0]),48],[new P([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new P([8193,16,0,0,0,0,0,0]),28],orchid2:[new P([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new P([8193,48,0,0,0,0,0,0]),28],reserved:[[new P([8193,0,0,0,0,0,0,0]),23],[new P([8193,3512,0,0,0,0,0,0]),32]]},P.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},P.prototype.kind=function(){return"ipv6"},P.prototype.match=function(S,D){let E;if(D===void 0&&(E=S,S=E[0],D=E[1]),S.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return v(this.parts,S.parts,16,D)},P.prototype.prefixLengthFromSubnetMask=function(){let S=0,D=!1,E={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},u,f;for(let c=7;c>=0;c-=1)if(u=this.parts[c],u in E){if(f=E[u],D&&f!==0)return null;f!==16&&(D=!0),S+=f}else return null;return 128-S},P.prototype.range=function(){return T.subnetMatch(this,this.SpecialRanges)},P.prototype.toByteArray=function(){let S,D=[],E=this.parts;for(let u=0;u<E.length;u++)S=E[u],D.push(S>>8),D.push(S&255);return D},P.prototype.toFixedLengthString=function(){let S=(function(){let E=[];for(let u=0;u<this.parts.length;u++)E.push(x(this.parts[u].toString(16),4));return E}).call(this).join(":"),D="";return this.zoneId&&(D=`%${this.zoneId}`),S+D},P.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let S=this.parts.slice(-2),D=S[0],E=S[1];return new T.IPv4([D>>8,D&255,E>>8,E&255])},P.prototype.toNormalizedString=function(){let S=(function(){let E=[];for(let u=0;u<this.parts.length;u++)E.push(this.parts[u].toString(16));return E}).call(this).join(":"),D="";return this.zoneId&&(D=`%${this.zoneId}`),S+D},P.prototype.toRFC5952String=function(){let S=/((^|:)(0(:|$)){2,})/g,D=this.toNormalizedString(),E=0,u=-1,f;for(;f=S.exec(D);)f[0].length>u&&(E=f.index,u=f[0].length);return u<0?D:`${D.substring(0,E)}::${D.substring(E+u)}`},P.prototype.toString=function(){return this.toRFC5952String()},P})(),T.IPv6.broadcastAddressFromCIDR=function(P){try{let S=this.parseCIDR(P),D=S[0].toByteArray(),E=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],f=0;for(;f<16;)u.push(parseInt(D[f],10)|parseInt(E[f],10)^255),f++;return new this(u)}catch(S){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${S})`)}},T.IPv6.isIPv6=function(P){return this.parser(P)!==null},T.IPv6.isValid=function(P){if(typeof P=="string"&&P.indexOf(":")===-1)return!1;try{let S=this.parser(P);return new this(S.parts,S.zoneId),!0}catch{return!1}},T.IPv6.isValidCIDR=function(P){if(typeof P=="string"&&P.indexOf(":")===-1)return!1;try{return this.parseCIDR(P),!0}catch{return!1}},T.IPv6.networkAddressFromCIDR=function(P){let S,D,E,u,f;try{for(S=this.parseCIDR(P),E=S[0].toByteArray(),f=this.subnetMaskFromPrefixLength(S[1]).toByteArray(),u=[],D=0;D<16;)u.push(parseInt(E[D],10)&parseInt(f[D],10)),D++;return new this(u)}catch(c){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${c})`)}},T.IPv6.parse=function(P){let S=this.parser(P);if(S.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(S.parts,S.zoneId)},T.IPv6.parseCIDR=function(P){let S,D,E;if((D=P.match(/^(.+)\/(\d+)$/))&&(S=parseInt(D[2]),S>=0&&S<=128))return E=[this.parse(D[1]),S],Object.defineProperty(E,"toString",{value:i(function(){return this.join("/")},"value")}),E;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},T.IPv6.parser=function(P){let S,D,E,u,f,c;if(E=P.match(m.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(m.native.test(P))return h(P,8);if((E=P.match(m.transitional))&&(c=E[6]||"",S=E[1],E[1].endsWith("::")||(S=S.slice(0,-1)),S=h(S+c,6),S.parts)){for(f=[parseInt(E[2]),parseInt(E[3]),parseInt(E[4]),parseInt(E[5])],D=0;D<f.length;D++)if(u=f[D],!(0<=u&&u<=255))return null;return S.parts.push(f[0]<<8|f[1]),S.parts.push(f[2]<<8|f[3]),{parts:S.parts,zoneId:S.zoneId}}return null},T.IPv6.subnetMaskFromPrefixLength=function(P){if(P=parseInt(P),P<0||P>128)throw new Error("ipaddr: invalid IPv6 prefix length");let S=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],D=0,E=Math.floor(P/8);for(;D<E;)S[D]=255,D++;return E<16&&(S[E]=Math.pow(2,P%8)-1<<8-P%8),new this(S)},T.fromByteArray=function(P){let S=P.length;if(S===4)return new T.IPv4(P);if(S===16)return new T.IPv6(P);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},T.isValid=function(P){return T.IPv6.isValid(P)||T.IPv4.isValid(P)},T.isValidCIDR=function(P){return T.IPv6.isValidCIDR(P)||T.IPv4.isValidCIDR(P)},T.parse=function(P){if(T.IPv6.isValid(P))return T.IPv6.parse(P);if(T.IPv4.isValid(P))return T.IPv4.parse(P);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},T.parseCIDR=function(P){try{return T.IPv6.parseCIDR(P)}catch{try{return T.IPv4.parseCIDR(P)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},T.process=function(P){let S=this.parse(P);return S.kind()==="ipv6"&&S.isIPv4MappedAddress()?S.toIPv4Address():S},T.subnetMatch=function(P,S,D){let E,u,f,c;D==null&&(D="unicast");for(u in S)if(Object.prototype.hasOwnProperty.call(S,u)){for(f=S[u],f[0]&&!(f[0]instanceof Array)&&(f=[f]),E=0;E<f.length;E++)if(c=f[E],P.kind()===c[0].kind()&&P.match.apply(P,c))return u}return D},typeof Js<"u"&&Js.exports?Js.exports=T:t.ipaddr=T})(py)});var gv=L((L9,hv)=>{var mv=require("stream").Stream,UO=require("util");hv.exports=Er;function Er(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(Er,"DelayedStream");UO.inherits(Er,mv);Er.create=function(t,e){var r=new this;e=e||{};for(var n in e)r[n]=e[n];r.source=t;var o=t.emit;return t.emit=function(){return r._handleEmit(arguments),o.apply(t,arguments)},t.on("error",function(){}),r.pauseStream&&t.pause(),r};Object.defineProperty(Er.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});Er.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Er.prototype.resume=function(){this._released||this.release(),this.source.resume()};Er.prototype.pause=function(){this.source.pause()};Er.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};Er.prototype.pipe=function(){var t=mv.prototype.pipe.apply(this,arguments);return this.resume(),t};Er.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)};Er.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 wv=L((q9,_v)=>{var MO=require("util"),vv=require("stream").Stream,yv=gv();_v.exports=pt;function pt(){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}i(pt,"CombinedStream");MO.inherits(pt,vv);pt.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};pt.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};pt.prototype.append=function(t){var e=pt.isStreamLike(t);if(e){if(!(t instanceof yv)){var r=yv.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};pt.prototype.pipe=function(t,e){return vv.prototype.pipe.call(this,t,e),this.resume(),t};pt.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}};pt.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=pt.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};pt.prototype._pipeNext=function(t){this._currentStream=t;var e=pt.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()};pt.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};pt.prototype.write=function(t){this.emit("data",t)};pt.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};pt.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")};pt.prototype.end=function(){this._reset(),this.emit("end")};pt.prototype.destroy=function(){this._reset(),this.emit("close")};pt.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};pt.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};pt.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)};pt.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var bv=L((V9,Pv)=>{"use strict";Pv.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 mn=L(Lt=>{"use strict";var tu=bv(),FO=require("path").extname,Tv=/^\s*([^;\s]*)(?:;|\s|$)/,LO=/^text\//i;Lt.charset=Sv;Lt.charsets={lookup:Sv};Lt.contentType=jO;Lt.extension=qO;Lt.extensions=Object.create(null);Lt.lookup=BO;Lt.types=Object.create(null);VO(Lt.extensions,Lt.types);function Sv(t){if(!t||typeof t!="string")return!1;var e=Tv.exec(t),r=e&&tu[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&LO.test(e[1])?"UTF-8":!1}i(Sv,"charset");function jO(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Lt.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Lt.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}i(jO,"contentType");function qO(t){if(!t||typeof t!="string")return!1;var e=Tv.exec(t),r=e&&Lt.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(qO,"extension");function BO(t){if(!t||typeof t!="string")return!1;var e=FO("x."+t).toLowerCase().substr(1);return e&&Lt.types[e]||!1}i(BO,"lookup");function VO(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(tu).forEach(i(function(o){var s=tu[o],d=s.extensions;if(!(!d||!d.length)){t[o]=d;for(var m=0;m<d.length;m++){var h=d[m];if(e[h]){var v=r.indexOf(tu[e[h]].source),_=r.indexOf(s.source);if(e[h]!=="application/octet-stream"&&(v>_||v===_&&e[h].substr(0,12)==="application/"))continue}e[h]=o}}},"forEachMimeType"))}i(VO,"populateMaps")});var xv=L((W9,Ev)=>{Ev.exports=GO;function GO(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}i(GO,"defer")});var pd=L((K9,Av)=>{var Iv=xv();Av.exports=HO;function HO(t){var e=!1;return Iv(function(){e=!0}),i(function(n,o){e?t(n,o):Iv(i(function(){t(n,o)},"nextTick_callback"))},"async_callback")}i(HO,"async")});var fd=L((Y9,Rv)=>{Rv.exports=WO;function WO(t){Object.keys(t.jobs).forEach(ZO.bind(t)),t.jobs={}}i(WO,"abort");function ZO(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}i(ZO,"clean")});var md=L((Q9,$v)=>{var Dv=pd(),KO=fd();$v.exports=JO;function JO(t,e,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=YO(e,o,t[o],function(s,d){o in r.jobs&&(delete r.jobs[o],s?KO(r):r.results[o]=d,n(s,r.results))})}i(JO,"iterate");function YO(t,e,r,n){var o;return t.length==2?o=t(r,Dv(n)):o=t(r,e,Dv(n)),o}i(YO,"runJob")});var hd=L((tY,Ov)=>{Ov.exports=XO;function XO(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(o,s){return e(t[o],t[s])}),n}i(XO,"state")});var gd=L((nY,Cv)=>{var QO=fd(),eC=pd();Cv.exports=tC;function tC(t){Object.keys(this.jobs).length&&(this.index=this.size,QO(this),eC(t)(null,this.results))}i(tC,"terminator")});var kv=L((oY,Nv)=>{var rC=md(),nC=hd(),iC=gd();Nv.exports=oC;function oC(t,e,r){for(var n=nC(t);n.index<(n.keyedList||t).length;)rC(t,e,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return iC.bind(n,r)}i(oC,"parallel")});var yd=L((sY,ru)=>{var zv=md(),aC=hd(),sC=gd();ru.exports=uC;ru.exports.ascending=Uv;ru.exports.descending=cC;function uC(t,e,r,n){var o=aC(t,r);return zv(t,e,o,i(function s(d,m){if(d){n(d,m);return}if(o.index++,o.index<(o.keyedList||t).length){zv(t,e,o,s);return}n(null,o.results)},"iteratorHandler")),sC.bind(o,n)}i(uC,"serialOrdered");function Uv(t,e){return t<e?-1:t>e?1:0}i(Uv,"ascending");function cC(t,e){return-1*Uv(t,e)}i(cC,"descending")});var Fv=L((cY,Mv)=>{var lC=yd();Mv.exports=dC;function dC(t,e,r){return lC(t,e,null,r)}i(dC,"serial")});var jv=L((dY,Lv)=>{Lv.exports={parallel:kv(),serial:Fv(),serialOrdered:yd()}});var vd=L((pY,qv)=>{"use strict";qv.exports=Object});var Vv=L((fY,Bv)=>{"use strict";Bv.exports=Error});var Hv=L((mY,Gv)=>{"use strict";Gv.exports=EvalError});var Zv=L((hY,Wv)=>{"use strict";Wv.exports=RangeError});var Jv=L((gY,Kv)=>{"use strict";Kv.exports=ReferenceError});var Xv=L((yY,Yv)=>{"use strict";Yv.exports=SyntaxError});var jn=L((vY,Qv)=>{"use strict";Qv.exports=TypeError});var t_=L((_Y,e_)=>{"use strict";e_.exports=URIError});var n_=L((wY,r_)=>{"use strict";r_.exports=Math.abs});var o_=L((PY,i_)=>{"use strict";i_.exports=Math.floor});var s_=L((bY,a_)=>{"use strict";a_.exports=Math.max});var c_=L((TY,u_)=>{"use strict";u_.exports=Math.min});var d_=L((SY,l_)=>{"use strict";l_.exports=Math.pow});var f_=L((EY,p_)=>{"use strict";p_.exports=Math.round});var h_=L((xY,m_)=>{"use strict";m_.exports=Number.isNaN||i(function(e){return e!==e},"isNaN")});var y_=L((AY,g_)=>{"use strict";var pC=h_();g_.exports=i(function(e){return pC(e)||e===0?e:e<0?-1:1},"sign")});var __=L((DY,v_)=>{"use strict";v_.exports=Object.getOwnPropertyDescriptor});var _d=L(($Y,w_)=>{"use strict";var nu=__();if(nu)try{nu([],"length")}catch{nu=null}w_.exports=nu});var b_=L((OY,P_)=>{"use strict";var iu=Object.defineProperty||!1;if(iu)try{iu({},"a",{value:1})}catch{iu=!1}P_.exports=iu});var wd=L((CY,T_)=>{"use strict";T_.exports=i(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 o=42;e[r]=o;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 d=Object.getOwnPropertySymbols(e);if(d.length!==1||d[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var m=Object.getOwnPropertyDescriptor(e,r);if(m.value!==o||m.enumerable!==!0)return!1}return!0},"hasSymbols")});var x_=L((kY,E_)=>{"use strict";var S_=typeof Symbol<"u"&&Symbol,fC=wd();E_.exports=i(function(){return typeof S_!="function"||typeof Symbol!="function"||typeof S_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:fC()},"hasNativeSymbols")});var Pd=L((UY,I_)=>{"use strict";I_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var bd=L((MY,A_)=>{"use strict";var mC=vd();A_.exports=mC.getPrototypeOf||null});var $_=L((FY,D_)=>{"use strict";var hC="Function.prototype.bind called on incompatible ",gC=Object.prototype.toString,yC=Math.max,vC="[object Function]",R_=i(function(e,r){for(var n=[],o=0;o<e.length;o+=1)n[o]=e[o];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},"concatty"),_C=i(function(e,r){for(var n=[],o=r||0,s=0;o<e.length;o+=1,s+=1)n[s]=e[o];return n},"slicy"),wC=i(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");D_.exports=i(function(e){var r=this;if(typeof r!="function"||gC.apply(r)!==vC)throw new TypeError(hC+r);for(var n=_C(arguments,1),o,s=i(function(){if(this instanceof o){var _=r.apply(this,R_(n,arguments));return Object(_)===_?_:this}return r.apply(e,R_(n,arguments))},"binder"),d=yC(0,r.length-n.length),m=[],h=0;h<d;h++)m[h]="$"+h;if(o=Function("binder","return function ("+wC(m,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var v=i(function(){},"Empty");v.prototype=r.prototype,o.prototype=new v,v.prototype=null}return o},"bind")});var Ji=L((jY,O_)=>{"use strict";var PC=$_();O_.exports=Function.prototype.bind||PC});var ou=L((qY,C_)=>{"use strict";C_.exports=Function.prototype.call});var Td=L((BY,N_)=>{"use strict";N_.exports=Function.prototype.apply});var z_=L((VY,k_)=>{"use strict";k_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var M_=L((GY,U_)=>{"use strict";var bC=Ji(),TC=Td(),SC=ou(),EC=z_();U_.exports=EC||bC.call(SC,TC)});var Sd=L((HY,F_)=>{"use strict";var xC=Ji(),IC=jn(),AC=ou(),RC=M_();F_.exports=i(function(e){if(e.length<1||typeof e[0]!="function")throw new IC("a function is required");return RC(xC,AC,e)},"callBindBasic")});var G_=L((ZY,V_)=>{"use strict";var DC=Sd(),L_=_d(),q_;try{q_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ed=!!q_&&L_&&L_(Object.prototype,"__proto__"),B_=Object,j_=B_.getPrototypeOf;V_.exports=Ed&&typeof Ed.get=="function"?DC([Ed.get]):typeof j_=="function"?i(function(e){return j_(e==null?e:B_(e))},"getDunder"):!1});var J_=L((JY,K_)=>{"use strict";var H_=Pd(),W_=bd(),Z_=G_();K_.exports=H_?i(function(e){return H_(e)},"getProto"):W_?i(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return W_(e)},"getProto"):Z_?i(function(e){return Z_(e)},"getProto"):null});var xd=L((XY,Y_)=>{"use strict";var $C=Function.prototype.call,OC=Object.prototype.hasOwnProperty,CC=Ji();Y_.exports=CC.call($C,OC)});var ca=L((QY,nw)=>{"use strict";var Le,NC=vd(),kC=Vv(),zC=Hv(),UC=Zv(),MC=Jv(),eo=Xv(),Qi=jn(),FC=t_(),LC=n_(),jC=o_(),qC=s_(),BC=c_(),VC=d_(),GC=f_(),HC=y_(),tw=Function,Id=i(function(t){try{return tw('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),aa=_d(),WC=b_(),Ad=i(function(){throw new Qi},"throwTypeError"),ZC=aa?(function(){try{return arguments.callee,Ad}catch{try{return aa(arguments,"callee").get}catch{return Ad}}})():Ad,Yi=x_()(),xt=J_(),KC=bd(),JC=Pd(),rw=Td(),sa=ou(),Xi={},YC=typeof Uint8Array>"u"||!xt?Le:xt(Uint8Array),ci={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Le:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Le:ArrayBuffer,"%ArrayIteratorPrototype%":Yi&&xt?xt([][Symbol.iterator]()):Le,"%AsyncFromSyncIteratorPrototype%":Le,"%AsyncFunction%":Xi,"%AsyncGenerator%":Xi,"%AsyncGeneratorFunction%":Xi,"%AsyncIteratorPrototype%":Xi,"%Atomics%":typeof Atomics>"u"?Le:Atomics,"%BigInt%":typeof BigInt>"u"?Le:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Le:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Le:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Le:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":kC,"%eval%":eval,"%EvalError%":zC,"%Float16Array%":typeof Float16Array>"u"?Le:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Le:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Le:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Le:FinalizationRegistry,"%Function%":tw,"%GeneratorFunction%":Xi,"%Int8Array%":typeof Int8Array>"u"?Le:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Le:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Le:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Yi&&xt?xt(xt([][Symbol.iterator]())):Le,"%JSON%":typeof JSON=="object"?JSON:Le,"%Map%":typeof Map>"u"?Le:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Yi||!xt?Le:xt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":NC,"%Object.getOwnPropertyDescriptor%":aa,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Le:Promise,"%Proxy%":typeof Proxy>"u"?Le:Proxy,"%RangeError%":UC,"%ReferenceError%":MC,"%Reflect%":typeof Reflect>"u"?Le:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Le:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Yi||!xt?Le:xt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Le:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Yi&&xt?xt(""[Symbol.iterator]()):Le,"%Symbol%":Yi?Symbol:Le,"%SyntaxError%":eo,"%ThrowTypeError%":ZC,"%TypedArray%":YC,"%TypeError%":Qi,"%Uint8Array%":typeof Uint8Array>"u"?Le:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Le:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Le:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Le:Uint32Array,"%URIError%":FC,"%WeakMap%":typeof WeakMap>"u"?Le:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Le:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Le:WeakSet,"%Function.prototype.call%":sa,"%Function.prototype.apply%":rw,"%Object.defineProperty%":WC,"%Object.getPrototypeOf%":KC,"%Math.abs%":LC,"%Math.floor%":jC,"%Math.max%":qC,"%Math.min%":BC,"%Math.pow%":VC,"%Math.round%":GC,"%Math.sign%":HC,"%Reflect.getPrototypeOf%":JC};if(xt)try{null.error}catch(t){X_=xt(xt(t)),ci["%Error.prototype%"]=X_}var X_,XC=i(function t(e){var r;if(e==="%AsyncFunction%")r=Id("async function () {}");else if(e==="%GeneratorFunction%")r=Id("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Id("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&xt&&(r=xt(o.prototype))}return ci[e]=r,r},"doEval"),Q_={__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"]},ua=Ji(),au=xd(),QC=ua.call(sa,Array.prototype.concat),eN=ua.call(rw,Array.prototype.splice),ew=ua.call(sa,String.prototype.replace),su=ua.call(sa,String.prototype.slice),tN=ua.call(sa,RegExp.prototype.exec),rN=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,nN=/\\(\\)?/g,iN=i(function(e){var r=su(e,0,1),n=su(e,-1);if(r==="%"&&n!=="%")throw new eo("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new eo("invalid intrinsic syntax, expected opening `%`");var o=[];return ew(e,rN,function(s,d,m,h){o[o.length]=m?ew(h,nN,"$1"):d||s}),o},"stringToPath"),oN=i(function(e,r){var n=e,o;if(au(Q_,n)&&(o=Q_[n],n="%"+o[0]+"%"),au(ci,n)){var s=ci[n];if(s===Xi&&(s=XC(n)),typeof s>"u"&&!r)throw new Qi("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new eo("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");nw.exports=i(function(e,r){if(typeof e!="string"||e.length===0)throw new Qi("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Qi('"allowMissing" argument must be a boolean');if(tN(/^%?[^%]*%?$/,e)===null)throw new eo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=iN(e),o=n.length>0?n[0]:"",s=oN("%"+o+"%",r),d=s.name,m=s.value,h=!1,v=s.alias;v&&(o=v[0],eN(n,QC([0,1],v)));for(var _=1,x=!0;_<n.length;_+=1){var T=n[_],P=su(T,0,1),S=su(T,-1);if((P==='"'||P==="'"||P==="`"||S==='"'||S==="'"||S==="`")&&P!==S)throw new eo("property names with quotes must have matching quotes");if((T==="constructor"||!x)&&(h=!0),o+="."+T,d="%"+o+"%",au(ci,d))m=ci[d];else if(m!=null){if(!(T in m)){if(!r)throw new Qi("base intrinsic for "+e+" exists, but the property is not available.");return}if(aa&&_+1>=n.length){var D=aa(m,T);x=!!D,x&&"get"in D&&!("originalValue"in D.get)?m=D.get:m=m[T]}else x=au(m,T),m=m[T];x&&!h&&(ci[d]=m)}}return m},"GetIntrinsic")});var ow=L((tX,iw)=>{"use strict";var aN=wd();iw.exports=i(function(){return aN()&&!!Symbol.toStringTag},"hasToStringTagShams")});var uw=L((nX,sw)=>{"use strict";var sN=ca(),aw=sN("%Object.defineProperty%",!0),uN=ow()(),cN=xd(),lN=jn(),uu=uN?Symbol.toStringTag:null;sw.exports=i(function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new lN("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");uu&&(n||!cN(e,uu))&&(aw?aw(e,uu,{configurable:!o,enumerable:!1,value:r,writable:!1}):e[uu]=r)},"setToStringTag")});var lw=L((oX,cw)=>{"use strict";var dN=Function.prototype.call,pN=Object.prototype.hasOwnProperty,fN=Ji();cw.exports=fN.call(dN,pN)});var pw=L((aX,dw)=>{"use strict";dw.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var la=L((sX,mw)=>{"use strict";var Od=wv(),mN=require("util"),Rd=require("path"),hN=require("http"),gN=require("https"),yN=require("url").parse,vN=require("fs"),_N=require("stream").Stream,wN=require("crypto"),Dd=mn(),PN=jv(),bN=uw(),qn=lw(),$d=pw();function fw(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(fw,"escapeHeaderParam");function He(t){if(!(this instanceof He))return new He(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Od.call(this),t=t||{};for(var e in t)this[e]=t[e]}i(He,"FormData");mN.inherits(He,Od);He.LINE_BREAK=`\r
|
|
2
|
+
`;He.DEFAULT_CONTENT_TYPE="application/octet-stream";He.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Od.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 o=this._multiPartHeader(t,e,r),s=this._multiPartFooter();n(o),n(e),n(s),this._trackLength(o,e,r)};He.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)+He.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&qn(e,"httpVersion"))&&!(e instanceof _N))&&(r.knownLength||this._valuesToMeasure.push(e))};He.prototype._lengthRetriever=function(t,e){qn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):vN.stat(t.path,function(r,n){if(r){e(r);return}var o=n.size-(t.start?t.start:0);e(null,o)}):qn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):qn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};He.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),o=this._getContentType(e,r),s="",d={"Content-Disposition":["form-data",'name="'+fw(t)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&$d(d,r.header);var m;for(var h in d)if(qn(d,h)){if(m=d[h],m==null)continue;Array.isArray(m)||(m=[m]),m.length&&(s+=h+": "+m.join("; ")+He.LINE_BREAK)}return"--"+this.getBoundary()+He.LINE_BREAK+s+He.LINE_BREAK};He.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=Rd.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=Rd.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&qn(t,"httpVersion")&&(r=Rd.basename(t.client._httpMessage.path||"")),r)return'filename="'+fw(r)+'"'};He.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&&qn(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=He.DEFAULT_CONTENT_TYPE),r};He.prototype._multiPartFooter=function(){return function(t){var e=He.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};He.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+He.LINE_BREAK};He.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)qn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};He.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};He.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};He.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(He.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};He.prototype._generateBoundary=function(){this._boundary="--------------------------"+wN.randomBytes(12).toString("hex")};He.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};He.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};He.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}PN.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(o){e+=o}),t(null,e)})};He.prototype.submit=function(t,e){var r,n,o={method:"post"};return typeof t=="string"?(t=yN(t),n=$d({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},o)):(n=$d(t,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=gN.request(n):r=hN.request(n),this.getLength(function(s,d){if(s&&s!=="Unknown stream"){this._error(s);return}if(d&&r.setHeader("Content-Length",d),this.pipe(r),e){var m,h=i(function(v,_){return r.removeListener("error",h),r.removeListener("response",m),e.call(this,v,_)},"callback");m=h.bind(this,null),r.on("error",h),r.on("response",m)}}.bind(this)),r};He.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};He.prototype.toString=function(){return"[object FormData]"};bN(He.prototype,"FormData");mw.exports=He});var da=L((OX,xw)=>{"use strict";var cu=Object.prototype.hasOwnProperty,Ew=Object.prototype.toString,_w=Object.defineProperty,ww=Object.getOwnPropertyDescriptor,Pw=i(function(e){return typeof Array.isArray=="function"?Array.isArray(e):Ew.call(e)==="[object Array]"},"isArray"),bw=i(function(e){if(!e||Ew.call(e)!=="[object Object]")return!1;var r=cu.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&cu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var o;for(o in e);return typeof o>"u"||cu.call(e,o)},"isPlainObject"),Tw=i(function(e,r){_w&&r.name==="__proto__"?_w(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),Sw=i(function(e,r){if(r==="__proto__")if(cu.call(e,r)){if(ww)return ww(e,r).value}else return;return e[r]},"getProperty");xw.exports=i(function t(){var e,r,n,o,s,d,m=arguments[0],h=1,v=arguments.length,_=!1;for(typeof m=="boolean"&&(_=m,m=arguments[1]||{},h=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});h<v;++h)if(e=arguments[h],e!=null)for(r in e)n=Sw(m,r),o=Sw(e,r),m!==o&&(_&&o&&(bw(o)||(s=Pw(o)))?(s?(s=!1,d=n&&Pw(n)?n:[]):d=n&&bw(n)?n:{},Tw(m,{name:r,newValue:t(_,d,o)})):typeof o<"u"&&Tw(m,{name:r,newValue:o}));return m},"extend")});var Iw=L((NX,CN)=>{CN.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 Rw=L((kX,Aw)=>{"use strict";var NN=Iw();Aw.exports={pkg:NN}});var kd=L(pr=>{"use strict";var $w=pr&&pr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pr,"__esModule",{value:!0});pr.GaxiosError=pr.GAXIOS_ERROR_SYMBOL=void 0;pr.defaultErrorRedactor=Ow;var Dw=$w(da()),kN=$w(Rw()),Cd=kN.default.pkg;pr.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Cd.name}-gaxios-error`);var Nd=class t extends Error{static{i(this,"GaxiosError")}config;response;code;status;error;[pr.GAXIOS_ERROR_SYMBOL]=Cd.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&pr.GAXIOS_ERROR_SYMBOL in e&&e[pr.GAXIOS_ERROR_SYMBOL]===Cd.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,r,n,o){if(super(e,{cause:o}),this.config=r,this.response=n,this.error=o instanceof Error?o:void 0,this.config=(0,Dw.default)(!0,{},r),this.response&&(this.response.config=(0,Dw.default)(!0,{},this.response.config)),this.response){try{this.response.data=zN(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}o instanceof DOMException?this.code=o.name:o&&typeof o=="object"&&"code"in o&&(typeof o.code=="string"||typeof o.code=="number")&&(this.code=o.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 o="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 d=[];for(let m of e.data.error.errors)typeof m=="object"&&"message"in m&&typeof m.message=="string"&&d.push(m.message);return Object.assign({message:d.join(`
|
|
3
|
+
`)||n,code:s,status:o},e.data.error)}return Object.assign({message:n,code:s,status:o},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};pr.GaxiosError=Nd;function zN(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}}i(zN,"translateData");function Ow(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((d,m)=>{(/^authentication$/i.test(m)||/^authorization$/i.test(m)||/secret/i.test(m))&&s.set(m,e)})}i(r,"redactHeaders");function n(s,d){if(typeof s=="object"&&s!==null&&typeof s[d]=="string"){let m=s[d];(/grant_type=/i.test(m)||/assertion=/i.test(m)||/secret/i.test(m))&&(s[d]=e)}}i(n,"redactString");function o(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((d,m)=>{(["grant_type","assertion"].includes(m)||/secret/.test(m))&&s.set(m,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return i(o,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),o(t.config.data),n(t.config,"body"),o(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&&(Ow({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),o(t.response.data))),t}i(Ow,"defaultErrorRedactor")});var Nw=L(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.getRetryConfig=UN;async function UN(t){let e=Cw(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||MN)(t))return{shouldRetry:!1,config:t.config};let o=FN(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,o):new Promise(d=>{setTimeout(d,o)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}i(UN,"getRetryConfig");function MN(t){let e=Cw(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,o]of e.statusCodesToRetry){let s=t.response.status;if(s>=n&&s<=o){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}i(MN,"shouldRetryRequest");function Cw(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}i(Cw,"getConfig");function FN(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)}i(FN,"getNextRetryDelay")});var Md=L(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.GaxiosInterceptorManager=void 0;var Ud=class extends Set{static{i(this,"GaxiosInterceptorManager")}};lu.GaxiosInterceptorManager=Ud});var zw=L((qX,kw)=>{var to=1e3,ro=to*60,no=ro*60,li=no*24,LN=li*7,jN=li*365.25;kw.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return qN(t);if(r==="number"&&isFinite(t))return e.long?VN(t):BN(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function qN(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*jN;case"weeks":case"week":case"w":return r*LN;case"days":case"day":case"d":return r*li;case"hours":case"hour":case"hrs":case"hr":case"h":return r*no;case"minutes":case"minute":case"mins":case"min":case"m":return r*ro;case"seconds":case"second":case"secs":case"sec":case"s":return r*to;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}i(qN,"parse");function BN(t){var e=Math.abs(t);return e>=li?Math.round(t/li)+"d":e>=no?Math.round(t/no)+"h":e>=ro?Math.round(t/ro)+"m":e>=to?Math.round(t/to)+"s":t+"ms"}i(BN,"fmtShort");function VN(t){var e=Math.abs(t);return e>=li?du(t,e,li,"day"):e>=no?du(t,e,no,"hour"):e>=ro?du(t,e,ro,"minute"):e>=to?du(t,e,to,"second"):t+" ms"}i(VN,"fmtLong");function du(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}i(du,"plural")});var Fd=L((VX,Uw)=>{function GN(t){r.debug=r,r.default=r,r.coerce=h,r.disable=d,r.enable=o,r.enabled=m,r.humanize=zw(),r.destroy=v,Object.keys(t).forEach(_=>{r[_]=t[_]}),r.names=[],r.skips=[],r.formatters={};function e(_){let x=0;for(let T=0;T<_.length;T++)x=(x<<5)-x+_.charCodeAt(T),x|=0;return r.colors[Math.abs(x)%r.colors.length]}i(e,"selectColor"),r.selectColor=e;function r(_){let x,T=null,P,S;function D(...E){if(!D.enabled)return;let u=D,f=Number(new Date),c=f-(x||f);u.diff=c,u.prev=x,u.curr=f,x=f,E[0]=r.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let y=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(b,g)=>{if(b==="%%")return"%";y++;let ae=r.formatters[g];if(typeof ae=="function"){let re=E[y];b=ae.call(u,re),E.splice(y,1),y--}return b}),r.formatArgs.call(u,E),(u.log||r.log).apply(u,E)}return i(D,"debug"),D.namespace=_,D.useColors=r.useColors(),D.color=r.selectColor(_),D.extend=n,D.destroy=r.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:i(()=>T!==null?T:(P!==r.namespaces&&(P=r.namespaces,S=r.enabled(_)),S),"get"),set:i(E=>{T=E},"set")}),typeof r.init=="function"&&r.init(D),D}i(r,"createDebug");function n(_,x){let T=r(this.namespace+(typeof x>"u"?":":x)+_);return T.log=this.log,T}i(n,"extend");function o(_){r.save(_),r.namespaces=_,r.names=[],r.skips=[];let x=(typeof _=="string"?_:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let T of x)T[0]==="-"?r.skips.push(T.slice(1)):r.names.push(T)}i(o,"enable");function s(_,x){let T=0,P=0,S=-1,D=0;for(;T<_.length;)if(P<x.length&&(x[P]===_[T]||x[P]==="*"))x[P]==="*"?(S=P,D=T,P++):(T++,P++);else if(S!==-1)P=S+1,D++,T=D;else return!1;for(;P<x.length&&x[P]==="*";)P++;return P===x.length}i(s,"matchesTemplate");function d(){let _=[...r.names,...r.skips.map(x=>"-"+x)].join(",");return r.enable(""),_}i(d,"disable");function m(_){for(let x of r.skips)if(s(_,x))return!1;for(let x of r.names)if(s(_,x))return!0;return!1}i(m,"enabled");function h(_){return _ instanceof Error?_.stack||_.message:_}i(h,"coerce");function v(){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 i(v,"destroy"),r.enable(r.load()),r}i(GN,"setup");Uw.exports=GN});var Mw=L((jt,pu)=>{jt.formatArgs=WN;jt.save=ZN;jt.load=KN;jt.useColors=HN;jt.storage=JN();jt.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`."))}})();jt.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 HN(){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+)/)}i(HN,"useColors");function WN(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+pu.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,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}i(WN,"formatArgs");jt.log=console.debug||console.log||(()=>{});function ZN(t){try{t?jt.storage.setItem("debug",t):jt.storage.removeItem("debug")}catch{}}i(ZN,"save");function KN(){let t;try{t=jt.storage.getItem("debug")||jt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}i(KN,"load");function JN(){try{return localStorage}catch{}}i(JN,"localstorage");pu.exports=Fd()(jt);var{formatters:YN}=pu.exports;YN.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Lw=L((WX,Fw)=>{"use strict";Fw.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),o=e.indexOf("--");return n!==-1&&(o===-1||n<o)}});var Bw=L((ZX,qw)=>{"use strict";var XN=require("os"),jw=require("tty"),fr=Lw(),{env:It}=process,Bn;fr("no-color")||fr("no-colors")||fr("color=false")||fr("color=never")?Bn=0:(fr("color")||fr("colors")||fr("color=true")||fr("color=always"))&&(Bn=1);"FORCE_COLOR"in It&&(It.FORCE_COLOR==="true"?Bn=1:It.FORCE_COLOR==="false"?Bn=0:Bn=It.FORCE_COLOR.length===0?1:Math.min(parseInt(It.FORCE_COLOR,10),3));function Ld(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}i(Ld,"translateLevel");function jd(t,e){if(Bn===0)return 0;if(fr("color=16m")||fr("color=full")||fr("color=truecolor"))return 3;if(fr("color=256"))return 2;if(t&&!e&&Bn===void 0)return 0;let r=Bn||0;if(It.TERM==="dumb")return r;if(process.platform==="win32"){let n=XN.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in It)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in It)||It.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in It)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(It.TEAMCITY_VERSION)?1:0;if(It.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in It){let n=parseInt((It.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(It.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(It.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(It.TERM)||"COLORTERM"in It?1:r}i(jd,"supportsColor");function QN(t){let e=jd(t,t&&t.isTTY);return Ld(e)}i(QN,"getSupportLevel");qw.exports={supportsColor:QN,stdout:Ld(jd(!0,jw.isatty(1))),stderr:Ld(jd(!0,jw.isatty(2)))}});var Gw=L((At,mu)=>{var ek=require("tty"),fu=require("util");At.init=sk;At.log=ik;At.formatArgs=rk;At.save=ok;At.load=ak;At.useColors=tk;At.destroy=fu.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");At.colors=[6,2,3,4,5,1];try{let t=Bw();t&&(t.stderr||t).level>=2&&(At.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{}At.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,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 tk(){return"colors"in At.inspectOpts?!!At.inspectOpts.colors:ek.isatty(process.stderr.fd)}i(tk,"useColors");function rk(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
4
4
|
`).join(`
|
|
5
|
-
`+s),t.push(o+"m+"+mu.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=
|
|
6
|
-
`)}i(
|
|
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(o+"m+"+mu.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=nk()+e+" "+t[0]}i(rk,"formatArgs");function nk(){return At.inspectOpts.hideDate?"":new Date().toISOString()+" "}i(nk,"getDate");function ik(...t){return process.stderr.write(fu.formatWithOptions(At.inspectOpts,...t)+`
|
|
6
|
+
`)}i(ik,"log");function ok(t){t?process.env.DEBUG=t:delete process.env.DEBUG}i(ok,"save");function ak(){return process.env.DEBUG}i(ak,"load");function sk(t){t.inspectOpts={};let e=Object.keys(At.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=At.inspectOpts[e[r]]}i(sk,"init");mu.exports=Fd()(At);var{formatters:Vw}=mu.exports;Vw.o=function(t){return this.inspectOpts.colors=this.useColors,fu.inspect(t,this.inspectOpts).split(`
|
|
7
|
+
`).map(e=>e.trim()).join(" ")};Vw.O=function(t){return this.inspectOpts.colors=this.useColors,fu.inspect(t,this.inspectOpts)}});var Bd=L((YX,qd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?qd.exports=Mw():qd.exports=Gw()});var Zw=L(qt=>{"use strict";var uk=qt&&qt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ck=qt&&qt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Hw=qt&&qt.__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)&&uk(e,t,r);return ck(e,t),e};Object.defineProperty(qt,"__esModule",{value:!0});qt.req=qt.json=qt.toBuffer=void 0;var lk=Hw(require("http")),dk=Hw(require("https"));async function Ww(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}i(Ww,"toBuffer");qt.toBuffer=Ww;async function pk(t){let r=(await Ww(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}i(pk,"json");qt.json=pk;function fk(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?dk:lk).request(t,e),o=new Promise((s,d)=>{n.once("response",s).once("error",d).end()});return n.then=o.then.bind(o),n}i(fk,"req");qt.req=fk});var Xw=L(Yt=>{"use strict";var Jw=Yt&&Yt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mk=Yt&&Yt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Yw=Yt&&Yt.__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)&&Jw(e,t,r);return mk(e,t),e},hk=Yt&&Yt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Jw(e,t,r)};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.Agent=void 0;var gk=Yw(require("net")),Kw=Yw(require("http")),yk=require("https");hk(Zw(),Yt);var Fr=Symbol("AgentBaseInternalState"),Vd=class extends Kw.Agent{static{i(this,"Agent")}constructor(e){super(e),this[Fr]={}}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 gk.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],o=n.indexOf(r);o!==-1&&(n.splice(o,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?yk.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let o={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(o),d=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,o)).then(m=>{if(this.decrementSockets(s,d),m instanceof Kw.Agent)try{return m.addRequest(e,o)}catch(h){return n(h)}this[Fr].currentSocket=m,super.createSocket(e,r,n)},m=>{this.decrementSockets(s,d),n(m)})}createConnection(){let e=this[Fr].currentSocket;if(this[Fr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Fr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Fr]&&(this[Fr].defaultPort=e)}get protocol(){return this[Fr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Fr]&&(this[Fr].protocol=e)}};Yt.Agent=Vd});var Qw=L(io=>{"use strict";var vk=io&&io.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(io,"__esModule",{value:!0});io.parseProxyResponse=void 0;var _k=vk(Bd()),hu=(0,_k.default)("https-proxy-agent:parse-proxy-response");function wk(t){return new Promise((e,r)=>{let n=0,o=[];function s(){let _=t.read();_?v(_):t.once("readable",s)}i(s,"read");function d(){t.removeListener("end",m),t.removeListener("error",h),t.removeListener("readable",s)}i(d,"cleanup");function m(){d(),hu("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}i(m,"onend");function h(_){d(),hu("onerror %o",_),r(_)}i(h,"onerror");function v(_){o.push(_),n+=_.length;let x=Buffer.concat(o,n),T=x.indexOf(`\r
|
|
9
9
|
\r
|
|
10
10
|
`);if(T===-1){hu("have not received end of HTTP headers yet..."),s();return}let P=x.slice(0,T).toString("ascii").split(`\r
|
|
11
|
-
`),S=P.shift();if(!S)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let D=S.split(" "),E=+D[1],u=D.slice(2).join(" "),f={};for(let c of P){if(!c)continue;let y=c.indexOf(":");if(y===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${c}"`));let l=c.slice(0,y).toLowerCase(),b=c.slice(y+1).trimStart(),g=f[l];typeof g=="string"?f[l]=[g,b]:Array.isArray(g)?g.push(b):f[l]=b}hu("got proxy server response: %o %o",S,f),d(),e({connect:{statusCode:E,statusText:u,headers:f},buffered:x})}i(v,"ondata"),t.on("error",h),t.on("end",m),s()})}i(
|
|
11
|
+
`),S=P.shift();if(!S)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let D=S.split(" "),E=+D[1],u=D.slice(2).join(" "),f={};for(let c of P){if(!c)continue;let y=c.indexOf(":");if(y===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${c}"`));let l=c.slice(0,y).toLowerCase(),b=c.slice(y+1).trimStart(),g=f[l];typeof g=="string"?f[l]=[g,b]:Array.isArray(g)?g.push(b):f[l]=b}hu("got proxy server response: %o %o",S,f),d(),e({connect:{statusCode:E,statusText:u,headers:f},buffered:x})}i(v,"ondata"),t.on("error",h),t.on("end",m),s()})}i(wk,"parseProxyResponse");io.parseProxyResponse=wk});var oP=L(mr=>{"use strict";var Pk=mr&&mr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bk=mr&&mr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),nP=mr&&mr.__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)&&Pk(e,t,r);return bk(e,t),e},iP=mr&&mr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mr,"__esModule",{value:!0});mr.HttpsProxyAgent=void 0;var gu=nP(require("net")),eP=nP(require("tls")),Tk=iP(require("assert")),Sk=iP(Bd()),Ek=Xw(),xk=require("url"),Ik=Qw(),pa=(0,Sk.default)("https-proxy-agent"),tP=i(t=>t.servername===void 0&&t.host&&!gu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),yu=class extends Ek.Agent{static{i(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new xk.URL(e):e,this.proxyHeaders=r?.headers??{},pa("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?rP(r,"headers"):null,host:n,port:o}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let o;n.protocol==="https:"?(pa("Creating `tls.Socket`: %o",this.connectOpts),o=eP.connect(tP(this.connectOpts))):(pa("Creating `net.Socket`: %o",this.connectOpts),o=gu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},d=gu.isIPv6(r.host)?`[${r.host}]`:r.host,m=`CONNECT ${d}:${r.port} HTTP/1.1\r
|
|
12
12
|
`;if(n.username||n.password){let T=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(T).toString("base64")}`}s.Host=`${d}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let T of Object.keys(s))m+=`${T}: ${s[T]}\r
|
|
13
|
-
`;let h=(0,
|
|
14
|
-
`);let{connect:v,buffered:_}=await h;if(e.emit("proxyConnect",v),this.emit("proxyConnect",v,e),v.statusCode===200)return e.once("socket",Sk),r.secureEndpoint?(pa("Upgrading socket connection to TLS"),Xw.connect({...eP(Qw(r),"host","path","port"),socket:o})):o;o.destroy();let x=new gu.Socket({writable:!1});return x.readable=!0,e.once("socket",T=>{pa("Replaying proxy buffer for failed request"),(0,_k.default)(T.listenerCount("data")>0),T.push(_),T.push(null)}),x}};yu.protocols=["http","https"];mr.HttpsProxyAgent=yu;function Sk(t){t.resume()}i(Sk,"resume");function eP(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}i(eP,"omit")});function Ek(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="",o=!1,s=r[0]||"text/plain",d=s;for(let _=1;_<r.length;_++)r[_]==="base64"?o=!0:r[_]&&(d+=`;${r[_]}`,r[_].indexOf("charset=")===0&&(n=r[_].substring(8)));!r[0]&&!n.length&&(d+=";charset=US-ASCII",n="US-ASCII");let m=o?"base64":"ascii",h=unescape(t.substring(e+1)),v=Buffer.from(h,m);return v.type=s,v.typeFull=d,v.charset=n,v}var iP,oP=St(()=>{i(Ek,"dataUriToBuffer");iP=Ek});var sP=L((vu,aP)=>{(function(t,e){typeof vu=="object"&&typeof aP<"u"?e(vu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(vu,(function(t){"use strict";function e(){}i(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}i(r,"typeIsObject");let n=e;function o(a,p){try{Object.defineProperty(a,"name",{value:p,configurable:!0})}catch{}}i(o,"setFunctionName");let s=Promise,d=Promise.prototype.then,m=Promise.reject.bind(s);function h(a){return new s(a)}i(h,"newPromise");function v(a){return h(p=>p(a))}i(v,"promiseResolvedWith");function _(a){return m(a)}i(_,"promiseRejectedWith");function x(a,p,w){return d.call(a,p,w)}i(x,"PerformPromiseThen");function T(a,p,w){x(x(a,p,w),void 0,n)}i(T,"uponPromise");function P(a,p){T(a,p)}i(P,"uponFulfillment");function S(a,p){T(a,void 0,p)}i(S,"uponRejection");function D(a,p,w){return x(a,p,w)}i(D,"transformPromiseWith");function E(a){x(a,void 0,n)}i(E,"setPromiseIsHandledToTrue");let u=i(a=>{if(typeof queueMicrotask=="function")u=queueMicrotask;else{let p=v(void 0);u=i(w=>x(p,w),"_queueMicrotask")}return u(a)},"_queueMicrotask");function f(a,p,w){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,p,w)}i(f,"reflectCall");function c(a,p,w){try{return v(f(a,p,w))}catch(R){return _(R)}}i(c,"promiseCall");let y=16384;class l{static{i(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(p){let w=this._back,R=w;w._elements.length===y-1&&(R={_elements:[],_next:void 0}),w._elements.push(p),R!==w&&(this._back=R,w._next=R),++this._size}shift(){let p=this._front,w=p,R=this._cursor,N=R+1,G=p._elements,K=G[R];return N===y&&(w=p._next,N=0),--this._size,this._cursor=N,p!==w&&(this._front=w),G[R]=void 0,K}forEach(p){let w=this._cursor,R=this._front,N=R._elements;for(;(w!==N.length||R._next!==void 0)&&!(w===N.length&&(R=R._next,N=R._elements,w=0,N.length===0));)p(N[w]),++w}peek(){let p=this._front,w=this._cursor;return p._elements[w]}}let b=Symbol("[[AbortSteps]]"),g=Symbol("[[ErrorSteps]]"),ae=Symbol("[[CancelSteps]]"),re=Symbol("[[PullSteps]]"),Ue=Symbol("[[ReleaseSteps]]");function se(a,p){a._ownerReadableStream=p,p._reader=a,p._state==="readable"?ee(a):p._state==="closed"?de(a):ce(a,p._storedError)}i(se,"ReadableStreamReaderGenericInitialize");function X(a,p){let w=a._ownerReadableStream;return Pr(w,p)}i(X,"ReadableStreamReaderGenericCancel");function Y(a){let p=a._ownerReadableStream;p._state==="readable"?ke(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Me(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),p._readableStreamController[Ue](),p._reader=void 0,a._ownerReadableStream=void 0}i(Y,"ReadableStreamReaderGenericRelease");function ne(a){return new TypeError("Cannot "+a+" a stream using a released reader")}i(ne,"readerLockException");function ee(a){a._closedPromise=h((p,w)=>{a._closedPromise_resolve=p,a._closedPromise_reject=w})}i(ee,"defaultReaderClosedPromiseInitialize");function ce(a,p){ee(a),ke(a,p)}i(ce,"defaultReaderClosedPromiseInitializeAsRejected");function de(a){ee(a),Ke(a)}i(de,"defaultReaderClosedPromiseInitializeAsResolved");function ke(a,p){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(p),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}i(ke,"defaultReaderClosedPromiseReject");function Me(a,p){ce(a,p)}i(Me,"defaultReaderClosedPromiseResetToRejected");function Ke(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}i(Ke,"defaultReaderClosedPromiseResolve");let Qe=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Tt=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function ie(a){return typeof a=="object"||typeof a=="function"}i(ie,"isDictionary");function lt(a,p){if(a!==void 0&&!ie(a))throw new TypeError(`${p} is not an object.`)}i(lt,"assertDictionary");function ft(a,p){if(typeof a!="function")throw new TypeError(`${p} is not a function.`)}i(ft,"assertFunction");function Ht(a){return typeof a=="object"&&a!==null||typeof a=="function"}i(Ht,"isObject");function Ze(a,p){if(!Ht(a))throw new TypeError(`${p} is not an object.`)}i(Ze,"assertObject");function Je(a,p,w){if(a===void 0)throw new TypeError(`Parameter ${p} is required in '${w}'.`)}i(Je,"assertRequiredArgument");function A(a,p,w){if(a===void 0)throw new TypeError(`${p} is required in '${w}'.`)}i(A,"assertRequiredField");function $(a){return Number(a)}i($,"convertUnrestrictedDouble");function C(a){return a===0?0:a}i(C,"censorNegativeZero");function q(a){return C(Tt(a))}i(q,"integerPart");function z(a,p){let R=Number.MAX_SAFE_INTEGER,N=Number(a);if(N=C(N),!Qe(N))throw new TypeError(`${p} is not a finite number`);if(N=q(N),N<0||N>R)throw new TypeError(`${p} is outside the accepted range of 0 to ${R}, inclusive`);return!Qe(N)||N===0?0:N}i(z,"convertUnsignedLongLongWithEnforceRange");function F(a,p){if(!An(a))throw new TypeError(`${p} is not a ReadableStream.`)}i(F,"assertReadableStream");function H(a){return new Q(a)}i(H,"AcquireReadableStreamDefaultReader");function k(a,p){a._reader._readRequests.push(p)}i(k,"ReadableStreamAddReadRequest");function M(a,p,w){let N=a._reader._readRequests.shift();w?N._closeSteps():N._chunkSteps(p)}i(M,"ReadableStreamFulfillReadRequest");function V(a){return a._reader._readRequests.length}i(V,"ReadableStreamGetNumReadRequests");function j(a){let p=a._reader;return!(p===void 0||!pe(p))}i(j,"ReadableStreamHasDefaultReader");class Q{static{i(this,"ReadableStreamDefaultReader")}constructor(p){if(Je(p,1,"ReadableStreamDefaultReader"),F(p,"First parameter"),Rn(p))throw new TypeError("This stream has already been locked for exclusive reading by another reader");se(this,p),this._readRequests=new l}get closed(){return pe(this)?this._closedPromise:_(ot("closed"))}cancel(p=void 0){return pe(this)?this._ownerReadableStream===void 0?_(ne("cancel")):X(this,p):_(ot("cancel"))}read(){if(!pe(this))return _(ot("read"));if(this._ownerReadableStream===void 0)return _(ne("read from"));let p,w,R=h((G,K)=>{p=G,w=K});return he(this,{_chunkSteps:i(G=>p({value:G,done:!1}),"_chunkSteps"),_closeSteps:i(()=>p({value:void 0,done:!0}),"_closeSteps"),_errorSteps:i(G=>w(G),"_errorSteps")}),R}releaseLock(){if(!pe(this))throw ot("releaseLock");this._ownerReadableStream!==void 0&&Ge(this)}}Object.defineProperties(Q.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),o(Q.prototype.cancel,"cancel"),o(Q.prototype.read,"read"),o(Q.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Q.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function pe(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof Q}i(pe,"IsReadableStreamDefaultReader");function he(a,p){let w=a._ownerReadableStream;w._disturbed=!0,w._state==="closed"?p._closeSteps():w._state==="errored"?p._errorSteps(w._storedError):w._readableStreamController[re](p)}i(he,"ReadableStreamDefaultReaderRead");function Ge(a){Y(a);let p=new TypeError("Reader was released");nt(a,p)}i(Ge,"ReadableStreamDefaultReaderRelease");function nt(a,p){let w=a._readRequests;a._readRequests=new l,w.forEach(R=>{R._errorSteps(p)})}i(nt,"ReadableStreamDefaultReaderErrorReadRequests");function ot(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}i(ot,"defaultReaderBrandCheckException");let Be=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class We{static{i(this,"ReadableStreamAsyncIteratorImpl")}constructor(p,w){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=p,this._preventCancel=w}next(){let p=i(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?D(this._ongoingPromise,p,p):p(),this._ongoingPromise}return(p){let w=i(()=>this._returnSteps(p),"returnSteps");return this._ongoingPromise?D(this._ongoingPromise,w,w):w()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let p=this._reader,w,R,N=h((K,le)=>{w=K,R=le});return he(p,{_chunkSteps:i(K=>{this._ongoingPromise=void 0,u(()=>w({value:K,done:!1}))},"_chunkSteps"),_closeSteps:i(()=>{this._ongoingPromise=void 0,this._isFinished=!0,Y(p),w({value:void 0,done:!0})},"_closeSteps"),_errorSteps:i(K=>{this._ongoingPromise=void 0,this._isFinished=!0,Y(p),R(K)},"_errorSteps")}),N}_returnSteps(p){if(this._isFinished)return Promise.resolve({value:p,done:!0});this._isFinished=!0;let w=this._reader;if(!this._preventCancel){let R=X(w,p);return Y(w),D(R,()=>({value:p,done:!0}))}return Y(w),v({value:p,done:!0})}}let wt={next(){return Ei(this)?this._asyncIteratorImpl.next():_(xi("next"))},return(a){return Ei(this)?this._asyncIteratorImpl.return(a):_(xi("return"))}};Object.setPrototypeOf(wt,Be);function Si(a,p){let w=H(a),R=new We(w,p),N=Object.create(wt);return N._asyncIteratorImpl=R,N}i(Si,"AcquireReadableStreamAsyncIterator");function Ei(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof We}catch{return!1}}i(Ei,"IsReadableStreamAsyncIterator");function xi(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}i(xi,"streamAsyncIteratorBrandCheckException");let Wt=Number.isNaN||function(a){return a!==a};var en,Dt,Pt;function Ye(a){return a.slice()}i(Ye,"CreateArrayFromList");function Lm(a,p,w,R,N){new Uint8Array(a).set(new Uint8Array(w,R,N),p)}i(Lm,"CopyDataBlockBytes");let tn=i(a=>(typeof a.transfer=="function"?tn=i(p=>p.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?tn=i(p=>structuredClone(p,{transfer:[p]}),"TransferArrayBuffer"):tn=i(p=>p,"TransferArrayBuffer"),tn(a)),"TransferArrayBuffer"),Sn=i(a=>(typeof a.detached=="boolean"?Sn=i(p=>p.detached,"IsDetachedBuffer"):Sn=i(p=>p.byteLength===0,"IsDetachedBuffer"),Sn(a)),"IsDetachedBuffer");function jm(a,p,w){if(a.slice)return a.slice(p,w);let R=w-p,N=new ArrayBuffer(R);return Lm(N,0,a,p,R),N}i(jm,"ArrayBufferSlice");function rs(a,p){let w=a[p];if(w!=null){if(typeof w!="function")throw new TypeError(`${String(p)} is not a function`);return w}}i(rs,"GetMethod");function cR(a){let p={[Symbol.iterator]:()=>a.iterator},w=(async function*(){return yield*p})(),R=w.next;return{iterator:w,nextMethod:R,done:!1}}i(cR,"CreateAsyncFromSyncIterator");let Jc=(Pt=(en=Symbol.asyncIterator)!==null&&en!==void 0?en:(Dt=Symbol.for)===null||Dt===void 0?void 0:Dt.call(Symbol,"Symbol.asyncIterator"))!==null&&Pt!==void 0?Pt:"@@asyncIterator";function qm(a,p="sync",w){if(w===void 0)if(p==="async"){if(w=rs(a,Jc),w===void 0){let G=rs(a,Symbol.iterator),K=qm(a,"sync",G);return cR(K)}}else w=rs(a,Symbol.iterator);if(w===void 0)throw new TypeError("The object is not iterable");let R=f(w,a,[]);if(!r(R))throw new TypeError("The iterator method must return an object");let N=R.next;return{iterator:R,nextMethod:N,done:!1}}i(qm,"GetIterator");function lR(a){let p=f(a.nextMethod,a.iterator,[]);if(!r(p))throw new TypeError("The iterator.next() method must return an object");return p}i(lR,"IteratorNext");function dR(a){return!!a.done}i(dR,"IteratorComplete");function pR(a){return a.value}i(pR,"IteratorValue");function fR(a){return!(typeof a!="number"||Wt(a)||a<0)}i(fR,"IsNonNegativeNumber");function Bm(a){let p=jm(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(p)}i(Bm,"CloneAsUint8Array");function Yc(a){let p=a._queue.shift();return a._queueTotalSize-=p.size,a._queueTotalSize<0&&(a._queueTotalSize=0),p.value}i(Yc,"DequeueValue");function Xc(a,p,w){if(!fR(w)||w===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:p,size:w}),a._queueTotalSize+=w}i(Xc,"EnqueueValueWithSize");function mR(a){return a._queue.peek().value}i(mR,"PeekQueueValue");function En(a){a._queue=new l,a._queueTotalSize=0}i(En,"ResetQueue");function Vm(a){return a===DataView}i(Vm,"isDataViewConstructor");function hR(a){return Vm(a.constructor)}i(hR,"isDataView");function gR(a){return Vm(a)?1:a.BYTES_PER_ELEMENT}i(gR,"arrayBufferViewElementSize");class Qn{static{i(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Qc(this))throw il("view");return this._view}respond(p){if(!Qc(this))throw il("respond");if(Je(p,1,"respond"),p=z(p,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Sn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");as(this._associatedReadableByteStreamController,p)}respondWithNewView(p){if(!Qc(this))throw il("respondWithNewView");if(Je(p,1,"respondWithNewView"),!ArrayBuffer.isView(p))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Sn(p.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");ss(this._associatedReadableByteStreamController,p)}}Object.defineProperties(Qn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),o(Qn.prototype.respond,"respond"),o(Qn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Qn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class rn{static{i(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ei(this))throw Oo("byobRequest");return nl(this)}get desiredSize(){if(!ei(this))throw Oo("desiredSize");return eh(this)}close(){if(!ei(this))throw Oo("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let p=this._controlledReadableByteStream._state;if(p!=="readable")throw new TypeError(`The stream (in ${p} state) is not in the readable state and cannot be closed`);$o(this)}enqueue(p){if(!ei(this))throw Oo("enqueue");if(Je(p,1,"enqueue"),!ArrayBuffer.isView(p))throw new TypeError("chunk must be an array buffer view");if(p.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(p.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let w=this._controlledReadableByteStream._state;if(w!=="readable")throw new TypeError(`The stream (in ${w} state) is not in the readable state and cannot be enqueued to`);os(this,p)}error(p=void 0){if(!ei(this))throw Oo("error");cr(this,p)}[ae](p){Gm(this),En(this);let w=this._cancelAlgorithm(p);return is(this),w}[re](p){let w=this._controlledReadableByteStream;if(this._queueTotalSize>0){Qm(this,p);return}let R=this._autoAllocateChunkSize;if(R!==void 0){let N;try{N=new ArrayBuffer(R)}catch(K){p._errorSteps(K);return}let G={buffer:N,bufferByteLength:R,byteOffset:0,byteLength:R,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(G)}k(w,p),ti(this)}[Ue](){if(this._pendingPullIntos.length>0){let p=this._pendingPullIntos.peek();p.readerType="none",this._pendingPullIntos=new l,this._pendingPullIntos.push(p)}}}Object.defineProperties(rn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),o(rn.prototype.close,"close"),o(rn.prototype.enqueue,"enqueue"),o(rn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(rn.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function ei(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof rn}i(ei,"IsReadableByteStreamController");function Qc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Qn}i(Qc,"IsReadableStreamBYOBRequest");function ti(a){if(!PR(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let w=a._pullAlgorithm();T(w,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,ti(a)),null),R=>(cr(a,R),null))}i(ti,"ReadableByteStreamControllerCallPullIfNeeded");function Gm(a){tl(a),a._pendingPullIntos=new l}i(Gm,"ReadableByteStreamControllerClearPendingPullIntos");function el(a,p){let w=!1;a._state==="closed"&&(w=!0);let R=Hm(p);p.readerType==="default"?M(a,R,w):IR(a,R,w)}i(el,"ReadableByteStreamControllerCommitPullIntoDescriptor");function Hm(a){let p=a.bytesFilled,w=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,p/w)}i(Hm,"ReadableByteStreamControllerConvertPullIntoDescriptor");function ns(a,p,w,R){a._queue.push({buffer:p,byteOffset:w,byteLength:R}),a._queueTotalSize+=R}i(ns,"ReadableByteStreamControllerEnqueueChunkToQueue");function Wm(a,p,w,R){let N;try{N=jm(p,w,w+R)}catch(G){throw cr(a,G),G}ns(a,N,0,R)}i(Wm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Zm(a,p){p.bytesFilled>0&&Wm(a,p.buffer,p.byteOffset,p.bytesFilled),Ii(a)}i(Zm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function Km(a,p){let w=Math.min(a._queueTotalSize,p.byteLength-p.bytesFilled),R=p.bytesFilled+w,N=w,G=!1,K=R%p.elementSize,le=R-K;le>=p.minimumFill&&(N=le-p.bytesFilled,G=!0);let Se=a._queue;for(;N>0;){let ye=Se.peek(),Oe=Math.min(N,ye.byteLength),Fe=p.byteOffset+p.bytesFilled;Lm(p.buffer,Fe,ye.buffer,ye.byteOffset,Oe),ye.byteLength===Oe?Se.shift():(ye.byteOffset+=Oe,ye.byteLength-=Oe),a._queueTotalSize-=Oe,Jm(a,Oe,p),N-=Oe}return G}i(Km,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function Jm(a,p,w){w.bytesFilled+=p}i(Jm,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Ym(a){a._queueTotalSize===0&&a._closeRequested?(is(a),Mo(a._controlledReadableByteStream)):ti(a)}i(Ym,"ReadableByteStreamControllerHandleQueueDrain");function tl(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}i(tl,"ReadableByteStreamControllerInvalidateBYOBRequest");function rl(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let p=a._pendingPullIntos.peek();Km(a,p)&&(Ii(a),el(a._controlledReadableByteStream,p))}}i(rl,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function yR(a){let p=a._controlledReadableByteStream._reader;for(;p._readRequests.length>0;){if(a._queueTotalSize===0)return;let w=p._readRequests.shift();Qm(a,w)}}i(yR,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function vR(a,p,w,R){let N=a._controlledReadableByteStream,G=p.constructor,K=gR(G),{byteOffset:le,byteLength:Se}=p,ye=w*K,Oe;try{Oe=tn(p.buffer)}catch(et){R._errorSteps(et);return}let Fe={buffer:Oe,bufferByteLength:Oe.byteLength,byteOffset:le,byteLength:Se,bytesFilled:0,minimumFill:ye,elementSize:K,viewConstructor:G,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Fe),nh(N,R);return}if(N._state==="closed"){let et=new G(Fe.buffer,Fe.byteOffset,0);R._closeSteps(et);return}if(a._queueTotalSize>0){if(Km(a,Fe)){let et=Hm(Fe);Ym(a),R._chunkSteps(et);return}if(a._closeRequested){let et=new TypeError("Insufficient bytes to fill elements in the given buffer");cr(a,et),R._errorSteps(et);return}}a._pendingPullIntos.push(Fe),nh(N,R),ti(a)}i(vR,"ReadableByteStreamControllerPullInto");function _R(a,p){p.readerType==="none"&&Ii(a);let w=a._controlledReadableByteStream;if(ol(w))for(;ih(w)>0;){let R=Ii(a);el(w,R)}}i(_R,"ReadableByteStreamControllerRespondInClosedState");function wR(a,p,w){if(Jm(a,p,w),w.readerType==="none"){Zm(a,w),rl(a);return}if(w.bytesFilled<w.minimumFill)return;Ii(a);let R=w.bytesFilled%w.elementSize;if(R>0){let N=w.byteOffset+w.bytesFilled;Wm(a,w.buffer,N-R,R)}w.bytesFilled-=R,el(a._controlledReadableByteStream,w),rl(a)}i(wR,"ReadableByteStreamControllerRespondInReadableState");function Xm(a,p){let w=a._pendingPullIntos.peek();tl(a),a._controlledReadableByteStream._state==="closed"?_R(a,w):wR(a,p,w),ti(a)}i(Xm,"ReadableByteStreamControllerRespondInternal");function Ii(a){return a._pendingPullIntos.shift()}i(Ii,"ReadableByteStreamControllerShiftPendingPullInto");function PR(a){let p=a._controlledReadableByteStream;return p._state!=="readable"||a._closeRequested||!a._started?!1:!!(j(p)&&V(p)>0||ol(p)&&ih(p)>0||eh(a)>0)}i(PR,"ReadableByteStreamControllerShouldCallPull");function is(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}i(is,"ReadableByteStreamControllerClearAlgorithms");function $o(a){let p=a._controlledReadableByteStream;if(!(a._closeRequested||p._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let w=a._pendingPullIntos.peek();if(w.bytesFilled%w.elementSize!==0){let R=new TypeError("Insufficient bytes to fill elements in the given buffer");throw cr(a,R),R}}is(a),Mo(p)}}i($o,"ReadableByteStreamControllerClose");function os(a,p){let w=a._controlledReadableByteStream;if(a._closeRequested||w._state!=="readable")return;let{buffer:R,byteOffset:N,byteLength:G}=p;if(Sn(R))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let K=tn(R);if(a._pendingPullIntos.length>0){let le=a._pendingPullIntos.peek();if(Sn(le.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");tl(a),le.buffer=tn(le.buffer),le.readerType==="none"&&Zm(a,le)}if(j(w))if(yR(a),V(w)===0)ns(a,K,N,G);else{a._pendingPullIntos.length>0&&Ii(a);let le=new Uint8Array(K,N,G);M(w,le,!1)}else ol(w)?(ns(a,K,N,G),rl(a)):ns(a,K,N,G);ti(a)}i(os,"ReadableByteStreamControllerEnqueue");function cr(a,p){let w=a._controlledReadableByteStream;w._state==="readable"&&(Gm(a),En(a),is(a),Ah(w,p))}i(cr,"ReadableByteStreamControllerError");function Qm(a,p){let w=a._queue.shift();a._queueTotalSize-=w.byteLength,Ym(a);let R=new Uint8Array(w.buffer,w.byteOffset,w.byteLength);p._chunkSteps(R)}i(Qm,"ReadableByteStreamControllerFillReadRequestFromQueue");function nl(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let p=a._pendingPullIntos.peek(),w=new Uint8Array(p.buffer,p.byteOffset+p.bytesFilled,p.byteLength-p.bytesFilled),R=Object.create(Qn.prototype);TR(R,a,w),a._byobRequest=R}return a._byobRequest}i(nl,"ReadableByteStreamControllerGetBYOBRequest");function eh(a){let p=a._controlledReadableByteStream._state;return p==="errored"?null:p==="closed"?0:a._strategyHWM-a._queueTotalSize}i(eh,"ReadableByteStreamControllerGetDesiredSize");function as(a,p){let w=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(p!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(p===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(w.bytesFilled+p>w.byteLength)throw new RangeError("bytesWritten out of range")}w.buffer=tn(w.buffer),Xm(a,p)}i(as,"ReadableByteStreamControllerRespond");function ss(a,p){let w=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(p.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(p.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(w.byteOffset+w.bytesFilled!==p.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(w.bufferByteLength!==p.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(w.bytesFilled+p.byteLength>w.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let N=p.byteLength;w.buffer=tn(p.buffer),Xm(a,N)}i(ss,"ReadableByteStreamControllerRespondWithNewView");function th(a,p,w,R,N,G,K){p._controlledReadableByteStream=a,p._pullAgain=!1,p._pulling=!1,p._byobRequest=null,p._queue=p._queueTotalSize=void 0,En(p),p._closeRequested=!1,p._started=!1,p._strategyHWM=G,p._pullAlgorithm=R,p._cancelAlgorithm=N,p._autoAllocateChunkSize=K,p._pendingPullIntos=new l,a._readableStreamController=p;let le=w();T(v(le),()=>(p._started=!0,ti(p),null),Se=>(cr(p,Se),null))}i(th,"SetUpReadableByteStreamController");function bR(a,p,w){let R=Object.create(rn.prototype),N,G,K;p.start!==void 0?N=i(()=>p.start(R),"startAlgorithm"):N=i(()=>{},"startAlgorithm"),p.pull!==void 0?G=i(()=>p.pull(R),"pullAlgorithm"):G=i(()=>v(void 0),"pullAlgorithm"),p.cancel!==void 0?K=i(Se=>p.cancel(Se),"cancelAlgorithm"):K=i(()=>v(void 0),"cancelAlgorithm");let le=p.autoAllocateChunkSize;if(le===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");th(a,R,N,G,K,w,le)}i(bR,"SetUpReadableByteStreamControllerFromUnderlyingSource");function TR(a,p,w){a._associatedReadableByteStreamController=p,a._view=w}i(TR,"SetUpReadableStreamBYOBRequest");function il(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}i(il,"byobRequestBrandCheckException");function Oo(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}i(Oo,"byteStreamControllerBrandCheckException");function SR(a,p){lt(a,p);let w=a?.mode;return{mode:w===void 0?void 0:ER(w,`${p} has member 'mode' that`)}}i(SR,"convertReaderOptions");function ER(a,p){if(a=`${a}`,a!=="byob")throw new TypeError(`${p} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}i(ER,"convertReadableStreamReaderMode");function xR(a,p){var w;lt(a,p);let R=(w=a?.min)!==null&&w!==void 0?w:1;return{min:z(R,`${p} has member 'min' that`)}}i(xR,"convertByobReadOptions");function rh(a){return new xn(a)}i(rh,"AcquireReadableStreamBYOBReader");function nh(a,p){a._reader._readIntoRequests.push(p)}i(nh,"ReadableStreamAddReadIntoRequest");function IR(a,p,w){let N=a._reader._readIntoRequests.shift();w?N._closeSteps(p):N._chunkSteps(p)}i(IR,"ReadableStreamFulfillReadIntoRequest");function ih(a){return a._reader._readIntoRequests.length}i(ih,"ReadableStreamGetNumReadIntoRequests");function ol(a){let p=a._reader;return!(p===void 0||!ri(p))}i(ol,"ReadableStreamHasBYOBReader");class xn{static{i(this,"ReadableStreamBYOBReader")}constructor(p){if(Je(p,1,"ReadableStreamBYOBReader"),F(p,"First parameter"),Rn(p))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ei(p._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");se(this,p),this._readIntoRequests=new l}get closed(){return ri(this)?this._closedPromise:_(us("closed"))}cancel(p=void 0){return ri(this)?this._ownerReadableStream===void 0?_(ne("cancel")):X(this,p):_(us("cancel"))}read(p,w={}){if(!ri(this))return _(us("read"));if(!ArrayBuffer.isView(p))return _(new TypeError("view must be an array buffer view"));if(p.byteLength===0)return _(new TypeError("view must have non-zero byteLength"));if(p.buffer.byteLength===0)return _(new TypeError("view's buffer must have non-zero byteLength"));if(Sn(p.buffer))return _(new TypeError("view's buffer has been detached"));let R;try{R=xR(w,"options")}catch(ye){return _(ye)}let N=R.min;if(N===0)return _(new TypeError("options.min must be greater than 0"));if(hR(p)){if(N>p.byteLength)return _(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(N>p.length)return _(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return _(ne("read from"));let G,K,le=h((ye,Oe)=>{G=ye,K=Oe});return oh(this,p,N,{_chunkSteps:i(ye=>G({value:ye,done:!1}),"_chunkSteps"),_closeSteps:i(ye=>G({value:ye,done:!0}),"_closeSteps"),_errorSteps:i(ye=>K(ye),"_errorSteps")}),le}releaseLock(){if(!ri(this))throw us("releaseLock");this._ownerReadableStream!==void 0&&AR(this)}}Object.defineProperties(xn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),o(xn.prototype.cancel,"cancel"),o(xn.prototype.read,"read"),o(xn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(xn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function ri(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof xn}i(ri,"IsReadableStreamBYOBReader");function oh(a,p,w,R){let N=a._ownerReadableStream;N._disturbed=!0,N._state==="errored"?R._errorSteps(N._storedError):vR(N._readableStreamController,p,w,R)}i(oh,"ReadableStreamBYOBReaderRead");function AR(a){Y(a);let p=new TypeError("Reader was released");ah(a,p)}i(AR,"ReadableStreamBYOBReaderRelease");function ah(a,p){let w=a._readIntoRequests;a._readIntoRequests=new l,w.forEach(R=>{R._errorSteps(p)})}i(ah,"ReadableStreamBYOBReaderErrorReadIntoRequests");function us(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}i(us,"byobReaderBrandCheckException");function Co(a,p){let{highWaterMark:w}=a;if(w===void 0)return p;if(Wt(w)||w<0)throw new RangeError("Invalid highWaterMark");return w}i(Co,"ExtractHighWaterMark");function cs(a){let{size:p}=a;return p||(()=>1)}i(cs,"ExtractSizeAlgorithm");function ls(a,p){lt(a,p);let w=a?.highWaterMark,R=a?.size;return{highWaterMark:w===void 0?void 0:$(w),size:R===void 0?void 0:RR(R,`${p} has member 'size' that`)}}i(ls,"convertQueuingStrategy");function RR(a,p){return ft(a,p),w=>$(a(w))}i(RR,"convertQueuingStrategySize");function DR(a,p){lt(a,p);let w=a?.abort,R=a?.close,N=a?.start,G=a?.type,K=a?.write;return{abort:w===void 0?void 0:$R(w,a,`${p} has member 'abort' that`),close:R===void 0?void 0:OR(R,a,`${p} has member 'close' that`),start:N===void 0?void 0:CR(N,a,`${p} has member 'start' that`),write:K===void 0?void 0:NR(K,a,`${p} has member 'write' that`),type:G}}i(DR,"convertUnderlyingSink");function $R(a,p,w){return ft(a,w),R=>c(a,p,[R])}i($R,"convertUnderlyingSinkAbortCallback");function OR(a,p,w){return ft(a,w),()=>c(a,p,[])}i(OR,"convertUnderlyingSinkCloseCallback");function CR(a,p,w){return ft(a,w),R=>f(a,p,[R])}i(CR,"convertUnderlyingSinkStartCallback");function NR(a,p,w){return ft(a,w),(R,N)=>c(a,p,[R,N])}i(NR,"convertUnderlyingSinkWriteCallback");function sh(a,p){if(!Ai(a))throw new TypeError(`${p} is not a WritableStream.`)}i(sh,"assertWritableStream");function kR(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}i(kR,"isAbortSignal");let zR=typeof AbortController=="function";function UR(){if(zR)return new AbortController}i(UR,"createAbortController");class In{static{i(this,"WritableStream")}constructor(p={},w={}){p===void 0?p=null:Ze(p,"First parameter");let R=ls(w,"Second parameter"),N=DR(p,"First parameter");if(ch(this),N.type!==void 0)throw new RangeError("Invalid type is specified");let K=cs(R),le=Co(R,1);YR(this,N,le,K)}get locked(){if(!Ai(this))throw hs("locked");return Ri(this)}abort(p=void 0){return Ai(this)?Ri(this)?_(new TypeError("Cannot abort a stream that already has a writer")):ds(this,p):_(hs("abort"))}close(){return Ai(this)?Ri(this)?_(new TypeError("Cannot close a stream that already has a writer")):kr(this)?_(new TypeError("Cannot close an already-closing stream")):lh(this):_(hs("close"))}getWriter(){if(!Ai(this))throw hs("getWriter");return uh(this)}}Object.defineProperties(In.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),o(In.prototype.abort,"abort"),o(In.prototype.close,"close"),o(In.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(In.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function uh(a){return new nn(a)}i(uh,"AcquireWritableStreamDefaultWriter");function MR(a,p,w,R,N=1,G=()=>1){let K=Object.create(In.prototype);ch(K);let le=Object.create(Di.prototype);return gh(K,le,a,p,w,R,N,G),K}i(MR,"CreateWritableStream");function ch(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new l,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}i(ch,"InitializeWritableStream");function Ai(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof In}i(Ai,"IsWritableStream");function Ri(a){return a._writer!==void 0}i(Ri,"IsWritableStreamLocked");function ds(a,p){var w;if(a._state==="closed"||a._state==="errored")return v(void 0);a._writableStreamController._abortReason=p,(w=a._writableStreamController._abortController)===null||w===void 0||w.abort(p);let R=a._state;if(R==="closed"||R==="errored")return v(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let N=!1;R==="erroring"&&(N=!0,p=void 0);let G=h((K,le)=>{a._pendingAbortRequest={_promise:void 0,_resolve:K,_reject:le,_reason:p,_wasAlreadyErroring:N}});return a._pendingAbortRequest._promise=G,N||sl(a,p),G}i(ds,"WritableStreamAbort");function lh(a){let p=a._state;if(p==="closed"||p==="errored")return _(new TypeError(`The stream (in ${p} state) is not in the writable state and cannot be closed`));let w=h((N,G)=>{let K={_resolve:N,_reject:G};a._closeRequest=K}),R=a._writer;return R!==void 0&&a._backpressure&&p==="writable"&&hl(R),XR(a._writableStreamController),w}i(lh,"WritableStreamClose");function FR(a){return h((w,R)=>{let N={_resolve:w,_reject:R};a._writeRequests.push(N)})}i(FR,"WritableStreamAddWriteRequest");function al(a,p){if(a._state==="writable"){sl(a,p);return}ul(a)}i(al,"WritableStreamDealWithRejection");function sl(a,p){let w=a._writableStreamController;a._state="erroring",a._storedError=p;let R=a._writer;R!==void 0&&ph(R,p),!VR(a)&&w._started&&ul(a)}i(sl,"WritableStreamStartErroring");function ul(a){a._state="errored",a._writableStreamController[g]();let p=a._storedError;if(a._writeRequests.forEach(N=>{N._reject(p)}),a._writeRequests=new l,a._pendingAbortRequest===void 0){ps(a);return}let w=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,w._wasAlreadyErroring){w._reject(p),ps(a);return}let R=a._writableStreamController[b](w._reason);T(R,()=>(w._resolve(),ps(a),null),N=>(w._reject(N),ps(a),null))}i(ul,"WritableStreamFinishErroring");function LR(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}i(LR,"WritableStreamFinishInFlightWrite");function jR(a,p){a._inFlightWriteRequest._reject(p),a._inFlightWriteRequest=void 0,al(a,p)}i(jR,"WritableStreamFinishInFlightWriteWithError");function qR(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 w=a._writer;w!==void 0&&wh(w)}i(qR,"WritableStreamFinishInFlightClose");function BR(a,p){a._inFlightCloseRequest._reject(p),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(p),a._pendingAbortRequest=void 0),al(a,p)}i(BR,"WritableStreamFinishInFlightCloseWithError");function kr(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}i(kr,"WritableStreamCloseQueuedOrInFlight");function VR(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}i(VR,"WritableStreamHasOperationMarkedInFlight");function GR(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}i(GR,"WritableStreamMarkCloseRequestInFlight");function HR(a){a._inFlightWriteRequest=a._writeRequests.shift()}i(HR,"WritableStreamMarkFirstWriteRequestInFlight");function ps(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let p=a._writer;p!==void 0&&fl(p,a._storedError)}i(ps,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function cl(a,p){let w=a._writer;w!==void 0&&p!==a._backpressure&&(p?o0(w):hl(w)),a._backpressure=p}i(cl,"WritableStreamUpdateBackpressure");class nn{static{i(this,"WritableStreamDefaultWriter")}constructor(p){if(Je(p,1,"WritableStreamDefaultWriter"),sh(p,"First parameter"),Ri(p))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=p,p._writer=this;let w=p._state;if(w==="writable")!kr(p)&&p._backpressure?ys(this):Ph(this),gs(this);else if(w==="erroring")ml(this,p._storedError),gs(this);else if(w==="closed")Ph(this),n0(this);else{let R=p._storedError;ml(this,R),_h(this,R)}}get closed(){return ni(this)?this._closedPromise:_(ii("closed"))}get desiredSize(){if(!ni(this))throw ii("desiredSize");if(this._ownerWritableStream===void 0)throw ko("desiredSize");return JR(this)}get ready(){return ni(this)?this._readyPromise:_(ii("ready"))}abort(p=void 0){return ni(this)?this._ownerWritableStream===void 0?_(ko("abort")):WR(this,p):_(ii("abort"))}close(){if(!ni(this))return _(ii("close"));let p=this._ownerWritableStream;return p===void 0?_(ko("close")):kr(p)?_(new TypeError("Cannot close an already-closing stream")):dh(this)}releaseLock(){if(!ni(this))throw ii("releaseLock");this._ownerWritableStream!==void 0&&fh(this)}write(p=void 0){return ni(this)?this._ownerWritableStream===void 0?_(ko("write to")):mh(this,p):_(ii("write"))}}Object.defineProperties(nn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),o(nn.prototype.abort,"abort"),o(nn.prototype.close,"close"),o(nn.prototype.releaseLock,"releaseLock"),o(nn.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(nn.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function ni(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof nn}i(ni,"IsWritableStreamDefaultWriter");function WR(a,p){let w=a._ownerWritableStream;return ds(w,p)}i(WR,"WritableStreamDefaultWriterAbort");function dh(a){let p=a._ownerWritableStream;return lh(p)}i(dh,"WritableStreamDefaultWriterClose");function ZR(a){let p=a._ownerWritableStream,w=p._state;return kr(p)||w==="closed"?v(void 0):w==="errored"?_(p._storedError):dh(a)}i(ZR,"WritableStreamDefaultWriterCloseWithErrorPropagation");function KR(a,p){a._closedPromiseState==="pending"?fl(a,p):i0(a,p)}i(KR,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function ph(a,p){a._readyPromiseState==="pending"?bh(a,p):a0(a,p)}i(ph,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function JR(a){let p=a._ownerWritableStream,w=p._state;return w==="errored"||w==="erroring"?null:w==="closed"?0:yh(p._writableStreamController)}i(JR,"WritableStreamDefaultWriterGetDesiredSize");function fh(a){let p=a._ownerWritableStream,w=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");ph(a,w),KR(a,w),p._writer=void 0,a._ownerWritableStream=void 0}i(fh,"WritableStreamDefaultWriterRelease");function mh(a,p){let w=a._ownerWritableStream,R=w._writableStreamController,N=QR(R,p);if(w!==a._ownerWritableStream)return _(ko("write to"));let G=w._state;if(G==="errored")return _(w._storedError);if(kr(w)||G==="closed")return _(new TypeError("The stream is closing or closed and cannot be written to"));if(G==="erroring")return _(w._storedError);let K=FR(w);return e0(R,p,N),K}i(mh,"WritableStreamDefaultWriterWrite");let hh={};class Di{static{i(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!ll(this))throw pl("abortReason");return this._abortReason}get signal(){if(!ll(this))throw pl("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(p=void 0){if(!ll(this))throw pl("error");this._controlledWritableStream._state==="writable"&&vh(this,p)}[b](p){let w=this._abortAlgorithm(p);return fs(this),w}[g](){En(this)}}Object.defineProperties(Di.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Di.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function ll(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Di}i(ll,"IsWritableStreamDefaultController");function gh(a,p,w,R,N,G,K,le){p._controlledWritableStream=a,a._writableStreamController=p,p._queue=void 0,p._queueTotalSize=void 0,En(p),p._abortReason=void 0,p._abortController=UR(),p._started=!1,p._strategySizeAlgorithm=le,p._strategyHWM=K,p._writeAlgorithm=R,p._closeAlgorithm=N,p._abortAlgorithm=G;let Se=dl(p);cl(a,Se);let ye=w(),Oe=v(ye);T(Oe,()=>(p._started=!0,ms(p),null),Fe=>(p._started=!0,al(a,Fe),null))}i(gh,"SetUpWritableStreamDefaultController");function YR(a,p,w,R){let N=Object.create(Di.prototype),G,K,le,Se;p.start!==void 0?G=i(()=>p.start(N),"startAlgorithm"):G=i(()=>{},"startAlgorithm"),p.write!==void 0?K=i(ye=>p.write(ye,N),"writeAlgorithm"):K=i(()=>v(void 0),"writeAlgorithm"),p.close!==void 0?le=i(()=>p.close(),"closeAlgorithm"):le=i(()=>v(void 0),"closeAlgorithm"),p.abort!==void 0?Se=i(ye=>p.abort(ye),"abortAlgorithm"):Se=i(()=>v(void 0),"abortAlgorithm"),gh(a,N,G,K,le,Se,w,R)}i(YR,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function fs(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}i(fs,"WritableStreamDefaultControllerClearAlgorithms");function XR(a){Xc(a,hh,0),ms(a)}i(XR,"WritableStreamDefaultControllerClose");function QR(a,p){try{return a._strategySizeAlgorithm(p)}catch(w){return No(a,w),1}}i(QR,"WritableStreamDefaultControllerGetChunkSize");function yh(a){return a._strategyHWM-a._queueTotalSize}i(yh,"WritableStreamDefaultControllerGetDesiredSize");function e0(a,p,w){try{Xc(a,p,w)}catch(N){No(a,N);return}let R=a._controlledWritableStream;if(!kr(R)&&R._state==="writable"){let N=dl(a);cl(R,N)}ms(a)}i(e0,"WritableStreamDefaultControllerWrite");function ms(a){let p=a._controlledWritableStream;if(!a._started||p._inFlightWriteRequest!==void 0)return;if(p._state==="erroring"){ul(p);return}if(a._queue.length===0)return;let R=mR(a);R===hh?t0(a):r0(a,R)}i(ms,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function No(a,p){a._controlledWritableStream._state==="writable"&&vh(a,p)}i(No,"WritableStreamDefaultControllerErrorIfNeeded");function t0(a){let p=a._controlledWritableStream;GR(p),Yc(a);let w=a._closeAlgorithm();fs(a),T(w,()=>(qR(p),null),R=>(BR(p,R),null))}i(t0,"WritableStreamDefaultControllerProcessClose");function r0(a,p){let w=a._controlledWritableStream;HR(w);let R=a._writeAlgorithm(p);T(R,()=>{LR(w);let N=w._state;if(Yc(a),!kr(w)&&N==="writable"){let G=dl(a);cl(w,G)}return ms(a),null},N=>(w._state==="writable"&&fs(a),jR(w,N),null))}i(r0,"WritableStreamDefaultControllerProcessWrite");function dl(a){return yh(a)<=0}i(dl,"WritableStreamDefaultControllerGetBackpressure");function vh(a,p){let w=a._controlledWritableStream;fs(a),sl(w,p)}i(vh,"WritableStreamDefaultControllerError");function hs(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}i(hs,"streamBrandCheckException$2");function pl(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}i(pl,"defaultControllerBrandCheckException$2");function ii(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}i(ii,"defaultWriterBrandCheckException");function ko(a){return new TypeError("Cannot "+a+" a stream using a released writer")}i(ko,"defaultWriterLockException");function gs(a){a._closedPromise=h((p,w)=>{a._closedPromise_resolve=p,a._closedPromise_reject=w,a._closedPromiseState="pending"})}i(gs,"defaultWriterClosedPromiseInitialize");function _h(a,p){gs(a),fl(a,p)}i(_h,"defaultWriterClosedPromiseInitializeAsRejected");function n0(a){gs(a),wh(a)}i(n0,"defaultWriterClosedPromiseInitializeAsResolved");function fl(a,p){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(p),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}i(fl,"defaultWriterClosedPromiseReject");function i0(a,p){_h(a,p)}i(i0,"defaultWriterClosedPromiseResetToRejected");function wh(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="resolved")}i(wh,"defaultWriterClosedPromiseResolve");function ys(a){a._readyPromise=h((p,w)=>{a._readyPromise_resolve=p,a._readyPromise_reject=w}),a._readyPromiseState="pending"}i(ys,"defaultWriterReadyPromiseInitialize");function ml(a,p){ys(a),bh(a,p)}i(ml,"defaultWriterReadyPromiseInitializeAsRejected");function Ph(a){ys(a),hl(a)}i(Ph,"defaultWriterReadyPromiseInitializeAsResolved");function bh(a,p){a._readyPromise_reject!==void 0&&(E(a._readyPromise),a._readyPromise_reject(p),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}i(bh,"defaultWriterReadyPromiseReject");function o0(a){ys(a)}i(o0,"defaultWriterReadyPromiseReset");function a0(a,p){ml(a,p)}i(a0,"defaultWriterReadyPromiseResetToRejected");function hl(a){a._readyPromise_resolve!==void 0&&(a._readyPromise_resolve(void 0),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="fulfilled")}i(hl,"defaultWriterReadyPromiseResolve");function s0(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}i(s0,"getGlobals");let gl=s0();function u0(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}i(u0,"isDOMExceptionConstructor");function c0(){let a=gl?.DOMException;return u0(a)?a:void 0}i(c0,"getFromGlobal");function l0(){let a=i(function(w,R){this.message=w||"",this.name=R||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return o(a,"DOMException"),a.prototype=Object.create(Error.prototype),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,configurable:!0}),a}i(l0,"createPolyfill");let d0=c0()||l0();function Th(a,p,w,R,N,G){let K=H(a),le=uh(p);a._disturbed=!0;let Se=!1,ye=v(void 0);return h((Oe,Fe)=>{let et;if(G!==void 0){if(et=i(()=>{let _e=G.reason!==void 0?G.reason:new d0("Aborted","AbortError"),je=[];R||je.push(()=>p._state==="writable"?ds(p,_e):v(void 0)),N||je.push(()=>a._state==="readable"?Pr(a,_e):v(void 0)),Ft(()=>Promise.all(je.map(tt=>tt())),!0,_e)},"abortAlgorithm"),G.aborted){et();return}G.addEventListener("abort",et)}function br(){return h((_e,je)=>{function tt(Zt){Zt?_e():x(Ni(),tt,je)}i(tt,"next"),tt(!1)})}i(br,"pipeLoop");function Ni(){return Se?v(!0):x(le._readyPromise,()=>h((_e,je)=>{he(K,{_chunkSteps:i(tt=>{ye=x(mh(le,tt),void 0,e),_e(!1)},"_chunkSteps"),_closeSteps:i(()=>_e(!0),"_closeSteps"),_errorSteps:je})}))}if(i(Ni,"pipeStep"),an(a,K._closedPromise,_e=>(R?lr(!0,_e):Ft(()=>ds(p,_e),!0,_e),null)),an(p,le._closedPromise,_e=>(N?lr(!0,_e):Ft(()=>Pr(a,_e),!0,_e),null)),kt(a,K._closedPromise,()=>(w?lr():Ft(()=>ZR(le)),null)),kr(p)||p._state==="closed"){let _e=new TypeError("the destination writable stream closed before all data could be piped to it");N?lr(!0,_e):Ft(()=>Pr(a,_e),!0,_e)}E(br());function $n(){let _e=ye;return x(ye,()=>_e!==ye?$n():void 0)}i($n,"waitForWritesToFinish");function an(_e,je,tt){_e._state==="errored"?tt(_e._storedError):S(je,tt)}i(an,"isOrBecomesErrored");function kt(_e,je,tt){_e._state==="closed"?tt():P(je,tt)}i(kt,"isOrBecomesClosed");function Ft(_e,je,tt){if(Se)return;Se=!0,p._state==="writable"&&!kr(p)?P($n(),Zt):Zt();function Zt(){return T(_e(),()=>sn(je,tt),ki=>sn(!0,ki)),null}i(Zt,"doTheRest")}i(Ft,"shutdownWithAction");function lr(_e,je){Se||(Se=!0,p._state==="writable"&&!kr(p)?P($n(),()=>sn(_e,je)):sn(_e,je))}i(lr,"shutdown");function sn(_e,je){return fh(le),Y(K),G!==void 0&&G.removeEventListener("abort",et),_e?Fe(je):Oe(void 0),null}i(sn,"finalize")})}i(Th,"ReadableStreamPipeTo");class on{static{i(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!vs(this))throw ws("desiredSize");return yl(this)}close(){if(!vs(this))throw ws("close");if(!Oi(this))throw new TypeError("The stream is not in a state that permits close");oi(this)}enqueue(p=void 0){if(!vs(this))throw ws("enqueue");if(!Oi(this))throw new TypeError("The stream is not in a state that permits enqueue");return $i(this,p)}error(p=void 0){if(!vs(this))throw ws("error");wr(this,p)}[ae](p){En(this);let w=this._cancelAlgorithm(p);return _s(this),w}[re](p){let w=this._controlledReadableStream;if(this._queue.length>0){let R=Yc(this);this._closeRequested&&this._queue.length===0?(_s(this),Mo(w)):zo(this),p._chunkSteps(R)}else k(w,p),zo(this)}[Ue](){}}Object.defineProperties(on.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),o(on.prototype.close,"close"),o(on.prototype.enqueue,"enqueue"),o(on.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(on.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function vs(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof on}i(vs,"IsReadableStreamDefaultController");function zo(a){if(!Sh(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let w=a._pullAlgorithm();T(w,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,zo(a)),null),R=>(wr(a,R),null))}i(zo,"ReadableStreamDefaultControllerCallPullIfNeeded");function Sh(a){let p=a._controlledReadableStream;return!Oi(a)||!a._started?!1:!!(Rn(p)&&V(p)>0||yl(a)>0)}i(Sh,"ReadableStreamDefaultControllerShouldCallPull");function _s(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}i(_s,"ReadableStreamDefaultControllerClearAlgorithms");function oi(a){if(!Oi(a))return;let p=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(_s(a),Mo(p))}i(oi,"ReadableStreamDefaultControllerClose");function $i(a,p){if(!Oi(a))return;let w=a._controlledReadableStream;if(Rn(w)&&V(w)>0)M(w,p,!1);else{let R;try{R=a._strategySizeAlgorithm(p)}catch(N){throw wr(a,N),N}try{Xc(a,p,R)}catch(N){throw wr(a,N),N}}zo(a)}i($i,"ReadableStreamDefaultControllerEnqueue");function wr(a,p){let w=a._controlledReadableStream;w._state==="readable"&&(En(a),_s(a),Ah(w,p))}i(wr,"ReadableStreamDefaultControllerError");function yl(a){let p=a._controlledReadableStream._state;return p==="errored"?null:p==="closed"?0:a._strategyHWM-a._queueTotalSize}i(yl,"ReadableStreamDefaultControllerGetDesiredSize");function p0(a){return!Sh(a)}i(p0,"ReadableStreamDefaultControllerHasBackpressure");function Oi(a){let p=a._controlledReadableStream._state;return!a._closeRequested&&p==="readable"}i(Oi,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Eh(a,p,w,R,N,G,K){p._controlledReadableStream=a,p._queue=void 0,p._queueTotalSize=void 0,En(p),p._started=!1,p._closeRequested=!1,p._pullAgain=!1,p._pulling=!1,p._strategySizeAlgorithm=K,p._strategyHWM=G,p._pullAlgorithm=R,p._cancelAlgorithm=N,a._readableStreamController=p;let le=w();T(v(le),()=>(p._started=!0,zo(p),null),Se=>(wr(p,Se),null))}i(Eh,"SetUpReadableStreamDefaultController");function f0(a,p,w,R){let N=Object.create(on.prototype),G,K,le;p.start!==void 0?G=i(()=>p.start(N),"startAlgorithm"):G=i(()=>{},"startAlgorithm"),p.pull!==void 0?K=i(()=>p.pull(N),"pullAlgorithm"):K=i(()=>v(void 0),"pullAlgorithm"),p.cancel!==void 0?le=i(Se=>p.cancel(Se),"cancelAlgorithm"):le=i(()=>v(void 0),"cancelAlgorithm"),Eh(a,N,G,K,le,w,R)}i(f0,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function ws(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}i(ws,"defaultControllerBrandCheckException$1");function m0(a,p){return ei(a._readableStreamController)?g0(a):h0(a)}i(m0,"ReadableStreamTee");function h0(a,p){let w=H(a),R=!1,N=!1,G=!1,K=!1,le,Se,ye,Oe,Fe,et=h(kt=>{Fe=kt});function br(){return R?(N=!0,v(void 0)):(R=!0,he(w,{_chunkSteps:i(Ft=>{u(()=>{N=!1;let lr=Ft,sn=Ft;G||$i(ye._readableStreamController,lr),K||$i(Oe._readableStreamController,sn),R=!1,N&&br()})},"_chunkSteps"),_closeSteps:i(()=>{R=!1,G||oi(ye._readableStreamController),K||oi(Oe._readableStreamController),(!G||!K)&&Fe(void 0)},"_closeSteps"),_errorSteps:i(()=>{R=!1},"_errorSteps")}),v(void 0))}i(br,"pullAlgorithm");function Ni(kt){if(G=!0,le=kt,K){let Ft=Ye([le,Se]),lr=Pr(a,Ft);Fe(lr)}return et}i(Ni,"cancel1Algorithm");function $n(kt){if(K=!0,Se=kt,G){let Ft=Ye([le,Se]),lr=Pr(a,Ft);Fe(lr)}return et}i($n,"cancel2Algorithm");function an(){}return i(an,"startAlgorithm"),ye=Uo(an,br,Ni),Oe=Uo(an,br,$n),S(w._closedPromise,kt=>(wr(ye._readableStreamController,kt),wr(Oe._readableStreamController,kt),(!G||!K)&&Fe(void 0),null)),[ye,Oe]}i(h0,"ReadableStreamDefaultTee");function g0(a){let p=H(a),w=!1,R=!1,N=!1,G=!1,K=!1,le,Se,ye,Oe,Fe,et=h(_e=>{Fe=_e});function br(_e){S(_e._closedPromise,je=>(_e!==p||(cr(ye._readableStreamController,je),cr(Oe._readableStreamController,je),(!G||!K)&&Fe(void 0)),null))}i(br,"forwardReaderError");function Ni(){ri(p)&&(Y(p),p=H(a),br(p)),he(p,{_chunkSteps:i(je=>{u(()=>{R=!1,N=!1;let tt=je,Zt=je;if(!G&&!K)try{Zt=Bm(je)}catch(ki){cr(ye._readableStreamController,ki),cr(Oe._readableStreamController,ki),Fe(Pr(a,ki));return}G||os(ye._readableStreamController,tt),K||os(Oe._readableStreamController,Zt),w=!1,R?an():N&&kt()})},"_chunkSteps"),_closeSteps:i(()=>{w=!1,G||$o(ye._readableStreamController),K||$o(Oe._readableStreamController),ye._readableStreamController._pendingPullIntos.length>0&&as(ye._readableStreamController,0),Oe._readableStreamController._pendingPullIntos.length>0&&as(Oe._readableStreamController,0),(!G||!K)&&Fe(void 0)},"_closeSteps"),_errorSteps:i(()=>{w=!1},"_errorSteps")})}i(Ni,"pullWithDefaultReader");function $n(_e,je){pe(p)&&(Y(p),p=rh(a),br(p));let tt=je?Oe:ye,Zt=je?ye:Oe;oh(p,_e,1,{_chunkSteps:i(zi=>{u(()=>{R=!1,N=!1;let Ui=je?K:G;if(je?G:K)Ui||ss(tt._readableStreamController,zi);else{let jh;try{jh=Bm(zi)}catch(bl){cr(tt._readableStreamController,bl),cr(Zt._readableStreamController,bl),Fe(Pr(a,bl));return}Ui||ss(tt._readableStreamController,zi),os(Zt._readableStreamController,jh)}w=!1,R?an():N&&kt()})},"_chunkSteps"),_closeSteps:i(zi=>{w=!1;let Ui=je?K:G,As=je?G:K;Ui||$o(tt._readableStreamController),As||$o(Zt._readableStreamController),zi!==void 0&&(Ui||ss(tt._readableStreamController,zi),!As&&Zt._readableStreamController._pendingPullIntos.length>0&&as(Zt._readableStreamController,0)),(!Ui||!As)&&Fe(void 0)},"_closeSteps"),_errorSteps:i(()=>{w=!1},"_errorSteps")})}i($n,"pullWithBYOBReader");function an(){if(w)return R=!0,v(void 0);w=!0;let _e=nl(ye._readableStreamController);return _e===null?Ni():$n(_e._view,!1),v(void 0)}i(an,"pull1Algorithm");function kt(){if(w)return N=!0,v(void 0);w=!0;let _e=nl(Oe._readableStreamController);return _e===null?Ni():$n(_e._view,!0),v(void 0)}i(kt,"pull2Algorithm");function Ft(_e){if(G=!0,le=_e,K){let je=Ye([le,Se]),tt=Pr(a,je);Fe(tt)}return et}i(Ft,"cancel1Algorithm");function lr(_e){if(K=!0,Se=_e,G){let je=Ye([le,Se]),tt=Pr(a,je);Fe(tt)}return et}i(lr,"cancel2Algorithm");function sn(){}return i(sn,"startAlgorithm"),ye=Ih(sn,an,Ft),Oe=Ih(sn,kt,lr),br(p),[ye,Oe]}i(g0,"ReadableByteStreamTee");function y0(a){return r(a)&&typeof a.getReader<"u"}i(y0,"isReadableStreamLike");function v0(a){return y0(a)?w0(a.getReader()):_0(a)}i(v0,"ReadableStreamFrom");function _0(a){let p,w=qm(a,"async"),R=e;function N(){let K;try{K=lR(w)}catch(Se){return _(Se)}let le=v(K);return D(le,Se=>{if(!r(Se))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(dR(Se))oi(p._readableStreamController);else{let Oe=pR(Se);$i(p._readableStreamController,Oe)}})}i(N,"pullAlgorithm");function G(K){let le=w.iterator,Se;try{Se=rs(le,"return")}catch(Fe){return _(Fe)}if(Se===void 0)return v(void 0);let ye;try{ye=f(Se,le,[K])}catch(Fe){return _(Fe)}let Oe=v(ye);return D(Oe,Fe=>{if(!r(Fe))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return i(G,"cancelAlgorithm"),p=Uo(R,N,G,0),p}i(_0,"ReadableStreamFromIterable");function w0(a){let p,w=e;function R(){let G;try{G=a.read()}catch(K){return _(K)}return D(G,K=>{if(!r(K))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(K.done)oi(p._readableStreamController);else{let le=K.value;$i(p._readableStreamController,le)}})}i(R,"pullAlgorithm");function N(G){try{return v(a.cancel(G))}catch(K){return _(K)}}return i(N,"cancelAlgorithm"),p=Uo(w,R,N,0),p}i(w0,"ReadableStreamFromDefaultReader");function P0(a,p){lt(a,p);let w=a,R=w?.autoAllocateChunkSize,N=w?.cancel,G=w?.pull,K=w?.start,le=w?.type;return{autoAllocateChunkSize:R===void 0?void 0:z(R,`${p} has member 'autoAllocateChunkSize' that`),cancel:N===void 0?void 0:b0(N,w,`${p} has member 'cancel' that`),pull:G===void 0?void 0:T0(G,w,`${p} has member 'pull' that`),start:K===void 0?void 0:S0(K,w,`${p} has member 'start' that`),type:le===void 0?void 0:E0(le,`${p} has member 'type' that`)}}i(P0,"convertUnderlyingDefaultOrByteSource");function b0(a,p,w){return ft(a,w),R=>c(a,p,[R])}i(b0,"convertUnderlyingSourceCancelCallback");function T0(a,p,w){return ft(a,w),R=>c(a,p,[R])}i(T0,"convertUnderlyingSourcePullCallback");function S0(a,p,w){return ft(a,w),R=>f(a,p,[R])}i(S0,"convertUnderlyingSourceStartCallback");function E0(a,p){if(a=`${a}`,a!=="bytes")throw new TypeError(`${p} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}i(E0,"convertReadableStreamType");function x0(a,p){return lt(a,p),{preventCancel:!!a?.preventCancel}}i(x0,"convertIteratorOptions");function xh(a,p){lt(a,p);let w=a?.preventAbort,R=a?.preventCancel,N=a?.preventClose,G=a?.signal;return G!==void 0&&I0(G,`${p} has member 'signal' that`),{preventAbort:!!w,preventCancel:!!R,preventClose:!!N,signal:G}}i(xh,"convertPipeOptions");function I0(a,p){if(!kR(a))throw new TypeError(`${p} is not an AbortSignal.`)}i(I0,"assertAbortSignal");function A0(a,p){lt(a,p);let w=a?.readable;A(w,"readable","ReadableWritablePair"),F(w,`${p} has member 'readable' that`);let R=a?.writable;return A(R,"writable","ReadableWritablePair"),sh(R,`${p} has member 'writable' that`),{readable:w,writable:R}}i(A0,"convertReadableWritablePair");class $t{static{i(this,"ReadableStream")}constructor(p={},w={}){p===void 0?p=null:Ze(p,"First parameter");let R=ls(w,"Second parameter"),N=P0(p,"First parameter");if(vl(this),N.type==="bytes"){if(R.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let G=Co(R,0);bR(this,N,G)}else{let G=cs(R),K=Co(R,1);f0(this,N,K,G)}}get locked(){if(!An(this))throw ai("locked");return Rn(this)}cancel(p=void 0){return An(this)?Rn(this)?_(new TypeError("Cannot cancel a stream that already has a reader")):Pr(this,p):_(ai("cancel"))}getReader(p=void 0){if(!An(this))throw ai("getReader");return SR(p,"First parameter").mode===void 0?H(this):rh(this)}pipeThrough(p,w={}){if(!An(this))throw ai("pipeThrough");Je(p,1,"pipeThrough");let R=A0(p,"First parameter"),N=xh(w,"Second parameter");if(Rn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Ri(R.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let G=Th(this,R.writable,N.preventClose,N.preventAbort,N.preventCancel,N.signal);return E(G),R.readable}pipeTo(p,w={}){if(!An(this))return _(ai("pipeTo"));if(p===void 0)return _("Parameter 1 is required in 'pipeTo'.");if(!Ai(p))return _(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let R;try{R=xh(w,"Second parameter")}catch(N){return _(N)}return Rn(this)?_(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ri(p)?_(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Th(this,p,R.preventClose,R.preventAbort,R.preventCancel,R.signal)}tee(){if(!An(this))throw ai("tee");let p=m0(this);return Ye(p)}values(p=void 0){if(!An(this))throw ai("values");let w=x0(p,"First parameter");return Si(this,w.preventCancel)}[Jc](p){return this.values(p)}static from(p){return v0(p)}}Object.defineProperties($t,{from:{enumerable:!0}}),Object.defineProperties($t.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),o($t.from,"from"),o($t.prototype.cancel,"cancel"),o($t.prototype.getReader,"getReader"),o($t.prototype.pipeThrough,"pipeThrough"),o($t.prototype.pipeTo,"pipeTo"),o($t.prototype.tee,"tee"),o($t.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($t.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty($t.prototype,Jc,{value:$t.prototype.values,writable:!0,configurable:!0});function Uo(a,p,w,R=1,N=()=>1){let G=Object.create($t.prototype);vl(G);let K=Object.create(on.prototype);return Eh(G,K,a,p,w,R,N),G}i(Uo,"CreateReadableStream");function Ih(a,p,w){let R=Object.create($t.prototype);vl(R);let N=Object.create(rn.prototype);return th(R,N,a,p,w,0,void 0),R}i(Ih,"CreateReadableByteStream");function vl(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}i(vl,"InitializeReadableStream");function An(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof $t}i(An,"IsReadableStream");function Rn(a){return a._reader!==void 0}i(Rn,"IsReadableStreamLocked");function Pr(a,p){if(a._disturbed=!0,a._state==="closed")return v(void 0);if(a._state==="errored")return _(a._storedError);Mo(a);let w=a._reader;if(w!==void 0&&ri(w)){let N=w._readIntoRequests;w._readIntoRequests=new l,N.forEach(G=>{G._closeSteps(void 0)})}let R=a._readableStreamController[ae](p);return D(R,e)}i(Pr,"ReadableStreamCancel");function Mo(a){a._state="closed";let p=a._reader;if(p!==void 0&&(Ke(p),pe(p))){let w=p._readRequests;p._readRequests=new l,w.forEach(R=>{R._closeSteps()})}}i(Mo,"ReadableStreamClose");function Ah(a,p){a._state="errored",a._storedError=p;let w=a._reader;w!==void 0&&(ke(w,p),pe(w)?nt(w,p):ah(w,p))}i(Ah,"ReadableStreamError");function ai(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}i(ai,"streamBrandCheckException$1");function Rh(a,p){lt(a,p);let w=a?.highWaterMark;return A(w,"highWaterMark","QueuingStrategyInit"),{highWaterMark:$(w)}}i(Rh,"convertQueuingStrategyInit");let Dh=i(a=>a.byteLength,"byteLengthSizeFunction");o(Dh,"size");class Ps{static{i(this,"ByteLengthQueuingStrategy")}constructor(p){Je(p,1,"ByteLengthQueuingStrategy"),p=Rh(p,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=p.highWaterMark}get highWaterMark(){if(!Oh(this))throw $h("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Oh(this))throw $h("size");return Dh}}Object.defineProperties(Ps.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ps.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function $h(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}i($h,"byteLengthBrandCheckException");function Oh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof Ps}i(Oh,"IsByteLengthQueuingStrategy");let Ch=i(()=>1,"countSizeFunction");o(Ch,"size");class bs{static{i(this,"CountQueuingStrategy")}constructor(p){Je(p,1,"CountQueuingStrategy"),p=Rh(p,"First parameter"),this._countQueuingStrategyHighWaterMark=p.highWaterMark}get highWaterMark(){if(!kh(this))throw Nh("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!kh(this))throw Nh("size");return Ch}}Object.defineProperties(bs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bs.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Nh(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}i(Nh,"countBrandCheckException");function kh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof bs}i(kh,"IsCountQueuingStrategy");function R0(a,p){lt(a,p);let w=a?.cancel,R=a?.flush,N=a?.readableType,G=a?.start,K=a?.transform,le=a?.writableType;return{cancel:w===void 0?void 0:C0(w,a,`${p} has member 'cancel' that`),flush:R===void 0?void 0:D0(R,a,`${p} has member 'flush' that`),readableType:N,start:G===void 0?void 0:$0(G,a,`${p} has member 'start' that`),transform:K===void 0?void 0:O0(K,a,`${p} has member 'transform' that`),writableType:le}}i(R0,"convertTransformer");function D0(a,p,w){return ft(a,w),R=>c(a,p,[R])}i(D0,"convertTransformerFlushCallback");function $0(a,p,w){return ft(a,w),R=>f(a,p,[R])}i($0,"convertTransformerStartCallback");function O0(a,p,w){return ft(a,w),(R,N)=>c(a,p,[R,N])}i(O0,"convertTransformerTransformCallback");function C0(a,p,w){return ft(a,w),R=>c(a,p,[R])}i(C0,"convertTransformerCancelCallback");class Ts{static{i(this,"TransformStream")}constructor(p={},w={},R={}){p===void 0&&(p=null);let N=ls(w,"Second parameter"),G=ls(R,"Third parameter"),K=R0(p,"First parameter");if(K.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(K.writableType!==void 0)throw new RangeError("Invalid writableType specified");let le=Co(G,0),Se=cs(G),ye=Co(N,1),Oe=cs(N),Fe,et=h(br=>{Fe=br});N0(this,et,ye,Oe,le,Se),z0(this,K),K.start!==void 0?Fe(K.start(this._transformStreamController)):Fe(void 0)}get readable(){if(!zh(this))throw Lh("readable");return this._readable}get writable(){if(!zh(this))throw Lh("writable");return this._writable}}Object.defineProperties(Ts.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ts.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function N0(a,p,w,R,N,G){function K(){return p}i(K,"startAlgorithm");function le(et){return F0(a,et)}i(le,"writeAlgorithm");function Se(et){return L0(a,et)}i(Se,"abortAlgorithm");function ye(){return j0(a)}i(ye,"closeAlgorithm"),a._writable=MR(K,le,ye,Se,w,R);function Oe(){return q0(a)}i(Oe,"pullAlgorithm");function Fe(et){return B0(a,et)}i(Fe,"cancelAlgorithm"),a._readable=Uo(K,Oe,Fe,N,G),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,Ss(a,!0),a._transformStreamController=void 0}i(N0,"InitializeTransformStream");function zh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof Ts}i(zh,"IsTransformStream");function Uh(a,p){wr(a._readable._readableStreamController,p),_l(a,p)}i(Uh,"TransformStreamError");function _l(a,p){xs(a._transformStreamController),No(a._writable._writableStreamController,p),wl(a)}i(_l,"TransformStreamErrorWritableAndUnblockWrite");function wl(a){a._backpressure&&Ss(a,!1)}i(wl,"TransformStreamUnblockWrite");function Ss(a,p){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=h(w=>{a._backpressureChangePromise_resolve=w}),a._backpressure=p}i(Ss,"TransformStreamSetBackpressure");class Dn{static{i(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Es(this))throw Is("desiredSize");let p=this._controlledTransformStream._readable._readableStreamController;return yl(p)}enqueue(p=void 0){if(!Es(this))throw Is("enqueue");Mh(this,p)}error(p=void 0){if(!Es(this))throw Is("error");U0(this,p)}terminate(){if(!Es(this))throw Is("terminate");M0(this)}}Object.defineProperties(Dn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),o(Dn.prototype.enqueue,"enqueue"),o(Dn.prototype.error,"error"),o(Dn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Dn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function Es(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof Dn}i(Es,"IsTransformStreamDefaultController");function k0(a,p,w,R,N){p._controlledTransformStream=a,a._transformStreamController=p,p._transformAlgorithm=w,p._flushAlgorithm=R,p._cancelAlgorithm=N,p._finishPromise=void 0,p._finishPromise_resolve=void 0,p._finishPromise_reject=void 0}i(k0,"SetUpTransformStreamDefaultController");function z0(a,p){let w=Object.create(Dn.prototype),R,N,G;p.transform!==void 0?R=i(K=>p.transform(K,w),"transformAlgorithm"):R=i(K=>{try{return Mh(w,K),v(void 0)}catch(le){return _(le)}},"transformAlgorithm"),p.flush!==void 0?N=i(()=>p.flush(w),"flushAlgorithm"):N=i(()=>v(void 0),"flushAlgorithm"),p.cancel!==void 0?G=i(K=>p.cancel(K),"cancelAlgorithm"):G=i(()=>v(void 0),"cancelAlgorithm"),k0(a,w,R,N,G)}i(z0,"SetUpTransformStreamDefaultControllerFromTransformer");function xs(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}i(xs,"TransformStreamDefaultControllerClearAlgorithms");function Mh(a,p){let w=a._controlledTransformStream,R=w._readable._readableStreamController;if(!Oi(R))throw new TypeError("Readable side is not in a state that permits enqueue");try{$i(R,p)}catch(G){throw _l(w,G),w._readable._storedError}p0(R)!==w._backpressure&&Ss(w,!0)}i(Mh,"TransformStreamDefaultControllerEnqueue");function U0(a,p){Uh(a._controlledTransformStream,p)}i(U0,"TransformStreamDefaultControllerError");function Fh(a,p){let w=a._transformAlgorithm(p);return D(w,void 0,R=>{throw Uh(a._controlledTransformStream,R),R})}i(Fh,"TransformStreamDefaultControllerPerformTransform");function M0(a){let p=a._controlledTransformStream,w=p._readable._readableStreamController;oi(w);let R=new TypeError("TransformStream terminated");_l(p,R)}i(M0,"TransformStreamDefaultControllerTerminate");function F0(a,p){let w=a._transformStreamController;if(a._backpressure){let R=a._backpressureChangePromise;return D(R,()=>{let N=a._writable;if(N._state==="erroring")throw N._storedError;return Fh(w,p)})}return Fh(w,p)}i(F0,"TransformStreamDefaultSinkWriteAlgorithm");function L0(a,p){let w=a._transformStreamController;if(w._finishPromise!==void 0)return w._finishPromise;let R=a._readable;w._finishPromise=h((G,K)=>{w._finishPromise_resolve=G,w._finishPromise_reject=K});let N=w._cancelAlgorithm(p);return xs(w),T(N,()=>(R._state==="errored"?Ci(w,R._storedError):(wr(R._readableStreamController,p),Pl(w)),null),G=>(wr(R._readableStreamController,G),Ci(w,G),null)),w._finishPromise}i(L0,"TransformStreamDefaultSinkAbortAlgorithm");function j0(a){let p=a._transformStreamController;if(p._finishPromise!==void 0)return p._finishPromise;let w=a._readable;p._finishPromise=h((N,G)=>{p._finishPromise_resolve=N,p._finishPromise_reject=G});let R=p._flushAlgorithm();return xs(p),T(R,()=>(w._state==="errored"?Ci(p,w._storedError):(oi(w._readableStreamController),Pl(p)),null),N=>(wr(w._readableStreamController,N),Ci(p,N),null)),p._finishPromise}i(j0,"TransformStreamDefaultSinkCloseAlgorithm");function q0(a){return Ss(a,!1),a._backpressureChangePromise}i(q0,"TransformStreamDefaultSourcePullAlgorithm");function B0(a,p){let w=a._transformStreamController;if(w._finishPromise!==void 0)return w._finishPromise;let R=a._writable;w._finishPromise=h((G,K)=>{w._finishPromise_resolve=G,w._finishPromise_reject=K});let N=w._cancelAlgorithm(p);return xs(w),T(N,()=>(R._state==="errored"?Ci(w,R._storedError):(No(R._writableStreamController,p),wl(a),Pl(w)),null),G=>(No(R._writableStreamController,G),wl(a),Ci(w,G),null)),w._finishPromise}i(B0,"TransformStreamDefaultSourceCancelAlgorithm");function Is(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}i(Is,"defaultControllerBrandCheckException");function Pl(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}i(Pl,"defaultControllerFinishPromiseResolve");function Ci(a,p){a._finishPromise_reject!==void 0&&(E(a._finishPromise),a._finishPromise_reject(p),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}i(Ci,"defaultControllerFinishPromiseReject");function Lh(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}i(Lh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=Ps,t.CountQueuingStrategy=bs,t.ReadableByteStreamController=rn,t.ReadableStream=$t,t.ReadableStreamBYOBReader=xn,t.ReadableStreamBYOBRequest=Qn,t.ReadableStreamDefaultController=on,t.ReadableStreamDefaultReader=Q,t.TransformStream=Ts,t.TransformStreamDefaultController=Dn,t.WritableStream=In,t.WritableStreamDefaultController=Di,t.WritableStreamDefaultWriter=nn}))});var uP=L(()=>{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,sP())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=i(function(r){let n=0,o=this;return new ReadableStream({type:"bytes",async pull(s){let m=await o.slice(n,Math.min(o.size,n+65536)).arrayBuffer();n+=m.byteLength,s.enqueue(new Uint8Array(m)),n===o.size&&s.close()}})},"name"))}catch{}});async function*Gd(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,o=r.byteOffset+r.byteLength;for(;n!==o;){let s=Math.min(o-n,cP),d=r.buffer.slice(n,n+s);n+=d.byteLength,yield new Uint8Array(d)}}else yield r;else{let n=0,o=r;for(;n!==o.size;){let d=await o.slice(n,Math.min(o.size,n+cP)).arrayBuffer();n+=d.byteLength,yield new Uint8Array(d)}}}var a7,cP,lP,xk,xr,fa=St(()=>{a7=ue(uP(),1);cP=65536;i(Gd,"toIterator");lP=class Hd{static{i(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 d;ArrayBuffer.isView(s)?d=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?d=new Uint8Array(s.slice(0)):s instanceof Hd?d=s:d=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(d)?d.byteLength:d.size,this.#e.push(d)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let o=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(o)?o:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Gd(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 Gd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Gd(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:o}=this,s=e<0?Math.max(o+e,0):Math.min(e,o),d=r<0?Math.max(o+r,0):Math.min(r,o),m=Math.max(d-s,0),h=this.#e,v=[],_=0;for(let T of h){if(_>=m)break;let P=ArrayBuffer.isView(T)?T.byteLength:T.size;if(s&&P<=s)s-=P,d-=P;else{let S;ArrayBuffer.isView(T)?(S=T.subarray(s,Math.min(P,d)),_+=S.byteLength):(S=T.slice(s,Math.min(P,d)),_+=S.size),d-=P,v.push(S),s=0}}let x=new Hd([],{type:String(n).toLowerCase()});return x.#r=m,x.#e=v,x}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(lP.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});xk=lP,xr=xk});var Ik,Ak,Vn,Wd=St(()=>{fa();Ik=class extends xr{static{i(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 o=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(o)||(this.#e=o),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 xr&&/^(File)$/.test(e[Symbol.toStringTag])}},Ak=Ik,Vn=Ak});function fP(t,e=xr){var r=`${dP()}${dP()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],o=`--${r}\r
|
|
13
|
+
`;let h=(0,Ik.parseProxyResponse)(o);o.write(`${m}\r
|
|
14
|
+
`);let{connect:v,buffered:_}=await h;if(e.emit("proxyConnect",v),this.emit("proxyConnect",v,e),v.statusCode===200)return e.once("socket",Ak),r.secureEndpoint?(pa("Upgrading socket connection to TLS"),eP.connect({...rP(tP(r),"host","path","port"),socket:o})):o;o.destroy();let x=new gu.Socket({writable:!1});return x.readable=!0,e.once("socket",T=>{pa("Replaying proxy buffer for failed request"),(0,Tk.default)(T.listenerCount("data")>0),T.push(_),T.push(null)}),x}};yu.protocols=["http","https"];mr.HttpsProxyAgent=yu;function Ak(t){t.resume()}i(Ak,"resume");function rP(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}i(rP,"omit")});function Rk(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="",o=!1,s=r[0]||"text/plain",d=s;for(let _=1;_<r.length;_++)r[_]==="base64"?o=!0:r[_]&&(d+=`;${r[_]}`,r[_].indexOf("charset=")===0&&(n=r[_].substring(8)));!r[0]&&!n.length&&(d+=";charset=US-ASCII",n="US-ASCII");let m=o?"base64":"ascii",h=unescape(t.substring(e+1)),v=Buffer.from(h,m);return v.type=s,v.typeFull=d,v.charset=n,v}var aP,sP=St(()=>{i(Rk,"dataUriToBuffer");aP=Rk});var cP=L((vu,uP)=>{(function(t,e){typeof vu=="object"&&typeof uP<"u"?e(vu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(vu,(function(t){"use strict";function e(){}i(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}i(r,"typeIsObject");let n=e;function o(a,p){try{Object.defineProperty(a,"name",{value:p,configurable:!0})}catch{}}i(o,"setFunctionName");let s=Promise,d=Promise.prototype.then,m=Promise.reject.bind(s);function h(a){return new s(a)}i(h,"newPromise");function v(a){return h(p=>p(a))}i(v,"promiseResolvedWith");function _(a){return m(a)}i(_,"promiseRejectedWith");function x(a,p,w){return d.call(a,p,w)}i(x,"PerformPromiseThen");function T(a,p,w){x(x(a,p,w),void 0,n)}i(T,"uponPromise");function P(a,p){T(a,p)}i(P,"uponFulfillment");function S(a,p){T(a,void 0,p)}i(S,"uponRejection");function D(a,p,w){return x(a,p,w)}i(D,"transformPromiseWith");function E(a){x(a,void 0,n)}i(E,"setPromiseIsHandledToTrue");let u=i(a=>{if(typeof queueMicrotask=="function")u=queueMicrotask;else{let p=v(void 0);u=i(w=>x(p,w),"_queueMicrotask")}return u(a)},"_queueMicrotask");function f(a,p,w){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,p,w)}i(f,"reflectCall");function c(a,p,w){try{return v(f(a,p,w))}catch(R){return _(R)}}i(c,"promiseCall");let y=16384;class l{static{i(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(p){let w=this._back,R=w;w._elements.length===y-1&&(R={_elements:[],_next:void 0}),w._elements.push(p),R!==w&&(this._back=R,w._next=R),++this._size}shift(){let p=this._front,w=p,R=this._cursor,N=R+1,G=p._elements,K=G[R];return N===y&&(w=p._next,N=0),--this._size,this._cursor=N,p!==w&&(this._front=w),G[R]=void 0,K}forEach(p){let w=this._cursor,R=this._front,N=R._elements;for(;(w!==N.length||R._next!==void 0)&&!(w===N.length&&(R=R._next,N=R._elements,w=0,N.length===0));)p(N[w]),++w}peek(){let p=this._front,w=this._cursor;return p._elements[w]}}let b=Symbol("[[AbortSteps]]"),g=Symbol("[[ErrorSteps]]"),ae=Symbol("[[CancelSteps]]"),re=Symbol("[[PullSteps]]"),Ue=Symbol("[[ReleaseSteps]]");function se(a,p){a._ownerReadableStream=p,p._reader=a,p._state==="readable"?ee(a):p._state==="closed"?de(a):ce(a,p._storedError)}i(se,"ReadableStreamReaderGenericInitialize");function X(a,p){let w=a._ownerReadableStream;return Pr(w,p)}i(X,"ReadableStreamReaderGenericCancel");function Y(a){let p=a._ownerReadableStream;p._state==="readable"?ke(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Me(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),p._readableStreamController[Ue](),p._reader=void 0,a._ownerReadableStream=void 0}i(Y,"ReadableStreamReaderGenericRelease");function ne(a){return new TypeError("Cannot "+a+" a stream using a released reader")}i(ne,"readerLockException");function ee(a){a._closedPromise=h((p,w)=>{a._closedPromise_resolve=p,a._closedPromise_reject=w})}i(ee,"defaultReaderClosedPromiseInitialize");function ce(a,p){ee(a),ke(a,p)}i(ce,"defaultReaderClosedPromiseInitializeAsRejected");function de(a){ee(a),Ke(a)}i(de,"defaultReaderClosedPromiseInitializeAsResolved");function ke(a,p){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(p),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}i(ke,"defaultReaderClosedPromiseReject");function Me(a,p){ce(a,p)}i(Me,"defaultReaderClosedPromiseResetToRejected");function Ke(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}i(Ke,"defaultReaderClosedPromiseResolve");let Qe=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Tt=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function ie(a){return typeof a=="object"||typeof a=="function"}i(ie,"isDictionary");function lt(a,p){if(a!==void 0&&!ie(a))throw new TypeError(`${p} is not an object.`)}i(lt,"assertDictionary");function ft(a,p){if(typeof a!="function")throw new TypeError(`${p} is not a function.`)}i(ft,"assertFunction");function Ht(a){return typeof a=="object"&&a!==null||typeof a=="function"}i(Ht,"isObject");function Ze(a,p){if(!Ht(a))throw new TypeError(`${p} is not an object.`)}i(Ze,"assertObject");function Je(a,p,w){if(a===void 0)throw new TypeError(`Parameter ${p} is required in '${w}'.`)}i(Je,"assertRequiredArgument");function A(a,p,w){if(a===void 0)throw new TypeError(`${p} is required in '${w}'.`)}i(A,"assertRequiredField");function $(a){return Number(a)}i($,"convertUnrestrictedDouble");function C(a){return a===0?0:a}i(C,"censorNegativeZero");function q(a){return C(Tt(a))}i(q,"integerPart");function z(a,p){let R=Number.MAX_SAFE_INTEGER,N=Number(a);if(N=C(N),!Qe(N))throw new TypeError(`${p} is not a finite number`);if(N=q(N),N<0||N>R)throw new TypeError(`${p} is outside the accepted range of 0 to ${R}, inclusive`);return!Qe(N)||N===0?0:N}i(z,"convertUnsignedLongLongWithEnforceRange");function F(a,p){if(!An(a))throw new TypeError(`${p} is not a ReadableStream.`)}i(F,"assertReadableStream");function H(a){return new Q(a)}i(H,"AcquireReadableStreamDefaultReader");function k(a,p){a._reader._readRequests.push(p)}i(k,"ReadableStreamAddReadRequest");function M(a,p,w){let N=a._reader._readRequests.shift();w?N._closeSteps():N._chunkSteps(p)}i(M,"ReadableStreamFulfillReadRequest");function V(a){return a._reader._readRequests.length}i(V,"ReadableStreamGetNumReadRequests");function j(a){let p=a._reader;return!(p===void 0||!pe(p))}i(j,"ReadableStreamHasDefaultReader");class Q{static{i(this,"ReadableStreamDefaultReader")}constructor(p){if(Je(p,1,"ReadableStreamDefaultReader"),F(p,"First parameter"),Rn(p))throw new TypeError("This stream has already been locked for exclusive reading by another reader");se(this,p),this._readRequests=new l}get closed(){return pe(this)?this._closedPromise:_(ot("closed"))}cancel(p=void 0){return pe(this)?this._ownerReadableStream===void 0?_(ne("cancel")):X(this,p):_(ot("cancel"))}read(){if(!pe(this))return _(ot("read"));if(this._ownerReadableStream===void 0)return _(ne("read from"));let p,w,R=h((G,K)=>{p=G,w=K});return he(this,{_chunkSteps:i(G=>p({value:G,done:!1}),"_chunkSteps"),_closeSteps:i(()=>p({value:void 0,done:!0}),"_closeSteps"),_errorSteps:i(G=>w(G),"_errorSteps")}),R}releaseLock(){if(!pe(this))throw ot("releaseLock");this._ownerReadableStream!==void 0&&Ge(this)}}Object.defineProperties(Q.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),o(Q.prototype.cancel,"cancel"),o(Q.prototype.read,"read"),o(Q.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Q.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function pe(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof Q}i(pe,"IsReadableStreamDefaultReader");function he(a,p){let w=a._ownerReadableStream;w._disturbed=!0,w._state==="closed"?p._closeSteps():w._state==="errored"?p._errorSteps(w._storedError):w._readableStreamController[re](p)}i(he,"ReadableStreamDefaultReaderRead");function Ge(a){Y(a);let p=new TypeError("Reader was released");nt(a,p)}i(Ge,"ReadableStreamDefaultReaderRelease");function nt(a,p){let w=a._readRequests;a._readRequests=new l,w.forEach(R=>{R._errorSteps(p)})}i(nt,"ReadableStreamDefaultReaderErrorReadRequests");function ot(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}i(ot,"defaultReaderBrandCheckException");let Be=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class We{static{i(this,"ReadableStreamAsyncIteratorImpl")}constructor(p,w){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=p,this._preventCancel=w}next(){let p=i(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?D(this._ongoingPromise,p,p):p(),this._ongoingPromise}return(p){let w=i(()=>this._returnSteps(p),"returnSteps");return this._ongoingPromise?D(this._ongoingPromise,w,w):w()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let p=this._reader,w,R,N=h((K,le)=>{w=K,R=le});return he(p,{_chunkSteps:i(K=>{this._ongoingPromise=void 0,u(()=>w({value:K,done:!1}))},"_chunkSteps"),_closeSteps:i(()=>{this._ongoingPromise=void 0,this._isFinished=!0,Y(p),w({value:void 0,done:!0})},"_closeSteps"),_errorSteps:i(K=>{this._ongoingPromise=void 0,this._isFinished=!0,Y(p),R(K)},"_errorSteps")}),N}_returnSteps(p){if(this._isFinished)return Promise.resolve({value:p,done:!0});this._isFinished=!0;let w=this._reader;if(!this._preventCancel){let R=X(w,p);return Y(w),D(R,()=>({value:p,done:!0}))}return Y(w),v({value:p,done:!0})}}let wt={next(){return Ei(this)?this._asyncIteratorImpl.next():_(xi("next"))},return(a){return Ei(this)?this._asyncIteratorImpl.return(a):_(xi("return"))}};Object.setPrototypeOf(wt,Be);function Si(a,p){let w=H(a),R=new We(w,p),N=Object.create(wt);return N._asyncIteratorImpl=R,N}i(Si,"AcquireReadableStreamAsyncIterator");function Ei(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof We}catch{return!1}}i(Ei,"IsReadableStreamAsyncIterator");function xi(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}i(xi,"streamAsyncIteratorBrandCheckException");let Wt=Number.isNaN||function(a){return a!==a};var en,Dt,Pt;function Ye(a){return a.slice()}i(Ye,"CreateArrayFromList");function Lm(a,p,w,R,N){new Uint8Array(a).set(new Uint8Array(w,R,N),p)}i(Lm,"CopyDataBlockBytes");let tn=i(a=>(typeof a.transfer=="function"?tn=i(p=>p.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?tn=i(p=>structuredClone(p,{transfer:[p]}),"TransferArrayBuffer"):tn=i(p=>p,"TransferArrayBuffer"),tn(a)),"TransferArrayBuffer"),Sn=i(a=>(typeof a.detached=="boolean"?Sn=i(p=>p.detached,"IsDetachedBuffer"):Sn=i(p=>p.byteLength===0,"IsDetachedBuffer"),Sn(a)),"IsDetachedBuffer");function jm(a,p,w){if(a.slice)return a.slice(p,w);let R=w-p,N=new ArrayBuffer(R);return Lm(N,0,a,p,R),N}i(jm,"ArrayBufferSlice");function rs(a,p){let w=a[p];if(w!=null){if(typeof w!="function")throw new TypeError(`${String(p)} is not a function`);return w}}i(rs,"GetMethod");function dR(a){let p={[Symbol.iterator]:()=>a.iterator},w=(async function*(){return yield*p})(),R=w.next;return{iterator:w,nextMethod:R,done:!1}}i(dR,"CreateAsyncFromSyncIterator");let Jc=(Pt=(en=Symbol.asyncIterator)!==null&&en!==void 0?en:(Dt=Symbol.for)===null||Dt===void 0?void 0:Dt.call(Symbol,"Symbol.asyncIterator"))!==null&&Pt!==void 0?Pt:"@@asyncIterator";function qm(a,p="sync",w){if(w===void 0)if(p==="async"){if(w=rs(a,Jc),w===void 0){let G=rs(a,Symbol.iterator),K=qm(a,"sync",G);return dR(K)}}else w=rs(a,Symbol.iterator);if(w===void 0)throw new TypeError("The object is not iterable");let R=f(w,a,[]);if(!r(R))throw new TypeError("The iterator method must return an object");let N=R.next;return{iterator:R,nextMethod:N,done:!1}}i(qm,"GetIterator");function pR(a){let p=f(a.nextMethod,a.iterator,[]);if(!r(p))throw new TypeError("The iterator.next() method must return an object");return p}i(pR,"IteratorNext");function fR(a){return!!a.done}i(fR,"IteratorComplete");function mR(a){return a.value}i(mR,"IteratorValue");function hR(a){return!(typeof a!="number"||Wt(a)||a<0)}i(hR,"IsNonNegativeNumber");function Bm(a){let p=jm(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(p)}i(Bm,"CloneAsUint8Array");function Yc(a){let p=a._queue.shift();return a._queueTotalSize-=p.size,a._queueTotalSize<0&&(a._queueTotalSize=0),p.value}i(Yc,"DequeueValue");function Xc(a,p,w){if(!hR(w)||w===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:p,size:w}),a._queueTotalSize+=w}i(Xc,"EnqueueValueWithSize");function gR(a){return a._queue.peek().value}i(gR,"PeekQueueValue");function En(a){a._queue=new l,a._queueTotalSize=0}i(En,"ResetQueue");function Vm(a){return a===DataView}i(Vm,"isDataViewConstructor");function yR(a){return Vm(a.constructor)}i(yR,"isDataView");function vR(a){return Vm(a)?1:a.BYTES_PER_ELEMENT}i(vR,"arrayBufferViewElementSize");class Qn{static{i(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Qc(this))throw il("view");return this._view}respond(p){if(!Qc(this))throw il("respond");if(Je(p,1,"respond"),p=z(p,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Sn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");as(this._associatedReadableByteStreamController,p)}respondWithNewView(p){if(!Qc(this))throw il("respondWithNewView");if(Je(p,1,"respondWithNewView"),!ArrayBuffer.isView(p))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Sn(p.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");ss(this._associatedReadableByteStreamController,p)}}Object.defineProperties(Qn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),o(Qn.prototype.respond,"respond"),o(Qn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Qn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class rn{static{i(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ei(this))throw Oo("byobRequest");return nl(this)}get desiredSize(){if(!ei(this))throw Oo("desiredSize");return eh(this)}close(){if(!ei(this))throw Oo("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let p=this._controlledReadableByteStream._state;if(p!=="readable")throw new TypeError(`The stream (in ${p} state) is not in the readable state and cannot be closed`);$o(this)}enqueue(p){if(!ei(this))throw Oo("enqueue");if(Je(p,1,"enqueue"),!ArrayBuffer.isView(p))throw new TypeError("chunk must be an array buffer view");if(p.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(p.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let w=this._controlledReadableByteStream._state;if(w!=="readable")throw new TypeError(`The stream (in ${w} state) is not in the readable state and cannot be enqueued to`);os(this,p)}error(p=void 0){if(!ei(this))throw Oo("error");cr(this,p)}[ae](p){Gm(this),En(this);let w=this._cancelAlgorithm(p);return is(this),w}[re](p){let w=this._controlledReadableByteStream;if(this._queueTotalSize>0){Qm(this,p);return}let R=this._autoAllocateChunkSize;if(R!==void 0){let N;try{N=new ArrayBuffer(R)}catch(K){p._errorSteps(K);return}let G={buffer:N,bufferByteLength:R,byteOffset:0,byteLength:R,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(G)}k(w,p),ti(this)}[Ue](){if(this._pendingPullIntos.length>0){let p=this._pendingPullIntos.peek();p.readerType="none",this._pendingPullIntos=new l,this._pendingPullIntos.push(p)}}}Object.defineProperties(rn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),o(rn.prototype.close,"close"),o(rn.prototype.enqueue,"enqueue"),o(rn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(rn.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function ei(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof rn}i(ei,"IsReadableByteStreamController");function Qc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Qn}i(Qc,"IsReadableStreamBYOBRequest");function ti(a){if(!TR(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let w=a._pullAlgorithm();T(w,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,ti(a)),null),R=>(cr(a,R),null))}i(ti,"ReadableByteStreamControllerCallPullIfNeeded");function Gm(a){tl(a),a._pendingPullIntos=new l}i(Gm,"ReadableByteStreamControllerClearPendingPullIntos");function el(a,p){let w=!1;a._state==="closed"&&(w=!0);let R=Hm(p);p.readerType==="default"?M(a,R,w):RR(a,R,w)}i(el,"ReadableByteStreamControllerCommitPullIntoDescriptor");function Hm(a){let p=a.bytesFilled,w=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,p/w)}i(Hm,"ReadableByteStreamControllerConvertPullIntoDescriptor");function ns(a,p,w,R){a._queue.push({buffer:p,byteOffset:w,byteLength:R}),a._queueTotalSize+=R}i(ns,"ReadableByteStreamControllerEnqueueChunkToQueue");function Wm(a,p,w,R){let N;try{N=jm(p,w,w+R)}catch(G){throw cr(a,G),G}ns(a,N,0,R)}i(Wm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Zm(a,p){p.bytesFilled>0&&Wm(a,p.buffer,p.byteOffset,p.bytesFilled),Ii(a)}i(Zm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function Km(a,p){let w=Math.min(a._queueTotalSize,p.byteLength-p.bytesFilled),R=p.bytesFilled+w,N=w,G=!1,K=R%p.elementSize,le=R-K;le>=p.minimumFill&&(N=le-p.bytesFilled,G=!0);let Se=a._queue;for(;N>0;){let ye=Se.peek(),Oe=Math.min(N,ye.byteLength),Fe=p.byteOffset+p.bytesFilled;Lm(p.buffer,Fe,ye.buffer,ye.byteOffset,Oe),ye.byteLength===Oe?Se.shift():(ye.byteOffset+=Oe,ye.byteLength-=Oe),a._queueTotalSize-=Oe,Jm(a,Oe,p),N-=Oe}return G}i(Km,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function Jm(a,p,w){w.bytesFilled+=p}i(Jm,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Ym(a){a._queueTotalSize===0&&a._closeRequested?(is(a),Mo(a._controlledReadableByteStream)):ti(a)}i(Ym,"ReadableByteStreamControllerHandleQueueDrain");function tl(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}i(tl,"ReadableByteStreamControllerInvalidateBYOBRequest");function rl(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let p=a._pendingPullIntos.peek();Km(a,p)&&(Ii(a),el(a._controlledReadableByteStream,p))}}i(rl,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function _R(a){let p=a._controlledReadableByteStream._reader;for(;p._readRequests.length>0;){if(a._queueTotalSize===0)return;let w=p._readRequests.shift();Qm(a,w)}}i(_R,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function wR(a,p,w,R){let N=a._controlledReadableByteStream,G=p.constructor,K=vR(G),{byteOffset:le,byteLength:Se}=p,ye=w*K,Oe;try{Oe=tn(p.buffer)}catch(et){R._errorSteps(et);return}let Fe={buffer:Oe,bufferByteLength:Oe.byteLength,byteOffset:le,byteLength:Se,bytesFilled:0,minimumFill:ye,elementSize:K,viewConstructor:G,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Fe),nh(N,R);return}if(N._state==="closed"){let et=new G(Fe.buffer,Fe.byteOffset,0);R._closeSteps(et);return}if(a._queueTotalSize>0){if(Km(a,Fe)){let et=Hm(Fe);Ym(a),R._chunkSteps(et);return}if(a._closeRequested){let et=new TypeError("Insufficient bytes to fill elements in the given buffer");cr(a,et),R._errorSteps(et);return}}a._pendingPullIntos.push(Fe),nh(N,R),ti(a)}i(wR,"ReadableByteStreamControllerPullInto");function PR(a,p){p.readerType==="none"&&Ii(a);let w=a._controlledReadableByteStream;if(ol(w))for(;ih(w)>0;){let R=Ii(a);el(w,R)}}i(PR,"ReadableByteStreamControllerRespondInClosedState");function bR(a,p,w){if(Jm(a,p,w),w.readerType==="none"){Zm(a,w),rl(a);return}if(w.bytesFilled<w.minimumFill)return;Ii(a);let R=w.bytesFilled%w.elementSize;if(R>0){let N=w.byteOffset+w.bytesFilled;Wm(a,w.buffer,N-R,R)}w.bytesFilled-=R,el(a._controlledReadableByteStream,w),rl(a)}i(bR,"ReadableByteStreamControllerRespondInReadableState");function Xm(a,p){let w=a._pendingPullIntos.peek();tl(a),a._controlledReadableByteStream._state==="closed"?PR(a,w):bR(a,p,w),ti(a)}i(Xm,"ReadableByteStreamControllerRespondInternal");function Ii(a){return a._pendingPullIntos.shift()}i(Ii,"ReadableByteStreamControllerShiftPendingPullInto");function TR(a){let p=a._controlledReadableByteStream;return p._state!=="readable"||a._closeRequested||!a._started?!1:!!(j(p)&&V(p)>0||ol(p)&&ih(p)>0||eh(a)>0)}i(TR,"ReadableByteStreamControllerShouldCallPull");function is(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}i(is,"ReadableByteStreamControllerClearAlgorithms");function $o(a){let p=a._controlledReadableByteStream;if(!(a._closeRequested||p._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let w=a._pendingPullIntos.peek();if(w.bytesFilled%w.elementSize!==0){let R=new TypeError("Insufficient bytes to fill elements in the given buffer");throw cr(a,R),R}}is(a),Mo(p)}}i($o,"ReadableByteStreamControllerClose");function os(a,p){let w=a._controlledReadableByteStream;if(a._closeRequested||w._state!=="readable")return;let{buffer:R,byteOffset:N,byteLength:G}=p;if(Sn(R))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let K=tn(R);if(a._pendingPullIntos.length>0){let le=a._pendingPullIntos.peek();if(Sn(le.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");tl(a),le.buffer=tn(le.buffer),le.readerType==="none"&&Zm(a,le)}if(j(w))if(_R(a),V(w)===0)ns(a,K,N,G);else{a._pendingPullIntos.length>0&&Ii(a);let le=new Uint8Array(K,N,G);M(w,le,!1)}else ol(w)?(ns(a,K,N,G),rl(a)):ns(a,K,N,G);ti(a)}i(os,"ReadableByteStreamControllerEnqueue");function cr(a,p){let w=a._controlledReadableByteStream;w._state==="readable"&&(Gm(a),En(a),is(a),Ah(w,p))}i(cr,"ReadableByteStreamControllerError");function Qm(a,p){let w=a._queue.shift();a._queueTotalSize-=w.byteLength,Ym(a);let R=new Uint8Array(w.buffer,w.byteOffset,w.byteLength);p._chunkSteps(R)}i(Qm,"ReadableByteStreamControllerFillReadRequestFromQueue");function nl(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let p=a._pendingPullIntos.peek(),w=new Uint8Array(p.buffer,p.byteOffset+p.bytesFilled,p.byteLength-p.bytesFilled),R=Object.create(Qn.prototype);ER(R,a,w),a._byobRequest=R}return a._byobRequest}i(nl,"ReadableByteStreamControllerGetBYOBRequest");function eh(a){let p=a._controlledReadableByteStream._state;return p==="errored"?null:p==="closed"?0:a._strategyHWM-a._queueTotalSize}i(eh,"ReadableByteStreamControllerGetDesiredSize");function as(a,p){let w=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(p!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(p===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(w.bytesFilled+p>w.byteLength)throw new RangeError("bytesWritten out of range")}w.buffer=tn(w.buffer),Xm(a,p)}i(as,"ReadableByteStreamControllerRespond");function ss(a,p){let w=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(p.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(p.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(w.byteOffset+w.bytesFilled!==p.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(w.bufferByteLength!==p.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(w.bytesFilled+p.byteLength>w.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let N=p.byteLength;w.buffer=tn(p.buffer),Xm(a,N)}i(ss,"ReadableByteStreamControllerRespondWithNewView");function th(a,p,w,R,N,G,K){p._controlledReadableByteStream=a,p._pullAgain=!1,p._pulling=!1,p._byobRequest=null,p._queue=p._queueTotalSize=void 0,En(p),p._closeRequested=!1,p._started=!1,p._strategyHWM=G,p._pullAlgorithm=R,p._cancelAlgorithm=N,p._autoAllocateChunkSize=K,p._pendingPullIntos=new l,a._readableStreamController=p;let le=w();T(v(le),()=>(p._started=!0,ti(p),null),Se=>(cr(p,Se),null))}i(th,"SetUpReadableByteStreamController");function SR(a,p,w){let R=Object.create(rn.prototype),N,G,K;p.start!==void 0?N=i(()=>p.start(R),"startAlgorithm"):N=i(()=>{},"startAlgorithm"),p.pull!==void 0?G=i(()=>p.pull(R),"pullAlgorithm"):G=i(()=>v(void 0),"pullAlgorithm"),p.cancel!==void 0?K=i(Se=>p.cancel(Se),"cancelAlgorithm"):K=i(()=>v(void 0),"cancelAlgorithm");let le=p.autoAllocateChunkSize;if(le===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");th(a,R,N,G,K,w,le)}i(SR,"SetUpReadableByteStreamControllerFromUnderlyingSource");function ER(a,p,w){a._associatedReadableByteStreamController=p,a._view=w}i(ER,"SetUpReadableStreamBYOBRequest");function il(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}i(il,"byobRequestBrandCheckException");function Oo(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}i(Oo,"byteStreamControllerBrandCheckException");function xR(a,p){lt(a,p);let w=a?.mode;return{mode:w===void 0?void 0:IR(w,`${p} has member 'mode' that`)}}i(xR,"convertReaderOptions");function IR(a,p){if(a=`${a}`,a!=="byob")throw new TypeError(`${p} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}i(IR,"convertReadableStreamReaderMode");function AR(a,p){var w;lt(a,p);let R=(w=a?.min)!==null&&w!==void 0?w:1;return{min:z(R,`${p} has member 'min' that`)}}i(AR,"convertByobReadOptions");function rh(a){return new xn(a)}i(rh,"AcquireReadableStreamBYOBReader");function nh(a,p){a._reader._readIntoRequests.push(p)}i(nh,"ReadableStreamAddReadIntoRequest");function RR(a,p,w){let N=a._reader._readIntoRequests.shift();w?N._closeSteps(p):N._chunkSteps(p)}i(RR,"ReadableStreamFulfillReadIntoRequest");function ih(a){return a._reader._readIntoRequests.length}i(ih,"ReadableStreamGetNumReadIntoRequests");function ol(a){let p=a._reader;return!(p===void 0||!ri(p))}i(ol,"ReadableStreamHasBYOBReader");class xn{static{i(this,"ReadableStreamBYOBReader")}constructor(p){if(Je(p,1,"ReadableStreamBYOBReader"),F(p,"First parameter"),Rn(p))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ei(p._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");se(this,p),this._readIntoRequests=new l}get closed(){return ri(this)?this._closedPromise:_(us("closed"))}cancel(p=void 0){return ri(this)?this._ownerReadableStream===void 0?_(ne("cancel")):X(this,p):_(us("cancel"))}read(p,w={}){if(!ri(this))return _(us("read"));if(!ArrayBuffer.isView(p))return _(new TypeError("view must be an array buffer view"));if(p.byteLength===0)return _(new TypeError("view must have non-zero byteLength"));if(p.buffer.byteLength===0)return _(new TypeError("view's buffer must have non-zero byteLength"));if(Sn(p.buffer))return _(new TypeError("view's buffer has been detached"));let R;try{R=AR(w,"options")}catch(ye){return _(ye)}let N=R.min;if(N===0)return _(new TypeError("options.min must be greater than 0"));if(yR(p)){if(N>p.byteLength)return _(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(N>p.length)return _(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return _(ne("read from"));let G,K,le=h((ye,Oe)=>{G=ye,K=Oe});return oh(this,p,N,{_chunkSteps:i(ye=>G({value:ye,done:!1}),"_chunkSteps"),_closeSteps:i(ye=>G({value:ye,done:!0}),"_closeSteps"),_errorSteps:i(ye=>K(ye),"_errorSteps")}),le}releaseLock(){if(!ri(this))throw us("releaseLock");this._ownerReadableStream!==void 0&&DR(this)}}Object.defineProperties(xn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),o(xn.prototype.cancel,"cancel"),o(xn.prototype.read,"read"),o(xn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(xn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function ri(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof xn}i(ri,"IsReadableStreamBYOBReader");function oh(a,p,w,R){let N=a._ownerReadableStream;N._disturbed=!0,N._state==="errored"?R._errorSteps(N._storedError):wR(N._readableStreamController,p,w,R)}i(oh,"ReadableStreamBYOBReaderRead");function DR(a){Y(a);let p=new TypeError("Reader was released");ah(a,p)}i(DR,"ReadableStreamBYOBReaderRelease");function ah(a,p){let w=a._readIntoRequests;a._readIntoRequests=new l,w.forEach(R=>{R._errorSteps(p)})}i(ah,"ReadableStreamBYOBReaderErrorReadIntoRequests");function us(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}i(us,"byobReaderBrandCheckException");function Co(a,p){let{highWaterMark:w}=a;if(w===void 0)return p;if(Wt(w)||w<0)throw new RangeError("Invalid highWaterMark");return w}i(Co,"ExtractHighWaterMark");function cs(a){let{size:p}=a;return p||(()=>1)}i(cs,"ExtractSizeAlgorithm");function ls(a,p){lt(a,p);let w=a?.highWaterMark,R=a?.size;return{highWaterMark:w===void 0?void 0:$(w),size:R===void 0?void 0:$R(R,`${p} has member 'size' that`)}}i(ls,"convertQueuingStrategy");function $R(a,p){return ft(a,p),w=>$(a(w))}i($R,"convertQueuingStrategySize");function OR(a,p){lt(a,p);let w=a?.abort,R=a?.close,N=a?.start,G=a?.type,K=a?.write;return{abort:w===void 0?void 0:CR(w,a,`${p} has member 'abort' that`),close:R===void 0?void 0:NR(R,a,`${p} has member 'close' that`),start:N===void 0?void 0:kR(N,a,`${p} has member 'start' that`),write:K===void 0?void 0:zR(K,a,`${p} has member 'write' that`),type:G}}i(OR,"convertUnderlyingSink");function CR(a,p,w){return ft(a,w),R=>c(a,p,[R])}i(CR,"convertUnderlyingSinkAbortCallback");function NR(a,p,w){return ft(a,w),()=>c(a,p,[])}i(NR,"convertUnderlyingSinkCloseCallback");function kR(a,p,w){return ft(a,w),R=>f(a,p,[R])}i(kR,"convertUnderlyingSinkStartCallback");function zR(a,p,w){return ft(a,w),(R,N)=>c(a,p,[R,N])}i(zR,"convertUnderlyingSinkWriteCallback");function sh(a,p){if(!Ai(a))throw new TypeError(`${p} is not a WritableStream.`)}i(sh,"assertWritableStream");function UR(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}i(UR,"isAbortSignal");let MR=typeof AbortController=="function";function FR(){if(MR)return new AbortController}i(FR,"createAbortController");class In{static{i(this,"WritableStream")}constructor(p={},w={}){p===void 0?p=null:Ze(p,"First parameter");let R=ls(w,"Second parameter"),N=OR(p,"First parameter");if(ch(this),N.type!==void 0)throw new RangeError("Invalid type is specified");let K=cs(R),le=Co(R,1);QR(this,N,le,K)}get locked(){if(!Ai(this))throw hs("locked");return Ri(this)}abort(p=void 0){return Ai(this)?Ri(this)?_(new TypeError("Cannot abort a stream that already has a writer")):ds(this,p):_(hs("abort"))}close(){return Ai(this)?Ri(this)?_(new TypeError("Cannot close a stream that already has a writer")):kr(this)?_(new TypeError("Cannot close an already-closing stream")):lh(this):_(hs("close"))}getWriter(){if(!Ai(this))throw hs("getWriter");return uh(this)}}Object.defineProperties(In.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),o(In.prototype.abort,"abort"),o(In.prototype.close,"close"),o(In.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(In.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function uh(a){return new nn(a)}i(uh,"AcquireWritableStreamDefaultWriter");function LR(a,p,w,R,N=1,G=()=>1){let K=Object.create(In.prototype);ch(K);let le=Object.create(Di.prototype);return gh(K,le,a,p,w,R,N,G),K}i(LR,"CreateWritableStream");function ch(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new l,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}i(ch,"InitializeWritableStream");function Ai(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof In}i(Ai,"IsWritableStream");function Ri(a){return a._writer!==void 0}i(Ri,"IsWritableStreamLocked");function ds(a,p){var w;if(a._state==="closed"||a._state==="errored")return v(void 0);a._writableStreamController._abortReason=p,(w=a._writableStreamController._abortController)===null||w===void 0||w.abort(p);let R=a._state;if(R==="closed"||R==="errored")return v(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let N=!1;R==="erroring"&&(N=!0,p=void 0);let G=h((K,le)=>{a._pendingAbortRequest={_promise:void 0,_resolve:K,_reject:le,_reason:p,_wasAlreadyErroring:N}});return a._pendingAbortRequest._promise=G,N||sl(a,p),G}i(ds,"WritableStreamAbort");function lh(a){let p=a._state;if(p==="closed"||p==="errored")return _(new TypeError(`The stream (in ${p} state) is not in the writable state and cannot be closed`));let w=h((N,G)=>{let K={_resolve:N,_reject:G};a._closeRequest=K}),R=a._writer;return R!==void 0&&a._backpressure&&p==="writable"&&hl(R),e0(a._writableStreamController),w}i(lh,"WritableStreamClose");function jR(a){return h((w,R)=>{let N={_resolve:w,_reject:R};a._writeRequests.push(N)})}i(jR,"WritableStreamAddWriteRequest");function al(a,p){if(a._state==="writable"){sl(a,p);return}ul(a)}i(al,"WritableStreamDealWithRejection");function sl(a,p){let w=a._writableStreamController;a._state="erroring",a._storedError=p;let R=a._writer;R!==void 0&&ph(R,p),!HR(a)&&w._started&&ul(a)}i(sl,"WritableStreamStartErroring");function ul(a){a._state="errored",a._writableStreamController[g]();let p=a._storedError;if(a._writeRequests.forEach(N=>{N._reject(p)}),a._writeRequests=new l,a._pendingAbortRequest===void 0){ps(a);return}let w=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,w._wasAlreadyErroring){w._reject(p),ps(a);return}let R=a._writableStreamController[b](w._reason);T(R,()=>(w._resolve(),ps(a),null),N=>(w._reject(N),ps(a),null))}i(ul,"WritableStreamFinishErroring");function qR(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}i(qR,"WritableStreamFinishInFlightWrite");function BR(a,p){a._inFlightWriteRequest._reject(p),a._inFlightWriteRequest=void 0,al(a,p)}i(BR,"WritableStreamFinishInFlightWriteWithError");function VR(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 w=a._writer;w!==void 0&&wh(w)}i(VR,"WritableStreamFinishInFlightClose");function GR(a,p){a._inFlightCloseRequest._reject(p),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(p),a._pendingAbortRequest=void 0),al(a,p)}i(GR,"WritableStreamFinishInFlightCloseWithError");function kr(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}i(kr,"WritableStreamCloseQueuedOrInFlight");function HR(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}i(HR,"WritableStreamHasOperationMarkedInFlight");function WR(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}i(WR,"WritableStreamMarkCloseRequestInFlight");function ZR(a){a._inFlightWriteRequest=a._writeRequests.shift()}i(ZR,"WritableStreamMarkFirstWriteRequestInFlight");function ps(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let p=a._writer;p!==void 0&&fl(p,a._storedError)}i(ps,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function cl(a,p){let w=a._writer;w!==void 0&&p!==a._backpressure&&(p?s0(w):hl(w)),a._backpressure=p}i(cl,"WritableStreamUpdateBackpressure");class nn{static{i(this,"WritableStreamDefaultWriter")}constructor(p){if(Je(p,1,"WritableStreamDefaultWriter"),sh(p,"First parameter"),Ri(p))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=p,p._writer=this;let w=p._state;if(w==="writable")!kr(p)&&p._backpressure?ys(this):Ph(this),gs(this);else if(w==="erroring")ml(this,p._storedError),gs(this);else if(w==="closed")Ph(this),o0(this);else{let R=p._storedError;ml(this,R),_h(this,R)}}get closed(){return ni(this)?this._closedPromise:_(ii("closed"))}get desiredSize(){if(!ni(this))throw ii("desiredSize");if(this._ownerWritableStream===void 0)throw ko("desiredSize");return XR(this)}get ready(){return ni(this)?this._readyPromise:_(ii("ready"))}abort(p=void 0){return ni(this)?this._ownerWritableStream===void 0?_(ko("abort")):KR(this,p):_(ii("abort"))}close(){if(!ni(this))return _(ii("close"));let p=this._ownerWritableStream;return p===void 0?_(ko("close")):kr(p)?_(new TypeError("Cannot close an already-closing stream")):dh(this)}releaseLock(){if(!ni(this))throw ii("releaseLock");this._ownerWritableStream!==void 0&&fh(this)}write(p=void 0){return ni(this)?this._ownerWritableStream===void 0?_(ko("write to")):mh(this,p):_(ii("write"))}}Object.defineProperties(nn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),o(nn.prototype.abort,"abort"),o(nn.prototype.close,"close"),o(nn.prototype.releaseLock,"releaseLock"),o(nn.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(nn.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function ni(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof nn}i(ni,"IsWritableStreamDefaultWriter");function KR(a,p){let w=a._ownerWritableStream;return ds(w,p)}i(KR,"WritableStreamDefaultWriterAbort");function dh(a){let p=a._ownerWritableStream;return lh(p)}i(dh,"WritableStreamDefaultWriterClose");function JR(a){let p=a._ownerWritableStream,w=p._state;return kr(p)||w==="closed"?v(void 0):w==="errored"?_(p._storedError):dh(a)}i(JR,"WritableStreamDefaultWriterCloseWithErrorPropagation");function YR(a,p){a._closedPromiseState==="pending"?fl(a,p):a0(a,p)}i(YR,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function ph(a,p){a._readyPromiseState==="pending"?bh(a,p):u0(a,p)}i(ph,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function XR(a){let p=a._ownerWritableStream,w=p._state;return w==="errored"||w==="erroring"?null:w==="closed"?0:yh(p._writableStreamController)}i(XR,"WritableStreamDefaultWriterGetDesiredSize");function fh(a){let p=a._ownerWritableStream,w=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");ph(a,w),YR(a,w),p._writer=void 0,a._ownerWritableStream=void 0}i(fh,"WritableStreamDefaultWriterRelease");function mh(a,p){let w=a._ownerWritableStream,R=w._writableStreamController,N=t0(R,p);if(w!==a._ownerWritableStream)return _(ko("write to"));let G=w._state;if(G==="errored")return _(w._storedError);if(kr(w)||G==="closed")return _(new TypeError("The stream is closing or closed and cannot be written to"));if(G==="erroring")return _(w._storedError);let K=jR(w);return r0(R,p,N),K}i(mh,"WritableStreamDefaultWriterWrite");let hh={};class Di{static{i(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!ll(this))throw pl("abortReason");return this._abortReason}get signal(){if(!ll(this))throw pl("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(p=void 0){if(!ll(this))throw pl("error");this._controlledWritableStream._state==="writable"&&vh(this,p)}[b](p){let w=this._abortAlgorithm(p);return fs(this),w}[g](){En(this)}}Object.defineProperties(Di.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Di.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function ll(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Di}i(ll,"IsWritableStreamDefaultController");function gh(a,p,w,R,N,G,K,le){p._controlledWritableStream=a,a._writableStreamController=p,p._queue=void 0,p._queueTotalSize=void 0,En(p),p._abortReason=void 0,p._abortController=FR(),p._started=!1,p._strategySizeAlgorithm=le,p._strategyHWM=K,p._writeAlgorithm=R,p._closeAlgorithm=N,p._abortAlgorithm=G;let Se=dl(p);cl(a,Se);let ye=w(),Oe=v(ye);T(Oe,()=>(p._started=!0,ms(p),null),Fe=>(p._started=!0,al(a,Fe),null))}i(gh,"SetUpWritableStreamDefaultController");function QR(a,p,w,R){let N=Object.create(Di.prototype),G,K,le,Se;p.start!==void 0?G=i(()=>p.start(N),"startAlgorithm"):G=i(()=>{},"startAlgorithm"),p.write!==void 0?K=i(ye=>p.write(ye,N),"writeAlgorithm"):K=i(()=>v(void 0),"writeAlgorithm"),p.close!==void 0?le=i(()=>p.close(),"closeAlgorithm"):le=i(()=>v(void 0),"closeAlgorithm"),p.abort!==void 0?Se=i(ye=>p.abort(ye),"abortAlgorithm"):Se=i(()=>v(void 0),"abortAlgorithm"),gh(a,N,G,K,le,Se,w,R)}i(QR,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function fs(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}i(fs,"WritableStreamDefaultControllerClearAlgorithms");function e0(a){Xc(a,hh,0),ms(a)}i(e0,"WritableStreamDefaultControllerClose");function t0(a,p){try{return a._strategySizeAlgorithm(p)}catch(w){return No(a,w),1}}i(t0,"WritableStreamDefaultControllerGetChunkSize");function yh(a){return a._strategyHWM-a._queueTotalSize}i(yh,"WritableStreamDefaultControllerGetDesiredSize");function r0(a,p,w){try{Xc(a,p,w)}catch(N){No(a,N);return}let R=a._controlledWritableStream;if(!kr(R)&&R._state==="writable"){let N=dl(a);cl(R,N)}ms(a)}i(r0,"WritableStreamDefaultControllerWrite");function ms(a){let p=a._controlledWritableStream;if(!a._started||p._inFlightWriteRequest!==void 0)return;if(p._state==="erroring"){ul(p);return}if(a._queue.length===0)return;let R=gR(a);R===hh?n0(a):i0(a,R)}i(ms,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function No(a,p){a._controlledWritableStream._state==="writable"&&vh(a,p)}i(No,"WritableStreamDefaultControllerErrorIfNeeded");function n0(a){let p=a._controlledWritableStream;WR(p),Yc(a);let w=a._closeAlgorithm();fs(a),T(w,()=>(VR(p),null),R=>(GR(p,R),null))}i(n0,"WritableStreamDefaultControllerProcessClose");function i0(a,p){let w=a._controlledWritableStream;ZR(w);let R=a._writeAlgorithm(p);T(R,()=>{qR(w);let N=w._state;if(Yc(a),!kr(w)&&N==="writable"){let G=dl(a);cl(w,G)}return ms(a),null},N=>(w._state==="writable"&&fs(a),BR(w,N),null))}i(i0,"WritableStreamDefaultControllerProcessWrite");function dl(a){return yh(a)<=0}i(dl,"WritableStreamDefaultControllerGetBackpressure");function vh(a,p){let w=a._controlledWritableStream;fs(a),sl(w,p)}i(vh,"WritableStreamDefaultControllerError");function hs(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}i(hs,"streamBrandCheckException$2");function pl(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}i(pl,"defaultControllerBrandCheckException$2");function ii(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}i(ii,"defaultWriterBrandCheckException");function ko(a){return new TypeError("Cannot "+a+" a stream using a released writer")}i(ko,"defaultWriterLockException");function gs(a){a._closedPromise=h((p,w)=>{a._closedPromise_resolve=p,a._closedPromise_reject=w,a._closedPromiseState="pending"})}i(gs,"defaultWriterClosedPromiseInitialize");function _h(a,p){gs(a),fl(a,p)}i(_h,"defaultWriterClosedPromiseInitializeAsRejected");function o0(a){gs(a),wh(a)}i(o0,"defaultWriterClosedPromiseInitializeAsResolved");function fl(a,p){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(p),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}i(fl,"defaultWriterClosedPromiseReject");function a0(a,p){_h(a,p)}i(a0,"defaultWriterClosedPromiseResetToRejected");function wh(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="resolved")}i(wh,"defaultWriterClosedPromiseResolve");function ys(a){a._readyPromise=h((p,w)=>{a._readyPromise_resolve=p,a._readyPromise_reject=w}),a._readyPromiseState="pending"}i(ys,"defaultWriterReadyPromiseInitialize");function ml(a,p){ys(a),bh(a,p)}i(ml,"defaultWriterReadyPromiseInitializeAsRejected");function Ph(a){ys(a),hl(a)}i(Ph,"defaultWriterReadyPromiseInitializeAsResolved");function bh(a,p){a._readyPromise_reject!==void 0&&(E(a._readyPromise),a._readyPromise_reject(p),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}i(bh,"defaultWriterReadyPromiseReject");function s0(a){ys(a)}i(s0,"defaultWriterReadyPromiseReset");function u0(a,p){ml(a,p)}i(u0,"defaultWriterReadyPromiseResetToRejected");function hl(a){a._readyPromise_resolve!==void 0&&(a._readyPromise_resolve(void 0),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="fulfilled")}i(hl,"defaultWriterReadyPromiseResolve");function c0(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}i(c0,"getGlobals");let gl=c0();function l0(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}i(l0,"isDOMExceptionConstructor");function d0(){let a=gl?.DOMException;return l0(a)?a:void 0}i(d0,"getFromGlobal");function p0(){let a=i(function(w,R){this.message=w||"",this.name=R||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return o(a,"DOMException"),a.prototype=Object.create(Error.prototype),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,configurable:!0}),a}i(p0,"createPolyfill");let f0=d0()||p0();function Th(a,p,w,R,N,G){let K=H(a),le=uh(p);a._disturbed=!0;let Se=!1,ye=v(void 0);return h((Oe,Fe)=>{let et;if(G!==void 0){if(et=i(()=>{let _e=G.reason!==void 0?G.reason:new f0("Aborted","AbortError"),je=[];R||je.push(()=>p._state==="writable"?ds(p,_e):v(void 0)),N||je.push(()=>a._state==="readable"?Pr(a,_e):v(void 0)),Ft(()=>Promise.all(je.map(tt=>tt())),!0,_e)},"abortAlgorithm"),G.aborted){et();return}G.addEventListener("abort",et)}function br(){return h((_e,je)=>{function tt(Zt){Zt?_e():x(Ni(),tt,je)}i(tt,"next"),tt(!1)})}i(br,"pipeLoop");function Ni(){return Se?v(!0):x(le._readyPromise,()=>h((_e,je)=>{he(K,{_chunkSteps:i(tt=>{ye=x(mh(le,tt),void 0,e),_e(!1)},"_chunkSteps"),_closeSteps:i(()=>_e(!0),"_closeSteps"),_errorSteps:je})}))}if(i(Ni,"pipeStep"),an(a,K._closedPromise,_e=>(R?lr(!0,_e):Ft(()=>ds(p,_e),!0,_e),null)),an(p,le._closedPromise,_e=>(N?lr(!0,_e):Ft(()=>Pr(a,_e),!0,_e),null)),kt(a,K._closedPromise,()=>(w?lr():Ft(()=>JR(le)),null)),kr(p)||p._state==="closed"){let _e=new TypeError("the destination writable stream closed before all data could be piped to it");N?lr(!0,_e):Ft(()=>Pr(a,_e),!0,_e)}E(br());function $n(){let _e=ye;return x(ye,()=>_e!==ye?$n():void 0)}i($n,"waitForWritesToFinish");function an(_e,je,tt){_e._state==="errored"?tt(_e._storedError):S(je,tt)}i(an,"isOrBecomesErrored");function kt(_e,je,tt){_e._state==="closed"?tt():P(je,tt)}i(kt,"isOrBecomesClosed");function Ft(_e,je,tt){if(Se)return;Se=!0,p._state==="writable"&&!kr(p)?P($n(),Zt):Zt();function Zt(){return T(_e(),()=>sn(je,tt),ki=>sn(!0,ki)),null}i(Zt,"doTheRest")}i(Ft,"shutdownWithAction");function lr(_e,je){Se||(Se=!0,p._state==="writable"&&!kr(p)?P($n(),()=>sn(_e,je)):sn(_e,je))}i(lr,"shutdown");function sn(_e,je){return fh(le),Y(K),G!==void 0&&G.removeEventListener("abort",et),_e?Fe(je):Oe(void 0),null}i(sn,"finalize")})}i(Th,"ReadableStreamPipeTo");class on{static{i(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!vs(this))throw ws("desiredSize");return yl(this)}close(){if(!vs(this))throw ws("close");if(!Oi(this))throw new TypeError("The stream is not in a state that permits close");oi(this)}enqueue(p=void 0){if(!vs(this))throw ws("enqueue");if(!Oi(this))throw new TypeError("The stream is not in a state that permits enqueue");return $i(this,p)}error(p=void 0){if(!vs(this))throw ws("error");wr(this,p)}[ae](p){En(this);let w=this._cancelAlgorithm(p);return _s(this),w}[re](p){let w=this._controlledReadableStream;if(this._queue.length>0){let R=Yc(this);this._closeRequested&&this._queue.length===0?(_s(this),Mo(w)):zo(this),p._chunkSteps(R)}else k(w,p),zo(this)}[Ue](){}}Object.defineProperties(on.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),o(on.prototype.close,"close"),o(on.prototype.enqueue,"enqueue"),o(on.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(on.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function vs(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof on}i(vs,"IsReadableStreamDefaultController");function zo(a){if(!Sh(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let w=a._pullAlgorithm();T(w,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,zo(a)),null),R=>(wr(a,R),null))}i(zo,"ReadableStreamDefaultControllerCallPullIfNeeded");function Sh(a){let p=a._controlledReadableStream;return!Oi(a)||!a._started?!1:!!(Rn(p)&&V(p)>0||yl(a)>0)}i(Sh,"ReadableStreamDefaultControllerShouldCallPull");function _s(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}i(_s,"ReadableStreamDefaultControllerClearAlgorithms");function oi(a){if(!Oi(a))return;let p=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(_s(a),Mo(p))}i(oi,"ReadableStreamDefaultControllerClose");function $i(a,p){if(!Oi(a))return;let w=a._controlledReadableStream;if(Rn(w)&&V(w)>0)M(w,p,!1);else{let R;try{R=a._strategySizeAlgorithm(p)}catch(N){throw wr(a,N),N}try{Xc(a,p,R)}catch(N){throw wr(a,N),N}}zo(a)}i($i,"ReadableStreamDefaultControllerEnqueue");function wr(a,p){let w=a._controlledReadableStream;w._state==="readable"&&(En(a),_s(a),Ah(w,p))}i(wr,"ReadableStreamDefaultControllerError");function yl(a){let p=a._controlledReadableStream._state;return p==="errored"?null:p==="closed"?0:a._strategyHWM-a._queueTotalSize}i(yl,"ReadableStreamDefaultControllerGetDesiredSize");function m0(a){return!Sh(a)}i(m0,"ReadableStreamDefaultControllerHasBackpressure");function Oi(a){let p=a._controlledReadableStream._state;return!a._closeRequested&&p==="readable"}i(Oi,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Eh(a,p,w,R,N,G,K){p._controlledReadableStream=a,p._queue=void 0,p._queueTotalSize=void 0,En(p),p._started=!1,p._closeRequested=!1,p._pullAgain=!1,p._pulling=!1,p._strategySizeAlgorithm=K,p._strategyHWM=G,p._pullAlgorithm=R,p._cancelAlgorithm=N,a._readableStreamController=p;let le=w();T(v(le),()=>(p._started=!0,zo(p),null),Se=>(wr(p,Se),null))}i(Eh,"SetUpReadableStreamDefaultController");function h0(a,p,w,R){let N=Object.create(on.prototype),G,K,le;p.start!==void 0?G=i(()=>p.start(N),"startAlgorithm"):G=i(()=>{},"startAlgorithm"),p.pull!==void 0?K=i(()=>p.pull(N),"pullAlgorithm"):K=i(()=>v(void 0),"pullAlgorithm"),p.cancel!==void 0?le=i(Se=>p.cancel(Se),"cancelAlgorithm"):le=i(()=>v(void 0),"cancelAlgorithm"),Eh(a,N,G,K,le,w,R)}i(h0,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function ws(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}i(ws,"defaultControllerBrandCheckException$1");function g0(a,p){return ei(a._readableStreamController)?v0(a):y0(a)}i(g0,"ReadableStreamTee");function y0(a,p){let w=H(a),R=!1,N=!1,G=!1,K=!1,le,Se,ye,Oe,Fe,et=h(kt=>{Fe=kt});function br(){return R?(N=!0,v(void 0)):(R=!0,he(w,{_chunkSteps:i(Ft=>{u(()=>{N=!1;let lr=Ft,sn=Ft;G||$i(ye._readableStreamController,lr),K||$i(Oe._readableStreamController,sn),R=!1,N&&br()})},"_chunkSteps"),_closeSteps:i(()=>{R=!1,G||oi(ye._readableStreamController),K||oi(Oe._readableStreamController),(!G||!K)&&Fe(void 0)},"_closeSteps"),_errorSteps:i(()=>{R=!1},"_errorSteps")}),v(void 0))}i(br,"pullAlgorithm");function Ni(kt){if(G=!0,le=kt,K){let Ft=Ye([le,Se]),lr=Pr(a,Ft);Fe(lr)}return et}i(Ni,"cancel1Algorithm");function $n(kt){if(K=!0,Se=kt,G){let Ft=Ye([le,Se]),lr=Pr(a,Ft);Fe(lr)}return et}i($n,"cancel2Algorithm");function an(){}return i(an,"startAlgorithm"),ye=Uo(an,br,Ni),Oe=Uo(an,br,$n),S(w._closedPromise,kt=>(wr(ye._readableStreamController,kt),wr(Oe._readableStreamController,kt),(!G||!K)&&Fe(void 0),null)),[ye,Oe]}i(y0,"ReadableStreamDefaultTee");function v0(a){let p=H(a),w=!1,R=!1,N=!1,G=!1,K=!1,le,Se,ye,Oe,Fe,et=h(_e=>{Fe=_e});function br(_e){S(_e._closedPromise,je=>(_e!==p||(cr(ye._readableStreamController,je),cr(Oe._readableStreamController,je),(!G||!K)&&Fe(void 0)),null))}i(br,"forwardReaderError");function Ni(){ri(p)&&(Y(p),p=H(a),br(p)),he(p,{_chunkSteps:i(je=>{u(()=>{R=!1,N=!1;let tt=je,Zt=je;if(!G&&!K)try{Zt=Bm(je)}catch(ki){cr(ye._readableStreamController,ki),cr(Oe._readableStreamController,ki),Fe(Pr(a,ki));return}G||os(ye._readableStreamController,tt),K||os(Oe._readableStreamController,Zt),w=!1,R?an():N&&kt()})},"_chunkSteps"),_closeSteps:i(()=>{w=!1,G||$o(ye._readableStreamController),K||$o(Oe._readableStreamController),ye._readableStreamController._pendingPullIntos.length>0&&as(ye._readableStreamController,0),Oe._readableStreamController._pendingPullIntos.length>0&&as(Oe._readableStreamController,0),(!G||!K)&&Fe(void 0)},"_closeSteps"),_errorSteps:i(()=>{w=!1},"_errorSteps")})}i(Ni,"pullWithDefaultReader");function $n(_e,je){pe(p)&&(Y(p),p=rh(a),br(p));let tt=je?Oe:ye,Zt=je?ye:Oe;oh(p,_e,1,{_chunkSteps:i(zi=>{u(()=>{R=!1,N=!1;let Ui=je?K:G;if(je?G:K)Ui||ss(tt._readableStreamController,zi);else{let jh;try{jh=Bm(zi)}catch(bl){cr(tt._readableStreamController,bl),cr(Zt._readableStreamController,bl),Fe(Pr(a,bl));return}Ui||ss(tt._readableStreamController,zi),os(Zt._readableStreamController,jh)}w=!1,R?an():N&&kt()})},"_chunkSteps"),_closeSteps:i(zi=>{w=!1;let Ui=je?K:G,As=je?G:K;Ui||$o(tt._readableStreamController),As||$o(Zt._readableStreamController),zi!==void 0&&(Ui||ss(tt._readableStreamController,zi),!As&&Zt._readableStreamController._pendingPullIntos.length>0&&as(Zt._readableStreamController,0)),(!Ui||!As)&&Fe(void 0)},"_closeSteps"),_errorSteps:i(()=>{w=!1},"_errorSteps")})}i($n,"pullWithBYOBReader");function an(){if(w)return R=!0,v(void 0);w=!0;let _e=nl(ye._readableStreamController);return _e===null?Ni():$n(_e._view,!1),v(void 0)}i(an,"pull1Algorithm");function kt(){if(w)return N=!0,v(void 0);w=!0;let _e=nl(Oe._readableStreamController);return _e===null?Ni():$n(_e._view,!0),v(void 0)}i(kt,"pull2Algorithm");function Ft(_e){if(G=!0,le=_e,K){let je=Ye([le,Se]),tt=Pr(a,je);Fe(tt)}return et}i(Ft,"cancel1Algorithm");function lr(_e){if(K=!0,Se=_e,G){let je=Ye([le,Se]),tt=Pr(a,je);Fe(tt)}return et}i(lr,"cancel2Algorithm");function sn(){}return i(sn,"startAlgorithm"),ye=Ih(sn,an,Ft),Oe=Ih(sn,kt,lr),br(p),[ye,Oe]}i(v0,"ReadableByteStreamTee");function _0(a){return r(a)&&typeof a.getReader<"u"}i(_0,"isReadableStreamLike");function w0(a){return _0(a)?b0(a.getReader()):P0(a)}i(w0,"ReadableStreamFrom");function P0(a){let p,w=qm(a,"async"),R=e;function N(){let K;try{K=pR(w)}catch(Se){return _(Se)}let le=v(K);return D(le,Se=>{if(!r(Se))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(fR(Se))oi(p._readableStreamController);else{let Oe=mR(Se);$i(p._readableStreamController,Oe)}})}i(N,"pullAlgorithm");function G(K){let le=w.iterator,Se;try{Se=rs(le,"return")}catch(Fe){return _(Fe)}if(Se===void 0)return v(void 0);let ye;try{ye=f(Se,le,[K])}catch(Fe){return _(Fe)}let Oe=v(ye);return D(Oe,Fe=>{if(!r(Fe))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return i(G,"cancelAlgorithm"),p=Uo(R,N,G,0),p}i(P0,"ReadableStreamFromIterable");function b0(a){let p,w=e;function R(){let G;try{G=a.read()}catch(K){return _(K)}return D(G,K=>{if(!r(K))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(K.done)oi(p._readableStreamController);else{let le=K.value;$i(p._readableStreamController,le)}})}i(R,"pullAlgorithm");function N(G){try{return v(a.cancel(G))}catch(K){return _(K)}}return i(N,"cancelAlgorithm"),p=Uo(w,R,N,0),p}i(b0,"ReadableStreamFromDefaultReader");function T0(a,p){lt(a,p);let w=a,R=w?.autoAllocateChunkSize,N=w?.cancel,G=w?.pull,K=w?.start,le=w?.type;return{autoAllocateChunkSize:R===void 0?void 0:z(R,`${p} has member 'autoAllocateChunkSize' that`),cancel:N===void 0?void 0:S0(N,w,`${p} has member 'cancel' that`),pull:G===void 0?void 0:E0(G,w,`${p} has member 'pull' that`),start:K===void 0?void 0:x0(K,w,`${p} has member 'start' that`),type:le===void 0?void 0:I0(le,`${p} has member 'type' that`)}}i(T0,"convertUnderlyingDefaultOrByteSource");function S0(a,p,w){return ft(a,w),R=>c(a,p,[R])}i(S0,"convertUnderlyingSourceCancelCallback");function E0(a,p,w){return ft(a,w),R=>c(a,p,[R])}i(E0,"convertUnderlyingSourcePullCallback");function x0(a,p,w){return ft(a,w),R=>f(a,p,[R])}i(x0,"convertUnderlyingSourceStartCallback");function I0(a,p){if(a=`${a}`,a!=="bytes")throw new TypeError(`${p} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}i(I0,"convertReadableStreamType");function A0(a,p){return lt(a,p),{preventCancel:!!a?.preventCancel}}i(A0,"convertIteratorOptions");function xh(a,p){lt(a,p);let w=a?.preventAbort,R=a?.preventCancel,N=a?.preventClose,G=a?.signal;return G!==void 0&&R0(G,`${p} has member 'signal' that`),{preventAbort:!!w,preventCancel:!!R,preventClose:!!N,signal:G}}i(xh,"convertPipeOptions");function R0(a,p){if(!UR(a))throw new TypeError(`${p} is not an AbortSignal.`)}i(R0,"assertAbortSignal");function D0(a,p){lt(a,p);let w=a?.readable;A(w,"readable","ReadableWritablePair"),F(w,`${p} has member 'readable' that`);let R=a?.writable;return A(R,"writable","ReadableWritablePair"),sh(R,`${p} has member 'writable' that`),{readable:w,writable:R}}i(D0,"convertReadableWritablePair");class $t{static{i(this,"ReadableStream")}constructor(p={},w={}){p===void 0?p=null:Ze(p,"First parameter");let R=ls(w,"Second parameter"),N=T0(p,"First parameter");if(vl(this),N.type==="bytes"){if(R.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let G=Co(R,0);SR(this,N,G)}else{let G=cs(R),K=Co(R,1);h0(this,N,K,G)}}get locked(){if(!An(this))throw ai("locked");return Rn(this)}cancel(p=void 0){return An(this)?Rn(this)?_(new TypeError("Cannot cancel a stream that already has a reader")):Pr(this,p):_(ai("cancel"))}getReader(p=void 0){if(!An(this))throw ai("getReader");return xR(p,"First parameter").mode===void 0?H(this):rh(this)}pipeThrough(p,w={}){if(!An(this))throw ai("pipeThrough");Je(p,1,"pipeThrough");let R=D0(p,"First parameter"),N=xh(w,"Second parameter");if(Rn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Ri(R.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let G=Th(this,R.writable,N.preventClose,N.preventAbort,N.preventCancel,N.signal);return E(G),R.readable}pipeTo(p,w={}){if(!An(this))return _(ai("pipeTo"));if(p===void 0)return _("Parameter 1 is required in 'pipeTo'.");if(!Ai(p))return _(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let R;try{R=xh(w,"Second parameter")}catch(N){return _(N)}return Rn(this)?_(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ri(p)?_(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Th(this,p,R.preventClose,R.preventAbort,R.preventCancel,R.signal)}tee(){if(!An(this))throw ai("tee");let p=g0(this);return Ye(p)}values(p=void 0){if(!An(this))throw ai("values");let w=A0(p,"First parameter");return Si(this,w.preventCancel)}[Jc](p){return this.values(p)}static from(p){return w0(p)}}Object.defineProperties($t,{from:{enumerable:!0}}),Object.defineProperties($t.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),o($t.from,"from"),o($t.prototype.cancel,"cancel"),o($t.prototype.getReader,"getReader"),o($t.prototype.pipeThrough,"pipeThrough"),o($t.prototype.pipeTo,"pipeTo"),o($t.prototype.tee,"tee"),o($t.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($t.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty($t.prototype,Jc,{value:$t.prototype.values,writable:!0,configurable:!0});function Uo(a,p,w,R=1,N=()=>1){let G=Object.create($t.prototype);vl(G);let K=Object.create(on.prototype);return Eh(G,K,a,p,w,R,N),G}i(Uo,"CreateReadableStream");function Ih(a,p,w){let R=Object.create($t.prototype);vl(R);let N=Object.create(rn.prototype);return th(R,N,a,p,w,0,void 0),R}i(Ih,"CreateReadableByteStream");function vl(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}i(vl,"InitializeReadableStream");function An(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof $t}i(An,"IsReadableStream");function Rn(a){return a._reader!==void 0}i(Rn,"IsReadableStreamLocked");function Pr(a,p){if(a._disturbed=!0,a._state==="closed")return v(void 0);if(a._state==="errored")return _(a._storedError);Mo(a);let w=a._reader;if(w!==void 0&&ri(w)){let N=w._readIntoRequests;w._readIntoRequests=new l,N.forEach(G=>{G._closeSteps(void 0)})}let R=a._readableStreamController[ae](p);return D(R,e)}i(Pr,"ReadableStreamCancel");function Mo(a){a._state="closed";let p=a._reader;if(p!==void 0&&(Ke(p),pe(p))){let w=p._readRequests;p._readRequests=new l,w.forEach(R=>{R._closeSteps()})}}i(Mo,"ReadableStreamClose");function Ah(a,p){a._state="errored",a._storedError=p;let w=a._reader;w!==void 0&&(ke(w,p),pe(w)?nt(w,p):ah(w,p))}i(Ah,"ReadableStreamError");function ai(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}i(ai,"streamBrandCheckException$1");function Rh(a,p){lt(a,p);let w=a?.highWaterMark;return A(w,"highWaterMark","QueuingStrategyInit"),{highWaterMark:$(w)}}i(Rh,"convertQueuingStrategyInit");let Dh=i(a=>a.byteLength,"byteLengthSizeFunction");o(Dh,"size");class Ps{static{i(this,"ByteLengthQueuingStrategy")}constructor(p){Je(p,1,"ByteLengthQueuingStrategy"),p=Rh(p,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=p.highWaterMark}get highWaterMark(){if(!Oh(this))throw $h("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Oh(this))throw $h("size");return Dh}}Object.defineProperties(Ps.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ps.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function $h(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}i($h,"byteLengthBrandCheckException");function Oh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof Ps}i(Oh,"IsByteLengthQueuingStrategy");let Ch=i(()=>1,"countSizeFunction");o(Ch,"size");class bs{static{i(this,"CountQueuingStrategy")}constructor(p){Je(p,1,"CountQueuingStrategy"),p=Rh(p,"First parameter"),this._countQueuingStrategyHighWaterMark=p.highWaterMark}get highWaterMark(){if(!kh(this))throw Nh("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!kh(this))throw Nh("size");return Ch}}Object.defineProperties(bs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bs.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Nh(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}i(Nh,"countBrandCheckException");function kh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof bs}i(kh,"IsCountQueuingStrategy");function $0(a,p){lt(a,p);let w=a?.cancel,R=a?.flush,N=a?.readableType,G=a?.start,K=a?.transform,le=a?.writableType;return{cancel:w===void 0?void 0:k0(w,a,`${p} has member 'cancel' that`),flush:R===void 0?void 0:O0(R,a,`${p} has member 'flush' that`),readableType:N,start:G===void 0?void 0:C0(G,a,`${p} has member 'start' that`),transform:K===void 0?void 0:N0(K,a,`${p} has member 'transform' that`),writableType:le}}i($0,"convertTransformer");function O0(a,p,w){return ft(a,w),R=>c(a,p,[R])}i(O0,"convertTransformerFlushCallback");function C0(a,p,w){return ft(a,w),R=>f(a,p,[R])}i(C0,"convertTransformerStartCallback");function N0(a,p,w){return ft(a,w),(R,N)=>c(a,p,[R,N])}i(N0,"convertTransformerTransformCallback");function k0(a,p,w){return ft(a,w),R=>c(a,p,[R])}i(k0,"convertTransformerCancelCallback");class Ts{static{i(this,"TransformStream")}constructor(p={},w={},R={}){p===void 0&&(p=null);let N=ls(w,"Second parameter"),G=ls(R,"Third parameter"),K=$0(p,"First parameter");if(K.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(K.writableType!==void 0)throw new RangeError("Invalid writableType specified");let le=Co(G,0),Se=cs(G),ye=Co(N,1),Oe=cs(N),Fe,et=h(br=>{Fe=br});z0(this,et,ye,Oe,le,Se),M0(this,K),K.start!==void 0?Fe(K.start(this._transformStreamController)):Fe(void 0)}get readable(){if(!zh(this))throw Lh("readable");return this._readable}get writable(){if(!zh(this))throw Lh("writable");return this._writable}}Object.defineProperties(Ts.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ts.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function z0(a,p,w,R,N,G){function K(){return p}i(K,"startAlgorithm");function le(et){return j0(a,et)}i(le,"writeAlgorithm");function Se(et){return q0(a,et)}i(Se,"abortAlgorithm");function ye(){return B0(a)}i(ye,"closeAlgorithm"),a._writable=LR(K,le,ye,Se,w,R);function Oe(){return V0(a)}i(Oe,"pullAlgorithm");function Fe(et){return G0(a,et)}i(Fe,"cancelAlgorithm"),a._readable=Uo(K,Oe,Fe,N,G),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,Ss(a,!0),a._transformStreamController=void 0}i(z0,"InitializeTransformStream");function zh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof Ts}i(zh,"IsTransformStream");function Uh(a,p){wr(a._readable._readableStreamController,p),_l(a,p)}i(Uh,"TransformStreamError");function _l(a,p){xs(a._transformStreamController),No(a._writable._writableStreamController,p),wl(a)}i(_l,"TransformStreamErrorWritableAndUnblockWrite");function wl(a){a._backpressure&&Ss(a,!1)}i(wl,"TransformStreamUnblockWrite");function Ss(a,p){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=h(w=>{a._backpressureChangePromise_resolve=w}),a._backpressure=p}i(Ss,"TransformStreamSetBackpressure");class Dn{static{i(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Es(this))throw Is("desiredSize");let p=this._controlledTransformStream._readable._readableStreamController;return yl(p)}enqueue(p=void 0){if(!Es(this))throw Is("enqueue");Mh(this,p)}error(p=void 0){if(!Es(this))throw Is("error");F0(this,p)}terminate(){if(!Es(this))throw Is("terminate");L0(this)}}Object.defineProperties(Dn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),o(Dn.prototype.enqueue,"enqueue"),o(Dn.prototype.error,"error"),o(Dn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Dn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function Es(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof Dn}i(Es,"IsTransformStreamDefaultController");function U0(a,p,w,R,N){p._controlledTransformStream=a,a._transformStreamController=p,p._transformAlgorithm=w,p._flushAlgorithm=R,p._cancelAlgorithm=N,p._finishPromise=void 0,p._finishPromise_resolve=void 0,p._finishPromise_reject=void 0}i(U0,"SetUpTransformStreamDefaultController");function M0(a,p){let w=Object.create(Dn.prototype),R,N,G;p.transform!==void 0?R=i(K=>p.transform(K,w),"transformAlgorithm"):R=i(K=>{try{return Mh(w,K),v(void 0)}catch(le){return _(le)}},"transformAlgorithm"),p.flush!==void 0?N=i(()=>p.flush(w),"flushAlgorithm"):N=i(()=>v(void 0),"flushAlgorithm"),p.cancel!==void 0?G=i(K=>p.cancel(K),"cancelAlgorithm"):G=i(()=>v(void 0),"cancelAlgorithm"),U0(a,w,R,N,G)}i(M0,"SetUpTransformStreamDefaultControllerFromTransformer");function xs(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}i(xs,"TransformStreamDefaultControllerClearAlgorithms");function Mh(a,p){let w=a._controlledTransformStream,R=w._readable._readableStreamController;if(!Oi(R))throw new TypeError("Readable side is not in a state that permits enqueue");try{$i(R,p)}catch(G){throw _l(w,G),w._readable._storedError}m0(R)!==w._backpressure&&Ss(w,!0)}i(Mh,"TransformStreamDefaultControllerEnqueue");function F0(a,p){Uh(a._controlledTransformStream,p)}i(F0,"TransformStreamDefaultControllerError");function Fh(a,p){let w=a._transformAlgorithm(p);return D(w,void 0,R=>{throw Uh(a._controlledTransformStream,R),R})}i(Fh,"TransformStreamDefaultControllerPerformTransform");function L0(a){let p=a._controlledTransformStream,w=p._readable._readableStreamController;oi(w);let R=new TypeError("TransformStream terminated");_l(p,R)}i(L0,"TransformStreamDefaultControllerTerminate");function j0(a,p){let w=a._transformStreamController;if(a._backpressure){let R=a._backpressureChangePromise;return D(R,()=>{let N=a._writable;if(N._state==="erroring")throw N._storedError;return Fh(w,p)})}return Fh(w,p)}i(j0,"TransformStreamDefaultSinkWriteAlgorithm");function q0(a,p){let w=a._transformStreamController;if(w._finishPromise!==void 0)return w._finishPromise;let R=a._readable;w._finishPromise=h((G,K)=>{w._finishPromise_resolve=G,w._finishPromise_reject=K});let N=w._cancelAlgorithm(p);return xs(w),T(N,()=>(R._state==="errored"?Ci(w,R._storedError):(wr(R._readableStreamController,p),Pl(w)),null),G=>(wr(R._readableStreamController,G),Ci(w,G),null)),w._finishPromise}i(q0,"TransformStreamDefaultSinkAbortAlgorithm");function B0(a){let p=a._transformStreamController;if(p._finishPromise!==void 0)return p._finishPromise;let w=a._readable;p._finishPromise=h((N,G)=>{p._finishPromise_resolve=N,p._finishPromise_reject=G});let R=p._flushAlgorithm();return xs(p),T(R,()=>(w._state==="errored"?Ci(p,w._storedError):(oi(w._readableStreamController),Pl(p)),null),N=>(wr(w._readableStreamController,N),Ci(p,N),null)),p._finishPromise}i(B0,"TransformStreamDefaultSinkCloseAlgorithm");function V0(a){return Ss(a,!1),a._backpressureChangePromise}i(V0,"TransformStreamDefaultSourcePullAlgorithm");function G0(a,p){let w=a._transformStreamController;if(w._finishPromise!==void 0)return w._finishPromise;let R=a._writable;w._finishPromise=h((G,K)=>{w._finishPromise_resolve=G,w._finishPromise_reject=K});let N=w._cancelAlgorithm(p);return xs(w),T(N,()=>(R._state==="errored"?Ci(w,R._storedError):(No(R._writableStreamController,p),wl(a),Pl(w)),null),G=>(No(R._writableStreamController,G),wl(a),Ci(w,G),null)),w._finishPromise}i(G0,"TransformStreamDefaultSourceCancelAlgorithm");function Is(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}i(Is,"defaultControllerBrandCheckException");function Pl(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}i(Pl,"defaultControllerFinishPromiseResolve");function Ci(a,p){a._finishPromise_reject!==void 0&&(E(a._finishPromise),a._finishPromise_reject(p),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}i(Ci,"defaultControllerFinishPromiseReject");function Lh(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}i(Lh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=Ps,t.CountQueuingStrategy=bs,t.ReadableByteStreamController=rn,t.ReadableStream=$t,t.ReadableStreamBYOBReader=xn,t.ReadableStreamBYOBRequest=Qn,t.ReadableStreamDefaultController=on,t.ReadableStreamDefaultReader=Q,t.TransformStream=Ts,t.TransformStreamDefaultController=Dn,t.WritableStream=In,t.WritableStreamDefaultController=Di,t.WritableStreamDefaultWriter=nn}))});var lP=L(()=>{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,cP())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=i(function(r){let n=0,o=this;return new ReadableStream({type:"bytes",async pull(s){let m=await o.slice(n,Math.min(o.size,n+65536)).arrayBuffer();n+=m.byteLength,s.enqueue(new Uint8Array(m)),n===o.size&&s.close()}})},"name"))}catch{}});async function*Gd(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,o=r.byteOffset+r.byteLength;for(;n!==o;){let s=Math.min(o-n,dP),d=r.buffer.slice(n,n+s);n+=d.byteLength,yield new Uint8Array(d)}}else yield r;else{let n=0,o=r;for(;n!==o.size;){let d=await o.slice(n,Math.min(o.size,n+dP)).arrayBuffer();n+=d.byteLength,yield new Uint8Array(d)}}}var p7,dP,pP,Dk,xr,fa=St(()=>{p7=ue(lP(),1);dP=65536;i(Gd,"toIterator");pP=class Hd{static{i(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 d;ArrayBuffer.isView(s)?d=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?d=new Uint8Array(s.slice(0)):s instanceof Hd?d=s:d=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(d)?d.byteLength:d.size,this.#e.push(d)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let o=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(o)?o:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Gd(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 Gd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Gd(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:o}=this,s=e<0?Math.max(o+e,0):Math.min(e,o),d=r<0?Math.max(o+r,0):Math.min(r,o),m=Math.max(d-s,0),h=this.#e,v=[],_=0;for(let T of h){if(_>=m)break;let P=ArrayBuffer.isView(T)?T.byteLength:T.size;if(s&&P<=s)s-=P,d-=P;else{let S;ArrayBuffer.isView(T)?(S=T.subarray(s,Math.min(P,d)),_+=S.byteLength):(S=T.slice(s,Math.min(P,d)),_+=S.size),d-=P,v.push(S),s=0}}let x=new Hd([],{type:String(n).toLowerCase()});return x.#r=m,x.#e=v,x}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(pP.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});Dk=pP,xr=Dk});var $k,Ok,Vn,Wd=St(()=>{fa();$k=class extends xr{static{i(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 o=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(o)||(this.#e=o),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 xr&&/^(File)$/.test(e[Symbol.toStringTag])}},Ok=$k,Vn=Ok});function hP(t,e=xr){var r=`${fP()}${fP()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],o=`--${r}\r
|
|
15
15
|
Content-Disposition: form-data; name="`;return t.forEach((s,d)=>typeof s=="string"?n.push(o+Zd(d)+`"\r
|
|
16
16
|
\r
|
|
17
17
|
${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
@@ -20,61 +20,61 @@ ${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\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 ma,
|
|
24
|
-
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),di=i((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"),Gn=class{static{i(this,"FormData")}#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[ma](){return"FormData"}[
|
|
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=rt.START_BOUNDARY}write(e){let r=0,n=e.length,o=this.index,{lookbehind:s,boundary:d,boundaryChars:m,index:h,state:v,flags:_}=this,x=this.boundary.length,T=x-1,P=e.length,S,D,E=i(y=>{this[y+"Mark"]=r},"mark"),u=i(y=>{delete this[y+"Mark"]},"clear"),f=i((y,l,b,g)=>{(l===void 0||l!==b)&&this[y](g&&g.subarray(l,b))},"callback"),c=i((y,l)=>{let b=y+"Mark";b in this&&(l?(f(y,this[b],r,e),delete this[b]):(f(y,this[b],e.length,e),this[b]=0))},"dataCallback");for(r=0;r<n;r++)switch(S=e[r],v){case rt.START_BOUNDARY:if(h===d.length-2){if(S===ga)_|=Hn.LAST_BOUNDARY;else if(S!==Eu)return;h++;break}else if(h-1===d.length-2){if(_&Hn.LAST_BOUNDARY&&S===ga)v=rt.END,_=0;else if(!(_&Hn.LAST_BOUNDARY)&&S===Su)h=0,f("onPartBegin"),v=rt.HEADER_FIELD_START;else return;break}S!==d[h+2]&&(h=-2),S===d[h+2]&&h++;break;case rt.HEADER_FIELD_START:v=rt.HEADER_FIELD,E("onHeaderField"),h=0;case rt.HEADER_FIELD:if(S===Eu){u("onHeaderField"),v=rt.HEADERS_ALMOST_DONE;break}if(h++,S===ga)break;if(S===Ck){if(h===1)return;c("onHeaderField",!0),v=rt.HEADER_VALUE_START;break}if(D=zk(S),D<Nk||D>kk)return;break;case rt.HEADER_VALUE_START:if(S===Ok)break;E("onHeaderValue"),v=rt.HEADER_VALUE;case rt.HEADER_VALUE:S===Eu&&(c("onHeaderValue",!0),f("onHeaderEnd"),v=rt.HEADER_VALUE_ALMOST_DONE);break;case rt.HEADER_VALUE_ALMOST_DONE:if(S!==Su)return;v=rt.HEADER_FIELD_START;break;case rt.HEADERS_ALMOST_DONE:if(S!==Su)return;f("onHeadersEnd"),v=rt.PART_DATA_START;break;case rt.PART_DATA_START:v=rt.PART_DATA,E("onPartData");case rt.PART_DATA:if(o=h,h===0){for(r+=T;r<P&&!(e[r]in m);)r+=x;r-=T,S=e[r]}if(h<d.length)d[h]===S?(h===0&&c("onPartData",!0),h++):h=0;else if(h===d.length)h++,S===Eu?_|=Hn.PART_BOUNDARY:S===ga?_|=Hn.LAST_BOUNDARY:h=0;else if(h-1===d.length)if(_&Hn.PART_BOUNDARY){if(h=0,S===Su){_&=~Hn.PART_BOUNDARY,f("onPartEnd"),f("onPartBegin"),v=rt.HEADER_FIELD_START;break}}else _&Hn.LAST_BOUNDARY&&S===ga?(f("onPartEnd"),v=rt.END,_=0):h=0;if(h>0)s[h-1]=S;else if(o>0){let y=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);f("onPartData",0,o,y),o=0,E("onPartData"),r--}break;case rt.END:break;default:throw new Error(`Unexpected state entered: ${v}`)}c("onHeaderField"),c("onHeaderValue"),c("onPartData"),this.index=h,this.state=v,this.flags=_}end(){if(this.state===rt.HEADER_FIELD_START&&this.index===0||this.state===rt.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==rt.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};i(Uk,"_fileName");i(Mk,"toFormData")});async function ep(t){if(t[Bt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Bt].disturbed=!0,t[Bt].error)throw t[Bt].error;let{body:e}=t;if(e===null)return Xt.Buffer.alloc(0);if(!(e instanceof hr.default))return Xt.Buffer.alloc(0);let r=[],n=0;try{for await(let o of e){if(t.size>0&&n+o.length>t.size){let s=new Ut(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}n+=o.length,r.push(o)}}catch(o){throw o instanceof hn?o:new Ut(`Invalid response body while trying to fetch ${t.url}: ${o.message}`,"system",o)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(o=>typeof o=="string")?Xt.Buffer.from(r.join("")):Xt.Buffer.concat(r,n)}catch(o){throw new Ut(`Could not create Buffer from response body for ${t.url}: ${o.message}`,"system",o)}else throw new Ut(`Premature close of server response while trying to fetch ${t.url}`)}var hr,gn,Xt,Fk,Bt,jr,oo,Lk,xu,DP,$P,Iu=St(()=>{hr=ue(require("node:stream"),1),gn=require("node:util"),Xt=require("node:buffer");fa();_u();Kd();wu();bu();Fk=(0,gn.promisify)(hr.default.pipeline),Bt=Symbol("Body internals"),jr=class{static{i(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:Jd(e)?e=Xt.Buffer.from(e.toString()):ha(e)||Xt.Buffer.isBuffer(e)||(gn.types.isAnyArrayBuffer(e)?e=Xt.Buffer.from(e):ArrayBuffer.isView(e)?e=Xt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof hr.default||(e instanceof Gn?(e=fP(e),n=e.type.split("=")[1]):e=Xt.Buffer.from(String(e))));let o=e;Xt.Buffer.isBuffer(e)?o=hr.default.Readable.from(e):ha(e)&&(o=hr.default.Readable.from(e.stream())),this[Bt]={body:e,stream:o,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof hr.default&&e.on("error",s=>{let d=s instanceof hn?s:new Ut(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Bt].error=d})}get body(){return this[Bt].stream}get bodyUsed(){return this[Bt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await ep(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 Gn,o=new URLSearchParams(await this.text());for(let[s,d]of o)n.append(s,d);return n}let{toFormData:r}=await Promise.resolve().then(()=>(RP(),AP));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Bt].body&&this[Bt].body.type||"",r=await this.arrayBuffer();return new xr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await ep(this);return new TextDecoder().decode(e)}buffer(){return ep(this)}};jr.prototype.buffer=(0,gn.deprecate)(jr.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(jr.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,gn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});i(ep,"consumeBody");oo=i((t,e)=>{let r,n,{body:o}=t[Bt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof hr.default&&typeof o.getBoundary!="function"&&(r=new hr.PassThrough({highWaterMark:e}),n=new hr.PassThrough({highWaterMark:e}),o.pipe(r),o.pipe(n),t[Bt].stream=r,o=n),o},"clone"),Lk=(0,gn.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"),xu=i((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Jd(t)?"application/x-www-form-urlencoded;charset=UTF-8":ha(t)?t.type||null:Xt.Buffer.isBuffer(t)||gn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Gn?`multipart/form-data; boundary=${e[Bt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${Lk(t)}`:t instanceof hr.default?null:"text/plain;charset=UTF-8","extractContentType"),DP=i(t=>{let{body:e}=t[Bt];return e===null?0:ha(e)?e.size:Xt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),$P=i(async(t,{body:e})=>{e===null?t.end():await Fk(e,t)},"writeToStream")});function OP(t=[]){return new Vt(t.reduce((e,r,n,o)=>(n%2===0&&e.push(o.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return Au(e),rp(e,String(r)),!0}catch{return!1}}))}var tp,ya,Au,rp,Vt,Ru=St(()=>{tp=require("node:util"),ya=ue(require("node:http"),1),Au=typeof ya.default.validateHeaderName=="function"?ya.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}},rp=typeof ya.default.validateHeaderValue=="function"?ya.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}},Vt=class t extends URLSearchParams{static{i(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[o,s]of Object.entries(n))r.push(...s.map(d=>[o,d]))}else if(e!=null)if(typeof e=="object"&&!tp.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(o=>{if(typeof o!="object"||tp.types.isBoxedPrimitive(o))throw new TypeError("Each header pair must be an iterable object");return[...o]}).map(o=>{if(o.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...o]})}}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,o])=>(Au(n),rp(n,String(o)),[String(n).toLowerCase(),String(o)])):void 0,super(r),new Proxy(this,{get(n,o,s){switch(o){case"append":case"set":return(d,m)=>(Au(d),rp(d,String(m)),URLSearchParams.prototype[o].call(n,String(d).toLowerCase(),String(m)));case"delete":case"has":case"getAll":return d=>(Au(d),URLSearchParams.prototype[o].call(n,String(d).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,o,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(Vt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));i(OP,"fromRawHeaders")});var jk,va,np=St(()=>{jk=new Set([301,302,303,307,308]),va=i(t=>jk.has(t),"isRedirect")});var Ir,Qt,CP=St(()=>{Ru();Iu();np();Ir=Symbol("Response internals"),Qt=class t extends jr{static{i(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,o=new Vt(r.headers);if(e!==null&&!o.has("Content-Type")){let s=xu(e,this);s&&o.append("Content-Type",s)}this[Ir]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:o,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Ir].type}get url(){return this[Ir].url||""}get status(){return this[Ir].status}get ok(){return this[Ir].status>=200&&this[Ir].status<300}get redirected(){return this[Ir].counter>0}get statusText(){return this[Ir].statusText}get headers(){return this[Ir].headers}get highWaterMark(){return this[Ir].highWaterMark}clone(){return new t(oo(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(!va(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[Ir].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 o=new Vt(r&&r.headers);return o.has("content-type")||o.set("content-type","application/json"),new t(n,{...r,headers:o})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Qt.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 NP,kP=St(()=>{NP=i(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 zP(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 LP(t){if(!MP.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function qk(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,UP.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 ao(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:qk(t)}function jP(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 o=t.referrer,s=zP(o),d=zP(o,!0);s.toString().length>4096&&(s=d),e&&(s=e(s)),r&&(d=r(d));let m=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return d;case"unsafe-url":return s;case"strict-origin":return ao(s)&&!ao(m)?"no-referrer":d.toString();case"strict-origin-when-cross-origin":return s.origin===m.origin?s:ao(s)&&!ao(m)?"no-referrer":d;case"same-origin":return s.origin===m.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===m.origin?s:d;case"no-referrer-when-downgrade":return ao(s)&&!ao(m)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function qP(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&MP.has(n)&&(r=n);return r}var UP,MP,FP,ip=St(()=>{UP=require("node:net");i(zP,"stripURLForUseAsAReferrer");MP=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),FP="strict-origin-when-cross-origin";i(LP,"validateReferrerPolicy");i(qk,"isOriginPotentiallyTrustworthy");i(ao,"isUrlPotentiallyTrustworthy");i(jP,"determineRequestsReferrer");i(qP,"parseReferrerPolicyFromHeader")});var BP,VP,Rt,_a,Bk,Wn,GP,HP=St(()=>{BP=require("node:url"),VP=require("node:util");Ru();Iu();bu();kP();ip();Rt=Symbol("Request internals"),_a=i(t=>typeof t=="object"&&typeof t[Rt]=="object","isRequest"),Bk=(0,VP.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Wn=class t extends jr{static{i(this,"Request")}constructor(e,r={}){let n;if(_a(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 o=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)&&(o=o.toUpperCase()),!_a(r)&&"data"in r&&Bk(),(r.body!=null||_a(e)&&e.body!==null)&&(o==="GET"||o==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:_a(e)&&e.body!==null?oo(e):null;super(s,{size:r.size||e.size||0});let d=new Vt(r.headers||e.headers||{});if(s!==null&&!d.has("Content-Type")){let v=xu(s,this);v&&d.set("Content-Type",v)}let m=_a(e)?e.signal:null;if("signal"in r&&(m=r.signal),m!=null&&!mP(m))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let h=r.referrer==null?e.referrer:r.referrer;if(h==="")h="no-referrer";else if(h){let v=new URL(h);h=/^about:(\/\/)?client$/.test(v)?"client":v}else h=void 0;this[Rt]={method:o,redirect:r.redirect||e.redirect||"follow",headers:d,parsedURL:n,signal:m,referrer:h},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[Rt].method}get url(){return(0,BP.format)(this[Rt].parsedURL)}get headers(){return this[Rt].headers}get redirect(){return this[Rt].redirect}get signal(){return this[Rt].signal}get referrer(){if(this[Rt].referrer==="no-referrer")return"";if(this[Rt].referrer==="client")return"about:client";if(this[Rt].referrer)return this[Rt].referrer.toString()}get referrerPolicy(){return this[Rt].referrerPolicy}set referrerPolicy(e){this[Rt].referrerPolicy=LP(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Wn.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}});GP=i(t=>{let{parsedURL:e}=t[Rt],r=new Vt(t[Rt].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 m=DP(t);typeof m=="number"&&!Number.isNaN(m)&&(n=String(m))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=FP),t.referrer&&t.referrer!=="no-referrer"?t[Rt].referrer=jP(t):t[Rt].referrer="no-referrer",t[Rt].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:o}=t;typeof o=="function"&&(o=o(e));let s=NP(e),d={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:o};return{parsedURL:e,options:d}},"getNodeRequestOptions")});var wa,WP=St(()=>{wu();wa=class extends hn{static{i(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var JP={};Rs(JP,{AbortError:()=>wa,Blob:()=>xr,FetchError:()=>Ut,File:()=>Vn,FormData:()=>Gn,Headers:()=>Vt,Request:()=>Wn,Response:()=>Qt,blobFrom:()=>bP,blobFromSync:()=>PP,default:()=>op,fileFrom:()=>TP,fileFromSync:()=>SP,isRedirect:()=>va});async function op(t,e){return new Promise((r,n)=>{let o=new Wn(t,e),{parsedURL:s,options:d}=GP(o);if(!Vk.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let S=iP(o.url),D=new Qt(S,{headers:{"Content-Type":S.typeFull}});r(D);return}let m=(s.protocol==="https:"?KP.default:ZP.default).request,{signal:h}=o,v=null,_=i(()=>{let S=new wa("The operation was aborted.");n(S),o.body&&o.body instanceof er.default.Readable&&o.body.destroy(S),!(!v||!v.body)&&v.body.emit("error",S)},"abort");if(h&&h.aborted){_();return}let x=i(()=>{_(),P()},"abortAndFinalize"),T=m(s.toString(),d);h&&h.addEventListener("abort",x);let P=i(()=>{T.abort(),h&&h.removeEventListener("abort",x)},"finalize");T.on("error",S=>{n(new Ut(`request to ${o.url} failed, reason: ${S.message}`,"system",S)),P()}),Gk(T,S=>{v&&v.body&&v.body.destroy(S)}),process.version<"v14"&&T.on("socket",S=>{let D;S.prependListener("end",()=>{D=S._eventsCount}),S.prependListener("close",E=>{if(v&&D<S._eventsCount&&!E){let u=new Error("Premature close");u.code="ERR_STREAM_PREMATURE_CLOSE",v.body.emit("error",u)}})}),T.on("response",S=>{T.setTimeout(0);let D=OP(S.rawHeaders);if(va(S.statusCode)){let y=D.get("Location"),l=null;try{l=y===null?null:new URL(y,o.url)}catch{if(o.redirect!=="manual"){n(new Ut(`uri requested responds with an invalid redirect URL: ${y}`,"invalid-redirect")),P();return}}switch(o.redirect){case"error":n(new Ut(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),P();return;case"manual":break;case"follow":{if(l===null)break;if(o.counter>=o.follow){n(new Ut(`maximum redirect reached at: ${o.url}`,"max-redirect")),P();return}let b={headers:new Vt(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:oo(o),signal:o.signal,size:o.size,referrer:o.referrer,referrerPolicy:o.referrerPolicy};if(!hP(o.url,l)||!gP(o.url,l))for(let ae of["authorization","www-authenticate","cookie","cookie2"])b.headers.delete(ae);if(S.statusCode!==303&&o.body&&e.body instanceof er.default.Readable){n(new Ut("Cannot follow redirect with body being a readable stream","unsupported-redirect")),P();return}(S.statusCode===303||(S.statusCode===301||S.statusCode===302)&&o.method==="POST")&&(b.method="GET",b.body=void 0,b.headers.delete("content-length"));let g=qP(D);g&&(b.referrerPolicy=g),r(op(new Wn(l,b))),P();return}default:return n(new TypeError(`Redirect option '${o.redirect}' is not a valid value of RequestRedirect`))}}h&&S.once("end",()=>{h.removeEventListener("abort",x)});let E=(0,er.pipeline)(S,new er.PassThrough,y=>{y&&n(y)});process.version<"v12.10"&&S.on("aborted",x);let u={url:o.url,status:S.statusCode,statusText:S.statusMessage,headers:D,size:o.size,counter:o.counter,highWaterMark:o.highWaterMark},f=D.get("Content-Encoding");if(!o.compress||o.method==="HEAD"||f===null||S.statusCode===204||S.statusCode===304){v=new Qt(E,u),r(v);return}let c={flush:mi.default.Z_SYNC_FLUSH,finishFlush:mi.default.Z_SYNC_FLUSH};if(f==="gzip"||f==="x-gzip"){E=(0,er.pipeline)(E,mi.default.createGunzip(c),y=>{y&&n(y)}),v=new Qt(E,u),r(v);return}if(f==="deflate"||f==="x-deflate"){let y=(0,er.pipeline)(S,new er.PassThrough,l=>{l&&n(l)});y.once("data",l=>{(l[0]&15)===8?E=(0,er.pipeline)(E,mi.default.createInflate(),b=>{b&&n(b)}):E=(0,er.pipeline)(E,mi.default.createInflateRaw(),b=>{b&&n(b)}),v=new Qt(E,u),r(v)}),y.once("end",()=>{v||(v=new Qt(E,u),r(v))});return}if(f==="br"){E=(0,er.pipeline)(E,mi.default.createBrotliDecompress(),y=>{y&&n(y)}),v=new Qt(E,u),r(v);return}v=new Qt(E,u),r(v)}),$P(T,o).catch(n)})}function Gk(t,e){let r=Pa.Buffer.from(`0\r
|
|
23
|
+
`)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var ma,Ck,Nk,fP,kk,mP,Zd,di,Gn,_u=St(()=>{fa();Wd();({toStringTag:ma,iterator:Ck,hasInstance:Nk}=Symbol),fP=Math.random,kk="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),mP=i((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[ma])?[(r=r!==void 0?r+"":e[ma]=="File"?e.name:"blob",t),e.name!==r||e[ma]=="blob"?new Vn([e],r,e):e]:[t,e+""]),"f"),Zd=i((t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r
|
|
24
|
+
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),di=i((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"),Gn=class{static{i(this,"FormData")}#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[ma](){return"FormData"}[Ck](){return this.entries()}static[Nk](e){return e&&typeof e=="object"&&e[ma]==="FormData"&&!kk.some(r=>typeof e[r]!="function")}append(...e){di("append",arguments,2),this.#e.push(mP(...e))}delete(e){di("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){di("get",arguments,1),e+="";for(var r=this.#e,n=r.length,o=0;o<n;o++)if(r[o][0]===e)return r[o][1];return null}getAll(e,r){return di("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return di("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){di("forEach",arguments,1);for(var[n,o]of this)e.call(r,o,n,this)}set(...e){di("set",arguments,2);var r=[],n=!0;e=mP(...e),this.#e.forEach(o=>{o[0]===e[0]?n&&(n=!r.push(e)):r.push(o)}),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}};i(hP,"formDataToBlob")});var hn,wu=St(()=>{hn=class extends Error{static{i(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 Ut,Kd=St(()=>{wu();Ut=class extends hn{static{i(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var Pu,Jd,ha,gP,yP,vP,bu=St(()=>{Pu=Symbol.toStringTag,Jd=i(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[Pu]==="URLSearchParams","isURLSearchParameters"),ha=i(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[Pu]),"isBlob"),gP=i(t=>typeof t=="object"&&(t[Pu]==="AbortSignal"||t[Pu]==="EventTarget"),"isAbortSignal"),yP=i((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),vP=i((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var wP=L(($7,_P)=>{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)}_P.exports=globalThis.DOMException});var pi,PP,bP,Yd,TP,SP,EP,xP,IP,AP,Tu,Xd=St(()=>{pi=require("node:fs"),PP=require("node:path"),bP=ue(wP(),1);Wd();fa();({stat:Yd}=pi.promises),TP=i((t,e)=>IP((0,pi.statSync)(t),t,e),"blobFromSync"),SP=i((t,e)=>Yd(t).then(r=>IP(r,t,e)),"blobFrom"),EP=i((t,e)=>Yd(t).then(r=>AP(r,t,e)),"fileFrom"),xP=i((t,e)=>AP((0,pi.statSync)(t),t,e),"fileFromSync"),IP=i((t,e,r="")=>new xr([new Tu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),AP=i((t,e,r="")=>new Vn([new Tu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,PP.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),Tu=class t{static{i(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 Yd(this.#e);if(e>this.lastModified)throw new bP.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,pi.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var DP={};Rs(DP,{toFormData:()=>qk});function jk(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,(o,s)=>String.fromCharCode(s)),n}async function qk(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 Qd(r[1]||r[2]),o,s,d,m,h,v,_=[],x=new Gn,T=i(u=>{d+=E.decode(u,{stream:!0})},"onPartData"),P=i(u=>{_.push(u)},"appendToFile"),S=i(()=>{let u=new Vn(_,v,{type:h});x.append(m,u)},"appendFileToFormData"),D=i(()=>{x.append(m,d)},"appendEntryToFormData"),E=new TextDecoder("utf-8");E.decode(),n.onPartBegin=function(){n.onPartData=T,n.onPartEnd=D,o="",s="",d="",m="",h="",v=null,_.length=0},n.onHeaderField=function(u){o+=E.decode(u,{stream:!0})},n.onHeaderValue=function(u){s+=E.decode(u,{stream:!0})},n.onHeaderEnd=function(){if(s+=E.decode(),o=o.toLowerCase(),o==="content-disposition"){let u=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);u&&(m=u[2]||u[3]||""),v=jk(s),v&&(n.onPartData=P,n.onPartEnd=S)}else o==="content-type"&&(h=s);s="",o=""};for await(let u of t)n.write(u);return n.end(),x}var Lr,rt,RP,Hn,Su,Eu,zk,ga,Uk,Mk,Fk,Lk,fi,Qd,$P=St(()=>{Xd();_u();Lr=0,rt={START_BOUNDARY:Lr++,HEADER_FIELD_START:Lr++,HEADER_FIELD:Lr++,HEADER_VALUE_START:Lr++,HEADER_VALUE:Lr++,HEADER_VALUE_ALMOST_DONE:Lr++,HEADERS_ALMOST_DONE:Lr++,PART_DATA_START:Lr++,PART_DATA:Lr++,END:Lr++},RP=1,Hn={PART_BOUNDARY:RP,LAST_BOUNDARY:RP*=2},Su=10,Eu=13,zk=32,ga=45,Uk=58,Mk=97,Fk=122,Lk=i(t=>t|32,"lower"),fi=i(()=>{},"noop"),Qd=class{static{i(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=fi,this.onHeaderField=fi,this.onHeadersEnd=fi,this.onHeaderValue=fi,this.onPartBegin=fi,this.onPartData=fi,this.onPartEnd=fi,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=rt.START_BOUNDARY}write(e){let r=0,n=e.length,o=this.index,{lookbehind:s,boundary:d,boundaryChars:m,index:h,state:v,flags:_}=this,x=this.boundary.length,T=x-1,P=e.length,S,D,E=i(y=>{this[y+"Mark"]=r},"mark"),u=i(y=>{delete this[y+"Mark"]},"clear"),f=i((y,l,b,g)=>{(l===void 0||l!==b)&&this[y](g&&g.subarray(l,b))},"callback"),c=i((y,l)=>{let b=y+"Mark";b in this&&(l?(f(y,this[b],r,e),delete this[b]):(f(y,this[b],e.length,e),this[b]=0))},"dataCallback");for(r=0;r<n;r++)switch(S=e[r],v){case rt.START_BOUNDARY:if(h===d.length-2){if(S===ga)_|=Hn.LAST_BOUNDARY;else if(S!==Eu)return;h++;break}else if(h-1===d.length-2){if(_&Hn.LAST_BOUNDARY&&S===ga)v=rt.END,_=0;else if(!(_&Hn.LAST_BOUNDARY)&&S===Su)h=0,f("onPartBegin"),v=rt.HEADER_FIELD_START;else return;break}S!==d[h+2]&&(h=-2),S===d[h+2]&&h++;break;case rt.HEADER_FIELD_START:v=rt.HEADER_FIELD,E("onHeaderField"),h=0;case rt.HEADER_FIELD:if(S===Eu){u("onHeaderField"),v=rt.HEADERS_ALMOST_DONE;break}if(h++,S===ga)break;if(S===Uk){if(h===1)return;c("onHeaderField",!0),v=rt.HEADER_VALUE_START;break}if(D=Lk(S),D<Mk||D>Fk)return;break;case rt.HEADER_VALUE_START:if(S===zk)break;E("onHeaderValue"),v=rt.HEADER_VALUE;case rt.HEADER_VALUE:S===Eu&&(c("onHeaderValue",!0),f("onHeaderEnd"),v=rt.HEADER_VALUE_ALMOST_DONE);break;case rt.HEADER_VALUE_ALMOST_DONE:if(S!==Su)return;v=rt.HEADER_FIELD_START;break;case rt.HEADERS_ALMOST_DONE:if(S!==Su)return;f("onHeadersEnd"),v=rt.PART_DATA_START;break;case rt.PART_DATA_START:v=rt.PART_DATA,E("onPartData");case rt.PART_DATA:if(o=h,h===0){for(r+=T;r<P&&!(e[r]in m);)r+=x;r-=T,S=e[r]}if(h<d.length)d[h]===S?(h===0&&c("onPartData",!0),h++):h=0;else if(h===d.length)h++,S===Eu?_|=Hn.PART_BOUNDARY:S===ga?_|=Hn.LAST_BOUNDARY:h=0;else if(h-1===d.length)if(_&Hn.PART_BOUNDARY){if(h=0,S===Su){_&=~Hn.PART_BOUNDARY,f("onPartEnd"),f("onPartBegin"),v=rt.HEADER_FIELD_START;break}}else _&Hn.LAST_BOUNDARY&&S===ga?(f("onPartEnd"),v=rt.END,_=0):h=0;if(h>0)s[h-1]=S;else if(o>0){let y=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);f("onPartData",0,o,y),o=0,E("onPartData"),r--}break;case rt.END:break;default:throw new Error(`Unexpected state entered: ${v}`)}c("onHeaderField"),c("onHeaderValue"),c("onPartData"),this.index=h,this.state=v,this.flags=_}end(){if(this.state===rt.HEADER_FIELD_START&&this.index===0||this.state===rt.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==rt.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};i(jk,"_fileName");i(qk,"toFormData")});async function ep(t){if(t[Bt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Bt].disturbed=!0,t[Bt].error)throw t[Bt].error;let{body:e}=t;if(e===null)return Xt.Buffer.alloc(0);if(!(e instanceof hr.default))return Xt.Buffer.alloc(0);let r=[],n=0;try{for await(let o of e){if(t.size>0&&n+o.length>t.size){let s=new Ut(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}n+=o.length,r.push(o)}}catch(o){throw o instanceof hn?o:new Ut(`Invalid response body while trying to fetch ${t.url}: ${o.message}`,"system",o)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(o=>typeof o=="string")?Xt.Buffer.from(r.join("")):Xt.Buffer.concat(r,n)}catch(o){throw new Ut(`Could not create Buffer from response body for ${t.url}: ${o.message}`,"system",o)}else throw new Ut(`Premature close of server response while trying to fetch ${t.url}`)}var hr,gn,Xt,Bk,Bt,jr,oo,Vk,xu,OP,CP,Iu=St(()=>{hr=ue(require("node:stream"),1),gn=require("node:util"),Xt=require("node:buffer");fa();_u();Kd();wu();bu();Bk=(0,gn.promisify)(hr.default.pipeline),Bt=Symbol("Body internals"),jr=class{static{i(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:Jd(e)?e=Xt.Buffer.from(e.toString()):ha(e)||Xt.Buffer.isBuffer(e)||(gn.types.isAnyArrayBuffer(e)?e=Xt.Buffer.from(e):ArrayBuffer.isView(e)?e=Xt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof hr.default||(e instanceof Gn?(e=hP(e),n=e.type.split("=")[1]):e=Xt.Buffer.from(String(e))));let o=e;Xt.Buffer.isBuffer(e)?o=hr.default.Readable.from(e):ha(e)&&(o=hr.default.Readable.from(e.stream())),this[Bt]={body:e,stream:o,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof hr.default&&e.on("error",s=>{let d=s instanceof hn?s:new Ut(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Bt].error=d})}get body(){return this[Bt].stream}get bodyUsed(){return this[Bt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await ep(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 Gn,o=new URLSearchParams(await this.text());for(let[s,d]of o)n.append(s,d);return n}let{toFormData:r}=await Promise.resolve().then(()=>($P(),DP));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Bt].body&&this[Bt].body.type||"",r=await this.arrayBuffer();return new xr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await ep(this);return new TextDecoder().decode(e)}buffer(){return ep(this)}};jr.prototype.buffer=(0,gn.deprecate)(jr.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(jr.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,gn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});i(ep,"consumeBody");oo=i((t,e)=>{let r,n,{body:o}=t[Bt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof hr.default&&typeof o.getBoundary!="function"&&(r=new hr.PassThrough({highWaterMark:e}),n=new hr.PassThrough({highWaterMark:e}),o.pipe(r),o.pipe(n),t[Bt].stream=r,o=n),o},"clone"),Vk=(0,gn.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"),xu=i((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Jd(t)?"application/x-www-form-urlencoded;charset=UTF-8":ha(t)?t.type||null:Xt.Buffer.isBuffer(t)||gn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Gn?`multipart/form-data; boundary=${e[Bt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${Vk(t)}`:t instanceof hr.default?null:"text/plain;charset=UTF-8","extractContentType"),OP=i(t=>{let{body:e}=t[Bt];return e===null?0:ha(e)?e.size:Xt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),CP=i(async(t,{body:e})=>{e===null?t.end():await Bk(e,t)},"writeToStream")});function NP(t=[]){return new Vt(t.reduce((e,r,n,o)=>(n%2===0&&e.push(o.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return Au(e),rp(e,String(r)),!0}catch{return!1}}))}var tp,ya,Au,rp,Vt,Ru=St(()=>{tp=require("node:util"),ya=ue(require("node:http"),1),Au=typeof ya.default.validateHeaderName=="function"?ya.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}},rp=typeof ya.default.validateHeaderValue=="function"?ya.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}},Vt=class t extends URLSearchParams{static{i(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[o,s]of Object.entries(n))r.push(...s.map(d=>[o,d]))}else if(e!=null)if(typeof e=="object"&&!tp.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(o=>{if(typeof o!="object"||tp.types.isBoxedPrimitive(o))throw new TypeError("Each header pair must be an iterable object");return[...o]}).map(o=>{if(o.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...o]})}}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,o])=>(Au(n),rp(n,String(o)),[String(n).toLowerCase(),String(o)])):void 0,super(r),new Proxy(this,{get(n,o,s){switch(o){case"append":case"set":return(d,m)=>(Au(d),rp(d,String(m)),URLSearchParams.prototype[o].call(n,String(d).toLowerCase(),String(m)));case"delete":case"has":case"getAll":return d=>(Au(d),URLSearchParams.prototype[o].call(n,String(d).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,o,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(Vt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));i(NP,"fromRawHeaders")});var Gk,va,np=St(()=>{Gk=new Set([301,302,303,307,308]),va=i(t=>Gk.has(t),"isRedirect")});var Ir,Qt,kP=St(()=>{Ru();Iu();np();Ir=Symbol("Response internals"),Qt=class t extends jr{static{i(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,o=new Vt(r.headers);if(e!==null&&!o.has("Content-Type")){let s=xu(e,this);s&&o.append("Content-Type",s)}this[Ir]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:o,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Ir].type}get url(){return this[Ir].url||""}get status(){return this[Ir].status}get ok(){return this[Ir].status>=200&&this[Ir].status<300}get redirected(){return this[Ir].counter>0}get statusText(){return this[Ir].statusText}get headers(){return this[Ir].headers}get highWaterMark(){return this[Ir].highWaterMark}clone(){return new t(oo(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(!va(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[Ir].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 o=new Vt(r&&r.headers);return o.has("content-type")||o.set("content-type","application/json"),new t(n,{...r,headers:o})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Qt.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 zP,UP=St(()=>{zP=i(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 MP(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 qP(t){if(!LP.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function Hk(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,FP.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 ao(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:Hk(t)}function BP(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 o=t.referrer,s=MP(o),d=MP(o,!0);s.toString().length>4096&&(s=d),e&&(s=e(s)),r&&(d=r(d));let m=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return d;case"unsafe-url":return s;case"strict-origin":return ao(s)&&!ao(m)?"no-referrer":d.toString();case"strict-origin-when-cross-origin":return s.origin===m.origin?s:ao(s)&&!ao(m)?"no-referrer":d;case"same-origin":return s.origin===m.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===m.origin?s:d;case"no-referrer-when-downgrade":return ao(s)&&!ao(m)?"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&&LP.has(n)&&(r=n);return r}var FP,LP,jP,ip=St(()=>{FP=require("node:net");i(MP,"stripURLForUseAsAReferrer");LP=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),jP="strict-origin-when-cross-origin";i(qP,"validateReferrerPolicy");i(Hk,"isOriginPotentiallyTrustworthy");i(ao,"isUrlPotentiallyTrustworthy");i(BP,"determineRequestsReferrer");i(VP,"parseReferrerPolicyFromHeader")});var GP,HP,Rt,_a,Wk,Wn,WP,ZP=St(()=>{GP=require("node:url"),HP=require("node:util");Ru();Iu();bu();UP();ip();Rt=Symbol("Request internals"),_a=i(t=>typeof t=="object"&&typeof t[Rt]=="object","isRequest"),Wk=(0,HP.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Wn=class t extends jr{static{i(this,"Request")}constructor(e,r={}){let n;if(_a(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 o=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)&&(o=o.toUpperCase()),!_a(r)&&"data"in r&&Wk(),(r.body!=null||_a(e)&&e.body!==null)&&(o==="GET"||o==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:_a(e)&&e.body!==null?oo(e):null;super(s,{size:r.size||e.size||0});let d=new Vt(r.headers||e.headers||{});if(s!==null&&!d.has("Content-Type")){let v=xu(s,this);v&&d.set("Content-Type",v)}let m=_a(e)?e.signal:null;if("signal"in r&&(m=r.signal),m!=null&&!gP(m))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let h=r.referrer==null?e.referrer:r.referrer;if(h==="")h="no-referrer";else if(h){let v=new URL(h);h=/^about:(\/\/)?client$/.test(v)?"client":v}else h=void 0;this[Rt]={method:o,redirect:r.redirect||e.redirect||"follow",headers:d,parsedURL:n,signal:m,referrer:h},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[Rt].method}get url(){return(0,GP.format)(this[Rt].parsedURL)}get headers(){return this[Rt].headers}get redirect(){return this[Rt].redirect}get signal(){return this[Rt].signal}get referrer(){if(this[Rt].referrer==="no-referrer")return"";if(this[Rt].referrer==="client")return"about:client";if(this[Rt].referrer)return this[Rt].referrer.toString()}get referrerPolicy(){return this[Rt].referrerPolicy}set referrerPolicy(e){this[Rt].referrerPolicy=qP(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Wn.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}});WP=i(t=>{let{parsedURL:e}=t[Rt],r=new Vt(t[Rt].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 m=OP(t);typeof m=="number"&&!Number.isNaN(m)&&(n=String(m))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=jP),t.referrer&&t.referrer!=="no-referrer"?t[Rt].referrer=BP(t):t[Rt].referrer="no-referrer",t[Rt].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:o}=t;typeof o=="function"&&(o=o(e));let s=zP(e),d={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:o};return{parsedURL:e,options:d}},"getNodeRequestOptions")});var wa,KP=St(()=>{wu();wa=class extends hn{static{i(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var XP={};Rs(XP,{AbortError:()=>wa,Blob:()=>xr,FetchError:()=>Ut,File:()=>Vn,FormData:()=>Gn,Headers:()=>Vt,Request:()=>Wn,Response:()=>Qt,blobFrom:()=>SP,blobFromSync:()=>TP,default:()=>op,fileFrom:()=>EP,fileFromSync:()=>xP,isRedirect:()=>va});async function op(t,e){return new Promise((r,n)=>{let o=new Wn(t,e),{parsedURL:s,options:d}=WP(o);if(!Zk.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let S=aP(o.url),D=new Qt(S,{headers:{"Content-Type":S.typeFull}});r(D);return}let m=(s.protocol==="https:"?YP.default:JP.default).request,{signal:h}=o,v=null,_=i(()=>{let S=new wa("The operation was aborted.");n(S),o.body&&o.body instanceof er.default.Readable&&o.body.destroy(S),!(!v||!v.body)&&v.body.emit("error",S)},"abort");if(h&&h.aborted){_();return}let x=i(()=>{_(),P()},"abortAndFinalize"),T=m(s.toString(),d);h&&h.addEventListener("abort",x);let P=i(()=>{T.abort(),h&&h.removeEventListener("abort",x)},"finalize");T.on("error",S=>{n(new Ut(`request to ${o.url} failed, reason: ${S.message}`,"system",S)),P()}),Kk(T,S=>{v&&v.body&&v.body.destroy(S)}),process.version<"v14"&&T.on("socket",S=>{let D;S.prependListener("end",()=>{D=S._eventsCount}),S.prependListener("close",E=>{if(v&&D<S._eventsCount&&!E){let u=new Error("Premature close");u.code="ERR_STREAM_PREMATURE_CLOSE",v.body.emit("error",u)}})}),T.on("response",S=>{T.setTimeout(0);let D=NP(S.rawHeaders);if(va(S.statusCode)){let y=D.get("Location"),l=null;try{l=y===null?null:new URL(y,o.url)}catch{if(o.redirect!=="manual"){n(new Ut(`uri requested responds with an invalid redirect URL: ${y}`,"invalid-redirect")),P();return}}switch(o.redirect){case"error":n(new Ut(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),P();return;case"manual":break;case"follow":{if(l===null)break;if(o.counter>=o.follow){n(new Ut(`maximum redirect reached at: ${o.url}`,"max-redirect")),P();return}let b={headers:new Vt(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:oo(o),signal:o.signal,size:o.size,referrer:o.referrer,referrerPolicy:o.referrerPolicy};if(!yP(o.url,l)||!vP(o.url,l))for(let ae of["authorization","www-authenticate","cookie","cookie2"])b.headers.delete(ae);if(S.statusCode!==303&&o.body&&e.body instanceof er.default.Readable){n(new Ut("Cannot follow redirect with body being a readable stream","unsupported-redirect")),P();return}(S.statusCode===303||(S.statusCode===301||S.statusCode===302)&&o.method==="POST")&&(b.method="GET",b.body=void 0,b.headers.delete("content-length"));let g=VP(D);g&&(b.referrerPolicy=g),r(op(new Wn(l,b))),P();return}default:return n(new TypeError(`Redirect option '${o.redirect}' is not a valid value of RequestRedirect`))}}h&&S.once("end",()=>{h.removeEventListener("abort",x)});let E=(0,er.pipeline)(S,new er.PassThrough,y=>{y&&n(y)});process.version<"v12.10"&&S.on("aborted",x);let u={url:o.url,status:S.statusCode,statusText:S.statusMessage,headers:D,size:o.size,counter:o.counter,highWaterMark:o.highWaterMark},f=D.get("Content-Encoding");if(!o.compress||o.method==="HEAD"||f===null||S.statusCode===204||S.statusCode===304){v=new Qt(E,u),r(v);return}let c={flush:mi.default.Z_SYNC_FLUSH,finishFlush:mi.default.Z_SYNC_FLUSH};if(f==="gzip"||f==="x-gzip"){E=(0,er.pipeline)(E,mi.default.createGunzip(c),y=>{y&&n(y)}),v=new Qt(E,u),r(v);return}if(f==="deflate"||f==="x-deflate"){let y=(0,er.pipeline)(S,new er.PassThrough,l=>{l&&n(l)});y.once("data",l=>{(l[0]&15)===8?E=(0,er.pipeline)(E,mi.default.createInflate(),b=>{b&&n(b)}):E=(0,er.pipeline)(E,mi.default.createInflateRaw(),b=>{b&&n(b)}),v=new Qt(E,u),r(v)}),y.once("end",()=>{v||(v=new Qt(E,u),r(v))});return}if(f==="br"){E=(0,er.pipeline)(E,mi.default.createBrotliDecompress(),y=>{y&&n(y)}),v=new Qt(E,u),r(v);return}v=new Qt(E,u),r(v)}),CP(T,o).catch(n)})}function Kk(t,e){let r=Pa.Buffer.from(`0\r
|
|
26
26
|
\r
|
|
27
|
-
`),n=!1,o=!1,s;t.on("response",d=>{let{headers:m}=d;n=m["transfer-encoding"]==="chunked"&&!m["content-length"]}),t.on("socket",d=>{let m=i(()=>{if(n&&!o){let v=new Error("Premature close");v.code="ERR_STREAM_PREMATURE_CLOSE",e(v)}},"onSocketClose"),h=i(v=>{o=Pa.Buffer.compare(v.slice(-5),r)===0,!o&&s&&(o=Pa.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&Pa.Buffer.compare(v.slice(-2),r.slice(3))===0),s=v},"onData");d.prependListener("close",m),d.on("data",h),t.on("close",()=>{d.removeListener("close",m),d.removeListener("data",h)})})}var
|
|
27
|
+
`),n=!1,o=!1,s;t.on("response",d=>{let{headers:m}=d;n=m["transfer-encoding"]==="chunked"&&!m["content-length"]}),t.on("socket",d=>{let m=i(()=>{if(n&&!o){let v=new Error("Premature close");v.code="ERR_STREAM_PREMATURE_CLOSE",e(v)}},"onSocketClose"),h=i(v=>{o=Pa.Buffer.compare(v.slice(-5),r)===0,!o&&s&&(o=Pa.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&Pa.Buffer.compare(v.slice(-2),r.slice(3))===0),s=v},"onData");d.prependListener("close",m),d.on("data",h),t.on("close",()=>{d.removeListener("close",m),d.removeListener("data",h)})})}var JP,YP,mi,er,Pa,Zk,QP=St(()=>{JP=ue(require("node:http"),1),YP=ue(require("node:https"),1),mi=ue(require("node:zlib"),1),er=ue(require("node:stream"),1),Pa=require("node:buffer");sP();Iu();kP();Ru();ZP();Kd();KP();np();_u();bu();ip();Xd();Zk=new Set(["data:","http:","https:"]);i(op,"fetch");i(Kk,"fixResponseChunkedTransferBadEnding")});var rb=L(uo=>{"use strict";var Jk=uo&&uo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},so;Object.defineProperty(uo,"__esModule",{value:!0});uo.Gaxios=void 0;var Yk=Jk(da()),Xk=require("https"),hi=kd(),Qk=Nw(),eb=require("stream"),tb=Md(),ez=i(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),tz=204,Du=class{static{i(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new tb.GaxiosInterceptorManager,response:new tb.GaxiosInterceptorManager}}fetch(...e){let r=e[0],n=e[1],o,s=new Headers;return typeof r=="string"?o=new URL(r):r instanceof URL?o=r:r&&r.url&&(o=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&so.mergeHeaders(s,r.headers),n&&so.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:o}):this.request({...n,headers:s,url:o})}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 so.#u(),n={...e};delete n.data;let o=await r(e.url,n),s=await this.getResponseData(e,o);return Object.getOwnPropertyDescriptor(o,"data")?.configurable||Object.defineProperties(o,{data:{configurable:!0,writable:!0,enumerable:!0,value:s}}),Object.assign(o,{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 o=[];for await(let s of r.data)o.push(s);r.data=o.toString()}let n=hi.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new hi.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof hi.GaxiosError?n=r:r instanceof Error?n=new hi.GaxiosError(r.message,e,void 0,r):n=new hi.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:o,config:s}=await(0,Qk.getRetryConfig)(n);if(o&&s)return n.config.retryConfig.currentRetryAttempt=s.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#i(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,r){if(r.status===tz)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new hi.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),o=[...r],s=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let d of s)o.push(d.trim());for(let d of o)if(d instanceof RegExp){if(d.test(n.toString()))return!1}else if(d instanceof URL){if(d.origin===n.origin)return!1}else if(d.startsWith("*.")||d.startsWith(".")){let m=d.replace(/^\*\./,".");if(n.hostname.endsWith(m))return!1}else if(d===n.origin||d===n.hostname||d===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);so.mergeHeaders(r,e.headers);let n=(0,Yk.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 d=n.paramsSerializer(n.params);d.startsWith("?")&&(d=d.slice(1));let m=n.url.toString().includes("?")?"&":"?";n.url=n.url+m+d}else{let d=n.url instanceof URL?n.url:new URL(n.url);for(let[m,h]of new URLSearchParams(n.params))d.searchParams.append(m,h);n.url=d}typeof e.maxContentLength=="number"&&(n.size=e.maxContentLength),typeof e.maxRedirects=="number"&&(n.follow=e.maxRedirects);let o=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 eb.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 d=await ez();r.set("content-type",`multipart/related; boundary=${d}`),n.body=eb.Readable.from(this.getMultipartRequest(n.multipart,d))}else o?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 d=await so.#s();this.agentCache.has(s)?n.agent=this.agentCache.get(s):(n.agent=new d(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 Xk.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=hi.defaultErrorRedactor),n.body&&!("duplex"in n)&&(n.duplex="half"),this.#i(n),Object.assign(n,{headers:r,url:n.url instanceof URL?n.url:new URL(n.url)})}#i(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 o of e){let s=o.headers.get("Content-Type")||"application/octet-stream";yield`--${r}\r
|
|
28
28
|
Content-Type: ${s}\r
|
|
29
29
|
\r
|
|
30
30
|
`,typeof o.content=="string"?yield o.content:yield*o.content,yield`\r
|
|
31
|
-
`}yield n}static#o;static#a;static async#s(){return this.#o||=(await Promise.resolve().then(()=>ue(nP()))).HttpsProxyAgent,this.#o}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(YP(),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,d)=>{d==="set-cookie"?e.append(d,s):e.set(d,s)});return e}};uo.Gaxios=Du;so=Du});var gt=L(Mt=>{"use strict";var Xk=Mt&&Mt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qk=Mt&&Mt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Xk(e,t,r)};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.instance=Mt.Gaxios=Mt.GaxiosError=void 0;Mt.request=tz;var tb=eb();Object.defineProperty(Mt,"Gaxios",{enumerable:!0,get:i(function(){return tb.Gaxios},"get")});var ez=kd();Object.defineProperty(Mt,"GaxiosError",{enumerable:!0,get:i(function(){return ez.GaxiosError},"get")});Qk(Md(),Mt);Mt.instance=new tb.Gaxios;async function tz(t){return Mt.instance.request(t)}i(tz,"request")});var ap=L((rb,$u)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,o=Math.floor,s="[BigNumber Error] ",d=s+"Number primitive has more than 15 significant digits: ",m=1e14,h=14,v=9007199254740991,_=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],x=1e7,T=1e9;function P(l){var b,g,ae,re=ie.prototype={constructor:ie,toString:null,valueOf:null},Ue=new ie(1),se=20,X=4,Y=-7,ne=21,ee=-1e7,ce=1e7,de=!1,ke=1,Me=0,Ke={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Qe="0123456789abcdefghijklmnopqrstuvwxyz",Tt=!0;function ie(A,$){var C,q,z,F,H,k,M,V,j=this;if(!(j instanceof ie))return new ie(A,$);if($==null){if(A&&A._isBigNumber===!0){j.s=A.s,!A.c||A.e>ce?j.c=j.e=null:A.e<ee?j.c=[j.e=0]:(j.e=A.e,j.c=A.c.slice());return}if((k=typeof A=="number")&&A*0==0){if(j.s=1/A<0?(A=-A,-1):1,A===~~A){for(F=0,H=A;H>=10;H/=10,F++);F>ce?j.c=j.e=null:(j.e=F,j.c=[A]);return}V=String(A)}else{if(!r.test(V=String(A)))return ae(j,V,k);j.s=V.charCodeAt(0)==45?(V=V.slice(1),-1):1}(F=V.indexOf("."))>-1&&(V=V.replace(".","")),(H=V.search(/e/i))>0?(F<0&&(F=H),F+=+V.slice(H+1),V=V.substring(0,H)):F<0&&(F=V.length)}else{if(u($,2,Qe.length,"Base"),$==10&&Tt)return j=new ie(A),Ze(j,se+j.e+1,X);if(V=String(A),k=typeof A=="number"){if(A*0!=0)return ae(j,V,k,$);if(j.s=1/A<0?(V=V.slice(1),-1):1,ie.DEBUG&&V.replace(/^0\.0*|\./,"").length>15)throw Error(d+A)}else j.s=V.charCodeAt(0)===45?(V=V.slice(1),-1):1;for(C=Qe.slice(0,$),F=H=0,M=V.length;H<M;H++)if(C.indexOf(q=V.charAt(H))<0){if(q=="."){if(H>F){F=M;continue}}else if(!z&&(V==V.toUpperCase()&&(V=V.toLowerCase())||V==V.toLowerCase()&&(V=V.toUpperCase()))){z=!0,H=-1,F=0;continue}return ae(j,String(A),k,$)}k=!1,V=g(V,$,10,j.s),(F=V.indexOf("."))>-1?V=V.replace(".",""):F=V.length}for(H=0;V.charCodeAt(H)===48;H++);for(M=V.length;V.charCodeAt(--M)===48;);if(V=V.slice(H,++M)){if(M-=H,k&&ie.DEBUG&&M>15&&(A>v||A!==o(A)))throw Error(d+j.s*A);if((F=F-H-1)>ce)j.c=j.e=null;else if(F<ee)j.c=[j.e=0];else{if(j.e=F,j.c=[],H=(F+1)%h,F<0&&(H+=h),H<M){for(H&&j.c.push(+V.slice(0,H)),M-=h;H<M;)j.c.push(+V.slice(H,H+=h));H=h-(V=V.slice(H)).length}else H-=M;for(;H--;V+="0");j.c.push(+V)}}else j.c=[j.e=0]}i(ie,"BigNumber"),ie.clone=P,ie.ROUND_UP=0,ie.ROUND_DOWN=1,ie.ROUND_CEIL=2,ie.ROUND_FLOOR=3,ie.ROUND_HALF_UP=4,ie.ROUND_HALF_DOWN=5,ie.ROUND_HALF_EVEN=6,ie.ROUND_HALF_CEIL=7,ie.ROUND_HALF_FLOOR=8,ie.EUCLID=9,ie.config=ie.set=function(A){var $,C;if(A!=null)if(typeof A=="object"){if(A.hasOwnProperty($="DECIMAL_PLACES")&&(C=A[$],u(C,0,T,$),se=C),A.hasOwnProperty($="ROUNDING_MODE")&&(C=A[$],u(C,0,8,$),X=C),A.hasOwnProperty($="EXPONENTIAL_AT")&&(C=A[$],C&&C.pop?(u(C[0],-T,0,$),u(C[1],0,T,$),Y=C[0],ne=C[1]):(u(C,-T,T,$),Y=-(ne=C<0?-C:C))),A.hasOwnProperty($="RANGE"))if(C=A[$],C&&C.pop)u(C[0],-T,-1,$),u(C[1],1,T,$),ee=C[0],ce=C[1];else if(u(C,-T,T,$),C)ee=-(ce=C<0?-C:C);else throw Error(s+$+" cannot be zero: "+C);if(A.hasOwnProperty($="CRYPTO"))if(C=A[$],C===!!C)if(C)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))de=C;else throw de=!C,Error(s+"crypto unavailable");else de=C;else throw Error(s+$+" not true or false: "+C);if(A.hasOwnProperty($="MODULO_MODE")&&(C=A[$],u(C,0,9,$),ke=C),A.hasOwnProperty($="POW_PRECISION")&&(C=A[$],u(C,0,T,$),Me=C),A.hasOwnProperty($="FORMAT"))if(C=A[$],typeof C=="object")Ke=C;else throw Error(s+$+" not an object: "+C);if(A.hasOwnProperty($="ALPHABET"))if(C=A[$],typeof C=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(C))Tt=C.slice(0,10)=="0123456789",Qe=C;else throw Error(s+$+" invalid: "+C)}else throw Error(s+"Object expected: "+A);return{DECIMAL_PLACES:se,ROUNDING_MODE:X,EXPONENTIAL_AT:[Y,ne],RANGE:[ee,ce],CRYPTO:de,MODULO_MODE:ke,POW_PRECISION:Me,FORMAT:Ke,ALPHABET:Qe}},ie.isBigNumber=function(A){if(!A||A._isBigNumber!==!0)return!1;if(!ie.DEBUG)return!0;var $,C,q=A.c,z=A.e,F=A.s;e:if({}.toString.call(q)=="[object Array]"){if((F===1||F===-1)&&z>=-T&&z<=T&&z===o(z)){if(q[0]===0){if(z===0&&q.length===1)return!0;break e}if($=(z+1)%h,$<1&&($+=h),String(q[0]).length==$){for($=0;$<q.length;$++)if(C=q[$],C<0||C>=m||C!==o(C))break e;if(C!==0)return!0}}}else if(q===null&&z===null&&(F===null||F===1||F===-1))return!0;throw Error(s+"Invalid BigNumber: "+A)},ie.maximum=ie.max=function(){return ft(arguments,-1)},ie.minimum=ie.min=function(){return ft(arguments,1)},ie.random=(function(){var A=9007199254740992,$=Math.random()*A&2097151?function(){return o(Math.random()*A)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(C){var q,z,F,H,k,M=0,V=[],j=new ie(Ue);if(C==null?C=se:u(C,0,T),H=n(C/h),de)if(crypto.getRandomValues){for(q=crypto.getRandomValues(new Uint32Array(H*=2));M<H;)k=q[M]*131072+(q[M+1]>>>11),k>=9e15?(z=crypto.getRandomValues(new Uint32Array(2)),q[M]=z[0],q[M+1]=z[1]):(V.push(k%1e14),M+=2);M=H/2}else if(crypto.randomBytes){for(q=crypto.randomBytes(H*=7);M<H;)k=(q[M]&31)*281474976710656+q[M+1]*1099511627776+q[M+2]*4294967296+q[M+3]*16777216+(q[M+4]<<16)+(q[M+5]<<8)+q[M+6],k>=9e15?crypto.randomBytes(7).copy(q,M):(V.push(k%1e14),M+=7);M=H/7}else throw de=!1,Error(s+"crypto unavailable");if(!de)for(;M<H;)k=$(),k<9e15&&(V[M++]=k%1e14);for(H=V[--M],C%=h,H&&C&&(k=_[h-C],V[M]=o(H/k)*k);V[M]===0;V.pop(),M--);if(M<0)V=[F=0];else{for(F=-1;V[0]===0;V.splice(0,1),F-=h);for(M=1,k=V[0];k>=10;k/=10,M++);M<h&&(F-=h-M)}return j.e=F,j.c=V,j}})(),ie.sum=function(){for(var A=1,$=arguments,C=new ie($[0]);A<$.length;)C=C.plus($[A++]);return C},g=(function(){var A="0123456789";function $(C,q,z,F){for(var H,k=[0],M,V=0,j=C.length;V<j;){for(M=k.length;M--;k[M]*=q);for(k[0]+=F.indexOf(C.charAt(V++)),H=0;H<k.length;H++)k[H]>z-1&&(k[H+1]==null&&(k[H+1]=0),k[H+1]+=k[H]/z|0,k[H]%=z)}return k.reverse()}return i($,"toBaseOut"),function(C,q,z,F,H){var k,M,V,j,Q,pe,he,Ge,nt=C.indexOf("."),ot=se,Be=X;for(nt>=0&&(j=Me,Me=0,C=C.replace(".",""),Ge=new ie(q),pe=Ge.pow(C.length-nt),Me=j,Ge.c=$(y(D(pe.c),pe.e,"0"),10,z,A),Ge.e=Ge.c.length),he=$(C,q,z,H?(k=Qe,A):(k=A,Qe)),V=j=he.length;he[--j]==0;he.pop());if(!he[0])return k.charAt(0);if(nt<0?--V:(pe.c=he,pe.e=V,pe.s=F,pe=b(pe,Ge,ot,Be,z),he=pe.c,Q=pe.r,V=pe.e),M=V+ot+1,nt=he[M],j=z/2,Q=Q||M<0||he[M+1]!=null,Q=Be<4?(nt!=null||Q)&&(Be==0||Be==(pe.s<0?3:2)):nt>j||nt==j&&(Be==4||Q||Be==6&&he[M-1]&1||Be==(pe.s<0?8:7)),M<1||!he[0])C=Q?y(k.charAt(1),-ot,k.charAt(0)):k.charAt(0);else{if(he.length=M,Q)for(--z;++he[--M]>z;)he[M]=0,M||(++V,he=[1].concat(he));for(j=he.length;!he[--j];);for(nt=0,C="";nt<=j;C+=k.charAt(he[nt++]));C=y(C,V,k.charAt(0))}return C}})(),b=(function(){function A(q,z,F){var H,k,M,V,j=0,Q=q.length,pe=z%x,he=z/x|0;for(q=q.slice();Q--;)M=q[Q]%x,V=q[Q]/x|0,H=he*M+V*pe,k=pe*M+H%x*x+j,j=(k/F|0)+(H/x|0)+he*V,q[Q]=k%F;return j&&(q=[j].concat(q)),q}i(A,"multiply");function $(q,z,F,H){var k,M;if(F!=H)M=F>H?1:-1;else for(k=M=0;k<F;k++)if(q[k]!=z[k]){M=q[k]>z[k]?1:-1;break}return M}i($,"compare");function C(q,z,F,H){for(var k=0;F--;)q[F]-=k,k=q[F]<z[F]?1:0,q[F]=k*H+q[F]-z[F];for(;!q[0]&&q.length>1;q.splice(0,1));}return i(C,"subtract"),function(q,z,F,H,k){var M,V,j,Q,pe,he,Ge,nt,ot,Be,We,wt,Si,Ei,xi,Wt,en,Dt=q.s==z.s?1:-1,Pt=q.c,Ye=z.c;if(!Pt||!Pt[0]||!Ye||!Ye[0])return new ie(!q.s||!z.s||(Pt?Ye&&Pt[0]==Ye[0]:!Ye)?NaN:Pt&&Pt[0]==0||!Ye?Dt*0:Dt/0);for(nt=new ie(Dt),ot=nt.c=[],V=q.e-z.e,Dt=F+V+1,k||(k=m,V=S(q.e/h)-S(z.e/h),Dt=Dt/h|0),j=0;Ye[j]==(Pt[j]||0);j++);if(Ye[j]>(Pt[j]||0)&&V--,Dt<0)ot.push(1),Q=!0;else{for(Ei=Pt.length,Wt=Ye.length,j=0,Dt+=2,pe=o(k/(Ye[0]+1)),pe>1&&(Ye=A(Ye,pe,k),Pt=A(Pt,pe,k),Wt=Ye.length,Ei=Pt.length),Si=Wt,Be=Pt.slice(0,Wt),We=Be.length;We<Wt;Be[We++]=0);en=Ye.slice(),en=[0].concat(en),xi=Ye[0],Ye[1]>=k/2&&xi++;do{if(pe=0,M=$(Ye,Be,Wt,We),M<0){if(wt=Be[0],Wt!=We&&(wt=wt*k+(Be[1]||0)),pe=o(wt/xi),pe>1)for(pe>=k&&(pe=k-1),he=A(Ye,pe,k),Ge=he.length,We=Be.length;$(he,Be,Ge,We)==1;)pe--,C(he,Wt<Ge?en:Ye,Ge,k),Ge=he.length,M=1;else pe==0&&(M=pe=1),he=Ye.slice(),Ge=he.length;if(Ge<We&&(he=[0].concat(he)),C(Be,he,We,k),We=Be.length,M==-1)for(;$(Ye,Be,Wt,We)<1;)pe++,C(Be,Wt<We?en:Ye,We,k),We=Be.length}else M===0&&(pe++,Be=[0]);ot[j++]=pe,Be[0]?Be[We++]=Pt[Si]||0:(Be=[Pt[Si]],We=1)}while((Si++<Ei||Be[0]!=null)&&Dt--);Q=Be[0]!=null,ot[0]||ot.splice(0,1)}if(k==m){for(j=1,Dt=ot[0];Dt>=10;Dt/=10,j++);Ze(nt,F+(nt.e=j+V*h-1)+1,H,Q)}else nt.e=V,nt.r=+Q;return nt}})();function lt(A,$,C,q){var z,F,H,k,M;if(C==null?C=X:u(C,0,8),!A.c)return A.toString();if(z=A.c[0],H=A.e,$==null)M=D(A.c),M=q==1||q==2&&(H<=Y||H>=ne)?c(M,H):y(M,H,"0");else if(A=Ze(new ie(A),$,C),F=A.e,M=D(A.c),k=M.length,q==1||q==2&&($<=F||F<=Y)){for(;k<$;M+="0",k++);M=c(M,F)}else if($-=H+(q===2&&F>H),M=y(M,F,"0"),F+1>k){if(--$>0)for(M+=".";$--;M+="0");}else if($+=F-k,$>0)for(F+1==k&&(M+=".");$--;M+="0");return A.s<0&&z?"-"+M:M}i(lt,"format");function ft(A,$){for(var C,q,z=1,F=new ie(A[0]);z<A.length;z++)q=new ie(A[z]),(!q.s||(C=E(F,q))===$||C===0&&F.s===$)&&(F=q);return F}i(ft,"maxOrMin");function Ht(A,$,C){for(var q=1,z=$.length;!$[--z];$.pop());for(z=$[0];z>=10;z/=10,q++);return(C=q+C*h-1)>ce?A.c=A.e=null:C<ee?A.c=[A.e=0]:(A.e=C,A.c=$),A}i(Ht,"normalise"),ae=(function(){var A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,$=/^([^.]+)\.$/,C=/^\.([^.]+)$/,q=/^-?(Infinity|NaN)$/,z=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,H,k,M){var V,j=k?H:H.replace(z,"");if(q.test(j))F.s=isNaN(j)?null:j<0?-1:1;else{if(!k&&(j=j.replace(A,function(Q,pe,he){return V=(he=he.toLowerCase())=="x"?16:he=="b"?2:8,!M||M==V?pe:Q}),M&&(V=M,j=j.replace($,"$1").replace(C,"0.$1")),H!=j))return new ie(j,V);if(ie.DEBUG)throw Error(s+"Not a"+(M?" base "+M:"")+" number: "+H);F.s=null}F.c=F.e=null}})();function Ze(A,$,C,q){var z,F,H,k,M,V,j,Q=A.c,pe=_;if(Q){e:{for(z=1,k=Q[0];k>=10;k/=10,z++);if(F=$-z,F<0)F+=h,H=$,M=Q[V=0],j=o(M/pe[z-H-1]%10);else if(V=n((F+1)/h),V>=Q.length)if(q){for(;Q.length<=V;Q.push(0));M=j=0,z=1,F%=h,H=F-h+1}else break e;else{for(M=k=Q[V],z=1;k>=10;k/=10,z++);F%=h,H=F-h+z,j=H<0?0:o(M/pe[z-H-1]%10)}if(q=q||$<0||Q[V+1]!=null||(H<0?M:M%pe[z-H-1]),q=C<4?(j||q)&&(C==0||C==(A.s<0?3:2)):j>5||j==5&&(C==4||q||C==6&&(F>0?H>0?M/pe[z-H]:0:Q[V-1])%10&1||C==(A.s<0?8:7)),$<1||!Q[0])return Q.length=0,q?($-=A.e+1,Q[0]=pe[(h-$%h)%h],A.e=-$||0):Q[0]=A.e=0,A;if(F==0?(Q.length=V,k=1,V--):(Q.length=V+1,k=pe[h-F],Q[V]=H>0?o(M/pe[z-H]%pe[H])*k:0),q)for(;;)if(V==0){for(F=1,H=Q[0];H>=10;H/=10,F++);for(H=Q[0]+=k,k=1;H>=10;H/=10,k++);F!=k&&(A.e++,Q[0]==m&&(Q[0]=1));break}else{if(Q[V]+=k,Q[V]!=m)break;Q[V--]=0,k=1}for(F=Q.length;Q[--F]===0;Q.pop());}A.e>ce?A.c=A.e=null:A.e<ee&&(A.c=[A.e=0])}return A}i(Ze,"round");function Je(A){var $,C=A.e;return C===null?A.toString():($=D(A.c),$=C<=Y||C>=ne?c($,C):y($,C,"0"),A.s<0?"-"+$:$)}return i(Je,"valueOf"),re.absoluteValue=re.abs=function(){var A=new ie(this);return A.s<0&&(A.s=1),A},re.comparedTo=function(A,$){return E(this,new ie(A,$))},re.decimalPlaces=re.dp=function(A,$){var C,q,z,F=this;if(A!=null)return u(A,0,T),$==null?$=X:u($,0,8),Ze(new ie(F),A+F.e+1,$);if(!(C=F.c))return null;if(q=((z=C.length-1)-S(this.e/h))*h,z=C[z])for(;z%10==0;z/=10,q--);return q<0&&(q=0),q},re.dividedBy=re.div=function(A,$){return b(this,new ie(A,$),se,X)},re.dividedToIntegerBy=re.idiv=function(A,$){return b(this,new ie(A,$),0,1)},re.exponentiatedBy=re.pow=function(A,$){var C,q,z,F,H,k,M,V,j,Q=this;if(A=new ie(A),A.c&&!A.isInteger())throw Error(s+"Exponent not an integer: "+Je(A));if($!=null&&($=new ie($)),k=A.e>14,!Q.c||!Q.c[0]||Q.c[0]==1&&!Q.e&&Q.c.length==1||!A.c||!A.c[0])return j=new ie(Math.pow(+Je(Q),k?A.s*(2-f(A)):+Je(A))),$?j.mod($):j;if(M=A.s<0,$){if($.c?!$.c[0]:!$.s)return new ie(NaN);q=!M&&Q.isInteger()&&$.isInteger(),q&&(Q=Q.mod($))}else{if(A.e>9&&(Q.e>0||Q.e<-1||(Q.e==0?Q.c[0]>1||k&&Q.c[1]>=24e7:Q.c[0]<8e13||k&&Q.c[0]<=9999975e7)))return F=Q.s<0&&f(A)?-0:0,Q.e>-1&&(F=1/F),new ie(M?1/F:F);Me&&(F=n(Me/h+2))}for(k?(C=new ie(.5),M&&(A.s=1),V=f(A)):(z=Math.abs(+Je(A)),V=z%2),j=new ie(Ue);;){if(V){if(j=j.times(Q),!j.c)break;F?j.c.length>F&&(j.c.length=F):q&&(j=j.mod($))}if(z){if(z=o(z/2),z===0)break;V=z%2}else if(A=A.times(C),Ze(A,A.e+1,1),A.e>14)V=f(A);else{if(z=+Je(A),z===0)break;V=z%2}Q=Q.times(Q),F?Q.c&&Q.c.length>F&&(Q.c.length=F):q&&(Q=Q.mod($))}return q?j:(M&&(j=Ue.div(j)),$?j.mod($):F?Ze(j,Me,X,H):j)},re.integerValue=function(A){var $=new ie(this);return A==null?A=X:u(A,0,8),Ze($,$.e+1,A)},re.isEqualTo=re.eq=function(A,$){return E(this,new ie(A,$))===0},re.isFinite=function(){return!!this.c},re.isGreaterThan=re.gt=function(A,$){return E(this,new ie(A,$))>0},re.isGreaterThanOrEqualTo=re.gte=function(A,$){return($=E(this,new ie(A,$)))===1||$===0},re.isInteger=function(){return!!this.c&&S(this.e/h)>this.c.length-2},re.isLessThan=re.lt=function(A,$){return E(this,new ie(A,$))<0},re.isLessThanOrEqualTo=re.lte=function(A,$){return($=E(this,new ie(A,$)))===-1||$===0},re.isNaN=function(){return!this.s},re.isNegative=function(){return this.s<0},re.isPositive=function(){return this.s>0},re.isZero=function(){return!!this.c&&this.c[0]==0},re.minus=function(A,$){var C,q,z,F,H=this,k=H.s;if(A=new ie(A,$),$=A.s,!k||!$)return new ie(NaN);if(k!=$)return A.s=-$,H.plus(A);var M=H.e/h,V=A.e/h,j=H.c,Q=A.c;if(!M||!V){if(!j||!Q)return j?(A.s=-$,A):new ie(Q?H:NaN);if(!j[0]||!Q[0])return Q[0]?(A.s=-$,A):new ie(j[0]?H:X==3?-0:0)}if(M=S(M),V=S(V),j=j.slice(),k=M-V){for((F=k<0)?(k=-k,z=j):(V=M,z=Q),z.reverse(),$=k;$--;z.push(0));z.reverse()}else for(q=(F=(k=j.length)<($=Q.length))?k:$,k=$=0;$<q;$++)if(j[$]!=Q[$]){F=j[$]<Q[$];break}if(F&&(z=j,j=Q,Q=z,A.s=-A.s),$=(q=Q.length)-(C=j.length),$>0)for(;$--;j[C++]=0);for($=m-1;q>k;){if(j[--q]<Q[q]){for(C=q;C&&!j[--C];j[C]=$);--j[C],j[q]+=m}j[q]-=Q[q]}for(;j[0]==0;j.splice(0,1),--V);return j[0]?Ht(A,j,V):(A.s=X==3?-1:1,A.c=[A.e=0],A)},re.modulo=re.mod=function(A,$){var C,q,z=this;return A=new ie(A,$),!z.c||!A.s||A.c&&!A.c[0]?new ie(NaN):!A.c||z.c&&!z.c[0]?new ie(z):(ke==9?(q=A.s,A.s=1,C=b(z,A,0,3),A.s=q,C.s*=q):C=b(z,A,0,ke),A=z.minus(C.times(A)),!A.c[0]&&ke==1&&(A.s=z.s),A)},re.multipliedBy=re.times=function(A,$){var C,q,z,F,H,k,M,V,j,Q,pe,he,Ge,nt,ot,Be=this,We=Be.c,wt=(A=new ie(A,$)).c;if(!We||!wt||!We[0]||!wt[0])return!Be.s||!A.s||We&&!We[0]&&!wt||wt&&!wt[0]&&!We?A.c=A.e=A.s=null:(A.s*=Be.s,!We||!wt?A.c=A.e=null:(A.c=[0],A.e=0)),A;for(q=S(Be.e/h)+S(A.e/h),A.s*=Be.s,M=We.length,Q=wt.length,M<Q&&(Ge=We,We=wt,wt=Ge,z=M,M=Q,Q=z),z=M+Q,Ge=[];z--;Ge.push(0));for(nt=m,ot=x,z=Q;--z>=0;){for(C=0,pe=wt[z]%ot,he=wt[z]/ot|0,H=M,F=z+H;F>z;)V=We[--H]%ot,j=We[H]/ot|0,k=he*V+j*pe,V=pe*V+k%ot*ot+Ge[F]+C,C=(V/nt|0)+(k/ot|0)+he*j,Ge[F--]=V%nt;Ge[F]=C}return C?++q:Ge.splice(0,1),Ht(A,Ge,q)},re.negated=function(){var A=new ie(this);return A.s=-A.s||null,A},re.plus=function(A,$){var C,q=this,z=q.s;if(A=new ie(A,$),$=A.s,!z||!$)return new ie(NaN);if(z!=$)return A.s=-$,q.minus(A);var F=q.e/h,H=A.e/h,k=q.c,M=A.c;if(!F||!H){if(!k||!M)return new ie(z/0);if(!k[0]||!M[0])return M[0]?A:new ie(k[0]?q:z*0)}if(F=S(F),H=S(H),k=k.slice(),z=F-H){for(z>0?(H=F,C=M):(z=-z,C=k),C.reverse();z--;C.push(0));C.reverse()}for(z=k.length,$=M.length,z-$<0&&(C=M,M=k,k=C,$=z),z=0;$;)z=(k[--$]=k[$]+M[$]+z)/m|0,k[$]=m===k[$]?0:k[$]%m;return z&&(k=[z].concat(k),++H),Ht(A,k,H)},re.precision=re.sd=function(A,$){var C,q,z,F=this;if(A!=null&&A!==!!A)return u(A,1,T),$==null?$=X:u($,0,8),Ze(new ie(F),A,$);if(!(C=F.c))return null;if(z=C.length-1,q=z*h+1,z=C[z]){for(;z%10==0;z/=10,q--);for(z=C[0];z>=10;z/=10,q++);}return A&&F.e+1>q&&(q=F.e+1),q},re.shiftedBy=function(A){return u(A,-v,v),this.times("1e"+A)},re.squareRoot=re.sqrt=function(){var A,$,C,q,z,F=this,H=F.c,k=F.s,M=F.e,V=se+4,j=new ie("0.5");if(k!==1||!H||!H[0])return new ie(!k||k<0&&(!H||H[0])?NaN:H?F:1/0);if(k=Math.sqrt(+Je(F)),k==0||k==1/0?($=D(H),($.length+M)%2==0&&($+="0"),k=Math.sqrt(+$),M=S((M+1)/2)-(M<0||M%2),k==1/0?$="5e"+M:($=k.toExponential(),$=$.slice(0,$.indexOf("e")+1)+M),C=new ie($)):C=new ie(k+""),C.c[0]){for(M=C.e,k=M+V,k<3&&(k=0);;)if(z=C,C=j.times(z.plus(b(F,z,V,1))),D(z.c).slice(0,k)===($=D(C.c)).slice(0,k))if(C.e<M&&--k,$=$.slice(k-3,k+1),$=="9999"||!q&&$=="4999"){if(!q&&(Ze(z,z.e+se+2,0),z.times(z).eq(F))){C=z;break}V+=4,k+=4,q=1}else{(!+$||!+$.slice(1)&&$.charAt(0)=="5")&&(Ze(C,C.e+se+2,1),A=!C.times(C).eq(F));break}}return Ze(C,C.e+se+1,X,A)},re.toExponential=function(A,$){return A!=null&&(u(A,0,T),A++),lt(this,A,$,1)},re.toFixed=function(A,$){return A!=null&&(u(A,0,T),A=A+this.e+1),lt(this,A,$)},re.toFormat=function(A,$,C){var q,z=this;if(C==null)A!=null&&$&&typeof $=="object"?(C=$,$=null):A&&typeof A=="object"?(C=A,A=$=null):C=Ke;else if(typeof C!="object")throw Error(s+"Argument not an object: "+C);if(q=z.toFixed(A,$),z.c){var F,H=q.split("."),k=+C.groupSize,M=+C.secondaryGroupSize,V=C.groupSeparator||"",j=H[0],Q=H[1],pe=z.s<0,he=pe?j.slice(1):j,Ge=he.length;if(M&&(F=k,k=M,M=F,Ge-=F),k>0&&Ge>0){for(F=Ge%k||k,j=he.substr(0,F);F<Ge;F+=k)j+=V+he.substr(F,k);M>0&&(j+=V+he.slice(F)),pe&&(j="-"+j)}q=Q?j+(C.decimalSeparator||"")+((M=+C.fractionGroupSize)?Q.replace(new RegExp("\\d{"+M+"}\\B","g"),"$&"+(C.fractionGroupSeparator||"")):Q):j}return(C.prefix||"")+q+(C.suffix||"")},re.toFraction=function(A){var $,C,q,z,F,H,k,M,V,j,Q,pe,he=this,Ge=he.c;if(A!=null&&(k=new ie(A),!k.isInteger()&&(k.c||k.s!==1)||k.lt(Ue)))throw Error(s+"Argument "+(k.isInteger()?"out of range: ":"not an integer: ")+Je(k));if(!Ge)return new ie(he);for($=new ie(Ue),V=C=new ie(Ue),q=M=new ie(Ue),pe=D(Ge),F=$.e=pe.length-he.e-1,$.c[0]=_[(H=F%h)<0?h+H:H],A=!A||k.comparedTo($)>0?F>0?$:V:k,H=ce,ce=1/0,k=new ie(pe),M.c[0]=0;j=b(k,$,0,1),z=C.plus(j.times(q)),z.comparedTo(A)!=1;)C=q,q=z,V=M.plus(j.times(z=V)),M=z,$=k.minus(j.times(z=$)),k=z;return z=b(A.minus(C),q,0,1),M=M.plus(z.times(V)),C=C.plus(z.times(q)),M.s=V.s=he.s,F=F*2,Q=b(V,q,F,X).minus(he).abs().comparedTo(b(M,C,F,X).minus(he).abs())<1?[V,q]:[M,C],ce=H,Q},re.toNumber=function(){return+Je(this)},re.toPrecision=function(A,$){return A!=null&&u(A,1,T),lt(this,A,$,2)},re.toString=function(A){var $,C=this,q=C.s,z=C.e;return z===null?q?($="Infinity",q<0&&($="-"+$)):$="NaN":(A==null?$=z<=Y||z>=ne?c(D(C.c),z):y(D(C.c),z,"0"):A===10&&Tt?(C=Ze(new ie(C),se+z+1,X),$=y(D(C.c),C.e,"0")):(u(A,2,Qe.length,"Base"),$=g(y(D(C.c),z,"0"),10,A,q,!0)),q<0&&C.c[0]&&($="-"+$)),$},re.valueOf=re.toJSON=function(){return Je(this)},re._isBigNumber=!0,l!=null&&ie.set(l),ie}i(P,"clone");function S(l){var b=l|0;return l>0||l===b?b:b-1}i(S,"bitFloor");function D(l){for(var b,g,ae=1,re=l.length,Ue=l[0]+"";ae<re;){for(b=l[ae++]+"",g=h-b.length;g--;b="0"+b);Ue+=b}for(re=Ue.length;Ue.charCodeAt(--re)===48;);return Ue.slice(0,re+1||1)}i(D,"coeffToString");function E(l,b){var g,ae,re=l.c,Ue=b.c,se=l.s,X=b.s,Y=l.e,ne=b.e;if(!se||!X)return null;if(g=re&&!re[0],ae=Ue&&!Ue[0],g||ae)return g?ae?0:-X:se;if(se!=X)return se;if(g=se<0,ae=Y==ne,!re||!Ue)return ae?0:!re^g?1:-1;if(!ae)return Y>ne^g?1:-1;for(X=(Y=re.length)<(ne=Ue.length)?Y:ne,se=0;se<X;se++)if(re[se]!=Ue[se])return re[se]>Ue[se]^g?1:-1;return Y==ne?0:Y>ne^g?1:-1}i(E,"compare");function u(l,b,g,ae){if(l<b||l>g||l!==o(l))throw Error(s+(ae||"Argument")+(typeof l=="number"?l<b||l>g?" out of range: ":" not an integer: ":" not a primitive number: ")+String(l))}i(u,"intCheck");function f(l){var b=l.c.length-1;return S(l.e/h)==b&&l.c[b]%2!=0}i(f,"isOdd");function c(l,b){return(l.length>1?l.charAt(0)+"."+l.slice(1):l)+(b<0?"e":"e+")+b}i(c,"toExponential");function y(l,b,g){var ae,re;if(b<0){for(re=g+".";++b;re+=g);l=re+l}else if(ae=l.length,++b>ae){for(re=g,b-=ae;--b;re+=g);l+=re}else b<ae&&(l=l.slice(0,b)+"."+l.slice(b));return l}i(y,"toFixedPoint"),e=P(),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)})(rb)});var ab=L((IQ,ob)=>{var nb=ap(),ib=ob.exports;(function(){"use strict";function t(v){return v<10?"0"+v:v}i(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,o,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},d;function m(v){return r.lastIndex=0,r.test(v)?'"'+v.replace(r,function(_){var x=s[_];return typeof x=="string"?x:"\\u"+("0000"+_.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+v+'"'}i(m,"quote");function h(v,_){var x,T,P,S,D=n,E,u=_[v],f=u!=null&&(u instanceof nb||nb.isBigNumber(u));switch(u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(v)),typeof d=="function"&&(u=d.call(_,v,u)),typeof u){case"string":return f?u:m(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":case"bigint":return String(u);case"object":if(!u)return"null";if(n+=o,E=[],Object.prototype.toString.apply(u)==="[object Array]"){for(S=u.length,x=0;x<S;x+=1)E[x]=h(x,u)||"null";return P=E.length===0?"[]":n?`[
|
|
31
|
+
`}yield n}static#o;static#a;static async#s(){return this.#o||=(await Promise.resolve().then(()=>ue(oP()))).HttpsProxyAgent,this.#o}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(QP(),XP))).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,d)=>{d==="set-cookie"?e.append(d,s):e.set(d,s)});return e}};uo.Gaxios=Du;so=Du});var gt=L(Mt=>{"use strict";var rz=Mt&&Mt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nz=Mt&&Mt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rz(e,t,r)};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.instance=Mt.Gaxios=Mt.GaxiosError=void 0;Mt.request=oz;var nb=rb();Object.defineProperty(Mt,"Gaxios",{enumerable:!0,get:i(function(){return nb.Gaxios},"get")});var iz=kd();Object.defineProperty(Mt,"GaxiosError",{enumerable:!0,get:i(function(){return iz.GaxiosError},"get")});nz(Md(),Mt);Mt.instance=new nb.Gaxios;async function oz(t){return Mt.instance.request(t)}i(oz,"request")});var ap=L((ib,$u)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,o=Math.floor,s="[BigNumber Error] ",d=s+"Number primitive has more than 15 significant digits: ",m=1e14,h=14,v=9007199254740991,_=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],x=1e7,T=1e9;function P(l){var b,g,ae,re=ie.prototype={constructor:ie,toString:null,valueOf:null},Ue=new ie(1),se=20,X=4,Y=-7,ne=21,ee=-1e7,ce=1e7,de=!1,ke=1,Me=0,Ke={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Qe="0123456789abcdefghijklmnopqrstuvwxyz",Tt=!0;function ie(A,$){var C,q,z,F,H,k,M,V,j=this;if(!(j instanceof ie))return new ie(A,$);if($==null){if(A&&A._isBigNumber===!0){j.s=A.s,!A.c||A.e>ce?j.c=j.e=null:A.e<ee?j.c=[j.e=0]:(j.e=A.e,j.c=A.c.slice());return}if((k=typeof A=="number")&&A*0==0){if(j.s=1/A<0?(A=-A,-1):1,A===~~A){for(F=0,H=A;H>=10;H/=10,F++);F>ce?j.c=j.e=null:(j.e=F,j.c=[A]);return}V=String(A)}else{if(!r.test(V=String(A)))return ae(j,V,k);j.s=V.charCodeAt(0)==45?(V=V.slice(1),-1):1}(F=V.indexOf("."))>-1&&(V=V.replace(".","")),(H=V.search(/e/i))>0?(F<0&&(F=H),F+=+V.slice(H+1),V=V.substring(0,H)):F<0&&(F=V.length)}else{if(u($,2,Qe.length,"Base"),$==10&&Tt)return j=new ie(A),Ze(j,se+j.e+1,X);if(V=String(A),k=typeof A=="number"){if(A*0!=0)return ae(j,V,k,$);if(j.s=1/A<0?(V=V.slice(1),-1):1,ie.DEBUG&&V.replace(/^0\.0*|\./,"").length>15)throw Error(d+A)}else j.s=V.charCodeAt(0)===45?(V=V.slice(1),-1):1;for(C=Qe.slice(0,$),F=H=0,M=V.length;H<M;H++)if(C.indexOf(q=V.charAt(H))<0){if(q=="."){if(H>F){F=M;continue}}else if(!z&&(V==V.toUpperCase()&&(V=V.toLowerCase())||V==V.toLowerCase()&&(V=V.toUpperCase()))){z=!0,H=-1,F=0;continue}return ae(j,String(A),k,$)}k=!1,V=g(V,$,10,j.s),(F=V.indexOf("."))>-1?V=V.replace(".",""):F=V.length}for(H=0;V.charCodeAt(H)===48;H++);for(M=V.length;V.charCodeAt(--M)===48;);if(V=V.slice(H,++M)){if(M-=H,k&&ie.DEBUG&&M>15&&(A>v||A!==o(A)))throw Error(d+j.s*A);if((F=F-H-1)>ce)j.c=j.e=null;else if(F<ee)j.c=[j.e=0];else{if(j.e=F,j.c=[],H=(F+1)%h,F<0&&(H+=h),H<M){for(H&&j.c.push(+V.slice(0,H)),M-=h;H<M;)j.c.push(+V.slice(H,H+=h));H=h-(V=V.slice(H)).length}else H-=M;for(;H--;V+="0");j.c.push(+V)}}else j.c=[j.e=0]}i(ie,"BigNumber"),ie.clone=P,ie.ROUND_UP=0,ie.ROUND_DOWN=1,ie.ROUND_CEIL=2,ie.ROUND_FLOOR=3,ie.ROUND_HALF_UP=4,ie.ROUND_HALF_DOWN=5,ie.ROUND_HALF_EVEN=6,ie.ROUND_HALF_CEIL=7,ie.ROUND_HALF_FLOOR=8,ie.EUCLID=9,ie.config=ie.set=function(A){var $,C;if(A!=null)if(typeof A=="object"){if(A.hasOwnProperty($="DECIMAL_PLACES")&&(C=A[$],u(C,0,T,$),se=C),A.hasOwnProperty($="ROUNDING_MODE")&&(C=A[$],u(C,0,8,$),X=C),A.hasOwnProperty($="EXPONENTIAL_AT")&&(C=A[$],C&&C.pop?(u(C[0],-T,0,$),u(C[1],0,T,$),Y=C[0],ne=C[1]):(u(C,-T,T,$),Y=-(ne=C<0?-C:C))),A.hasOwnProperty($="RANGE"))if(C=A[$],C&&C.pop)u(C[0],-T,-1,$),u(C[1],1,T,$),ee=C[0],ce=C[1];else if(u(C,-T,T,$),C)ee=-(ce=C<0?-C:C);else throw Error(s+$+" cannot be zero: "+C);if(A.hasOwnProperty($="CRYPTO"))if(C=A[$],C===!!C)if(C)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))de=C;else throw de=!C,Error(s+"crypto unavailable");else de=C;else throw Error(s+$+" not true or false: "+C);if(A.hasOwnProperty($="MODULO_MODE")&&(C=A[$],u(C,0,9,$),ke=C),A.hasOwnProperty($="POW_PRECISION")&&(C=A[$],u(C,0,T,$),Me=C),A.hasOwnProperty($="FORMAT"))if(C=A[$],typeof C=="object")Ke=C;else throw Error(s+$+" not an object: "+C);if(A.hasOwnProperty($="ALPHABET"))if(C=A[$],typeof C=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(C))Tt=C.slice(0,10)=="0123456789",Qe=C;else throw Error(s+$+" invalid: "+C)}else throw Error(s+"Object expected: "+A);return{DECIMAL_PLACES:se,ROUNDING_MODE:X,EXPONENTIAL_AT:[Y,ne],RANGE:[ee,ce],CRYPTO:de,MODULO_MODE:ke,POW_PRECISION:Me,FORMAT:Ke,ALPHABET:Qe}},ie.isBigNumber=function(A){if(!A||A._isBigNumber!==!0)return!1;if(!ie.DEBUG)return!0;var $,C,q=A.c,z=A.e,F=A.s;e:if({}.toString.call(q)=="[object Array]"){if((F===1||F===-1)&&z>=-T&&z<=T&&z===o(z)){if(q[0]===0){if(z===0&&q.length===1)return!0;break e}if($=(z+1)%h,$<1&&($+=h),String(q[0]).length==$){for($=0;$<q.length;$++)if(C=q[$],C<0||C>=m||C!==o(C))break e;if(C!==0)return!0}}}else if(q===null&&z===null&&(F===null||F===1||F===-1))return!0;throw Error(s+"Invalid BigNumber: "+A)},ie.maximum=ie.max=function(){return ft(arguments,-1)},ie.minimum=ie.min=function(){return ft(arguments,1)},ie.random=(function(){var A=9007199254740992,$=Math.random()*A&2097151?function(){return o(Math.random()*A)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(C){var q,z,F,H,k,M=0,V=[],j=new ie(Ue);if(C==null?C=se:u(C,0,T),H=n(C/h),de)if(crypto.getRandomValues){for(q=crypto.getRandomValues(new Uint32Array(H*=2));M<H;)k=q[M]*131072+(q[M+1]>>>11),k>=9e15?(z=crypto.getRandomValues(new Uint32Array(2)),q[M]=z[0],q[M+1]=z[1]):(V.push(k%1e14),M+=2);M=H/2}else if(crypto.randomBytes){for(q=crypto.randomBytes(H*=7);M<H;)k=(q[M]&31)*281474976710656+q[M+1]*1099511627776+q[M+2]*4294967296+q[M+3]*16777216+(q[M+4]<<16)+(q[M+5]<<8)+q[M+6],k>=9e15?crypto.randomBytes(7).copy(q,M):(V.push(k%1e14),M+=7);M=H/7}else throw de=!1,Error(s+"crypto unavailable");if(!de)for(;M<H;)k=$(),k<9e15&&(V[M++]=k%1e14);for(H=V[--M],C%=h,H&&C&&(k=_[h-C],V[M]=o(H/k)*k);V[M]===0;V.pop(),M--);if(M<0)V=[F=0];else{for(F=-1;V[0]===0;V.splice(0,1),F-=h);for(M=1,k=V[0];k>=10;k/=10,M++);M<h&&(F-=h-M)}return j.e=F,j.c=V,j}})(),ie.sum=function(){for(var A=1,$=arguments,C=new ie($[0]);A<$.length;)C=C.plus($[A++]);return C},g=(function(){var A="0123456789";function $(C,q,z,F){for(var H,k=[0],M,V=0,j=C.length;V<j;){for(M=k.length;M--;k[M]*=q);for(k[0]+=F.indexOf(C.charAt(V++)),H=0;H<k.length;H++)k[H]>z-1&&(k[H+1]==null&&(k[H+1]=0),k[H+1]+=k[H]/z|0,k[H]%=z)}return k.reverse()}return i($,"toBaseOut"),function(C,q,z,F,H){var k,M,V,j,Q,pe,he,Ge,nt=C.indexOf("."),ot=se,Be=X;for(nt>=0&&(j=Me,Me=0,C=C.replace(".",""),Ge=new ie(q),pe=Ge.pow(C.length-nt),Me=j,Ge.c=$(y(D(pe.c),pe.e,"0"),10,z,A),Ge.e=Ge.c.length),he=$(C,q,z,H?(k=Qe,A):(k=A,Qe)),V=j=he.length;he[--j]==0;he.pop());if(!he[0])return k.charAt(0);if(nt<0?--V:(pe.c=he,pe.e=V,pe.s=F,pe=b(pe,Ge,ot,Be,z),he=pe.c,Q=pe.r,V=pe.e),M=V+ot+1,nt=he[M],j=z/2,Q=Q||M<0||he[M+1]!=null,Q=Be<4?(nt!=null||Q)&&(Be==0||Be==(pe.s<0?3:2)):nt>j||nt==j&&(Be==4||Q||Be==6&&he[M-1]&1||Be==(pe.s<0?8:7)),M<1||!he[0])C=Q?y(k.charAt(1),-ot,k.charAt(0)):k.charAt(0);else{if(he.length=M,Q)for(--z;++he[--M]>z;)he[M]=0,M||(++V,he=[1].concat(he));for(j=he.length;!he[--j];);for(nt=0,C="";nt<=j;C+=k.charAt(he[nt++]));C=y(C,V,k.charAt(0))}return C}})(),b=(function(){function A(q,z,F){var H,k,M,V,j=0,Q=q.length,pe=z%x,he=z/x|0;for(q=q.slice();Q--;)M=q[Q]%x,V=q[Q]/x|0,H=he*M+V*pe,k=pe*M+H%x*x+j,j=(k/F|0)+(H/x|0)+he*V,q[Q]=k%F;return j&&(q=[j].concat(q)),q}i(A,"multiply");function $(q,z,F,H){var k,M;if(F!=H)M=F>H?1:-1;else for(k=M=0;k<F;k++)if(q[k]!=z[k]){M=q[k]>z[k]?1:-1;break}return M}i($,"compare");function C(q,z,F,H){for(var k=0;F--;)q[F]-=k,k=q[F]<z[F]?1:0,q[F]=k*H+q[F]-z[F];for(;!q[0]&&q.length>1;q.splice(0,1));}return i(C,"subtract"),function(q,z,F,H,k){var M,V,j,Q,pe,he,Ge,nt,ot,Be,We,wt,Si,Ei,xi,Wt,en,Dt=q.s==z.s?1:-1,Pt=q.c,Ye=z.c;if(!Pt||!Pt[0]||!Ye||!Ye[0])return new ie(!q.s||!z.s||(Pt?Ye&&Pt[0]==Ye[0]:!Ye)?NaN:Pt&&Pt[0]==0||!Ye?Dt*0:Dt/0);for(nt=new ie(Dt),ot=nt.c=[],V=q.e-z.e,Dt=F+V+1,k||(k=m,V=S(q.e/h)-S(z.e/h),Dt=Dt/h|0),j=0;Ye[j]==(Pt[j]||0);j++);if(Ye[j]>(Pt[j]||0)&&V--,Dt<0)ot.push(1),Q=!0;else{for(Ei=Pt.length,Wt=Ye.length,j=0,Dt+=2,pe=o(k/(Ye[0]+1)),pe>1&&(Ye=A(Ye,pe,k),Pt=A(Pt,pe,k),Wt=Ye.length,Ei=Pt.length),Si=Wt,Be=Pt.slice(0,Wt),We=Be.length;We<Wt;Be[We++]=0);en=Ye.slice(),en=[0].concat(en),xi=Ye[0],Ye[1]>=k/2&&xi++;do{if(pe=0,M=$(Ye,Be,Wt,We),M<0){if(wt=Be[0],Wt!=We&&(wt=wt*k+(Be[1]||0)),pe=o(wt/xi),pe>1)for(pe>=k&&(pe=k-1),he=A(Ye,pe,k),Ge=he.length,We=Be.length;$(he,Be,Ge,We)==1;)pe--,C(he,Wt<Ge?en:Ye,Ge,k),Ge=he.length,M=1;else pe==0&&(M=pe=1),he=Ye.slice(),Ge=he.length;if(Ge<We&&(he=[0].concat(he)),C(Be,he,We,k),We=Be.length,M==-1)for(;$(Ye,Be,Wt,We)<1;)pe++,C(Be,Wt<We?en:Ye,We,k),We=Be.length}else M===0&&(pe++,Be=[0]);ot[j++]=pe,Be[0]?Be[We++]=Pt[Si]||0:(Be=[Pt[Si]],We=1)}while((Si++<Ei||Be[0]!=null)&&Dt--);Q=Be[0]!=null,ot[0]||ot.splice(0,1)}if(k==m){for(j=1,Dt=ot[0];Dt>=10;Dt/=10,j++);Ze(nt,F+(nt.e=j+V*h-1)+1,H,Q)}else nt.e=V,nt.r=+Q;return nt}})();function lt(A,$,C,q){var z,F,H,k,M;if(C==null?C=X:u(C,0,8),!A.c)return A.toString();if(z=A.c[0],H=A.e,$==null)M=D(A.c),M=q==1||q==2&&(H<=Y||H>=ne)?c(M,H):y(M,H,"0");else if(A=Ze(new ie(A),$,C),F=A.e,M=D(A.c),k=M.length,q==1||q==2&&($<=F||F<=Y)){for(;k<$;M+="0",k++);M=c(M,F)}else if($-=H+(q===2&&F>H),M=y(M,F,"0"),F+1>k){if(--$>0)for(M+=".";$--;M+="0");}else if($+=F-k,$>0)for(F+1==k&&(M+=".");$--;M+="0");return A.s<0&&z?"-"+M:M}i(lt,"format");function ft(A,$){for(var C,q,z=1,F=new ie(A[0]);z<A.length;z++)q=new ie(A[z]),(!q.s||(C=E(F,q))===$||C===0&&F.s===$)&&(F=q);return F}i(ft,"maxOrMin");function Ht(A,$,C){for(var q=1,z=$.length;!$[--z];$.pop());for(z=$[0];z>=10;z/=10,q++);return(C=q+C*h-1)>ce?A.c=A.e=null:C<ee?A.c=[A.e=0]:(A.e=C,A.c=$),A}i(Ht,"normalise"),ae=(function(){var A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,$=/^([^.]+)\.$/,C=/^\.([^.]+)$/,q=/^-?(Infinity|NaN)$/,z=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,H,k,M){var V,j=k?H:H.replace(z,"");if(q.test(j))F.s=isNaN(j)?null:j<0?-1:1;else{if(!k&&(j=j.replace(A,function(Q,pe,he){return V=(he=he.toLowerCase())=="x"?16:he=="b"?2:8,!M||M==V?pe:Q}),M&&(V=M,j=j.replace($,"$1").replace(C,"0.$1")),H!=j))return new ie(j,V);if(ie.DEBUG)throw Error(s+"Not a"+(M?" base "+M:"")+" number: "+H);F.s=null}F.c=F.e=null}})();function Ze(A,$,C,q){var z,F,H,k,M,V,j,Q=A.c,pe=_;if(Q){e:{for(z=1,k=Q[0];k>=10;k/=10,z++);if(F=$-z,F<0)F+=h,H=$,M=Q[V=0],j=o(M/pe[z-H-1]%10);else if(V=n((F+1)/h),V>=Q.length)if(q){for(;Q.length<=V;Q.push(0));M=j=0,z=1,F%=h,H=F-h+1}else break e;else{for(M=k=Q[V],z=1;k>=10;k/=10,z++);F%=h,H=F-h+z,j=H<0?0:o(M/pe[z-H-1]%10)}if(q=q||$<0||Q[V+1]!=null||(H<0?M:M%pe[z-H-1]),q=C<4?(j||q)&&(C==0||C==(A.s<0?3:2)):j>5||j==5&&(C==4||q||C==6&&(F>0?H>0?M/pe[z-H]:0:Q[V-1])%10&1||C==(A.s<0?8:7)),$<1||!Q[0])return Q.length=0,q?($-=A.e+1,Q[0]=pe[(h-$%h)%h],A.e=-$||0):Q[0]=A.e=0,A;if(F==0?(Q.length=V,k=1,V--):(Q.length=V+1,k=pe[h-F],Q[V]=H>0?o(M/pe[z-H]%pe[H])*k:0),q)for(;;)if(V==0){for(F=1,H=Q[0];H>=10;H/=10,F++);for(H=Q[0]+=k,k=1;H>=10;H/=10,k++);F!=k&&(A.e++,Q[0]==m&&(Q[0]=1));break}else{if(Q[V]+=k,Q[V]!=m)break;Q[V--]=0,k=1}for(F=Q.length;Q[--F]===0;Q.pop());}A.e>ce?A.c=A.e=null:A.e<ee&&(A.c=[A.e=0])}return A}i(Ze,"round");function Je(A){var $,C=A.e;return C===null?A.toString():($=D(A.c),$=C<=Y||C>=ne?c($,C):y($,C,"0"),A.s<0?"-"+$:$)}return i(Je,"valueOf"),re.absoluteValue=re.abs=function(){var A=new ie(this);return A.s<0&&(A.s=1),A},re.comparedTo=function(A,$){return E(this,new ie(A,$))},re.decimalPlaces=re.dp=function(A,$){var C,q,z,F=this;if(A!=null)return u(A,0,T),$==null?$=X:u($,0,8),Ze(new ie(F),A+F.e+1,$);if(!(C=F.c))return null;if(q=((z=C.length-1)-S(this.e/h))*h,z=C[z])for(;z%10==0;z/=10,q--);return q<0&&(q=0),q},re.dividedBy=re.div=function(A,$){return b(this,new ie(A,$),se,X)},re.dividedToIntegerBy=re.idiv=function(A,$){return b(this,new ie(A,$),0,1)},re.exponentiatedBy=re.pow=function(A,$){var C,q,z,F,H,k,M,V,j,Q=this;if(A=new ie(A),A.c&&!A.isInteger())throw Error(s+"Exponent not an integer: "+Je(A));if($!=null&&($=new ie($)),k=A.e>14,!Q.c||!Q.c[0]||Q.c[0]==1&&!Q.e&&Q.c.length==1||!A.c||!A.c[0])return j=new ie(Math.pow(+Je(Q),k?A.s*(2-f(A)):+Je(A))),$?j.mod($):j;if(M=A.s<0,$){if($.c?!$.c[0]:!$.s)return new ie(NaN);q=!M&&Q.isInteger()&&$.isInteger(),q&&(Q=Q.mod($))}else{if(A.e>9&&(Q.e>0||Q.e<-1||(Q.e==0?Q.c[0]>1||k&&Q.c[1]>=24e7:Q.c[0]<8e13||k&&Q.c[0]<=9999975e7)))return F=Q.s<0&&f(A)?-0:0,Q.e>-1&&(F=1/F),new ie(M?1/F:F);Me&&(F=n(Me/h+2))}for(k?(C=new ie(.5),M&&(A.s=1),V=f(A)):(z=Math.abs(+Je(A)),V=z%2),j=new ie(Ue);;){if(V){if(j=j.times(Q),!j.c)break;F?j.c.length>F&&(j.c.length=F):q&&(j=j.mod($))}if(z){if(z=o(z/2),z===0)break;V=z%2}else if(A=A.times(C),Ze(A,A.e+1,1),A.e>14)V=f(A);else{if(z=+Je(A),z===0)break;V=z%2}Q=Q.times(Q),F?Q.c&&Q.c.length>F&&(Q.c.length=F):q&&(Q=Q.mod($))}return q?j:(M&&(j=Ue.div(j)),$?j.mod($):F?Ze(j,Me,X,H):j)},re.integerValue=function(A){var $=new ie(this);return A==null?A=X:u(A,0,8),Ze($,$.e+1,A)},re.isEqualTo=re.eq=function(A,$){return E(this,new ie(A,$))===0},re.isFinite=function(){return!!this.c},re.isGreaterThan=re.gt=function(A,$){return E(this,new ie(A,$))>0},re.isGreaterThanOrEqualTo=re.gte=function(A,$){return($=E(this,new ie(A,$)))===1||$===0},re.isInteger=function(){return!!this.c&&S(this.e/h)>this.c.length-2},re.isLessThan=re.lt=function(A,$){return E(this,new ie(A,$))<0},re.isLessThanOrEqualTo=re.lte=function(A,$){return($=E(this,new ie(A,$)))===-1||$===0},re.isNaN=function(){return!this.s},re.isNegative=function(){return this.s<0},re.isPositive=function(){return this.s>0},re.isZero=function(){return!!this.c&&this.c[0]==0},re.minus=function(A,$){var C,q,z,F,H=this,k=H.s;if(A=new ie(A,$),$=A.s,!k||!$)return new ie(NaN);if(k!=$)return A.s=-$,H.plus(A);var M=H.e/h,V=A.e/h,j=H.c,Q=A.c;if(!M||!V){if(!j||!Q)return j?(A.s=-$,A):new ie(Q?H:NaN);if(!j[0]||!Q[0])return Q[0]?(A.s=-$,A):new ie(j[0]?H:X==3?-0:0)}if(M=S(M),V=S(V),j=j.slice(),k=M-V){for((F=k<0)?(k=-k,z=j):(V=M,z=Q),z.reverse(),$=k;$--;z.push(0));z.reverse()}else for(q=(F=(k=j.length)<($=Q.length))?k:$,k=$=0;$<q;$++)if(j[$]!=Q[$]){F=j[$]<Q[$];break}if(F&&(z=j,j=Q,Q=z,A.s=-A.s),$=(q=Q.length)-(C=j.length),$>0)for(;$--;j[C++]=0);for($=m-1;q>k;){if(j[--q]<Q[q]){for(C=q;C&&!j[--C];j[C]=$);--j[C],j[q]+=m}j[q]-=Q[q]}for(;j[0]==0;j.splice(0,1),--V);return j[0]?Ht(A,j,V):(A.s=X==3?-1:1,A.c=[A.e=0],A)},re.modulo=re.mod=function(A,$){var C,q,z=this;return A=new ie(A,$),!z.c||!A.s||A.c&&!A.c[0]?new ie(NaN):!A.c||z.c&&!z.c[0]?new ie(z):(ke==9?(q=A.s,A.s=1,C=b(z,A,0,3),A.s=q,C.s*=q):C=b(z,A,0,ke),A=z.minus(C.times(A)),!A.c[0]&&ke==1&&(A.s=z.s),A)},re.multipliedBy=re.times=function(A,$){var C,q,z,F,H,k,M,V,j,Q,pe,he,Ge,nt,ot,Be=this,We=Be.c,wt=(A=new ie(A,$)).c;if(!We||!wt||!We[0]||!wt[0])return!Be.s||!A.s||We&&!We[0]&&!wt||wt&&!wt[0]&&!We?A.c=A.e=A.s=null:(A.s*=Be.s,!We||!wt?A.c=A.e=null:(A.c=[0],A.e=0)),A;for(q=S(Be.e/h)+S(A.e/h),A.s*=Be.s,M=We.length,Q=wt.length,M<Q&&(Ge=We,We=wt,wt=Ge,z=M,M=Q,Q=z),z=M+Q,Ge=[];z--;Ge.push(0));for(nt=m,ot=x,z=Q;--z>=0;){for(C=0,pe=wt[z]%ot,he=wt[z]/ot|0,H=M,F=z+H;F>z;)V=We[--H]%ot,j=We[H]/ot|0,k=he*V+j*pe,V=pe*V+k%ot*ot+Ge[F]+C,C=(V/nt|0)+(k/ot|0)+he*j,Ge[F--]=V%nt;Ge[F]=C}return C?++q:Ge.splice(0,1),Ht(A,Ge,q)},re.negated=function(){var A=new ie(this);return A.s=-A.s||null,A},re.plus=function(A,$){var C,q=this,z=q.s;if(A=new ie(A,$),$=A.s,!z||!$)return new ie(NaN);if(z!=$)return A.s=-$,q.minus(A);var F=q.e/h,H=A.e/h,k=q.c,M=A.c;if(!F||!H){if(!k||!M)return new ie(z/0);if(!k[0]||!M[0])return M[0]?A:new ie(k[0]?q:z*0)}if(F=S(F),H=S(H),k=k.slice(),z=F-H){for(z>0?(H=F,C=M):(z=-z,C=k),C.reverse();z--;C.push(0));C.reverse()}for(z=k.length,$=M.length,z-$<0&&(C=M,M=k,k=C,$=z),z=0;$;)z=(k[--$]=k[$]+M[$]+z)/m|0,k[$]=m===k[$]?0:k[$]%m;return z&&(k=[z].concat(k),++H),Ht(A,k,H)},re.precision=re.sd=function(A,$){var C,q,z,F=this;if(A!=null&&A!==!!A)return u(A,1,T),$==null?$=X:u($,0,8),Ze(new ie(F),A,$);if(!(C=F.c))return null;if(z=C.length-1,q=z*h+1,z=C[z]){for(;z%10==0;z/=10,q--);for(z=C[0];z>=10;z/=10,q++);}return A&&F.e+1>q&&(q=F.e+1),q},re.shiftedBy=function(A){return u(A,-v,v),this.times("1e"+A)},re.squareRoot=re.sqrt=function(){var A,$,C,q,z,F=this,H=F.c,k=F.s,M=F.e,V=se+4,j=new ie("0.5");if(k!==1||!H||!H[0])return new ie(!k||k<0&&(!H||H[0])?NaN:H?F:1/0);if(k=Math.sqrt(+Je(F)),k==0||k==1/0?($=D(H),($.length+M)%2==0&&($+="0"),k=Math.sqrt(+$),M=S((M+1)/2)-(M<0||M%2),k==1/0?$="5e"+M:($=k.toExponential(),$=$.slice(0,$.indexOf("e")+1)+M),C=new ie($)):C=new ie(k+""),C.c[0]){for(M=C.e,k=M+V,k<3&&(k=0);;)if(z=C,C=j.times(z.plus(b(F,z,V,1))),D(z.c).slice(0,k)===($=D(C.c)).slice(0,k))if(C.e<M&&--k,$=$.slice(k-3,k+1),$=="9999"||!q&&$=="4999"){if(!q&&(Ze(z,z.e+se+2,0),z.times(z).eq(F))){C=z;break}V+=4,k+=4,q=1}else{(!+$||!+$.slice(1)&&$.charAt(0)=="5")&&(Ze(C,C.e+se+2,1),A=!C.times(C).eq(F));break}}return Ze(C,C.e+se+1,X,A)},re.toExponential=function(A,$){return A!=null&&(u(A,0,T),A++),lt(this,A,$,1)},re.toFixed=function(A,$){return A!=null&&(u(A,0,T),A=A+this.e+1),lt(this,A,$)},re.toFormat=function(A,$,C){var q,z=this;if(C==null)A!=null&&$&&typeof $=="object"?(C=$,$=null):A&&typeof A=="object"?(C=A,A=$=null):C=Ke;else if(typeof C!="object")throw Error(s+"Argument not an object: "+C);if(q=z.toFixed(A,$),z.c){var F,H=q.split("."),k=+C.groupSize,M=+C.secondaryGroupSize,V=C.groupSeparator||"",j=H[0],Q=H[1],pe=z.s<0,he=pe?j.slice(1):j,Ge=he.length;if(M&&(F=k,k=M,M=F,Ge-=F),k>0&&Ge>0){for(F=Ge%k||k,j=he.substr(0,F);F<Ge;F+=k)j+=V+he.substr(F,k);M>0&&(j+=V+he.slice(F)),pe&&(j="-"+j)}q=Q?j+(C.decimalSeparator||"")+((M=+C.fractionGroupSize)?Q.replace(new RegExp("\\d{"+M+"}\\B","g"),"$&"+(C.fractionGroupSeparator||"")):Q):j}return(C.prefix||"")+q+(C.suffix||"")},re.toFraction=function(A){var $,C,q,z,F,H,k,M,V,j,Q,pe,he=this,Ge=he.c;if(A!=null&&(k=new ie(A),!k.isInteger()&&(k.c||k.s!==1)||k.lt(Ue)))throw Error(s+"Argument "+(k.isInteger()?"out of range: ":"not an integer: ")+Je(k));if(!Ge)return new ie(he);for($=new ie(Ue),V=C=new ie(Ue),q=M=new ie(Ue),pe=D(Ge),F=$.e=pe.length-he.e-1,$.c[0]=_[(H=F%h)<0?h+H:H],A=!A||k.comparedTo($)>0?F>0?$:V:k,H=ce,ce=1/0,k=new ie(pe),M.c[0]=0;j=b(k,$,0,1),z=C.plus(j.times(q)),z.comparedTo(A)!=1;)C=q,q=z,V=M.plus(j.times(z=V)),M=z,$=k.minus(j.times(z=$)),k=z;return z=b(A.minus(C),q,0,1),M=M.plus(z.times(V)),C=C.plus(z.times(q)),M.s=V.s=he.s,F=F*2,Q=b(V,q,F,X).minus(he).abs().comparedTo(b(M,C,F,X).minus(he).abs())<1?[V,q]:[M,C],ce=H,Q},re.toNumber=function(){return+Je(this)},re.toPrecision=function(A,$){return A!=null&&u(A,1,T),lt(this,A,$,2)},re.toString=function(A){var $,C=this,q=C.s,z=C.e;return z===null?q?($="Infinity",q<0&&($="-"+$)):$="NaN":(A==null?$=z<=Y||z>=ne?c(D(C.c),z):y(D(C.c),z,"0"):A===10&&Tt?(C=Ze(new ie(C),se+z+1,X),$=y(D(C.c),C.e,"0")):(u(A,2,Qe.length,"Base"),$=g(y(D(C.c),z,"0"),10,A,q,!0)),q<0&&C.c[0]&&($="-"+$)),$},re.valueOf=re.toJSON=function(){return Je(this)},re._isBigNumber=!0,l!=null&&ie.set(l),ie}i(P,"clone");function S(l){var b=l|0;return l>0||l===b?b:b-1}i(S,"bitFloor");function D(l){for(var b,g,ae=1,re=l.length,Ue=l[0]+"";ae<re;){for(b=l[ae++]+"",g=h-b.length;g--;b="0"+b);Ue+=b}for(re=Ue.length;Ue.charCodeAt(--re)===48;);return Ue.slice(0,re+1||1)}i(D,"coeffToString");function E(l,b){var g,ae,re=l.c,Ue=b.c,se=l.s,X=b.s,Y=l.e,ne=b.e;if(!se||!X)return null;if(g=re&&!re[0],ae=Ue&&!Ue[0],g||ae)return g?ae?0:-X:se;if(se!=X)return se;if(g=se<0,ae=Y==ne,!re||!Ue)return ae?0:!re^g?1:-1;if(!ae)return Y>ne^g?1:-1;for(X=(Y=re.length)<(ne=Ue.length)?Y:ne,se=0;se<X;se++)if(re[se]!=Ue[se])return re[se]>Ue[se]^g?1:-1;return Y==ne?0:Y>ne^g?1:-1}i(E,"compare");function u(l,b,g,ae){if(l<b||l>g||l!==o(l))throw Error(s+(ae||"Argument")+(typeof l=="number"?l<b||l>g?" out of range: ":" not an integer: ":" not a primitive number: ")+String(l))}i(u,"intCheck");function f(l){var b=l.c.length-1;return S(l.e/h)==b&&l.c[b]%2!=0}i(f,"isOdd");function c(l,b){return(l.length>1?l.charAt(0)+"."+l.slice(1):l)+(b<0?"e":"e+")+b}i(c,"toExponential");function y(l,b,g){var ae,re;if(b<0){for(re=g+".";++b;re+=g);l=re+l}else if(ae=l.length,++b>ae){for(re=g,b-=ae;--b;re+=g);l+=re}else b<ae&&(l=l.slice(0,b)+"."+l.slice(b));return l}i(y,"toFixedPoint"),e=P(),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)})(ib)});var ub=L((CQ,sb)=>{var ob=ap(),ab=sb.exports;(function(){"use strict";function t(v){return v<10?"0"+v:v}i(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,o,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},d;function m(v){return r.lastIndex=0,r.test(v)?'"'+v.replace(r,function(_){var x=s[_];return typeof x=="string"?x:"\\u"+("0000"+_.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+v+'"'}i(m,"quote");function h(v,_){var x,T,P,S,D=n,E,u=_[v],f=u!=null&&(u instanceof ob||ob.isBigNumber(u));switch(u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(v)),typeof d=="function"&&(u=d.call(_,v,u)),typeof u){case"string":return f?u:m(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":case"bigint":return String(u);case"object":if(!u)return"null";if(n+=o,E=[],Object.prototype.toString.apply(u)==="[object Array]"){for(S=u.length,x=0;x<S;x+=1)E[x]=h(x,u)||"null";return P=E.length===0?"[]":n?`[
|
|
32
32
|
`+n+E.join(`,
|
|
33
33
|
`+n)+`
|
|
34
34
|
`+D+"]":"["+E.join(",")+"]",n=D,P}if(d&&typeof d=="object")for(S=d.length,x=0;x<S;x+=1)typeof d[x]=="string"&&(T=d[x],P=h(T,u),P&&E.push(m(T)+(n?": ":":")+P));else Object.keys(u).forEach(function(c){var y=h(c,u);y&&E.push(m(c)+(n?": ":":")+y)});return P=E.length===0?"{}":n?`{
|
|
35
35
|
`+n+E.join(`,
|
|
36
36
|
`+n)+`
|
|
37
|
-
`+D+"}":"{"+E.join(",")+"}",n=D,P}}i(h,"str"),typeof
|
|
38
|
-
`,r:"\r",t:" "},s,d=i(function(D){throw{name:"SyntaxError",message:D,at:r,text:s}},"error"),m=i(function(D){return D&&D!==n&&d("Expected '"+D+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),h=i(function(){var D,E="";for(n==="-"&&(E="-",m("-"));n>="0"&&n<="9";)E+=n,m();if(n===".")for(E+=".";m()&&n>="0"&&n<="9";)E+=n;if(n==="e"||n==="E")for(E+=n,m(),(n==="-"||n==="+")&&(E+=n,m());n>="0"&&n<="9";)E+=n,m();if(D=+E,!isFinite(D))d("Bad number");else return Ou==null&&(Ou=ap()),E.length>15?e.storeAsString?E:e.useNativeBigInt?BigInt(E):new Ou(E):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(D):new Ou(D):D},"number"),v=i(function(){var D,E,u="",f;if(n==='"')for(var c=r;m();){if(n==='"')return r-1>c&&(u+=s.substring(c,r-1)),m(),u;if(n==="\\"){if(r-1>c&&(u+=s.substring(c,r-1)),m(),n==="u"){for(f=0,E=0;E<4&&(D=parseInt(m(),16),!!isFinite(D));E+=1)f=f*16+D;u+=String.fromCharCode(f)}else if(typeof o[n]=="string")u+=o[n];else break;c=r}}d("Bad string")},"string"),_=i(function(){for(;n&&n<=" ";)m()},"white"),x=i(function(){switch(n){case"t":return m("t"),m("r"),m("u"),m("e"),!0;case"f":return m("f"),m("a"),m("l"),m("s"),m("e"),!1;case"n":return m("n"),m("u"),m("l"),m("l"),null}d("Unexpected '"+n+"'")},"word"),T,P=i(function(){var D=[];if(n==="["){if(m("["),_(),n==="]")return m("]"),D;for(;n;){if(D.push(T()),_(),n==="]")return m("]"),D;m(","),_()}}d("Bad array")},"array"),S=i(function(){var D,E=Object.create(null);if(n==="{"){if(m("{"),_(),n==="}")return m("}"),E;for(;n;){if(D=v(),_(),m(":"),e.strict===!0&&Object.hasOwnProperty.call(E,D)&&d('Duplicate key "'+D+'"'),rz.test(D)===!0?e.protoAction==="error"?d("Object contains forbidden prototype property"):e.protoAction==="ignore"?T():E[D]=T():nz.test(D)===!0?e.constructorAction==="error"?d("Object contains forbidden constructor property"):e.constructorAction==="ignore"?T():E[D]=T():E[D]=T(),_(),n==="}")return m("}"),E;m(","),_()}}d("Bad object")},"object");return T=i(function(){switch(_(),n){case"{":return S();case"[":return P();case'"':return v();case"-":return h();default:return n>="0"&&n<="9"?h():x()}},"value"),function(D,E){var u;return s=D+"",r=0,n=" ",u=T(),_(),n&&d("Syntax error"),typeof E=="function"?i((function f(c,y){var l,b,g=c[y];return g&&typeof g=="object"&&Object.keys(g).forEach(function(ae){b=f(g,ae),b!==void 0?g[ae]=b:delete g[ae]}),E.call(c,y,g)}),"walk")({"":u},""):u}},"json_parse");sb.exports=iz});var db=L(($Q,Cu)=>{var cb=ab().stringify,lb=ub();Cu.exports=function(t){return{parse:lb(t),stringify:cb}};Cu.exports.parse=lb();Cu.exports.stringify=cb});var sp=L(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.GCE_LINUX_BIOS_PATHS=void 0;Ar.isGoogleCloudServerless=mb;Ar.isGoogleComputeEngineLinux=hb;Ar.isGoogleComputeEngineMACAddress=gb;Ar.isGoogleComputeEngine=yb;Ar.detectGCPResidency=az;var pb=require("fs"),fb=require("os");Ar.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var oz=/^42:01/;function mb(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}i(mb,"isGoogleCloudServerless");function hb(){if((0,fb.platform)()!=="linux")return!1;try{(0,pb.statSync)(Ar.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,pb.readFileSync)(Ar.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}i(hb,"isGoogleComputeEngineLinux");function gb(){let t=(0,fb.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(oz.test(r))return!0}return!1}i(gb,"isGoogleComputeEngineMACAddress");function yb(){return hb()||gb()}i(yb,"isGoogleComputeEngine");function az(){return mb()||yb()}i(az,"detectGCPResidency")});var vb=L(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.Colours=void 0;var Ct=class t{static{i(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="")}};Nu.Colours=Ct;Ct.enabled=!1;Ct.reset="";Ct.bright="";Ct.dim="";Ct.red="";Ct.green="";Ct.yellow="";Ct.blue="";Ct.magenta="";Ct.cyan="";Ct.white="";Ct.grey="";Ct.refresh()});var bb=L(Xe=>{"use strict";var sz=Xe&&Xe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uz=Xe&&Xe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_b=Xe&&Xe.__importStar||(function(){var t=i(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o<n.length;o++)n[o]!=="default"&&sz(r,e,n[o]);return uz(r,e),r}})();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.env=Xe.DebugLogBackendBase=Xe.placeholder=Xe.AdhocDebugLogger=Xe.LogSeverity=void 0;Xe.getNodeBackend=cp;Xe.getDebugBackend=lz;Xe.getStructuredBackend=dz;Xe.setBackend=pz;Xe.log=Pb;var cz=require("events"),ba=_b(require("process")),wb=_b(require("util")),tr=vb(),Rr;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Rr||(Xe.LogSeverity=Rr={}));var Ta=class extends cz.EventEmitter{static{i(this,"AdhocDebugLogger")}constructor(e,r){super(),this.namespace=e,this.upstream=r,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:i((n,o)=>this.on(n,o),"on")}),this.func.debug=(...n)=>this.invokeSeverity(Rr.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Rr.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Rr.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Rr.ERROR,...n),this.func.sublog=n=>Pb(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)}};Xe.AdhocDebugLogger=Ta;Xe.placeholder=new Ta("",()=>{}).func;var co=class{static{i(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=ba.env[Xe.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 o=this.cached.get(e);o||(o=this.makeLogger(e),this.cached.set(e,o)),o(r,...n)}catch(o){console.error(o)}}};Xe.DebugLogBackendBase=co;var up=class extends co{static{i(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 o;let s=`${tr.Colours.green}${e}${tr.Colours.reset}`,d=`${tr.Colours.yellow}${ba.pid}${tr.Colours.reset}`,m;switch(r.severity){case Rr.ERROR:m=`${tr.Colours.red}${r.severity}${tr.Colours.reset}`;break;case Rr.INFO:m=`${tr.Colours.magenta}${r.severity}${tr.Colours.reset}`;break;case Rr.WARNING:m=`${tr.Colours.yellow}${r.severity}${tr.Colours.reset}`;break;default:m=(o=r.severity)!==null&&o!==void 0?o:Rr.DEFAULT;break}let h=wb.formatWithOptions({colors:tr.Colours.enabled},...n),v=Object.assign({},r);delete v.severity;let _=Object.getOwnPropertyNames(v).length?JSON.stringify(v):"",x=_?`${tr.Colours.grey}${_}${tr.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",d,s,m,h,_?` ${x}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function cp(){return new up}i(cp,"getNodeBackend");var lp=class extends co{static{i(this,"DebugBackend")}constructor(e){super(),this.debugPkg=e}makeLogger(e){let r=this.debugPkg(e);return(n,...o)=>{r(o[0],...o.slice(1))}}setFilters(){var e;let r=(e=ba.env.NODE_DEBUG)!==null&&e!==void 0?e:"";ba.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function lz(t){return new lp(t)}i(lz,"getDebugBackend");var dp=class extends co{static{i(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(o,...s)=>{var d;let m=(d=o.severity)!==null&&d!==void 0?d:Rr.INFO,h=Object.assign({severity:m,message:wb.format(...s)},o),v=JSON.stringify(h);n?n(o,v):console.log("%s",v)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function dz(t){return new dp(t)}i(dz,"getStructuredBackend");Xe.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var pp=new Map,rr;function pz(t){rr=t,pp.clear()}i(pz,"setBackend");function Pb(t,e){if(!rr&&!ba.env[Xe.env.nodeEnables]||!t)return Xe.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=pp.get(t);if(r)return r.func;if(rr===null)return Xe.placeholder;rr===void 0&&(rr=cp());let n=(()=>{let o;return new Ta(t,(d,...m)=>{if(o!==rr){if(rr===null)return;rr===void 0&&(rr=cp()),o=rr}rr?.log(t,d,...m)})})();return pp.set(t,n),n.func}i(Pb,"log")});var fp=L(gi=>{"use strict";var fz=gi&&gi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mz=gi&&gi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fz(e,t,r)};Object.defineProperty(gi,"__esModule",{value:!0});mz(bb(),gi)});var Ea=L(we=>{"use strict";var Sb=we&&we.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hz=we&&we.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gz=we&&we.__importStar||(function(){var t=i(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o<n.length;o++)n[o]!=="default"&&Sb(r,e,n[o]);return hz(r,e),r}})(),yz=we&&we.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Sb(e,t,r)};Object.defineProperty(we,"__esModule",{value:!0});we.gcpResidencyCache=we.METADATA_SERVER_DETECTION=we.HEADERS=we.HEADER_VALUE=we.HEADER_NAME=we.SECONDARY_HOST_ADDRESS=we.HOST_ADDRESS=we.BASE_PATH=void 0;we.instance=Tz;we.project=Sz;we.universe=Ez;we.bulk=xz;we.isAvailable=Az;we.resetIsAvailableCache=Rz;we.getGCPResidency=gp;we.setGCPResidency=Eb;we.requestTimeout=xb;var mp=gt(),vz=db(),_z=sp(),wz=gz(fp());we.BASE_PATH="/computeMetadata/v1";we.HOST_ADDRESS="http://169.254.169.254";we.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";we.HEADER_NAME="Metadata-Flavor";we.HEADER_VALUE="Google";we.HEADERS=Object.freeze({[we.HEADER_NAME]:we.HEADER_VALUE});var Tb=wz.log("gcp-metadata");we.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 hp(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||we.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(we.BASE_PATH,t).href}i(hp,"getBaseUrl");function Pz(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.`)}})}i(Pz,"validate");async function Sa(t,e={},r=3,n=!1){let o=new Headers(we.HEADERS),s="",d={};if(typeof t=="object"){let x=t;new Headers(x.headers).forEach((T,P)=>o.set(P,T)),s=x.metadataKey,d=x.params||d,r=x.noResponseRetries||r,n=x.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(Pz(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((x,T)=>o.set(T,x)),d=e.params||d);let m=n?bz:mp.request,h={url:`${hp()}/${s}`,headers:o,retryConfig:{noResponseRetries:r},params:d,responseType:"text",timeout:xb()};Tb.info("instance request %j",h);let v=await m(h);Tb.info("instance metadata is %s",v.data);let _=v.headers.get(we.HEADER_NAME);if(_!==we.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${we.HEADER_NAME} header. Expected '${we.HEADER_VALUE}', got ${_?`'${_}'`:"no header"}`);if(typeof v.data=="string")try{return vz.parse(v.data)}catch{}return v.data}i(Sa,"metadataAccessor");async function bz(t){let e={...t,url:t.url?.toString().replace(hp(),hp(we.SECONDARY_HOST_ADDRESS))},r=(0,mp.request)(t),n=(0,mp.request)(e);return Promise.any([r,n])}i(bz,"fastFailMetadataRequest");function Tz(t){return Sa("instance",t)}i(Tz,"instance");function Sz(t){return Sa("project",t)}i(Sz,"project");function Ez(t){return Sa("universe",t)}i(Ez,"universe");async function xz(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await Sa(r),o=r.metadataKey;e[o]=n})())),e}i(xz,"bulk");function Iz(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}i(Iz,"detectGCPAvailableRetries");var ku;async function Az(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in we.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(we.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return gp();case"ping-only":}}try{return ku===void 0&&(ku=Sa("instance",void 0,Iz(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await ku,!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}}i(Az,"isAvailable");function Rz(){ku=void 0}i(Rz,"resetIsAvailableCache");we.gcpResidencyCache=null;function gp(){return we.gcpResidencyCache===null&&Eb(),we.gcpResidencyCache}i(gp,"getGCPResidency");function Eb(t=null){we.gcpResidencyCache=t!==null?t:(0,_z.detectGCPResidency)()}i(Eb,"setGCPResidency");function xb(){return gp()?0:3e3}i(xb,"requestTimeout");yz(sp(),we)});var Rb=L(zu=>{"use strict";zu.byteLength=$z;zu.toByteArray=Cz;zu.fromByteArray=zz;var qr=[],gr=[],Dz=typeof Uint8Array<"u"?Uint8Array:Array,yp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(yi=0,Ib=yp.length;yi<Ib;++yi)qr[yi]=yp[yi],gr[yp.charCodeAt(yi)]=yi;var yi,Ib;gr[45]=62;gr[95]=63;function Ab(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]}i(Ab,"getLens");function $z(t){var e=Ab(t),r=e[0],n=e[1];return(r+n)*3/4-n}i($z,"byteLength");function Oz(t,e,r){return(e+r)*3/4-r}i(Oz,"_byteLength");function Cz(t){var e,r=Ab(t),n=r[0],o=r[1],s=new Dz(Oz(t,n,o)),d=0,m=o>0?n-4:n,h;for(h=0;h<m;h+=4)e=gr[t.charCodeAt(h)]<<18|gr[t.charCodeAt(h+1)]<<12|gr[t.charCodeAt(h+2)]<<6|gr[t.charCodeAt(h+3)],s[d++]=e>>16&255,s[d++]=e>>8&255,s[d++]=e&255;return o===2&&(e=gr[t.charCodeAt(h)]<<2|gr[t.charCodeAt(h+1)]>>4,s[d++]=e&255),o===1&&(e=gr[t.charCodeAt(h)]<<10|gr[t.charCodeAt(h+1)]<<4|gr[t.charCodeAt(h+2)]>>2,s[d++]=e>>8&255,s[d++]=e&255),s}i(Cz,"toByteArray");function Nz(t){return qr[t>>18&63]+qr[t>>12&63]+qr[t>>6&63]+qr[t&63]}i(Nz,"tripletToBase64");function kz(t,e,r){for(var n,o=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),o.push(Nz(n));return o.join("")}i(kz,"encodeChunk");function zz(t){for(var e,r=t.length,n=r%3,o=[],s=16383,d=0,m=r-n;d<m;d+=s)o.push(kz(t,d,d+s>m?m:d+s));return n===1?(e=t[r-1],o.push(qr[e>>2]+qr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],o.push(qr[e>>10]+qr[e>>4&63]+qr[e<<2&63]+"=")),o.join("")}i(zz,"fromByteArray")});var _p=L(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.fromArrayBufferToHex=Uz;function Uz(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}i(Uz,"fromArrayBufferToHex")});var Db=L(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.BrowserCrypto=void 0;var lo=Rb(),Mz=_p(),wp=class t{static{i(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 lo.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),lo.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let o={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),d=lo.toByteArray(t.padBase64(n)),m=await window.crypto.subtle.importKey("jwk",e,o,!0,["verify"]);return await window.crypto.subtle.verify(o,m,d,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},o=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),d=await window.crypto.subtle.sign(n,s,o);return lo.fromByteArray(new Uint8Array(d))}decodeBase64StringUtf8(e){let r=lo.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return lo.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,Mz.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),o=new TextEncoder,s=await window.crypto.subtle.importKey("raw",o.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,o.encode(r))}};Uu.BrowserCrypto=wp});var $b=L(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.NodeCrypto=void 0;var po=require("crypto"),Pp=class{static{i(this,"NodeCrypto")}async sha256DigestBase64(e){return po.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return po.randomBytes(e).toString("base64")}async verify(e,r,n){let o=po.createVerify("RSA-SHA256");return o.update(r),o.end(),o.verify(e,n,"base64")}async sign(e,r){let n=po.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 po.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:Lz(e);return Fz(po.createHmac("sha256",n).update(r).digest())}};Mu.NodeCrypto=Pp;function Fz(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}i(Fz,"toArrayBuffer");function Lz(t){return Buffer.from(t)}i(Lz,"toBuffer")});var xa=L(yn=>{"use strict";var jz=yn&&yn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qz=yn&&yn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jz(e,t,r)};Object.defineProperty(yn,"__esModule",{value:!0});yn.createCrypto=Gz;yn.hasBrowserCrypto=Ob;var Bz=Db(),Vz=$b();qz(_p(),yn);function Gz(){return Ob()?new Bz.BrowserCrypto:new Vz.NodeCrypto}i(Gz,"createCrypto");function Ob(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}i(Ob,"hasBrowserCrypto")});var fo=L((bp,Nb)=>{var Fu=require("buffer"),Br=Fu.Buffer;function Cb(t,e){for(var r in t)e[r]=t[r]}i(Cb,"copyProps");Br.from&&Br.alloc&&Br.allocUnsafe&&Br.allocUnsafeSlow?Nb.exports=Fu:(Cb(Fu,bp),bp.Buffer=vi);function vi(t,e,r){return Br(t,e,r)}i(vi,"SafeBuffer");vi.prototype=Object.create(Br.prototype);Cb(Br,vi);vi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Br(t,e,r)};vi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Br(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};vi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Br(t)};vi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Fu.SlowBuffer(t)}});var zb=L((QQ,kb)=>{"use strict";function Tp(t){var e=(t/8|0)+(t%8===0?0:1);return e}i(Tp,"getParamSize");var Hz={ES256:Tp(256),ES384:Tp(384),ES512:Tp(521)};function Wz(t){var e=Hz[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}i(Wz,"getParamBytesForAlg");kb.exports=Wz});var Sp=L((tee,qb)=>{"use strict";var Lu=fo().Buffer,Mb=zb(),ju=128,Fb=0,Zz=32,Kz=16,Jz=2,Lb=Kz|Zz|Fb<<6,qu=Jz|Fb<<6;function Yz(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(Yz,"base64Url");function jb(t){if(Lu.isBuffer(t))return t;if(typeof t=="string")return Lu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}i(jb,"signatureAsBuffer");function Xz(t,e){t=jb(t);var r=Mb(e),n=r+1,o=t.length,s=0;if(t[s++]!==Lb)throw new Error('Could not find expected "seq"');var d=t[s++];if(d===(ju|1)&&(d=t[s++]),o-s<d)throw new Error('"seq" specified length of "'+d+'", only "'+(o-s)+'" remaining');if(t[s++]!==qu)throw new Error('Could not find expected "int" for "r"');var m=t[s++];if(o-s-2<m)throw new Error('"r" specified length of "'+m+'", only "'+(o-s-2)+'" available');if(n<m)throw new Error('"r" specified length of "'+m+'", max of "'+n+'" is acceptable');var h=s;if(s+=m,t[s++]!==qu)throw new Error('Could not find expected "int" for "s"');var v=t[s++];if(o-s!==v)throw new Error('"s" specified length of "'+v+'", expected "'+(o-s)+'"');if(n<v)throw new Error('"s" specified length of "'+v+'", max of "'+n+'" is acceptable');var _=s;if(s+=v,s!==o)throw new Error('Expected to consume entire buffer, but "'+(o-s)+'" bytes remain');var x=r-m,T=r-v,P=Lu.allocUnsafe(x+m+T+v);for(s=0;s<x;++s)P[s]=0;t.copy(P,s,h+Math.max(-x,0),h+m),s=r;for(var S=s;s<S+T;++s)P[s]=0;return t.copy(P,s,_+Math.max(-T,0),_+v),P=P.toString("base64"),P=Yz(P),P}i(Xz,"derToJose");function Ub(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var o=t[e+n]>=ju;return o&&--n,n}i(Ub,"countPadding");function Qz(t,e){t=jb(t);var r=Mb(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=Ub(t,0,r),s=Ub(t,r,t.length),d=r-o,m=r-s,h=2+d+1+1+m,v=h<ju,_=Lu.allocUnsafe((v?2:3)+h),x=0;return _[x++]=Lb,v?_[x++]=h:(_[x++]=ju|1,_[x++]=h&255),_[x++]=qu,_[x++]=d,o<0?(_[x++]=0,x+=t.copy(_,x,0,r)):x+=t.copy(_,x,o,r),_[x++]=qu,_[x++]=m,s<0?(_[x++]=0,t.copy(_,x,r)):t.copy(_,x,r+s),_}i(Qz,"joseToDer");qb.exports={derToJose:Xz,joseToDer:Qz}});var Dr=L(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.LRUCache=void 0;vn.snakeToCamel=Vb;vn.originalOrCamelOptions=nU;vn.removeUndefinedValuesInObject=iU;vn.isValidFile=oU;vn.getWellKnownCertificateConfigFileLocation=aU;var eU=require("fs"),tU=require("os"),Ep=require("path"),rU="certificate_config.json",Bb="gcloud";function Vb(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}i(Vb,"snakeToCamel");function nU(t){function e(r){let n=t||{};return n[r]??n[Vb(r)]}return i(e,"get"),{get:e}}i(nU,"originalOrCamelOptions");var xp=class{static{i(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()}};vn.LRUCache=xp;function iU(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}i(iU,"removeUndefinedValuesInObject");async function oU(t){try{return(await eU.promises.lstat(t)).isFile()}catch{return!1}}i(oU,"isValidFile");function aU(){let t=process.env.CLOUDSDK_CONFIG||(sU()?Ep.join(process.env.APPDATA||"",Bb):Ep.join(process.env.HOME||"",".config",Bb));return Ep.join(t,rU)}i(aU,"getWellKnownCertificateConfigFileLocation");function sU(){return tU.platform().startsWith("win")}i(sU,"_isWindows")});var Gb=L((oee,uU)=>{uU.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 Ip=L(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.USER_AGENT=Zn.PRODUCT_NAME=Zn.pkg=void 0;var Hb=Gb();Zn.pkg=Hb;var Wb="google-api-nodejs-client";Zn.PRODUCT_NAME=Wb;var cU=`${Wb}/${Hb.version}`;Zn.USER_AGENT=cU});var nr=L($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.AuthClient=$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=$r.DEFAULT_UNIVERSE=void 0;var lU=require("events"),Ap=gt(),dU=Dr(),pU=fp(),Rp=Ip();$r.DEFAULT_UNIVERSE="googleapis.com";$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var Dp=class t extends lU.EventEmitter{static{i(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=$r.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,dU.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")??$r.DEFAULT_UNIVERSE,this.transporter=e.transporter??new Ap.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],o,s=new Headers;return typeof r=="string"?o=new URL(r):r instanceof URL?o=r:r&&r.url&&(o=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&Ap.Gaxios.mergeHeaders(s,r.headers),n&&Ap.Gaxios.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:o}):this.request({...n,headers:s,url:o})}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"),o=r.get("authorization");return n&&e.set("x-goog-user-project",n),o&&e.set("authorization",o),e}static log=(0,pU.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:i(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(`${Rp.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${Rp.USER_AGENT}`):e.headers.set("User-Agent",Rp.USER_AGENT);try{let n=e,o=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let d={url:e.url,headers:e.headers};o?t.log.info("%s [%s] request %j",o,s,d):t.log.info("[%s] request %j",s,d)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:i(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],o=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,o,e.data):t.log.info("[%s] response %j",o,e.data)}catch{}return e},"resolved"),rejected:i(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],o=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,o,e.response?.data):t.log.error("[%s] error %j",o,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"]}}}};$r.AuthClient=Dp});var Op=L(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.LoginTicket=void 0;var $p=class{static{i(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()}}};Bu.LoginTicket=$p});var _i=L(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.OAuth2Client=Vr.ClientAuthentication=Vr.CertificateFormat=Vr.CodeChallengeMethod=void 0;var Zb=gt(),fU=require("querystring"),mU=require("stream"),hU=Sp(),Kb=Dr(),Cp=xa(),mo=nr(),gU=Op(),Jb;(function(t){t.Plain="plain",t.S256="S256"})(Jb||(Vr.CodeChallengeMethod=Jb={}));var _n;(function(t){t.PEM="PEM",t.JWK="JWK"})(_n||(Vr.CertificateFormat=_n={}));var Ia;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(Ia||(Vr.ClientAuthentication=Ia={}));var Np=class t extends mo.AuthClient{static{i(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=_n.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||Ia.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()+"?"+fU.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,Cp.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(o=>r(null,o.tokens,o.res),o=>r(o,null,o.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,o={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===Ia.ClientSecretBasic){let h=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${h.toString("base64")}`)}this.clientAuthentication===Ia.ClientSecretPost&&(o.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,Kb.removeUndefinedValuesInObject)(o)),headers:n};mo.AuthClient.setMethodName(s,"getTokenAsync");let d=await this.transporter.request(s),m=d.data;return d.data&&d.data.expires_in&&(m.expiry_date=new Date().getTime()+d.data.expires_in*1e3,delete m.expires_in),this.emit("tokens",m),{tokens:m,res:d}}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"},o;try{let d={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,Kb.removeUndefinedValuesInObject)(n))};mo.AuthClient.setMethodName(d,"refreshTokenNoCache"),o=await this.transporter.request(d)}catch(d){throw d instanceof Zb.GaxiosError&&d.message==="invalid_grant"&&d.response?.data&&/ReAuth/i.test(d.response.data.error_description)&&(d.message=JSON.stringify(d.response.data)),d}let s=o.data;return o.data&&o.data.expires_in&&(s.expiry_date=new Date().getTime()+o.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:o}}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 m=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(m)}}if(this.refreshHandler){let m=await this.processAndValidateRefreshHandler();if(m?.access_token){this.setCredentials(m);let h=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(h)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,o=null;try{n=await this.refreshToken(r.refresh_token),o=n.tokens}catch(m){let h=m;throw h.response&&(h.response.status===403||h.response.status===404)&&(h.message=`Could not refresh access token: ${h.message}`),h}let s=this.credentials;s.token_type=s.token_type||"Bearer",o.refresh_token=s.refresh_token,this.credentials=o;let d=new Headers({authorization:s.token_type+" "+o.access_token});return{headers:this.addSharedMetadataHeaders(d),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(mo.AuthClient.setMethodName(n,"revokeToken"),r)this.transporter.request(n).then(o=>r(null,o),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=Zb.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 o=n.response;if(o){let s=o.status,d=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),m=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,h=o.config.data instanceof mU.Readable,v=s===401||s===403;if(!r&&v&&!h&&d)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&v&&!h&&m){let _=await this.processAndValidateRefreshHandler();return _?.access_token&&this.setCredentials(_),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,Cp.hasBrowserCrypto)()?_n.JWK:_n.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,o;switch(r){case _n.PEM:o=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case _n.JWK:o=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let v={...t.RETRY_CONFIG,url:o};mo.AuthClient.setMethodName(v,"getFederatedSignonCertsAsync"),n=await this.transporter.request(v)}catch(v){throw v instanceof Error&&(v.message=`Failed to retrieve verification certificates: ${v.message}`),v}let s=n?.headers.get("cache-control"),d=-1;if(s){let v=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;v&&(d=Number(v)*1e3)}let m={};switch(r){case _n.PEM:m=n.data;break;case _n.JWK:for(let v of n.data.keys)m[v.kid]=v;break;default:throw new Error(`Unsupported certificate format ${r}`)}let h=new Date;return this.certificateExpiry=d===-1?null:new Date(h.getTime()+d),this.certificateCache=m,this.certificateCacheFormat=r,{certs:m,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};mo.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,o,s){let d=(0,Cp.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let m=e.split(".");if(m.length!==3)throw new Error("Wrong number of segments in token: "+e);let h=m[0]+"."+m[1],v=m[2],_,x;try{_=JSON.parse(d.decodeBase64StringUtf8(m[0]))}catch(c){throw c instanceof Error&&(c.message=`Can't parse token envelope: ${m[0]}': ${c.message}`),c}if(!_)throw new Error("Can't parse token envelope: "+m[0]);try{x=JSON.parse(d.decodeBase64StringUtf8(m[1]))}catch(c){throw c instanceof Error&&(c.message=`Can't parse token payload '${m[0]}`),c}if(!x)throw new Error("Can't parse token payload: "+m[1]);if(!Object.prototype.hasOwnProperty.call(r,_.kid))throw new Error("No pem found for envelope: "+JSON.stringify(_));let T=r[_.kid];if(_.alg==="ES256"&&(v=hU.joseToDer(v,"ES256").toString("base64")),!await d.verify(T,h,v))throw new Error("Invalid token signature: "+e);if(!x.iat)throw new Error("No issue time in token: "+JSON.stringify(x));if(!x.exp)throw new Error("No expiration time in token: "+JSON.stringify(x));let S=Number(x.iat);if(isNaN(S))throw new Error("iat field using invalid format");let D=Number(x.exp);if(isNaN(D))throw new Error("exp field using invalid format");let E=new Date().getTime()/1e3;if(D>=E+s)throw new Error("Expiration time too far in future: "+JSON.stringify(x));let u=S-t.CLOCK_SKEW_SECS_,f=D+t.CLOCK_SKEW_SECS_;if(E<u)throw new Error("Token used too early, "+E+" < "+u+": "+JSON.stringify(x));if(E>f)throw new Error("Token used too late, "+E+" > "+f+": "+JSON.stringify(x));if(o&&o.indexOf(x.iss)<0)throw new Error("Invalid issuer, expected one of ["+o+"], but got "+x.iss);if(typeof n<"u"&&n!==null){let c=x.aud,y=!1;if(n.constructor===Array?y=n.indexOf(c)>-1:y=c===n,!y)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new gU.LoginTicket(_,x)}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}};Vr.OAuth2Client=Np});var zp=L(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.Compute=void 0;var yU=gt(),Yb=Ea(),vU=_i(),kp=class extends vU.OAuth2Client{static{i(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 o={property:e};this.scopes.length>0&&(o.params={scopes:this.scopes.join(",")}),r=await Yb.instance(o)}catch(o){throw o instanceof yU.GaxiosError&&(o.message=`Could not refresh access token: ${o.message}`,this.wrapError(o)),o}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 o={property:r};n=await Yb.instance(o)}catch(o){throw o instanceof Error&&(o.message=`Could not fetch ID token: ${o.message}`),o}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))}};Vu.Compute=kp});var Mp=L(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.IdTokenClient=void 0;var _U=_i(),Up=class extends _U.OAuth2Client{static{i(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}};Gu.IdTokenClient=Up});var Fp=L(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.GCPEnv=void 0;ho.clear=wU;ho.getEnv=PU;var Xb=Ea(),Gr;(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"})(Gr||(ho.GCPEnv=Gr={}));var Aa;function wU(){Aa=void 0}i(wU,"clear");async function PU(){return Aa||(Aa=bU(),Aa)}i(PU,"getEnv");async function bU(){let t=Gr.NONE;return TU()?t=Gr.APP_ENGINE:SU()?t=Gr.CLOUD_FUNCTIONS:await AU()?await IU()?t=Gr.KUBERNETES_ENGINE:EU()?t=Gr.CLOUD_RUN:xU()?t=Gr.CLOUD_RUN_JOBS:t=Gr.COMPUTE_ENGINE:t=Gr.NONE,t}i(bU,"getEnvMemoized");function TU(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}i(TU,"isAppEngine");function SU(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}i(SU,"isCloudFunction");function EU(){return!!process.env.K_CONFIGURATION}i(EU,"isCloudRun");function xU(){return!!process.env.CLOUD_RUN_JOB}i(xU,"isCloudRunJob");async function IU(){try{return await Xb.instance("attributes/cluster-name"),!0}catch{return!1}}i(IU,"isKubernetesEngine");async function AU(){return Xb.isAvailable()}i(AU,"isComputeEngine")});var Lp=L((_ee,Qb)=>{var Hu=fo().Buffer,RU=require("stream"),DU=require("util");function Wu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Hu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Hu.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+")")}i(Wu,"DataStream");DU.inherits(Wu,RU);Wu.prototype.write=i(function(e){this.buffer=Hu.concat([this.buffer,Hu.from(e)]),this.emit("data",e)},"write");Wu.prototype.end=i(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Qb.exports=Wu});var tT=L((Pee,eT)=>{"use strict";var Ra=require("buffer").Buffer,jp=require("buffer").SlowBuffer;eT.exports=Zu;function Zu(t,e){if(!Ra.isBuffer(t)||!Ra.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}i(Zu,"bufferEq");Zu.install=function(){Ra.prototype.equal=jp.prototype.equal=i(function(e){return Zu(this,e)},"equal")};var $U=Ra.prototype.equal,OU=jp.prototype.equal;Zu.restore=function(){Ra.prototype.equal=$U,jp.prototype.equal=OU}});var Gp=L((Tee,lT)=>{var yo=fo().Buffer,yr=require("crypto"),nT=Sp(),rT=require("util"),CU=`"%s" is not a valid algorithm.
|
|
37
|
+
`+D+"}":"{"+E.join(",")+"}",n=D,P}}i(h,"str"),typeof ab.stringify!="function"&&(ab.stringify=function(v,_,x){var T;if(n="",o="",typeof x=="number")for(T=0;T<x;T+=1)o+=" ";else typeof x=="string"&&(o=x);if(d=_,_&&typeof _!="function"&&(typeof _!="object"||typeof _.length!="number"))throw new Error("JSON.stringify");return h("",{"":v})})})()});var lb=L((kQ,cb)=>{var Ou=null,az=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,sz=/(?: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)/,uz=i(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,o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
38
|
+
`,r:"\r",t:" "},s,d=i(function(D){throw{name:"SyntaxError",message:D,at:r,text:s}},"error"),m=i(function(D){return D&&D!==n&&d("Expected '"+D+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),h=i(function(){var D,E="";for(n==="-"&&(E="-",m("-"));n>="0"&&n<="9";)E+=n,m();if(n===".")for(E+=".";m()&&n>="0"&&n<="9";)E+=n;if(n==="e"||n==="E")for(E+=n,m(),(n==="-"||n==="+")&&(E+=n,m());n>="0"&&n<="9";)E+=n,m();if(D=+E,!isFinite(D))d("Bad number");else return Ou==null&&(Ou=ap()),E.length>15?e.storeAsString?E:e.useNativeBigInt?BigInt(E):new Ou(E):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(D):new Ou(D):D},"number"),v=i(function(){var D,E,u="",f;if(n==='"')for(var c=r;m();){if(n==='"')return r-1>c&&(u+=s.substring(c,r-1)),m(),u;if(n==="\\"){if(r-1>c&&(u+=s.substring(c,r-1)),m(),n==="u"){for(f=0,E=0;E<4&&(D=parseInt(m(),16),!!isFinite(D));E+=1)f=f*16+D;u+=String.fromCharCode(f)}else if(typeof o[n]=="string")u+=o[n];else break;c=r}}d("Bad string")},"string"),_=i(function(){for(;n&&n<=" ";)m()},"white"),x=i(function(){switch(n){case"t":return m("t"),m("r"),m("u"),m("e"),!0;case"f":return m("f"),m("a"),m("l"),m("s"),m("e"),!1;case"n":return m("n"),m("u"),m("l"),m("l"),null}d("Unexpected '"+n+"'")},"word"),T,P=i(function(){var D=[];if(n==="["){if(m("["),_(),n==="]")return m("]"),D;for(;n;){if(D.push(T()),_(),n==="]")return m("]"),D;m(","),_()}}d("Bad array")},"array"),S=i(function(){var D,E=Object.create(null);if(n==="{"){if(m("{"),_(),n==="}")return m("}"),E;for(;n;){if(D=v(),_(),m(":"),e.strict===!0&&Object.hasOwnProperty.call(E,D)&&d('Duplicate key "'+D+'"'),az.test(D)===!0?e.protoAction==="error"?d("Object contains forbidden prototype property"):e.protoAction==="ignore"?T():E[D]=T():sz.test(D)===!0?e.constructorAction==="error"?d("Object contains forbidden constructor property"):e.constructorAction==="ignore"?T():E[D]=T():E[D]=T(),_(),n==="}")return m("}"),E;m(","),_()}}d("Bad object")},"object");return T=i(function(){switch(_(),n){case"{":return S();case"[":return P();case'"':return v();case"-":return h();default:return n>="0"&&n<="9"?h():x()}},"value"),function(D,E){var u;return s=D+"",r=0,n=" ",u=T(),_(),n&&d("Syntax error"),typeof E=="function"?i((function f(c,y){var l,b,g=c[y];return g&&typeof g=="object"&&Object.keys(g).forEach(function(ae){b=f(g,ae),b!==void 0?g[ae]=b:delete g[ae]}),E.call(c,y,g)}),"walk")({"":u},""):u}},"json_parse");cb.exports=uz});var fb=L((UQ,Cu)=>{var db=ub().stringify,pb=lb();Cu.exports=function(t){return{parse:pb(t),stringify:db}};Cu.exports.parse=pb();Cu.exports.stringify=db});var sp=L(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.GCE_LINUX_BIOS_PATHS=void 0;Ar.isGoogleCloudServerless=gb;Ar.isGoogleComputeEngineLinux=yb;Ar.isGoogleComputeEngineMACAddress=vb;Ar.isGoogleComputeEngine=_b;Ar.detectGCPResidency=lz;var mb=require("fs"),hb=require("os");Ar.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var cz=/^42:01/;function gb(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}i(gb,"isGoogleCloudServerless");function yb(){if((0,hb.platform)()!=="linux")return!1;try{(0,mb.statSync)(Ar.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,mb.readFileSync)(Ar.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}i(yb,"isGoogleComputeEngineLinux");function vb(){let t=(0,hb.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(cz.test(r))return!0}return!1}i(vb,"isGoogleComputeEngineMACAddress");function _b(){return yb()||vb()}i(_b,"isGoogleComputeEngine");function lz(){return gb()||_b()}i(lz,"detectGCPResidency")});var wb=L(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.Colours=void 0;var Ct=class t{static{i(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="")}};Nu.Colours=Ct;Ct.enabled=!1;Ct.reset="";Ct.bright="";Ct.dim="";Ct.red="";Ct.green="";Ct.yellow="";Ct.blue="";Ct.magenta="";Ct.cyan="";Ct.white="";Ct.grey="";Ct.refresh()});var Sb=L(Xe=>{"use strict";var dz=Xe&&Xe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pz=Xe&&Xe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Pb=Xe&&Xe.__importStar||(function(){var t=i(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o<n.length;o++)n[o]!=="default"&&dz(r,e,n[o]);return pz(r,e),r}})();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.env=Xe.DebugLogBackendBase=Xe.placeholder=Xe.AdhocDebugLogger=Xe.LogSeverity=void 0;Xe.getNodeBackend=cp;Xe.getDebugBackend=mz;Xe.getStructuredBackend=hz;Xe.setBackend=gz;Xe.log=Tb;var fz=require("events"),ba=Pb(require("process")),bb=Pb(require("util")),tr=wb(),Rr;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Rr||(Xe.LogSeverity=Rr={}));var Ta=class extends fz.EventEmitter{static{i(this,"AdhocDebugLogger")}constructor(e,r){super(),this.namespace=e,this.upstream=r,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:i((n,o)=>this.on(n,o),"on")}),this.func.debug=(...n)=>this.invokeSeverity(Rr.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Rr.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Rr.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Rr.ERROR,...n),this.func.sublog=n=>Tb(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)}};Xe.AdhocDebugLogger=Ta;Xe.placeholder=new Ta("",()=>{}).func;var co=class{static{i(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=ba.env[Xe.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 o=this.cached.get(e);o||(o=this.makeLogger(e),this.cached.set(e,o)),o(r,...n)}catch(o){console.error(o)}}};Xe.DebugLogBackendBase=co;var up=class extends co{static{i(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 o;let s=`${tr.Colours.green}${e}${tr.Colours.reset}`,d=`${tr.Colours.yellow}${ba.pid}${tr.Colours.reset}`,m;switch(r.severity){case Rr.ERROR:m=`${tr.Colours.red}${r.severity}${tr.Colours.reset}`;break;case Rr.INFO:m=`${tr.Colours.magenta}${r.severity}${tr.Colours.reset}`;break;case Rr.WARNING:m=`${tr.Colours.yellow}${r.severity}${tr.Colours.reset}`;break;default:m=(o=r.severity)!==null&&o!==void 0?o:Rr.DEFAULT;break}let h=bb.formatWithOptions({colors:tr.Colours.enabled},...n),v=Object.assign({},r);delete v.severity;let _=Object.getOwnPropertyNames(v).length?JSON.stringify(v):"",x=_?`${tr.Colours.grey}${_}${tr.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",d,s,m,h,_?` ${x}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function cp(){return new up}i(cp,"getNodeBackend");var lp=class extends co{static{i(this,"DebugBackend")}constructor(e){super(),this.debugPkg=e}makeLogger(e){let r=this.debugPkg(e);return(n,...o)=>{r(o[0],...o.slice(1))}}setFilters(){var e;let r=(e=ba.env.NODE_DEBUG)!==null&&e!==void 0?e:"";ba.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function mz(t){return new lp(t)}i(mz,"getDebugBackend");var dp=class extends co{static{i(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(o,...s)=>{var d;let m=(d=o.severity)!==null&&d!==void 0?d:Rr.INFO,h=Object.assign({severity:m,message:bb.format(...s)},o),v=JSON.stringify(h);n?n(o,v):console.log("%s",v)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function hz(t){return new dp(t)}i(hz,"getStructuredBackend");Xe.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var pp=new Map,rr;function gz(t){rr=t,pp.clear()}i(gz,"setBackend");function Tb(t,e){if(!rr&&!ba.env[Xe.env.nodeEnables]||!t)return Xe.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=pp.get(t);if(r)return r.func;if(rr===null)return Xe.placeholder;rr===void 0&&(rr=cp());let n=(()=>{let o;return new Ta(t,(d,...m)=>{if(o!==rr){if(rr===null)return;rr===void 0&&(rr=cp()),o=rr}rr?.log(t,d,...m)})})();return pp.set(t,n),n.func}i(Tb,"log")});var fp=L(gi=>{"use strict";var yz=gi&&gi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vz=gi&&gi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yz(e,t,r)};Object.defineProperty(gi,"__esModule",{value:!0});vz(Sb(),gi)});var Ea=L(we=>{"use strict";var xb=we&&we.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_z=we&&we.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wz=we&&we.__importStar||(function(){var t=i(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o<n.length;o++)n[o]!=="default"&&xb(r,e,n[o]);return _z(r,e),r}})(),Pz=we&&we.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xb(e,t,r)};Object.defineProperty(we,"__esModule",{value:!0});we.gcpResidencyCache=we.METADATA_SERVER_DETECTION=we.HEADERS=we.HEADER_VALUE=we.HEADER_NAME=we.SECONDARY_HOST_ADDRESS=we.HOST_ADDRESS=we.BASE_PATH=void 0;we.instance=Iz;we.project=Az;we.universe=Rz;we.bulk=Dz;we.isAvailable=Oz;we.resetIsAvailableCache=Cz;we.getGCPResidency=gp;we.setGCPResidency=Ib;we.requestTimeout=Ab;var mp=gt(),bz=fb(),Tz=sp(),Sz=wz(fp());we.BASE_PATH="/computeMetadata/v1";we.HOST_ADDRESS="http://169.254.169.254";we.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";we.HEADER_NAME="Metadata-Flavor";we.HEADER_VALUE="Google";we.HEADERS=Object.freeze({[we.HEADER_NAME]:we.HEADER_VALUE});var Eb=Sz.log("gcp-metadata");we.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 hp(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||we.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(we.BASE_PATH,t).href}i(hp,"getBaseUrl");function Ez(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.`)}})}i(Ez,"validate");async function Sa(t,e={},r=3,n=!1){let o=new Headers(we.HEADERS),s="",d={};if(typeof t=="object"){let x=t;new Headers(x.headers).forEach((T,P)=>o.set(P,T)),s=x.metadataKey,d=x.params||d,r=x.noResponseRetries||r,n=x.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(Ez(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((x,T)=>o.set(T,x)),d=e.params||d);let m=n?xz:mp.request,h={url:`${hp()}/${s}`,headers:o,retryConfig:{noResponseRetries:r},params:d,responseType:"text",timeout:Ab()};Eb.info("instance request %j",h);let v=await m(h);Eb.info("instance metadata is %s",v.data);let _=v.headers.get(we.HEADER_NAME);if(_!==we.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${we.HEADER_NAME} header. Expected '${we.HEADER_VALUE}', got ${_?`'${_}'`:"no header"}`);if(typeof v.data=="string")try{return bz.parse(v.data)}catch{}return v.data}i(Sa,"metadataAccessor");async function xz(t){let e={...t,url:t.url?.toString().replace(hp(),hp(we.SECONDARY_HOST_ADDRESS))},r=(0,mp.request)(t),n=(0,mp.request)(e);return Promise.any([r,n])}i(xz,"fastFailMetadataRequest");function Iz(t){return Sa("instance",t)}i(Iz,"instance");function Az(t){return Sa("project",t)}i(Az,"project");function Rz(t){return Sa("universe",t)}i(Rz,"universe");async function Dz(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await Sa(r),o=r.metadataKey;e[o]=n})())),e}i(Dz,"bulk");function $z(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}i($z,"detectGCPAvailableRetries");var ku;async function Oz(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in we.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(we.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return gp();case"ping-only":}}try{return ku===void 0&&(ku=Sa("instance",void 0,$z(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await ku,!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}}i(Oz,"isAvailable");function Cz(){ku=void 0}i(Cz,"resetIsAvailableCache");we.gcpResidencyCache=null;function gp(){return we.gcpResidencyCache===null&&Ib(),we.gcpResidencyCache}i(gp,"getGCPResidency");function Ib(t=null){we.gcpResidencyCache=t!==null?t:(0,Tz.detectGCPResidency)()}i(Ib,"setGCPResidency");function Ab(){return gp()?0:3e3}i(Ab,"requestTimeout");Pz(sp(),we)});var $b=L(zu=>{"use strict";zu.byteLength=kz;zu.toByteArray=Uz;zu.fromByteArray=Lz;var qr=[],gr=[],Nz=typeof Uint8Array<"u"?Uint8Array:Array,yp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(yi=0,Rb=yp.length;yi<Rb;++yi)qr[yi]=yp[yi],gr[yp.charCodeAt(yi)]=yi;var yi,Rb;gr[45]=62;gr[95]=63;function Db(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]}i(Db,"getLens");function kz(t){var e=Db(t),r=e[0],n=e[1];return(r+n)*3/4-n}i(kz,"byteLength");function zz(t,e,r){return(e+r)*3/4-r}i(zz,"_byteLength");function Uz(t){var e,r=Db(t),n=r[0],o=r[1],s=new Nz(zz(t,n,o)),d=0,m=o>0?n-4:n,h;for(h=0;h<m;h+=4)e=gr[t.charCodeAt(h)]<<18|gr[t.charCodeAt(h+1)]<<12|gr[t.charCodeAt(h+2)]<<6|gr[t.charCodeAt(h+3)],s[d++]=e>>16&255,s[d++]=e>>8&255,s[d++]=e&255;return o===2&&(e=gr[t.charCodeAt(h)]<<2|gr[t.charCodeAt(h+1)]>>4,s[d++]=e&255),o===1&&(e=gr[t.charCodeAt(h)]<<10|gr[t.charCodeAt(h+1)]<<4|gr[t.charCodeAt(h+2)]>>2,s[d++]=e>>8&255,s[d++]=e&255),s}i(Uz,"toByteArray");function Mz(t){return qr[t>>18&63]+qr[t>>12&63]+qr[t>>6&63]+qr[t&63]}i(Mz,"tripletToBase64");function Fz(t,e,r){for(var n,o=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),o.push(Mz(n));return o.join("")}i(Fz,"encodeChunk");function Lz(t){for(var e,r=t.length,n=r%3,o=[],s=16383,d=0,m=r-n;d<m;d+=s)o.push(Fz(t,d,d+s>m?m:d+s));return n===1?(e=t[r-1],o.push(qr[e>>2]+qr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],o.push(qr[e>>10]+qr[e>>4&63]+qr[e<<2&63]+"=")),o.join("")}i(Lz,"fromByteArray")});var _p=L(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.fromArrayBufferToHex=jz;function jz(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}i(jz,"fromArrayBufferToHex")});var Ob=L(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.BrowserCrypto=void 0;var lo=$b(),qz=_p(),wp=class t{static{i(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 lo.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),lo.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let o={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),d=lo.toByteArray(t.padBase64(n)),m=await window.crypto.subtle.importKey("jwk",e,o,!0,["verify"]);return await window.crypto.subtle.verify(o,m,d,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},o=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),d=await window.crypto.subtle.sign(n,s,o);return lo.fromByteArray(new Uint8Array(d))}decodeBase64StringUtf8(e){let r=lo.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return lo.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,qz.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),o=new TextEncoder,s=await window.crypto.subtle.importKey("raw",o.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,o.encode(r))}};Uu.BrowserCrypto=wp});var Cb=L(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.NodeCrypto=void 0;var po=require("crypto"),Pp=class{static{i(this,"NodeCrypto")}async sha256DigestBase64(e){return po.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return po.randomBytes(e).toString("base64")}async verify(e,r,n){let o=po.createVerify("RSA-SHA256");return o.update(r),o.end(),o.verify(e,n,"base64")}async sign(e,r){let n=po.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 po.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:Vz(e);return Bz(po.createHmac("sha256",n).update(r).digest())}};Mu.NodeCrypto=Pp;function Bz(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}i(Bz,"toArrayBuffer");function Vz(t){return Buffer.from(t)}i(Vz,"toBuffer")});var xa=L(yn=>{"use strict";var Gz=yn&&yn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hz=yn&&yn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gz(e,t,r)};Object.defineProperty(yn,"__esModule",{value:!0});yn.createCrypto=Kz;yn.hasBrowserCrypto=Nb;var Wz=Ob(),Zz=Cb();Hz(_p(),yn);function Kz(){return Nb()?new Wz.BrowserCrypto:new Zz.NodeCrypto}i(Kz,"createCrypto");function Nb(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}i(Nb,"hasBrowserCrypto")});var fo=L((bp,zb)=>{var Fu=require("buffer"),Br=Fu.Buffer;function kb(t,e){for(var r in t)e[r]=t[r]}i(kb,"copyProps");Br.from&&Br.alloc&&Br.allocUnsafe&&Br.allocUnsafeSlow?zb.exports=Fu:(kb(Fu,bp),bp.Buffer=vi);function vi(t,e,r){return Br(t,e,r)}i(vi,"SafeBuffer");vi.prototype=Object.create(Br.prototype);kb(Br,vi);vi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Br(t,e,r)};vi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Br(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};vi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Br(t)};vi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Fu.SlowBuffer(t)}});var Mb=L((oee,Ub)=>{"use strict";function Tp(t){var e=(t/8|0)+(t%8===0?0:1);return e}i(Tp,"getParamSize");var Jz={ES256:Tp(256),ES384:Tp(384),ES512:Tp(521)};function Yz(t){var e=Jz[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}i(Yz,"getParamBytesForAlg");Ub.exports=Yz});var Sp=L((see,Vb)=>{"use strict";var Lu=fo().Buffer,Lb=Mb(),ju=128,jb=0,Xz=32,Qz=16,eU=2,qb=Qz|Xz|jb<<6,qu=eU|jb<<6;function tU(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(tU,"base64Url");function Bb(t){if(Lu.isBuffer(t))return t;if(typeof t=="string")return Lu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}i(Bb,"signatureAsBuffer");function rU(t,e){t=Bb(t);var r=Lb(e),n=r+1,o=t.length,s=0;if(t[s++]!==qb)throw new Error('Could not find expected "seq"');var d=t[s++];if(d===(ju|1)&&(d=t[s++]),o-s<d)throw new Error('"seq" specified length of "'+d+'", only "'+(o-s)+'" remaining');if(t[s++]!==qu)throw new Error('Could not find expected "int" for "r"');var m=t[s++];if(o-s-2<m)throw new Error('"r" specified length of "'+m+'", only "'+(o-s-2)+'" available');if(n<m)throw new Error('"r" specified length of "'+m+'", max of "'+n+'" is acceptable');var h=s;if(s+=m,t[s++]!==qu)throw new Error('Could not find expected "int" for "s"');var v=t[s++];if(o-s!==v)throw new Error('"s" specified length of "'+v+'", expected "'+(o-s)+'"');if(n<v)throw new Error('"s" specified length of "'+v+'", max of "'+n+'" is acceptable');var _=s;if(s+=v,s!==o)throw new Error('Expected to consume entire buffer, but "'+(o-s)+'" bytes remain');var x=r-m,T=r-v,P=Lu.allocUnsafe(x+m+T+v);for(s=0;s<x;++s)P[s]=0;t.copy(P,s,h+Math.max(-x,0),h+m),s=r;for(var S=s;s<S+T;++s)P[s]=0;return t.copy(P,s,_+Math.max(-T,0),_+v),P=P.toString("base64"),P=tU(P),P}i(rU,"derToJose");function Fb(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var o=t[e+n]>=ju;return o&&--n,n}i(Fb,"countPadding");function nU(t,e){t=Bb(t);var r=Lb(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=Fb(t,0,r),s=Fb(t,r,t.length),d=r-o,m=r-s,h=2+d+1+1+m,v=h<ju,_=Lu.allocUnsafe((v?2:3)+h),x=0;return _[x++]=qb,v?_[x++]=h:(_[x++]=ju|1,_[x++]=h&255),_[x++]=qu,_[x++]=d,o<0?(_[x++]=0,x+=t.copy(_,x,0,r)):x+=t.copy(_,x,o,r),_[x++]=qu,_[x++]=m,s<0?(_[x++]=0,t.copy(_,x,r)):t.copy(_,x,r+s),_}i(nU,"joseToDer");Vb.exports={derToJose:rU,joseToDer:nU}});var Dr=L(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.LRUCache=void 0;vn.snakeToCamel=Hb;vn.originalOrCamelOptions=sU;vn.removeUndefinedValuesInObject=uU;vn.isValidFile=cU;vn.getWellKnownCertificateConfigFileLocation=lU;var iU=require("fs"),oU=require("os"),Ep=require("path"),aU="certificate_config.json",Gb="gcloud";function Hb(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}i(Hb,"snakeToCamel");function sU(t){function e(r){let n=t||{};return n[r]??n[Hb(r)]}return i(e,"get"),{get:e}}i(sU,"originalOrCamelOptions");var xp=class{static{i(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()}};vn.LRUCache=xp;function uU(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}i(uU,"removeUndefinedValuesInObject");async function cU(t){try{return(await iU.promises.lstat(t)).isFile()}catch{return!1}}i(cU,"isValidFile");function lU(){let t=process.env.CLOUDSDK_CONFIG||(dU()?Ep.join(process.env.APPDATA||"",Gb):Ep.join(process.env.HOME||"",".config",Gb));return Ep.join(t,aU)}i(lU,"getWellKnownCertificateConfigFileLocation");function dU(){return oU.platform().startsWith("win")}i(dU,"_isWindows")});var Wb=L((dee,pU)=>{pU.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 Ip=L(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.USER_AGENT=Zn.PRODUCT_NAME=Zn.pkg=void 0;var Zb=Wb();Zn.pkg=Zb;var Kb="google-api-nodejs-client";Zn.PRODUCT_NAME=Kb;var fU=`${Kb}/${Zb.version}`;Zn.USER_AGENT=fU});var nr=L($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.AuthClient=$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=$r.DEFAULT_UNIVERSE=void 0;var mU=require("events"),Ap=gt(),hU=Dr(),gU=fp(),Rp=Ip();$r.DEFAULT_UNIVERSE="googleapis.com";$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var Dp=class t extends mU.EventEmitter{static{i(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=$r.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,hU.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")??$r.DEFAULT_UNIVERSE,this.transporter=e.transporter??new Ap.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],o,s=new Headers;return typeof r=="string"?o=new URL(r):r instanceof URL?o=r:r&&r.url&&(o=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&Ap.Gaxios.mergeHeaders(s,r.headers),n&&Ap.Gaxios.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:o}):this.request({...n,headers:s,url:o})}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"),o=r.get("authorization");return n&&e.set("x-goog-user-project",n),o&&e.set("authorization",o),e}static log=(0,gU.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:i(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(`${Rp.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${Rp.USER_AGENT}`):e.headers.set("User-Agent",Rp.USER_AGENT);try{let n=e,o=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let d={url:e.url,headers:e.headers};o?t.log.info("%s [%s] request %j",o,s,d):t.log.info("[%s] request %j",s,d)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:i(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],o=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,o,e.data):t.log.info("[%s] response %j",o,e.data)}catch{}return e},"resolved"),rejected:i(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],o=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,o,e.response?.data):t.log.error("[%s] error %j",o,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"]}}}};$r.AuthClient=Dp});var Op=L(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.LoginTicket=void 0;var $p=class{static{i(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()}}};Bu.LoginTicket=$p});var _i=L(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.OAuth2Client=Vr.ClientAuthentication=Vr.CertificateFormat=Vr.CodeChallengeMethod=void 0;var Jb=gt(),yU=require("querystring"),vU=require("stream"),_U=Sp(),Yb=Dr(),Cp=xa(),mo=nr(),wU=Op(),Xb;(function(t){t.Plain="plain",t.S256="S256"})(Xb||(Vr.CodeChallengeMethod=Xb={}));var _n;(function(t){t.PEM="PEM",t.JWK="JWK"})(_n||(Vr.CertificateFormat=_n={}));var Ia;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(Ia||(Vr.ClientAuthentication=Ia={}));var Np=class t extends mo.AuthClient{static{i(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=_n.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||Ia.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()+"?"+yU.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,Cp.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(o=>r(null,o.tokens,o.res),o=>r(o,null,o.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,o={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===Ia.ClientSecretBasic){let h=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${h.toString("base64")}`)}this.clientAuthentication===Ia.ClientSecretPost&&(o.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,Yb.removeUndefinedValuesInObject)(o)),headers:n};mo.AuthClient.setMethodName(s,"getTokenAsync");let d=await this.transporter.request(s),m=d.data;return d.data&&d.data.expires_in&&(m.expiry_date=new Date().getTime()+d.data.expires_in*1e3,delete m.expires_in),this.emit("tokens",m),{tokens:m,res:d}}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"},o;try{let d={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,Yb.removeUndefinedValuesInObject)(n))};mo.AuthClient.setMethodName(d,"refreshTokenNoCache"),o=await this.transporter.request(d)}catch(d){throw d instanceof Jb.GaxiosError&&d.message==="invalid_grant"&&d.response?.data&&/ReAuth/i.test(d.response.data.error_description)&&(d.message=JSON.stringify(d.response.data)),d}let s=o.data;return o.data&&o.data.expires_in&&(s.expiry_date=new Date().getTime()+o.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:o}}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 m=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(m)}}if(this.refreshHandler){let m=await this.processAndValidateRefreshHandler();if(m?.access_token){this.setCredentials(m);let h=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(h)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,o=null;try{n=await this.refreshToken(r.refresh_token),o=n.tokens}catch(m){let h=m;throw h.response&&(h.response.status===403||h.response.status===404)&&(h.message=`Could not refresh access token: ${h.message}`),h}let s=this.credentials;s.token_type=s.token_type||"Bearer",o.refresh_token=s.refresh_token,this.credentials=o;let d=new Headers({authorization:s.token_type+" "+o.access_token});return{headers:this.addSharedMetadataHeaders(d),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(mo.AuthClient.setMethodName(n,"revokeToken"),r)this.transporter.request(n).then(o=>r(null,o),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=Jb.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 o=n.response;if(o){let s=o.status,d=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),m=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,h=o.config.data instanceof vU.Readable,v=s===401||s===403;if(!r&&v&&!h&&d)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&v&&!h&&m){let _=await this.processAndValidateRefreshHandler();return _?.access_token&&this.setCredentials(_),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,Cp.hasBrowserCrypto)()?_n.JWK:_n.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,o;switch(r){case _n.PEM:o=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case _n.JWK:o=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let v={...t.RETRY_CONFIG,url:o};mo.AuthClient.setMethodName(v,"getFederatedSignonCertsAsync"),n=await this.transporter.request(v)}catch(v){throw v instanceof Error&&(v.message=`Failed to retrieve verification certificates: ${v.message}`),v}let s=n?.headers.get("cache-control"),d=-1;if(s){let v=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;v&&(d=Number(v)*1e3)}let m={};switch(r){case _n.PEM:m=n.data;break;case _n.JWK:for(let v of n.data.keys)m[v.kid]=v;break;default:throw new Error(`Unsupported certificate format ${r}`)}let h=new Date;return this.certificateExpiry=d===-1?null:new Date(h.getTime()+d),this.certificateCache=m,this.certificateCacheFormat=r,{certs:m,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};mo.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,o,s){let d=(0,Cp.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let m=e.split(".");if(m.length!==3)throw new Error("Wrong number of segments in token: "+e);let h=m[0]+"."+m[1],v=m[2],_,x;try{_=JSON.parse(d.decodeBase64StringUtf8(m[0]))}catch(c){throw c instanceof Error&&(c.message=`Can't parse token envelope: ${m[0]}': ${c.message}`),c}if(!_)throw new Error("Can't parse token envelope: "+m[0]);try{x=JSON.parse(d.decodeBase64StringUtf8(m[1]))}catch(c){throw c instanceof Error&&(c.message=`Can't parse token payload '${m[0]}`),c}if(!x)throw new Error("Can't parse token payload: "+m[1]);if(!Object.prototype.hasOwnProperty.call(r,_.kid))throw new Error("No pem found for envelope: "+JSON.stringify(_));let T=r[_.kid];if(_.alg==="ES256"&&(v=_U.joseToDer(v,"ES256").toString("base64")),!await d.verify(T,h,v))throw new Error("Invalid token signature: "+e);if(!x.iat)throw new Error("No issue time in token: "+JSON.stringify(x));if(!x.exp)throw new Error("No expiration time in token: "+JSON.stringify(x));let S=Number(x.iat);if(isNaN(S))throw new Error("iat field using invalid format");let D=Number(x.exp);if(isNaN(D))throw new Error("exp field using invalid format");let E=new Date().getTime()/1e3;if(D>=E+s)throw new Error("Expiration time too far in future: "+JSON.stringify(x));let u=S-t.CLOCK_SKEW_SECS_,f=D+t.CLOCK_SKEW_SECS_;if(E<u)throw new Error("Token used too early, "+E+" < "+u+": "+JSON.stringify(x));if(E>f)throw new Error("Token used too late, "+E+" > "+f+": "+JSON.stringify(x));if(o&&o.indexOf(x.iss)<0)throw new Error("Invalid issuer, expected one of ["+o+"], but got "+x.iss);if(typeof n<"u"&&n!==null){let c=x.aud,y=!1;if(n.constructor===Array?y=n.indexOf(c)>-1:y=c===n,!y)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new wU.LoginTicket(_,x)}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}};Vr.OAuth2Client=Np});var zp=L(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.Compute=void 0;var PU=gt(),Qb=Ea(),bU=_i(),kp=class extends bU.OAuth2Client{static{i(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 o={property:e};this.scopes.length>0&&(o.params={scopes:this.scopes.join(",")}),r=await Qb.instance(o)}catch(o){throw o instanceof PU.GaxiosError&&(o.message=`Could not refresh access token: ${o.message}`,this.wrapError(o)),o}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 o={property:r};n=await Qb.instance(o)}catch(o){throw o instanceof Error&&(o.message=`Could not fetch ID token: ${o.message}`),o}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))}};Vu.Compute=kp});var Mp=L(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.IdTokenClient=void 0;var TU=_i(),Up=class extends TU.OAuth2Client{static{i(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}};Gu.IdTokenClient=Up});var Fp=L(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.GCPEnv=void 0;ho.clear=SU;ho.getEnv=EU;var eT=Ea(),Gr;(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"})(Gr||(ho.GCPEnv=Gr={}));var Aa;function SU(){Aa=void 0}i(SU,"clear");async function EU(){return Aa||(Aa=xU(),Aa)}i(EU,"getEnv");async function xU(){let t=Gr.NONE;return IU()?t=Gr.APP_ENGINE:AU()?t=Gr.CLOUD_FUNCTIONS:await OU()?await $U()?t=Gr.KUBERNETES_ENGINE:RU()?t=Gr.CLOUD_RUN:DU()?t=Gr.CLOUD_RUN_JOBS:t=Gr.COMPUTE_ENGINE:t=Gr.NONE,t}i(xU,"getEnvMemoized");function IU(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}i(IU,"isAppEngine");function AU(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}i(AU,"isCloudFunction");function RU(){return!!process.env.K_CONFIGURATION}i(RU,"isCloudRun");function DU(){return!!process.env.CLOUD_RUN_JOB}i(DU,"isCloudRunJob");async function $U(){try{return await eT.instance("attributes/cluster-name"),!0}catch{return!1}}i($U,"isKubernetesEngine");async function OU(){return eT.isAvailable()}i(OU,"isComputeEngine")});var Lp=L((Eee,tT)=>{var Hu=fo().Buffer,CU=require("stream"),NU=require("util");function Wu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Hu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Hu.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+")")}i(Wu,"DataStream");NU.inherits(Wu,CU);Wu.prototype.write=i(function(e){this.buffer=Hu.concat([this.buffer,Hu.from(e)]),this.emit("data",e)},"write");Wu.prototype.end=i(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");tT.exports=Wu});var nT=L((Iee,rT)=>{"use strict";var Ra=require("buffer").Buffer,jp=require("buffer").SlowBuffer;rT.exports=Zu;function Zu(t,e){if(!Ra.isBuffer(t)||!Ra.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}i(Zu,"bufferEq");Zu.install=function(){Ra.prototype.equal=jp.prototype.equal=i(function(e){return Zu(this,e)},"equal")};var kU=Ra.prototype.equal,zU=jp.prototype.equal;Zu.restore=function(){Ra.prototype.equal=kU,jp.prototype.equal=zU}});var Gp=L((Ree,pT)=>{var yo=fo().Buffer,yr=require("crypto"),oT=Sp(),iT=require("util"),UU=`"%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".`,Da="secret must be a string or buffer",go="key must be a string or a buffer",NU="key must be a string, a buffer or an object",Bp=typeof yr.createPublicKey=="function";Bp&&(go+=" or a KeyObject",Da+="or a KeyObject");function iT(t){if(!yo.isBuffer(t)&&typeof t!="string"&&(!Bp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Or(go)}i(iT,"checkIsPublicKey");function oT(t){if(!yo.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Or(NU)}i(oT,"checkIsPrivateKey");function kU(t){if(!yo.isBuffer(t)){if(typeof t=="string")return t;if(!Bp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Or(Da)}}i(kU,"checkIsSecretKey");function Vp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(Vp,"fromBase64");function aT(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,"/")}i(aT,"toBase64");function Or(t){var e=[].slice.call(arguments,1),r=rT.format.bind(rT,t).apply(null,e);return new TypeError(r)}i(Or,"typeError");function zU(t){return yo.isBuffer(t)||typeof t=="string"}i(zU,"bufferOrString");function $a(t){return zU(t)||(t=JSON.stringify(t)),t}i($a,"normalizeInput");function sT(t){return i(function(r,n){kU(n),r=$a(r);var o=yr.createHmac("sha"+t,n),s=(o.update(r),o.digest("base64"));return Vp(s)},"sign")}i(sT,"createHmacSigner");var qp,UU="timingSafeEqual"in yr?i(function(e,r){return e.byteLength!==r.byteLength?!1:yr.timingSafeEqual(e,r)},"timingSafeEqual"):i(function(e,r){return qp||(qp=tT()),qp(e,r)},"timingSafeEqual");function MU(t){return i(function(r,n,o){var s=sT(t)(r,o);return UU(yo.from(n),yo.from(s))},"verify")}i(MU,"createHmacVerifier");function uT(t){return i(function(r,n){oT(n),r=$a(r);var o=yr.createSign("RSA-SHA"+t),s=(o.update(r),o.sign(n,"base64"));return Vp(s)},"sign")}i(uT,"createKeySigner");function cT(t){return i(function(r,n,o){iT(o),r=$a(r),n=aT(n);var s=yr.createVerify("RSA-SHA"+t);return s.update(r),s.verify(o,n,"base64")},"verify")}i(cT,"createKeyVerifier");function FU(t){return i(function(r,n){oT(n),r=$a(r);var o=yr.createSign("RSA-SHA"+t),s=(o.update(r),o.sign({key:n,padding:yr.constants.RSA_PKCS1_PSS_PADDING,saltLength:yr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Vp(s)},"sign")}i(FU,"createPSSKeySigner");function LU(t){return i(function(r,n,o){iT(o),r=$a(r),n=aT(n);var s=yr.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:o,padding:yr.constants.RSA_PKCS1_PSS_PADDING,saltLength:yr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}i(LU,"createPSSKeyVerifier");function jU(t){var e=uT(t);return i(function(){var n=e.apply(null,arguments);return n=nT.derToJose(n,"ES"+t),n},"sign")}i(jU,"createECDSASigner");function qU(t){var e=cT(t);return i(function(n,o,s){o=nT.joseToDer(o,"ES"+t).toString("base64");var d=e(n,o,s);return d},"verify")}i(qU,"createECDSAVerifer");function BU(){return i(function(){return""},"sign")}i(BU,"createNoneSigner");function VU(){return i(function(e,r){return r===""},"verify")}i(VU,"createNoneVerifier");lT.exports=i(function(e){var r={hs:sT,rs:uT,ps:FU,es:jU,none:BU},n={hs:MU,rs:cT,ps:LU,es:qU,none:VU},o=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!o)throw Or(CU,e);var s=(o[1]||o[3]).toLowerCase(),d=o[2];return{sign:r[s](d),verify:n[s](d)}},"jwa")});var Hp=L((Eee,dT)=>{var GU=require("buffer").Buffer;dT.exports=i(function(e){return typeof e=="string"?e:typeof e=="number"||GU.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var yT=L((Iee,gT)=>{var HU=fo().Buffer,pT=Lp(),WU=Gp(),ZU=require("stream"),fT=Hp(),Wp=require("util");function mT(t,e){return HU.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(mT,"base64url");function KU(t,e,r){r=r||"utf8";var n=mT(fT(t),"binary"),o=mT(fT(e),r);return Wp.format("%s.%s",n,o)}i(KU,"jwsSecuredInput");function hT(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=WU(e.alg),d=KU(e,r,o),m=s.sign(d,n);return Wp.format("%s.%s",d,m)}i(hT,"jwsSign");function Ku(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 pT(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new pT(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))}i(Ku,"SignStream");Wp.inherits(Ku,ZU);Ku.prototype.sign=i(function(){try{var e=hT({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");Ku.sign=hT;gT.exports=Ku});var IT=L((Ree,xT)=>{var _T=fo().Buffer,vT=Lp(),JU=Gp(),YU=require("stream"),wT=Hp(),XU=require("util"),QU=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function eM(t){return Object.prototype.toString.call(t)==="[object Object]"}i(eM,"isObject");function tM(t){if(eM(t))return t;try{return JSON.parse(t)}catch{return}}i(tM,"safeJsonParse");function PT(t){var e=t.split(".",1)[0];return tM(_T.from(e,"base64").toString("binary"))}i(PT,"headerFromJWS");function rM(t){return t.split(".",2).join(".")}i(rM,"securedInputFromJWS");function bT(t){return t.split(".")[2]}i(bT,"signatureFromJWS");function nM(t,e){e=e||"utf8";var r=t.split(".")[1];return _T.from(r,"base64").toString(e)}i(nM,"payloadFromJWS");function TT(t){return QU.test(t)&&!!PT(t)}i(TT,"isValidJws");function ST(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=wT(t);var o=bT(t),s=rM(t),d=JU(e);return d.verify(s,o,r)}i(ST,"jwsVerify");function ET(t,e){if(e=e||{},t=wT(t),!TT(t))return null;var r=PT(t);if(!r)return null;var n=nM(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:bT(t)}}i(ET,"jwsDecode");function vo(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 vT(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new vT(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))}i(vo,"VerifyStream");XU.inherits(vo,YU);vo.prototype.verify=i(function(){try{var e=ST(this.signature.buffer,this.algorithm,this.key.buffer),r=ET(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");vo.decode=ET;vo.isValid=TT;vo.verify=ST;xT.exports=vo});var Zp=L(Kn=>{var AT=yT(),Ju=IT(),iM=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Kn.ALGORITHMS=iM;Kn.sign=AT.sign;Kn.verify=Ju.verify;Kn.decode=Ju.decode;Kn.isValid=Ju.isValid;Kn.createSign=i(function(e){return new AT(e)},"createSign");Kn.createVerify=i(function(e){return new Ju(e)},"createVerify")});var BT=L(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.GoogleToken=void 0;var RT=Yu(require("fs")),oM=gt(),aM=Yu(Zp()),sM=Yu(require("path")),uM=require("util");function Yu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Yu=i(function(s,d){if(!d&&s&&s.__esModule)return s;var m,h,v={__proto__:null,default:s};if(s===null||wn(s)!="object"&&typeof s!="function")return v;if(m=d?n:r){if(m.has(s))return m.get(s);m.set(s,v)}for(var _ in s)_!=="default"&&{}.hasOwnProperty.call(s,_)&&((h=(m=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,_))&&(h.get||h.set)?m(v,_,h):v[_]=s[_]);return v},"_interopRequireWildcard"))(t,e)}i(Yu,"_interopRequireWildcard");function wn(t){"@babel/helpers - typeof";return wn=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},wn(t)}i(wn,"_typeof");function cM(t,e){MT(t,e),e.add(t)}i(cM,"_classPrivateMethodInitSpec");function lM(t,e,r){MT(t,e),e.set(t,r)}i(lM,"_classPrivateFieldInitSpec");function MT(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(MT,"_checkPrivateRedeclaration");function DT(t,e,r){return t.set(Cr(t,e),r),r}i(DT,"_classPrivateFieldSet");function $T(t,e){return t.get(Cr(t,e))}i($T,"_classPrivateFieldGet");function Cr(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")}i(Cr,"_assertClassBrand");function OT(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,jT(n.key),n)}}i(OT,"_defineProperties");function FT(t,e,r){return e&&OT(t.prototype,e),r&&OT(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}i(FT,"_createClass");function LT(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}i(LT,"_classCallCheck");function dM(t,e,r){return e=ka(e),pM(t,ef()?Reflect.construct(e,r||[],ka(t).constructor):e.apply(t,r))}i(dM,"_callSuper");function pM(t,e){if(e&&(wn(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fM(t)}i(pM,"_possibleConstructorReturn");function fM(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}i(fM,"_assertThisInitialized");function mM(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&&Na(t,e)}i(mM,"_inherits");function Kp(t){var e=typeof Map=="function"?new Map:void 0;return Kp=i(function(n){if(n===null||!gM(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,o)}function o(){return hM(n,arguments,ka(this).constructor)}return i(o,"Wrapper"),o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Na(o,n)},"_wrapNativeSuper"),Kp(t)}i(Kp,"_wrapNativeSuper");function hM(t,e,r){if(ef())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&Na(o,r.prototype),o}i(hM,"_construct");function ef(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ef=i(function(){return!!t},"_isNativeReflectConstruct"))()}i(ef,"_isNativeReflectConstruct");function gM(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}i(gM,"_isNativeFunction");function Na(t,e){return Na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Na(t,e)}i(Na,"_setPrototypeOf");function ka(t){return ka=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ka(t)}i(ka,"_getPrototypeOf");function ir(t,e,r){return(e=jT(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}i(ir,"_defineProperty");function jT(t){var e=yM(t,"string");return wn(e)=="symbol"?e:e+""}i(jT,"_toPropertyKey");function yM(t,e){if(wn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(wn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}i(yM,"_toPrimitive");function ar(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function s(P,S,D,E){var u=S&&S.prototype instanceof m?S:m,f=Object.create(u.prototype);return or(f,"_invoke",(function(c,y,l){var b,g,ae,re=0,Ue=l||[],se=!1,X={p:0,n:0,v:t,a:Y,f:Y.bind(t,4),d:i(function(ee,ce){return b=ee,g=0,ae=t,X.n=ce,d},"d")};function Y(ne,ee){for(g=ne,ae=ee,e=0;!se&&re&&!ce&&e<Ue.length;e++){var ce,de=Ue[e],ke=X.p,Me=de[2];ne>3?(ce=Me===ee)&&(ae=de[(g=de[4])?5:(g=3,3)],de[4]=de[5]=t):de[0]<=ke&&((ce=ne<2&&ke<de[1])?(g=0,X.v=ee,X.n=de[1]):ke<Me&&(ce=ne<3||de[0]>ee||ee>Me)&&(de[4]=ne,de[5]=ee,X.n=Me,g=0))}if(ce||ne>1)return d;throw se=!0,ee}return i(Y,"d"),function(ne,ee,ce){if(re>1)throw TypeError("Generator is already running");for(se&&ee===1&&Y(ee,ce),g=ee,ae=ce;(e=g<2?t:ae)||!se;){b||(g?g<3?(g>1&&(X.n=-1),Y(g,ae)):X.n=ae:X.v=ae);try{if(re=2,b){if(g||(ne="next"),e=b[ne]){if(!(e=e.call(b,ae)))throw TypeError("iterator result is not an object");if(!e.done)return e;ae=e.value,g<2&&(g=0)}else g===1&&(e=b.return)&&e.call(b),g<2&&(ae=TypeError("The iterator does not provide a '"+ne+"' method"),g=1);b=t}else if((e=(se=X.n<0)?ae:c.call(y,X))!==d)break}catch(de){b=t,g=1,ae=de}finally{re=1}}return{value:e,done:se}}})(P,D,E),!0),f}i(s,"i");var d={};function m(){}i(m,"Generator");function h(){}i(h,"GeneratorFunction");function v(){}i(v,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var _=[][n]?e(e([][n]())):(or(e={},n,function(){return this}),e),x=v.prototype=m.prototype=Object.create(_);function T(P){return Object.setPrototypeOf?Object.setPrototypeOf(P,v):(P.__proto__=v,or(P,o,"GeneratorFunction")),P.prototype=Object.create(x),P}return i(T,"f"),h.prototype=v,or(x,"constructor",v),or(v,"constructor",h),h.displayName="GeneratorFunction",or(v,o,"GeneratorFunction"),or(x),or(x,o,"Generator"),or(x,n,function(){return this}),or(x,"toString",function(){return"[object Generator]"}),(ar=i(function(){return{w:s,m:T}},"_regenerator"))()}i(ar,"_regenerator");function or(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch{o=0}or=i(function(d,m,h,v){if(m)o?o(d,m,{value:h,enumerable:!v,configurable:!v,writable:!v}):d[m]=h;else{var _=i(function(T,P){or(d,T,function(S){return this._invoke(T,P,S)})},"o");_("next",0),_("throw",1),_("return",2)}},"_regeneratorDefine"),or(t,e,r,n)}i(or,"_regeneratorDefine2");function CT(t,e,r,n,o,s,d){try{var m=t[s](d),h=m.value}catch(v){return void r(v)}m.done?e(h):Promise.resolve(h).then(n,o)}i(CT,"asyncGeneratorStep");function _o(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var s=t.apply(e,r);function d(h){CT(s,n,o,d,m,"next",h)}i(d,"_next");function m(h){CT(s,n,o,d,m,"throw",h)}i(m,"_throw"),d(void 0)})}}i(_o,"_asyncToGenerator");var NT=RT.readFile?(0,uM.promisify)(RT.readFile):_o(ar().m(i(function t(){return ar().w(function(e){for(;;)switch(e.n){case 0:throw new Ca("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),kT="https://oauth2.googleapis.com/token",vM="https://oauth2.googleapis.com/revoke?token=",Ca=(function(t){function e(r,n){var o;return LT(this,e),o=dM(this,e,[r]),ir(o,"code",void 0),o.code=n,o}return i(e,"ErrorWithCode"),mM(e,t),FT(e)})(Kp(Error)),Oa=new WeakMap,Hr=new WeakSet,Cee=Xu.GoogleToken=(function(){function t(e){LT(this,t),cM(this,Hr),ir(this,"expiresAt",void 0),ir(this,"key",void 0),ir(this,"keyFile",void 0),ir(this,"iss",void 0),ir(this,"sub",void 0),ir(this,"scope",void 0),ir(this,"rawToken",void 0),ir(this,"tokenExpires",void 0),ir(this,"email",void 0),ir(this,"additionalClaims",void 0),ir(this,"eagerRefreshThresholdMillis",void 0),ir(this,"transporter",{request:i(function(n){return(0,oM.request)(n)},"request")}),lM(this,Oa,void 0),Cr(Hr,this,qT).call(this,e)}return i(t,"GoogleToken"),FT(t,[{key:"accessToken",get:i(function(){return this.rawToken?this.rawToken.access_token:void 0},"get")},{key:"idToken",get:i(function(){return this.rawToken?this.rawToken.id_token:void 0},"get")},{key:"tokenType",get:i(function(){return this.rawToken?this.rawToken.token_type:void 0},"get")},{key:"refreshToken",get:i(function(){return this.rawToken?this.rawToken.refresh_token:void 0},"get")},{key:"hasExpired",value:i(function(){var r=new Date().getTime();return this.rawToken&&this.expiresAt?r>=this.expiresAt:!0},"hasExpired")},{key:"isTokenExpiring",value:i(function(){var r,n=new Date().getTime(),o=(r=this.eagerRefreshThresholdMillis)!==null&&r!==void 0?r:0;return this.rawToken&&this.expiresAt?this.expiresAt<=n+o:!0},"isTokenExpiring")},{key:"getToken",value:i(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(wn(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var o=r;Cr(Hr,this,zT).call(this,n).then(function(s){return o(null,s)},r);return}return Cr(Hr,this,zT).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=_o(ar().m(i(function n(o){var s,d,m,h,v,_,x;return ar().w(function(T){for(;;)switch(T.n){case 0:s=sM.extname(o),x=s,T.n=x===".json"?1:x===".der"||x===".crt"||x===".pem"?4:x===".p12"||x===".pfx"?6:7;break;case 1:return T.n=2,NT(o,"utf8");case 2:if(d=T.v,m=JSON.parse(d),h=m.private_key,v=m.client_email,!(!h||!v)){T.n=3;break}throw new Ca("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return T.a(2,{privateKey:h,clientEmail:v});case 4:return T.n=5,NT(o,"utf8");case 5:return _=T.v,T.a(2,{privateKey:_});case 6:throw new Ca("*.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 Ca("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return T.a(2)}},n)},"_callee2")));function r(n){return e.apply(this,arguments)}return i(r,"getCredentials"),r})()},{key:"revokeToken",value:i(function(r){if(r){Cr(Hr,this,UT).call(this).then(function(){return r()},r);return}return Cr(Hr,this,UT).call(this)},"revokeToken")}])})();function zT(t){return Jp.apply(this,arguments)}i(zT,"_getTokenAsync");function Jp(){return Jp=_o(ar().m(i(function t(e){return ar().w(function(r){for(;;)switch(r.n){case 0:if(!($T(Oa,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,$T(Oa,this));case 1:return r.p=1,r.n=2,DT(Oa,this,Cr(Hr,this,_M).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,DT(Oa,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),Jp.apply(this,arguments)}i(Jp,"_getTokenAsync2");function _M(t){return Yp.apply(this,arguments)}i(_M,"_getTokenAsyncInner");function Yp(){return Yp=_o(ar().m(i(function t(e){var r;return ar().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||Cr(Hr,this,wM).call(this);case 4:return n.a(2,Cr(Hr,this,PM).call(this))}},t,this)},"_callee4"))),Yp.apply(this,arguments)}i(Yp,"_getTokenAsyncInner2");function wM(){if(!this.iss)throw new Ca("email is required.","MISSING_CREDENTIALS")}i(wM,"_ensureEmail");function UT(){return Xp.apply(this,arguments)}i(UT,"_revokeTokenAsync");function Xp(){return Xp=_o(ar().m(i(function t(){var e;return ar().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=vM+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Cr(Hr,this,qT).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"))),Xp.apply(this,arguments)}i(Xp,"_revokeTokenAsync2");function qT(){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,wn(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}i(qT,"_configure");function PM(){return Qp.apply(this,arguments)}i(PM,"_requestToken");function Qp(){return Qp=_o(ar().m(i(function t(){var e,r,n,o,s,d,m,h,v,_;return ar().w(function(x){for(;;)switch(x.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:kT,exp:e+3600,iat:e,sub:this.sub},r),o=aM.sign({header:{alg:"RS256"},payload:n,secret:this.key}),x.p=1,x.n=2,this.transporter.request({method:"POST",url:kT,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:o}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=x.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,x.a(2,this.rawToken);case 3:throw x.p=3,_=x.v,this.rawToken=void 0,this.tokenExpires=void 0,h=_.response&&(d=_.response)!==null&&d!==void 0&&d.data?(m=_.response)===null||m===void 0?void 0:m.data:{},h.error&&(v=h.error_description?": ".concat(h.error_description):"",_.message="".concat(h.error).concat(v)),_;case 4:return x.a(2)}},t,this,[[1,3]])},"_callee6"))),Qp.apply(this,arguments)}i(Qp,"_requestToken2")});var rf=L(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.JWTAccess=void 0;var bM=Zp(),TM=Dr(),VT={alg:"RS256",typ:"JWT"},tf=class t{static{i(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new TM.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,o){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=o??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 o=this.getCachedKey(e,n),s=this.cache.get(o),d=Date.now();if(s&&s.expiration-d>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let m=Math.floor(Date.now()/1e3),h=t.getExpirationTime(m),v;if(Array.isArray(n)&&(n=n.join(" ")),n?v={iss:this.email,sub:this.email,scope:n,exp:h,iat:m}:v={iss:this.email,sub:this.email,aud:e,exp:h,iat:m},r){for(let S in v)if(r[S])throw new Error(`The '${S}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let _=this.keyId?{...VT,kid:this.keyId}:VT,x=Object.assign(v,r),T=bM.sign({header:_,payload:x,secret:this.key}),P=new Headers({authorization:`Bearer ${T}`});return this.cache.set(o,{expiration:h*1e3,headers:P}),P}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 o="";e.setEncoding("utf8").on("data",s=>o+=s).on("error",n).on("end",()=>{try{let s=JSON.parse(o);this.fromJSON(s),r()}catch(s){n(s)}})})}};Qu.JWTAccess=tf});var of=L(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.JWT=void 0;var GT=BT(),SM=rf(),EM=_i(),ec=nr(),nf=class t extends EM.OAuth2Client{static{i(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!==ec.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==ec.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${ec.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 SM.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let n;this.hasUserScopes()?n=this.scopes:e||(n=this.defaultScopes);let o=this.useJWTAccessWithScope||this.universeDomain!==ec.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,o?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 GT.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 GT.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 o="";e.setEncoding("utf8").on("error",n).on("data",s=>o+=s).on("end",()=>{try{let s=JSON.parse(o);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.")}};tc.JWT=nf});var sf=L(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.UserRefreshClient=wo.USER_REFRESH_ACCOUNT_TYPE=void 0;var xM=_i(),IM=nr();wo.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var af=class t extends xM.OAuth2Client{static{i(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,o,s){let d=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:o,forceRefreshOnFailure:s};super(d),this._refreshToken=d.refreshToken,this.credentials.refresh_token=d.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 IM.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 o="";e.setEncoding("utf8").on("error",n).on("data",s=>o+=s).on("end",()=>{try{let s=JSON.parse(o);return this.fromJSON(s),r()}catch(s){return n(s)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};wo.UserRefreshClient=af});var cf=L(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.Impersonated=Po.IMPERSONATED_ACCOUNT_TYPE=void 0;var HT=_i(),AM=gt(),RM=Dr();Po.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var uf=class t extends HT.OAuth2Client{static{i(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 HT.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,RM.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`,o={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:o,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"},o=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),s=o.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:o}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof AM.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}`,o=`${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:o,data:s,method:"POST"})).data.token}};Po.Impersonated=uf});var df=L(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.OAuthClientAuthHandler=void 0;za.getErrorFromOAuthErrorResponse=OM;var bo=gt(),DM=xa(),$M=["PUT","POST","PATCH"],lf=class{static{i(this,"OAuthClientAuthHandler")}#e=(0,DM.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new bo.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new bo.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=bo.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=bo.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=bo.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,o=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${o}`);bo.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!$M.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let o=new Headers(e.headers).get("content-type");if(o?.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(o?.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(`${o} 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"]}}}};za.OAuthClientAuthHandler=lf;function OM(t,e){let r=t.error,n=t.error_description,o=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof o<"u"&&(s+=` - ${o}`);let d=new Error(s);if(e){let m=Object.keys(e);e.stack&&m.push("stack"),m.forEach(h=>{h!=="message"&&Object.defineProperty(d,h,{value:e[h],writable:!1,enumerable:!0})})}return d}i(OM,"getErrorFromOAuthErrorResponse")});var nc=L(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.StsCredentials=void 0;var CM=gt(),NM=nr(),WT=df(),kM=Dr(),pf=class t extends WT.OAuthClientAuthHandler{static{i(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 o={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,kM.removeUndefinedValuesInObject)(o))};NM.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let d=await this.transporter.request(s),m=d.data;return m.res=d,m}catch(d){throw d instanceof CM.GaxiosError&&d.response?(0,WT.getErrorFromOAuthErrorResponse)(d.response.data,d):d}}};rc.StsCredentials=pf});var Jn=L(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.BaseExternalAccountClient=vr.CLOUD_RESOURCE_MANAGER=vr.EXTERNAL_ACCOUNT_TYPE=vr.EXPIRATION_TIME_OFFSET=void 0;var zM=gt(),UM=require("stream"),ff=nr(),MM=nc(),ZT=Dr(),FM=Ip(),LM="urn:ietf:params:oauth:grant-type:token-exchange",jM="urn:ietf:params:oauth:token-type:access_token",mf="https://www.googleapis.com/auth/cloud-platform",qM=3600;vr.EXPIRATION_TIME_OFFSET=300*1e3;vr.EXTERNAL_ACCOUNT_TYPE="external_account";vr.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var BM="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",VM="https://sts.{universeDomain}/v1/token",hf=class t extends ff.AuthClient{static{i(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,ZT.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==vr.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${vr.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let o=r.get("client_id"),s=r.get("client_secret");this.tokenUrl=r.get("token_url")??VM.replace("{universeDomain}",this.universeDomain);let d=r.get("subject_token_type"),m=r.get("workforce_pool_user_project"),h=r.get("service_account_impersonation_url"),v=r.get("service_account_impersonation"),_=(0,ZT.originalOrCamelOptions)(v).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),o&&(this.clientAuth={confidentialClientType:"basic",clientId:o,clientSecret:s}),this.stsCredential=new MM.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[mf],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=d,this.workforcePoolUserProject=m;let x=new RegExp(BM);if(this.workforcePoolUserProject&&!this.audience.match(x))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=h,this.serviceAccountImpersonationLifetime=_,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=qM),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}`};ff.AuthClient.setMethodName(n,"getProjectId");let o=await this.transporter.request(n);return this.projectId=o.data.projectId,this.projectId}return null}async requestAsync(e,r=!1){let n;try{let o=await this.getRequestHeaders();e.headers=zM.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let d=s.status,m=s.config.data instanceof UM.Readable;if(!r&&(d===401||d===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw o}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:LM,audience:this.audience,requestedTokenType:jM,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[mf]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,o=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(r,o,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"}};ff.AuthClient.setMethodName(r,"getImpersonatedAccessToken");let n=await this.transporter.request(r),o=n.data;return{access_token:o.accessToken,expiry_date:new Date(o.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||[mf]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${FM.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};vr.BaseExternalAccountClient=hf});var KT=L(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.FileSubjectTokenSupplier=void 0;var yf=require("util"),vf=require("fs"),GM=(0,yf.promisify)(vf.readFile??(()=>{})),HM=(0,yf.promisify)(vf.realpath??(()=>{})),WM=(0,yf.promisify)(vf.lstat??(()=>{})),gf=class{static{i(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 HM(e),!(await WM(e)).isFile())throw new Error}catch(o){throw o instanceof Error&&(o.message=`The file at ${e} does not exist, or it is not a file. ${o.message}`),o}let r,n=await GM(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}};ic.FileSubjectTokenSupplier=gf});var JT=L(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.UrlSubjectTokenSupplier=void 0;var ZM=nr(),_f=class{static{i(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};ZM.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}};oc.UrlSubjectTokenSupplier=_f});var YT=L(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.CertificateSubjectTokenSupplier=sr.InvalidConfigurationError=sr.CertificateSourceUnavailableError=sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var ac=Dr(),sc=require("fs"),uc=require("crypto"),KM=require("https");sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Wr=class extends Error{static{i(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};sr.CertificateSourceUnavailableError=Wr;var _r=class extends Error{static{i(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};sr.InvalidConfigurationError=_r;var wf=class{static{i(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new _r("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new _r("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new _r("Cannot create mTLS Agent with missing certificate or key");return new KM.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,ac.isValidFile)(e))return e;throw new Wr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,ac.isValidFile)(r))return r;throw new Wr(`Path from environment variable "${sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,ac.getWellKnownCertificateConfigFileLocation)();if(await(0,ac.isValidFile)(n))return n;throw new Wr(`Could not find certificate configuration file. Searched override path, the "${sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await sc.promises.readFile(e,"utf8")}catch{throw new Wr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),o=n?.cert_configs?.workload?.cert_path,s=n?.cert_configs?.workload?.key_path;if(!o||!s)throw new _r(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:o,keyPath:s}}catch(n){throw n instanceof _r?n:new _r(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,o;try{n=await sc.promises.readFile(e),new uc.X509Certificate(n)}catch(s){let d=s instanceof Error?s.message:String(s);throw new Wr(`Failed to read certificate file at ${e}: ${d}`)}try{o=await sc.promises.readFile(r),(0,uc.createPrivateKey)(o)}catch(s){let d=s instanceof Error?s.message:String(s);throw new Wr(`Failed to read private key file at ${r}: ${d}`)}return{cert:n,key:o}}async#n(e){let r=new uc.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await sc.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((h,v)=>{try{return new uc.X509Certificate(h)}catch(_){let x=_ instanceof Error?_.message:String(_);throw new _r(`Failed to parse certificate at index ${v} in trust chain file ${this.trustChainPath}: ${x}`)}}),d=s.findIndex(h=>r.raw.equals(h.raw)),m;if(d===-1)m=[r,...s];else if(d===0)m=s;else throw new _r(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${d}).`);return JSON.stringify(m.map(h=>h.raw.toString("base64")))}catch(n){if(n instanceof _r)throw n;let o=n instanceof Error?n.message:String(n);throw new Wr(`Failed to process certificate chain from ${this.trustChainPath}: ${o}`)}}};sr.CertificateSubjectTokenSupplier=wf});var Tf=L(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.IdentityPoolClient=void 0;var JM=Jn(),Pf=Dr(),YM=KT(),XM=JT(),XT=YT(),QM=nc(),QT=gt(),bf=class t extends JM.BaseExternalAccountClient{static{i(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,Pf.originalOrCamelOptions)(e),n=r.get("credential_source"),o=r.get("subject_token_supplier");if(!n&&!o)throw new Error("A credential source or subject token supplier must be specified.");if(n&&o)throw new Error("Only one of credential source or subject token supplier can be specified.");if(o)this.subjectTokenSupplier=o,this.credentialSourceType="programmatic";else{let s=(0,Pf.originalOrCamelOptions)(n),d=(0,Pf.originalOrCamelOptions)(s.get("format")),m=d.get("type")||"text",h=d.get("subject_token_field_name");if(m!=="json"&&m!=="text")throw new Error(`Invalid credential_source format "${m}"`);if(m==="json"&&!h)throw new Error("Missing subject_token_field_name for JSON credential_source format");let v=s.get("file"),_=s.get("url"),x=s.get("certificate"),T=s.get("headers");if(v&&_||_&&x||v&&x)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(v)this.credentialSourceType="file",this.subjectTokenSupplier=new YM.FileSubjectTokenSupplier({filePath:v,formatType:m,subjectTokenFieldName:h});else if(_)this.credentialSourceType="url",this.subjectTokenSupplier=new XM.UrlSubjectTokenSupplier({url:_,formatType:m,subjectTokenFieldName:h,headers:T,additionalGaxiosOptions:t.RETRY_CONFIG});else if(x){this.credentialSourceType="certificate";let P=new XT.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:x.use_default_certificate_config,certificateConfigLocation:x.certificate_config_location,trustChainPath:x.trust_chain_path});this.subjectTokenSupplier=P}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 XT.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new QM.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new QT.Gaxios({agent:r})}),this.transporter=new QT.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};cc.IdentityPoolClient=bf});var Ef=L(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.AwsRequestSigner=void 0;var lc=gt(),tS=xa(),eS="AWS4-HMAC-SHA256",eF="aws4_request",Sf=class{static{i(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,tS.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,o=e.method||"GET",s=e.body||r,d=e.headers,m=await this.getCredentials(),h=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 v=await rF({crypto:this.crypto,host:h.host,canonicalUri:h.pathname,canonicalQuerystring:h.search.slice(1),method:o,region:this.region,securityCredentials:m,requestPayload:s,additionalAmzHeaders:d}),_=lc.Gaxios.mergeHeaders(v.amzDate?{"x-amz-date":v.amzDate}:{},{authorization:v.authorizationHeader,host:h.host},d||{});m.token&&lc.Gaxios.mergeHeaders(_,{"x-amz-security-token":m.token});let x={url:n,method:o,headers:_};return s!==void 0&&(x.body=s),x}};dc.AwsRequestSigner=Sf;async function Ua(t,e,r){return await t.signWithHmacSha256(e,r)}i(Ua,"sign");async function tF(t,e,r,n,o){let s=await Ua(t,`AWS4${e}`,r),d=await Ua(t,s,n),m=await Ua(t,d,o);return await Ua(t,m,"aws4_request")}i(tF,"getSigningKey");async function rF(t){let e=lc.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],o=new Date,s=o.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),d=o.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let m=lc.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),h="",v=[...m.keys()].sort();v.forEach(f=>{h+=`${f}:${m.get(f)}
|
|
40
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Da="secret must be a string or buffer",go="key must be a string or a buffer",MU="key must be a string, a buffer or an object",Bp=typeof yr.createPublicKey=="function";Bp&&(go+=" or a KeyObject",Da+="or a KeyObject");function aT(t){if(!yo.isBuffer(t)&&typeof t!="string"&&(!Bp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Or(go)}i(aT,"checkIsPublicKey");function sT(t){if(!yo.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Or(MU)}i(sT,"checkIsPrivateKey");function FU(t){if(!yo.isBuffer(t)){if(typeof t=="string")return t;if(!Bp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Or(Da)}}i(FU,"checkIsSecretKey");function Vp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(Vp,"fromBase64");function uT(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,"/")}i(uT,"toBase64");function Or(t){var e=[].slice.call(arguments,1),r=iT.format.bind(iT,t).apply(null,e);return new TypeError(r)}i(Or,"typeError");function LU(t){return yo.isBuffer(t)||typeof t=="string"}i(LU,"bufferOrString");function $a(t){return LU(t)||(t=JSON.stringify(t)),t}i($a,"normalizeInput");function cT(t){return i(function(r,n){FU(n),r=$a(r);var o=yr.createHmac("sha"+t,n),s=(o.update(r),o.digest("base64"));return Vp(s)},"sign")}i(cT,"createHmacSigner");var qp,jU="timingSafeEqual"in yr?i(function(e,r){return e.byteLength!==r.byteLength?!1:yr.timingSafeEqual(e,r)},"timingSafeEqual"):i(function(e,r){return qp||(qp=nT()),qp(e,r)},"timingSafeEqual");function qU(t){return i(function(r,n,o){var s=cT(t)(r,o);return jU(yo.from(n),yo.from(s))},"verify")}i(qU,"createHmacVerifier");function lT(t){return i(function(r,n){sT(n),r=$a(r);var o=yr.createSign("RSA-SHA"+t),s=(o.update(r),o.sign(n,"base64"));return Vp(s)},"sign")}i(lT,"createKeySigner");function dT(t){return i(function(r,n,o){aT(o),r=$a(r),n=uT(n);var s=yr.createVerify("RSA-SHA"+t);return s.update(r),s.verify(o,n,"base64")},"verify")}i(dT,"createKeyVerifier");function BU(t){return i(function(r,n){sT(n),r=$a(r);var o=yr.createSign("RSA-SHA"+t),s=(o.update(r),o.sign({key:n,padding:yr.constants.RSA_PKCS1_PSS_PADDING,saltLength:yr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Vp(s)},"sign")}i(BU,"createPSSKeySigner");function VU(t){return i(function(r,n,o){aT(o),r=$a(r),n=uT(n);var s=yr.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:o,padding:yr.constants.RSA_PKCS1_PSS_PADDING,saltLength:yr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}i(VU,"createPSSKeyVerifier");function GU(t){var e=lT(t);return i(function(){var n=e.apply(null,arguments);return n=oT.derToJose(n,"ES"+t),n},"sign")}i(GU,"createECDSASigner");function HU(t){var e=dT(t);return i(function(n,o,s){o=oT.joseToDer(o,"ES"+t).toString("base64");var d=e(n,o,s);return d},"verify")}i(HU,"createECDSAVerifer");function WU(){return i(function(){return""},"sign")}i(WU,"createNoneSigner");function ZU(){return i(function(e,r){return r===""},"verify")}i(ZU,"createNoneVerifier");pT.exports=i(function(e){var r={hs:cT,rs:lT,ps:BU,es:GU,none:WU},n={hs:qU,rs:dT,ps:VU,es:HU,none:ZU},o=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!o)throw Or(UU,e);var s=(o[1]||o[3]).toLowerCase(),d=o[2];return{sign:r[s](d),verify:n[s](d)}},"jwa")});var Hp=L(($ee,fT)=>{var KU=require("buffer").Buffer;fT.exports=i(function(e){return typeof e=="string"?e:typeof e=="number"||KU.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var _T=L((Cee,vT)=>{var JU=fo().Buffer,mT=Lp(),YU=Gp(),XU=require("stream"),hT=Hp(),Wp=require("util");function gT(t,e){return JU.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(gT,"base64url");function QU(t,e,r){r=r||"utf8";var n=gT(hT(t),"binary"),o=gT(hT(e),r);return Wp.format("%s.%s",n,o)}i(QU,"jwsSecuredInput");function yT(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=YU(e.alg),d=QU(e,r,o),m=s.sign(d,n);return Wp.format("%s.%s",d,m)}i(yT,"jwsSign");function Ku(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 mT(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new mT(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))}i(Ku,"SignStream");Wp.inherits(Ku,XU);Ku.prototype.sign=i(function(){try{var e=yT({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");Ku.sign=yT;vT.exports=Ku});var RT=L((kee,AT)=>{var PT=fo().Buffer,wT=Lp(),eM=Gp(),tM=require("stream"),bT=Hp(),rM=require("util"),nM=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function iM(t){return Object.prototype.toString.call(t)==="[object Object]"}i(iM,"isObject");function oM(t){if(iM(t))return t;try{return JSON.parse(t)}catch{return}}i(oM,"safeJsonParse");function TT(t){var e=t.split(".",1)[0];return oM(PT.from(e,"base64").toString("binary"))}i(TT,"headerFromJWS");function aM(t){return t.split(".",2).join(".")}i(aM,"securedInputFromJWS");function ST(t){return t.split(".")[2]}i(ST,"signatureFromJWS");function sM(t,e){e=e||"utf8";var r=t.split(".")[1];return PT.from(r,"base64").toString(e)}i(sM,"payloadFromJWS");function ET(t){return nM.test(t)&&!!TT(t)}i(ET,"isValidJws");function xT(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=bT(t);var o=ST(t),s=aM(t),d=eM(e);return d.verify(s,o,r)}i(xT,"jwsVerify");function IT(t,e){if(e=e||{},t=bT(t),!ET(t))return null;var r=TT(t);if(!r)return null;var n=sM(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:ST(t)}}i(IT,"jwsDecode");function vo(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 wT(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new wT(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))}i(vo,"VerifyStream");rM.inherits(vo,tM);vo.prototype.verify=i(function(){try{var e=xT(this.signature.buffer,this.algorithm,this.key.buffer),r=IT(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");vo.decode=IT;vo.isValid=ET;vo.verify=xT;AT.exports=vo});var Zp=L(Kn=>{var DT=_T(),Ju=RT(),uM=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Kn.ALGORITHMS=uM;Kn.sign=DT.sign;Kn.verify=Ju.verify;Kn.decode=Ju.decode;Kn.isValid=Ju.isValid;Kn.createSign=i(function(e){return new DT(e)},"createSign");Kn.createVerify=i(function(e){return new Ju(e)},"createVerify")});var GT=L(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.GoogleToken=void 0;var $T=Yu(require("fs")),cM=gt(),lM=Yu(Zp()),dM=Yu(require("path")),pM=require("util");function Yu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Yu=i(function(s,d){if(!d&&s&&s.__esModule)return s;var m,h,v={__proto__:null,default:s};if(s===null||wn(s)!="object"&&typeof s!="function")return v;if(m=d?n:r){if(m.has(s))return m.get(s);m.set(s,v)}for(var _ in s)_!=="default"&&{}.hasOwnProperty.call(s,_)&&((h=(m=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,_))&&(h.get||h.set)?m(v,_,h):v[_]=s[_]);return v},"_interopRequireWildcard"))(t,e)}i(Yu,"_interopRequireWildcard");function wn(t){"@babel/helpers - typeof";return wn=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},wn(t)}i(wn,"_typeof");function fM(t,e){LT(t,e),e.add(t)}i(fM,"_classPrivateMethodInitSpec");function mM(t,e,r){LT(t,e),e.set(t,r)}i(mM,"_classPrivateFieldInitSpec");function LT(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(LT,"_checkPrivateRedeclaration");function OT(t,e,r){return t.set(Cr(t,e),r),r}i(OT,"_classPrivateFieldSet");function CT(t,e){return t.get(Cr(t,e))}i(CT,"_classPrivateFieldGet");function Cr(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")}i(Cr,"_assertClassBrand");function NT(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,BT(n.key),n)}}i(NT,"_defineProperties");function jT(t,e,r){return e&&NT(t.prototype,e),r&&NT(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}i(jT,"_createClass");function qT(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}i(qT,"_classCallCheck");function hM(t,e,r){return e=ka(e),gM(t,ef()?Reflect.construct(e,r||[],ka(t).constructor):e.apply(t,r))}i(hM,"_callSuper");function gM(t,e){if(e&&(wn(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yM(t)}i(gM,"_possibleConstructorReturn");function yM(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}i(yM,"_assertThisInitialized");function vM(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&&Na(t,e)}i(vM,"_inherits");function Kp(t){var e=typeof Map=="function"?new Map:void 0;return Kp=i(function(n){if(n===null||!wM(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,o)}function o(){return _M(n,arguments,ka(this).constructor)}return i(o,"Wrapper"),o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Na(o,n)},"_wrapNativeSuper"),Kp(t)}i(Kp,"_wrapNativeSuper");function _M(t,e,r){if(ef())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&Na(o,r.prototype),o}i(_M,"_construct");function ef(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ef=i(function(){return!!t},"_isNativeReflectConstruct"))()}i(ef,"_isNativeReflectConstruct");function wM(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}i(wM,"_isNativeFunction");function Na(t,e){return Na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Na(t,e)}i(Na,"_setPrototypeOf");function ka(t){return ka=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ka(t)}i(ka,"_getPrototypeOf");function ir(t,e,r){return(e=BT(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}i(ir,"_defineProperty");function BT(t){var e=PM(t,"string");return wn(e)=="symbol"?e:e+""}i(BT,"_toPropertyKey");function PM(t,e){if(wn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(wn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}i(PM,"_toPrimitive");function ar(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function s(P,S,D,E){var u=S&&S.prototype instanceof m?S:m,f=Object.create(u.prototype);return or(f,"_invoke",(function(c,y,l){var b,g,ae,re=0,Ue=l||[],se=!1,X={p:0,n:0,v:t,a:Y,f:Y.bind(t,4),d:i(function(ee,ce){return b=ee,g=0,ae=t,X.n=ce,d},"d")};function Y(ne,ee){for(g=ne,ae=ee,e=0;!se&&re&&!ce&&e<Ue.length;e++){var ce,de=Ue[e],ke=X.p,Me=de[2];ne>3?(ce=Me===ee)&&(ae=de[(g=de[4])?5:(g=3,3)],de[4]=de[5]=t):de[0]<=ke&&((ce=ne<2&&ke<de[1])?(g=0,X.v=ee,X.n=de[1]):ke<Me&&(ce=ne<3||de[0]>ee||ee>Me)&&(de[4]=ne,de[5]=ee,X.n=Me,g=0))}if(ce||ne>1)return d;throw se=!0,ee}return i(Y,"d"),function(ne,ee,ce){if(re>1)throw TypeError("Generator is already running");for(se&&ee===1&&Y(ee,ce),g=ee,ae=ce;(e=g<2?t:ae)||!se;){b||(g?g<3?(g>1&&(X.n=-1),Y(g,ae)):X.n=ae:X.v=ae);try{if(re=2,b){if(g||(ne="next"),e=b[ne]){if(!(e=e.call(b,ae)))throw TypeError("iterator result is not an object");if(!e.done)return e;ae=e.value,g<2&&(g=0)}else g===1&&(e=b.return)&&e.call(b),g<2&&(ae=TypeError("The iterator does not provide a '"+ne+"' method"),g=1);b=t}else if((e=(se=X.n<0)?ae:c.call(y,X))!==d)break}catch(de){b=t,g=1,ae=de}finally{re=1}}return{value:e,done:se}}})(P,D,E),!0),f}i(s,"i");var d={};function m(){}i(m,"Generator");function h(){}i(h,"GeneratorFunction");function v(){}i(v,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var _=[][n]?e(e([][n]())):(or(e={},n,function(){return this}),e),x=v.prototype=m.prototype=Object.create(_);function T(P){return Object.setPrototypeOf?Object.setPrototypeOf(P,v):(P.__proto__=v,or(P,o,"GeneratorFunction")),P.prototype=Object.create(x),P}return i(T,"f"),h.prototype=v,or(x,"constructor",v),or(v,"constructor",h),h.displayName="GeneratorFunction",or(v,o,"GeneratorFunction"),or(x),or(x,o,"Generator"),or(x,n,function(){return this}),or(x,"toString",function(){return"[object Generator]"}),(ar=i(function(){return{w:s,m:T}},"_regenerator"))()}i(ar,"_regenerator");function or(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch{o=0}or=i(function(d,m,h,v){if(m)o?o(d,m,{value:h,enumerable:!v,configurable:!v,writable:!v}):d[m]=h;else{var _=i(function(T,P){or(d,T,function(S){return this._invoke(T,P,S)})},"o");_("next",0),_("throw",1),_("return",2)}},"_regeneratorDefine"),or(t,e,r,n)}i(or,"_regeneratorDefine2");function kT(t,e,r,n,o,s,d){try{var m=t[s](d),h=m.value}catch(v){return void r(v)}m.done?e(h):Promise.resolve(h).then(n,o)}i(kT,"asyncGeneratorStep");function _o(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var s=t.apply(e,r);function d(h){kT(s,n,o,d,m,"next",h)}i(d,"_next");function m(h){kT(s,n,o,d,m,"throw",h)}i(m,"_throw"),d(void 0)})}}i(_o,"_asyncToGenerator");var zT=$T.readFile?(0,pM.promisify)($T.readFile):_o(ar().m(i(function t(){return ar().w(function(e){for(;;)switch(e.n){case 0:throw new Ca("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),UT="https://oauth2.googleapis.com/token",bM="https://oauth2.googleapis.com/revoke?token=",Ca=(function(t){function e(r,n){var o;return qT(this,e),o=hM(this,e,[r]),ir(o,"code",void 0),o.code=n,o}return i(e,"ErrorWithCode"),vM(e,t),jT(e)})(Kp(Error)),Oa=new WeakMap,Hr=new WeakSet,Fee=Xu.GoogleToken=(function(){function t(e){qT(this,t),fM(this,Hr),ir(this,"expiresAt",void 0),ir(this,"key",void 0),ir(this,"keyFile",void 0),ir(this,"iss",void 0),ir(this,"sub",void 0),ir(this,"scope",void 0),ir(this,"rawToken",void 0),ir(this,"tokenExpires",void 0),ir(this,"email",void 0),ir(this,"additionalClaims",void 0),ir(this,"eagerRefreshThresholdMillis",void 0),ir(this,"transporter",{request:i(function(n){return(0,cM.request)(n)},"request")}),mM(this,Oa,void 0),Cr(Hr,this,VT).call(this,e)}return i(t,"GoogleToken"),jT(t,[{key:"accessToken",get:i(function(){return this.rawToken?this.rawToken.access_token:void 0},"get")},{key:"idToken",get:i(function(){return this.rawToken?this.rawToken.id_token:void 0},"get")},{key:"tokenType",get:i(function(){return this.rawToken?this.rawToken.token_type:void 0},"get")},{key:"refreshToken",get:i(function(){return this.rawToken?this.rawToken.refresh_token:void 0},"get")},{key:"hasExpired",value:i(function(){var r=new Date().getTime();return this.rawToken&&this.expiresAt?r>=this.expiresAt:!0},"hasExpired")},{key:"isTokenExpiring",value:i(function(){var r,n=new Date().getTime(),o=(r=this.eagerRefreshThresholdMillis)!==null&&r!==void 0?r:0;return this.rawToken&&this.expiresAt?this.expiresAt<=n+o:!0},"isTokenExpiring")},{key:"getToken",value:i(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(wn(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var o=r;Cr(Hr,this,MT).call(this,n).then(function(s){return o(null,s)},r);return}return Cr(Hr,this,MT).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=_o(ar().m(i(function n(o){var s,d,m,h,v,_,x;return ar().w(function(T){for(;;)switch(T.n){case 0:s=dM.extname(o),x=s,T.n=x===".json"?1:x===".der"||x===".crt"||x===".pem"?4:x===".p12"||x===".pfx"?6:7;break;case 1:return T.n=2,zT(o,"utf8");case 2:if(d=T.v,m=JSON.parse(d),h=m.private_key,v=m.client_email,!(!h||!v)){T.n=3;break}throw new Ca("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return T.a(2,{privateKey:h,clientEmail:v});case 4:return T.n=5,zT(o,"utf8");case 5:return _=T.v,T.a(2,{privateKey:_});case 6:throw new Ca("*.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 Ca("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return T.a(2)}},n)},"_callee2")));function r(n){return e.apply(this,arguments)}return i(r,"getCredentials"),r})()},{key:"revokeToken",value:i(function(r){if(r){Cr(Hr,this,FT).call(this).then(function(){return r()},r);return}return Cr(Hr,this,FT).call(this)},"revokeToken")}])})();function MT(t){return Jp.apply(this,arguments)}i(MT,"_getTokenAsync");function Jp(){return Jp=_o(ar().m(i(function t(e){return ar().w(function(r){for(;;)switch(r.n){case 0:if(!(CT(Oa,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,CT(Oa,this));case 1:return r.p=1,r.n=2,OT(Oa,this,Cr(Hr,this,TM).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,OT(Oa,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),Jp.apply(this,arguments)}i(Jp,"_getTokenAsync2");function TM(t){return Yp.apply(this,arguments)}i(TM,"_getTokenAsyncInner");function Yp(){return Yp=_o(ar().m(i(function t(e){var r;return ar().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||Cr(Hr,this,SM).call(this);case 4:return n.a(2,Cr(Hr,this,EM).call(this))}},t,this)},"_callee4"))),Yp.apply(this,arguments)}i(Yp,"_getTokenAsyncInner2");function SM(){if(!this.iss)throw new Ca("email is required.","MISSING_CREDENTIALS")}i(SM,"_ensureEmail");function FT(){return Xp.apply(this,arguments)}i(FT,"_revokeTokenAsync");function Xp(){return Xp=_o(ar().m(i(function t(){var e;return ar().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=bM+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Cr(Hr,this,VT).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"))),Xp.apply(this,arguments)}i(Xp,"_revokeTokenAsync2");function VT(){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,wn(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}i(VT,"_configure");function EM(){return Qp.apply(this,arguments)}i(EM,"_requestToken");function Qp(){return Qp=_o(ar().m(i(function t(){var e,r,n,o,s,d,m,h,v,_;return ar().w(function(x){for(;;)switch(x.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:UT,exp:e+3600,iat:e,sub:this.sub},r),o=lM.sign({header:{alg:"RS256"},payload:n,secret:this.key}),x.p=1,x.n=2,this.transporter.request({method:"POST",url:UT,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:o}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=x.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,x.a(2,this.rawToken);case 3:throw x.p=3,_=x.v,this.rawToken=void 0,this.tokenExpires=void 0,h=_.response&&(d=_.response)!==null&&d!==void 0&&d.data?(m=_.response)===null||m===void 0?void 0:m.data:{},h.error&&(v=h.error_description?": ".concat(h.error_description):"",_.message="".concat(h.error).concat(v)),_;case 4:return x.a(2)}},t,this,[[1,3]])},"_callee6"))),Qp.apply(this,arguments)}i(Qp,"_requestToken2")});var rf=L(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.JWTAccess=void 0;var xM=Zp(),IM=Dr(),HT={alg:"RS256",typ:"JWT"},tf=class t{static{i(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new IM.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,o){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=o??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 o=this.getCachedKey(e,n),s=this.cache.get(o),d=Date.now();if(s&&s.expiration-d>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let m=Math.floor(Date.now()/1e3),h=t.getExpirationTime(m),v;if(Array.isArray(n)&&(n=n.join(" ")),n?v={iss:this.email,sub:this.email,scope:n,exp:h,iat:m}:v={iss:this.email,sub:this.email,aud:e,exp:h,iat:m},r){for(let S in v)if(r[S])throw new Error(`The '${S}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let _=this.keyId?{...HT,kid:this.keyId}:HT,x=Object.assign(v,r),T=xM.sign({header:_,payload:x,secret:this.key}),P=new Headers({authorization:`Bearer ${T}`});return this.cache.set(o,{expiration:h*1e3,headers:P}),P}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 o="";e.setEncoding("utf8").on("data",s=>o+=s).on("error",n).on("end",()=>{try{let s=JSON.parse(o);this.fromJSON(s),r()}catch(s){n(s)}})})}};Qu.JWTAccess=tf});var of=L(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.JWT=void 0;var WT=GT(),AM=rf(),RM=_i(),ec=nr(),nf=class t extends RM.OAuth2Client{static{i(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!==ec.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==ec.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${ec.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 AM.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let n;this.hasUserScopes()?n=this.scopes:e||(n=this.defaultScopes);let o=this.useJWTAccessWithScope||this.universeDomain!==ec.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,o?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 WT.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 WT.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 o="";e.setEncoding("utf8").on("error",n).on("data",s=>o+=s).on("end",()=>{try{let s=JSON.parse(o);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.")}};tc.JWT=nf});var sf=L(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.UserRefreshClient=wo.USER_REFRESH_ACCOUNT_TYPE=void 0;var DM=_i(),$M=nr();wo.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var af=class t extends DM.OAuth2Client{static{i(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,o,s){let d=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:o,forceRefreshOnFailure:s};super(d),this._refreshToken=d.refreshToken,this.credentials.refresh_token=d.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 $M.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 o="";e.setEncoding("utf8").on("error",n).on("data",s=>o+=s).on("end",()=>{try{let s=JSON.parse(o);return this.fromJSON(s),r()}catch(s){return n(s)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};wo.UserRefreshClient=af});var cf=L(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.Impersonated=Po.IMPERSONATED_ACCOUNT_TYPE=void 0;var ZT=_i(),OM=gt(),CM=Dr();Po.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var uf=class t extends ZT.OAuth2Client{static{i(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 ZT.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,CM.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`,o={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:o,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"},o=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),s=o.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:o}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof OM.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}`,o=`${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:o,data:s,method:"POST"})).data.token}};Po.Impersonated=uf});var df=L(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.OAuthClientAuthHandler=void 0;za.getErrorFromOAuthErrorResponse=zM;var bo=gt(),NM=xa(),kM=["PUT","POST","PATCH"],lf=class{static{i(this,"OAuthClientAuthHandler")}#e=(0,NM.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new bo.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new bo.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=bo.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=bo.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=bo.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,o=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${o}`);bo.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!kM.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let o=new Headers(e.headers).get("content-type");if(o?.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(o?.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(`${o} 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"]}}}};za.OAuthClientAuthHandler=lf;function zM(t,e){let r=t.error,n=t.error_description,o=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof o<"u"&&(s+=` - ${o}`);let d=new Error(s);if(e){let m=Object.keys(e);e.stack&&m.push("stack"),m.forEach(h=>{h!=="message"&&Object.defineProperty(d,h,{value:e[h],writable:!1,enumerable:!0})})}return d}i(zM,"getErrorFromOAuthErrorResponse")});var nc=L(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.StsCredentials=void 0;var UM=gt(),MM=nr(),KT=df(),FM=Dr(),pf=class t extends KT.OAuthClientAuthHandler{static{i(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 o={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,FM.removeUndefinedValuesInObject)(o))};MM.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let d=await this.transporter.request(s),m=d.data;return m.res=d,m}catch(d){throw d instanceof UM.GaxiosError&&d.response?(0,KT.getErrorFromOAuthErrorResponse)(d.response.data,d):d}}};rc.StsCredentials=pf});var Jn=L(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.BaseExternalAccountClient=vr.CLOUD_RESOURCE_MANAGER=vr.EXTERNAL_ACCOUNT_TYPE=vr.EXPIRATION_TIME_OFFSET=void 0;var LM=gt(),jM=require("stream"),ff=nr(),qM=nc(),JT=Dr(),BM=Ip(),VM="urn:ietf:params:oauth:grant-type:token-exchange",GM="urn:ietf:params:oauth:token-type:access_token",mf="https://www.googleapis.com/auth/cloud-platform",HM=3600;vr.EXPIRATION_TIME_OFFSET=300*1e3;vr.EXTERNAL_ACCOUNT_TYPE="external_account";vr.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var WM="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",ZM="https://sts.{universeDomain}/v1/token",hf=class t extends ff.AuthClient{static{i(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,JT.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==vr.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${vr.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let o=r.get("client_id"),s=r.get("client_secret");this.tokenUrl=r.get("token_url")??ZM.replace("{universeDomain}",this.universeDomain);let d=r.get("subject_token_type"),m=r.get("workforce_pool_user_project"),h=r.get("service_account_impersonation_url"),v=r.get("service_account_impersonation"),_=(0,JT.originalOrCamelOptions)(v).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),o&&(this.clientAuth={confidentialClientType:"basic",clientId:o,clientSecret:s}),this.stsCredential=new qM.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[mf],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=d,this.workforcePoolUserProject=m;let x=new RegExp(WM);if(this.workforcePoolUserProject&&!this.audience.match(x))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=h,this.serviceAccountImpersonationLifetime=_,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=HM),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}`};ff.AuthClient.setMethodName(n,"getProjectId");let o=await this.transporter.request(n);return this.projectId=o.data.projectId,this.projectId}return null}async requestAsync(e,r=!1){let n;try{let o=await this.getRequestHeaders();e.headers=LM.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let d=s.status,m=s.config.data instanceof jM.Readable;if(!r&&(d===401||d===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw o}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:VM,audience:this.audience,requestedTokenType:GM,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[mf]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,o=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(r,o,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"}};ff.AuthClient.setMethodName(r,"getImpersonatedAccessToken");let n=await this.transporter.request(r),o=n.data;return{access_token:o.accessToken,expiry_date:new Date(o.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||[mf]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${BM.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};vr.BaseExternalAccountClient=hf});var YT=L(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.FileSubjectTokenSupplier=void 0;var yf=require("util"),vf=require("fs"),KM=(0,yf.promisify)(vf.readFile??(()=>{})),JM=(0,yf.promisify)(vf.realpath??(()=>{})),YM=(0,yf.promisify)(vf.lstat??(()=>{})),gf=class{static{i(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 JM(e),!(await YM(e)).isFile())throw new Error}catch(o){throw o instanceof Error&&(o.message=`The file at ${e} does not exist, or it is not a file. ${o.message}`),o}let r,n=await KM(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}};ic.FileSubjectTokenSupplier=gf});var XT=L(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.UrlSubjectTokenSupplier=void 0;var XM=nr(),_f=class{static{i(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};XM.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}};oc.UrlSubjectTokenSupplier=_f});var QT=L(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.CertificateSubjectTokenSupplier=sr.InvalidConfigurationError=sr.CertificateSourceUnavailableError=sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var ac=Dr(),sc=require("fs"),uc=require("crypto"),QM=require("https");sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Wr=class extends Error{static{i(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};sr.CertificateSourceUnavailableError=Wr;var _r=class extends Error{static{i(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};sr.InvalidConfigurationError=_r;var wf=class{static{i(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new _r("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new _r("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new _r("Cannot create mTLS Agent with missing certificate or key");return new QM.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,ac.isValidFile)(e))return e;throw new Wr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,ac.isValidFile)(r))return r;throw new Wr(`Path from environment variable "${sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,ac.getWellKnownCertificateConfigFileLocation)();if(await(0,ac.isValidFile)(n))return n;throw new Wr(`Could not find certificate configuration file. Searched override path, the "${sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await sc.promises.readFile(e,"utf8")}catch{throw new Wr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),o=n?.cert_configs?.workload?.cert_path,s=n?.cert_configs?.workload?.key_path;if(!o||!s)throw new _r(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:o,keyPath:s}}catch(n){throw n instanceof _r?n:new _r(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,o;try{n=await sc.promises.readFile(e),new uc.X509Certificate(n)}catch(s){let d=s instanceof Error?s.message:String(s);throw new Wr(`Failed to read certificate file at ${e}: ${d}`)}try{o=await sc.promises.readFile(r),(0,uc.createPrivateKey)(o)}catch(s){let d=s instanceof Error?s.message:String(s);throw new Wr(`Failed to read private key file at ${r}: ${d}`)}return{cert:n,key:o}}async#n(e){let r=new uc.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await sc.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((h,v)=>{try{return new uc.X509Certificate(h)}catch(_){let x=_ instanceof Error?_.message:String(_);throw new _r(`Failed to parse certificate at index ${v} in trust chain file ${this.trustChainPath}: ${x}`)}}),d=s.findIndex(h=>r.raw.equals(h.raw)),m;if(d===-1)m=[r,...s];else if(d===0)m=s;else throw new _r(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${d}).`);return JSON.stringify(m.map(h=>h.raw.toString("base64")))}catch(n){if(n instanceof _r)throw n;let o=n instanceof Error?n.message:String(n);throw new Wr(`Failed to process certificate chain from ${this.trustChainPath}: ${o}`)}}};sr.CertificateSubjectTokenSupplier=wf});var Tf=L(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.IdentityPoolClient=void 0;var eF=Jn(),Pf=Dr(),tF=YT(),rF=XT(),eS=QT(),nF=nc(),tS=gt(),bf=class t extends eF.BaseExternalAccountClient{static{i(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,Pf.originalOrCamelOptions)(e),n=r.get("credential_source"),o=r.get("subject_token_supplier");if(!n&&!o)throw new Error("A credential source or subject token supplier must be specified.");if(n&&o)throw new Error("Only one of credential source or subject token supplier can be specified.");if(o)this.subjectTokenSupplier=o,this.credentialSourceType="programmatic";else{let s=(0,Pf.originalOrCamelOptions)(n),d=(0,Pf.originalOrCamelOptions)(s.get("format")),m=d.get("type")||"text",h=d.get("subject_token_field_name");if(m!=="json"&&m!=="text")throw new Error(`Invalid credential_source format "${m}"`);if(m==="json"&&!h)throw new Error("Missing subject_token_field_name for JSON credential_source format");let v=s.get("file"),_=s.get("url"),x=s.get("certificate"),T=s.get("headers");if(v&&_||_&&x||v&&x)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(v)this.credentialSourceType="file",this.subjectTokenSupplier=new tF.FileSubjectTokenSupplier({filePath:v,formatType:m,subjectTokenFieldName:h});else if(_)this.credentialSourceType="url",this.subjectTokenSupplier=new rF.UrlSubjectTokenSupplier({url:_,formatType:m,subjectTokenFieldName:h,headers:T,additionalGaxiosOptions:t.RETRY_CONFIG});else if(x){this.credentialSourceType="certificate";let P=new eS.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:x.use_default_certificate_config,certificateConfigLocation:x.certificate_config_location,trustChainPath:x.trust_chain_path});this.subjectTokenSupplier=P}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 eS.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new nF.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new tS.Gaxios({agent:r})}),this.transporter=new tS.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};cc.IdentityPoolClient=bf});var Ef=L(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.AwsRequestSigner=void 0;var lc=gt(),nS=xa(),rS="AWS4-HMAC-SHA256",iF="aws4_request",Sf=class{static{i(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,nS.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,o=e.method||"GET",s=e.body||r,d=e.headers,m=await this.getCredentials(),h=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 v=await aF({crypto:this.crypto,host:h.host,canonicalUri:h.pathname,canonicalQuerystring:h.search.slice(1),method:o,region:this.region,securityCredentials:m,requestPayload:s,additionalAmzHeaders:d}),_=lc.Gaxios.mergeHeaders(v.amzDate?{"x-amz-date":v.amzDate}:{},{authorization:v.authorizationHeader,host:h.host},d||{});m.token&&lc.Gaxios.mergeHeaders(_,{"x-amz-security-token":m.token});let x={url:n,method:o,headers:_};return s!==void 0&&(x.body=s),x}};dc.AwsRequestSigner=Sf;async function Ua(t,e,r){return await t.signWithHmacSha256(e,r)}i(Ua,"sign");async function oF(t,e,r,n,o){let s=await Ua(t,`AWS4${e}`,r),d=await Ua(t,s,n),m=await Ua(t,d,o);return await Ua(t,m,"aws4_request")}i(oF,"getSigningKey");async function aF(t){let e=lc.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],o=new Date,s=o.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),d=o.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let m=lc.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),h="",v=[...m.keys()].sort();v.forEach(f=>{h+=`${f}:${m.get(f)}
|
|
41
41
|
`});let _=v.join(";"),x=await t.crypto.sha256DigestHex(r),T=`${t.method.toUpperCase()}
|
|
42
42
|
${t.canonicalUri}
|
|
43
43
|
${t.canonicalQuerystring}
|
|
44
44
|
${h}
|
|
45
45
|
${_}
|
|
46
|
-
${x}`,P=`${d}/${t.region}/${n}/${
|
|
46
|
+
${x}`,P=`${d}/${t.region}/${n}/${iF}`,S=`${rS}
|
|
47
47
|
${s}
|
|
48
48
|
${P}
|
|
49
|
-
`+await t.crypto.sha256DigestHex(T),D=await tF(t.crypto,t.securityCredentials.secretAccessKey,d,t.region,n),E=await Ua(t.crypto,D,S),u=`${eS} Credential=${t.securityCredentials.accessKeyId}/${P}, SignedHeaders=${_}, Signature=${(0,tS.fromArrayBufferToHex)(E)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:u,canonicalQuerystring:t.canonicalQuerystring}}i(rF,"generateAuthenticationHeaderMap")});var rS=L(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.DefaultAwsSecurityCredentialsSupplier=void 0;var pc=nr(),xf=class{static{i(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};pc.AuthClient.setMethodName(n,"getAwsRegion");let o=await e.transporter.request(n);return o.data.substr(0,o.data.length-1)}async getAwsSecurityCredentials(e){if(this.#i)return this.#i;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),o=await this.#r(n,r,e.transporter);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,token:o.Token}}async#e(e){let r={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return pc.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 pc.AuthClient.setMethodName(n,"#getAwsRoleName"),(await r.request(n)).data}async#r(e,r,n){let o={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:r};return pc.AuthClient.setMethodName(o,"#retrieveAwsSecurityCredentials"),(await n.request(o)).data}get#n(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#i(){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}};fc.DefaultAwsSecurityCredentialsSupplier=xf});var Af=L(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.AwsClient=void 0;var nF=Ef(),iF=Jn(),oF=rS(),nS=Dr(),aF=gt(),If=class t extends iF.BaseExternalAccountClient{static{i(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,nS.originalOrCamelOptions)(e),n=r.get("credential_source"),o=r.get("aws_security_credentials_supplier");if(!n&&!o)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&o)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(o)this.awsSecurityCredentialsSupplier=o,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,nS.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let d=s.get("region_url"),m=s.get("url"),h=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new oF.DefaultAwsSecurityCredentialsSupplier({regionUrl:d,securityCredentialsUrl:m,imdsV2SessionTokenUrl:h}),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 nF.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 aF.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((o,s)=>r.push({key:s,value:o})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};mc.AwsClient=If});var Cf=L(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.InvalidSubjectTokenError=_t.InvalidMessageFieldError=_t.InvalidCodeFieldError=_t.InvalidTokenTypeFieldError=_t.InvalidExpirationTimeFieldError=_t.InvalidSuccessFieldError=_t.InvalidVersionFieldError=_t.ExecutableResponseError=_t.ExecutableResponse=void 0;var hc="urn:ietf:params:oauth:token-type:saml2",Rf="urn:ietf:params:oauth:token-type:id_token",Df="urn:ietf:params:oauth:token-type:jwt",$f=class{static{i(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new gc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new yc("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!==hc&&this.tokenType!==Rf&&this.tokenType!==Df)throw new vc(`Executable response must contain a 'token_type' field when successful and it must be one of ${Rf}, ${Df}, or ${hc}.`);if(this.tokenType===hc){if(!e.saml_response)throw new Ma(`Executable response must contain a 'saml_response' field when token_type=${hc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Ma(`Executable response must contain a 'id_token' field when token_type=${Rf} or ${Df}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new _c("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new wc("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)}};_t.ExecutableResponse=$f;var Zr=class extends Error{static{i(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};_t.ExecutableResponseError=Zr;var gc=class extends Zr{static{i(this,"InvalidVersionFieldError")}};_t.InvalidVersionFieldError=gc;var yc=class extends Zr{static{i(this,"InvalidSuccessFieldError")}};_t.InvalidSuccessFieldError=yc;var Of=class extends Zr{static{i(this,"InvalidExpirationTimeFieldError")}};_t.InvalidExpirationTimeFieldError=Of;var vc=class extends Zr{static{i(this,"InvalidTokenTypeFieldError")}};_t.InvalidTokenTypeFieldError=vc;var _c=class extends Zr{static{i(this,"InvalidCodeFieldError")}};_t.InvalidCodeFieldError=_c;var wc=class extends Zr{static{i(this,"InvalidMessageFieldError")}};_t.InvalidMessageFieldError=wc;var Ma=class extends Zr{static{i(this,"InvalidSubjectTokenError")}};_t.InvalidSubjectTokenError=Ma});var zf=L(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.PluggableAuthHandler=To.ExecutableError=void 0;var wi=Cf(),sF=require("child_process"),Nf=require("fs"),Pc=class extends Error{static{i(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)}};To.ExecutableError=Pc;var kf=class t{static{i(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 o=sF.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";o.stdout.on("data",m=>{s+=m}),o.stderr.on("data",m=>{s+=m});let d=setTimeout(()=>(o.removeAllListeners(),o.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);o.on("close",m=>{if(clearTimeout(d),m===0)try{let h=JSON.parse(s),v=new wi.ExecutableResponse(h);return r(v)}catch(h){return h instanceof wi.ExecutableResponseError?n(h):n(new wi.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new Pc(s,m.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await Nf.promises.realpath(this.outputFile)}catch{return}if(!(await Nf.promises.lstat(e)).isFile())return;let r=await Nf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new wi.ExecutableResponse(n).isValid()?new wi.ExecutableResponse(n):void 0}catch(n){throw n instanceof wi.ExecutableResponseError?n:new wi.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}};To.PluggableAuthHandler=kf});var Mf=L(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.PluggableAuthClient=So.ExecutableError=void 0;var uF=Jn(),cF=Cf(),iS=zf(),lF=zf();Object.defineProperty(So,"ExecutableError",{enumerable:!0,get:i(function(){return lF.ExecutableError},"get")});var dF=30*1e3,oS=5*1e3,aS=120*1e3,pF="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",sS=1,Uf=class extends uF.BaseExternalAccountClient{static{i(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=dF;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<oS||this.timeoutMillis>aS)throw new Error(`Timeout must be between ${oS} and ${aS} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new iS.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[pF]!=="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>sS)throw new Error(`Version of executable is not currently supported, maximum supported version is ${sS}.`);if(!e.success)throw new iS.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new cF.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}};So.PluggableAuthClient=Uf});var Lf=L(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.ExternalAccountClient=void 0;var fF=Jn(),mF=Tf(),hF=Af(),gF=Mf(),Ff=class{static{i(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===fF.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new hF.AwsClient(e):e.credential_source?.executable?new gF.PluggableAuthClient(e):new mF.IdentityPoolClient(e):null}};bc.ExternalAccountClient=Ff});var Bf=L(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.ExternalAccountAuthorizedUserClient=Eo.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var cS=nr(),uS=df(),lS=gt(),yF=require("stream"),vF=Jn();Eo.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var _F="https://sts.{universeDomain}/v1/oauthtoken",jf=class t extends uS.OAuthClientAuthHandler{static{i(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})};cS.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let o=await this.transporter.request(n),s=o.data;return s.res=o,s}catch(o){throw o instanceof lS.GaxiosError&&o.response?(0,uS.getErrorFromOAuthErrorResponse)(o.response.data,o):o}}},qf=class extends cS.AuthClient{static{i(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 jf({tokenRefreshEndpoint:e.token_url??_F.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=vF.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 o=await this.getRequestHeaders();e.headers=lS.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let d=s.status,m=s.config.data instanceof yF.Readable;if(!r&&(d===401||d===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw o}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}};Eo.ExternalAccountAuthorizedUserClient=qf});var mS=L(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.GoogleAuth=Nr.GoogleAuthExceptionMessages=void 0;var wF=require("child_process"),Fa=require("fs"),PF=gt(),La=Ea(),bF=require("os"),Vf=require("path"),TF=xa(),SF=zp(),EF=Mp(),xF=Fp(),xo=of(),dS=sf(),Io=cf(),IF=Lf(),ja=Jn(),Gf=nr(),pS=Bf(),fS=Dr();Nr.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(T),D=await oF(t.crypto,t.securityCredentials.secretAccessKey,d,t.region,n),E=await Ua(t.crypto,D,S),u=`${rS} Credential=${t.securityCredentials.accessKeyId}/${P}, SignedHeaders=${_}, Signature=${(0,nS.fromArrayBufferToHex)(E)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:u,canonicalQuerystring:t.canonicalQuerystring}}i(aF,"generateAuthenticationHeaderMap")});var iS=L(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.DefaultAwsSecurityCredentialsSupplier=void 0;var pc=nr(),xf=class{static{i(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};pc.AuthClient.setMethodName(n,"getAwsRegion");let o=await e.transporter.request(n);return o.data.substr(0,o.data.length-1)}async getAwsSecurityCredentials(e){if(this.#i)return this.#i;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),o=await this.#r(n,r,e.transporter);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,token:o.Token}}async#e(e){let r={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return pc.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 pc.AuthClient.setMethodName(n,"#getAwsRoleName"),(await r.request(n)).data}async#r(e,r,n){let o={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:r};return pc.AuthClient.setMethodName(o,"#retrieveAwsSecurityCredentials"),(await n.request(o)).data}get#n(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#i(){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}};fc.DefaultAwsSecurityCredentialsSupplier=xf});var Af=L(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.AwsClient=void 0;var sF=Ef(),uF=Jn(),cF=iS(),oS=Dr(),lF=gt(),If=class t extends uF.BaseExternalAccountClient{static{i(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,oS.originalOrCamelOptions)(e),n=r.get("credential_source"),o=r.get("aws_security_credentials_supplier");if(!n&&!o)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&o)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(o)this.awsSecurityCredentialsSupplier=o,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,oS.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let d=s.get("region_url"),m=s.get("url"),h=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new cF.DefaultAwsSecurityCredentialsSupplier({regionUrl:d,securityCredentialsUrl:m,imdsV2SessionTokenUrl:h}),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 sF.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 lF.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((o,s)=>r.push({key:s,value:o})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};mc.AwsClient=If});var Cf=L(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.InvalidSubjectTokenError=_t.InvalidMessageFieldError=_t.InvalidCodeFieldError=_t.InvalidTokenTypeFieldError=_t.InvalidExpirationTimeFieldError=_t.InvalidSuccessFieldError=_t.InvalidVersionFieldError=_t.ExecutableResponseError=_t.ExecutableResponse=void 0;var hc="urn:ietf:params:oauth:token-type:saml2",Rf="urn:ietf:params:oauth:token-type:id_token",Df="urn:ietf:params:oauth:token-type:jwt",$f=class{static{i(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new gc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new yc("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!==hc&&this.tokenType!==Rf&&this.tokenType!==Df)throw new vc(`Executable response must contain a 'token_type' field when successful and it must be one of ${Rf}, ${Df}, or ${hc}.`);if(this.tokenType===hc){if(!e.saml_response)throw new Ma(`Executable response must contain a 'saml_response' field when token_type=${hc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Ma(`Executable response must contain a 'id_token' field when token_type=${Rf} or ${Df}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new _c("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new wc("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)}};_t.ExecutableResponse=$f;var Zr=class extends Error{static{i(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};_t.ExecutableResponseError=Zr;var gc=class extends Zr{static{i(this,"InvalidVersionFieldError")}};_t.InvalidVersionFieldError=gc;var yc=class extends Zr{static{i(this,"InvalidSuccessFieldError")}};_t.InvalidSuccessFieldError=yc;var Of=class extends Zr{static{i(this,"InvalidExpirationTimeFieldError")}};_t.InvalidExpirationTimeFieldError=Of;var vc=class extends Zr{static{i(this,"InvalidTokenTypeFieldError")}};_t.InvalidTokenTypeFieldError=vc;var _c=class extends Zr{static{i(this,"InvalidCodeFieldError")}};_t.InvalidCodeFieldError=_c;var wc=class extends Zr{static{i(this,"InvalidMessageFieldError")}};_t.InvalidMessageFieldError=wc;var Ma=class extends Zr{static{i(this,"InvalidSubjectTokenError")}};_t.InvalidSubjectTokenError=Ma});var zf=L(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.PluggableAuthHandler=To.ExecutableError=void 0;var wi=Cf(),dF=require("child_process"),Nf=require("fs"),Pc=class extends Error{static{i(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)}};To.ExecutableError=Pc;var kf=class t{static{i(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 o=dF.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";o.stdout.on("data",m=>{s+=m}),o.stderr.on("data",m=>{s+=m});let d=setTimeout(()=>(o.removeAllListeners(),o.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);o.on("close",m=>{if(clearTimeout(d),m===0)try{let h=JSON.parse(s),v=new wi.ExecutableResponse(h);return r(v)}catch(h){return h instanceof wi.ExecutableResponseError?n(h):n(new wi.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new Pc(s,m.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await Nf.promises.realpath(this.outputFile)}catch{return}if(!(await Nf.promises.lstat(e)).isFile())return;let r=await Nf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new wi.ExecutableResponse(n).isValid()?new wi.ExecutableResponse(n):void 0}catch(n){throw n instanceof wi.ExecutableResponseError?n:new wi.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}};To.PluggableAuthHandler=kf});var Mf=L(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.PluggableAuthClient=So.ExecutableError=void 0;var pF=Jn(),fF=Cf(),aS=zf(),mF=zf();Object.defineProperty(So,"ExecutableError",{enumerable:!0,get:i(function(){return mF.ExecutableError},"get")});var hF=30*1e3,sS=5*1e3,uS=120*1e3,gF="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",cS=1,Uf=class extends pF.BaseExternalAccountClient{static{i(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=hF;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<sS||this.timeoutMillis>uS)throw new Error(`Timeout must be between ${sS} and ${uS} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new aS.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[gF]!=="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>cS)throw new Error(`Version of executable is not currently supported, maximum supported version is ${cS}.`);if(!e.success)throw new aS.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new fF.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}};So.PluggableAuthClient=Uf});var Lf=L(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.ExternalAccountClient=void 0;var yF=Jn(),vF=Tf(),_F=Af(),wF=Mf(),Ff=class{static{i(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===yF.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new _F.AwsClient(e):e.credential_source?.executable?new wF.PluggableAuthClient(e):new vF.IdentityPoolClient(e):null}};bc.ExternalAccountClient=Ff});var Bf=L(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.ExternalAccountAuthorizedUserClient=Eo.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var dS=nr(),lS=df(),pS=gt(),PF=require("stream"),bF=Jn();Eo.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var TF="https://sts.{universeDomain}/v1/oauthtoken",jf=class t extends lS.OAuthClientAuthHandler{static{i(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})};dS.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let o=await this.transporter.request(n),s=o.data;return s.res=o,s}catch(o){throw o instanceof pS.GaxiosError&&o.response?(0,lS.getErrorFromOAuthErrorResponse)(o.response.data,o):o}}},qf=class extends dS.AuthClient{static{i(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 jf({tokenRefreshEndpoint:e.token_url??TF.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=bF.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 o=await this.getRequestHeaders();e.headers=pS.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let d=s.status,m=s.config.data instanceof PF.Readable;if(!r&&(d===401||d===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw o}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}};Eo.ExternalAccountAuthorizedUserClient=qf});var gS=L(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.GoogleAuth=Nr.GoogleAuthExceptionMessages=void 0;var SF=require("child_process"),Fa=require("fs"),EF=gt(),La=Ea(),xF=require("os"),Vf=require("path"),IF=xa(),AF=zp(),RF=Mp(),DF=Fp(),xo=of(),fS=sf(),Io=cf(),$F=Lf(),ja=Jn(),Gf=nr(),mS=Bf(),hS=Dr();Nr.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 Hf=class{static{i(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(Nr.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===Nr.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(Nr.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 La.universe("universe-domain"),e||=Gf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Gf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,fS.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Gf.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(o=>r(null,o.credential,o.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 xo.JWT?r.scopes=this.scopes:r instanceof ja.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof xo.JWT?r.scopes=this.scopes:r instanceof ja.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new SF.Compute(e));throw new Error(Nr.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=La.getGCPResidency()||await La.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 o=process.env.HOME;o&&(r=Vf.join(o,".config"))}return r&&(r=Vf.join(r,"gcloud","application_default_credentials.json"),Fa.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=Fa.realpathSync(e),!Fa.lstatSync(e).isFile())throw new Error}catch(o){throw o instanceof Error&&(o.message=`The file at ${e} does not exist, or it is not a file. ${o.message}`),o}let n=Fa.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!==Io.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${Io.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 o=(this.scopes||e.scopes||this.defaultScopes)??[];return new Io.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(o)?o:[o]})}fromJSON(e,r={}){let n,o=(0,fS.originalOrCamelOptions)(r).get("universe_domain");return e.type===dS.USER_REFRESH_ACCOUNT_TYPE?(n=new dS.UserRefreshClient(r),n.fromJSON(e)):e.type===Io.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===ja.EXTERNAL_ACCOUNT_TYPE?(n=IF.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===pS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new pS.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new xo.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),o&&(n.universeDomain=o),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let o={};if(typeof r=="function"?n=r:o=r,n)this.fromStreamAsync(e,o).then(s=>n(null,s),n);else return this.fromStreamAsync(e,o)}fromStreamAsync(e,r){return new Promise((n,o)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",o).on("data",d=>s.push(d)).on("end",()=>{try{try{let d=JSON.parse(s.join("")),m=this._cacheClientFromJSON(d,r);return n(m)}catch(d){if(!this.keyFilename)throw d;let m=new xo.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=m,this.setGapicJWTValues(m),n(m)}}catch(d){return o(d)}})})}fromAPIKey(e,r={}){return new xo.JWT({...r,apiKey:e})}_isWindows(){let e=bF.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,wF.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n)try{let o=JSON.parse(n).configuration.properties.core.project;e(o);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!==ja.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await La.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 Io.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof ja.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([La.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(Nr.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=Vf.resolve(this.keyFilename),r=Fa.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 EF.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,o=await(await this.getClient()).getRequestHeaders(r);return e.headers=PF.Gaxios.mergeHeaders(e.headers,o),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,xF.getEnv)()}async sign(e,r){let n=await this.getClient(),o=await this.getUniverseDomain();if(r=r||`https://iamcredentials.${o}/v1/projects/-/serviceAccounts/`,n instanceof Io.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,TF.createCrypto)();if(n instanceof xo.JWT&&n.key)return await s.sign(n.key,e);let d=await this.getCredentials();if(!d.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,d.client_email,e,r)}async signBlob(e,r,n,o){let s=new URL(o+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};Nr.GoogleAuth=Hf});var hS=L(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.IAMAuth=void 0;var Wf=class{static{i(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}}};Tc.IAMAuth=Wf});var gS=L(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.DownscopedClient=Kr.EXPIRATION_TIME_OFFSET=Kr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var AF=gt(),RF=require("stream"),Zf=nr(),DF=nc(),$F="urn:ietf:params:oauth:grant-type:token-exchange",OF="urn:ietf:params:oauth:token-type:access_token",CF="urn:ietf:params:oauth:token-type:access_token";Kr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Kr.EXPIRATION_TIME_OFFSET=300*1e3;var Kf=class extends Zf.AuthClient{static{i(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Zf.AuthClient?{}:e),e instanceof Zf.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>Kr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Kr.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 DF.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 o=await this.getRequestHeaders();e.headers=AF.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let d=s.status,m=s.config.data instanceof RF.Readable;if(!r&&(d===401||d===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw o}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:$F,requestedTokenType:OF,subjectToken:e,subjectTokenType:CF},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),o=this.authClient.credentials?.expiry_date||null,s=n.expires_in?new Date().getTime()+n.expires_in*1e3:o;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}};Kr.DownscopedClient=Kf});var yS=L(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.PassThroughClient=void 0;var NF=nr(),Jf=class extends NF.AuthClient{static{i(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};Sc.PassThroughClient=Jf});var qa=L(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.GoogleAuth=me.auth=me.PassThroughClient=me.ExternalAccountAuthorizedUserClient=me.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=me.ExecutableError=me.PluggableAuthClient=me.DownscopedClient=me.BaseExternalAccountClient=me.ExternalAccountClient=me.IdentityPoolClient=me.AwsRequestSigner=me.AwsClient=me.UserRefreshClient=me.LoginTicket=me.ClientAuthentication=me.OAuth2Client=me.CodeChallengeMethod=me.Impersonated=me.JWT=me.JWTAccess=me.IdTokenClient=me.IAMAuth=me.GCPEnv=me.Compute=me.DEFAULT_UNIVERSE=me.AuthClient=me.gaxios=me.gcpMetadata=void 0;var vS=mS();Object.defineProperty(me,"GoogleAuth",{enumerable:!0,get:i(function(){return vS.GoogleAuth},"get")});me.gcpMetadata=Ea();me.gaxios=gt();var _S=nr();Object.defineProperty(me,"AuthClient",{enumerable:!0,get:i(function(){return _S.AuthClient},"get")});Object.defineProperty(me,"DEFAULT_UNIVERSE",{enumerable:!0,get:i(function(){return _S.DEFAULT_UNIVERSE},"get")});var kF=zp();Object.defineProperty(me,"Compute",{enumerable:!0,get:i(function(){return kF.Compute},"get")});var zF=Fp();Object.defineProperty(me,"GCPEnv",{enumerable:!0,get:i(function(){return zF.GCPEnv},"get")});var UF=hS();Object.defineProperty(me,"IAMAuth",{enumerable:!0,get:i(function(){return UF.IAMAuth},"get")});var MF=Mp();Object.defineProperty(me,"IdTokenClient",{enumerable:!0,get:i(function(){return MF.IdTokenClient},"get")});var FF=rf();Object.defineProperty(me,"JWTAccess",{enumerable:!0,get:i(function(){return FF.JWTAccess},"get")});var LF=of();Object.defineProperty(me,"JWT",{enumerable:!0,get:i(function(){return LF.JWT},"get")});var jF=cf();Object.defineProperty(me,"Impersonated",{enumerable:!0,get:i(function(){return jF.Impersonated},"get")});var Yf=_i();Object.defineProperty(me,"CodeChallengeMethod",{enumerable:!0,get:i(function(){return Yf.CodeChallengeMethod},"get")});Object.defineProperty(me,"OAuth2Client",{enumerable:!0,get:i(function(){return Yf.OAuth2Client},"get")});Object.defineProperty(me,"ClientAuthentication",{enumerable:!0,get:i(function(){return Yf.ClientAuthentication},"get")});var qF=Op();Object.defineProperty(me,"LoginTicket",{enumerable:!0,get:i(function(){return qF.LoginTicket},"get")});var BF=sf();Object.defineProperty(me,"UserRefreshClient",{enumerable:!0,get:i(function(){return BF.UserRefreshClient},"get")});var VF=Af();Object.defineProperty(me,"AwsClient",{enumerable:!0,get:i(function(){return VF.AwsClient},"get")});var GF=Ef();Object.defineProperty(me,"AwsRequestSigner",{enumerable:!0,get:i(function(){return GF.AwsRequestSigner},"get")});var HF=Tf();Object.defineProperty(me,"IdentityPoolClient",{enumerable:!0,get:i(function(){return HF.IdentityPoolClient},"get")});var WF=Lf();Object.defineProperty(me,"ExternalAccountClient",{enumerable:!0,get:i(function(){return WF.ExternalAccountClient},"get")});var ZF=Jn();Object.defineProperty(me,"BaseExternalAccountClient",{enumerable:!0,get:i(function(){return ZF.BaseExternalAccountClient},"get")});var KF=gS();Object.defineProperty(me,"DownscopedClient",{enumerable:!0,get:i(function(){return KF.DownscopedClient},"get")});var wS=Mf();Object.defineProperty(me,"PluggableAuthClient",{enumerable:!0,get:i(function(){return wS.PluggableAuthClient},"get")});Object.defineProperty(me,"ExecutableError",{enumerable:!0,get:i(function(){return wS.ExecutableError},"get")});var PS=Bf();Object.defineProperty(me,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:i(function(){return PS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(me,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:i(function(){return PS.ExternalAccountAuthorizedUserClient},"get")});var JF=yS();Object.defineProperty(me,"PassThroughClient",{enumerable:!0,get:i(function(){return JF.PassThroughClient},"get")});var YF=new vS.GoogleAuth;me.auth=YF});var TS=L(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.getAPI=XF;function XF(t,e,r,n){let o;if(typeof e=="string")o=e,e={};else if(typeof e=="object")o=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[o],d=new s(e,n);return Object.freeze(d)}catch(s){throw new Error(`Unable to load endpoint ${t}("${o}"): ${s.message}`)}}i(XF,"getAPI")});var ES=L((Ute,SS)=>{SS.exports=require("util").inspect});var Wa=L((Mte,GS)=>{var um=typeof Map=="function"&&Map.prototype,Qf=Object.getOwnPropertyDescriptor&&um?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ic=um&&Qf&&typeof Qf.get=="function"?Qf.get:null,xS=um&&Map.prototype.forEach,cm=typeof Set=="function"&&Set.prototype,em=Object.getOwnPropertyDescriptor&&cm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ac=cm&&em&&typeof em.get=="function"?em.get:null,IS=cm&&Set.prototype.forEach,QF=typeof WeakMap=="function"&&WeakMap.prototype,Va=QF?WeakMap.prototype.has:null,e1=typeof WeakSet=="function"&&WeakSet.prototype,Ga=e1?WeakSet.prototype.has:null,t1=typeof WeakRef=="function"&&WeakRef.prototype,AS=t1?WeakRef.prototype.deref:null,r1=Boolean.prototype.valueOf,n1=Object.prototype.toString,i1=Function.prototype.toString,o1=String.prototype.match,lm=String.prototype.slice,Yn=String.prototype.replace,a1=String.prototype.toUpperCase,RS=String.prototype.toLowerCase,MS=RegExp.prototype.test,DS=Array.prototype.concat,Jr=Array.prototype.join,s1=Array.prototype.slice,$S=Math.floor,nm=typeof BigInt=="function"?BigInt.prototype.valueOf:null,tm=Object.getOwnPropertySymbols,im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ao=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ha=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ao||!0)?Symbol.toStringTag:null,FS=Object.prototype.propertyIsEnumerable,OS=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function CS(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||MS.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-$S(-t):$S(t);if(n!==t){var o=String(n),s=lm.call(e,o.length+1);return Yn.call(o,r,"$&_")+"."+Yn.call(Yn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Yn.call(e,r,"$&_")}i(CS,"addNumericSeparator");var om=ES(),NS=om.custom,kS=qS(NS)?NS:null,LS={__proto__:null,double:'"',single:"'"},u1={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};GS.exports=i(function t(e,r,n,o){var s=r||{};if(Pn(s,"quoteStyle")&&!Pn(LS,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Pn(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 d=Pn(s,"customInspect")?s.customInspect:!0;if(typeof d!="boolean"&&d!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Pn(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(Pn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var m=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 VS(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var h=String(e);return m?CS(e,h):h}if(typeof e=="bigint"){var v=String(e)+"n";return m?CS(e,v):v}var _=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=_&&_>0&&typeof e=="object")return am(e)?"[Array]":"[Object]";var x=x1(s,n);if(typeof o>"u")o=[];else if(BS(o,e)>=0)return"[Circular]";function T(Y,ne,ee){if(ne&&(o=s1.call(o),o.push(ne)),ee){var ce={depth:s.depth};return Pn(s,"quoteStyle")&&(ce.quoteStyle=s.quoteStyle),t(Y,ce,n+1,o)}return t(Y,s,n+1,o)}if(i(T,"inspect"),typeof e=="function"&&!zS(e)){var P=y1(e),S=xc(e,T);return"[Function"+(P?": "+P:" (anonymous)")+"]"+(S.length>0?" { "+Jr.call(S,", ")+" }":"")}if(qS(e)){var D=Ao?Yn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):im.call(e);return typeof e=="object"&&!Ao?Ba(D):D}if(T1(e)){for(var E="<"+RS.call(String(e.nodeName)),u=e.attributes||[],f=0;f<u.length;f++)E+=" "+u[f].name+"="+jS(c1(u[f].value),"double",s);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+RS.call(String(e.nodeName))+">",E}if(am(e)){if(e.length===0)return"[]";var c=xc(e,T);return x&&!E1(c)?"["+sm(c,x)+"]":"[ "+Jr.call(c,", ")+" ]"}if(d1(e)){var y=xc(e,T);return!("cause"in Error.prototype)&&"cause"in e&&!FS.call(e,"cause")?"{ ["+String(e)+"] "+Jr.call(DS.call("[cause]: "+T(e.cause),y),", ")+" }":y.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Jr.call(y,", ")+" }"}if(typeof e=="object"&&d){if(kS&&typeof e[kS]=="function"&&om)return om(e,{depth:_-n});if(d!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(v1(e)){var l=[];return xS&&xS.call(e,function(Y,ne){l.push(T(ne,e,!0)+" => "+T(Y,e))}),US("Map",Ic.call(e),l,x)}if(P1(e)){var b=[];return IS&&IS.call(e,function(Y){b.push(T(Y,e))}),US("Set",Ac.call(e),b,x)}if(_1(e))return rm("WeakMap");if(b1(e))return rm("WeakSet");if(w1(e))return rm("WeakRef");if(f1(e))return Ba(T(Number(e)));if(h1(e))return Ba(T(nm.call(e)));if(m1(e))return Ba(r1.call(e));if(p1(e))return Ba(T(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(!l1(e)&&!zS(e)){var g=xc(e,T),ae=OS?OS(e)===Object.prototype:e instanceof Object||e.constructor===Object,re=e instanceof Object?"":"null prototype",Ue=!ae&&Ha&&Object(e)===e&&Ha in e?lm.call(Xn(e),8,-1):re?"Object":"",se=ae||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",X=se+(Ue||re?"["+Jr.call(DS.call([],Ue||[],re||[]),": ")+"] ":"");return g.length===0?X+"{}":x?X+"{"+sm(g,x)+"}":X+"{ "+Jr.call(g,", ")+" }"}return String(e)},"inspect_");function jS(t,e,r){var n=r.quoteStyle||e,o=LS[n];return o+t+o}i(jS,"wrapQuotes");function c1(t){return Yn.call(String(t),/"/g,""")}i(c1,"quote");function Pi(t){return!Ha||!(typeof t=="object"&&(Ha in t||typeof t[Ha]<"u"))}i(Pi,"canTrustToString");function am(t){return Xn(t)==="[object Array]"&&Pi(t)}i(am,"isArray");function l1(t){return Xn(t)==="[object Date]"&&Pi(t)}i(l1,"isDate");function zS(t){return Xn(t)==="[object RegExp]"&&Pi(t)}i(zS,"isRegExp");function d1(t){return Xn(t)==="[object Error]"&&Pi(t)}i(d1,"isError");function p1(t){return Xn(t)==="[object String]"&&Pi(t)}i(p1,"isString");function f1(t){return Xn(t)==="[object Number]"&&Pi(t)}i(f1,"isNumber");function m1(t){return Xn(t)==="[object Boolean]"&&Pi(t)}i(m1,"isBoolean");function qS(t){if(Ao)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!im)return!1;try{return im.call(t),!0}catch{}return!1}i(qS,"isSymbol");function h1(t){if(!t||typeof t!="object"||!nm)return!1;try{return nm.call(t),!0}catch{}return!1}i(h1,"isBigInt");var g1=Object.prototype.hasOwnProperty||function(t){return t in this};function Pn(t,e){return g1.call(t,e)}i(Pn,"has");function Xn(t){return n1.call(t)}i(Xn,"toStr");function y1(t){if(t.name)return t.name;var e=o1.call(i1.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}i(y1,"nameOf");function BS(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}i(BS,"indexOf");function v1(t){if(!Ic||!t||typeof t!="object")return!1;try{Ic.call(t);try{Ac.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}i(v1,"isMap");function _1(t){if(!Va||!t||typeof t!="object")return!1;try{Va.call(t,Va);try{Ga.call(t,Ga)}catch{return!0}return t instanceof WeakMap}catch{}return!1}i(_1,"isWeakMap");function w1(t){if(!AS||!t||typeof t!="object")return!1;try{return AS.call(t),!0}catch{}return!1}i(w1,"isWeakRef");function P1(t){if(!Ac||!t||typeof t!="object")return!1;try{Ac.call(t);try{Ic.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}i(P1,"isSet");function b1(t){if(!Ga||!t||typeof t!="object")return!1;try{Ga.call(t,Ga);try{Va.call(t,Va)}catch{return!0}return t instanceof WeakSet}catch{}return!1}i(b1,"isWeakSet");function T1(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}i(T1,"isElement");function VS(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return VS(lm.call(t,0,e.maxStringLength),e)+n}var o=u1[e.quoteStyle||"single"];o.lastIndex=0;var s=Yn.call(Yn.call(t,o,"\\$1"),/[\x00-\x1f]/g,S1);return jS(s,"single",e)}i(VS,"inspectString");function S1(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":"")+a1.call(e.toString(16))}i(S1,"lowbyte");function Ba(t){return"Object("+t+")"}i(Ba,"markBoxed");function rm(t){return t+" { ? }"}i(rm,"weakCollectionOf");function US(t,e,r,n){var o=n?sm(r,n):Jr.call(r,", ");return t+" ("+e+") {"+o+"}"}i(US,"collectionOf");function E1(t){for(var e=0;e<t.length;e++)if(BS(t[e],`
|
|
56
|
-
`)>=0)return!1;return!0}i(
|
|
55
|
+
https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var Hf=class{static{i(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(Nr.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===Nr.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(Nr.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 La.universe("universe-domain"),e||=Gf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Gf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,hS.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Gf.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(o=>r(null,o.credential,o.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 xo.JWT?r.scopes=this.scopes:r instanceof ja.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof xo.JWT?r.scopes=this.scopes:r instanceof ja.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new AF.Compute(e));throw new Error(Nr.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=La.getGCPResidency()||await La.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 o=process.env.HOME;o&&(r=Vf.join(o,".config"))}return r&&(r=Vf.join(r,"gcloud","application_default_credentials.json"),Fa.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=Fa.realpathSync(e),!Fa.lstatSync(e).isFile())throw new Error}catch(o){throw o instanceof Error&&(o.message=`The file at ${e} does not exist, or it is not a file. ${o.message}`),o}let n=Fa.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!==Io.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${Io.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 o=(this.scopes||e.scopes||this.defaultScopes)??[];return new Io.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(o)?o:[o]})}fromJSON(e,r={}){let n,o=(0,hS.originalOrCamelOptions)(r).get("universe_domain");return e.type===fS.USER_REFRESH_ACCOUNT_TYPE?(n=new fS.UserRefreshClient(r),n.fromJSON(e)):e.type===Io.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===ja.EXTERNAL_ACCOUNT_TYPE?(n=$F.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===mS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new mS.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new xo.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),o&&(n.universeDomain=o),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let o={};if(typeof r=="function"?n=r:o=r,n)this.fromStreamAsync(e,o).then(s=>n(null,s),n);else return this.fromStreamAsync(e,o)}fromStreamAsync(e,r){return new Promise((n,o)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",o).on("data",d=>s.push(d)).on("end",()=>{try{try{let d=JSON.parse(s.join("")),m=this._cacheClientFromJSON(d,r);return n(m)}catch(d){if(!this.keyFilename)throw d;let m=new xo.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=m,this.setGapicJWTValues(m),n(m)}}catch(d){return o(d)}})})}fromAPIKey(e,r={}){return new xo.JWT({...r,apiKey:e})}_isWindows(){let e=xF.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,SF.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n)try{let o=JSON.parse(n).configuration.properties.core.project;e(o);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!==ja.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await La.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 Io.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof ja.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([La.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(Nr.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=Vf.resolve(this.keyFilename),r=Fa.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 RF.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,o=await(await this.getClient()).getRequestHeaders(r);return e.headers=EF.Gaxios.mergeHeaders(e.headers,o),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,DF.getEnv)()}async sign(e,r){let n=await this.getClient(),o=await this.getUniverseDomain();if(r=r||`https://iamcredentials.${o}/v1/projects/-/serviceAccounts/`,n instanceof Io.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,IF.createCrypto)();if(n instanceof xo.JWT&&n.key)return await s.sign(n.key,e);let d=await this.getCredentials();if(!d.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,d.client_email,e,r)}async signBlob(e,r,n,o){let s=new URL(o+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};Nr.GoogleAuth=Hf});var yS=L(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.IAMAuth=void 0;var Wf=class{static{i(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}}};Tc.IAMAuth=Wf});var vS=L(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.DownscopedClient=Kr.EXPIRATION_TIME_OFFSET=Kr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var OF=gt(),CF=require("stream"),Zf=nr(),NF=nc(),kF="urn:ietf:params:oauth:grant-type:token-exchange",zF="urn:ietf:params:oauth:token-type:access_token",UF="urn:ietf:params:oauth:token-type:access_token";Kr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Kr.EXPIRATION_TIME_OFFSET=300*1e3;var Kf=class extends Zf.AuthClient{static{i(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Zf.AuthClient?{}:e),e instanceof Zf.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>Kr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Kr.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 NF.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 o=await this.getRequestHeaders();e.headers=OF.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let d=s.status,m=s.config.data instanceof CF.Readable;if(!r&&(d===401||d===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw o}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:kF,requestedTokenType:zF,subjectToken:e,subjectTokenType:UF},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),o=this.authClient.credentials?.expiry_date||null,s=n.expires_in?new Date().getTime()+n.expires_in*1e3:o;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}};Kr.DownscopedClient=Kf});var _S=L(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.PassThroughClient=void 0;var MF=nr(),Jf=class extends MF.AuthClient{static{i(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};Sc.PassThroughClient=Jf});var qa=L(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.GoogleAuth=me.auth=me.PassThroughClient=me.ExternalAccountAuthorizedUserClient=me.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=me.ExecutableError=me.PluggableAuthClient=me.DownscopedClient=me.BaseExternalAccountClient=me.ExternalAccountClient=me.IdentityPoolClient=me.AwsRequestSigner=me.AwsClient=me.UserRefreshClient=me.LoginTicket=me.ClientAuthentication=me.OAuth2Client=me.CodeChallengeMethod=me.Impersonated=me.JWT=me.JWTAccess=me.IdTokenClient=me.IAMAuth=me.GCPEnv=me.Compute=me.DEFAULT_UNIVERSE=me.AuthClient=me.gaxios=me.gcpMetadata=void 0;var wS=gS();Object.defineProperty(me,"GoogleAuth",{enumerable:!0,get:i(function(){return wS.GoogleAuth},"get")});me.gcpMetadata=Ea();me.gaxios=gt();var PS=nr();Object.defineProperty(me,"AuthClient",{enumerable:!0,get:i(function(){return PS.AuthClient},"get")});Object.defineProperty(me,"DEFAULT_UNIVERSE",{enumerable:!0,get:i(function(){return PS.DEFAULT_UNIVERSE},"get")});var FF=zp();Object.defineProperty(me,"Compute",{enumerable:!0,get:i(function(){return FF.Compute},"get")});var LF=Fp();Object.defineProperty(me,"GCPEnv",{enumerable:!0,get:i(function(){return LF.GCPEnv},"get")});var jF=yS();Object.defineProperty(me,"IAMAuth",{enumerable:!0,get:i(function(){return jF.IAMAuth},"get")});var qF=Mp();Object.defineProperty(me,"IdTokenClient",{enumerable:!0,get:i(function(){return qF.IdTokenClient},"get")});var BF=rf();Object.defineProperty(me,"JWTAccess",{enumerable:!0,get:i(function(){return BF.JWTAccess},"get")});var VF=of();Object.defineProperty(me,"JWT",{enumerable:!0,get:i(function(){return VF.JWT},"get")});var GF=cf();Object.defineProperty(me,"Impersonated",{enumerable:!0,get:i(function(){return GF.Impersonated},"get")});var Yf=_i();Object.defineProperty(me,"CodeChallengeMethod",{enumerable:!0,get:i(function(){return Yf.CodeChallengeMethod},"get")});Object.defineProperty(me,"OAuth2Client",{enumerable:!0,get:i(function(){return Yf.OAuth2Client},"get")});Object.defineProperty(me,"ClientAuthentication",{enumerable:!0,get:i(function(){return Yf.ClientAuthentication},"get")});var HF=Op();Object.defineProperty(me,"LoginTicket",{enumerable:!0,get:i(function(){return HF.LoginTicket},"get")});var WF=sf();Object.defineProperty(me,"UserRefreshClient",{enumerable:!0,get:i(function(){return WF.UserRefreshClient},"get")});var ZF=Af();Object.defineProperty(me,"AwsClient",{enumerable:!0,get:i(function(){return ZF.AwsClient},"get")});var KF=Ef();Object.defineProperty(me,"AwsRequestSigner",{enumerable:!0,get:i(function(){return KF.AwsRequestSigner},"get")});var JF=Tf();Object.defineProperty(me,"IdentityPoolClient",{enumerable:!0,get:i(function(){return JF.IdentityPoolClient},"get")});var YF=Lf();Object.defineProperty(me,"ExternalAccountClient",{enumerable:!0,get:i(function(){return YF.ExternalAccountClient},"get")});var XF=Jn();Object.defineProperty(me,"BaseExternalAccountClient",{enumerable:!0,get:i(function(){return XF.BaseExternalAccountClient},"get")});var QF=vS();Object.defineProperty(me,"DownscopedClient",{enumerable:!0,get:i(function(){return QF.DownscopedClient},"get")});var bS=Mf();Object.defineProperty(me,"PluggableAuthClient",{enumerable:!0,get:i(function(){return bS.PluggableAuthClient},"get")});Object.defineProperty(me,"ExecutableError",{enumerable:!0,get:i(function(){return bS.ExecutableError},"get")});var TS=Bf();Object.defineProperty(me,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:i(function(){return TS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(me,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:i(function(){return TS.ExternalAccountAuthorizedUserClient},"get")});var e1=_S();Object.defineProperty(me,"PassThroughClient",{enumerable:!0,get:i(function(){return e1.PassThroughClient},"get")});var t1=new wS.GoogleAuth;me.auth=t1});var ES=L(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});Xf.getAPI=r1;function r1(t,e,r,n){let o;if(typeof e=="string")o=e,e={};else if(typeof e=="object")o=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[o],d=new s(e,n);return Object.freeze(d)}catch(s){throw new Error(`Unable to load endpoint ${t}("${o}"): ${s.message}`)}}i(r1,"getAPI")});var IS=L((Bte,xS)=>{xS.exports=require("util").inspect});var Wa=L((Vte,WS)=>{var um=typeof Map=="function"&&Map.prototype,Qf=Object.getOwnPropertyDescriptor&&um?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ic=um&&Qf&&typeof Qf.get=="function"?Qf.get:null,AS=um&&Map.prototype.forEach,cm=typeof Set=="function"&&Set.prototype,em=Object.getOwnPropertyDescriptor&&cm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ac=cm&&em&&typeof em.get=="function"?em.get:null,RS=cm&&Set.prototype.forEach,n1=typeof WeakMap=="function"&&WeakMap.prototype,Va=n1?WeakMap.prototype.has:null,i1=typeof WeakSet=="function"&&WeakSet.prototype,Ga=i1?WeakSet.prototype.has:null,o1=typeof WeakRef=="function"&&WeakRef.prototype,DS=o1?WeakRef.prototype.deref:null,a1=Boolean.prototype.valueOf,s1=Object.prototype.toString,u1=Function.prototype.toString,c1=String.prototype.match,lm=String.prototype.slice,Yn=String.prototype.replace,l1=String.prototype.toUpperCase,$S=String.prototype.toLowerCase,LS=RegExp.prototype.test,OS=Array.prototype.concat,Jr=Array.prototype.join,d1=Array.prototype.slice,CS=Math.floor,nm=typeof BigInt=="function"?BigInt.prototype.valueOf:null,tm=Object.getOwnPropertySymbols,im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ao=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ha=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ao||!0)?Symbol.toStringTag:null,jS=Object.prototype.propertyIsEnumerable,NS=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function kS(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||LS.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-CS(-t):CS(t);if(n!==t){var o=String(n),s=lm.call(e,o.length+1);return Yn.call(o,r,"$&_")+"."+Yn.call(Yn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Yn.call(e,r,"$&_")}i(kS,"addNumericSeparator");var om=IS(),zS=om.custom,US=VS(zS)?zS:null,qS={__proto__:null,double:'"',single:"'"},p1={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};WS.exports=i(function t(e,r,n,o){var s=r||{};if(Pn(s,"quoteStyle")&&!Pn(qS,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Pn(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 d=Pn(s,"customInspect")?s.customInspect:!0;if(typeof d!="boolean"&&d!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Pn(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(Pn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var m=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 HS(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var h=String(e);return m?kS(e,h):h}if(typeof e=="bigint"){var v=String(e)+"n";return m?kS(e,v):v}var _=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=_&&_>0&&typeof e=="object")return am(e)?"[Array]":"[Object]";var x=D1(s,n);if(typeof o>"u")o=[];else if(GS(o,e)>=0)return"[Circular]";function T(Y,ne,ee){if(ne&&(o=d1.call(o),o.push(ne)),ee){var ce={depth:s.depth};return Pn(s,"quoteStyle")&&(ce.quoteStyle=s.quoteStyle),t(Y,ce,n+1,o)}return t(Y,s,n+1,o)}if(i(T,"inspect"),typeof e=="function"&&!MS(e)){var P=P1(e),S=xc(e,T);return"[Function"+(P?": "+P:" (anonymous)")+"]"+(S.length>0?" { "+Jr.call(S,", ")+" }":"")}if(VS(e)){var D=Ao?Yn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):im.call(e);return typeof e=="object"&&!Ao?Ba(D):D}if(I1(e)){for(var E="<"+$S.call(String(e.nodeName)),u=e.attributes||[],f=0;f<u.length;f++)E+=" "+u[f].name+"="+BS(f1(u[f].value),"double",s);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+$S.call(String(e.nodeName))+">",E}if(am(e)){if(e.length===0)return"[]";var c=xc(e,T);return x&&!R1(c)?"["+sm(c,x)+"]":"[ "+Jr.call(c,", ")+" ]"}if(h1(e)){var y=xc(e,T);return!("cause"in Error.prototype)&&"cause"in e&&!jS.call(e,"cause")?"{ ["+String(e)+"] "+Jr.call(OS.call("[cause]: "+T(e.cause),y),", ")+" }":y.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Jr.call(y,", ")+" }"}if(typeof e=="object"&&d){if(US&&typeof e[US]=="function"&&om)return om(e,{depth:_-n});if(d!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(b1(e)){var l=[];return AS&&AS.call(e,function(Y,ne){l.push(T(ne,e,!0)+" => "+T(Y,e))}),FS("Map",Ic.call(e),l,x)}if(E1(e)){var b=[];return RS&&RS.call(e,function(Y){b.push(T(Y,e))}),FS("Set",Ac.call(e),b,x)}if(T1(e))return rm("WeakMap");if(x1(e))return rm("WeakSet");if(S1(e))return rm("WeakRef");if(y1(e))return Ba(T(Number(e)));if(_1(e))return Ba(T(nm.call(e)));if(v1(e))return Ba(a1.call(e));if(g1(e))return Ba(T(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(!m1(e)&&!MS(e)){var g=xc(e,T),ae=NS?NS(e)===Object.prototype:e instanceof Object||e.constructor===Object,re=e instanceof Object?"":"null prototype",Ue=!ae&&Ha&&Object(e)===e&&Ha in e?lm.call(Xn(e),8,-1):re?"Object":"",se=ae||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",X=se+(Ue||re?"["+Jr.call(OS.call([],Ue||[],re||[]),": ")+"] ":"");return g.length===0?X+"{}":x?X+"{"+sm(g,x)+"}":X+"{ "+Jr.call(g,", ")+" }"}return String(e)},"inspect_");function BS(t,e,r){var n=r.quoteStyle||e,o=qS[n];return o+t+o}i(BS,"wrapQuotes");function f1(t){return Yn.call(String(t),/"/g,""")}i(f1,"quote");function Pi(t){return!Ha||!(typeof t=="object"&&(Ha in t||typeof t[Ha]<"u"))}i(Pi,"canTrustToString");function am(t){return Xn(t)==="[object Array]"&&Pi(t)}i(am,"isArray");function m1(t){return Xn(t)==="[object Date]"&&Pi(t)}i(m1,"isDate");function MS(t){return Xn(t)==="[object RegExp]"&&Pi(t)}i(MS,"isRegExp");function h1(t){return Xn(t)==="[object Error]"&&Pi(t)}i(h1,"isError");function g1(t){return Xn(t)==="[object String]"&&Pi(t)}i(g1,"isString");function y1(t){return Xn(t)==="[object Number]"&&Pi(t)}i(y1,"isNumber");function v1(t){return Xn(t)==="[object Boolean]"&&Pi(t)}i(v1,"isBoolean");function VS(t){if(Ao)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!im)return!1;try{return im.call(t),!0}catch{}return!1}i(VS,"isSymbol");function _1(t){if(!t||typeof t!="object"||!nm)return!1;try{return nm.call(t),!0}catch{}return!1}i(_1,"isBigInt");var w1=Object.prototype.hasOwnProperty||function(t){return t in this};function Pn(t,e){return w1.call(t,e)}i(Pn,"has");function Xn(t){return s1.call(t)}i(Xn,"toStr");function P1(t){if(t.name)return t.name;var e=c1.call(u1.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}i(P1,"nameOf");function GS(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}i(GS,"indexOf");function b1(t){if(!Ic||!t||typeof t!="object")return!1;try{Ic.call(t);try{Ac.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}i(b1,"isMap");function T1(t){if(!Va||!t||typeof t!="object")return!1;try{Va.call(t,Va);try{Ga.call(t,Ga)}catch{return!0}return t instanceof WeakMap}catch{}return!1}i(T1,"isWeakMap");function S1(t){if(!DS||!t||typeof t!="object")return!1;try{return DS.call(t),!0}catch{}return!1}i(S1,"isWeakRef");function E1(t){if(!Ac||!t||typeof t!="object")return!1;try{Ac.call(t);try{Ic.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}i(E1,"isSet");function x1(t){if(!Ga||!t||typeof t!="object")return!1;try{Ga.call(t,Ga);try{Va.call(t,Va)}catch{return!0}return t instanceof WeakSet}catch{}return!1}i(x1,"isWeakSet");function I1(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}i(I1,"isElement");function HS(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return HS(lm.call(t,0,e.maxStringLength),e)+n}var o=p1[e.quoteStyle||"single"];o.lastIndex=0;var s=Yn.call(Yn.call(t,o,"\\$1"),/[\x00-\x1f]/g,A1);return BS(s,"single",e)}i(HS,"inspectString");function A1(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":"")+l1.call(e.toString(16))}i(A1,"lowbyte");function Ba(t){return"Object("+t+")"}i(Ba,"markBoxed");function rm(t){return t+" { ? }"}i(rm,"weakCollectionOf");function FS(t,e,r,n){var o=n?sm(r,n):Jr.call(r,", ");return t+" ("+e+") {"+o+"}"}i(FS,"collectionOf");function R1(t){for(var e=0;e<t.length;e++)if(GS(t[e],`
|
|
56
|
+
`)>=0)return!1;return!0}i(R1,"singleLineValues");function D1(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)}}i(D1,"getIndent");function sm(t,e){if(t.length===0)return"";var r=`
|
|
57
57
|
`+e.prev+e.base;return r+Jr.call(t,","+r)+`
|
|
58
|
-
`+e.prev}i(sm,"indentedJoin");function xc(t,e){var r=am(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=Pn(t,o)?e(t[o],t):""}var s=typeof tm=="function"?tm(t):[],d;if(Ao){d={};for(var m=0;m<s.length;m++)d["$"+s[m]]=s[m]}for(var h in t)Pn(t,h)&&(r&&String(Number(h))===h&&h<t.length||Ao&&d["$"+h]instanceof Symbol||(MS.call(/[^\w$]/,h)?n.push(e(h,t)+": "+e(t[h],t)):n.push(h+": "+e(t[h],t))));if(typeof tm=="function")for(var v=0;v<s.length;v++)FS.call(t,s[v])&&n.push("["+e(s[v])+"]: "+e(t[s[v]],t));return n}i(xc,"arrObjKeys")});var WS=L((Lte,HS)=>{"use strict";var I1=Wa(),A1=jn(),Rc=i(function(t,e,r){for(var n=t,o;(o=n.next)!=null;n=o)if(o.key===e)return n.next=o.next,r||(o.next=t.next,t.next=o),o},"listGetNode"),R1=i(function(t,e){if(t){var r=Rc(t,e);return r&&r.value}},"listGet"),D1=i(function(t,e,r){var n=Rc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),$1=i(function(t,e){return t?!!Rc(t,e):!1},"listHas"),O1=i(function(t,e){if(t)return Rc(t,e,!0)},"listDelete");HS.exports=i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new A1("Side channel does not contain "+I1(n))},"assert"),delete:i(function(n){var o=O1(e,n);return o&&e&&!e.next&&(e=void 0),!!o},"delete"),get:i(function(n){return R1(e,n)},"get"),has:i(function(n){return $1(e,n)},"has"),set:i(function(n,o){e||(e={next:void 0}),D1(e,n,o)},"set")};return r},"getSideChannelList")});var dm=L((qte,JS)=>{"use strict";var ZS=ca(),KS=Sd(),C1=KS([ZS("%String.prototype.indexOf%")]);JS.exports=i(function(e,r){var n=ZS(e,!!r);return typeof n=="function"&&C1(e,".prototype.")>-1?KS([n]):n},"callBoundIntrinsic")});var pm=L((Vte,XS)=>{"use strict";var N1=ca(),Za=dm(),k1=Wa(),z1=jn(),YS=N1("%Map%",!0),U1=Za("Map.prototype.get",!0),M1=Za("Map.prototype.set",!0),F1=Za("Map.prototype.has",!0),L1=Za("Map.prototype.delete",!0),j1=Za("Map.prototype.size",!0);XS.exports=!!YS&&i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new z1("Side channel does not contain "+k1(n))},"assert"),delete:i(function(n){if(e){var o=L1(e,n);return j1(e)===0&&(e=void 0),o}return!1},"delete"),get:i(function(n){if(e)return U1(e,n)},"get"),has:i(function(n){return e?F1(e,n):!1},"has"),set:i(function(n,o){e||(e=new YS),M1(e,n,o)},"set")};return r},"getSideChannelMap")});var eE=L((Hte,QS)=>{"use strict";var q1=ca(),$c=dm(),B1=Wa(),Dc=pm(),V1=jn(),Ro=q1("%WeakMap%",!0),G1=$c("WeakMap.prototype.get",!0),H1=$c("WeakMap.prototype.set",!0),W1=$c("WeakMap.prototype.has",!0),Z1=$c("WeakMap.prototype.delete",!0);QS.exports=Ro?i(function(){var e,r,n={assert:i(function(o){if(!n.has(o))throw new V1("Side channel does not contain "+B1(o))},"assert"),delete:i(function(o){if(Ro&&o&&(typeof o=="object"||typeof o=="function")){if(e)return Z1(e,o)}else if(Dc&&r)return r.delete(o);return!1},"delete"),get:i(function(o){return Ro&&o&&(typeof o=="object"||typeof o=="function")&&e?G1(e,o):r&&r.get(o)},"get"),has:i(function(o){return Ro&&o&&(typeof o=="object"||typeof o=="function")&&e?W1(e,o):!!r&&r.has(o)},"has"),set:i(function(o,s){Ro&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Ro),H1(e,o,s)):Dc&&(r||(r=Dc()),r.set(o,s))},"set")};return n},"getSideChannelWeakMap"):Dc});var fm=L((Zte,tE)=>{"use strict";var K1=jn(),J1=Wa(),Y1=WS(),X1=pm(),Q1=eE(),eL=Q1||X1||Y1;tE.exports=i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new K1("Side channel does not contain "+J1(n))},"assert"),delete:i(function(n){return!!e&&e.delete(n)},"delete"),get:i(function(n){return e&&e.get(n)},"get"),has:i(function(n){return!!e&&e.has(n)},"has"),set:i(function(n,o){e||(e=eL()),e.set(n,o)},"set")};return r},"getSideChannel")});var Oc=L((Jte,rE)=>{"use strict";var tL=String.prototype.replace,rL=/%20/g,mm={RFC1738:"RFC1738",RFC3986:"RFC3986"};rE.exports={default:mm.RFC3986,formatters:{RFC1738:i(function(t){return tL.call(t,rL,"+")},"RFC1738"),RFC3986:i(function(t){return String(t)},"RFC3986")},RFC1738:mm.RFC1738,RFC3986:mm.RFC3986}});var vm=L((Xte,nE)=>{"use strict";var nL=Oc(),iL=fm(),hm=Object.prototype.hasOwnProperty,bi=Array.isArray,Cc=iL(),Do=i(function(e,r){return Cc.set(e,r),e},"markOverflow"),Ti=i(function(e){return Cc.has(e)},"isOverflow"),Ka=i(function(e){return Cc.get(e)},"getMaxIndex"),ym=i(function(e,r){Cc.set(e,r)},"setMaxIndex"),Yr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),oL=i(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(bi(n)){for(var o=[],s=0;s<n.length;++s)typeof n[s]<"u"&&(o[o.length]=n[s]);r.obj[r.prop]=o}}},"compactQueue"),Ja=i(function(e,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},o=0;o<e.length;++o)typeof e[o]<"u"&&(n[o]=e[o]);return n},"arrayToObject"),aL=i(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(bi(e)){var o=e.length;if(n&&typeof n.arrayLimit=="number"&&o>n.arrayLimit)return Do(Ja(e.concat(r),n),o);e[o]=r}else if(e&&typeof e=="object")if(Ti(e)){var s=Ka(e)+1;e[s]=r,ym(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!hm.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(Ti(r)){for(var d=Object.keys(r),m=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},h=0;h<d.length;h++){var v=parseInt(d[h],10);m[v+1]=r[d[h]]}return Do(m,Ka(r)+1)}var _=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&_.length>n.arrayLimit?Do(Ja(_,n),_.length-1):_}var x=e;return bi(e)&&!bi(r)&&(x=Ja(e,n)),bi(e)&&bi(r)?(r.forEach(function(T,P){if(hm.call(e,P)){var S=e[P];S&&typeof S=="object"&&T&&typeof T=="object"?e[P]=t(S,T,n):e[e.length]=T}else e[P]=T}),e):Object.keys(r).reduce(function(T,P){var S=r[P];if(hm.call(T,P)?T[P]=t(T[P],S,n):T[P]=S,Ti(r)&&!Ti(T)&&Do(T,Ka(r)),Ti(T)){var D=parseInt(P,10);String(D)===P&&D>=0&&D>Ka(T)&&ym(T,D)}return T},x)},"merge"),sL=i(function(e,r){return Object.keys(r).reduce(function(n,o){return n[o]=r[o],n},e)},"assignSingleSource"),uL=i(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"),gm=1024,cL=i(function(e,r,n,o,s){if(e.length===0)return e;var d=e;if(typeof e=="symbol"?d=Symbol.prototype.toString.call(e):typeof e!="string"&&(d=String(e)),n==="iso-8859-1")return escape(d).replace(/%u[0-9a-f]{4}/gi,function(P){return"%26%23"+parseInt(P.slice(2),16)+"%3B"});for(var m="",h=0;h<d.length;h+=gm){for(var v=d.length>=gm?d.slice(h,h+gm):d,_=[],x=0;x<v.length;++x){var T=v.charCodeAt(x);if(T===45||T===46||T===95||T===126||T>=48&&T<=57||T>=65&&T<=90||T>=97&&T<=122||s===nL.RFC1738&&(T===40||T===41)){_[_.length]=v.charAt(x);continue}if(T<128){_[_.length]=Yr[T];continue}if(T<2048){_[_.length]=Yr[192|T>>6]+Yr[128|T&63];continue}if(T<55296||T>=57344){_[_.length]=Yr[224|T>>12]+Yr[128|T>>6&63]+Yr[128|T&63];continue}x+=1,T=65536+((T&1023)<<10|v.charCodeAt(x)&1023),_[_.length]=Yr[240|T>>18]+Yr[128|T>>12&63]+Yr[128|T>>6&63]+Yr[128|T&63]}m+=_.join("")}return m},"encode"),lL=i(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o<r.length;++o)for(var s=r[o],d=s.obj[s.prop],m=Object.keys(d),h=0;h<m.length;++h){var v=m[h],_=d[v];typeof _=="object"&&_!==null&&n.indexOf(_)===-1&&(r[r.length]={obj:d,prop:v},n[n.length]=_)}return oL(r),e},"compact"),dL=i(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),pL=i(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),fL=i(function(e,r,n,o){if(Ti(e)){var s=Ka(e)+1;return e[s]=r,ym(e,s),e}var d=[].concat(e,r);return d.length>n?Do(Ja(d,{plainObjects:o}),d.length-1):d},"combine"),mL=i(function(e,r){if(bi(e)){for(var n=[],o=0;o<e.length;o+=1)n[n.length]=r(e[o]);return n}return r(e)},"maybeMap");nE.exports={arrayToObject:Ja,assign:sL,combine:fL,compact:lL,decode:uL,encode:cL,isBuffer:pL,isOverflow:Ti,isRegExp:dL,markOverflow:Do,maybeMap:mL,merge:aL}});var cE=L((ere,uE)=>{"use strict";var oE=fm(),Nc=vm(),Ya=Oc(),hL=Object.prototype.hasOwnProperty,aE={brackets:i(function(e){return e+"[]"},"brackets"),comma:"comma",indices:i(function(e,r){return e+"["+r+"]"},"indices"),repeat:i(function(e){return e},"repeat")},Xr=Array.isArray,gL=Array.prototype.push,sE=i(function(t,e){gL.apply(t,Xr(e)?e:[e])},"pushToArray"),yL=Date.prototype.toISOString,iE=Ya.default,bt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Nc.encode,encodeValuesOnly:!1,filter:void 0,format:iE,formatter:Ya.formatters[iE],indices:!1,serializeDate:i(function(e){return yL.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},vL=i(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),_m={},_L=i(function t(e,r,n,o,s,d,m,h,v,_,x,T,P,S,D,E,u,f){for(var c=e,y=f,l=0,b=!1;(y=y.get(_m))!==void 0&&!b;){var g=y.get(e);if(l+=1,typeof g<"u"){if(g===l)throw new RangeError("Cyclic object value");b=!0}typeof y.get(_m)>"u"&&(l=0)}if(typeof _=="function"?c=_(r,c):c instanceof Date?c=P(c):n==="comma"&&Xr(c)&&(c=Nc.maybeMap(c,function(Ke){return Ke instanceof Date?P(Ke):Ke})),c===null){if(d)return v&&!E?v(r,bt.encoder,u,"key",S):r;c=""}if(vL(c)||Nc.isBuffer(c)){if(v){var ae=E?r:v(r,bt.encoder,u,"key",S);return[D(ae)+"="+D(v(c,bt.encoder,u,"value",S))]}return[D(r)+"="+D(String(c))]}var re=[];if(typeof c>"u")return re;var Ue;if(n==="comma"&&Xr(c))E&&v&&(c=Nc.maybeMap(c,v)),Ue=[{value:c.length>0?c.join(",")||null:void 0}];else if(Xr(_))Ue=_;else{var se=Object.keys(c);Ue=x?se.sort(x):se}var X=h?String(r).replace(/\./g,"%2E"):String(r),Y=o&&Xr(c)&&c.length===1?X+"[]":X;if(s&&Xr(c)&&c.length===0)return Y+"[]";for(var ne=0;ne<Ue.length;++ne){var ee=Ue[ne],ce=typeof ee=="object"&&ee&&typeof ee.value<"u"?ee.value:c[ee];if(!(m&&ce===null)){var de=T&&h?String(ee).replace(/\./g,"%2E"):String(ee),ke=Xr(c)?typeof n=="function"?n(Y,de):Y:Y+(T?"."+de:"["+de+"]");f.set(e,l);var Me=oE();Me.set(_m,f),sE(re,t(ce,ke,n,o,s,d,m,h,n==="comma"&&E&&Xr(c)?null:v,_,x,T,P,S,D,E,u,Me))}}return re},"stringify"),wL=i(function(e){if(!e)return bt;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||bt.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=Ya.default;if(typeof e.format<"u"){if(!hL.call(Ya.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var o=Ya.formatters[n],s=bt.filter;(typeof e.filter=="function"||Xr(e.filter))&&(s=e.filter);var d;if(e.arrayFormat in aE?d=e.arrayFormat:"indices"in e?d=e.indices?"indices":"repeat":d=bt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var m=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:bt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:bt.addQueryPrefix,allowDots:m,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:bt.allowEmptyArrays,arrayFormat:d,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:bt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?bt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:bt.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:bt.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:bt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:bt.encodeValuesOnly,filter:s,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:bt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:bt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:bt.strictNullHandling}},"normalizeStringifyOptions");uE.exports=function(t,e){var r=t,n=wL(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Xr(n.filter)&&(s=n.filter,o=s);var d=[];if(typeof r!="object"||r===null)return"";var m=aE[n.arrayFormat],h=m==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var v=oE(),_=0;_<o.length;++_){var x=o[_],T=r[x];n.skipNulls&&T===null||sE(d,_L(T,x,m,h,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,v))}var P=d.join(n.delimiter),S=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),P.length>0?S+P:""}});var pE=L((rre,dE)=>{"use strict";var Qr=vm(),kc=Object.prototype.hasOwnProperty,wm=Array.isArray,ct={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Qr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},PL=i(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),lE=i(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"),bL="utf8=%26%2310003%3B",TL="utf8=%E2%9C%93",SL=i(function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,d=o.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&d.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var m=-1,h,v=r.charset;if(r.charsetSentinel)for(h=0;h<d.length;++h)d[h].indexOf("utf8=")===0&&(d[h]===TL?v="utf-8":d[h]===bL&&(v="iso-8859-1"),m=h,h=d.length);for(h=0;h<d.length;++h)if(h!==m){var _=d[h],x=_.indexOf("]="),T=x===-1?_.indexOf("="):x+1,P,S;if(T===-1?(P=r.decoder(_,ct.decoder,v,"key"),S=r.strictNullHandling?null:""):(P=r.decoder(_.slice(0,T),ct.decoder,v,"key"),P!==null&&(S=Qr.maybeMap(lE(_.slice(T+1),r,wm(n[P])?n[P].length:0),function(E){return r.decoder(E,ct.decoder,v,"value")}))),S&&r.interpretNumericEntities&&v==="iso-8859-1"&&(S=PL(String(S))),_.indexOf("[]=")>-1&&(S=wm(S)?[S]:S),r.comma&&wm(S)&&S.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");S=Qr.combine([],S,r.arrayLimit,r.plainObjects)}if(P!==null){var D=kc.call(n,P);D&&(r.duplicates==="combine"||_.indexOf("[]=")>-1)?n[P]=Qr.combine(n[P],S,r.arrayLimit,r.plainObjects):(!D||r.duplicates==="last")&&(n[P]=S)}}return n},"parseQueryStringValues"),EL=i(function(t,e,r,n){var o=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");o=Array.isArray(e)&&e[s]?e[s].length:0}for(var d=n?e:lE(e,r,o),m=t.length-1;m>=0;--m){var h,v=t[m];if(v==="[]"&&r.parseArrays)Qr.isOverflow(d)?h=d:h=r.allowEmptyArrays&&(d===""||r.strictNullHandling&&d===null)?[]:Qr.combine([],d,r.arrayLimit,r.plainObjects);else{h=r.plainObjects?{__proto__:null}:{};var _=v.charAt(0)==="["&&v.charAt(v.length-1)==="]"?v.slice(1,-1):v,x=r.decodeDotInKeys?_.replace(/%2E/g,"."):_,T=parseInt(x,10),P=!isNaN(T)&&v!==x&&String(T)===x&&T>=0&&r.parseArrays;if(!r.parseArrays&&x==="")h={0:d};else if(P&&T<r.arrayLimit)h=[],h[T]=d;else{if(P&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");P?(h[T]=d,Qr.markOverflow(h,T)):x!=="__proto__"&&(h[x]=d)}}d=h}return d},"parseObject"),xL=i(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&kc.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,d=o.exec(n),m=d?n.slice(0,d.index):n,h=[];if(m){if(!r.plainObjects&&kc.call(Object.prototype,m)&&!r.allowPrototypes)return;h[h.length]=m}for(var v=0;(d=s.exec(n))!==null&&v<r.depth;){v+=1;var _=d[1].slice(1,-1);if(!r.plainObjects&&kc.call(Object.prototype,_)&&!r.allowPrototypes)return;h[h.length]=d[1]}if(d){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");h[h.length]="["+n.slice(d.index)+"]"}return h},"splitKeyIntoSegments"),IL=i(function(e,r,n,o){if(e){var s=xL(e,n);if(s)return EL(s,r,n,o)}},"parseQueryStringKeys"),AL=i(function(e){if(!e)return ct;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"?ct.charset:e.charset,n=typeof e.duplicates>"u"?ct.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:ct.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ct.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:ct.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:ct.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:ct.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ct.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:ct.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:ct.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:ct.decoder,delimiter:typeof e.delimiter=="string"||Qr.isRegExp(e.delimiter)?e.delimiter:ct.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:ct.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:ct.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:ct.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:ct.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:ct.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:ct.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ct.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");dE.exports=function(t,e){var r=AL(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?SL(t,r):t,o=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),d=0;d<s.length;++d){var m=s[d],h=IL(m,n[m],r,typeof t=="string");o=Qr.merge(o,h,r)}return r.allowSparse===!0?o:Qr.compact(o)}});var Pm=L((ire,fE)=>{"use strict";var RL=cE(),DL=pE(),$L=Oc();fE.exports={formats:$L,parse:DL,stringify:RL}});var hE=L((bm,mE)=>{(function(t,e){typeof bm=="object"?mE.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(bm,function(){function t(){}return i(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,o){var s=e[n],d=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),o&&o!=="*"&&(s=s.substring(0,parseInt(o,10))),d.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(o==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(h){d.push(this.encodeValue(r,h,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(h){this.isDefined(s[h])&&d.push(this.encodeValue(r,s[h],h))},this);else{var m=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(h){m.push(this.encodeValue(r,h))},this):Object.keys(s).forEach(function(h){this.isDefined(s[h])&&(m.push(this.encodeUnreserved(h)),m.push(this.encodeValue(r,s[h].toString())))},this),this.isKeyOperator(r)?d.push(this.encodeUnreserved(n)+"="+m.join(",")):m.length!==0&&d.push(m.join(","))}else r===";"?this.isDefined(s)&&d.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?d.push(this.encodeUnreserved(n)+"="):s===""&&d.push("");return d},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:i(function(o){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,d,m){if(d){var h=null,v=[];if(n.indexOf(d.charAt(0))!==-1&&(h=d.charAt(0),d=d.substr(1)),d.split(/,/g).forEach(function(x){var T=/([^:\*]*)(?::(\d+)|(\*))?/.exec(x);v.push.apply(v,r.getValues(o,h,T[1],T[2]||T[3]))}),h&&h!=="+"){var _=",";return h==="?"?_="&":h!=="#"&&(_=h),(v.length!==0?h:"")+v.join(_)}else return v.join(",")}else return r.encodeReserved(m)})},"expand")}},new t})});var gE=L(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.isBrowser=OL;function OL(){return typeof window<"u"}i(OL,"isBrowser")});var Uc=L(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.headersToClassicHeaders=yE;zc.marshallGaxiosResponse=CL;function yE(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}i(yE,"headersToClassicHeaders");function CL(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:yE(t?.headers)}})}i(CL,"marshallGaxiosResponse")});var wE=L(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.sessions=void 0;ur.request=HL;ur.closeSession=Sm;var _E=require("http2"),NL=require("zlib"),kL=require("url"),zL=Pm(),UL=da(),ML=require("stream"),FL=require("util"),LL=require("process"),jL=Uc(),{HTTP2_HEADER_CONTENT_ENCODING:qL,HTTP2_HEADER_CONTENT_TYPE:vE,HTTP2_HEADER_METHOD:BL,HTTP2_HEADER_PATH:VL,HTTP2_HEADER_STATUS:GL}=_E.constants,Xa=!!LL.env.HTTP2_DEBUG;ur.sessions={};async function HL(t){let e=UL(!0,{},t);e.validateStatus=e.validateStatus||WL,e.responseType=e.responseType||"json";let r=new kL.URL(e.url),n=ZL(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let o=r.pathname;if(t.params&&Object.keys(t.params).length>0){let x=(t.paramsSerializer||zL.stringify)(e.params);o+=`?${x}`}let s=(0,jL.headersToClassicHeaders)(e.headers);s[VL]=o,s[BL]=t.method||"GET",e.headers=s,s[vE]||e.responseType!=="text"&&(s[vE]="application/json");let d={config:t,headers:{},status:0,data:{},statusText:""},m=[],h=n.session,v;return new Promise((_,x)=>{try{v=h.request(s).on("response",T=>{Object.assign(d,{headers:T,status:T[GL]});let P=v;if(T[qL]==="gzip"&&(P=v.pipe(NL.createGunzip())),e.responseType==="stream"){d.data=P,_(d);return}P.on("data",S=>{m.push(S)}).on("error",S=>{x(S)}).on("end",()=>{let S=Buffer.concat(m),D=S;if(S){if(e.responseType==="json")try{D=JSON.parse(S.toString("utf8"))}catch{D=S.toString("utf8")}else e.responseType==="text"?D=S.toString("utf8"):e.responseType==="arraybuffer"&&(D=S.buffer);d.data=D}if(!e.validateStatus(d.status)){let E=`Request failed with status code ${d.status}. `;if(d.data&&typeof d.data=="object"){let u=FL.inspect(d.data,{depth:5});E=`${E}
|
|
59
|
-
'${u}`}x(new Error(E,{cause:d}))}_(d)})}).on("error",T=>{x(T)})}catch(T){Sm(r).then(()=>x(T)).catch(x);return}if(d.request=v,t.data){if(t.data instanceof
|
|
60
|
-
`),this.push(D),c()}}),u=new Am,f=
|
|
58
|
+
`+e.prev}i(sm,"indentedJoin");function xc(t,e){var r=am(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=Pn(t,o)?e(t[o],t):""}var s=typeof tm=="function"?tm(t):[],d;if(Ao){d={};for(var m=0;m<s.length;m++)d["$"+s[m]]=s[m]}for(var h in t)Pn(t,h)&&(r&&String(Number(h))===h&&h<t.length||Ao&&d["$"+h]instanceof Symbol||(LS.call(/[^\w$]/,h)?n.push(e(h,t)+": "+e(t[h],t)):n.push(h+": "+e(t[h],t))));if(typeof tm=="function")for(var v=0;v<s.length;v++)jS.call(t,s[v])&&n.push("["+e(s[v])+"]: "+e(t[s[v]],t));return n}i(xc,"arrObjKeys")});var KS=L((Hte,ZS)=>{"use strict";var $1=Wa(),O1=jn(),Rc=i(function(t,e,r){for(var n=t,o;(o=n.next)!=null;n=o)if(o.key===e)return n.next=o.next,r||(o.next=t.next,t.next=o),o},"listGetNode"),C1=i(function(t,e){if(t){var r=Rc(t,e);return r&&r.value}},"listGet"),N1=i(function(t,e,r){var n=Rc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),k1=i(function(t,e){return t?!!Rc(t,e):!1},"listHas"),z1=i(function(t,e){if(t)return Rc(t,e,!0)},"listDelete");ZS.exports=i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new O1("Side channel does not contain "+$1(n))},"assert"),delete:i(function(n){var o=z1(e,n);return o&&e&&!e.next&&(e=void 0),!!o},"delete"),get:i(function(n){return C1(e,n)},"get"),has:i(function(n){return k1(e,n)},"has"),set:i(function(n,o){e||(e={next:void 0}),N1(e,n,o)},"set")};return r},"getSideChannelList")});var dm=L((Zte,XS)=>{"use strict";var JS=ca(),YS=Sd(),U1=YS([JS("%String.prototype.indexOf%")]);XS.exports=i(function(e,r){var n=JS(e,!!r);return typeof n=="function"&&U1(e,".prototype.")>-1?YS([n]):n},"callBoundIntrinsic")});var pm=L((Jte,eE)=>{"use strict";var M1=ca(),Za=dm(),F1=Wa(),L1=jn(),QS=M1("%Map%",!0),j1=Za("Map.prototype.get",!0),q1=Za("Map.prototype.set",!0),B1=Za("Map.prototype.has",!0),V1=Za("Map.prototype.delete",!0),G1=Za("Map.prototype.size",!0);eE.exports=!!QS&&i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new L1("Side channel does not contain "+F1(n))},"assert"),delete:i(function(n){if(e){var o=V1(e,n);return G1(e)===0&&(e=void 0),o}return!1},"delete"),get:i(function(n){if(e)return j1(e,n)},"get"),has:i(function(n){return e?B1(e,n):!1},"has"),set:i(function(n,o){e||(e=new QS),q1(e,n,o)},"set")};return r},"getSideChannelMap")});var rE=L((Xte,tE)=>{"use strict";var H1=ca(),$c=dm(),W1=Wa(),Dc=pm(),Z1=jn(),Ro=H1("%WeakMap%",!0),K1=$c("WeakMap.prototype.get",!0),J1=$c("WeakMap.prototype.set",!0),Y1=$c("WeakMap.prototype.has",!0),X1=$c("WeakMap.prototype.delete",!0);tE.exports=Ro?i(function(){var e,r,n={assert:i(function(o){if(!n.has(o))throw new Z1("Side channel does not contain "+W1(o))},"assert"),delete:i(function(o){if(Ro&&o&&(typeof o=="object"||typeof o=="function")){if(e)return X1(e,o)}else if(Dc&&r)return r.delete(o);return!1},"delete"),get:i(function(o){return Ro&&o&&(typeof o=="object"||typeof o=="function")&&e?K1(e,o):r&&r.get(o)},"get"),has:i(function(o){return Ro&&o&&(typeof o=="object"||typeof o=="function")&&e?Y1(e,o):!!r&&r.has(o)},"has"),set:i(function(o,s){Ro&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Ro),J1(e,o,s)):Dc&&(r||(r=Dc()),r.set(o,s))},"set")};return n},"getSideChannelWeakMap"):Dc});var fm=L((ere,nE)=>{"use strict";var Q1=jn(),eL=Wa(),tL=KS(),rL=pm(),nL=rE(),iL=nL||rL||tL;nE.exports=i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new Q1("Side channel does not contain "+eL(n))},"assert"),delete:i(function(n){return!!e&&e.delete(n)},"delete"),get:i(function(n){return e&&e.get(n)},"get"),has:i(function(n){return!!e&&e.has(n)},"has"),set:i(function(n,o){e||(e=iL()),e.set(n,o)},"set")};return r},"getSideChannel")});var Oc=L((rre,iE)=>{"use strict";var oL=String.prototype.replace,aL=/%20/g,mm={RFC1738:"RFC1738",RFC3986:"RFC3986"};iE.exports={default:mm.RFC3986,formatters:{RFC1738:i(function(t){return oL.call(t,aL,"+")},"RFC1738"),RFC3986:i(function(t){return String(t)},"RFC3986")},RFC1738:mm.RFC1738,RFC3986:mm.RFC3986}});var vm=L((ire,oE)=>{"use strict";var sL=Oc(),uL=fm(),hm=Object.prototype.hasOwnProperty,bi=Array.isArray,Cc=uL(),Do=i(function(e,r){return Cc.set(e,r),e},"markOverflow"),Ti=i(function(e){return Cc.has(e)},"isOverflow"),Ka=i(function(e){return Cc.get(e)},"getMaxIndex"),ym=i(function(e,r){Cc.set(e,r)},"setMaxIndex"),Yr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),cL=i(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(bi(n)){for(var o=[],s=0;s<n.length;++s)typeof n[s]<"u"&&(o[o.length]=n[s]);r.obj[r.prop]=o}}},"compactQueue"),Ja=i(function(e,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},o=0;o<e.length;++o)typeof e[o]<"u"&&(n[o]=e[o]);return n},"arrayToObject"),lL=i(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(bi(e)){var o=e.length;if(n&&typeof n.arrayLimit=="number"&&o>n.arrayLimit)return Do(Ja(e.concat(r),n),o);e[o]=r}else if(e&&typeof e=="object")if(Ti(e)){var s=Ka(e)+1;e[s]=r,ym(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!hm.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(Ti(r)){for(var d=Object.keys(r),m=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},h=0;h<d.length;h++){var v=parseInt(d[h],10);m[v+1]=r[d[h]]}return Do(m,Ka(r)+1)}var _=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&_.length>n.arrayLimit?Do(Ja(_,n),_.length-1):_}var x=e;return bi(e)&&!bi(r)&&(x=Ja(e,n)),bi(e)&&bi(r)?(r.forEach(function(T,P){if(hm.call(e,P)){var S=e[P];S&&typeof S=="object"&&T&&typeof T=="object"?e[P]=t(S,T,n):e[e.length]=T}else e[P]=T}),e):Object.keys(r).reduce(function(T,P){var S=r[P];if(hm.call(T,P)?T[P]=t(T[P],S,n):T[P]=S,Ti(r)&&!Ti(T)&&Do(T,Ka(r)),Ti(T)){var D=parseInt(P,10);String(D)===P&&D>=0&&D>Ka(T)&&ym(T,D)}return T},x)},"merge"),dL=i(function(e,r){return Object.keys(r).reduce(function(n,o){return n[o]=r[o],n},e)},"assignSingleSource"),pL=i(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"),gm=1024,fL=i(function(e,r,n,o,s){if(e.length===0)return e;var d=e;if(typeof e=="symbol"?d=Symbol.prototype.toString.call(e):typeof e!="string"&&(d=String(e)),n==="iso-8859-1")return escape(d).replace(/%u[0-9a-f]{4}/gi,function(P){return"%26%23"+parseInt(P.slice(2),16)+"%3B"});for(var m="",h=0;h<d.length;h+=gm){for(var v=d.length>=gm?d.slice(h,h+gm):d,_=[],x=0;x<v.length;++x){var T=v.charCodeAt(x);if(T===45||T===46||T===95||T===126||T>=48&&T<=57||T>=65&&T<=90||T>=97&&T<=122||s===sL.RFC1738&&(T===40||T===41)){_[_.length]=v.charAt(x);continue}if(T<128){_[_.length]=Yr[T];continue}if(T<2048){_[_.length]=Yr[192|T>>6]+Yr[128|T&63];continue}if(T<55296||T>=57344){_[_.length]=Yr[224|T>>12]+Yr[128|T>>6&63]+Yr[128|T&63];continue}x+=1,T=65536+((T&1023)<<10|v.charCodeAt(x)&1023),_[_.length]=Yr[240|T>>18]+Yr[128|T>>12&63]+Yr[128|T>>6&63]+Yr[128|T&63]}m+=_.join("")}return m},"encode"),mL=i(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o<r.length;++o)for(var s=r[o],d=s.obj[s.prop],m=Object.keys(d),h=0;h<m.length;++h){var v=m[h],_=d[v];typeof _=="object"&&_!==null&&n.indexOf(_)===-1&&(r[r.length]={obj:d,prop:v},n[n.length]=_)}return cL(r),e},"compact"),hL=i(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),gL=i(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),yL=i(function(e,r,n,o){if(Ti(e)){var s=Ka(e)+1;return e[s]=r,ym(e,s),e}var d=[].concat(e,r);return d.length>n?Do(Ja(d,{plainObjects:o}),d.length-1):d},"combine"),vL=i(function(e,r){if(bi(e)){for(var n=[],o=0;o<e.length;o+=1)n[n.length]=r(e[o]);return n}return r(e)},"maybeMap");oE.exports={arrayToObject:Ja,assign:dL,combine:yL,compact:mL,decode:pL,encode:fL,isBuffer:gL,isOverflow:Ti,isRegExp:hL,markOverflow:Do,maybeMap:vL,merge:lL}});var dE=L((are,lE)=>{"use strict";var sE=fm(),Nc=vm(),Ya=Oc(),_L=Object.prototype.hasOwnProperty,uE={brackets:i(function(e){return e+"[]"},"brackets"),comma:"comma",indices:i(function(e,r){return e+"["+r+"]"},"indices"),repeat:i(function(e){return e},"repeat")},Xr=Array.isArray,wL=Array.prototype.push,cE=i(function(t,e){wL.apply(t,Xr(e)?e:[e])},"pushToArray"),PL=Date.prototype.toISOString,aE=Ya.default,bt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Nc.encode,encodeValuesOnly:!1,filter:void 0,format:aE,formatter:Ya.formatters[aE],indices:!1,serializeDate:i(function(e){return PL.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},bL=i(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),_m={},TL=i(function t(e,r,n,o,s,d,m,h,v,_,x,T,P,S,D,E,u,f){for(var c=e,y=f,l=0,b=!1;(y=y.get(_m))!==void 0&&!b;){var g=y.get(e);if(l+=1,typeof g<"u"){if(g===l)throw new RangeError("Cyclic object value");b=!0}typeof y.get(_m)>"u"&&(l=0)}if(typeof _=="function"?c=_(r,c):c instanceof Date?c=P(c):n==="comma"&&Xr(c)&&(c=Nc.maybeMap(c,function(Ke){return Ke instanceof Date?P(Ke):Ke})),c===null){if(d)return v&&!E?v(r,bt.encoder,u,"key",S):r;c=""}if(bL(c)||Nc.isBuffer(c)){if(v){var ae=E?r:v(r,bt.encoder,u,"key",S);return[D(ae)+"="+D(v(c,bt.encoder,u,"value",S))]}return[D(r)+"="+D(String(c))]}var re=[];if(typeof c>"u")return re;var Ue;if(n==="comma"&&Xr(c))E&&v&&(c=Nc.maybeMap(c,v)),Ue=[{value:c.length>0?c.join(",")||null:void 0}];else if(Xr(_))Ue=_;else{var se=Object.keys(c);Ue=x?se.sort(x):se}var X=h?String(r).replace(/\./g,"%2E"):String(r),Y=o&&Xr(c)&&c.length===1?X+"[]":X;if(s&&Xr(c)&&c.length===0)return Y+"[]";for(var ne=0;ne<Ue.length;++ne){var ee=Ue[ne],ce=typeof ee=="object"&&ee&&typeof ee.value<"u"?ee.value:c[ee];if(!(m&&ce===null)){var de=T&&h?String(ee).replace(/\./g,"%2E"):String(ee),ke=Xr(c)?typeof n=="function"?n(Y,de):Y:Y+(T?"."+de:"["+de+"]");f.set(e,l);var Me=sE();Me.set(_m,f),cE(re,t(ce,ke,n,o,s,d,m,h,n==="comma"&&E&&Xr(c)?null:v,_,x,T,P,S,D,E,u,Me))}}return re},"stringify"),SL=i(function(e){if(!e)return bt;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||bt.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=Ya.default;if(typeof e.format<"u"){if(!_L.call(Ya.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var o=Ya.formatters[n],s=bt.filter;(typeof e.filter=="function"||Xr(e.filter))&&(s=e.filter);var d;if(e.arrayFormat in uE?d=e.arrayFormat:"indices"in e?d=e.indices?"indices":"repeat":d=bt.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var m=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:bt.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:bt.addQueryPrefix,allowDots:m,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:bt.allowEmptyArrays,arrayFormat:d,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:bt.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?bt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:bt.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:bt.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:bt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:bt.encodeValuesOnly,filter:s,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:bt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:bt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:bt.strictNullHandling}},"normalizeStringifyOptions");lE.exports=function(t,e){var r=t,n=SL(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Xr(n.filter)&&(s=n.filter,o=s);var d=[];if(typeof r!="object"||r===null)return"";var m=uE[n.arrayFormat],h=m==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var v=sE(),_=0;_<o.length;++_){var x=o[_],T=r[x];n.skipNulls&&T===null||cE(d,TL(T,x,m,h,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,v))}var P=d.join(n.delimiter),S=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),P.length>0?S+P:""}});var mE=L((ure,fE)=>{"use strict";var Qr=vm(),kc=Object.prototype.hasOwnProperty,wm=Array.isArray,ct={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Qr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},EL=i(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),pE=i(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"),xL="utf8=%26%2310003%3B",IL="utf8=%E2%9C%93",AL=i(function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,d=o.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&d.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var m=-1,h,v=r.charset;if(r.charsetSentinel)for(h=0;h<d.length;++h)d[h].indexOf("utf8=")===0&&(d[h]===IL?v="utf-8":d[h]===xL&&(v="iso-8859-1"),m=h,h=d.length);for(h=0;h<d.length;++h)if(h!==m){var _=d[h],x=_.indexOf("]="),T=x===-1?_.indexOf("="):x+1,P,S;if(T===-1?(P=r.decoder(_,ct.decoder,v,"key"),S=r.strictNullHandling?null:""):(P=r.decoder(_.slice(0,T),ct.decoder,v,"key"),P!==null&&(S=Qr.maybeMap(pE(_.slice(T+1),r,wm(n[P])?n[P].length:0),function(E){return r.decoder(E,ct.decoder,v,"value")}))),S&&r.interpretNumericEntities&&v==="iso-8859-1"&&(S=EL(String(S))),_.indexOf("[]=")>-1&&(S=wm(S)?[S]:S),r.comma&&wm(S)&&S.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");S=Qr.combine([],S,r.arrayLimit,r.plainObjects)}if(P!==null){var D=kc.call(n,P);D&&(r.duplicates==="combine"||_.indexOf("[]=")>-1)?n[P]=Qr.combine(n[P],S,r.arrayLimit,r.plainObjects):(!D||r.duplicates==="last")&&(n[P]=S)}}return n},"parseQueryStringValues"),RL=i(function(t,e,r,n){var o=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");o=Array.isArray(e)&&e[s]?e[s].length:0}for(var d=n?e:pE(e,r,o),m=t.length-1;m>=0;--m){var h,v=t[m];if(v==="[]"&&r.parseArrays)Qr.isOverflow(d)?h=d:h=r.allowEmptyArrays&&(d===""||r.strictNullHandling&&d===null)?[]:Qr.combine([],d,r.arrayLimit,r.plainObjects);else{h=r.plainObjects?{__proto__:null}:{};var _=v.charAt(0)==="["&&v.charAt(v.length-1)==="]"?v.slice(1,-1):v,x=r.decodeDotInKeys?_.replace(/%2E/g,"."):_,T=parseInt(x,10),P=!isNaN(T)&&v!==x&&String(T)===x&&T>=0&&r.parseArrays;if(!r.parseArrays&&x==="")h={0:d};else if(P&&T<r.arrayLimit)h=[],h[T]=d;else{if(P&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");P?(h[T]=d,Qr.markOverflow(h,T)):x!=="__proto__"&&(h[x]=d)}}d=h}return d},"parseObject"),DL=i(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&kc.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,d=o.exec(n),m=d?n.slice(0,d.index):n,h=[];if(m){if(!r.plainObjects&&kc.call(Object.prototype,m)&&!r.allowPrototypes)return;h[h.length]=m}for(var v=0;(d=s.exec(n))!==null&&v<r.depth;){v+=1;var _=d[1].slice(1,-1);if(!r.plainObjects&&kc.call(Object.prototype,_)&&!r.allowPrototypes)return;h[h.length]=d[1]}if(d){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");h[h.length]="["+n.slice(d.index)+"]"}return h},"splitKeyIntoSegments"),$L=i(function(e,r,n,o){if(e){var s=DL(e,n);if(s)return RL(s,r,n,o)}},"parseQueryStringKeys"),OL=i(function(e){if(!e)return ct;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"?ct.charset:e.charset,n=typeof e.duplicates>"u"?ct.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:ct.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ct.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:ct.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:ct.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:ct.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ct.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:ct.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:ct.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:ct.decoder,delimiter:typeof e.delimiter=="string"||Qr.isRegExp(e.delimiter)?e.delimiter:ct.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:ct.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:ct.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:ct.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:ct.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:ct.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:ct.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ct.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");fE.exports=function(t,e){var r=OL(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?AL(t,r):t,o=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),d=0;d<s.length;++d){var m=s[d],h=$L(m,n[m],r,typeof t=="string");o=Qr.merge(o,h,r)}return r.allowSparse===!0?o:Qr.compact(o)}});var Pm=L((lre,hE)=>{"use strict";var CL=dE(),NL=mE(),kL=Oc();hE.exports={formats:kL,parse:NL,stringify:CL}});var yE=L((bm,gE)=>{(function(t,e){typeof bm=="object"?gE.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(bm,function(){function t(){}return i(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,o){var s=e[n],d=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),o&&o!=="*"&&(s=s.substring(0,parseInt(o,10))),d.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(o==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(h){d.push(this.encodeValue(r,h,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(h){this.isDefined(s[h])&&d.push(this.encodeValue(r,s[h],h))},this);else{var m=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(h){m.push(this.encodeValue(r,h))},this):Object.keys(s).forEach(function(h){this.isDefined(s[h])&&(m.push(this.encodeUnreserved(h)),m.push(this.encodeValue(r,s[h].toString())))},this),this.isKeyOperator(r)?d.push(this.encodeUnreserved(n)+"="+m.join(",")):m.length!==0&&d.push(m.join(","))}else r===";"?this.isDefined(s)&&d.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?d.push(this.encodeUnreserved(n)+"="):s===""&&d.push("");return d},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:i(function(o){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,d,m){if(d){var h=null,v=[];if(n.indexOf(d.charAt(0))!==-1&&(h=d.charAt(0),d=d.substr(1)),d.split(/,/g).forEach(function(x){var T=/([^:\*]*)(?::(\d+)|(\*))?/.exec(x);v.push.apply(v,r.getValues(o,h,T[1],T[2]||T[3]))}),h&&h!=="+"){var _=",";return h==="?"?_="&":h!=="#"&&(_=h),(v.length!==0?h:"")+v.join(_)}else return v.join(",")}else return r.encodeReserved(m)})},"expand")}},new t})});var vE=L(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.isBrowser=zL;function zL(){return typeof window<"u"}i(zL,"isBrowser")});var Uc=L(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.headersToClassicHeaders=_E;zc.marshallGaxiosResponse=UL;function _E(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}i(_E,"headersToClassicHeaders");function UL(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:_E(t?.headers)}})}i(UL,"marshallGaxiosResponse")});var bE=L(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.sessions=void 0;ur.request=JL;ur.closeSession=Sm;var PE=require("http2"),ML=require("zlib"),FL=require("url"),LL=Pm(),jL=da(),qL=require("stream"),BL=require("util"),VL=require("process"),GL=Uc(),{HTTP2_HEADER_CONTENT_ENCODING:HL,HTTP2_HEADER_CONTENT_TYPE:wE,HTTP2_HEADER_METHOD:WL,HTTP2_HEADER_PATH:ZL,HTTP2_HEADER_STATUS:KL}=PE.constants,Xa=!!VL.env.HTTP2_DEBUG;ur.sessions={};async function JL(t){let e=jL(!0,{},t);e.validateStatus=e.validateStatus||YL,e.responseType=e.responseType||"json";let r=new FL.URL(e.url),n=XL(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let o=r.pathname;if(t.params&&Object.keys(t.params).length>0){let x=(t.paramsSerializer||LL.stringify)(e.params);o+=`?${x}`}let s=(0,GL.headersToClassicHeaders)(e.headers);s[ZL]=o,s[WL]=t.method||"GET",e.headers=s,s[wE]||e.responseType!=="text"&&(s[wE]="application/json");let d={config:t,headers:{},status:0,data:{},statusText:""},m=[],h=n.session,v;return new Promise((_,x)=>{try{v=h.request(s).on("response",T=>{Object.assign(d,{headers:T,status:T[KL]});let P=v;if(T[HL]==="gzip"&&(P=v.pipe(ML.createGunzip())),e.responseType==="stream"){d.data=P,_(d);return}P.on("data",S=>{m.push(S)}).on("error",S=>{x(S)}).on("end",()=>{let S=Buffer.concat(m),D=S;if(S){if(e.responseType==="json")try{D=JSON.parse(S.toString("utf8"))}catch{D=S.toString("utf8")}else e.responseType==="text"?D=S.toString("utf8"):e.responseType==="arraybuffer"&&(D=S.buffer);d.data=D}if(!e.validateStatus(d.status)){let E=`Request failed with status code ${d.status}. `;if(d.data&&typeof d.data=="object"){let u=BL.inspect(d.data,{depth:5});E=`${E}
|
|
59
|
+
'${u}`}x(new Error(E,{cause:d}))}_(d)})}).on("error",T=>{x(T)})}catch(T){Sm(r).then(()=>x(T)).catch(x);return}if(d.request=v,t.data){if(t.data instanceof qL.Stream)t.data.pipe(v);else if(typeof t.data=="string"){let T=Buffer.from(t.data);v.end(T)}else if(typeof t.data=="object"){let T=JSON.stringify(t.data);v.end(T)}}n.timeoutHandle=setTimeout(()=>Sm(r),500)})}i(JL,"request");function YL(t){return t>=200&&t<300}i(YL,"validateStatus");function XL(t){if(ur.sessions[t])Xa&&console.log(`Used cached client for ${t}`);else{Xa&&console.log(`Creating client for ${t}`);let e=PE.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete ur.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete ur.sessions[t]}),ur.sessions[t]={session:e}}return ur.sessions[t]}i(XL,"_getClient");async function Sm(t){let e=ur.sessions[t.host];if(!e)return;let{session:r}=e;delete ur.sessions[t.host],Xa&&console.error(`Closing ${t.host}`),r.close(()=>{Xa&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(Xa&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}i(Sm,"closeSession")});var TE=L((vre,QL)=>{QL.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 Mc=L(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.createAPIRequest=ij;var Em=gt(),ej=Pm(),AE=require("stream"),SE=yE(),EE=da(),Im=vE(),tj=bE(),xm=Uc(),RE=TE(),xE=i(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function rj(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}i(rj,"isReadableStream");function nj(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}i(nj,"getMissingParams");function ij(t,e){if(e)IE(t).then(r=>e(null,r),e);else return IE(t)}i(ij,"createAPIRequest");async function IE(t){let e=EE(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=EE(!0,{},e.params,t.params);e.userAgentDirectives=e.userAgentDirectives||[];let n=r.media||{},o=r.requestBody;!r.requestBody&&r.resource&&(!t.requiredParams.includes("resource")||typeof r.resource!="string")&&(o=r.resource,delete r.resource),delete r.requestBody;let s=r.auth||e.auth,d=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let m=(0,xm.headersToClassicHeaders)(r.headers||{});oj(m,e.apiVersion),delete r.headers,Object.keys(r).forEach(P=>{if(P.slice(-1)==="_"){let S=P.slice(0,-1);r[S]=r[P],delete r[P]}});let h=nj(r,t.requiredParams);if(h)throw new Error("Missing required parameters: "+h.join(", "));if(e.url){let P=e.url;typeof P=="object"&&(P=P.toString()),e.url=SE.parse(P).expand(r)}if(t.mediaUrl&&(t.mediaUrl=SE.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let P=new URL(e.url),S=P.href.substr(P.origin.length);e.url=new URL(S,t.context._options.rootUrl).href}e.paramsSerializer=P=>ej.stringify(P,{arrayFormat:"repeat"}),t.pathParams.forEach(P=>delete r[P]),typeof s=="string"&&(r.key=r.key||s,s=void 0);function v(P){let S=xE(),D=`--${S}--`,E=new AE.PassThrough({flush(c){this.push(`\r
|
|
60
|
+
`),this.push(D),c()}}),u=new Am,f=rj(P[1].body);m["content-type"]=`multipart/related; boundary=${S}`;for(let c of P){let y=`--${S}\r
|
|
61
61
|
content-type: ${c["content-type"]}\r
|
|
62
62
|
\r
|
|
63
63
|
`;E.push(y),typeof c.body=="string"?(E.push(c.body),E.push(`\r
|
|
64
|
-
`)):(u.on("progress",l=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:l})}),c.body.pipe(u).pipe(E))}f||(E.push(D),E.push(null)),e.data=E}i(v,"multipartUpload");function _(P){let S=
|
|
64
|
+
`)):(u.on("progress",l=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:l})}),c.body.pipe(u).pipe(E))}f||(E.push(D),E.push(null)),e.data=E}i(v,"multipartUpload");function _(P){let S=xE(),D=`--${S}--`;m["content-type"]=`multipart/related; boundary=${S}`;let E="";for(let u of P){let f=`--${S}\r
|
|
65
65
|
content-type: ${u["content-type"]}\r
|
|
66
66
|
\r
|
|
67
67
|
`;E+=f,typeof u.body=="string"&&(E+=u.body,E+=`\r
|
|
68
|
-
`)}E+=D,e.data=E}if(i(_,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,o){r.uploadType="multipart";let P=[{"content-type":"application/json",body:JSON.stringify(o)},{"content-type":n.mimeType||o&&o.mimeType||d,body:n.body}];(0,Im.isBrowser)()?_(P):v(P)}else r.uploadType="media",Object.assign(m,{"content-type":n.mimeType||d}),e.data=n.body;else e.data=o||void 0;if(e.headers=Em.Gaxios.mergeHeaders(e.headers||{},m),e.params=r,!(0,Im.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:IE.version,comment:"gzip"});let P=e.userAgentDirectives.map(S=>{let D=`${S.product}/${S.version}`;return S.comment&&(D+=` (${S.comment})`),D}).join(" ");e.headers.set("User-Agent",P)}if(e.validateStatus||(e.validateStatus=P=>P>=200&&P<300||P===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 x=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,T=e.universeDomain??e.universe_domain??x??"googleapis.com";if(T!=="googleapis.com"&&e.url){let P=new URL(e.url);P.hostname.endsWith(".googleapis.com")&&(P.hostname=P.hostname.replace(/googleapis\.com$/,T),e.url=P.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let P=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(P&&T!==P)throw new Error(`The configured universe domain (${T}) does not match the universe domain found in the credentials (${P}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let S=await s.getRequestHeaders(e.url),D=Object.assign({},e);return D.headers=Em.Gaxios.mergeHeaders(D.headers,S),YL.request(D)}else{let S=await s.request(e);return(0,xm.marshallGaxiosResponse)(S)}}else return new Em.Gaxios().request(e).then(P=>(0,xm.marshallGaxiosResponse)(P))}i(EE,"createAPIRequestAsync");var Am=class extends xE.Transform{static{i(this,"ProgressStream")}bytesRead=0;_transform(e,r,n){this.bytesRead+=e.length,this.emit("progress",this.bytesRead),this.push(e),n()}};function tj(t,e){(0,Im.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${IE.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}i(tj,"populateAPIHeader")});var AE=L(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.AuthPlus=void 0;var bn=qa(),Dm=class extends bn.GoogleAuth{static{i(this,"AuthPlus")}JWT=bn.JWT;Compute=bn.Compute;OAuth2=bn.OAuth2Client;GoogleAuth=bn.GoogleAuth;AwsClient=bn.AwsClient;IdentityPoolClient=bn.IdentityPoolClient;ExternalAccountClient=bn.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new bn.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()}};Fc.AuthPlus=Dm});var Om=L(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.Endpoint=void 0;var RE=Mc(),$m=class{static{i(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,o){if(this.applyMethodsFromSchema(e,r,n,o),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let d=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,d,o)}}}applyMethodsFromSchema(e,r,n,o){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let d=n.methods[s];e[s]=this.makeMethod(r,d,o)}}}makeMethod(e,r,n){return(o,s)=>{let d=typeof o=="function"?{}:o;s=typeof o=="function"?o:s;let m=DE(e.rootUrl+e.servicePath+r.path),h={options:{url:m.substring(1,m.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:d,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 v=DE(e.rootUrl+r.mediaUpload.protocols.simple.path);h.mediaUrl=v.substring(1,v.length-1)}if(!s)return(0,RE.createAPIRequest)(h);(0,RE.createAPIRequest)(h,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}};Lc.Endpoint=$m;function DE(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}i(DE,"buildurl")});var OE=L(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.Discovery=void 0;var rj=require("fs"),nj=gt(),ij=require("url"),$E=require("util"),oj=Mc(),aj=Om(),sj=$E.promisify(rj.readFile),Cm=class{static{i(this,"Discovery")}transporter=new nj.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new aj.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"}),o=(await this.transporter.request({url:e,headers:r})).data.items,s=await Promise.all(o.map(async h=>{let v=await this.discoverAPI(h.discoveryRestUrl);return{api:h,endpointCreator:v}})),d={},m={};for(let h of s)m[h.api.name]||(d[h.api.name]={},m[h.api.name]=v=>{let _=typeof v,x;if(_==="string")x=v,v={};else if(_==="object")x=v.version,delete v.version;else throw new Error("Argument error: Accepts only string or object");try{let T=h.endpointCreator(v,this);return Object.freeze(T)}catch(T){throw new Error($E.format('Unable to load endpoint %s("%s"): %s',h.api.name,x,T.message))}}),d[h.api.name][h.api.version]=h.endpointCreator;return m}async discoverAPI(e){if(typeof e=="string"){let r=ij.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await sj(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 o={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},s=await(0,oj.createAPIRequest)(o);return this.makeEndpoint(s.data)}}};jc.Discovery=Cm});var Qa=L(Ce=>{"use strict";var uj=Ce&&Ce.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cj=Ce&&Ce.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uj(e,t,r)};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.Endpoint=Ce.Discovery=Ce.AuthPlus=Ce.createAPIRequest=Ce.getAPI=Ce.GaxiosError=Ce.Gaxios=Ce.AwsClient=Ce.IdentityPoolClient=Ce.BaseExternalAccountClient=Ce.ExternalAccountClient=Ce.GoogleAuth=Ce.UserRefreshClient=Ce.Compute=Ce.JWT=Ce.OAuth2Client=Ce.gaxios=Ce.googleAuthLibrary=void 0;Ce.googleAuthLibrary=qa();Ce.gaxios=gt();var Tn=qa();Object.defineProperty(Ce,"OAuth2Client",{enumerable:!0,get:i(function(){return Tn.OAuth2Client},"get")});Object.defineProperty(Ce,"JWT",{enumerable:!0,get:i(function(){return Tn.JWT},"get")});Object.defineProperty(Ce,"Compute",{enumerable:!0,get:i(function(){return Tn.Compute},"get")});Object.defineProperty(Ce,"UserRefreshClient",{enumerable:!0,get:i(function(){return Tn.UserRefreshClient},"get")});Object.defineProperty(Ce,"GoogleAuth",{enumerable:!0,get:i(function(){return Tn.GoogleAuth},"get")});Object.defineProperty(Ce,"ExternalAccountClient",{enumerable:!0,get:i(function(){return Tn.ExternalAccountClient},"get")});Object.defineProperty(Ce,"BaseExternalAccountClient",{enumerable:!0,get:i(function(){return Tn.BaseExternalAccountClient},"get")});Object.defineProperty(Ce,"IdentityPoolClient",{enumerable:!0,get:i(function(){return Tn.IdentityPoolClient},"get")});Object.defineProperty(Ce,"AwsClient",{enumerable:!0,get:i(function(){return Tn.AwsClient},"get")});var CE=gt();Object.defineProperty(Ce,"Gaxios",{enumerable:!0,get:i(function(){return CE.Gaxios},"get")});Object.defineProperty(Ce,"GaxiosError",{enumerable:!0,get:i(function(){return CE.GaxiosError},"get")});var lj=TS();Object.defineProperty(Ce,"getAPI",{enumerable:!0,get:i(function(){return lj.getAPI},"get")});var dj=Mc();Object.defineProperty(Ce,"createAPIRequest",{enumerable:!0,get:i(function(){return dj.createAPIRequest},"get")});var pj=AE();Object.defineProperty(Ce,"AuthPlus",{enumerable:!0,get:i(function(){return pj.AuthPlus},"get")});var fj=OE();Object.defineProperty(Ce,"Discovery",{enumerable:!0,get:i(function(){return fj.Discovery},"get")});var mj=Om();Object.defineProperty(Ce,"Endpoint",{enumerable:!0,get:i(function(){return mj.Endpoint},"get")});cj(Uc(),Ce)});var kE=L(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.drive_v2=void 0;var B=Qa(),NE;(function(t){class e{static{i(this,"Drive")}context;about;apps;changes;channels;children;comments;drives;files;parents;permissions;properties;replies;revisions;teamdrives;constructor(u,f){this.context={_options:u||{},google:f},this.about=new r(this.context),this.apps=new n(this.context),this.changes=new o(this.context),this.channels=new s(this.context),this.children=new d(this.context),this.comments=new m(this.context),this.drives=new h(this.context),this.files=new v(this.context),this.parents=new _(this.context),this.permissions=new x(this.context),this.properties=new T(this.context),this.replies=new P(this.context),this.revisions=new S(this.context),this.teamdrives=new D(this.context)}}t.Drive=e;class r{static{i(this,"Resource$About")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/about").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$About=r;class n{static{i(this,"Resource$Apps")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/apps/{appId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["appId"],pathParams:["appId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/apps").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Apps=n;class o{static{i(this,"Resource$Changes")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes/{changeId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["changeId"],pathParams:["changeId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}getStartPageToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes/startPageToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Changes=o;class s{static{i(this,"Resource$Channels")}context;constructor(u){this.context=u}stop(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Channels=s;class d{static{i(this,"Resource$Children")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children/{childId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["folderId","childId"],pathParams:["childId","folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children/{childId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["folderId","childId"],pathParams:["childId","folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["folderId"],pathParams:["folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["folderId"],pathParams:["folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Children=d;class m{static{i(this,"Resource$Comments")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Comments=m;class h{static{i(this,"Resource$Drives")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}hide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}/hide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}unhide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}/unhide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Drives=h;class v{static{i(this,"Resource$Files")}context;constructor(u){this.context=u}copy(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/copy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}emptyTrash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/trash").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}export(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/export").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","mimeType"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}generateCseToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/generateCseToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}generateIds(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/generateIds").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}listLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/listLabels").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}modifyLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/modifyLabels").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}touch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/touch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}trash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/trash").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}untrash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/untrash").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Files=v;class _{static{i(this,"Resource$Parents")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents/{parentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","parentId"],pathParams:["fileId","parentId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents/{parentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","parentId"],pathParams:["fileId","parentId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Parents=_;class x{static{i(this,"Resource$Permissions")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}getIdForEmail(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/permissionIds/{email}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["email"],pathParams:["email"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Permissions=x;class T{static{i(this,"Resource$Properties")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Properties=T;class P{static{i(this,"Resource$Replies")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Replies=P;class S{static{i(this,"Resource$Revisions")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Revisions=S;class D{static{i(this,"Resource$Teamdrives")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Teamdrives=D})(NE||(qc.drive_v2=NE={}))});var UE=L(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.drive_v3=void 0;var Z=Qa(),zE;(function(t){class e{static{i(this,"Drive")}context;about;accessproposals;approvals;apps;changes;channels;comments;drives;files;operations;permissions;replies;revisions;teamdrives;constructor(u,f){this.context={_options:u||{},google:f},this.about=new r(this.context),this.accessproposals=new n(this.context),this.approvals=new o(this.context),this.apps=new s(this.context),this.changes=new d(this.context),this.channels=new m(this.context),this.comments=new h(this.context),this.drives=new v(this.context),this.files=new _(this.context),this.operations=new x(this.context),this.permissions=new T(this.context),this.replies=new P(this.context),this.revisions=new S(this.context),this.teamdrives=new D(this.context)}}t.Drive=e;class r{static{i(this,"Resource$About")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/about").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$About=r;class n{static{i(this,"Resource$Accessproposals")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/accessproposals/{proposalId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","proposalId"],pathParams:["fileId","proposalId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/accessproposals").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}resolve(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/accessproposals/{proposalId}:resolve").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","proposalId"],pathParams:["fileId","proposalId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Accessproposals=n;class o{static{i(this,"Resource$Approvals")}context;constructor(u){this.context=u}approve(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:approve").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}cancel(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:cancel").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}comment(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:comment").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}decline(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:decline").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}reassign(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:reassign").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}start(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals:start").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Approvals=o;class s{static{i(this,"Resource$Apps")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/apps/{appId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["appId"],pathParams:["appId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/apps").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Apps=s;class d{static{i(this,"Resource$Changes")}context;constructor(u){this.context=u}getStartPageToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/changes/startPageToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/changes").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["pageToken"],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/changes/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["pageToken"],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Changes=d;class m{static{i(this,"Resource$Channels")}context;constructor(u){this.context=u}stop(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Channels=m;class h{static{i(this,"Resource$Comments")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Comments=h;class v{static{i(this,"Resource$Drives")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}hide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}/hide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}unhide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}/unhide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Drives=v;class _{static{i(this,"Resource$Files")}context;constructor(u){this.context=u}copy(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/copy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}download(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/download").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}emptyTrash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/trash").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}export(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/export").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","mimeType"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}generateCseToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/generateCseToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}generateIds(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/generateIds").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}listLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/listLabels").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}modifyLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/modifyLabels").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Files=_;class x{static{i(this,"Resource$Operations")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/operations/{name}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["name"],pathParams:["name"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Operations=x;class T{static{i(this,"Resource$Permissions")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Permissions=T;class P{static{i(this,"Resource$Replies")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Replies=P;class S{static{i(this,"Resource$Revisions")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Revisions=S;class D{static{i(this,"Resource$Teamdrives")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Teamdrives=D})(zE||(Bc.drive_v3=zE={}))});var $e=L(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.AuthPlus=Gt.drive_v3=Gt.drive_v2=Gt.auth=Gt.VERSIONS=void 0;Gt.drive=hj;var ME=Qa(),FE=kE();Object.defineProperty(Gt,"drive_v2",{enumerable:!0,get:i(function(){return FE.drive_v2},"get")});var LE=UE();Object.defineProperty(Gt,"drive_v3",{enumerable:!0,get:i(function(){return LE.drive_v3},"get")});Gt.VERSIONS={v2:FE.drive_v2.Drive,v3:LE.drive_v3.Drive};function hj(t){return(0,ME.getAPI)("drive",t,Gt.VERSIONS,this)}i(hj,"drive");var gj=new ME.AuthPlus;Gt.auth=gj;var yj=Qa();Object.defineProperty(Gt,"AuthPlus",{enumerable:!0,get:i(function(){return yj.AuthPlus},"get")})});var es=L((Nm,km)=>{(function(t,e){typeof Nm=="object"&&typeof km<"u"?km.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Nm,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",o="second",s="minute",d="hour",m="day",h="week",v="month",_="quarter",x="year",T="date",P="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|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,E={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:i(function(se){var X=["th","st","nd","rd"],Y=se%100;return"["+se+(X[(Y-20)%10]||X[Y]||X[0])+"]"},"ordinal")},u=i(function(se,X,Y){var ne=String(se);return!ne||ne.length>=X?se:""+Array(X+1-ne.length).join(Y)+se},"m"),f={s:u,z:i(function(se){var X=-se.utcOffset(),Y=Math.abs(X),ne=Math.floor(Y/60),ee=Y%60;return(X<=0?"+":"-")+u(ne,2,"0")+":"+u(ee,2,"0")},"z"),m:i(function se(X,Y){if(X.date()<Y.date())return-se(Y,X);var ne=12*(Y.year()-X.year())+(Y.month()-X.month()),ee=X.clone().add(ne,v),ce=Y-ee<0,de=X.clone().add(ne+(ce?-1:1),v);return+(-(ne+(Y-ee)/(ce?ee-de:de-ee))||0)},"t"),a:i(function(se){return se<0?Math.ceil(se)||0:Math.floor(se)},"a"),p:i(function(se){return{M:v,y:x,w:h,d:m,D:T,h:d,m:s,s:o,ms:n,Q:_}[se]||String(se||"").toLowerCase().replace(/s$/,"")},"p"),u:i(function(se){return se===void 0},"u")},c="en",y={};y[c]=E;var l=i(function(se){return se instanceof re},"p"),b=i(function se(X,Y,ne){var ee;if(!X)return c;if(typeof X=="string"){var ce=X.toLowerCase();y[ce]&&(ee=ce),Y&&(y[ce]=Y,ee=ce);var de=X.split("-");if(!ee&&de.length>1)return se(de[0])}else{var ke=X.name;y[ke]=X,ee=ke}return!ne&&ee&&(c=ee),ee||!ne&&c},"t"),g=i(function(se,X){if(l(se))return se.clone();var Y=typeof X=="object"?X:{};return Y.date=se,Y.args=arguments,new re(Y)},"w"),ae=f;ae.l=b,ae.i=l,ae.w=function(se,X){return g(se,{locale:X.$L,utc:X.$u,x:X.$x,$offset:X.$offset})};var re=(function(){function se(Y){this.$L=b(Y.locale,null,!0),this.parse(Y)}i(se,"M");var X=se.prototype;return X.parse=function(Y){this.$d=(function(ne){var ee=ne.date,ce=ne.utc;if(ee===null)return new Date(NaN);if(ae.u(ee))return new Date;if(ee instanceof Date)return new Date(ee);if(typeof ee=="string"&&!/Z$/i.test(ee)){var de=ee.match(S);if(de){var ke=de[2]-1||0,Me=(de[7]||"0").substring(0,3);return ce?new Date(Date.UTC(de[1],ke,de[3]||1,de[4]||0,de[5]||0,de[6]||0,Me)):new Date(de[1],ke,de[3]||1,de[4]||0,de[5]||0,de[6]||0,Me)}}return new Date(ee)})(Y),this.$x=Y.x||{},this.init()},X.init=function(){var Y=this.$d;this.$y=Y.getFullYear(),this.$M=Y.getMonth(),this.$D=Y.getDate(),this.$W=Y.getDay(),this.$H=Y.getHours(),this.$m=Y.getMinutes(),this.$s=Y.getSeconds(),this.$ms=Y.getMilliseconds()},X.$utils=function(){return ae},X.isValid=function(){return this.$d.toString()!==P},X.isSame=function(Y,ne){var ee=g(Y);return this.startOf(ne)<=ee&&ee<=this.endOf(ne)},X.isAfter=function(Y,ne){return g(Y)<this.startOf(ne)},X.isBefore=function(Y,ne){return this.endOf(ne)<g(Y)},X.$g=function(Y,ne,ee){return ae.u(Y)?this[ne]:this.set(ee,Y)},X.unix=function(){return Math.floor(this.valueOf()/1e3)},X.valueOf=function(){return this.$d.getTime()},X.startOf=function(Y,ne){var ee=this,ce=!!ae.u(ne)||ne,de=ae.p(Y),ke=i(function(Ht,Ze){var Je=ae.w(ee.$u?Date.UTC(ee.$y,Ze,Ht):new Date(ee.$y,Ze,Ht),ee);return ce?Je:Je.endOf(m)},"l"),Me=i(function(Ht,Ze){return ae.w(ee.toDate()[Ht].apply(ee.toDate("s"),(ce?[0,0,0,0]:[23,59,59,999]).slice(Ze)),ee)},"$"),Ke=this.$W,Qe=this.$M,Tt=this.$D,ie="set"+(this.$u?"UTC":"");switch(de){case x:return ce?ke(1,0):ke(31,11);case v:return ce?ke(1,Qe):ke(0,Qe+1);case h:var lt=this.$locale().weekStart||0,ft=(Ke<lt?Ke+7:Ke)-lt;return ke(ce?Tt-ft:Tt+(6-ft),Qe);case m:case T:return Me(ie+"Hours",0);case d:return Me(ie+"Minutes",1);case s:return Me(ie+"Seconds",2);case o:return Me(ie+"Milliseconds",3);default:return this.clone()}},X.endOf=function(Y){return this.startOf(Y,!1)},X.$set=function(Y,ne){var ee,ce=ae.p(Y),de="set"+(this.$u?"UTC":""),ke=(ee={},ee[m]=de+"Date",ee[T]=de+"Date",ee[v]=de+"Month",ee[x]=de+"FullYear",ee[d]=de+"Hours",ee[s]=de+"Minutes",ee[o]=de+"Seconds",ee[n]=de+"Milliseconds",ee)[ce],Me=ce===m?this.$D+(ne-this.$W):ne;if(ce===v||ce===x){var Ke=this.clone().set(T,1);Ke.$d[ke](Me),Ke.init(),this.$d=Ke.set(T,Math.min(this.$D,Ke.daysInMonth())).$d}else ke&&this.$d[ke](Me);return this.init(),this},X.set=function(Y,ne){return this.clone().$set(Y,ne)},X.get=function(Y){return this[ae.p(Y)]()},X.add=function(Y,ne){var ee,ce=this;Y=Number(Y);var de=ae.p(ne),ke=i(function(Qe){var Tt=g(ce);return ae.w(Tt.date(Tt.date()+Math.round(Qe*Y)),ce)},"y");if(de===v)return this.set(v,this.$M+Y);if(de===x)return this.set(x,this.$y+Y);if(de===m)return ke(1);if(de===h)return ke(7);var Me=(ee={},ee[s]=e,ee[d]=r,ee[o]=t,ee)[de]||1,Ke=this.$d.getTime()+Y*Me;return ae.w(Ke,this)},X.subtract=function(Y,ne){return this.add(-1*Y,ne)},X.format=function(Y){var ne=this,ee=this.$locale();if(!this.isValid())return ee.invalidDate||P;var ce=Y||"YYYY-MM-DDTHH:mm:ssZ",de=ae.z(this),ke=this.$H,Me=this.$m,Ke=this.$M,Qe=ee.weekdays,Tt=ee.months,ie=ee.meridiem,lt=i(function(Ze,Je,A,$){return Ze&&(Ze[Je]||Ze(ne,ce))||A[Je].slice(0,$)},"h"),ft=i(function(Ze){return ae.s(ke%12||12,Ze,"0")},"d"),Ht=ie||function(Ze,Je,A){var $=Ze<12?"AM":"PM";return A?$.toLowerCase():$};return ce.replace(D,(function(Ze,Je){return Je||(function(A){switch(A){case"YY":return String(ne.$y).slice(-2);case"YYYY":return ae.s(ne.$y,4,"0");case"M":return Ke+1;case"MM":return ae.s(Ke+1,2,"0");case"MMM":return lt(ee.monthsShort,Ke,Tt,3);case"MMMM":return lt(Tt,Ke);case"D":return ne.$D;case"DD":return ae.s(ne.$D,2,"0");case"d":return String(ne.$W);case"dd":return lt(ee.weekdaysMin,ne.$W,Qe,2);case"ddd":return lt(ee.weekdaysShort,ne.$W,Qe,3);case"dddd":return Qe[ne.$W];case"H":return String(ke);case"HH":return ae.s(ke,2,"0");case"h":return ft(1);case"hh":return ft(2);case"a":return Ht(ke,Me,!0);case"A":return Ht(ke,Me,!1);case"m":return String(Me);case"mm":return ae.s(Me,2,"0");case"s":return String(ne.$s);case"ss":return ae.s(ne.$s,2,"0");case"SSS":return ae.s(ne.$ms,3,"0");case"Z":return de}return null})(Ze)||de.replace(":","")}))},X.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},X.diff=function(Y,ne,ee){var ce,de=this,ke=ae.p(ne),Me=g(Y),Ke=(Me.utcOffset()-this.utcOffset())*e,Qe=this-Me,Tt=i(function(){return ae.m(de,Me)},"D");switch(ke){case x:ce=Tt()/12;break;case v:ce=Tt();break;case _:ce=Tt()/3;break;case h:ce=(Qe-Ke)/6048e5;break;case m:ce=(Qe-Ke)/864e5;break;case d:ce=Qe/r;break;case s:ce=Qe/e;break;case o:ce=Qe/t;break;default:ce=Qe}return ee?ce:ae.a(ce)},X.daysInMonth=function(){return this.endOf(v).$D},X.$locale=function(){return y[this.$L]},X.locale=function(Y,ne){if(!Y)return this.$L;var ee=this.clone(),ce=b(Y,ne,!0);return ce&&(ee.$L=ce),ee},X.clone=function(){return ae.w(this.$d,this)},X.toDate=function(){return new Date(this.valueOf())},X.toJSON=function(){return this.isValid()?this.toISOString():null},X.toISOString=function(){return this.$d.toISOString()},X.toString=function(){return this.$d.toUTCString()},se})(),Ue=re.prototype;return g.prototype=Ue,[["$ms",n],["$s",o],["$m",s],["$H",d],["$W",m],["$M",v],["$y",x],["$D",T]].forEach((function(se){Ue[se[1]]=function(X){return this.$g(X,se[0],se[1])}})),g.extend=function(se,X){return se.$i||(se(X,re,g),se.$i=!0),g},g.locale=b,g.isDayjs=l,g.unix=function(se){return g(1e3*se)},g.en=y[c],g.Ls=y,g.p={},g}))});var qj={};Rs(qj,{createGoogleClient:()=>oe,getAccessToken:()=>it,googleDrive:()=>jj,googleDriveAuth:()=>J});module.exports=K0(qj);var J0=Object.freeze({status:"aborted"});function fe(t,e,r){function n(m,h){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:h,constr:d,traits:new Set},enumerable:!1}),m._zod.traits.has(t))return;m._zod.traits.add(t),e(m,h);let v=d.prototype,_=Object.keys(v);for(let x=0;x<_.length;x++){let T=_[x];T in m||(m[T]=v[T].bind(m))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function d(m){var h;let v=r?.Parent?new s:this;n(v,m),(h=v._zod).deferred??(h.deferred=[]);for(let _ of v._zod.deferred)_();return v}return i(d,"_"),Object.defineProperty(d,"init",{value:n}),Object.defineProperty(d,Symbol.hasInstance,{value:i(m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(t),"value")}),Object.defineProperty(d,"name",{value:t}),d}i(fe,"$constructor");var zr=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ds=class extends Error{static{i(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Tl={};function un(t){return t&&Object.assign(Tl,t),Tl}i(un,"config");function El(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}i(El,"getEnumValues");function Vh(t,e){return typeof e=="bigint"?e.toString():e}i(Vh,"jsonStringifyReplacer");function Os(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Os,"cached");function Gh(t){return t==null}i(Gh,"nullish");function Cs(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}i(Cs,"cleanRegex");var Bh=Symbol("evaluating");function yt(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Bh)return n===void 0&&(n=Bh,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}i(yt,"defineLazy");var xl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Lo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}i(Lo,"isObject");var Y0=Os(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Hh(t){if(Lo(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Lo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(Hh,"isPlainObject");var Wh=new Set(["string","number","symbol"]);function Mi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Mi,"escapeRegex");function Ns(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}i(Ns,"clone");function at(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:i(()=>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:i(()=>e.error,"error")}:e}i(at,"normalizeParams");function Zh(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}i(Zh,"optionalKeys");var Kh={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 Fi(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}i(Fi,"aborted");function On(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}i(On,"prefixIssues");function $s(t){return typeof t=="string"?t:t?.message}i($s,"unwrapMessage");function Cn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=$s(t.inst?._zod.def?.error?.(t))??$s(e?.error?.(t))??$s(r.customError?.(t))??$s(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}i(Cn,"finalizeIssue");function Jh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}i(Jh,"getLengthableOrigin");function Il(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}i(Il,"issue");var Yh=i((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,Vh,2),Object.defineProperty(t,"toString",{value:i(()=>t.message,"value"),enumerable:!1})},"initializer"),Xh=fe("$ZodError",Yh),jo=fe("$ZodError",Yh,{Parent:Error});var Q0=i(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},d=e._zod.run({value:r,issues:[]},s);if(d instanceof Promise)throw new zr;if(d.issues.length){let m=new(o?.Err??t)(d.issues.map(h=>Cn(h,s,un())));throw xl(m,o?.callee),m}return d.value},"_parse"),ks=Q0(jo),eD=i(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},d=e._zod.run({value:r,issues:[]},s);if(d instanceof Promise&&(d=await d),d.issues.length){let m=new(o?.Err??t)(d.issues.map(h=>Cn(h,s,un())));throw xl(m,o?.callee),m}return d.value},"_parseAsync"),zs=eD(jo),tD=i(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new zr;return s.issues.length?{success:!1,error:new(t??Xh)(s.issues.map(d=>Cn(d,o,un())))}:{success:!0,data:s.value}},"_safeParse"),qo=tD(jo),rD=i(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(d=>Cn(d,o,un())))}:{success:!0,data:s.value}},"_safeParseAsync"),Bo=rD(jo);var nD="(?:(?:\\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])))",iD=new RegExp(`^${nD}$`);var Qh=i(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),eg=/^-?\d+n?$/,tg=/^-?\d+$/,Al=/^-?\d+(?:\.\d+)?$/,rg=/^(?:true|false)$/i;var Nn=fe("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),oD={number:"number",bigint:"bigint",object:"date"};var ng=fe("$ZodCheckGreaterThan",(t,e)=>{Nn.init(t,e);let r=oD[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.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 ig=fe("$ZodCheckNumberFormat",(t,e)=>{Nn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=Kh[e.format];t._zod.onattach.push(d=>{let m=d._zod.bag;m.format=e.format,m.minimum=o,m.maximum=s,r&&(m.pattern=tg)}),t._zod.check=d=>{let m=d.value;if(r){if(!Number.isInteger(m)){d.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:m,inst:t});return}if(!Number.isSafeInteger(m)){m>0?d.issues.push({input:m,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}):d.issues.push({input:m,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}}m<o&&d.issues.push({origin:"number",input:m,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),m>s&&d.issues.push({origin:"number",input:m,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var og=fe("$ZodCheckMinLength",(t,e)=>{var r;Nn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Gh(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let d=Jh(o);n.issues.push({origin:d,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}});var Rl=fe("$ZodCheckStringFormat",(t,e)=>{var r,n;Nn.init(t,e),t._zod.onattach.push(o=>{let s=o._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=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),ag=fe("$ZodCheckRegex",(t,e)=>{Rl.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 ug={major:4,minor:3,patch:6};var dt=fe("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=ug;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._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 o=i((d,m,h)=>{let v=Fi(d),_;for(let x of m){if(x._zod.def.when){if(!x._zod.def.when(d))continue}else if(v)continue;let T=d.issues.length,P=x._zod.check(d);if(P instanceof Promise&&h?.async===!1)throw new zr;if(_||P instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await P,d.issues.length!==T&&(v||(v=Fi(d,T)))});else{if(d.issues.length===T)continue;v||(v=Fi(d,T))}}return _?_.then(()=>d):d},"runChecks"),s=i((d,m,h)=>{if(Fi(d))return d.aborted=!0,d;let v=o(m,n,h);if(v instanceof Promise){if(h.async===!1)throw new zr;return v.then(_=>t._zod.parse(_,h))}return t._zod.parse(v,h)},"handleCanaryResult");t._zod.run=(d,m)=>{if(m.skipChecks)return t._zod.parse(d,m);if(m.direction==="backward"){let v=t._zod.parse({value:d.value,issues:[]},{...m,skipChecks:!0});return v instanceof Promise?v.then(_=>s(_,d,m)):s(v,d,m)}let h=t._zod.parse(d,m);if(h instanceof Promise){if(m.async===!1)throw new zr;return h.then(v=>o(v,n,m))}return o(h,n,m)}}yt(t,"~standard",()=>({validate:i(o=>{try{let s=qo(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Bo(t,o).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Fs=fe("$ZodString",(t,e)=>{dt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Qh(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=fe("$ZodStringFormat",(t,e)=>{Rl.init(t,e),Fs.init(t,e)});var fg=fe("$ZodURL",(t,e)=>{Dl.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.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(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}});var $l=fe("$ZodNumber",(t,e)=>{dt.init(t,e),t._zod.pattern=t._zod.bag.pattern??Al,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),mg=fe("$ZodNumberFormat",(t,e)=>{ig.init(t,e),$l.init(t,e)}),Ol=fe("$ZodBoolean",(t,e)=>{dt.init(t,e),t._zod.pattern=rg,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),hg=fe("$ZodBigInt",(t,e)=>{dt.init(t,e),t._zod.pattern=eg,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 gg=fe("$ZodAny",(t,e)=>{dt.init(t,e),t._zod.parse=r=>r}),yg=fe("$ZodUnknown",(t,e)=>{dt.init(t,e),t._zod.parse=r=>r});var vg=fe("$ZodVoid",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),_g=fe("$ZodDate",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});function cg(t,e,r){t.issues.length&&e.issues.push(...On(r,t.issues)),e.value[r]=t.value}i(cg,"handleArrayResult");var wg=fe("$ZodArray",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let d=0;d<o.length;d++){let m=o[d],h=e.element._zod.run({value:m,issues:[]},n);h instanceof Promise?s.push(h.then(v=>cg(v,r,d))):cg(h,r,d)}return s.length?Promise.all(s).then(()=>r):r}});function Ms(t,e,r,n,o){if(t.issues.length){if(o&&!(r in n))return;e.issues.push(...On(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}i(Ms,"handlePropertyResult");function aD(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=Zh(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}i(aD,"normalizeDef");function sD(t,e,r,n,o,s){let d=[],m=o.keySet,h=o.catchall._zod,v=h.def.type,_=h.optout==="optional";for(let x in e){if(m.has(x))continue;if(v==="never"){d.push(x);continue}let T=h.run({value:e[x],issues:[]},n);T instanceof Promise?t.push(T.then(P=>Ms(P,r,x,e,_))):Ms(T,r,x,e,_)}return d.length&&r.issues.push({code:"unrecognized_keys",keys:d,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}i(sD,"handleCatchall");var Pg=fe("$ZodObject",(t,e)=>{if(dt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let m=e.shape;Object.defineProperty(e,"shape",{get:i(()=>{let h={...m};return Object.defineProperty(e,"shape",{value:h}),h},"get")})}let n=Os(()=>aD(e));yt(t._zod,"propValues",()=>{let m=e.shape,h={};for(let v in m){let _=m[v]._zod;if(_.values){h[v]??(h[v]=new Set);for(let x of _.values)h[v].add(x)}}return h});let o=Lo,s=e.catchall,d;t._zod.parse=(m,h)=>{d??(d=n.value);let v=m.value;if(!o(v))return m.issues.push({expected:"object",code:"invalid_type",input:v,inst:t}),m;m.value={};let _=[],x=d.shape;for(let T of d.keys){let P=x[T],S=P._zod.optout==="optional",D=P._zod.run({value:v[T],issues:[]},h);D instanceof Promise?_.push(D.then(E=>Ms(E,m,T,v,S))):Ms(D,m,T,v,S)}return s?sD(_,v,m,h,n.value,t):_.length?Promise.all(_).then(()=>m):m}});function lg(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let o=t.filter(s=>!Fi(s));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(d=>Cn(d,n,un())))}),e)}i(lg,"handleUnionResults");var Cl=fe("$ZodUnion",(t,e)=>{dt.init(t,e),yt(t._zod,"optin",()=>e.options.some(o=>o._zod.optin==="optional")?"optional":void 0),yt(t._zod,"optout",()=>e.options.some(o=>o._zod.optout==="optional")?"optional":void 0),yt(t._zod,"values",()=>{if(e.options.every(o=>o._zod.values))return new Set(e.options.flatMap(o=>Array.from(o._zod.values)))}),yt(t._zod,"pattern",()=>{if(e.options.every(o=>o._zod.pattern)){let o=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Cs(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(o,s)=>{if(r)return n(o,s);let d=!1,m=[];for(let h of e.options){let v=h._zod.run({value:o.value,issues:[]},s);if(v instanceof Promise)m.push(v),d=!0;else{if(v.issues.length===0)return v;m.push(v)}}return d?Promise.all(m).then(h=>lg(h,o,t,s)):lg(m,o,t,s)}});var bg=fe("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Cl.init(t,e);let r=t._zod.parse;yt(t._zod,"propValues",()=>{let o={};for(let s of e.options){let d=s._zod.propValues;if(!d||Object.keys(d).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[m,h]of Object.entries(d)){o[m]||(o[m]=new Set);for(let v of h)o[m].add(v)}}return o});let n=Os(()=>{let o=e.options,s=new Map;for(let d of o){let m=d._zod.propValues?.[e.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(d)}"`);for(let h of m){if(s.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);s.set(h,d)}}return s});t._zod.parse=(o,s)=>{let d=o.value;if(!Lo(d))return o.issues.push({code:"invalid_type",expected:"object",input:d,inst:t}),o;let m=n.value.get(d?.[e.discriminator]);return m?m._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:d,path:[e.discriminator],inst:t}),o)}});var Tg=fe("$ZodRecord",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Hh(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[],d=e.keyType._zod.values;if(d){r.value={};let m=new Set;for(let v of d)if(typeof v=="string"||typeof v=="number"||typeof v=="symbol"){m.add(typeof v=="number"?v.toString():v);let _=e.valueType._zod.run({value:o[v],issues:[]},n);_ instanceof Promise?s.push(_.then(x=>{x.issues.length&&r.issues.push(...On(v,x.issues)),r.value[v]=x.value})):(_.issues.length&&r.issues.push(...On(v,_.issues)),r.value[v]=_.value)}let h;for(let v in o)m.has(v)||(h=h??[],h.push(v));h&&h.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:h})}else{r.value={};for(let m of Reflect.ownKeys(o)){if(m==="__proto__")continue;let h=e.keyType._zod.run({value:m,issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&Al.test(m)&&h.issues.length){let x=e.keyType._zod.run({value:Number(m),issues:[]},n);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(h=x)}if(h.issues.length){e.mode==="loose"?r.value[m]=o[m]:r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(x=>Cn(x,n,un())),input:m,path:[m],inst:t});continue}let _=e.valueType._zod.run({value:o[m],issues:[]},n);_ instanceof Promise?s.push(_.then(x=>{x.issues.length&&r.issues.push(...On(m,x.issues)),r.value[h.value]=x.value})):(_.issues.length&&r.issues.push(...On(m,_.issues)),r.value[h.value]=_.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Sg=fe("$ZodEnum",(t,e)=>{dt.init(t,e);let r=El(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>Wh.has(typeof o)).map(o=>typeof o=="string"?Mi(o):o.toString()).join("|")})$`),t._zod.parse=(o,s)=>{let d=o.value;return n.has(d)||o.issues.push({code:"invalid_value",values:r,input:d,inst:t}),o}}),Eg=fe("$ZodLiteral",(t,e)=>{if(dt.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"?Mi(n):n?Mi(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var xg=fe("$ZodTransform",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(d=>(r.value=d,r));if(o instanceof Promise)throw new zr;return r.value=o,r}});function dg(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}i(dg,"handleOptionalResult");var Ig=fe("$ZodOptional",(t,e)=>{dt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",yt(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),yt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Cs(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>dg(s,r.value)):dg(o,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var Ag=fe("$ZodNullable",(t,e)=>{dt.init(t,e),yt(t._zod,"optin",()=>e.innerType._zod.optin),yt(t._zod,"optout",()=>e.innerType._zod.optout),yt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Cs(r.source)}|null)$`):void 0}),yt(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=fe("$ZodPipe",(t,e)=>{dt.init(t,e),yt(t._zod,"values",()=>e.in._zod.values),yt(t._zod,"optin",()=>e.in._zod.optin),yt(t._zod,"optout",()=>e.out._zod.optout),yt(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(d=>Us(d,e.in,n)):Us(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Us(s,e.out,n)):Us(o,e.out,n)}});function Us(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}i(Us,"handlePipeResult");var Dg=fe("$ZodCustom",(t,e)=>{Nn.init(t,e),dt.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>pg(s,r,n,t));pg(o,r,n,t)}});function pg(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(Il(o))}}i(pg,"handleRefineResult");var Og;var Nl=class{static{i(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 o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Cg(){return new Nl}i(Cg,"registry");(Og=globalThis).__zod_globalRegistry??(Og.__zod_globalRegistry=Cg());var kl=globalThis.__zod_globalRegistry;function Ng(t,e){return new t({type:"string",...at(e)})}i(Ng,"_string");function kg(t,e){return new t({type:"string",coerce:!0,...at(e)})}i(kg,"_coercedString");function zg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...at(e)})}i(zg,"_url");function Ug(t,e){return new t({type:"number",checks:[],...at(e)})}i(Ug,"_number");function Mg(t,e){return new t({type:"number",coerce:!0,checks:[],...at(e)})}i(Mg,"_coercedNumber");function Fg(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...at(e)})}i(Fg,"_int");function Lg(t,e){return new t({type:"boolean",...at(e)})}i(Lg,"_boolean");function jg(t,e){return new t({type:"boolean",coerce:!0,...at(e)})}i(jg,"_coercedBoolean");function qg(t,e){return new t({type:"bigint",coerce:!0,...at(e)})}i(qg,"_coercedBigint");function Bg(t){return new t({type:"any"})}i(Bg,"_any");function Vg(t){return new t({type:"unknown"})}i(Vg,"_unknown");function Gg(t,e){return new t({type:"void",...at(e)})}i(Gg,"_void");function Hg(t,e){return new t({type:"date",coerce:!0,...at(e)})}i(Hg,"_coercedDate");function Ls(t,e){return new ng({check:"greater_than",...at(e),value:t,inclusive:!0})}i(Ls,"_gte");function Tr(t,e){return new og({check:"min_length",...at(e),minimum:t})}i(Tr,"_minLength");function kn(t,e){return new ag({check:"string_format",format:"regex",...at(e),pattern:t})}i(kn,"_regex");function Wg(t,e,r){let n=at(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}i(Wg,"_custom");var vt=fe("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");dt.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>ks(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>qo(t,r,n),t.parseAsync=async(r,n)=>zs(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Bo(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)=>Ns(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),qs=fe("ZodMiniString",(t,e)=>{Fs.init(t,e),vt.init(t,e)});function I(t){return Ng(qs,t)}i(I,"string");var Zg=fe("ZodMiniStringFormat",(t,e)=>{Dl.init(t,e),qs.init(t,e)});var wD=fe("ZodMiniURL",(t,e)=>{fg.init(t,e),Zg.init(t,e)});function Kg(t){return zg(wD,t)}i(Kg,"url");var Bs=fe("ZodMiniNumber",(t,e)=>{$l.init(t,e),vt.init(t,e)});function Et(t){return Ug(Bs,t)}i(Et,"number");var PD=fe("ZodMiniNumberFormat",(t,e)=>{mg.init(t,e),Bs.init(t,e)});function Jg(t){return Fg(PD,t)}i(Jg,"int");var zl=fe("ZodMiniBoolean",(t,e)=>{Ol.init(t,e),vt.init(t,e)});function Ve(t){return Lg(zl,t)}i(Ve,"boolean");var Yg=fe("ZodMiniBigInt",(t,e)=>{hg.init(t,e),vt.init(t,e)});var bD=fe("ZodMiniAny",(t,e)=>{gg.init(t,e),vt.init(t,e)});function Go(){return Bg(bD)}i(Go,"any");var TD=fe("ZodMiniUnknown",(t,e)=>{yg.init(t,e),vt.init(t,e)});function Ae(){return Vg(TD)}i(Ae,"unknown");var SD=fe("ZodMiniVoid",(t,e)=>{vg.init(t,e),vt.init(t,e)});function Xg(t){return Gg(SD,t)}i(Xg,"_void");var Qg=fe("ZodMiniDate",(t,e)=>{_g.init(t,e),vt.init(t,e)});var ED=fe("ZodMiniArray",(t,e)=>{wg.init(t,e),vt.init(t,e)});function be(t,e){return new ED({type:"array",element:t,...at(e)})}i(be,"array");var xD=fe("ZodMiniObject",(t,e)=>{Pg.init(t,e),vt.init(t,e),yt(t,"shape",()=>e.shape)});function U(t,e){let r={type:"object",shape:t??{},...at(e)};return new xD(r)}i(U,"object");var ID=fe("ZodMiniUnion",(t,e)=>{Cl.init(t,e),vt.init(t,e)});function ze(t,e){return new ID({type:"union",options:t,...at(e)})}i(ze,"union");var AD=fe("ZodMiniDiscriminatedUnion",(t,e)=>{bg.init(t,e),vt.init(t,e)});function zn(t,e,r){return new AD({type:"union",options:e,discriminator:t,...at(r)})}i(zn,"discriminatedUnion");var RD=fe("ZodMiniRecord",(t,e)=>{Tg.init(t,e),vt.init(t,e)});function Re(t,e,r){return new RD({type:"record",keyType:t,valueType:e,...at(r)})}i(Re,"record");var DD=fe("ZodMiniEnum",(t,e)=>{Sg.init(t,e),vt.init(t,e),t.options=Object.values(e.entries)});function Pe(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new DD({type:"enum",entries:r,...at(e)})}i(Pe,"_enum");var $D=fe("ZodMiniLiteral",(t,e)=>{Eg.init(t,e),vt.init(t,e)});function ve(t,e){return new $D({type:"literal",values:Array.isArray(t)?t:[t],...at(e)})}i(ve,"literal");var OD=fe("ZodMiniTransform",(t,e)=>{xg.init(t,e),vt.init(t,e)});function Un(t){return new OD({type:"transform",transform:t})}i(Un,"transform");var CD=fe("ZodMiniOptional",(t,e)=>{Ig.init(t,e),vt.init(t,e)});function W(t){return new CD({type:"optional",innerType:t})}i(W,"optional");var ND=fe("ZodMiniNullable",(t,e)=>{Ag.init(t,e),vt.init(t,e)});function Ho(t){return new ND({type:"nullable",innerType:t})}i(Ho,"nullable");var kD=fe("ZodMiniPipe",(t,e)=>{Rg.init(t,e),vt.init(t,e)});function Mn(t,e){return new kD({type:"pipe",in:t,out:e})}i(Mn,"pipe");var zD=fe("ZodMiniCustom",(t,e)=>{Dg.init(t,e),vt.init(t,e)});function Vs(t,e){return Wg(zD,t??(()=>!0),e)}i(Vs,"custom");var Wo={};Rs(Wo,{bigint:()=>qD,boolean:()=>jD,date:()=>BD,number:()=>LD,string:()=>FD});function FD(t){return kg(qs,t)}i(FD,"string");function LD(t){return Mg(Bs,t)}i(LD,"number");function jD(t){return jg(zl,t)}i(jD,"boolean");function qD(t){return qg(Yg,t)}i(qD,"bigint");function BD(t){return Hg(Qg,t)}i(BD,"date");var Ml=U({retryOnFailure:U({defaultValue:W(Ve()),hide:W(Ve())}),continueOnFailure:U({defaultValue:W(Ve()),hide:W(Ve())})}),Ul=class{constructor(e,r,n,o,s,d,m,h,v,_,x,T,P){this.name=e;this.displayName=r;this.description=n;this.props=o;this.propertyGroups=s;this.run=d;this.test=m;this.requireAuth=h;this.errorHandlingOptions=v;this.outputSchema=_;this.audience=x;this.aiMetadata=T;this.classification=P}static{i(this,"IAction")}},te=i(t=>new Ul(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 qe=U({displayName:I(),description:W(I()),advanced:W(Ve()),width:W(Pe(["half","full"])),icon:W(I()),placeholder:W(I())}),De=i((t,e)=>U({type:ve(e),required:Ve(),defaultValue:W(Go())}),"TPropertyValue");var Kt=U({...qe.shape,...De(I(),"SHORT_TEXT").shape}),cn=U({...qe.shape,...De(I(),"LONG_TEXT").shape});var ty=U({label:I(),value:Ae(),description:W(I()),icon:W(I())}),Gs=U({disabled:W(Ve()),placeholder:W(I()),options:be(ty)});var GD=Pe(["cards"]),Jt=U({...qe.shape,options:Gs,display:W(GD),...De(Ae(),"STATIC_DROPDOWN").shape}),ln=U({...qe.shape,options:Gs,...De(be(Ae()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Fl=U({...qe.shape,...De(Ae(),"DROPDOWN").shape,refreshers:be(I())}),Zo=U({...qe.shape,...De(be(Ae()),"MULTI_SELECT_DROPDOWN").shape,refreshers:be(I())});var dn=U({...qe.shape,reveals:W(be(I())),...De(Ve(),"CHECKBOX").shape});var pn=U({...qe.shape,display:W(Pe(["stepper"])),min:W(Et()),max:W(Et()),step:W(Et()),...De(Et(),"NUMBER").shape});var Ko=U({...qe.shape,streaming:W(Ve()),...De(Ae(),"FILE").shape});var Jo=U({...qe.shape,...De(I(),"DATE_TIME").shape});var ry=Re(I(),ze([Kt,cn,Jt,Zo,ln,dn,pn,Ko,Jo])),Yo=U({...qe.shape,properties:ry,...De(be(Ae()),"ARRAY").shape});var ny=Pe(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),iy=U({preset:W(ny),after:W(I()),before:W(I())}),Ll=U({...qe.shape,display:W(Pe(["dropdown"])),...De(iy,"DATE_RANGE").shape});var Xo=U({...qe.shape,...De(ze([Re(I(),Ae())]),"JSON").shape});var oy=ze([Kt,Jt,Xo,Yo,ln]),HD=Re(I(),oy),jl=U({refreshers:be(I()),...qe.shape,...De(Ae(),"DYNAMIC").shape});var Hs=U({...qe.shape,...De(Xg(),"MARKDOWN").shape});var Qo=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Qo||{}),Li=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Li||{}),ji=(u=>(u.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",u.COMMUNICATION="COMMUNICATION",u.COMMERCE="COMMERCE",u.CORE="CORE",u.UNIVERSAL_AI="UNIVERSAL_AI",u.FLOW_CONTROL="FLOW_CONTROL",u.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",u.ACCOUNTING="ACCOUNTING",u.PRODUCTIVITY="PRODUCTIVITY",u.CONTENT_AND_FILES="CONTENT_AND_FILES",u.DEVELOPER_TOOLS="DEVELOPER_TOOLS",u.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",u.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",u.HUMAN_RESOURCES="HUMAN_RESOURCES",u.PAYMENT_PROCESSING="PAYMENT_PROCESSING",u.MARKETING="MARKETING",u.SALES_AND_CRM="SALES_AND_CRM",u))(ji||{});var ea=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ea||{}),ql="both_client_credentials_and_authorization_code";var Ur=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ur||{}),ta=(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))(ta||{}),WD=U({strategy:Pe(ta),paramName:W(I())}),ra=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ra||{});var Ws=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ws||{}),ay=U({status:W(Et()),body:W(Ae()),headers:W(Re(I(),I()))}),sy=U({type:ve("DELAY"),resumeDateTime:I(),requestIdToReply:W(I()),handlerId:W(I()),streamStepProgress:W(Pe(Ws))}),uy=U({type:ve("WEBHOOK"),requestId:I(),requestIdToReply:W(I()),response:ay,handlerId:W(I()),streamStepProgress:W(Pe(Ws))}),ZD=ze([sy,uy]);var KD=U({body:Ae(),rawBody:W(Ae()),headers:Re(I(),I()),queryParams:Re(I(),I())});function mt(t){return t==null}i(mt,"isNil");function na(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}i(na,"isEmpty");function Zs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}i(Zs,"assertNotNullOrUndefined");async function Bl(t){try{return{data:await t(),error:null}}catch(e){return{data:null,error:e}}}i(Bl,"tryCatch");var Vl=ue(require("crypto"),1);var JD=128,Fn,qi,YD=i(t=>{if(t<0)throw new RangeError("Wrong ID size");try{!Fn||Fn.length<t?(Fn=Buffer.allocUnsafe(t*JD),Vl.default.randomFillSync(Fn),qi=0):qi+t>Fn.length&&(Vl.default.randomFillSync(Fn),qi=0)}catch(e){throw Fn=void 0,e}qi+=t},"fillPool"),XD=i(t=>(YD(t|=0),Fn.subarray(qi-t,qi)),"random"),QD=i((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,o=Math.ceil(1.6*n*e/t.length);return(s=e)=>{if(s<=0)return"";let d="";for(;;){let m=r(o),h=o;for(;h--;)if(d+=t[m[h]&n]||"",d.length===s)return d}}},"customRandom"),ly=i((t,e=21)=>QD(t,e,XD),"customAlphabet");var e$="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",dy=21,xZ=I().check(kn(new RegExp(`^[0-9a-zA-Z]{${dy}}$`))),t$=ly(e$,dy);var Ln=Mn(Un(t=>t instanceof Date?t.toISOString():t),I()),dr={id:I(),created:Ln,updated:Ln},ut=i(t=>W(Ho(t)),"Nullable");function Gl(t){return W(Ho(Pe(t)))}i(Gl,"NullableEnum");var RZ=Mn(Un(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),W(Ve())),Ks=i(t=>Mn(Un(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),W(be(t))),"OptionalArrayFromQuery");var OZ=Re(I(),Ae());var Bi=(E=>(E.OPENAI="openai",E.OPENROUTER="openrouter",E.ANTHROPIC="anthropic",E.AZURE="azure",E.GOOGLE="google",E.ACTIVEPIECES="activepieces",E.CLOUDFLARE_GATEWAY="cloudflare-gateway",E.CUSTOM="custom",E.BEDROCK="bedrock",E.MISTRAL="mistral",E.XAI="xai",E.DEEPSEEK="deepseek",E.ZAI="zai",E.QWEN="qwen",E.MINIMAX="minimax",E.MOONSHOT="moonshot",E))(Bi||{});var VZ=I().check(kn(/^#[0-9A-Fa-f]{6}$/));var HZ=U({filename:I(),data:Ae(),type:ve("file"),mimetype:W(I())});var r$=ue(fy());var QZ=U({...dr,name:I(),permissions:be(I()),platformId:ut(I()),type:I(),userCount:W(Et())});var my=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(my||{}),Hl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Hl||{}),Wl=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Wl||{});var Zl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Zl||{});var Kl=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Kl||{});var n$=U({mode:Pe(my),value:Ae()}),i$=U({auth:W(I()),fields:Re(I(),n$)}),o$=U({pieceName:I(),pieceVersion:I(),actionName:I(),predefinedInput:W(i$)}),a$=U({type:ve("PIECE"),toolName:I().check(Tr(1)),pieceMetadata:o$}),s$=U({type:ve("none")}),u$=U({type:ve("access_token"),accessToken:I()}),c$=U({type:ve("api_key"),apiKey:I(),apiKeyHeader:I()}),l$=U({type:ve("headers"),headers:Re(I(),I())}),d$=zn("type",[s$,u$,c$,l$]),hy=U({type:ve("FLOW"),toolName:I().check(Tr(1)),externalFlowId:I(),flowDisplayName:W(I())}),gy=U({type:ve("MCP"),toolName:I().check(Tr(1)),serverUrl:Kg(),protocol:Pe(Wl),auth:d$}),yy=U({type:ve("KNOWLEDGE_BASE"),toolName:I().check(Tr(1)),sourceType:Pe(Hl),sourceId:I(),sourceName:I()}),p$=zn("type",[a$,hy,gy,yy]),f$=U({displayName:I(),description:W(I()),type:Pe(Zl)}),vy=U({type:ve("MARKDOWN"),markdown:I()}),Vi={type:ve("TOOL_CALL"),input:ut(Re(I(),Ae())),output:W(Ae()),toolName:I(),status:Pe(Kl),toolCallId:I(),startTime:I(),endTime:W(I())},D3=U(Vi),_y=zn("toolCallType",[U({...Vi,toolCallType:ve("PIECE"),pieceName:I(),pieceVersion:I(),actionName:I()}),U({...Vi,toolCallType:ve("FLOW"),displayName:I(),externalFlowId:I()}),U({...Vi,toolCallType:ve("MCP"),displayName:I(),serverUrl:I()}),U({...Vi,toolCallType:ve("KNOWLEDGE_BASE"),displayName:I(),sourceType:I()}),U({...Vi,toolCallType:ve("UNKNOWN"),displayName:I()})]),m$=ze([vy,_y]);var Jl=(r=>(r.IMAGE="image",r.TEXT="text",r))(Jl||{}),fn=U({apiKey:I()}),h$=fn,g$=U({apiKey:I(),apiKeyHash:I()}),y$=fn,v$=fn,_$=fn,w$=fn,P$=fn,b$=fn,T$=fn,Sy=U({accessKeyId:I().check(Tr(1)),secretAccessKey:I().check(Tr(1))}),S$=U({}),E$=U({}),x$=U({}),I$=U({}),A$=U({}),R$=U({}),Ey=U({modelId:I(),modelName:I(),modelType:Pe(Jl)}),xy=U({apiKeyHeader:I(),baseUrl:I(),models:be(Ey),defaultHeaders:W(Re(I(),I()))}),Iy=U({accountId:I(),gatewayId:I(),models:be(Ey),vertexProject:W(I()),vertexRegion:W(I())}),Ay=U({resourceName:I(),apiVersion:Mn(Un(t=>typeof t=="string"&&t.trim().length===0?void 0:t),W(I()))}),Ry=U({region:I().check(Tr(1))}),Dy=U({}),D$=ze([h$,_$,w$,P$,b$,v$,y$,g$,Sy,T$]),$y=ze([xy,Iy,Ay,Ry,S$,x$,I$,A$,E$,R$,Dy]),$$=U({id:I(),name:I(),type:Pe(Jl)}),O$=U({id:I(),name:I(),provider:Pe(Bi),config:$y,enabledForChat:Ve()}),C$=U({provider:Pe(Bi),name:I(),enabledForChat:Ve(),keys:be(U({id:I(),name:I()}))}),N$=U({provider:Pe(Bi),configId:I(),config:$y,auth:D$,platformId:I()});var N3={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},wy=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],k$=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],z$=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Py=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],U$=["grok-4.20","grok-4.1-fast"],M$={openai:wy,anthropic:k$,google:Py,activepieces:[...z$.map(t=>`anthropic/${t}`),...wy.map(t=>`openai/${t}`),...Py.map(t=>`google/${t}`),...U$.map(t=>`x-ai/${t}`)]};var by=128e3,F$={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function L$({provider:t}){return t?F$[t]??by:by}i(L$,"getMaxContextTokens");var Ty={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"},j$={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},q$=new Set(["anthropic","mistral","xai","deepseek","zai","qwen","minimax","moonshot"]),B$={xai:"https://api.x.ai/v1",deepseek:"https://api.deepseek.com/v1",zai:"https://api.z.ai/api/paas/v4",qwen:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",minimax:"https://api.minimax.io/v1",moonshot:"https://api.moonshot.ai/v1"};function Ot(t){return{chatModels:M$[t],maxContextTokens:L$({provider:t}),defaultEmbeddingModel:Ty[t],supportsEmbedding:Ty[t]!==void 0,supportsImageGeneration:!q$.has(t),webSearch:j$[t]}}i(Ot,"buildProviderCapabilities");var V$={openai:Ot("openai"),anthropic:Ot("anthropic"),openrouter:Ot("openrouter"),azure:Ot("azure"),google:Ot("google"),"cloudflare-gateway":Ot("cloudflare-gateway"),custom:Ot("custom"),bedrock:Ot("bedrock"),mistral:Ot("mistral"),activepieces:Ot("activepieces"),xai:Ot("xai"),deepseek:Ot("deepseek"),zai:Ot("zai"),qwen:Ot("qwen"),minimax:Ot("minimax"),moonshot:Ot("moonshot")};var G$=U({base64Url:I(),fileName:I(),extension:W(I())}),H$=U({mimeType:I(),url:I(),fileName:W(I())}),Yl=ze([G$,H$]);var W$=ze([U({type:ve("file"),value:Yl}),U({type:ve("markdown"),value:I(),files:W(be(Yl))})]),Z$=U({sessionId:I(),message:I(),files:W(be(I()))});var Cy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Cy||{}),Ny=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ny||{}),Xl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Xl||{});var K$=ze([U({...dr,name:I(),externalId:I(),type:ve("STATIC_DROPDOWN"),tableId:I(),projectId:I(),data:U({options:be(U({value:I()}))})}),U({...dr,name:I(),externalId:I(),type:ze([ve("TEXT"),ve("NUMBER"),ve("DATE"),ve("DATETIME")]),tableId:I(),projectId:I()})]),J$=U({...dr,name:I(),folderId:ut(I()),projectId:I(),externalId:I(),status:Gl(Ny),trigger:Gl(Cy)}),Y$=U({...dr,tableId:I(),projectId:I(),cells:Re(I(),U({updated:I(),created:I(),value:Ae(),fieldName:I()}))}),X$=U({events:be(Pe(Xl)),webhookUrl:I(),flowId:I()}),Q$=U({fields:be(U({id:I(),name:I()})),rows:be(Re(I(),I())),name:I()}),eO=U({projectId:I(),limit:W(Wo.number()),cursor:W(I()),name:W(I()),externalIds:Ks(I()),folderId:W(I()),folderIds:Ks(I())}),tO=U({records:be(be(U({fieldId:I(),value:zy()}))),tableId:I()}),rO=U({cells:W(be(U({fieldId:I(),value:zy()}))),tableId:I(),agentUpdate:W(Ve())}),ky=zn("operator",[si("eq"),si("neq"),si("gt"),si("gte"),si("lt"),si("lte"),si("co"),Oy("exists"),Oy("not_exists")]),nO=U({tableId:I(),limit:W(Wo.number()),cursor:W(I()),filters:Ks(ky)});function zy(){return Mn(Un(t=>t==null?t:String(t)),Ho(I()))}i(zy,"coerceToString");function si(t){return U({fieldId:I(),operator:ve(t),value:I()})}i(si,"valueFilter");function Oy(t){return U({fieldId:I(),operator:ve(t)})}i(Oy,"existenceFilter");var iO=U({status:W(Et()),body:W(Ae()),headers:W(Re(I(),I()))}),oO=U({...dr,deleted:ut(Ln),ownerId:I(),displayName:I(),platformId:I(),externalId:ut(I())});var Uy=U({name:I(),description:W(I()),type:I(),required:Ve()}),aO=U({pieceName:I(),triggerName:I(),input:U({toolName:I(),toolDescription:I(),inputSchema:be(Uy),returnsResponse:Ve()})});var My="^[0-9]+\\.[0-9]+\\.[0-9]+$",Q3=new RegExp(My),uO="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",eK=I().check(kn(new RegExp(My))),tK=I().check(kn(new RegExp(uO))),cO=U({packageType:ve("ARCHIVE"),pieceType:Pe(Li),pieceName:I(),pieceVersion:I(),archiveId:I(),platformId:I()}),Fy=U({packageType:ve("REGISTRY"),pieceType:ve("OFFICIAL"),pieceName:I(),pieceVersion:I()}),Ly=U({packageType:ve("REGISTRY"),pieceType:ve("CUSTOM"),pieceName:I(),pieceVersion:I(),platformId:I()}),rK=ze([Fy,Ly]),nK=ze([cO,Fy,Ly]);var lO=zn("type",[U({type:ve("CRON_EXPRESSION"),cronExpression:I(),timezone:I()}),U({type:ve("INTERVAL"),intervalMs:Jg().check(Ls(6e4))})]),iK=U({...dr,type:Pe(Ur),projectId:I(),flowId:I(),triggerName:I(),schedule:ut(lO),flowVersionId:I(),pieceName:I(),pieceVersion:I(),deleted:ut(I()),simulate:Ve()}),jy=(E=>(E.UNKNOWN="UNKNOWN",E.FLOW_RUN_LOG="FLOW_RUN_LOG",E.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",E.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",E.FLOW_STEP_FILE="FLOW_STEP_FILE",E.SAMPLE_DATA="SAMPLE_DATA",E.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",E.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",E.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",E.PROJECT_RELEASE="PROJECT_RELEASE",E.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",E.PLATFORM_ASSET="PLATFORM_ASSET",E.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",E.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",E.KNOWLEDGE_BASE="KNOWLEDGE_BASE",E.FLOW_BUNDLE="FLOW_BUNDLE",E))(jy||{}),qy=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(qy||{}),By=(r=>(r.S3="S3",r.DB="DB",r))(By||{}),oK=U({...dr,projectId:ut(I()),platformId:ut(I()),type:Pe(jy),compression:Pe(qy),data:W(Ae()),location:Pe(By),size:ut(Et()),fileName:ut(I()),s3Key:ut(I()),metadata:ut(Re(I(),I()))}),Vy=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Vy||{}),Gy=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Gy||{}),aK=U({id:I(),email:I(),firstName:I(),status:Pe(Gy),externalId:ut(I()),platformId:ut(I()),platformRole:Pe(Vy),lastName:I(),created:Ln,updated:Ln,lastActiveDate:ut(Ln),imageUrl:ut(I())});var td=U({...qe.shape,...De(Re(I(),Ae()),"OBJECT").shape});var rd=U({...qe.shape,formatProperty:W(I()),...De(I(),"RICH_TEXT").shape});var Wy=U({...qe.shape,...De(I(),"COLOR").shape});var nd=ze([Kt,cn,rd,Hs,dn,Jt,ln,Fl,Zo,jl,pn,Yo,td,Xo,Jo,Ll,Ko,Wy]),O={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 Mr=U({displayName:I(),description:W(I()),hasConnectionIdentifier:W(Ve())});var Zy=U({username:I(),password:I()}),id=U({...Mr.shape,username:U({displayName:I(),description:W(I())}),password:U({displayName:I(),description:W(I())}),...De(Zy,"BASIC_AUTH").shape});var mO=Re(I(),ze([Kt,cn,pn,dn,Jt])),od=U({...Mr.shape,props:mO,...De(Ae(),"CUSTOM_AUTH").shape});var ui=U({...Mr.shape,...De(U({auth:I()}),"SECRET_TEXT").shape});var hO=Re(I(),ze([Kt,cn,ui,pn,dn,Jt,ln,Hs])),Ky=U({...Mr.shape,props:hO,...De(Ae(),"OIDC").shape});var ad=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(ad||{}),Jy=ze([Kt,ui,Jt]),Yy=Re(I(),Jy),gO=U({props:W(Re(I(),Jy)),authUrl:I(),tokenUrl:I(),scope:be(I()),prompt:W(ze([ve("none"),ve("consent"),ve("login"),ve("omit")])),pkce:W(Ve()),pkceMethod:W(ze([ve("plain"),ve("S256")])),authorizationMethod:W(Pe(ad)),grantType:W(ze([Pe(ea),ve(ql)])),extra:W(Re(I(),I()))}),Xy=U({access_token:I(),props:W(Yy),data:Re(I(),Go())}),sd=U({...Mr.shape,...gO.shape,...De(Xy,"OAUTH2").shape});var Gi=ze([id,od,Ky,sd,ui]),ia="Connection",Hi={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||ia}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||ia,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||ia}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||ia}},None(){}};var BJ={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 yO=U({...qe.shape,...De(Ae(),"CUSTOM").shape,code:I()});var vO=ze([nd,Gi]),ud=Re(I(),vO),l8=Re(I(),nd);var Qy=ze([U({strategy:ve("CRON"),cronExpression:I()}),U({strategy:ve("NONE")})]),Wi=class{constructor(e,r,n,o,s,d,m,h,v,_,x,T,P,S,D,E,u,f,c,y,l){this.name=e;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=d;this.handshakeConfiguration=m;this.onHandshake=h;this.renewConfiguration=v;this.onRenew=_;this.onEnable=x;this.onDisable=T;this.onStart=P;this.run=S;this.test=D;this.sampleData=E;this.testStrategy=u;this.outputSchema=f;this.aiMetadata=c;this.classification=y;this.propertyGroups=l}static{i(this,"ITrigger")}},Zi=i(t=>{switch(t.type){case"WEBHOOK":return new Wi(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 Wi(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 Wi(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 Wi(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,mt(t.sampleData)&&mt(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups)}},"createTrigger");var ev="2",Ys="0.82.0";var cd=class{constructor(e,r,n,o,s,d,m,h,v=Ys,_,x="",T){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=o;this.categories=m;this.auth=h;this.minimumSupportedRelease=v;this.maximumSupportedRelease=_;this.description=x;this.deprecated=T;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:ev}),"getContextInfo");(!wO(v)||PO(v,Ys))&&(this.minimumSupportedRelease=Ys),s.forEach(P=>this._actions[P.name]=P),d.forEach(P=>this._triggers[P.name]=P)}static{i(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:_O(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}},rv=i(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new cd(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 _O(t){if(t!==void 0)return Array.isArray(t)?t.map(tv):tv(t)}i(_O,"withConnectionIdentifierFlag");function tv(t){return{...t,hasConnectionIdentifier:t.getConnectionIdentifier!==void 0}}i(tv,"flagConnectionIdentifier");function wO(t){return/^\d+\.\d+\.\d+$/.test(t)}i(wO,"isValidSimpleSemver");function PO(t,e){let[r,n,o]=t.split(".").map(Number),[s,d,m]=e.split(".").map(Number);return r!==s?r<s:n!==d?n<d:o<m}i(PO,"isSemverLessThan");var bO=W(Re(I(),Re(I(),I()))),nv=U({id:W(I()),name:I(),displayName:I(),logoUrl:I(),description:I(),authors:be(I()),platformId:W(I()),directoryPath:W(I()),auth:W(ze([Gi,be(Gi)])),version:I(),categories:W(be(Pe(ji))),minimumSupportedRelease:W(I()),maximumSupportedRelease:W(I()),deprecated:W(Ve()),i18n:bO}),TO=Pe(["human","ai","both"]),iv=U({description:W(I()),idempotent:W(Ve())}),ov=Pe(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var SO=Pe(["tabs","section","summary","builder","footer"]),av=U({key:I(),display:SO,label:W(I()),description:W(I()),icon:W(I()),props:be(I())}),sv=U({name:I(),displayName:I(),description:I(),props:ud,propertyGroups:W(be(av)),requireAuth:Ve(),errorHandlingOptions:W(Ml),outputSchema:W(Vs()),audience:W(TO),aiMetadata:W(iv),classification:W(ov)}),uv=U({name:I(),displayName:I(),description:I(),props:ud,propertyGroups:W(be(av)),errorHandlingOptions:W(Ml),type:Pe(Ur),sampleData:Ae(),handshakeConfiguration:W(Vs()),renewConfiguration:W(Qy),testStrategy:Pe(ra),outputSchema:W(Vs()),aiMetadata:W(iv),classification:W(ov)}),EO=U({...nv.shape,actions:Re(I(),sv),triggers:Re(I(),uv)}),xO=U({...nv.shape,actions:Et(),triggers:Et(),suggestedActions:W(be(sv)),suggestedTriggers:W(be(uv))}),cv=U({projectUsage:Et(),pieceType:Pe(Li),packageType:Pe(Qo),platformId:W(I()),archiveId:W(I())}),p5=U({...EO.shape,...cv.shape}),f5=U({...xO.shape,...cv.shape}),m5=U({name:I(),version:I()});var IO=ue(require("path")),AO=ue(require("fs/promises"));var Ki=require("node:stream");var Xs=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,d)=>{o.append(d,s)}),{urlWithoutQueryParams:n,queryParams:o}}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 Qs=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(e=new ld,r=new dd){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},ld=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},dd=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(e,r){let n=`${e.username}:${e.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var oa=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(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 lv({error:t,requestBody:e}){return t instanceof oa?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}i(lv,"toFailsafeOutput");var Sr=(d=>(d.GET="GET",d.POST="POST",d.PATCH="PATCH",d.PUT="PUT",d.DELETE="DELETE",d.HEAD="HEAD",d))(Sr||{});var eu=class extends Xs{static{i(this,"FetchHttpClient")}constructor(e="",r=new Qs){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(e),s=this.getHeaders(e),d=e.queryParams??{};for(let[c,y]of Object.entries(d))o.append(c,y);let m=o.toString(),h=m?`${n}?${m}`:n,v=e.responseType??"json",_=e.followRedirects??!0,x=e.retries??0,{body:T,extraHeaders:P,isStream:S}=RO(e.method)?DO(e.body,s):{body:void 0,extraHeaders:{},isStream:!1},D=OO({...s,...P}),E=await $O(async()=>{let c=new AbortController,y=e.timeout&&e.timeout>0?setTimeout(()=>c.abort(),e.timeout):void 0;try{let l={method:e.method.toString(),headers:D,body:T,redirect:_?"follow":"manual",signal:c.signal};return S&&(l.duplex="half"),r?.dispatcher!==void 0&&(l.dispatcher=r.dispatcher),await fetch(h,l)}finally{y!==void 0&&clearTimeout(y)}},S?0:x),u=_?300:400;if(E.status<200||E.status>=u){let c=await dv(E,v==="stream"?"text":v),y=new oa(e.body,{status:E.status,responseBody:c});throw console.error("[HttpClient#(sanitized error message)] Request failed:",y),y}let f=await dv(E,v);return{status:E.status,headers:CO(E.headers),body:f}}};function RO(t){return t!=="GET"&&t!=="HEAD"}i(RO,"acceptsRequestBody");function DO(t,e){if(fv(t))return{body:void 0,extraHeaders:{},isStream:!1};if(NO(t)){let n=new Ki.PassThrough;return t.on("error",o=>n.destroy(o)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return t instanceof Ki.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}}i(DO,"serializeBody");async function dv(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"stream":return fv(t.body)?Ki.Readable.from([]):Ki.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}}}}i(dv,"parseResponseBody");async function $O(t,e){let r;for(let n=0;n<=e;n++)try{let o=await t();if(o.status>=500&&n<e){await pv(n);continue}return o}catch(o){if(r=o,n<e){await pv(n);continue}throw o}throw r}i($O,"sendWithRetries");function pv(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}i(pv,"backoff");function OO(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}i(OO,"normalizeHeaders");function CO(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}i(CO,"toHttpHeaders");function NO(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}i(NO,"isNodeFormData");function fv(t){return t==null}i(fv,"isNil");var ht=new eu;var PN=ue(require("fs")),hw=ue(la());var bN={"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 TN(t){let e=t.split(";")[0].trim().toLowerCase();return bN[e]??""}i(TN,"contentTypeToExtension");var SN=i(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),EN=i((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 gw({auth:t,baseUrl:e,authMapping:r,description:n,displayName:o,name:s,props:d,extraProps:m,authLocation:h="headers",classification:v="WRITE"}){return te({audience:"human",name:s||"custom_api_call",classification:v,displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:O.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:i(async({auth:_})=>({url:O.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
69
|
-
i.e ${
|
|
70
|
-
Error:${v}`)}return{disabled:!1,placeholder:h?`Showing first ${m.length} matches \u2014 type to narrow the list, or switch to Dynamic value to paste an ID.`:void 0,options:m.map(v=>({label:v.name,value:v.id}))}}i(jE,"fetchFolderDropdownOptions");var Ne={properties:{parentFolder:O.Dropdown({displayName:"Parent Folder",description:"The Drive folder to target. Leave empty to use the root of My Drive. Type in the box to search your Drive by folder name. If the folder still isn't listed, switch this field to 'Dynamic value' (the toggle next to the field) and paste the folder ID \u2014 you can copy it from the folder's URL in Drive, after /folders/ (e.g. https://drive.google.com/drive/folders/<FOLDER_ID>).",required:!1,auth:J,refreshers:["include_team_drives"],refreshOnSearch:!0,options:i(async({auth:t,include_team_drives:e},r)=>jE({auth:t,searchValue:r?.searchValue,includeTeamDrives:e}),"options")}),include_team_drives:O.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},fetchFolderDropdownOptions:jE,async getFiles(t,e,r){let n=await oe(t),o=(0,zm.drive)({version:"v3",auth:n}),s=[];if(e?.parent&&s.push(`'${Gc(e.parent)}' in parents`),e?.createdTime&&s.push(`createdTime ${e.createdTimeOp??">"} '${(0,Vc.default)(e.createdTime).format()}'`),e?.changedSince){let v=(0,Vc.default)(e.changedSince).format();s.push(`(modifiedTime > '${v}' or createdTime > '${v}')`)}e?.mimeTypes?.length&&s.push(`(${e.mimeTypes.map(v=>`mimeType='${Gc(v)}'`).join(" or ")})`),e?.excludeShortcuts&&s.push("mimeType!='application/vnd.google-apps.shortcut'"),s.push("trashed = false");let d=[],m,h=0;do{let v={q:s.concat("mimeType!='application/vnd.google-apps.folder'").join(" and "),fields:"nextPageToken, files(id, name, mimeType, webViewLink, kind, createdTime, modifiedTime)",orderBy:r??"createdTime desc",supportsAllDrives:!0,includeItemsFromAllDrives:e?.includeTeamDrive,corpora:e?.includeTeamDrive?"allDrives":"user"};m&&(v.pageToken=m);let _=await o.files.list(v);if(d.push(..._.data.files??[]),m=_.data.nextPageToken??void 0,h+=1,e?.maxPages&&h>=e.maxPages)break}while(m);return d},async getFolders(t,e,r){let n=await oe(t),o=(0,zm.drive)({version:"v3",auth:n}),s=["mimeType='application/vnd.google-apps.folder'"];e?.parent&&s.push(`'${Gc(e.parent)}' in parents`),e?.createdTime&&s.push(`createdTime ${e.createdTimeOp??">"} '${(0,Vc.default)(e.createdTime).format()}'`),s.push("trashed = false");let d=[],m;do{let h={q:s.join(" and "),fields:"nextPageToken, files(id, name, createdTime)",orderBy:r??"createdTime desc",supportsAllDrives:!0,includeItemsFromAllDrives:e?.includeTeamDrive,corpora:e?.includeTeamDrive?"allDrives":"user"};m&&(h.pageToken=m);let v=await o.files.list(h);d.push(...v.data.files??[]),m=v.data.nextPageToken??void 0}while(m);return d}};var qE={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},BE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},VE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},GE={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},HE={fields:[{key:"name",label:"Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},WE={fields:[{key:"files",label:"Files",labelKey:"name",listItems:[{key:"name",label:"Name",value:"name"},{key:"id",label:"File ID",value:"id"},{key:"mimeType",label:"MIME Type",value:"mimeType"},{key:"trashed",label:"Trashed",value:"trashed",format:"boolean"},{key:"parents",label:"Parent Folder ID",value:"parents[0]"}]},{key:"incompleteSearch",label:"Incomplete Search",value:"incompleteSearch",format:"boolean"}]},ZE={fields:[{key:"results",label:"Results",value:"",labelKey:"name",listItems:[{key:"name",label:"Name",value:"name"},{key:"mimeType",label:"MIME Type",value:"mimeType"},{key:"id",label:"File ID",value:"id"},{key:"createdTime",label:"Created Time",value:"createdTime",format:"datetime"},{key:"modifiedTime",label:"Modified Time",value:"modifiedTime",format:"datetime"}]}]},KE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},JE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},YE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"iconLink",label:"Icon",format:"image"},{key:"size",label:"Size",format:"filesize"},{key:"fileExtension",label:"File Extension"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"shared",label:"Shared",format:"boolean"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]},{key:"lastModifyingUser",label:"Last Modifying User",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]},{key:"permissions",label:"Permissions",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]}]},XE={fields:[{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"id",label:"Permission ID"},{key:"allowFileDiscovery",label:"Allow File Discovery",format:"boolean"},{key:"downloadUrl",label:"Download URL",format:"url"},{key:"kind",label:"Kind"}]},QE={fields:[{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]},ex={fields:[{key:"removed",label:"Removed",value:"removed",format:"boolean"},{key:"message",label:"Message",value:"message"}]},tx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},rx={fields:[{key:"name",label:"File Name"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"id",label:"File ID"}]},nx={fields:[{key:"changeType",label:"Change Type"},{key:"content",label:"File Content"},{key:"contentError",label:"File Content Error"},{key:"name",label:"File Name"},{key:"webViewLink",label:"View Link",format:"url"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"id",label:"File ID"}]},ix={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"createdTime",label:"Created Time",format:"datetime"}]},_j=[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"iconLink",label:"Icon",format:"image"},{key:"fileExtension",label:"File Extension"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"shared",label:"Shared",format:"boolean"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]},{key:"lastModifyingUser",label:"Last Modifying User",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]}],ox={fields:_j},ax={fields:[{key:"files",label:"Files",labelKey:"name",listItems:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"shared",label:"Shared",format:"boolean"}]},{key:"incompleteSearch",label:"Incomplete Search",format:"boolean"}]},sx={fields:[{key:"files",label:"Search Results",labelKey:"name",listItems:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"}]}]},ux={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"size",label:"Size",format:"filesize"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]},{key:"lastModifyingUser",label:"Last Modifying User",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]},{key:"shared",label:"Shared",format:"boolean"}]},cx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"iconLink",label:"Icon",format:"image"},{key:"fileExtension",label:"File Extension"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"me",label:"Is Me",format:"boolean"}]}]},lx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"me",label:"Is Me",format:"boolean"}]}]},dx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"parents",label:"Parent Folder IDs"},{key:"shared",label:"Shared",format:"boolean"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"me",label:"Is Me",format:"boolean"}]}]},px={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"description",label:"Description"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"webViewLink",label:"View Link",format:"url"},{key:"size",label:"Size",format:"filesize"}]},fx={fields:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"displayName",label:"Display Name"},{key:"photoLink",label:"Photo",format:"image"},{key:"pendingOwner",label:"Pending Owner",format:"boolean"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"permissionDetails",label:"Permission Details",labelKey:"role",listItems:[{key:"role",label:"Role"},{key:"permissionType",label:"Permission Type"},{key:"inherited",label:"Inherited",format:"boolean"}]}]},mx={fields:[{key:"permissions",label:"Permissions",labelKey:"displayName",listItems:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"displayName",label:"Display Name"},{key:"photoLink",label:"Photo",format:"image"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"pendingOwner",label:"Pending Owner",format:"boolean"}]}]},hx={fields:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"allowFileDiscovery",label:"Allow File Discovery",format:"boolean"},{key:"permissionDetails",label:"Permission Details",labelKey:"role",listItems:[{key:"role",label:"Role"},{key:"permissionType",label:"Permission Type"},{key:"inherited",label:"Inherited",format:"boolean"}]}]},gx={fields:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"displayName",label:"Display Name"},{key:"photoLink",label:"Photo",format:"image"}]},yx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},vx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},_x={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},wx={fields:[{key:"user",label:"Current User",children:[{key:"displayName",label:"Display Name"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"},{key:"permissionId",label:"Permission ID"}]},{key:"storageQuota",label:"Storage Quota",children:[{key:"limit",label:"Total Limit",format:"filesize"},{key:"usage",label:"Used Space",format:"filesize"},{key:"usageInDrive",label:"Used in Drive",format:"filesize"},{key:"usageInDriveTrash",label:"Used in Trash",format:"filesize"}]},{key:"maxUploadSize",label:"Max Upload Size",format:"filesize"}]},Px={fields:[{key:"drives",label:"Shared Drives",labelKey:"name",listItems:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"}]}]},bx={fields:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"restrictions",label:"Restrictions",children:[{key:"adminManagedRestrictions",label:"Admin Managed",format:"boolean"},{key:"copyRequiresWriterPermission",label:"Copy Requires Writer Permission",format:"boolean"},{key:"domainUsersOnly",label:"Domain Users Only",format:"boolean"},{key:"driveMembersOnly",label:"Drive Members Only",format:"boolean"}]}]},Tx={fields:[{key:"comments",label:"Comments",labelKey:"content",listItems:[{key:"id",label:"Comment ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]}]}]},Sx={fields:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},Ex={fields:[{key:"id",label:"Comment ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},xx={fields:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"htmlContent",label:"HTML Content",format:"html"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},Ix={fields:[{key:"replies",label:"Replies",labelKey:"content",listItems:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]}]}]},Ax={fields:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},Rx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},Dx={fields:[{key:"id",label:"Folder ID"},{key:"name",label:"Folder Name"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"parents",label:"Parent Folder IDs"},{key:"webViewLink",label:"View Link",format:"url"}]},$x={fields:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"}]},Ox={fields:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"}]},Cx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Nx={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},kx={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},zx={fields:[{key:"success",label:"Success",format:"boolean"},{key:"reply_id",label:"Reply ID"}]},Ux={fields:[{key:"deleted",label:"Deleted",format:"boolean"},{key:"driveId",label:"Drive ID"}]},Mx={fields:[{key:"success",label:"Success",format:"boolean"},{key:"driveId",label:"Drive ID"}]},Fx={fields:[{key:"removed",label:"Removed",format:"boolean"},{key:"message",label:"Message"}]};var jx=te({auth:J,name:"update_permissions",classification:"WRITE",description:"Update permissions for a file or folder",audience:"human",aiMetadata:{description:"Grants a specified role (reader, commenter, writer, fileOrganizer, or organizer) on a Drive file or folder to a user identified by email, optionally sending a notification email. Use to share a resource with a person. Requires the file/folder ID and target email. Not idempotent: each call creates a new permission grant.",idempotent:!1},displayName:"Update permissions",props:{fileId:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:O.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:O.StaticDropdown({displayName:"Role",description:"The role to grant to user. See more at: https://developers.google.com/drive/api/guides/ref-roles",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}}),include_team_drives:Ne.properties.include_team_drives,send_invitation_email:O.Checkbox({displayName:"Send invitation email",description:"Send an email to the user to notify them of the new permissions",required:!0})},outputSchema:QE,async run(t){let{fileId:e,user_email:r,permission_name:n,send_invitation_email:o,include_team_drives:s}=t.propsValue,d=await oe(t.auth),m=(0,Lx.drive)({version:"v3",auth:d}),h={type:"user",role:n,emailAddress:r};return(await m.permissions.create({requestBody:h,fileId:e,sendNotificationEmail:o,supportsAllDrives:s})).data}});var qx=ue($e());var Bx=te({auth:J,name:"create_new_gdrive_folder",classification:"WRITE",description:"Create a new empty folder in your Google Drive",audience:"human",aiMetadata:{description:"Creates a new empty folder in Google Drive, optionally nested under a parent folder. Use to set up a destination before uploading or moving files. Not idempotent: each call creates a distinct folder even with the same name (Drive permits duplicate folder names).",idempotent:!1},displayName:"Create new folder",props:{folderName:O.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives},outputSchema:qE,async run(t){let e=await oe(t.auth);return(await(0,qx.drive)({version:"v3",auth:e}).files.create({requestBody:{mimeType:"application/vnd.google-apps.folder",name:t.propsValue.folderName,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},supportsAllDrives:t.propsValue.include_team_drives})).data}});var Vx=ue($e());var Gx=te({auth:J,name:"create_new_gdrive_file",classification:"WRITE",description:"Create a new text file in your Google Drive from text",audience:"human",aiMetadata:{description:"Creates a new file in Google Drive from inline text content as plain text, CSV, or XML, optionally inside a parent folder. Use when an agent has generated text it needs to persist as a Drive file. Not idempotent: each call creates a new file.",idempotent:!1},displayName:"Create new file",props:{fileName:O.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:O.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),fileType:O.StaticDropdown({displayName:"Content type",description:"Select file type",required:!0,defaultValue:"text/plain",options:{options:[{label:"Text",value:"text/plain"},{label:"CSV",value:"text/csv"},{label:"XML",value:"text/xml"}]}}),parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives},outputSchema:BE,async run(t){let e=await oe(t.auth),r=(0,Vx.drive)({version:"v3",auth:e}),n=t.propsValue.fileType==="plain/text"?"text/plain":t.propsValue.fileType;return(await r.files.create({requestBody:{name:t.propsValue.fileName,mimeType:n,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},media:{mimeType:n,body:t.propsValue.text},supportsAllDrives:t.propsValue.include_team_drives??!1,fields:"id, name, mimeType, kind"})).data}});var Hx=ue($e());var Wx=te({auth:J,name:"delete_permissions",classification:"DESTRUCTIVE",description:"Removes a role from an user for a file or folder",audience:"human",aiMetadata:{description:"Revokes a specific role from a user (matched by email and role) on a Drive file or folder. Use to unshare or downgrade access for someone. Requires the file/folder ID, the user email, and the role to remove. Idempotent: if no matching permission exists, the call is a no-op.",idempotent:!0},displayName:"Delete permissions",props:{fileId:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:O.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:O.StaticDropdown({displayName:"Role",description:"The role to remove from user.",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}})},outputSchema:ex,async run(t){let[e,r]=[t.propsValue.fileId,t.propsValue.user_email],n=await oe(t.auth),o=(0,Hx.drive)({version:"v3",auth:n}),s=await o.permissions.list({fileId:e,fields:"permissions(id, emailAddress, role)"});if(s.data.permissions){for(let d of s.data.permissions)if(d.emailAddress===r&&d.role===t.propsValue.permission_name)return await o.permissions.delete({fileId:e,permissionId:d.id?d.id:""}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var Zx=ue($e());var Kx=te({displayName:"Duplicate File",auth:J,name:"duplicate_file",classification:"WRITE",description:"Duplicate a file from Google Drive. Returns the new file ID.",audience:"human",aiMetadata:{description:"Copies an existing Drive file into a target folder under a new name, optionally converting it to a Google Sheet or Google Doc. Use to clone a file or create an editable Google-format copy. Requires the source file ID and destination folder ID. Not idempotent: each call creates a new copy.",idempotent:!1},props:{fileId:O.ShortText({displayName:"File ID",description:"The ID of the file to duplicate",required:!0}),name:O.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folderId:O.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be duplicated",required:!0}),mimeType:O.StaticDropdown({displayName:"Duplicate as",description:"If left unselected the file will be duplicated as it is",required:!1,options:{options:[{label:"Google Sheets",value:"application/vnd.google-apps.spreadsheet"},{label:"Google Docs",value:"application/vnd.google-apps.document"}]}}),include_team_drives:Ne.properties.include_team_drives},outputSchema:KE,async run(t){let e=await oe(t.auth),r=t.propsValue.fileId,n=t.propsValue.name,o=t.propsValue.folderId,s=t.propsValue.mimeType,d=(0,Zx.drive)({version:"v3",auth:e}),m={name:n,parents:[o]};s&&(m.mimeType=s);let h=await d.files.copy({fileId:r,auth:e,requestBody:m,supportsAllDrives:t.propsValue.include_team_drives});if(h.status!==200)throw new Error("Error duplicating file");return h.data}});var Jx=ue($e());var Yx=te({auth:J,name:"get-file-or-folder-by-id",classification:"READ",displayName:"Get File Information",description:"Get a file folder for files/sub-folders",audience:"human",aiMetadata:{description:"Fetches metadata for a single file or folder in Google Drive by its exact ID (name, MIME type, parents, etc.). Use when an agent already has a file/folder ID and needs its details. Read-only and idempotent. Requires the resource ID, not a name or path.",idempotent:!0},props:{id:O.ShortText({displayName:"File / Folder Id",description:"The Id of the file/folder to search for.",required:!0}),include_team_drives:Ne.properties.include_team_drives},outputSchema:HE,async run(t){let e=await oe(t.auth),n=await(0,Jx.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.id,supportsAllDrives:t.propsValue.include_team_drives});return n.data?n.data:null}});var Um=ue(require("querystring"));var Qx=require("node:stream"),eI=ue(mn());async function tI(t,e){let r=await it(t);return(await fetch(`https://www.googleapis.com/drive/v3/files/${e}?fields=mimeType&supportsAllDrives=true`,{headers:{Authorization:`Bearer ${r}`}}).then(o=>o.json())).mimeType}i(tI,"getMimeType");var Xx=i(async(t,e,r,n,o)=>{let s=await tI(e,r),d=await it(e),m=await fetch(t,{headers:{Authorization:`Bearer ${d}`}}).catch(x=>Promise.reject(new Error(`Error when download file:
|
|
68
|
+
`)}E+=D,e.data=E}if(i(_,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,o){r.uploadType="multipart";let P=[{"content-type":"application/json",body:JSON.stringify(o)},{"content-type":n.mimeType||o&&o.mimeType||d,body:n.body}];(0,Im.isBrowser)()?_(P):v(P)}else r.uploadType="media",Object.assign(m,{"content-type":n.mimeType||d}),e.data=n.body;else e.data=o||void 0;if(e.headers=Em.Gaxios.mergeHeaders(e.headers||{},m),e.params=r,!(0,Im.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:RE.version,comment:"gzip"});let P=e.userAgentDirectives.map(S=>{let D=`${S.product}/${S.version}`;return S.comment&&(D+=` (${S.comment})`),D}).join(" ");e.headers.set("User-Agent",P)}if(e.validateStatus||(e.validateStatus=P=>P>=200&&P<300||P===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 x=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,T=e.universeDomain??e.universe_domain??x??"googleapis.com";if(T!=="googleapis.com"&&e.url){let P=new URL(e.url);P.hostname.endsWith(".googleapis.com")&&(P.hostname=P.hostname.replace(/googleapis\.com$/,T),e.url=P.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let P=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(P&&T!==P)throw new Error(`The configured universe domain (${T}) does not match the universe domain found in the credentials (${P}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let S=await s.getRequestHeaders(e.url),D=Object.assign({},e);return D.headers=Em.Gaxios.mergeHeaders(D.headers,S),tj.request(D)}else{let S=await s.request(e);return(0,xm.marshallGaxiosResponse)(S)}}else return new Em.Gaxios().request(e).then(P=>(0,xm.marshallGaxiosResponse)(P))}i(IE,"createAPIRequestAsync");var Am=class extends AE.Transform{static{i(this,"ProgressStream")}bytesRead=0;_transform(e,r,n){this.bytesRead+=e.length,this.emit("progress",this.bytesRead),this.push(e),n()}};function oj(t,e){(0,Im.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${RE.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}i(oj,"populateAPIHeader")});var DE=L(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.AuthPlus=void 0;var bn=qa(),Dm=class extends bn.GoogleAuth{static{i(this,"AuthPlus")}JWT=bn.JWT;Compute=bn.Compute;OAuth2=bn.OAuth2Client;GoogleAuth=bn.GoogleAuth;AwsClient=bn.AwsClient;IdentityPoolClient=bn.IdentityPoolClient;ExternalAccountClient=bn.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new bn.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()}};Fc.AuthPlus=Dm});var Om=L(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.Endpoint=void 0;var $E=Mc(),$m=class{static{i(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,o){if(this.applyMethodsFromSchema(e,r,n,o),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let d=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,d,o)}}}applyMethodsFromSchema(e,r,n,o){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let d=n.methods[s];e[s]=this.makeMethod(r,d,o)}}}makeMethod(e,r,n){return(o,s)=>{let d=typeof o=="function"?{}:o;s=typeof o=="function"?o:s;let m=OE(e.rootUrl+e.servicePath+r.path),h={options:{url:m.substring(1,m.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:d,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 v=OE(e.rootUrl+r.mediaUpload.protocols.simple.path);h.mediaUrl=v.substring(1,v.length-1)}if(!s)return(0,$E.createAPIRequest)(h);(0,$E.createAPIRequest)(h,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}};Lc.Endpoint=$m;function OE(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}i(OE,"buildurl")});var NE=L(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.Discovery=void 0;var aj=require("fs"),sj=gt(),uj=require("url"),CE=require("util"),cj=Mc(),lj=Om(),dj=CE.promisify(aj.readFile),Cm=class{static{i(this,"Discovery")}transporter=new sj.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new lj.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"}),o=(await this.transporter.request({url:e,headers:r})).data.items,s=await Promise.all(o.map(async h=>{let v=await this.discoverAPI(h.discoveryRestUrl);return{api:h,endpointCreator:v}})),d={},m={};for(let h of s)m[h.api.name]||(d[h.api.name]={},m[h.api.name]=v=>{let _=typeof v,x;if(_==="string")x=v,v={};else if(_==="object")x=v.version,delete v.version;else throw new Error("Argument error: Accepts only string or object");try{let T=h.endpointCreator(v,this);return Object.freeze(T)}catch(T){throw new Error(CE.format('Unable to load endpoint %s("%s"): %s',h.api.name,x,T.message))}}),d[h.api.name][h.api.version]=h.endpointCreator;return m}async discoverAPI(e){if(typeof e=="string"){let r=uj.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await dj(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 o={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},s=await(0,cj.createAPIRequest)(o);return this.makeEndpoint(s.data)}}};jc.Discovery=Cm});var Qa=L(Ce=>{"use strict";var pj=Ce&&Ce.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:i(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fj=Ce&&Ce.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pj(e,t,r)};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.Endpoint=Ce.Discovery=Ce.AuthPlus=Ce.createAPIRequest=Ce.getAPI=Ce.GaxiosError=Ce.Gaxios=Ce.AwsClient=Ce.IdentityPoolClient=Ce.BaseExternalAccountClient=Ce.ExternalAccountClient=Ce.GoogleAuth=Ce.UserRefreshClient=Ce.Compute=Ce.JWT=Ce.OAuth2Client=Ce.gaxios=Ce.googleAuthLibrary=void 0;Ce.googleAuthLibrary=qa();Ce.gaxios=gt();var Tn=qa();Object.defineProperty(Ce,"OAuth2Client",{enumerable:!0,get:i(function(){return Tn.OAuth2Client},"get")});Object.defineProperty(Ce,"JWT",{enumerable:!0,get:i(function(){return Tn.JWT},"get")});Object.defineProperty(Ce,"Compute",{enumerable:!0,get:i(function(){return Tn.Compute},"get")});Object.defineProperty(Ce,"UserRefreshClient",{enumerable:!0,get:i(function(){return Tn.UserRefreshClient},"get")});Object.defineProperty(Ce,"GoogleAuth",{enumerable:!0,get:i(function(){return Tn.GoogleAuth},"get")});Object.defineProperty(Ce,"ExternalAccountClient",{enumerable:!0,get:i(function(){return Tn.ExternalAccountClient},"get")});Object.defineProperty(Ce,"BaseExternalAccountClient",{enumerable:!0,get:i(function(){return Tn.BaseExternalAccountClient},"get")});Object.defineProperty(Ce,"IdentityPoolClient",{enumerable:!0,get:i(function(){return Tn.IdentityPoolClient},"get")});Object.defineProperty(Ce,"AwsClient",{enumerable:!0,get:i(function(){return Tn.AwsClient},"get")});var kE=gt();Object.defineProperty(Ce,"Gaxios",{enumerable:!0,get:i(function(){return kE.Gaxios},"get")});Object.defineProperty(Ce,"GaxiosError",{enumerable:!0,get:i(function(){return kE.GaxiosError},"get")});var mj=ES();Object.defineProperty(Ce,"getAPI",{enumerable:!0,get:i(function(){return mj.getAPI},"get")});var hj=Mc();Object.defineProperty(Ce,"createAPIRequest",{enumerable:!0,get:i(function(){return hj.createAPIRequest},"get")});var gj=DE();Object.defineProperty(Ce,"AuthPlus",{enumerable:!0,get:i(function(){return gj.AuthPlus},"get")});var yj=NE();Object.defineProperty(Ce,"Discovery",{enumerable:!0,get:i(function(){return yj.Discovery},"get")});var vj=Om();Object.defineProperty(Ce,"Endpoint",{enumerable:!0,get:i(function(){return vj.Endpoint},"get")});fj(Uc(),Ce)});var UE=L(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.drive_v2=void 0;var B=Qa(),zE;(function(t){class e{static{i(this,"Drive")}context;about;apps;changes;channels;children;comments;drives;files;parents;permissions;properties;replies;revisions;teamdrives;constructor(u,f){this.context={_options:u||{},google:f},this.about=new r(this.context),this.apps=new n(this.context),this.changes=new o(this.context),this.channels=new s(this.context),this.children=new d(this.context),this.comments=new m(this.context),this.drives=new h(this.context),this.files=new v(this.context),this.parents=new _(this.context),this.permissions=new x(this.context),this.properties=new T(this.context),this.replies=new P(this.context),this.revisions=new S(this.context),this.teamdrives=new D(this.context)}}t.Drive=e;class r{static{i(this,"Resource$About")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/about").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$About=r;class n{static{i(this,"Resource$Apps")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/apps/{appId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["appId"],pathParams:["appId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/apps").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Apps=n;class o{static{i(this,"Resource$Changes")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes/{changeId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["changeId"],pathParams:["changeId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}getStartPageToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes/startPageToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/changes/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Changes=o;class s{static{i(this,"Resource$Channels")}context;constructor(u){this.context=u}stop(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Channels=s;class d{static{i(this,"Resource$Children")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children/{childId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["folderId","childId"],pathParams:["childId","folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children/{childId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["folderId","childId"],pathParams:["childId","folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["folderId"],pathParams:["folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{folderId}/children").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["folderId"],pathParams:["folderId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Children=d;class m{static{i(this,"Resource$Comments")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Comments=m;class h{static{i(this,"Resource$Drives")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}hide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}/hide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}unhide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}/unhide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Drives=h;class v{static{i(this,"Resource$Files")}context;constructor(u){this.context=u}copy(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/copy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}emptyTrash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/trash").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}export(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/export").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","mimeType"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}generateCseToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/generateCseToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}generateIds(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/generateIds").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}listLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/listLabels").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}modifyLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/modifyLabels").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}touch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/touch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}trash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/trash").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}untrash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/untrash").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v2/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Files=v;class _{static{i(this,"Resource$Parents")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents/{parentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","parentId"],pathParams:["fileId","parentId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents/{parentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","parentId"],pathParams:["fileId","parentId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/parents").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Parents=_;class x{static{i(this,"Resource$Permissions")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}getIdForEmail(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/permissionIds/{email}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["email"],pathParams:["email"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Permissions=x;class T{static{i(this,"Resource$Properties")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/properties/{propertyKey}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","propertyKey"],pathParams:["fileId","propertyKey"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Properties=T;class P{static{i(this,"Resource$Replies")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Replies=P;class S{static{i(this,"Resource$Revisions")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}patch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Revisions=S;class D{static{i(this,"Resource$Teamdrives")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}insert(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v2/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,B.createAPIRequest)(g,c);else return(0,B.createAPIRequest)(g)}}t.Resource$Teamdrives=D})(zE||(qc.drive_v2=zE={}))});var FE=L(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.drive_v3=void 0;var Z=Qa(),ME;(function(t){class e{static{i(this,"Drive")}context;about;accessproposals;approvals;apps;changes;channels;comments;drives;files;operations;permissions;replies;revisions;teamdrives;constructor(u,f){this.context={_options:u||{},google:f},this.about=new r(this.context),this.accessproposals=new n(this.context),this.approvals=new o(this.context),this.apps=new s(this.context),this.changes=new d(this.context),this.channels=new m(this.context),this.comments=new h(this.context),this.drives=new v(this.context),this.files=new _(this.context),this.operations=new x(this.context),this.permissions=new T(this.context),this.replies=new P(this.context),this.revisions=new S(this.context),this.teamdrives=new D(this.context)}}t.Drive=e;class r{static{i(this,"Resource$About")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/about").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$About=r;class n{static{i(this,"Resource$Accessproposals")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/accessproposals/{proposalId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","proposalId"],pathParams:["fileId","proposalId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/accessproposals").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}resolve(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/accessproposals/{proposalId}:resolve").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","proposalId"],pathParams:["fileId","proposalId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Accessproposals=n;class o{static{i(this,"Resource$Approvals")}context;constructor(u){this.context=u}approve(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:approve").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}cancel(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:cancel").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}comment(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:comment").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}decline(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:decline").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}reassign(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals/{approvalId}:reassign").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","approvalId"],pathParams:["approvalId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}start(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/approvals:start").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Approvals=o;class s{static{i(this,"Resource$Apps")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/apps/{appId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["appId"],pathParams:["appId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/apps").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Apps=s;class d{static{i(this,"Resource$Changes")}context;constructor(u){this.context=u}getStartPageToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/changes/startPageToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/changes").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["pageToken"],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/changes/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["pageToken"],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Changes=d;class m{static{i(this,"Resource$Channels")}context;constructor(u){this.context=u}stop(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Channels=m;class h{static{i(this,"Resource$Comments")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Comments=h;class v{static{i(this,"Resource$Drives")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}hide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}/hide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}unhide(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}/unhide").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/drives/{driveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["driveId"],pathParams:["driveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Drives=v;class _{static{i(this,"Resource$Files")}context;constructor(u){this.context=u}copy(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/copy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}download(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/download").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}emptyTrash(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/trash").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}export(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/export").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","mimeType"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}generateCseToken(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/generateCseToken").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}generateIds(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/generateIds").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}listLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/listLabels").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}modifyLabels(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/modifyLabels").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,mediaUrl:(b+"/upload/drive/v3/files/{fileId}").replace(/([^:]\/)\/+/g,"$1"),requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}watch(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Files=_;class x{static{i(this,"Resource$Operations")}context;constructor(u){this.context=u}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/operations/{name}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["name"],pathParams:["name"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Operations=x;class T{static{i(this,"Resource$Permissions")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/permissions/{permissionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","permissionId"],pathParams:["fileId","permissionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Permissions=T;class P{static{i(this,"Resource$Replies")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","commentId"],pathParams:["commentId","fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","commentId","replyId"],pathParams:["commentId","fileId","replyId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Replies=P;class S{static{i(this,"Resource$Revisions")}context;constructor(u){this.context=u}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["fileId"],pathParams:["fileId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/files/{fileId}/revisions/{revisionId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["fileId","revisionId"],pathParams:["fileId","revisionId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Revisions=S;class D{static{i(this,"Resource$Teamdrives")}context;constructor(u){this.context=u}create(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},l),params:y,requiredParams:["requestId"],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}delete(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}get(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}list(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},l),params:y,requiredParams:[],pathParams:[],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}update(u,f,c){let y=u||{},l=f||{};typeof u=="function"&&(c=u,y={},l={}),typeof f=="function"&&(c=f,l={});let b=l.rootUrl||"https://www.googleapis.com/",g={options:Object.assign({url:(b+"/drive/v3/teamdrives/{teamDriveId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},l),params:y,requiredParams:["teamDriveId"],pathParams:["teamDriveId"],context:this.context};if(c)(0,Z.createAPIRequest)(g,c);else return(0,Z.createAPIRequest)(g)}}t.Resource$Teamdrives=D})(ME||(Bc.drive_v3=ME={}))});var $e=L(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.AuthPlus=Gt.drive_v3=Gt.drive_v2=Gt.auth=Gt.VERSIONS=void 0;Gt.drive=_j;var LE=Qa(),jE=UE();Object.defineProperty(Gt,"drive_v2",{enumerable:!0,get:i(function(){return jE.drive_v2},"get")});var qE=FE();Object.defineProperty(Gt,"drive_v3",{enumerable:!0,get:i(function(){return qE.drive_v3},"get")});Gt.VERSIONS={v2:jE.drive_v2.Drive,v3:qE.drive_v3.Drive};function _j(t){return(0,LE.getAPI)("drive",t,Gt.VERSIONS,this)}i(_j,"drive");var wj=new LE.AuthPlus;Gt.auth=wj;var Pj=Qa();Object.defineProperty(Gt,"AuthPlus",{enumerable:!0,get:i(function(){return Pj.AuthPlus},"get")})});var es=L((Nm,km)=>{(function(t,e){typeof Nm=="object"&&typeof km<"u"?km.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Nm,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",o="second",s="minute",d="hour",m="day",h="week",v="month",_="quarter",x="year",T="date",P="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|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,E={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:i(function(se){var X=["th","st","nd","rd"],Y=se%100;return"["+se+(X[(Y-20)%10]||X[Y]||X[0])+"]"},"ordinal")},u=i(function(se,X,Y){var ne=String(se);return!ne||ne.length>=X?se:""+Array(X+1-ne.length).join(Y)+se},"m"),f={s:u,z:i(function(se){var X=-se.utcOffset(),Y=Math.abs(X),ne=Math.floor(Y/60),ee=Y%60;return(X<=0?"+":"-")+u(ne,2,"0")+":"+u(ee,2,"0")},"z"),m:i(function se(X,Y){if(X.date()<Y.date())return-se(Y,X);var ne=12*(Y.year()-X.year())+(Y.month()-X.month()),ee=X.clone().add(ne,v),ce=Y-ee<0,de=X.clone().add(ne+(ce?-1:1),v);return+(-(ne+(Y-ee)/(ce?ee-de:de-ee))||0)},"t"),a:i(function(se){return se<0?Math.ceil(se)||0:Math.floor(se)},"a"),p:i(function(se){return{M:v,y:x,w:h,d:m,D:T,h:d,m:s,s:o,ms:n,Q:_}[se]||String(se||"").toLowerCase().replace(/s$/,"")},"p"),u:i(function(se){return se===void 0},"u")},c="en",y={};y[c]=E;var l=i(function(se){return se instanceof re},"p"),b=i(function se(X,Y,ne){var ee;if(!X)return c;if(typeof X=="string"){var ce=X.toLowerCase();y[ce]&&(ee=ce),Y&&(y[ce]=Y,ee=ce);var de=X.split("-");if(!ee&&de.length>1)return se(de[0])}else{var ke=X.name;y[ke]=X,ee=ke}return!ne&&ee&&(c=ee),ee||!ne&&c},"t"),g=i(function(se,X){if(l(se))return se.clone();var Y=typeof X=="object"?X:{};return Y.date=se,Y.args=arguments,new re(Y)},"w"),ae=f;ae.l=b,ae.i=l,ae.w=function(se,X){return g(se,{locale:X.$L,utc:X.$u,x:X.$x,$offset:X.$offset})};var re=(function(){function se(Y){this.$L=b(Y.locale,null,!0),this.parse(Y)}i(se,"M");var X=se.prototype;return X.parse=function(Y){this.$d=(function(ne){var ee=ne.date,ce=ne.utc;if(ee===null)return new Date(NaN);if(ae.u(ee))return new Date;if(ee instanceof Date)return new Date(ee);if(typeof ee=="string"&&!/Z$/i.test(ee)){var de=ee.match(S);if(de){var ke=de[2]-1||0,Me=(de[7]||"0").substring(0,3);return ce?new Date(Date.UTC(de[1],ke,de[3]||1,de[4]||0,de[5]||0,de[6]||0,Me)):new Date(de[1],ke,de[3]||1,de[4]||0,de[5]||0,de[6]||0,Me)}}return new Date(ee)})(Y),this.$x=Y.x||{},this.init()},X.init=function(){var Y=this.$d;this.$y=Y.getFullYear(),this.$M=Y.getMonth(),this.$D=Y.getDate(),this.$W=Y.getDay(),this.$H=Y.getHours(),this.$m=Y.getMinutes(),this.$s=Y.getSeconds(),this.$ms=Y.getMilliseconds()},X.$utils=function(){return ae},X.isValid=function(){return this.$d.toString()!==P},X.isSame=function(Y,ne){var ee=g(Y);return this.startOf(ne)<=ee&&ee<=this.endOf(ne)},X.isAfter=function(Y,ne){return g(Y)<this.startOf(ne)},X.isBefore=function(Y,ne){return this.endOf(ne)<g(Y)},X.$g=function(Y,ne,ee){return ae.u(Y)?this[ne]:this.set(ee,Y)},X.unix=function(){return Math.floor(this.valueOf()/1e3)},X.valueOf=function(){return this.$d.getTime()},X.startOf=function(Y,ne){var ee=this,ce=!!ae.u(ne)||ne,de=ae.p(Y),ke=i(function(Ht,Ze){var Je=ae.w(ee.$u?Date.UTC(ee.$y,Ze,Ht):new Date(ee.$y,Ze,Ht),ee);return ce?Je:Je.endOf(m)},"l"),Me=i(function(Ht,Ze){return ae.w(ee.toDate()[Ht].apply(ee.toDate("s"),(ce?[0,0,0,0]:[23,59,59,999]).slice(Ze)),ee)},"$"),Ke=this.$W,Qe=this.$M,Tt=this.$D,ie="set"+(this.$u?"UTC":"");switch(de){case x:return ce?ke(1,0):ke(31,11);case v:return ce?ke(1,Qe):ke(0,Qe+1);case h:var lt=this.$locale().weekStart||0,ft=(Ke<lt?Ke+7:Ke)-lt;return ke(ce?Tt-ft:Tt+(6-ft),Qe);case m:case T:return Me(ie+"Hours",0);case d:return Me(ie+"Minutes",1);case s:return Me(ie+"Seconds",2);case o:return Me(ie+"Milliseconds",3);default:return this.clone()}},X.endOf=function(Y){return this.startOf(Y,!1)},X.$set=function(Y,ne){var ee,ce=ae.p(Y),de="set"+(this.$u?"UTC":""),ke=(ee={},ee[m]=de+"Date",ee[T]=de+"Date",ee[v]=de+"Month",ee[x]=de+"FullYear",ee[d]=de+"Hours",ee[s]=de+"Minutes",ee[o]=de+"Seconds",ee[n]=de+"Milliseconds",ee)[ce],Me=ce===m?this.$D+(ne-this.$W):ne;if(ce===v||ce===x){var Ke=this.clone().set(T,1);Ke.$d[ke](Me),Ke.init(),this.$d=Ke.set(T,Math.min(this.$D,Ke.daysInMonth())).$d}else ke&&this.$d[ke](Me);return this.init(),this},X.set=function(Y,ne){return this.clone().$set(Y,ne)},X.get=function(Y){return this[ae.p(Y)]()},X.add=function(Y,ne){var ee,ce=this;Y=Number(Y);var de=ae.p(ne),ke=i(function(Qe){var Tt=g(ce);return ae.w(Tt.date(Tt.date()+Math.round(Qe*Y)),ce)},"y");if(de===v)return this.set(v,this.$M+Y);if(de===x)return this.set(x,this.$y+Y);if(de===m)return ke(1);if(de===h)return ke(7);var Me=(ee={},ee[s]=e,ee[d]=r,ee[o]=t,ee)[de]||1,Ke=this.$d.getTime()+Y*Me;return ae.w(Ke,this)},X.subtract=function(Y,ne){return this.add(-1*Y,ne)},X.format=function(Y){var ne=this,ee=this.$locale();if(!this.isValid())return ee.invalidDate||P;var ce=Y||"YYYY-MM-DDTHH:mm:ssZ",de=ae.z(this),ke=this.$H,Me=this.$m,Ke=this.$M,Qe=ee.weekdays,Tt=ee.months,ie=ee.meridiem,lt=i(function(Ze,Je,A,$){return Ze&&(Ze[Je]||Ze(ne,ce))||A[Je].slice(0,$)},"h"),ft=i(function(Ze){return ae.s(ke%12||12,Ze,"0")},"d"),Ht=ie||function(Ze,Je,A){var $=Ze<12?"AM":"PM";return A?$.toLowerCase():$};return ce.replace(D,(function(Ze,Je){return Je||(function(A){switch(A){case"YY":return String(ne.$y).slice(-2);case"YYYY":return ae.s(ne.$y,4,"0");case"M":return Ke+1;case"MM":return ae.s(Ke+1,2,"0");case"MMM":return lt(ee.monthsShort,Ke,Tt,3);case"MMMM":return lt(Tt,Ke);case"D":return ne.$D;case"DD":return ae.s(ne.$D,2,"0");case"d":return String(ne.$W);case"dd":return lt(ee.weekdaysMin,ne.$W,Qe,2);case"ddd":return lt(ee.weekdaysShort,ne.$W,Qe,3);case"dddd":return Qe[ne.$W];case"H":return String(ke);case"HH":return ae.s(ke,2,"0");case"h":return ft(1);case"hh":return ft(2);case"a":return Ht(ke,Me,!0);case"A":return Ht(ke,Me,!1);case"m":return String(Me);case"mm":return ae.s(Me,2,"0");case"s":return String(ne.$s);case"ss":return ae.s(ne.$s,2,"0");case"SSS":return ae.s(ne.$ms,3,"0");case"Z":return de}return null})(Ze)||de.replace(":","")}))},X.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},X.diff=function(Y,ne,ee){var ce,de=this,ke=ae.p(ne),Me=g(Y),Ke=(Me.utcOffset()-this.utcOffset())*e,Qe=this-Me,Tt=i(function(){return ae.m(de,Me)},"D");switch(ke){case x:ce=Tt()/12;break;case v:ce=Tt();break;case _:ce=Tt()/3;break;case h:ce=(Qe-Ke)/6048e5;break;case m:ce=(Qe-Ke)/864e5;break;case d:ce=Qe/r;break;case s:ce=Qe/e;break;case o:ce=Qe/t;break;default:ce=Qe}return ee?ce:ae.a(ce)},X.daysInMonth=function(){return this.endOf(v).$D},X.$locale=function(){return y[this.$L]},X.locale=function(Y,ne){if(!Y)return this.$L;var ee=this.clone(),ce=b(Y,ne,!0);return ce&&(ee.$L=ce),ee},X.clone=function(){return ae.w(this.$d,this)},X.toDate=function(){return new Date(this.valueOf())},X.toJSON=function(){return this.isValid()?this.toISOString():null},X.toISOString=function(){return this.$d.toISOString()},X.toString=function(){return this.$d.toUTCString()},se})(),Ue=re.prototype;return g.prototype=Ue,[["$ms",n],["$s",o],["$m",s],["$H",d],["$W",m],["$M",v],["$y",x],["$D",T]].forEach((function(se){Ue[se[1]]=function(X){return this.$g(X,se[0],se[1])}})),g.extend=function(se,X){return se.$i||(se(X,re,g),se.$i=!0),g},g.locale=b,g.isDayjs=l,g.unix=function(se){return g(1e3*se)},g.en=y[c],g.Ls=y,g.p={},g}))});var Hj={};Rs(Hj,{createGoogleClient:()=>oe,getAccessToken:()=>it,googleDrive:()=>Gj,googleDriveAuth:()=>J});module.exports=Y0(Hj);var X0=Object.freeze({status:"aborted"});function fe(t,e,r){function n(m,h){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:h,constr:d,traits:new Set},enumerable:!1}),m._zod.traits.has(t))return;m._zod.traits.add(t),e(m,h);let v=d.prototype,_=Object.keys(v);for(let x=0;x<_.length;x++){let T=_[x];T in m||(m[T]=v[T].bind(m))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function d(m){var h;let v=r?.Parent?new s:this;n(v,m),(h=v._zod).deferred??(h.deferred=[]);for(let _ of v._zod.deferred)_();return v}return i(d,"_"),Object.defineProperty(d,"init",{value:n}),Object.defineProperty(d,Symbol.hasInstance,{value:i(m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(t),"value")}),Object.defineProperty(d,"name",{value:t}),d}i(fe,"$constructor");var zr=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ds=class extends Error{static{i(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Tl={};function un(t){return t&&Object.assign(Tl,t),Tl}i(un,"config");function El(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}i(El,"getEnumValues");function Vh(t,e){return typeof e=="bigint"?e.toString():e}i(Vh,"jsonStringifyReplacer");function Os(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Os,"cached");function Gh(t){return t==null}i(Gh,"nullish");function Cs(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}i(Cs,"cleanRegex");var Bh=Symbol("evaluating");function yt(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Bh)return n===void 0&&(n=Bh,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}i(yt,"defineLazy");var xl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Lo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}i(Lo,"isObject");var Q0=Os(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Hh(t){if(Lo(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Lo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(Hh,"isPlainObject");var Wh=new Set(["string","number","symbol"]);function Mi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Mi,"escapeRegex");function Ns(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}i(Ns,"clone");function at(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:i(()=>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:i(()=>e.error,"error")}:e}i(at,"normalizeParams");function Zh(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}i(Zh,"optionalKeys");var Kh={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 Fi(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}i(Fi,"aborted");function On(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}i(On,"prefixIssues");function $s(t){return typeof t=="string"?t:t?.message}i($s,"unwrapMessage");function Cn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=$s(t.inst?._zod.def?.error?.(t))??$s(e?.error?.(t))??$s(r.customError?.(t))??$s(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}i(Cn,"finalizeIssue");function Jh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}i(Jh,"getLengthableOrigin");function Il(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}i(Il,"issue");var Yh=i((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,Vh,2),Object.defineProperty(t,"toString",{value:i(()=>t.message,"value"),enumerable:!1})},"initializer"),Xh=fe("$ZodError",Yh),jo=fe("$ZodError",Yh,{Parent:Error});var tD=i(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},d=e._zod.run({value:r,issues:[]},s);if(d instanceof Promise)throw new zr;if(d.issues.length){let m=new(o?.Err??t)(d.issues.map(h=>Cn(h,s,un())));throw xl(m,o?.callee),m}return d.value},"_parse"),ks=tD(jo),rD=i(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},d=e._zod.run({value:r,issues:[]},s);if(d instanceof Promise&&(d=await d),d.issues.length){let m=new(o?.Err??t)(d.issues.map(h=>Cn(h,s,un())));throw xl(m,o?.callee),m}return d.value},"_parseAsync"),zs=rD(jo),nD=i(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new zr;return s.issues.length?{success:!1,error:new(t??Xh)(s.issues.map(d=>Cn(d,o,un())))}:{success:!0,data:s.value}},"_safeParse"),qo=nD(jo),iD=i(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(d=>Cn(d,o,un())))}:{success:!0,data:s.value}},"_safeParseAsync"),Bo=iD(jo);var oD="(?:(?:\\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])))",aD=new RegExp(`^${oD}$`);var Qh=i(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),eg=/^-?\d+n?$/,tg=/^-?\d+$/,Al=/^-?\d+(?:\.\d+)?$/,rg=/^(?:true|false)$/i;var Nn=fe("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),sD={number:"number",bigint:"bigint",object:"date"};var ng=fe("$ZodCheckGreaterThan",(t,e)=>{Nn.init(t,e);let r=sD[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.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 ig=fe("$ZodCheckNumberFormat",(t,e)=>{Nn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=Kh[e.format];t._zod.onattach.push(d=>{let m=d._zod.bag;m.format=e.format,m.minimum=o,m.maximum=s,r&&(m.pattern=tg)}),t._zod.check=d=>{let m=d.value;if(r){if(!Number.isInteger(m)){d.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:m,inst:t});return}if(!Number.isSafeInteger(m)){m>0?d.issues.push({input:m,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}):d.issues.push({input:m,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}}m<o&&d.issues.push({origin:"number",input:m,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),m>s&&d.issues.push({origin:"number",input:m,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var og=fe("$ZodCheckMinLength",(t,e)=>{var r;Nn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Gh(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let d=Jh(o);n.issues.push({origin:d,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}});var Rl=fe("$ZodCheckStringFormat",(t,e)=>{var r,n;Nn.init(t,e),t._zod.onattach.push(o=>{let s=o._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=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),ag=fe("$ZodCheckRegex",(t,e)=>{Rl.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 ug={major:4,minor:3,patch:6};var dt=fe("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=ug;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._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 o=i((d,m,h)=>{let v=Fi(d),_;for(let x of m){if(x._zod.def.when){if(!x._zod.def.when(d))continue}else if(v)continue;let T=d.issues.length,P=x._zod.check(d);if(P instanceof Promise&&h?.async===!1)throw new zr;if(_||P instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await P,d.issues.length!==T&&(v||(v=Fi(d,T)))});else{if(d.issues.length===T)continue;v||(v=Fi(d,T))}}return _?_.then(()=>d):d},"runChecks"),s=i((d,m,h)=>{if(Fi(d))return d.aborted=!0,d;let v=o(m,n,h);if(v instanceof Promise){if(h.async===!1)throw new zr;return v.then(_=>t._zod.parse(_,h))}return t._zod.parse(v,h)},"handleCanaryResult");t._zod.run=(d,m)=>{if(m.skipChecks)return t._zod.parse(d,m);if(m.direction==="backward"){let v=t._zod.parse({value:d.value,issues:[]},{...m,skipChecks:!0});return v instanceof Promise?v.then(_=>s(_,d,m)):s(v,d,m)}let h=t._zod.parse(d,m);if(h instanceof Promise){if(m.async===!1)throw new zr;return h.then(v=>o(v,n,m))}return o(h,n,m)}}yt(t,"~standard",()=>({validate:i(o=>{try{let s=qo(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Bo(t,o).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Fs=fe("$ZodString",(t,e)=>{dt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Qh(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=fe("$ZodStringFormat",(t,e)=>{Rl.init(t,e),Fs.init(t,e)});var fg=fe("$ZodURL",(t,e)=>{Dl.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.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(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}});var $l=fe("$ZodNumber",(t,e)=>{dt.init(t,e),t._zod.pattern=t._zod.bag.pattern??Al,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),mg=fe("$ZodNumberFormat",(t,e)=>{ig.init(t,e),$l.init(t,e)}),Ol=fe("$ZodBoolean",(t,e)=>{dt.init(t,e),t._zod.pattern=rg,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),hg=fe("$ZodBigInt",(t,e)=>{dt.init(t,e),t._zod.pattern=eg,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 gg=fe("$ZodAny",(t,e)=>{dt.init(t,e),t._zod.parse=r=>r}),yg=fe("$ZodUnknown",(t,e)=>{dt.init(t,e),t._zod.parse=r=>r});var vg=fe("$ZodVoid",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),_g=fe("$ZodDate",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});function cg(t,e,r){t.issues.length&&e.issues.push(...On(r,t.issues)),e.value[r]=t.value}i(cg,"handleArrayResult");var wg=fe("$ZodArray",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let d=0;d<o.length;d++){let m=o[d],h=e.element._zod.run({value:m,issues:[]},n);h instanceof Promise?s.push(h.then(v=>cg(v,r,d))):cg(h,r,d)}return s.length?Promise.all(s).then(()=>r):r}});function Ms(t,e,r,n,o){if(t.issues.length){if(o&&!(r in n))return;e.issues.push(...On(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}i(Ms,"handlePropertyResult");function uD(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=Zh(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}i(uD,"normalizeDef");function cD(t,e,r,n,o,s){let d=[],m=o.keySet,h=o.catchall._zod,v=h.def.type,_=h.optout==="optional";for(let x in e){if(m.has(x))continue;if(v==="never"){d.push(x);continue}let T=h.run({value:e[x],issues:[]},n);T instanceof Promise?t.push(T.then(P=>Ms(P,r,x,e,_))):Ms(T,r,x,e,_)}return d.length&&r.issues.push({code:"unrecognized_keys",keys:d,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}i(cD,"handleCatchall");var Pg=fe("$ZodObject",(t,e)=>{if(dt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let m=e.shape;Object.defineProperty(e,"shape",{get:i(()=>{let h={...m};return Object.defineProperty(e,"shape",{value:h}),h},"get")})}let n=Os(()=>uD(e));yt(t._zod,"propValues",()=>{let m=e.shape,h={};for(let v in m){let _=m[v]._zod;if(_.values){h[v]??(h[v]=new Set);for(let x of _.values)h[v].add(x)}}return h});let o=Lo,s=e.catchall,d;t._zod.parse=(m,h)=>{d??(d=n.value);let v=m.value;if(!o(v))return m.issues.push({expected:"object",code:"invalid_type",input:v,inst:t}),m;m.value={};let _=[],x=d.shape;for(let T of d.keys){let P=x[T],S=P._zod.optout==="optional",D=P._zod.run({value:v[T],issues:[]},h);D instanceof Promise?_.push(D.then(E=>Ms(E,m,T,v,S))):Ms(D,m,T,v,S)}return s?cD(_,v,m,h,n.value,t):_.length?Promise.all(_).then(()=>m):m}});function lg(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let o=t.filter(s=>!Fi(s));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(d=>Cn(d,n,un())))}),e)}i(lg,"handleUnionResults");var Cl=fe("$ZodUnion",(t,e)=>{dt.init(t,e),yt(t._zod,"optin",()=>e.options.some(o=>o._zod.optin==="optional")?"optional":void 0),yt(t._zod,"optout",()=>e.options.some(o=>o._zod.optout==="optional")?"optional":void 0),yt(t._zod,"values",()=>{if(e.options.every(o=>o._zod.values))return new Set(e.options.flatMap(o=>Array.from(o._zod.values)))}),yt(t._zod,"pattern",()=>{if(e.options.every(o=>o._zod.pattern)){let o=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Cs(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(o,s)=>{if(r)return n(o,s);let d=!1,m=[];for(let h of e.options){let v=h._zod.run({value:o.value,issues:[]},s);if(v instanceof Promise)m.push(v),d=!0;else{if(v.issues.length===0)return v;m.push(v)}}return d?Promise.all(m).then(h=>lg(h,o,t,s)):lg(m,o,t,s)}});var bg=fe("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Cl.init(t,e);let r=t._zod.parse;yt(t._zod,"propValues",()=>{let o={};for(let s of e.options){let d=s._zod.propValues;if(!d||Object.keys(d).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[m,h]of Object.entries(d)){o[m]||(o[m]=new Set);for(let v of h)o[m].add(v)}}return o});let n=Os(()=>{let o=e.options,s=new Map;for(let d of o){let m=d._zod.propValues?.[e.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(d)}"`);for(let h of m){if(s.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);s.set(h,d)}}return s});t._zod.parse=(o,s)=>{let d=o.value;if(!Lo(d))return o.issues.push({code:"invalid_type",expected:"object",input:d,inst:t}),o;let m=n.value.get(d?.[e.discriminator]);return m?m._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:d,path:[e.discriminator],inst:t}),o)}});var Tg=fe("$ZodRecord",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Hh(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[],d=e.keyType._zod.values;if(d){r.value={};let m=new Set;for(let v of d)if(typeof v=="string"||typeof v=="number"||typeof v=="symbol"){m.add(typeof v=="number"?v.toString():v);let _=e.valueType._zod.run({value:o[v],issues:[]},n);_ instanceof Promise?s.push(_.then(x=>{x.issues.length&&r.issues.push(...On(v,x.issues)),r.value[v]=x.value})):(_.issues.length&&r.issues.push(...On(v,_.issues)),r.value[v]=_.value)}let h;for(let v in o)m.has(v)||(h=h??[],h.push(v));h&&h.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:h})}else{r.value={};for(let m of Reflect.ownKeys(o)){if(m==="__proto__")continue;let h=e.keyType._zod.run({value:m,issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&Al.test(m)&&h.issues.length){let x=e.keyType._zod.run({value:Number(m),issues:[]},n);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(h=x)}if(h.issues.length){e.mode==="loose"?r.value[m]=o[m]:r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(x=>Cn(x,n,un())),input:m,path:[m],inst:t});continue}let _=e.valueType._zod.run({value:o[m],issues:[]},n);_ instanceof Promise?s.push(_.then(x=>{x.issues.length&&r.issues.push(...On(m,x.issues)),r.value[h.value]=x.value})):(_.issues.length&&r.issues.push(...On(m,_.issues)),r.value[h.value]=_.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Sg=fe("$ZodEnum",(t,e)=>{dt.init(t,e);let r=El(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>Wh.has(typeof o)).map(o=>typeof o=="string"?Mi(o):o.toString()).join("|")})$`),t._zod.parse=(o,s)=>{let d=o.value;return n.has(d)||o.issues.push({code:"invalid_value",values:r,input:d,inst:t}),o}}),Eg=fe("$ZodLiteral",(t,e)=>{if(dt.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"?Mi(n):n?Mi(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var xg=fe("$ZodTransform",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(d=>(r.value=d,r));if(o instanceof Promise)throw new zr;return r.value=o,r}});function dg(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}i(dg,"handleOptionalResult");var Ig=fe("$ZodOptional",(t,e)=>{dt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",yt(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),yt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Cs(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>dg(s,r.value)):dg(o,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var Ag=fe("$ZodNullable",(t,e)=>{dt.init(t,e),yt(t._zod,"optin",()=>e.innerType._zod.optin),yt(t._zod,"optout",()=>e.innerType._zod.optout),yt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Cs(r.source)}|null)$`):void 0}),yt(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=fe("$ZodPipe",(t,e)=>{dt.init(t,e),yt(t._zod,"values",()=>e.in._zod.values),yt(t._zod,"optin",()=>e.in._zod.optin),yt(t._zod,"optout",()=>e.out._zod.optout),yt(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(d=>Us(d,e.in,n)):Us(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Us(s,e.out,n)):Us(o,e.out,n)}});function Us(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}i(Us,"handlePipeResult");var Dg=fe("$ZodCustom",(t,e)=>{Nn.init(t,e),dt.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>pg(s,r,n,t));pg(o,r,n,t)}});function pg(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(Il(o))}}i(pg,"handleRefineResult");var Og;var Nl=class{static{i(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 o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Cg(){return new Nl}i(Cg,"registry");(Og=globalThis).__zod_globalRegistry??(Og.__zod_globalRegistry=Cg());var kl=globalThis.__zod_globalRegistry;function Ng(t,e){return new t({type:"string",...at(e)})}i(Ng,"_string");function kg(t,e){return new t({type:"string",coerce:!0,...at(e)})}i(kg,"_coercedString");function zg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...at(e)})}i(zg,"_url");function Ug(t,e){return new t({type:"number",checks:[],...at(e)})}i(Ug,"_number");function Mg(t,e){return new t({type:"number",coerce:!0,checks:[],...at(e)})}i(Mg,"_coercedNumber");function Fg(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...at(e)})}i(Fg,"_int");function Lg(t,e){return new t({type:"boolean",...at(e)})}i(Lg,"_boolean");function jg(t,e){return new t({type:"boolean",coerce:!0,...at(e)})}i(jg,"_coercedBoolean");function qg(t,e){return new t({type:"bigint",coerce:!0,...at(e)})}i(qg,"_coercedBigint");function Bg(t){return new t({type:"any"})}i(Bg,"_any");function Vg(t){return new t({type:"unknown"})}i(Vg,"_unknown");function Gg(t,e){return new t({type:"void",...at(e)})}i(Gg,"_void");function Hg(t,e){return new t({type:"date",coerce:!0,...at(e)})}i(Hg,"_coercedDate");function Ls(t,e){return new ng({check:"greater_than",...at(e),value:t,inclusive:!0})}i(Ls,"_gte");function Tr(t,e){return new og({check:"min_length",...at(e),minimum:t})}i(Tr,"_minLength");function kn(t,e){return new ag({check:"string_format",format:"regex",...at(e),pattern:t})}i(kn,"_regex");function Wg(t,e,r){let n=at(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}i(Wg,"_custom");var vt=fe("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");dt.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>ks(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>qo(t,r,n),t.parseAsync=async(r,n)=>zs(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Bo(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)=>Ns(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),qs=fe("ZodMiniString",(t,e)=>{Fs.init(t,e),vt.init(t,e)});function I(t){return Ng(qs,t)}i(I,"string");var Zg=fe("ZodMiniStringFormat",(t,e)=>{Dl.init(t,e),qs.init(t,e)});var bD=fe("ZodMiniURL",(t,e)=>{fg.init(t,e),Zg.init(t,e)});function Kg(t){return zg(bD,t)}i(Kg,"url");var Bs=fe("ZodMiniNumber",(t,e)=>{$l.init(t,e),vt.init(t,e)});function Et(t){return Ug(Bs,t)}i(Et,"number");var TD=fe("ZodMiniNumberFormat",(t,e)=>{mg.init(t,e),Bs.init(t,e)});function Jg(t){return Fg(TD,t)}i(Jg,"int");var zl=fe("ZodMiniBoolean",(t,e)=>{Ol.init(t,e),vt.init(t,e)});function Ve(t){return Lg(zl,t)}i(Ve,"boolean");var Yg=fe("ZodMiniBigInt",(t,e)=>{hg.init(t,e),vt.init(t,e)});var SD=fe("ZodMiniAny",(t,e)=>{gg.init(t,e),vt.init(t,e)});function Go(){return Bg(SD)}i(Go,"any");var ED=fe("ZodMiniUnknown",(t,e)=>{yg.init(t,e),vt.init(t,e)});function Ae(){return Vg(ED)}i(Ae,"unknown");var xD=fe("ZodMiniVoid",(t,e)=>{vg.init(t,e),vt.init(t,e)});function Xg(t){return Gg(xD,t)}i(Xg,"_void");var Qg=fe("ZodMiniDate",(t,e)=>{_g.init(t,e),vt.init(t,e)});var ID=fe("ZodMiniArray",(t,e)=>{wg.init(t,e),vt.init(t,e)});function be(t,e){return new ID({type:"array",element:t,...at(e)})}i(be,"array");var AD=fe("ZodMiniObject",(t,e)=>{Pg.init(t,e),vt.init(t,e),yt(t,"shape",()=>e.shape)});function U(t,e){let r={type:"object",shape:t??{},...at(e)};return new AD(r)}i(U,"object");var RD=fe("ZodMiniUnion",(t,e)=>{Cl.init(t,e),vt.init(t,e)});function ze(t,e){return new RD({type:"union",options:t,...at(e)})}i(ze,"union");var DD=fe("ZodMiniDiscriminatedUnion",(t,e)=>{bg.init(t,e),vt.init(t,e)});function zn(t,e,r){return new DD({type:"union",options:e,discriminator:t,...at(r)})}i(zn,"discriminatedUnion");var $D=fe("ZodMiniRecord",(t,e)=>{Tg.init(t,e),vt.init(t,e)});function Re(t,e,r){return new $D({type:"record",keyType:t,valueType:e,...at(r)})}i(Re,"record");var OD=fe("ZodMiniEnum",(t,e)=>{Sg.init(t,e),vt.init(t,e),t.options=Object.values(e.entries)});function Pe(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new OD({type:"enum",entries:r,...at(e)})}i(Pe,"_enum");var CD=fe("ZodMiniLiteral",(t,e)=>{Eg.init(t,e),vt.init(t,e)});function ve(t,e){return new CD({type:"literal",values:Array.isArray(t)?t:[t],...at(e)})}i(ve,"literal");var ND=fe("ZodMiniTransform",(t,e)=>{xg.init(t,e),vt.init(t,e)});function Un(t){return new ND({type:"transform",transform:t})}i(Un,"transform");var kD=fe("ZodMiniOptional",(t,e)=>{Ig.init(t,e),vt.init(t,e)});function W(t){return new kD({type:"optional",innerType:t})}i(W,"optional");var zD=fe("ZodMiniNullable",(t,e)=>{Ag.init(t,e),vt.init(t,e)});function Ho(t){return new zD({type:"nullable",innerType:t})}i(Ho,"nullable");var UD=fe("ZodMiniPipe",(t,e)=>{Rg.init(t,e),vt.init(t,e)});function Mn(t,e){return new UD({type:"pipe",in:t,out:e})}i(Mn,"pipe");var MD=fe("ZodMiniCustom",(t,e)=>{Dg.init(t,e),vt.init(t,e)});function Vs(t,e){return Wg(MD,t??(()=>!0),e)}i(Vs,"custom");var Wo={};Rs(Wo,{bigint:()=>VD,boolean:()=>BD,date:()=>GD,number:()=>qD,string:()=>jD});function jD(t){return kg(qs,t)}i(jD,"string");function qD(t){return Mg(Bs,t)}i(qD,"number");function BD(t){return jg(zl,t)}i(BD,"boolean");function VD(t){return qg(Yg,t)}i(VD,"bigint");function GD(t){return Hg(Qg,t)}i(GD,"date");var Ml=U({retryOnFailure:U({defaultValue:W(Ve()),hide:W(Ve())}),continueOnFailure:U({defaultValue:W(Ve()),hide:W(Ve())})}),Ul=class{constructor(e,r,n,o,s,d,m,h,v,_,x,T,P){this.name=e;this.displayName=r;this.description=n;this.props=o;this.propertyGroups=s;this.run=d;this.test=m;this.requireAuth=h;this.errorHandlingOptions=v;this.outputSchema=_;this.audience=x;this.aiMetadata=T;this.classification=P}static{i(this,"IAction")}},te=i(t=>new Ul(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 qe=U({displayName:I(),description:W(I()),advanced:W(Ve()),width:W(Pe(["half","full"])),icon:W(I()),placeholder:W(I())}),De=i((t,e)=>U({type:ve(e),required:Ve(),defaultValue:W(Go())}),"TPropertyValue");var Kt=U({...qe.shape,...De(I(),"SHORT_TEXT").shape}),cn=U({...qe.shape,...De(I(),"LONG_TEXT").shape});var ty=U({label:I(),value:Ae(),description:W(I()),icon:W(I())}),Gs=U({disabled:W(Ve()),placeholder:W(I()),options:be(ty)});var WD=Pe(["cards"]),Jt=U({...qe.shape,options:Gs,display:W(WD),...De(Ae(),"STATIC_DROPDOWN").shape}),ln=U({...qe.shape,options:Gs,...De(be(Ae()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Fl=U({...qe.shape,...De(Ae(),"DROPDOWN").shape,refreshers:be(I())}),Zo=U({...qe.shape,...De(be(Ae()),"MULTI_SELECT_DROPDOWN").shape,refreshers:be(I())});var dn=U({...qe.shape,reveals:W(be(I())),...De(Ve(),"CHECKBOX").shape});var pn=U({...qe.shape,display:W(Pe(["stepper"])),min:W(Et()),max:W(Et()),step:W(Et()),...De(Et(),"NUMBER").shape});var Ko=U({...qe.shape,streaming:W(Ve()),...De(Ae(),"FILE").shape});var Jo=U({...qe.shape,...De(I(),"DATE_TIME").shape});var ry=Re(I(),ze([Kt,cn,Jt,Zo,ln,dn,pn,Ko,Jo])),Yo=U({...qe.shape,properties:ry,...De(be(Ae()),"ARRAY").shape});var ny=Pe(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),iy=U({preset:W(ny),after:W(I()),before:W(I())}),Ll=U({...qe.shape,display:W(Pe(["dropdown"])),...De(iy,"DATE_RANGE").shape});var Xo=U({...qe.shape,...De(ze([Re(I(),Ae())]),"JSON").shape});var oy=ze([Kt,Jt,Xo,Yo,ln]),ZD=Re(I(),oy),jl=U({refreshers:be(I()),...qe.shape,...De(Ae(),"DYNAMIC").shape});var Hs=U({...qe.shape,...De(Xg(),"MARKDOWN").shape});var Qo=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Qo||{}),Li=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Li||{}),ji=(u=>(u.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",u.COMMUNICATION="COMMUNICATION",u.COMMERCE="COMMERCE",u.CORE="CORE",u.UNIVERSAL_AI="UNIVERSAL_AI",u.FLOW_CONTROL="FLOW_CONTROL",u.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",u.ACCOUNTING="ACCOUNTING",u.PRODUCTIVITY="PRODUCTIVITY",u.CONTENT_AND_FILES="CONTENT_AND_FILES",u.DEVELOPER_TOOLS="DEVELOPER_TOOLS",u.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",u.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",u.HUMAN_RESOURCES="HUMAN_RESOURCES",u.PAYMENT_PROCESSING="PAYMENT_PROCESSING",u.MARKETING="MARKETING",u.SALES_AND_CRM="SALES_AND_CRM",u))(ji||{});var ea=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ea||{}),ql="both_client_credentials_and_authorization_code";var Ur=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ur||{}),ta=(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))(ta||{}),KD=U({strategy:Pe(ta),paramName:W(I())}),ra=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ra||{});var Ws=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ws||{}),ay=U({status:W(Et()),body:W(Ae()),headers:W(Re(I(),I()))}),sy=U({type:ve("DELAY"),resumeDateTime:I(),requestIdToReply:W(I()),handlerId:W(I()),streamStepProgress:W(Pe(Ws))}),uy=U({type:ve("WEBHOOK"),requestId:I(),requestIdToReply:W(I()),response:ay,handlerId:W(I()),streamStepProgress:W(Pe(Ws))}),JD=ze([sy,uy]);var YD=U({body:Ae(),rawBody:W(Ae()),headers:Re(I(),I()),queryParams:Re(I(),I())});function mt(t){return t==null}i(mt,"isNil");function na(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}i(na,"isEmpty");function Zs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}i(Zs,"assertNotNullOrUndefined");async function Bl(t){try{return{data:await t(),error:null}}catch(e){return{data:null,error:e}}}i(Bl,"tryCatch");var Vl=ue(require("crypto"),1);var XD=128,Fn,qi,QD=i(t=>{if(t<0)throw new RangeError("Wrong ID size");try{!Fn||Fn.length<t?(Fn=Buffer.allocUnsafe(t*XD),Vl.default.randomFillSync(Fn),qi=0):qi+t>Fn.length&&(Vl.default.randomFillSync(Fn),qi=0)}catch(e){throw Fn=void 0,e}qi+=t},"fillPool"),e$=i(t=>(QD(t|=0),Fn.subarray(qi-t,qi)),"random"),t$=i((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,o=Math.ceil(1.6*n*e/t.length);return(s=e)=>{if(s<=0)return"";let d="";for(;;){let m=r(o),h=o;for(;h--;)if(d+=t[m[h]&n]||"",d.length===s)return d}}},"customRandom"),ly=i((t,e=21)=>t$(t,e,e$),"customAlphabet");var r$="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",dy=21,DZ=I().check(kn(new RegExp(`^[0-9a-zA-Z]{${dy}}$`))),n$=ly(r$,dy);var Ln=Mn(Un(t=>t instanceof Date?t.toISOString():t),I()),dr={id:I(),created:Ln,updated:Ln},ut=i(t=>W(Ho(t)),"Nullable");function Gl(t){return W(Ho(Pe(t)))}i(Gl,"NullableEnum");var CZ=Mn(Un(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),W(Ve())),Ks=i(t=>Mn(Un(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),W(be(t))),"OptionalArrayFromQuery");var zZ=Re(I(),Ae());var Bi=(E=>(E.OPENAI="openai",E.OPENROUTER="openrouter",E.ANTHROPIC="anthropic",E.AZURE="azure",E.GOOGLE="google",E.ACTIVEPIECES="activepieces",E.CLOUDFLARE_GATEWAY="cloudflare-gateway",E.CUSTOM="custom",E.BEDROCK="bedrock",E.MISTRAL="mistral",E.XAI="xai",E.DEEPSEEK="deepseek",E.ZAI="zai",E.QWEN="qwen",E.MINIMAX="minimax",E.MOONSHOT="moonshot",E))(Bi||{});var ZZ=I().check(kn(/^#[0-9A-Fa-f]{6}$/));var JZ=U({filename:I(),data:Ae(),type:ve("file"),mimetype:W(I())});var i$=ue(fy());var n3=U({...dr,name:I(),permissions:be(I()),platformId:ut(I()),type:I(),userCount:W(Et())});var my=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(my||{}),Hl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Hl||{}),Wl=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Wl||{});var Zl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Zl||{});var Kl=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Kl||{});var o$=U({mode:Pe(my),value:Ae()}),a$=U({auth:W(I()),fields:Re(I(),o$)}),s$=U({pieceName:I(),pieceVersion:I(),actionName:I(),predefinedInput:W(a$)}),u$=U({type:ve("PIECE"),toolName:I().check(Tr(1)),pieceMetadata:s$}),c$=U({type:ve("none")}),l$=U({type:ve("access_token"),accessToken:I()}),d$=U({type:ve("api_key"),apiKey:I(),apiKeyHeader:I()}),p$=U({type:ve("headers"),headers:Re(I(),I())}),f$=zn("type",[c$,l$,d$,p$]),hy=U({type:ve("FLOW"),toolName:I().check(Tr(1)),externalFlowId:I(),flowDisplayName:W(I())}),gy=U({type:ve("MCP"),toolName:I().check(Tr(1)),serverUrl:Kg(),protocol:Pe(Wl),auth:f$}),yy=U({type:ve("KNOWLEDGE_BASE"),toolName:I().check(Tr(1)),sourceType:Pe(Hl),sourceId:I(),sourceName:I()}),m$=zn("type",[u$,hy,gy,yy]),h$=U({displayName:I(),description:W(I()),type:Pe(Zl)}),vy=U({type:ve("MARKDOWN"),markdown:I()}),Vi={type:ve("TOOL_CALL"),input:ut(Re(I(),Ae())),output:W(Ae()),toolName:I(),status:Pe(Kl),toolCallId:I(),startTime:I(),endTime:W(I())},N3=U(Vi),_y=zn("toolCallType",[U({...Vi,toolCallType:ve("PIECE"),pieceName:I(),pieceVersion:I(),actionName:I()}),U({...Vi,toolCallType:ve("FLOW"),displayName:I(),externalFlowId:I()}),U({...Vi,toolCallType:ve("MCP"),displayName:I(),serverUrl:I()}),U({...Vi,toolCallType:ve("KNOWLEDGE_BASE"),displayName:I(),sourceType:I()}),U({...Vi,toolCallType:ve("UNKNOWN"),displayName:I()})]),g$=ze([vy,_y]);var Jl=(r=>(r.IMAGE="image",r.TEXT="text",r))(Jl||{}),fn=U({apiKey:I()}),y$=fn,v$=U({apiKey:I(),apiKeyHash:I()}),_$=fn,w$=fn,P$=fn,b$=fn,T$=fn,S$=fn,E$=fn,Sy=U({accessKeyId:I().check(Tr(1)),secretAccessKey:I().check(Tr(1))}),x$=U({}),I$=U({}),A$=U({}),R$=U({}),D$=U({}),$$=U({}),Ey=U({modelId:I(),modelName:I(),modelType:Pe(Jl)}),xy=U({apiKeyHeader:I(),baseUrl:I(),models:be(Ey),defaultHeaders:W(Re(I(),I()))}),Iy=U({accountId:I(),gatewayId:I(),models:be(Ey),vertexProject:W(I()),vertexRegion:W(I())}),Ay=U({resourceName:I(),apiVersion:Mn(Un(t=>typeof t=="string"&&t.trim().length===0?void 0:t),W(I()))}),Ry=U({region:I().check(Tr(1))}),Dy=U({}),O$=ze([y$,P$,b$,T$,S$,w$,_$,v$,Sy,E$]),$y=ze([xy,Iy,Ay,Ry,x$,A$,R$,D$,I$,$$,Dy]),C$=U({id:I(),name:I(),type:Pe(Jl)}),N$=U({id:I(),name:I(),provider:Pe(Bi),config:$y,enabledForChat:Ve()}),k$=U({provider:Pe(Bi),name:I(),enabledForChat:Ve(),keys:be(U({id:I(),name:I()}))}),z$=U({provider:Pe(Bi),configId:I(),config:$y,auth:O$,platformId:I()});var M3={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},wy=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],U$=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],M$=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Py=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],F$=["grok-4.20","grok-4.1-fast"],L$={openai:wy,anthropic:U$,google:Py,activepieces:[...M$.map(t=>`anthropic/${t}`),...wy.map(t=>`openai/${t}`),...Py.map(t=>`google/${t}`),...F$.map(t=>`x-ai/${t}`)]};var by=128e3,j$={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function q$({provider:t}){return t?j$[t]??by:by}i(q$,"getMaxContextTokens");var Ty={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"},B$={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},V$=new Set(["anthropic","mistral","xai","deepseek","zai","qwen","minimax","moonshot"]),G$={xai:"https://api.x.ai/v1",deepseek:"https://api.deepseek.com/v1",zai:"https://api.z.ai/api/paas/v4",qwen:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",minimax:"https://api.minimax.io/v1",moonshot:"https://api.moonshot.ai/v1"};function Ot(t){return{chatModels:L$[t],maxContextTokens:q$({provider:t}),defaultEmbeddingModel:Ty[t],supportsEmbedding:Ty[t]!==void 0,supportsImageGeneration:!V$.has(t),webSearch:B$[t]}}i(Ot,"buildProviderCapabilities");var H$={openai:Ot("openai"),anthropic:Ot("anthropic"),openrouter:Ot("openrouter"),azure:Ot("azure"),google:Ot("google"),"cloudflare-gateway":Ot("cloudflare-gateway"),custom:Ot("custom"),bedrock:Ot("bedrock"),mistral:Ot("mistral"),activepieces:Ot("activepieces"),xai:Ot("xai"),deepseek:Ot("deepseek"),zai:Ot("zai"),qwen:Ot("qwen"),minimax:Ot("minimax"),moonshot:Ot("moonshot")};var W$=U({base64Url:I(),fileName:I(),extension:W(I())}),Z$=U({mimeType:I(),url:I(),fileName:W(I())}),Yl=ze([W$,Z$]);var K$=ze([U({type:ve("file"),value:Yl}),U({type:ve("markdown"),value:I(),files:W(be(Yl))})]),J$=U({sessionId:I(),message:I(),files:W(be(I()))});var Cy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Cy||{}),Ny=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ny||{}),Xl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Xl||{});var Y$=ze([U({...dr,name:I(),externalId:I(),type:ve("STATIC_DROPDOWN"),tableId:I(),projectId:I(),data:U({options:be(U({value:I()}))})}),U({...dr,name:I(),externalId:I(),type:ze([ve("TEXT"),ve("NUMBER"),ve("DATE"),ve("DATETIME")]),tableId:I(),projectId:I()})]),X$=U({...dr,name:I(),folderId:ut(I()),projectId:I(),externalId:I(),status:Gl(Ny),trigger:Gl(Cy)}),Q$=U({...dr,tableId:I(),projectId:I(),cells:Re(I(),U({updated:I(),created:I(),value:Ae(),fieldName:I()}))}),eO=U({events:be(Pe(Xl)),webhookUrl:I(),flowId:I()}),tO=U({fields:be(U({id:I(),name:I()})),rows:be(Re(I(),I())),name:I()}),rO=U({projectId:I(),limit:W(Wo.number()),cursor:W(I()),name:W(I()),externalIds:Ks(I()),folderId:W(I()),folderIds:Ks(I())}),nO=U({records:be(be(U({fieldId:I(),value:zy()}))),tableId:I()}),iO=U({cells:W(be(U({fieldId:I(),value:zy()}))),tableId:I(),agentUpdate:W(Ve())}),ky=zn("operator",[si("eq"),si("neq"),si("gt"),si("gte"),si("lt"),si("lte"),si("co"),Oy("exists"),Oy("not_exists")]),oO=U({tableId:I(),limit:W(Wo.number()),cursor:W(I()),filters:Ks(ky)});function zy(){return Mn(Un(t=>t==null?t:String(t)),Ho(I()))}i(zy,"coerceToString");function si(t){return U({fieldId:I(),operator:ve(t),value:I()})}i(si,"valueFilter");function Oy(t){return U({fieldId:I(),operator:ve(t)})}i(Oy,"existenceFilter");var aO=U({status:W(Et()),body:W(Ae()),headers:W(Re(I(),I()))}),sO=U({...dr,deleted:ut(Ln),ownerId:I(),displayName:I(),platformId:I(),externalId:ut(I())});var Uy=U({name:I(),description:W(I()),type:I(),required:Ve()}),uO=U({pieceName:I(),triggerName:I(),input:U({toolName:I(),toolDescription:I(),inputSchema:be(Uy),returnsResponse:Ve()})});var My="^[0-9]+\\.[0-9]+\\.[0-9]+$",nK=new RegExp(My),lO="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",iK=I().check(kn(new RegExp(My))),oK=I().check(kn(new RegExp(lO))),dO=U({packageType:ve("ARCHIVE"),pieceType:Pe(Li),pieceName:I(),pieceVersion:I(),archiveId:I(),platformId:I()}),Fy=U({packageType:ve("REGISTRY"),pieceType:ve("OFFICIAL"),pieceName:I(),pieceVersion:I()}),Ly=U({packageType:ve("REGISTRY"),pieceType:ve("CUSTOM"),pieceName:I(),pieceVersion:I(),platformId:I()}),aK=ze([Fy,Ly]),sK=ze([dO,Fy,Ly]);var pO=zn("type",[U({type:ve("CRON_EXPRESSION"),cronExpression:I(),timezone:I()}),U({type:ve("INTERVAL"),intervalMs:Jg().check(Ls(6e4))})]),uK=U({...dr,type:Pe(Ur),projectId:I(),flowId:I(),triggerName:I(),schedule:ut(pO),flowVersionId:I(),pieceName:I(),pieceVersion:I(),deleted:ut(I()),simulate:Ve()}),jy=(E=>(E.UNKNOWN="UNKNOWN",E.FLOW_RUN_LOG="FLOW_RUN_LOG",E.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",E.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",E.FLOW_STEP_FILE="FLOW_STEP_FILE",E.SAMPLE_DATA="SAMPLE_DATA",E.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",E.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",E.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",E.PROJECT_RELEASE="PROJECT_RELEASE",E.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",E.PLATFORM_ASSET="PLATFORM_ASSET",E.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",E.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",E.KNOWLEDGE_BASE="KNOWLEDGE_BASE",E.FLOW_BUNDLE="FLOW_BUNDLE",E))(jy||{}),qy=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(qy||{}),By=(r=>(r.S3="S3",r.DB="DB",r))(By||{}),cK=U({...dr,projectId:ut(I()),platformId:ut(I()),type:Pe(jy),compression:Pe(qy),data:W(Ae()),location:Pe(By),size:ut(Et()),fileName:ut(I()),s3Key:ut(I()),metadata:ut(Re(I(),I()))}),Vy=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Vy||{}),Gy=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Gy||{}),lK=U({id:I(),email:I(),firstName:I(),status:Pe(Gy),externalId:ut(I()),platformId:ut(I()),platformRole:Pe(Vy),lastName:I(),created:Ln,updated:Ln,lastActiveDate:ut(Ln),imageUrl:ut(I())});var td=U({...qe.shape,...De(Re(I(),Ae()),"OBJECT").shape});var rd=U({...qe.shape,formatProperty:W(I()),...De(I(),"RICH_TEXT").shape});var Wy=U({...qe.shape,...De(I(),"COLOR").shape});var nd=ze([Kt,cn,rd,Hs,dn,Jt,ln,Fl,Zo,jl,pn,Yo,td,Xo,Jo,Ll,Ko,Wy]),O={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 Mr=U({displayName:I(),description:W(I()),hasConnectionIdentifier:W(Ve())});var Zy=U({username:I(),password:I()}),id=U({...Mr.shape,username:U({displayName:I(),description:W(I())}),password:U({displayName:I(),description:W(I())}),...De(Zy,"BASIC_AUTH").shape});var gO=Re(I(),ze([Kt,cn,pn,dn,Jt])),od=U({...Mr.shape,props:gO,...De(Ae(),"CUSTOM_AUTH").shape});var ui=U({...Mr.shape,...De(U({auth:I()}),"SECRET_TEXT").shape});var yO=Re(I(),ze([Kt,cn,ui,pn,dn,Jt,ln,Hs])),Ky=U({...Mr.shape,props:yO,...De(Ae(),"OIDC").shape});var ad=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(ad||{}),Jy=ze([Kt,ui,Jt]),Yy=Re(I(),Jy),vO=U({props:W(Re(I(),Jy)),authUrl:I(),tokenUrl:I(),scope:be(I()),prompt:W(ze([ve("none"),ve("consent"),ve("login"),ve("omit")])),pkce:W(Ve()),pkceMethod:W(ze([ve("plain"),ve("S256")])),authorizationMethod:W(Pe(ad)),grantType:W(ze([Pe(ea),ve(ql)])),extra:W(Re(I(),I()))}),Xy=U({access_token:I(),props:W(Yy),data:Re(I(),Go())}),sd=U({...Mr.shape,...vO.shape,...De(Xy,"OAUTH2").shape});var Gi=ze([id,od,Ky,sd,ui]),ia="Connection",Hi={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||ia}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||ia,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||ia}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||ia}},None(){}};var WJ={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 _O=U({...qe.shape,...De(Ae(),"CUSTOM").shape,code:I()});var wO=ze([nd,Gi]),ud=Re(I(),wO),m8=Re(I(),nd);var Qy=ze([U({strategy:ve("CRON"),cronExpression:I()}),U({strategy:ve("NONE")})]),Wi=class{constructor(e,r,n,o,s,d,m,h,v,_,x,T,P,S,D,E,u,f,c,y,l){this.name=e;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=d;this.handshakeConfiguration=m;this.onHandshake=h;this.renewConfiguration=v;this.onRenew=_;this.onEnable=x;this.onDisable=T;this.onStart=P;this.run=S;this.test=D;this.sampleData=E;this.testStrategy=u;this.outputSchema=f;this.aiMetadata=c;this.classification=y;this.propertyGroups=l}static{i(this,"ITrigger")}},Zi=i(t=>{switch(t.type){case"WEBHOOK":return new Wi(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 Wi(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 Wi(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 Wi(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,mt(t.sampleData)&&mt(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata,t.classification,t.propertyGroups)}},"createTrigger");var ev="2",Ys="0.82.0";var cd=class{constructor(e,r,n,o,s,d,m,h,v=Ys,_,x="",T){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=o;this.categories=m;this.auth=h;this.minimumSupportedRelease=v;this.maximumSupportedRelease=_;this.description=x;this.deprecated=T;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:ev}),"getContextInfo");(!bO(v)||TO(v,Ys))&&(this.minimumSupportedRelease=Ys),s.forEach(P=>this._actions[P.name]=P),d.forEach(P=>this._triggers[P.name]=P)}static{i(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:PO(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}},rv=i(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new cd(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 PO(t){if(t!==void 0)return Array.isArray(t)?t.map(tv):tv(t)}i(PO,"withConnectionIdentifierFlag");function tv(t){return{...t,hasConnectionIdentifier:t.getConnectionIdentifier!==void 0}}i(tv,"flagConnectionIdentifier");function bO(t){return/^\d+\.\d+\.\d+$/.test(t)}i(bO,"isValidSimpleSemver");function TO(t,e){let[r,n,o]=t.split(".").map(Number),[s,d,m]=e.split(".").map(Number);return r!==s?r<s:n!==d?n<d:o<m}i(TO,"isSemverLessThan");var SO=W(Re(I(),Re(I(),I()))),nv=U({id:W(I()),name:I(),displayName:I(),logoUrl:I(),description:I(),authors:be(I()),platformId:W(I()),directoryPath:W(I()),auth:W(ze([Gi,be(Gi)])),version:I(),categories:W(be(Pe(ji))),minimumSupportedRelease:W(I()),maximumSupportedRelease:W(I()),deprecated:W(Ve()),i18n:SO}),EO=Pe(["human","ai","both"]),iv=U({description:W(I()),idempotent:W(Ve())}),ov=Pe(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var xO=Pe(["tabs","section","summary","builder","footer"]),av=U({key:I(),display:xO,label:W(I()),description:W(I()),icon:W(I()),props:be(I())}),sv=U({name:I(),displayName:I(),description:I(),props:ud,propertyGroups:W(be(av)),requireAuth:Ve(),errorHandlingOptions:W(Ml),outputSchema:W(Vs()),audience:W(EO),aiMetadata:W(iv),classification:W(ov)}),uv=U({name:I(),displayName:I(),description:I(),props:ud,propertyGroups:W(be(av)),errorHandlingOptions:W(Ml),type:Pe(Ur),sampleData:Ae(),handshakeConfiguration:W(Vs()),renewConfiguration:W(Qy),testStrategy:Pe(ra),outputSchema:W(Vs()),aiMetadata:W(iv),classification:W(ov)}),IO=U({...nv.shape,actions:Re(I(),sv),triggers:Re(I(),uv)}),AO=U({...nv.shape,actions:Et(),triggers:Et(),suggestedActions:W(be(sv)),suggestedTriggers:W(be(uv))}),cv=U({projectUsage:Et(),pieceType:Pe(Li),packageType:Pe(Qo),platformId:W(I()),archiveId:W(I())}),g5=U({...IO.shape,...cv.shape}),y5=U({...AO.shape,...cv.shape}),v5=U({name:I(),version:I()});var RO=ue(require("path")),DO=ue(require("fs/promises"));var Ki=require("node:stream");var Xs=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,d)=>{o.append(d,s)}),{urlWithoutQueryParams:n,queryParams:o}}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 Qs=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(e=new ld,r=new dd){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},ld=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},dd=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(e,r){let n=`${e.username}:${e.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var oa=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(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 lv({error:t,requestBody:e}){return t instanceof oa?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}i(lv,"toFailsafeOutput");var Sr=(d=>(d.GET="GET",d.POST="POST",d.PATCH="PATCH",d.PUT="PUT",d.DELETE="DELETE",d.HEAD="HEAD",d))(Sr||{});var eu=class extends Xs{static{i(this,"FetchHttpClient")}constructor(e="",r=new Qs){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(e),s=this.getHeaders(e),d=e.queryParams??{};for(let[c,y]of Object.entries(d))o.append(c,y);let m=o.toString(),h=m?`${n}?${m}`:n,v=e.responseType??"json",_=e.followRedirects??!0,x=e.retries??0,{body:T,extraHeaders:P,isStream:S}=$O(e.method)?OO(e.body,s):{body:void 0,extraHeaders:{},isStream:!1},D=NO({...s,...P}),E=await CO(async()=>{let c=new AbortController,y=e.timeout&&e.timeout>0?setTimeout(()=>c.abort(),e.timeout):void 0;try{let l={method:e.method.toString(),headers:D,body:T,redirect:_?"follow":"manual",signal:c.signal};return S&&(l.duplex="half"),r?.dispatcher!==void 0&&(l.dispatcher=r.dispatcher),await fetch(h,l)}finally{y!==void 0&&clearTimeout(y)}},S?0:x),u=_?300:400;if(E.status<200||E.status>=u){let c=await dv(E,v==="stream"?"text":v),y=new oa(e.body,{status:E.status,responseBody:c});throw console.error("[HttpClient#(sanitized error message)] Request failed:",y),y}let f=await dv(E,v);return{status:E.status,headers:kO(E.headers),body:f}}};function $O(t){return t!=="GET"&&t!=="HEAD"}i($O,"acceptsRequestBody");function OO(t,e){if(fv(t))return{body:void 0,extraHeaders:{},isStream:!1};if(zO(t)){let n=new Ki.PassThrough;return t.on("error",o=>n.destroy(o)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return t instanceof Ki.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}}i(OO,"serializeBody");async function dv(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"stream":return fv(t.body)?Ki.Readable.from([]):Ki.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}}}}i(dv,"parseResponseBody");async function CO(t,e){let r;for(let n=0;n<=e;n++)try{let o=await t();if(o.status>=500&&n<e){await pv(n);continue}return o}catch(o){if(r=o,n<e){await pv(n);continue}throw o}throw r}i(CO,"sendWithRetries");function pv(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}i(pv,"backoff");function NO(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}i(NO,"normalizeHeaders");function kO(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}i(kO,"toHttpHeaders");function zO(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}i(zO,"isNodeFormData");function fv(t){return t==null}i(fv,"isNil");var ht=new eu;var TN=ue(require("fs")),hw=ue(la());var SN={"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 EN(t){let e=t.split(";")[0].trim().toLowerCase();return SN[e]??""}i(EN,"contentTypeToExtension");var xN=i(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),IN=i((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 gw({auth:t,baseUrl:e,authMapping:r,description:n,displayName:o,name:s,props:d,extraProps:m,authLocation:h="headers",classification:v="WRITE"}){return te({audience:"human",name:s||"custom_api_call",classification:v,displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:O.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:i(async({auth:_})=>({url:O.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
69
|
+
i.e ${IN(e,_)}/resource or /resource`,required:!0,defaultValue:_?e(_):"",...d?.url??{}})}),"props")}),method:O.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Sr).map(_=>({label:_,value:_}))},...d?.method??{}}),headers:O.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...d?.headers??{}}),queryParams:O.Object({displayName:"Query Parameters",required:!0,...d?.queryParams??{}}),body_type:O.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:O.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:_})=>{if(!_)return{};let x=_,T={};switch(x){case"none":break;case"json":T.data=O.Json({displayName:"JSON Body",required:!0,...d?.body??{}});break;case"raw":T.data=O.LongText({displayName:"Raw Body",required:!0});break;case"form_data":T.data=O.Array({displayName:"Form Data",required:!0,properties:{fieldName:O.ShortText({displayName:"Field Name",required:!0}),fieldType:O.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:O.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:O.File({displayName:"File Field Value",required:!1})}});break}return T},"props")}),response_is_binary:O.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:O.Checkbox({displayName:"No Error on Failure",required:!1,...d?.failsafe??{}}),timeout:O.Number({displayName:"Timeout (in seconds)",required:!1,...d?.timeout??{}}),followRedirects:O.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...m},run:i(async _=>{let{method:x,url:T,headers:P,queryParams:S,body:D,body_type:E,failsafe:u,timeout:f,response_is_binary:c,followRedirects:y}=_.propsValue;Zs(x,"Method"),Zs(T,"URL");let l=mt(r)?{}:await r(_.auth,_.propsValue),b=T.url,g=b.startsWith("http://")||b.startsWith("https://")?b:xN({baseUrl:e(_.auth),relativePath:b}),ae={method:x,url:g,headers:{...P??{},...h==="headers"||!mt(h)?l:{}},queryParams:{...h==="queryParams"?l:{},...S??{}},timeout:f?f*1e3:0,followRedirects:y};if(c&&(ae.responseType="arraybuffer"),D)if(E&&E!=="none"){let re=D.data;if(E==="form_data"){let Ue=re,se=new hw.default;for(let{fieldName:X,fieldType:Y,textFieldValue:ne,fileFieldValue:ee}of Ue)Y==="text"&&!na(ne)?se.append(X,ne):Y==="file"&&!na(ee)&&se.append(X,ee.data,{filename:ee?.filename});ae.body=se,ae.headers={...ae.headers,...se.getHeaders()}}else ae.body=re}else E||(ae.body=D);try{let re=await ht.sendRequest(ae);return await AN(_.files,re.body,re.status,re.headers,c)}catch(re){if(u)return lv({error:re,requestBody:ae.body});throw re}},"run")})}i(gw,"createCustomApiCallAction");var AN=i(async(t,e,r,n,o)=>{let s;if(o&&RN(e)){let d=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],m=EN(d??"")||"txt",h;e instanceof ArrayBuffer?h=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?h=e:h=Buffer.from(e),s=await t.write({fileName:`output.${m}`,data:h})}else s=e;return{status:r,headers:n,body:s}},"handleBinaryResponse"),RN=i(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var zt={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:o,files:s,server:d}){switch(t.strategy){case 0:{let m=await e.get("lastPoll");if(mt(m))throw new Error("lastPoll doesn't exist in the store.");let h=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:m,server:d}),v=h.reduce((_,x)=>Math.max(_,x.epochMilliSeconds),m);return await e.put("lastPoll",v),h.filter(_=>_.epochMilliSeconds>m).map(_=>_.data)}case 1:{let m=await e.get("lastItem"),h=await t.items({store:e,auth:r,propsValue:n,lastItemId:m,files:s,server:d}),v=h.findIndex(T=>T.id===m),_=[];mt(m)||v==-1?_=h??[]:_=h?.slice(0,v)??[],mt(o)||(_=_.slice(-o));let x=_?.[0]?.id;return mt(x)||await e.put("lastItem",x),_.map(T=>T.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:o,isRepublish:s}){switch(t.strategy){case 0:{if(s&&!mt(await e.get("lastPoll")))break;await e.put("lastPoll",Date.now());break}case 1:{if(s&&!mt(await e.get("lastItem")))break;let m=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;mt(m)?await e.delete("lastItem"):await e.put("lastItem",m);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:o,server:s}){let d=[];switch(t.strategy){case 0:{d=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{d=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:o,server:s});break}}return DN(d.map(m=>m.data))}};function DN(t){return t.length<=5?t:t.slice(0,5)}i(DN,"getFirstFiveOrAll");var yw=require("node:stream");function $N(t){return"body"in t?{body:t.body,size:t.size}:{body:yw.Readable.from(t.data),size:t.data.length}}i($N,"toStreamingBody");async function*ON({readable:t,chunkSize:e}){let r=[],n=0;for await(let o of t)for(r.push(Buffer.isBuffer(o)?o:Buffer.from(o)),n+=r[r.length-1].length;n>=e;){let s=r.length===1?r[0]:Buffer.concat(r);yield s.subarray(0,e);let d=s.subarray(e);r=d.length>0?[d]:[],n=d.length}n>0&&(yield r.length===1?r[0]:Buffer.concat(r))}i(ON,"readChunks");var vw={readChunks:ON,toStreamingBody:$N};var Ec=ue(qa());var SS=["https://www.googleapis.com/auth/drive","email"],J=[Hi.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:SS}),Hi.CustomAuth({displayName:"Service Account (Advanced)",description:"Authenticate via service account from https://console.cloud.google.com/ > IAM & Admin > Service Accounts > Create Service Account > Keys > Add key. <br> <br> You can optionally use domain-wide delegation (https://support.google.com/a/answer/162106?hl=en#zippy=%2Cset-up-domain-wide-delegation-for-a-client) to access files without adding the service account to each one. <br> <br> **Note:** Without a user email, the service account only has access to files/folders you explicitly share with it.",required:!0,props:{serviceAccount:O.LongText({displayName:"Service Account JSON Key",required:!0}),userEmail:O.ShortText({displayName:"User Email",required:!1,description:"Email address of the user to impersonate for domain-wide delegation."})},validate:i(async({auth:t})=>{try{await it({type:"CUSTOM_AUTH",props:{...t}})}catch(e){return{valid:!1,error:e.message}}return{valid:!0}},"validate")})];async function oe(t){if(t.type==="CUSTOM_AUTH"){let r;try{r=JSON.parse(t.props.serviceAccount)}catch{throw new Error("Invalid Service Account JSON Key. Please provide a valid JSON string.")}return new Ec.JWT({email:r.client_email,key:r.private_key,scopes:SS,subject:t.props.userEmail})}let e=new Ec.OAuth2Client;return e.setCredentials(t),e}i(oe,"createGoogleClient");var it=i(async t=>{if(t.type==="CUSTOM_AUTH"){let r=await(await oe(t)).getAccessToken();if(r.token)return r.token;throw new Error("Could not retrieve access token from service account json")}return t.access_token},"getAccessToken");var qx=ue($e());var Vc=ue(es()),zm=ue($e());var bj=1e3,Gc=i(t=>t.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),"escapeDriveQueryLiteral");async function BE({auth:t,searchValue:e,includeTeamDrives:r}){if(!t)return{disabled:!0,options:[],placeholder:"Please authenticate first"};let n=await it(t),o=e?.trim()??"",s=["mimeType='application/vnd.google-apps.folder'","trashed = false"];o.length>0&&s.push(`name contains '${Gc(o)}'`);let d={method:"GET",url:"https://www.googleapis.com/drive/v3/files",queryParams:{q:s.join(" and "),includeItemsFromAllDrives:r?"true":"false",supportsAllDrives:"true",corpora:r?"allDrives":"user",pageSize:String(bj),fields:"nextPageToken, files(id, name)"},authentication:{type:"BEARER_TOKEN",token:n}},m=[],h=!1;try{let v=await ht.sendRequest(d);m=v.body.files??[],h=!!v.body.nextPageToken}catch(v){throw new Error(`Failed to get folders
|
|
70
|
+
Error:${v}`)}return{disabled:!1,placeholder:h?`Showing first ${m.length} matches \u2014 type to narrow the list, or switch to Dynamic value to paste an ID.`:void 0,options:m.map(v=>({label:v.name,value:v.id}))}}i(BE,"fetchFolderDropdownOptions");var Ne={properties:{parentFolder:O.Dropdown({displayName:"Parent Folder",description:"The Drive folder to target. Leave empty to use the root of My Drive. Type in the box to search your Drive by folder name. If the folder still isn't listed, switch this field to 'Dynamic value' (the toggle next to the field) and paste the folder ID \u2014 you can copy it from the folder's URL in Drive, after /folders/ (e.g. https://drive.google.com/drive/folders/<FOLDER_ID>).",required:!1,auth:J,refreshers:["include_team_drives"],refreshOnSearch:!0,options:i(async({auth:t,include_team_drives:e},r)=>BE({auth:t,searchValue:r?.searchValue,includeTeamDrives:e}),"options")}),include_team_drives:O.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},fetchFolderDropdownOptions:BE,async getFiles(t,e,r){let n=await oe(t),o=(0,zm.drive)({version:"v3",auth:n}),s=[];if(e?.parent&&s.push(`'${Gc(e.parent)}' in parents`),e?.createdTime&&s.push(`createdTime ${e.createdTimeOp??">"} '${(0,Vc.default)(e.createdTime).format()}'`),e?.changedSince){let v=(0,Vc.default)(e.changedSince).format();s.push(`(modifiedTime > '${v}' or createdTime > '${v}')`)}e?.mimeTypes?.length&&s.push(`(${e.mimeTypes.map(v=>`mimeType='${Gc(v)}'`).join(" or ")})`),e?.excludeShortcuts&&s.push("mimeType!='application/vnd.google-apps.shortcut'"),s.push("trashed = false");let d=[],m,h=0;do{let v={q:s.concat("mimeType!='application/vnd.google-apps.folder'").join(" and "),fields:"nextPageToken, files(id, name, mimeType, webViewLink, kind, createdTime, modifiedTime)",orderBy:r??"createdTime desc",supportsAllDrives:!0,includeItemsFromAllDrives:e?.includeTeamDrive,corpora:e?.includeTeamDrive?"allDrives":"user"};m&&(v.pageToken=m);let _=await o.files.list(v);if(d.push(..._.data.files??[]),m=_.data.nextPageToken??void 0,h+=1,e?.maxPages&&h>=e.maxPages)break}while(m);return d},async getFolders(t,e,r){let n=await oe(t),o=(0,zm.drive)({version:"v3",auth:n}),s=["mimeType='application/vnd.google-apps.folder'"];e?.parent&&s.push(`'${Gc(e.parent)}' in parents`),e?.createdTime&&s.push(`createdTime ${e.createdTimeOp??">"} '${(0,Vc.default)(e.createdTime).format()}'`),s.push("trashed = false");let d=[],m;do{let h={q:s.join(" and "),fields:"nextPageToken, files(id, name, createdTime)",orderBy:r??"createdTime desc",supportsAllDrives:!0,includeItemsFromAllDrives:e?.includeTeamDrive,corpora:e?.includeTeamDrive?"allDrives":"user"};m&&(h.pageToken=m);let v=await o.files.list(h);d.push(...v.data.files??[]),m=v.data.nextPageToken??void 0}while(m);return d}};var VE={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},GE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},HE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},WE={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},ZE={fields:[{key:"name",label:"Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},KE={fields:[{key:"files",label:"Files",labelKey:"name",listItems:[{key:"name",label:"Name",value:"name"},{key:"id",label:"File ID",value:"id"},{key:"mimeType",label:"MIME Type",value:"mimeType"},{key:"trashed",label:"Trashed",value:"trashed",format:"boolean"},{key:"parents",label:"Parent Folder ID",value:"parents[0]"}]},{key:"incompleteSearch",label:"Incomplete Search",value:"incompleteSearch",format:"boolean"}]},JE={fields:[{key:"results",label:"Results",value:"",labelKey:"name",listItems:[{key:"name",label:"Name",value:"name"},{key:"mimeType",label:"MIME Type",value:"mimeType"},{key:"id",label:"File ID",value:"id"},{key:"createdTime",label:"Created Time",value:"createdTime",format:"datetime"},{key:"modifiedTime",label:"Modified Time",value:"modifiedTime",format:"datetime"}]}]},YE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},XE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},QE={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"iconLink",label:"Icon",format:"image"},{key:"size",label:"Size",format:"filesize"},{key:"fileExtension",label:"File Extension"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"shared",label:"Shared",format:"boolean"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]},{key:"lastModifyingUser",label:"Last Modifying User",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]},{key:"permissions",label:"Permissions",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]}]},ex={fields:[{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"id",label:"Permission ID"},{key:"allowFileDiscovery",label:"Allow File Discovery",format:"boolean"},{key:"downloadUrl",label:"Download URL",format:"url"},{key:"kind",label:"Kind"}]},tx={fields:[{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]},rx={fields:[{key:"removed",label:"Removed",value:"removed",format:"boolean"},{key:"message",label:"Message",value:"message"}]},nx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},ix={fields:[{key:"name",label:"File Name"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"id",label:"File ID"}]},ox={fields:[{key:"changeType",label:"Change Type"},{key:"content",label:"File Content"},{key:"contentError",label:"File Content Error"},{key:"name",label:"File Name"},{key:"webViewLink",label:"View Link",format:"url"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"id",label:"File ID"}]},ax={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"createdTime",label:"Created Time",format:"datetime"}]},Tj=[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"iconLink",label:"Icon",format:"image"},{key:"fileExtension",label:"File Extension"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"shared",label:"Shared",format:"boolean"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]},{key:"lastModifyingUser",label:"Last Modifying User",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]}],sx={fields:Tj},ux={fields:[{key:"files",label:"Files",labelKey:"name",listItems:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"shared",label:"Shared",format:"boolean"}]},{key:"incompleteSearch",label:"Incomplete Search",format:"boolean"}]},cx={fields:[{key:"files",label:"Search Results",labelKey:"name",listItems:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"}]}]},lx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"size",label:"Size",format:"filesize"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]},{key:"lastModifyingUser",label:"Last Modifying User",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]},{key:"shared",label:"Shared",format:"boolean"}]},dx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"iconLink",label:"Icon",format:"image"},{key:"fileExtension",label:"File Extension"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"me",label:"Is Me",format:"boolean"}]}]},px={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"parents",label:"Parent Folder IDs"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"me",label:"Is Me",format:"boolean"}]}]},fx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"},{key:"webContentLink",label:"Download Link",format:"url"},{key:"fileExtension",label:"File Extension"},{key:"parents",label:"Parent Folder IDs"},{key:"shared",label:"Shared",format:"boolean"},{key:"owners",label:"Owners",labelKey:"displayName",listItems:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"me",label:"Is Me",format:"boolean"}]}]},mx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"description",label:"Description"},{key:"mimeType",label:"MIME Type"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"starred",label:"Starred",format:"boolean"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"webViewLink",label:"View Link",format:"url"},{key:"size",label:"Size",format:"filesize"}]},hx={fields:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"displayName",label:"Display Name"},{key:"photoLink",label:"Photo",format:"image"},{key:"pendingOwner",label:"Pending Owner",format:"boolean"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"permissionDetails",label:"Permission Details",labelKey:"role",listItems:[{key:"role",label:"Role"},{key:"permissionType",label:"Permission Type"},{key:"inherited",label:"Inherited",format:"boolean"}]}]},gx={fields:[{key:"permissions",label:"Permissions",labelKey:"displayName",listItems:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"displayName",label:"Display Name"},{key:"photoLink",label:"Photo",format:"image"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"pendingOwner",label:"Pending Owner",format:"boolean"}]}]},yx={fields:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"allowFileDiscovery",label:"Allow File Discovery",format:"boolean"},{key:"permissionDetails",label:"Permission Details",labelKey:"role",listItems:[{key:"role",label:"Role"},{key:"permissionType",label:"Permission Type"},{key:"inherited",label:"Inherited",format:"boolean"}]}]},vx={fields:[{key:"id",label:"Permission ID"},{key:"type",label:"Type"},{key:"role",label:"Role"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"displayName",label:"Display Name"},{key:"photoLink",label:"Photo",format:"image"}]},_x={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},wx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"trashed",label:"Trashed",format:"boolean"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},Px={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},bx={fields:[{key:"user",label:"Current User",children:[{key:"displayName",label:"Display Name"},{key:"emailAddress",label:"Email Address",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"},{key:"permissionId",label:"Permission ID"}]},{key:"storageQuota",label:"Storage Quota",children:[{key:"limit",label:"Total Limit",format:"filesize"},{key:"usage",label:"Used Space",format:"filesize"},{key:"usageInDrive",label:"Used in Drive",format:"filesize"},{key:"usageInDriveTrash",label:"Used in Trash",format:"filesize"}]},{key:"maxUploadSize",label:"Max Upload Size",format:"filesize"}]},Tx={fields:[{key:"drives",label:"Shared Drives",labelKey:"name",listItems:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"}]}]},Sx={fields:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"restrictions",label:"Restrictions",children:[{key:"adminManagedRestrictions",label:"Admin Managed",format:"boolean"},{key:"copyRequiresWriterPermission",label:"Copy Requires Writer Permission",format:"boolean"},{key:"domainUsersOnly",label:"Domain Users Only",format:"boolean"},{key:"driveMembersOnly",label:"Drive Members Only",format:"boolean"}]}]},Ex={fields:[{key:"comments",label:"Comments",labelKey:"content",listItems:[{key:"id",label:"Comment ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]}]}]},xx={fields:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},Ix={fields:[{key:"id",label:"Comment ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},Ax={fields:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"htmlContent",label:"HTML Content",format:"html"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},Rx={fields:[{key:"replies",label:"Replies",labelKey:"content",listItems:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"}]}]}]},Dx={fields:[{key:"id",label:"Reply ID"},{key:"content",label:"Content"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"deleted",label:"Deleted",format:"boolean"},{key:"author",label:"Author",children:[{key:"displayName",label:"Name"},{key:"emailAddress",label:"Email",format:"email"},{key:"photoLink",label:"Photo",format:"image"},{key:"me",label:"Is Me",format:"boolean"}]}]},$x={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"size",label:"Size",format:"filesize"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"modifiedTime",label:"Modified Time",format:"datetime"},{key:"webViewLink",label:"View Link",format:"url"}]},Ox={fields:[{key:"id",label:"Folder ID"},{key:"name",label:"Folder Name"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"},{key:"createdTime",label:"Created Time",format:"datetime"},{key:"parents",label:"Parent Folder IDs"},{key:"webViewLink",label:"View Link",format:"url"}]},Cx={fields:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"}]},Nx={fields:[{key:"id",label:"Drive ID"},{key:"name",label:"Drive Name"},{key:"kind",label:"Kind"},{key:"colorRgb",label:"Color"},{key:"createdTime",label:"Created Time",format:"datetime"}]},kx={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},zx={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},Ux={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},Mx={fields:[{key:"success",label:"Success",format:"boolean"},{key:"reply_id",label:"Reply ID"}]},Fx={fields:[{key:"deleted",label:"Deleted",format:"boolean"},{key:"driveId",label:"Drive ID"}]},Lx={fields:[{key:"success",label:"Success",format:"boolean"},{key:"driveId",label:"Drive ID"}]},jx={fields:[{key:"removed",label:"Removed",format:"boolean"},{key:"message",label:"Message"}]};var Bx=te({auth:J,name:"update_permissions",classification:"WRITE",description:"Update permissions for a file or folder",audience:"human",aiMetadata:{description:"Grants a specified role (reader, commenter, writer, fileOrganizer, or organizer) on a Drive file or folder to a user identified by email, optionally sending a notification email. Use to share a resource with a person. Requires the file/folder ID and target email. Not idempotent: each call creates a new permission grant.",idempotent:!1},displayName:"Update permissions",props:{fileId:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:O.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:O.StaticDropdown({displayName:"Role",description:"The role to grant to user. See more at: https://developers.google.com/drive/api/guides/ref-roles",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}}),include_team_drives:Ne.properties.include_team_drives,send_invitation_email:O.Checkbox({displayName:"Send invitation email",description:"Send an email to the user to notify them of the new permissions",required:!0})},outputSchema:tx,async run(t){let{fileId:e,user_email:r,permission_name:n,send_invitation_email:o,include_team_drives:s}=t.propsValue,d=await oe(t.auth),m=(0,qx.drive)({version:"v3",auth:d}),h={type:"user",role:n,emailAddress:r};return(await m.permissions.create({requestBody:h,fileId:e,sendNotificationEmail:o,supportsAllDrives:s})).data}});var Vx=ue($e());var Gx=te({auth:J,name:"create_new_gdrive_folder",classification:"WRITE",description:"Create a new empty folder in your Google Drive",audience:"human",aiMetadata:{description:"Creates a new empty folder in Google Drive, optionally nested under a parent folder. Use to set up a destination before uploading or moving files. Not idempotent: each call creates a distinct folder even with the same name (Drive permits duplicate folder names).",idempotent:!1},displayName:"Create new folder",props:{folderName:O.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives},outputSchema:VE,async run(t){let e=await oe(t.auth);return(await(0,Vx.drive)({version:"v3",auth:e}).files.create({requestBody:{mimeType:"application/vnd.google-apps.folder",name:t.propsValue.folderName,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},supportsAllDrives:t.propsValue.include_team_drives})).data}});var Hx=ue($e());var Wx=te({auth:J,name:"create_new_gdrive_file",classification:"WRITE",description:"Create a new text file in your Google Drive from text",audience:"human",aiMetadata:{description:"Creates a new file in Google Drive from inline text content as plain text, CSV, or XML, optionally inside a parent folder. Use when an agent has generated text it needs to persist as a Drive file. Not idempotent: each call creates a new file.",idempotent:!1},displayName:"Create new file",props:{fileName:O.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:O.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),fileType:O.StaticDropdown({displayName:"Content type",description:"Select file type",required:!0,defaultValue:"text/plain",options:{options:[{label:"Text",value:"text/plain"},{label:"CSV",value:"text/csv"},{label:"XML",value:"text/xml"}]}}),parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives},outputSchema:GE,async run(t){let e=await oe(t.auth),r=(0,Hx.drive)({version:"v3",auth:e}),n=t.propsValue.fileType==="plain/text"?"text/plain":t.propsValue.fileType;return(await r.files.create({requestBody:{name:t.propsValue.fileName,mimeType:n,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},media:{mimeType:n,body:t.propsValue.text},supportsAllDrives:t.propsValue.include_team_drives??!1,fields:"id, name, mimeType, kind"})).data}});var Zx=ue($e());var Kx=te({auth:J,name:"delete_permissions",classification:"DESTRUCTIVE",description:"Removes a role from an user for a file or folder",audience:"human",aiMetadata:{description:"Revokes a specific role from a user (matched by email and role) on a Drive file or folder. Use to unshare or downgrade access for someone. Requires the file/folder ID, the user email, and the role to remove. Idempotent: if no matching permission exists, the call is a no-op.",idempotent:!0},displayName:"Delete permissions",props:{fileId:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:O.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:O.StaticDropdown({displayName:"Role",description:"The role to remove from user.",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}})},outputSchema:rx,async run(t){let[e,r]=[t.propsValue.fileId,t.propsValue.user_email],n=await oe(t.auth),o=(0,Zx.drive)({version:"v3",auth:n}),s=await o.permissions.list({fileId:e,fields:"permissions(id, emailAddress, role)"});if(s.data.permissions){for(let d of s.data.permissions)if(d.emailAddress===r&&d.role===t.propsValue.permission_name)return await o.permissions.delete({fileId:e,permissionId:d.id?d.id:""}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var Jx=ue($e());var Yx=te({displayName:"Duplicate File",auth:J,name:"duplicate_file",classification:"WRITE",description:"Duplicate a file from Google Drive. Returns the new file ID.",audience:"human",aiMetadata:{description:"Copies an existing Drive file into a target folder under a new name, optionally converting it to a Google Sheet or Google Doc. Use to clone a file or create an editable Google-format copy. Requires the source file ID and destination folder ID. Not idempotent: each call creates a new copy.",idempotent:!1},props:{fileId:O.ShortText({displayName:"File ID",description:"The ID of the file to duplicate",required:!0}),name:O.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folderId:O.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be duplicated",required:!0}),mimeType:O.StaticDropdown({displayName:"Duplicate as",description:"If left unselected the file will be duplicated as it is",required:!1,options:{options:[{label:"Google Sheets",value:"application/vnd.google-apps.spreadsheet"},{label:"Google Docs",value:"application/vnd.google-apps.document"}]}}),include_team_drives:Ne.properties.include_team_drives},outputSchema:YE,async run(t){let e=await oe(t.auth),r=t.propsValue.fileId,n=t.propsValue.name,o=t.propsValue.folderId,s=t.propsValue.mimeType,d=(0,Jx.drive)({version:"v3",auth:e}),m={name:n,parents:[o]};s&&(m.mimeType=s);let h=await d.files.copy({fileId:r,auth:e,requestBody:m,supportsAllDrives:t.propsValue.include_team_drives});if(h.status!==200)throw new Error("Error duplicating file");return h.data}});var Xx=ue($e());var Qx=te({auth:J,name:"get-file-or-folder-by-id",classification:"READ",displayName:"Get File Information",description:"Get a file folder for files/sub-folders",audience:"human",aiMetadata:{description:"Fetches metadata for a single file or folder in Google Drive by its exact ID (name, MIME type, parents, etc.). Use when an agent already has a file/folder ID and needs its details. Read-only and idempotent. Requires the resource ID, not a name or path.",idempotent:!0},props:{id:O.ShortText({displayName:"File / Folder Id",description:"The Id of the file/folder to search for.",required:!0}),include_team_drives:Ne.properties.include_team_drives},outputSchema:ZE,async run(t){let e=await oe(t.auth),n=await(0,Xx.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.id,supportsAllDrives:t.propsValue.include_team_drives});return n.data?n.data:null}});var Um=ue(require("querystring"));var tI=require("node:stream"),rI=ue(mn());async function nI(t,e){let r=await it(t);return(await fetch(`https://www.googleapis.com/drive/v3/files/${e}?fields=mimeType&supportsAllDrives=true`,{headers:{Authorization:`Bearer ${r}`}}).then(o=>o.json())).mimeType}i(nI,"getMimeType");var eI=i(async(t,e,r,n,o)=>{let s=await nI(e,r),d=await it(e),m=await fetch(t,{headers:{Authorization:`Bearer ${d}`}}).catch(x=>Promise.reject(new Error(`Error when download file:
|
|
71
71
|
Download file response: ${x.message??x}`)));if(!m.ok||!m.body)throw new Error(`Error when download file:
|
|
72
|
-
Download file response: ${m.status} ${m.statusText}`);let h=(0,eI.extension)(s),v=h?"."+h:"",_=o??r+v;return n.write({fileName:_,data:Qx.Readable.fromWeb(m.body)})},"googledlCall");async function Nt(t,e,r,n){let o=await tI(t,r);if(["application/vnd.google-apps.document","application/vnd.google-apps.spreadsheet","application/vnd.google-apps.presentation"].includes(o)){switch(o){case"application/vnd.google-apps.document":o="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"application/vnd.google-apps.spreadsheet":o="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"application/vnd.google-apps.presentation":o="application/vnd.openxmlformats-officedocument.presentationml.presentation";break}return await Xx(`https://www.googleapis.com/drive/v3/files/${r}/export?mimeType=${o}&supportsAllDrives=true`,t,r,e,n)}else return await Xx(`https://www.googleapis.com/drive/v3/files/${r}?alt=media&supportsAllDrives=true`,t,r,e,n)}i(Nt,"downloadFileFromDrive");async function rI(t,e,r,n,o,s=0){let d=[];if(s>r)return d;let m=await it(t),h=`'${e}' in parents`;n||(h+=" and trashed=false");let v={q:h,fields:"nextPageToken,files(id,kind,mimeType,name,trashed,parents)",supportsAllDrives:"true",includeItemsFromAllDrives:o?"true":"false",corpora:o?"allDrives":"user",pageSize:"1000"},_=await ht.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Um.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of _.body.files)d.push({file:x,level:s,parentFolder:e});for(;_.body.nextPageToken;){v.pageToken=_.body.nextPageToken,_=await ht.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Um.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of _.body.files)d.push({file:x,level:s,parentFolder:e})}if(s+1<r){let x=d.filter(T=>T.file.mimeType==="application/vnd.google-apps.folder");for(let T of x){let P=await rI(t,T.file.id,r,n,o,s+1);d.push(...P)}}return d}i(rI,"getFilesRecursively");var nI=te({auth:J,name:"list-files",classification:"SEARCH",displayName:"List files",description:"List files from a Google Drive folder",audience:"human",aiMetadata:{description:"Lists files and subfolders inside a given Drive folder, with optional recursion to a chosen depth and optional download of each file's content. Use to enumerate the contents of a known folder ID. Read-only and idempotent. Requires the folder ID, not a name.",idempotent:!0},props:{folderId:O.ShortText({displayName:"Folder ID",description:"Folder ID coming from | New Folder -> id | (or any other source)",required:!0}),include_team_drives:Ne.properties.include_team_drives,includeTrashed:O.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depthLevel:O.Number({displayName:"Depth Level",description:"How many levels deep to search for files. 1 = current folder only, 2 = current + next level, etc.",required:!1,defaultValue:1}),downloadFiles:O.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1})},outputSchema:WE,async run(t){let e={type:"drive#fileList",incompleteSearch:!1,files:[]},r=t.propsValue.depthLevel||1,n=await rI(t.auth,t.propsValue.folderId,r,t.propsValue.includeTrashed??!1,t.propsValue.include_team_drives??!1);if(e.files=n.map(o=>o.file),t.propsValue.downloadFiles){let o=[],s={"application/pdf":".pdf","image/jpeg":".jpg","image/png":".png","image/tiff":".tiff","text/plain":".txt","text/csv":".csv","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":".xlsx"};for(let d of n){let m=d.file;if(m.mimeType==="application/vnd.google-apps.folder")continue;let h=m.name,v=s[m.mimeType];v&&!h.toLowerCase().endsWith(v)&&(m.mimeType==="image/jpeg"&&h.toLowerCase().endsWith(".jpeg")||(h=h+v));try{let _=await Nt(t.auth,t.files,m.id,h);o.push(_)}catch(_){console.warn(`Failed to download file ${m.name}: ${_ instanceof Error?_.message:"Download failed"}`)}}e.downloadedFiles=o}return e}});var iI=te({auth:J,name:"read-file",classification:"READ",displayName:"Read File Content",description:"Read a selected file from google drive file",audience:"human",aiMetadata:{description:"Downloads the content of a Drive file by its file ID and returns it as a usable file reference. Use to retrieve a file an agent already knows the ID of (e.g. from a trigger or search). Read-only and idempotent. Requires the exact file ID, not a name.",idempotent:!0},props:{fileId:O.ShortText({displayName:"File ID",description:"File ID coming from | New File -> id |",required:!0}),fileName:O.ShortText({displayName:"Destination File name",required:!1})},outputSchema:GE,run:i(async({auth:t,propsValue:e,files:r})=>Nt(t,r,e.fileId,e.fileName),"run")});var oI=ue($e()),aI=require("stream");var sI=te({displayName:"Save Document as PDF",auth:J,name:"save_file_as_pdf",classification:"WRITE",description:"Save a document as PDF in a Google Drive folder",audience:"human",aiMetadata:{description:"Exports a Google document to PDF and saves it as a new file in a target Drive folder. Use to produce a PDF rendition of a Google Doc/Sheet/Slides for sharing or archival. Requires the source document ID and destination folder ID. Not idempotent: each call creates a new PDF file.",idempotent:!1},props:{documentId:O.ShortText({displayName:"Document ID",description:"The ID of the document to export",required:!0}),folderId:O.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be exported",required:!0}),name:O.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0}),include_team_drives:Ne.properties.include_team_drives},outputSchema:JE,async run(t){let e=await oe(t.auth),r=t.propsValue.documentId,n=t.propsValue.folderId,o=t.propsValue.name,s=(0,oI.drive)({version:"v3",auth:e}),d=await s.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:o+".pdf",parents:[n]},h=Buffer.from(d.data,"base64"),_={mimeType:"application/pdf",body:new aI.Stream.PassThrough().end(h)};return(await s.files.create({requestBody:m,media:_,supportsAllDrives:t.propsValue.include_team_drives})).data}});var uI=ue($e());var cI=te({auth:J,name:"search-folder",classification:"SEARCH",displayName:"Search",description:"Search a Google Drive folder for files/sub-folders",audience:"human",aiMetadata:{description:"Searches Google Drive for files or folders matching a name, full-text, or MIME-type query, optionally scoped to a parent folder and filtered to files or folders only. Use to resolve a file/folder ID from a human-readable name before acting on it. Read-only and idempotent.",idempotent:!0},props:{queryTerm:O.StaticDropdown({displayName:"Query Term",description:"The Query term or field of file/folder to search upon.",defaultValue:"name",options:{options:[{label:"File name",value:"name"},{label:"Full text search",value:"fullText"},{label:"Content type",value:"mimeType"}]},required:!0}),operator:O.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),query:O.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:O.StaticDropdown({displayName:"File Type",description:"(Optional) Choose between files and folders.",required:!1,options:{options:[{label:"All",value:"all"},{label:"Files",value:"file"},{label:"Folders",value:"folder"}]},defaultValue:"all"}),parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives},outputSchema:ZE,async run(t){let e=await oe(t.auth),r=(0,uI.drive)({version:"v3",auth:e}),n=t.propsValue.operator??"contains",s=`${t.propsValue.queryTerm??"name"} ${n} '${t.propsValue.query}'`;switch(t.propsValue.parentFolder&&(s=`${s} and '${t.propsValue.parentFolder}' in parents`),t.propsValue.type??"all"){case"file":s=`${s} and mimeType!='application/vnd.google-apps.folder'`;break;case"folder":s=`${s} and mimeType='application/vnd.google-apps.folder'`;break;default:break}let m=[],h;do{let v={q:s,fields:"nextPageToken, files(id, name, mimeType, createdTime, modifiedTime)",includeItemsFromAllDrives:t.propsValue.include_team_drives,supportsAllDrives:!0,corpora:t.propsValue.include_team_drives?"allDrives":"user",pageSize:1e3};h&&(v.pageToken=h);let _=await r.files.list(v);if(_.status!==200)throw console.error(_),new Error("Error searching for the file/folder");m.push(..._.data.files??[]),h=_.data.nextPageToken??void 0}while(h);return m.length>0?m:[]}});var lI=ue(mn()),dI=ue($e());var pI=te({auth:J,name:"upload_gdrive_file",classification:"WRITE",description:"Upload a file in your Google Drive",audience:"human",aiMetadata:{description:"Uploads a binary file (from a URL or base64 input) into Google Drive, optionally inside a parent folder. Use to store an existing file or attachment in Drive; the MIME type is inferred from the file extension. Not idempotent: each call creates a new file.",idempotent:!1},displayName:"Upload file",props:{fileName:O.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:O.File({displayName:"File",description:"The file URL or base64 to upload",required:!0,streaming:!0}),parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives},outputSchema:VE,async run(t){let e=t.propsValue.file,r=lI.default.lookup(e.extension??"")||"application/octet-stream",n=await oe(t.auth);return(await(0,dI.drive)({version:"v3",auth:n}).files.create({requestBody:{name:t.propsValue.fileName,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},media:{mimeType:r,body:e.body},supportsAllDrives:t.propsValue.include_team_drives??!1,fields:"id, name, mimeType, kind"})).data}});var hI=ue(es());var Wc={strategy:0,items:i(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await Ne.getFiles(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(s=>({epochMilliSeconds:(0,hI.default)(s.createdTime).valueOf(),data:s})),"items")},gI=Zi({auth:J,name:"new_file",classification:"READ",displayName:"New File",description:"Trigger when a new file is uploaded.",aiMetadata:{description:"Fires when a new file appears in Google Drive, optionally scoped to a specific parent folder. Each event represents one newly created file and its metadata, with optional inclusion of the file content."},props:{parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives,include_file_content:O.Checkbox({displayName:"Include File Content",description:"Include the file content in the output. This will increase the time taken to fetch the files and might cause issues with large files.",required:!1,defaultValue:!1})},outputSchema:rx,type:"POLLING",onEnable:i(async t=>{await zt.onEnable(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:i(async t=>{await zt.onDisable(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:i(async t=>{let e=await zt.poll(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await fI(e,t)},"run"),test:i(async t=>{let e=await zt.test(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await fI(e,t)},"test"),sampleData:{kind:"drive#file",mimeType:"image/png",id:"1dpv4-sKJfKRwI9qx1vWqQhEGEn3EpbI5",name:"google-drive.png",link:"https://cdn.activepieces.com/pieces/google-drive.png"}});async function fI(t,e){let r=JSON.parse(JSON.stringify(t));if(e.propsValue.include_file_content){let n=[];for(let s of r)n.push(Nt(e.auth,e.files,s.id,s.name));let o=await Promise.all(n);for(let s=0;s<r.length;s++)r[s].content=o[s]}return r}i(fI,"handleFileContent");var yI=ue(es());var Zc={strategy:0,items:i(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await Ne.getFolders(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(s=>({epochMilliSeconds:(0,yI.default)(s.createdTime).valueOf(),data:s})),"items")},vI=Zi({auth:J,name:"new_folder",classification:"READ",displayName:"New Folder",description:"Trigger when a new folder is created or uploaded.",aiMetadata:{description:"Fires when a new folder is created in Google Drive, optionally scoped to a specific parent folder. Each event represents one newly created folder and its metadata."},props:{parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives},outputSchema:ix,type:"POLLING",onEnable:i(async t=>{await zt.onEnable(Zc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:i(async t=>{await zt.onDisable(Zc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:i(async t=>await zt.poll(Zc,t),"run"),test:i(async t=>await zt.test(Zc,t),"test"),sampleData:{kind:"drive#file",mimeType:"application/vnd.google-apps.folder",id:"1aMEtTqIYn5651wdK7WLxaK_SDim4mvXW",name:"New Folder WOOOO"}});var Mm=ue(es());var Kc={strategy:0,items:i(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let n=r===0,o=await Ne.getFiles(t,{parent:e.parentFolder,changedSince:n?void 0:r,mimeTypes:e.file_types,excludeShortcuts:!0,includeTeamDrive:e.include_team_drives,maxPages:n?1:void 0},"modifiedTime desc")??[],s=Date.now();return o.filter(EI).filter(d=>wj({file:d,now:s})).map(d=>({epochMilliSeconds:SI(d),data:{...d,changeType:Pj({file:d,lastFetchEpochMS:r})}}))},"items")},TI=Zi({auth:J,name:"new_or_updated_file",classification:"READ",displayName:"New or Updated File",description:"Trigger when a file is created or updated, checked on a schedule. Each event carries a Change Type of created or updated, and several edits between two checks arrive as a single event. Renaming a file counts as an update. Trashing a file is not an event, and neither is restoring one from the bin nor moving an existing file into the watched folder. Selecting a parent folder watches its direct children only, not sub-folders.",aiMetadata:{description:"Fires when a file is created or modified in Google Drive, based on its creation and last-modified times (polling), optionally scoped to a parent folder and to specific file types. Each event represents one file and its metadata, carries a changeType of created or updated, and can include the file content, falling back to a contentError field when a download fails. Choose this over New File when edits to files that already exist should also trigger the flow."},props:{parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives,file_types:O.StaticMultiSelectDropdown({displayName:"File Types",description:"Only fire for files of these types. Leave empty to watch every type. If the type you need is not listed, switch this field to 'Dynamic value' (the toggle next to the field) and provide a list of MIME types.",required:!1,options:{options:[{label:"Google Sheets",value:"application/vnd.google-apps.spreadsheet"},{label:"Google Docs",value:"application/vnd.google-apps.document"},{label:"Google Slides",value:"application/vnd.google-apps.presentation"},{label:"Excel (XLSX)",value:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{label:"Excel 97-2003 (XLS)",value:"application/vnd.ms-excel"},{label:"CSV",value:"text/csv"},{label:"Word (DOCX)",value:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{label:"PowerPoint (PPTX)",value:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{label:"PDF",value:"application/pdf"},{label:"Plain Text (TXT)",value:"text/plain"},{label:"PNG",value:"image/png"},{label:"JPEG",value:"image/jpeg"},{label:"ZIP",value:"application/zip"}]}}),include_file_content:O.Checkbox({displayName:"Include File Content",description:"Include the file content in the output. This will increase the time taken to fetch the files and might cause issues with large files. If a download fails the event still arrives, carrying a File Content Error instead of the content.",required:!1,defaultValue:!1})},outputSchema:nx,type:"POLLING",onEnable:i(async t=>{await zt.onEnable(Kc,t)},"onEnable"),onDisable:i(async t=>{await zt.onDisable(Kc,t)},"onDisable"),run:i(async t=>{let e=Date.now()+bI,r=await zt.poll(Kc,t);return await _I({auth:t.auth,files:t.files,items:r,includeFileContent:t.propsValue.include_file_content,deadline:e})},"run"),test:i(async t=>{let e=Date.now()+bI,r=await zt.test(Kc,t);return await _I({auth:t.auth,files:t.files,items:r,includeFileContent:t.propsValue.include_file_content,deadline:e})},"test"),sampleData:{changeType:"updated",kind:"drive#file",id:"1dpv4-sKJfKRwI9qx1vWqQhEGEn3EpbI5",name:"quarterly-report.xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",webViewLink:"https://docs.google.com/spreadsheets/d/1dpv4-sKJfKRwI9qx1vWqQhEGEn3EpbI5/edit?usp=drivesdk",createdTime:"2026-08-20T09:12:44.000Z",modifiedTime:"2026-08-25T14:34:07.000Z"}});function ts(t){return typeof t=="string"&&(0,Mm.default)(t).isValid()?(0,Mm.default)(t).valueOf():0}i(ts,"epochOf");function SI(t){return Math.max(ts(t.modifiedTime),ts(t.createdTime))}i(SI,"changedAtEpoch");function wj({file:t,now:e}){let r=SI(t);return r>0&&r<=e}i(wj,"isDeliverable");function Pj({file:t,lastFetchEpochMS:e}){return e>0?ts(t.createdTime)>e?"created":"updated":ts(t.modifiedTime)>ts(t.createdTime)?"updated":"created"}i(Pj,"resolveChangeType");function EI(t){return typeof t=="object"&&t!==null&&"id"in t&&typeof t.id=="string"&&"name"in t&&typeof t.name=="string"}i(EI,"isDriveFile");function bj(t){return new Promise(e=>setTimeout(e,t))}i(bj,"delay");function Tj(){return Math.floor(Math.random()*xj)}i(Tj,"jitterMs");async function Sj({auth:t,files:e,file:r,deadline:n}){let o=Ij;for(let s=1;s<=PI;s++){if(Date.now()>=n)return{error:o};let{data:d,error:m}=await Bl(()=>Nt(t,e,r.id,r.name));if(m===null&&d!==null)return{content:d};o=m===null?"Download returned no content":m.message;let h=s*Ej+Tj();s<PI&&Date.now()+h<n&&await bj(h)}return{error:o}}i(Sj,"downloadContent");async function _I({auth:t,files:e,items:r,includeFileContent:n,deadline:o}){if(!n)return r;let s=[];for(let d=0;d<r.length;d+=wI){let m=r.slice(d,d+wI),h=await Promise.all(m.map(async v=>{if(!EI(v))return v;let _=await Sj({auth:t,files:e,file:v,deadline:o});return"content"in _?{...v,content:_.content}:{...v,contentError:_.error}}));s.push(...h)}return s}i(_I,"withFileContent");var wI=5,PI=3,Ej=500,xj=250,bI=4e4,Ij="Timed out before the file content could be downloaded";var xI=ue($e());var II=te({auth:J,name:"set_public_access",classification:"WRITE",description:"Set public access for a file or folder",audience:"human",aiMetadata:{description:"Makes a Drive file or folder accessible to anyone with the link at the chosen role (reader, commenter, or writer) and returns its shareable view/download URL. Use to publish a resource publicly. Requires the file/folder ID. Not idempotent: each call adds a new anyone-with-link permission.",idempotent:!1},displayName:"Set public access",props:{fileId:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),role:O.StaticDropdown({displayName:"Role",description:"The role to assign for public access",options:{options:[{label:"Reader",value:"reader"},{label:"Commenter",value:"commenter"},{label:"Editor",value:"writer"}]},defaultValue:"reader",required:!0})},outputSchema:XE,async run(t){let e=await oe(t.auth),r=t.propsValue.fileId,n=t.propsValue.role,o=(0,xI.drive)({version:"v3",auth:e}),s={role:n,type:"anyone"},d=await o.permissions.create({fileId:r,requestBody:s}),m=await o.files.get({fileId:r,fields:"name,mimeType,webContentLink,webViewLink"});if(m.data.mimeType==="application/vnd.google-apps.folder")return{...d.data,webViewLink:m.data.webViewLink,downloadUrl:null};let h=await Nt(t.auth,t.files,r,m.data.name);return{...d.data,downloadUrl:h}}});var AI=ue($e());var RI=te({auth:J,name:"google-drive-move-file",classification:"WRITE",displayName:"Move File",description:"Moves a file from one folder to another.",audience:"human",aiMetadata:{description:"Relocates a Drive file to a target folder, detaching it from its current parents and attaching it to the new one. Use to reorganize a file once you know its ID and the destination folder ID. Idempotent: repeating with the same destination leaves the file in the same folder.",idempotent:!0},props:{fileId:O.ShortText({displayName:"File ID",description:"You can use **Search Folder/File** action to retrieve ID.",required:!0}),include_team_drives:Ne.properties.include_team_drives,folderId:Ne.properties.parentFolder},outputSchema:YE,async run(t){let e=t.propsValue.fileId,r=t.propsValue.folderId,n=await oe(t.auth),o=(0,AI.drive)({version:"v3",auth:n}),s=await o.files.get({fileId:e,supportsAllDrives:t.propsValue.include_team_drives,fields:"id,parents"});return(await o.files.update({fileId:e,fields:"*",removeParents:s.data.parents?.join(","),addParents:r,supportsAllDrives:t.propsValue.include_team_drives})).data}});var DI=ue($e()),$I=te({auth:J,name:"delete_gdrive_file",classification:"DESTRUCTIVE",description:"Delete permanently a file from your Google Drive",audience:"human",aiMetadata:{description:"Permanently deletes a file from Google Drive by its ID, bypassing the trash and making it unrecoverable. Use only when permanent removal is intended; prefer Trash file for reversible deletion. Requires the file ID. Not idempotent: a repeat call fails because the file no longer exists.",idempotent:!1},displayName:"Delete file",props:{fileId:O.ShortText({displayName:"File ID",description:"The ID of the file to delete",required:!0}),include_team_drives:Ne.properties.include_team_drives},async run(t){let e=await oe(t.auth);return(await(0,DI.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives})).data}});var OI=ue($e());var CI=te({auth:J,name:"trash_gdrive_file",classification:"DESTRUCTIVE",description:"Move a file to the trash in your Google Drive",audience:"human",aiMetadata:{description:"Moves a Drive file to the trash by its ID, a reversible deletion that can be restored from Drive. Use for safe removal instead of permanent deletion. Requires the file ID. Idempotent: re-trashing an already-trashed file leaves it in the same state.",idempotent:!0},displayName:"Trash file",props:{fileId:O.ShortText({displayName:"File ID",description:"The ID of the file to trash",required:!0}),include_team_drives:Ne.properties.include_team_drives},outputSchema:tx,async run(t){let e=await oe(t.auth),r=(0,OI.drive)({version:"v3",auth:e}),n={trashed:!0};return(await r.files.update({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives,requestBody:n})).data}});var NI=require("node:stream"),kI=require("@zip.js/zip.js"),zI=ue(mn()),UI=ue(require("querystring"));var Aj=4,Rj=16*1024*1024,Dj=8*1024*1024,$j=20,MI="application/vnd.google-apps.folder",Oj={"application/vnd.google-apps.document":{key:"docs",exportMimeTypes:{pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}},"application/vnd.google-apps.spreadsheet":{key:"sheets",exportMimeTypes:{pdf:"application/pdf",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}},"application/vnd.google-apps.presentation":{key:"slides",exportMimeTypes:{pdf:"application/pdf",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}}},Cj=`
|
|
72
|
+
Download file response: ${m.status} ${m.statusText}`);let h=(0,rI.extension)(s),v=h?"."+h:"",_=o??r+v;return n.write({fileName:_,data:tI.Readable.fromWeb(m.body)})},"googledlCall");async function Nt(t,e,r,n){let o=await nI(t,r);if(["application/vnd.google-apps.document","application/vnd.google-apps.spreadsheet","application/vnd.google-apps.presentation"].includes(o)){switch(o){case"application/vnd.google-apps.document":o="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"application/vnd.google-apps.spreadsheet":o="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"application/vnd.google-apps.presentation":o="application/vnd.openxmlformats-officedocument.presentationml.presentation";break}return await eI(`https://www.googleapis.com/drive/v3/files/${r}/export?mimeType=${o}&supportsAllDrives=true`,t,r,e,n)}else return await eI(`https://www.googleapis.com/drive/v3/files/${r}?alt=media&supportsAllDrives=true`,t,r,e,n)}i(Nt,"downloadFileFromDrive");async function iI(t,e,r,n,o,s=0){let d=[];if(s>r)return d;let m=await it(t),h=`'${e}' in parents`;n||(h+=" and trashed=false");let v={q:h,fields:"nextPageToken,files(id,kind,mimeType,name,trashed,parents)",supportsAllDrives:"true",includeItemsFromAllDrives:o?"true":"false",corpora:o?"allDrives":"user",pageSize:"1000"},_=await ht.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Um.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of _.body.files)d.push({file:x,level:s,parentFolder:e});for(;_.body.nextPageToken;){v.pageToken=_.body.nextPageToken,_=await ht.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Um.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of _.body.files)d.push({file:x,level:s,parentFolder:e})}if(s+1<r){let x=d.filter(T=>T.file.mimeType==="application/vnd.google-apps.folder");for(let T of x){let P=await iI(t,T.file.id,r,n,o,s+1);d.push(...P)}}return d}i(iI,"getFilesRecursively");var oI=te({auth:J,name:"list-files",classification:"SEARCH",displayName:"List files",description:"List files from a Google Drive folder",audience:"human",aiMetadata:{description:"Lists files and subfolders inside a given Drive folder, with optional recursion to a chosen depth and optional download of each file's content. Use to enumerate the contents of a known folder ID. Read-only and idempotent. Requires the folder ID, not a name.",idempotent:!0},props:{folderId:O.ShortText({displayName:"Folder ID",description:"Folder ID coming from | New Folder -> id | (or any other source)",required:!0}),include_team_drives:Ne.properties.include_team_drives,includeTrashed:O.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depthLevel:O.Number({displayName:"Depth Level",description:"How many levels deep to search for files. 1 = current folder only, 2 = current + next level, etc.",required:!1,defaultValue:1}),downloadFiles:O.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1})},outputSchema:KE,async run(t){let e={type:"drive#fileList",incompleteSearch:!1,files:[]},r=t.propsValue.depthLevel||1,n=await iI(t.auth,t.propsValue.folderId,r,t.propsValue.includeTrashed??!1,t.propsValue.include_team_drives??!1);if(e.files=n.map(o=>o.file),t.propsValue.downloadFiles){let o=[],s={"application/pdf":".pdf","image/jpeg":".jpg","image/png":".png","image/tiff":".tiff","text/plain":".txt","text/csv":".csv","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":".xlsx"};for(let d of n){let m=d.file;if(m.mimeType==="application/vnd.google-apps.folder")continue;let h=m.name,v=s[m.mimeType];v&&!h.toLowerCase().endsWith(v)&&(m.mimeType==="image/jpeg"&&h.toLowerCase().endsWith(".jpeg")||(h=h+v));try{let _=await Nt(t.auth,t.files,m.id,h);o.push(_)}catch(_){console.warn(`Failed to download file ${m.name}: ${_ instanceof Error?_.message:"Download failed"}`)}}e.downloadedFiles=o}return e}});var aI=te({auth:J,name:"read-file",classification:"READ",displayName:"Read File Content",description:"Read a selected file from google drive file",audience:"human",aiMetadata:{description:"Downloads the content of a Drive file by its file ID and returns it as a usable file reference. Use to retrieve a file an agent already knows the ID of (e.g. from a trigger or search). Read-only and idempotent. Requires the exact file ID, not a name.",idempotent:!0},props:{fileId:O.ShortText({displayName:"File ID",description:"File ID coming from | New File -> id |",required:!0}),fileName:O.ShortText({displayName:"Destination File name",required:!1})},outputSchema:WE,run:i(async({auth:t,propsValue:e,files:r})=>Nt(t,r,e.fileId,e.fileName),"run")});var sI=ue($e()),uI=require("stream");var cI=te({displayName:"Save Document as PDF",auth:J,name:"save_file_as_pdf",classification:"WRITE",description:"Save a document as PDF in a Google Drive folder",audience:"human",aiMetadata:{description:"Exports a Google document to PDF and saves it as a new file in a target Drive folder. Use to produce a PDF rendition of a Google Doc/Sheet/Slides for sharing or archival. Requires the source document ID and destination folder ID. Not idempotent: each call creates a new PDF file.",idempotent:!1},props:{documentId:O.ShortText({displayName:"Document ID",description:"The ID of the document to export",required:!0}),folderId:O.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be exported",required:!0}),name:O.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0}),include_team_drives:Ne.properties.include_team_drives},outputSchema:XE,async run(t){let e=await oe(t.auth),r=t.propsValue.documentId,n=t.propsValue.folderId,o=t.propsValue.name,s=(0,sI.drive)({version:"v3",auth:e}),d=await s.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:o+".pdf",parents:[n]},h=Buffer.from(d.data,"base64"),_={mimeType:"application/pdf",body:new uI.Stream.PassThrough().end(h)};return(await s.files.create({requestBody:m,media:_,supportsAllDrives:t.propsValue.include_team_drives})).data}});var lI=ue($e());var dI=te({auth:J,name:"search-folder",classification:"SEARCH",displayName:"Search",description:"Search a Google Drive folder for files/sub-folders",audience:"human",aiMetadata:{description:"Searches Google Drive for files or folders matching a name, full-text, or MIME-type query, optionally scoped to a parent folder and filtered to files or folders only. Use to resolve a file/folder ID from a human-readable name before acting on it. Read-only and idempotent.",idempotent:!0},props:{queryTerm:O.StaticDropdown({displayName:"Query Term",description:"The Query term or field of file/folder to search upon.",defaultValue:"name",options:{options:[{label:"File name",value:"name"},{label:"Full text search",value:"fullText"},{label:"Content type",value:"mimeType"}]},required:!0}),operator:O.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),query:O.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:O.StaticDropdown({displayName:"File Type",description:"(Optional) Choose between files and folders.",required:!1,options:{options:[{label:"All",value:"all"},{label:"Files",value:"file"},{label:"Folders",value:"folder"}]},defaultValue:"all"}),parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives},outputSchema:JE,async run(t){let e=await oe(t.auth),r=(0,lI.drive)({version:"v3",auth:e}),n=t.propsValue.operator??"contains",s=`${t.propsValue.queryTerm??"name"} ${n} '${t.propsValue.query}'`;switch(t.propsValue.parentFolder&&(s=`${s} and '${t.propsValue.parentFolder}' in parents`),t.propsValue.type??"all"){case"file":s=`${s} and mimeType!='application/vnd.google-apps.folder'`;break;case"folder":s=`${s} and mimeType='application/vnd.google-apps.folder'`;break;default:break}let m=[],h;do{let v={q:s,fields:"nextPageToken, files(id, name, mimeType, createdTime, modifiedTime)",includeItemsFromAllDrives:t.propsValue.include_team_drives,supportsAllDrives:!0,corpora:t.propsValue.include_team_drives?"allDrives":"user",pageSize:1e3};h&&(v.pageToken=h);let _=await r.files.list(v);if(_.status!==200)throw console.error(_),new Error("Error searching for the file/folder");m.push(..._.data.files??[]),h=_.data.nextPageToken??void 0}while(h);return m.length>0?m:[]}});var pI=ue(mn()),fI=ue($e());var mI=te({auth:J,name:"upload_gdrive_file",classification:"WRITE",description:"Upload a file in your Google Drive",audience:"human",aiMetadata:{description:"Uploads a binary file (from a URL or base64 input) into Google Drive, optionally inside a parent folder. Use to store an existing file or attachment in Drive; the MIME type is inferred from the file extension. Not idempotent: each call creates a new file.",idempotent:!1},displayName:"Upload file",props:{fileName:O.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:O.File({displayName:"File",description:"The file URL or base64 to upload",required:!0,streaming:!0}),parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives},outputSchema:HE,async run(t){let e=t.propsValue.file,{body:r}=vw.toStreamingBody(e),n=pI.default.lookup(e.extension??"")||"application/octet-stream",o=await oe(t.auth);return(await(0,fI.drive)({version:"v3",auth:o}).files.create({requestBody:{name:t.propsValue.fileName,...t.propsValue.parentFolder?{parents:[t.propsValue.parentFolder]}:{}},media:{mimeType:n,body:r},supportsAllDrives:t.propsValue.include_team_drives??!1,fields:"id, name, mimeType, kind"})).data}});var yI=ue(es());var Wc={strategy:0,items:i(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await Ne.getFiles(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(s=>({epochMilliSeconds:(0,yI.default)(s.createdTime).valueOf(),data:s})),"items")},vI=Zi({auth:J,name:"new_file",classification:"READ",displayName:"New File",description:"Trigger when a new file is uploaded.",aiMetadata:{description:"Fires when a new file appears in Google Drive, optionally scoped to a specific parent folder. Each event represents one newly created file and its metadata, with optional inclusion of the file content."},props:{parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives,include_file_content:O.Checkbox({displayName:"Include File Content",description:"Include the file content in the output. This will increase the time taken to fetch the files and might cause issues with large files.",required:!1,defaultValue:!1})},outputSchema:ix,type:"POLLING",onEnable:i(async t=>{await zt.onEnable(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:i(async t=>{await zt.onDisable(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:i(async t=>{let e=await zt.poll(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await hI(e,t)},"run"),test:i(async t=>{let e=await zt.test(Wc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await hI(e,t)},"test"),sampleData:{kind:"drive#file",mimeType:"image/png",id:"1dpv4-sKJfKRwI9qx1vWqQhEGEn3EpbI5",name:"google-drive.png",link:"https://cdn.activepieces.com/pieces/google-drive.png"}});async function hI(t,e){let r=JSON.parse(JSON.stringify(t));if(e.propsValue.include_file_content){let n=[];for(let s of r)n.push(Nt(e.auth,e.files,s.id,s.name));let o=await Promise.all(n);for(let s=0;s<r.length;s++)r[s].content=o[s]}return r}i(hI,"handleFileContent");var _I=ue(es());var Zc={strategy:0,items:i(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await Ne.getFolders(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(s=>({epochMilliSeconds:(0,_I.default)(s.createdTime).valueOf(),data:s})),"items")},wI=Zi({auth:J,name:"new_folder",classification:"READ",displayName:"New Folder",description:"Trigger when a new folder is created or uploaded.",aiMetadata:{description:"Fires when a new folder is created in Google Drive, optionally scoped to a specific parent folder. Each event represents one newly created folder and its metadata."},props:{parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives},outputSchema:ax,type:"POLLING",onEnable:i(async t=>{await zt.onEnable(Zc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:i(async t=>{await zt.onDisable(Zc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:i(async t=>await zt.poll(Zc,t),"run"),test:i(async t=>await zt.test(Zc,t),"test"),sampleData:{kind:"drive#file",mimeType:"application/vnd.google-apps.folder",id:"1aMEtTqIYn5651wdK7WLxaK_SDim4mvXW",name:"New Folder WOOOO"}});var Mm=ue(es());var Kc={strategy:0,items:i(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let n=r===0,o=await Ne.getFiles(t,{parent:e.parentFolder,changedSince:n?void 0:r,mimeTypes:e.file_types,excludeShortcuts:!0,includeTeamDrive:e.include_team_drives,maxPages:n?1:void 0},"modifiedTime desc")??[],s=Date.now();return o.filter(II).filter(d=>Sj({file:d,now:s})).map(d=>({epochMilliSeconds:xI(d),data:{...d,changeType:Ej({file:d,lastFetchEpochMS:r})}}))},"items")},EI=Zi({auth:J,name:"new_or_updated_file",classification:"READ",displayName:"New or Updated File",description:"Trigger when a file is created or updated, checked on a schedule. Each event carries a Change Type of created or updated, and several edits between two checks arrive as a single event. Renaming a file counts as an update. Trashing a file is not an event, and neither is restoring one from the bin nor moving an existing file into the watched folder. Selecting a parent folder watches its direct children only, not sub-folders.",aiMetadata:{description:"Fires when a file is created or modified in Google Drive, based on its creation and last-modified times (polling), optionally scoped to a parent folder and to specific file types. Each event represents one file and its metadata, carries a changeType of created or updated, and can include the file content, falling back to a contentError field when a download fails. Choose this over New File when edits to files that already exist should also trigger the flow."},props:{parentFolder:Ne.properties.parentFolder,include_team_drives:Ne.properties.include_team_drives,file_types:O.StaticMultiSelectDropdown({displayName:"File Types",description:"Only fire for files of these types. Leave empty to watch every type. If the type you need is not listed, switch this field to 'Dynamic value' (the toggle next to the field) and provide a list of MIME types.",required:!1,options:{options:[{label:"Google Sheets",value:"application/vnd.google-apps.spreadsheet"},{label:"Google Docs",value:"application/vnd.google-apps.document"},{label:"Google Slides",value:"application/vnd.google-apps.presentation"},{label:"Excel (XLSX)",value:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{label:"Excel 97-2003 (XLS)",value:"application/vnd.ms-excel"},{label:"CSV",value:"text/csv"},{label:"Word (DOCX)",value:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{label:"PowerPoint (PPTX)",value:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{label:"PDF",value:"application/pdf"},{label:"Plain Text (TXT)",value:"text/plain"},{label:"PNG",value:"image/png"},{label:"JPEG",value:"image/jpeg"},{label:"ZIP",value:"application/zip"}]}}),include_file_content:O.Checkbox({displayName:"Include File Content",description:"Include the file content in the output. This will increase the time taken to fetch the files and might cause issues with large files. If a download fails the event still arrives, carrying a File Content Error instead of the content.",required:!1,defaultValue:!1})},outputSchema:ox,type:"POLLING",onEnable:i(async t=>{await zt.onEnable(Kc,t)},"onEnable"),onDisable:i(async t=>{await zt.onDisable(Kc,t)},"onDisable"),run:i(async t=>{let e=Date.now()+SI,r=await zt.poll(Kc,t);return await PI({auth:t.auth,files:t.files,items:r,includeFileContent:t.propsValue.include_file_content,deadline:e})},"run"),test:i(async t=>{let e=Date.now()+SI,r=await zt.test(Kc,t);return await PI({auth:t.auth,files:t.files,items:r,includeFileContent:t.propsValue.include_file_content,deadline:e})},"test"),sampleData:{changeType:"updated",kind:"drive#file",id:"1dpv4-sKJfKRwI9qx1vWqQhEGEn3EpbI5",name:"quarterly-report.xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",webViewLink:"https://docs.google.com/spreadsheets/d/1dpv4-sKJfKRwI9qx1vWqQhEGEn3EpbI5/edit?usp=drivesdk",createdTime:"2026-08-20T09:12:44.000Z",modifiedTime:"2026-08-25T14:34:07.000Z"}});function ts(t){return typeof t=="string"&&(0,Mm.default)(t).isValid()?(0,Mm.default)(t).valueOf():0}i(ts,"epochOf");function xI(t){return Math.max(ts(t.modifiedTime),ts(t.createdTime))}i(xI,"changedAtEpoch");function Sj({file:t,now:e}){let r=xI(t);return r>0&&r<=e}i(Sj,"isDeliverable");function Ej({file:t,lastFetchEpochMS:e}){return e>0?ts(t.createdTime)>e?"created":"updated":ts(t.modifiedTime)>ts(t.createdTime)?"updated":"created"}i(Ej,"resolveChangeType");function II(t){return typeof t=="object"&&t!==null&&"id"in t&&typeof t.id=="string"&&"name"in t&&typeof t.name=="string"}i(II,"isDriveFile");function xj(t){return new Promise(e=>setTimeout(e,t))}i(xj,"delay");function Ij(){return Math.floor(Math.random()*Dj)}i(Ij,"jitterMs");async function Aj({auth:t,files:e,file:r,deadline:n}){let o=$j;for(let s=1;s<=TI;s++){if(Date.now()>=n)return{error:o};let{data:d,error:m}=await Bl(()=>Nt(t,e,r.id,r.name));if(m===null&&d!==null)return{content:d};o=m===null?"Download returned no content":m.message;let h=s*Rj+Ij();s<TI&&Date.now()+h<n&&await xj(h)}return{error:o}}i(Aj,"downloadContent");async function PI({auth:t,files:e,items:r,includeFileContent:n,deadline:o}){if(!n)return r;let s=[];for(let d=0;d<r.length;d+=bI){let m=r.slice(d,d+bI),h=await Promise.all(m.map(async v=>{if(!II(v))return v;let _=await Aj({auth:t,files:e,file:v,deadline:o});return"content"in _?{...v,content:_.content}:{...v,contentError:_.error}}));s.push(...h)}return s}i(PI,"withFileContent");var bI=5,TI=3,Rj=500,Dj=250,SI=4e4,$j="Timed out before the file content could be downloaded";var AI=ue($e());var RI=te({auth:J,name:"set_public_access",classification:"WRITE",description:"Set public access for a file or folder",audience:"human",aiMetadata:{description:"Makes a Drive file or folder accessible to anyone with the link at the chosen role (reader, commenter, or writer) and returns its shareable view/download URL. Use to publish a resource publicly. Requires the file/folder ID. Not idempotent: each call adds a new anyone-with-link permission.",idempotent:!1},displayName:"Set public access",props:{fileId:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),role:O.StaticDropdown({displayName:"Role",description:"The role to assign for public access",options:{options:[{label:"Reader",value:"reader"},{label:"Commenter",value:"commenter"},{label:"Editor",value:"writer"}]},defaultValue:"reader",required:!0})},outputSchema:ex,async run(t){let e=await oe(t.auth),r=t.propsValue.fileId,n=t.propsValue.role,o=(0,AI.drive)({version:"v3",auth:e}),s={role:n,type:"anyone"},d=await o.permissions.create({fileId:r,requestBody:s}),m=await o.files.get({fileId:r,fields:"name,mimeType,webContentLink,webViewLink"});if(m.data.mimeType==="application/vnd.google-apps.folder")return{...d.data,webViewLink:m.data.webViewLink,downloadUrl:null};let h=await Nt(t.auth,t.files,r,m.data.name);return{...d.data,downloadUrl:h}}});var DI=ue($e());var $I=te({auth:J,name:"google-drive-move-file",classification:"WRITE",displayName:"Move File",description:"Moves a file from one folder to another.",audience:"human",aiMetadata:{description:"Relocates a Drive file to a target folder, detaching it from its current parents and attaching it to the new one. Use to reorganize a file once you know its ID and the destination folder ID. Idempotent: repeating with the same destination leaves the file in the same folder.",idempotent:!0},props:{fileId:O.ShortText({displayName:"File ID",description:"You can use **Search Folder/File** action to retrieve ID.",required:!0}),include_team_drives:Ne.properties.include_team_drives,folderId:Ne.properties.parentFolder},outputSchema:QE,async run(t){let e=t.propsValue.fileId,r=t.propsValue.folderId,n=await oe(t.auth),o=(0,DI.drive)({version:"v3",auth:n}),s=await o.files.get({fileId:e,supportsAllDrives:t.propsValue.include_team_drives,fields:"id,parents"});return(await o.files.update({fileId:e,fields:"*",removeParents:s.data.parents?.join(","),addParents:r,supportsAllDrives:t.propsValue.include_team_drives})).data}});var OI=ue($e()),CI=te({auth:J,name:"delete_gdrive_file",classification:"DESTRUCTIVE",description:"Delete permanently a file from your Google Drive",audience:"human",aiMetadata:{description:"Permanently deletes a file from Google Drive by its ID, bypassing the trash and making it unrecoverable. Use only when permanent removal is intended; prefer Trash file for reversible deletion. Requires the file ID. Not idempotent: a repeat call fails because the file no longer exists.",idempotent:!1},displayName:"Delete file",props:{fileId:O.ShortText({displayName:"File ID",description:"The ID of the file to delete",required:!0}),include_team_drives:Ne.properties.include_team_drives},async run(t){let e=await oe(t.auth);return(await(0,OI.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives})).data}});var NI=ue($e());var kI=te({auth:J,name:"trash_gdrive_file",classification:"DESTRUCTIVE",description:"Move a file to the trash in your Google Drive",audience:"human",aiMetadata:{description:"Moves a Drive file to the trash by its ID, a reversible deletion that can be restored from Drive. Use for safe removal instead of permanent deletion. Requires the file ID. Idempotent: re-trashing an already-trashed file leaves it in the same state.",idempotent:!0},displayName:"Trash file",props:{fileId:O.ShortText({displayName:"File ID",description:"The ID of the file to trash",required:!0}),include_team_drives:Ne.properties.include_team_drives},outputSchema:nx,async run(t){let e=await oe(t.auth),r=(0,NI.drive)({version:"v3",auth:e}),n={trashed:!0};return(await r.files.update({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives,requestBody:n})).data}});var zI=require("node:stream"),UI=require("@zip.js/zip.js"),MI=ue(mn()),FI=ue(require("querystring"));var Oj=4,Cj=16*1024*1024,Nj=8*1024*1024,kj=20,LI="application/vnd.google-apps.folder",zj={"application/vnd.google-apps.document":{key:"docs",exportMimeTypes:{pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}},"application/vnd.google-apps.spreadsheet":{key:"sheets",exportMimeTypes:{pdf:"application/pdf",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}},"application/vnd.google-apps.presentation":{key:"slides",exportMimeTypes:{pdf:"application/pdf",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}}},Uj=`
|
|
73
73
|
- ZipCrypto: Legacy encryption method with wide compatibility (not recommended for sensitive data)
|
|
74
74
|
- AES-256: Modern encryption with strong security (may not be supported by older zip clients)
|
|
75
|
-
`;async function
|
|
75
|
+
`;async function Mj({auth:t,folderId:e,includeTeamDrives:r}){let n=await it(t),o=[],s={q:`'${e}' in parents and trashed=false`,fields:"nextPageToken,files(id,name,mimeType,size)",supportsAllDrives:"true",includeItemsFromAllDrives:r?"true":"false",corpora:r?"allDrives":"user",pageSize:"1000"},d;do{d&&(s.pageToken=d);let m=await ht.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${FI.default.stringify(s)}`,headers:{Authorization:`Bearer ${n}`}});o.push(...m.body.files??[]),d=m.body.nextPageToken}while(d);return o}i(Mj,"listFolderChildren");function Fj(t,e){let r=e.length>0?e:"/",n=`"${t}"`;if(t.includes("/"))return{name:n,location:r,message:'contains "/"'};if(t.includes("\\"))return{name:n,location:r,message:'contains "\\"'};if(t==="..")return{name:n,location:r,message:"escapes the archive root on extraction"};if(t===".")return{name:n,location:r,message:"collides with other paths once normalized on extraction"}}i(Fj,"checkSafeItemName");function Lj(t,e){if(t.mimeType===LI)return{item:t,name:t.name};let r=zj[t.mimeType];if(r){let n=e[r.key];if(n==="skip")return;let o=r.exportMimeTypes[n],s=(0,MI.extension)(o);return{item:t,name:s?`${t.name}.${s}`:t.name,downloadUrl:`https://www.googleapis.com/drive/v3/files/${t.id}/export?mimeType=${encodeURIComponent(o)}&supportsAllDrives=true`}}if(!t.mimeType.startsWith("application/vnd.google-apps."))return{item:t,name:t.name,downloadUrl:`https://www.googleapis.com/drive/v3/files/${t.id}?alt=media&supportsAllDrives=true`}}i(Lj,"resolveItem");function jj(t,e){let r=new Map;for(let{name:s}of t){let d=s.toLowerCase(),m=r.get(d);m?m.push(s):r.set(d,[s])}let n=e.length>0?e:"/",o=[];for(let s of r.values()){if(s.length<=1)continue;let d=[...new Set(s)];o.push({name:d.map(m=>`"${m}"`).join(", "),location:n,message:d.length>1?`${s.length} items would map to the same zip path (names differing only by case collide on Windows and macOS)`:`${s.length} items would map to the same zip path`})}return o}i(jj,"checkUniqueNames");async function jI({auth:t,folderId:e,relativePrefix:r,nativeFormats:n,includeTeamDrives:o,out:s,errors:d}){let m=await Mj({auth:t,folderId:e,includeTeamDrives:o});if(m.length===0){r.length>0&&s.push({relativePath:r,fileId:e,isEmptyFolder:!0,sizeBytes:0});return}let h=m.map(v=>Lj(v,n)).filter(v=>v!==void 0);for(let{item:v}of h){let _=Fj(v.name,r);_&&d.push(_)}d.push(...jj(h,r));for(let v of h){let _=r.length>0?`${r}/${v.name}`:v.name;if(v.item.mimeType===LI){await jI({auth:t,folderId:v.item.id,relativePrefix:_,nativeFormats:n,includeTeamDrives:o,out:s,errors:d});continue}let x=Number(v.item.size);s.push({relativePath:_,fileId:v.item.id,isEmptyFolder:!1,downloadUrl:v.downloadUrl,sizeBytes:Number.isFinite(x)?x:Nj})}}i(jI,"walk");async function qj({auth:t,rootFolderId:e,nativeFormats:r,includeTeamDrives:n}){let o=[],s=[];if(await jI({auth:t,folderId:e,relativePrefix:"",nativeFormats:r,includeTeamDrives:n,out:o,errors:s}),s.length>0){let d=[...s].sort((v,_)=>v.location.localeCompare(_.location)||v.name.localeCompare(_.name)),m=d.slice(0,kj),h=m.map(v=>`- [${v.location}] ${v.name} ${v.message}`);throw d.length>m.length&&h.push(`- ...and ${d.length-m.length} more`),new Error(`Cannot export (${s.length} problem${s.length>1?"s":""}) - Rename the conflicting or unsafe items in Drive and try again.
|
|
76
76
|
${h.join(`
|
|
77
|
-
`)}`)}return o}i(Mj,"collectZipEntries");function Fj(t){let e=[],r=[],n=0;for(let o of t){let s=n+o.sizeBytes>Rj,d=r.length>=Aj;r.length>0&&(s||d)&&(e.push(r),r=[],n=0),r.push(o),n+=o.sizeBytes}return r.length>0&&e.push(r),e}i(Fj,"batchByBytes");async function Lj({auth:t,entry:e,zipWriter:r,fileAddOptions:n}){if(!e.downloadUrl)throw new Error(`No download URL for entry "${e.relativePath}"`);let o=await it(t),s=await fetch(e.downloadUrl,{headers:{Authorization:`Bearer ${o}`}});if(!s.ok||!s.body){let d=await s.text().catch(()=>"");throw s.status===403&&d.includes("exportSizeLimitExceeded")?new Error(`Export failed for "${e.relativePath}": exceeds Drive's ~10MB export size limit.`):new Error(`Failed to download "${e.relativePath}" (HTTP ${s.status}): ${d}`)}await r.add(e.relativePath,s.body,n)}i(Lj,"downloadAndAddZipEntry");var LI=te({auth:J,name:"drive_export_folder_as_zip",classification:"READ",displayName:"Export Folder as Zip",description:"Recursively export a Google Drive folder (with all subfolders) as a single zip file.",audience:"human",aiMetadata:{description:"Recursively downloads every file in a Drive folder (including subfolders) and packages them into a single zip whose internal paths mirror the folder hierarchy. Native Google Docs/Sheets/Slides are converted per user-chosen format (PDF/Office format) or skipped. Fails the whole action if any single file cannot be downloaded/exported. Optionally password-protects the zip.",idempotent:!0},props:{duplicatePathWarning:O.MarkDown({value:`Zip paths mirror the Drive folder exactly, with no renaming. The action fails before downloading anything if: a file and a folder share a name in the same Drive folder, two items share a name, or a Google Doc/Sheet/Slides export lands on a name that already exists (e.g. a Sheet named "Report" exported as PDF alongside an existing "Report.pdf"); or an included item's name contains "/" or "\\", or is exactly "." or ".." (not usable as a zip path segment). Rename the conflicting or unsafe item in Drive and re-run.`,variant:"WARNING"}),folderId:O.Dropdown({displayName:"Folder",description:"The Drive folder to export (including all subfolders).",required:!0,auth:J,refreshers:["includeTeamDrives"],refreshOnSearch:!0,options:i(async({auth:t,includeTeamDrives:e},r)=>Ne.fetchFolderDropdownOptions({auth:t,searchValue:r?.searchValue,includeTeamDrives:e}),"options")}),includeTeamDrives:O.Checkbox({displayName:"Include Team Drives",required:!1,defaultValue:!1}),googleDocsFormat:O.StaticDropdown({displayName:"Google Docs",description:"How to include native Google Docs found in the folder.",required:!0,defaultValue:"docx",options:{options:[{label:"Word (DOCX)",value:"docx"},{label:"PDF",value:"pdf"},{label:"Skip",value:"skip"}]}}),googleSheetsFormat:O.StaticDropdown({displayName:"Google Sheets",description:"How to include native Google Sheets found in the folder.",required:!0,defaultValue:"xlsx",options:{options:[{label:"Excel (XLSX)",value:"xlsx"},{label:"PDF",value:"pdf"},{label:"Skip",value:"skip"}]}}),googleSlidesFormat:O.StaticDropdown({displayName:"Google Slides",description:"How to include native Google Slides found in the folder.",required:!0,defaultValue:"pptx",options:{options:[{label:"PowerPoint (PPTX)",value:"pptx"},{label:"PDF",value:"pdf"},{label:"Skip",value:"skip"}]}}),outputFileName:O.ShortText({displayName:"Output Zip File Name",required:!0,defaultValue:"export.zip"}),usePassword:O.Checkbox({displayName:"Use password",description:"Enable password protection for the zip file",required:!1,defaultValue:!1}),passwordOptions:O.DynamicProperties({displayName:"Password options",required:!1,auth:Hi.None(),refreshers:["usePassword"],props:i(async({usePassword:t})=>t?{password:O.ShortText({displayName:"Password",required:!0}),encryptionMethod:O.StaticDropdown({displayName:"Encryption Method",description:Cj,required:!0,defaultValue:"zipcrypto",options:{disabled:!1,options:[{label:"ZipCrypto (Most Compatible)",value:"zipcrypto"},{label:"AES-256 (Stronger Security)",value:"aes-256"}]}})}:{},"props")})},async run(t){let e={docs:t.propsValue.googleDocsFormat,sheets:t.propsValue.googleSheetsFormat,slides:t.propsValue.googleSlidesFormat},r=await Mj({auth:t.auth,rootFolderId:t.propsValue.folderId,nativeFormats:e,includeTeamDrives:t.propsValue.includeTeamDrives??!1}),n={};if(t.propsValue.usePassword){let _=t.propsValue.passwordOptions?.password,x=t.propsValue.passwordOptions?.encryptionMethod;if(!_)throw new Error('Cannot export: "Use password" is enabled but no password was provided. Enter a password or turn the option off.');n.password=_,x==="aes-256"?n.encryptionStrength=3:n.zipCrypto=!0}let o=new TransformStream,s=new kI.ZipWriter(o.writable),d=NI.Readable.fromWeb(o.readable),m=t.files.write({data:d,fileName:t.propsValue.outputFileName});m.catch(()=>{});let h=[],v=[];for(let _ of r)(_.isEmptyFolder?v:h).push(_);try{for(let _ of Fj(h))await Promise.all(_.map(x=>Lj({auth:t.auth,entry:x,zipWriter:s,fileAddOptions:n})));for(let _ of v)await s.add(`${_.relativePath}/`,void 0,{directory:!0});await s.close()}catch(_){throw d.destroy(_ instanceof Error?_:new Error(String(_))),_}return m}});var jI=ue($e());var qI=te({auth:J,name:"drive_create_folder",classification:"WRITE",displayName:"Create Folder",description:"Create a new empty folder in your Google Drive",audience:"ai",aiMetadata:{description:"Creates a new empty folder in Google Drive, optionally nested under a parent folder (resolve the parent ID via `drive_search_files`). Use to set up a destination before uploading or moving files. Each call creates a distinct folder even with the same name, so retries duplicate.",idempotent:!1},outputSchema:Dx,props:{folder_name:O.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parent_folder_id:O.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to create the new folder inside. Leave empty to create it in the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let e=await oe(t.auth);return(await(0,jI.drive)({version:"v3",auth:e}).files.create({requestBody:{mimeType:"application/vnd.google-apps.folder",name:t.propsValue.folder_name,...t.propsValue.parent_folder_id?{parents:[t.propsValue.parent_folder_id]}:{}},supportsAllDrives:!0})).data}});var BI=ue(la());var VI=te({auth:J,name:"drive_create_file_from_text",classification:"WRITE",displayName:"Create File from Text",description:"Create a new text file in your Google Drive from text",audience:"ai",aiMetadata:{description:"Creates a new Drive file from inline text content as plain text, CSV, or XML. Use when an agent has generated text it needs to persist as a Drive file; for binary or existing files use `drive_upload_file` instead. Each call creates a new file.",idempotent:!1},outputSchema:ux,props:{file_name:O.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:O.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),content_type:O.StaticDropdown({displayName:"Content type",description:"Select file type",required:!0,defaultValue:"plain/text",options:{options:[{label:"Text",value:"plain/text"},{label:"CSV",value:"text/csv"},{label:"XML",value:"text/xml"}]}}),parent_folder_id:O.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to create the file inside. Leave empty to create it in the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let e={mimeType:t.propsValue.content_type,name:t.propsValue.file_name,...t.propsValue.parent_folder_id?{parents:[t.propsValue.parent_folder_id]}:{}},r=Buffer.from(JSON.stringify(e),"utf-8"),n=Buffer.from(t.propsValue.text,"utf-8"),o=new BI.default;return o.append("Metadata",r,{contentType:"application/json"}),o.append("Media",n,{contentType:t.propsValue.content_type}),(await ht.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart",body:o,headers:{...o.getHeaders()},queryParams:{supportsAllDrives:"true"},authentication:{type:"BEARER_TOKEN",token:await it(t.auth)}})).body}});var GI=ue(la());var HI=ue(mn());var WI=te({auth:J,name:"drive_upload_file",classification:"WRITE",displayName:"Upload File",description:"Upload a file in your Google Drive",audience:"ai",aiMetadata:{description:"Uploads a binary file (from a URL or base64 input) into Drive; MIME type is inferred from the extension. Use to store an existing file or attachment; for plain generated text use `drive_create_file_from_text`, and to fetch a remote URL server-side use `drive_upload_from_url`. Each call creates a new file.",idempotent:!1},outputSchema:cx,props:{file_name:O.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:O.File({displayName:"File",description:"The file URL or base64 to upload",required:!0}),parent_folder_id:O.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to upload the file into. Leave empty to upload to the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let e=t.propsValue.file,n={mimeType:HI.default.lookup(e.extension?e.extension:""),name:t.propsValue.file_name,...t.propsValue.parent_folder_id?{parents:[t.propsValue.parent_folder_id]}:{}},o=Buffer.from(JSON.stringify(n),"utf-8"),s=Buffer.from(e.base64,"base64"),d=new GI.default;return d.append("Metadata",o,{contentType:"application/json"}),d.append("Media",s),(await ht.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files",queryParams:{uploadType:"multipart",supportsAllDrives:"true"},body:d,headers:{...d.getHeaders()},authentication:{type:"BEARER_TOKEN",token:await it(t.auth)}})).body}});var ZI=ue(la());var KI=ue(mn());var JI=te({auth:J,name:"drive_upload_from_url",classification:"WRITE",displayName:"Upload File from URL",description:"Fetch a file from a public URL and upload it into Google Drive.",audience:"ai",aiMetadata:{description:"Fetches a file from a public URL and uploads it into Drive in one step (server-side fetch, no base64 round-trip). Use when the agent has a downloadable link rather than file bytes; for bytes already in hand use `drive_upload_file`, and for plain generated text use `drive_create_file_from_text`. Each call creates a new file.",idempotent:!1},outputSchema:Cx,props:{source_url:O.ShortText({displayName:"Source URL",description:"The publicly accessible URL to fetch the file from. Only public URLs are supported (no authentication headers are sent).",required:!0}),file_name:O.ShortText({displayName:"File name",description:"The name to give the uploaded file in Drive.",required:!0}),mime_type:O.ShortText({displayName:"MIME Type",description:"Optional MIME type for the uploaded file (e.g. application/pdf). Provide this when the URL has no file extension; otherwise the type is inferred from the URL.",required:!1}),parent_folder_id:O.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to upload the file into. Leave empty to upload to the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let{source_url:e,file_name:r,mime_type:n,parent_folder_id:o}=t.propsValue,s;try{s=await ht.sendRequest({method:"GET",url:e,responseType:"arraybuffer"})}catch(T){throw new Error(`Failed to fetch the file from the source URL (${e}). Ensure it is a publicly accessible link. Underlying error: ${T?.message??T}`)}let d=n||KI.default.lookup(e)||"application/octet-stream",m={mimeType:d,name:r,...o?{parents:[o]}:{}},h=Buffer.from(JSON.stringify(m),"utf-8"),v=Buffer.from(s.body),_=new ZI.default;return _.append("Metadata",h,{contentType:"application/json"}),_.append("Media",v,{contentType:d}),(await ht.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files",queryParams:{uploadType:"multipart",supportsAllDrives:"true"},body:_,headers:{..._.getHeaders()},authentication:{type:"BEARER_TOKEN",token:await it(t.auth)}})).body}});var YI=ue(mn());var XI=te({auth:J,name:"drive_replace_file_content",classification:"WRITE",displayName:"Replace File Content",description:"Replace an existing Drive file's bytes, keeping its ID and name.",audience:"ai",aiMetadata:{description:"Replaces the contents of an existing Drive file with new bytes, keeping the same file ID, name, and location. Use to update a file in place (e.g. overwrite a report); to create a brand-new file use `drive_upload_file`, and to rename without changing content use `drive_update_file_metadata`. Each call overwrites the previous content.",idempotent:!1},outputSchema:_x,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the existing file whose content to replace. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),file:O.File({displayName:"New File Content",description:"The file URL or base64 whose bytes will replace the existing content.",required:!0}),mime_type:O.ShortText({displayName:"MIME Type",description:"Optional MIME type for the new content (e.g. application/pdf). Provide this when the source has no file extension; otherwise the type is inferred from the extension.",required:!1})},async run(t){let{file_id:e,file:r,mime_type:n}=t.propsValue,o=n||YI.default.lookup(r.extension?r.extension:"")||"application/octet-stream",s=Buffer.from(r.base64,"base64");return(await ht.sendRequest({method:"PATCH",url:`https://www.googleapis.com/upload/drive/v3/files/${e}`,queryParams:{uploadType:"media",supportsAllDrives:"true"},body:s,headers:{"Content-Type":o},authentication:{type:"BEARER_TOKEN",token:await it(t.auth)}})).body}});var QI=te({auth:J,name:"drive_download_file",classification:"READ",displayName:"Download File Content",description:"Read a selected file from google drive file",audience:"ai",aiMetadata:{description:"Downloads a Drive file's bytes by ID and returns a file reference; native Google files (Docs/Sheets/Slides) are auto-exported to their default Office format. Use to retrieve content of a file you have the ID for (obtain it from `drive_search_files` or `drive_get_file`). Read-only.",idempotent:!0},outputSchema:Nx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to download. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),destination_file_name:O.ShortText({displayName:"Destination File name",required:!1})},run:i(async({auth:t,propsValue:e,files:r})=>Nt(t,r,e.file_id,e.destination_file_name),"run")});var eA=ue($e()),tA=ue(mn());var rA=te({auth:J,name:"drive_export_workspace_file",classification:"READ",displayName:"Export Google Doc/Sheet/Slides",description:"Export a native Google Workspace file (Doc/Sheet/Slides) to a chosen format.",audience:"ai",aiMetadata:{description:"Exports a native Google Workspace file (Doc/Sheet/Slides) to a caller-chosen format and returns the bytes. Use when you need a specific format such as PDF, HTML, CSV, or Markdown; for the default rendition or for ordinary binary files use `drive_download_file`. The chosen format must match the source type (Doc formats for a Doc, Sheet formats for a Sheet, etc.). Read-only. Export size is capped at ~10 MB by Drive.",idempotent:!0},outputSchema:kx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the native Google Workspace file to export. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),mime_type:O.StaticDropdown({displayName:"Export Format",description:"The target format. It must match the source type: Doc formats for a Google Doc, Sheet formats for a Google Sheet, Slides formats for Google Slides. An incompatible pairing returns an error.",required:!0,options:{options:[{label:"Word (DOCX) \u2014 Docs",value:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{label:"PDF \u2014 Docs/Sheets/Slides",value:"application/pdf"},{label:"HTML \u2014 Docs",value:"text/html"},{label:"Plain Text (TXT) \u2014 Docs",value:"text/plain"},{label:"Rich Text (RTF) \u2014 Docs",value:"application/rtf"},{label:"OpenDocument Text (ODT) \u2014 Docs",value:"application/vnd.oasis.opendocument.text"},{label:"EPUB \u2014 Docs",value:"application/epub+zip"},{label:"Markdown (MD) \u2014 Docs",value:"text/markdown"},{label:"Excel (XLSX) \u2014 Sheets",value:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{label:"CSV \u2014 Sheets",value:"text/csv"},{label:"TSV \u2014 Sheets",value:"text/tab-separated-values"},{label:"OpenDocument Spreadsheet (ODS) \u2014 Sheets",value:"application/vnd.oasis.opendocument.spreadsheet"},{label:"PowerPoint (PPTX) \u2014 Slides",value:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{label:"OpenDocument Presentation (ODP) \u2014 Slides",value:"application/vnd.oasis.opendocument.presentation"},{label:"PNG \u2014 Slides",value:"image/png"},{label:"SVG \u2014 Slides",value:"image/svg+xml"}]}})},async run(t){let{file_id:e,mime_type:r}=t.propsValue,n=await oe(t.auth),o=(0,eA.drive)({version:"v3",auth:n});try{let s=await o.files.export({fileId:e,mimeType:r},{responseType:"arraybuffer"}),d=(0,tA.extension)(r),m=d?"."+d:"";return t.files.write({fileName:e+m,data:Buffer.from(s.data)})}catch(s){throw(s?.errors?.[0]?.reason??s?.response?.data?.error?.errors?.[0]?.reason)==="exportSizeLimitExceeded"?new Error(`Export failed: the file exceeds Drive's ~10 MB export size limit (file ID: ${e}). Use drive_download_file to fetch the source directly instead.`):s.code===403?new Error(`Permission denied exporting file ${e}. You may lack access to this file.`):s.code===400?new Error(`Invalid export for file ${e}: the chosen format does not match the source type, or this is not a native Google Workspace file. Use drive_download_file for ordinary binary files.`):s.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):s}}});var nA=ue($e());var iA=te({auth:J,name:"drive_get_file",classification:"READ",displayName:"Get File or Folder",description:"Get a file folder for files/sub-folders",audience:"ai",aiMetadata:{description:"Fetches metadata for a single file or folder by its exact ID (name, MIME type, parents, owners, links). Use when you already have an ID (e.g. from a trigger or `drive_search_files`) and need its details, including its parent folder IDs. Read-only and safe to retry.",idempotent:!0},outputSchema:ox,props:{file_id:O.ShortText({displayName:"File / Folder ID",description:"The ID of the file/folder to fetch. Resolve it via `drive_search_files` or `drive_list_files`.",required:!0})},async run(t){let e=await oe(t.auth),n=await(0,nA.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.file_id,supportsAllDrives:!0});return n.data?n.data:null}});var Fm=ue(require("querystring"));async function oA(t,e,r,n,o,s=0){let d=[];if(s>r)return d;let m=await it(t),h=`'${e}' in parents`;n||(h+=" and trashed=false");let v={q:h,fields:"nextPageToken,files(id,kind,mimeType,name,trashed,parents)",supportsAllDrives:"true",includeItemsFromAllDrives:o?"true":"false",corpora:o?"allDrives":"user",pageSize:"1000"},_=await ht.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Fm.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of _.body.files)d.push({file:x,level:s,parentFolder:e});for(;_.body.nextPageToken;){v.pageToken=_.body.nextPageToken,_=await ht.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Fm.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of _.body.files)d.push({file:x,level:s,parentFolder:e})}if(s+1<r){let x=d.filter(T=>T.file.mimeType==="application/vnd.google-apps.folder");for(let T of x){let P=await oA(t,T.file.id,r,n,o,s+1);d.push(...P)}}return d}i(oA,"getFilesRecursively");var aA=te({auth:J,name:"drive_list_files",classification:"SEARCH",displayName:"List Folder Contents",description:"List files from a Google Drive folder",audience:"ai",aiMetadata:{description:"Lists files and subfolders inside a given folder ID, optionally recursing to a chosen depth and downloading each file's content. Use to enumerate the contents of a known folder; to find a file by name across Drive use `drive_search_files`. Read-only. Requires the folder ID, not a name.",idempotent:!0},outputSchema:ax,props:{folder_id:O.ShortText({displayName:"Folder ID",description:"The ID of the folder to list. Resolve it via `drive_search_files` (or any other source).",required:!0}),include_trashed:O.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depth_level:O.Number({displayName:"Depth Level",description:"How many levels deep to search for files. 1 = current folder only, 2 = current + next level, etc.",required:!1,defaultValue:1}),download_files:O.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1}),include_team_drives:O.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},async run(t){let e={type:"drive#fileList",incompleteSearch:!1,files:[]},r=t.propsValue.depth_level||1,n=await oA(t.auth,t.propsValue.folder_id,r,t.propsValue.include_trashed??!1,t.propsValue.include_team_drives??!1);if(e.files=n.map(o=>o.file),t.propsValue.download_files){let o=[],s={"application/pdf":".pdf","image/jpeg":".jpg","image/png":".png","image/tiff":".tiff","text/plain":".txt","text/csv":".csv","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":".xlsx"};for(let d of n){let m=d.file;if(m.mimeType==="application/vnd.google-apps.folder")continue;let h=m.name,v=s[m.mimeType];v&&!h.toLowerCase().endsWith(v)&&(m.mimeType==="image/jpeg"&&h.toLowerCase().endsWith(".jpeg")||(h=h+v));try{let _=await Nt(t.auth,t.files,m.id,h);o.push(_)}catch(_){console.warn(`Failed to download file ${m.name}: ${_ instanceof Error?_.message:"Download failed"}`)}}e.downloadedFiles=o}return e}});var sA=ue($e());var uA=te({auth:J,name:"drive_search_files",classification:"SEARCH",displayName:"Search Files and Folders",description:"Search a Google Drive folder for files/sub-folders",audience:"ai",aiMetadata:{description:"Searches Drive for files or folders matching a name, full-text, or MIME-type query, optionally scoped to a parent folder. Use this to resolve a human-readable name into a file/folder ID before acting on it; to list a known folder's children use `drive_list_files` instead. Read-only.",idempotent:!0},outputSchema:sx,props:{query_term:O.StaticDropdown({displayName:"Query Term",description:"The Query term or field of file/folder to search upon.",defaultValue:"name",options:{options:[{label:"File name",value:"name"},{label:"Full text search",value:"fullText"},{label:"Content type",value:"mimeType"}]},required:!0}),operator:O.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),value:O.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:O.StaticDropdown({displayName:"File Type",description:"(Optional) Choose between files and folders.",required:!1,options:{options:[{label:"All",value:"all"},{label:"Files",value:"file"},{label:"Folders",value:"folder"}]},defaultValue:"all"}),parent_folder_id:O.ShortText({displayName:"Parent Folder ID",description:"(Optional) Restrict the search to files/folders inside this folder ID.",required:!1}),include_team_drives:O.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},async run(t){let e=await oe(t.auth),r=(0,sA.drive)({version:"v3",auth:e}),n=t.propsValue.operator??"contains",s=`${t.propsValue.query_term??"name"} ${n} '${t.propsValue.value}'`;switch(t.propsValue.parent_folder_id&&(s=`${s} and '${t.propsValue.parent_folder_id}' in parents`),t.propsValue.type??"all"){case"file":s=`${s} and mimeType!='application/vnd.google-apps.folder'`;break;case"folder":s=`${s} and mimeType='application/vnd.google-apps.folder'`;break;default:break}let m=[],h;do{let v={q:s,fields:"nextPageToken, files(id, name, mimeType, createdTime, modifiedTime)",includeItemsFromAllDrives:t.propsValue.include_team_drives,supportsAllDrives:!0,corpora:t.propsValue.include_team_drives?"allDrives":"user",pageSize:1e3};h&&(v.pageToken=h);let _=await r.files.list(v);if(_.status!==200)throw console.error(_),new Error("Error searching for the file/folder");m.push(..._.data.files??[]),h=_.data.nextPageToken??void 0}while(h);return m.length>0?m:[]}});var cA=ue($e());var lA=te({auth:J,name:"drive_copy_file",classification:"WRITE",displayName:"Copy File",description:"Duplicate a file from Google Drive. Returns the new file ID.",audience:"ai",aiMetadata:{description:"Copies an existing Drive file into a target folder under a new name, optionally converting it to a Google Sheet or Doc. Use to clone a file or make an editable Google-format copy; to relocate the original instead of copying use `drive_move_file`. Requires source file ID and destination folder ID. Each call creates a new copy.",idempotent:!1},outputSchema:lx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to duplicate. Resolve it via `drive_search_files`.",required:!0}),name:O.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folder_id:O.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be duplicated. Resolve it via `drive_search_files`.",required:!0}),convert_to:O.StaticDropdown({displayName:"Duplicate as",description:"If left unselected the file will be duplicated as it is",required:!1,options:{options:[{label:"Google Sheets",value:"application/vnd.google-apps.spreadsheet"},{label:"Google Docs",value:"application/vnd.google-apps.document"}]}})},async run(t){let e=await oe(t.auth),r=t.propsValue.file_id,n=t.propsValue.name,o=t.propsValue.folder_id,s=t.propsValue.convert_to,d=(0,cA.drive)({version:"v3",auth:e}),m={name:n,parents:[o]};s&&(m.mimeType=s);let h=await d.files.copy({fileId:r,auth:e,requestBody:m,supportsAllDrives:!0});if(h.status!==200)throw new Error("Error duplicating file");return h.data}});var dA=ue($e());var pA=te({auth:J,name:"drive_move_file",classification:"WRITE",displayName:"Move File",description:"Move a Drive file from its current folder(s) to a target folder.",audience:"ai",aiMetadata:{description:"Relocates a file to a target folder, detaching it from its current parents and attaching the new one. Use to reorganize a file by ID; to copy instead of move use drive_copy_file, and to rename without moving use drive_update_file_metadata. Safe to retry \u2014 repeating leaves the file in the same destination.",idempotent:!0},outputSchema:dx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to move. Resolve it via drive_search_files or drive_get_file.",required:!0}),folder_id:O.ShortText({displayName:"Destination Folder ID",description:"The ID of the folder to move the file into. Resolve it via drive_search_files; leave empty for the root of My Drive.",required:!0})},async run(t){let e=t.propsValue.file_id,r=t.propsValue.folder_id,n=await oe(t.auth),o=(0,dA.drive)({version:"v3",auth:n}),s=await o.files.get({fileId:e,supportsAllDrives:!0,fields:"id,parents"});return(await o.files.update({fileId:e,fields:"*",removeParents:s.data.parents?.join(","),addParents:r,supportsAllDrives:!0})).data}});var fA=ue($e());var mA=te({auth:J,name:"drive_update_file_metadata",classification:"WRITE",displayName:"Update File Metadata (Rename)",description:"Rename a Drive file/folder or update its description or starred flag (metadata only).",audience:"ai",aiMetadata:{description:"Renames a file/folder or updates its description or starred flag via a metadata-only PATCH. Use to rename or annotate a resource; this never changes the file's location \u2014 to re-parent use `drive_move_file`, and to replace the file's bytes use `drive_replace_file_content`. Safe to retry \u2014 re-applying the same values is a no-op.",idempotent:!0},outputSchema:px,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),name:O.ShortText({displayName:"New Name",description:"A new name for the file or folder. Leave empty to keep the current name.",required:!1}),description:O.ShortText({displayName:"Description",description:"A new description for the file or folder. Leave empty to keep the current description.",required:!1}),starred:O.Checkbox({displayName:"Starred",description:"Whether to mark the file or folder as starred.",required:!1})},async run(t){let{file_id:e,name:r,description:n,starred:o}=t.propsValue,s={};r!=null&&r!==""&&(s.name=r),n!=null&&(s.description=n),o!=null&&(s.starred=o);let d=await oe(t.auth),m=(0,fA.drive)({version:"v3",auth:d});try{return(await m.files.update({fileId:e,supportsAllDrives:!0,requestBody:s})).data}catch(h){throw h.code===404?new Error(`File or folder not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):h.code===403?new Error(`Permission denied updating file ${e}. You may lack edit permission on this resource.`):h}}});var hA=ue($e()),gA=require("stream");var yA=te({auth:J,name:"drive_save_file_as_pdf",classification:"WRITE",displayName:"Save File as PDF",description:"Save a document as PDF in a Google Drive folder",audience:"ai",aiMetadata:{description:"Exports a native Google document to PDF and saves it as a new file in a target Drive folder. Use to produce a PDF rendition of a Google Doc/Sheet/Slides for sharing or archival (resolve the source and folder IDs via `drive_search_files`). Each call creates a new PDF file.",idempotent:!1},outputSchema:Rx,props:{document_id:O.ShortText({displayName:"Document ID",description:"The ID of the document to export. Resolve it via `drive_search_files`.",required:!0}),folder_id:O.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be exported. Resolve it via `drive_search_files`.",required:!0}),name:O.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0})},async run(t){let e=await oe(t.auth),r=t.propsValue.document_id,n=t.propsValue.folder_id,o=t.propsValue.name,s=(0,hA.drive)({version:"v3",auth:e}),d=await s.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:o+".pdf",parents:[n]},h=Buffer.from(d.data,"base64"),_={mimeType:"application/pdf",body:new gA.Stream.PassThrough().end(h)};return(await s.files.create({requestBody:m,media:_,supportsAllDrives:!0})).data}});var vA=ue($e());var _A=te({auth:J,name:"drive_trash_file",classification:"DESTRUCTIVE",displayName:"Trash File",description:"Move a Drive file to the trash by ID (reversible deletion).",audience:"ai",aiMetadata:{description:"Moves a file to the trash by ID \u2014 a reversible deletion restorable from Drive. Use for safe removal; for irreversible removal use drive_delete_file, and to restore use drive_untrash_file. Safe to retry \u2014 re-trashing leaves it trashed.",idempotent:!0},outputSchema:yx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to trash. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let e=await oe(t.auth),r=(0,vA.drive)({version:"v3",auth:e}),n={trashed:!0};return(await r.files.update({fileId:t.propsValue.file_id,supportsAllDrives:!0,requestBody:n})).data}});var wA=ue($e());var PA=te({auth:J,name:"drive_untrash_file",classification:"WRITE",displayName:"Restore File from Trash",description:"Restore a trashed Drive file by ID back to its original location.",audience:"ai",aiMetadata:{description:"Restores a trashed file by ID back to its original location. Use to undo a `drive_trash_file`; to permanently purge instead use `drive_empty_trash` or `drive_delete_file`. Safe to retry \u2014 re-restoring an active file is a no-op.",idempotent:!0},outputSchema:vx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the trashed file to restore. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let{file_id:e}=t.propsValue,r=await oe(t.auth),n=(0,wA.drive)({version:"v3",auth:r});try{return(await n.files.update({fileId:e,supportsAllDrives:!0,requestBody:{trashed:!1}})).data}catch(o){throw o.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):o.code===403?new Error(`Permission denied restoring file ${e}. You may lack permission to restore this resource.`):o}}});var bA=ue($e()),TA=te({auth:J,name:"drive_delete_file",classification:"DESTRUCTIVE",displayName:"Delete File Permanently",description:"Permanently delete a Drive file by ID, bypassing the trash.",audience:"ai",aiMetadata:{description:"Permanently deletes a file by ID, bypassing the trash \u2014 unrecoverable. Use only when permanent removal is intended; for reversible deletion prefer drive_trash_file. A repeat call fails because the file no longer exists.",idempotent:!1},props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to permanently delete. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let e=await oe(t.auth);return(await(0,bA.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.file_id,supportsAllDrives:!0})).data}});var SA=ue($e());var EA=te({auth:J,name:"drive_empty_trash",classification:"DESTRUCTIVE",displayName:"Empty Trash",description:"Permanently delete ALL files in the trash (irreversible, account-wide).",audience:"ai",aiMetadata:{description:"DESTRUCTIVE: permanently deletes EVERY file currently in the trash \u2014 this is an irreversible, account-wide purge (not a single file), or scoped to one shared drive if `drive_id` is given. The entire trash is emptied, so any file the user trashed is gone for good. Use only as a deliberate cleanup step; to remove a single file reversibly use `drive_trash_file`, and to permanently remove one specific file use `drive_delete_file`. Not safe to retry casually \u2014 it purges whatever is in the trash at call time.",idempotent:!1},outputSchema:Mx,props:{drive_id:O.ShortText({displayName:"Shared Drive ID",description:"Optional. Restrict the purge to a single shared drive's trash (resolve via drive_list_shared_drives). Leave empty to empty the entire My Drive trash for the connected account.",required:!1})},async run(t){let{drive_id:e}=t.propsValue,r=await oe(t.auth),n=(0,SA.drive)({version:"v3",auth:r});try{return await n.files.emptyTrash({...e?{driveId:e}:{}}),{success:!0,driveId:e??null}}catch(o){throw o.code===403?new Error("Permission denied emptying the trash. You may lack permission to empty this trash."):o}}});var xA=ue($e());var IA=te({auth:J,name:"drive_share_file",classification:"WRITE",displayName:"Share File with User",description:"Grant a role on a Drive file or folder to a user by email.",audience:"ai",aiMetadata:{description:"Grants a role to a user (by email) on a file or folder, optionally emailing them. Use to share with a specific person; to share with anyone-with-the-link use drive_set_public_access, and to change an existing collaborator's role use drive_update_permission. Each call creates a new permission grant.",idempotent:!1},outputSchema:fx,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to share. Resolve it via drive_search_files or drive_get_file.",required:!0}),user_email:O.ShortText({displayName:"User Email",description:"The email address of the user to grant access to.",required:!0}),role:O.StaticDropdown({displayName:"Role",description:"The role to grant to the user. See https://developers.google.com/drive/api/guides/ref-roles",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}}),send_invitation_email:O.Checkbox({displayName:"Send Invitation Email",description:"Send an email to the user to notify them of the new permission.",required:!0})},async run(t){let{file_id:e,user_email:r,role:n,send_invitation_email:o}=t.propsValue,s=await oe(t.auth),d=(0,xA.drive)({version:"v3",auth:s}),m={type:"user",role:n,emailAddress:r};return(await d.permissions.create({requestBody:m,fileId:e,sendNotificationEmail:o,supportsAllDrives:!0})).data}});var AA=ue($e());var RA=te({auth:J,name:"drive_set_public_access",classification:"WRITE",displayName:"Set Public Access",description:"Make a Drive file or folder accessible to anyone with the link.",audience:"ai",aiMetadata:{description:"Makes a file or folder accessible to anyone with the link at the chosen role and returns its shareable view/download URL. Use to publish a resource publicly; to share with a named person instead use drive_share_file. Each call adds a new anyone-with-link permission.",idempotent:!1},outputSchema:hx,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to make public. Resolve it via drive_search_files or drive_get_file.",required:!0}),role:O.StaticDropdown({displayName:"Role",description:"The role to assign for public access.",options:{options:[{label:"Reader",value:"reader"},{label:"Commenter",value:"commenter"},{label:"Editor",value:"writer"}]},defaultValue:"reader",required:!0})},async run(t){let e=await oe(t.auth),r=t.propsValue.file_id,n=t.propsValue.role,o=(0,AA.drive)({version:"v3",auth:e}),s={role:n,type:"anyone"},d=await o.permissions.create({fileId:r,requestBody:s,supportsAllDrives:!0}),m=await o.files.get({fileId:r,fields:"name,mimeType,webContentLink,webViewLink",supportsAllDrives:!0});if(m.data.mimeType==="application/vnd.google-apps.folder")return{...d.data,webViewLink:m.data.webViewLink,downloadUrl:null};let h=await Nt(t.auth,t.files,r,m.data.name);return{...d.data,downloadUrl:h}}});var DA=ue($e());var $A=te({auth:J,name:"drive_list_permissions",classification:"SEARCH",displayName:"List Permissions",description:"List every permission on a Drive file or folder.",audience:"ai",aiMetadata:{description:"Lists every permission (who has access and at what role) on a file or folder, with each permission's id, type, role, and email/domain. Use to audit sharing before granting or revoking; it is the resolver for the permissionId other sharing atomics need. Read-only.",idempotent:!0},outputSchema:mx,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder whose permissions to list. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let{file_id:e}=t.propsValue,r=await oe(t.auth),n=(0,DA.drive)({version:"v3",auth:r});try{let s=(await n.permissions.list({fileId:e,fields:"permissions(id,type,role,emailAddress,domain)",supportsAllDrives:!0})).data.permissions??[];return{permissions:s,count:s.length}}catch(o){throw o.code===404?new Error(`File or folder not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):o.code===403?new Error(`Permission denied listing permissions for file ${e}. You may lack access to this resource.`):o}}});var OA=ue($e());var CA=te({auth:J,name:"drive_update_permission",classification:"WRITE",displayName:"Update Permission Role",description:"Change an existing collaborator's role on a Drive file or folder.",audience:"ai",aiMetadata:{description:"Changes an existing collaborator's role in place (e.g. reader to writer), resolving the permission by their email internally. Use to upgrade or downgrade access without unsharing; to grant net-new access use drive_share_file. If the user has no existing grant it is a no-op (it never silently creates one). Safe to retry.",idempotent:!0},outputSchema:gx,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder whose permission to update. Resolve it via drive_search_files or drive_get_file.",required:!0}),user_email:O.ShortText({displayName:"User Email",description:"The email address of the collaborator whose role to change. The existing permission is matched by this email; list current grants via drive_list_permissions.",required:!0}),new_role:O.StaticDropdown({displayName:"New Role",description:"The role to set for the user. See https://developers.google.com/drive/api/guides/ref-roles",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}})},async run(t){let{file_id:e,user_email:r,new_role:n}=t.propsValue,o=await oe(t.auth),s=(0,OA.drive)({version:"v3",auth:o});try{let h=((await s.permissions.list({fileId:e,fields:"permissions(id,emailAddress,role)",supportsAllDrives:!0})).data.permissions??[]).find(_=>_.emailAddress===r);return!h||!h.id?{updated:!1,message:`No existing permission found for ${r}. Use drive_share_file to grant new access.`}:{updated:!0,permission:(await s.permissions.update({fileId:e,permissionId:h.id,requestBody:{role:n},supportsAllDrives:!0})).data}}catch(d){throw d.code===404?new Error(`File or folder not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):d.code===403?new Error(`Permission denied updating the role on file ${e}. You may lack permission to manage sharing on this resource.`):d}}});var NA=ue($e());var kA=te({auth:J,name:"drive_remove_permission",classification:"DESTRUCTIVE",displayName:"Remove Permission",description:"Revoke a role from a user on a Drive file or folder.",audience:"ai",aiMetadata:{description:"Revokes a specific role from a user (matched by email and role) on a file or folder, resolving the permission ID internally. Use to unshare or remove access; to lower a role instead of removing it use drive_update_permission. Safe to retry \u2014 if no matching permission exists it is a no-op.",idempotent:!0},outputSchema:Fx,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to remove the permission from. Resolve it via drive_search_files or drive_get_file.",required:!0}),user_email:O.ShortText({displayName:"User Email",description:"The email address of the user whose access to revoke.",required:!0}),role:O.StaticDropdown({displayName:"Role",description:"The role to remove from the user. The grant is matched by email and role.",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}})},async run(t){let[e,r]=[t.propsValue.file_id,t.propsValue.user_email],n=await oe(t.auth),o=(0,NA.drive)({version:"v3",auth:n}),s=await o.permissions.list({fileId:e,fields:"permissions(id, emailAddress, role)",supportsAllDrives:!0});if(s.data.permissions){for(let d of s.data.permissions)if(d.emailAddress===r&&d.role===t.propsValue.role)return await o.permissions.delete({fileId:e,permissionId:d.id?d.id:"",supportsAllDrives:!0}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var zA=ue($e());var UA=te({auth:J,name:"drive_list_shared_drives",classification:"SEARCH",displayName:"List Shared Drives",description:"List the shared drives the account can access.",audience:"ai",aiMetadata:{description:"Lists the shared drives the account can access, with each drive's id and name. Use to discover a driveId before creating or listing content in a shared drive or before drive_get_shared_drive, drive_update_shared_drive, or drive_delete_shared_drive. Read-only.",idempotent:!0},outputSchema:Px,props:{query:O.ShortText({displayName:"Query",description:"Optional search query to filter shared drives, e.g. name contains 'marketing'. See https://developers.google.com/drive/api/guides/search-shareddrives",required:!1}),page_size:O.Number({displayName:"Page Size",description:"Maximum number of shared drives to return (1-100). Defaults to 100.",required:!1})},async run(t){let{query:e,page_size:r}=t.propsValue,n=await oe(t.auth),o=(0,zA.drive)({version:"v3",auth:n});try{let d=(await o.drives.list({q:e||void 0,pageSize:r||void 0})).data.drives??[];return{drives:d,count:d.length}}catch(s){throw s.code===403?new Error("Permission denied listing shared drives. Your account may not have shared-drive access."):s}}});var MA=ue($e());var FA=te({auth:J,name:"drive_get_shared_drive",classification:"READ",displayName:"Get Shared Drive",description:"Fetch metadata for one shared drive by ID.",audience:"ai",aiMetadata:{description:"Fetches metadata and capabilities for one shared drive by ID (resolve the ID via drive_list_shared_drives). Use to inspect a shared drive's settings before modifying it. Read-only.",idempotent:!0},outputSchema:bx,props:{drive_id:O.ShortText({displayName:"Shared Drive ID",description:"The ID of the shared drive. Resolve it via drive_list_shared_drives.",required:!0})},async run(t){let{drive_id:e}=t.propsValue,r=await oe(t.auth),n=(0,MA.drive)({version:"v3",auth:r});try{return(await n.drives.get({driveId:e})).data}catch(o){throw o.code===404?new Error(`Shared drive not found (ID: ${e}). Resolve a valid ID via drive_list_shared_drives.`):o.code===403?new Error(`Permission denied accessing shared drive ${e}. You may not be a member of this drive.`):o}}});var LA=require("crypto");var jA=ue($e());var qA=te({auth:J,name:"drive_create_shared_drive",classification:"WRITE",displayName:"Create Shared Drive",description:"Create a new shared drive (Team Drive).",audience:"ai",aiMetadata:{description:"Creates a new shared drive (Team Drive) with the given name; the action supplies the required idempotency requestId internally. Use to set up a shared workspace. Each call creates a distinct shared drive. Your Workspace admin must have shared-drive creation enabled (a 403 here is an admin-policy issue, not a scope issue).",idempotent:!1},outputSchema:$x,props:{name:O.ShortText({displayName:"Name",description:"The name of the new shared drive.",required:!0})},async run(t){let{name:e}=t.propsValue,r=await oe(t.auth),n=(0,jA.drive)({version:"v3",auth:r}),o=(0,LA.randomUUID)();try{return(await n.drives.create({requestId:o,requestBody:{name:e}})).data}catch(s){throw s.code===403?new Error("Permission denied creating a shared drive. Your Google Workspace admin may have disabled shared-drive creation for your account."):s}}});var BA=ue($e());var VA=te({auth:J,name:"drive_update_shared_drive",classification:"WRITE",displayName:"Update Shared Drive",description:"Rename or update a shared drive by ID.",audience:"ai",aiMetadata:{description:"Renames or updates a shared drive's settings by ID (resolve via drive_list_shared_drives). Use to rename a shared drive; to remove it entirely use drive_delete_shared_drive. Safe to retry \u2014 re-applying the same values is a no-op.",idempotent:!0},outputSchema:Ox,props:{drive_id:O.ShortText({displayName:"Shared Drive ID",description:"The ID of the shared drive to update. Resolve it via drive_list_shared_drives.",required:!0}),name:O.ShortText({displayName:"Name",description:"The new name for the shared drive. Leave empty to keep the current name.",required:!1})},async run(t){let{drive_id:e,name:r}=t.propsValue,n=await oe(t.auth),o=(0,BA.drive)({version:"v3",auth:n}),s={};r&&(s.name=r);try{return(await o.drives.update({driveId:e,requestBody:s})).data}catch(d){throw d.code===404?new Error(`Shared drive not found (ID: ${e}). Resolve a valid ID via drive_list_shared_drives.`):d.code===403?new Error(`Permission denied updating shared drive ${e}. You must be an organizer of this drive.`):d}}});var GA=ue($e());var HA=te({auth:J,name:"drive_delete_shared_drive",classification:"DESTRUCTIVE",displayName:"Delete Shared Drive",description:"Permanently delete a shared drive by ID.",audience:"ai",aiMetadata:{description:"Permanently deletes a shared drive by ID (it must already be empty). Irreversible. Use only to remove a no-longer-needed shared drive. A repeat call fails because the drive no longer exists.",idempotent:!1},outputSchema:Ux,props:{drive_id:O.ShortText({displayName:"Shared Drive ID",description:"The ID of the shared drive to delete. Resolve it via drive_list_shared_drives.",required:!0})},async run(t){let{drive_id:e}=t.propsValue,r=await oe(t.auth),n=(0,GA.drive)({version:"v3",auth:r});try{return await n.drives.delete({driveId:e}),{deleted:!0,driveId:e}}catch(o){throw o.code===404?new Error(`Shared drive not found (ID: ${e}). It may have already been deleted. Resolve a valid ID via drive_list_shared_drives.`):o.code===400?new Error(`Cannot delete shared drive ${e}: it must be empty before deletion. Remove or trash all of its files first.`):o.code===403?new Error(`Permission denied deleting shared drive ${e}. You must be an organizer of this drive.`):o}}});var WA=ue($e());var ZA=te({auth:J,name:"drive_create_comment",classification:"WRITE",displayName:"Create Comment",description:"Add a new comment to a Drive file.",audience:"ai",aiMetadata:{description:"Adds a new top-level comment to a file. Use to leave feedback or a note on a file (resolve the file ID via drive_search_files); to respond to an existing comment use drive_create_reply instead. Each call creates a new comment, so retries duplicate.",idempotent:!1},outputSchema:Ex,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to comment on. Resolve it via drive_search_files or drive_get_file.",required:!0}),content:O.LongText({displayName:"Content",description:"The plain-text content of the comment.",required:!0})},async run(t){let{file_id:e,content:r}=t.propsValue,n=await oe(t.auth),o=(0,WA.drive)({version:"v3",auth:n});try{return(await o.comments.create({fileId:e,fields:"*",requestBody:{content:r}})).data}catch(s){throw s.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):s.code===403?new Error(`Permission denied commenting on file ${e}. You may lack comment access to this file.`):s}}});var KA=ue($e());var JA=te({auth:J,name:"drive_list_comments",classification:"SEARCH",displayName:"List Comments",description:"List the comments on a Drive file.",audience:"ai",aiMetadata:{description:"Lists the comments on a file with each comment's id, author, content, and resolved state. Use to read discussion on a file or to resolve a commentId before replying (drive_create_reply) or listing its replies (drive_list_replies). Read-only.",idempotent:!0},outputSchema:Tx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file whose comments to list. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let{file_id:e}=t.propsValue,r=await oe(t.auth),n=(0,KA.drive)({version:"v3",auth:r});try{let s=(await n.comments.list({fileId:e,fields:"*",includeDeleted:!1})).data.comments??[];return{comments:s,count:s.length}}catch(o){throw o.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):o.code===403?new Error(`Permission denied listing comments for file ${e}. You may lack access to this file.`):o}}});var YA=ue($e());var XA=te({auth:J,name:"drive_create_reply",classification:"WRITE",displayName:"Reply to Comment",description:"Add a reply to an existing comment on a Drive file.",audience:"ai",aiMetadata:{description:"Adds a reply to an existing comment, optionally resolving or reopening the comment via the action field. Use to respond to a comment (resolve the commentId via drive_list_comments); to start a new top-level comment use drive_create_comment instead. Each call creates a new reply, so retries duplicate.",idempotent:!1},outputSchema:Sx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:O.ShortText({displayName:"Comment ID",description:"The ID of the comment to reply to. Resolve it via drive_list_comments.",required:!0}),content:O.LongText({displayName:"Content",description:"The plain-text content of the reply.",required:!0}),action:O.StaticDropdown({displayName:"Action",description:"Optionally change the parent comment's state: resolve (mark resolved) or reopen.",required:!1,options:{options:[{label:"Resolve",value:"resolve"},{label:"Reopen",value:"reopen"}]}})},async run(t){let{file_id:e,comment_id:r,content:n,action:o}=t.propsValue,s=await oe(t.auth),d=(0,YA.drive)({version:"v3",auth:s}),m={content:n};o&&(m.action=o);try{return(await d.replies.create({fileId:e,commentId:r,fields:"*",requestBody:m})).data}catch(h){throw h.code===404?new Error(`File or comment not found (file ID: ${e}, comment ID: ${r}). Resolve the comment ID via drive_list_comments.`):h.code===403?new Error(`Permission denied replying to comment ${r} on file ${e}. You may lack comment access to this file.`):h}}});var QA=ue($e());var eR=te({auth:J,name:"drive_get_reply",classification:"READ",displayName:"Get Reply",description:"Fetch a single reply on a Drive comment by ID.",audience:"ai",aiMetadata:{description:"Fetches a single reply by ID, including its author, content, and action. Use when you already have a replyId (resolve it via drive_list_replies) and need that one reply's details. Read-only.",idempotent:!0},outputSchema:xx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:O.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:O.ShortText({displayName:"Reply ID",description:"The ID of the reply to fetch. Resolve it via drive_list_replies.",required:!0})},async run(t){let{file_id:e,comment_id:r,reply_id:n}=t.propsValue,o=await oe(t.auth),s=(0,QA.drive)({version:"v3",auth:o});try{return(await s.replies.get({fileId:e,commentId:r,replyId:n,fields:"*"})).data}catch(d){throw d.code===404?new Error(`File, comment, or reply not found (file ID: ${e}, comment ID: ${r}, reply ID: ${n}). Resolve the reply ID via drive_list_replies.`):d.code===403?new Error(`Permission denied fetching reply ${n} on file ${e}. You may lack access to this file.`):d}}});var tR=ue($e());var rR=te({auth:J,name:"drive_list_replies",classification:"SEARCH",displayName:"List Replies",description:"List the replies under a Drive comment.",audience:"ai",aiMetadata:{description:"Lists the replies under a given comment with each reply's id, author, content, and action. Use to read a comment thread or to resolve a replyId before fetching (drive_get_reply), editing (drive_update_reply), or deleting (drive_delete_reply) a reply. Read-only.",idempotent:!0},outputSchema:Ix,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:O.ShortText({displayName:"Comment ID",description:"The ID of the comment whose replies to list. Resolve it via drive_list_comments.",required:!0})},async run(t){let{file_id:e,comment_id:r}=t.propsValue,n=await oe(t.auth),o=(0,tR.drive)({version:"v3",auth:n});try{let d=(await o.replies.list({fileId:e,commentId:r,fields:"*"})).data.replies??[];return{replies:d,count:d.length}}catch(s){throw s.code===404?new Error(`File or comment not found (file ID: ${e}, comment ID: ${r}). Resolve the comment ID via drive_list_comments.`):s.code===403?new Error(`Permission denied listing replies for comment ${r} on file ${e}. You may lack access to this file.`):s}}});var nR=ue($e());var iR=te({auth:J,name:"drive_update_reply",classification:"WRITE",displayName:"Update Reply",description:"Edit the text of an existing reply on a Drive comment.",audience:"ai",aiMetadata:{description:"Edits the text of an existing reply by ID (resolve via drive_list_replies). Use to correct or revise a reply you control; to add a new reply instead use drive_create_reply. Safe to retry \u2014 re-applying the same content is a no-op.",idempotent:!0},outputSchema:Ax,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:O.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:O.ShortText({displayName:"Reply ID",description:"The ID of the reply to update. Resolve it via drive_list_replies.",required:!0}),content:O.LongText({displayName:"Content",description:"The new plain-text content for the reply.",required:!0})},async run(t){let{file_id:e,comment_id:r,reply_id:n,content:o}=t.propsValue,s=await oe(t.auth),d=(0,nR.drive)({version:"v3",auth:s});try{return(await d.replies.update({fileId:e,commentId:r,replyId:n,fields:"*",requestBody:{content:o}})).data}catch(m){throw m.code===404?new Error(`File, comment, or reply not found (file ID: ${e}, comment ID: ${r}, reply ID: ${n}). Resolve the reply ID via drive_list_replies.`):m.code===403?new Error(`Permission denied updating reply ${n} on file ${e}. You can only edit your own replies.`):m}}});var oR=ue($e());var aR=te({auth:J,name:"drive_delete_reply",classification:"DESTRUCTIVE",displayName:"Delete Reply",description:"Permanently delete a reply on a Drive comment by ID.",audience:"ai",aiMetadata:{description:"Permanently deletes a reply by ID (resolve via drive_list_replies). Use to remove a reply you control; to edit it instead use drive_update_reply. A repeat call fails because the reply is already gone, so it is not safe to retry blindly.",idempotent:!1},outputSchema:zx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:O.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:O.ShortText({displayName:"Reply ID",description:"The ID of the reply to delete. Resolve it via drive_list_replies.",required:!0})},async run(t){let{file_id:e,comment_id:r,reply_id:n}=t.propsValue,o=await oe(t.auth),s=(0,oR.drive)({version:"v3",auth:o});try{return await s.replies.delete({fileId:e,commentId:r,replyId:n}),{success:!0,reply_id:n}}catch(d){throw d.code===404?new Error(`File, comment, or reply not found (file ID: ${e}, comment ID: ${r}, reply ID: ${n}). It may already be deleted. Resolve the reply ID via drive_list_replies.`):d.code===403?new Error(`Permission denied deleting reply ${n} on file ${e}. You can only delete your own replies.`):d}}});var sR=ue($e());var uR=te({auth:J,name:"drive_get_about",classification:"READ",displayName:"Get Account & Storage Info",description:"Get the authenticated Drive account, storage quota, and supported formats.",audience:"ai",aiMetadata:{description:"Returns the authenticated user's Drive info: account identity, storage quota and usage, and supported import/export formats. Use to check available space before a large upload, confirm which account is connected, or look up valid export MIME types. Read-only.",idempotent:!0},outputSchema:wx,props:{},async run(t){let e=await oe(t.auth),r=(0,sR.drive)({version:"v3",auth:e});try{return(await r.about.get({fields:"user,storageQuota,maxImportSizes,exportFormats"})).data}catch(n){throw n.code===403?new Error("Permission denied fetching Drive account info. The connection may lack the required Drive scope."):n}}});var jj=rv({minimumSupportedRelease:"0.86.4",logoUrl:"https://cdn.activepieces.com/pieces/google-drive.png",categories:["CONTENT_AND_FILES"],displayName:"Google Drive",description:"Cloud storage and file backup",authors:["BastienMe","ArmanGiau3","Vitalini","pfernandez98","kanarelo","Salem-Alaa","kishanprmr","MoShizzle","AbdulTheActivePiecer","khaledmashaly","abuaboud","geekyme"],triggers:[gI,vI,TI],actions:[Bx,Gx,pI,iI,Yx,nI,cI,Kx,sI,jx,Wx,II,RI,$I,CI,LI,qI,VI,WI,JI,XI,QI,rA,iA,aA,uA,lA,pA,mA,yA,_A,PA,TA,EA,IA,RA,$A,CA,kA,UA,FA,qA,VA,HA,ZA,JA,XA,eR,rR,iR,aR,uR,gw({baseUrl:i(()=>"https://www.googleapis.com/drive/v3","baseUrl"),auth:J,authMapping:i(async t=>({Authorization:`Bearer ${await it(t)}`}),"authMapping")})],auth:J});0&&(module.exports={createGoogleClient,getAccessToken,googleDrive,googleDriveAuth});
|
|
77
|
+
`)}`)}return o}i(qj,"collectZipEntries");function Bj(t){let e=[],r=[],n=0;for(let o of t){let s=n+o.sizeBytes>Cj,d=r.length>=Oj;r.length>0&&(s||d)&&(e.push(r),r=[],n=0),r.push(o),n+=o.sizeBytes}return r.length>0&&e.push(r),e}i(Bj,"batchByBytes");async function Vj({auth:t,entry:e,zipWriter:r,fileAddOptions:n}){if(!e.downloadUrl)throw new Error(`No download URL for entry "${e.relativePath}"`);let o=await it(t),s=await fetch(e.downloadUrl,{headers:{Authorization:`Bearer ${o}`}});if(!s.ok||!s.body){let d=await s.text().catch(()=>"");throw s.status===403&&d.includes("exportSizeLimitExceeded")?new Error(`Export failed for "${e.relativePath}": exceeds Drive's ~10MB export size limit.`):new Error(`Failed to download "${e.relativePath}" (HTTP ${s.status}): ${d}`)}await r.add(e.relativePath,s.body,n)}i(Vj,"downloadAndAddZipEntry");var qI=te({auth:J,name:"drive_export_folder_as_zip",classification:"READ",displayName:"Export Folder as Zip",description:"Recursively export a Google Drive folder (with all subfolders) as a single zip file.",audience:"human",aiMetadata:{description:"Recursively downloads every file in a Drive folder (including subfolders) and packages them into a single zip whose internal paths mirror the folder hierarchy. Native Google Docs/Sheets/Slides are converted per user-chosen format (PDF/Office format) or skipped. Fails the whole action if any single file cannot be downloaded/exported. Optionally password-protects the zip.",idempotent:!0},props:{duplicatePathWarning:O.MarkDown({value:`Zip paths mirror the Drive folder exactly, with no renaming. The action fails before downloading anything if: a file and a folder share a name in the same Drive folder, two items share a name, or a Google Doc/Sheet/Slides export lands on a name that already exists (e.g. a Sheet named "Report" exported as PDF alongside an existing "Report.pdf"); or an included item's name contains "/" or "\\", or is exactly "." or ".." (not usable as a zip path segment). Rename the conflicting or unsafe item in Drive and re-run.`,variant:"WARNING"}),folderId:O.Dropdown({displayName:"Folder",description:"The Drive folder to export (including all subfolders).",required:!0,auth:J,refreshers:["includeTeamDrives"],refreshOnSearch:!0,options:i(async({auth:t,includeTeamDrives:e},r)=>Ne.fetchFolderDropdownOptions({auth:t,searchValue:r?.searchValue,includeTeamDrives:e}),"options")}),includeTeamDrives:O.Checkbox({displayName:"Include Team Drives",required:!1,defaultValue:!1}),googleDocsFormat:O.StaticDropdown({displayName:"Google Docs",description:"How to include native Google Docs found in the folder.",required:!0,defaultValue:"docx",options:{options:[{label:"Word (DOCX)",value:"docx"},{label:"PDF",value:"pdf"},{label:"Skip",value:"skip"}]}}),googleSheetsFormat:O.StaticDropdown({displayName:"Google Sheets",description:"How to include native Google Sheets found in the folder.",required:!0,defaultValue:"xlsx",options:{options:[{label:"Excel (XLSX)",value:"xlsx"},{label:"PDF",value:"pdf"},{label:"Skip",value:"skip"}]}}),googleSlidesFormat:O.StaticDropdown({displayName:"Google Slides",description:"How to include native Google Slides found in the folder.",required:!0,defaultValue:"pptx",options:{options:[{label:"PowerPoint (PPTX)",value:"pptx"},{label:"PDF",value:"pdf"},{label:"Skip",value:"skip"}]}}),outputFileName:O.ShortText({displayName:"Output Zip File Name",required:!0,defaultValue:"export.zip"}),usePassword:O.Checkbox({displayName:"Use password",description:"Enable password protection for the zip file",required:!1,defaultValue:!1}),passwordOptions:O.DynamicProperties({displayName:"Password options",required:!1,auth:Hi.None(),refreshers:["usePassword"],props:i(async({usePassword:t})=>t?{password:O.ShortText({displayName:"Password",required:!0}),encryptionMethod:O.StaticDropdown({displayName:"Encryption Method",description:Uj,required:!0,defaultValue:"zipcrypto",options:{disabled:!1,options:[{label:"ZipCrypto (Most Compatible)",value:"zipcrypto"},{label:"AES-256 (Stronger Security)",value:"aes-256"}]}})}:{},"props")})},async run(t){let e={docs:t.propsValue.googleDocsFormat,sheets:t.propsValue.googleSheetsFormat,slides:t.propsValue.googleSlidesFormat},r=await qj({auth:t.auth,rootFolderId:t.propsValue.folderId,nativeFormats:e,includeTeamDrives:t.propsValue.includeTeamDrives??!1}),n={};if(t.propsValue.usePassword){let _=t.propsValue.passwordOptions?.password,x=t.propsValue.passwordOptions?.encryptionMethod;if(!_)throw new Error('Cannot export: "Use password" is enabled but no password was provided. Enter a password or turn the option off.');n.password=_,x==="aes-256"?n.encryptionStrength=3:n.zipCrypto=!0}let o=new TransformStream,s=new UI.ZipWriter(o.writable),d=zI.Readable.fromWeb(o.readable),m=t.files.write({data:d,fileName:t.propsValue.outputFileName});m.catch(()=>{});let h=[],v=[];for(let _ of r)(_.isEmptyFolder?v:h).push(_);try{for(let _ of Bj(h))await Promise.all(_.map(x=>Vj({auth:t.auth,entry:x,zipWriter:s,fileAddOptions:n})));for(let _ of v)await s.add(`${_.relativePath}/`,void 0,{directory:!0});await s.close()}catch(_){throw d.destroy(_ instanceof Error?_:new Error(String(_))),_}return m}});var BI=ue($e());var VI=te({auth:J,name:"drive_create_folder",classification:"WRITE",displayName:"Create Folder",description:"Create a new empty folder in your Google Drive",audience:"ai",aiMetadata:{description:"Creates a new empty folder in Google Drive, optionally nested under a parent folder (resolve the parent ID via `drive_search_files`). Use to set up a destination before uploading or moving files. Each call creates a distinct folder even with the same name, so retries duplicate.",idempotent:!1},outputSchema:Ox,props:{folder_name:O.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parent_folder_id:O.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to create the new folder inside. Leave empty to create it in the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let e=await oe(t.auth);return(await(0,BI.drive)({version:"v3",auth:e}).files.create({requestBody:{mimeType:"application/vnd.google-apps.folder",name:t.propsValue.folder_name,...t.propsValue.parent_folder_id?{parents:[t.propsValue.parent_folder_id]}:{}},supportsAllDrives:!0})).data}});var GI=ue(la());var HI=te({auth:J,name:"drive_create_file_from_text",classification:"WRITE",displayName:"Create File from Text",description:"Create a new text file in your Google Drive from text",audience:"ai",aiMetadata:{description:"Creates a new Drive file from inline text content as plain text, CSV, or XML. Use when an agent has generated text it needs to persist as a Drive file; for binary or existing files use `drive_upload_file` instead. Each call creates a new file.",idempotent:!1},outputSchema:lx,props:{file_name:O.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:O.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),content_type:O.StaticDropdown({displayName:"Content type",description:"Select file type",required:!0,defaultValue:"plain/text",options:{options:[{label:"Text",value:"plain/text"},{label:"CSV",value:"text/csv"},{label:"XML",value:"text/xml"}]}}),parent_folder_id:O.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to create the file inside. Leave empty to create it in the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let e={mimeType:t.propsValue.content_type,name:t.propsValue.file_name,...t.propsValue.parent_folder_id?{parents:[t.propsValue.parent_folder_id]}:{}},r=Buffer.from(JSON.stringify(e),"utf-8"),n=Buffer.from(t.propsValue.text,"utf-8"),o=new GI.default;return o.append("Metadata",r,{contentType:"application/json"}),o.append("Media",n,{contentType:t.propsValue.content_type}),(await ht.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart",body:o,headers:{...o.getHeaders()},queryParams:{supportsAllDrives:"true"},authentication:{type:"BEARER_TOKEN",token:await it(t.auth)}})).body}});var WI=ue(la());var ZI=ue(mn());var KI=te({auth:J,name:"drive_upload_file",classification:"WRITE",displayName:"Upload File",description:"Upload a file in your Google Drive",audience:"ai",aiMetadata:{description:"Uploads a binary file (from a URL or base64 input) into Drive; MIME type is inferred from the extension. Use to store an existing file or attachment; for plain generated text use `drive_create_file_from_text`, and to fetch a remote URL server-side use `drive_upload_from_url`. Each call creates a new file.",idempotent:!1},outputSchema:dx,props:{file_name:O.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:O.File({displayName:"File",description:"The file URL or base64 to upload",required:!0}),parent_folder_id:O.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to upload the file into. Leave empty to upload to the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let e=t.propsValue.file,n={mimeType:ZI.default.lookup(e.extension?e.extension:""),name:t.propsValue.file_name,...t.propsValue.parent_folder_id?{parents:[t.propsValue.parent_folder_id]}:{}},o=Buffer.from(JSON.stringify(n),"utf-8"),s=Buffer.from(e.base64,"base64"),d=new WI.default;return d.append("Metadata",o,{contentType:"application/json"}),d.append("Media",s),(await ht.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files",queryParams:{uploadType:"multipart",supportsAllDrives:"true"},body:d,headers:{...d.getHeaders()},authentication:{type:"BEARER_TOKEN",token:await it(t.auth)}})).body}});var JI=ue(la());var YI=ue(mn());var XI=te({auth:J,name:"drive_upload_from_url",classification:"WRITE",displayName:"Upload File from URL",description:"Fetch a file from a public URL and upload it into Google Drive.",audience:"ai",aiMetadata:{description:"Fetches a file from a public URL and uploads it into Drive in one step (server-side fetch, no base64 round-trip). Use when the agent has a downloadable link rather than file bytes; for bytes already in hand use `drive_upload_file`, and for plain generated text use `drive_create_file_from_text`. Each call creates a new file.",idempotent:!1},outputSchema:kx,props:{source_url:O.ShortText({displayName:"Source URL",description:"The publicly accessible URL to fetch the file from. Only public URLs are supported (no authentication headers are sent).",required:!0}),file_name:O.ShortText({displayName:"File name",description:"The name to give the uploaded file in Drive.",required:!0}),mime_type:O.ShortText({displayName:"MIME Type",description:"Optional MIME type for the uploaded file (e.g. application/pdf). Provide this when the URL has no file extension; otherwise the type is inferred from the URL.",required:!1}),parent_folder_id:O.ShortText({displayName:"Parent Folder ID",description:"The ID of the folder to upload the file into. Leave empty to upload to the root of My Drive. Resolve a folder ID with `drive_search_files`.",required:!1})},async run(t){let{source_url:e,file_name:r,mime_type:n,parent_folder_id:o}=t.propsValue,s;try{s=await ht.sendRequest({method:"GET",url:e,responseType:"arraybuffer"})}catch(T){throw new Error(`Failed to fetch the file from the source URL (${e}). Ensure it is a publicly accessible link. Underlying error: ${T?.message??T}`)}let d=n||YI.default.lookup(e)||"application/octet-stream",m={mimeType:d,name:r,...o?{parents:[o]}:{}},h=Buffer.from(JSON.stringify(m),"utf-8"),v=Buffer.from(s.body),_=new JI.default;return _.append("Metadata",h,{contentType:"application/json"}),_.append("Media",v,{contentType:d}),(await ht.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files",queryParams:{uploadType:"multipart",supportsAllDrives:"true"},body:_,headers:{..._.getHeaders()},authentication:{type:"BEARER_TOKEN",token:await it(t.auth)}})).body}});var QI=ue(mn());var eA=te({auth:J,name:"drive_replace_file_content",classification:"WRITE",displayName:"Replace File Content",description:"Replace an existing Drive file's bytes, keeping its ID and name.",audience:"ai",aiMetadata:{description:"Replaces the contents of an existing Drive file with new bytes, keeping the same file ID, name, and location. Use to update a file in place (e.g. overwrite a report); to create a brand-new file use `drive_upload_file`, and to rename without changing content use `drive_update_file_metadata`. Each call overwrites the previous content.",idempotent:!1},outputSchema:Px,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the existing file whose content to replace. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),file:O.File({displayName:"New File Content",description:"The file URL or base64 whose bytes will replace the existing content.",required:!0}),mime_type:O.ShortText({displayName:"MIME Type",description:"Optional MIME type for the new content (e.g. application/pdf). Provide this when the source has no file extension; otherwise the type is inferred from the extension.",required:!1})},async run(t){let{file_id:e,file:r,mime_type:n}=t.propsValue,o=n||QI.default.lookup(r.extension?r.extension:"")||"application/octet-stream",s=Buffer.from(r.base64,"base64");return(await ht.sendRequest({method:"PATCH",url:`https://www.googleapis.com/upload/drive/v3/files/${e}`,queryParams:{uploadType:"media",supportsAllDrives:"true"},body:s,headers:{"Content-Type":o},authentication:{type:"BEARER_TOKEN",token:await it(t.auth)}})).body}});var tA=te({auth:J,name:"drive_download_file",classification:"READ",displayName:"Download File Content",description:"Read a selected file from google drive file",audience:"ai",aiMetadata:{description:"Downloads a Drive file's bytes by ID and returns a file reference; native Google files (Docs/Sheets/Slides) are auto-exported to their default Office format. Use to retrieve content of a file you have the ID for (obtain it from `drive_search_files` or `drive_get_file`). Read-only.",idempotent:!0},outputSchema:zx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to download. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),destination_file_name:O.ShortText({displayName:"Destination File name",required:!1})},run:i(async({auth:t,propsValue:e,files:r})=>Nt(t,r,e.file_id,e.destination_file_name),"run")});var rA=ue($e()),nA=ue(mn());var iA=te({auth:J,name:"drive_export_workspace_file",classification:"READ",displayName:"Export Google Doc/Sheet/Slides",description:"Export a native Google Workspace file (Doc/Sheet/Slides) to a chosen format.",audience:"ai",aiMetadata:{description:"Exports a native Google Workspace file (Doc/Sheet/Slides) to a caller-chosen format and returns the bytes. Use when you need a specific format such as PDF, HTML, CSV, or Markdown; for the default rendition or for ordinary binary files use `drive_download_file`. The chosen format must match the source type (Doc formats for a Doc, Sheet formats for a Sheet, etc.). Read-only. Export size is capped at ~10 MB by Drive.",idempotent:!0},outputSchema:Ux,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the native Google Workspace file to export. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),mime_type:O.StaticDropdown({displayName:"Export Format",description:"The target format. It must match the source type: Doc formats for a Google Doc, Sheet formats for a Google Sheet, Slides formats for Google Slides. An incompatible pairing returns an error.",required:!0,options:{options:[{label:"Word (DOCX) \u2014 Docs",value:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{label:"PDF \u2014 Docs/Sheets/Slides",value:"application/pdf"},{label:"HTML \u2014 Docs",value:"text/html"},{label:"Plain Text (TXT) \u2014 Docs",value:"text/plain"},{label:"Rich Text (RTF) \u2014 Docs",value:"application/rtf"},{label:"OpenDocument Text (ODT) \u2014 Docs",value:"application/vnd.oasis.opendocument.text"},{label:"EPUB \u2014 Docs",value:"application/epub+zip"},{label:"Markdown (MD) \u2014 Docs",value:"text/markdown"},{label:"Excel (XLSX) \u2014 Sheets",value:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{label:"CSV \u2014 Sheets",value:"text/csv"},{label:"TSV \u2014 Sheets",value:"text/tab-separated-values"},{label:"OpenDocument Spreadsheet (ODS) \u2014 Sheets",value:"application/vnd.oasis.opendocument.spreadsheet"},{label:"PowerPoint (PPTX) \u2014 Slides",value:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{label:"OpenDocument Presentation (ODP) \u2014 Slides",value:"application/vnd.oasis.opendocument.presentation"},{label:"PNG \u2014 Slides",value:"image/png"},{label:"SVG \u2014 Slides",value:"image/svg+xml"}]}})},async run(t){let{file_id:e,mime_type:r}=t.propsValue,n=await oe(t.auth),o=(0,rA.drive)({version:"v3",auth:n});try{let s=await o.files.export({fileId:e,mimeType:r},{responseType:"arraybuffer"}),d=(0,nA.extension)(r),m=d?"."+d:"";return t.files.write({fileName:e+m,data:Buffer.from(s.data)})}catch(s){throw(s?.errors?.[0]?.reason??s?.response?.data?.error?.errors?.[0]?.reason)==="exportSizeLimitExceeded"?new Error(`Export failed: the file exceeds Drive's ~10 MB export size limit (file ID: ${e}). Use drive_download_file to fetch the source directly instead.`):s.code===403?new Error(`Permission denied exporting file ${e}. You may lack access to this file.`):s.code===400?new Error(`Invalid export for file ${e}: the chosen format does not match the source type, or this is not a native Google Workspace file. Use drive_download_file for ordinary binary files.`):s.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):s}}});var oA=ue($e());var aA=te({auth:J,name:"drive_get_file",classification:"READ",displayName:"Get File or Folder",description:"Get a file folder for files/sub-folders",audience:"ai",aiMetadata:{description:"Fetches metadata for a single file or folder by its exact ID (name, MIME type, parents, owners, links). Use when you already have an ID (e.g. from a trigger or `drive_search_files`) and need its details, including its parent folder IDs. Read-only and safe to retry.",idempotent:!0},outputSchema:sx,props:{file_id:O.ShortText({displayName:"File / Folder ID",description:"The ID of the file/folder to fetch. Resolve it via `drive_search_files` or `drive_list_files`.",required:!0})},async run(t){let e=await oe(t.auth),n=await(0,oA.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.file_id,supportsAllDrives:!0});return n.data?n.data:null}});var Fm=ue(require("querystring"));async function sA(t,e,r,n,o,s=0){let d=[];if(s>r)return d;let m=await it(t),h=`'${e}' in parents`;n||(h+=" and trashed=false");let v={q:h,fields:"nextPageToken,files(id,kind,mimeType,name,trashed,parents)",supportsAllDrives:"true",includeItemsFromAllDrives:o?"true":"false",corpora:o?"allDrives":"user",pageSize:"1000"},_=await ht.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Fm.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of _.body.files)d.push({file:x,level:s,parentFolder:e});for(;_.body.nextPageToken;){v.pageToken=_.body.nextPageToken,_=await ht.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Fm.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of _.body.files)d.push({file:x,level:s,parentFolder:e})}if(s+1<r){let x=d.filter(T=>T.file.mimeType==="application/vnd.google-apps.folder");for(let T of x){let P=await sA(t,T.file.id,r,n,o,s+1);d.push(...P)}}return d}i(sA,"getFilesRecursively");var uA=te({auth:J,name:"drive_list_files",classification:"SEARCH",displayName:"List Folder Contents",description:"List files from a Google Drive folder",audience:"ai",aiMetadata:{description:"Lists files and subfolders inside a given folder ID, optionally recursing to a chosen depth and downloading each file's content. Use to enumerate the contents of a known folder; to find a file by name across Drive use `drive_search_files`. Read-only. Requires the folder ID, not a name.",idempotent:!0},outputSchema:ux,props:{folder_id:O.ShortText({displayName:"Folder ID",description:"The ID of the folder to list. Resolve it via `drive_search_files` (or any other source).",required:!0}),include_trashed:O.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depth_level:O.Number({displayName:"Depth Level",description:"How many levels deep to search for files. 1 = current folder only, 2 = current + next level, etc.",required:!1,defaultValue:1}),download_files:O.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1}),include_team_drives:O.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},async run(t){let e={type:"drive#fileList",incompleteSearch:!1,files:[]},r=t.propsValue.depth_level||1,n=await sA(t.auth,t.propsValue.folder_id,r,t.propsValue.include_trashed??!1,t.propsValue.include_team_drives??!1);if(e.files=n.map(o=>o.file),t.propsValue.download_files){let o=[],s={"application/pdf":".pdf","image/jpeg":".jpg","image/png":".png","image/tiff":".tiff","text/plain":".txt","text/csv":".csv","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":".xlsx"};for(let d of n){let m=d.file;if(m.mimeType==="application/vnd.google-apps.folder")continue;let h=m.name,v=s[m.mimeType];v&&!h.toLowerCase().endsWith(v)&&(m.mimeType==="image/jpeg"&&h.toLowerCase().endsWith(".jpeg")||(h=h+v));try{let _=await Nt(t.auth,t.files,m.id,h);o.push(_)}catch(_){console.warn(`Failed to download file ${m.name}: ${_ instanceof Error?_.message:"Download failed"}`)}}e.downloadedFiles=o}return e}});var cA=ue($e());var lA=te({auth:J,name:"drive_search_files",classification:"SEARCH",displayName:"Search Files and Folders",description:"Search a Google Drive folder for files/sub-folders",audience:"ai",aiMetadata:{description:"Searches Drive for files or folders matching a name, full-text, or MIME-type query, optionally scoped to a parent folder. Use this to resolve a human-readable name into a file/folder ID before acting on it; to list a known folder's children use `drive_list_files` instead. Read-only.",idempotent:!0},outputSchema:cx,props:{query_term:O.StaticDropdown({displayName:"Query Term",description:"The Query term or field of file/folder to search upon.",defaultValue:"name",options:{options:[{label:"File name",value:"name"},{label:"Full text search",value:"fullText"},{label:"Content type",value:"mimeType"}]},required:!0}),operator:O.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),value:O.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:O.StaticDropdown({displayName:"File Type",description:"(Optional) Choose between files and folders.",required:!1,options:{options:[{label:"All",value:"all"},{label:"Files",value:"file"},{label:"Folders",value:"folder"}]},defaultValue:"all"}),parent_folder_id:O.ShortText({displayName:"Parent Folder ID",description:"(Optional) Restrict the search to files/folders inside this folder ID.",required:!1}),include_team_drives:O.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},async run(t){let e=await oe(t.auth),r=(0,cA.drive)({version:"v3",auth:e}),n=t.propsValue.operator??"contains",s=`${t.propsValue.query_term??"name"} ${n} '${t.propsValue.value}'`;switch(t.propsValue.parent_folder_id&&(s=`${s} and '${t.propsValue.parent_folder_id}' in parents`),t.propsValue.type??"all"){case"file":s=`${s} and mimeType!='application/vnd.google-apps.folder'`;break;case"folder":s=`${s} and mimeType='application/vnd.google-apps.folder'`;break;default:break}let m=[],h;do{let v={q:s,fields:"nextPageToken, files(id, name, mimeType, createdTime, modifiedTime)",includeItemsFromAllDrives:t.propsValue.include_team_drives,supportsAllDrives:!0,corpora:t.propsValue.include_team_drives?"allDrives":"user",pageSize:1e3};h&&(v.pageToken=h);let _=await r.files.list(v);if(_.status!==200)throw console.error(_),new Error("Error searching for the file/folder");m.push(..._.data.files??[]),h=_.data.nextPageToken??void 0}while(h);return m.length>0?m:[]}});var dA=ue($e());var pA=te({auth:J,name:"drive_copy_file",classification:"WRITE",displayName:"Copy File",description:"Duplicate a file from Google Drive. Returns the new file ID.",audience:"ai",aiMetadata:{description:"Copies an existing Drive file into a target folder under a new name, optionally converting it to a Google Sheet or Doc. Use to clone a file or make an editable Google-format copy; to relocate the original instead of copying use `drive_move_file`. Requires source file ID and destination folder ID. Each call creates a new copy.",idempotent:!1},outputSchema:px,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to duplicate. Resolve it via `drive_search_files`.",required:!0}),name:O.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folder_id:O.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be duplicated. Resolve it via `drive_search_files`.",required:!0}),convert_to:O.StaticDropdown({displayName:"Duplicate as",description:"If left unselected the file will be duplicated as it is",required:!1,options:{options:[{label:"Google Sheets",value:"application/vnd.google-apps.spreadsheet"},{label:"Google Docs",value:"application/vnd.google-apps.document"}]}})},async run(t){let e=await oe(t.auth),r=t.propsValue.file_id,n=t.propsValue.name,o=t.propsValue.folder_id,s=t.propsValue.convert_to,d=(0,dA.drive)({version:"v3",auth:e}),m={name:n,parents:[o]};s&&(m.mimeType=s);let h=await d.files.copy({fileId:r,auth:e,requestBody:m,supportsAllDrives:!0});if(h.status!==200)throw new Error("Error duplicating file");return h.data}});var fA=ue($e());var mA=te({auth:J,name:"drive_move_file",classification:"WRITE",displayName:"Move File",description:"Move a Drive file from its current folder(s) to a target folder.",audience:"ai",aiMetadata:{description:"Relocates a file to a target folder, detaching it from its current parents and attaching the new one. Use to reorganize a file by ID; to copy instead of move use drive_copy_file, and to rename without moving use drive_update_file_metadata. Safe to retry \u2014 repeating leaves the file in the same destination.",idempotent:!0},outputSchema:fx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to move. Resolve it via drive_search_files or drive_get_file.",required:!0}),folder_id:O.ShortText({displayName:"Destination Folder ID",description:"The ID of the folder to move the file into. Resolve it via drive_search_files; leave empty for the root of My Drive.",required:!0})},async run(t){let e=t.propsValue.file_id,r=t.propsValue.folder_id,n=await oe(t.auth),o=(0,fA.drive)({version:"v3",auth:n}),s=await o.files.get({fileId:e,supportsAllDrives:!0,fields:"id,parents"});return(await o.files.update({fileId:e,fields:"*",removeParents:s.data.parents?.join(","),addParents:r,supportsAllDrives:!0})).data}});var hA=ue($e());var gA=te({auth:J,name:"drive_update_file_metadata",classification:"WRITE",displayName:"Update File Metadata (Rename)",description:"Rename a Drive file/folder or update its description or starred flag (metadata only).",audience:"ai",aiMetadata:{description:"Renames a file/folder or updates its description or starred flag via a metadata-only PATCH. Use to rename or annotate a resource; this never changes the file's location \u2014 to re-parent use `drive_move_file`, and to replace the file's bytes use `drive_replace_file_content`. Safe to retry \u2014 re-applying the same values is a no-op.",idempotent:!0},outputSchema:mx,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update. Resolve it via `drive_search_files` or `drive_get_file`.",required:!0}),name:O.ShortText({displayName:"New Name",description:"A new name for the file or folder. Leave empty to keep the current name.",required:!1}),description:O.ShortText({displayName:"Description",description:"A new description for the file or folder. Leave empty to keep the current description.",required:!1}),starred:O.Checkbox({displayName:"Starred",description:"Whether to mark the file or folder as starred.",required:!1})},async run(t){let{file_id:e,name:r,description:n,starred:o}=t.propsValue,s={};r!=null&&r!==""&&(s.name=r),n!=null&&(s.description=n),o!=null&&(s.starred=o);let d=await oe(t.auth),m=(0,hA.drive)({version:"v3",auth:d});try{return(await m.files.update({fileId:e,supportsAllDrives:!0,requestBody:s})).data}catch(h){throw h.code===404?new Error(`File or folder not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):h.code===403?new Error(`Permission denied updating file ${e}. You may lack edit permission on this resource.`):h}}});var yA=ue($e()),vA=require("stream");var _A=te({auth:J,name:"drive_save_file_as_pdf",classification:"WRITE",displayName:"Save File as PDF",description:"Save a document as PDF in a Google Drive folder",audience:"ai",aiMetadata:{description:"Exports a native Google document to PDF and saves it as a new file in a target Drive folder. Use to produce a PDF rendition of a Google Doc/Sheet/Slides for sharing or archival (resolve the source and folder IDs via `drive_search_files`). Each call creates a new PDF file.",idempotent:!1},outputSchema:$x,props:{document_id:O.ShortText({displayName:"Document ID",description:"The ID of the document to export. Resolve it via `drive_search_files`.",required:!0}),folder_id:O.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be exported. Resolve it via `drive_search_files`.",required:!0}),name:O.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0})},async run(t){let e=await oe(t.auth),r=t.propsValue.document_id,n=t.propsValue.folder_id,o=t.propsValue.name,s=(0,yA.drive)({version:"v3",auth:e}),d=await s.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:o+".pdf",parents:[n]},h=Buffer.from(d.data,"base64"),_={mimeType:"application/pdf",body:new vA.Stream.PassThrough().end(h)};return(await s.files.create({requestBody:m,media:_,supportsAllDrives:!0})).data}});var wA=ue($e());var PA=te({auth:J,name:"drive_trash_file",classification:"DESTRUCTIVE",displayName:"Trash File",description:"Move a Drive file to the trash by ID (reversible deletion).",audience:"ai",aiMetadata:{description:"Moves a file to the trash by ID \u2014 a reversible deletion restorable from Drive. Use for safe removal; for irreversible removal use drive_delete_file, and to restore use drive_untrash_file. Safe to retry \u2014 re-trashing leaves it trashed.",idempotent:!0},outputSchema:_x,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to trash. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let e=await oe(t.auth),r=(0,wA.drive)({version:"v3",auth:e}),n={trashed:!0};return(await r.files.update({fileId:t.propsValue.file_id,supportsAllDrives:!0,requestBody:n})).data}});var bA=ue($e());var TA=te({auth:J,name:"drive_untrash_file",classification:"WRITE",displayName:"Restore File from Trash",description:"Restore a trashed Drive file by ID back to its original location.",audience:"ai",aiMetadata:{description:"Restores a trashed file by ID back to its original location. Use to undo a `drive_trash_file`; to permanently purge instead use `drive_empty_trash` or `drive_delete_file`. Safe to retry \u2014 re-restoring an active file is a no-op.",idempotent:!0},outputSchema:wx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the trashed file to restore. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let{file_id:e}=t.propsValue,r=await oe(t.auth),n=(0,bA.drive)({version:"v3",auth:r});try{return(await n.files.update({fileId:e,supportsAllDrives:!0,requestBody:{trashed:!1}})).data}catch(o){throw o.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):o.code===403?new Error(`Permission denied restoring file ${e}. You may lack permission to restore this resource.`):o}}});var SA=ue($e()),EA=te({auth:J,name:"drive_delete_file",classification:"DESTRUCTIVE",displayName:"Delete File Permanently",description:"Permanently delete a Drive file by ID, bypassing the trash.",audience:"ai",aiMetadata:{description:"Permanently deletes a file by ID, bypassing the trash \u2014 unrecoverable. Use only when permanent removal is intended; for reversible deletion prefer drive_trash_file. A repeat call fails because the file no longer exists.",idempotent:!1},props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to permanently delete. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let e=await oe(t.auth);return(await(0,SA.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.file_id,supportsAllDrives:!0})).data}});var xA=ue($e());var IA=te({auth:J,name:"drive_empty_trash",classification:"DESTRUCTIVE",displayName:"Empty Trash",description:"Permanently delete ALL files in the trash (irreversible, account-wide).",audience:"ai",aiMetadata:{description:"DESTRUCTIVE: permanently deletes EVERY file currently in the trash \u2014 this is an irreversible, account-wide purge (not a single file), or scoped to one shared drive if `drive_id` is given. The entire trash is emptied, so any file the user trashed is gone for good. Use only as a deliberate cleanup step; to remove a single file reversibly use `drive_trash_file`, and to permanently remove one specific file use `drive_delete_file`. Not safe to retry casually \u2014 it purges whatever is in the trash at call time.",idempotent:!1},outputSchema:Lx,props:{drive_id:O.ShortText({displayName:"Shared Drive ID",description:"Optional. Restrict the purge to a single shared drive's trash (resolve via drive_list_shared_drives). Leave empty to empty the entire My Drive trash for the connected account.",required:!1})},async run(t){let{drive_id:e}=t.propsValue,r=await oe(t.auth),n=(0,xA.drive)({version:"v3",auth:r});try{return await n.files.emptyTrash({...e?{driveId:e}:{}}),{success:!0,driveId:e??null}}catch(o){throw o.code===403?new Error("Permission denied emptying the trash. You may lack permission to empty this trash."):o}}});var AA=ue($e());var RA=te({auth:J,name:"drive_share_file",classification:"WRITE",displayName:"Share File with User",description:"Grant a role on a Drive file or folder to a user by email.",audience:"ai",aiMetadata:{description:"Grants a role to a user (by email) on a file or folder, optionally emailing them. Use to share with a specific person; to share with anyone-with-the-link use drive_set_public_access, and to change an existing collaborator's role use drive_update_permission. Each call creates a new permission grant.",idempotent:!1},outputSchema:hx,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to share. Resolve it via drive_search_files or drive_get_file.",required:!0}),user_email:O.ShortText({displayName:"User Email",description:"The email address of the user to grant access to.",required:!0}),role:O.StaticDropdown({displayName:"Role",description:"The role to grant to the user. See https://developers.google.com/drive/api/guides/ref-roles",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}}),send_invitation_email:O.Checkbox({displayName:"Send Invitation Email",description:"Send an email to the user to notify them of the new permission.",required:!0})},async run(t){let{file_id:e,user_email:r,role:n,send_invitation_email:o}=t.propsValue,s=await oe(t.auth),d=(0,AA.drive)({version:"v3",auth:s}),m={type:"user",role:n,emailAddress:r};return(await d.permissions.create({requestBody:m,fileId:e,sendNotificationEmail:o,supportsAllDrives:!0})).data}});var DA=ue($e());var $A=te({auth:J,name:"drive_set_public_access",classification:"WRITE",displayName:"Set Public Access",description:"Make a Drive file or folder accessible to anyone with the link.",audience:"ai",aiMetadata:{description:"Makes a file or folder accessible to anyone with the link at the chosen role and returns its shareable view/download URL. Use to publish a resource publicly; to share with a named person instead use drive_share_file. Each call adds a new anyone-with-link permission.",idempotent:!1},outputSchema:yx,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to make public. Resolve it via drive_search_files or drive_get_file.",required:!0}),role:O.StaticDropdown({displayName:"Role",description:"The role to assign for public access.",options:{options:[{label:"Reader",value:"reader"},{label:"Commenter",value:"commenter"},{label:"Editor",value:"writer"}]},defaultValue:"reader",required:!0})},async run(t){let e=await oe(t.auth),r=t.propsValue.file_id,n=t.propsValue.role,o=(0,DA.drive)({version:"v3",auth:e}),s={role:n,type:"anyone"},d=await o.permissions.create({fileId:r,requestBody:s,supportsAllDrives:!0}),m=await o.files.get({fileId:r,fields:"name,mimeType,webContentLink,webViewLink",supportsAllDrives:!0});if(m.data.mimeType==="application/vnd.google-apps.folder")return{...d.data,webViewLink:m.data.webViewLink,downloadUrl:null};let h=await Nt(t.auth,t.files,r,m.data.name);return{...d.data,downloadUrl:h}}});var OA=ue($e());var CA=te({auth:J,name:"drive_list_permissions",classification:"SEARCH",displayName:"List Permissions",description:"List every permission on a Drive file or folder.",audience:"ai",aiMetadata:{description:"Lists every permission (who has access and at what role) on a file or folder, with each permission's id, type, role, and email/domain. Use to audit sharing before granting or revoking; it is the resolver for the permissionId other sharing atomics need. Read-only.",idempotent:!0},outputSchema:gx,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder whose permissions to list. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let{file_id:e}=t.propsValue,r=await oe(t.auth),n=(0,OA.drive)({version:"v3",auth:r});try{let s=(await n.permissions.list({fileId:e,fields:"permissions(id,type,role,emailAddress,domain)",supportsAllDrives:!0})).data.permissions??[];return{permissions:s,count:s.length}}catch(o){throw o.code===404?new Error(`File or folder not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):o.code===403?new Error(`Permission denied listing permissions for file ${e}. You may lack access to this resource.`):o}}});var NA=ue($e());var kA=te({auth:J,name:"drive_update_permission",classification:"WRITE",displayName:"Update Permission Role",description:"Change an existing collaborator's role on a Drive file or folder.",audience:"ai",aiMetadata:{description:"Changes an existing collaborator's role in place (e.g. reader to writer), resolving the permission by their email internally. Use to upgrade or downgrade access without unsharing; to grant net-new access use drive_share_file. If the user has no existing grant it is a no-op (it never silently creates one). Safe to retry.",idempotent:!0},outputSchema:vx,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder whose permission to update. Resolve it via drive_search_files or drive_get_file.",required:!0}),user_email:O.ShortText({displayName:"User Email",description:"The email address of the collaborator whose role to change. The existing permission is matched by this email; list current grants via drive_list_permissions.",required:!0}),new_role:O.StaticDropdown({displayName:"New Role",description:"The role to set for the user. See https://developers.google.com/drive/api/guides/ref-roles",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}})},async run(t){let{file_id:e,user_email:r,new_role:n}=t.propsValue,o=await oe(t.auth),s=(0,NA.drive)({version:"v3",auth:o});try{let h=((await s.permissions.list({fileId:e,fields:"permissions(id,emailAddress,role)",supportsAllDrives:!0})).data.permissions??[]).find(_=>_.emailAddress===r);return!h||!h.id?{updated:!1,message:`No existing permission found for ${r}. Use drive_share_file to grant new access.`}:{updated:!0,permission:(await s.permissions.update({fileId:e,permissionId:h.id,requestBody:{role:n},supportsAllDrives:!0})).data}}catch(d){throw d.code===404?new Error(`File or folder not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):d.code===403?new Error(`Permission denied updating the role on file ${e}. You may lack permission to manage sharing on this resource.`):d}}});var zA=ue($e());var UA=te({auth:J,name:"drive_remove_permission",classification:"DESTRUCTIVE",displayName:"Remove Permission",description:"Revoke a role from a user on a Drive file or folder.",audience:"ai",aiMetadata:{description:"Revokes a specific role from a user (matched by email and role) on a file or folder, resolving the permission ID internally. Use to unshare or remove access; to lower a role instead of removing it use drive_update_permission. Safe to retry \u2014 if no matching permission exists it is a no-op.",idempotent:!0},outputSchema:jx,props:{file_id:O.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to remove the permission from. Resolve it via drive_search_files or drive_get_file.",required:!0}),user_email:O.ShortText({displayName:"User Email",description:"The email address of the user whose access to revoke.",required:!0}),role:O.StaticDropdown({displayName:"Role",description:"The role to remove from the user. The grant is matched by email and role.",required:!0,options:{options:[{label:"Organizer",value:"organizer"},{label:"File Organizer",value:"fileOrganizer"},{label:"Writer",value:"writer"},{label:"Commenter",value:"commenter"},{label:"Reader",value:"reader"}]}})},async run(t){let[e,r]=[t.propsValue.file_id,t.propsValue.user_email],n=await oe(t.auth),o=(0,zA.drive)({version:"v3",auth:n}),s=await o.permissions.list({fileId:e,fields:"permissions(id, emailAddress, role)",supportsAllDrives:!0});if(s.data.permissions){for(let d of s.data.permissions)if(d.emailAddress===r&&d.role===t.propsValue.role)return await o.permissions.delete({fileId:e,permissionId:d.id?d.id:"",supportsAllDrives:!0}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var MA=ue($e());var FA=te({auth:J,name:"drive_list_shared_drives",classification:"SEARCH",displayName:"List Shared Drives",description:"List the shared drives the account can access.",audience:"ai",aiMetadata:{description:"Lists the shared drives the account can access, with each drive's id and name. Use to discover a driveId before creating or listing content in a shared drive or before drive_get_shared_drive, drive_update_shared_drive, or drive_delete_shared_drive. Read-only.",idempotent:!0},outputSchema:Tx,props:{query:O.ShortText({displayName:"Query",description:"Optional search query to filter shared drives, e.g. name contains 'marketing'. See https://developers.google.com/drive/api/guides/search-shareddrives",required:!1}),page_size:O.Number({displayName:"Page Size",description:"Maximum number of shared drives to return (1-100). Defaults to 100.",required:!1})},async run(t){let{query:e,page_size:r}=t.propsValue,n=await oe(t.auth),o=(0,MA.drive)({version:"v3",auth:n});try{let d=(await o.drives.list({q:e||void 0,pageSize:r||void 0})).data.drives??[];return{drives:d,count:d.length}}catch(s){throw s.code===403?new Error("Permission denied listing shared drives. Your account may not have shared-drive access."):s}}});var LA=ue($e());var jA=te({auth:J,name:"drive_get_shared_drive",classification:"READ",displayName:"Get Shared Drive",description:"Fetch metadata for one shared drive by ID.",audience:"ai",aiMetadata:{description:"Fetches metadata and capabilities for one shared drive by ID (resolve the ID via drive_list_shared_drives). Use to inspect a shared drive's settings before modifying it. Read-only.",idempotent:!0},outputSchema:Sx,props:{drive_id:O.ShortText({displayName:"Shared Drive ID",description:"The ID of the shared drive. Resolve it via drive_list_shared_drives.",required:!0})},async run(t){let{drive_id:e}=t.propsValue,r=await oe(t.auth),n=(0,LA.drive)({version:"v3",auth:r});try{return(await n.drives.get({driveId:e})).data}catch(o){throw o.code===404?new Error(`Shared drive not found (ID: ${e}). Resolve a valid ID via drive_list_shared_drives.`):o.code===403?new Error(`Permission denied accessing shared drive ${e}. You may not be a member of this drive.`):o}}});var qA=require("crypto");var BA=ue($e());var VA=te({auth:J,name:"drive_create_shared_drive",classification:"WRITE",displayName:"Create Shared Drive",description:"Create a new shared drive (Team Drive).",audience:"ai",aiMetadata:{description:"Creates a new shared drive (Team Drive) with the given name; the action supplies the required idempotency requestId internally. Use to set up a shared workspace. Each call creates a distinct shared drive. Your Workspace admin must have shared-drive creation enabled (a 403 here is an admin-policy issue, not a scope issue).",idempotent:!1},outputSchema:Cx,props:{name:O.ShortText({displayName:"Name",description:"The name of the new shared drive.",required:!0})},async run(t){let{name:e}=t.propsValue,r=await oe(t.auth),n=(0,BA.drive)({version:"v3",auth:r}),o=(0,qA.randomUUID)();try{return(await n.drives.create({requestId:o,requestBody:{name:e}})).data}catch(s){throw s.code===403?new Error("Permission denied creating a shared drive. Your Google Workspace admin may have disabled shared-drive creation for your account."):s}}});var GA=ue($e());var HA=te({auth:J,name:"drive_update_shared_drive",classification:"WRITE",displayName:"Update Shared Drive",description:"Rename or update a shared drive by ID.",audience:"ai",aiMetadata:{description:"Renames or updates a shared drive's settings by ID (resolve via drive_list_shared_drives). Use to rename a shared drive; to remove it entirely use drive_delete_shared_drive. Safe to retry \u2014 re-applying the same values is a no-op.",idempotent:!0},outputSchema:Nx,props:{drive_id:O.ShortText({displayName:"Shared Drive ID",description:"The ID of the shared drive to update. Resolve it via drive_list_shared_drives.",required:!0}),name:O.ShortText({displayName:"Name",description:"The new name for the shared drive. Leave empty to keep the current name.",required:!1})},async run(t){let{drive_id:e,name:r}=t.propsValue,n=await oe(t.auth),o=(0,GA.drive)({version:"v3",auth:n}),s={};r&&(s.name=r);try{return(await o.drives.update({driveId:e,requestBody:s})).data}catch(d){throw d.code===404?new Error(`Shared drive not found (ID: ${e}). Resolve a valid ID via drive_list_shared_drives.`):d.code===403?new Error(`Permission denied updating shared drive ${e}. You must be an organizer of this drive.`):d}}});var WA=ue($e());var ZA=te({auth:J,name:"drive_delete_shared_drive",classification:"DESTRUCTIVE",displayName:"Delete Shared Drive",description:"Permanently delete a shared drive by ID.",audience:"ai",aiMetadata:{description:"Permanently deletes a shared drive by ID (it must already be empty). Irreversible. Use only to remove a no-longer-needed shared drive. A repeat call fails because the drive no longer exists.",idempotent:!1},outputSchema:Fx,props:{drive_id:O.ShortText({displayName:"Shared Drive ID",description:"The ID of the shared drive to delete. Resolve it via drive_list_shared_drives.",required:!0})},async run(t){let{drive_id:e}=t.propsValue,r=await oe(t.auth),n=(0,WA.drive)({version:"v3",auth:r});try{return await n.drives.delete({driveId:e}),{deleted:!0,driveId:e}}catch(o){throw o.code===404?new Error(`Shared drive not found (ID: ${e}). It may have already been deleted. Resolve a valid ID via drive_list_shared_drives.`):o.code===400?new Error(`Cannot delete shared drive ${e}: it must be empty before deletion. Remove or trash all of its files first.`):o.code===403?new Error(`Permission denied deleting shared drive ${e}. You must be an organizer of this drive.`):o}}});var KA=ue($e());var JA=te({auth:J,name:"drive_create_comment",classification:"WRITE",displayName:"Create Comment",description:"Add a new comment to a Drive file.",audience:"ai",aiMetadata:{description:"Adds a new top-level comment to a file. Use to leave feedback or a note on a file (resolve the file ID via drive_search_files); to respond to an existing comment use drive_create_reply instead. Each call creates a new comment, so retries duplicate.",idempotent:!1},outputSchema:Ix,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file to comment on. Resolve it via drive_search_files or drive_get_file.",required:!0}),content:O.LongText({displayName:"Content",description:"The plain-text content of the comment.",required:!0})},async run(t){let{file_id:e,content:r}=t.propsValue,n=await oe(t.auth),o=(0,KA.drive)({version:"v3",auth:n});try{return(await o.comments.create({fileId:e,fields:"*",requestBody:{content:r}})).data}catch(s){throw s.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):s.code===403?new Error(`Permission denied commenting on file ${e}. You may lack comment access to this file.`):s}}});var YA=ue($e());var XA=te({auth:J,name:"drive_list_comments",classification:"SEARCH",displayName:"List Comments",description:"List the comments on a Drive file.",audience:"ai",aiMetadata:{description:"Lists the comments on a file with each comment's id, author, content, and resolved state. Use to read discussion on a file or to resolve a commentId before replying (drive_create_reply) or listing its replies (drive_list_replies). Read-only.",idempotent:!0},outputSchema:Ex,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file whose comments to list. Resolve it via drive_search_files or drive_get_file.",required:!0})},async run(t){let{file_id:e}=t.propsValue,r=await oe(t.auth),n=(0,YA.drive)({version:"v3",auth:r});try{let s=(await n.comments.list({fileId:e,fields:"*",includeDeleted:!1})).data.comments??[];return{comments:s,count:s.length}}catch(o){throw o.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):o.code===403?new Error(`Permission denied listing comments for file ${e}. You may lack access to this file.`):o}}});var QA=ue($e());var eR=te({auth:J,name:"drive_create_reply",classification:"WRITE",displayName:"Reply to Comment",description:"Add a reply to an existing comment on a Drive file.",audience:"ai",aiMetadata:{description:"Adds a reply to an existing comment, optionally resolving or reopening the comment via the action field. Use to respond to a comment (resolve the commentId via drive_list_comments); to start a new top-level comment use drive_create_comment instead. Each call creates a new reply, so retries duplicate.",idempotent:!1},outputSchema:xx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:O.ShortText({displayName:"Comment ID",description:"The ID of the comment to reply to. Resolve it via drive_list_comments.",required:!0}),content:O.LongText({displayName:"Content",description:"The plain-text content of the reply.",required:!0}),action:O.StaticDropdown({displayName:"Action",description:"Optionally change the parent comment's state: resolve (mark resolved) or reopen.",required:!1,options:{options:[{label:"Resolve",value:"resolve"},{label:"Reopen",value:"reopen"}]}})},async run(t){let{file_id:e,comment_id:r,content:n,action:o}=t.propsValue,s=await oe(t.auth),d=(0,QA.drive)({version:"v3",auth:s}),m={content:n};o&&(m.action=o);try{return(await d.replies.create({fileId:e,commentId:r,fields:"*",requestBody:m})).data}catch(h){throw h.code===404?new Error(`File or comment not found (file ID: ${e}, comment ID: ${r}). Resolve the comment ID via drive_list_comments.`):h.code===403?new Error(`Permission denied replying to comment ${r} on file ${e}. You may lack comment access to this file.`):h}}});var tR=ue($e());var rR=te({auth:J,name:"drive_get_reply",classification:"READ",displayName:"Get Reply",description:"Fetch a single reply on a Drive comment by ID.",audience:"ai",aiMetadata:{description:"Fetches a single reply by ID, including its author, content, and action. Use when you already have a replyId (resolve it via drive_list_replies) and need that one reply's details. Read-only.",idempotent:!0},outputSchema:Ax,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:O.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:O.ShortText({displayName:"Reply ID",description:"The ID of the reply to fetch. Resolve it via drive_list_replies.",required:!0})},async run(t){let{file_id:e,comment_id:r,reply_id:n}=t.propsValue,o=await oe(t.auth),s=(0,tR.drive)({version:"v3",auth:o});try{return(await s.replies.get({fileId:e,commentId:r,replyId:n,fields:"*"})).data}catch(d){throw d.code===404?new Error(`File, comment, or reply not found (file ID: ${e}, comment ID: ${r}, reply ID: ${n}). Resolve the reply ID via drive_list_replies.`):d.code===403?new Error(`Permission denied fetching reply ${n} on file ${e}. You may lack access to this file.`):d}}});var nR=ue($e());var iR=te({auth:J,name:"drive_list_replies",classification:"SEARCH",displayName:"List Replies",description:"List the replies under a Drive comment.",audience:"ai",aiMetadata:{description:"Lists the replies under a given comment with each reply's id, author, content, and action. Use to read a comment thread or to resolve a replyId before fetching (drive_get_reply), editing (drive_update_reply), or deleting (drive_delete_reply) a reply. Read-only.",idempotent:!0},outputSchema:Rx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:O.ShortText({displayName:"Comment ID",description:"The ID of the comment whose replies to list. Resolve it via drive_list_comments.",required:!0})},async run(t){let{file_id:e,comment_id:r}=t.propsValue,n=await oe(t.auth),o=(0,nR.drive)({version:"v3",auth:n});try{let d=(await o.replies.list({fileId:e,commentId:r,fields:"*"})).data.replies??[];return{replies:d,count:d.length}}catch(s){throw s.code===404?new Error(`File or comment not found (file ID: ${e}, comment ID: ${r}). Resolve the comment ID via drive_list_comments.`):s.code===403?new Error(`Permission denied listing replies for comment ${r} on file ${e}. You may lack access to this file.`):s}}});var oR=ue($e());var aR=te({auth:J,name:"drive_update_reply",classification:"WRITE",displayName:"Update Reply",description:"Edit the text of an existing reply on a Drive comment.",audience:"ai",aiMetadata:{description:"Edits the text of an existing reply by ID (resolve via drive_list_replies). Use to correct or revise a reply you control; to add a new reply instead use drive_create_reply. Safe to retry \u2014 re-applying the same content is a no-op.",idempotent:!0},outputSchema:Dx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:O.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:O.ShortText({displayName:"Reply ID",description:"The ID of the reply to update. Resolve it via drive_list_replies.",required:!0}),content:O.LongText({displayName:"Content",description:"The new plain-text content for the reply.",required:!0})},async run(t){let{file_id:e,comment_id:r,reply_id:n,content:o}=t.propsValue,s=await oe(t.auth),d=(0,oR.drive)({version:"v3",auth:s});try{return(await d.replies.update({fileId:e,commentId:r,replyId:n,fields:"*",requestBody:{content:o}})).data}catch(m){throw m.code===404?new Error(`File, comment, or reply not found (file ID: ${e}, comment ID: ${r}, reply ID: ${n}). Resolve the reply ID via drive_list_replies.`):m.code===403?new Error(`Permission denied updating reply ${n} on file ${e}. You can only edit your own replies.`):m}}});var sR=ue($e());var uR=te({auth:J,name:"drive_delete_reply",classification:"DESTRUCTIVE",displayName:"Delete Reply",description:"Permanently delete a reply on a Drive comment by ID.",audience:"ai",aiMetadata:{description:"Permanently deletes a reply by ID (resolve via drive_list_replies). Use to remove a reply you control; to edit it instead use drive_update_reply. A repeat call fails because the reply is already gone, so it is not safe to retry blindly.",idempotent:!1},outputSchema:Mx,props:{file_id:O.ShortText({displayName:"File ID",description:"The ID of the file the comment belongs to. Resolve it via drive_search_files or drive_get_file.",required:!0}),comment_id:O.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:O.ShortText({displayName:"Reply ID",description:"The ID of the reply to delete. Resolve it via drive_list_replies.",required:!0})},async run(t){let{file_id:e,comment_id:r,reply_id:n}=t.propsValue,o=await oe(t.auth),s=(0,sR.drive)({version:"v3",auth:o});try{return await s.replies.delete({fileId:e,commentId:r,replyId:n}),{success:!0,reply_id:n}}catch(d){throw d.code===404?new Error(`File, comment, or reply not found (file ID: ${e}, comment ID: ${r}, reply ID: ${n}). It may already be deleted. Resolve the reply ID via drive_list_replies.`):d.code===403?new Error(`Permission denied deleting reply ${n} on file ${e}. You can only delete your own replies.`):d}}});var cR=ue($e());var lR=te({auth:J,name:"drive_get_about",classification:"READ",displayName:"Get Account & Storage Info",description:"Get the authenticated Drive account, storage quota, and supported formats.",audience:"ai",aiMetadata:{description:"Returns the authenticated user's Drive info: account identity, storage quota and usage, and supported import/export formats. Use to check available space before a large upload, confirm which account is connected, or look up valid export MIME types. Read-only.",idempotent:!0},outputSchema:bx,props:{},async run(t){let e=await oe(t.auth),r=(0,cR.drive)({version:"v3",auth:e});try{return(await r.about.get({fields:"user,storageQuota,maxImportSizes,exportFormats"})).data}catch(n){throw n.code===403?new Error("Permission denied fetching Drive account info. The connection may lack the required Drive scope."):n}}});var Gj=rv({minimumSupportedRelease:"0.86.4",logoUrl:"https://cdn.activepieces.com/pieces/google-drive.png",categories:["CONTENT_AND_FILES"],displayName:"Google Drive",description:"Cloud storage and file backup",authors:["BastienMe","ArmanGiau3","Vitalini","pfernandez98","kanarelo","Salem-Alaa","kishanprmr","MoShizzle","AbdulTheActivePiecer","khaledmashaly","abuaboud","geekyme"],triggers:[vI,wI,EI],actions:[Gx,Wx,mI,aI,Qx,oI,dI,Yx,cI,Bx,Kx,RI,$I,CI,kI,qI,VI,HI,KI,XI,eA,tA,iA,aA,uA,lA,pA,mA,gA,_A,PA,TA,EA,IA,RA,$A,CA,kA,UA,FA,jA,VA,HA,ZA,JA,XA,eR,rR,iR,aR,uR,lR,gw({baseUrl:i(()=>"https://www.googleapis.com/drive/v3","baseUrl"),auth:J,authMapping:i(async t=>({Authorization:`Bearer ${await it(t)}`}),"authMapping")})],auth:J});0&&(module.exports={createGoogleClient,getAccessToken,googleDrive,googleDriveAuth});
|
|
78
78
|
/*! Bundled license information:
|
|
79
79
|
|
|
80
80
|
mime-types/index.js:
|