@activepieces/piece-google-drive 0.8.3 → 0.8.4

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.
Files changed (2) hide show
  1. package/package.json +4 -2
  2. package/src/index.js +42 -37
package/src/index.js CHANGED
@@ -1,75 +1,80 @@
1
- "use strict";var h0=Object.create;var zo=Object.defineProperty;var g0=Object.getOwnPropertyDescriptor;var y0=Object.getOwnPropertyNames;var v0=Object.getPrototypeOf,_0=Object.prototype.hasOwnProperty;var i=(t,e)=>zo(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}},xs=(t,e)=>{for(var r in e)zo(t,r,{get:e[r],enumerable:!0})},Nh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of y0(e))!_0.call(t,o)&&o!==r&&zo(t,o,{get:()=>e[o],enumerable:!(n=g0(e,o))||n.enumerable});return t};var ue=(t,e,r)=>(r=t!=null?h0(v0(t)):{},Nh(e||!t||!t.__esModule?zo(r,"default",{value:t,enumerable:!0}):r,t)),P0=t=>Nh(zo({},"__esModule",{value:!0}),t);var ny=L((ry,Hs)=>{(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,}",p="(?:[0-9a-f]+::?)+",m={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${p})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${p})|(?:::)(?:${p})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function h(w,S){if(w.indexOf("::")!==w.lastIndexOf("::"))return null;let D=0,E=-1,u=(w.match(m.zoneIndex)||[])[0],f,c;for(u&&(u=u.substring(1),w=w.replace(/%.+$/,""));(E=w.indexOf(":",E+1))>=0;)D++;if(w.substr(0,2)==="::"&&D--,w.substr(-2,2)==="::"&&D--,D>S)return null;for(c=S-D,f=":";c--;)f+="0:";return w=w.replace("::",f),w[0]===":"&&(w=w.slice(1)),w[w.length-1]===":"&&(w=w.slice(0,-1)),S=(function(){let y=w.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(w,S,D,E){if(w.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),w[u]>>f!==S[u]>>f)return!1;E-=D,u+=1}return!0}i(v,"matchCIDR");function P(w){if(o.test(w))return parseInt(w,16);if(w[0]==="0"&&!isNaN(parseInt(w[1],10))){if(n.test(w))return parseInt(w,8);throw new Error(`ipaddr: cannot parse ${w} as octal`)}return parseInt(w,10)}i(P,"parseIntAuto");function x(w,S){for(;w.length<S;)w=`0${w}`;return w}i(x,"padPart");let T={};T.IPv4=(function(){function w(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(w,"IPv4"),w.prototype.SpecialRanges={unspecified:[[new w([0,0,0,0]),8]],broadcast:[[new w([255,255,255,255]),32]],multicast:[[new w([224,0,0,0]),4]],linkLocal:[[new w([169,254,0,0]),16]],loopback:[[new w([127,0,0,0]),8]],carrierGradeNat:[[new w([100,64,0,0]),10]],private:[[new w([10,0,0,0]),8],[new w([172,16,0,0]),12],[new w([192,168,0,0]),16]],reserved:[[new w([192,0,0,0]),24],[new w([192,0,2,0]),24],[new w([192,88,99,0]),24],[new w([198,18,0,0]),15],[new w([198,51,100,0]),24],[new w([203,0,113,0]),24],[new w([240,0,0,0]),4]],as112:[[new w([192,175,48,0]),24],[new w([192,31,196,0]),24]],amt:[[new w([192,52,193,0]),24]]},w.prototype.kind=function(){return"ipv4"},w.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)},w.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},w.prototype.range=function(){return T.subnetMatch(this,this.SpecialRanges)},w.prototype.toByteArray=function(){return this.octets.slice(0)},w.prototype.toIPv4MappedAddress=function(){return T.IPv6.parse(`::ffff:${this.toString()}`)},w.prototype.toNormalizedString=function(){return this.toString()},w.prototype.toString=function(){return this.octets.join(".")},w})(),T.IPv4.broadcastAddressFromCIDR=function(w){try{let S=this.parseCIDR(w),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(w){return this.parser(w)!==null},T.IPv4.isValid=function(w){try{return new this(this.parser(w)),!0}catch{return!1}},T.IPv4.isValidCIDR=function(w){try{return this.parseCIDR(w),!0}catch{return!1}},T.IPv4.isValidFourPartDecimal=function(w){return!!(T.IPv4.isValid(w)&&w.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},T.IPv4.isValidCIDRFourPartDecimal=function(w){let S=w.match(/^(.+)\/(\d+)$/);return!T.IPv4.isValidCIDR(w)||!S?!1:T.IPv4.isValidFourPartDecimal(S[1])},T.IPv4.networkAddressFromCIDR=function(w){let S,D,E,u,f;try{for(S=this.parseCIDR(w),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(w){let S=this.parser(w);if(S===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(S)},T.IPv4.parseCIDR=function(w){let S;if(S=w.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(w){let S,D,E;if(S=w.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(P(D));return f})();if(S=w.match(r.longValue)){if(E=P(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=w.match(r.twoOctet))?(function(){let u=S.slice(1,4),f=[];if(E=P(u[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return f.push(P(u[0])),f.push(E>>16&255),f.push(E>>8&255),f.push(E&255),f})():(S=w.match(r.threeOctet))?(function(){let u=S.slice(1,5),f=[];if(E=P(u[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return f.push(P(u[0])),f.push(P(u[1])),f.push(E>>8&255),f.push(E&255),f})():null},T.IPv4.subnetMaskFromPrefixLength=function(w){if(w=parseInt(w),w<0||w>32)throw new Error("ipaddr: invalid IPv4 prefix length");let S=[0,0,0,0],D=0,E=Math.floor(w/8);for(;D<E;)S[D]=255,D++;return E<4&&(S[E]=Math.pow(2,w%8)-1<<8-w%8),new this(S)},T.IPv6=(function(){function w(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(w,"IPv6"),w.prototype.SpecialRanges={unspecified:[new w([0,0,0,0,0,0,0,0]),128],linkLocal:[new w([65152,0,0,0,0,0,0,0]),10],multicast:[new w([65280,0,0,0,0,0,0,0]),8],loopback:[new w([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new w([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new w([0,0,0,0,0,65535,0,0]),96],discard:[new w([256,0,0,0,0,0,0,0]),64],rfc6145:[new w([0,0,0,0,65535,0,0,0]),96],rfc6052:[new w([100,65435,0,0,0,0,0,0]),96],"6to4":[new w([8194,0,0,0,0,0,0,0]),16],teredo:[new w([8193,0,0,0,0,0,0,0]),32],benchmarking:[new w([8193,2,0,0,0,0,0,0]),48],amt:[new w([8193,3,0,0,0,0,0,0]),32],as112v6:[[new w([8193,4,274,0,0,0,0,0]),48],[new w([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new w([8193,16,0,0,0,0,0,0]),28],orchid2:[new w([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new w([8193,48,0,0,0,0,0,0]),28],reserved:[[new w([8193,0,0,0,0,0,0,0]),23],[new w([8193,3512,0,0,0,0,0,0]),32]]},w.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},w.prototype.kind=function(){return"ipv6"},w.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)},w.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},w.prototype.range=function(){return T.subnetMatch(this,this.SpecialRanges)},w.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},w.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},w.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])},w.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},w.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)}`},w.prototype.toString=function(){return this.toRFC5952String()},w})(),T.IPv6.broadcastAddressFromCIDR=function(w){try{let S=this.parseCIDR(w),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(w){return this.parser(w)!==null},T.IPv6.isValid=function(w){if(typeof w=="string"&&w.indexOf(":")===-1)return!1;try{let S=this.parser(w);return new this(S.parts,S.zoneId),!0}catch{return!1}},T.IPv6.isValidCIDR=function(w){if(typeof w=="string"&&w.indexOf(":")===-1)return!1;try{return this.parseCIDR(w),!0}catch{return!1}},T.IPv6.networkAddressFromCIDR=function(w){let S,D,E,u,f;try{for(S=this.parseCIDR(w),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(w){let S=this.parser(w);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(w){let S,D,E;if((D=w.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(w){let S,D,E,u,f,c;if(E=w.match(m.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(m.native.test(w))return h(w,8);if((E=w.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(w){if(w=parseInt(w),w<0||w>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(w/8);for(;D<E;)S[D]=255,D++;return E<16&&(S[E]=Math.pow(2,w%8)-1<<8-w%8),new this(S)},T.fromByteArray=function(w){let S=w.length;if(S===4)return new T.IPv4(w);if(S===16)return new T.IPv6(w);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},T.isValid=function(w){return T.IPv6.isValid(w)||T.IPv4.isValid(w)},T.isValidCIDR=function(w){return T.IPv6.isValidCIDR(w)||T.IPv4.isValidCIDR(w)},T.parse=function(w){if(T.IPv6.isValid(w))return T.IPv6.parse(w);if(T.IPv4.isValid(w))return T.IPv4.parse(w);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},T.parseCIDR=function(w){try{return T.IPv6.parseCIDR(w)}catch{try{return T.IPv4.parseCIDR(w)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},T.process=function(w){let S=this.parse(w);return S.kind()==="ipv6"&&S.isIPv4MappedAddress()?S.toIPv4Address():S},T.subnetMatch=function(w,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],w.kind()===c[0].kind()&&w.match.apply(w,c))return u}return D},typeof Hs<"u"&&Hs.exports?Hs.exports=T:t.ipaddr=T})(ry)});var iv=L((E5,nv)=>{var rv=require("stream").Stream,rO=require("util");nv.exports=br;function br(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(br,"DelayedStream");rO.inherits(br,rv);br.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(br.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});br.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};br.prototype.resume=function(){this._released||this.release(),this.source.resume()};br.prototype.pause=function(){this.source.pause()};br.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};br.prototype.pipe=function(){var t=rv.prototype.pipe.apply(this,arguments);return this.resume(),t};br.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)};br.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 uv=L((A5,sv)=>{var nO=require("util"),av=require("stream").Stream,ov=iv();sv.exports=dt;function dt(){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(dt,"CombinedStream");nO.inherits(dt,av);dt.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};dt.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};dt.prototype.append=function(t){var e=dt.isStreamLike(t);if(e){if(!(t instanceof ov)){var r=ov.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};dt.prototype.pipe=function(t,e){return av.prototype.pipe.call(this,t,e),this.resume(),t};dt.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}};dt.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=dt.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};dt.prototype._pipeNext=function(t){this._currentStream=t;var e=dt.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()};dt.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};dt.prototype.write=function(t){this.emit("data",t)};dt.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};dt.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")};dt.prototype.end=function(){this._reset(),this.emit("end")};dt.prototype.destroy=function(){this._reset(),this.emit("close")};dt.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};dt.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};dt.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)};dt.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var lv=L((D5,cv)=>{"use strict";cv.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 Ln=L(Ut=>{"use strict";var Qs=lv(),iO=require("path").extname,dv=/^\s*([^;\s]*)(?:;|\s|$)/,oO=/^text\//i;Ut.charset=pv;Ut.charsets={lookup:pv};Ut.contentType=aO;Ut.extension=sO;Ut.extensions=Object.create(null);Ut.lookup=uO;Ut.types=Object.create(null);cO(Ut.extensions,Ut.types);function pv(t){if(!t||typeof t!="string")return!1;var e=dv.exec(t),r=e&&Qs[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&oO.test(e[1])?"UTF-8":!1}i(pv,"charset");function aO(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Ut.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Ut.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}i(aO,"contentType");function sO(t){if(!t||typeof t!="string")return!1;var e=dv.exec(t),r=e&&Ut.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(sO,"extension");function uO(t){if(!t||typeof t!="string")return!1;var e=iO("x."+t).toLowerCase().substr(1);return e&&Ut.types[e]||!1}i(uO,"lookup");function cO(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(Qs).forEach(i(function(o){var s=Qs[o],p=s.extensions;if(!(!p||!p.length)){t[o]=p;for(var m=0;m<p.length;m++){var h=p[m];if(e[h]){var v=r.indexOf(Qs[e[h]].source),P=r.indexOf(s.source);if(e[h]!=="application/octet-stream"&&(v>P||v===P&&e[h].substr(0,12)==="application/"))continue}e[h]=o}}},"forEachMimeType"))}i(cO,"populateMaps")});var mv=L((C5,fv)=>{fv.exports=lO;function lO(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}i(lO,"defer")});var id=L((k5,gv)=>{var hv=mv();gv.exports=dO;function dO(t){var e=!1;return hv(function(){e=!0}),i(function(n,o){e?t(n,o):hv(i(function(){t(n,o)},"nextTick_callback"))},"async_callback")}i(dO,"async")});var od=L((U5,yv)=>{yv.exports=pO;function pO(t){Object.keys(t.jobs).forEach(fO.bind(t)),t.jobs={}}i(pO,"abort");function fO(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}i(fO,"clean")});var ad=L((F5,_v)=>{var vv=id(),mO=od();_v.exports=hO;function hO(t,e,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=gO(e,o,t[o],function(s,p){o in r.jobs&&(delete r.jobs[o],s?mO(r):r.results[o]=p,n(s,r.results))})}i(hO,"iterate");function gO(t,e,r,n){var o;return t.length==2?o=t(r,vv(n)):o=t(r,e,vv(n)),o}i(gO,"runJob")});var sd=L((j5,Pv)=>{Pv.exports=yO;function yO(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};return e&&n.keyedList.sort(r?e:function(o,s){return e(t[o],t[s])}),n}i(yO,"state")});var ud=L((B5,wv)=>{var vO=od(),_O=id();wv.exports=PO;function PO(t){Object.keys(this.jobs).length&&(this.index=this.size,vO(this),_O(t)(null,this.results))}i(PO,"terminator")});var Tv=L((G5,bv)=>{var wO=ad(),bO=sd(),TO=ud();bv.exports=SO;function SO(t,e,r){for(var n=bO(t);n.index<(n.keyedList||t).length;)wO(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 TO.bind(n,r)}i(SO,"parallel")});var cd=L((W5,eu)=>{var Sv=ad(),xO=sd(),EO=ud();eu.exports=IO;eu.exports.ascending=xv;eu.exports.descending=AO;function IO(t,e,r,n){var o=xO(t,r);return Sv(t,e,o,i(function s(p,m){if(p){n(p,m);return}if(o.index++,o.index<(o.keyedList||t).length){Sv(t,e,o,s);return}n(null,o.results)},"iteratorHandler")),EO.bind(o,n)}i(IO,"serialOrdered");function xv(t,e){return t<e?-1:t>e?1:0}i(xv,"ascending");function AO(t,e){return-1*xv(t,e)}i(AO,"descending")});var Iv=L((K5,Ev)=>{var RO=cd();Ev.exports=DO;function DO(t,e,r){return RO(t,e,null,r)}i(DO,"serial")});var Rv=L((Y5,Av)=>{Av.exports={parallel:Tv(),serial:Iv(),serialOrdered:cd()}});var ld=L((X5,Dv)=>{"use strict";Dv.exports=Object});var Ov=L((Q5,$v)=>{"use strict";$v.exports=Error});var Nv=L((e9,Cv)=>{"use strict";Cv.exports=EvalError});var zv=L((t9,kv)=>{"use strict";kv.exports=RangeError});var Mv=L((r9,Uv)=>{"use strict";Uv.exports=ReferenceError});var Lv=L((n9,Fv)=>{"use strict";Fv.exports=SyntaxError});var jn=L((i9,jv)=>{"use strict";jv.exports=TypeError});var Bv=L((o9,qv)=>{"use strict";qv.exports=URIError});var Gv=L((a9,Vv)=>{"use strict";Vv.exports=Math.abs});var Wv=L((s9,Hv)=>{"use strict";Hv.exports=Math.floor});var Kv=L((u9,Zv)=>{"use strict";Zv.exports=Math.max});var Yv=L((c9,Jv)=>{"use strict";Jv.exports=Math.min});var Qv=L((l9,Xv)=>{"use strict";Xv.exports=Math.pow});var t_=L((d9,e_)=>{"use strict";e_.exports=Math.round});var n_=L((p9,r_)=>{"use strict";r_.exports=Number.isNaN||i(function(e){return e!==e},"isNaN")});var o_=L((m9,i_)=>{"use strict";var $O=n_();i_.exports=i(function(e){return $O(e)||e===0?e:e<0?-1:1},"sign")});var s_=L((g9,a_)=>{"use strict";a_.exports=Object.getOwnPropertyDescriptor});var dd=L((y9,u_)=>{"use strict";var tu=s_();if(tu)try{tu([],"length")}catch{tu=null}u_.exports=tu});var l_=L((v9,c_)=>{"use strict";var ru=Object.defineProperty||!1;if(ru)try{ru({},"a",{value:1})}catch{ru=!1}c_.exports=ru});var pd=L((_9,d_)=>{"use strict";d_.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 p=Object.getOwnPropertySymbols(e);if(p.length!==1||p[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 m_=L((w9,f_)=>{"use strict";var p_=typeof Symbol<"u"&&Symbol,OO=pd();f_.exports=i(function(){return typeof p_!="function"||typeof Symbol!="function"||typeof p_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:OO()},"hasNativeSymbols")});var fd=L((T9,h_)=>{"use strict";h_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var md=L((S9,g_)=>{"use strict";var CO=ld();g_.exports=CO.getPrototypeOf||null});var __=L((x9,v_)=>{"use strict";var NO="Function.prototype.bind called on incompatible ",kO=Object.prototype.toString,zO=Math.max,UO="[object Function]",y_=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"),MO=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"),FO=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");v_.exports=i(function(e){var r=this;if(typeof r!="function"||kO.apply(r)!==UO)throw new TypeError(NO+r);for(var n=MO(arguments,1),o,s=i(function(){if(this instanceof o){var P=r.apply(this,y_(n,arguments));return Object(P)===P?P:this}return r.apply(e,y_(n,arguments))},"binder"),p=zO(0,r.length-n.length),m=[],h=0;h<p;h++)m[h]="$"+h;if(o=Function("binder","return function ("+FO(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 Wi=L((I9,P_)=>{"use strict";var LO=__();P_.exports=Function.prototype.bind||LO});var nu=L((A9,w_)=>{"use strict";w_.exports=Function.prototype.call});var hd=L((R9,b_)=>{"use strict";b_.exports=Function.prototype.apply});var S_=L((D9,T_)=>{"use strict";T_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var E_=L(($9,x_)=>{"use strict";var jO=Wi(),qO=hd(),BO=nu(),VO=S_();x_.exports=VO||jO.call(BO,qO)});var gd=L((O9,I_)=>{"use strict";var GO=Wi(),HO=jn(),WO=nu(),ZO=E_();I_.exports=i(function(e){if(e.length<1||typeof e[0]!="function")throw new HO("a function is required");return ZO(GO,WO,e)},"callBindBasic")});var C_=L((N9,O_)=>{"use strict";var KO=gd(),A_=dd(),D_;try{D_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var yd=!!D_&&A_&&A_(Object.prototype,"__proto__"),$_=Object,R_=$_.getPrototypeOf;O_.exports=yd&&typeof yd.get=="function"?KO([yd.get]):typeof R_=="function"?i(function(e){return R_(e==null?e:$_(e))},"getDunder"):!1});var M_=L((z9,U_)=>{"use strict";var N_=fd(),k_=md(),z_=C_();U_.exports=N_?i(function(e){return N_(e)},"getProto"):k_?i(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return k_(e)},"getProto"):z_?i(function(e){return z_(e)},"getProto"):null});var vd=L((M9,F_)=>{"use strict";var JO=Function.prototype.call,YO=Object.prototype.hasOwnProperty,XO=Wi();F_.exports=XO.call(JO,YO)});var sa=L((F9,G_)=>{"use strict";var Fe,QO=ld(),eC=Ov(),tC=Nv(),rC=zv(),nC=Mv(),Yi=Lv(),Ji=jn(),iC=Bv(),oC=Gv(),aC=Wv(),sC=Kv(),uC=Yv(),cC=Qv(),lC=t_(),dC=o_(),B_=Function,_d=i(function(t){try{return B_('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),ia=dd(),pC=l_(),Pd=i(function(){throw new Ji},"throwTypeError"),fC=ia?(function(){try{return arguments.callee,Pd}catch{try{return ia(arguments,"callee").get}catch{return Pd}}})():Pd,Zi=m_()(),xt=M_(),mC=md(),hC=fd(),V_=hd(),oa=nu(),Ki={},gC=typeof Uint8Array>"u"||!xt?Fe:xt(Uint8Array),ci={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Fe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Fe:ArrayBuffer,"%ArrayIteratorPrototype%":Zi&&xt?xt([][Symbol.iterator]()):Fe,"%AsyncFromSyncIteratorPrototype%":Fe,"%AsyncFunction%":Ki,"%AsyncGenerator%":Ki,"%AsyncGeneratorFunction%":Ki,"%AsyncIteratorPrototype%":Ki,"%Atomics%":typeof Atomics>"u"?Fe:Atomics,"%BigInt%":typeof BigInt>"u"?Fe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Fe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Fe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Fe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":eC,"%eval%":eval,"%EvalError%":tC,"%Float16Array%":typeof Float16Array>"u"?Fe:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Fe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Fe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Fe:FinalizationRegistry,"%Function%":B_,"%GeneratorFunction%":Ki,"%Int8Array%":typeof Int8Array>"u"?Fe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Fe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Fe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Zi&&xt?xt(xt([][Symbol.iterator]())):Fe,"%JSON%":typeof JSON=="object"?JSON:Fe,"%Map%":typeof Map>"u"?Fe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Zi||!xt?Fe:xt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":QO,"%Object.getOwnPropertyDescriptor%":ia,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Fe:Promise,"%Proxy%":typeof Proxy>"u"?Fe:Proxy,"%RangeError%":rC,"%ReferenceError%":nC,"%Reflect%":typeof Reflect>"u"?Fe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Fe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Zi||!xt?Fe:xt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Fe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Zi&&xt?xt(""[Symbol.iterator]()):Fe,"%Symbol%":Zi?Symbol:Fe,"%SyntaxError%":Yi,"%ThrowTypeError%":fC,"%TypedArray%":gC,"%TypeError%":Ji,"%Uint8Array%":typeof Uint8Array>"u"?Fe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Fe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Fe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Fe:Uint32Array,"%URIError%":iC,"%WeakMap%":typeof WeakMap>"u"?Fe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Fe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Fe:WeakSet,"%Function.prototype.call%":oa,"%Function.prototype.apply%":V_,"%Object.defineProperty%":pC,"%Object.getPrototypeOf%":mC,"%Math.abs%":oC,"%Math.floor%":aC,"%Math.max%":sC,"%Math.min%":uC,"%Math.pow%":cC,"%Math.round%":lC,"%Math.sign%":dC,"%Reflect.getPrototypeOf%":hC};if(xt)try{null.error}catch(t){L_=xt(xt(t)),ci["%Error.prototype%"]=L_}var L_,yC=i(function t(e){var r;if(e==="%AsyncFunction%")r=_d("async function () {}");else if(e==="%GeneratorFunction%")r=_d("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=_d("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"),j_={__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"]},aa=Wi(),iu=vd(),vC=aa.call(oa,Array.prototype.concat),_C=aa.call(V_,Array.prototype.splice),q_=aa.call(oa,String.prototype.replace),ou=aa.call(oa,String.prototype.slice),PC=aa.call(oa,RegExp.prototype.exec),wC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,bC=/\\(\\)?/g,TC=i(function(e){var r=ou(e,0,1),n=ou(e,-1);if(r==="%"&&n!=="%")throw new Yi("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Yi("invalid intrinsic syntax, expected opening `%`");var o=[];return q_(e,wC,function(s,p,m,h){o[o.length]=m?q_(h,bC,"$1"):p||s}),o},"stringToPath"),SC=i(function(e,r){var n=e,o;if(iu(j_,n)&&(o=j_[n],n="%"+o[0]+"%"),iu(ci,n)){var s=ci[n];if(s===Ki&&(s=yC(n)),typeof s>"u"&&!r)throw new Ji("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Yi("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");G_.exports=i(function(e,r){if(typeof e!="string"||e.length===0)throw new Ji("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ji('"allowMissing" argument must be a boolean');if(PC(/^%?[^%]*%?$/,e)===null)throw new Yi("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=TC(e),o=n.length>0?n[0]:"",s=SC("%"+o+"%",r),p=s.name,m=s.value,h=!1,v=s.alias;v&&(o=v[0],_C(n,vC([0,1],v)));for(var P=1,x=!0;P<n.length;P+=1){var T=n[P],w=ou(T,0,1),S=ou(T,-1);if((w==='"'||w==="'"||w==="`"||S==='"'||S==="'"||S==="`")&&w!==S)throw new Yi("property names with quotes must have matching quotes");if((T==="constructor"||!x)&&(h=!0),o+="."+T,p="%"+o+"%",iu(ci,p))m=ci[p];else if(m!=null){if(!(T in m)){if(!r)throw new Ji("base intrinsic for "+e+" exists, but the property is not available.");return}if(ia&&P+1>=n.length){var D=ia(m,T);x=!!D,x&&"get"in D&&!("originalValue"in D.get)?m=D.get:m=m[T]}else x=iu(m,T),m=m[T];x&&!h&&(ci[p]=m)}}return m},"GetIntrinsic")});var W_=L((j9,H_)=>{"use strict";var xC=pd();H_.exports=i(function(){return xC()&&!!Symbol.toStringTag},"hasToStringTagShams")});var J_=L((B9,K_)=>{"use strict";var EC=sa(),Z_=EC("%Object.defineProperty%",!0),IC=W_()(),AC=vd(),RC=jn(),au=IC?Symbol.toStringTag:null;K_.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 RC("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");au&&(n||!AC(e,au))&&(Z_?Z_(e,au,{configurable:!o,enumerable:!1,value:r,writable:!1}):e[au]=r)},"setToStringTag")});var X_=L((G9,Y_)=>{"use strict";var DC=Function.prototype.call,$C=Object.prototype.hasOwnProperty,OC=Wi();Y_.exports=OC.call(DC,$C)});var eP=L((H9,Q_)=>{"use strict";Q_.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var ua=L((W9,rP)=>{"use strict";var Sd=uv(),CC=require("util"),wd=require("path"),NC=require("http"),kC=require("https"),zC=require("url").parse,UC=require("fs"),MC=require("stream").Stream,FC=require("crypto"),bd=Ln(),LC=Rv(),jC=J_(),qn=X_(),Td=eP();function tP(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(tP,"escapeHeaderParam");function Ve(t){if(!(this instanceof Ve))return new Ve(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Sd.call(this),t=t||{};for(var e in t)this[e]=t[e]}i(Ve,"FormData");CC.inherits(Ve,Sd);Ve.LINE_BREAK=`\r
2
- `;Ve.DEFAULT_CONTENT_TYPE="application/octet-stream";Ve.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Sd.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)};Ve.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)+Ve.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&qn(e,"httpVersion"))&&!(e instanceof MC))&&(r.knownLength||this._valuesToMeasure.push(e))};Ve.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)):UC.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")};Ve.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="",p={"Content-Disposition":["form-data",'name="'+tP(t)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&Td(p,r.header);var m;for(var h in p)if(qn(p,h)){if(m=p[h],m==null)continue;Array.isArray(m)||(m=[m]),m.length&&(s+=h+": "+m.join("; ")+Ve.LINE_BREAK)}return"--"+this.getBoundary()+Ve.LINE_BREAK+s+Ve.LINE_BREAK};Ve.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=wd.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=wd.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&qn(t,"httpVersion")&&(r=wd.basename(t.client._httpMessage.path||"")),r)return'filename="'+tP(r)+'"'};Ve.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=bd.lookup(t.name)),!r&&t&&t.path&&(r=bd.lookup(t.path)),!r&&t&&t.readable&&qn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=bd.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Ve.DEFAULT_CONTENT_TYPE),r};Ve.prototype._multiPartFooter=function(){return function(t){var e=Ve.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Ve.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Ve.LINE_BREAK};Ve.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};Ve.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Ve.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Ve.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(Ve.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Ve.prototype._generateBoundary=function(){this._boundary="--------------------------"+FC.randomBytes(12).toString("hex")};Ve.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};Ve.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Ve.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}LC.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(o){e+=o}),t(null,e)})};Ve.prototype.submit=function(t,e){var r,n,o={method:"post"};return typeof t=="string"?(t=zC(t),n=Td({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},o)):(n=Td(t,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=kC.request(n):r=NC.request(n),this.getLength(function(s,p){if(s&&s!=="Unknown stream"){this._error(s);return}if(p&&r.setHeader("Content-Length",p),this.pipe(r),e){var m,h=i(function(v,P){return r.removeListener("error",h),r.removeListener("response",m),e.call(this,v,P)},"callback");m=h.bind(this,null),r.on("error",h),r.on("response",m)}}.bind(this)),r};Ve.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Ve.prototype.toString=function(){return"[object FormData]"};jC(Ve.prototype,"FormData");rP.exports=Ve});var ca=L((hY,pP)=>{"use strict";var su=Object.prototype.hasOwnProperty,dP=Object.prototype.toString,oP=Object.defineProperty,aP=Object.getOwnPropertyDescriptor,sP=i(function(e){return typeof Array.isArray=="function"?Array.isArray(e):dP.call(e)==="[object Array]"},"isArray"),uP=i(function(e){if(!e||dP.call(e)!=="[object Object]")return!1;var r=su.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&su.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var o;for(o in e);return typeof o>"u"||su.call(e,o)},"isPlainObject"),cP=i(function(e,r){oP&&r.name==="__proto__"?oP(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),lP=i(function(e,r){if(r==="__proto__")if(su.call(e,r)){if(aP)return aP(e,r).value}else return;return e[r]},"getProperty");pP.exports=i(function t(){var e,r,n,o,s,p,m=arguments[0],h=1,v=arguments.length,P=!1;for(typeof m=="boolean"&&(P=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=lP(m,r),o=lP(e,r),m!==o&&(P&&o&&(uP(o)||(s=sP(o)))?(s?(s=!1,p=n&&sP(n)?n:[]):p=n&&uP(n)?n:{},cP(m,{name:r,newValue:t(P,p,o)})):typeof o<"u"&&cP(m,{name:r,newValue:o}));return m},"extend")});var fP=L((yY,JC)=>{JC.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 hP=L((vY,mP)=>{"use strict";var YC=fP();mP.exports={pkg:YC}});var Id=L(lr=>{"use strict";var yP=lr&&lr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lr,"__esModule",{value:!0});lr.GaxiosError=lr.GAXIOS_ERROR_SYMBOL=void 0;lr.defaultErrorRedactor=vP;var gP=yP(ca()),XC=yP(hP()),xd=XC.default.pkg;lr.GAXIOS_ERROR_SYMBOL=Symbol.for(`${xd.name}-gaxios-error`);var Ed=class t extends Error{static{i(this,"GaxiosError")}config;response;code;status;error;[lr.GAXIOS_ERROR_SYMBOL]=xd.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&lr.GAXIOS_ERROR_SYMBOL in e&&e[lr.GAXIOS_ERROR_SYMBOL]===xd.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,gP.default)(!0,{},r),this.response&&(this.response.config=(0,gP.default)(!0,{},this.response.config)),this.response){try{this.response.data=QC(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 p=[];for(let m of e.data.error.errors)typeof m=="object"&&"message"in m&&typeof m.message=="string"&&p.push(m.message);return Object.assign({message:p.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}}};lr.GaxiosError=Ed;function QC(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(QC,"translateData");function vP(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((p,m)=>{(/^authentication$/i.test(m)||/^authorization$/i.test(m)||/secret/i.test(m))&&s.set(m,e)})}i(r,"redactHeaders");function n(s,p){if(typeof s=="object"&&s!==null&&typeof s[p]=="string"){let m=s[p];(/grant_type=/i.test(m)||/assertion=/i.test(m)||/secret/i.test(m))&&(s[p]=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((p,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&&(vP({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),o(t.response.data))),t}i(vP,"defaultErrorRedactor")});var PP=L(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.getRetryConfig=eN;async function eN(t){let e=_P(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||tN)(t))return{shouldRetry:!1,config:t.config};let o=rN(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,o):new Promise(p=>{setTimeout(p,o)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}i(eN,"getRetryConfig");function tN(t){let e=_P(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(tN,"shouldRetryRequest");function _P(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}i(_P,"getConfig");function rN(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(rN,"getNextRetryDelay")});var Dd=L(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.GaxiosInterceptorManager=void 0;var Rd=class extends Set{static{i(this,"GaxiosInterceptorManager")}};uu.GaxiosInterceptorManager=Rd});var bP=L((xY,wP)=>{var Xi=1e3,Qi=Xi*60,eo=Qi*60,li=eo*24,nN=li*7,iN=li*365.25;wP.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return oN(t);if(r==="number"&&isFinite(t))return e.long?sN(t):aN(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function oN(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*iN;case"weeks":case"week":case"w":return r*nN;case"days":case"day":case"d":return r*li;case"hours":case"hour":case"hrs":case"hr":case"h":return r*eo;case"minutes":case"minute":case"mins":case"min":case"m":return r*Qi;case"seconds":case"second":case"secs":case"sec":case"s":return r*Xi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}i(oN,"parse");function aN(t){var e=Math.abs(t);return e>=li?Math.round(t/li)+"d":e>=eo?Math.round(t/eo)+"h":e>=Qi?Math.round(t/Qi)+"m":e>=Xi?Math.round(t/Xi)+"s":t+"ms"}i(aN,"fmtShort");function sN(t){var e=Math.abs(t);return e>=li?cu(t,e,li,"day"):e>=eo?cu(t,e,eo,"hour"):e>=Qi?cu(t,e,Qi,"minute"):e>=Xi?cu(t,e,Xi,"second"):t+" ms"}i(sN,"fmtLong");function cu(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}i(cu,"plural")});var $d=L((IY,TP)=>{function uN(t){r.debug=r,r.default=r,r.coerce=h,r.disable=p,r.enable=o,r.enabled=m,r.humanize=bP(),r.destroy=v,Object.keys(t).forEach(P=>{r[P]=t[P]}),r.names=[],r.skips=[],r.formatters={};function e(P){let x=0;for(let T=0;T<P.length;T++)x=(x<<5)-x+P.charCodeAt(T),x|=0;return r.colors[Math.abs(x)%r.colors.length]}i(e,"selectColor"),r.selectColor=e;function r(P){let x,T=null,w,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 oe=r.formatters[g];if(typeof oe=="function"){let ne=E[y];b=oe.call(u,ne),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=P,D.useColors=r.useColors(),D.color=r.selectColor(P),D.extend=n,D.destroy=r.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:i(()=>T!==null?T:(w!==r.namespaces&&(w=r.namespaces,S=r.enabled(P)),S),"get"),set:i(E=>{T=E},"set")}),typeof r.init=="function"&&r.init(D),D}i(r,"createDebug");function n(P,x){let T=r(this.namespace+(typeof x>"u"?":":x)+P);return T.log=this.log,T}i(n,"extend");function o(P){r.save(P),r.namespaces=P,r.names=[],r.skips=[];let x=(typeof P=="string"?P:"").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(P,x){let T=0,w=0,S=-1,D=0;for(;T<P.length;)if(w<x.length&&(x[w]===P[T]||x[w]==="*"))x[w]==="*"?(S=w,D=T,w++):(T++,w++);else if(S!==-1)w=S+1,D++,T=D;else return!1;for(;w<x.length&&x[w]==="*";)w++;return w===x.length}i(s,"matchesTemplate");function p(){let P=[...r.names,...r.skips.map(x=>"-"+x)].join(",");return r.enable(""),P}i(p,"disable");function m(P){for(let x of r.skips)if(s(P,x))return!1;for(let x of r.names)if(s(P,x))return!0;return!1}i(m,"enabled");function h(P){return P instanceof Error?P.stack||P.message:P}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(uN,"setup");TP.exports=uN});var SP=L((Mt,lu)=>{Mt.formatArgs=lN;Mt.save=dN;Mt.load=pN;Mt.useColors=cN;Mt.storage=fN();Mt.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`."))}})();Mt.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 cN(){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(cN,"useColors");function lN(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+lu.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(lN,"formatArgs");Mt.log=console.debug||console.log||(()=>{});function dN(t){try{t?Mt.storage.setItem("debug",t):Mt.storage.removeItem("debug")}catch{}}i(dN,"save");function pN(){let t;try{t=Mt.storage.getItem("debug")||Mt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}i(pN,"load");function fN(){try{return localStorage}catch{}}i(fN,"localstorage");lu.exports=$d()(Mt);var{formatters:mN}=lu.exports;mN.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var EP=L((DY,xP)=>{"use strict";xP.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 RP=L(($Y,AP)=>{"use strict";var hN=require("os"),IP=require("tty"),dr=EP(),{env:Et}=process,Bn;dr("no-color")||dr("no-colors")||dr("color=false")||dr("color=never")?Bn=0:(dr("color")||dr("colors")||dr("color=true")||dr("color=always"))&&(Bn=1);"FORCE_COLOR"in Et&&(Et.FORCE_COLOR==="true"?Bn=1:Et.FORCE_COLOR==="false"?Bn=0:Bn=Et.FORCE_COLOR.length===0?1:Math.min(parseInt(Et.FORCE_COLOR,10),3));function Od(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}i(Od,"translateLevel");function Cd(t,e){if(Bn===0)return 0;if(dr("color=16m")||dr("color=full")||dr("color=truecolor"))return 3;if(dr("color=256"))return 2;if(t&&!e&&Bn===void 0)return 0;let r=Bn||0;if(Et.TERM==="dumb")return r;if(process.platform==="win32"){let n=hN.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Et)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in Et)||Et.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in Et)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Et.TEAMCITY_VERSION)?1:0;if(Et.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Et){let n=parseInt((Et.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Et.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Et.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Et.TERM)||"COLORTERM"in Et?1:r}i(Cd,"supportsColor");function gN(t){let e=Cd(t,t&&t.isTTY);return Od(e)}i(gN,"getSupportLevel");AP.exports={supportsColor:gN,stdout:Od(Cd(!0,IP.isatty(1))),stderr:Od(Cd(!0,IP.isatty(2)))}});var $P=L((It,pu)=>{var yN=require("tty"),du=require("util");It.init=SN;It.log=wN;It.formatArgs=_N;It.save=bN;It.load=TN;It.useColors=vN;It.destroy=du.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");It.colors=[6,2,3,4,5,1];try{let t=RP();t&&(t.stderr||t).level>=2&&(It.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{}It.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 vN(){return"colors"in It.inspectOpts?!!It.inspectOpts.colors:yN.isatty(process.stderr.fd)}i(vN,"useColors");function _N(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 R0=Object.create;var Ui=Object.defineProperty;var D0=Object.getOwnPropertyDescriptor;var $0=Object.getOwnPropertyNames;var O0=Object.getPrototypeOf,C0=Object.prototype.hasOwnProperty;var o=(t,e)=>Ui(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}},Es=(t,e)=>{for(var r in e)Ui(t,r,{get:e[r],enumerable:!0})},Uh=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $0(e))!C0.call(t,i)&&i!==r&&Ui(t,i,{get:()=>e[i],enumerable:!(n=D0(e,i))||n.enumerable});return t};var ue=(t,e,r)=>(r=t!=null?R0(O0(t)):{},Uh(e||!t||!t.__esModule?Ui(r,"default",{value:t,enumerable:!0}):r,t)),N0=t=>Uh(Ui({},"__esModule",{value:!0}),t);var uy=L((sy,Ws)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",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(w,S){if(w.indexOf("::")!==w.lastIndexOf("::"))return null;let D=0,E=-1,u=(w.match(m.zoneIndex)||[])[0],f,c;for(u&&(u=u.substring(1),w=w.replace(/%.+$/,""));(E=w.indexOf(":",E+1))>=0;)D++;if(w.substr(0,2)==="::"&&D--,w.substr(-2,2)==="::"&&D--,D>S)return null;for(c=S-D,f=":";c--;)f+="0:";return w=w.replace("::",f),w[0]===":"&&(w=w.slice(1)),w[w.length-1]===":"&&(w=w.slice(0,-1)),S=(function(){let y=w.split(":"),l=[];for(let b=0;b<y.length;b++)l.push(parseInt(y[b],16));return l})(),{parts:S,zoneId:u}}o(h,"expandIPv6");function v(w,S,D,E){if(w.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),w[u]>>f!==S[u]>>f)return!1;E-=D,u+=1}return!0}o(v,"matchCIDR");function _(w){if(i.test(w))return parseInt(w,16);if(w[0]==="0"&&!isNaN(parseInt(w[1],10))){if(n.test(w))return parseInt(w,8);throw new Error(`ipaddr: cannot parse ${w} as octal`)}return parseInt(w,10)}o(_,"parseIntAuto");function x(w,S){for(;w.length<S;)w=`0${w}`;return w}o(x,"padPart");let T={};T.IPv4=(function(){function w(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 o(w,"IPv4"),w.prototype.SpecialRanges={unspecified:[[new w([0,0,0,0]),8]],broadcast:[[new w([255,255,255,255]),32]],multicast:[[new w([224,0,0,0]),4]],linkLocal:[[new w([169,254,0,0]),16]],loopback:[[new w([127,0,0,0]),8]],carrierGradeNat:[[new w([100,64,0,0]),10]],private:[[new w([10,0,0,0]),8],[new w([172,16,0,0]),12],[new w([192,168,0,0]),16]],reserved:[[new w([192,0,0,0]),24],[new w([192,0,2,0]),24],[new w([192,88,99,0]),24],[new w([198,18,0,0]),15],[new w([198,51,100,0]),24],[new w([203,0,113,0]),24],[new w([240,0,0,0]),4]],as112:[[new w([192,175,48,0]),24],[new w([192,31,196,0]),24]],amt:[[new w([192,52,193,0]),24]]},w.prototype.kind=function(){return"ipv4"},w.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)},w.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},w.prototype.range=function(){return T.subnetMatch(this,this.SpecialRanges)},w.prototype.toByteArray=function(){return this.octets.slice(0)},w.prototype.toIPv4MappedAddress=function(){return T.IPv6.parse(`::ffff:${this.toString()}`)},w.prototype.toNormalizedString=function(){return this.toString()},w.prototype.toString=function(){return this.octets.join(".")},w})(),T.IPv4.broadcastAddressFromCIDR=function(w){try{let S=this.parseCIDR(w),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(w){return this.parser(w)!==null},T.IPv4.isValid=function(w){try{return new this(this.parser(w)),!0}catch{return!1}},T.IPv4.isValidCIDR=function(w){try{return this.parseCIDR(w),!0}catch{return!1}},T.IPv4.isValidFourPartDecimal=function(w){return!!(T.IPv4.isValid(w)&&w.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},T.IPv4.isValidCIDRFourPartDecimal=function(w){let S=w.match(/^(.+)\/(\d+)$/);return!T.IPv4.isValidCIDR(w)||!S?!1:T.IPv4.isValidFourPartDecimal(S[1])},T.IPv4.networkAddressFromCIDR=function(w){let S,D,E,u,f;try{for(S=this.parseCIDR(w),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(w){let S=this.parser(w);if(S===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(S)},T.IPv4.parseCIDR=function(w){let S;if(S=w.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:o(function(){return this.join("/")},"value")}),E}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},T.IPv4.parser=function(w){let S,D,E;if(S=w.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=w.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=w.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=w.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(w){if(w=parseInt(w),w<0||w>32)throw new Error("ipaddr: invalid IPv4 prefix length");let S=[0,0,0,0],D=0,E=Math.floor(w/8);for(;D<E;)S[D]=255,D++;return E<4&&(S[E]=Math.pow(2,w%8)-1<<8-w%8),new this(S)},T.IPv6=(function(){function w(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 o(w,"IPv6"),w.prototype.SpecialRanges={unspecified:[new w([0,0,0,0,0,0,0,0]),128],linkLocal:[new w([65152,0,0,0,0,0,0,0]),10],multicast:[new w([65280,0,0,0,0,0,0,0]),8],loopback:[new w([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new w([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new w([0,0,0,0,0,65535,0,0]),96],discard:[new w([256,0,0,0,0,0,0,0]),64],rfc6145:[new w([0,0,0,0,65535,0,0,0]),96],rfc6052:[new w([100,65435,0,0,0,0,0,0]),96],"6to4":[new w([8194,0,0,0,0,0,0,0]),16],teredo:[new w([8193,0,0,0,0,0,0,0]),32],benchmarking:[new w([8193,2,0,0,0,0,0,0]),48],amt:[new w([8193,3,0,0,0,0,0,0]),32],as112v6:[[new w([8193,4,274,0,0,0,0,0]),48],[new w([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new w([8193,16,0,0,0,0,0,0]),28],orchid2:[new w([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new w([8193,48,0,0,0,0,0,0]),28],reserved:[[new w([8193,0,0,0,0,0,0,0]),23],[new w([8193,3512,0,0,0,0,0,0]),32]]},w.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},w.prototype.kind=function(){return"ipv6"},w.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)},w.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},w.prototype.range=function(){return T.subnetMatch(this,this.SpecialRanges)},w.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},w.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},w.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])},w.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},w.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)}`},w.prototype.toString=function(){return this.toRFC5952String()},w})(),T.IPv6.broadcastAddressFromCIDR=function(w){try{let S=this.parseCIDR(w),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(w){return this.parser(w)!==null},T.IPv6.isValid=function(w){if(typeof w=="string"&&w.indexOf(":")===-1)return!1;try{let S=this.parser(w);return new this(S.parts,S.zoneId),!0}catch{return!1}},T.IPv6.isValidCIDR=function(w){if(typeof w=="string"&&w.indexOf(":")===-1)return!1;try{return this.parseCIDR(w),!0}catch{return!1}},T.IPv6.networkAddressFromCIDR=function(w){let S,D,E,u,f;try{for(S=this.parseCIDR(w),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(w){let S=this.parser(w);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(w){let S,D,E;if((D=w.match(/^(.+)\/(\d+)$/))&&(S=parseInt(D[2]),S>=0&&S<=128))return E=[this.parse(D[1]),S],Object.defineProperty(E,"toString",{value:o(function(){return this.join("/")},"value")}),E;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},T.IPv6.parser=function(w){let S,D,E,u,f,c;if(E=w.match(m.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(m.native.test(w))return h(w,8);if((E=w.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(w){if(w=parseInt(w),w<0||w>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(w/8);for(;D<E;)S[D]=255,D++;return E<16&&(S[E]=Math.pow(2,w%8)-1<<8-w%8),new this(S)},T.fromByteArray=function(w){let S=w.length;if(S===4)return new T.IPv4(w);if(S===16)return new T.IPv6(w);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},T.isValid=function(w){return T.IPv6.isValid(w)||T.IPv4.isValid(w)},T.isValidCIDR=function(w){return T.IPv6.isValidCIDR(w)||T.IPv4.isValidCIDR(w)},T.parse=function(w){if(T.IPv6.isValid(w))return T.IPv6.parse(w);if(T.IPv4.isValid(w))return T.IPv4.parse(w);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},T.parseCIDR=function(w){try{return T.IPv6.parseCIDR(w)}catch{try{return T.IPv4.parseCIDR(w)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},T.process=function(w){let S=this.parse(w);return S.kind()==="ipv6"&&S.isIPv4MappedAddress()?S.toIPv4Address():S},T.subnetMatch=function(w,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],w.kind()===c[0].kind()&&w.match.apply(w,c))return u}return D},typeof Ws<"u"&&Ws.exports?Ws.exports=T:t.ipaddr=T})(sy)});var lv=L((f9,cv)=>{var uv=require("stream").Stream,vO=require("util");cv.exports=Tr;function Tr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(Tr,"DelayedStream");vO.inherits(Tr,uv);Tr.create=function(t,e){var r=new this;e=e||{};for(var n in e)r[n]=e[n];r.source=t;var i=t.emit;return t.emit=function(){return r._handleEmit(arguments),i.apply(t,arguments)},t.on("error",function(){}),r.pauseStream&&t.pause(),r};Object.defineProperty(Tr.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});Tr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Tr.prototype.resume=function(){this._released||this.release(),this.source.resume()};Tr.prototype.pause=function(){this.source.pause()};Tr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};Tr.prototype.pipe=function(){var t=uv.prototype.pipe.apply(this,arguments);return this.resume(),t};Tr.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)};Tr.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 mv=L((h9,fv)=>{var _O=require("util"),pv=require("stream").Stream,dv=lv();fv.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}o(pt,"CombinedStream");_O.inherits(pt,pv);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 dv)){var r=dv.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 pv.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 gv=L((y9,hv)=>{"use strict";hv.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(Ut=>{"use strict";var Qs=gv(),PO=require("path").extname,yv=/^\s*([^;\s]*)(?:;|\s|$)/,wO=/^text\//i;Ut.charset=vv;Ut.charsets={lookup:vv};Ut.contentType=bO;Ut.extension=TO;Ut.extensions=Object.create(null);Ut.lookup=SO;Ut.types=Object.create(null);xO(Ut.extensions,Ut.types);function vv(t){if(!t||typeof t!="string")return!1;var e=yv.exec(t),r=e&&Qs[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&wO.test(e[1])?"UTF-8":!1}o(vv,"charset");function bO(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Ut.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Ut.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(bO,"contentType");function TO(t){if(!t||typeof t!="string")return!1;var e=yv.exec(t),r=e&&Ut.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(TO,"extension");function SO(t){if(!t||typeof t!="string")return!1;var e=PO("x."+t).toLowerCase().substr(1);return e&&Ut.types[e]||!1}o(SO,"lookup");function xO(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(Qs).forEach(o(function(i){var s=Qs[i],d=s.extensions;if(!(!d||!d.length)){t[i]=d;for(var m=0;m<d.length;m++){var h=d[m];if(e[h]){var v=r.indexOf(Qs[e[h]].source),_=r.indexOf(s.source);if(e[h]!=="application/octet-stream"&&(v>_||v===_&&e[h].substr(0,12)==="application/"))continue}e[h]=i}}},"forEachMimeType"))}o(xO,"populateMaps")});var Pv=L((P9,_v)=>{_v.exports=EO;function EO(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(EO,"defer")});var sd=L((b9,bv)=>{var wv=Pv();bv.exports=IO;function IO(t){var e=!1;return wv(function(){e=!0}),o(function(n,i){e?t(n,i):wv(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(IO,"async")});var ud=L((S9,Tv)=>{Tv.exports=AO;function AO(t){Object.keys(t.jobs).forEach(RO.bind(t)),t.jobs={}}o(AO,"abort");function RO(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(RO,"clean")});var cd=L((E9,xv)=>{var Sv=sd(),DO=ud();xv.exports=$O;function $O(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=OO(e,i,t[i],function(s,d){i in r.jobs&&(delete r.jobs[i],s?DO(r):r.results[i]=d,n(s,r.results))})}o($O,"iterate");function OO(t,e,r,n){var i;return t.length==2?i=t(r,Sv(n)):i=t(r,e,Sv(n)),i}o(OO,"runJob")});var ld=L((A9,Ev)=>{Ev.exports=CO;function CO(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};return e&&n.keyedList.sort(r?e:function(i,s){return e(t[i],t[s])}),n}o(CO,"state")});var dd=L((D9,Iv)=>{var NO=ud(),zO=sd();Iv.exports=kO;function kO(t){Object.keys(this.jobs).length&&(this.index=this.size,NO(this),zO(t)(null,this.results))}o(kO,"terminator")});var Rv=L((O9,Av)=>{var UO=cd(),MO=ld(),FO=dd();Av.exports=LO;function LO(t,e,r){for(var n=MO(t);n.index<(n.keyedList||t).length;)UO(t,e,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return FO.bind(n,r)}o(LO,"parallel")});var pd=L((N9,eu)=>{var Dv=cd(),jO=ld(),qO=dd();eu.exports=BO;eu.exports.ascending=$v;eu.exports.descending=VO;function BO(t,e,r,n){var i=jO(t,r);return Dv(t,e,i,o(function s(d,m){if(d){n(d,m);return}if(i.index++,i.index<(i.keyedList||t).length){Dv(t,e,i,s);return}n(null,i.results)},"iteratorHandler")),qO.bind(i,n)}o(BO,"serialOrdered");function $v(t,e){return t<e?-1:t>e?1:0}o($v,"ascending");function VO(t,e){return-1*$v(t,e)}o(VO,"descending")});var Cv=L((k9,Ov)=>{var GO=pd();Ov.exports=HO;function HO(t,e,r){return GO(t,e,null,r)}o(HO,"serial")});var zv=L((M9,Nv)=>{Nv.exports={parallel:Rv(),serial:Cv(),serialOrdered:pd()}});var fd=L((F9,kv)=>{"use strict";kv.exports=Object});var Mv=L((L9,Uv)=>{"use strict";Uv.exports=Error});var Lv=L((j9,Fv)=>{"use strict";Fv.exports=EvalError});var qv=L((q9,jv)=>{"use strict";jv.exports=RangeError});var Vv=L((B9,Bv)=>{"use strict";Bv.exports=ReferenceError});var Hv=L((V9,Gv)=>{"use strict";Gv.exports=SyntaxError});var jn=L((G9,Wv)=>{"use strict";Wv.exports=TypeError});var Kv=L((H9,Zv)=>{"use strict";Zv.exports=URIError});var Yv=L((W9,Jv)=>{"use strict";Jv.exports=Math.abs});var Qv=L((Z9,Xv)=>{"use strict";Xv.exports=Math.floor});var t_=L((K9,e_)=>{"use strict";e_.exports=Math.max});var n_=L((J9,r_)=>{"use strict";r_.exports=Math.min});var i_=L((Y9,o_)=>{"use strict";o_.exports=Math.pow});var s_=L((X9,a_)=>{"use strict";a_.exports=Math.round});var c_=L((Q9,u_)=>{"use strict";u_.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var d_=L((tY,l_)=>{"use strict";var WO=c_();l_.exports=o(function(e){return WO(e)||e===0?e:e<0?-1:1},"sign")});var f_=L((nY,p_)=>{"use strict";p_.exports=Object.getOwnPropertyDescriptor});var md=L((oY,m_)=>{"use strict";var tu=f_();if(tu)try{tu([],"length")}catch{tu=null}m_.exports=tu});var g_=L((iY,h_)=>{"use strict";var ru=Object.defineProperty||!1;if(ru)try{ru({},"a",{value:1})}catch{ru=!1}h_.exports=ru});var hd=L((aY,y_)=>{"use strict";y_.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var 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!==i||m.enumerable!==!0)return!1}return!0},"hasSymbols")});var P_=L((uY,__)=>{"use strict";var v_=typeof Symbol<"u"&&Symbol,ZO=hd();__.exports=o(function(){return typeof v_!="function"||typeof Symbol!="function"||typeof v_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ZO()},"hasNativeSymbols")});var gd=L((lY,w_)=>{"use strict";w_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var yd=L((dY,b_)=>{"use strict";var KO=fd();b_.exports=KO.getPrototypeOf||null});var x_=L((pY,S_)=>{"use strict";var JO="Function.prototype.bind called on incompatible ",YO=Object.prototype.toString,XO=Math.max,QO="[object Function]",T_=o(function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},"concatty"),eC=o(function(e,r){for(var n=[],i=r||0,s=0;i<e.length;i+=1,s+=1)n[s]=e[i];return n},"slicy"),tC=o(function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r},"joiny");S_.exports=o(function(e){var r=this;if(typeof r!="function"||YO.apply(r)!==QO)throw new TypeError(JO+r);for(var n=eC(arguments,1),i,s=o(function(){if(this instanceof i){var _=r.apply(this,T_(n,arguments));return Object(_)===_?_:this}return r.apply(e,T_(n,arguments))},"binder"),d=XO(0,r.length-n.length),m=[],h=0;h<d;h++)m[h]="$"+h;if(i=Function("binder","return function ("+tC(m,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var v=o(function(){},"Empty");v.prototype=r.prototype,i.prototype=new v,v.prototype=null}return i},"bind")});var Ko=L((mY,E_)=>{"use strict";var rC=x_();E_.exports=Function.prototype.bind||rC});var nu=L((hY,I_)=>{"use strict";I_.exports=Function.prototype.call});var vd=L((gY,A_)=>{"use strict";A_.exports=Function.prototype.apply});var D_=L((yY,R_)=>{"use strict";R_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var O_=L((vY,$_)=>{"use strict";var nC=Ko(),oC=vd(),iC=nu(),aC=D_();$_.exports=aC||nC.call(iC,oC)});var _d=L((_Y,C_)=>{"use strict";var sC=Ko(),uC=jn(),cC=nu(),lC=O_();C_.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new uC("a function is required");return lC(sC,cC,e)},"callBindBasic")});var F_=L((wY,M_)=>{"use strict";var dC=_d(),N_=md(),k_;try{k_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Pd=!!k_&&N_&&N_(Object.prototype,"__proto__"),U_=Object,z_=U_.getPrototypeOf;M_.exports=Pd&&typeof Pd.get=="function"?dC([Pd.get]):typeof z_=="function"?o(function(e){return z_(e==null?e:U_(e))},"getDunder"):!1});var V_=L((TY,B_)=>{"use strict";var L_=gd(),j_=yd(),q_=F_();B_.exports=L_?o(function(e){return L_(e)},"getProto"):j_?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return j_(e)},"getProto"):q_?o(function(e){return q_(e)},"getProto"):null});var wd=L((xY,G_)=>{"use strict";var pC=Function.prototype.call,fC=Object.prototype.hasOwnProperty,mC=Ko();G_.exports=mC.call(pC,fC)});var ua=L((EY,Y_)=>{"use strict";var Le,hC=fd(),gC=Mv(),yC=Lv(),vC=qv(),_C=Vv(),Qo=Hv(),Xo=jn(),PC=Kv(),wC=Yv(),bC=Qv(),TC=t_(),SC=n_(),xC=i_(),EC=s_(),IC=d_(),K_=Function,bd=o(function(t){try{return K_('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),ia=md(),AC=g_(),Td=o(function(){throw new Xo},"throwTypeError"),RC=ia?(function(){try{return arguments.callee,Td}catch{try{return ia(arguments,"callee").get}catch{return Td}}})():Td,Jo=P_()(),Et=V_(),DC=yd(),$C=gd(),J_=vd(),aa=nu(),Yo={},OC=typeof Uint8Array>"u"||!Et?Le:Et(Uint8Array),co={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Le:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Le:ArrayBuffer,"%ArrayIteratorPrototype%":Jo&&Et?Et([][Symbol.iterator]()):Le,"%AsyncFromSyncIteratorPrototype%":Le,"%AsyncFunction%":Yo,"%AsyncGenerator%":Yo,"%AsyncGeneratorFunction%":Yo,"%AsyncIteratorPrototype%":Yo,"%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%":gC,"%eval%":eval,"%EvalError%":yC,"%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%":K_,"%GeneratorFunction%":Yo,"%Int8Array%":typeof Int8Array>"u"?Le:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Le:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Le:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Jo&&Et?Et(Et([][Symbol.iterator]())):Le,"%JSON%":typeof JSON=="object"?JSON:Le,"%Map%":typeof Map>"u"?Le:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Jo||!Et?Le:Et(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":hC,"%Object.getOwnPropertyDescriptor%":ia,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Le:Promise,"%Proxy%":typeof Proxy>"u"?Le:Proxy,"%RangeError%":vC,"%ReferenceError%":_C,"%Reflect%":typeof Reflect>"u"?Le:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Le:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Jo||!Et?Le:Et(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Le:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Jo&&Et?Et(""[Symbol.iterator]()):Le,"%Symbol%":Jo?Symbol:Le,"%SyntaxError%":Qo,"%ThrowTypeError%":RC,"%TypedArray%":OC,"%TypeError%":Xo,"%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%":PC,"%WeakMap%":typeof WeakMap>"u"?Le:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Le:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Le:WeakSet,"%Function.prototype.call%":aa,"%Function.prototype.apply%":J_,"%Object.defineProperty%":AC,"%Object.getPrototypeOf%":DC,"%Math.abs%":wC,"%Math.floor%":bC,"%Math.max%":TC,"%Math.min%":SC,"%Math.pow%":xC,"%Math.round%":EC,"%Math.sign%":IC,"%Reflect.getPrototypeOf%":$C};if(Et)try{null.error}catch(t){H_=Et(Et(t)),co["%Error.prototype%"]=H_}var H_,CC=o(function t(e){var r;if(e==="%AsyncFunction%")r=bd("async function () {}");else if(e==="%GeneratorFunction%")r=bd("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=bd("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Et&&(r=Et(i.prototype))}return co[e]=r,r},"doEval"),W_={__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"]},sa=Ko(),ou=wd(),NC=sa.call(aa,Array.prototype.concat),zC=sa.call(J_,Array.prototype.splice),Z_=sa.call(aa,String.prototype.replace),iu=sa.call(aa,String.prototype.slice),kC=sa.call(aa,RegExp.prototype.exec),UC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,MC=/\\(\\)?/g,FC=o(function(e){var r=iu(e,0,1),n=iu(e,-1);if(r==="%"&&n!=="%")throw new Qo("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Qo("invalid intrinsic syntax, expected opening `%`");var i=[];return Z_(e,UC,function(s,d,m,h){i[i.length]=m?Z_(h,MC,"$1"):d||s}),i},"stringToPath"),LC=o(function(e,r){var n=e,i;if(ou(W_,n)&&(i=W_[n],n="%"+i[0]+"%"),ou(co,n)){var s=co[n];if(s===Yo&&(s=CC(n)),typeof s>"u"&&!r)throw new Xo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Qo("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");Y_.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new Xo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xo('"allowMissing" argument must be a boolean');if(kC(/^%?[^%]*%?$/,e)===null)throw new Qo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=FC(e),i=n.length>0?n[0]:"",s=LC("%"+i+"%",r),d=s.name,m=s.value,h=!1,v=s.alias;v&&(i=v[0],zC(n,NC([0,1],v)));for(var _=1,x=!0;_<n.length;_+=1){var T=n[_],w=iu(T,0,1),S=iu(T,-1);if((w==='"'||w==="'"||w==="`"||S==='"'||S==="'"||S==="`")&&w!==S)throw new Qo("property names with quotes must have matching quotes");if((T==="constructor"||!x)&&(h=!0),i+="."+T,d="%"+i+"%",ou(co,d))m=co[d];else if(m!=null){if(!(T in m)){if(!r)throw new Xo("base intrinsic for "+e+" exists, but the property is not available.");return}if(ia&&_+1>=n.length){var D=ia(m,T);x=!!D,x&&"get"in D&&!("originalValue"in D.get)?m=D.get:m=m[T]}else x=ou(m,T),m=m[T];x&&!h&&(co[d]=m)}}return m},"GetIntrinsic")});var Q_=L((AY,X_)=>{"use strict";var jC=hd();X_.exports=o(function(){return jC()&&!!Symbol.toStringTag},"hasToStringTagShams")});var rP=L((DY,tP)=>{"use strict";var qC=ua(),eP=qC("%Object.defineProperty%",!0),BC=Q_()(),VC=wd(),GC=jn(),au=BC?Symbol.toStringTag:null;tP.exports=o(function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new GC("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");au&&(n||!VC(e,au))&&(eP?eP(e,au,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[au]=r)},"setToStringTag")});var oP=L((OY,nP)=>{"use strict";var HC=Function.prototype.call,WC=Object.prototype.hasOwnProperty,ZC=Ko();nP.exports=ZC.call(HC,WC)});var aP=L((CY,iP)=>{"use strict";iP.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var ca=L((NY,uP)=>{"use strict";var Id=mv(),KC=require("util"),Sd=require("path"),JC=require("http"),YC=require("https"),XC=require("url").parse,QC=require("fs"),eN=require("stream").Stream,tN=require("crypto"),xd=mn(),rN=zv(),nN=rP(),qn=oP(),Ed=aP();function sP(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(sP,"escapeHeaderParam");function He(t){if(!(this instanceof He))return new He(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Id.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(He,"FormData");KC.inherits(He,Id);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=Id.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r),s=this._multiPartFooter();n(i),n(e),n(s),this._trackLength(i,e,r)};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 eN))&&(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)):QC.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):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),i=this._getContentType(e,r),s="",d={"Content-Disposition":["form-data",'name="'+sP(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&Ed(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=Sd.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=Sd.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&qn(t,"httpVersion")&&(r=Sd.basename(t.client._httpMessage.path||"")),r)return'filename="'+sP(r)+'"'};He.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=xd.lookup(t.name)),!r&&t&&t.path&&(r=xd.lookup(t.path)),!r&&t&&t.readable&&qn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=xd.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="--------------------------"+tN.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}rN.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};He.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=XC(t),n=Ed({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=Ed(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=YC.request(n):r=JC.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=o(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]"};nN(He.prototype,"FormData");uP.exports=He});var la=L((rX,vP)=>{"use strict";var su=Object.prototype.hasOwnProperty,yP=Object.prototype.toString,dP=Object.defineProperty,pP=Object.getOwnPropertyDescriptor,fP=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):yP.call(e)==="[object Array]"},"isArray"),mP=o(function(e){if(!e||yP.call(e)!=="[object Object]")return!1;var r=su.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&su.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||su.call(e,i)},"isPlainObject"),hP=o(function(e,r){dP&&r.name==="__proto__"?dP(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),gP=o(function(e,r){if(r==="__proto__")if(su.call(e,r)){if(pP)return pP(e,r).value}else return;return e[r]},"getProperty");vP.exports=o(function t(){var e,r,n,i,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=gP(m,r),i=gP(e,r),m!==i&&(_&&i&&(mP(i)||(s=fP(i)))?(s?(s=!1,d=n&&fP(n)?n:[]):d=n&&mP(n)?n:{},hP(m,{name:r,newValue:t(_,d,i)})):typeof i<"u"&&hP(m,{name:r,newValue:i}));return m},"extend")});var _P=L((oX,pN)=>{pN.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 wP=L((iX,PP)=>{"use strict";var fN=_P();PP.exports={pkg:fN}});var Dd=L(lr=>{"use strict";var TP=lr&&lr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lr,"__esModule",{value:!0});lr.GaxiosError=lr.GAXIOS_ERROR_SYMBOL=void 0;lr.defaultErrorRedactor=SP;var bP=TP(la()),mN=TP(wP()),Ad=mN.default.pkg;lr.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Ad.name}-gaxios-error`);var Rd=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[lr.GAXIOS_ERROR_SYMBOL]=Ad.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&lr.GAXIOS_ERROR_SYMBOL in e&&e[lr.GAXIOS_ERROR_SYMBOL]===Ad.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,r,n,i){if(super(e,{cause:i}),this.config=r,this.response=n,this.error=i instanceof Error?i:void 0,this.config=(0,bP.default)(!0,{},r),this.response&&(this.response.config=(0,bP.default)(!0,{},this.response.config)),this.response){try{this.response.data=hN(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,r="The request failed"){let n=r;if(typeof e.data=="string"&&(n=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){n="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:n;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,s="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let 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:i},e.data.error)}return Object.assign({message:n,code:s,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};lr.GaxiosError=Rd;function hN(t,e){switch(t){case"stream":return e;case"json":return JSON.parse(JSON.stringify(e));case"arraybuffer":return JSON.parse(Buffer.from(e).toString("utf8"));case"blob":return JSON.parse(e.text());default:return e}}o(hN,"translateData");function SP(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)})}o(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)}}o(n,"redactString");function i(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 o(i,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),i(t.config.data),n(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(SP({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(SP,"defaultErrorRedactor")});var EP=L($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.getRetryConfig=gN;async function gN(t){let e=xP(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||yN)(t))return{shouldRetry:!1,config:t.config};let i=vN(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,i):new Promise(d=>{setTimeout(d,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}o(gN,"getRetryConfig");function yN(t){let e=xP(t);if(t.config.signal?.aborted&&t.code!=="TimeoutError"||t.code==="AbortError"||!e||e.retry===0||!t.response&&(e.currentRetryAttempt||0)>=e.noResponseRetries||!e.httpMethodsToRetry||!e.httpMethodsToRetry.includes(t.config.method?.toUpperCase()||"GET"))return!1;if(t.response&&t.response.status){let r=!1;for(let[n,i]of e.statusCodesToRetry){let s=t.response.status;if(s>=n&&s<=i){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}o(yN,"shouldRetryRequest");function xP(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(xP,"getConfig");function vN(t){let r=(t.currentRetryAttempt?0:t.retryDelay??100)+(Math.pow(t.retryDelayMultiplier,t.currentRetryAttempt)-1)/2*1e3,n=t.totalTimeout-(Date.now()-t.timeOfFirstRequest);return Math.min(r,n,t.maxRetryDelay)}o(vN,"getNextRetryDelay")});var Cd=L(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.GaxiosInterceptorManager=void 0;var Od=class extends Set{static{o(this,"GaxiosInterceptorManager")}};uu.GaxiosInterceptorManager=Od});var AP=L((pX,IP)=>{var ei=1e3,ti=ei*60,ri=ti*60,lo=ri*24,_N=lo*7,PN=lo*365.25;IP.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return wN(t);if(r==="number"&&isFinite(t))return e.long?TN(t):bN(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function wN(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*PN;case"weeks":case"week":case"w":return r*_N;case"days":case"day":case"d":return r*lo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ri;case"minutes":case"minute":case"mins":case"min":case"m":return r*ti;case"seconds":case"second":case"secs":case"sec":case"s":return r*ei;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(wN,"parse");function bN(t){var e=Math.abs(t);return e>=lo?Math.round(t/lo)+"d":e>=ri?Math.round(t/ri)+"h":e>=ti?Math.round(t/ti)+"m":e>=ei?Math.round(t/ei)+"s":t+"ms"}o(bN,"fmtShort");function TN(t){var e=Math.abs(t);return e>=lo?cu(t,e,lo,"day"):e>=ri?cu(t,e,ri,"hour"):e>=ti?cu(t,e,ti,"minute"):e>=ei?cu(t,e,ei,"second"):t+" ms"}o(TN,"fmtLong");function cu(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(cu,"plural")});var Nd=L((mX,RP)=>{function SN(t){r.debug=r,r.default=r,r.coerce=h,r.disable=d,r.enable=i,r.enabled=m,r.humanize=AP(),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]}o(e,"selectColor"),r.selectColor=e;function r(_){let x,T=null,w,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 ie=r.formatters[g];if(typeof ie=="function"){let ne=E[y];b=ie.call(u,ne),E.splice(y,1),y--}return b}),r.formatArgs.call(u,E),(u.log||r.log).apply(u,E)}return o(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:o(()=>T!==null?T:(w!==r.namespaces&&(w=r.namespaces,S=r.enabled(_)),S),"get"),set:o(E=>{T=E},"set")}),typeof r.init=="function"&&r.init(D),D}o(r,"createDebug");function n(_,x){let T=r(this.namespace+(typeof x>"u"?":":x)+_);return T.log=this.log,T}o(n,"extend");function i(_){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)}o(i,"enable");function s(_,x){let T=0,w=0,S=-1,D=0;for(;T<_.length;)if(w<x.length&&(x[w]===_[T]||x[w]==="*"))x[w]==="*"?(S=w,D=T,w++):(T++,w++);else if(S!==-1)w=S+1,D++,T=D;else return!1;for(;w<x.length&&x[w]==="*";)w++;return w===x.length}o(s,"matchesTemplate");function d(){let _=[...r.names,...r.skips.map(x=>"-"+x)].join(",");return r.enable(""),_}o(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}o(m,"enabled");function h(_){return _ instanceof Error?_.stack||_.message:_}o(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 o(v,"destroy"),r.enable(r.load()),r}o(SN,"setup");RP.exports=SN});var DP=L((Mt,lu)=>{Mt.formatArgs=EN;Mt.save=IN;Mt.load=AN;Mt.useColors=xN;Mt.storage=RN();Mt.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`."))}})();Mt.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 xN(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(xN,"useColors");function EN(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+lu.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}o(EN,"formatArgs");Mt.log=console.debug||console.log||(()=>{});function IN(t){try{t?Mt.storage.setItem("debug",t):Mt.storage.removeItem("debug")}catch{}}o(IN,"save");function AN(){let t;try{t=Mt.storage.getItem("debug")||Mt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(AN,"load");function RN(){try{return localStorage}catch{}}o(RN,"localstorage");lu.exports=Nd()(Mt);var{formatters:DN}=lu.exports;DN.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var OP=L((yX,$P)=>{"use strict";$P.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var zP=L((vX,NP)=>{"use strict";var $N=require("os"),CP=require("tty"),dr=OP(),{env:It}=process,Bn;dr("no-color")||dr("no-colors")||dr("color=false")||dr("color=never")?Bn=0:(dr("color")||dr("colors")||dr("color=true")||dr("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 zd(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(zd,"translateLevel");function kd(t,e){if(Bn===0)return 0;if(dr("color=16m")||dr("color=full")||dr("color=truecolor"))return 3;if(dr("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=$N.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}o(kd,"supportsColor");function ON(t){let e=kd(t,t&&t.isTTY);return zd(e)}o(ON,"getSupportLevel");NP.exports={supportsColor:ON,stdout:zd(kd(!0,CP.isatty(1))),stderr:zd(kd(!0,CP.isatty(2)))}});var UP=L((At,pu)=>{var CN=require("tty"),du=require("util");At.init=LN;At.log=UN;At.formatArgs=zN;At.save=MN;At.load=FN;At.useColors=NN;At.destroy=du.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=zP();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,(i,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function NN(){return"colors"in At.inspectOpts?!!At.inspectOpts.colors:CN.isatty(process.stderr.fd)}o(NN,"useColors");function zN(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
4
4
  `).join(`
5
- `+s),t.push(o+"m+"+pu.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=PN()+e+" "+t[0]}i(_N,"formatArgs");function PN(){return It.inspectOpts.hideDate?"":new Date().toISOString()+" "}i(PN,"getDate");function wN(...t){return process.stderr.write(du.formatWithOptions(It.inspectOpts,...t)+`
6
- `)}i(wN,"log");function bN(t){t?process.env.DEBUG=t:delete process.env.DEBUG}i(bN,"save");function TN(){return process.env.DEBUG}i(TN,"load");function SN(t){t.inspectOpts={};let e=Object.keys(It.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=It.inspectOpts[e[r]]}i(SN,"init");pu.exports=$d()(It);var{formatters:DP}=pu.exports;DP.o=function(t){return this.inspectOpts.colors=this.useColors,du.inspect(t,this.inspectOpts).split(`
7
- `).map(e=>e.trim()).join(" ")};DP.O=function(t){return this.inspectOpts.colors=this.useColors,du.inspect(t,this.inspectOpts)}});var kd=L((NY,Nd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Nd.exports=SP():Nd.exports=$P()});var NP=L(Ft=>{"use strict";var xN=Ft&&Ft.__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]})),EN=Ft&&Ft.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),OP=Ft&&Ft.__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)&&xN(e,t,r);return EN(e,t),e};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.req=Ft.json=Ft.toBuffer=void 0;var IN=OP(require("http")),AN=OP(require("https"));async function CP(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}i(CP,"toBuffer");Ft.toBuffer=CP;async function RN(t){let r=(await CP(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}i(RN,"json");Ft.json=RN;function DN(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?AN:IN).request(t,e),o=new Promise((s,p)=>{n.once("response",s).once("error",p).end()});return n.then=o.then.bind(o),n}i(DN,"req");Ft.req=DN});var MP=L(Kt=>{"use strict";var zP=Kt&&Kt.__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]})),$N=Kt&&Kt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),UP=Kt&&Kt.__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)&&zP(e,t,r);return $N(e,t),e},ON=Kt&&Kt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zP(e,t,r)};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.Agent=void 0;var CN=UP(require("net")),kP=UP(require("http")),NN=require("https");ON(NP(),Kt);var Mr=Symbol("AgentBaseInternalState"),zd=class extends kP.Agent{static{i(this,"Agent")}constructor(e){super(e),this[Mr]={}}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 CN.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)?NN.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let o={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(o),p=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,o)).then(m=>{if(this.decrementSockets(s,p),m instanceof kP.Agent)try{return m.addRequest(e,o)}catch(h){return n(h)}this[Mr].currentSocket=m,super.createSocket(e,r,n)},m=>{this.decrementSockets(s,p),n(m)})}createConnection(){let e=this[Mr].currentSocket;if(this[Mr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Mr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Mr]&&(this[Mr].defaultPort=e)}get protocol(){return this[Mr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Mr]&&(this[Mr].protocol=e)}};Kt.Agent=zd});var FP=L(to=>{"use strict";var kN=to&&to.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(to,"__esModule",{value:!0});to.parseProxyResponse=void 0;var zN=kN(kd()),fu=(0,zN.default)("https-proxy-agent:parse-proxy-response");function UN(t){return new Promise((e,r)=>{let n=0,o=[];function s(){let P=t.read();P?v(P):t.once("readable",s)}i(s,"read");function p(){t.removeListener("end",m),t.removeListener("error",h),t.removeListener("readable",s)}i(p,"cleanup");function m(){p(),fu("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}i(m,"onend");function h(P){p(),fu("onerror %o",P),r(P)}i(h,"onerror");function v(P){o.push(P),n+=P.length;let x=Buffer.concat(o,n),T=x.indexOf(`\r
5
+ `+s),t.push(i+"m+"+pu.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=kN()+e+" "+t[0]}o(zN,"formatArgs");function kN(){return At.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(kN,"getDate");function UN(...t){return process.stderr.write(du.formatWithOptions(At.inspectOpts,...t)+`
6
+ `)}o(UN,"log");function MN(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o(MN,"save");function FN(){return process.env.DEBUG}o(FN,"load");function LN(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]]}o(LN,"init");pu.exports=Nd()(At);var{formatters:kP}=pu.exports;kP.o=function(t){return this.inspectOpts.colors=this.useColors,du.inspect(t,this.inspectOpts).split(`
7
+ `).map(e=>e.trim()).join(" ")};kP.O=function(t){return this.inspectOpts.colors=this.useColors,du.inspect(t,this.inspectOpts)}});var Md=L((wX,Ud)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ud.exports=DP():Ud.exports=UP()});var LP=L(Ft=>{"use strict";var jN=Ft&&Ft.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qN=Ft&&Ft.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),MP=Ft&&Ft.__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)&&jN(e,t,r);return qN(e,t),e};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.req=Ft.json=Ft.toBuffer=void 0;var BN=MP(require("http")),VN=MP(require("https"));async function FP(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}o(FP,"toBuffer");Ft.toBuffer=FP;async function GN(t){let r=(await FP(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}o(GN,"json");Ft.json=GN;function HN(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?VN:BN).request(t,e),i=new Promise((s,d)=>{n.once("response",s).once("error",d).end()});return n.then=i.then.bind(i),n}o(HN,"req");Ft.req=HN});var VP=L(Kt=>{"use strict";var qP=Kt&&Kt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WN=Kt&&Kt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BP=Kt&&Kt.__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)&&qP(e,t,r);return WN(e,t),e},ZN=Kt&&Kt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qP(e,t,r)};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.Agent=void 0;var KN=BP(require("net")),jP=BP(require("http")),JN=require("https");ZN(LP(),Kt);var Mr=Symbol("AgentBaseInternalState"),Fd=class extends jP.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Mr]={}}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 KN.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],i=n.indexOf(r);i!==-1&&(n.splice(i,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?JN.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let i={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(i),d=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(m=>{if(this.decrementSockets(s,d),m instanceof jP.Agent)try{return m.addRequest(e,i)}catch(h){return n(h)}this[Mr].currentSocket=m,super.createSocket(e,r,n)},m=>{this.decrementSockets(s,d),n(m)})}createConnection(){let e=this[Mr].currentSocket;if(this[Mr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Mr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Mr]&&(this[Mr].defaultPort=e)}get protocol(){return this[Mr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Mr]&&(this[Mr].protocol=e)}};Kt.Agent=Fd});var GP=L(ni=>{"use strict";var YN=ni&&ni.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ni,"__esModule",{value:!0});ni.parseProxyResponse=void 0;var XN=YN(Md()),fu=(0,XN.default)("https-proxy-agent:parse-proxy-response");function QN(t){return new Promise((e,r)=>{let n=0,i=[];function s(){let _=t.read();_?v(_):t.once("readable",s)}o(s,"read");function d(){t.removeListener("end",m),t.removeListener("error",h),t.removeListener("readable",s)}o(d,"cleanup");function m(){d(),fu("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}o(m,"onend");function h(_){d(),fu("onerror %o",_),r(_)}o(h,"onerror");function v(_){i.push(_),n+=_.length;let x=Buffer.concat(i,n),T=x.indexOf(`\r
9
9
  \r
10
10
  `);if(T===-1){fu("have not received end of HTTP headers yet..."),s();return}let w=x.slice(0,T).toString("ascii").split(`\r
11
- `),S=w.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 w){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}fu("got proxy server response: %o %o",S,f),p(),e({connect:{statusCode:E,statusText:u,headers:f},buffered:x})}i(v,"ondata"),t.on("error",h),t.on("end",m),s()})}i(UN,"parseProxyResponse");to.parseProxyResponse=UN});var GP=L(pr=>{"use strict";var MN=pr&&pr.__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]})),FN=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BP=pr&&pr.__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)&&MN(e,t,r);return FN(e,t),e},VP=pr&&pr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pr,"__esModule",{value:!0});pr.HttpsProxyAgent=void 0;var mu=BP(require("net")),LP=BP(require("tls")),LN=VP(require("assert")),jN=VP(kd()),qN=MP(),BN=require("url"),VN=FP(),la=(0,jN.default)("https-proxy-agent"),jP=i(t=>t.servername===void 0&&t.host&&!mu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),hu=class extends qN.Agent{static{i(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new BN.URL(e):e,this.proxyHeaders=r?.headers??{},la("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?qP(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:"?(la("Creating `tls.Socket`: %o",this.connectOpts),o=LP.connect(jP(this.connectOpts))):(la("Creating `net.Socket`: %o",this.connectOpts),o=mu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},p=mu.isIPv6(r.host)?`[${r.host}]`:r.host,m=`CONNECT ${p}:${r.port} HTTP/1.1\r
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=`${p}:${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,VN.parseProxyResponse)(o);o.write(`${m}\r
14
- `);let{connect:v,buffered:P}=await h;if(e.emit("proxyConnect",v),this.emit("proxyConnect",v,e),v.statusCode===200)return e.once("socket",GN),r.secureEndpoint?(la("Upgrading socket connection to TLS"),LP.connect({...qP(jP(r),"host","path","port"),socket:o})):o;o.destroy();let x=new mu.Socket({writable:!1});return x.readable=!0,e.once("socket",T=>{la("Replaying proxy buffer for failed request"),(0,LN.default)(T.listenerCount("data")>0),T.push(P),T.push(null)}),x}};hu.protocols=["http","https"];pr.HttpsProxyAgent=hu;function GN(t){t.resume()}i(GN,"resume");function qP(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}i(qP,"omit")});function HN(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",p=s;for(let P=1;P<r.length;P++)r[P]==="base64"?o=!0:r[P]&&(p+=`;${r[P]}`,r[P].indexOf("charset=")===0&&(n=r[P].substring(8)));!r[0]&&!n.length&&(p+=";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=p,v.charset=n,v}var HP,WP=St(()=>{i(HN,"dataUriToBuffer");HP=HN});var KP=L((gu,ZP)=>{(function(t,e){typeof gu=="object"&&typeof ZP<"u"?e(gu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(gu,(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,d){try{Object.defineProperty(a,"name",{value:d,configurable:!0})}catch{}}i(o,"setFunctionName");let s=Promise,p=Promise.prototype.then,m=Promise.reject.bind(s);function h(a){return new s(a)}i(h,"newPromise");function v(a){return h(d=>d(a))}i(v,"promiseResolvedWith");function P(a){return m(a)}i(P,"promiseRejectedWith");function x(a,d,_){return p.call(a,d,_)}i(x,"PerformPromiseThen");function T(a,d,_){x(x(a,d,_),void 0,n)}i(T,"uponPromise");function w(a,d){T(a,d)}i(w,"uponFulfillment");function S(a,d){T(a,void 0,d)}i(S,"uponRejection");function D(a,d,_){return x(a,d,_)}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 d=v(void 0);u=i(_=>x(d,_),"_queueMicrotask")}return u(a)},"_queueMicrotask");function f(a,d,_){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,d,_)}i(f,"reflectCall");function c(a,d,_){try{return v(f(a,d,_))}catch(R){return P(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(d){let _=this._back,R=_;_._elements.length===y-1&&(R={_elements:[],_next:void 0}),_._elements.push(d),R!==_&&(this._back=R,_._next=R),++this._size}shift(){let d=this._front,_=d,R=this._cursor,N=R+1,G=d._elements,Z=G[R];return N===y&&(_=d._next,N=0),--this._size,this._cursor=N,d!==_&&(this._front=_),G[R]=void 0,Z}forEach(d){let _=this._cursor,R=this._front,N=R._elements;for(;(_!==N.length||R._next!==void 0)&&!(_===N.length&&(R=R._next,N=R._elements,_=0,N.length===0));)d(N[_]),++_}peek(){let d=this._front,_=this._cursor;return d._elements[_]}}let b=Symbol("[[AbortSteps]]"),g=Symbol("[[ErrorSteps]]"),oe=Symbol("[[CancelSteps]]"),ne=Symbol("[[PullSteps]]"),Re=Symbol("[[ReleaseSteps]]");function se(a,d){a._ownerReadableStream=d,d._reader=a,d._state==="readable"?te(a):d._state==="closed"?de(a):ce(a,d._storedError)}i(se,"ReadableStreamReaderGenericInitialize");function Y(a,d){let _=a._ownerReadableStream;return _r(_,d)}i(Y,"ReadableStreamReaderGenericCancel");function K(a){let d=a._ownerReadableStream;d._state==="readable"?Oe(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):ze(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),d._readableStreamController[Re](),d._reader=void 0,a._ownerReadableStream=void 0}i(K,"ReadableStreamReaderGenericRelease");function re(a){return new TypeError("Cannot "+a+" a stream using a released reader")}i(re,"readerLockException");function te(a){a._closedPromise=h((d,_)=>{a._closedPromise_resolve=d,a._closedPromise_reject=_})}i(te,"defaultReaderClosedPromiseInitialize");function ce(a,d){te(a),Oe(a,d)}i(ce,"defaultReaderClosedPromiseInitializeAsRejected");function de(a){te(a),Ke(a)}i(de,"defaultReaderClosedPromiseInitializeAsResolved");function Oe(a,d){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(d),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}i(Oe,"defaultReaderClosedPromiseReject");function ze(a,d){ce(a,d)}i(ze,"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 ut(a,d){if(a!==void 0&&!ie(a))throw new TypeError(`${d} is not an object.`)}i(ut,"assertDictionary");function ft(a,d){if(typeof a!="function")throw new TypeError(`${d} is not a function.`)}i(ft,"assertFunction");function Vt(a){return typeof a=="object"&&a!==null||typeof a=="function"}i(Vt,"isObject");function Ze(a,d){if(!Vt(a))throw new TypeError(`${d} is not an object.`)}i(Ze,"assertObject");function Je(a,d,_){if(a===void 0)throw new TypeError(`Parameter ${d} is required in '${_}'.`)}i(Je,"assertRequiredArgument");function I(a,d,_){if(a===void 0)throw new TypeError(`${d} is required in '${_}'.`)}i(I,"assertRequiredField");function $(a){return Number(a)}i($,"convertUnrestrictedDouble");function O(a){return a===0?0:a}i(O,"censorNegativeZero");function q(a){return O(Tt(a))}i(q,"integerPart");function z(a,d){let R=Number.MAX_SAFE_INTEGER,N=Number(a);if(N=O(N),!Qe(N))throw new TypeError(`${d} is not a finite number`);if(N=q(N),N<0||N>R)throw new TypeError(`${d} is outside the accepted range of 0 to ${R}, inclusive`);return!Qe(N)||N===0?0:N}i(z,"convertUnsignedLongLongWithEnforceRange");function F(a,d){if(!In(a))throw new TypeError(`${d} is not a ReadableStream.`)}i(F,"assertReadableStream");function H(a){return new X(a)}i(H,"AcquireReadableStreamDefaultReader");function k(a,d){a._reader._readRequests.push(d)}i(k,"ReadableStreamAddReadRequest");function U(a,d,_){let N=a._reader._readRequests.shift();_?N._closeSteps():N._chunkSteps(d)}i(U,"ReadableStreamFulfillReadRequest");function V(a){return a._reader._readRequests.length}i(V,"ReadableStreamGetNumReadRequests");function j(a){let d=a._reader;return!(d===void 0||!pe(d))}i(j,"ReadableStreamHasDefaultReader");class X{static{i(this,"ReadableStreamDefaultReader")}constructor(d){if(Je(d,1,"ReadableStreamDefaultReader"),F(d,"First parameter"),An(d))throw new TypeError("This stream has already been locked for exclusive reading by another reader");se(this,d),this._readRequests=new l}get closed(){return pe(this)?this._closedPromise:P(it("closed"))}cancel(d=void 0){return pe(this)?this._ownerReadableStream===void 0?P(re("cancel")):Y(this,d):P(it("cancel"))}read(){if(!pe(this))return P(it("read"));if(this._ownerReadableStream===void 0)return P(re("read from"));let d,_,R=h((G,Z)=>{d=G,_=Z});return he(this,{_chunkSteps:i(G=>d({value:G,done:!1}),"_chunkSteps"),_closeSteps:i(()=>d({value:void 0,done:!0}),"_closeSteps"),_errorSteps:i(G=>_(G),"_errorSteps")}),R}releaseLock(){if(!pe(this))throw it("releaseLock");this._ownerReadableStream!==void 0&&Be(this)}}Object.defineProperties(X.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),o(X.prototype.cancel,"cancel"),o(X.prototype.read,"read"),o(X.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(X.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function pe(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof X}i(pe,"IsReadableStreamDefaultReader");function he(a,d){let _=a._ownerReadableStream;_._disturbed=!0,_._state==="closed"?d._closeSteps():_._state==="errored"?d._errorSteps(_._storedError):_._readableStreamController[ne](d)}i(he,"ReadableStreamDefaultReaderRead");function Be(a){K(a);let d=new TypeError("Reader was released");nt(a,d)}i(Be,"ReadableStreamDefaultReaderRelease");function nt(a,d){let _=a._readRequests;a._readRequests=new l,_.forEach(R=>{R._errorSteps(d)})}i(nt,"ReadableStreamDefaultReaderErrorReadRequests");function it(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}i(it,"defaultReaderBrandCheckException");let qe=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class We{static{i(this,"ReadableStreamAsyncIteratorImpl")}constructor(d,_){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=d,this._preventCancel=_}next(){let d=i(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?D(this._ongoingPromise,d,d):d(),this._ongoingPromise}return(d){let _=i(()=>this._returnSteps(d),"returnSteps");return this._ongoingPromise?D(this._ongoingPromise,_,_):_()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let d=this._reader,_,R,N=h((Z,le)=>{_=Z,R=le});return he(d,{_chunkSteps:i(Z=>{this._ongoingPromise=void 0,u(()=>_({value:Z,done:!1}))},"_chunkSteps"),_closeSteps:i(()=>{this._ongoingPromise=void 0,this._isFinished=!0,K(d),_({value:void 0,done:!0})},"_closeSteps"),_errorSteps:i(Z=>{this._ongoingPromise=void 0,this._isFinished=!0,K(d),R(Z)},"_errorSteps")}),N}_returnSteps(d){if(this._isFinished)return Promise.resolve({value:d,done:!0});this._isFinished=!0;let _=this._reader;if(!this._preventCancel){let R=Y(_,d);return K(_),D(R,()=>({value:d,done:!0}))}return K(_),v({value:d,done:!0})}}let _t={next(){return xi(this)?this._asyncIteratorImpl.next():P(Ei("next"))},return(a){return xi(this)?this._asyncIteratorImpl.return(a):P(Ei("return"))}};Object.setPrototypeOf(_t,qe);function Si(a,d){let _=H(a),R=new We(_,d),N=Object.create(_t);return N._asyncIteratorImpl=R,N}i(Si,"AcquireReadableStreamAsyncIterator");function xi(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof We}catch{return!1}}i(xi,"IsReadableStreamAsyncIterator");function Ei(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}i(Ei,"streamAsyncIteratorBrandCheckException");let Gt=Number.isNaN||function(a){return a!==a};var Qr,Rt,Pt;function Ye(a){return a.slice()}i(Ye,"CreateArrayFromList");function Om(a,d,_,R,N){new Uint8Array(a).set(new Uint8Array(_,R,N),d)}i(Om,"CopyDataBlockBytes");let en=i(a=>(typeof a.transfer=="function"?en=i(d=>d.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?en=i(d=>structuredClone(d,{transfer:[d]}),"TransferArrayBuffer"):en=i(d=>d,"TransferArrayBuffer"),en(a)),"TransferArrayBuffer"),Tn=i(a=>(typeof a.detached=="boolean"?Tn=i(d=>d.detached,"IsDetachedBuffer"):Tn=i(d=>d.byteLength===0,"IsDetachedBuffer"),Tn(a)),"IsDetachedBuffer");function Cm(a,d,_){if(a.slice)return a.slice(d,_);let R=_-d,N=new ArrayBuffer(R);return Om(N,0,a,d,R),N}i(Cm,"ArrayBufferSlice");function Xa(a,d){let _=a[d];if(_!=null){if(typeof _!="function")throw new TypeError(`${String(d)} is not a function`);return _}}i(Xa,"GetMethod");function NA(a){let d={[Symbol.iterator]:()=>a.iterator},_=(async function*(){return yield*d})(),R=_.next;return{iterator:_,nextMethod:R,done:!1}}i(NA,"CreateAsyncFromSyncIterator");let Hc=(Pt=(Qr=Symbol.asyncIterator)!==null&&Qr!==void 0?Qr:(Rt=Symbol.for)===null||Rt===void 0?void 0:Rt.call(Symbol,"Symbol.asyncIterator"))!==null&&Pt!==void 0?Pt:"@@asyncIterator";function Nm(a,d="sync",_){if(_===void 0)if(d==="async"){if(_=Xa(a,Hc),_===void 0){let G=Xa(a,Symbol.iterator),Z=Nm(a,"sync",G);return NA(Z)}}else _=Xa(a,Symbol.iterator);if(_===void 0)throw new TypeError("The object is not iterable");let R=f(_,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(Nm,"GetIterator");function kA(a){let d=f(a.nextMethod,a.iterator,[]);if(!r(d))throw new TypeError("The iterator.next() method must return an object");return d}i(kA,"IteratorNext");function zA(a){return!!a.done}i(zA,"IteratorComplete");function UA(a){return a.value}i(UA,"IteratorValue");function MA(a){return!(typeof a!="number"||Gt(a)||a<0)}i(MA,"IsNonNegativeNumber");function km(a){let d=Cm(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(d)}i(km,"CloneAsUint8Array");function Wc(a){let d=a._queue.shift();return a._queueTotalSize-=d.size,a._queueTotalSize<0&&(a._queueTotalSize=0),d.value}i(Wc,"DequeueValue");function Zc(a,d,_){if(!MA(_)||_===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:d,size:_}),a._queueTotalSize+=_}i(Zc,"EnqueueValueWithSize");function FA(a){return a._queue.peek().value}i(FA,"PeekQueueValue");function Sn(a){a._queue=new l,a._queueTotalSize=0}i(Sn,"ResetQueue");function zm(a){return a===DataView}i(zm,"isDataViewConstructor");function LA(a){return zm(a.constructor)}i(LA,"isDataView");function jA(a){return zm(a)?1:a.BYTES_PER_ELEMENT}i(jA,"arrayBufferViewElementSize");class Qn{static{i(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Kc(this))throw el("view");return this._view}respond(d){if(!Kc(this))throw el("respond");if(Je(d,1,"respond"),d=z(d,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Tn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");rs(this._associatedReadableByteStreamController,d)}respondWithNewView(d){if(!Kc(this))throw el("respondWithNewView");if(Je(d,1,"respondWithNewView"),!ArrayBuffer.isView(d))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(Tn(d.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");ns(this._associatedReadableByteStreamController,d)}}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 tn{static{i(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ei(this))throw Ro("byobRequest");return Qc(this)}get desiredSize(){if(!ei(this))throw Ro("desiredSize");return Hm(this)}close(){if(!ei(this))throw Ro("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let d=this._controlledReadableByteStream._state;if(d!=="readable")throw new TypeError(`The stream (in ${d} state) is not in the readable state and cannot be closed`);Ao(this)}enqueue(d){if(!ei(this))throw Ro("enqueue");if(Je(d,1,"enqueue"),!ArrayBuffer.isView(d))throw new TypeError("chunk must be an array buffer view");if(d.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(d.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 _=this._controlledReadableByteStream._state;if(_!=="readable")throw new TypeError(`The stream (in ${_} state) is not in the readable state and cannot be enqueued to`);ts(this,d)}error(d=void 0){if(!ei(this))throw Ro("error");sr(this,d)}[oe](d){Um(this),Sn(this);let _=this._cancelAlgorithm(d);return es(this),_}[ne](d){let _=this._controlledReadableByteStream;if(this._queueTotalSize>0){Gm(this,d);return}let R=this._autoAllocateChunkSize;if(R!==void 0){let N;try{N=new ArrayBuffer(R)}catch(Z){d._errorSteps(Z);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(_,d),ti(this)}[Re](){if(this._pendingPullIntos.length>0){let d=this._pendingPullIntos.peek();d.readerType="none",this._pendingPullIntos=new l,this._pendingPullIntos.push(d)}}}Object.defineProperties(tn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),o(tn.prototype.close,"close"),o(tn.prototype.enqueue,"enqueue"),o(tn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(tn.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function ei(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof tn}i(ei,"IsReadableByteStreamController");function Kc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Qn}i(Kc,"IsReadableStreamBYOBRequest");function ti(a){if(!HA(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let _=a._pullAlgorithm();T(_,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,ti(a)),null),R=>(sr(a,R),null))}i(ti,"ReadableByteStreamControllerCallPullIfNeeded");function Um(a){Yc(a),a._pendingPullIntos=new l}i(Um,"ReadableByteStreamControllerClearPendingPullIntos");function Jc(a,d){let _=!1;a._state==="closed"&&(_=!0);let R=Mm(d);d.readerType==="default"?U(a,R,_):XA(a,R,_)}i(Jc,"ReadableByteStreamControllerCommitPullIntoDescriptor");function Mm(a){let d=a.bytesFilled,_=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,d/_)}i(Mm,"ReadableByteStreamControllerConvertPullIntoDescriptor");function Qa(a,d,_,R){a._queue.push({buffer:d,byteOffset:_,byteLength:R}),a._queueTotalSize+=R}i(Qa,"ReadableByteStreamControllerEnqueueChunkToQueue");function Fm(a,d,_,R){let N;try{N=Cm(d,_,_+R)}catch(G){throw sr(a,G),G}Qa(a,N,0,R)}i(Fm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Lm(a,d){d.bytesFilled>0&&Fm(a,d.buffer,d.byteOffset,d.bytesFilled),Ii(a)}i(Lm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function jm(a,d){let _=Math.min(a._queueTotalSize,d.byteLength-d.bytesFilled),R=d.bytesFilled+_,N=_,G=!1,Z=R%d.elementSize,le=R-Z;le>=d.minimumFill&&(N=le-d.bytesFilled,G=!0);let we=a._queue;for(;N>0;){let ye=we.peek(),De=Math.min(N,ye.byteLength),Ue=d.byteOffset+d.bytesFilled;Om(d.buffer,Ue,ye.buffer,ye.byteOffset,De),ye.byteLength===De?we.shift():(ye.byteOffset+=De,ye.byteLength-=De),a._queueTotalSize-=De,qm(a,De,d),N-=De}return G}i(jm,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function qm(a,d,_){_.bytesFilled+=d}i(qm,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Bm(a){a._queueTotalSize===0&&a._closeRequested?(es(a),ko(a._controlledReadableByteStream)):ti(a)}i(Bm,"ReadableByteStreamControllerHandleQueueDrain");function Yc(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}i(Yc,"ReadableByteStreamControllerInvalidateBYOBRequest");function Xc(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let d=a._pendingPullIntos.peek();jm(a,d)&&(Ii(a),Jc(a._controlledReadableByteStream,d))}}i(Xc,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function qA(a){let d=a._controlledReadableByteStream._reader;for(;d._readRequests.length>0;){if(a._queueTotalSize===0)return;let _=d._readRequests.shift();Gm(a,_)}}i(qA,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function BA(a,d,_,R){let N=a._controlledReadableByteStream,G=d.constructor,Z=jA(G),{byteOffset:le,byteLength:we}=d,ye=_*Z,De;try{De=en(d.buffer)}catch(et){R._errorSteps(et);return}let Ue={buffer:De,bufferByteLength:De.byteLength,byteOffset:le,byteLength:we,bytesFilled:0,minimumFill:ye,elementSize:Z,viewConstructor:G,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Ue),Km(N,R);return}if(N._state==="closed"){let et=new G(Ue.buffer,Ue.byteOffset,0);R._closeSteps(et);return}if(a._queueTotalSize>0){if(jm(a,Ue)){let et=Mm(Ue);Bm(a),R._chunkSteps(et);return}if(a._closeRequested){let et=new TypeError("Insufficient bytes to fill elements in the given buffer");sr(a,et),R._errorSteps(et);return}}a._pendingPullIntos.push(Ue),Km(N,R),ti(a)}i(BA,"ReadableByteStreamControllerPullInto");function VA(a,d){d.readerType==="none"&&Ii(a);let _=a._controlledReadableByteStream;if(tl(_))for(;Jm(_)>0;){let R=Ii(a);Jc(_,R)}}i(VA,"ReadableByteStreamControllerRespondInClosedState");function GA(a,d,_){if(qm(a,d,_),_.readerType==="none"){Lm(a,_),Xc(a);return}if(_.bytesFilled<_.minimumFill)return;Ii(a);let R=_.bytesFilled%_.elementSize;if(R>0){let N=_.byteOffset+_.bytesFilled;Fm(a,_.buffer,N-R,R)}_.bytesFilled-=R,Jc(a._controlledReadableByteStream,_),Xc(a)}i(GA,"ReadableByteStreamControllerRespondInReadableState");function Vm(a,d){let _=a._pendingPullIntos.peek();Yc(a),a._controlledReadableByteStream._state==="closed"?VA(a,_):GA(a,d,_),ti(a)}i(Vm,"ReadableByteStreamControllerRespondInternal");function Ii(a){return a._pendingPullIntos.shift()}i(Ii,"ReadableByteStreamControllerShiftPendingPullInto");function HA(a){let d=a._controlledReadableByteStream;return d._state!=="readable"||a._closeRequested||!a._started?!1:!!(j(d)&&V(d)>0||tl(d)&&Jm(d)>0||Hm(a)>0)}i(HA,"ReadableByteStreamControllerShouldCallPull");function es(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}i(es,"ReadableByteStreamControllerClearAlgorithms");function Ao(a){let d=a._controlledReadableByteStream;if(!(a._closeRequested||d._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let _=a._pendingPullIntos.peek();if(_.bytesFilled%_.elementSize!==0){let R=new TypeError("Insufficient bytes to fill elements in the given buffer");throw sr(a,R),R}}es(a),ko(d)}}i(Ao,"ReadableByteStreamControllerClose");function ts(a,d){let _=a._controlledReadableByteStream;if(a._closeRequested||_._state!=="readable")return;let{buffer:R,byteOffset:N,byteLength:G}=d;if(Tn(R))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let Z=en(R);if(a._pendingPullIntos.length>0){let le=a._pendingPullIntos.peek();if(Tn(le.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Yc(a),le.buffer=en(le.buffer),le.readerType==="none"&&Lm(a,le)}if(j(_))if(qA(a),V(_)===0)Qa(a,Z,N,G);else{a._pendingPullIntos.length>0&&Ii(a);let le=new Uint8Array(Z,N,G);U(_,le,!1)}else tl(_)?(Qa(a,Z,N,G),Xc(a)):Qa(a,Z,N,G);ti(a)}i(ts,"ReadableByteStreamControllerEnqueue");function sr(a,d){let _=a._controlledReadableByteStream;_._state==="readable"&&(Um(a),Sn(a),es(a),Ph(_,d))}i(sr,"ReadableByteStreamControllerError");function Gm(a,d){let _=a._queue.shift();a._queueTotalSize-=_.byteLength,Bm(a);let R=new Uint8Array(_.buffer,_.byteOffset,_.byteLength);d._chunkSteps(R)}i(Gm,"ReadableByteStreamControllerFillReadRequestFromQueue");function Qc(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let d=a._pendingPullIntos.peek(),_=new Uint8Array(d.buffer,d.byteOffset+d.bytesFilled,d.byteLength-d.bytesFilled),R=Object.create(Qn.prototype);ZA(R,a,_),a._byobRequest=R}return a._byobRequest}i(Qc,"ReadableByteStreamControllerGetBYOBRequest");function Hm(a){let d=a._controlledReadableByteStream._state;return d==="errored"?null:d==="closed"?0:a._strategyHWM-a._queueTotalSize}i(Hm,"ReadableByteStreamControllerGetDesiredSize");function rs(a,d){let _=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(d!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(d===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(_.bytesFilled+d>_.byteLength)throw new RangeError("bytesWritten out of range")}_.buffer=en(_.buffer),Vm(a,d)}i(rs,"ReadableByteStreamControllerRespond");function ns(a,d){let _=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(d.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(d.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(_.byteOffset+_.bytesFilled!==d.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(_.bufferByteLength!==d.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(_.bytesFilled+d.byteLength>_.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let N=d.byteLength;_.buffer=en(d.buffer),Vm(a,N)}i(ns,"ReadableByteStreamControllerRespondWithNewView");function Wm(a,d,_,R,N,G,Z){d._controlledReadableByteStream=a,d._pullAgain=!1,d._pulling=!1,d._byobRequest=null,d._queue=d._queueTotalSize=void 0,Sn(d),d._closeRequested=!1,d._started=!1,d._strategyHWM=G,d._pullAlgorithm=R,d._cancelAlgorithm=N,d._autoAllocateChunkSize=Z,d._pendingPullIntos=new l,a._readableStreamController=d;let le=_();T(v(le),()=>(d._started=!0,ti(d),null),we=>(sr(d,we),null))}i(Wm,"SetUpReadableByteStreamController");function WA(a,d,_){let R=Object.create(tn.prototype),N,G,Z;d.start!==void 0?N=i(()=>d.start(R),"startAlgorithm"):N=i(()=>{},"startAlgorithm"),d.pull!==void 0?G=i(()=>d.pull(R),"pullAlgorithm"):G=i(()=>v(void 0),"pullAlgorithm"),d.cancel!==void 0?Z=i(we=>d.cancel(we),"cancelAlgorithm"):Z=i(()=>v(void 0),"cancelAlgorithm");let le=d.autoAllocateChunkSize;if(le===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Wm(a,R,N,G,Z,_,le)}i(WA,"SetUpReadableByteStreamControllerFromUnderlyingSource");function ZA(a,d,_){a._associatedReadableByteStreamController=d,a._view=_}i(ZA,"SetUpReadableStreamBYOBRequest");function el(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}i(el,"byobRequestBrandCheckException");function Ro(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}i(Ro,"byteStreamControllerBrandCheckException");function KA(a,d){ut(a,d);let _=a?.mode;return{mode:_===void 0?void 0:JA(_,`${d} has member 'mode' that`)}}i(KA,"convertReaderOptions");function JA(a,d){if(a=`${a}`,a!=="byob")throw new TypeError(`${d} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}i(JA,"convertReadableStreamReaderMode");function YA(a,d){var _;ut(a,d);let R=(_=a?.min)!==null&&_!==void 0?_:1;return{min:z(R,`${d} has member 'min' that`)}}i(YA,"convertByobReadOptions");function Zm(a){return new xn(a)}i(Zm,"AcquireReadableStreamBYOBReader");function Km(a,d){a._reader._readIntoRequests.push(d)}i(Km,"ReadableStreamAddReadIntoRequest");function XA(a,d,_){let N=a._reader._readIntoRequests.shift();_?N._closeSteps(d):N._chunkSteps(d)}i(XA,"ReadableStreamFulfillReadIntoRequest");function Jm(a){return a._reader._readIntoRequests.length}i(Jm,"ReadableStreamGetNumReadIntoRequests");function tl(a){let d=a._reader;return!(d===void 0||!ri(d))}i(tl,"ReadableStreamHasBYOBReader");class xn{static{i(this,"ReadableStreamBYOBReader")}constructor(d){if(Je(d,1,"ReadableStreamBYOBReader"),F(d,"First parameter"),An(d))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ei(d._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");se(this,d),this._readIntoRequests=new l}get closed(){return ri(this)?this._closedPromise:P(is("closed"))}cancel(d=void 0){return ri(this)?this._ownerReadableStream===void 0?P(re("cancel")):Y(this,d):P(is("cancel"))}read(d,_={}){if(!ri(this))return P(is("read"));if(!ArrayBuffer.isView(d))return P(new TypeError("view must be an array buffer view"));if(d.byteLength===0)return P(new TypeError("view must have non-zero byteLength"));if(d.buffer.byteLength===0)return P(new TypeError("view's buffer must have non-zero byteLength"));if(Tn(d.buffer))return P(new TypeError("view's buffer has been detached"));let R;try{R=YA(_,"options")}catch(ye){return P(ye)}let N=R.min;if(N===0)return P(new TypeError("options.min must be greater than 0"));if(LA(d)){if(N>d.byteLength)return P(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(N>d.length)return P(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return P(re("read from"));let G,Z,le=h((ye,De)=>{G=ye,Z=De});return Ym(this,d,N,{_chunkSteps:i(ye=>G({value:ye,done:!1}),"_chunkSteps"),_closeSteps:i(ye=>G({value:ye,done:!0}),"_closeSteps"),_errorSteps:i(ye=>Z(ye),"_errorSteps")}),le}releaseLock(){if(!ri(this))throw is("releaseLock");this._ownerReadableStream!==void 0&&QA(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 Ym(a,d,_,R){let N=a._ownerReadableStream;N._disturbed=!0,N._state==="errored"?R._errorSteps(N._storedError):BA(N._readableStreamController,d,_,R)}i(Ym,"ReadableStreamBYOBReaderRead");function QA(a){K(a);let d=new TypeError("Reader was released");Xm(a,d)}i(QA,"ReadableStreamBYOBReaderRelease");function Xm(a,d){let _=a._readIntoRequests;a._readIntoRequests=new l,_.forEach(R=>{R._errorSteps(d)})}i(Xm,"ReadableStreamBYOBReaderErrorReadIntoRequests");function is(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}i(is,"byobReaderBrandCheckException");function Do(a,d){let{highWaterMark:_}=a;if(_===void 0)return d;if(Gt(_)||_<0)throw new RangeError("Invalid highWaterMark");return _}i(Do,"ExtractHighWaterMark");function os(a){let{size:d}=a;return d||(()=>1)}i(os,"ExtractSizeAlgorithm");function as(a,d){ut(a,d);let _=a?.highWaterMark,R=a?.size;return{highWaterMark:_===void 0?void 0:$(_),size:R===void 0?void 0:eR(R,`${d} has member 'size' that`)}}i(as,"convertQueuingStrategy");function eR(a,d){return ft(a,d),_=>$(a(_))}i(eR,"convertQueuingStrategySize");function tR(a,d){ut(a,d);let _=a?.abort,R=a?.close,N=a?.start,G=a?.type,Z=a?.write;return{abort:_===void 0?void 0:rR(_,a,`${d} has member 'abort' that`),close:R===void 0?void 0:nR(R,a,`${d} has member 'close' that`),start:N===void 0?void 0:iR(N,a,`${d} has member 'start' that`),write:Z===void 0?void 0:oR(Z,a,`${d} has member 'write' that`),type:G}}i(tR,"convertUnderlyingSink");function rR(a,d,_){return ft(a,_),R=>c(a,d,[R])}i(rR,"convertUnderlyingSinkAbortCallback");function nR(a,d,_){return ft(a,_),()=>c(a,d,[])}i(nR,"convertUnderlyingSinkCloseCallback");function iR(a,d,_){return ft(a,_),R=>f(a,d,[R])}i(iR,"convertUnderlyingSinkStartCallback");function oR(a,d,_){return ft(a,_),(R,N)=>c(a,d,[R,N])}i(oR,"convertUnderlyingSinkWriteCallback");function Qm(a,d){if(!Ai(a))throw new TypeError(`${d} is not a WritableStream.`)}i(Qm,"assertWritableStream");function aR(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}i(aR,"isAbortSignal");let sR=typeof AbortController=="function";function uR(){if(sR)return new AbortController}i(uR,"createAbortController");class En{static{i(this,"WritableStream")}constructor(d={},_={}){d===void 0?d=null:Ze(d,"First parameter");let R=as(_,"Second parameter"),N=tR(d,"First parameter");if(th(this),N.type!==void 0)throw new RangeError("Invalid type is specified");let Z=os(R),le=Do(R,1);bR(this,N,le,Z)}get locked(){if(!Ai(this))throw ds("locked");return Ri(this)}abort(d=void 0){return Ai(this)?Ri(this)?P(new TypeError("Cannot abort a stream that already has a writer")):ss(this,d):P(ds("abort"))}close(){return Ai(this)?Ri(this)?P(new TypeError("Cannot close a stream that already has a writer")):Or(this)?P(new TypeError("Cannot close an already-closing stream")):rh(this):P(ds("close"))}getWriter(){if(!Ai(this))throw ds("getWriter");return eh(this)}}Object.defineProperties(En.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),o(En.prototype.abort,"abort"),o(En.prototype.close,"close"),o(En.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(En.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function eh(a){return new rn(a)}i(eh,"AcquireWritableStreamDefaultWriter");function cR(a,d,_,R,N=1,G=()=>1){let Z=Object.create(En.prototype);th(Z);let le=Object.create(Di.prototype);return uh(Z,le,a,d,_,R,N,G),Z}i(cR,"CreateWritableStream");function th(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(th,"InitializeWritableStream");function Ai(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof En}i(Ai,"IsWritableStream");function Ri(a){return a._writer!==void 0}i(Ri,"IsWritableStreamLocked");function ss(a,d){var _;if(a._state==="closed"||a._state==="errored")return v(void 0);a._writableStreamController._abortReason=d,(_=a._writableStreamController._abortController)===null||_===void 0||_.abort(d);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,d=void 0);let G=h((Z,le)=>{a._pendingAbortRequest={_promise:void 0,_resolve:Z,_reject:le,_reason:d,_wasAlreadyErroring:N}});return a._pendingAbortRequest._promise=G,N||nl(a,d),G}i(ss,"WritableStreamAbort");function rh(a){let d=a._state;if(d==="closed"||d==="errored")return P(new TypeError(`The stream (in ${d} state) is not in the writable state and cannot be closed`));let _=h((N,G)=>{let Z={_resolve:N,_reject:G};a._closeRequest=Z}),R=a._writer;return R!==void 0&&a._backpressure&&d==="writable"&&dl(R),TR(a._writableStreamController),_}i(rh,"WritableStreamClose");function lR(a){return h((_,R)=>{let N={_resolve:_,_reject:R};a._writeRequests.push(N)})}i(lR,"WritableStreamAddWriteRequest");function rl(a,d){if(a._state==="writable"){nl(a,d);return}il(a)}i(rl,"WritableStreamDealWithRejection");function nl(a,d){let _=a._writableStreamController;a._state="erroring",a._storedError=d;let R=a._writer;R!==void 0&&ih(R,d),!hR(a)&&_._started&&il(a)}i(nl,"WritableStreamStartErroring");function il(a){a._state="errored",a._writableStreamController[g]();let d=a._storedError;if(a._writeRequests.forEach(N=>{N._reject(d)}),a._writeRequests=new l,a._pendingAbortRequest===void 0){us(a);return}let _=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,_._wasAlreadyErroring){_._reject(d),us(a);return}let R=a._writableStreamController[b](_._reason);T(R,()=>(_._resolve(),us(a),null),N=>(_._reject(N),us(a),null))}i(il,"WritableStreamFinishErroring");function dR(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}i(dR,"WritableStreamFinishInFlightWrite");function pR(a,d){a._inFlightWriteRequest._reject(d),a._inFlightWriteRequest=void 0,rl(a,d)}i(pR,"WritableStreamFinishInFlightWriteWithError");function fR(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 _=a._writer;_!==void 0&&ph(_)}i(fR,"WritableStreamFinishInFlightClose");function mR(a,d){a._inFlightCloseRequest._reject(d),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(d),a._pendingAbortRequest=void 0),rl(a,d)}i(mR,"WritableStreamFinishInFlightCloseWithError");function Or(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}i(Or,"WritableStreamCloseQueuedOrInFlight");function hR(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}i(hR,"WritableStreamHasOperationMarkedInFlight");function gR(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}i(gR,"WritableStreamMarkCloseRequestInFlight");function yR(a){a._inFlightWriteRequest=a._writeRequests.shift()}i(yR,"WritableStreamMarkFirstWriteRequestInFlight");function us(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let d=a._writer;d!==void 0&&cl(d,a._storedError)}i(us,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function ol(a,d){let _=a._writer;_!==void 0&&d!==a._backpressure&&(d?DR(_):dl(_)),a._backpressure=d}i(ol,"WritableStreamUpdateBackpressure");class rn{static{i(this,"WritableStreamDefaultWriter")}constructor(d){if(Je(d,1,"WritableStreamDefaultWriter"),Qm(d,"First parameter"),Ri(d))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=d,d._writer=this;let _=d._state;if(_==="writable")!Or(d)&&d._backpressure?fs(this):fh(this),ps(this);else if(_==="erroring")ll(this,d._storedError),ps(this);else if(_==="closed")fh(this),AR(this);else{let R=d._storedError;ll(this,R),dh(this,R)}}get closed(){return ni(this)?this._closedPromise:P(ii("closed"))}get desiredSize(){if(!ni(this))throw ii("desiredSize");if(this._ownerWritableStream===void 0)throw Oo("desiredSize");return wR(this)}get ready(){return ni(this)?this._readyPromise:P(ii("ready"))}abort(d=void 0){return ni(this)?this._ownerWritableStream===void 0?P(Oo("abort")):vR(this,d):P(ii("abort"))}close(){if(!ni(this))return P(ii("close"));let d=this._ownerWritableStream;return d===void 0?P(Oo("close")):Or(d)?P(new TypeError("Cannot close an already-closing stream")):nh(this)}releaseLock(){if(!ni(this))throw ii("releaseLock");this._ownerWritableStream!==void 0&&oh(this)}write(d=void 0){return ni(this)?this._ownerWritableStream===void 0?P(Oo("write to")):ah(this,d):P(ii("write"))}}Object.defineProperties(rn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),o(rn.prototype.abort,"abort"),o(rn.prototype.close,"close"),o(rn.prototype.releaseLock,"releaseLock"),o(rn.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(rn.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function ni(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof rn}i(ni,"IsWritableStreamDefaultWriter");function vR(a,d){let _=a._ownerWritableStream;return ss(_,d)}i(vR,"WritableStreamDefaultWriterAbort");function nh(a){let d=a._ownerWritableStream;return rh(d)}i(nh,"WritableStreamDefaultWriterClose");function _R(a){let d=a._ownerWritableStream,_=d._state;return Or(d)||_==="closed"?v(void 0):_==="errored"?P(d._storedError):nh(a)}i(_R,"WritableStreamDefaultWriterCloseWithErrorPropagation");function PR(a,d){a._closedPromiseState==="pending"?cl(a,d):RR(a,d)}i(PR,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function ih(a,d){a._readyPromiseState==="pending"?mh(a,d):$R(a,d)}i(ih,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function wR(a){let d=a._ownerWritableStream,_=d._state;return _==="errored"||_==="erroring"?null:_==="closed"?0:ch(d._writableStreamController)}i(wR,"WritableStreamDefaultWriterGetDesiredSize");function oh(a){let d=a._ownerWritableStream,_=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");ih(a,_),PR(a,_),d._writer=void 0,a._ownerWritableStream=void 0}i(oh,"WritableStreamDefaultWriterRelease");function ah(a,d){let _=a._ownerWritableStream,R=_._writableStreamController,N=SR(R,d);if(_!==a._ownerWritableStream)return P(Oo("write to"));let G=_._state;if(G==="errored")return P(_._storedError);if(Or(_)||G==="closed")return P(new TypeError("The stream is closing or closed and cannot be written to"));if(G==="erroring")return P(_._storedError);let Z=lR(_);return xR(R,d,N),Z}i(ah,"WritableStreamDefaultWriterWrite");let sh={};class Di{static{i(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!al(this))throw ul("abortReason");return this._abortReason}get signal(){if(!al(this))throw ul("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(d=void 0){if(!al(this))throw ul("error");this._controlledWritableStream._state==="writable"&&lh(this,d)}[b](d){let _=this._abortAlgorithm(d);return cs(this),_}[g](){Sn(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 al(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Di}i(al,"IsWritableStreamDefaultController");function uh(a,d,_,R,N,G,Z,le){d._controlledWritableStream=a,a._writableStreamController=d,d._queue=void 0,d._queueTotalSize=void 0,Sn(d),d._abortReason=void 0,d._abortController=uR(),d._started=!1,d._strategySizeAlgorithm=le,d._strategyHWM=Z,d._writeAlgorithm=R,d._closeAlgorithm=N,d._abortAlgorithm=G;let we=sl(d);ol(a,we);let ye=_(),De=v(ye);T(De,()=>(d._started=!0,ls(d),null),Ue=>(d._started=!0,rl(a,Ue),null))}i(uh,"SetUpWritableStreamDefaultController");function bR(a,d,_,R){let N=Object.create(Di.prototype),G,Z,le,we;d.start!==void 0?G=i(()=>d.start(N),"startAlgorithm"):G=i(()=>{},"startAlgorithm"),d.write!==void 0?Z=i(ye=>d.write(ye,N),"writeAlgorithm"):Z=i(()=>v(void 0),"writeAlgorithm"),d.close!==void 0?le=i(()=>d.close(),"closeAlgorithm"):le=i(()=>v(void 0),"closeAlgorithm"),d.abort!==void 0?we=i(ye=>d.abort(ye),"abortAlgorithm"):we=i(()=>v(void 0),"abortAlgorithm"),uh(a,N,G,Z,le,we,_,R)}i(bR,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function cs(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}i(cs,"WritableStreamDefaultControllerClearAlgorithms");function TR(a){Zc(a,sh,0),ls(a)}i(TR,"WritableStreamDefaultControllerClose");function SR(a,d){try{return a._strategySizeAlgorithm(d)}catch(_){return $o(a,_),1}}i(SR,"WritableStreamDefaultControllerGetChunkSize");function ch(a){return a._strategyHWM-a._queueTotalSize}i(ch,"WritableStreamDefaultControllerGetDesiredSize");function xR(a,d,_){try{Zc(a,d,_)}catch(N){$o(a,N);return}let R=a._controlledWritableStream;if(!Or(R)&&R._state==="writable"){let N=sl(a);ol(R,N)}ls(a)}i(xR,"WritableStreamDefaultControllerWrite");function ls(a){let d=a._controlledWritableStream;if(!a._started||d._inFlightWriteRequest!==void 0)return;if(d._state==="erroring"){il(d);return}if(a._queue.length===0)return;let R=FA(a);R===sh?ER(a):IR(a,R)}i(ls,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function $o(a,d){a._controlledWritableStream._state==="writable"&&lh(a,d)}i($o,"WritableStreamDefaultControllerErrorIfNeeded");function ER(a){let d=a._controlledWritableStream;gR(d),Wc(a);let _=a._closeAlgorithm();cs(a),T(_,()=>(fR(d),null),R=>(mR(d,R),null))}i(ER,"WritableStreamDefaultControllerProcessClose");function IR(a,d){let _=a._controlledWritableStream;yR(_);let R=a._writeAlgorithm(d);T(R,()=>{dR(_);let N=_._state;if(Wc(a),!Or(_)&&N==="writable"){let G=sl(a);ol(_,G)}return ls(a),null},N=>(_._state==="writable"&&cs(a),pR(_,N),null))}i(IR,"WritableStreamDefaultControllerProcessWrite");function sl(a){return ch(a)<=0}i(sl,"WritableStreamDefaultControllerGetBackpressure");function lh(a,d){let _=a._controlledWritableStream;cs(a),nl(_,d)}i(lh,"WritableStreamDefaultControllerError");function ds(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}i(ds,"streamBrandCheckException$2");function ul(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}i(ul,"defaultControllerBrandCheckException$2");function ii(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}i(ii,"defaultWriterBrandCheckException");function Oo(a){return new TypeError("Cannot "+a+" a stream using a released writer")}i(Oo,"defaultWriterLockException");function ps(a){a._closedPromise=h((d,_)=>{a._closedPromise_resolve=d,a._closedPromise_reject=_,a._closedPromiseState="pending"})}i(ps,"defaultWriterClosedPromiseInitialize");function dh(a,d){ps(a),cl(a,d)}i(dh,"defaultWriterClosedPromiseInitializeAsRejected");function AR(a){ps(a),ph(a)}i(AR,"defaultWriterClosedPromiseInitializeAsResolved");function cl(a,d){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(d),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}i(cl,"defaultWriterClosedPromiseReject");function RR(a,d){dh(a,d)}i(RR,"defaultWriterClosedPromiseResetToRejected");function ph(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(ph,"defaultWriterClosedPromiseResolve");function fs(a){a._readyPromise=h((d,_)=>{a._readyPromise_resolve=d,a._readyPromise_reject=_}),a._readyPromiseState="pending"}i(fs,"defaultWriterReadyPromiseInitialize");function ll(a,d){fs(a),mh(a,d)}i(ll,"defaultWriterReadyPromiseInitializeAsRejected");function fh(a){fs(a),dl(a)}i(fh,"defaultWriterReadyPromiseInitializeAsResolved");function mh(a,d){a._readyPromise_reject!==void 0&&(E(a._readyPromise),a._readyPromise_reject(d),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}i(mh,"defaultWriterReadyPromiseReject");function DR(a){fs(a)}i(DR,"defaultWriterReadyPromiseReset");function $R(a,d){ll(a,d)}i($R,"defaultWriterReadyPromiseResetToRejected");function dl(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(dl,"defaultWriterReadyPromiseResolve");function OR(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}i(OR,"getGlobals");let pl=OR();function CR(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}i(CR,"isDOMExceptionConstructor");function NR(){let a=pl?.DOMException;return CR(a)?a:void 0}i(NR,"getFromGlobal");function kR(){let a=i(function(_,R){this.message=_||"",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(kR,"createPolyfill");let zR=NR()||kR();function hh(a,d,_,R,N,G){let Z=H(a),le=eh(d);a._disturbed=!0;let we=!1,ye=v(void 0);return h((De,Ue)=>{let et;if(G!==void 0){if(et=i(()=>{let ve=G.reason!==void 0?G.reason:new zR("Aborted","AbortError"),je=[];R||je.push(()=>d._state==="writable"?ss(d,ve):v(void 0)),N||je.push(()=>a._state==="readable"?_r(a,ve):v(void 0)),zt(()=>Promise.all(je.map(tt=>tt())),!0,ve)},"abortAlgorithm"),G.aborted){et();return}G.addEventListener("abort",et)}function Pr(){return h((ve,je)=>{function tt(Ht){Ht?ve():x(Ni(),tt,je)}i(tt,"next"),tt(!1)})}i(Pr,"pipeLoop");function Ni(){return we?v(!0):x(le._readyPromise,()=>h((ve,je)=>{he(Z,{_chunkSteps:i(tt=>{ye=x(ah(le,tt),void 0,e),ve(!1)},"_chunkSteps"),_closeSteps:i(()=>ve(!0),"_closeSteps"),_errorSteps:je})}))}if(i(Ni,"pipeStep"),on(a,Z._closedPromise,ve=>(R?ur(!0,ve):zt(()=>ss(d,ve),!0,ve),null)),on(d,le._closedPromise,ve=>(N?ur(!0,ve):zt(()=>_r(a,ve),!0,ve),null)),Ot(a,Z._closedPromise,()=>(_?ur():zt(()=>_R(le)),null)),Or(d)||d._state==="closed"){let ve=new TypeError("the destination writable stream closed before all data could be piped to it");N?ur(!0,ve):zt(()=>_r(a,ve),!0,ve)}E(Pr());function Dn(){let ve=ye;return x(ye,()=>ve!==ye?Dn():void 0)}i(Dn,"waitForWritesToFinish");function on(ve,je,tt){ve._state==="errored"?tt(ve._storedError):S(je,tt)}i(on,"isOrBecomesErrored");function Ot(ve,je,tt){ve._state==="closed"?tt():w(je,tt)}i(Ot,"isOrBecomesClosed");function zt(ve,je,tt){if(we)return;we=!0,d._state==="writable"&&!Or(d)?w(Dn(),Ht):Ht();function Ht(){return T(ve(),()=>an(je,tt),ki=>an(!0,ki)),null}i(Ht,"doTheRest")}i(zt,"shutdownWithAction");function ur(ve,je){we||(we=!0,d._state==="writable"&&!Or(d)?w(Dn(),()=>an(ve,je)):an(ve,je))}i(ur,"shutdown");function an(ve,je){return oh(le),K(Z),G!==void 0&&G.removeEventListener("abort",et),ve?Ue(je):De(void 0),null}i(an,"finalize")})}i(hh,"ReadableStreamPipeTo");class nn{static{i(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ms(this))throw gs("desiredSize");return fl(this)}close(){if(!ms(this))throw gs("close");if(!Oi(this))throw new TypeError("The stream is not in a state that permits close");oi(this)}enqueue(d=void 0){if(!ms(this))throw gs("enqueue");if(!Oi(this))throw new TypeError("The stream is not in a state that permits enqueue");return $i(this,d)}error(d=void 0){if(!ms(this))throw gs("error");vr(this,d)}[oe](d){Sn(this);let _=this._cancelAlgorithm(d);return hs(this),_}[ne](d){let _=this._controlledReadableStream;if(this._queue.length>0){let R=Wc(this);this._closeRequested&&this._queue.length===0?(hs(this),ko(_)):Co(this),d._chunkSteps(R)}else k(_,d),Co(this)}[Re](){}}Object.defineProperties(nn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),o(nn.prototype.close,"close"),o(nn.prototype.enqueue,"enqueue"),o(nn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(nn.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function ms(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof nn}i(ms,"IsReadableStreamDefaultController");function Co(a){if(!gh(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let _=a._pullAlgorithm();T(_,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Co(a)),null),R=>(vr(a,R),null))}i(Co,"ReadableStreamDefaultControllerCallPullIfNeeded");function gh(a){let d=a._controlledReadableStream;return!Oi(a)||!a._started?!1:!!(An(d)&&V(d)>0||fl(a)>0)}i(gh,"ReadableStreamDefaultControllerShouldCallPull");function hs(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}i(hs,"ReadableStreamDefaultControllerClearAlgorithms");function oi(a){if(!Oi(a))return;let d=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(hs(a),ko(d))}i(oi,"ReadableStreamDefaultControllerClose");function $i(a,d){if(!Oi(a))return;let _=a._controlledReadableStream;if(An(_)&&V(_)>0)U(_,d,!1);else{let R;try{R=a._strategySizeAlgorithm(d)}catch(N){throw vr(a,N),N}try{Zc(a,d,R)}catch(N){throw vr(a,N),N}}Co(a)}i($i,"ReadableStreamDefaultControllerEnqueue");function vr(a,d){let _=a._controlledReadableStream;_._state==="readable"&&(Sn(a),hs(a),Ph(_,d))}i(vr,"ReadableStreamDefaultControllerError");function fl(a){let d=a._controlledReadableStream._state;return d==="errored"?null:d==="closed"?0:a._strategyHWM-a._queueTotalSize}i(fl,"ReadableStreamDefaultControllerGetDesiredSize");function UR(a){return!gh(a)}i(UR,"ReadableStreamDefaultControllerHasBackpressure");function Oi(a){let d=a._controlledReadableStream._state;return!a._closeRequested&&d==="readable"}i(Oi,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function yh(a,d,_,R,N,G,Z){d._controlledReadableStream=a,d._queue=void 0,d._queueTotalSize=void 0,Sn(d),d._started=!1,d._closeRequested=!1,d._pullAgain=!1,d._pulling=!1,d._strategySizeAlgorithm=Z,d._strategyHWM=G,d._pullAlgorithm=R,d._cancelAlgorithm=N,a._readableStreamController=d;let le=_();T(v(le),()=>(d._started=!0,Co(d),null),we=>(vr(d,we),null))}i(yh,"SetUpReadableStreamDefaultController");function MR(a,d,_,R){let N=Object.create(nn.prototype),G,Z,le;d.start!==void 0?G=i(()=>d.start(N),"startAlgorithm"):G=i(()=>{},"startAlgorithm"),d.pull!==void 0?Z=i(()=>d.pull(N),"pullAlgorithm"):Z=i(()=>v(void 0),"pullAlgorithm"),d.cancel!==void 0?le=i(we=>d.cancel(we),"cancelAlgorithm"):le=i(()=>v(void 0),"cancelAlgorithm"),yh(a,N,G,Z,le,_,R)}i(MR,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function gs(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}i(gs,"defaultControllerBrandCheckException$1");function FR(a,d){return ei(a._readableStreamController)?jR(a):LR(a)}i(FR,"ReadableStreamTee");function LR(a,d){let _=H(a),R=!1,N=!1,G=!1,Z=!1,le,we,ye,De,Ue,et=h(Ot=>{Ue=Ot});function Pr(){return R?(N=!0,v(void 0)):(R=!0,he(_,{_chunkSteps:i(zt=>{u(()=>{N=!1;let ur=zt,an=zt;G||$i(ye._readableStreamController,ur),Z||$i(De._readableStreamController,an),R=!1,N&&Pr()})},"_chunkSteps"),_closeSteps:i(()=>{R=!1,G||oi(ye._readableStreamController),Z||oi(De._readableStreamController),(!G||!Z)&&Ue(void 0)},"_closeSteps"),_errorSteps:i(()=>{R=!1},"_errorSteps")}),v(void 0))}i(Pr,"pullAlgorithm");function Ni(Ot){if(G=!0,le=Ot,Z){let zt=Ye([le,we]),ur=_r(a,zt);Ue(ur)}return et}i(Ni,"cancel1Algorithm");function Dn(Ot){if(Z=!0,we=Ot,G){let zt=Ye([le,we]),ur=_r(a,zt);Ue(ur)}return et}i(Dn,"cancel2Algorithm");function on(){}return i(on,"startAlgorithm"),ye=No(on,Pr,Ni),De=No(on,Pr,Dn),S(_._closedPromise,Ot=>(vr(ye._readableStreamController,Ot),vr(De._readableStreamController,Ot),(!G||!Z)&&Ue(void 0),null)),[ye,De]}i(LR,"ReadableStreamDefaultTee");function jR(a){let d=H(a),_=!1,R=!1,N=!1,G=!1,Z=!1,le,we,ye,De,Ue,et=h(ve=>{Ue=ve});function Pr(ve){S(ve._closedPromise,je=>(ve!==d||(sr(ye._readableStreamController,je),sr(De._readableStreamController,je),(!G||!Z)&&Ue(void 0)),null))}i(Pr,"forwardReaderError");function Ni(){ri(d)&&(K(d),d=H(a),Pr(d)),he(d,{_chunkSteps:i(je=>{u(()=>{R=!1,N=!1;let tt=je,Ht=je;if(!G&&!Z)try{Ht=km(je)}catch(ki){sr(ye._readableStreamController,ki),sr(De._readableStreamController,ki),Ue(_r(a,ki));return}G||ts(ye._readableStreamController,tt),Z||ts(De._readableStreamController,Ht),_=!1,R?on():N&&Ot()})},"_chunkSteps"),_closeSteps:i(()=>{_=!1,G||Ao(ye._readableStreamController),Z||Ao(De._readableStreamController),ye._readableStreamController._pendingPullIntos.length>0&&rs(ye._readableStreamController,0),De._readableStreamController._pendingPullIntos.length>0&&rs(De._readableStreamController,0),(!G||!Z)&&Ue(void 0)},"_closeSteps"),_errorSteps:i(()=>{_=!1},"_errorSteps")})}i(Ni,"pullWithDefaultReader");function Dn(ve,je){pe(d)&&(K(d),d=Zm(a),Pr(d));let tt=je?De:ye,Ht=je?ye:De;Ym(d,ve,1,{_chunkSteps:i(zi=>{u(()=>{R=!1,N=!1;let Ui=je?Z:G;if(je?G:Z)Ui||ns(tt._readableStreamController,zi);else{let Ch;try{Ch=km(zi)}catch(vl){sr(tt._readableStreamController,vl),sr(Ht._readableStreamController,vl),Ue(_r(a,vl));return}Ui||ns(tt._readableStreamController,zi),ts(Ht._readableStreamController,Ch)}_=!1,R?on():N&&Ot()})},"_chunkSteps"),_closeSteps:i(zi=>{_=!1;let Ui=je?Z:G,Ss=je?G:Z;Ui||Ao(tt._readableStreamController),Ss||Ao(Ht._readableStreamController),zi!==void 0&&(Ui||ns(tt._readableStreamController,zi),!Ss&&Ht._readableStreamController._pendingPullIntos.length>0&&rs(Ht._readableStreamController,0)),(!Ui||!Ss)&&Ue(void 0)},"_closeSteps"),_errorSteps:i(()=>{_=!1},"_errorSteps")})}i(Dn,"pullWithBYOBReader");function on(){if(_)return R=!0,v(void 0);_=!0;let ve=Qc(ye._readableStreamController);return ve===null?Ni():Dn(ve._view,!1),v(void 0)}i(on,"pull1Algorithm");function Ot(){if(_)return N=!0,v(void 0);_=!0;let ve=Qc(De._readableStreamController);return ve===null?Ni():Dn(ve._view,!0),v(void 0)}i(Ot,"pull2Algorithm");function zt(ve){if(G=!0,le=ve,Z){let je=Ye([le,we]),tt=_r(a,je);Ue(tt)}return et}i(zt,"cancel1Algorithm");function ur(ve){if(Z=!0,we=ve,G){let je=Ye([le,we]),tt=_r(a,je);Ue(tt)}return et}i(ur,"cancel2Algorithm");function an(){}return i(an,"startAlgorithm"),ye=_h(an,on,zt),De=_h(an,Ot,ur),Pr(d),[ye,De]}i(jR,"ReadableByteStreamTee");function qR(a){return r(a)&&typeof a.getReader<"u"}i(qR,"isReadableStreamLike");function BR(a){return qR(a)?GR(a.getReader()):VR(a)}i(BR,"ReadableStreamFrom");function VR(a){let d,_=Nm(a,"async"),R=e;function N(){let Z;try{Z=kA(_)}catch(we){return P(we)}let le=v(Z);return D(le,we=>{if(!r(we))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(zA(we))oi(d._readableStreamController);else{let De=UA(we);$i(d._readableStreamController,De)}})}i(N,"pullAlgorithm");function G(Z){let le=_.iterator,we;try{we=Xa(le,"return")}catch(Ue){return P(Ue)}if(we===void 0)return v(void 0);let ye;try{ye=f(we,le,[Z])}catch(Ue){return P(Ue)}let De=v(ye);return D(De,Ue=>{if(!r(Ue))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return i(G,"cancelAlgorithm"),d=No(R,N,G,0),d}i(VR,"ReadableStreamFromIterable");function GR(a){let d,_=e;function R(){let G;try{G=a.read()}catch(Z){return P(Z)}return D(G,Z=>{if(!r(Z))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(Z.done)oi(d._readableStreamController);else{let le=Z.value;$i(d._readableStreamController,le)}})}i(R,"pullAlgorithm");function N(G){try{return v(a.cancel(G))}catch(Z){return P(Z)}}return i(N,"cancelAlgorithm"),d=No(_,R,N,0),d}i(GR,"ReadableStreamFromDefaultReader");function HR(a,d){ut(a,d);let _=a,R=_?.autoAllocateChunkSize,N=_?.cancel,G=_?.pull,Z=_?.start,le=_?.type;return{autoAllocateChunkSize:R===void 0?void 0:z(R,`${d} has member 'autoAllocateChunkSize' that`),cancel:N===void 0?void 0:WR(N,_,`${d} has member 'cancel' that`),pull:G===void 0?void 0:ZR(G,_,`${d} has member 'pull' that`),start:Z===void 0?void 0:KR(Z,_,`${d} has member 'start' that`),type:le===void 0?void 0:JR(le,`${d} has member 'type' that`)}}i(HR,"convertUnderlyingDefaultOrByteSource");function WR(a,d,_){return ft(a,_),R=>c(a,d,[R])}i(WR,"convertUnderlyingSourceCancelCallback");function ZR(a,d,_){return ft(a,_),R=>c(a,d,[R])}i(ZR,"convertUnderlyingSourcePullCallback");function KR(a,d,_){return ft(a,_),R=>f(a,d,[R])}i(KR,"convertUnderlyingSourceStartCallback");function JR(a,d){if(a=`${a}`,a!=="bytes")throw new TypeError(`${d} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}i(JR,"convertReadableStreamType");function YR(a,d){return ut(a,d),{preventCancel:!!a?.preventCancel}}i(YR,"convertIteratorOptions");function vh(a,d){ut(a,d);let _=a?.preventAbort,R=a?.preventCancel,N=a?.preventClose,G=a?.signal;return G!==void 0&&XR(G,`${d} has member 'signal' that`),{preventAbort:!!_,preventCancel:!!R,preventClose:!!N,signal:G}}i(vh,"convertPipeOptions");function XR(a,d){if(!aR(a))throw new TypeError(`${d} is not an AbortSignal.`)}i(XR,"assertAbortSignal");function QR(a,d){ut(a,d);let _=a?.readable;I(_,"readable","ReadableWritablePair"),F(_,`${d} has member 'readable' that`);let R=a?.writable;return I(R,"writable","ReadableWritablePair"),Qm(R,`${d} has member 'writable' that`),{readable:_,writable:R}}i(QR,"convertReadableWritablePair");class Dt{static{i(this,"ReadableStream")}constructor(d={},_={}){d===void 0?d=null:Ze(d,"First parameter");let R=as(_,"Second parameter"),N=HR(d,"First parameter");if(ml(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=Do(R,0);WA(this,N,G)}else{let G=os(R),Z=Do(R,1);MR(this,N,Z,G)}}get locked(){if(!In(this))throw ai("locked");return An(this)}cancel(d=void 0){return In(this)?An(this)?P(new TypeError("Cannot cancel a stream that already has a reader")):_r(this,d):P(ai("cancel"))}getReader(d=void 0){if(!In(this))throw ai("getReader");return KA(d,"First parameter").mode===void 0?H(this):Zm(this)}pipeThrough(d,_={}){if(!In(this))throw ai("pipeThrough");Je(d,1,"pipeThrough");let R=QR(d,"First parameter"),N=vh(_,"Second parameter");if(An(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=hh(this,R.writable,N.preventClose,N.preventAbort,N.preventCancel,N.signal);return E(G),R.readable}pipeTo(d,_={}){if(!In(this))return P(ai("pipeTo"));if(d===void 0)return P("Parameter 1 is required in 'pipeTo'.");if(!Ai(d))return P(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let R;try{R=vh(_,"Second parameter")}catch(N){return P(N)}return An(this)?P(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Ri(d)?P(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):hh(this,d,R.preventClose,R.preventAbort,R.preventCancel,R.signal)}tee(){if(!In(this))throw ai("tee");let d=FR(this);return Ye(d)}values(d=void 0){if(!In(this))throw ai("values");let _=YR(d,"First parameter");return Si(this,_.preventCancel)}[Hc](d){return this.values(d)}static from(d){return BR(d)}}Object.defineProperties(Dt,{from:{enumerable:!0}}),Object.defineProperties(Dt.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),o(Dt.from,"from"),o(Dt.prototype.cancel,"cancel"),o(Dt.prototype.getReader,"getReader"),o(Dt.prototype.pipeThrough,"pipeThrough"),o(Dt.prototype.pipeTo,"pipeTo"),o(Dt.prototype.tee,"tee"),o(Dt.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Dt.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Dt.prototype,Hc,{value:Dt.prototype.values,writable:!0,configurable:!0});function No(a,d,_,R=1,N=()=>1){let G=Object.create(Dt.prototype);ml(G);let Z=Object.create(nn.prototype);return yh(G,Z,a,d,_,R,N),G}i(No,"CreateReadableStream");function _h(a,d,_){let R=Object.create(Dt.prototype);ml(R);let N=Object.create(tn.prototype);return Wm(R,N,a,d,_,0,void 0),R}i(_h,"CreateReadableByteStream");function ml(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}i(ml,"InitializeReadableStream");function In(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof Dt}i(In,"IsReadableStream");function An(a){return a._reader!==void 0}i(An,"IsReadableStreamLocked");function _r(a,d){if(a._disturbed=!0,a._state==="closed")return v(void 0);if(a._state==="errored")return P(a._storedError);ko(a);let _=a._reader;if(_!==void 0&&ri(_)){let N=_._readIntoRequests;_._readIntoRequests=new l,N.forEach(G=>{G._closeSteps(void 0)})}let R=a._readableStreamController[oe](d);return D(R,e)}i(_r,"ReadableStreamCancel");function ko(a){a._state="closed";let d=a._reader;if(d!==void 0&&(Ke(d),pe(d))){let _=d._readRequests;d._readRequests=new l,_.forEach(R=>{R._closeSteps()})}}i(ko,"ReadableStreamClose");function Ph(a,d){a._state="errored",a._storedError=d;let _=a._reader;_!==void 0&&(Oe(_,d),pe(_)?nt(_,d):Xm(_,d))}i(Ph,"ReadableStreamError");function ai(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}i(ai,"streamBrandCheckException$1");function wh(a,d){ut(a,d);let _=a?.highWaterMark;return I(_,"highWaterMark","QueuingStrategyInit"),{highWaterMark:$(_)}}i(wh,"convertQueuingStrategyInit");let bh=i(a=>a.byteLength,"byteLengthSizeFunction");o(bh,"size");class ys{static{i(this,"ByteLengthQueuingStrategy")}constructor(d){Je(d,1,"ByteLengthQueuingStrategy"),d=wh(d,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=d.highWaterMark}get highWaterMark(){if(!Sh(this))throw Th("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Sh(this))throw Th("size");return bh}}Object.defineProperties(ys.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ys.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function Th(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}i(Th,"byteLengthBrandCheckException");function Sh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof ys}i(Sh,"IsByteLengthQueuingStrategy");let xh=i(()=>1,"countSizeFunction");o(xh,"size");class vs{static{i(this,"CountQueuingStrategy")}constructor(d){Je(d,1,"CountQueuingStrategy"),d=wh(d,"First parameter"),this._countQueuingStrategyHighWaterMark=d.highWaterMark}get highWaterMark(){if(!Ih(this))throw Eh("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Ih(this))throw Eh("size");return xh}}Object.defineProperties(vs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(vs.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Eh(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}i(Eh,"countBrandCheckException");function Ih(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof vs}i(Ih,"IsCountQueuingStrategy");function e0(a,d){ut(a,d);let _=a?.cancel,R=a?.flush,N=a?.readableType,G=a?.start,Z=a?.transform,le=a?.writableType;return{cancel:_===void 0?void 0:i0(_,a,`${d} has member 'cancel' that`),flush:R===void 0?void 0:t0(R,a,`${d} has member 'flush' that`),readableType:N,start:G===void 0?void 0:r0(G,a,`${d} has member 'start' that`),transform:Z===void 0?void 0:n0(Z,a,`${d} has member 'transform' that`),writableType:le}}i(e0,"convertTransformer");function t0(a,d,_){return ft(a,_),R=>c(a,d,[R])}i(t0,"convertTransformerFlushCallback");function r0(a,d,_){return ft(a,_),R=>f(a,d,[R])}i(r0,"convertTransformerStartCallback");function n0(a,d,_){return ft(a,_),(R,N)=>c(a,d,[R,N])}i(n0,"convertTransformerTransformCallback");function i0(a,d,_){return ft(a,_),R=>c(a,d,[R])}i(i0,"convertTransformerCancelCallback");class _s{static{i(this,"TransformStream")}constructor(d={},_={},R={}){d===void 0&&(d=null);let N=as(_,"Second parameter"),G=as(R,"Third parameter"),Z=e0(d,"First parameter");if(Z.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(Z.writableType!==void 0)throw new RangeError("Invalid writableType specified");let le=Do(G,0),we=os(G),ye=Do(N,1),De=os(N),Ue,et=h(Pr=>{Ue=Pr});o0(this,et,ye,De,le,we),s0(this,Z),Z.start!==void 0?Ue(Z.start(this._transformStreamController)):Ue(void 0)}get readable(){if(!Ah(this))throw Oh("readable");return this._readable}get writable(){if(!Ah(this))throw Oh("writable");return this._writable}}Object.defineProperties(_s.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(_s.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function o0(a,d,_,R,N,G){function Z(){return d}i(Z,"startAlgorithm");function le(et){return l0(a,et)}i(le,"writeAlgorithm");function we(et){return d0(a,et)}i(we,"abortAlgorithm");function ye(){return p0(a)}i(ye,"closeAlgorithm"),a._writable=cR(Z,le,ye,we,_,R);function De(){return f0(a)}i(De,"pullAlgorithm");function Ue(et){return m0(a,et)}i(Ue,"cancelAlgorithm"),a._readable=No(Z,De,Ue,N,G),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,Ps(a,!0),a._transformStreamController=void 0}i(o0,"InitializeTransformStream");function Ah(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof _s}i(Ah,"IsTransformStream");function Rh(a,d){vr(a._readable._readableStreamController,d),hl(a,d)}i(Rh,"TransformStreamError");function hl(a,d){bs(a._transformStreamController),$o(a._writable._writableStreamController,d),gl(a)}i(hl,"TransformStreamErrorWritableAndUnblockWrite");function gl(a){a._backpressure&&Ps(a,!1)}i(gl,"TransformStreamUnblockWrite");function Ps(a,d){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=h(_=>{a._backpressureChangePromise_resolve=_}),a._backpressure=d}i(Ps,"TransformStreamSetBackpressure");class Rn{static{i(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ws(this))throw Ts("desiredSize");let d=this._controlledTransformStream._readable._readableStreamController;return fl(d)}enqueue(d=void 0){if(!ws(this))throw Ts("enqueue");Dh(this,d)}error(d=void 0){if(!ws(this))throw Ts("error");u0(this,d)}terminate(){if(!ws(this))throw Ts("terminate");c0(this)}}Object.defineProperties(Rn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),o(Rn.prototype.enqueue,"enqueue"),o(Rn.prototype.error,"error"),o(Rn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function ws(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof Rn}i(ws,"IsTransformStreamDefaultController");function a0(a,d,_,R,N){d._controlledTransformStream=a,a._transformStreamController=d,d._transformAlgorithm=_,d._flushAlgorithm=R,d._cancelAlgorithm=N,d._finishPromise=void 0,d._finishPromise_resolve=void 0,d._finishPromise_reject=void 0}i(a0,"SetUpTransformStreamDefaultController");function s0(a,d){let _=Object.create(Rn.prototype),R,N,G;d.transform!==void 0?R=i(Z=>d.transform(Z,_),"transformAlgorithm"):R=i(Z=>{try{return Dh(_,Z),v(void 0)}catch(le){return P(le)}},"transformAlgorithm"),d.flush!==void 0?N=i(()=>d.flush(_),"flushAlgorithm"):N=i(()=>v(void 0),"flushAlgorithm"),d.cancel!==void 0?G=i(Z=>d.cancel(Z),"cancelAlgorithm"):G=i(()=>v(void 0),"cancelAlgorithm"),a0(a,_,R,N,G)}i(s0,"SetUpTransformStreamDefaultControllerFromTransformer");function bs(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}i(bs,"TransformStreamDefaultControllerClearAlgorithms");function Dh(a,d){let _=a._controlledTransformStream,R=_._readable._readableStreamController;if(!Oi(R))throw new TypeError("Readable side is not in a state that permits enqueue");try{$i(R,d)}catch(G){throw hl(_,G),_._readable._storedError}UR(R)!==_._backpressure&&Ps(_,!0)}i(Dh,"TransformStreamDefaultControllerEnqueue");function u0(a,d){Rh(a._controlledTransformStream,d)}i(u0,"TransformStreamDefaultControllerError");function $h(a,d){let _=a._transformAlgorithm(d);return D(_,void 0,R=>{throw Rh(a._controlledTransformStream,R),R})}i($h,"TransformStreamDefaultControllerPerformTransform");function c0(a){let d=a._controlledTransformStream,_=d._readable._readableStreamController;oi(_);let R=new TypeError("TransformStream terminated");hl(d,R)}i(c0,"TransformStreamDefaultControllerTerminate");function l0(a,d){let _=a._transformStreamController;if(a._backpressure){let R=a._backpressureChangePromise;return D(R,()=>{let N=a._writable;if(N._state==="erroring")throw N._storedError;return $h(_,d)})}return $h(_,d)}i(l0,"TransformStreamDefaultSinkWriteAlgorithm");function d0(a,d){let _=a._transformStreamController;if(_._finishPromise!==void 0)return _._finishPromise;let R=a._readable;_._finishPromise=h((G,Z)=>{_._finishPromise_resolve=G,_._finishPromise_reject=Z});let N=_._cancelAlgorithm(d);return bs(_),T(N,()=>(R._state==="errored"?Ci(_,R._storedError):(vr(R._readableStreamController,d),yl(_)),null),G=>(vr(R._readableStreamController,G),Ci(_,G),null)),_._finishPromise}i(d0,"TransformStreamDefaultSinkAbortAlgorithm");function p0(a){let d=a._transformStreamController;if(d._finishPromise!==void 0)return d._finishPromise;let _=a._readable;d._finishPromise=h((N,G)=>{d._finishPromise_resolve=N,d._finishPromise_reject=G});let R=d._flushAlgorithm();return bs(d),T(R,()=>(_._state==="errored"?Ci(d,_._storedError):(oi(_._readableStreamController),yl(d)),null),N=>(vr(_._readableStreamController,N),Ci(d,N),null)),d._finishPromise}i(p0,"TransformStreamDefaultSinkCloseAlgorithm");function f0(a){return Ps(a,!1),a._backpressureChangePromise}i(f0,"TransformStreamDefaultSourcePullAlgorithm");function m0(a,d){let _=a._transformStreamController;if(_._finishPromise!==void 0)return _._finishPromise;let R=a._writable;_._finishPromise=h((G,Z)=>{_._finishPromise_resolve=G,_._finishPromise_reject=Z});let N=_._cancelAlgorithm(d);return bs(_),T(N,()=>(R._state==="errored"?Ci(_,R._storedError):($o(R._writableStreamController,d),gl(a),yl(_)),null),G=>($o(R._writableStreamController,G),gl(a),Ci(_,G),null)),_._finishPromise}i(m0,"TransformStreamDefaultSourceCancelAlgorithm");function Ts(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}i(Ts,"defaultControllerBrandCheckException");function yl(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}i(yl,"defaultControllerFinishPromiseResolve");function Ci(a,d){a._finishPromise_reject!==void 0&&(E(a._finishPromise),a._finishPromise_reject(d),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}i(Ci,"defaultControllerFinishPromiseReject");function Oh(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}i(Oh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=ys,t.CountQueuingStrategy=vs,t.ReadableByteStreamController=tn,t.ReadableStream=Dt,t.ReadableStreamBYOBReader=xn,t.ReadableStreamBYOBRequest=Qn,t.ReadableStreamDefaultController=nn,t.ReadableStreamDefaultReader=X,t.TransformStream=_s,t.TransformStreamDefaultController=Rn,t.WritableStream=En,t.WritableStreamDefaultController=Di,t.WritableStreamDefaultWriter=rn}))});var JP=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,KP())}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*Ud(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,YP),p=r.buffer.slice(n,n+s);n+=p.byteLength,yield new Uint8Array(p)}}else yield r;else{let n=0,o=r;for(;n!==o.size;){let p=await o.slice(n,Math.min(o.size,n+YP)).arrayBuffer();n+=p.byteLength,yield new Uint8Array(p)}}}var KY,YP,XP,WN,Tr,da=St(()=>{KY=ue(JP(),1);YP=65536;i(Ud,"toIterator");XP=class Md{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 p;ArrayBuffer.isView(s)?p=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?p=new Uint8Array(s.slice(0)):s instanceof Md?p=s:p=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(p)?p.byteLength:p.size,this.#e.push(p)}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 Ud(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 Ud(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Ud(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),p=r<0?Math.max(o+r,0):Math.min(r,o),m=Math.max(p-s,0),h=this.#e,v=[],P=0;for(let T of h){if(P>=m)break;let w=ArrayBuffer.isView(T)?T.byteLength:T.size;if(s&&w<=s)s-=w,p-=w;else{let S;ArrayBuffer.isView(T)?(S=T.subarray(s,Math.min(w,p)),P+=S.byteLength):(S=T.slice(s,Math.min(w,p)),P+=S.size),p-=w,v.push(S),s=0}}let x=new Md([],{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(XP.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});WN=XP,Tr=WN});var ZN,KN,Vn,Fd=St(()=>{da();ZN=class extends Tr{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 Tr&&/^(File)$/.test(e[Symbol.toStringTag])}},KN=ZN,Vn=KN});function tw(t,e=Tr){var r=`${QP()}${QP()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],o=`--${r}\r
15
- Content-Disposition: form-data; name="`;return t.forEach((s,p)=>typeof s=="string"?n.push(o+Ld(p)+`"\r
11
+ `),S=w.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 w){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}fu("got proxy server response: %o %o",S,f),d(),e({connect:{statusCode:E,statusText:u,headers:f},buffered:x})}o(v,"ondata"),t.on("error",h),t.on("end",m),s()})}o(QN,"parseProxyResponse");ni.parseProxyResponse=QN});var YP=L(pr=>{"use strict";var ez=pr&&pr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tz=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),KP=pr&&pr.__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)&&ez(e,t,r);return tz(e,t),e},JP=pr&&pr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pr,"__esModule",{value:!0});pr.HttpsProxyAgent=void 0;var mu=KP(require("net")),HP=KP(require("tls")),rz=JP(require("assert")),nz=JP(Md()),oz=VP(),iz=require("url"),az=GP(),da=(0,nz.default)("https-proxy-agent"),WP=o(t=>t.servername===void 0&&t.host&&!mu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),hu=class extends oz.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new iz.URL(e):e,this.proxyHeaders=r?.headers??{},da("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?ZP(r,"headers"):null,host:n,port:i}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let i;n.protocol==="https:"?(da("Creating `tls.Socket`: %o",this.connectOpts),i=HP.connect(WP(this.connectOpts))):(da("Creating `net.Socket`: %o",this.connectOpts),i=mu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},d=mu.isIPv6(r.host)?`[${r.host}]`:r.host,m=`CONNECT ${d}:${r.port} HTTP/1.1\r
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,az.parseProxyResponse)(i);i.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",sz),r.secureEndpoint?(da("Upgrading socket connection to TLS"),HP.connect({...ZP(WP(r),"host","path","port"),socket:i})):i;i.destroy();let x=new mu.Socket({writable:!1});return x.readable=!0,e.once("socket",T=>{da("Replaying proxy buffer for failed request"),(0,rz.default)(T.listenerCount("data")>0),T.push(_),T.push(null)}),x}};hu.protocols=["http","https"];pr.HttpsProxyAgent=hu;function sz(t){t.resume()}o(sz,"resume");function ZP(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(ZP,"omit")});function uz(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,s=r[0]||"text/plain",d=s;for(let _=1;_<r.length;_++)r[_]==="base64"?i=!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=i?"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 XP,QP=St(()=>{o(uz,"dataUriToBuffer");XP=uz});var tw=L((gu,ew)=>{(function(t,e){typeof gu=="object"&&typeof ew<"u"?e(gu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(gu,(function(t){"use strict";function e(){}o(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(r,"typeIsObject");let n=e;function i(a,p){try{Object.defineProperty(a,"name",{value:p,configurable:!0})}catch{}}o(i,"setFunctionName");let s=Promise,d=Promise.prototype.then,m=Promise.reject.bind(s);function h(a){return new s(a)}o(h,"newPromise");function v(a){return h(p=>p(a))}o(v,"promiseResolvedWith");function _(a){return m(a)}o(_,"promiseRejectedWith");function x(a,p,P){return d.call(a,p,P)}o(x,"PerformPromiseThen");function T(a,p,P){x(x(a,p,P),void 0,n)}o(T,"uponPromise");function w(a,p){T(a,p)}o(w,"uponFulfillment");function S(a,p){T(a,void 0,p)}o(S,"uponRejection");function D(a,p,P){return x(a,p,P)}o(D,"transformPromiseWith");function E(a){x(a,void 0,n)}o(E,"setPromiseIsHandledToTrue");let u=o(a=>{if(typeof queueMicrotask=="function")u=queueMicrotask;else{let p=v(void 0);u=o(P=>x(p,P),"_queueMicrotask")}return u(a)},"_queueMicrotask");function f(a,p,P){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,p,P)}o(f,"reflectCall");function c(a,p,P){try{return v(f(a,p,P))}catch(R){return _(R)}}o(c,"promiseCall");let y=16384;class l{static{o(this,"SimpleQueue")}constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(p){let P=this._back,R=P;P._elements.length===y-1&&(R={_elements:[],_next:void 0}),P._elements.push(p),R!==P&&(this._back=R,P._next=R),++this._size}shift(){let p=this._front,P=p,R=this._cursor,N=R+1,G=p._elements,K=G[R];return N===y&&(P=p._next,N=0),--this._size,this._cursor=N,p!==P&&(this._front=P),G[R]=void 0,K}forEach(p){let P=this._cursor,R=this._front,N=R._elements;for(;(P!==N.length||R._next!==void 0)&&!(P===N.length&&(R=R._next,N=R._elements,P=0,N.length===0));)p(N[P]),++P}peek(){let p=this._front,P=this._cursor;return p._elements[P]}}let b=Symbol("[[AbortSteps]]"),g=Symbol("[[ErrorSteps]]"),ie=Symbol("[[CancelSteps]]"),ne=Symbol("[[PullSteps]]"),Oe=Symbol("[[ReleaseSteps]]");function se(a,p){a._ownerReadableStream=p,p._reader=a,p._state==="readable"?te(a):p._state==="closed"?de(a):ce(a,p._storedError)}o(se,"ReadableStreamReaderGenericInitialize");function X(a,p){let P=a._ownerReadableStream;return _r(P,p)}o(X,"ReadableStreamReaderGenericCancel");function J(a){let p=a._ownerReadableStream;p._state==="readable"?ze(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Ue(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),p._readableStreamController[Oe](),p._reader=void 0,a._ownerReadableStream=void 0}o(J,"ReadableStreamReaderGenericRelease");function re(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(re,"readerLockException");function te(a){a._closedPromise=h((p,P)=>{a._closedPromise_resolve=p,a._closedPromise_reject=P})}o(te,"defaultReaderClosedPromiseInitialize");function ce(a,p){te(a),ze(a,p)}o(ce,"defaultReaderClosedPromiseInitializeAsRejected");function de(a){te(a),Ke(a)}o(de,"defaultReaderClosedPromiseInitializeAsResolved");function ze(a,p){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(p),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(ze,"defaultReaderClosedPromiseReject");function Ue(a,p){ce(a,p)}o(Ue,"defaultReaderClosedPromiseResetToRejected");function Ke(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(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 oe(a){return typeof a=="object"||typeof a=="function"}o(oe,"isDictionary");function lt(a,p){if(a!==void 0&&!oe(a))throw new TypeError(`${p} is not an object.`)}o(lt,"assertDictionary");function ft(a,p){if(typeof a!="function")throw new TypeError(`${p} is not a function.`)}o(ft,"assertFunction");function Vt(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(Vt,"isObject");function Ze(a,p){if(!Vt(a))throw new TypeError(`${p} is not an object.`)}o(Ze,"assertObject");function Je(a,p,P){if(a===void 0)throw new TypeError(`Parameter ${p} is required in '${P}'.`)}o(Je,"assertRequiredArgument");function A(a,p,P){if(a===void 0)throw new TypeError(`${p} is required in '${P}'.`)}o(A,"assertRequiredField");function $(a){return Number(a)}o($,"convertUnrestrictedDouble");function O(a){return a===0?0:a}o(O,"censorNegativeZero");function q(a){return O(Tt(a))}o(q,"integerPart");function k(a,p){let R=Number.MAX_SAFE_INTEGER,N=Number(a);if(N=O(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}o(k,"convertUnsignedLongLongWithEnforceRange");function F(a,p){if(!An(a))throw new TypeError(`${p} is not a ReadableStream.`)}o(F,"assertReadableStream");function H(a){return new Q(a)}o(H,"AcquireReadableStreamDefaultReader");function z(a,p){a._reader._readRequests.push(p)}o(z,"ReadableStreamAddReadRequest");function M(a,p,P){let N=a._reader._readRequests.shift();P?N._closeSteps():N._chunkSteps(p)}o(M,"ReadableStreamFulfillReadRequest");function V(a){return a._reader._readRequests.length}o(V,"ReadableStreamGetNumReadRequests");function j(a){let p=a._reader;return!(p===void 0||!pe(p))}o(j,"ReadableStreamHasDefaultReader");class Q{static{o(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:_(it("closed"))}cancel(p=void 0){return pe(this)?this._ownerReadableStream===void 0?_(re("cancel")):X(this,p):_(it("cancel"))}read(){if(!pe(this))return _(it("read"));if(this._ownerReadableStream===void 0)return _(re("read from"));let p,P,R=h((G,K)=>{p=G,P=K});return he(this,{_chunkSteps:o(G=>p({value:G,done:!1}),"_chunkSteps"),_closeSteps:o(()=>p({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(G=>P(G),"_errorSteps")}),R}releaseLock(){if(!pe(this))throw it("releaseLock");this._ownerReadableStream!==void 0&&Ve(this)}}Object.defineProperties(Q.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(Q.prototype.cancel,"cancel"),i(Q.prototype.read,"read"),i(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}o(pe,"IsReadableStreamDefaultReader");function he(a,p){let P=a._ownerReadableStream;P._disturbed=!0,P._state==="closed"?p._closeSteps():P._state==="errored"?p._errorSteps(P._storedError):P._readableStreamController[ne](p)}o(he,"ReadableStreamDefaultReaderRead");function Ve(a){J(a);let p=new TypeError("Reader was released");nt(a,p)}o(Ve,"ReadableStreamDefaultReaderRelease");function nt(a,p){let P=a._readRequests;a._readRequests=new l,P.forEach(R=>{R._errorSteps(p)})}o(nt,"ReadableStreamDefaultReaderErrorReadRequests");function it(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(it,"defaultReaderBrandCheckException");let Be=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class We{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(p,P){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=p,this._preventCancel=P}next(){let p=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?D(this._ongoingPromise,p,p):p(),this._ongoingPromise}return(p){let P=o(()=>this._returnSteps(p),"returnSteps");return this._ongoingPromise?D(this._ongoingPromise,P,P):P()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let p=this._reader,P,R,N=h((K,le)=>{P=K,R=le});return he(p,{_chunkSteps:o(K=>{this._ongoingPromise=void 0,u(()=>P({value:K,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,J(p),P({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(K=>{this._ongoingPromise=void 0,this._isFinished=!0,J(p),R(K)},"_errorSteps")}),N}_returnSteps(p){if(this._isFinished)return Promise.resolve({value:p,done:!0});this._isFinished=!0;let P=this._reader;if(!this._preventCancel){let R=X(P,p);return J(P),D(R,()=>({value:p,done:!0}))}return J(P),v({value:p,done:!0})}}let Pt={next(){return Eo(this)?this._asyncIteratorImpl.next():_(Io("next"))},return(a){return Eo(this)?this._asyncIteratorImpl.return(a):_(Io("return"))}};Object.setPrototypeOf(Pt,Be);function xo(a,p){let P=H(a),R=new We(P,p),N=Object.create(Pt);return N._asyncIteratorImpl=R,N}o(xo,"AcquireReadableStreamAsyncIterator");function Eo(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof We}catch{return!1}}o(Eo,"IsReadableStreamAsyncIterator");function Io(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(Io,"streamAsyncIteratorBrandCheckException");let Gt=Number.isNaN||function(a){return a!==a};var Qr,Dt,wt;function Ye(a){return a.slice()}o(Ye,"CreateArrayFromList");function zm(a,p,P,R,N){new Uint8Array(a).set(new Uint8Array(P,R,N),p)}o(zm,"CopyDataBlockBytes");let en=o(a=>(typeof a.transfer=="function"?en=o(p=>p.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?en=o(p=>structuredClone(p,{transfer:[p]}),"TransferArrayBuffer"):en=o(p=>p,"TransferArrayBuffer"),en(a)),"TransferArrayBuffer"),Sn=o(a=>(typeof a.detached=="boolean"?Sn=o(p=>p.detached,"IsDetachedBuffer"):Sn=o(p=>p.byteLength===0,"IsDetachedBuffer"),Sn(a)),"IsDetachedBuffer");function km(a,p,P){if(a.slice)return a.slice(p,P);let R=P-p,N=new ArrayBuffer(R);return zm(N,0,a,p,R),N}o(km,"ArrayBufferSlice");function Qa(a,p){let P=a[p];if(P!=null){if(typeof P!="function")throw new TypeError(`${String(p)} is not a function`);return P}}o(Qa,"GetMethod");function ZA(a){let p={[Symbol.iterator]:()=>a.iterator},P=(async function*(){return yield*p})(),R=P.next;return{iterator:P,nextMethod:R,done:!1}}o(ZA,"CreateAsyncFromSyncIterator");let Hc=(wt=(Qr=Symbol.asyncIterator)!==null&&Qr!==void 0?Qr:(Dt=Symbol.for)===null||Dt===void 0?void 0:Dt.call(Symbol,"Symbol.asyncIterator"))!==null&&wt!==void 0?wt:"@@asyncIterator";function Um(a,p="sync",P){if(P===void 0)if(p==="async"){if(P=Qa(a,Hc),P===void 0){let G=Qa(a,Symbol.iterator),K=Um(a,"sync",G);return ZA(K)}}else P=Qa(a,Symbol.iterator);if(P===void 0)throw new TypeError("The object is not iterable");let R=f(P,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}}o(Um,"GetIterator");function KA(a){let p=f(a.nextMethod,a.iterator,[]);if(!r(p))throw new TypeError("The iterator.next() method must return an object");return p}o(KA,"IteratorNext");function JA(a){return!!a.done}o(JA,"IteratorComplete");function YA(a){return a.value}o(YA,"IteratorValue");function XA(a){return!(typeof a!="number"||Gt(a)||a<0)}o(XA,"IsNonNegativeNumber");function Mm(a){let p=km(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(p)}o(Mm,"CloneAsUint8Array");function Wc(a){let p=a._queue.shift();return a._queueTotalSize-=p.size,a._queueTotalSize<0&&(a._queueTotalSize=0),p.value}o(Wc,"DequeueValue");function Zc(a,p,P){if(!XA(P)||P===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:p,size:P}),a._queueTotalSize+=P}o(Zc,"EnqueueValueWithSize");function QA(a){return a._queue.peek().value}o(QA,"PeekQueueValue");function xn(a){a._queue=new l,a._queueTotalSize=0}o(xn,"ResetQueue");function Fm(a){return a===DataView}o(Fm,"isDataViewConstructor");function eR(a){return Fm(a.constructor)}o(eR,"isDataView");function tR(a){return Fm(a)?1:a.BYTES_PER_ELEMENT}o(tR,"arrayBufferViewElementSize");class Qn{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Kc(this))throw el("view");return this._view}respond(p){if(!Kc(this))throw el("respond");if(Je(p,1,"respond"),p=k(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");ns(this._associatedReadableByteStreamController,p)}respondWithNewView(p){if(!Kc(this))throw el("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");os(this._associatedReadableByteStreamController,p)}}Object.defineProperties(Qn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(Qn.prototype.respond,"respond"),i(Qn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Qn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class tn{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!eo(this))throw Di("byobRequest");return Qc(this)}get desiredSize(){if(!eo(this))throw Di("desiredSize");return Km(this)}close(){if(!eo(this))throw Di("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`);Ri(this)}enqueue(p){if(!eo(this))throw Di("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 P=this._controlledReadableByteStream._state;if(P!=="readable")throw new TypeError(`The stream (in ${P} state) is not in the readable state and cannot be enqueued to`);rs(this,p)}error(p=void 0){if(!eo(this))throw Di("error");sr(this,p)}[ie](p){Lm(this),xn(this);let P=this._cancelAlgorithm(p);return ts(this),P}[ne](p){let P=this._controlledReadableByteStream;if(this._queueTotalSize>0){Zm(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)}z(P,p),to(this)}[Oe](){if(this._pendingPullIntos.length>0){let p=this._pendingPullIntos.peek();p.readerType="none",this._pendingPullIntos=new l,this._pendingPullIntos.push(p)}}}Object.defineProperties(tn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(tn.prototype.close,"close"),i(tn.prototype.enqueue,"enqueue"),i(tn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(tn.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function eo(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof tn}o(eo,"IsReadableByteStreamController");function Kc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Qn}o(Kc,"IsReadableStreamBYOBRequest");function to(a){if(!aR(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let P=a._pullAlgorithm();T(P,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,to(a)),null),R=>(sr(a,R),null))}o(to,"ReadableByteStreamControllerCallPullIfNeeded");function Lm(a){Yc(a),a._pendingPullIntos=new l}o(Lm,"ReadableByteStreamControllerClearPendingPullIntos");function Jc(a,p){let P=!1;a._state==="closed"&&(P=!0);let R=jm(p);p.readerType==="default"?M(a,R,P):pR(a,R,P)}o(Jc,"ReadableByteStreamControllerCommitPullIntoDescriptor");function jm(a){let p=a.bytesFilled,P=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,p/P)}o(jm,"ReadableByteStreamControllerConvertPullIntoDescriptor");function es(a,p,P,R){a._queue.push({buffer:p,byteOffset:P,byteLength:R}),a._queueTotalSize+=R}o(es,"ReadableByteStreamControllerEnqueueChunkToQueue");function qm(a,p,P,R){let N;try{N=km(p,P,P+R)}catch(G){throw sr(a,G),G}es(a,N,0,R)}o(qm,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Bm(a,p){p.bytesFilled>0&&qm(a,p.buffer,p.byteOffset,p.bytesFilled),Ao(a)}o(Bm,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function Vm(a,p){let P=Math.min(a._queueTotalSize,p.byteLength-p.bytesFilled),R=p.bytesFilled+P,N=P,G=!1,K=R%p.elementSize,le=R-K;le>=p.minimumFill&&(N=le-p.bytesFilled,G=!0);let Te=a._queue;for(;N>0;){let ye=Te.peek(),Ce=Math.min(N,ye.byteLength),Me=p.byteOffset+p.bytesFilled;zm(p.buffer,Me,ye.buffer,ye.byteOffset,Ce),ye.byteLength===Ce?Te.shift():(ye.byteOffset+=Ce,ye.byteLength-=Ce),a._queueTotalSize-=Ce,Gm(a,Ce,p),N-=Ce}return G}o(Vm,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function Gm(a,p,P){P.bytesFilled+=p}o(Gm,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Hm(a){a._queueTotalSize===0&&a._closeRequested?(ts(a),ki(a._controlledReadableByteStream)):to(a)}o(Hm,"ReadableByteStreamControllerHandleQueueDrain");function Yc(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(Yc,"ReadableByteStreamControllerInvalidateBYOBRequest");function Xc(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let p=a._pendingPullIntos.peek();Vm(a,p)&&(Ao(a),Jc(a._controlledReadableByteStream,p))}}o(Xc,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function rR(a){let p=a._controlledReadableByteStream._reader;for(;p._readRequests.length>0;){if(a._queueTotalSize===0)return;let P=p._readRequests.shift();Zm(a,P)}}o(rR,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function nR(a,p,P,R){let N=a._controlledReadableByteStream,G=p.constructor,K=tR(G),{byteOffset:le,byteLength:Te}=p,ye=P*K,Ce;try{Ce=en(p.buffer)}catch(et){R._errorSteps(et);return}let Me={buffer:Ce,bufferByteLength:Ce.byteLength,byteOffset:le,byteLength:Te,bytesFilled:0,minimumFill:ye,elementSize:K,viewConstructor:G,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Me),Xm(N,R);return}if(N._state==="closed"){let et=new G(Me.buffer,Me.byteOffset,0);R._closeSteps(et);return}if(a._queueTotalSize>0){if(Vm(a,Me)){let et=jm(Me);Hm(a),R._chunkSteps(et);return}if(a._closeRequested){let et=new TypeError("Insufficient bytes to fill elements in the given buffer");sr(a,et),R._errorSteps(et);return}}a._pendingPullIntos.push(Me),Xm(N,R),to(a)}o(nR,"ReadableByteStreamControllerPullInto");function oR(a,p){p.readerType==="none"&&Ao(a);let P=a._controlledReadableByteStream;if(tl(P))for(;Qm(P)>0;){let R=Ao(a);Jc(P,R)}}o(oR,"ReadableByteStreamControllerRespondInClosedState");function iR(a,p,P){if(Gm(a,p,P),P.readerType==="none"){Bm(a,P),Xc(a);return}if(P.bytesFilled<P.minimumFill)return;Ao(a);let R=P.bytesFilled%P.elementSize;if(R>0){let N=P.byteOffset+P.bytesFilled;qm(a,P.buffer,N-R,R)}P.bytesFilled-=R,Jc(a._controlledReadableByteStream,P),Xc(a)}o(iR,"ReadableByteStreamControllerRespondInReadableState");function Wm(a,p){let P=a._pendingPullIntos.peek();Yc(a),a._controlledReadableByteStream._state==="closed"?oR(a,P):iR(a,p,P),to(a)}o(Wm,"ReadableByteStreamControllerRespondInternal");function Ao(a){return a._pendingPullIntos.shift()}o(Ao,"ReadableByteStreamControllerShiftPendingPullInto");function aR(a){let p=a._controlledReadableByteStream;return p._state!=="readable"||a._closeRequested||!a._started?!1:!!(j(p)&&V(p)>0||tl(p)&&Qm(p)>0||Km(a)>0)}o(aR,"ReadableByteStreamControllerShouldCallPull");function ts(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(ts,"ReadableByteStreamControllerClearAlgorithms");function Ri(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 P=a._pendingPullIntos.peek();if(P.bytesFilled%P.elementSize!==0){let R=new TypeError("Insufficient bytes to fill elements in the given buffer");throw sr(a,R),R}}ts(a),ki(p)}}o(Ri,"ReadableByteStreamControllerClose");function rs(a,p){let P=a._controlledReadableByteStream;if(a._closeRequested||P._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=en(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");Yc(a),le.buffer=en(le.buffer),le.readerType==="none"&&Bm(a,le)}if(j(P))if(rR(a),V(P)===0)es(a,K,N,G);else{a._pendingPullIntos.length>0&&Ao(a);let le=new Uint8Array(K,N,G);M(P,le,!1)}else tl(P)?(es(a,K,N,G),Xc(a)):es(a,K,N,G);to(a)}o(rs,"ReadableByteStreamControllerEnqueue");function sr(a,p){let P=a._controlledReadableByteStream;P._state==="readable"&&(Lm(a),xn(a),ts(a),Th(P,p))}o(sr,"ReadableByteStreamControllerError");function Zm(a,p){let P=a._queue.shift();a._queueTotalSize-=P.byteLength,Hm(a);let R=new Uint8Array(P.buffer,P.byteOffset,P.byteLength);p._chunkSteps(R)}o(Zm,"ReadableByteStreamControllerFillReadRequestFromQueue");function Qc(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let p=a._pendingPullIntos.peek(),P=new Uint8Array(p.buffer,p.byteOffset+p.bytesFilled,p.byteLength-p.bytesFilled),R=Object.create(Qn.prototype);uR(R,a,P),a._byobRequest=R}return a._byobRequest}o(Qc,"ReadableByteStreamControllerGetBYOBRequest");function Km(a){let p=a._controlledReadableByteStream._state;return p==="errored"?null:p==="closed"?0:a._strategyHWM-a._queueTotalSize}o(Km,"ReadableByteStreamControllerGetDesiredSize");function ns(a,p){let P=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(P.bytesFilled+p>P.byteLength)throw new RangeError("bytesWritten out of range")}P.buffer=en(P.buffer),Wm(a,p)}o(ns,"ReadableByteStreamControllerRespond");function os(a,p){let P=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(P.byteOffset+P.bytesFilled!==p.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(P.bufferByteLength!==p.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(P.bytesFilled+p.byteLength>P.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let N=p.byteLength;P.buffer=en(p.buffer),Wm(a,N)}o(os,"ReadableByteStreamControllerRespondWithNewView");function Jm(a,p,P,R,N,G,K){p._controlledReadableByteStream=a,p._pullAgain=!1,p._pulling=!1,p._byobRequest=null,p._queue=p._queueTotalSize=void 0,xn(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=P();T(v(le),()=>(p._started=!0,to(p),null),Te=>(sr(p,Te),null))}o(Jm,"SetUpReadableByteStreamController");function sR(a,p,P){let R=Object.create(tn.prototype),N,G,K;p.start!==void 0?N=o(()=>p.start(R),"startAlgorithm"):N=o(()=>{},"startAlgorithm"),p.pull!==void 0?G=o(()=>p.pull(R),"pullAlgorithm"):G=o(()=>v(void 0),"pullAlgorithm"),p.cancel!==void 0?K=o(Te=>p.cancel(Te),"cancelAlgorithm"):K=o(()=>v(void 0),"cancelAlgorithm");let le=p.autoAllocateChunkSize;if(le===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Jm(a,R,N,G,K,P,le)}o(sR,"SetUpReadableByteStreamControllerFromUnderlyingSource");function uR(a,p,P){a._associatedReadableByteStreamController=p,a._view=P}o(uR,"SetUpReadableStreamBYOBRequest");function el(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(el,"byobRequestBrandCheckException");function Di(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(Di,"byteStreamControllerBrandCheckException");function cR(a,p){lt(a,p);let P=a?.mode;return{mode:P===void 0?void 0:lR(P,`${p} has member 'mode' that`)}}o(cR,"convertReaderOptions");function lR(a,p){if(a=`${a}`,a!=="byob")throw new TypeError(`${p} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(lR,"convertReadableStreamReaderMode");function dR(a,p){var P;lt(a,p);let R=(P=a?.min)!==null&&P!==void 0?P:1;return{min:k(R,`${p} has member 'min' that`)}}o(dR,"convertByobReadOptions");function Ym(a){return new En(a)}o(Ym,"AcquireReadableStreamBYOBReader");function Xm(a,p){a._reader._readIntoRequests.push(p)}o(Xm,"ReadableStreamAddReadIntoRequest");function pR(a,p,P){let N=a._reader._readIntoRequests.shift();P?N._closeSteps(p):N._chunkSteps(p)}o(pR,"ReadableStreamFulfillReadIntoRequest");function Qm(a){return a._reader._readIntoRequests.length}o(Qm,"ReadableStreamGetNumReadIntoRequests");function tl(a){let p=a._reader;return!(p===void 0||!ro(p))}o(tl,"ReadableStreamHasBYOBReader");class En{static{o(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(!eo(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 ro(this)?this._closedPromise:_(is("closed"))}cancel(p=void 0){return ro(this)?this._ownerReadableStream===void 0?_(re("cancel")):X(this,p):_(is("cancel"))}read(p,P={}){if(!ro(this))return _(is("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=dR(P,"options")}catch(ye){return _(ye)}let N=R.min;if(N===0)return _(new TypeError("options.min must be greater than 0"));if(eR(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 _(re("read from"));let G,K,le=h((ye,Ce)=>{G=ye,K=Ce});return eh(this,p,N,{_chunkSteps:o(ye=>G({value:ye,done:!1}),"_chunkSteps"),_closeSteps:o(ye=>G({value:ye,done:!0}),"_closeSteps"),_errorSteps:o(ye=>K(ye),"_errorSteps")}),le}releaseLock(){if(!ro(this))throw is("releaseLock");this._ownerReadableStream!==void 0&&fR(this)}}Object.defineProperties(En.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(En.prototype.cancel,"cancel"),i(En.prototype.read,"read"),i(En.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(En.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function ro(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof En}o(ro,"IsReadableStreamBYOBReader");function eh(a,p,P,R){let N=a._ownerReadableStream;N._disturbed=!0,N._state==="errored"?R._errorSteps(N._storedError):nR(N._readableStreamController,p,P,R)}o(eh,"ReadableStreamBYOBReaderRead");function fR(a){J(a);let p=new TypeError("Reader was released");th(a,p)}o(fR,"ReadableStreamBYOBReaderRelease");function th(a,p){let P=a._readIntoRequests;a._readIntoRequests=new l,P.forEach(R=>{R._errorSteps(p)})}o(th,"ReadableStreamBYOBReaderErrorReadIntoRequests");function is(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(is,"byobReaderBrandCheckException");function $i(a,p){let{highWaterMark:P}=a;if(P===void 0)return p;if(Gt(P)||P<0)throw new RangeError("Invalid highWaterMark");return P}o($i,"ExtractHighWaterMark");function as(a){let{size:p}=a;return p||(()=>1)}o(as,"ExtractSizeAlgorithm");function ss(a,p){lt(a,p);let P=a?.highWaterMark,R=a?.size;return{highWaterMark:P===void 0?void 0:$(P),size:R===void 0?void 0:mR(R,`${p} has member 'size' that`)}}o(ss,"convertQueuingStrategy");function mR(a,p){return ft(a,p),P=>$(a(P))}o(mR,"convertQueuingStrategySize");function hR(a,p){lt(a,p);let P=a?.abort,R=a?.close,N=a?.start,G=a?.type,K=a?.write;return{abort:P===void 0?void 0:gR(P,a,`${p} has member 'abort' that`),close:R===void 0?void 0:yR(R,a,`${p} has member 'close' that`),start:N===void 0?void 0:vR(N,a,`${p} has member 'start' that`),write:K===void 0?void 0:_R(K,a,`${p} has member 'write' that`),type:G}}o(hR,"convertUnderlyingSink");function gR(a,p,P){return ft(a,P),R=>c(a,p,[R])}o(gR,"convertUnderlyingSinkAbortCallback");function yR(a,p,P){return ft(a,P),()=>c(a,p,[])}o(yR,"convertUnderlyingSinkCloseCallback");function vR(a,p,P){return ft(a,P),R=>f(a,p,[R])}o(vR,"convertUnderlyingSinkStartCallback");function _R(a,p,P){return ft(a,P),(R,N)=>c(a,p,[R,N])}o(_R,"convertUnderlyingSinkWriteCallback");function rh(a,p){if(!Ro(a))throw new TypeError(`${p} is not a WritableStream.`)}o(rh,"assertWritableStream");function PR(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o(PR,"isAbortSignal");let wR=typeof AbortController=="function";function bR(){if(wR)return new AbortController}o(bR,"createAbortController");class In{static{o(this,"WritableStream")}constructor(p={},P={}){p===void 0?p=null:Ze(p,"First parameter");let R=ss(P,"Second parameter"),N=hR(p,"First parameter");if(oh(this),N.type!==void 0)throw new RangeError("Invalid type is specified");let K=as(R),le=$i(R,1);kR(this,N,le,K)}get locked(){if(!Ro(this))throw ps("locked");return Do(this)}abort(p=void 0){return Ro(this)?Do(this)?_(new TypeError("Cannot abort a stream that already has a writer")):us(this,p):_(ps("abort"))}close(){return Ro(this)?Do(this)?_(new TypeError("Cannot close a stream that already has a writer")):Cr(this)?_(new TypeError("Cannot close an already-closing stream")):ih(this):_(ps("close"))}getWriter(){if(!Ro(this))throw ps("getWriter");return nh(this)}}Object.defineProperties(In.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(In.prototype.abort,"abort"),i(In.prototype.close,"close"),i(In.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(In.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function nh(a){return new rn(a)}o(nh,"AcquireWritableStreamDefaultWriter");function TR(a,p,P,R,N=1,G=()=>1){let K=Object.create(In.prototype);oh(K);let le=Object.create($o.prototype);return dh(K,le,a,p,P,R,N,G),K}o(TR,"CreateWritableStream");function oh(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}o(oh,"InitializeWritableStream");function Ro(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof In}o(Ro,"IsWritableStream");function Do(a){return a._writer!==void 0}o(Do,"IsWritableStreamLocked");function us(a,p){var P;if(a._state==="closed"||a._state==="errored")return v(void 0);a._writableStreamController._abortReason=p,(P=a._writableStreamController._abortController)===null||P===void 0||P.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||nl(a,p),G}o(us,"WritableStreamAbort");function ih(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 P=h((N,G)=>{let K={_resolve:N,_reject:G};a._closeRequest=K}),R=a._writer;return R!==void 0&&a._backpressure&&p==="writable"&&dl(R),UR(a._writableStreamController),P}o(ih,"WritableStreamClose");function SR(a){return h((P,R)=>{let N={_resolve:P,_reject:R};a._writeRequests.push(N)})}o(SR,"WritableStreamAddWriteRequest");function rl(a,p){if(a._state==="writable"){nl(a,p);return}ol(a)}o(rl,"WritableStreamDealWithRejection");function nl(a,p){let P=a._writableStreamController;a._state="erroring",a._storedError=p;let R=a._writer;R!==void 0&&sh(R,p),!RR(a)&&P._started&&ol(a)}o(nl,"WritableStreamStartErroring");function ol(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){cs(a);return}let P=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,P._wasAlreadyErroring){P._reject(p),cs(a);return}let R=a._writableStreamController[b](P._reason);T(R,()=>(P._resolve(),cs(a),null),N=>(P._reject(N),cs(a),null))}o(ol,"WritableStreamFinishErroring");function xR(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(xR,"WritableStreamFinishInFlightWrite");function ER(a,p){a._inFlightWriteRequest._reject(p),a._inFlightWriteRequest=void 0,rl(a,p)}o(ER,"WritableStreamFinishInFlightWriteWithError");function IR(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 P=a._writer;P!==void 0&&hh(P)}o(IR,"WritableStreamFinishInFlightClose");function AR(a,p){a._inFlightCloseRequest._reject(p),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(p),a._pendingAbortRequest=void 0),rl(a,p)}o(AR,"WritableStreamFinishInFlightCloseWithError");function Cr(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Cr,"WritableStreamCloseQueuedOrInFlight");function RR(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o(RR,"WritableStreamHasOperationMarkedInFlight");function DR(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(DR,"WritableStreamMarkCloseRequestInFlight");function $R(a){a._inFlightWriteRequest=a._writeRequests.shift()}o($R,"WritableStreamMarkFirstWriteRequestInFlight");function cs(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let p=a._writer;p!==void 0&&cl(p,a._storedError)}o(cs,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function il(a,p){let P=a._writer;P!==void 0&&p!==a._backpressure&&(p?VR(P):dl(P)),a._backpressure=p}o(il,"WritableStreamUpdateBackpressure");class rn{static{o(this,"WritableStreamDefaultWriter")}constructor(p){if(Je(p,1,"WritableStreamDefaultWriter"),rh(p,"First parameter"),Do(p))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=p,p._writer=this;let P=p._state;if(P==="writable")!Cr(p)&&p._backpressure?ms(this):gh(this),fs(this);else if(P==="erroring")ll(this,p._storedError),fs(this);else if(P==="closed")gh(this),qR(this);else{let R=p._storedError;ll(this,R),mh(this,R)}}get closed(){return no(this)?this._closedPromise:_(oo("closed"))}get desiredSize(){if(!no(this))throw oo("desiredSize");if(this._ownerWritableStream===void 0)throw Ci("desiredSize");return zR(this)}get ready(){return no(this)?this._readyPromise:_(oo("ready"))}abort(p=void 0){return no(this)?this._ownerWritableStream===void 0?_(Ci("abort")):OR(this,p):_(oo("abort"))}close(){if(!no(this))return _(oo("close"));let p=this._ownerWritableStream;return p===void 0?_(Ci("close")):Cr(p)?_(new TypeError("Cannot close an already-closing stream")):ah(this)}releaseLock(){if(!no(this))throw oo("releaseLock");this._ownerWritableStream!==void 0&&uh(this)}write(p=void 0){return no(this)?this._ownerWritableStream===void 0?_(Ci("write to")):ch(this,p):_(oo("write"))}}Object.defineProperties(rn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(rn.prototype.abort,"abort"),i(rn.prototype.close,"close"),i(rn.prototype.releaseLock,"releaseLock"),i(rn.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(rn.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function no(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof rn}o(no,"IsWritableStreamDefaultWriter");function OR(a,p){let P=a._ownerWritableStream;return us(P,p)}o(OR,"WritableStreamDefaultWriterAbort");function ah(a){let p=a._ownerWritableStream;return ih(p)}o(ah,"WritableStreamDefaultWriterClose");function CR(a){let p=a._ownerWritableStream,P=p._state;return Cr(p)||P==="closed"?v(void 0):P==="errored"?_(p._storedError):ah(a)}o(CR,"WritableStreamDefaultWriterCloseWithErrorPropagation");function NR(a,p){a._closedPromiseState==="pending"?cl(a,p):BR(a,p)}o(NR,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function sh(a,p){a._readyPromiseState==="pending"?yh(a,p):GR(a,p)}o(sh,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function zR(a){let p=a._ownerWritableStream,P=p._state;return P==="errored"||P==="erroring"?null:P==="closed"?0:ph(p._writableStreamController)}o(zR,"WritableStreamDefaultWriterGetDesiredSize");function uh(a){let p=a._ownerWritableStream,P=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");sh(a,P),NR(a,P),p._writer=void 0,a._ownerWritableStream=void 0}o(uh,"WritableStreamDefaultWriterRelease");function ch(a,p){let P=a._ownerWritableStream,R=P._writableStreamController,N=MR(R,p);if(P!==a._ownerWritableStream)return _(Ci("write to"));let G=P._state;if(G==="errored")return _(P._storedError);if(Cr(P)||G==="closed")return _(new TypeError("The stream is closing or closed and cannot be written to"));if(G==="erroring")return _(P._storedError);let K=SR(P);return FR(R,p,N),K}o(ch,"WritableStreamDefaultWriterWrite");let lh={};class $o{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!al(this))throw ul("abortReason");return this._abortReason}get signal(){if(!al(this))throw ul("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(p=void 0){if(!al(this))throw ul("error");this._controlledWritableStream._state==="writable"&&fh(this,p)}[b](p){let P=this._abortAlgorithm(p);return ls(this),P}[g](){xn(this)}}Object.defineProperties($o.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($o.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function al(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof $o}o(al,"IsWritableStreamDefaultController");function dh(a,p,P,R,N,G,K,le){p._controlledWritableStream=a,a._writableStreamController=p,p._queue=void 0,p._queueTotalSize=void 0,xn(p),p._abortReason=void 0,p._abortController=bR(),p._started=!1,p._strategySizeAlgorithm=le,p._strategyHWM=K,p._writeAlgorithm=R,p._closeAlgorithm=N,p._abortAlgorithm=G;let Te=sl(p);il(a,Te);let ye=P(),Ce=v(ye);T(Ce,()=>(p._started=!0,ds(p),null),Me=>(p._started=!0,rl(a,Me),null))}o(dh,"SetUpWritableStreamDefaultController");function kR(a,p,P,R){let N=Object.create($o.prototype),G,K,le,Te;p.start!==void 0?G=o(()=>p.start(N),"startAlgorithm"):G=o(()=>{},"startAlgorithm"),p.write!==void 0?K=o(ye=>p.write(ye,N),"writeAlgorithm"):K=o(()=>v(void 0),"writeAlgorithm"),p.close!==void 0?le=o(()=>p.close(),"closeAlgorithm"):le=o(()=>v(void 0),"closeAlgorithm"),p.abort!==void 0?Te=o(ye=>p.abort(ye),"abortAlgorithm"):Te=o(()=>v(void 0),"abortAlgorithm"),dh(a,N,G,K,le,Te,P,R)}o(kR,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function ls(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(ls,"WritableStreamDefaultControllerClearAlgorithms");function UR(a){Zc(a,lh,0),ds(a)}o(UR,"WritableStreamDefaultControllerClose");function MR(a,p){try{return a._strategySizeAlgorithm(p)}catch(P){return Oi(a,P),1}}o(MR,"WritableStreamDefaultControllerGetChunkSize");function ph(a){return a._strategyHWM-a._queueTotalSize}o(ph,"WritableStreamDefaultControllerGetDesiredSize");function FR(a,p,P){try{Zc(a,p,P)}catch(N){Oi(a,N);return}let R=a._controlledWritableStream;if(!Cr(R)&&R._state==="writable"){let N=sl(a);il(R,N)}ds(a)}o(FR,"WritableStreamDefaultControllerWrite");function ds(a){let p=a._controlledWritableStream;if(!a._started||p._inFlightWriteRequest!==void 0)return;if(p._state==="erroring"){ol(p);return}if(a._queue.length===0)return;let R=QA(a);R===lh?LR(a):jR(a,R)}o(ds,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Oi(a,p){a._controlledWritableStream._state==="writable"&&fh(a,p)}o(Oi,"WritableStreamDefaultControllerErrorIfNeeded");function LR(a){let p=a._controlledWritableStream;DR(p),Wc(a);let P=a._closeAlgorithm();ls(a),T(P,()=>(IR(p),null),R=>(AR(p,R),null))}o(LR,"WritableStreamDefaultControllerProcessClose");function jR(a,p){let P=a._controlledWritableStream;$R(P);let R=a._writeAlgorithm(p);T(R,()=>{xR(P);let N=P._state;if(Wc(a),!Cr(P)&&N==="writable"){let G=sl(a);il(P,G)}return ds(a),null},N=>(P._state==="writable"&&ls(a),ER(P,N),null))}o(jR,"WritableStreamDefaultControllerProcessWrite");function sl(a){return ph(a)<=0}o(sl,"WritableStreamDefaultControllerGetBackpressure");function fh(a,p){let P=a._controlledWritableStream;ls(a),nl(P,p)}o(fh,"WritableStreamDefaultControllerError");function ps(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(ps,"streamBrandCheckException$2");function ul(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(ul,"defaultControllerBrandCheckException$2");function oo(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(oo,"defaultWriterBrandCheckException");function Ci(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(Ci,"defaultWriterLockException");function fs(a){a._closedPromise=h((p,P)=>{a._closedPromise_resolve=p,a._closedPromise_reject=P,a._closedPromiseState="pending"})}o(fs,"defaultWriterClosedPromiseInitialize");function mh(a,p){fs(a),cl(a,p)}o(mh,"defaultWriterClosedPromiseInitializeAsRejected");function qR(a){fs(a),hh(a)}o(qR,"defaultWriterClosedPromiseInitializeAsResolved");function cl(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")}o(cl,"defaultWriterClosedPromiseReject");function BR(a,p){mh(a,p)}o(BR,"defaultWriterClosedPromiseResetToRejected");function hh(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="resolved")}o(hh,"defaultWriterClosedPromiseResolve");function ms(a){a._readyPromise=h((p,P)=>{a._readyPromise_resolve=p,a._readyPromise_reject=P}),a._readyPromiseState="pending"}o(ms,"defaultWriterReadyPromiseInitialize");function ll(a,p){ms(a),yh(a,p)}o(ll,"defaultWriterReadyPromiseInitializeAsRejected");function gh(a){ms(a),dl(a)}o(gh,"defaultWriterReadyPromiseInitializeAsResolved");function yh(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")}o(yh,"defaultWriterReadyPromiseReject");function VR(a){ms(a)}o(VR,"defaultWriterReadyPromiseReset");function GR(a,p){ll(a,p)}o(GR,"defaultWriterReadyPromiseResetToRejected");function dl(a){a._readyPromise_resolve!==void 0&&(a._readyPromise_resolve(void 0),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="fulfilled")}o(dl,"defaultWriterReadyPromiseResolve");function HR(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(HR,"getGlobals");let pl=HR();function WR(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(WR,"isDOMExceptionConstructor");function ZR(){let a=pl?.DOMException;return WR(a)?a:void 0}o(ZR,"getFromGlobal");function KR(){let a=o(function(P,R){this.message=P||"",this.name=R||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return i(a,"DOMException"),a.prototype=Object.create(Error.prototype),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,configurable:!0}),a}o(KR,"createPolyfill");let JR=ZR()||KR();function vh(a,p,P,R,N,G){let K=H(a),le=nh(p);a._disturbed=!0;let Te=!1,ye=v(void 0);return h((Ce,Me)=>{let et;if(G!==void 0){if(et=o(()=>{let _e=G.reason!==void 0?G.reason:new JR("Aborted","AbortError"),je=[];R||je.push(()=>p._state==="writable"?us(p,_e):v(void 0)),N||je.push(()=>a._state==="readable"?_r(a,_e):v(void 0)),kt(()=>Promise.all(je.map(tt=>tt())),!0,_e)},"abortAlgorithm"),G.aborted){et();return}G.addEventListener("abort",et)}function Pr(){return h((_e,je)=>{function tt(Ht){Ht?_e():x(zo(),tt,je)}o(tt,"next"),tt(!1)})}o(Pr,"pipeLoop");function zo(){return Te?v(!0):x(le._readyPromise,()=>h((_e,je)=>{he(K,{_chunkSteps:o(tt=>{ye=x(ch(le,tt),void 0,e),_e(!1)},"_chunkSteps"),_closeSteps:o(()=>_e(!0),"_closeSteps"),_errorSteps:je})}))}if(o(zo,"pipeStep"),on(a,K._closedPromise,_e=>(R?ur(!0,_e):kt(()=>us(p,_e),!0,_e),null)),on(p,le._closedPromise,_e=>(N?ur(!0,_e):kt(()=>_r(a,_e),!0,_e),null)),Ct(a,K._closedPromise,()=>(P?ur():kt(()=>CR(le)),null)),Cr(p)||p._state==="closed"){let _e=new TypeError("the destination writable stream closed before all data could be piped to it");N?ur(!0,_e):kt(()=>_r(a,_e),!0,_e)}E(Pr());function $n(){let _e=ye;return x(ye,()=>_e!==ye?$n():void 0)}o($n,"waitForWritesToFinish");function on(_e,je,tt){_e._state==="errored"?tt(_e._storedError):S(je,tt)}o(on,"isOrBecomesErrored");function Ct(_e,je,tt){_e._state==="closed"?tt():w(je,tt)}o(Ct,"isOrBecomesClosed");function kt(_e,je,tt){if(Te)return;Te=!0,p._state==="writable"&&!Cr(p)?w($n(),Ht):Ht();function Ht(){return T(_e(),()=>an(je,tt),ko=>an(!0,ko)),null}o(Ht,"doTheRest")}o(kt,"shutdownWithAction");function ur(_e,je){Te||(Te=!0,p._state==="writable"&&!Cr(p)?w($n(),()=>an(_e,je)):an(_e,je))}o(ur,"shutdown");function an(_e,je){return uh(le),J(K),G!==void 0&&G.removeEventListener("abort",et),_e?Me(je):Ce(void 0),null}o(an,"finalize")})}o(vh,"ReadableStreamPipeTo");class nn{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!hs(this))throw ys("desiredSize");return fl(this)}close(){if(!hs(this))throw ys("close");if(!Co(this))throw new TypeError("The stream is not in a state that permits close");io(this)}enqueue(p=void 0){if(!hs(this))throw ys("enqueue");if(!Co(this))throw new TypeError("The stream is not in a state that permits enqueue");return Oo(this,p)}error(p=void 0){if(!hs(this))throw ys("error");vr(this,p)}[ie](p){xn(this);let P=this._cancelAlgorithm(p);return gs(this),P}[ne](p){let P=this._controlledReadableStream;if(this._queue.length>0){let R=Wc(this);this._closeRequested&&this._queue.length===0?(gs(this),ki(P)):Ni(this),p._chunkSteps(R)}else z(P,p),Ni(this)}[Oe](){}}Object.defineProperties(nn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(nn.prototype.close,"close"),i(nn.prototype.enqueue,"enqueue"),i(nn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(nn.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function hs(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof nn}o(hs,"IsReadableStreamDefaultController");function Ni(a){if(!_h(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let P=a._pullAlgorithm();T(P,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Ni(a)),null),R=>(vr(a,R),null))}o(Ni,"ReadableStreamDefaultControllerCallPullIfNeeded");function _h(a){let p=a._controlledReadableStream;return!Co(a)||!a._started?!1:!!(Rn(p)&&V(p)>0||fl(a)>0)}o(_h,"ReadableStreamDefaultControllerShouldCallPull");function gs(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(gs,"ReadableStreamDefaultControllerClearAlgorithms");function io(a){if(!Co(a))return;let p=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(gs(a),ki(p))}o(io,"ReadableStreamDefaultControllerClose");function Oo(a,p){if(!Co(a))return;let P=a._controlledReadableStream;if(Rn(P)&&V(P)>0)M(P,p,!1);else{let R;try{R=a._strategySizeAlgorithm(p)}catch(N){throw vr(a,N),N}try{Zc(a,p,R)}catch(N){throw vr(a,N),N}}Ni(a)}o(Oo,"ReadableStreamDefaultControllerEnqueue");function vr(a,p){let P=a._controlledReadableStream;P._state==="readable"&&(xn(a),gs(a),Th(P,p))}o(vr,"ReadableStreamDefaultControllerError");function fl(a){let p=a._controlledReadableStream._state;return p==="errored"?null:p==="closed"?0:a._strategyHWM-a._queueTotalSize}o(fl,"ReadableStreamDefaultControllerGetDesiredSize");function YR(a){return!_h(a)}o(YR,"ReadableStreamDefaultControllerHasBackpressure");function Co(a){let p=a._controlledReadableStream._state;return!a._closeRequested&&p==="readable"}o(Co,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Ph(a,p,P,R,N,G,K){p._controlledReadableStream=a,p._queue=void 0,p._queueTotalSize=void 0,xn(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=P();T(v(le),()=>(p._started=!0,Ni(p),null),Te=>(vr(p,Te),null))}o(Ph,"SetUpReadableStreamDefaultController");function XR(a,p,P,R){let N=Object.create(nn.prototype),G,K,le;p.start!==void 0?G=o(()=>p.start(N),"startAlgorithm"):G=o(()=>{},"startAlgorithm"),p.pull!==void 0?K=o(()=>p.pull(N),"pullAlgorithm"):K=o(()=>v(void 0),"pullAlgorithm"),p.cancel!==void 0?le=o(Te=>p.cancel(Te),"cancelAlgorithm"):le=o(()=>v(void 0),"cancelAlgorithm"),Ph(a,N,G,K,le,P,R)}o(XR,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function ys(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o(ys,"defaultControllerBrandCheckException$1");function QR(a,p){return eo(a._readableStreamController)?t0(a):e0(a)}o(QR,"ReadableStreamTee");function e0(a,p){let P=H(a),R=!1,N=!1,G=!1,K=!1,le,Te,ye,Ce,Me,et=h(Ct=>{Me=Ct});function Pr(){return R?(N=!0,v(void 0)):(R=!0,he(P,{_chunkSteps:o(kt=>{u(()=>{N=!1;let ur=kt,an=kt;G||Oo(ye._readableStreamController,ur),K||Oo(Ce._readableStreamController,an),R=!1,N&&Pr()})},"_chunkSteps"),_closeSteps:o(()=>{R=!1,G||io(ye._readableStreamController),K||io(Ce._readableStreamController),(!G||!K)&&Me(void 0)},"_closeSteps"),_errorSteps:o(()=>{R=!1},"_errorSteps")}),v(void 0))}o(Pr,"pullAlgorithm");function zo(Ct){if(G=!0,le=Ct,K){let kt=Ye([le,Te]),ur=_r(a,kt);Me(ur)}return et}o(zo,"cancel1Algorithm");function $n(Ct){if(K=!0,Te=Ct,G){let kt=Ye([le,Te]),ur=_r(a,kt);Me(ur)}return et}o($n,"cancel2Algorithm");function on(){}return o(on,"startAlgorithm"),ye=zi(on,Pr,zo),Ce=zi(on,Pr,$n),S(P._closedPromise,Ct=>(vr(ye._readableStreamController,Ct),vr(Ce._readableStreamController,Ct),(!G||!K)&&Me(void 0),null)),[ye,Ce]}o(e0,"ReadableStreamDefaultTee");function t0(a){let p=H(a),P=!1,R=!1,N=!1,G=!1,K=!1,le,Te,ye,Ce,Me,et=h(_e=>{Me=_e});function Pr(_e){S(_e._closedPromise,je=>(_e!==p||(sr(ye._readableStreamController,je),sr(Ce._readableStreamController,je),(!G||!K)&&Me(void 0)),null))}o(Pr,"forwardReaderError");function zo(){ro(p)&&(J(p),p=H(a),Pr(p)),he(p,{_chunkSteps:o(je=>{u(()=>{R=!1,N=!1;let tt=je,Ht=je;if(!G&&!K)try{Ht=Mm(je)}catch(ko){sr(ye._readableStreamController,ko),sr(Ce._readableStreamController,ko),Me(_r(a,ko));return}G||rs(ye._readableStreamController,tt),K||rs(Ce._readableStreamController,Ht),P=!1,R?on():N&&Ct()})},"_chunkSteps"),_closeSteps:o(()=>{P=!1,G||Ri(ye._readableStreamController),K||Ri(Ce._readableStreamController),ye._readableStreamController._pendingPullIntos.length>0&&ns(ye._readableStreamController,0),Ce._readableStreamController._pendingPullIntos.length>0&&ns(Ce._readableStreamController,0),(!G||!K)&&Me(void 0)},"_closeSteps"),_errorSteps:o(()=>{P=!1},"_errorSteps")})}o(zo,"pullWithDefaultReader");function $n(_e,je){pe(p)&&(J(p),p=Ym(a),Pr(p));let tt=je?Ce:ye,Ht=je?ye:Ce;eh(p,_e,1,{_chunkSteps:o(Uo=>{u(()=>{R=!1,N=!1;let Mo=je?K:G;if(je?G:K)Mo||os(tt._readableStreamController,Uo);else{let kh;try{kh=Mm(Uo)}catch(vl){sr(tt._readableStreamController,vl),sr(Ht._readableStreamController,vl),Me(_r(a,vl));return}Mo||os(tt._readableStreamController,Uo),rs(Ht._readableStreamController,kh)}P=!1,R?on():N&&Ct()})},"_chunkSteps"),_closeSteps:o(Uo=>{P=!1;let Mo=je?K:G,xs=je?G:K;Mo||Ri(tt._readableStreamController),xs||Ri(Ht._readableStreamController),Uo!==void 0&&(Mo||os(tt._readableStreamController,Uo),!xs&&Ht._readableStreamController._pendingPullIntos.length>0&&ns(Ht._readableStreamController,0)),(!Mo||!xs)&&Me(void 0)},"_closeSteps"),_errorSteps:o(()=>{P=!1},"_errorSteps")})}o($n,"pullWithBYOBReader");function on(){if(P)return R=!0,v(void 0);P=!0;let _e=Qc(ye._readableStreamController);return _e===null?zo():$n(_e._view,!1),v(void 0)}o(on,"pull1Algorithm");function Ct(){if(P)return N=!0,v(void 0);P=!0;let _e=Qc(Ce._readableStreamController);return _e===null?zo():$n(_e._view,!0),v(void 0)}o(Ct,"pull2Algorithm");function kt(_e){if(G=!0,le=_e,K){let je=Ye([le,Te]),tt=_r(a,je);Me(tt)}return et}o(kt,"cancel1Algorithm");function ur(_e){if(K=!0,Te=_e,G){let je=Ye([le,Te]),tt=_r(a,je);Me(tt)}return et}o(ur,"cancel2Algorithm");function an(){}return o(an,"startAlgorithm"),ye=bh(an,on,kt),Ce=bh(an,Ct,ur),Pr(p),[ye,Ce]}o(t0,"ReadableByteStreamTee");function r0(a){return r(a)&&typeof a.getReader<"u"}o(r0,"isReadableStreamLike");function n0(a){return r0(a)?i0(a.getReader()):o0(a)}o(n0,"ReadableStreamFrom");function o0(a){let p,P=Um(a,"async"),R=e;function N(){let K;try{K=KA(P)}catch(Te){return _(Te)}let le=v(K);return D(le,Te=>{if(!r(Te))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(JA(Te))io(p._readableStreamController);else{let Ce=YA(Te);Oo(p._readableStreamController,Ce)}})}o(N,"pullAlgorithm");function G(K){let le=P.iterator,Te;try{Te=Qa(le,"return")}catch(Me){return _(Me)}if(Te===void 0)return v(void 0);let ye;try{ye=f(Te,le,[K])}catch(Me){return _(Me)}let Ce=v(ye);return D(Ce,Me=>{if(!r(Me))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(G,"cancelAlgorithm"),p=zi(R,N,G,0),p}o(o0,"ReadableStreamFromIterable");function i0(a){let p,P=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)io(p._readableStreamController);else{let le=K.value;Oo(p._readableStreamController,le)}})}o(R,"pullAlgorithm");function N(G){try{return v(a.cancel(G))}catch(K){return _(K)}}return o(N,"cancelAlgorithm"),p=zi(P,R,N,0),p}o(i0,"ReadableStreamFromDefaultReader");function a0(a,p){lt(a,p);let P=a,R=P?.autoAllocateChunkSize,N=P?.cancel,G=P?.pull,K=P?.start,le=P?.type;return{autoAllocateChunkSize:R===void 0?void 0:k(R,`${p} has member 'autoAllocateChunkSize' that`),cancel:N===void 0?void 0:s0(N,P,`${p} has member 'cancel' that`),pull:G===void 0?void 0:u0(G,P,`${p} has member 'pull' that`),start:K===void 0?void 0:c0(K,P,`${p} has member 'start' that`),type:le===void 0?void 0:l0(le,`${p} has member 'type' that`)}}o(a0,"convertUnderlyingDefaultOrByteSource");function s0(a,p,P){return ft(a,P),R=>c(a,p,[R])}o(s0,"convertUnderlyingSourceCancelCallback");function u0(a,p,P){return ft(a,P),R=>c(a,p,[R])}o(u0,"convertUnderlyingSourcePullCallback");function c0(a,p,P){return ft(a,P),R=>f(a,p,[R])}o(c0,"convertUnderlyingSourceStartCallback");function l0(a,p){if(a=`${a}`,a!=="bytes")throw new TypeError(`${p} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(l0,"convertReadableStreamType");function d0(a,p){return lt(a,p),{preventCancel:!!a?.preventCancel}}o(d0,"convertIteratorOptions");function wh(a,p){lt(a,p);let P=a?.preventAbort,R=a?.preventCancel,N=a?.preventClose,G=a?.signal;return G!==void 0&&p0(G,`${p} has member 'signal' that`),{preventAbort:!!P,preventCancel:!!R,preventClose:!!N,signal:G}}o(wh,"convertPipeOptions");function p0(a,p){if(!PR(a))throw new TypeError(`${p} is not an AbortSignal.`)}o(p0,"assertAbortSignal");function f0(a,p){lt(a,p);let P=a?.readable;A(P,"readable","ReadableWritablePair"),F(P,`${p} has member 'readable' that`);let R=a?.writable;return A(R,"writable","ReadableWritablePair"),rh(R,`${p} has member 'writable' that`),{readable:P,writable:R}}o(f0,"convertReadableWritablePair");class $t{static{o(this,"ReadableStream")}constructor(p={},P={}){p===void 0?p=null:Ze(p,"First parameter");let R=ss(P,"Second parameter"),N=a0(p,"First parameter");if(ml(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=$i(R,0);sR(this,N,G)}else{let G=as(R),K=$i(R,1);XR(this,N,K,G)}}get locked(){if(!An(this))throw ao("locked");return Rn(this)}cancel(p=void 0){return An(this)?Rn(this)?_(new TypeError("Cannot cancel a stream that already has a reader")):_r(this,p):_(ao("cancel"))}getReader(p=void 0){if(!An(this))throw ao("getReader");return cR(p,"First parameter").mode===void 0?H(this):Ym(this)}pipeThrough(p,P={}){if(!An(this))throw ao("pipeThrough");Je(p,1,"pipeThrough");let R=f0(p,"First parameter"),N=wh(P,"Second parameter");if(Rn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Do(R.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let G=vh(this,R.writable,N.preventClose,N.preventAbort,N.preventCancel,N.signal);return E(G),R.readable}pipeTo(p,P={}){if(!An(this))return _(ao("pipeTo"));if(p===void 0)return _("Parameter 1 is required in 'pipeTo'.");if(!Ro(p))return _(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let R;try{R=wh(P,"Second parameter")}catch(N){return _(N)}return Rn(this)?_(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Do(p)?_(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):vh(this,p,R.preventClose,R.preventAbort,R.preventCancel,R.signal)}tee(){if(!An(this))throw ao("tee");let p=QR(this);return Ye(p)}values(p=void 0){if(!An(this))throw ao("values");let P=d0(p,"First parameter");return xo(this,P.preventCancel)}[Hc](p){return this.values(p)}static from(p){return n0(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}}),i($t.from,"from"),i($t.prototype.cancel,"cancel"),i($t.prototype.getReader,"getReader"),i($t.prototype.pipeThrough,"pipeThrough"),i($t.prototype.pipeTo,"pipeTo"),i($t.prototype.tee,"tee"),i($t.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($t.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty($t.prototype,Hc,{value:$t.prototype.values,writable:!0,configurable:!0});function zi(a,p,P,R=1,N=()=>1){let G=Object.create($t.prototype);ml(G);let K=Object.create(nn.prototype);return Ph(G,K,a,p,P,R,N),G}o(zi,"CreateReadableStream");function bh(a,p,P){let R=Object.create($t.prototype);ml(R);let N=Object.create(tn.prototype);return Jm(R,N,a,p,P,0,void 0),R}o(bh,"CreateReadableByteStream");function ml(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(ml,"InitializeReadableStream");function An(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof $t}o(An,"IsReadableStream");function Rn(a){return a._reader!==void 0}o(Rn,"IsReadableStreamLocked");function _r(a,p){if(a._disturbed=!0,a._state==="closed")return v(void 0);if(a._state==="errored")return _(a._storedError);ki(a);let P=a._reader;if(P!==void 0&&ro(P)){let N=P._readIntoRequests;P._readIntoRequests=new l,N.forEach(G=>{G._closeSteps(void 0)})}let R=a._readableStreamController[ie](p);return D(R,e)}o(_r,"ReadableStreamCancel");function ki(a){a._state="closed";let p=a._reader;if(p!==void 0&&(Ke(p),pe(p))){let P=p._readRequests;p._readRequests=new l,P.forEach(R=>{R._closeSteps()})}}o(ki,"ReadableStreamClose");function Th(a,p){a._state="errored",a._storedError=p;let P=a._reader;P!==void 0&&(ze(P,p),pe(P)?nt(P,p):th(P,p))}o(Th,"ReadableStreamError");function ao(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(ao,"streamBrandCheckException$1");function Sh(a,p){lt(a,p);let P=a?.highWaterMark;return A(P,"highWaterMark","QueuingStrategyInit"),{highWaterMark:$(P)}}o(Sh,"convertQueuingStrategyInit");let xh=o(a=>a.byteLength,"byteLengthSizeFunction");i(xh,"size");class vs{static{o(this,"ByteLengthQueuingStrategy")}constructor(p){Je(p,1,"ByteLengthQueuingStrategy"),p=Sh(p,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=p.highWaterMark}get highWaterMark(){if(!Ih(this))throw Eh("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Ih(this))throw Eh("size");return xh}}Object.defineProperties(vs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(vs.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function Eh(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(Eh,"byteLengthBrandCheckException");function Ih(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof vs}o(Ih,"IsByteLengthQueuingStrategy");let Ah=o(()=>1,"countSizeFunction");i(Ah,"size");class _s{static{o(this,"CountQueuingStrategy")}constructor(p){Je(p,1,"CountQueuingStrategy"),p=Sh(p,"First parameter"),this._countQueuingStrategyHighWaterMark=p.highWaterMark}get highWaterMark(){if(!Dh(this))throw Rh("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Dh(this))throw Rh("size");return Ah}}Object.defineProperties(_s.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(_s.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Rh(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o(Rh,"countBrandCheckException");function Dh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof _s}o(Dh,"IsCountQueuingStrategy");function m0(a,p){lt(a,p);let P=a?.cancel,R=a?.flush,N=a?.readableType,G=a?.start,K=a?.transform,le=a?.writableType;return{cancel:P===void 0?void 0:v0(P,a,`${p} has member 'cancel' that`),flush:R===void 0?void 0:h0(R,a,`${p} has member 'flush' that`),readableType:N,start:G===void 0?void 0:g0(G,a,`${p} has member 'start' that`),transform:K===void 0?void 0:y0(K,a,`${p} has member 'transform' that`),writableType:le}}o(m0,"convertTransformer");function h0(a,p,P){return ft(a,P),R=>c(a,p,[R])}o(h0,"convertTransformerFlushCallback");function g0(a,p,P){return ft(a,P),R=>f(a,p,[R])}o(g0,"convertTransformerStartCallback");function y0(a,p,P){return ft(a,P),(R,N)=>c(a,p,[R,N])}o(y0,"convertTransformerTransformCallback");function v0(a,p,P){return ft(a,P),R=>c(a,p,[R])}o(v0,"convertTransformerCancelCallback");class Ps{static{o(this,"TransformStream")}constructor(p={},P={},R={}){p===void 0&&(p=null);let N=ss(P,"Second parameter"),G=ss(R,"Third parameter"),K=m0(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=$i(G,0),Te=as(G),ye=$i(N,1),Ce=as(N),Me,et=h(Pr=>{Me=Pr});_0(this,et,ye,Ce,le,Te),w0(this,K),K.start!==void 0?Me(K.start(this._transformStreamController)):Me(void 0)}get readable(){if(!$h(this))throw zh("readable");return this._readable}get writable(){if(!$h(this))throw zh("writable");return this._writable}}Object.defineProperties(Ps.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ps.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function _0(a,p,P,R,N,G){function K(){return p}o(K,"startAlgorithm");function le(et){return S0(a,et)}o(le,"writeAlgorithm");function Te(et){return x0(a,et)}o(Te,"abortAlgorithm");function ye(){return E0(a)}o(ye,"closeAlgorithm"),a._writable=TR(K,le,ye,Te,P,R);function Ce(){return I0(a)}o(Ce,"pullAlgorithm");function Me(et){return A0(a,et)}o(Me,"cancelAlgorithm"),a._readable=zi(K,Ce,Me,N,G),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,ws(a,!0),a._transformStreamController=void 0}o(_0,"InitializeTransformStream");function $h(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof Ps}o($h,"IsTransformStream");function Oh(a,p){vr(a._readable._readableStreamController,p),hl(a,p)}o(Oh,"TransformStreamError");function hl(a,p){Ts(a._transformStreamController),Oi(a._writable._writableStreamController,p),gl(a)}o(hl,"TransformStreamErrorWritableAndUnblockWrite");function gl(a){a._backpressure&&ws(a,!1)}o(gl,"TransformStreamUnblockWrite");function ws(a,p){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=h(P=>{a._backpressureChangePromise_resolve=P}),a._backpressure=p}o(ws,"TransformStreamSetBackpressure");class Dn{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!bs(this))throw Ss("desiredSize");let p=this._controlledTransformStream._readable._readableStreamController;return fl(p)}enqueue(p=void 0){if(!bs(this))throw Ss("enqueue");Ch(this,p)}error(p=void 0){if(!bs(this))throw Ss("error");b0(this,p)}terminate(){if(!bs(this))throw Ss("terminate");T0(this)}}Object.defineProperties(Dn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Dn.prototype.enqueue,"enqueue"),i(Dn.prototype.error,"error"),i(Dn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Dn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function bs(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof Dn}o(bs,"IsTransformStreamDefaultController");function P0(a,p,P,R,N){p._controlledTransformStream=a,a._transformStreamController=p,p._transformAlgorithm=P,p._flushAlgorithm=R,p._cancelAlgorithm=N,p._finishPromise=void 0,p._finishPromise_resolve=void 0,p._finishPromise_reject=void 0}o(P0,"SetUpTransformStreamDefaultController");function w0(a,p){let P=Object.create(Dn.prototype),R,N,G;p.transform!==void 0?R=o(K=>p.transform(K,P),"transformAlgorithm"):R=o(K=>{try{return Ch(P,K),v(void 0)}catch(le){return _(le)}},"transformAlgorithm"),p.flush!==void 0?N=o(()=>p.flush(P),"flushAlgorithm"):N=o(()=>v(void 0),"flushAlgorithm"),p.cancel!==void 0?G=o(K=>p.cancel(K),"cancelAlgorithm"):G=o(()=>v(void 0),"cancelAlgorithm"),P0(a,P,R,N,G)}o(w0,"SetUpTransformStreamDefaultControllerFromTransformer");function Ts(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(Ts,"TransformStreamDefaultControllerClearAlgorithms");function Ch(a,p){let P=a._controlledTransformStream,R=P._readable._readableStreamController;if(!Co(R))throw new TypeError("Readable side is not in a state that permits enqueue");try{Oo(R,p)}catch(G){throw hl(P,G),P._readable._storedError}YR(R)!==P._backpressure&&ws(P,!0)}o(Ch,"TransformStreamDefaultControllerEnqueue");function b0(a,p){Oh(a._controlledTransformStream,p)}o(b0,"TransformStreamDefaultControllerError");function Nh(a,p){let P=a._transformAlgorithm(p);return D(P,void 0,R=>{throw Oh(a._controlledTransformStream,R),R})}o(Nh,"TransformStreamDefaultControllerPerformTransform");function T0(a){let p=a._controlledTransformStream,P=p._readable._readableStreamController;io(P);let R=new TypeError("TransformStream terminated");hl(p,R)}o(T0,"TransformStreamDefaultControllerTerminate");function S0(a,p){let P=a._transformStreamController;if(a._backpressure){let R=a._backpressureChangePromise;return D(R,()=>{let N=a._writable;if(N._state==="erroring")throw N._storedError;return Nh(P,p)})}return Nh(P,p)}o(S0,"TransformStreamDefaultSinkWriteAlgorithm");function x0(a,p){let P=a._transformStreamController;if(P._finishPromise!==void 0)return P._finishPromise;let R=a._readable;P._finishPromise=h((G,K)=>{P._finishPromise_resolve=G,P._finishPromise_reject=K});let N=P._cancelAlgorithm(p);return Ts(P),T(N,()=>(R._state==="errored"?No(P,R._storedError):(vr(R._readableStreamController,p),yl(P)),null),G=>(vr(R._readableStreamController,G),No(P,G),null)),P._finishPromise}o(x0,"TransformStreamDefaultSinkAbortAlgorithm");function E0(a){let p=a._transformStreamController;if(p._finishPromise!==void 0)return p._finishPromise;let P=a._readable;p._finishPromise=h((N,G)=>{p._finishPromise_resolve=N,p._finishPromise_reject=G});let R=p._flushAlgorithm();return Ts(p),T(R,()=>(P._state==="errored"?No(p,P._storedError):(io(P._readableStreamController),yl(p)),null),N=>(vr(P._readableStreamController,N),No(p,N),null)),p._finishPromise}o(E0,"TransformStreamDefaultSinkCloseAlgorithm");function I0(a){return ws(a,!1),a._backpressureChangePromise}o(I0,"TransformStreamDefaultSourcePullAlgorithm");function A0(a,p){let P=a._transformStreamController;if(P._finishPromise!==void 0)return P._finishPromise;let R=a._writable;P._finishPromise=h((G,K)=>{P._finishPromise_resolve=G,P._finishPromise_reject=K});let N=P._cancelAlgorithm(p);return Ts(P),T(N,()=>(R._state==="errored"?No(P,R._storedError):(Oi(R._writableStreamController,p),gl(a),yl(P)),null),G=>(Oi(R._writableStreamController,G),gl(a),No(P,G),null)),P._finishPromise}o(A0,"TransformStreamDefaultSourceCancelAlgorithm");function Ss(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(Ss,"defaultControllerBrandCheckException");function yl(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(yl,"defaultControllerFinishPromiseResolve");function No(a,p){a._finishPromise_reject!==void 0&&(E(a._finishPromise),a._finishPromise_reject(p),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(No,"defaultControllerFinishPromiseReject");function zh(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(zh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=vs,t.CountQueuingStrategy=_s,t.ReadableByteStreamController=tn,t.ReadableStream=$t,t.ReadableStreamBYOBReader=En,t.ReadableStreamBYOBRequest=Qn,t.ReadableStreamDefaultController=nn,t.ReadableStreamDefaultReader=Q,t.TransformStream=Ps,t.TransformStreamDefaultController=Dn,t.WritableStream=In,t.WritableStreamDefaultController=$o,t.WritableStreamDefaultWriter=rn}))});var rw=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,tw())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=o(function(r){let n=0,i=this;return new ReadableStream({type:"bytes",async pull(s){let m=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=m.byteLength,s.enqueue(new Uint8Array(m)),n===i.size&&s.close()}})},"name"))}catch{}});async function*Ld(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let n=r.byteOffset,i=r.byteOffset+r.byteLength;for(;n!==i;){let s=Math.min(i-n,nw),d=r.buffer.slice(n,n+s);n+=d.byteLength,yield new Uint8Array(d)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let d=await i.slice(n,Math.min(i.size,n+nw)).arrayBuffer();n+=d.byteLength,yield new Uint8Array(d)}}}var kX,nw,ow,cz,Sr,pa=St(()=>{kX=ue(rw(),1);nw=65536;o(Ld,"toIterator");ow=class jd{static{o(this,"Blob")}#e=[];#t="";#r=0;#n="transparent";constructor(e=[],r={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let n=new TextEncoder;for(let s of e){let 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 jd?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 i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Ld(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 Ld(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Ld(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let n=await e.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,n=""){let{size:i}=this,s=e<0?Math.max(i+e,0):Math.min(e,i),d=r<0?Math.max(i+r,0):Math.min(r,i),m=Math.max(d-s,0),h=this.#e,v=[],_=0;for(let T of h){if(_>=m)break;let w=ArrayBuffer.isView(T)?T.byteLength:T.size;if(s&&w<=s)s-=w,d-=w;else{let S;ArrayBuffer.isView(T)?(S=T.subarray(s,Math.min(w,d)),_+=S.byteLength):(S=T.slice(s,Math.min(w,d)),_+=S.size),d-=w,v.push(S),s=0}}let x=new jd([],{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(ow.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});cz=ow,Sr=cz});var lz,dz,Vn,qd=St(()=>{pa();lz=class extends Sr{static{o(this,"File")}#e=0;#t="";constructor(e,r,n={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,n),n===null&&(n={});let i=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(i)||(this.#e=i),this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof Sr&&/^(File)$/.test(e[Symbol.toStringTag])}},dz=lz,Vn=dz});function sw(t,e=Sr){var r=`${iw()}${iw()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
15
+ Content-Disposition: form-data; name="`;return t.forEach((s,d)=>typeof s=="string"?n.push(i+Bd(d)+`"\r
16
16
  \r
17
17
  ${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
18
18
  `)}\r
19
- `):n.push(o+Ld(p)+`"; filename="${Ld(s.name,1)}"\r
19
+ `):n.push(i+Bd(d)+`"; filename="${Bd(s.name,1)}"\r
20
20
  Content-Type: ${s.type||"application/octet-stream"}\r
21
21
  \r
22
22
  `,s,`\r
23
- `)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var pa,JN,YN,QP,XN,ew,Ld,di,Gn,yu=St(()=>{da();Fd();({toStringTag:pa,iterator:JN,hasInstance:YN}=Symbol),QP=Math.random,XN="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),ew=i((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[pa])?[(r=r!==void 0?r+"":e[pa]=="File"?e.name:"blob",t),e.name!==r||e[pa]=="blob"?new Vn([e],r,e):e]:[t,e+""]),"f"),Ld=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[pa](){return"FormData"}[JN](){return this.entries()}static[YN](e){return e&&typeof e=="object"&&e[pa]==="FormData"&&!XN.some(r=>typeof e[r]!="function")}append(...e){di("append",arguments,2),this.#e.push(ew(...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=ew(...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(tw,"formDataToBlob")});var mn,vu=St(()=>{mn=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 Nt,jd=St(()=>{vu();Nt=class extends mn{static{i(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var _u,qd,fa,rw,nw,iw,Pu=St(()=>{_u=Symbol.toStringTag,qd=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[_u]==="URLSearchParams","isURLSearchParameters"),fa=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[_u]),"isBlob"),rw=i(t=>typeof t=="object"&&(t[_u]==="AbortSignal"||t[_u]==="EventTarget"),"isAbortSignal"),nw=i((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),iw=i((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var aw=L((mX,ow)=>{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)}ow.exports=globalThis.DOMException});var pi,sw,uw,Bd,cw,lw,dw,pw,fw,mw,wu,Vd=St(()=>{pi=require("node:fs"),sw=require("node:path"),uw=ue(aw(),1);Fd();da();({stat:Bd}=pi.promises),cw=i((t,e)=>fw((0,pi.statSync)(t),t,e),"blobFromSync"),lw=i((t,e)=>Bd(t).then(r=>fw(r,t,e)),"blobFrom"),dw=i((t,e)=>Bd(t).then(r=>mw(r,t,e)),"fileFrom"),pw=i((t,e)=>mw((0,pi.statSync)(t),t,e),"fileFromSync"),fw=i((t,e,r="")=>new Tr([new wu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),mw=i((t,e,r="")=>new Vn([new wu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,sw.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),wu=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 Bd(this.#e);if(e>this.lastModified)throw new uw.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 gw={};xs(gw,{toFormData:()=>ok});function ik(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 ok(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 Gd(r[1]||r[2]),o,s,p,m,h,v,P=[],x=new Gn,T=i(u=>{p+=E.decode(u,{stream:!0})},"onPartData"),w=i(u=>{P.push(u)},"appendToFile"),S=i(()=>{let u=new Vn(P,v,{type:h});x.append(m,u)},"appendFileToFormData"),D=i(()=>{x.append(m,p)},"appendEntryToFormData"),E=new TextDecoder("utf-8");E.decode(),n.onPartBegin=function(){n.onPartData=T,n.onPartEnd=D,o="",s="",p="",m="",h="",v=null,P.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=ik(s),v&&(n.onPartData=w,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 Fr,rt,hw,Hn,bu,Tu,QN,ma,ek,tk,rk,nk,fi,Gd,yw=St(()=>{Vd();yu();Fr=0,rt={START_BOUNDARY:Fr++,HEADER_FIELD_START:Fr++,HEADER_FIELD:Fr++,HEADER_VALUE_START:Fr++,HEADER_VALUE:Fr++,HEADER_VALUE_ALMOST_DONE:Fr++,HEADERS_ALMOST_DONE:Fr++,PART_DATA_START:Fr++,PART_DATA:Fr++,END:Fr++},hw=1,Hn={PART_BOUNDARY:hw,LAST_BOUNDARY:hw*=2},bu=10,Tu=13,QN=32,ma=45,ek=58,tk=97,rk=122,nk=i(t=>t|32,"lower"),fi=i(()=>{},"noop"),Gd=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:p,boundaryChars:m,index:h,state:v,flags:P}=this,x=this.boundary.length,T=x-1,w=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===p.length-2){if(S===ma)P|=Hn.LAST_BOUNDARY;else if(S!==Tu)return;h++;break}else if(h-1===p.length-2){if(P&Hn.LAST_BOUNDARY&&S===ma)v=rt.END,P=0;else if(!(P&Hn.LAST_BOUNDARY)&&S===bu)h=0,f("onPartBegin"),v=rt.HEADER_FIELD_START;else return;break}S!==p[h+2]&&(h=-2),S===p[h+2]&&h++;break;case rt.HEADER_FIELD_START:v=rt.HEADER_FIELD,E("onHeaderField"),h=0;case rt.HEADER_FIELD:if(S===Tu){u("onHeaderField"),v=rt.HEADERS_ALMOST_DONE;break}if(h++,S===ma)break;if(S===ek){if(h===1)return;c("onHeaderField",!0),v=rt.HEADER_VALUE_START;break}if(D=nk(S),D<tk||D>rk)return;break;case rt.HEADER_VALUE_START:if(S===QN)break;E("onHeaderValue"),v=rt.HEADER_VALUE;case rt.HEADER_VALUE:S===Tu&&(c("onHeaderValue",!0),f("onHeaderEnd"),v=rt.HEADER_VALUE_ALMOST_DONE);break;case rt.HEADER_VALUE_ALMOST_DONE:if(S!==bu)return;v=rt.HEADER_FIELD_START;break;case rt.HEADERS_ALMOST_DONE:if(S!==bu)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<w&&!(e[r]in m);)r+=x;r-=T,S=e[r]}if(h<p.length)p[h]===S?(h===0&&c("onPartData",!0),h++):h=0;else if(h===p.length)h++,S===Tu?P|=Hn.PART_BOUNDARY:S===ma?P|=Hn.LAST_BOUNDARY:h=0;else if(h-1===p.length)if(P&Hn.PART_BOUNDARY){if(h=0,S===bu){P&=~Hn.PART_BOUNDARY,f("onPartEnd"),f("onPartBegin"),v=rt.HEADER_FIELD_START;break}}else P&Hn.LAST_BOUNDARY&&S===ma?(f("onPartEnd"),v=rt.END,P=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=P}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(ik,"_fileName");i(ok,"toFormData")});async function Hd(t){if(t[Lt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Lt].disturbed=!0,t[Lt].error)throw t[Lt].error;let{body:e}=t;if(e===null)return Jt.Buffer.alloc(0);if(!(e instanceof fr.default))return Jt.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 Nt(`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 mn?o:new Nt(`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")?Jt.Buffer.from(r.join("")):Jt.Buffer.concat(r,n)}catch(o){throw new Nt(`Could not create Buffer from response body for ${t.url}: ${o.message}`,"system",o)}else throw new Nt(`Premature close of server response while trying to fetch ${t.url}`)}var fr,hn,Jt,ak,Lt,Lr,ro,sk,Su,vw,_w,xu=St(()=>{fr=ue(require("node:stream"),1),hn=require("node:util"),Jt=require("node:buffer");da();yu();jd();vu();Pu();ak=(0,hn.promisify)(fr.default.pipeline),Lt=Symbol("Body internals"),Lr=class{static{i(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:qd(e)?e=Jt.Buffer.from(e.toString()):fa(e)||Jt.Buffer.isBuffer(e)||(hn.types.isAnyArrayBuffer(e)?e=Jt.Buffer.from(e):ArrayBuffer.isView(e)?e=Jt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof fr.default||(e instanceof Gn?(e=tw(e),n=e.type.split("=")[1]):e=Jt.Buffer.from(String(e))));let o=e;Jt.Buffer.isBuffer(e)?o=fr.default.Readable.from(e):fa(e)&&(o=fr.default.Readable.from(e.stream())),this[Lt]={body:e,stream:o,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof fr.default&&e.on("error",s=>{let p=s instanceof mn?s:new Nt(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Lt].error=p})}get body(){return this[Lt].stream}get bodyUsed(){return this[Lt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Hd(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,p]of o)n.append(s,p);return n}let{toFormData:r}=await Promise.resolve().then(()=>(yw(),gw));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Lt].body&&this[Lt].body.type||"",r=await this.arrayBuffer();return new Tr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await Hd(this);return new TextDecoder().decode(e)}buffer(){return Hd(this)}};Lr.prototype.buffer=(0,hn.deprecate)(Lr.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Lr.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,hn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});i(Hd,"consumeBody");ro=i((t,e)=>{let r,n,{body:o}=t[Lt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof fr.default&&typeof o.getBoundary!="function"&&(r=new fr.PassThrough({highWaterMark:e}),n=new fr.PassThrough({highWaterMark:e}),o.pipe(r),o.pipe(n),t[Lt].stream=r,o=n),o},"clone"),sk=(0,hn.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"),Su=i((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":qd(t)?"application/x-www-form-urlencoded;charset=UTF-8":fa(t)?t.type||null:Jt.Buffer.isBuffer(t)||hn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Gn?`multipart/form-data; boundary=${e[Lt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${sk(t)}`:t instanceof fr.default?null:"text/plain;charset=UTF-8","extractContentType"),vw=i(t=>{let{body:e}=t[Lt];return e===null?0:fa(e)?e.size:Jt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),_w=i(async(t,{body:e})=>{e===null?t.end():await ak(e,t)},"writeToStream")});function Pw(t=[]){return new jt(t.reduce((e,r,n,o)=>(n%2===0&&e.push(o.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return Eu(e),Zd(e,String(r)),!0}catch{return!1}}))}var Wd,ha,Eu,Zd,jt,Iu=St(()=>{Wd=require("node:util"),ha=ue(require("node:http"),1),Eu=typeof ha.default.validateHeaderName=="function"?ha.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}},Zd=typeof ha.default.validateHeaderValue=="function"?ha.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}},jt=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(p=>[o,p]))}else if(e!=null)if(typeof e=="object"&&!Wd.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"||Wd.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])=>(Eu(n),Zd(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(p,m)=>(Eu(p),Zd(p,String(m)),URLSearchParams.prototype[o].call(n,String(p).toLowerCase(),String(m)));case"delete":case"has":case"getAll":return p=>(Eu(p),URLSearchParams.prototype[o].call(n,String(p).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(jt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));i(Pw,"fromRawHeaders")});var uk,ga,Kd=St(()=>{uk=new Set([301,302,303,307,308]),ga=i(t=>uk.has(t),"isRedirect")});var Sr,Yt,ww=St(()=>{Iu();xu();Kd();Sr=Symbol("Response internals"),Yt=class t extends Lr{static{i(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,o=new jt(r.headers);if(e!==null&&!o.has("Content-Type")){let s=Su(e,this);s&&o.append("Content-Type",s)}this[Sr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:o,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Sr].type}get url(){return this[Sr].url||""}get status(){return this[Sr].status}get ok(){return this[Sr].status>=200&&this[Sr].status<300}get redirected(){return this[Sr].counter>0}get statusText(){return this[Sr].statusText}get headers(){return this[Sr].headers}get highWaterMark(){return this[Sr].highWaterMark}clone(){return new t(ro(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(!ga(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[Sr].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 jt(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(Yt.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 bw,Tw=St(()=>{bw=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 Sw(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 Aw(t){if(!Ew.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function ck(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,xw.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 no(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:ck(t)}function Rw(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=Sw(o),p=Sw(o,!0);s.toString().length>4096&&(s=p),e&&(s=e(s)),r&&(p=r(p));let m=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return p;case"unsafe-url":return s;case"strict-origin":return no(s)&&!no(m)?"no-referrer":p.toString();case"strict-origin-when-cross-origin":return s.origin===m.origin?s:no(s)&&!no(m)?"no-referrer":p;case"same-origin":return s.origin===m.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===m.origin?s:p;case"no-referrer-when-downgrade":return no(s)&&!no(m)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function Dw(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&Ew.has(n)&&(r=n);return r}var xw,Ew,Iw,Jd=St(()=>{xw=require("node:net");i(Sw,"stripURLForUseAsAReferrer");Ew=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),Iw="strict-origin-when-cross-origin";i(Aw,"validateReferrerPolicy");i(ck,"isOriginPotentiallyTrustworthy");i(no,"isUrlPotentiallyTrustworthy");i(Rw,"determineRequestsReferrer");i(Dw,"parseReferrerPolicyFromHeader")});var $w,Ow,At,ya,lk,Wn,Cw,Nw=St(()=>{$w=require("node:url"),Ow=require("node:util");Iu();xu();Pu();Tw();Jd();At=Symbol("Request internals"),ya=i(t=>typeof t=="object"&&typeof t[At]=="object","isRequest"),lk=(0,Ow.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 Lr{static{i(this,"Request")}constructor(e,r={}){let n;if(ya(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()),!ya(r)&&"data"in r&&lk(),(r.body!=null||ya(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:ya(e)&&e.body!==null?ro(e):null;super(s,{size:r.size||e.size||0});let p=new jt(r.headers||e.headers||{});if(s!==null&&!p.has("Content-Type")){let v=Su(s,this);v&&p.set("Content-Type",v)}let m=ya(e)?e.signal:null;if("signal"in r&&(m=r.signal),m!=null&&!rw(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[At]={method:o,redirect:r.redirect||e.redirect||"follow",headers:p,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[At].method}get url(){return(0,$w.format)(this[At].parsedURL)}get headers(){return this[At].headers}get redirect(){return this[At].redirect}get signal(){return this[At].signal}get referrer(){if(this[At].referrer==="no-referrer")return"";if(this[At].referrer==="client")return"about:client";if(this[At].referrer)return this[At].referrer.toString()}get referrerPolicy(){return this[At].referrerPolicy}set referrerPolicy(e){this[At].referrerPolicy=Aw(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}});Cw=i(t=>{let{parsedURL:e}=t[At],r=new jt(t[At].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=vw(t);typeof m=="number"&&!Number.isNaN(m)&&(n=String(m))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=Iw),t.referrer&&t.referrer!=="no-referrer"?t[At].referrer=Rw(t):t[At].referrer="no-referrer",t[At].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=bw(e),p={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:o};return{parsedURL:e,options:p}},"getNodeRequestOptions")});var va,kw=St(()=>{vu();va=class extends mn{static{i(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var Mw={};xs(Mw,{AbortError:()=>va,Blob:()=>Tr,FetchError:()=>Nt,File:()=>Vn,FormData:()=>Gn,Headers:()=>jt,Request:()=>Wn,Response:()=>Yt,blobFrom:()=>lw,blobFromSync:()=>cw,default:()=>Yd,fileFrom:()=>dw,fileFromSync:()=>pw,isRedirect:()=>ga});async function Yd(t,e){return new Promise((r,n)=>{let o=new Wn(t,e),{parsedURL:s,options:p}=Cw(o);if(!dk.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=HP(o.url),D=new Yt(S,{headers:{"Content-Type":S.typeFull}});r(D);return}let m=(s.protocol==="https:"?Uw.default:zw.default).request,{signal:h}=o,v=null,P=i(()=>{let S=new va("The operation was aborted.");n(S),o.body&&o.body instanceof Xt.default.Readable&&o.body.destroy(S),!(!v||!v.body)&&v.body.emit("error",S)},"abort");if(h&&h.aborted){P();return}let x=i(()=>{P(),w()},"abortAndFinalize"),T=m(s.toString(),p);h&&h.addEventListener("abort",x);let w=i(()=>{T.abort(),h&&h.removeEventListener("abort",x)},"finalize");T.on("error",S=>{n(new Nt(`request to ${o.url} failed, reason: ${S.message}`,"system",S)),w()}),pk(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=Pw(S.rawHeaders);if(ga(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 Nt(`uri requested responds with an invalid redirect URL: ${y}`,"invalid-redirect")),w();return}}switch(o.redirect){case"error":n(new Nt(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),w();return;case"manual":break;case"follow":{if(l===null)break;if(o.counter>=o.follow){n(new Nt(`maximum redirect reached at: ${o.url}`,"max-redirect")),w();return}let b={headers:new jt(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:ro(o),signal:o.signal,size:o.size,referrer:o.referrer,referrerPolicy:o.referrerPolicy};if(!nw(o.url,l)||!iw(o.url,l))for(let oe of["authorization","www-authenticate","cookie","cookie2"])b.headers.delete(oe);if(S.statusCode!==303&&o.body&&e.body instanceof Xt.default.Readable){n(new Nt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),w();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=Dw(D);g&&(b.referrerPolicy=g),r(Yd(new Wn(l,b))),w();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,Xt.pipeline)(S,new Xt.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 Yt(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,Xt.pipeline)(E,mi.default.createGunzip(c),y=>{y&&n(y)}),v=new Yt(E,u),r(v);return}if(f==="deflate"||f==="x-deflate"){let y=(0,Xt.pipeline)(S,new Xt.PassThrough,l=>{l&&n(l)});y.once("data",l=>{(l[0]&15)===8?E=(0,Xt.pipeline)(E,mi.default.createInflate(),b=>{b&&n(b)}):E=(0,Xt.pipeline)(E,mi.default.createInflateRaw(),b=>{b&&n(b)}),v=new Yt(E,u),r(v)}),y.once("end",()=>{v||(v=new Yt(E,u),r(v))});return}if(f==="br"){E=(0,Xt.pipeline)(E,mi.default.createBrotliDecompress(),y=>{y&&n(y)}),v=new Yt(E,u),r(v);return}v=new Yt(E,u),r(v)}),_w(T,o).catch(n)})}function pk(t,e){let r=_a.Buffer.from(`0\r
23
+ `)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var fa,pz,fz,iw,mz,aw,Bd,po,Gn,yu=St(()=>{pa();qd();({toStringTag:fa,iterator:pz,hasInstance:fz}=Symbol),iw=Math.random,mz="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),aw=o((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[fa])?[(r=r!==void 0?r+"":e[fa]=="File"?e.name:"blob",t),e.name!==r||e[fa]=="blob"?new Vn([e],r,e):e]:[t,e+""]),"f"),Bd=o((t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r
24
+ `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),po=o((t,e,r)=>{if(e.length<r)throw new TypeError(`Failed to execute '${t}' on 'FormData': ${r} arguments required, but only ${e.length} present.`)},"x"),Gn=class{static{o(this,"FormData")}#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[fa](){return"FormData"}[pz](){return this.entries()}static[fz](e){return e&&typeof e=="object"&&e[fa]==="FormData"&&!mz.some(r=>typeof e[r]!="function")}append(...e){po("append",arguments,2),this.#e.push(aw(...e))}delete(e){po("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){po("get",arguments,1),e+="";for(var r=this.#e,n=r.length,i=0;i<n;i++)if(r[i][0]===e)return r[i][1];return null}getAll(e,r){return po("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return po("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){po("forEach",arguments,1);for(var[n,i]of this)e.call(r,i,n,this)}set(...e){po("set",arguments,2);var r=[],n=!0;e=aw(...e),this.#e.forEach(i=>{i[0]===e[0]?n&&(n=!r.push(e)):r.push(i)}),n&&r.push(e),this.#e=r}*entries(){yield*this.#e}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}};o(sw,"formDataToBlob")});var hn,vu=St(()=>{hn=class extends Error{static{o(this,"FetchBaseError")}constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var Nt,Vd=St(()=>{vu();Nt=class extends hn{static{o(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var _u,Gd,ma,uw,cw,lw,Pu=St(()=>{_u=Symbol.toStringTag,Gd=o(t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[_u]==="URLSearchParams","isURLSearchParameters"),ma=o(t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[_u]),"isBlob"),uw=o(t=>typeof t=="object"&&(t[_u]==="AbortSignal"||t[_u]==="EventTarget"),"isAbortSignal"),cw=o((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),lw=o((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var pw=L((t7,dw)=>{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)}dw.exports=globalThis.DOMException});var fo,fw,mw,Hd,hw,gw,yw,vw,_w,Pw,wu,Wd=St(()=>{fo=require("node:fs"),fw=require("node:path"),mw=ue(pw(),1);qd();pa();({stat:Hd}=fo.promises),hw=o((t,e)=>_w((0,fo.statSync)(t),t,e),"blobFromSync"),gw=o((t,e)=>Hd(t).then(r=>_w(r,t,e)),"blobFrom"),yw=o((t,e)=>Hd(t).then(r=>Pw(r,t,e)),"fileFrom"),vw=o((t,e)=>Pw((0,fo.statSync)(t),t,e),"fileFromSync"),_w=o((t,e,r="")=>new Sr([new wu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),Pw=o((t,e,r="")=>new Vn([new wu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,fw.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),wu=class t{static{o(this,"BlobDataItem")}#e;#t;constructor(e){this.#e=e.path,this.#t=e.start,this.size=e.size,this.lastModified=e.lastModified}slice(e,r){return new t({path:this.#e,lastModified:this.lastModified,size:r-e,start:this.#t+e})}async*stream(){let{mtimeMs:e}=await Hd(this.#e);if(e>this.lastModified)throw new mw.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,fo.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var bw={};Es(bw,{toFormData:()=>wz});function Pz(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let r=e[2]||e[3]||"",n=r.slice(r.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,(i,s)=>String.fromCharCode(s)),n}async function wz(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 Zd(r[1]||r[2]),i,s,d,m,h,v,_=[],x=new Gn,T=o(u=>{d+=E.decode(u,{stream:!0})},"onPartData"),w=o(u=>{_.push(u)},"appendToFile"),S=o(()=>{let u=new Vn(_,v,{type:h});x.append(m,u)},"appendFileToFormData"),D=o(()=>{x.append(m,d)},"appendEntryToFormData"),E=new TextDecoder("utf-8");E.decode(),n.onPartBegin=function(){n.onPartData=T,n.onPartEnd=D,i="",s="",d="",m="",h="",v=null,_.length=0},n.onHeaderField=function(u){i+=E.decode(u,{stream:!0})},n.onHeaderValue=function(u){s+=E.decode(u,{stream:!0})},n.onHeaderEnd=function(){if(s+=E.decode(),i=i.toLowerCase(),i==="content-disposition"){let u=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);u&&(m=u[2]||u[3]||""),v=Pz(s),v&&(n.onPartData=w,n.onPartEnd=S)}else i==="content-type"&&(h=s);s="",i=""};for await(let u of t)n.write(u);return n.end(),x}var Fr,rt,ww,Hn,bu,Tu,hz,ha,gz,yz,vz,_z,mo,Zd,Tw=St(()=>{Wd();yu();Fr=0,rt={START_BOUNDARY:Fr++,HEADER_FIELD_START:Fr++,HEADER_FIELD:Fr++,HEADER_VALUE_START:Fr++,HEADER_VALUE:Fr++,HEADER_VALUE_ALMOST_DONE:Fr++,HEADERS_ALMOST_DONE:Fr++,PART_DATA_START:Fr++,PART_DATA:Fr++,END:Fr++},ww=1,Hn={PART_BOUNDARY:ww,LAST_BOUNDARY:ww*=2},bu=10,Tu=13,hz=32,ha=45,gz=58,yz=97,vz=122,_z=o(t=>t|32,"lower"),mo=o(()=>{},"noop"),Zd=class{static{o(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=mo,this.onHeaderField=mo,this.onHeadersEnd=mo,this.onHeaderValue=mo,this.onPartBegin=mo,this.onPartData=mo,this.onPartEnd=mo,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,i=this.index,{lookbehind:s,boundary:d,boundaryChars:m,index:h,state:v,flags:_}=this,x=this.boundary.length,T=x-1,w=e.length,S,D,E=o(y=>{this[y+"Mark"]=r},"mark"),u=o(y=>{delete this[y+"Mark"]},"clear"),f=o((y,l,b,g)=>{(l===void 0||l!==b)&&this[y](g&&g.subarray(l,b))},"callback"),c=o((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===ha)_|=Hn.LAST_BOUNDARY;else if(S!==Tu)return;h++;break}else if(h-1===d.length-2){if(_&Hn.LAST_BOUNDARY&&S===ha)v=rt.END,_=0;else if(!(_&Hn.LAST_BOUNDARY)&&S===bu)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===Tu){u("onHeaderField"),v=rt.HEADERS_ALMOST_DONE;break}if(h++,S===ha)break;if(S===gz){if(h===1)return;c("onHeaderField",!0),v=rt.HEADER_VALUE_START;break}if(D=_z(S),D<yz||D>vz)return;break;case rt.HEADER_VALUE_START:if(S===hz)break;E("onHeaderValue"),v=rt.HEADER_VALUE;case rt.HEADER_VALUE:S===Tu&&(c("onHeaderValue",!0),f("onHeaderEnd"),v=rt.HEADER_VALUE_ALMOST_DONE);break;case rt.HEADER_VALUE_ALMOST_DONE:if(S!==bu)return;v=rt.HEADER_FIELD_START;break;case rt.HEADERS_ALMOST_DONE:if(S!==bu)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(i=h,h===0){for(r+=T;r<w&&!(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===Tu?_|=Hn.PART_BOUNDARY:S===ha?_|=Hn.LAST_BOUNDARY:h=0;else if(h-1===d.length)if(_&Hn.PART_BOUNDARY){if(h=0,S===bu){_&=~Hn.PART_BOUNDARY,f("onPartEnd"),f("onPartBegin"),v=rt.HEADER_FIELD_START;break}}else _&Hn.LAST_BOUNDARY&&S===ha?(f("onPartEnd"),v=rt.END,_=0):h=0;if(h>0)s[h-1]=S;else if(i>0){let y=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);f("onPartData",0,i,y),i=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")}};o(Pz,"_fileName");o(wz,"toFormData")});async function Kd(t){if(t[Lt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Lt].disturbed=!0,t[Lt].error)throw t[Lt].error;let{body:e}=t;if(e===null)return Jt.Buffer.alloc(0);if(!(e instanceof fr.default))return Jt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let s=new Nt(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}n+=i.length,r.push(i)}}catch(i){throw i instanceof hn?i:new Nt(`Invalid response body while trying to fetch ${t.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?Jt.Buffer.from(r.join("")):Jt.Buffer.concat(r,n)}catch(i){throw new Nt(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new Nt(`Premature close of server response while trying to fetch ${t.url}`)}var fr,gn,Jt,bz,Lt,Lr,oi,Tz,Su,Sw,xw,xu=St(()=>{fr=ue(require("node:stream"),1),gn=require("node:util"),Jt=require("node:buffer");pa();yu();Vd();vu();Pu();bz=(0,gn.promisify)(fr.default.pipeline),Lt=Symbol("Body internals"),Lr=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:Gd(e)?e=Jt.Buffer.from(e.toString()):ma(e)||Jt.Buffer.isBuffer(e)||(gn.types.isAnyArrayBuffer(e)?e=Jt.Buffer.from(e):ArrayBuffer.isView(e)?e=Jt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof fr.default||(e instanceof Gn?(e=sw(e),n=e.type.split("=")[1]):e=Jt.Buffer.from(String(e))));let i=e;Jt.Buffer.isBuffer(e)?i=fr.default.Readable.from(e):ma(e)&&(i=fr.default.Readable.from(e.stream())),this[Lt]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof fr.default&&e.on("error",s=>{let d=s instanceof hn?s:new Nt(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Lt].error=d})}get body(){return this[Lt].stream}get bodyUsed(){return this[Lt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Kd(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,i=new URLSearchParams(await this.text());for(let[s,d]of i)n.append(s,d);return n}let{toFormData:r}=await Promise.resolve().then(()=>(Tw(),bw));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Lt].body&&this[Lt].body.type||"",r=await this.arrayBuffer();return new Sr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await Kd(this);return new TextDecoder().decode(e)}buffer(){return Kd(this)}};Lr.prototype.buffer=(0,gn.deprecate)(Lr.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Lr.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)")}});o(Kd,"consumeBody");oi=o((t,e)=>{let r,n,{body:i}=t[Lt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof fr.default&&typeof i.getBoundary!="function"&&(r=new fr.PassThrough({highWaterMark:e}),n=new fr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[Lt].stream=r,i=n),i},"clone"),Tz=(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"),Su=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Gd(t)?"application/x-www-form-urlencoded;charset=UTF-8":ma(t)?t.type||null:Jt.Buffer.isBuffer(t)||gn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Gn?`multipart/form-data; boundary=${e[Lt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${Tz(t)}`:t instanceof fr.default?null:"text/plain;charset=UTF-8","extractContentType"),Sw=o(t=>{let{body:e}=t[Lt];return e===null?0:ma(e)?e.size:Jt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),xw=o(async(t,{body:e})=>{e===null?t.end():await bz(e,t)},"writeToStream")});function Ew(t=[]){return new jt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return Eu(e),Yd(e,String(r)),!0}catch{return!1}}))}var Jd,ga,Eu,Yd,jt,Iu=St(()=>{Jd=require("node:util"),ga=ue(require("node:http"),1),Eu=typeof ga.default.validateHeaderName=="function"?ga.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}},Yd=typeof ga.default.validateHeaderValue=="function"?ga.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}},jt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,s]of Object.entries(n))r.push(...s.map(d=>[i,d]))}else if(e!=null)if(typeof e=="object"&&!Jd.types.isBoxedPrimitive(e)){let n=e[Symbol.iterator];if(n==null)r.push(...Object.entries(e));else{if(typeof n!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(i=>{if(typeof i!="object"||Jd.types.isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([n,i])=>(Eu(n),Yd(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,s){switch(i){case"append":case"set":return(d,m)=>(Eu(d),Yd(d,String(m)),URLSearchParams.prototype[i].call(n,String(d).toLowerCase(),String(m)));case"delete":case"has":case"getAll":return d=>(Eu(d),URLSearchParams.prototype[i].call(n,String(d).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(jt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(Ew,"fromRawHeaders")});var Sz,ya,Xd=St(()=>{Sz=new Set([301,302,303,307,308]),ya=o(t=>Sz.has(t),"isRedirect")});var xr,Yt,Iw=St(()=>{Iu();xu();Xd();xr=Symbol("Response internals"),Yt=class t extends Lr{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new jt(r.headers);if(e!==null&&!i.has("Content-Type")){let s=Su(e,this);s&&i.append("Content-Type",s)}this[xr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[xr].type}get url(){return this[xr].url||""}get status(){return this[xr].status}get ok(){return this[xr].status>=200&&this[xr].status<300}get redirected(){return this[xr].counter>0}get statusText(){return this[xr].statusText}get headers(){return this[xr].headers}get highWaterMark(){return this[xr].highWaterMark}clone(){return new t(oi(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(!ya(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[xr].type="error",e}static json(e=void 0,r={}){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("data is not JSON serializable");let i=new jt(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new t(n,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Yt.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 Aw,Rw=St(()=>{Aw=o(t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""},"getSearch")});function Dw(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 Nw(t){if(!Ow.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function xz(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,$w.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 ii(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:xz(t)}function zw(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let n=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,s=Dw(i),d=Dw(i,!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 ii(s)&&!ii(m)?"no-referrer":d.toString();case"strict-origin-when-cross-origin":return s.origin===m.origin?s:ii(s)&&!ii(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 ii(s)&&!ii(m)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function kw(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&Ow.has(n)&&(r=n);return r}var $w,Ow,Cw,Qd=St(()=>{$w=require("node:net");o(Dw,"stripURLForUseAsAReferrer");Ow=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),Cw="strict-origin-when-cross-origin";o(Nw,"validateReferrerPolicy");o(xz,"isOriginPotentiallyTrustworthy");o(ii,"isUrlPotentiallyTrustworthy");o(zw,"determineRequestsReferrer");o(kw,"parseReferrerPolicyFromHeader")});var Uw,Mw,Rt,va,Ez,Wn,Fw,Lw=St(()=>{Uw=require("node:url"),Mw=require("node:util");Iu();xu();Pu();Rw();Qd();Rt=Symbol("Request internals"),va=o(t=>typeof t=="object"&&typeof t[Rt]=="object","isRequest"),Ez=(0,Mw.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 Lr{static{o(this,"Request")}constructor(e,r={}){let n;if(va(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==""||n.password!=="")throw new TypeError(`${n} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!va(r)&&"data"in r&&Ez(),(r.body!=null||va(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:va(e)&&e.body!==null?oi(e):null;super(s,{size:r.size||e.size||0});let d=new jt(r.headers||e.headers||{});if(s!==null&&!d.has("Content-Type")){let v=Su(s,this);v&&d.set("Content-Type",v)}let m=va(e)?e.signal:null;if("signal"in r&&(m=r.signal),m!=null&&!uw(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:i,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,Uw.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=Nw(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}});Fw=o(t=>{let{parsedURL:e}=t[Rt],r=new jt(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=Sw(t);typeof m=="number"&&!Number.isNaN(m)&&(n=String(m))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=Cw),t.referrer&&t.referrer!=="no-referrer"?t[Rt].referrer=zw(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:i}=t;typeof i=="function"&&(i=i(e));let s=Aw(e),d={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:d}},"getNodeRequestOptions")});var _a,jw=St(()=>{vu();_a=class extends hn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var Vw={};Es(Vw,{AbortError:()=>_a,Blob:()=>Sr,FetchError:()=>Nt,File:()=>Vn,FormData:()=>Gn,Headers:()=>jt,Request:()=>Wn,Response:()=>Yt,blobFrom:()=>gw,blobFromSync:()=>hw,default:()=>ep,fileFrom:()=>yw,fileFromSync:()=>vw,isRedirect:()=>ya});async function ep(t,e){return new Promise((r,n)=>{let i=new Wn(t,e),{parsedURL:s,options:d}=Fw(i);if(!Iz.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=XP(i.url),D=new Yt(S,{headers:{"Content-Type":S.typeFull}});r(D);return}let m=(s.protocol==="https:"?Bw.default:qw.default).request,{signal:h}=i,v=null,_=o(()=>{let S=new _a("The operation was aborted.");n(S),i.body&&i.body instanceof Xt.default.Readable&&i.body.destroy(S),!(!v||!v.body)&&v.body.emit("error",S)},"abort");if(h&&h.aborted){_();return}let x=o(()=>{_(),w()},"abortAndFinalize"),T=m(s.toString(),d);h&&h.addEventListener("abort",x);let w=o(()=>{T.abort(),h&&h.removeEventListener("abort",x)},"finalize");T.on("error",S=>{n(new Nt(`request to ${i.url} failed, reason: ${S.message}`,"system",S)),w()}),Az(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=Ew(S.rawHeaders);if(ya(S.statusCode)){let y=D.get("Location"),l=null;try{l=y===null?null:new URL(y,i.url)}catch{if(i.redirect!=="manual"){n(new Nt(`uri requested responds with an invalid redirect URL: ${y}`,"invalid-redirect")),w();return}}switch(i.redirect){case"error":n(new Nt(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),w();return;case"manual":break;case"follow":{if(l===null)break;if(i.counter>=i.follow){n(new Nt(`maximum redirect reached at: ${i.url}`,"max-redirect")),w();return}let b={headers:new jt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:oi(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!cw(i.url,l)||!lw(i.url,l))for(let ie of["authorization","www-authenticate","cookie","cookie2"])b.headers.delete(ie);if(S.statusCode!==303&&i.body&&e.body instanceof Xt.default.Readable){n(new Nt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),w();return}(S.statusCode===303||(S.statusCode===301||S.statusCode===302)&&i.method==="POST")&&(b.method="GET",b.body=void 0,b.headers.delete("content-length"));let g=kw(D);g&&(b.referrerPolicy=g),r(ep(new Wn(l,b))),w();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}h&&S.once("end",()=>{h.removeEventListener("abort",x)});let E=(0,Xt.pipeline)(S,new Xt.PassThrough,y=>{y&&n(y)});process.version<"v12.10"&&S.on("aborted",x);let u={url:i.url,status:S.statusCode,statusText:S.statusMessage,headers:D,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},f=D.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||f===null||S.statusCode===204||S.statusCode===304){v=new Yt(E,u),r(v);return}let c={flush:ho.default.Z_SYNC_FLUSH,finishFlush:ho.default.Z_SYNC_FLUSH};if(f==="gzip"||f==="x-gzip"){E=(0,Xt.pipeline)(E,ho.default.createGunzip(c),y=>{y&&n(y)}),v=new Yt(E,u),r(v);return}if(f==="deflate"||f==="x-deflate"){let y=(0,Xt.pipeline)(S,new Xt.PassThrough,l=>{l&&n(l)});y.once("data",l=>{(l[0]&15)===8?E=(0,Xt.pipeline)(E,ho.default.createInflate(),b=>{b&&n(b)}):E=(0,Xt.pipeline)(E,ho.default.createInflateRaw(),b=>{b&&n(b)}),v=new Yt(E,u),r(v)}),y.once("end",()=>{v||(v=new Yt(E,u),r(v))});return}if(f==="br"){E=(0,Xt.pipeline)(E,ho.default.createBrotliDecompress(),y=>{y&&n(y)}),v=new Yt(E,u),r(v);return}v=new Yt(E,u),r(v)}),xw(T,i).catch(n)})}function Az(t,e){let r=Pa.Buffer.from(`0\r
26
26
  \r
27
- `),n=!1,o=!1,s;t.on("response",p=>{let{headers:m}=p;n=m["transfer-encoding"]==="chunked"&&!m["content-length"]}),t.on("socket",p=>{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=_a.Buffer.compare(v.slice(-5),r)===0,!o&&s&&(o=_a.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&_a.Buffer.compare(v.slice(-2),r.slice(3))===0),s=v},"onData");p.prependListener("close",m),p.on("data",h),t.on("close",()=>{p.removeListener("close",m),p.removeListener("data",h)})})}var zw,Uw,mi,Xt,_a,dk,Fw=St(()=>{zw=ue(require("node:http"),1),Uw=ue(require("node:https"),1),mi=ue(require("node:zlib"),1),Xt=ue(require("node:stream"),1),_a=require("node:buffer");WP();xu();ww();Iu();Nw();jd();kw();Kd();yu();Pu();Jd();Vd();dk=new Set(["data:","http:","https:"]);i(Yd,"fetch");i(pk,"fixResponseChunkedTransferBadEnding")});var qw=L(oo=>{"use strict";var fk=oo&&oo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},io;Object.defineProperty(oo,"__esModule",{value:!0});oo.Gaxios=void 0;var mk=fk(ca()),hk=require("https"),hi=Id(),gk=PP(),Lw=require("stream"),jw=Dd(),yk=i(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),vk=204,Au=class{static{i(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new jw.GaxiosInterceptorManager,response:new jw.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&&io.mergeHeaders(s,r.headers),n&&io.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 io.#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,gk.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===vk)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 p of s)o.push(p.trim());for(let p of o)if(p instanceof RegExp){if(p.test(n.toString()))return!1}else if(p instanceof URL){if(p.origin===n.origin)return!1}else if(p.startsWith("*.")||p.startsWith(".")){let m=p.replace(/^\*\./,".");if(n.hostname.endsWith(m))return!1}else if(p===n.origin||p===n.hostname||p===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);io.mergeHeaders(r,e.headers);let n=(0,mk.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 p=n.paramsSerializer(n.params);p.startsWith("?")&&(p=p.slice(1));let m=n.url.toString().includes("?")?"&":"?";n.url=n.url+m+p}else{let p=n.url instanceof URL?n.url:new URL(n.url);for(let[m,h]of new URLSearchParams(n.params))p.searchParams.append(m,h);n.url=p}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 Lw.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 p=await yk();r.set("content-type",`multipart/related; boundary=${p}`),n.body=Lw.Readable.from(this.getMultipartRequest(n.multipart,p))}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 p=await io.#s();this.agentCache.has(s)?n.agent=this.agentCache.get(s):(n.agent=new p(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 hk.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
27
+ `),n=!1,i=!1,s;t.on("response",d=>{let{headers:m}=d;n=m["transfer-encoding"]==="chunked"&&!m["content-length"]}),t.on("socket",d=>{let m=o(()=>{if(n&&!i){let v=new Error("Premature close");v.code="ERR_STREAM_PREMATURE_CLOSE",e(v)}},"onSocketClose"),h=o(v=>{i=Pa.Buffer.compare(v.slice(-5),r)===0,!i&&s&&(i=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 qw,Bw,ho,Xt,Pa,Iz,Gw=St(()=>{qw=ue(require("node:http"),1),Bw=ue(require("node:https"),1),ho=ue(require("node:zlib"),1),Xt=ue(require("node:stream"),1),Pa=require("node:buffer");QP();xu();Iw();Iu();Lw();Vd();jw();Xd();yu();Pu();Qd();Wd();Iz=new Set(["data:","http:","https:"]);o(ep,"fetch");o(Az,"fixResponseChunkedTransferBadEnding")});var Zw=L(si=>{"use strict";var Rz=si&&si.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},ai;Object.defineProperty(si,"__esModule",{value:!0});si.Gaxios=void 0;var Dz=Rz(la()),$z=require("https"),go=Dd(),Oz=EP(),Hw=require("stream"),Ww=Cd(),Cz=o(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),Nz=204,Au=class{static{o(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new Ww.GaxiosInterceptorManager,response:new Ww.GaxiosInterceptorManager}}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&ai.mergeHeaders(s,r.headers),n&&ai.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}async request(e={}){let r=await this.#n(e);return r=await this.#t(r),this.#r(this._request(r))}async _defaultAdapter(e){let r=e.fetchImplementation||this.defaults.fetchImplementation||await ai.#u(),n={...e};delete n.data;let i=await r(e.url,n),s=await this.getResponseData(e,i);return Object.getOwnPropertyDescriptor(i,"data")?.configurable||Object.defineProperties(i,{data:{configurable:!0,writable:!0,enumerable:!0,value:s}}),Object.assign(i,{config:e,data:s})}async _request(e){try{let r;if(e.adapter?r=await e.adapter(e,this._defaultAdapter.bind(this)):r=await this._defaultAdapter(e),!e.validateStatus(r.status)){if(e.responseType==="stream"){let i=[];for await(let s of r.data)i.push(s);r.data=i.toString()}let n=go.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new go.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof go.GaxiosError?n=r:r instanceof Error?n=new go.GaxiosError(r.message,e,void 0,r):n=new go.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:i,config:s}=await(0,Oz.getRetryConfig)(n);if(i&&s)return n.config.retryConfig.currentRetryAttempt=s.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#o(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,r){if(r.status===Nz)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new go.GaxiosError("Response's `Content-Length` is over the limit.",e,Object.assign(r,{config:e}));switch(e.responseType){case"stream":return r.body;case"json":{let n=await r.text();try{return JSON.parse(n)}catch{return n}}case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"text":return r.text();default:return this.getResponseDataFromContentType(r)}}#e(e,r=[]){let n=new URL(e),i=[...r],s=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let d of s)i.push(d.trim());for(let d of i)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);ai.mergeHeaders(r,e.headers);let n=(0,Dz.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 i=typeof n.data=="string"||n.data instanceof ArrayBuffer||n.data instanceof Blob||globalThis.File&&n.data instanceof File||n.data instanceof FormData||n.data instanceof Hw.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 Cz();r.set("content-type",`multipart/related; boundary=${d}`),n.body=Hw.Readable.from(this.getMultipartRequest(n.multipart,d))}else i?n.body=n.data:typeof n.data=="object"?r.get("Content-Type")==="application/x-www-form-urlencoded"?n.body=n.paramsSerializer?n.paramsSerializer(n.data):new URLSearchParams(n.data):(r.has("content-type")||r.set("content-type","application/json"),n.body=JSON.stringify(n.data)):n.data&&(n.body=n.data);n.validateStatus=n.validateStatus||this.validateStatus,n.responseType=n.responseType||"unknown",!r.has("accept")&&n.responseType==="json"&&r.set("accept","application/json");let s=n.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!n.agent)if(s&&this.#e(n.url,n.noProxy)){let d=await ai.#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 $z.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=go.defaultErrorRedactor),n.body&&!("duplex"in n)&&(n.duplex="half"),this.#o(n),Object.assign(n,{headers:r,url:n.url instanceof URL?n.url:new URL(n.url)})}#o(e){if(e.timeout){let r=AbortSignal.timeout(e.timeout);e.signal&&!e.signal.aborted?e.signal=AbortSignal.any([e.signal,r]):e.signal=r}}validateStatus(e){return e>=200&&e<300}async getResponseDataFromContentType(e){let r=e.headers.get("Content-Type");if(r===null)return e.text();if(r=r.toLowerCase(),r.includes("application/json")){let n=await e.text();try{n=JSON.parse(n)}catch{}return n}else return r.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,r){let n=`--${r}--`;for(let i of e){let s=i.headers.get("Content-Type")||"application/octet-stream";yield`--${r}\r
28
28
  Content-Type: ${s}\r
29
29
  \r
30
- `,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(GP()))).HttpsProxyAgent,this.#o}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(Fw(),Mw))).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,p)=>{p==="set-cookie"?e.append(p,s):e.set(p,s)});return e}};oo.Gaxios=Au;io=Au});var ht=L(kt=>{"use strict";var _k=kt&&kt.__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]})),Pk=kt&&kt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_k(e,t,r)};Object.defineProperty(kt,"__esModule",{value:!0});kt.instance=kt.Gaxios=kt.GaxiosError=void 0;kt.request=bk;var Bw=qw();Object.defineProperty(kt,"Gaxios",{enumerable:!0,get:i(function(){return Bw.Gaxios},"get")});var wk=Id();Object.defineProperty(kt,"GaxiosError",{enumerable:!0,get:i(function(){return wk.GaxiosError},"get")});Pk(Dd(),kt);kt.instance=new Bw.Gaxios;async function bk(t){return kt.instance.request(t)}i(bk,"request")});var Xd=L((Vw,Ru)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,o=Math.floor,s="[BigNumber Error] ",p=s+"Number primitive has more than 15 significant digits: ",m=1e14,h=14,v=9007199254740991,P=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],x=1e7,T=1e9;function w(l){var b,g,oe,ne=ie.prototype={constructor:ie,toString:null,valueOf:null},Re=new ie(1),se=20,Y=4,K=-7,re=21,te=-1e7,ce=1e7,de=!1,Oe=1,ze=0,Ke={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Qe="0123456789abcdefghijklmnopqrstuvwxyz",Tt=!0;function ie(I,$){var O,q,z,F,H,k,U,V,j=this;if(!(j instanceof ie))return new ie(I,$);if($==null){if(I&&I._isBigNumber===!0){j.s=I.s,!I.c||I.e>ce?j.c=j.e=null:I.e<te?j.c=[j.e=0]:(j.e=I.e,j.c=I.c.slice());return}if((k=typeof I=="number")&&I*0==0){if(j.s=1/I<0?(I=-I,-1):1,I===~~I){for(F=0,H=I;H>=10;H/=10,F++);F>ce?j.c=j.e=null:(j.e=F,j.c=[I]);return}V=String(I)}else{if(!r.test(V=String(I)))return oe(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(I),Ze(j,se+j.e+1,Y);if(V=String(I),k=typeof I=="number"){if(I*0!=0)return oe(j,V,k,$);if(j.s=1/I<0?(V=V.slice(1),-1):1,ie.DEBUG&&V.replace(/^0\.0*|\./,"").length>15)throw Error(p+I)}else j.s=V.charCodeAt(0)===45?(V=V.slice(1),-1):1;for(O=Qe.slice(0,$),F=H=0,U=V.length;H<U;H++)if(O.indexOf(q=V.charAt(H))<0){if(q=="."){if(H>F){F=U;continue}}else if(!z&&(V==V.toUpperCase()&&(V=V.toLowerCase())||V==V.toLowerCase()&&(V=V.toUpperCase()))){z=!0,H=-1,F=0;continue}return oe(j,String(I),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(U=V.length;V.charCodeAt(--U)===48;);if(V=V.slice(H,++U)){if(U-=H,k&&ie.DEBUG&&U>15&&(I>v||I!==o(I)))throw Error(p+j.s*I);if((F=F-H-1)>ce)j.c=j.e=null;else if(F<te)j.c=[j.e=0];else{if(j.e=F,j.c=[],H=(F+1)%h,F<0&&(H+=h),H<U){for(H&&j.c.push(+V.slice(0,H)),U-=h;H<U;)j.c.push(+V.slice(H,H+=h));H=h-(V=V.slice(H)).length}else H-=U;for(;H--;V+="0");j.c.push(+V)}}else j.c=[j.e=0]}i(ie,"BigNumber"),ie.clone=w,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(I){var $,O;if(I!=null)if(typeof I=="object"){if(I.hasOwnProperty($="DECIMAL_PLACES")&&(O=I[$],u(O,0,T,$),se=O),I.hasOwnProperty($="ROUNDING_MODE")&&(O=I[$],u(O,0,8,$),Y=O),I.hasOwnProperty($="EXPONENTIAL_AT")&&(O=I[$],O&&O.pop?(u(O[0],-T,0,$),u(O[1],0,T,$),K=O[0],re=O[1]):(u(O,-T,T,$),K=-(re=O<0?-O:O))),I.hasOwnProperty($="RANGE"))if(O=I[$],O&&O.pop)u(O[0],-T,-1,$),u(O[1],1,T,$),te=O[0],ce=O[1];else if(u(O,-T,T,$),O)te=-(ce=O<0?-O:O);else throw Error(s+$+" cannot be zero: "+O);if(I.hasOwnProperty($="CRYPTO"))if(O=I[$],O===!!O)if(O)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))de=O;else throw de=!O,Error(s+"crypto unavailable");else de=O;else throw Error(s+$+" not true or false: "+O);if(I.hasOwnProperty($="MODULO_MODE")&&(O=I[$],u(O,0,9,$),Oe=O),I.hasOwnProperty($="POW_PRECISION")&&(O=I[$],u(O,0,T,$),ze=O),I.hasOwnProperty($="FORMAT"))if(O=I[$],typeof O=="object")Ke=O;else throw Error(s+$+" not an object: "+O);if(I.hasOwnProperty($="ALPHABET"))if(O=I[$],typeof O=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(O))Tt=O.slice(0,10)=="0123456789",Qe=O;else throw Error(s+$+" invalid: "+O)}else throw Error(s+"Object expected: "+I);return{DECIMAL_PLACES:se,ROUNDING_MODE:Y,EXPONENTIAL_AT:[K,re],RANGE:[te,ce],CRYPTO:de,MODULO_MODE:Oe,POW_PRECISION:ze,FORMAT:Ke,ALPHABET:Qe}},ie.isBigNumber=function(I){if(!I||I._isBigNumber!==!0)return!1;if(!ie.DEBUG)return!0;var $,O,q=I.c,z=I.e,F=I.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(O=q[$],O<0||O>=m||O!==o(O))break e;if(O!==0)return!0}}}else if(q===null&&z===null&&(F===null||F===1||F===-1))return!0;throw Error(s+"Invalid BigNumber: "+I)},ie.maximum=ie.max=function(){return ft(arguments,-1)},ie.minimum=ie.min=function(){return ft(arguments,1)},ie.random=(function(){var I=9007199254740992,$=Math.random()*I&2097151?function(){return o(Math.random()*I)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(O){var q,z,F,H,k,U=0,V=[],j=new ie(Re);if(O==null?O=se:u(O,0,T),H=n(O/h),de)if(crypto.getRandomValues){for(q=crypto.getRandomValues(new Uint32Array(H*=2));U<H;)k=q[U]*131072+(q[U+1]>>>11),k>=9e15?(z=crypto.getRandomValues(new Uint32Array(2)),q[U]=z[0],q[U+1]=z[1]):(V.push(k%1e14),U+=2);U=H/2}else if(crypto.randomBytes){for(q=crypto.randomBytes(H*=7);U<H;)k=(q[U]&31)*281474976710656+q[U+1]*1099511627776+q[U+2]*4294967296+q[U+3]*16777216+(q[U+4]<<16)+(q[U+5]<<8)+q[U+6],k>=9e15?crypto.randomBytes(7).copy(q,U):(V.push(k%1e14),U+=7);U=H/7}else throw de=!1,Error(s+"crypto unavailable");if(!de)for(;U<H;)k=$(),k<9e15&&(V[U++]=k%1e14);for(H=V[--U],O%=h,H&&O&&(k=P[h-O],V[U]=o(H/k)*k);V[U]===0;V.pop(),U--);if(U<0)V=[F=0];else{for(F=-1;V[0]===0;V.splice(0,1),F-=h);for(U=1,k=V[0];k>=10;k/=10,U++);U<h&&(F-=h-U)}return j.e=F,j.c=V,j}})(),ie.sum=function(){for(var I=1,$=arguments,O=new ie($[0]);I<$.length;)O=O.plus($[I++]);return O},g=(function(){var I="0123456789";function $(O,q,z,F){for(var H,k=[0],U,V=0,j=O.length;V<j;){for(U=k.length;U--;k[U]*=q);for(k[0]+=F.indexOf(O.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(O,q,z,F,H){var k,U,V,j,X,pe,he,Be,nt=O.indexOf("."),it=se,qe=Y;for(nt>=0&&(j=ze,ze=0,O=O.replace(".",""),Be=new ie(q),pe=Be.pow(O.length-nt),ze=j,Be.c=$(y(D(pe.c),pe.e,"0"),10,z,I),Be.e=Be.c.length),he=$(O,q,z,H?(k=Qe,I):(k=I,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,Be,it,qe,z),he=pe.c,X=pe.r,V=pe.e),U=V+it+1,nt=he[U],j=z/2,X=X||U<0||he[U+1]!=null,X=qe<4?(nt!=null||X)&&(qe==0||qe==(pe.s<0?3:2)):nt>j||nt==j&&(qe==4||X||qe==6&&he[U-1]&1||qe==(pe.s<0?8:7)),U<1||!he[0])O=X?y(k.charAt(1),-it,k.charAt(0)):k.charAt(0);else{if(he.length=U,X)for(--z;++he[--U]>z;)he[U]=0,U||(++V,he=[1].concat(he));for(j=he.length;!he[--j];);for(nt=0,O="";nt<=j;O+=k.charAt(he[nt++]));O=y(O,V,k.charAt(0))}return O}})(),b=(function(){function I(q,z,F){var H,k,U,V,j=0,X=q.length,pe=z%x,he=z/x|0;for(q=q.slice();X--;)U=q[X]%x,V=q[X]/x|0,H=he*U+V*pe,k=pe*U+H%x*x+j,j=(k/F|0)+(H/x|0)+he*V,q[X]=k%F;return j&&(q=[j].concat(q)),q}i(I,"multiply");function $(q,z,F,H){var k,U;if(F!=H)U=F>H?1:-1;else for(k=U=0;k<F;k++)if(q[k]!=z[k]){U=q[k]>z[k]?1:-1;break}return U}i($,"compare");function O(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(O,"subtract"),function(q,z,F,H,k){var U,V,j,X,pe,he,Be,nt,it,qe,We,_t,Si,xi,Ei,Gt,Qr,Rt=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?Rt*0:Rt/0);for(nt=new ie(Rt),it=nt.c=[],V=q.e-z.e,Rt=F+V+1,k||(k=m,V=S(q.e/h)-S(z.e/h),Rt=Rt/h|0),j=0;Ye[j]==(Pt[j]||0);j++);if(Ye[j]>(Pt[j]||0)&&V--,Rt<0)it.push(1),X=!0;else{for(xi=Pt.length,Gt=Ye.length,j=0,Rt+=2,pe=o(k/(Ye[0]+1)),pe>1&&(Ye=I(Ye,pe,k),Pt=I(Pt,pe,k),Gt=Ye.length,xi=Pt.length),Si=Gt,qe=Pt.slice(0,Gt),We=qe.length;We<Gt;qe[We++]=0);Qr=Ye.slice(),Qr=[0].concat(Qr),Ei=Ye[0],Ye[1]>=k/2&&Ei++;do{if(pe=0,U=$(Ye,qe,Gt,We),U<0){if(_t=qe[0],Gt!=We&&(_t=_t*k+(qe[1]||0)),pe=o(_t/Ei),pe>1)for(pe>=k&&(pe=k-1),he=I(Ye,pe,k),Be=he.length,We=qe.length;$(he,qe,Be,We)==1;)pe--,O(he,Gt<Be?Qr:Ye,Be,k),Be=he.length,U=1;else pe==0&&(U=pe=1),he=Ye.slice(),Be=he.length;if(Be<We&&(he=[0].concat(he)),O(qe,he,We,k),We=qe.length,U==-1)for(;$(Ye,qe,Gt,We)<1;)pe++,O(qe,Gt<We?Qr:Ye,We,k),We=qe.length}else U===0&&(pe++,qe=[0]);it[j++]=pe,qe[0]?qe[We++]=Pt[Si]||0:(qe=[Pt[Si]],We=1)}while((Si++<xi||qe[0]!=null)&&Rt--);X=qe[0]!=null,it[0]||it.splice(0,1)}if(k==m){for(j=1,Rt=it[0];Rt>=10;Rt/=10,j++);Ze(nt,F+(nt.e=j+V*h-1)+1,H,X)}else nt.e=V,nt.r=+X;return nt}})();function ut(I,$,O,q){var z,F,H,k,U;if(O==null?O=Y:u(O,0,8),!I.c)return I.toString();if(z=I.c[0],H=I.e,$==null)U=D(I.c),U=q==1||q==2&&(H<=K||H>=re)?c(U,H):y(U,H,"0");else if(I=Ze(new ie(I),$,O),F=I.e,U=D(I.c),k=U.length,q==1||q==2&&($<=F||F<=K)){for(;k<$;U+="0",k++);U=c(U,F)}else if($-=H+(q===2&&F>H),U=y(U,F,"0"),F+1>k){if(--$>0)for(U+=".";$--;U+="0");}else if($+=F-k,$>0)for(F+1==k&&(U+=".");$--;U+="0");return I.s<0&&z?"-"+U:U}i(ut,"format");function ft(I,$){for(var O,q,z=1,F=new ie(I[0]);z<I.length;z++)q=new ie(I[z]),(!q.s||(O=E(F,q))===$||O===0&&F.s===$)&&(F=q);return F}i(ft,"maxOrMin");function Vt(I,$,O){for(var q=1,z=$.length;!$[--z];$.pop());for(z=$[0];z>=10;z/=10,q++);return(O=q+O*h-1)>ce?I.c=I.e=null:O<te?I.c=[I.e=0]:(I.e=O,I.c=$),I}i(Vt,"normalise"),oe=(function(){var I=/^(-?)0([xbo])(?=\w[\w.]*$)/i,$=/^([^.]+)\.$/,O=/^\.([^.]+)$/,q=/^-?(Infinity|NaN)$/,z=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,H,k,U){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(I,function(X,pe,he){return V=(he=he.toLowerCase())=="x"?16:he=="b"?2:8,!U||U==V?pe:X}),U&&(V=U,j=j.replace($,"$1").replace(O,"0.$1")),H!=j))return new ie(j,V);if(ie.DEBUG)throw Error(s+"Not a"+(U?" base "+U:"")+" number: "+H);F.s=null}F.c=F.e=null}})();function Ze(I,$,O,q){var z,F,H,k,U,V,j,X=I.c,pe=P;if(X){e:{for(z=1,k=X[0];k>=10;k/=10,z++);if(F=$-z,F<0)F+=h,H=$,U=X[V=0],j=o(U/pe[z-H-1]%10);else if(V=n((F+1)/h),V>=X.length)if(q){for(;X.length<=V;X.push(0));U=j=0,z=1,F%=h,H=F-h+1}else break e;else{for(U=k=X[V],z=1;k>=10;k/=10,z++);F%=h,H=F-h+z,j=H<0?0:o(U/pe[z-H-1]%10)}if(q=q||$<0||X[V+1]!=null||(H<0?U:U%pe[z-H-1]),q=O<4?(j||q)&&(O==0||O==(I.s<0?3:2)):j>5||j==5&&(O==4||q||O==6&&(F>0?H>0?U/pe[z-H]:0:X[V-1])%10&1||O==(I.s<0?8:7)),$<1||!X[0])return X.length=0,q?($-=I.e+1,X[0]=pe[(h-$%h)%h],I.e=-$||0):X[0]=I.e=0,I;if(F==0?(X.length=V,k=1,V--):(X.length=V+1,k=pe[h-F],X[V]=H>0?o(U/pe[z-H]%pe[H])*k:0),q)for(;;)if(V==0){for(F=1,H=X[0];H>=10;H/=10,F++);for(H=X[0]+=k,k=1;H>=10;H/=10,k++);F!=k&&(I.e++,X[0]==m&&(X[0]=1));break}else{if(X[V]+=k,X[V]!=m)break;X[V--]=0,k=1}for(F=X.length;X[--F]===0;X.pop());}I.e>ce?I.c=I.e=null:I.e<te&&(I.c=[I.e=0])}return I}i(Ze,"round");function Je(I){var $,O=I.e;return O===null?I.toString():($=D(I.c),$=O<=K||O>=re?c($,O):y($,O,"0"),I.s<0?"-"+$:$)}return i(Je,"valueOf"),ne.absoluteValue=ne.abs=function(){var I=new ie(this);return I.s<0&&(I.s=1),I},ne.comparedTo=function(I,$){return E(this,new ie(I,$))},ne.decimalPlaces=ne.dp=function(I,$){var O,q,z,F=this;if(I!=null)return u(I,0,T),$==null?$=Y:u($,0,8),Ze(new ie(F),I+F.e+1,$);if(!(O=F.c))return null;if(q=((z=O.length-1)-S(this.e/h))*h,z=O[z])for(;z%10==0;z/=10,q--);return q<0&&(q=0),q},ne.dividedBy=ne.div=function(I,$){return b(this,new ie(I,$),se,Y)},ne.dividedToIntegerBy=ne.idiv=function(I,$){return b(this,new ie(I,$),0,1)},ne.exponentiatedBy=ne.pow=function(I,$){var O,q,z,F,H,k,U,V,j,X=this;if(I=new ie(I),I.c&&!I.isInteger())throw Error(s+"Exponent not an integer: "+Je(I));if($!=null&&($=new ie($)),k=I.e>14,!X.c||!X.c[0]||X.c[0]==1&&!X.e&&X.c.length==1||!I.c||!I.c[0])return j=new ie(Math.pow(+Je(X),k?I.s*(2-f(I)):+Je(I))),$?j.mod($):j;if(U=I.s<0,$){if($.c?!$.c[0]:!$.s)return new ie(NaN);q=!U&&X.isInteger()&&$.isInteger(),q&&(X=X.mod($))}else{if(I.e>9&&(X.e>0||X.e<-1||(X.e==0?X.c[0]>1||k&&X.c[1]>=24e7:X.c[0]<8e13||k&&X.c[0]<=9999975e7)))return F=X.s<0&&f(I)?-0:0,X.e>-1&&(F=1/F),new ie(U?1/F:F);ze&&(F=n(ze/h+2))}for(k?(O=new ie(.5),U&&(I.s=1),V=f(I)):(z=Math.abs(+Je(I)),V=z%2),j=new ie(Re);;){if(V){if(j=j.times(X),!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(I=I.times(O),Ze(I,I.e+1,1),I.e>14)V=f(I);else{if(z=+Je(I),z===0)break;V=z%2}X=X.times(X),F?X.c&&X.c.length>F&&(X.c.length=F):q&&(X=X.mod($))}return q?j:(U&&(j=Re.div(j)),$?j.mod($):F?Ze(j,ze,Y,H):j)},ne.integerValue=function(I){var $=new ie(this);return I==null?I=Y:u(I,0,8),Ze($,$.e+1,I)},ne.isEqualTo=ne.eq=function(I,$){return E(this,new ie(I,$))===0},ne.isFinite=function(){return!!this.c},ne.isGreaterThan=ne.gt=function(I,$){return E(this,new ie(I,$))>0},ne.isGreaterThanOrEqualTo=ne.gte=function(I,$){return($=E(this,new ie(I,$)))===1||$===0},ne.isInteger=function(){return!!this.c&&S(this.e/h)>this.c.length-2},ne.isLessThan=ne.lt=function(I,$){return E(this,new ie(I,$))<0},ne.isLessThanOrEqualTo=ne.lte=function(I,$){return($=E(this,new ie(I,$)))===-1||$===0},ne.isNaN=function(){return!this.s},ne.isNegative=function(){return this.s<0},ne.isPositive=function(){return this.s>0},ne.isZero=function(){return!!this.c&&this.c[0]==0},ne.minus=function(I,$){var O,q,z,F,H=this,k=H.s;if(I=new ie(I,$),$=I.s,!k||!$)return new ie(NaN);if(k!=$)return I.s=-$,H.plus(I);var U=H.e/h,V=I.e/h,j=H.c,X=I.c;if(!U||!V){if(!j||!X)return j?(I.s=-$,I):new ie(X?H:NaN);if(!j[0]||!X[0])return X[0]?(I.s=-$,I):new ie(j[0]?H:Y==3?-0:0)}if(U=S(U),V=S(V),j=j.slice(),k=U-V){for((F=k<0)?(k=-k,z=j):(V=U,z=X),z.reverse(),$=k;$--;z.push(0));z.reverse()}else for(q=(F=(k=j.length)<($=X.length))?k:$,k=$=0;$<q;$++)if(j[$]!=X[$]){F=j[$]<X[$];break}if(F&&(z=j,j=X,X=z,I.s=-I.s),$=(q=X.length)-(O=j.length),$>0)for(;$--;j[O++]=0);for($=m-1;q>k;){if(j[--q]<X[q]){for(O=q;O&&!j[--O];j[O]=$);--j[O],j[q]+=m}j[q]-=X[q]}for(;j[0]==0;j.splice(0,1),--V);return j[0]?Vt(I,j,V):(I.s=Y==3?-1:1,I.c=[I.e=0],I)},ne.modulo=ne.mod=function(I,$){var O,q,z=this;return I=new ie(I,$),!z.c||!I.s||I.c&&!I.c[0]?new ie(NaN):!I.c||z.c&&!z.c[0]?new ie(z):(Oe==9?(q=I.s,I.s=1,O=b(z,I,0,3),I.s=q,O.s*=q):O=b(z,I,0,Oe),I=z.minus(O.times(I)),!I.c[0]&&Oe==1&&(I.s=z.s),I)},ne.multipliedBy=ne.times=function(I,$){var O,q,z,F,H,k,U,V,j,X,pe,he,Be,nt,it,qe=this,We=qe.c,_t=(I=new ie(I,$)).c;if(!We||!_t||!We[0]||!_t[0])return!qe.s||!I.s||We&&!We[0]&&!_t||_t&&!_t[0]&&!We?I.c=I.e=I.s=null:(I.s*=qe.s,!We||!_t?I.c=I.e=null:(I.c=[0],I.e=0)),I;for(q=S(qe.e/h)+S(I.e/h),I.s*=qe.s,U=We.length,X=_t.length,U<X&&(Be=We,We=_t,_t=Be,z=U,U=X,X=z),z=U+X,Be=[];z--;Be.push(0));for(nt=m,it=x,z=X;--z>=0;){for(O=0,pe=_t[z]%it,he=_t[z]/it|0,H=U,F=z+H;F>z;)V=We[--H]%it,j=We[H]/it|0,k=he*V+j*pe,V=pe*V+k%it*it+Be[F]+O,O=(V/nt|0)+(k/it|0)+he*j,Be[F--]=V%nt;Be[F]=O}return O?++q:Be.splice(0,1),Vt(I,Be,q)},ne.negated=function(){var I=new ie(this);return I.s=-I.s||null,I},ne.plus=function(I,$){var O,q=this,z=q.s;if(I=new ie(I,$),$=I.s,!z||!$)return new ie(NaN);if(z!=$)return I.s=-$,q.minus(I);var F=q.e/h,H=I.e/h,k=q.c,U=I.c;if(!F||!H){if(!k||!U)return new ie(z/0);if(!k[0]||!U[0])return U[0]?I: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,O=U):(z=-z,O=k),O.reverse();z--;O.push(0));O.reverse()}for(z=k.length,$=U.length,z-$<0&&(O=U,U=k,k=O,$=z),z=0;$;)z=(k[--$]=k[$]+U[$]+z)/m|0,k[$]=m===k[$]?0:k[$]%m;return z&&(k=[z].concat(k),++H),Vt(I,k,H)},ne.precision=ne.sd=function(I,$){var O,q,z,F=this;if(I!=null&&I!==!!I)return u(I,1,T),$==null?$=Y:u($,0,8),Ze(new ie(F),I,$);if(!(O=F.c))return null;if(z=O.length-1,q=z*h+1,z=O[z]){for(;z%10==0;z/=10,q--);for(z=O[0];z>=10;z/=10,q++);}return I&&F.e+1>q&&(q=F.e+1),q},ne.shiftedBy=function(I){return u(I,-v,v),this.times("1e"+I)},ne.squareRoot=ne.sqrt=function(){var I,$,O,q,z,F=this,H=F.c,k=F.s,U=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+U)%2==0&&($+="0"),k=Math.sqrt(+$),U=S((U+1)/2)-(U<0||U%2),k==1/0?$="5e"+U:($=k.toExponential(),$=$.slice(0,$.indexOf("e")+1)+U),O=new ie($)):O=new ie(k+""),O.c[0]){for(U=O.e,k=U+V,k<3&&(k=0);;)if(z=O,O=j.times(z.plus(b(F,z,V,1))),D(z.c).slice(0,k)===($=D(O.c)).slice(0,k))if(O.e<U&&--k,$=$.slice(k-3,k+1),$=="9999"||!q&&$=="4999"){if(!q&&(Ze(z,z.e+se+2,0),z.times(z).eq(F))){O=z;break}V+=4,k+=4,q=1}else{(!+$||!+$.slice(1)&&$.charAt(0)=="5")&&(Ze(O,O.e+se+2,1),I=!O.times(O).eq(F));break}}return Ze(O,O.e+se+1,Y,I)},ne.toExponential=function(I,$){return I!=null&&(u(I,0,T),I++),ut(this,I,$,1)},ne.toFixed=function(I,$){return I!=null&&(u(I,0,T),I=I+this.e+1),ut(this,I,$)},ne.toFormat=function(I,$,O){var q,z=this;if(O==null)I!=null&&$&&typeof $=="object"?(O=$,$=null):I&&typeof I=="object"?(O=I,I=$=null):O=Ke;else if(typeof O!="object")throw Error(s+"Argument not an object: "+O);if(q=z.toFixed(I,$),z.c){var F,H=q.split("."),k=+O.groupSize,U=+O.secondaryGroupSize,V=O.groupSeparator||"",j=H[0],X=H[1],pe=z.s<0,he=pe?j.slice(1):j,Be=he.length;if(U&&(F=k,k=U,U=F,Be-=F),k>0&&Be>0){for(F=Be%k||k,j=he.substr(0,F);F<Be;F+=k)j+=V+he.substr(F,k);U>0&&(j+=V+he.slice(F)),pe&&(j="-"+j)}q=X?j+(O.decimalSeparator||"")+((U=+O.fractionGroupSize)?X.replace(new RegExp("\\d{"+U+"}\\B","g"),"$&"+(O.fractionGroupSeparator||"")):X):j}return(O.prefix||"")+q+(O.suffix||"")},ne.toFraction=function(I){var $,O,q,z,F,H,k,U,V,j,X,pe,he=this,Be=he.c;if(I!=null&&(k=new ie(I),!k.isInteger()&&(k.c||k.s!==1)||k.lt(Re)))throw Error(s+"Argument "+(k.isInteger()?"out of range: ":"not an integer: ")+Je(k));if(!Be)return new ie(he);for($=new ie(Re),V=O=new ie(Re),q=U=new ie(Re),pe=D(Be),F=$.e=pe.length-he.e-1,$.c[0]=P[(H=F%h)<0?h+H:H],I=!I||k.comparedTo($)>0?F>0?$:V:k,H=ce,ce=1/0,k=new ie(pe),U.c[0]=0;j=b(k,$,0,1),z=O.plus(j.times(q)),z.comparedTo(I)!=1;)O=q,q=z,V=U.plus(j.times(z=V)),U=z,$=k.minus(j.times(z=$)),k=z;return z=b(I.minus(O),q,0,1),U=U.plus(z.times(V)),O=O.plus(z.times(q)),U.s=V.s=he.s,F=F*2,X=b(V,q,F,Y).minus(he).abs().comparedTo(b(U,O,F,Y).minus(he).abs())<1?[V,q]:[U,O],ce=H,X},ne.toNumber=function(){return+Je(this)},ne.toPrecision=function(I,$){return I!=null&&u(I,1,T),ut(this,I,$,2)},ne.toString=function(I){var $,O=this,q=O.s,z=O.e;return z===null?q?($="Infinity",q<0&&($="-"+$)):$="NaN":(I==null?$=z<=K||z>=re?c(D(O.c),z):y(D(O.c),z,"0"):I===10&&Tt?(O=Ze(new ie(O),se+z+1,Y),$=y(D(O.c),O.e,"0")):(u(I,2,Qe.length,"Base"),$=g(y(D(O.c),z,"0"),10,I,q,!0)),q<0&&O.c[0]&&($="-"+$)),$},ne.valueOf=ne.toJSON=function(){return Je(this)},ne._isBigNumber=!0,l!=null&&ie.set(l),ie}i(w,"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,oe=1,ne=l.length,Re=l[0]+"";oe<ne;){for(b=l[oe++]+"",g=h-b.length;g--;b="0"+b);Re+=b}for(ne=Re.length;Re.charCodeAt(--ne)===48;);return Re.slice(0,ne+1||1)}i(D,"coeffToString");function E(l,b){var g,oe,ne=l.c,Re=b.c,se=l.s,Y=b.s,K=l.e,re=b.e;if(!se||!Y)return null;if(g=ne&&!ne[0],oe=Re&&!Re[0],g||oe)return g?oe?0:-Y:se;if(se!=Y)return se;if(g=se<0,oe=K==re,!ne||!Re)return oe?0:!ne^g?1:-1;if(!oe)return K>re^g?1:-1;for(Y=(K=ne.length)<(re=Re.length)?K:re,se=0;se<Y;se++)if(ne[se]!=Re[se])return ne[se]>Re[se]^g?1:-1;return K==re?0:K>re^g?1:-1}i(E,"compare");function u(l,b,g,oe){if(l<b||l>g||l!==o(l))throw Error(s+(oe||"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 oe,ne;if(b<0){for(ne=g+".";++b;ne+=g);l=ne+l}else if(oe=l.length,++b>oe){for(ne=g,b-=oe;--b;ne+=g);l+=ne}else b<oe&&(l=l.slice(0,b)+"."+l.slice(b));return l}i(y,"toFixedPoint"),e=w(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof Ru<"u"&&Ru.exports?Ru.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(Vw)});var Zw=L((g7,Ww)=>{var Gw=Xd(),Hw=Ww.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",'"':'\\"',"\\":"\\\\"},p;function m(v){return r.lastIndex=0,r.test(v)?'"'+v.replace(r,function(P){var x=s[P];return typeof x=="string"?x:"\\u"+("0000"+P.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+v+'"'}i(m,"quote");function h(v,P){var x,T,w,S,D=n,E,u=P[v],f=u!=null&&(u instanceof Gw||Gw.isBigNumber(u));switch(u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(v)),typeof p=="function"&&(u=p.call(P,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 w=E.length===0?"[]":n?`[
30
+ `,typeof i.content=="string"?yield i.content:yield*i.content,yield`\r
31
+ `}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>ue(YP()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(Gw(),Vw))).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}};si.Gaxios=Au;ai=Au});var gt=L(zt=>{"use strict";var zz=zt&&zt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kz=zt&&zt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zz(e,t,r)};Object.defineProperty(zt,"__esModule",{value:!0});zt.instance=zt.Gaxios=zt.GaxiosError=void 0;zt.request=Mz;var Kw=Zw();Object.defineProperty(zt,"Gaxios",{enumerable:!0,get:o(function(){return Kw.Gaxios},"get")});var Uz=Dd();Object.defineProperty(zt,"GaxiosError",{enumerable:!0,get:o(function(){return Uz.GaxiosError},"get")});kz(Cd(),zt);zt.instance=new Kw.Gaxios;async function Mz(t){return zt.instance.request(t)}o(Mz,"request")});var tp=L((Jw,Ru)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=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 w(l){var b,g,ie,ne=oe.prototype={constructor:oe,toString:null,valueOf:null},Oe=new oe(1),se=20,X=4,J=-7,re=21,te=-1e7,ce=1e7,de=!1,ze=1,Ue=0,Ke={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Qe="0123456789abcdefghijklmnopqrstuvwxyz",Tt=!0;function oe(A,$){var O,q,k,F,H,z,M,V,j=this;if(!(j instanceof oe))return new oe(A,$);if($==null){if(A&&A._isBigNumber===!0){j.s=A.s,!A.c||A.e>ce?j.c=j.e=null:A.e<te?j.c=[j.e=0]:(j.e=A.e,j.c=A.c.slice());return}if((z=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 ie(j,V,z);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 oe(A),Ze(j,se+j.e+1,X);if(V=String(A),z=typeof A=="number"){if(A*0!=0)return ie(j,V,z,$);if(j.s=1/A<0?(V=V.slice(1),-1):1,oe.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(O=Qe.slice(0,$),F=H=0,M=V.length;H<M;H++)if(O.indexOf(q=V.charAt(H))<0){if(q=="."){if(H>F){F=M;continue}}else if(!k&&(V==V.toUpperCase()&&(V=V.toLowerCase())||V==V.toLowerCase()&&(V=V.toUpperCase()))){k=!0,H=-1,F=0;continue}return ie(j,String(A),z,$)}z=!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,z&&oe.DEBUG&&M>15&&(A>v||A!==i(A)))throw Error(d+j.s*A);if((F=F-H-1)>ce)j.c=j.e=null;else if(F<te)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]}o(oe,"BigNumber"),oe.clone=w,oe.ROUND_UP=0,oe.ROUND_DOWN=1,oe.ROUND_CEIL=2,oe.ROUND_FLOOR=3,oe.ROUND_HALF_UP=4,oe.ROUND_HALF_DOWN=5,oe.ROUND_HALF_EVEN=6,oe.ROUND_HALF_CEIL=7,oe.ROUND_HALF_FLOOR=8,oe.EUCLID=9,oe.config=oe.set=function(A){var $,O;if(A!=null)if(typeof A=="object"){if(A.hasOwnProperty($="DECIMAL_PLACES")&&(O=A[$],u(O,0,T,$),se=O),A.hasOwnProperty($="ROUNDING_MODE")&&(O=A[$],u(O,0,8,$),X=O),A.hasOwnProperty($="EXPONENTIAL_AT")&&(O=A[$],O&&O.pop?(u(O[0],-T,0,$),u(O[1],0,T,$),J=O[0],re=O[1]):(u(O,-T,T,$),J=-(re=O<0?-O:O))),A.hasOwnProperty($="RANGE"))if(O=A[$],O&&O.pop)u(O[0],-T,-1,$),u(O[1],1,T,$),te=O[0],ce=O[1];else if(u(O,-T,T,$),O)te=-(ce=O<0?-O:O);else throw Error(s+$+" cannot be zero: "+O);if(A.hasOwnProperty($="CRYPTO"))if(O=A[$],O===!!O)if(O)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))de=O;else throw de=!O,Error(s+"crypto unavailable");else de=O;else throw Error(s+$+" not true or false: "+O);if(A.hasOwnProperty($="MODULO_MODE")&&(O=A[$],u(O,0,9,$),ze=O),A.hasOwnProperty($="POW_PRECISION")&&(O=A[$],u(O,0,T,$),Ue=O),A.hasOwnProperty($="FORMAT"))if(O=A[$],typeof O=="object")Ke=O;else throw Error(s+$+" not an object: "+O);if(A.hasOwnProperty($="ALPHABET"))if(O=A[$],typeof O=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(O))Tt=O.slice(0,10)=="0123456789",Qe=O;else throw Error(s+$+" invalid: "+O)}else throw Error(s+"Object expected: "+A);return{DECIMAL_PLACES:se,ROUNDING_MODE:X,EXPONENTIAL_AT:[J,re],RANGE:[te,ce],CRYPTO:de,MODULO_MODE:ze,POW_PRECISION:Ue,FORMAT:Ke,ALPHABET:Qe}},oe.isBigNumber=function(A){if(!A||A._isBigNumber!==!0)return!1;if(!oe.DEBUG)return!0;var $,O,q=A.c,k=A.e,F=A.s;e:if({}.toString.call(q)=="[object Array]"){if((F===1||F===-1)&&k>=-T&&k<=T&&k===i(k)){if(q[0]===0){if(k===0&&q.length===1)return!0;break e}if($=(k+1)%h,$<1&&($+=h),String(q[0]).length==$){for($=0;$<q.length;$++)if(O=q[$],O<0||O>=m||O!==i(O))break e;if(O!==0)return!0}}}else if(q===null&&k===null&&(F===null||F===1||F===-1))return!0;throw Error(s+"Invalid BigNumber: "+A)},oe.maximum=oe.max=function(){return ft(arguments,-1)},oe.minimum=oe.min=function(){return ft(arguments,1)},oe.random=(function(){var A=9007199254740992,$=Math.random()*A&2097151?function(){return i(Math.random()*A)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(O){var q,k,F,H,z,M=0,V=[],j=new oe(Oe);if(O==null?O=se:u(O,0,T),H=n(O/h),de)if(crypto.getRandomValues){for(q=crypto.getRandomValues(new Uint32Array(H*=2));M<H;)z=q[M]*131072+(q[M+1]>>>11),z>=9e15?(k=crypto.getRandomValues(new Uint32Array(2)),q[M]=k[0],q[M+1]=k[1]):(V.push(z%1e14),M+=2);M=H/2}else if(crypto.randomBytes){for(q=crypto.randomBytes(H*=7);M<H;)z=(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],z>=9e15?crypto.randomBytes(7).copy(q,M):(V.push(z%1e14),M+=7);M=H/7}else throw de=!1,Error(s+"crypto unavailable");if(!de)for(;M<H;)z=$(),z<9e15&&(V[M++]=z%1e14);for(H=V[--M],O%=h,H&&O&&(z=_[h-O],V[M]=i(H/z)*z);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,z=V[0];z>=10;z/=10,M++);M<h&&(F-=h-M)}return j.e=F,j.c=V,j}})(),oe.sum=function(){for(var A=1,$=arguments,O=new oe($[0]);A<$.length;)O=O.plus($[A++]);return O},g=(function(){var A="0123456789";function $(O,q,k,F){for(var H,z=[0],M,V=0,j=O.length;V<j;){for(M=z.length;M--;z[M]*=q);for(z[0]+=F.indexOf(O.charAt(V++)),H=0;H<z.length;H++)z[H]>k-1&&(z[H+1]==null&&(z[H+1]=0),z[H+1]+=z[H]/k|0,z[H]%=k)}return z.reverse()}return o($,"toBaseOut"),function(O,q,k,F,H){var z,M,V,j,Q,pe,he,Ve,nt=O.indexOf("."),it=se,Be=X;for(nt>=0&&(j=Ue,Ue=0,O=O.replace(".",""),Ve=new oe(q),pe=Ve.pow(O.length-nt),Ue=j,Ve.c=$(y(D(pe.c),pe.e,"0"),10,k,A),Ve.e=Ve.c.length),he=$(O,q,k,H?(z=Qe,A):(z=A,Qe)),V=j=he.length;he[--j]==0;he.pop());if(!he[0])return z.charAt(0);if(nt<0?--V:(pe.c=he,pe.e=V,pe.s=F,pe=b(pe,Ve,it,Be,k),he=pe.c,Q=pe.r,V=pe.e),M=V+it+1,nt=he[M],j=k/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])O=Q?y(z.charAt(1),-it,z.charAt(0)):z.charAt(0);else{if(he.length=M,Q)for(--k;++he[--M]>k;)he[M]=0,M||(++V,he=[1].concat(he));for(j=he.length;!he[--j];);for(nt=0,O="";nt<=j;O+=z.charAt(he[nt++]));O=y(O,V,z.charAt(0))}return O}})(),b=(function(){function A(q,k,F){var H,z,M,V,j=0,Q=q.length,pe=k%x,he=k/x|0;for(q=q.slice();Q--;)M=q[Q]%x,V=q[Q]/x|0,H=he*M+V*pe,z=pe*M+H%x*x+j,j=(z/F|0)+(H/x|0)+he*V,q[Q]=z%F;return j&&(q=[j].concat(q)),q}o(A,"multiply");function $(q,k,F,H){var z,M;if(F!=H)M=F>H?1:-1;else for(z=M=0;z<F;z++)if(q[z]!=k[z]){M=q[z]>k[z]?1:-1;break}return M}o($,"compare");function O(q,k,F,H){for(var z=0;F--;)q[F]-=z,z=q[F]<k[F]?1:0,q[F]=z*H+q[F]-k[F];for(;!q[0]&&q.length>1;q.splice(0,1));}return o(O,"subtract"),function(q,k,F,H,z){var M,V,j,Q,pe,he,Ve,nt,it,Be,We,Pt,xo,Eo,Io,Gt,Qr,Dt=q.s==k.s?1:-1,wt=q.c,Ye=k.c;if(!wt||!wt[0]||!Ye||!Ye[0])return new oe(!q.s||!k.s||(wt?Ye&&wt[0]==Ye[0]:!Ye)?NaN:wt&&wt[0]==0||!Ye?Dt*0:Dt/0);for(nt=new oe(Dt),it=nt.c=[],V=q.e-k.e,Dt=F+V+1,z||(z=m,V=S(q.e/h)-S(k.e/h),Dt=Dt/h|0),j=0;Ye[j]==(wt[j]||0);j++);if(Ye[j]>(wt[j]||0)&&V--,Dt<0)it.push(1),Q=!0;else{for(Eo=wt.length,Gt=Ye.length,j=0,Dt+=2,pe=i(z/(Ye[0]+1)),pe>1&&(Ye=A(Ye,pe,z),wt=A(wt,pe,z),Gt=Ye.length,Eo=wt.length),xo=Gt,Be=wt.slice(0,Gt),We=Be.length;We<Gt;Be[We++]=0);Qr=Ye.slice(),Qr=[0].concat(Qr),Io=Ye[0],Ye[1]>=z/2&&Io++;do{if(pe=0,M=$(Ye,Be,Gt,We),M<0){if(Pt=Be[0],Gt!=We&&(Pt=Pt*z+(Be[1]||0)),pe=i(Pt/Io),pe>1)for(pe>=z&&(pe=z-1),he=A(Ye,pe,z),Ve=he.length,We=Be.length;$(he,Be,Ve,We)==1;)pe--,O(he,Gt<Ve?Qr:Ye,Ve,z),Ve=he.length,M=1;else pe==0&&(M=pe=1),he=Ye.slice(),Ve=he.length;if(Ve<We&&(he=[0].concat(he)),O(Be,he,We,z),We=Be.length,M==-1)for(;$(Ye,Be,Gt,We)<1;)pe++,O(Be,Gt<We?Qr:Ye,We,z),We=Be.length}else M===0&&(pe++,Be=[0]);it[j++]=pe,Be[0]?Be[We++]=wt[xo]||0:(Be=[wt[xo]],We=1)}while((xo++<Eo||Be[0]!=null)&&Dt--);Q=Be[0]!=null,it[0]||it.splice(0,1)}if(z==m){for(j=1,Dt=it[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,$,O,q){var k,F,H,z,M;if(O==null?O=X:u(O,0,8),!A.c)return A.toString();if(k=A.c[0],H=A.e,$==null)M=D(A.c),M=q==1||q==2&&(H<=J||H>=re)?c(M,H):y(M,H,"0");else if(A=Ze(new oe(A),$,O),F=A.e,M=D(A.c),z=M.length,q==1||q==2&&($<=F||F<=J)){for(;z<$;M+="0",z++);M=c(M,F)}else if($-=H+(q===2&&F>H),M=y(M,F,"0"),F+1>z){if(--$>0)for(M+=".";$--;M+="0");}else if($+=F-z,$>0)for(F+1==z&&(M+=".");$--;M+="0");return A.s<0&&k?"-"+M:M}o(lt,"format");function ft(A,$){for(var O,q,k=1,F=new oe(A[0]);k<A.length;k++)q=new oe(A[k]),(!q.s||(O=E(F,q))===$||O===0&&F.s===$)&&(F=q);return F}o(ft,"maxOrMin");function Vt(A,$,O){for(var q=1,k=$.length;!$[--k];$.pop());for(k=$[0];k>=10;k/=10,q++);return(O=q+O*h-1)>ce?A.c=A.e=null:O<te?A.c=[A.e=0]:(A.e=O,A.c=$),A}o(Vt,"normalise"),ie=(function(){var A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,$=/^([^.]+)\.$/,O=/^\.([^.]+)$/,q=/^-?(Infinity|NaN)$/,k=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(F,H,z,M){var V,j=z?H:H.replace(k,"");if(q.test(j))F.s=isNaN(j)?null:j<0?-1:1;else{if(!z&&(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(O,"0.$1")),H!=j))return new oe(j,V);if(oe.DEBUG)throw Error(s+"Not a"+(M?" base "+M:"")+" number: "+H);F.s=null}F.c=F.e=null}})();function Ze(A,$,O,q){var k,F,H,z,M,V,j,Q=A.c,pe=_;if(Q){e:{for(k=1,z=Q[0];z>=10;z/=10,k++);if(F=$-k,F<0)F+=h,H=$,M=Q[V=0],j=i(M/pe[k-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,k=1,F%=h,H=F-h+1}else break e;else{for(M=z=Q[V],k=1;z>=10;z/=10,k++);F%=h,H=F-h+k,j=H<0?0:i(M/pe[k-H-1]%10)}if(q=q||$<0||Q[V+1]!=null||(H<0?M:M%pe[k-H-1]),q=O<4?(j||q)&&(O==0||O==(A.s<0?3:2)):j>5||j==5&&(O==4||q||O==6&&(F>0?H>0?M/pe[k-H]:0:Q[V-1])%10&1||O==(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,z=1,V--):(Q.length=V+1,z=pe[h-F],Q[V]=H>0?i(M/pe[k-H]%pe[H])*z:0),q)for(;;)if(V==0){for(F=1,H=Q[0];H>=10;H/=10,F++);for(H=Q[0]+=z,z=1;H>=10;H/=10,z++);F!=z&&(A.e++,Q[0]==m&&(Q[0]=1));break}else{if(Q[V]+=z,Q[V]!=m)break;Q[V--]=0,z=1}for(F=Q.length;Q[--F]===0;Q.pop());}A.e>ce?A.c=A.e=null:A.e<te&&(A.c=[A.e=0])}return A}o(Ze,"round");function Je(A){var $,O=A.e;return O===null?A.toString():($=D(A.c),$=O<=J||O>=re?c($,O):y($,O,"0"),A.s<0?"-"+$:$)}return o(Je,"valueOf"),ne.absoluteValue=ne.abs=function(){var A=new oe(this);return A.s<0&&(A.s=1),A},ne.comparedTo=function(A,$){return E(this,new oe(A,$))},ne.decimalPlaces=ne.dp=function(A,$){var O,q,k,F=this;if(A!=null)return u(A,0,T),$==null?$=X:u($,0,8),Ze(new oe(F),A+F.e+1,$);if(!(O=F.c))return null;if(q=((k=O.length-1)-S(this.e/h))*h,k=O[k])for(;k%10==0;k/=10,q--);return q<0&&(q=0),q},ne.dividedBy=ne.div=function(A,$){return b(this,new oe(A,$),se,X)},ne.dividedToIntegerBy=ne.idiv=function(A,$){return b(this,new oe(A,$),0,1)},ne.exponentiatedBy=ne.pow=function(A,$){var O,q,k,F,H,z,M,V,j,Q=this;if(A=new oe(A),A.c&&!A.isInteger())throw Error(s+"Exponent not an integer: "+Je(A));if($!=null&&($=new oe($)),z=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 oe(Math.pow(+Je(Q),z?A.s*(2-f(A)):+Je(A))),$?j.mod($):j;if(M=A.s<0,$){if($.c?!$.c[0]:!$.s)return new oe(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||z&&Q.c[1]>=24e7:Q.c[0]<8e13||z&&Q.c[0]<=9999975e7)))return F=Q.s<0&&f(A)?-0:0,Q.e>-1&&(F=1/F),new oe(M?1/F:F);Ue&&(F=n(Ue/h+2))}for(z?(O=new oe(.5),M&&(A.s=1),V=f(A)):(k=Math.abs(+Je(A)),V=k%2),j=new oe(Oe);;){if(V){if(j=j.times(Q),!j.c)break;F?j.c.length>F&&(j.c.length=F):q&&(j=j.mod($))}if(k){if(k=i(k/2),k===0)break;V=k%2}else if(A=A.times(O),Ze(A,A.e+1,1),A.e>14)V=f(A);else{if(k=+Je(A),k===0)break;V=k%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=Oe.div(j)),$?j.mod($):F?Ze(j,Ue,X,H):j)},ne.integerValue=function(A){var $=new oe(this);return A==null?A=X:u(A,0,8),Ze($,$.e+1,A)},ne.isEqualTo=ne.eq=function(A,$){return E(this,new oe(A,$))===0},ne.isFinite=function(){return!!this.c},ne.isGreaterThan=ne.gt=function(A,$){return E(this,new oe(A,$))>0},ne.isGreaterThanOrEqualTo=ne.gte=function(A,$){return($=E(this,new oe(A,$)))===1||$===0},ne.isInteger=function(){return!!this.c&&S(this.e/h)>this.c.length-2},ne.isLessThan=ne.lt=function(A,$){return E(this,new oe(A,$))<0},ne.isLessThanOrEqualTo=ne.lte=function(A,$){return($=E(this,new oe(A,$)))===-1||$===0},ne.isNaN=function(){return!this.s},ne.isNegative=function(){return this.s<0},ne.isPositive=function(){return this.s>0},ne.isZero=function(){return!!this.c&&this.c[0]==0},ne.minus=function(A,$){var O,q,k,F,H=this,z=H.s;if(A=new oe(A,$),$=A.s,!z||!$)return new oe(NaN);if(z!=$)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 oe(Q?H:NaN);if(!j[0]||!Q[0])return Q[0]?(A.s=-$,A):new oe(j[0]?H:X==3?-0:0)}if(M=S(M),V=S(V),j=j.slice(),z=M-V){for((F=z<0)?(z=-z,k=j):(V=M,k=Q),k.reverse(),$=z;$--;k.push(0));k.reverse()}else for(q=(F=(z=j.length)<($=Q.length))?z:$,z=$=0;$<q;$++)if(j[$]!=Q[$]){F=j[$]<Q[$];break}if(F&&(k=j,j=Q,Q=k,A.s=-A.s),$=(q=Q.length)-(O=j.length),$>0)for(;$--;j[O++]=0);for($=m-1;q>z;){if(j[--q]<Q[q]){for(O=q;O&&!j[--O];j[O]=$);--j[O],j[q]+=m}j[q]-=Q[q]}for(;j[0]==0;j.splice(0,1),--V);return j[0]?Vt(A,j,V):(A.s=X==3?-1:1,A.c=[A.e=0],A)},ne.modulo=ne.mod=function(A,$){var O,q,k=this;return A=new oe(A,$),!k.c||!A.s||A.c&&!A.c[0]?new oe(NaN):!A.c||k.c&&!k.c[0]?new oe(k):(ze==9?(q=A.s,A.s=1,O=b(k,A,0,3),A.s=q,O.s*=q):O=b(k,A,0,ze),A=k.minus(O.times(A)),!A.c[0]&&ze==1&&(A.s=k.s),A)},ne.multipliedBy=ne.times=function(A,$){var O,q,k,F,H,z,M,V,j,Q,pe,he,Ve,nt,it,Be=this,We=Be.c,Pt=(A=new oe(A,$)).c;if(!We||!Pt||!We[0]||!Pt[0])return!Be.s||!A.s||We&&!We[0]&&!Pt||Pt&&!Pt[0]&&!We?A.c=A.e=A.s=null:(A.s*=Be.s,!We||!Pt?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=Pt.length,M<Q&&(Ve=We,We=Pt,Pt=Ve,k=M,M=Q,Q=k),k=M+Q,Ve=[];k--;Ve.push(0));for(nt=m,it=x,k=Q;--k>=0;){for(O=0,pe=Pt[k]%it,he=Pt[k]/it|0,H=M,F=k+H;F>k;)V=We[--H]%it,j=We[H]/it|0,z=he*V+j*pe,V=pe*V+z%it*it+Ve[F]+O,O=(V/nt|0)+(z/it|0)+he*j,Ve[F--]=V%nt;Ve[F]=O}return O?++q:Ve.splice(0,1),Vt(A,Ve,q)},ne.negated=function(){var A=new oe(this);return A.s=-A.s||null,A},ne.plus=function(A,$){var O,q=this,k=q.s;if(A=new oe(A,$),$=A.s,!k||!$)return new oe(NaN);if(k!=$)return A.s=-$,q.minus(A);var F=q.e/h,H=A.e/h,z=q.c,M=A.c;if(!F||!H){if(!z||!M)return new oe(k/0);if(!z[0]||!M[0])return M[0]?A:new oe(z[0]?q:k*0)}if(F=S(F),H=S(H),z=z.slice(),k=F-H){for(k>0?(H=F,O=M):(k=-k,O=z),O.reverse();k--;O.push(0));O.reverse()}for(k=z.length,$=M.length,k-$<0&&(O=M,M=z,z=O,$=k),k=0;$;)k=(z[--$]=z[$]+M[$]+k)/m|0,z[$]=m===z[$]?0:z[$]%m;return k&&(z=[k].concat(z),++H),Vt(A,z,H)},ne.precision=ne.sd=function(A,$){var O,q,k,F=this;if(A!=null&&A!==!!A)return u(A,1,T),$==null?$=X:u($,0,8),Ze(new oe(F),A,$);if(!(O=F.c))return null;if(k=O.length-1,q=k*h+1,k=O[k]){for(;k%10==0;k/=10,q--);for(k=O[0];k>=10;k/=10,q++);}return A&&F.e+1>q&&(q=F.e+1),q},ne.shiftedBy=function(A){return u(A,-v,v),this.times("1e"+A)},ne.squareRoot=ne.sqrt=function(){var A,$,O,q,k,F=this,H=F.c,z=F.s,M=F.e,V=se+4,j=new oe("0.5");if(z!==1||!H||!H[0])return new oe(!z||z<0&&(!H||H[0])?NaN:H?F:1/0);if(z=Math.sqrt(+Je(F)),z==0||z==1/0?($=D(H),($.length+M)%2==0&&($+="0"),z=Math.sqrt(+$),M=S((M+1)/2)-(M<0||M%2),z==1/0?$="5e"+M:($=z.toExponential(),$=$.slice(0,$.indexOf("e")+1)+M),O=new oe($)):O=new oe(z+""),O.c[0]){for(M=O.e,z=M+V,z<3&&(z=0);;)if(k=O,O=j.times(k.plus(b(F,k,V,1))),D(k.c).slice(0,z)===($=D(O.c)).slice(0,z))if(O.e<M&&--z,$=$.slice(z-3,z+1),$=="9999"||!q&&$=="4999"){if(!q&&(Ze(k,k.e+se+2,0),k.times(k).eq(F))){O=k;break}V+=4,z+=4,q=1}else{(!+$||!+$.slice(1)&&$.charAt(0)=="5")&&(Ze(O,O.e+se+2,1),A=!O.times(O).eq(F));break}}return Ze(O,O.e+se+1,X,A)},ne.toExponential=function(A,$){return A!=null&&(u(A,0,T),A++),lt(this,A,$,1)},ne.toFixed=function(A,$){return A!=null&&(u(A,0,T),A=A+this.e+1),lt(this,A,$)},ne.toFormat=function(A,$,O){var q,k=this;if(O==null)A!=null&&$&&typeof $=="object"?(O=$,$=null):A&&typeof A=="object"?(O=A,A=$=null):O=Ke;else if(typeof O!="object")throw Error(s+"Argument not an object: "+O);if(q=k.toFixed(A,$),k.c){var F,H=q.split("."),z=+O.groupSize,M=+O.secondaryGroupSize,V=O.groupSeparator||"",j=H[0],Q=H[1],pe=k.s<0,he=pe?j.slice(1):j,Ve=he.length;if(M&&(F=z,z=M,M=F,Ve-=F),z>0&&Ve>0){for(F=Ve%z||z,j=he.substr(0,F);F<Ve;F+=z)j+=V+he.substr(F,z);M>0&&(j+=V+he.slice(F)),pe&&(j="-"+j)}q=Q?j+(O.decimalSeparator||"")+((M=+O.fractionGroupSize)?Q.replace(new RegExp("\\d{"+M+"}\\B","g"),"$&"+(O.fractionGroupSeparator||"")):Q):j}return(O.prefix||"")+q+(O.suffix||"")},ne.toFraction=function(A){var $,O,q,k,F,H,z,M,V,j,Q,pe,he=this,Ve=he.c;if(A!=null&&(z=new oe(A),!z.isInteger()&&(z.c||z.s!==1)||z.lt(Oe)))throw Error(s+"Argument "+(z.isInteger()?"out of range: ":"not an integer: ")+Je(z));if(!Ve)return new oe(he);for($=new oe(Oe),V=O=new oe(Oe),q=M=new oe(Oe),pe=D(Ve),F=$.e=pe.length-he.e-1,$.c[0]=_[(H=F%h)<0?h+H:H],A=!A||z.comparedTo($)>0?F>0?$:V:z,H=ce,ce=1/0,z=new oe(pe),M.c[0]=0;j=b(z,$,0,1),k=O.plus(j.times(q)),k.comparedTo(A)!=1;)O=q,q=k,V=M.plus(j.times(k=V)),M=k,$=z.minus(j.times(k=$)),z=k;return k=b(A.minus(O),q,0,1),M=M.plus(k.times(V)),O=O.plus(k.times(q)),M.s=V.s=he.s,F=F*2,Q=b(V,q,F,X).minus(he).abs().comparedTo(b(M,O,F,X).minus(he).abs())<1?[V,q]:[M,O],ce=H,Q},ne.toNumber=function(){return+Je(this)},ne.toPrecision=function(A,$){return A!=null&&u(A,1,T),lt(this,A,$,2)},ne.toString=function(A){var $,O=this,q=O.s,k=O.e;return k===null?q?($="Infinity",q<0&&($="-"+$)):$="NaN":(A==null?$=k<=J||k>=re?c(D(O.c),k):y(D(O.c),k,"0"):A===10&&Tt?(O=Ze(new oe(O),se+k+1,X),$=y(D(O.c),O.e,"0")):(u(A,2,Qe.length,"Base"),$=g(y(D(O.c),k,"0"),10,A,q,!0)),q<0&&O.c[0]&&($="-"+$)),$},ne.valueOf=ne.toJSON=function(){return Je(this)},ne._isBigNumber=!0,l!=null&&oe.set(l),oe}o(w,"clone");function S(l){var b=l|0;return l>0||l===b?b:b-1}o(S,"bitFloor");function D(l){for(var b,g,ie=1,ne=l.length,Oe=l[0]+"";ie<ne;){for(b=l[ie++]+"",g=h-b.length;g--;b="0"+b);Oe+=b}for(ne=Oe.length;Oe.charCodeAt(--ne)===48;);return Oe.slice(0,ne+1||1)}o(D,"coeffToString");function E(l,b){var g,ie,ne=l.c,Oe=b.c,se=l.s,X=b.s,J=l.e,re=b.e;if(!se||!X)return null;if(g=ne&&!ne[0],ie=Oe&&!Oe[0],g||ie)return g?ie?0:-X:se;if(se!=X)return se;if(g=se<0,ie=J==re,!ne||!Oe)return ie?0:!ne^g?1:-1;if(!ie)return J>re^g?1:-1;for(X=(J=ne.length)<(re=Oe.length)?J:re,se=0;se<X;se++)if(ne[se]!=Oe[se])return ne[se]>Oe[se]^g?1:-1;return J==re?0:J>re^g?1:-1}o(E,"compare");function u(l,b,g,ie){if(l<b||l>g||l!==i(l))throw Error(s+(ie||"Argument")+(typeof l=="number"?l<b||l>g?" out of range: ":" not an integer: ":" not a primitive number: ")+String(l))}o(u,"intCheck");function f(l){var b=l.c.length-1;return S(l.e/h)==b&&l.c[b]%2!=0}o(f,"isOdd");function c(l,b){return(l.length>1?l.charAt(0)+"."+l.slice(1):l)+(b<0?"e":"e+")+b}o(c,"toExponential");function y(l,b,g){var ie,ne;if(b<0){for(ne=g+".";++b;ne+=g);l=ne+l}else if(ie=l.length,++b>ie){for(ne=g,b-=ie;--b;ne+=g);l+=ne}else b<ie&&(l=l.slice(0,b)+"."+l.slice(b));return l}o(y,"toFixedPoint"),e=w(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof Ru<"u"&&Ru.exports?Ru.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(Jw)});var eb=L((nQ,Qw)=>{var Yw=tp(),Xw=Qw.exports;(function(){"use strict";function t(v){return v<10?"0"+v:v}o(t,"f");var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},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+'"'}o(m,"quote");function h(v,_){var x,T,w,S,D=n,E,u=_[v],f=u!=null&&(u instanceof Yw||Yw.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+=i,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 w=E.length===0?"[]":n?`[
32
32
  `+n+E.join(`,
33
33
  `+n)+`
34
- `+D+"]":"["+E.join(",")+"]",n=D,w}if(p&&typeof p=="object")for(S=p.length,x=0;x<S;x+=1)typeof p[x]=="string"&&(T=p[x],w=h(T,u),w&&E.push(m(T)+(n?": ":":")+w));else Object.keys(u).forEach(function(c){var y=h(c,u);y&&E.push(m(c)+(n?": ":":")+y)});return w=E.length===0?"{}":n?`{
34
+ `+D+"]":"["+E.join(",")+"]",n=D,w}if(d&&typeof d=="object")for(S=d.length,x=0;x<S;x+=1)typeof d[x]=="string"&&(T=d[x],w=h(T,u),w&&E.push(m(T)+(n?": ":":")+w));else Object.keys(u).forEach(function(c){var y=h(c,u);y&&E.push(m(c)+(n?": ":":")+y)});return w=E.length===0?"{}":n?`{
35
35
  `+n+E.join(`,
36
36
  `+n)+`
37
- `+D+"}":"{"+E.join(",")+"}",n=D,w}}i(h,"str"),typeof Hw.stringify!="function"&&(Hw.stringify=function(v,P,x){var T;if(n="",o="",typeof x=="number")for(T=0;T<x;T+=1)o+=" ";else typeof x=="string"&&(o=x);if(p=P,P&&typeof P!="function"&&(typeof P!="object"||typeof P.length!="number"))throw new Error("JSON.stringify");return h("",{"":v})})})()});var Jw=L((v7,Kw)=>{var Du=null,Tk=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,Sk=/(?: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)/,xk=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,p=i(function(D){throw{name:"SyntaxError",message:D,at:r,text:s}},"error"),m=i(function(D){return D&&D!==n&&p("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))p("Bad number");else return Du==null&&(Du=Xd()),E.length>15?e.storeAsString?E:e.useNativeBigInt?BigInt(E):new Du(E):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(D):new Du(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}}p("Bad string")},"string"),P=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}p("Unexpected '"+n+"'")},"word"),T,w=i(function(){var D=[];if(n==="["){if(m("["),P(),n==="]")return m("]"),D;for(;n;){if(D.push(T()),P(),n==="]")return m("]"),D;m(","),P()}}p("Bad array")},"array"),S=i(function(){var D,E=Object.create(null);if(n==="{"){if(m("{"),P(),n==="}")return m("}"),E;for(;n;){if(D=v(),P(),m(":"),e.strict===!0&&Object.hasOwnProperty.call(E,D)&&p('Duplicate key "'+D+'"'),Tk.test(D)===!0?e.protoAction==="error"?p("Object contains forbidden prototype property"):e.protoAction==="ignore"?T():E[D]=T():Sk.test(D)===!0?e.constructorAction==="error"?p("Object contains forbidden constructor property"):e.constructorAction==="ignore"?T():E[D]=T():E[D]=T(),P(),n==="}")return m("}"),E;m(","),P()}}p("Bad object")},"object");return T=i(function(){switch(P(),n){case"{":return S();case"[":return w();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(),P(),n&&p("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(oe){b=f(g,oe),b!==void 0?g[oe]=b:delete g[oe]}),E.call(c,y,g)}),"walk")({"":u},""):u}},"json_parse");Kw.exports=xk});var Qw=L((P7,$u)=>{var Yw=Zw().stringify,Xw=Jw();$u.exports=function(t){return{parse:Xw(t),stringify:Yw}};$u.exports.parse=Xw();$u.exports.stringify=Yw});var Qd=L(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.GCE_LINUX_BIOS_PATHS=void 0;xr.isGoogleCloudServerless=rb;xr.isGoogleComputeEngineLinux=nb;xr.isGoogleComputeEngineMACAddress=ib;xr.isGoogleComputeEngine=ob;xr.detectGCPResidency=Ik;var eb=require("fs"),tb=require("os");xr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var Ek=/^42:01/;function rb(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}i(rb,"isGoogleCloudServerless");function nb(){if((0,tb.platform)()!=="linux")return!1;try{(0,eb.statSync)(xr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,eb.readFileSync)(xr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}i(nb,"isGoogleComputeEngineLinux");function ib(){let t=(0,tb.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(Ek.test(r))return!0}return!1}i(ib,"isGoogleComputeEngineMACAddress");function ob(){return nb()||ib()}i(ob,"isGoogleComputeEngine");function Ik(){return rb()||ob()}i(Ik,"detectGCPResidency")});var ab=L(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.Colours=void 0;var $t=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="")}};Ou.Colours=$t;$t.enabled=!1;$t.reset="";$t.bright="";$t.dim="";$t.red="";$t.green="";$t.yellow="";$t.blue="";$t.magenta="";$t.cyan="";$t.white="";$t.grey="";$t.refresh()});var lb=L(Xe=>{"use strict";var Ak=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]})),Rk=Xe&&Xe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),sb=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"&&Ak(r,e,n[o]);return Rk(r,e),r}})();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.env=Xe.DebugLogBackendBase=Xe.placeholder=Xe.AdhocDebugLogger=Xe.LogSeverity=void 0;Xe.getNodeBackend=tp;Xe.getDebugBackend=$k;Xe.getStructuredBackend=Ok;Xe.setBackend=Ck;Xe.log=cb;var Dk=require("events"),Pa=sb(require("process")),ub=sb(require("util")),Qt=ab(),Er;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Er||(Xe.LogSeverity=Er={}));var wa=class extends Dk.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(Er.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Er.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Er.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Er.ERROR,...n),this.func.sublog=n=>cb(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=wa;Xe.placeholder=new wa("",()=>{}).func;var ao=class{static{i(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=Pa.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=ao;var ep=class extends ao{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=`${Qt.Colours.green}${e}${Qt.Colours.reset}`,p=`${Qt.Colours.yellow}${Pa.pid}${Qt.Colours.reset}`,m;switch(r.severity){case Er.ERROR:m=`${Qt.Colours.red}${r.severity}${Qt.Colours.reset}`;break;case Er.INFO:m=`${Qt.Colours.magenta}${r.severity}${Qt.Colours.reset}`;break;case Er.WARNING:m=`${Qt.Colours.yellow}${r.severity}${Qt.Colours.reset}`;break;default:m=(o=r.severity)!==null&&o!==void 0?o:Er.DEFAULT;break}let h=ub.formatWithOptions({colors:Qt.Colours.enabled},...n),v=Object.assign({},r);delete v.severity;let P=Object.getOwnPropertyNames(v).length?JSON.stringify(v):"",x=P?`${Qt.Colours.grey}${P}${Qt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",p,s,m,h,P?` ${x}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function tp(){return new ep}i(tp,"getNodeBackend");var rp=class extends ao{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=Pa.env.NODE_DEBUG)!==null&&e!==void 0?e:"";Pa.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function $k(t){return new rp(t)}i($k,"getDebugBackend");var np=class extends ao{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 p;let m=(p=o.severity)!==null&&p!==void 0?p:Er.INFO,h=Object.assign({severity:m,message:ub.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 Ok(t){return new np(t)}i(Ok,"getStructuredBackend");Xe.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var ip=new Map,er;function Ck(t){er=t,ip.clear()}i(Ck,"setBackend");function cb(t,e){if(!er&&!Pa.env[Xe.env.nodeEnables]||!t)return Xe.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=ip.get(t);if(r)return r.func;if(er===null)return Xe.placeholder;er===void 0&&(er=tp());let n=(()=>{let o;return new wa(t,(p,...m)=>{if(o!==er){if(er===null)return;er===void 0&&(er=tp()),o=er}er?.log(t,p,...m)})})();return ip.set(t,n),n.func}i(cb,"log")});var op=L(gi=>{"use strict";var Nk=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]})),kk=gi&&gi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nk(e,t,r)};Object.defineProperty(gi,"__esModule",{value:!0});kk(lb(),gi)});var Ta=L(Pe=>{"use strict";var pb=Pe&&Pe.__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]})),zk=Pe&&Pe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Uk=Pe&&Pe.__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"&&pb(r,e,n[o]);return zk(r,e),r}})(),Mk=Pe&&Pe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pb(e,t,r)};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.gcpResidencyCache=Pe.METADATA_SERVER_DETECTION=Pe.HEADERS=Pe.HEADER_VALUE=Pe.HEADER_NAME=Pe.SECONDARY_HOST_ADDRESS=Pe.HOST_ADDRESS=Pe.BASE_PATH=void 0;Pe.instance=Vk;Pe.project=Gk;Pe.universe=Hk;Pe.bulk=Wk;Pe.isAvailable=Kk;Pe.resetIsAvailableCache=Jk;Pe.getGCPResidency=up;Pe.setGCPResidency=fb;Pe.requestTimeout=mb;var ap=ht(),Fk=Qw(),Lk=Qd(),jk=Uk(op());Pe.BASE_PATH="/computeMetadata/v1";Pe.HOST_ADDRESS="http://169.254.169.254";Pe.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";Pe.HEADER_NAME="Metadata-Flavor";Pe.HEADER_VALUE="Google";Pe.HEADERS=Object.freeze({[Pe.HEADER_NAME]:Pe.HEADER_VALUE});var db=jk.log("gcp-metadata");Pe.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 sp(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||Pe.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(Pe.BASE_PATH,t).href}i(sp,"getBaseUrl");function qk(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(qk,"validate");async function ba(t,e={},r=3,n=!1){let o=new Headers(Pe.HEADERS),s="",p={};if(typeof t=="object"){let x=t;new Headers(x.headers).forEach((T,w)=>o.set(w,T)),s=x.metadataKey,p=x.params||p,r=x.noResponseRetries||r,n=x.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(qk(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((x,T)=>o.set(T,x)),p=e.params||p);let m=n?Bk:ap.request,h={url:`${sp()}/${s}`,headers:o,retryConfig:{noResponseRetries:r},params:p,responseType:"text",timeout:mb()};db.info("instance request %j",h);let v=await m(h);db.info("instance metadata is %s",v.data);let P=v.headers.get(Pe.HEADER_NAME);if(P!==Pe.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${Pe.HEADER_NAME} header. Expected '${Pe.HEADER_VALUE}', got ${P?`'${P}'`:"no header"}`);if(typeof v.data=="string")try{return Fk.parse(v.data)}catch{}return v.data}i(ba,"metadataAccessor");async function Bk(t){let e={...t,url:t.url?.toString().replace(sp(),sp(Pe.SECONDARY_HOST_ADDRESS))},r=(0,ap.request)(t),n=(0,ap.request)(e);return Promise.any([r,n])}i(Bk,"fastFailMetadataRequest");function Vk(t){return ba("instance",t)}i(Vk,"instance");function Gk(t){return ba("project",t)}i(Gk,"project");function Hk(t){return ba("universe",t)}i(Hk,"universe");async function Wk(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await ba(r),o=r.metadataKey;e[o]=n})())),e}i(Wk,"bulk");function Zk(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}i(Zk,"detectGCPAvailableRetries");var Cu;async function Kk(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in Pe.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(Pe.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return up();case"ping-only":}}try{return Cu===void 0&&(Cu=ba("instance",void 0,Zk(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Cu,!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(Kk,"isAvailable");function Jk(){Cu=void 0}i(Jk,"resetIsAvailableCache");Pe.gcpResidencyCache=null;function up(){return Pe.gcpResidencyCache===null&&fb(),Pe.gcpResidencyCache}i(up,"getGCPResidency");function fb(t=null){Pe.gcpResidencyCache=t!==null?t:(0,Lk.detectGCPResidency)()}i(fb,"setGCPResidency");function mb(){return up()?0:3e3}i(mb,"requestTimeout");Mk(Qd(),Pe)});var yb=L(Nu=>{"use strict";Nu.byteLength=Xk;Nu.toByteArray=ez;Nu.fromByteArray=nz;var jr=[],mr=[],Yk=typeof Uint8Array<"u"?Uint8Array:Array,cp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(yi=0,hb=cp.length;yi<hb;++yi)jr[yi]=cp[yi],mr[cp.charCodeAt(yi)]=yi;var yi,hb;mr[45]=62;mr[95]=63;function gb(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(gb,"getLens");function Xk(t){var e=gb(t),r=e[0],n=e[1];return(r+n)*3/4-n}i(Xk,"byteLength");function Qk(t,e,r){return(e+r)*3/4-r}i(Qk,"_byteLength");function ez(t){var e,r=gb(t),n=r[0],o=r[1],s=new Yk(Qk(t,n,o)),p=0,m=o>0?n-4:n,h;for(h=0;h<m;h+=4)e=mr[t.charCodeAt(h)]<<18|mr[t.charCodeAt(h+1)]<<12|mr[t.charCodeAt(h+2)]<<6|mr[t.charCodeAt(h+3)],s[p++]=e>>16&255,s[p++]=e>>8&255,s[p++]=e&255;return o===2&&(e=mr[t.charCodeAt(h)]<<2|mr[t.charCodeAt(h+1)]>>4,s[p++]=e&255),o===1&&(e=mr[t.charCodeAt(h)]<<10|mr[t.charCodeAt(h+1)]<<4|mr[t.charCodeAt(h+2)]>>2,s[p++]=e>>8&255,s[p++]=e&255),s}i(ez,"toByteArray");function tz(t){return jr[t>>18&63]+jr[t>>12&63]+jr[t>>6&63]+jr[t&63]}i(tz,"tripletToBase64");function rz(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(tz(n));return o.join("")}i(rz,"encodeChunk");function nz(t){for(var e,r=t.length,n=r%3,o=[],s=16383,p=0,m=r-n;p<m;p+=s)o.push(rz(t,p,p+s>m?m:p+s));return n===1?(e=t[r-1],o.push(jr[e>>2]+jr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],o.push(jr[e>>10]+jr[e>>4&63]+jr[e<<2&63]+"=")),o.join("")}i(nz,"fromByteArray")});var dp=L(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.fromArrayBufferToHex=iz;function iz(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}i(iz,"fromArrayBufferToHex")});var vb=L(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.BrowserCrypto=void 0;var so=yb(),oz=dp(),pp=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 so.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),so.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),p=so.toByteArray(t.padBase64(n)),m=await window.crypto.subtle.importKey("jwk",e,o,!0,["verify"]);return await window.crypto.subtle.verify(o,m,p,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"]),p=await window.crypto.subtle.sign(n,s,o);return so.fromByteArray(new Uint8Array(p))}decodeBase64StringUtf8(e){let r=so.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return so.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,oz.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))}};ku.BrowserCrypto=pp});var _b=L(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.NodeCrypto=void 0;var uo=require("crypto"),fp=class{static{i(this,"NodeCrypto")}async sha256DigestBase64(e){return uo.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return uo.randomBytes(e).toString("base64")}async verify(e,r,n){let o=uo.createVerify("RSA-SHA256");return o.update(r),o.end(),o.verify(e,n,"base64")}async sign(e,r){let n=uo.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 uo.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:sz(e);return az(uo.createHmac("sha256",n).update(r).digest())}};zu.NodeCrypto=fp;function az(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}i(az,"toArrayBuffer");function sz(t){return Buffer.from(t)}i(sz,"toBuffer")});var Sa=L(gn=>{"use strict";var uz=gn&&gn.__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]})),cz=gn&&gn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uz(e,t,r)};Object.defineProperty(gn,"__esModule",{value:!0});gn.createCrypto=pz;gn.hasBrowserCrypto=Pb;var lz=vb(),dz=_b();cz(dp(),gn);function pz(){return Pb()?new lz.BrowserCrypto:new dz.NodeCrypto}i(pz,"createCrypto");function Pb(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}i(Pb,"hasBrowserCrypto")});var co=L((mp,bb)=>{var Uu=require("buffer"),qr=Uu.Buffer;function wb(t,e){for(var r in t)e[r]=t[r]}i(wb,"copyProps");qr.from&&qr.alloc&&qr.allocUnsafe&&qr.allocUnsafeSlow?bb.exports=Uu:(wb(Uu,mp),mp.Buffer=vi);function vi(t,e,r){return qr(t,e,r)}i(vi,"SafeBuffer");vi.prototype=Object.create(qr.prototype);wb(qr,vi);vi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return qr(t,e,r)};vi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=qr(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 qr(t)};vi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Uu.SlowBuffer(t)}});var Sb=L((q7,Tb)=>{"use strict";function hp(t){var e=(t/8|0)+(t%8===0?0:1);return e}i(hp,"getParamSize");var fz={ES256:hp(256),ES384:hp(384),ES512:hp(521)};function mz(t){var e=fz[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}i(mz,"getParamBytesForAlg");Tb.exports=mz});var gp=L((V7,Db)=>{"use strict";var Mu=co().Buffer,Eb=Sb(),Fu=128,Ib=0,hz=32,gz=16,yz=2,Ab=gz|hz|Ib<<6,Lu=yz|Ib<<6;function vz(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(vz,"base64Url");function Rb(t){if(Mu.isBuffer(t))return t;if(typeof t=="string")return Mu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}i(Rb,"signatureAsBuffer");function _z(t,e){t=Rb(t);var r=Eb(e),n=r+1,o=t.length,s=0;if(t[s++]!==Ab)throw new Error('Could not find expected "seq"');var p=t[s++];if(p===(Fu|1)&&(p=t[s++]),o-s<p)throw new Error('"seq" specified length of "'+p+'", only "'+(o-s)+'" remaining');if(t[s++]!==Lu)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++]!==Lu)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 P=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,w=Mu.allocUnsafe(x+m+T+v);for(s=0;s<x;++s)w[s]=0;t.copy(w,s,h+Math.max(-x,0),h+m),s=r;for(var S=s;s<S+T;++s)w[s]=0;return t.copy(w,s,P+Math.max(-T,0),P+v),w=w.toString("base64"),w=vz(w),w}i(_z,"derToJose");function xb(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var o=t[e+n]>=Fu;return o&&--n,n}i(xb,"countPadding");function Pz(t,e){t=Rb(t);var r=Eb(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=xb(t,0,r),s=xb(t,r,t.length),p=r-o,m=r-s,h=2+p+1+1+m,v=h<Fu,P=Mu.allocUnsafe((v?2:3)+h),x=0;return P[x++]=Ab,v?P[x++]=h:(P[x++]=Fu|1,P[x++]=h&255),P[x++]=Lu,P[x++]=p,o<0?(P[x++]=0,x+=t.copy(P,x,0,r)):x+=t.copy(P,x,o,r),P[x++]=Lu,P[x++]=m,s<0?(P[x++]=0,t.copy(P,x,r)):t.copy(P,x,r+s),P}i(Pz,"joseToDer");Db.exports={derToJose:_z,joseToDer:Pz}});var Ir=L(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.LRUCache=void 0;yn.snakeToCamel=Ob;yn.originalOrCamelOptions=Sz;yn.removeUndefinedValuesInObject=xz;yn.isValidFile=Ez;yn.getWellKnownCertificateConfigFileLocation=Iz;var wz=require("fs"),bz=require("os"),yp=require("path"),Tz="certificate_config.json",$b="gcloud";function Ob(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}i(Ob,"snakeToCamel");function Sz(t){function e(r){let n=t||{};return n[r]??n[Ob(r)]}return i(e,"get"),{get:e}}i(Sz,"originalOrCamelOptions");var vp=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()}};yn.LRUCache=vp;function xz(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}i(xz,"removeUndefinedValuesInObject");async function Ez(t){try{return(await wz.promises.lstat(t)).isFile()}catch{return!1}}i(Ez,"isValidFile");function Iz(){let t=process.env.CLOUDSDK_CONFIG||(Az()?yp.join(process.env.APPDATA||"",$b):yp.join(process.env.HOME||"",".config",$b));return yp.join(t,Tz)}i(Iz,"getWellKnownCertificateConfigFileLocation");function Az(){return bz.platform().startsWith("win")}i(Az,"_isWindows")});var Cb=L((Z7,Rz)=>{Rz.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 _p=L(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.USER_AGENT=Zn.PRODUCT_NAME=Zn.pkg=void 0;var Nb=Cb();Zn.pkg=Nb;var kb="google-api-nodejs-client";Zn.PRODUCT_NAME=kb;var Dz=`${kb}/${Nb.version}`;Zn.USER_AGENT=Dz});var tr=L(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.AuthClient=Ar.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Ar.DEFAULT_UNIVERSE=void 0;var $z=require("events"),Pp=ht(),Oz=Ir(),Cz=op(),wp=_p();Ar.DEFAULT_UNIVERSE="googleapis.com";Ar.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var bp=class t extends $z.EventEmitter{static{i(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=Ar.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=Ar.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,Oz.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")??Ar.DEFAULT_UNIVERSE,this.transporter=e.transporter??new Pp.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&&Pp.Gaxios.mergeHeaders(s,r.headers),n&&Pp.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,Cz.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(`${wp.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${wp.USER_AGENT}`):e.headers.set("User-Agent",wp.USER_AGENT);try{let n=e,o=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let p={url:e.url,headers:e.headers};o?t.log.info("%s [%s] request %j",o,s,p):t.log.info("[%s] request %j",s,p)}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"]}}}};Ar.AuthClient=bp});var Sp=L(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.LoginTicket=void 0;var Tp=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()}}};ju.LoginTicket=Tp});var _i=L(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.OAuth2Client=Br.ClientAuthentication=Br.CertificateFormat=Br.CodeChallengeMethod=void 0;var zb=ht(),Nz=require("querystring"),kz=require("stream"),zz=gp(),Ub=Ir(),xp=Sa(),lo=tr(),Uz=Sp(),Mb;(function(t){t.Plain="plain",t.S256="S256"})(Mb||(Br.CodeChallengeMethod=Mb={}));var vn;(function(t){t.PEM="PEM",t.JWK="JWK"})(vn||(Br.CertificateFormat=vn={}));var xa;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(xa||(Br.ClientAuthentication=xa={}));var Ep=class t extends lo.AuthClient{static{i(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=vn.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||xa.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()+"?"+Nz.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,xp.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===xa.ClientSecretBasic){let h=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${h.toString("base64")}`)}this.clientAuthentication===xa.ClientSecretPost&&(o.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,Ub.removeUndefinedValuesInObject)(o)),headers:n};lo.AuthClient.setMethodName(s,"getTokenAsync");let p=await this.transporter.request(s),m=p.data;return p.data&&p.data.expires_in&&(m.expiry_date=new Date().getTime()+p.data.expires_in*1e3,delete m.expires_in),this.emit("tokens",m),{tokens:m,res:p}}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 p={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,Ub.removeUndefinedValuesInObject)(n))};lo.AuthClient.setMethodName(p,"refreshTokenNoCache"),o=await this.transporter.request(p)}catch(p){throw p instanceof zb.GaxiosError&&p.message==="invalid_grant"&&p.response?.data&&/ReAuth/i.test(p.response.data.error_description)&&(p.message=JSON.stringify(p.response.data)),p}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 p=new Headers({authorization:s.token_type+" "+o.access_token});return{headers:this.addSharedMetadataHeaders(p),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(lo.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,p=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 kz.Readable,v=s===401||s===403;if(!r&&v&&!h&&p)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&v&&!h&&m){let P=await this.processAndValidateRefreshHandler();return P?.access_token&&this.setCredentials(P),this.requestAsync(e,!0)}}throw n}}verifyIdToken(e,r){if(r&&typeof r!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(r)this.verifyIdTokenAsync(e).then(n=>r(null,n),r);else return this.verifyIdTokenAsync(e)}async verifyIdTokenAsync(e){if(!e.idToken)throw new Error("The verifyIdToken method requires an ID Token");let r=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(e.idToken,r.certs,e.audience,this.issuers,e.maxExpiry)}async getTokenInfo(e){let{data:r}=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8",authorization:`Bearer ${e}`},url:this.endpoints.tokenInfoUrl.toString()}),n=Object.assign({expiry_date:new Date().getTime()+r.expires_in*1e3,scopes:r.scope.split(" ")},r);return delete n.expires_in,delete n.scope,n}getFederatedSignonCerts(e){if(e)this.getFederatedSignonCertsAsync().then(r=>e(null,r.certs,r.res),e);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let e=new Date().getTime(),r=(0,xp.hasBrowserCrypto)()?vn.JWK:vn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,o;switch(r){case vn.PEM:o=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case vn.JWK:o=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let v={...t.RETRY_CONFIG,url:o};lo.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"),p=-1;if(s){let v=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;v&&(p=Number(v)*1e3)}let m={};switch(r){case vn.PEM:m=n.data;break;case vn.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=p===-1?null:new Date(h.getTime()+p),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};lo.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 p=(0,xp.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],P,x;try{P=JSON.parse(p.decodeBase64StringUtf8(m[0]))}catch(c){throw c instanceof Error&&(c.message=`Can't parse token envelope: ${m[0]}': ${c.message}`),c}if(!P)throw new Error("Can't parse token envelope: "+m[0]);try{x=JSON.parse(p.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,P.kid))throw new Error("No pem found for envelope: "+JSON.stringify(P));let T=r[P.kid];if(P.alg==="ES256"&&(v=zz.joseToDer(v,"ES256").toString("base64")),!await p.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 Uz.LoginTicket(P,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}};Br.OAuth2Client=Ep});var Ap=L(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.Compute=void 0;var Mz=ht(),Fb=Ta(),Fz=_i(),Ip=class extends Fz.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 Fb.instance(o)}catch(o){throw o instanceof Mz.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 Fb.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))}};qu.Compute=Ip});var Dp=L(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.IdTokenClient=void 0;var Lz=_i(),Rp=class extends Lz.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}};Bu.IdTokenClient=Rp});var $p=L(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.GCPEnv=void 0;po.clear=jz;po.getEnv=qz;var Lb=Ta(),Vr;(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"})(Vr||(po.GCPEnv=Vr={}));var Ea;function jz(){Ea=void 0}i(jz,"clear");async function qz(){return Ea||(Ea=Bz(),Ea)}i(qz,"getEnv");async function Bz(){let t=Vr.NONE;return Vz()?t=Vr.APP_ENGINE:Gz()?t=Vr.CLOUD_FUNCTIONS:await Kz()?await Zz()?t=Vr.KUBERNETES_ENGINE:Hz()?t=Vr.CLOUD_RUN:Wz()?t=Vr.CLOUD_RUN_JOBS:t=Vr.COMPUTE_ENGINE:t=Vr.NONE,t}i(Bz,"getEnvMemoized");function Vz(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}i(Vz,"isAppEngine");function Gz(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}i(Gz,"isCloudFunction");function Hz(){return!!process.env.K_CONFIGURATION}i(Hz,"isCloudRun");function Wz(){return!!process.env.CLOUD_RUN_JOB}i(Wz,"isCloudRunJob");async function Zz(){try{return await Lb.instance("attributes/cluster-name"),!0}catch{return!1}}i(Zz,"isKubernetesEngine");async function Kz(){return Lb.isAvailable()}i(Kz,"isComputeEngine")});var Op=L((uQ,jb)=>{var Vu=co().Buffer,Jz=require("stream"),Yz=require("util");function Gu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Vu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Vu.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(Gu,"DataStream");Yz.inherits(Gu,Jz);Gu.prototype.write=i(function(e){this.buffer=Vu.concat([this.buffer,Vu.from(e)]),this.emit("data",e)},"write");Gu.prototype.end=i(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");jb.exports=Gu});var Bb=L((lQ,qb)=>{"use strict";var Ia=require("buffer").Buffer,Cp=require("buffer").SlowBuffer;qb.exports=Hu;function Hu(t,e){if(!Ia.isBuffer(t)||!Ia.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(Hu,"bufferEq");Hu.install=function(){Ia.prototype.equal=Cp.prototype.equal=i(function(e){return Hu(this,e)},"equal")};var Xz=Ia.prototype.equal,Qz=Cp.prototype.equal;Hu.restore=function(){Ia.prototype.equal=Xz,Cp.prototype.equal=Qz}});var Up=L((pQ,Xb)=>{var mo=co().Buffer,hr=require("crypto"),Gb=gp(),Vb=require("util"),eU=`"%s" is not a valid algorithm.
37
+ `+D+"}":"{"+E.join(",")+"}",n=D,w}}o(h,"str"),typeof Xw.stringify!="function"&&(Xw.stringify=function(v,_,x){var T;if(n="",i="",typeof x=="number")for(T=0;T<x;T+=1)i+=" ";else typeof x=="string"&&(i=x);if(d=_,_&&typeof _!="function"&&(typeof _!="object"||typeof _.length!="number"))throw new Error("JSON.stringify");return h("",{"":v})})})()});var rb=L((iQ,tb)=>{var Du=null,Fz=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,Lz=/(?: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)/,jz=o(function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(t!=null){if(t.strict===!0&&(e.strict=!0),t.storeAsString===!0&&(e.storeAsString=!0),e.alwaysParseAsBig=t.alwaysParseAsBig===!0?t.alwaysParseAsBig:!1,e.useNativeBigInt=t.useNativeBigInt===!0?t.useNativeBigInt:!1,typeof t.constructorAction<"u")if(t.constructorAction==="error"||t.constructorAction==="ignore"||t.constructorAction==="preserve")e.constructorAction=t.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(typeof t.protoAction<"u")if(t.protoAction==="error"||t.protoAction==="ignore"||t.protoAction==="preserve")e.protoAction=t.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var r,n,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
38
+ `,r:"\r",t:" "},s,d=o(function(D){throw{name:"SyntaxError",message:D,at:r,text:s}},"error"),m=o(function(D){return D&&D!==n&&d("Expected '"+D+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),h=o(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 Du==null&&(Du=tp()),E.length>15?e.storeAsString?E:e.useNativeBigInt?BigInt(E):new Du(E):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(D):new Du(D):D},"number"),v=o(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 i[n]=="string")u+=i[n];else break;c=r}}d("Bad string")},"string"),_=o(function(){for(;n&&n<=" ";)m()},"white"),x=o(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,w=o(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=o(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+'"'),Fz.test(D)===!0?e.protoAction==="error"?d("Object contains forbidden prototype property"):e.protoAction==="ignore"?T():E[D]=T():Lz.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=o(function(){switch(_(),n){case"{":return S();case"[":return w();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"?o((function f(c,y){var l,b,g=c[y];return g&&typeof g=="object"&&Object.keys(g).forEach(function(ie){b=f(g,ie),b!==void 0?g[ie]=b:delete g[ie]}),E.call(c,y,g)}),"walk")({"":u},""):u}},"json_parse");tb.exports=jz});var ib=L((sQ,$u)=>{var nb=eb().stringify,ob=rb();$u.exports=function(t){return{parse:ob(t),stringify:nb}};$u.exports.parse=ob();$u.exports.stringify=nb});var rp=L(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.GCE_LINUX_BIOS_PATHS=void 0;Er.isGoogleCloudServerless=ub;Er.isGoogleComputeEngineLinux=cb;Er.isGoogleComputeEngineMACAddress=lb;Er.isGoogleComputeEngine=db;Er.detectGCPResidency=Bz;var ab=require("fs"),sb=require("os");Er.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var qz=/^42:01/;function ub(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(ub,"isGoogleCloudServerless");function cb(){if((0,sb.platform)()!=="linux")return!1;try{(0,ab.statSync)(Er.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,ab.readFileSync)(Er.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(cb,"isGoogleComputeEngineLinux");function lb(){let t=(0,sb.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(qz.test(r))return!0}return!1}o(lb,"isGoogleComputeEngineMACAddress");function db(){return cb()||lb()}o(db,"isGoogleComputeEngine");function Bz(){return ub()||db()}o(Bz,"detectGCPResidency")});var pb=L(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});Ou.Colours=void 0;var Ot=class t{static{o(this,"Colours")}static isEnabled(e){return e&&e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process==null?void 0:process.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};Ou.Colours=Ot;Ot.enabled=!1;Ot.reset="";Ot.bright="";Ot.dim="";Ot.red="";Ot.green="";Ot.yellow="";Ot.blue="";Ot.magenta="";Ot.cyan="";Ot.white="";Ot.grey="";Ot.refresh()});var gb=L(Xe=>{"use strict";var Vz=Xe&&Xe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gz=Xe&&Xe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fb=Xe&&Xe.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&Vz(r,e,n[i]);return Gz(r,e),r}})();Object.defineProperty(Xe,"__esModule",{value:!0});Xe.env=Xe.DebugLogBackendBase=Xe.placeholder=Xe.AdhocDebugLogger=Xe.LogSeverity=void 0;Xe.getNodeBackend=op;Xe.getDebugBackend=Wz;Xe.getStructuredBackend=Zz;Xe.setBackend=Kz;Xe.log=hb;var Hz=require("events"),wa=fb(require("process")),mb=fb(require("util")),Qt=pb(),Ir;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Ir||(Xe.LogSeverity=Ir={}));var ba=class extends Hz.EventEmitter{static{o(this,"AdhocDebugLogger")}constructor(e,r){super(),this.namespace=e,this.upstream=r,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:o((n,i)=>this.on(n,i),"on")}),this.func.debug=(...n)=>this.invokeSeverity(Ir.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Ir.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Ir.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Ir.ERROR,...n),this.func.sublog=n=>hb(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=ba;Xe.placeholder=new ba("",()=>{}).func;var ui=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=wa.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 i=this.cached.get(e);i||(i=this.makeLogger(e),this.cached.set(e,i)),i(r,...n)}catch(i){console.error(i)}}};Xe.DebugLogBackendBase=ui;var np=class extends ui{static{o(this,"NodeBackend")}constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(r,...n)=>{var i;let s=`${Qt.Colours.green}${e}${Qt.Colours.reset}`,d=`${Qt.Colours.yellow}${wa.pid}${Qt.Colours.reset}`,m;switch(r.severity){case Ir.ERROR:m=`${Qt.Colours.red}${r.severity}${Qt.Colours.reset}`;break;case Ir.INFO:m=`${Qt.Colours.magenta}${r.severity}${Qt.Colours.reset}`;break;case Ir.WARNING:m=`${Qt.Colours.yellow}${r.severity}${Qt.Colours.reset}`;break;default:m=(i=r.severity)!==null&&i!==void 0?i:Ir.DEFAULT;break}let h=mb.formatWithOptions({colors:Qt.Colours.enabled},...n),v=Object.assign({},r);delete v.severity;let _=Object.getOwnPropertyNames(v).length?JSON.stringify(v):"",x=_?`${Qt.Colours.grey}${_}${Qt.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 op(){return new np}o(op,"getNodeBackend");var ip=class extends ui{static{o(this,"DebugBackend")}constructor(e){super(),this.debugPkg=e}makeLogger(e){let r=this.debugPkg(e);return(n,...i)=>{r(i[0],...i.slice(1))}}setFilters(){var e;let r=(e=wa.env.NODE_DEBUG)!==null&&e!==void 0?e:"";wa.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function Wz(t){return new ip(t)}o(Wz,"getDebugBackend");var ap=class extends ui{static{o(this,"StructuredBackend")}constructor(e){var r;super(),this.upstream=(r=e)!==null&&r!==void 0?r:void 0}makeLogger(e){var r;let n=(r=this.upstream)===null||r===void 0?void 0:r.makeLogger(e);return(i,...s)=>{var d;let m=(d=i.severity)!==null&&d!==void 0?d:Ir.INFO,h=Object.assign({severity:m,message:mb.format(...s)},i),v=JSON.stringify(h);n?n(i,v):console.log("%s",v)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function Zz(t){return new ap(t)}o(Zz,"getStructuredBackend");Xe.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var sp=new Map,er;function Kz(t){er=t,sp.clear()}o(Kz,"setBackend");function hb(t,e){if(!er&&!wa.env[Xe.env.nodeEnables]||!t)return Xe.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=sp.get(t);if(r)return r.func;if(er===null)return Xe.placeholder;er===void 0&&(er=op());let n=(()=>{let i;return new ba(t,(d,...m)=>{if(i!==er){if(er===null)return;er===void 0&&(er=op()),i=er}er?.log(t,d,...m)})})();return sp.set(t,n),n.func}o(hb,"log")});var up=L(yo=>{"use strict";var Jz=yo&&yo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Yz=yo&&yo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Jz(e,t,r)};Object.defineProperty(yo,"__esModule",{value:!0});Yz(gb(),yo)});var Sa=L(Pe=>{"use strict";var vb=Pe&&Pe.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xz=Pe&&Pe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Qz=Pe&&Pe.__importStar||(function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&vb(r,e,n[i]);return Xz(r,e),r}})(),ek=Pe&&Pe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vb(e,t,r)};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.gcpResidencyCache=Pe.METADATA_SERVER_DETECTION=Pe.HEADERS=Pe.HEADER_VALUE=Pe.HEADER_NAME=Pe.SECONDARY_HOST_ADDRESS=Pe.HOST_ADDRESS=Pe.BASE_PATH=void 0;Pe.instance=ak;Pe.project=sk;Pe.universe=uk;Pe.bulk=ck;Pe.isAvailable=dk;Pe.resetIsAvailableCache=pk;Pe.getGCPResidency=dp;Pe.setGCPResidency=_b;Pe.requestTimeout=Pb;var cp=gt(),tk=ib(),rk=rp(),nk=Qz(up());Pe.BASE_PATH="/computeMetadata/v1";Pe.HOST_ADDRESS="http://169.254.169.254";Pe.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";Pe.HEADER_NAME="Metadata-Flavor";Pe.HEADER_VALUE="Google";Pe.HEADERS=Object.freeze({[Pe.HEADER_NAME]:Pe.HEADER_VALUE});var yb=nk.log("gcp-metadata");Pe.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 lp(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||Pe.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(Pe.BASE_PATH,t).href}o(lp,"getBaseUrl");function ok(t){Object.keys(t).forEach(e=>{switch(e){case"params":case"property":case"headers":break;case"qs":throw new Error("'qs' is not a valid configuration option. Please use 'params' instead.");default:throw new Error(`'${e}' is not a valid configuration option.`)}})}o(ok,"validate");async function Ta(t,e={},r=3,n=!1){let i=new Headers(Pe.HEADERS),s="",d={};if(typeof t=="object"){let x=t;new Headers(x.headers).forEach((T,w)=>i.set(w,T)),s=x.metadataKey,d=x.params||d,r=x.noResponseRetries||r,n=x.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(ok(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((x,T)=>i.set(T,x)),d=e.params||d);let m=n?ik:cp.request,h={url:`${lp()}/${s}`,headers:i,retryConfig:{noResponseRetries:r},params:d,responseType:"text",timeout:Pb()};yb.info("instance request %j",h);let v=await m(h);yb.info("instance metadata is %s",v.data);let _=v.headers.get(Pe.HEADER_NAME);if(_!==Pe.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${Pe.HEADER_NAME} header. Expected '${Pe.HEADER_VALUE}', got ${_?`'${_}'`:"no header"}`);if(typeof v.data=="string")try{return tk.parse(v.data)}catch{}return v.data}o(Ta,"metadataAccessor");async function ik(t){let e={...t,url:t.url?.toString().replace(lp(),lp(Pe.SECONDARY_HOST_ADDRESS))},r=(0,cp.request)(t),n=(0,cp.request)(e);return Promise.any([r,n])}o(ik,"fastFailMetadataRequest");function ak(t){return Ta("instance",t)}o(ak,"instance");function sk(t){return Ta("project",t)}o(sk,"project");function uk(t){return Ta("universe",t)}o(uk,"universe");async function ck(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await Ta(r),i=r.metadataKey;e[i]=n})())),e}o(ck,"bulk");function lk(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(lk,"detectGCPAvailableRetries");var Cu;async function dk(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in Pe.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(Pe.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return dp();case"ping-only":}}try{return Cu===void 0&&(Cu=Ta("instance",void 0,lk(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Cu,!0}catch(t){let e=t;if(process.env.DEBUG_AUTH&&console.info(e),e.type==="request-timeout"||e.response&&e.response.status===404)return!1;if(!(e.response&&e.response.status===404)&&(!e.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(e.code.toString()))){let r="UNKNOWN";e.code&&(r=e.code.toString()),process.emitWarning(`received unexpected error = ${e.message} code = ${r}`,"MetadataLookupWarning")}return!1}}o(dk,"isAvailable");function pk(){Cu=void 0}o(pk,"resetIsAvailableCache");Pe.gcpResidencyCache=null;function dp(){return Pe.gcpResidencyCache===null&&_b(),Pe.gcpResidencyCache}o(dp,"getGCPResidency");function _b(t=null){Pe.gcpResidencyCache=t!==null?t:(0,rk.detectGCPResidency)()}o(_b,"setGCPResidency");function Pb(){return dp()?0:3e3}o(Pb,"requestTimeout");ek(rp(),Pe)});var Tb=L(Nu=>{"use strict";Nu.byteLength=mk;Nu.toByteArray=gk;Nu.fromByteArray=_k;var jr=[],mr=[],fk=typeof Uint8Array<"u"?Uint8Array:Array,pp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(vo=0,wb=pp.length;vo<wb;++vo)jr[vo]=pp[vo],mr[pp.charCodeAt(vo)]=vo;var vo,wb;mr[45]=62;mr[95]=63;function bb(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}o(bb,"getLens");function mk(t){var e=bb(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(mk,"byteLength");function hk(t,e,r){return(e+r)*3/4-r}o(hk,"_byteLength");function gk(t){var e,r=bb(t),n=r[0],i=r[1],s=new fk(hk(t,n,i)),d=0,m=i>0?n-4:n,h;for(h=0;h<m;h+=4)e=mr[t.charCodeAt(h)]<<18|mr[t.charCodeAt(h+1)]<<12|mr[t.charCodeAt(h+2)]<<6|mr[t.charCodeAt(h+3)],s[d++]=e>>16&255,s[d++]=e>>8&255,s[d++]=e&255;return i===2&&(e=mr[t.charCodeAt(h)]<<2|mr[t.charCodeAt(h+1)]>>4,s[d++]=e&255),i===1&&(e=mr[t.charCodeAt(h)]<<10|mr[t.charCodeAt(h+1)]<<4|mr[t.charCodeAt(h+2)]>>2,s[d++]=e>>8&255,s[d++]=e&255),s}o(gk,"toByteArray");function yk(t){return jr[t>>18&63]+jr[t>>12&63]+jr[t>>6&63]+jr[t&63]}o(yk,"tripletToBase64");function vk(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(yk(n));return i.join("")}o(vk,"encodeChunk");function _k(t){for(var e,r=t.length,n=r%3,i=[],s=16383,d=0,m=r-n;d<m;d+=s)i.push(vk(t,d,d+s>m?m:d+s));return n===1?(e=t[r-1],i.push(jr[e>>2]+jr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(jr[e>>10]+jr[e>>4&63]+jr[e<<2&63]+"=")),i.join("")}o(_k,"fromByteArray")});var mp=L(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.fromArrayBufferToHex=Pk;function Pk(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(Pk,"fromArrayBufferToHex")});var Sb=L(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.BrowserCrypto=void 0;var ci=Tb(),wk=mp(),hp=class t{static{o(this,"BrowserCrypto")}constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return ci.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),ci.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),d=ci.toByteArray(t.padBase64(n)),m=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,m,d,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),d=await window.crypto.subtle.sign(n,s,i);return ci.fromByteArray(new Uint8Array(d))}decodeBase64StringUtf8(e){let r=ci.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return ci.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,wk.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,s=await window.crypto.subtle.importKey("raw",i.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,i.encode(r))}};zu.BrowserCrypto=hp});var xb=L(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.NodeCrypto=void 0;var li=require("crypto"),gp=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return li.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return li.randomBytes(e).toString("base64")}async verify(e,r,n){let i=li.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=li.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 li.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:Tk(e);return bk(li.createHmac("sha256",n).update(r).digest())}};ku.NodeCrypto=gp;function bk(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(bk,"toArrayBuffer");function Tk(t){return Buffer.from(t)}o(Tk,"toBuffer")});var xa=L(yn=>{"use strict";var Sk=yn&&yn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xk=yn&&yn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Sk(e,t,r)};Object.defineProperty(yn,"__esModule",{value:!0});yn.createCrypto=Ak;yn.hasBrowserCrypto=Eb;var Ek=Sb(),Ik=xb();xk(mp(),yn);function Ak(){return Eb()?new Ek.BrowserCrypto:new Ik.NodeCrypto}o(Ak,"createCrypto");function Eb(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(Eb,"hasBrowserCrypto")});var di=L((yp,Ab)=>{var Uu=require("buffer"),qr=Uu.Buffer;function Ib(t,e){for(var r in t)e[r]=t[r]}o(Ib,"copyProps");qr.from&&qr.alloc&&qr.allocUnsafe&&qr.allocUnsafeSlow?Ab.exports=Uu:(Ib(Uu,yp),yp.Buffer=_o);function _o(t,e,r){return qr(t,e,r)}o(_o,"SafeBuffer");_o.prototype=Object.create(qr.prototype);Ib(qr,_o);_o.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return qr(t,e,r)};_o.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=qr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};_o.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return qr(t)};_o.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Uu.SlowBuffer(t)}});var Db=L((RQ,Rb)=>{"use strict";function vp(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(vp,"getParamSize");var Rk={ES256:vp(256),ES384:vp(384),ES512:vp(521)};function Dk(t){var e=Rk[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(Dk,"getParamBytesForAlg");Rb.exports=Dk});var _p=L(($Q,kb)=>{"use strict";var Mu=di().Buffer,Ob=Db(),Fu=128,Cb=0,$k=32,Ok=16,Ck=2,Nb=Ok|$k|Cb<<6,Lu=Ck|Cb<<6;function Nk(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Nk,"base64Url");function zb(t){if(Mu.isBuffer(t))return t;if(typeof t=="string")return Mu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(zb,"signatureAsBuffer");function zk(t,e){t=zb(t);var r=Ob(e),n=r+1,i=t.length,s=0;if(t[s++]!==Nb)throw new Error('Could not find expected "seq"');var d=t[s++];if(d===(Fu|1)&&(d=t[s++]),i-s<d)throw new Error('"seq" specified length of "'+d+'", only "'+(i-s)+'" remaining');if(t[s++]!==Lu)throw new Error('Could not find expected "int" for "r"');var m=t[s++];if(i-s-2<m)throw new Error('"r" specified length of "'+m+'", only "'+(i-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++]!==Lu)throw new Error('Could not find expected "int" for "s"');var v=t[s++];if(i-s!==v)throw new Error('"s" specified length of "'+v+'", expected "'+(i-s)+'"');if(n<v)throw new Error('"s" specified length of "'+v+'", max of "'+n+'" is acceptable');var _=s;if(s+=v,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var x=r-m,T=r-v,w=Mu.allocUnsafe(x+m+T+v);for(s=0;s<x;++s)w[s]=0;t.copy(w,s,h+Math.max(-x,0),h+m),s=r;for(var S=s;s<S+T;++s)w[s]=0;return t.copy(w,s,_+Math.max(-T,0),_+v),w=w.toString("base64"),w=Nk(w),w}o(zk,"derToJose");function $b(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=Fu;return i&&--n,n}o($b,"countPadding");function kk(t,e){t=zb(t);var r=Ob(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=$b(t,0,r),s=$b(t,r,t.length),d=r-i,m=r-s,h=2+d+1+1+m,v=h<Fu,_=Mu.allocUnsafe((v?2:3)+h),x=0;return _[x++]=Nb,v?_[x++]=h:(_[x++]=Fu|1,_[x++]=h&255),_[x++]=Lu,_[x++]=d,i<0?(_[x++]=0,x+=t.copy(_,x,0,r)):x+=t.copy(_,x,i,r),_[x++]=Lu,_[x++]=m,s<0?(_[x++]=0,t.copy(_,x,r)):t.copy(_,x,r+s),_}o(kk,"joseToDer");kb.exports={derToJose:zk,joseToDer:kk}});var Ar=L(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.LRUCache=void 0;vn.snakeToCamel=Mb;vn.originalOrCamelOptions=Lk;vn.removeUndefinedValuesInObject=jk;vn.isValidFile=qk;vn.getWellKnownCertificateConfigFileLocation=Bk;var Uk=require("fs"),Mk=require("os"),Pp=require("path"),Fk="certificate_config.json",Ub="gcloud";function Mb(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(Mb,"snakeToCamel");function Lk(t){function e(r){let n=t||{};return n[r]??n[Mb(r)]}return o(e,"get"),{get:e}}o(Lk,"originalOrCamelOptions");var wp=class{static{o(this,"LRUCache")}capacity;#e=new Map;maxAge;constructor(e){this.capacity=e.capacity,this.maxAge=e.maxAge}#t(e,r){this.#e.delete(e),this.#e.set(e,{value:r,lastAccessed:Date.now()})}set(e,r){this.#t(e,r),this.#r()}get(e){let r=this.#e.get(e);if(r)return this.#t(e,r.value),this.#r(),r.value}#r(){let e=this.maxAge?Date.now()-this.maxAge:0,r=this.#e.entries().next();for(;!r.done&&(this.#e.size>this.capacity||r.value[1].lastAccessed<e);)this.#e.delete(r.value[0]),r=this.#e.entries().next()}};vn.LRUCache=wp;function jk(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(jk,"removeUndefinedValuesInObject");async function qk(t){try{return(await Uk.promises.lstat(t)).isFile()}catch{return!1}}o(qk,"isValidFile");function Bk(){let t=process.env.CLOUDSDK_CONFIG||(Vk()?Pp.join(process.env.APPDATA||"",Ub):Pp.join(process.env.HOME||"",".config",Ub));return Pp.join(t,Fk)}o(Bk,"getWellKnownCertificateConfigFileLocation");function Vk(){return Mk.platform().startsWith("win")}o(Vk,"_isWindows")});var Fb=L((zQ,Gk)=>{Gk.exports={name:"google-auth-library",version:"10.5.0",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:"googleapis/google-auth-library-nodejs.git",keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.0.0","gcp-metadata":"^8.0.0","google-logging-utils":"^1.0.0",gtoken:"^8.0.0",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","assert-rejects":"^1.0.0",c8:"^10.0.0",codecov:"^3.0.2",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","ts-loader":"^8.0.0",typescript:"5.8.2",webpack:"^5.21.2","webpack-cli":"^4.0.0"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start","docs-test":"echo 'disabled until linkinator is fixed'","predocs-test":"npm run docs",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0"}});var bp=L(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.USER_AGENT=Zn.PRODUCT_NAME=Zn.pkg=void 0;var Lb=Fb();Zn.pkg=Lb;var jb="google-api-nodejs-client";Zn.PRODUCT_NAME=jb;var Hk=`${jb}/${Lb.version}`;Zn.USER_AGENT=Hk});var tr=L(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.AuthClient=Rr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Rr.DEFAULT_UNIVERSE=void 0;var Wk=require("events"),Tp=gt(),Zk=Ar(),Kk=up(),Sp=bp();Rr.DEFAULT_UNIVERSE="googleapis.com";Rr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var xp=class t extends Wk.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=Rr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=Rr.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,Zk.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")??Rr.DEFAULT_UNIVERSE,this.transporter=e.transporter??new Tp.Gaxios(e.transporterOptions),r.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(t.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(t.DEFAULT_RESPONSE_INTERCEPTOR)),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=e.forceRefreshOnFailure??!1}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&Tp.Gaxios.mergeHeaders(s,r.headers),n&&Tp.Gaxios.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e.has("x-goog-user-project")&&this.quotaProjectId&&e.set("x-goog-user-project",this.quotaProjectId),e}addUserProjectAndAuthHeaders(e,r){let n=r.get("x-goog-user-project"),i=r.get("authorization");return n&&e.set("x-goog-user-project",n),i&&e.set("authorization",i),e}static log=(0,Kk.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:o(async e=>{if(!e.headers.has("x-goog-api-client")){let n=process.version.replace(/^v/,"");e.headers.set("x-goog-api-client",`gl-node/${n}`)}let r=e.headers.get("User-Agent");r?r.includes(`${Sp.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${Sp.USER_AGENT}`):e.headers.set("User-Agent",Sp.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let d={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,s,d):t.log.info("[%s] request %j",s,d)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},"resolved"),rejected:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e},"rejected")};static setMethodName(e,r){try{let n=e;n[t.RequestMethodNameSymbol]=r}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};Rr.AuthClient=xp});var Ip=L(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.LoginTicket=void 0;var Ep=class{static{o(this,"LoginTicket")}envelope;payload;constructor(e,r){this.envelope=e,this.payload=r}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let e=this.getPayload();return e&&e.sub?e.sub:null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}};ju.LoginTicket=Ep});var Po=L(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.OAuth2Client=Br.ClientAuthentication=Br.CertificateFormat=Br.CodeChallengeMethod=void 0;var qb=gt(),Jk=require("querystring"),Yk=require("stream"),Xk=_p(),Bb=Ar(),Ap=xa(),pi=tr(),Qk=Ip(),Vb;(function(t){t.Plain="plain",t.S256="S256"})(Vb||(Br.CodeChallengeMethod=Vb={}));var _n;(function(t){t.PEM="PEM",t.JWK="JWK"})(_n||(Br.CertificateFormat=_n={}));var Ea;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(Ea||(Br.ClientAuthentication=Ea={}));var Rp=class t extends pi.AuthClient{static{o(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||Ea.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()+"?"+Jk.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,Ap.createCrypto)(),n=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),s=(await e.sha256DigestBase64(n)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:n,codeChallenge:s}}getToken(e,r){let n=typeof e=="string"?{code:e}:e;if(r)this.getTokenAsync(n).then(i=>r(null,i.tokens,i.res),i=>r(i,null,i.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,i={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===Ea.ClientSecretBasic){let h=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${h.toString("base64")}`)}this.clientAuthentication===Ea.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,Bb.removeUndefinedValuesInObject)(i)),headers:n};pi.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"},i;try{let d={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,Bb.removeUndefinedValuesInObject)(n))};pi.AuthClient.setMethodName(d,"refreshTokenNoCache"),i=await this.transporter.request(d)}catch(d){throw d instanceof qb.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=i.data;return i.data&&i.data.expires_in&&(s.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(r=>e(null,r.credentials,r.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),r=e.tokens;return r.refresh_token=this.credentials.refresh_token,this.credentials=r,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(r=>e(null,r.token,r.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let n=await this.processAndValidateRefreshHandler();if(n?.access_token)return this.setCredentials(n),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let r=this.credentials;if(!r.access_token&&!r.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(r.access_token&&!this.isTokenExpiring()){r.token_type=r.token_type||"Bearer";let 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,i=null;try{n=await this.refreshToken(r.refresh_token),i=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",i.refresh_token=s.refresh_token,this.credentials=i;let d=new Headers({authorization:s.token_type+" "+i.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(pi.AuthClient.setMethodName(n,"revokeToken"),r)this.transporter.request(n).then(i=>r(null,i),r);else return this.transporter.request(n)}revokeCredentials(e){if(e)this.revokeCredentialsAsync().then(r=>e(null,r),e);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let e=this.credentials.access_token;if(this.credentials={},e)return this.revokeToken(e);throw new Error("No access token to revoke.")}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){try{let n=await this.getRequestMetadataAsync();return e.headers=qb.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,n.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(n){let i=n.response;if(i){let s=i.status,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=i.config.data instanceof Yk.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,Ap.hasBrowserCrypto)()?_n.JWK:_n.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case _n.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case _n.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let v={...t.RETRY_CONFIG,url:i};pi.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};pi.AuthClient.setMethodName(n,"getIapPublicKeysAsync"),e=await this.transporter.request(n)}catch(n){throw n instanceof Error&&(n.message=`Failed to retrieve verification certificates: ${n.message}`),n}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,r,n,i,s){let d=(0,Ap.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=Xk.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(i&&i.indexOf(x.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], 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 Qk.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}};Br.OAuth2Client=Rp});var $p=L(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.Compute=void 0;var eU=gt(),Gb=Sa(),tU=Po(),Dp=class extends tU.OAuth2Client{static{o(this,"Compute")}serviceAccountEmail;scopes;constructor(e={}){super(e),this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=e.serviceAccountEmail||"default",this.scopes=Array.isArray(e.scopes)?e.scopes:e.scopes?[e.scopes]:[]}async refreshTokenNoCache(){let e=`service-accounts/${this.serviceAccountEmail}/token`,r;try{let i={property:e};this.scopes.length>0&&(i.params={scopes:this.scopes.join(",")}),r=await Gb.instance(i)}catch(i){throw i instanceof eU.GaxiosError&&(i.message=`Could not refresh access token: ${i.message}`,this.wrapError(i)),i}let n=r;return r&&r.expires_in&&(n.expiry_date=new Date().getTime()+r.expires_in*1e3,delete n.expires_in),this.emit("tokens",n),{tokens:n,res:null}}async fetchIdToken(e){let r=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${e}`,n;try{let i={property:r};n=await Gb.instance(i)}catch(i){throw i instanceof Error&&(i.message=`Could not fetch ID token: ${i.message}`),i}return n}wrapError(e){let r=e.response;r&&r.status&&(e.status=r.status,r.status===403?e.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+e.message:r.status===404&&(e.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+e.message))}};qu.Compute=Dp});var Cp=L(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.IdTokenClient=void 0;var rU=Po(),Op=class extends rU.OAuth2Client{static{o(this,"IdTokenClient")}targetAudience;idTokenProvider;constructor(e){super(e),this.targetAudience=e.targetAudience,this.idTokenProvider=e.idTokenProvider}async getRequestMetadataAsync(){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let r=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:r,expiry_date:this.getIdTokenExpiryDate(r)}}return{headers:new Headers({authorization:"Bearer "+this.credentials.id_token})}}getIdTokenExpiryDate(e){let r=e.split(".")[1];if(r)return JSON.parse(Buffer.from(r,"base64").toString("ascii")).exp*1e3}};Bu.IdTokenClient=Op});var Np=L(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.GCPEnv=void 0;fi.clear=nU;fi.getEnv=oU;var Hb=Sa(),Vr;(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"})(Vr||(fi.GCPEnv=Vr={}));var Ia;function nU(){Ia=void 0}o(nU,"clear");async function oU(){return Ia||(Ia=iU(),Ia)}o(oU,"getEnv");async function iU(){let t=Vr.NONE;return aU()?t=Vr.APP_ENGINE:sU()?t=Vr.CLOUD_FUNCTIONS:await dU()?await lU()?t=Vr.KUBERNETES_ENGINE:uU()?t=Vr.CLOUD_RUN:cU()?t=Vr.CLOUD_RUN_JOBS:t=Vr.COMPUTE_ENGINE:t=Vr.NONE,t}o(iU,"getEnvMemoized");function aU(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(aU,"isAppEngine");function sU(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(sU,"isCloudFunction");function uU(){return!!process.env.K_CONFIGURATION}o(uU,"isCloudRun");function cU(){return!!process.env.CLOUD_RUN_JOB}o(cU,"isCloudRunJob");async function lU(){try{return await Hb.instance("attributes/cluster-name"),!0}catch{return!1}}o(lU,"isKubernetesEngine");async function dU(){return Hb.isAvailable()}o(dU,"isComputeEngine")});var zp=L((KQ,Wb)=>{var Vu=di().Buffer,pU=require("stream"),fU=require("util");function Gu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Vu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Vu.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}o(Gu,"DataStream");fU.inherits(Gu,pU);Gu.prototype.write=o(function(e){this.buffer=Vu.concat([this.buffer,Vu.from(e)]),this.emit("data",e)},"write");Gu.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Wb.exports=Gu});var Kb=L((YQ,Zb)=>{"use strict";var Aa=require("buffer").Buffer,kp=require("buffer").SlowBuffer;Zb.exports=Hu;function Hu(t,e){if(!Aa.isBuffer(t)||!Aa.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}o(Hu,"bufferEq");Hu.install=function(){Aa.prototype.equal=kp.prototype.equal=o(function(e){return Hu(this,e)},"equal")};var mU=Aa.prototype.equal,hU=kp.prototype.equal;Hu.restore=function(){Aa.prototype.equal=mU,kp.prototype.equal=hU}});var Lp=L((QQ,oT)=>{var hi=di().Buffer,hr=require("crypto"),Yb=_p(),Jb=require("util"),gU=`"%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".`,Aa="secret must be a string or buffer",fo="key must be a string or a buffer",tU="key must be a string, a buffer or an object",kp=typeof hr.createPublicKey=="function";kp&&(fo+=" or a KeyObject",Aa+="or a KeyObject");function Hb(t){if(!mo.isBuffer(t)&&typeof t!="string"&&(!kp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Rr(fo)}i(Hb,"checkIsPublicKey");function Wb(t){if(!mo.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Rr(tU)}i(Wb,"checkIsPrivateKey");function rU(t){if(!mo.isBuffer(t)){if(typeof t=="string")return t;if(!kp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Rr(Aa)}}i(rU,"checkIsSecretKey");function zp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(zp,"fromBase64");function Zb(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(Zb,"toBase64");function Rr(t){var e=[].slice.call(arguments,1),r=Vb.format.bind(Vb,t).apply(null,e);return new TypeError(r)}i(Rr,"typeError");function nU(t){return mo.isBuffer(t)||typeof t=="string"}i(nU,"bufferOrString");function Ra(t){return nU(t)||(t=JSON.stringify(t)),t}i(Ra,"normalizeInput");function Kb(t){return i(function(r,n){rU(n),r=Ra(r);var o=hr.createHmac("sha"+t,n),s=(o.update(r),o.digest("base64"));return zp(s)},"sign")}i(Kb,"createHmacSigner");var Np,iU="timingSafeEqual"in hr?i(function(e,r){return e.byteLength!==r.byteLength?!1:hr.timingSafeEqual(e,r)},"timingSafeEqual"):i(function(e,r){return Np||(Np=Bb()),Np(e,r)},"timingSafeEqual");function oU(t){return i(function(r,n,o){var s=Kb(t)(r,o);return iU(mo.from(n),mo.from(s))},"verify")}i(oU,"createHmacVerifier");function Jb(t){return i(function(r,n){Wb(n),r=Ra(r);var o=hr.createSign("RSA-SHA"+t),s=(o.update(r),o.sign(n,"base64"));return zp(s)},"sign")}i(Jb,"createKeySigner");function Yb(t){return i(function(r,n,o){Hb(o),r=Ra(r),n=Zb(n);var s=hr.createVerify("RSA-SHA"+t);return s.update(r),s.verify(o,n,"base64")},"verify")}i(Yb,"createKeyVerifier");function aU(t){return i(function(r,n){Wb(n),r=Ra(r);var o=hr.createSign("RSA-SHA"+t),s=(o.update(r),o.sign({key:n,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return zp(s)},"sign")}i(aU,"createPSSKeySigner");function sU(t){return i(function(r,n,o){Hb(o),r=Ra(r),n=Zb(n);var s=hr.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:o,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}i(sU,"createPSSKeyVerifier");function uU(t){var e=Jb(t);return i(function(){var n=e.apply(null,arguments);return n=Gb.derToJose(n,"ES"+t),n},"sign")}i(uU,"createECDSASigner");function cU(t){var e=Yb(t);return i(function(n,o,s){o=Gb.joseToDer(o,"ES"+t).toString("base64");var p=e(n,o,s);return p},"verify")}i(cU,"createECDSAVerifer");function lU(){return i(function(){return""},"sign")}i(lU,"createNoneSigner");function dU(){return i(function(e,r){return r===""},"verify")}i(dU,"createNoneVerifier");Xb.exports=i(function(e){var r={hs:Kb,rs:Jb,ps:aU,es:uU,none:lU},n={hs:oU,rs:Yb,ps:sU,es:cU,none:dU},o=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!o)throw Rr(eU,e);var s=(o[1]||o[3]).toLowerCase(),p=o[2];return{sign:r[s](p),verify:n[s](p)}},"jwa")});var Mp=L((mQ,Qb)=>{var pU=require("buffer").Buffer;Qb.exports=i(function(e){return typeof e=="string"?e:typeof e=="number"||pU.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var oT=L((gQ,iT)=>{var fU=co().Buffer,eT=Op(),mU=Up(),hU=require("stream"),tT=Mp(),Fp=require("util");function rT(t,e){return fU.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}i(rT,"base64url");function gU(t,e,r){r=r||"utf8";var n=rT(tT(t),"binary"),o=rT(tT(e),r);return Fp.format("%s.%s",n,o)}i(gU,"jwsSecuredInput");function nT(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=mU(e.alg),p=gU(e,r,o),m=s.sign(p,n);return Fp.format("%s.%s",p,m)}i(nT,"jwsSign");function Wu(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 eT(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new eT(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(Wu,"SignStream");Fp.inherits(Wu,hU);Wu.prototype.sign=i(function(){try{var e=nT({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");Wu.sign=nT;iT.exports=Wu});var hT=L((vQ,mT)=>{var sT=co().Buffer,aT=Op(),yU=Up(),vU=require("stream"),uT=Mp(),_U=require("util"),PU=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function wU(t){return Object.prototype.toString.call(t)==="[object Object]"}i(wU,"isObject");function bU(t){if(wU(t))return t;try{return JSON.parse(t)}catch{return}}i(bU,"safeJsonParse");function cT(t){var e=t.split(".",1)[0];return bU(sT.from(e,"base64").toString("binary"))}i(cT,"headerFromJWS");function TU(t){return t.split(".",2).join(".")}i(TU,"securedInputFromJWS");function lT(t){return t.split(".")[2]}i(lT,"signatureFromJWS");function SU(t,e){e=e||"utf8";var r=t.split(".")[1];return sT.from(r,"base64").toString(e)}i(SU,"payloadFromJWS");function dT(t){return PU.test(t)&&!!cT(t)}i(dT,"isValidJws");function pT(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=uT(t);var o=lT(t),s=TU(t),p=yU(e);return p.verify(s,o,r)}i(pT,"jwsVerify");function fT(t,e){if(e=e||{},t=uT(t),!dT(t))return null;var r=cT(t);if(!r)return null;var n=SU(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:lT(t)}}i(fT,"jwsDecode");function ho(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 aT(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new aT(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(ho,"VerifyStream");_U.inherits(ho,vU);ho.prototype.verify=i(function(){try{var e=pT(this.signature.buffer,this.algorithm,this.key.buffer),r=fT(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");ho.decode=fT;ho.isValid=dT;ho.verify=pT;mT.exports=ho});var Lp=L(Kn=>{var gT=oT(),Zu=hT(),xU=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Kn.ALGORITHMS=xU;Kn.sign=gT.sign;Kn.verify=Zu.verify;Kn.decode=Zu.decode;Kn.isValid=Zu.isValid;Kn.createSign=i(function(e){return new gT(e)},"createSign");Kn.createVerify=i(function(e){return new Zu(e)},"createVerify")});var $T=L(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.GoogleToken=void 0;var yT=Ku(require("fs")),EU=ht(),IU=Ku(Lp()),AU=Ku(require("path")),RU=require("util");function Ku(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Ku=i(function(s,p){if(!p&&s&&s.__esModule)return s;var m,h,v={__proto__:null,default:s};if(s===null||_n(s)!="object"&&typeof s!="function")return v;if(m=p?n:r){if(m.has(s))return m.get(s);m.set(s,v)}for(var P in s)P!=="default"&&{}.hasOwnProperty.call(s,P)&&((h=(m=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,P))&&(h.get||h.set)?m(v,P,h):v[P]=s[P]);return v},"_interopRequireWildcard"))(t,e)}i(Ku,"_interopRequireWildcard");function _n(t){"@babel/helpers - typeof";return _n=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},_n(t)}i(_n,"_typeof");function DU(t,e){ET(t,e),e.add(t)}i(DU,"_classPrivateMethodInitSpec");function $U(t,e,r){ET(t,e),e.set(t,r)}i($U,"_classPrivateFieldInitSpec");function ET(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(ET,"_checkPrivateRedeclaration");function vT(t,e,r){return t.set(Dr(t,e),r),r}i(vT,"_classPrivateFieldSet");function _T(t,e){return t.get(Dr(t,e))}i(_T,"_classPrivateFieldGet");function Dr(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(Dr,"_assertClassBrand");function PT(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,RT(n.key),n)}}i(PT,"_defineProperties");function IT(t,e,r){return e&&PT(t.prototype,e),r&&PT(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}i(IT,"_createClass");function AT(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}i(AT,"_classCallCheck");function OU(t,e,r){return e=Ca(e),CU(t,Hp()?Reflect.construct(e,r||[],Ca(t).constructor):e.apply(t,r))}i(OU,"_callSuper");function CU(t,e){if(e&&(_n(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NU(t)}i(CU,"_possibleConstructorReturn");function NU(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}i(NU,"_assertThisInitialized");function kU(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&&Oa(t,e)}i(kU,"_inherits");function jp(t){var e=typeof Map=="function"?new Map:void 0;return jp=i(function(n){if(n===null||!UU(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 zU(n,arguments,Ca(this).constructor)}return i(o,"Wrapper"),o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Oa(o,n)},"_wrapNativeSuper"),jp(t)}i(jp,"_wrapNativeSuper");function zU(t,e,r){if(Hp())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&Oa(o,r.prototype),o}i(zU,"_construct");function Hp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hp=i(function(){return!!t},"_isNativeReflectConstruct"))()}i(Hp,"_isNativeReflectConstruct");function UU(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}i(UU,"_isNativeFunction");function Oa(t,e){return Oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Oa(t,e)}i(Oa,"_setPrototypeOf");function Ca(t){return Ca=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ca(t)}i(Ca,"_getPrototypeOf");function rr(t,e,r){return(e=RT(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}i(rr,"_defineProperty");function RT(t){var e=MU(t,"string");return _n(e)=="symbol"?e:e+""}i(RT,"_toPropertyKey");function MU(t,e){if(_n(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(_n(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}i(MU,"_toPrimitive");function ir(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function s(w,S,D,E){var u=S&&S.prototype instanceof m?S:m,f=Object.create(u.prototype);return nr(f,"_invoke",(function(c,y,l){var b,g,oe,ne=0,Re=l||[],se=!1,Y={p:0,n:0,v:t,a:K,f:K.bind(t,4),d:i(function(te,ce){return b=te,g=0,oe=t,Y.n=ce,p},"d")};function K(re,te){for(g=re,oe=te,e=0;!se&&ne&&!ce&&e<Re.length;e++){var ce,de=Re[e],Oe=Y.p,ze=de[2];re>3?(ce=ze===te)&&(oe=de[(g=de[4])?5:(g=3,3)],de[4]=de[5]=t):de[0]<=Oe&&((ce=re<2&&Oe<de[1])?(g=0,Y.v=te,Y.n=de[1]):Oe<ze&&(ce=re<3||de[0]>te||te>ze)&&(de[4]=re,de[5]=te,Y.n=ze,g=0))}if(ce||re>1)return p;throw se=!0,te}return i(K,"d"),function(re,te,ce){if(ne>1)throw TypeError("Generator is already running");for(se&&te===1&&K(te,ce),g=te,oe=ce;(e=g<2?t:oe)||!se;){b||(g?g<3?(g>1&&(Y.n=-1),K(g,oe)):Y.n=oe:Y.v=oe);try{if(ne=2,b){if(g||(re="next"),e=b[re]){if(!(e=e.call(b,oe)))throw TypeError("iterator result is not an object");if(!e.done)return e;oe=e.value,g<2&&(g=0)}else g===1&&(e=b.return)&&e.call(b),g<2&&(oe=TypeError("The iterator does not provide a '"+re+"' method"),g=1);b=t}else if((e=(se=Y.n<0)?oe:c.call(y,Y))!==p)break}catch(de){b=t,g=1,oe=de}finally{ne=1}}return{value:e,done:se}}})(w,D,E),!0),f}i(s,"i");var p={};function m(){}i(m,"Generator");function h(){}i(h,"GeneratorFunction");function v(){}i(v,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var P=[][n]?e(e([][n]())):(nr(e={},n,function(){return this}),e),x=v.prototype=m.prototype=Object.create(P);function T(w){return Object.setPrototypeOf?Object.setPrototypeOf(w,v):(w.__proto__=v,nr(w,o,"GeneratorFunction")),w.prototype=Object.create(x),w}return i(T,"f"),h.prototype=v,nr(x,"constructor",v),nr(v,"constructor",h),h.displayName="GeneratorFunction",nr(v,o,"GeneratorFunction"),nr(x),nr(x,o,"Generator"),nr(x,n,function(){return this}),nr(x,"toString",function(){return"[object Generator]"}),(ir=i(function(){return{w:s,m:T}},"_regenerator"))()}i(ir,"_regenerator");function nr(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch{o=0}nr=i(function(p,m,h,v){if(m)o?o(p,m,{value:h,enumerable:!v,configurable:!v,writable:!v}):p[m]=h;else{var P=i(function(T,w){nr(p,T,function(S){return this._invoke(T,w,S)})},"o");P("next",0),P("throw",1),P("return",2)}},"_regeneratorDefine"),nr(t,e,r,n)}i(nr,"_regeneratorDefine2");function wT(t,e,r,n,o,s,p){try{var m=t[s](p),h=m.value}catch(v){return void r(v)}m.done?e(h):Promise.resolve(h).then(n,o)}i(wT,"asyncGeneratorStep");function go(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var s=t.apply(e,r);function p(h){wT(s,n,o,p,m,"next",h)}i(p,"_next");function m(h){wT(s,n,o,p,m,"throw",h)}i(m,"_throw"),p(void 0)})}}i(go,"_asyncToGenerator");var bT=yT.readFile?(0,RU.promisify)(yT.readFile):go(ir().m(i(function t(){return ir().w(function(e){for(;;)switch(e.n){case 0:throw new $a("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),TT="https://oauth2.googleapis.com/token",FU="https://oauth2.googleapis.com/revoke?token=",$a=(function(t){function e(r,n){var o;return AT(this,e),o=OU(this,e,[r]),rr(o,"code",void 0),o.code=n,o}return i(e,"ErrorWithCode"),kU(e,t),IT(e)})(jp(Error)),Da=new WeakMap,Gr=new WeakSet,bQ=Ju.GoogleToken=(function(){function t(e){AT(this,t),DU(this,Gr),rr(this,"expiresAt",void 0),rr(this,"key",void 0),rr(this,"keyFile",void 0),rr(this,"iss",void 0),rr(this,"sub",void 0),rr(this,"scope",void 0),rr(this,"rawToken",void 0),rr(this,"tokenExpires",void 0),rr(this,"email",void 0),rr(this,"additionalClaims",void 0),rr(this,"eagerRefreshThresholdMillis",void 0),rr(this,"transporter",{request:i(function(n){return(0,EU.request)(n)},"request")}),$U(this,Da,void 0),Dr(Gr,this,DT).call(this,e)}return i(t,"GoogleToken"),IT(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(_n(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var o=r;Dr(Gr,this,ST).call(this,n).then(function(s){return o(null,s)},r);return}return Dr(Gr,this,ST).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=go(ir().m(i(function n(o){var s,p,m,h,v,P,x;return ir().w(function(T){for(;;)switch(T.n){case 0:s=AU.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,bT(o,"utf8");case 2:if(p=T.v,m=JSON.parse(p),h=m.private_key,v=m.client_email,!(!h||!v)){T.n=3;break}throw new $a("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,bT(o,"utf8");case 5:return P=T.v,T.a(2,{privateKey:P});case 6:throw new $a("*.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 $a("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){Dr(Gr,this,xT).call(this).then(function(){return r()},r);return}return Dr(Gr,this,xT).call(this)},"revokeToken")}])})();function ST(t){return qp.apply(this,arguments)}i(ST,"_getTokenAsync");function qp(){return qp=go(ir().m(i(function t(e){return ir().w(function(r){for(;;)switch(r.n){case 0:if(!(_T(Da,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,_T(Da,this));case 1:return r.p=1,r.n=2,vT(Da,this,Dr(Gr,this,LU).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,vT(Da,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),qp.apply(this,arguments)}i(qp,"_getTokenAsync2");function LU(t){return Bp.apply(this,arguments)}i(LU,"_getTokenAsyncInner");function Bp(){return Bp=go(ir().m(i(function t(e){var r;return ir().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||Dr(Gr,this,jU).call(this);case 4:return n.a(2,Dr(Gr,this,qU).call(this))}},t,this)},"_callee4"))),Bp.apply(this,arguments)}i(Bp,"_getTokenAsyncInner2");function jU(){if(!this.iss)throw new $a("email is required.","MISSING_CREDENTIALS")}i(jU,"_ensureEmail");function xT(){return Vp.apply(this,arguments)}i(xT,"_revokeTokenAsync");function Vp(){return Vp=go(ir().m(i(function t(){var e;return ir().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=FU+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Dr(Gr,this,DT).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"))),Vp.apply(this,arguments)}i(Vp,"_revokeTokenAsync2");function DT(){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,_n(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}i(DT,"_configure");function qU(){return Gp.apply(this,arguments)}i(qU,"_requestToken");function Gp(){return Gp=go(ir().m(i(function t(){var e,r,n,o,s,p,m,h,v,P;return ir().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:TT,exp:e+3600,iat:e,sub:this.sub},r),o=IU.sign({header:{alg:"RS256"},payload:n,secret:this.key}),x.p=1,x.n=2,this.transporter.request({method:"POST",url:TT,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,P=x.v,this.rawToken=void 0,this.tokenExpires=void 0,h=P.response&&(p=P.response)!==null&&p!==void 0&&p.data?(m=P.response)===null||m===void 0?void 0:m.data:{},h.error&&(v=h.error_description?": ".concat(h.error_description):"",P.message="".concat(h.error).concat(v)),P;case 4:return x.a(2)}},t,this,[[1,3]])},"_callee6"))),Gp.apply(this,arguments)}i(Gp,"_requestToken2")});var Zp=L(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.JWTAccess=void 0;var BU=Lp(),VU=Ir(),OT={alg:"RS256",typ:"JWT"},Wp=class t{static{i(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new VU.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),p=Date.now();if(s&&s.expiration-p>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 P=this.keyId?{...OT,kid:this.keyId}:OT,x=Object.assign(v,r),T=BU.sign({header:P,payload:x,secret:this.key}),w=new Headers({authorization:`Bearer ${T}`});return this.cache.set(o,{expiration:h*1e3,headers:w}),w}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)}})})}};Yu.JWTAccess=Wp});var Jp=L(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.JWT=void 0;var CT=$T(),GU=Zp(),HU=_i(),Xu=tr(),Kp=class t extends HU.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!==Xu.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==Xu.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${Xu.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 GU.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!==Xu.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 CT.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 CT.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.")}};Qu.JWT=Kp});var Xp=L(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.UserRefreshClient=yo.USER_REFRESH_ACCOUNT_TYPE=void 0;var WU=_i(),ZU=tr();yo.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var Yp=class t extends WU.OAuth2Client{static{i(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,o,s){let p=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:o,forceRefreshOnFailure:s};super(p),this._refreshToken=p.refreshToken,this.credentials.refresh_token=p.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 ZU.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}};yo.UserRefreshClient=Yp});var ef=L(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.Impersonated=vo.IMPERSONATED_ACCOUNT_TYPE=void 0;var NT=_i(),KU=ht(),JU=Ir();vo.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var Qp=class t extends NT.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 NT.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,JU.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 KU.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}};vo.Impersonated=Qp});var rf=L(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.OAuthClientAuthHandler=void 0;Na.getErrorFromOAuthErrorResponse=QU;var _o=ht(),YU=Sa(),XU=["PUT","POST","PATCH"],tf=class{static{i(this,"OAuthClientAuthHandler")}#e=(0,YU.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new _o.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new _o.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=_o.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=_o.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=_o.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,o=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${o}`);_o.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!XU.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"]}}}};Na.OAuthClientAuthHandler=tf;function QU(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 p=new Error(s);if(e){let m=Object.keys(e);e.stack&&m.push("stack"),m.forEach(h=>{h!=="message"&&Object.defineProperty(p,h,{value:e[h],writable:!1,enumerable:!0})})}return p}i(QU,"getErrorFromOAuthErrorResponse")});var tc=L(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.StsCredentials=void 0;var eM=ht(),tM=tr(),kT=rf(),rM=Ir(),nf=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,rM.removeUndefinedValuesInObject)(o))};tM.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let p=await this.transporter.request(s),m=p.data;return m.res=p,m}catch(p){throw p instanceof eM.GaxiosError&&p.response?(0,kT.getErrorFromOAuthErrorResponse)(p.response.data,p):p}}};ec.StsCredentials=nf});var Jn=L(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.BaseExternalAccountClient=gr.CLOUD_RESOURCE_MANAGER=gr.EXTERNAL_ACCOUNT_TYPE=gr.EXPIRATION_TIME_OFFSET=void 0;var nM=ht(),iM=require("stream"),of=tr(),oM=tc(),zT=Ir(),aM=_p(),sM="urn:ietf:params:oauth:grant-type:token-exchange",uM="urn:ietf:params:oauth:token-type:access_token",af="https://www.googleapis.com/auth/cloud-platform",cM=3600;gr.EXPIRATION_TIME_OFFSET=300*1e3;gr.EXTERNAL_ACCOUNT_TYPE="external_account";gr.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var lM="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",dM="https://sts.{universeDomain}/v1/token",sf=class t extends of.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!==gr.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${gr.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")??dM.replace("{universeDomain}",this.universeDomain);let p=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"),P=(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 oM.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[af],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=p,this.workforcePoolUserProject=m;let x=new RegExp(lM);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=P,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=cM),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}`};of.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=nM.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let p=s.status,m=s.config.data instanceof iM.Readable;if(!r&&(p===401||p===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:sM,audience:this.audience,requestedTokenType:uM,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[af]: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"}};of.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||[af]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${aM.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};gr.BaseExternalAccountClient=sf});var UT=L(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.FileSubjectTokenSupplier=void 0;var cf=require("util"),lf=require("fs"),pM=(0,cf.promisify)(lf.readFile??(()=>{})),fM=(0,cf.promisify)(lf.realpath??(()=>{})),mM=(0,cf.promisify)(lf.lstat??(()=>{})),uf=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 fM(e),!(await mM(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 pM(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}};rc.FileSubjectTokenSupplier=uf});var MT=L(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.UrlSubjectTokenSupplier=void 0;var hM=tr(),df=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};hM.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}};nc.UrlSubjectTokenSupplier=df});var FT=L(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.CertificateSubjectTokenSupplier=or.InvalidConfigurationError=or.CertificateSourceUnavailableError=or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var ic=Ir(),oc=require("fs"),ac=require("crypto"),gM=require("https");or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Hr=class extends Error{static{i(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};or.CertificateSourceUnavailableError=Hr;var yr=class extends Error{static{i(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};or.InvalidConfigurationError=yr;var pf=class{static{i(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new yr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new yr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new yr("Cannot create mTLS Agent with missing certificate or key");return new gM.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,ic.isValidFile)(e))return e;throw new Hr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,ic.isValidFile)(r))return r;throw new Hr(`Path from environment variable "${or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,ic.getWellKnownCertificateConfigFileLocation)();if(await(0,ic.isValidFile)(n))return n;throw new Hr(`Could not find certificate configuration file. Searched override path, the "${or.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await oc.promises.readFile(e,"utf8")}catch{throw new Hr(`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 yr(`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 yr?n:new yr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,o;try{n=await oc.promises.readFile(e),new ac.X509Certificate(n)}catch(s){let p=s instanceof Error?s.message:String(s);throw new Hr(`Failed to read certificate file at ${e}: ${p}`)}try{o=await oc.promises.readFile(r),(0,ac.createPrivateKey)(o)}catch(s){let p=s instanceof Error?s.message:String(s);throw new Hr(`Failed to read private key file at ${r}: ${p}`)}return{cert:n,key:o}}async#n(e){let r=new ac.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await oc.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((h,v)=>{try{return new ac.X509Certificate(h)}catch(P){let x=P instanceof Error?P.message:String(P);throw new yr(`Failed to parse certificate at index ${v} in trust chain file ${this.trustChainPath}: ${x}`)}}),p=s.findIndex(h=>r.raw.equals(h.raw)),m;if(p===-1)m=[r,...s];else if(p===0)m=s;else throw new yr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${p}).`);return JSON.stringify(m.map(h=>h.raw.toString("base64")))}catch(n){if(n instanceof yr)throw n;let o=n instanceof Error?n.message:String(n);throw new Hr(`Failed to process certificate chain from ${this.trustChainPath}: ${o}`)}}};or.CertificateSubjectTokenSupplier=pf});var hf=L(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.IdentityPoolClient=void 0;var yM=Jn(),ff=Ir(),vM=UT(),_M=MT(),LT=FT(),PM=tc(),jT=ht(),mf=class t extends yM.BaseExternalAccountClient{static{i(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,ff.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,ff.originalOrCamelOptions)(n),p=(0,ff.originalOrCamelOptions)(s.get("format")),m=p.get("type")||"text",h=p.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"),P=s.get("url"),x=s.get("certificate"),T=s.get("headers");if(v&&P||P&&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 vM.FileSubjectTokenSupplier({filePath:v,formatType:m,subjectTokenFieldName:h});else if(P)this.credentialSourceType="url",this.subjectTokenSupplier=new _M.UrlSubjectTokenSupplier({url:P,formatType:m,subjectTokenFieldName:h,headers:T,additionalGaxiosOptions:t.RETRY_CONFIG});else if(x){this.credentialSourceType="certificate";let w=new LT.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:x.use_default_certificate_config,certificateConfigLocation:x.certificate_config_location,trustChainPath:x.trust_chain_path});this.subjectTokenSupplier=w}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 LT.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new PM.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new jT.Gaxios({agent:r})}),this.transporter=new jT.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};sc.IdentityPoolClient=mf});var yf=L(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.AwsRequestSigner=void 0;var uc=ht(),BT=Sa(),qT="AWS4-HMAC-SHA256",wM="aws4_request",gf=class{static{i(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,BT.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,p=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 TM({crypto:this.crypto,host:h.host,canonicalUri:h.pathname,canonicalQuerystring:h.search.slice(1),method:o,region:this.region,securityCredentials:m,requestPayload:s,additionalAmzHeaders:p}),P=uc.Gaxios.mergeHeaders(v.amzDate?{"x-amz-date":v.amzDate}:{},{authorization:v.authorizationHeader,host:h.host},p||{});m.token&&uc.Gaxios.mergeHeaders(P,{"x-amz-security-token":m.token});let x={url:n,method:o,headers:P};return s!==void 0&&(x.body=s),x}};cc.AwsRequestSigner=gf;async function ka(t,e,r){return await t.signWithHmacSha256(e,r)}i(ka,"sign");async function bM(t,e,r,n,o){let s=await ka(t,`AWS4${e}`,r),p=await ka(t,s,n),m=await ka(t,p,o);return await ka(t,m,"aws4_request")}i(bM,"getSigningKey");async function TM(t){let e=uc.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],o=new Date,s=o.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),p=o.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let m=uc.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
- `});let P=v.join(";"),x=await t.crypto.sha256DigestHex(r),T=`${t.method.toUpperCase()}
40
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Ra="secret must be a string or buffer",mi="key must be a string or a buffer",yU="key must be a string, a buffer or an object",Mp=typeof hr.createPublicKey=="function";Mp&&(mi+=" or a KeyObject",Ra+="or a KeyObject");function Xb(t){if(!hi.isBuffer(t)&&typeof t!="string"&&(!Mp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Dr(mi)}o(Xb,"checkIsPublicKey");function Qb(t){if(!hi.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Dr(yU)}o(Qb,"checkIsPrivateKey");function vU(t){if(!hi.isBuffer(t)){if(typeof t=="string")return t;if(!Mp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Dr(Ra)}}o(vU,"checkIsSecretKey");function Fp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Fp,"fromBase64");function eT(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r<e;++r)t+="=";return t.replace(/\-/g,"+").replace(/_/g,"/")}o(eT,"toBase64");function Dr(t){var e=[].slice.call(arguments,1),r=Jb.format.bind(Jb,t).apply(null,e);return new TypeError(r)}o(Dr,"typeError");function _U(t){return hi.isBuffer(t)||typeof t=="string"}o(_U,"bufferOrString");function Da(t){return _U(t)||(t=JSON.stringify(t)),t}o(Da,"normalizeInput");function tT(t){return o(function(r,n){vU(n),r=Da(r);var i=hr.createHmac("sha"+t,n),s=(i.update(r),i.digest("base64"));return Fp(s)},"sign")}o(tT,"createHmacSigner");var Up,PU="timingSafeEqual"in hr?o(function(e,r){return e.byteLength!==r.byteLength?!1:hr.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return Up||(Up=Kb()),Up(e,r)},"timingSafeEqual");function wU(t){return o(function(r,n,i){var s=tT(t)(r,i);return PU(hi.from(n),hi.from(s))},"verify")}o(wU,"createHmacVerifier");function rT(t){return o(function(r,n){Qb(n),r=Da(r);var i=hr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign(n,"base64"));return Fp(s)},"sign")}o(rT,"createKeySigner");function nT(t){return o(function(r,n,i){Xb(i),r=Da(r),n=eT(n);var s=hr.createVerify("RSA-SHA"+t);return s.update(r),s.verify(i,n,"base64")},"verify")}o(nT,"createKeyVerifier");function bU(t){return o(function(r,n){Qb(n),r=Da(r);var i=hr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign({key:n,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Fp(s)},"sign")}o(bU,"createPSSKeySigner");function TU(t){return o(function(r,n,i){Xb(i),r=Da(r),n=eT(n);var s=hr.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:i,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(TU,"createPSSKeyVerifier");function SU(t){var e=rT(t);return o(function(){var n=e.apply(null,arguments);return n=Yb.derToJose(n,"ES"+t),n},"sign")}o(SU,"createECDSASigner");function xU(t){var e=nT(t);return o(function(n,i,s){i=Yb.joseToDer(i,"ES"+t).toString("base64");var d=e(n,i,s);return d},"verify")}o(xU,"createECDSAVerifer");function EU(){return o(function(){return""},"sign")}o(EU,"createNoneSigner");function IU(){return o(function(e,r){return r===""},"verify")}o(IU,"createNoneVerifier");oT.exports=o(function(e){var r={hs:tT,rs:rT,ps:bU,es:SU,none:EU},n={hs:wU,rs:nT,ps:TU,es:xU,none:IU},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Dr(gU,e);var s=(i[1]||i[3]).toLowerCase(),d=i[2];return{sign:r[s](d),verify:n[s](d)}},"jwa")});var jp=L((tee,iT)=>{var AU=require("buffer").Buffer;iT.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||AU.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var dT=L((nee,lT)=>{var RU=di().Buffer,aT=zp(),DU=Lp(),$U=require("stream"),sT=jp(),qp=require("util");function uT(t,e){return RU.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(uT,"base64url");function OU(t,e,r){r=r||"utf8";var n=uT(sT(t),"binary"),i=uT(sT(e),r);return qp.format("%s.%s",n,i)}o(OU,"jwsSecuredInput");function cT(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=DU(e.alg),d=OU(e,r,i),m=s.sign(d,n);return qp.format("%s.%s",d,m)}o(cT,"jwsSign");function Wu(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 aT(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new aT(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}o(Wu,"SignStream");qp.inherits(Wu,$U);Wu.prototype.sign=o(function(){try{var e=cT({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");Wu.sign=cT;lT.exports=Wu});var wT=L((iee,PT)=>{var fT=di().Buffer,pT=zp(),CU=Lp(),NU=require("stream"),mT=jp(),zU=require("util"),kU=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function UU(t){return Object.prototype.toString.call(t)==="[object Object]"}o(UU,"isObject");function MU(t){if(UU(t))return t;try{return JSON.parse(t)}catch{return}}o(MU,"safeJsonParse");function hT(t){var e=t.split(".",1)[0];return MU(fT.from(e,"base64").toString("binary"))}o(hT,"headerFromJWS");function FU(t){return t.split(".",2).join(".")}o(FU,"securedInputFromJWS");function gT(t){return t.split(".")[2]}o(gT,"signatureFromJWS");function LU(t,e){e=e||"utf8";var r=t.split(".")[1];return fT.from(r,"base64").toString(e)}o(LU,"payloadFromJWS");function yT(t){return kU.test(t)&&!!hT(t)}o(yT,"isValidJws");function vT(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=mT(t);var i=gT(t),s=FU(t),d=CU(e);return d.verify(s,i,r)}o(vT,"jwsVerify");function _T(t,e){if(e=e||{},t=mT(t),!yT(t))return null;var r=hT(t);if(!r)return null;var n=LU(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:gT(t)}}o(_T,"jwsDecode");function gi(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 pT(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new pT(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}o(gi,"VerifyStream");zU.inherits(gi,NU);gi.prototype.verify=o(function(){try{var e=vT(this.signature.buffer,this.algorithm,this.key.buffer),r=_T(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");gi.decode=_T;gi.isValid=yT;gi.verify=vT;PT.exports=gi});var Bp=L(Kn=>{var bT=dT(),Zu=wT(),jU=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Kn.ALGORITHMS=jU;Kn.sign=bT.sign;Kn.verify=Zu.verify;Kn.decode=Zu.decode;Kn.isValid=Zu.isValid;Kn.createSign=o(function(e){return new bT(e)},"createSign");Kn.createVerify=o(function(e){return new Zu(e)},"createVerify")});var UT=L(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.GoogleToken=void 0;var TT=Ku(require("fs")),qU=gt(),BU=Ku(Bp()),VU=Ku(require("path")),GU=require("util");function Ku(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Ku=o(function(s,d){if(!d&&s&&s.__esModule)return s;var m,h,v={__proto__:null,default:s};if(s===null||Pn(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)}o(Ku,"_interopRequireWildcard");function Pn(t){"@babel/helpers - typeof";return Pn=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},Pn(t)}o(Pn,"_typeof");function HU(t,e){OT(t,e),e.add(t)}o(HU,"_classPrivateMethodInitSpec");function WU(t,e,r){OT(t,e),e.set(t,r)}o(WU,"_classPrivateFieldInitSpec");function OT(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(OT,"_checkPrivateRedeclaration");function ST(t,e,r){return t.set($r(t,e),r),r}o(ST,"_classPrivateFieldSet");function xT(t,e){return t.get($r(t,e))}o(xT,"_classPrivateFieldGet");function $r(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}o($r,"_assertClassBrand");function ET(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,zT(n.key),n)}}o(ET,"_defineProperties");function CT(t,e,r){return e&&ET(t.prototype,e),r&&ET(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(CT,"_createClass");function NT(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(NT,"_classCallCheck");function ZU(t,e,r){return e=Na(e),KU(t,Kp()?Reflect.construct(e,r||[],Na(t).constructor):e.apply(t,r))}o(ZU,"_callSuper");function KU(t,e){if(e&&(Pn(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JU(t)}o(KU,"_possibleConstructorReturn");function JU(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(JU,"_assertThisInitialized");function YU(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&&Ca(t,e)}o(YU,"_inherits");function Vp(t){var e=typeof Map=="function"?new Map:void 0;return Vp=o(function(n){if(n===null||!QU(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return XU(n,arguments,Na(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ca(i,n)},"_wrapNativeSuper"),Vp(t)}o(Vp,"_wrapNativeSuper");function XU(t,e,r){if(Kp())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Ca(i,r.prototype),i}o(XU,"_construct");function Kp(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kp=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(Kp,"_isNativeReflectConstruct");function QU(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(QU,"_isNativeFunction");function Ca(t,e){return Ca=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Ca(t,e)}o(Ca,"_setPrototypeOf");function Na(t){return Na=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Na(t)}o(Na,"_getPrototypeOf");function rr(t,e,r){return(e=zT(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(rr,"_defineProperty");function zT(t){var e=eM(t,"string");return Pn(e)=="symbol"?e:e+""}o(zT,"_toPropertyKey");function eM(t,e){if(Pn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Pn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(eM,"_toPrimitive");function or(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(w,S,D,E){var u=S&&S.prototype instanceof m?S:m,f=Object.create(u.prototype);return nr(f,"_invoke",(function(c,y,l){var b,g,ie,ne=0,Oe=l||[],se=!1,X={p:0,n:0,v:t,a:J,f:J.bind(t,4),d:o(function(te,ce){return b=te,g=0,ie=t,X.n=ce,d},"d")};function J(re,te){for(g=re,ie=te,e=0;!se&&ne&&!ce&&e<Oe.length;e++){var ce,de=Oe[e],ze=X.p,Ue=de[2];re>3?(ce=Ue===te)&&(ie=de[(g=de[4])?5:(g=3,3)],de[4]=de[5]=t):de[0]<=ze&&((ce=re<2&&ze<de[1])?(g=0,X.v=te,X.n=de[1]):ze<Ue&&(ce=re<3||de[0]>te||te>Ue)&&(de[4]=re,de[5]=te,X.n=Ue,g=0))}if(ce||re>1)return d;throw se=!0,te}return o(J,"d"),function(re,te,ce){if(ne>1)throw TypeError("Generator is already running");for(se&&te===1&&J(te,ce),g=te,ie=ce;(e=g<2?t:ie)||!se;){b||(g?g<3?(g>1&&(X.n=-1),J(g,ie)):X.n=ie:X.v=ie);try{if(ne=2,b){if(g||(re="next"),e=b[re]){if(!(e=e.call(b,ie)))throw TypeError("iterator result is not an object");if(!e.done)return e;ie=e.value,g<2&&(g=0)}else g===1&&(e=b.return)&&e.call(b),g<2&&(ie=TypeError("The iterator does not provide a '"+re+"' method"),g=1);b=t}else if((e=(se=X.n<0)?ie:c.call(y,X))!==d)break}catch(de){b=t,g=1,ie=de}finally{ne=1}}return{value:e,done:se}}})(w,D,E),!0),f}o(s,"i");var d={};function m(){}o(m,"Generator");function h(){}o(h,"GeneratorFunction");function v(){}o(v,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var _=[][n]?e(e([][n]())):(nr(e={},n,function(){return this}),e),x=v.prototype=m.prototype=Object.create(_);function T(w){return Object.setPrototypeOf?Object.setPrototypeOf(w,v):(w.__proto__=v,nr(w,i,"GeneratorFunction")),w.prototype=Object.create(x),w}return o(T,"f"),h.prototype=v,nr(x,"constructor",v),nr(v,"constructor",h),h.displayName="GeneratorFunction",nr(v,i,"GeneratorFunction"),nr(x),nr(x,i,"Generator"),nr(x,n,function(){return this}),nr(x,"toString",function(){return"[object Generator]"}),(or=o(function(){return{w:s,m:T}},"_regenerator"))()}o(or,"_regenerator");function nr(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}nr=o(function(d,m,h,v){if(m)i?i(d,m,{value:h,enumerable:!v,configurable:!v,writable:!v}):d[m]=h;else{var _=o(function(T,w){nr(d,T,function(S){return this._invoke(T,w,S)})},"o");_("next",0),_("throw",1),_("return",2)}},"_regeneratorDefine"),nr(t,e,r,n)}o(nr,"_regeneratorDefine2");function IT(t,e,r,n,i,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,i)}o(IT,"asyncGeneratorStep");function yi(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function d(h){IT(s,n,i,d,m,"next",h)}o(d,"_next");function m(h){IT(s,n,i,d,m,"throw",h)}o(m,"_throw"),d(void 0)})}}o(yi,"_asyncToGenerator");var AT=TT.readFile?(0,GU.promisify)(TT.readFile):yi(or().m(o(function t(){return or().w(function(e){for(;;)switch(e.n){case 0:throw new Oa("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),RT="https://oauth2.googleapis.com/token",tM="https://oauth2.googleapis.com/revoke?token=",Oa=(function(t){function e(r,n){var i;return NT(this,e),i=ZU(this,e,[r]),rr(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),YU(e,t),CT(e)})(Vp(Error)),$a=new WeakMap,Gr=new WeakSet,cee=Ju.GoogleToken=(function(){function t(e){NT(this,t),HU(this,Gr),rr(this,"expiresAt",void 0),rr(this,"key",void 0),rr(this,"keyFile",void 0),rr(this,"iss",void 0),rr(this,"sub",void 0),rr(this,"scope",void 0),rr(this,"rawToken",void 0),rr(this,"tokenExpires",void 0),rr(this,"email",void 0),rr(this,"additionalClaims",void 0),rr(this,"eagerRefreshThresholdMillis",void 0),rr(this,"transporter",{request:o(function(n){return(0,qU.request)(n)},"request")}),WU(this,$a,void 0),$r(Gr,this,kT).call(this,e)}return o(t,"GoogleToken"),CT(t,[{key:"accessToken",get:o(function(){return this.rawToken?this.rawToken.access_token:void 0},"get")},{key:"idToken",get:o(function(){return this.rawToken?this.rawToken.id_token:void 0},"get")},{key:"tokenType",get:o(function(){return this.rawToken?this.rawToken.token_type:void 0},"get")},{key:"refreshToken",get:o(function(){return this.rawToken?this.rawToken.refresh_token:void 0},"get")},{key:"hasExpired",value:o(function(){var r=new Date().getTime();return this.rawToken&&this.expiresAt?r>=this.expiresAt:!0},"hasExpired")},{key:"isTokenExpiring",value:o(function(){var r,n=new Date().getTime(),i=(r=this.eagerRefreshThresholdMillis)!==null&&r!==void 0?r:0;return this.rawToken&&this.expiresAt?this.expiresAt<=n+i:!0},"isTokenExpiring")},{key:"getToken",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Pn(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;$r(Gr,this,DT).call(this,n).then(function(s){return i(null,s)},r);return}return $r(Gr,this,DT).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=yi(or().m(o(function n(i){var s,d,m,h,v,_,x;return or().w(function(T){for(;;)switch(T.n){case 0:s=VU.extname(i),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,AT(i,"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 Oa("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,AT(i,"utf8");case 5:return _=T.v,T.a(2,{privateKey:_});case 6:throw new Oa("*.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 Oa("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 o(r,"getCredentials"),r})()},{key:"revokeToken",value:o(function(r){if(r){$r(Gr,this,$T).call(this).then(function(){return r()},r);return}return $r(Gr,this,$T).call(this)},"revokeToken")}])})();function DT(t){return Gp.apply(this,arguments)}o(DT,"_getTokenAsync");function Gp(){return Gp=yi(or().m(o(function t(e){return or().w(function(r){for(;;)switch(r.n){case 0:if(!(xT($a,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,xT($a,this));case 1:return r.p=1,r.n=2,ST($a,this,$r(Gr,this,rM).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,ST($a,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),Gp.apply(this,arguments)}o(Gp,"_getTokenAsync2");function rM(t){return Hp.apply(this,arguments)}o(rM,"_getTokenAsyncInner");function Hp(){return Hp=yi(or().m(o(function t(e){var r;return or().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||$r(Gr,this,nM).call(this);case 4:return n.a(2,$r(Gr,this,oM).call(this))}},t,this)},"_callee4"))),Hp.apply(this,arguments)}o(Hp,"_getTokenAsyncInner2");function nM(){if(!this.iss)throw new Oa("email is required.","MISSING_CREDENTIALS")}o(nM,"_ensureEmail");function $T(){return Wp.apply(this,arguments)}o($T,"_revokeTokenAsync");function Wp(){return Wp=yi(or().m(o(function t(){var e;return or().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=tM+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:$r(Gr,this,kT).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"))),Wp.apply(this,arguments)}o(Wp,"_revokeTokenAsync2");function kT(){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,Pn(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(kT,"_configure");function oM(){return Zp.apply(this,arguments)}o(oM,"_requestToken");function Zp(){return Zp=yi(or().m(o(function t(){var e,r,n,i,s,d,m,h,v,_;return or().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:RT,exp:e+3600,iat:e,sub:this.sub},r),i=BU.sign({header:{alg:"RS256"},payload:n,secret:this.key}),x.p=1,x.n=2,this.transporter.request({method:"POST",url:RT,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),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"))),Zp.apply(this,arguments)}o(Zp,"_requestToken2")});var Yp=L(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.JWTAccess=void 0;var iM=Bp(),aM=Ar(),MT={alg:"RS256",typ:"JWT"},Jp=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new aM.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??300*1e3}getCachedKey(e,r){let n=e;if(r&&Array.isArray(r)&&r.length?n=e?`${e}_${r.join("_")}`:`${r.join("_")}`:typeof r=="string"&&(n=e?`${e}_${r}`:r),!n)throw Error("Scopes or url must be provided");return n}getRequestHeaders(e,r,n){let i=this.getCachedKey(e,n),s=this.cache.get(i),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?{...MT,kid:this.keyId}:MT,x=Object.assign(v,r),T=iM.sign({header:_,payload:x,secret:this.key}),w=new Headers({authorization:`Bearer ${T}`});return this.cache.set(i,{expiration:h*1e3,headers:w}),w}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{e||n(new Error("Must pass in a stream containing the service account auth settings."));let i="";e.setEncoding("utf8").on("data",s=>i+=s).on("error",n).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}};Yu.JWTAccess=Jp});var Qp=L(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.JWT=void 0;var FT=UT(),sM=Yp(),uM=Po(),Xu=tr(),Xp=class t extends uM.OAuth2Client{static{o(this,"JWT")}email;keyFile;key;keyId;defaultScopes;scopes;scope;subject;gtoken;additionalClaims;useJWTAccessWithScope;defaultServicePath;access;constructor(e={}){super(e),this.email=e.email,this.keyFile=e.keyFile,this.key=e.key,this.keyId=e.keyId,this.scopes=e.scopes,this.subject=e.subject,this.additionalClaims=e.additionalClaims,this.credentials={refresh_token:"jwt-placeholder",expiry_date:1}}createScoped(e){let r=new t(this);return r.scopes=e,r}async getRequestMetadataAsync(e){e=this.defaultServicePath?`https://${this.defaultServicePath}/`:e;let r=!this.hasUserScopes()&&e||this.useJWTAccessWithScope&&this.hasAnyScopes()||this.universeDomain!==Xu.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==Xu.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${Xu.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 i=this.useJWTAccessWithScope||this.universeDomain!==Xu.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?n:void 0);return{headers:this.addSharedMetadataHeaders(s)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let r=new FT.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 FT.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let r=await this.createGToken().getCredentials(this.keyFile);return{private_key:r.privateKey,client_email:r.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};Qu.JWT=Xp});var tf=L(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.UserRefreshClient=vi.USER_REFRESH_ACCOUNT_TYPE=void 0;var cM=Po(),lM=tr();vi.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var ef=class t extends cM.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,s){let d=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,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 lM.AuthClient.setMethodName(r,"fetchIdToken"),(await this.transporter.request(r)).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((r,n)=>{if(!e)return n(new Error("Must pass in a stream containing the user refresh token."));let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);return this.fromJSON(s),r()}catch(s){return n(s)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};vi.UserRefreshClient=ef});var nf=L(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.Impersonated=_i.IMPERSONATED_ACCOUNT_TYPE=void 0;var LT=Po(),dM=gt(),pM=Ar();_i.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var rf=class t extends LT.OAuth2Client{static{o(this,"Impersonated")}sourceClient;targetPrincipal;targetScopes;delegates;lifetime;endpoint;constructor(e={}){if(super(e),this.credentials={expiry_date:1,refresh_token:"impersonated-placeholder"},this.sourceClient=e.sourceClient??new LT.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,pM.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=e.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let r=`projects/-/serviceAccounts/${this.targetPrincipal}`,n=`${this.endpoint}/v1/${r}:signBlob`,i={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:i,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let e="projects/-/serviceAccounts/"+this.targetPrincipal,r=`${this.endpoint}/v1/${e}:generateAccessToken`,n={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},i=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),s=i.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof dM.GaxiosError&&(r=e?.response?.data?.error?.status,n=e?.response?.data?.error?.message),r&&n?(e.message=`${r}: unable to impersonate: ${n}`,e):(e.message=`unable to impersonate: ${e}`,e)}}async fetchIdToken(e,r){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,i=`${this.endpoint}/v1/${n}:generateIdToken`,s={delegates:this.delegates,audience:e,includeEmail:r?.includeEmail??!0,useEmailAzp:r?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:s,method:"POST"})).data.token}};_i.Impersonated=rf});var af=L(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.OAuthClientAuthHandler=void 0;za.getErrorFromOAuthErrorResponse=hM;var Pi=gt(),fM=xa(),mM=["PUT","POST","PATCH"],of=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,fM.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new Pi.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new Pi.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=Pi.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=Pi.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=Pi.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${i}`);Pi.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!mM.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let i=new Headers(e.headers).get("content-type");if(i?.startsWith("application/x-www-form-urlencoded")||e.data instanceof URLSearchParams){let s=new URLSearchParams(e.data??"");s.append("client_id",this.#t.clientId),s.append("client_secret",this.#t.clientSecret||""),e.data=s}else if(i?.startsWith("application/json"))e.data=e.data||{},Object.assign(e.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${i} content-types are not supported with ${this.#t.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};za.OAuthClientAuthHandler=of;function hM(t,e){let r=t.error,n=t.error_description,i=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof i<"u"&&(s+=` - ${i}`);let 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}o(hM,"getErrorFromOAuthErrorResponse")});var tc=L(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.StsCredentials=void 0;var gM=gt(),yM=tr(),jT=af(),vM=Ar(),sf=class t extends jT.OAuthClientAuthHandler{static{o(this,"StsCredentials")}#e;constructor(e={tokenExchangeEndpoint:""},r){(typeof e!="object"||e instanceof URL)&&(e={tokenExchangeEndpoint:e,clientAuthentication:r}),super(e),this.#e=e.tokenExchangeEndpoint}async exchangeToken(e,r,n){let i={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:e.scope?.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:e.actingParty?.actorToken,actor_token_type:e.actingParty?.actorTokenType,options:n&&JSON.stringify(n)},s={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:r,data:new URLSearchParams((0,vM.removeUndefinedValuesInObject)(i))};yM.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 gM.GaxiosError&&d.response?(0,jT.getErrorFromOAuthErrorResponse)(d.response.data,d):d}}};ec.StsCredentials=sf});var Jn=L(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.BaseExternalAccountClient=gr.CLOUD_RESOURCE_MANAGER=gr.EXTERNAL_ACCOUNT_TYPE=gr.EXPIRATION_TIME_OFFSET=void 0;var _M=gt(),PM=require("stream"),uf=tr(),wM=tc(),qT=Ar(),bM=bp(),TM="urn:ietf:params:oauth:grant-type:token-exchange",SM="urn:ietf:params:oauth:token-type:access_token",cf="https://www.googleapis.com/auth/cloud-platform",xM=3600;gr.EXPIRATION_TIME_OFFSET=300*1e3;gr.EXTERNAL_ACCOUNT_TYPE="external_account";gr.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var EM="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",IM="https://sts.{universeDomain}/v1/token",lf=class t extends uf.AuthClient{static{o(this,"BaseExternalAccountClient")}scopes;projectNumber;audience;subjectTokenType;stsCredential;clientAuth;credentialSourceType;cachedAccessToken;serviceAccountImpersonationUrl;serviceAccountImpersonationLifetime;workforcePoolUserProject;configLifetimeRequested;tokenUrl;cloudResourceManagerURL;supplierContext;#e=null;constructor(e){super(e);let r=(0,qT.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==gr.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${gr.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let i=r.get("client_id"),s=r.get("client_secret");this.tokenUrl=r.get("token_url")??IM.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,qT.originalOrCamelOptions)(v).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),i&&(this.clientAuth={confidentialClientType:"basic",clientId:i,clientSecret:s}),this.stsCredential=new wM.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[cf],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=d,this.workforcePoolUserProject=m;let x=new RegExp(EM);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=xM),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}`};uf.AuthClient.setMethodName(n,"getProjectId");let i=await this.transporter.request(n);return this.projectId=i.data.projectId,this.projectId}return null}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=_M.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let d=s.status,m=s.config.data instanceof PM.Readable;if(!r&&(d===401||d===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),r={grantType:TM,audience:this.audience,requestedTokenType:SM,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[cf]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(r,i,n);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(s.access_token):s.expires_in?this.cachedAccessToken={access_token:s.access_token,expiry_date:new Date().getTime()+s.expires_in*1e3,res:s.res}:this.cachedAccessToken={access_token:s.access_token,res:s.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(e){let r=e.match(/\/projects\/([^/]+)/);return r?r[1]:null}async getImpersonatedAccessToken(e){let r={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"}};uf.AuthClient.setMethodName(r,"getImpersonatedAccessToken");let n=await this.transporter.request(r),i=n.data;return{access_token:i.accessToken,expiry_date:new Date(i.expireTime).getTime(),res:n}}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[cf]}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}};gr.BaseExternalAccountClient=lf});var BT=L(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.FileSubjectTokenSupplier=void 0;var pf=require("util"),ff=require("fs"),AM=(0,pf.promisify)(ff.readFile??(()=>{})),RM=(0,pf.promisify)(ff.realpath??(()=>{})),DM=(0,pf.promisify)(ff.lstat??(()=>{})),df=class{static{o(this,"FileSubjectTokenSupplier")}filePath;formatType;subjectTokenFieldName;constructor(e){this.filePath=e.filePath,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName}async getSubjectToken(){let e=this.filePath;try{if(e=await RM(e),!(await DM(e)).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let r,n=await AM(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}};rc.FileSubjectTokenSupplier=df});var VT=L(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.UrlSubjectTokenSupplier=void 0;var $M=tr(),mf=class{static{o(this,"UrlSubjectTokenSupplier")}url;headers;formatType;subjectTokenFieldName;additionalGaxiosOptions;constructor(e){this.url=e.url,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName,this.headers=e.headers,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getSubjectToken(e){let r={...this.additionalGaxiosOptions,url:this.url,method:"GET",headers:this.headers};$M.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}};nc.UrlSubjectTokenSupplier=mf});var GT=L(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.CertificateSubjectTokenSupplier=ir.InvalidConfigurationError=ir.CertificateSourceUnavailableError=ir.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var oc=Ar(),ic=require("fs"),ac=require("crypto"),OM=require("https");ir.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Hr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};ir.CertificateSourceUnavailableError=Hr;var yr=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};ir.InvalidConfigurationError=yr;var hf=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new yr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new yr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new yr("Cannot create mTLS Agent with missing certificate or key");return new OM.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,oc.isValidFile)(e))return e;throw new Hr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[ir.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,oc.isValidFile)(r))return r;throw new Hr(`Path from environment variable "${ir.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,oc.getWellKnownCertificateConfigFileLocation)();if(await(0,oc.isValidFile)(n))return n;throw new Hr(`Could not find certificate configuration file. Searched override path, the "${ir.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await ic.promises.readFile(e,"utf8")}catch{throw new Hr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),i=n?.cert_configs?.workload?.cert_path,s=n?.cert_configs?.workload?.key_path;if(!i||!s)throw new yr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:s}}catch(n){throw n instanceof yr?n:new yr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await ic.promises.readFile(e),new ac.X509Certificate(n)}catch(s){let d=s instanceof Error?s.message:String(s);throw new Hr(`Failed to read certificate file at ${e}: ${d}`)}try{i=await ic.promises.readFile(r),(0,ac.createPrivateKey)(i)}catch(s){let d=s instanceof Error?s.message:String(s);throw new Hr(`Failed to read private key file at ${r}: ${d}`)}return{cert:n,key:i}}async#n(e){let r=new ac.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await ic.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((h,v)=>{try{return new ac.X509Certificate(h)}catch(_){let x=_ instanceof Error?_.message:String(_);throw new yr(`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 yr(`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 yr)throw n;let i=n instanceof Error?n.message:String(n);throw new Hr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};ir.CertificateSubjectTokenSupplier=hf});var vf=L(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.IdentityPoolClient=void 0;var CM=Jn(),gf=Ar(),NM=BT(),zM=VT(),HT=GT(),kM=tc(),WT=gt(),yf=class t extends CM.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,gf.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("subject_token_supplier");if(!n&&!i)throw new Error("A credential source or subject token supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or subject token supplier can be specified.");if(i)this.subjectTokenSupplier=i,this.credentialSourceType="programmatic";else{let s=(0,gf.originalOrCamelOptions)(n),d=(0,gf.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 NM.FileSubjectTokenSupplier({filePath:v,formatType:m,subjectTokenFieldName:h});else if(_)this.credentialSourceType="url",this.subjectTokenSupplier=new zM.UrlSubjectTokenSupplier({url:_,formatType:m,subjectTokenFieldName:h,headers:T,additionalGaxiosOptions:t.RETRY_CONFIG});else if(x){this.credentialSourceType="certificate";let w=new HT.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:x.use_default_certificate_config,certificateConfigLocation:x.certificate_config_location,trustChainPath:x.trust_chain_path});this.subjectTokenSupplier=w}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 HT.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new kM.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new WT.Gaxios({agent:r})}),this.transporter=new WT.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};sc.IdentityPoolClient=yf});var Pf=L(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.AwsRequestSigner=void 0;var uc=gt(),KT=xa(),ZT="AWS4-HMAC-SHA256",UM="aws4_request",_f=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,KT.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let r=typeof e.data=="object"?JSON.stringify(e.data):e.data,n=e.url,i=e.method||"GET",s=e.body||r,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 FM({crypto:this.crypto,host:h.host,canonicalUri:h.pathname,canonicalQuerystring:h.search.slice(1),method:i,region:this.region,securityCredentials:m,requestPayload:s,additionalAmzHeaders:d}),_=uc.Gaxios.mergeHeaders(v.amzDate?{"x-amz-date":v.amzDate}:{},{authorization:v.authorizationHeader,host:h.host},d||{});m.token&&uc.Gaxios.mergeHeaders(_,{"x-amz-security-token":m.token});let x={url:n,method:i,headers:_};return s!==void 0&&(x.body=s),x}};cc.AwsRequestSigner=_f;async function ka(t,e,r){return await t.signWithHmacSha256(e,r)}o(ka,"sign");async function MM(t,e,r,n,i){let s=await ka(t,`AWS4${e}`,r),d=await ka(t,s,n),m=await ka(t,d,i);return await ka(t,m,"aws4_request")}o(MM,"getSigningKey");async function FM(t){let e=uc.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,s=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),d=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let m=uc.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
+ `});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
- ${P}
46
- ${x}`,w=`${p}/${t.region}/${n}/${wM}`,S=`${qT}
45
+ ${_}
46
+ ${x}`,w=`${d}/${t.region}/${n}/${UM}`,S=`${ZT}
47
47
  ${s}
48
48
  ${w}
49
- `+await t.crypto.sha256DigestHex(T),D=await bM(t.crypto,t.securityCredentials.secretAccessKey,p,t.region,n),E=await ka(t.crypto,D,S),u=`${qT} Credential=${t.securityCredentials.accessKeyId}/${w}, SignedHeaders=${P}, Signature=${(0,BT.fromArrayBufferToHex)(E)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:u,canonicalQuerystring:t.canonicalQuerystring}}i(TM,"generateAuthenticationHeaderMap")});var VT=L(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.DefaultAwsSecurityCredentialsSupplier=void 0;var lc=tr(),vf=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};lc.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 lc.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 lc.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 lc.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}};dc.DefaultAwsSecurityCredentialsSupplier=vf});var Pf=L(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.AwsClient=void 0;var SM=yf(),xM=Jn(),EM=VT(),GT=Ir(),IM=ht(),_f=class t extends xM.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,GT.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,GT.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let p=s.get("region_url"),m=s.get("url"),h=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new EM.DefaultAwsSecurityCredentialsSupplier({regionUrl:p,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 SM.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 IM.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}))}};pc.AwsClient=_f});var xf=L(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.InvalidSubjectTokenError=vt.InvalidMessageFieldError=vt.InvalidCodeFieldError=vt.InvalidTokenTypeFieldError=vt.InvalidExpirationTimeFieldError=vt.InvalidSuccessFieldError=vt.InvalidVersionFieldError=vt.ExecutableResponseError=vt.ExecutableResponse=void 0;var fc="urn:ietf:params:oauth:token-type:saml2",wf="urn:ietf:params:oauth:token-type:id_token",bf="urn:ietf:params:oauth:token-type:jwt",Tf=class{static{i(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new mc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new hc("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!==fc&&this.tokenType!==wf&&this.tokenType!==bf)throw new gc(`Executable response must contain a 'token_type' field when successful and it must be one of ${wf}, ${bf}, or ${fc}.`);if(this.tokenType===fc){if(!e.saml_response)throw new za(`Executable response must contain a 'saml_response' field when token_type=${fc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new za(`Executable response must contain a 'id_token' field when token_type=${wf} or ${bf}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new yc("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new vc("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)}};vt.ExecutableResponse=Tf;var Wr=class extends Error{static{i(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};vt.ExecutableResponseError=Wr;var mc=class extends Wr{static{i(this,"InvalidVersionFieldError")}};vt.InvalidVersionFieldError=mc;var hc=class extends Wr{static{i(this,"InvalidSuccessFieldError")}};vt.InvalidSuccessFieldError=hc;var Sf=class extends Wr{static{i(this,"InvalidExpirationTimeFieldError")}};vt.InvalidExpirationTimeFieldError=Sf;var gc=class extends Wr{static{i(this,"InvalidTokenTypeFieldError")}};vt.InvalidTokenTypeFieldError=gc;var yc=class extends Wr{static{i(this,"InvalidCodeFieldError")}};vt.InvalidCodeFieldError=yc;var vc=class extends Wr{static{i(this,"InvalidMessageFieldError")}};vt.InvalidMessageFieldError=vc;var za=class extends Wr{static{i(this,"InvalidSubjectTokenError")}};vt.InvalidSubjectTokenError=za});var Af=L(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.PluggableAuthHandler=Po.ExecutableError=void 0;var Pi=xf(),AM=require("child_process"),Ef=require("fs"),_c=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)}};Po.ExecutableError=_c;var If=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=AM.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 p=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(p),m===0)try{let h=JSON.parse(s),v=new Pi.ExecutableResponse(h);return r(v)}catch(h){return h instanceof Pi.ExecutableResponseError?n(h):n(new Pi.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new _c(s,m.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await Ef.promises.realpath(this.outputFile)}catch{return}if(!(await Ef.promises.lstat(e)).isFile())return;let r=await Ef.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new Pi.ExecutableResponse(n).isValid()?new Pi.ExecutableResponse(n):void 0}catch(n){throw n instanceof Pi.ExecutableResponseError?n:new Pi.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}};Po.PluggableAuthHandler=If});var Df=L(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.PluggableAuthClient=wo.ExecutableError=void 0;var RM=Jn(),DM=xf(),HT=Af(),$M=Af();Object.defineProperty(wo,"ExecutableError",{enumerable:!0,get:i(function(){return $M.ExecutableError},"get")});var OM=30*1e3,WT=5*1e3,ZT=120*1e3,CM="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",KT=1,Rf=class extends RM.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=OM;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<WT||this.timeoutMillis>ZT)throw new Error(`Timeout must be between ${WT} and ${ZT} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new HT.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[CM]!=="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>KT)throw new Error(`Version of executable is not currently supported, maximum supported version is ${KT}.`);if(!e.success)throw new HT.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new DM.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}};wo.PluggableAuthClient=Rf});var Of=L(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.ExternalAccountClient=void 0;var NM=Jn(),kM=hf(),zM=Pf(),UM=Df(),$f=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===NM.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new zM.AwsClient(e):e.credential_source?.executable?new UM.PluggableAuthClient(e):new kM.IdentityPoolClient(e):null}};Pc.ExternalAccountClient=$f});var kf=L(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.ExternalAccountAuthorizedUserClient=bo.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var YT=tr(),JT=rf(),XT=ht(),MM=require("stream"),FM=Jn();bo.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var LM="https://sts.{universeDomain}/v1/oauthtoken",Cf=class t extends JT.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})};YT.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 XT.GaxiosError&&o.response?(0,JT.getErrorFromOAuthErrorResponse)(o.response.data,o):o}}},Nf=class extends YT.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 Cf({tokenRefreshEndpoint:e.token_url??LM.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=FM.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=XT.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let p=s.status,m=s.config.data instanceof MM.Readable;if(!r&&(p===401||p===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}};bo.ExternalAccountAuthorizedUserClient=Nf});var rS=L($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.GoogleAuth=$r.GoogleAuthExceptionMessages=void 0;var jM=require("child_process"),Ua=require("fs"),qM=ht(),Ma=Ta(),BM=require("os"),zf=require("path"),VM=Sa(),GM=Ap(),HM=Dp(),WM=$p(),To=Jp(),QT=Xp(),So=ef(),ZM=Of(),Fa=Jn(),Uf=tr(),eS=kf(),tS=Ir();$r.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 MM(t.crypto,t.securityCredentials.secretAccessKey,d,t.region,n),E=await ka(t.crypto,D,S),u=`${ZT} Credential=${t.securityCredentials.accessKeyId}/${w}, SignedHeaders=${_}, Signature=${(0,KT.fromArrayBufferToHex)(E)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:u,canonicalQuerystring:t.canonicalQuerystring}}o(FM,"generateAuthenticationHeaderMap")});var JT=L(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.DefaultAwsSecurityCredentialsSupplier=void 0;var lc=tr(),wf=class{static{o(this,"DefaultAwsSecurityCredentialsSupplier")}regionUrl;securityCredentialsUrl;imdsV2SessionTokenUrl;additionalGaxiosOptions;constructor(e){this.regionUrl=e.regionUrl,this.securityCredentialsUrl=e.securityCredentialsUrl,this.imdsV2SessionTokenUrl=e.imdsV2SessionTokenUrl,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getAwsRegion(e){if(this.#n)return this.#n;let r=new Headers;if(!this.#n&&this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter)),!this.regionUrl)throw new RangeError('Unable to determine AWS region due to missing "options.credential_source.region_url"');let n={...this.additionalGaxiosOptions,url:this.regionUrl,method:"GET",headers:r};lc.AuthClient.setMethodName(n,"getAwsRegion");let i=await e.transporter.request(n);return i.data.substr(0,i.data.length-1)}async getAwsSecurityCredentials(e){if(this.#o)return this.#o;let r=new Headers;this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter));let n=await this.#t(r,e.transporter),i=await this.#r(n,r,e.transporter);return{accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,token:i.Token}}async#e(e){let r={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return lc.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 lc.AuthClient.setMethodName(n,"#getAwsRoleName"),(await r.request(n)).data}async#r(e,r,n){let i={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:r};return lc.AuthClient.setMethodName(i,"#retrieveAwsSecurityCredentials"),(await n.request(i)).data}get#n(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#o(){return process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY?{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,token:process.env.AWS_SESSION_TOKEN}:null}};dc.DefaultAwsSecurityCredentialsSupplier=wf});var Tf=L(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.AwsClient=void 0;var LM=Pf(),jM=Jn(),qM=JT(),YT=Ar(),BM=gt(),bf=class t extends jM.BaseExternalAccountClient{static{o(this,"AwsClient")}environmentId;awsSecurityCredentialsSupplier;regionalCredVerificationUrl;awsRequestSigner;region;static#e="https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15";static AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";static AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254";constructor(e){super(e);let r=(0,YT.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("aws_security_credentials_supplier");if(!n&&!i)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(i)this.awsSecurityCredentialsSupplier=i,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,YT.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 qM.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 LM.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 BM.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,s)=>r.push({key:s,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};pc.AwsClient=bf});var Af=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 fc="urn:ietf:params:oauth:token-type:saml2",Sf="urn:ietf:params:oauth:token-type:id_token",xf="urn:ietf:params:oauth:token-type:jwt",Ef=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new mc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new hc("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!==fc&&this.tokenType!==Sf&&this.tokenType!==xf)throw new gc(`Executable response must contain a 'token_type' field when successful and it must be one of ${Sf}, ${xf}, or ${fc}.`);if(this.tokenType===fc){if(!e.saml_response)throw new Ua(`Executable response must contain a 'saml_response' field when token_type=${fc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new Ua(`Executable response must contain a 'id_token' field when token_type=${Sf} or ${xf}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new yc("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new vc("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=Ef;var Wr=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};_t.ExecutableResponseError=Wr;var mc=class extends Wr{static{o(this,"InvalidVersionFieldError")}};_t.InvalidVersionFieldError=mc;var hc=class extends Wr{static{o(this,"InvalidSuccessFieldError")}};_t.InvalidSuccessFieldError=hc;var If=class extends Wr{static{o(this,"InvalidExpirationTimeFieldError")}};_t.InvalidExpirationTimeFieldError=If;var gc=class extends Wr{static{o(this,"InvalidTokenTypeFieldError")}};_t.InvalidTokenTypeFieldError=gc;var yc=class extends Wr{static{o(this,"InvalidCodeFieldError")}};_t.InvalidCodeFieldError=yc;var vc=class extends Wr{static{o(this,"InvalidMessageFieldError")}};_t.InvalidMessageFieldError=vc;var Ua=class extends Wr{static{o(this,"InvalidSubjectTokenError")}};_t.InvalidSubjectTokenError=Ua});var $f=L(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.PluggableAuthHandler=wi.ExecutableError=void 0;var wo=Af(),VM=require("child_process"),Rf=require("fs"),_c=class extends Error{static{o(this,"ExecutableError")}code;constructor(e,r){super(`The executable failed with exit code: ${r} and error message: ${e}.`),this.code=r,Object.setPrototypeOf(this,new.target.prototype)}};wi.ExecutableError=_c;var Df=class t{static{o(this,"PluggableAuthHandler")}commandComponents;timeoutMillis;outputFile;constructor(e){if(!e.command)throw new Error("No command provided.");if(this.commandComponents=t.parseCommand(e.command),this.timeoutMillis=e.timeoutMillis,!this.timeoutMillis)throw new Error("No timeoutMillis provided.");this.outputFile=e.outputFile}retrieveResponseFromExecutable(e){return new Promise((r,n)=>{let i=VM.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";i.stdout.on("data",m=>{s+=m}),i.stderr.on("data",m=>{s+=m});let d=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",m=>{if(clearTimeout(d),m===0)try{let h=JSON.parse(s),v=new wo.ExecutableResponse(h);return r(v)}catch(h){return h instanceof wo.ExecutableResponseError?n(h):n(new wo.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new _c(s,m.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await Rf.promises.realpath(this.outputFile)}catch{return}if(!(await Rf.promises.lstat(e)).isFile())return;let r=await Rf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new wo.ExecutableResponse(n).isValid()?new wo.ExecutableResponse(n):void 0}catch(n){throw n instanceof wo.ExecutableResponseError?n:new wo.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}};wi.PluggableAuthHandler=Df});var Cf=L(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.PluggableAuthClient=bi.ExecutableError=void 0;var GM=Jn(),HM=Af(),XT=$f(),WM=$f();Object.defineProperty(bi,"ExecutableError",{enumerable:!0,get:o(function(){return WM.ExecutableError},"get")});var ZM=30*1e3,QT=5*1e3,eS=120*1e3,KM="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",tS=1,Of=class extends GM.BaseExternalAccountClient{static{o(this,"PluggableAuthClient")}command;timeoutMillis;outputFile;handler;constructor(e){if(super(e),!e.credential_source.executable)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=e.credential_source.executable.command,!this.command)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(e.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=ZM;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<QT||this.timeoutMillis>eS)throw new Error(`Timeout must be between ${QT} and ${eS} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new XT.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[KM]!=="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>tS)throw new Error(`Version of executable is not currently supported, maximum supported version is ${tS}.`);if(!e.success)throw new XT.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new HM.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}};bi.PluggableAuthClient=Of});var zf=L(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.ExternalAccountClient=void 0;var JM=Jn(),YM=vf(),XM=Tf(),QM=Cf(),Nf=class{static{o(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(e){return e&&e.type===JM.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new XM.AwsClient(e):e.credential_source?.executable?new QM.PluggableAuthClient(e):new YM.IdentityPoolClient(e):null}};Pc.ExternalAccountClient=Nf});var Mf=L(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.ExternalAccountAuthorizedUserClient=Ti.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var nS=tr(),rS=af(),oS=gt(),eF=require("stream"),tF=Jn();Ti.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var rF="https://sts.{universeDomain}/v1/oauthtoken",kf=class t extends rS.OAuthClientAuthHandler{static{o(this,"ExternalAccountAuthorizedUserHandler")}#e;constructor(e){super(e),this.#e=e.tokenRefreshEndpoint}async refreshToken(e,r){let n={...t.RETRY_CONFIG,url:this.#e,method:"POST",headers:r,data:new URLSearchParams({grant_type:"refresh_token",refresh_token:e})};nS.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let i=await this.transporter.request(n),s=i.data;return s.res=i,s}catch(i){throw i instanceof oS.GaxiosError&&i.response?(0,rS.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},Uf=class extends nS.AuthClient{static{o(this,"ExternalAccountAuthorizedUserClient")}cachedAccessToken;externalAccountAuthorizedUserHandler;refreshToken;constructor(e){super(e),e.universe_domain&&(this.universeDomain=e.universe_domain),this.refreshToken=e.refresh_token;let r={confidentialClientType:"basic",clientId:e.client_id,clientSecret:e.client_secret};this.externalAccountAuthorizedUserHandler=new kf({tokenRefreshEndpoint:e.token_url??rF.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=tF.EXPIRATION_TIME_OFFSET:this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis,this.forceRefreshOnFailure=!!e?.forceRefreshOnFailure}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=oS.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let d=s.status,m=s.config.data instanceof eF.Readable;if(!r&&(d===401||d===403)&&!m&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Ti.ExternalAccountAuthorizedUserClient=Uf});var uS=L(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.GoogleAuth=Or.GoogleAuthExceptionMessages=void 0;var nF=require("child_process"),Ma=require("fs"),oF=gt(),Fa=Sa(),iF=require("os"),Ff=require("path"),aF=xa(),sF=$p(),uF=Cp(),cF=Np(),Si=Qp(),iS=tf(),xi=nf(),lF=zf(),La=Jn(),Lf=tr(),aS=Mf(),sS=Ar();Or.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 Mf=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($r.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===$r.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($r.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 Ma.universe("universe-domain"),e||=Uf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Uf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,tS.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Uf.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 To.JWT?r.scopes=this.scopes:r instanceof Fa.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof To.JWT?r.scopes=this.scopes:r instanceof Fa.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new GM.Compute(e));throw new Error($r.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=Ma.getGCPResidency()||await Ma.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=zf.join(o,".config"))}return r&&(r=zf.join(r,"gcloud","application_default_credentials.json"),Ua.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=Ua.realpathSync(e),!Ua.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=Ua.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!==So.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${So.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 So.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(o)?o:[o]})}fromJSON(e,r={}){let n,o=(0,tS.originalOrCamelOptions)(r).get("universe_domain");return e.type===QT.USER_REFRESH_ACCOUNT_TYPE?(n=new QT.UserRefreshClient(r),n.fromJSON(e)):e.type===So.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===Fa.EXTERNAL_ACCOUNT_TYPE?(n=ZM.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===eS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new eS.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new To.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",p=>s.push(p)).on("end",()=>{try{try{let p=JSON.parse(s.join("")),m=this._cacheClientFromJSON(p,r);return n(m)}catch(p){if(!this.keyFilename)throw p;let m=new To.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=m,this.setGapicJWTValues(m),n(m)}}catch(p){return o(p)}})})}fromAPIKey(e,r={}){return new To.JWT({...r,apiKey:e})}_isWindows(){let e=BM.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,jM.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!==Fa.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await Ma.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 So.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof Fa.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([Ma.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error($r.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=zf.resolve(this.keyFilename),r=Ua.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 HM.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=qM.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,WM.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 So.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,VM.createCrypto)();if(n instanceof To.JWT&&n.key)return await s.sign(n.key,e);let p=await this.getCredentials();if(!p.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,p.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}};$r.GoogleAuth=Mf});var nS=L(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.IAMAuth=void 0;var Ff=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}}};wc.IAMAuth=Ff});var iS=L(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.DownscopedClient=Zr.EXPIRATION_TIME_OFFSET=Zr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var KM=ht(),JM=require("stream"),Lf=tr(),YM=tc(),XM="urn:ietf:params:oauth:grant-type:token-exchange",QM="urn:ietf:params:oauth:token-type:access_token",eF="urn:ietf:params:oauth:token-type:access_token";Zr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Zr.EXPIRATION_TIME_OFFSET=300*1e3;var jf=class extends Lf.AuthClient{static{i(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Lf.AuthClient?{}:e),e instanceof Lf.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>Zr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Zr.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 YM.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=KM.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,o),n=await this.transporter.request(e)}catch(o){let s=o.response;if(s){let p=s.status,m=s.config.data instanceof JM.Readable;if(!r&&(p===401||p===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:XM,requestedTokenType:QM,subjectToken:e,subjectTokenType:eF},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}};Zr.DownscopedClient=jf});var oS=L(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.PassThroughClient=void 0;var tF=tr(),qf=class extends tF.AuthClient{static{i(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};bc.PassThroughClient=qf});var La=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 aS=rS();Object.defineProperty(me,"GoogleAuth",{enumerable:!0,get:i(function(){return aS.GoogleAuth},"get")});me.gcpMetadata=Ta();me.gaxios=ht();var sS=tr();Object.defineProperty(me,"AuthClient",{enumerable:!0,get:i(function(){return sS.AuthClient},"get")});Object.defineProperty(me,"DEFAULT_UNIVERSE",{enumerable:!0,get:i(function(){return sS.DEFAULT_UNIVERSE},"get")});var rF=Ap();Object.defineProperty(me,"Compute",{enumerable:!0,get:i(function(){return rF.Compute},"get")});var nF=$p();Object.defineProperty(me,"GCPEnv",{enumerable:!0,get:i(function(){return nF.GCPEnv},"get")});var iF=nS();Object.defineProperty(me,"IAMAuth",{enumerable:!0,get:i(function(){return iF.IAMAuth},"get")});var oF=Dp();Object.defineProperty(me,"IdTokenClient",{enumerable:!0,get:i(function(){return oF.IdTokenClient},"get")});var aF=Zp();Object.defineProperty(me,"JWTAccess",{enumerable:!0,get:i(function(){return aF.JWTAccess},"get")});var sF=Jp();Object.defineProperty(me,"JWT",{enumerable:!0,get:i(function(){return sF.JWT},"get")});var uF=ef();Object.defineProperty(me,"Impersonated",{enumerable:!0,get:i(function(){return uF.Impersonated},"get")});var Bf=_i();Object.defineProperty(me,"CodeChallengeMethod",{enumerable:!0,get:i(function(){return Bf.CodeChallengeMethod},"get")});Object.defineProperty(me,"OAuth2Client",{enumerable:!0,get:i(function(){return Bf.OAuth2Client},"get")});Object.defineProperty(me,"ClientAuthentication",{enumerable:!0,get:i(function(){return Bf.ClientAuthentication},"get")});var cF=Sp();Object.defineProperty(me,"LoginTicket",{enumerable:!0,get:i(function(){return cF.LoginTicket},"get")});var lF=Xp();Object.defineProperty(me,"UserRefreshClient",{enumerable:!0,get:i(function(){return lF.UserRefreshClient},"get")});var dF=Pf();Object.defineProperty(me,"AwsClient",{enumerable:!0,get:i(function(){return dF.AwsClient},"get")});var pF=yf();Object.defineProperty(me,"AwsRequestSigner",{enumerable:!0,get:i(function(){return pF.AwsRequestSigner},"get")});var fF=hf();Object.defineProperty(me,"IdentityPoolClient",{enumerable:!0,get:i(function(){return fF.IdentityPoolClient},"get")});var mF=Of();Object.defineProperty(me,"ExternalAccountClient",{enumerable:!0,get:i(function(){return mF.ExternalAccountClient},"get")});var hF=Jn();Object.defineProperty(me,"BaseExternalAccountClient",{enumerable:!0,get:i(function(){return hF.BaseExternalAccountClient},"get")});var gF=iS();Object.defineProperty(me,"DownscopedClient",{enumerable:!0,get:i(function(){return gF.DownscopedClient},"get")});var uS=Df();Object.defineProperty(me,"PluggableAuthClient",{enumerable:!0,get:i(function(){return uS.PluggableAuthClient},"get")});Object.defineProperty(me,"ExecutableError",{enumerable:!0,get:i(function(){return uS.ExecutableError},"get")});var cS=kf();Object.defineProperty(me,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:i(function(){return cS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(me,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:i(function(){return cS.ExternalAccountAuthorizedUserClient},"get")});var yF=oS();Object.defineProperty(me,"PassThroughClient",{enumerable:!0,get:i(function(){return yF.PassThroughClient},"get")});var vF=new aS.GoogleAuth;me.auth=vF});var dS=L(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});Vf.getAPI=_F;function _F(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],p=new s(e,n);return Object.freeze(p)}catch(s){throw new Error(`Unable to load endpoint ${t}("${o}"): ${s.message}`)}}i(_F,"getAPI")});var fS=L((Eee,pS)=>{pS.exports=require("util").inspect});var Ga=L((Iee,CS)=>{var em=typeof Map=="function"&&Map.prototype,Gf=Object.getOwnPropertyDescriptor&&em?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,xc=em&&Gf&&typeof Gf.get=="function"?Gf.get:null,mS=em&&Map.prototype.forEach,tm=typeof Set=="function"&&Set.prototype,Hf=Object.getOwnPropertyDescriptor&&tm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ec=tm&&Hf&&typeof Hf.get=="function"?Hf.get:null,hS=tm&&Set.prototype.forEach,PF=typeof WeakMap=="function"&&WeakMap.prototype,qa=PF?WeakMap.prototype.has:null,wF=typeof WeakSet=="function"&&WeakSet.prototype,Ba=wF?WeakSet.prototype.has:null,bF=typeof WeakRef=="function"&&WeakRef.prototype,gS=bF?WeakRef.prototype.deref:null,TF=Boolean.prototype.valueOf,SF=Object.prototype.toString,xF=Function.prototype.toString,EF=String.prototype.match,rm=String.prototype.slice,Yn=String.prototype.replace,IF=String.prototype.toUpperCase,yS=String.prototype.toLowerCase,ES=RegExp.prototype.test,vS=Array.prototype.concat,Kr=Array.prototype.join,AF=Array.prototype.slice,_S=Math.floor,Kf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Wf=Object.getOwnPropertySymbols,Jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,xo=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Va=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===xo||!0)?Symbol.toStringTag:null,IS=Object.prototype.propertyIsEnumerable,PS=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function wS(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||ES.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=rm.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(wS,"addNumericSeparator");var Yf=fS(),bS=Yf.custom,TS=DS(bS)?bS:null,AS={__proto__:null,double:'"',single:"'"},RF={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};CS.exports=i(function t(e,r,n,o){var s=r||{};if(Pn(s,"quoteStyle")&&!Pn(AS,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 p=Pn(s,"customInspect")?s.customInspect:!0;if(typeof p!="boolean"&&p!=="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 OS(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var h=String(e);return m?wS(e,h):h}if(typeof e=="bigint"){var v=String(e)+"n";return m?wS(e,v):v}var P=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=P&&P>0&&typeof e=="object")return Xf(e)?"[Array]":"[Object]";var x=WF(s,n);if(typeof o>"u")o=[];else if($S(o,e)>=0)return"[Circular]";function T(K,re,te){if(re&&(o=AF.call(o),o.push(re)),te){var ce={depth:s.depth};return Pn(s,"quoteStyle")&&(ce.quoteStyle=s.quoteStyle),t(K,ce,n+1,o)}return t(K,s,n+1,o)}if(i(T,"inspect"),typeof e=="function"&&!SS(e)){var w=MF(e),S=Sc(e,T);return"[Function"+(w?": "+w:" (anonymous)")+"]"+(S.length>0?" { "+Kr.call(S,", ")+" }":"")}if(DS(e)){var D=xo?Yn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Jf.call(e);return typeof e=="object"&&!xo?ja(D):D}if(VF(e)){for(var E="<"+yS.call(String(e.nodeName)),u=e.attributes||[],f=0;f<u.length;f++)E+=" "+u[f].name+"="+RS(DF(u[f].value),"double",s);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+yS.call(String(e.nodeName))+">",E}if(Xf(e)){if(e.length===0)return"[]";var c=Sc(e,T);return x&&!HF(c)?"["+Qf(c,x)+"]":"[ "+Kr.call(c,", ")+" ]"}if(OF(e)){var y=Sc(e,T);return!("cause"in Error.prototype)&&"cause"in e&&!IS.call(e,"cause")?"{ ["+String(e)+"] "+Kr.call(vS.call("[cause]: "+T(e.cause),y),", ")+" }":y.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Kr.call(y,", ")+" }"}if(typeof e=="object"&&p){if(TS&&typeof e[TS]=="function"&&Yf)return Yf(e,{depth:P-n});if(p!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(FF(e)){var l=[];return mS&&mS.call(e,function(K,re){l.push(T(re,e,!0)+" => "+T(K,e))}),xS("Map",xc.call(e),l,x)}if(qF(e)){var b=[];return hS&&hS.call(e,function(K){b.push(T(K,e))}),xS("Set",Ec.call(e),b,x)}if(LF(e))return Zf("WeakMap");if(BF(e))return Zf("WeakSet");if(jF(e))return Zf("WeakRef");if(NF(e))return ja(T(Number(e)));if(zF(e))return ja(T(Kf.call(e)));if(kF(e))return ja(TF.call(e));if(CF(e))return ja(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(!$F(e)&&!SS(e)){var g=Sc(e,T),oe=PS?PS(e)===Object.prototype:e instanceof Object||e.constructor===Object,ne=e instanceof Object?"":"null prototype",Re=!oe&&Va&&Object(e)===e&&Va in e?rm.call(Xn(e),8,-1):ne?"Object":"",se=oe||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Y=se+(Re||ne?"["+Kr.call(vS.call([],Re||[],ne||[]),": ")+"] ":"");return g.length===0?Y+"{}":x?Y+"{"+Qf(g,x)+"}":Y+"{ "+Kr.call(g,", ")+" }"}return String(e)},"inspect_");function RS(t,e,r){var n=r.quoteStyle||e,o=AS[n];return o+t+o}i(RS,"wrapQuotes");function DF(t){return Yn.call(String(t),/"/g,"&quot;")}i(DF,"quote");function wi(t){return!Va||!(typeof t=="object"&&(Va in t||typeof t[Va]<"u"))}i(wi,"canTrustToString");function Xf(t){return Xn(t)==="[object Array]"&&wi(t)}i(Xf,"isArray");function $F(t){return Xn(t)==="[object Date]"&&wi(t)}i($F,"isDate");function SS(t){return Xn(t)==="[object RegExp]"&&wi(t)}i(SS,"isRegExp");function OF(t){return Xn(t)==="[object Error]"&&wi(t)}i(OF,"isError");function CF(t){return Xn(t)==="[object String]"&&wi(t)}i(CF,"isString");function NF(t){return Xn(t)==="[object Number]"&&wi(t)}i(NF,"isNumber");function kF(t){return Xn(t)==="[object Boolean]"&&wi(t)}i(kF,"isBoolean");function DS(t){if(xo)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Jf)return!1;try{return Jf.call(t),!0}catch{}return!1}i(DS,"isSymbol");function zF(t){if(!t||typeof t!="object"||!Kf)return!1;try{return Kf.call(t),!0}catch{}return!1}i(zF,"isBigInt");var UF=Object.prototype.hasOwnProperty||function(t){return t in this};function Pn(t,e){return UF.call(t,e)}i(Pn,"has");function Xn(t){return SF.call(t)}i(Xn,"toStr");function MF(t){if(t.name)return t.name;var e=EF.call(xF.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}i(MF,"nameOf");function $S(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($S,"indexOf");function FF(t){if(!xc||!t||typeof t!="object")return!1;try{xc.call(t);try{Ec.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}i(FF,"isMap");function LF(t){if(!qa||!t||typeof t!="object")return!1;try{qa.call(t,qa);try{Ba.call(t,Ba)}catch{return!0}return t instanceof WeakMap}catch{}return!1}i(LF,"isWeakMap");function jF(t){if(!gS||!t||typeof t!="object")return!1;try{return gS.call(t),!0}catch{}return!1}i(jF,"isWeakRef");function qF(t){if(!Ec||!t||typeof t!="object")return!1;try{Ec.call(t);try{xc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}i(qF,"isSet");function BF(t){if(!Ba||!t||typeof t!="object")return!1;try{Ba.call(t,Ba);try{qa.call(t,qa)}catch{return!0}return t instanceof WeakSet}catch{}return!1}i(BF,"isWeakSet");function VF(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}i(VF,"isElement");function OS(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return OS(rm.call(t,0,e.maxStringLength),e)+n}var o=RF[e.quoteStyle||"single"];o.lastIndex=0;var s=Yn.call(Yn.call(t,o,"\\$1"),/[\x00-\x1f]/g,GF);return RS(s,"single",e)}i(OS,"inspectString");function GF(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":"")+IF.call(e.toString(16))}i(GF,"lowbyte");function ja(t){return"Object("+t+")"}i(ja,"markBoxed");function Zf(t){return t+" { ? }"}i(Zf,"weakCollectionOf");function xS(t,e,r,n){var o=n?Qf(r,n):Kr.call(r,", ");return t+" ("+e+") {"+o+"}"}i(xS,"collectionOf");function HF(t){for(var e=0;e<t.length;e++)if($S(t[e],`
56
- `)>=0)return!1;return!0}i(HF,"singleLineValues");function WF(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Kr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Kr.call(Array(e+1),r)}}i(WF,"getIndent");function Qf(t,e){if(t.length===0)return"";var r=`
55
+ https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var jf=class{static{o(this,"GoogleAuth")}checkIsGCE=void 0;useJWTAccessWithScope;defaultServicePath;get isGCE(){return this.checkIsGCE}_findProjectIdPromise;_cachedProjectId;jsonContent=null;apiKey;cachedCredential=null;#e=null;defaultScopes;keyFilename;scopes;clientOptions={};constructor(e={}){if(this._cachedProjectId=e.projectId||null,this.cachedCredential=e.authClient||null,this.keyFilename=e.keyFilename||e.keyFile,this.scopes=e.scopes,this.clientOptions=e.clientOptions||{},this.jsonContent=e.credentials||null,this.apiKey=e.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(Or.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===Or.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(Or.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 Fa.universe("universe-domain"),e||=Lf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Lf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,sS.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Lf.DEFAULT_UNIVERSE}return e}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},r){let n;if(typeof e=="function"?r=e:n=e,r)this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r);else return this.getApplicationDefaultAsync(n)}async getApplicationDefaultAsync(e={}){if(this.cachedCredential)return await this.#t(this.cachedCredential,null);let r;if(r=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e),r)return r instanceof Si.JWT?r.scopes=this.scopes:r instanceof La.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof Si.JWT?r.scopes=this.scopes:r instanceof La.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(Or.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=Fa.getGCPResidency()||await Fa.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){let r=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!r||r.length===0)return null;try{return this._getApplicationCredentialsFromFilePath(r,e)}catch(n){throw n instanceof Error&&(n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`),n}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let r=null;if(this._isWindows())r=process.env.APPDATA;else{let i=process.env.HOME;i&&(r=Ff.join(i,".config"))}return r&&(r=Ff.join(r,"gcloud","application_default_credentials.json"),Ma.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=Ma.realpathSync(e),!Ma.lstatSync(e).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let n=Ma.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!==xi.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${xi.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!e.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!e.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let r=this.fromJSON(e.source_credentials);if(e.service_account_impersonation_url?.length>256)throw new RangeError(`Target principal is too long: ${e.service_account_impersonation_url}`);let n=/(?<target>[^/]+):(generateAccessToken|generateIdToken)$/.exec(e.service_account_impersonation_url)?.groups?.target;if(!n)throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`);let i=(this.scopes||e.scopes||this.defaultScopes)??[];return new xi.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,sS.originalOrCamelOptions)(r).get("universe_domain");return e.type===iS.USER_REFRESH_ACCOUNT_TYPE?(n=new iS.UserRefreshClient(r),n.fromJSON(e)):e.type===xi.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===La.EXTERNAL_ACCOUNT_TYPE?(n=lF.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===aS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new aS.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new Si.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),i&&(n.universeDomain=i),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let i={};if(typeof r=="function"?n=r:i=r,n)this.fromStreamAsync(e,i).then(s=>n(null,s),n);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",i).on("data",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 Si.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=m,this.setGapicJWTValues(m),n(m)}}catch(d){return i(d)}})})}fromAPIKey(e,r={}){return new Si.JWT({...r,apiKey:e})}_isWindows(){let e=iF.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,nF.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n)try{let i=JSON.parse(n).configuration.properties.core.project;e(i);return}catch{}e(null)})})}getProductionProjectId(){return process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project}async getFileProjectId(){if(this.cachedCredential)return this.cachedCredential.projectId;if(this.keyFilename){let r=await this.getClient();if(r&&r.projectId)return r.projectId}let e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return e?e.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==La.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await Fa.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 xi.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof La.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([Fa.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(Or.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=Ff.resolve(this.keyFilename),r=Ma.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 uF.IdTokenClient({targetAudience:e,idTokenProvider:r})}async getAccessToken(){return(await(await this.getClient()).getAccessToken()).token}async getRequestHeaders(e){return(await this.getClient()).getRequestHeaders(e)}async authorizeRequest(e={}){let r=e.url,i=await(await this.getClient()).getRequestHeaders(r);return e.headers=oF.Gaxios.mergeHeaders(e.headers,i),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,cF.getEnv)()}async sign(e,r){let n=await this.getClient(),i=await this.getUniverseDomain();if(r=r||`https://iamcredentials.${i}/v1/projects/-/serviceAccounts/`,n instanceof xi.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,aF.createCrypto)();if(n instanceof Si.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,i){let s=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};Or.GoogleAuth=jf});var cS=L(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.IAMAuth=void 0;var qf=class{static{o(this,"IAMAuth")}selector;token;constructor(e,r){this.selector=e,this.token=r,this.selector=e,this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};wc.IAMAuth=qf});var lS=L(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.DownscopedClient=Zr.EXPIRATION_TIME_OFFSET=Zr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var dF=gt(),pF=require("stream"),Bf=tr(),fF=tc(),mF="urn:ietf:params:oauth:grant-type:token-exchange",hF="urn:ietf:params:oauth:token-type:access_token",gF="urn:ietf:params:oauth:token-type:access_token";Zr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Zr.EXPIRATION_TIME_OFFSET=300*1e3;var Vf=class extends Bf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Bf.AuthClient?{}:e),e instanceof Bf.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>Zr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Zr.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 fF.StsCredentials({tokenExchangeEndpoint:`https://sts.${this.universeDomain}/v1/token`}),this.cachedDownscopedAccessToken=null}setCredentials(e){if(!e.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(e),this.cachedDownscopedAccessToken=e}async getAccessToken(){return(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=dF.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.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 i}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:mF,requestedTokenType:hF,subjectToken:e,subjectTokenType:gF},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,s=n.expires_in?new Date().getTime()+n.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:n.access_token,expiry_date:s,res:n.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Zr.DownscopedClient=Vf});var dS=L(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.PassThroughClient=void 0;var yF=tr(),Gf=class extends yF.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};bc.PassThroughClient=Gf});var ja=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 pS=uS();Object.defineProperty(me,"GoogleAuth",{enumerable:!0,get:o(function(){return pS.GoogleAuth},"get")});me.gcpMetadata=Sa();me.gaxios=gt();var fS=tr();Object.defineProperty(me,"AuthClient",{enumerable:!0,get:o(function(){return fS.AuthClient},"get")});Object.defineProperty(me,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return fS.DEFAULT_UNIVERSE},"get")});var vF=$p();Object.defineProperty(me,"Compute",{enumerable:!0,get:o(function(){return vF.Compute},"get")});var _F=Np();Object.defineProperty(me,"GCPEnv",{enumerable:!0,get:o(function(){return _F.GCPEnv},"get")});var PF=cS();Object.defineProperty(me,"IAMAuth",{enumerable:!0,get:o(function(){return PF.IAMAuth},"get")});var wF=Cp();Object.defineProperty(me,"IdTokenClient",{enumerable:!0,get:o(function(){return wF.IdTokenClient},"get")});var bF=Yp();Object.defineProperty(me,"JWTAccess",{enumerable:!0,get:o(function(){return bF.JWTAccess},"get")});var TF=Qp();Object.defineProperty(me,"JWT",{enumerable:!0,get:o(function(){return TF.JWT},"get")});var SF=nf();Object.defineProperty(me,"Impersonated",{enumerable:!0,get:o(function(){return SF.Impersonated},"get")});var Hf=Po();Object.defineProperty(me,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return Hf.CodeChallengeMethod},"get")});Object.defineProperty(me,"OAuth2Client",{enumerable:!0,get:o(function(){return Hf.OAuth2Client},"get")});Object.defineProperty(me,"ClientAuthentication",{enumerable:!0,get:o(function(){return Hf.ClientAuthentication},"get")});var xF=Ip();Object.defineProperty(me,"LoginTicket",{enumerable:!0,get:o(function(){return xF.LoginTicket},"get")});var EF=tf();Object.defineProperty(me,"UserRefreshClient",{enumerable:!0,get:o(function(){return EF.UserRefreshClient},"get")});var IF=Tf();Object.defineProperty(me,"AwsClient",{enumerable:!0,get:o(function(){return IF.AwsClient},"get")});var AF=Pf();Object.defineProperty(me,"AwsRequestSigner",{enumerable:!0,get:o(function(){return AF.AwsRequestSigner},"get")});var RF=vf();Object.defineProperty(me,"IdentityPoolClient",{enumerable:!0,get:o(function(){return RF.IdentityPoolClient},"get")});var DF=zf();Object.defineProperty(me,"ExternalAccountClient",{enumerable:!0,get:o(function(){return DF.ExternalAccountClient},"get")});var $F=Jn();Object.defineProperty(me,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return $F.BaseExternalAccountClient},"get")});var OF=lS();Object.defineProperty(me,"DownscopedClient",{enumerable:!0,get:o(function(){return OF.DownscopedClient},"get")});var mS=Cf();Object.defineProperty(me,"PluggableAuthClient",{enumerable:!0,get:o(function(){return mS.PluggableAuthClient},"get")});Object.defineProperty(me,"ExecutableError",{enumerable:!0,get:o(function(){return mS.ExecutableError},"get")});var hS=Mf();Object.defineProperty(me,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return hS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(me,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return hS.ExternalAccountAuthorizedUserClient},"get")});var CF=dS();Object.defineProperty(me,"PassThroughClient",{enumerable:!0,get:o(function(){return CF.PassThroughClient},"get")});var NF=new pS.GoogleAuth;me.auth=NF});var yS=L(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});Wf.getAPI=zF;function zF(t,e,r,n){let i;if(typeof e=="string")i=e,e={};else if(typeof e=="object")i=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[i],d=new s(e,n);return Object.freeze(d)}catch(s){throw new Error(`Unable to load endpoint ${t}("${i}"): ${s.message}`)}}o(zF,"getAPI")});var _S=L((fte,vS)=>{vS.exports=require("util").inspect});var Ha=L((mte,FS)=>{var nm=typeof Map=="function"&&Map.prototype,Zf=Object.getOwnPropertyDescriptor&&nm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,xc=nm&&Zf&&typeof Zf.get=="function"?Zf.get:null,PS=nm&&Map.prototype.forEach,om=typeof Set=="function"&&Set.prototype,Kf=Object.getOwnPropertyDescriptor&&om?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ec=om&&Kf&&typeof Kf.get=="function"?Kf.get:null,wS=om&&Set.prototype.forEach,kF=typeof WeakMap=="function"&&WeakMap.prototype,Ba=kF?WeakMap.prototype.has:null,UF=typeof WeakSet=="function"&&WeakSet.prototype,Va=UF?WeakSet.prototype.has:null,MF=typeof WeakRef=="function"&&WeakRef.prototype,bS=MF?WeakRef.prototype.deref:null,FF=Boolean.prototype.valueOf,LF=Object.prototype.toString,jF=Function.prototype.toString,qF=String.prototype.match,im=String.prototype.slice,Yn=String.prototype.replace,BF=String.prototype.toUpperCase,TS=String.prototype.toLowerCase,OS=RegExp.prototype.test,SS=Array.prototype.concat,Kr=Array.prototype.join,VF=Array.prototype.slice,xS=Math.floor,Xf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Jf=Object.getOwnPropertySymbols,Qf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ei=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ga=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ei||!0)?Symbol.toStringTag:null,CS=Object.prototype.propertyIsEnumerable,ES=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function IS(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||OS.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-xS(-t):xS(t);if(n!==t){var i=String(n),s=im.call(e,i.length+1);return Yn.call(i,r,"$&_")+"."+Yn.call(Yn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Yn.call(e,r,"$&_")}o(IS,"addNumericSeparator");var em=_S(),AS=em.custom,RS=kS(AS)?AS:null,NS={__proto__:null,double:'"',single:"'"},GF={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};FS.exports=o(function t(e,r,n,i){var s=r||{};if(wn(s,"quoteStyle")&&!wn(NS,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(wn(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=wn(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(wn(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(wn(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 MS(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var h=String(e);return m?IS(e,h):h}if(typeof e=="bigint"){var v=String(e)+"n";return m?IS(e,v):v}var _=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=_&&_>0&&typeof e=="object")return tm(e)?"[Array]":"[Object]";var x=c1(s,n);if(typeof i>"u")i=[];else if(US(i,e)>=0)return"[Circular]";function T(J,re,te){if(re&&(i=VF.call(i),i.push(re)),te){var ce={depth:s.depth};return wn(s,"quoteStyle")&&(ce.quoteStyle=s.quoteStyle),t(J,ce,n+1,i)}return t(J,s,n+1,i)}if(o(T,"inspect"),typeof e=="function"&&!DS(e)){var w=e1(e),S=Sc(e,T);return"[Function"+(w?": "+w:" (anonymous)")+"]"+(S.length>0?" { "+Kr.call(S,", ")+" }":"")}if(kS(e)){var D=Ei?Yn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Qf.call(e);return typeof e=="object"&&!Ei?qa(D):D}if(a1(e)){for(var E="<"+TS.call(String(e.nodeName)),u=e.attributes||[],f=0;f<u.length;f++)E+=" "+u[f].name+"="+zS(HF(u[f].value),"double",s);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+TS.call(String(e.nodeName))+">",E}if(tm(e)){if(e.length===0)return"[]";var c=Sc(e,T);return x&&!u1(c)?"["+rm(c,x)+"]":"[ "+Kr.call(c,", ")+" ]"}if(ZF(e)){var y=Sc(e,T);return!("cause"in Error.prototype)&&"cause"in e&&!CS.call(e,"cause")?"{ ["+String(e)+"] "+Kr.call(SS.call("[cause]: "+T(e.cause),y),", ")+" }":y.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Kr.call(y,", ")+" }"}if(typeof e=="object"&&d){if(RS&&typeof e[RS]=="function"&&em)return em(e,{depth:_-n});if(d!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(t1(e)){var l=[];return PS&&PS.call(e,function(J,re){l.push(T(re,e,!0)+" => "+T(J,e))}),$S("Map",xc.call(e),l,x)}if(o1(e)){var b=[];return wS&&wS.call(e,function(J){b.push(T(J,e))}),$S("Set",Ec.call(e),b,x)}if(r1(e))return Yf("WeakMap");if(i1(e))return Yf("WeakSet");if(n1(e))return Yf("WeakRef");if(JF(e))return qa(T(Number(e)));if(XF(e))return qa(T(Xf.call(e)));if(YF(e))return qa(FF.call(e));if(KF(e))return qa(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(!WF(e)&&!DS(e)){var g=Sc(e,T),ie=ES?ES(e)===Object.prototype:e instanceof Object||e.constructor===Object,ne=e instanceof Object?"":"null prototype",Oe=!ie&&Ga&&Object(e)===e&&Ga in e?im.call(Xn(e),8,-1):ne?"Object":"",se=ie||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",X=se+(Oe||ne?"["+Kr.call(SS.call([],Oe||[],ne||[]),": ")+"] ":"");return g.length===0?X+"{}":x?X+"{"+rm(g,x)+"}":X+"{ "+Kr.call(g,", ")+" }"}return String(e)},"inspect_");function zS(t,e,r){var n=r.quoteStyle||e,i=NS[n];return i+t+i}o(zS,"wrapQuotes");function HF(t){return Yn.call(String(t),/"/g,"&quot;")}o(HF,"quote");function bo(t){return!Ga||!(typeof t=="object"&&(Ga in t||typeof t[Ga]<"u"))}o(bo,"canTrustToString");function tm(t){return Xn(t)==="[object Array]"&&bo(t)}o(tm,"isArray");function WF(t){return Xn(t)==="[object Date]"&&bo(t)}o(WF,"isDate");function DS(t){return Xn(t)==="[object RegExp]"&&bo(t)}o(DS,"isRegExp");function ZF(t){return Xn(t)==="[object Error]"&&bo(t)}o(ZF,"isError");function KF(t){return Xn(t)==="[object String]"&&bo(t)}o(KF,"isString");function JF(t){return Xn(t)==="[object Number]"&&bo(t)}o(JF,"isNumber");function YF(t){return Xn(t)==="[object Boolean]"&&bo(t)}o(YF,"isBoolean");function kS(t){if(Ei)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Qf)return!1;try{return Qf.call(t),!0}catch{}return!1}o(kS,"isSymbol");function XF(t){if(!t||typeof t!="object"||!Xf)return!1;try{return Xf.call(t),!0}catch{}return!1}o(XF,"isBigInt");var QF=Object.prototype.hasOwnProperty||function(t){return t in this};function wn(t,e){return QF.call(t,e)}o(wn,"has");function Xn(t){return LF.call(t)}o(Xn,"toStr");function e1(t){if(t.name)return t.name;var e=qF.call(jF.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(e1,"nameOf");function US(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}o(US,"indexOf");function t1(t){if(!xc||!t||typeof t!="object")return!1;try{xc.call(t);try{Ec.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(t1,"isMap");function r1(t){if(!Ba||!t||typeof t!="object")return!1;try{Ba.call(t,Ba);try{Va.call(t,Va)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(r1,"isWeakMap");function n1(t){if(!bS||!t||typeof t!="object")return!1;try{return bS.call(t),!0}catch{}return!1}o(n1,"isWeakRef");function o1(t){if(!Ec||!t||typeof t!="object")return!1;try{Ec.call(t);try{xc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(o1,"isSet");function i1(t){if(!Va||!t||typeof t!="object")return!1;try{Va.call(t,Va);try{Ba.call(t,Ba)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(i1,"isWeakSet");function a1(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(a1,"isElement");function MS(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return MS(im.call(t,0,e.maxStringLength),e)+n}var i=GF[e.quoteStyle||"single"];i.lastIndex=0;var s=Yn.call(Yn.call(t,i,"\\$1"),/[\x00-\x1f]/g,s1);return zS(s,"single",e)}o(MS,"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":"")+BF.call(e.toString(16))}o(s1,"lowbyte");function qa(t){return"Object("+t+")"}o(qa,"markBoxed");function Yf(t){return t+" { ? }"}o(Yf,"weakCollectionOf");function $S(t,e,r,n){var i=n?rm(r,n):Kr.call(r,", ");return t+" ("+e+") {"+i+"}"}o($S,"collectionOf");function u1(t){for(var e=0;e<t.length;e++)if(US(t[e],`
56
+ `)>=0)return!1;return!0}o(u1,"singleLineValues");function c1(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Kr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Kr.call(Array(e+1),r)}}o(c1,"getIndent");function rm(t,e){if(t.length===0)return"";var r=`
57
57
  `+e.prev+e.base;return r+Kr.call(t,","+r)+`
58
- `+e.prev}i(Qf,"indentedJoin");function Sc(t,e){var r=Xf(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 Wf=="function"?Wf(t):[],p;if(xo){p={};for(var m=0;m<s.length;m++)p["$"+s[m]]=s[m]}for(var h in t)Pn(t,h)&&(r&&String(Number(h))===h&&h<t.length||xo&&p["$"+h]instanceof Symbol||(ES.call(/[^\w$]/,h)?n.push(e(h,t)+": "+e(t[h],t)):n.push(h+": "+e(t[h],t))));if(typeof Wf=="function")for(var v=0;v<s.length;v++)IS.call(t,s[v])&&n.push("["+e(s[v])+"]: "+e(t[s[v]],t));return n}i(Sc,"arrObjKeys")});var kS=L((Ree,NS)=>{"use strict";var ZF=Ga(),KF=jn(),Ic=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"),JF=i(function(t,e){if(t){var r=Ic(t,e);return r&&r.value}},"listGet"),YF=i(function(t,e,r){var n=Ic(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),XF=i(function(t,e){return t?!!Ic(t,e):!1},"listHas"),QF=i(function(t,e){if(t)return Ic(t,e,!0)},"listDelete");NS.exports=i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new KF("Side channel does not contain "+ZF(n))},"assert"),delete:i(function(n){var o=QF(e,n);return o&&e&&!e.next&&(e=void 0),!!o},"delete"),get:i(function(n){return JF(e,n)},"get"),has:i(function(n){return XF(e,n)},"has"),set:i(function(n,o){e||(e={next:void 0}),YF(e,n,o)},"set")};return r},"getSideChannelList")});var nm=L(($ee,MS)=>{"use strict";var zS=sa(),US=gd(),e1=US([zS("%String.prototype.indexOf%")]);MS.exports=i(function(e,r){var n=zS(e,!!r);return typeof n=="function"&&e1(e,".prototype.")>-1?US([n]):n},"callBoundIntrinsic")});var im=L((Cee,LS)=>{"use strict";var t1=sa(),Ha=nm(),r1=Ga(),n1=jn(),FS=t1("%Map%",!0),i1=Ha("Map.prototype.get",!0),o1=Ha("Map.prototype.set",!0),a1=Ha("Map.prototype.has",!0),s1=Ha("Map.prototype.delete",!0),u1=Ha("Map.prototype.size",!0);LS.exports=!!FS&&i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new n1("Side channel does not contain "+r1(n))},"assert"),delete:i(function(n){if(e){var o=s1(e,n);return u1(e)===0&&(e=void 0),o}return!1},"delete"),get:i(function(n){if(e)return i1(e,n)},"get"),has:i(function(n){return e?a1(e,n):!1},"has"),set:i(function(n,o){e||(e=new FS),o1(e,n,o)},"set")};return r},"getSideChannelMap")});var qS=L((kee,jS)=>{"use strict";var c1=sa(),Rc=nm(),l1=Ga(),Ac=im(),d1=jn(),Eo=c1("%WeakMap%",!0),p1=Rc("WeakMap.prototype.get",!0),f1=Rc("WeakMap.prototype.set",!0),m1=Rc("WeakMap.prototype.has",!0),h1=Rc("WeakMap.prototype.delete",!0);jS.exports=Eo?i(function(){var e,r,n={assert:i(function(o){if(!n.has(o))throw new d1("Side channel does not contain "+l1(o))},"assert"),delete:i(function(o){if(Eo&&o&&(typeof o=="object"||typeof o=="function")){if(e)return h1(e,o)}else if(Ac&&r)return r.delete(o);return!1},"delete"),get:i(function(o){return Eo&&o&&(typeof o=="object"||typeof o=="function")&&e?p1(e,o):r&&r.get(o)},"get"),has:i(function(o){return Eo&&o&&(typeof o=="object"||typeof o=="function")&&e?m1(e,o):!!r&&r.has(o)},"has"),set:i(function(o,s){Eo&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new Eo),f1(e,o,s)):Ac&&(r||(r=Ac()),r.set(o,s))},"set")};return n},"getSideChannelWeakMap"):Ac});var om=L((Uee,BS)=>{"use strict";var g1=jn(),y1=Ga(),v1=kS(),_1=im(),P1=qS(),w1=P1||_1||v1;BS.exports=i(function(){var e,r={assert:i(function(n){if(!r.has(n))throw new g1("Side channel does not contain "+y1(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=w1()),e.set(n,o)},"set")};return r},"getSideChannel")});var Dc=L((Fee,VS)=>{"use strict";var b1=String.prototype.replace,T1=/%20/g,am={RFC1738:"RFC1738",RFC3986:"RFC3986"};VS.exports={default:am.RFC3986,formatters:{RFC1738:i(function(t){return b1.call(t,T1,"+")},"RFC1738"),RFC3986:i(function(t){return String(t)},"RFC3986")},RFC1738:am.RFC1738,RFC3986:am.RFC3986}});var lm=L((jee,GS)=>{"use strict";var S1=Dc(),x1=om(),sm=Object.prototype.hasOwnProperty,bi=Array.isArray,$c=x1(),Io=i(function(e,r){return $c.set(e,r),e},"markOverflow"),Ti=i(function(e){return $c.has(e)},"isOverflow"),Wa=i(function(e){return $c.get(e)},"getMaxIndex"),cm=i(function(e,r){$c.set(e,r)},"setMaxIndex"),Jr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),E1=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"),Za=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"),I1=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 Io(Za(e.concat(r),n),o);e[o]=r}else if(e&&typeof e=="object")if(Ti(e)){var s=Wa(e)+1;e[s]=r,cm(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!sm.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(Ti(r)){for(var p=Object.keys(r),m=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},h=0;h<p.length;h++){var v=parseInt(p[h],10);m[v+1]=r[p[h]]}return Io(m,Wa(r)+1)}var P=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&P.length>n.arrayLimit?Io(Za(P,n),P.length-1):P}var x=e;return bi(e)&&!bi(r)&&(x=Za(e,n)),bi(e)&&bi(r)?(r.forEach(function(T,w){if(sm.call(e,w)){var S=e[w];S&&typeof S=="object"&&T&&typeof T=="object"?e[w]=t(S,T,n):e[e.length]=T}else e[w]=T}),e):Object.keys(r).reduce(function(T,w){var S=r[w];if(sm.call(T,w)?T[w]=t(T[w],S,n):T[w]=S,Ti(r)&&!Ti(T)&&Io(T,Wa(r)),Ti(T)){var D=parseInt(w,10);String(D)===w&&D>=0&&D>Wa(T)&&cm(T,D)}return T},x)},"merge"),A1=i(function(e,r){return Object.keys(r).reduce(function(n,o){return n[o]=r[o],n},e)},"assignSingleSource"),R1=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"),um=1024,D1=i(function(e,r,n,o,s){if(e.length===0)return e;var p=e;if(typeof e=="symbol"?p=Symbol.prototype.toString.call(e):typeof e!="string"&&(p=String(e)),n==="iso-8859-1")return escape(p).replace(/%u[0-9a-f]{4}/gi,function(w){return"%26%23"+parseInt(w.slice(2),16)+"%3B"});for(var m="",h=0;h<p.length;h+=um){for(var v=p.length>=um?p.slice(h,h+um):p,P=[],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===S1.RFC1738&&(T===40||T===41)){P[P.length]=v.charAt(x);continue}if(T<128){P[P.length]=Jr[T];continue}if(T<2048){P[P.length]=Jr[192|T>>6]+Jr[128|T&63];continue}if(T<55296||T>=57344){P[P.length]=Jr[224|T>>12]+Jr[128|T>>6&63]+Jr[128|T&63];continue}x+=1,T=65536+((T&1023)<<10|v.charCodeAt(x)&1023),P[P.length]=Jr[240|T>>18]+Jr[128|T>>12&63]+Jr[128|T>>6&63]+Jr[128|T&63]}m+=P.join("")}return m},"encode"),$1=i(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o<r.length;++o)for(var s=r[o],p=s.obj[s.prop],m=Object.keys(p),h=0;h<m.length;++h){var v=m[h],P=p[v];typeof P=="object"&&P!==null&&n.indexOf(P)===-1&&(r[r.length]={obj:p,prop:v},n[n.length]=P)}return E1(r),e},"compact"),O1=i(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),C1=i(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),N1=i(function(e,r,n,o){if(Ti(e)){var s=Wa(e)+1;return e[s]=r,cm(e,s),e}var p=[].concat(e,r);return p.length>n?Io(Za(p,{plainObjects:o}),p.length-1):p},"combine"),k1=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");GS.exports={arrayToObject:Za,assign:A1,combine:N1,compact:$1,decode:R1,encode:D1,isBuffer:C1,isOverflow:Ti,isRegExp:O1,markOverflow:Io,maybeMap:k1,merge:I1}});var YS=L((Bee,JS)=>{"use strict";var WS=om(),Oc=lm(),Ka=Dc(),z1=Object.prototype.hasOwnProperty,ZS={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")},Yr=Array.isArray,U1=Array.prototype.push,KS=i(function(t,e){U1.apply(t,Yr(e)?e:[e])},"pushToArray"),M1=Date.prototype.toISOString,HS=Ka.default,bt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Oc.encode,encodeValuesOnly:!1,filter:void 0,format:HS,formatter:Ka.formatters[HS],indices:!1,serializeDate:i(function(e){return M1.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},F1=i(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),dm={},L1=i(function t(e,r,n,o,s,p,m,h,v,P,x,T,w,S,D,E,u,f){for(var c=e,y=f,l=0,b=!1;(y=y.get(dm))!==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(dm)>"u"&&(l=0)}if(typeof P=="function"?c=P(r,c):c instanceof Date?c=w(c):n==="comma"&&Yr(c)&&(c=Oc.maybeMap(c,function(Ke){return Ke instanceof Date?w(Ke):Ke})),c===null){if(p)return v&&!E?v(r,bt.encoder,u,"key",S):r;c=""}if(F1(c)||Oc.isBuffer(c)){if(v){var oe=E?r:v(r,bt.encoder,u,"key",S);return[D(oe)+"="+D(v(c,bt.encoder,u,"value",S))]}return[D(r)+"="+D(String(c))]}var ne=[];if(typeof c>"u")return ne;var Re;if(n==="comma"&&Yr(c))E&&v&&(c=Oc.maybeMap(c,v)),Re=[{value:c.length>0?c.join(",")||null:void 0}];else if(Yr(P))Re=P;else{var se=Object.keys(c);Re=x?se.sort(x):se}var Y=h?String(r).replace(/\./g,"%2E"):String(r),K=o&&Yr(c)&&c.length===1?Y+"[]":Y;if(s&&Yr(c)&&c.length===0)return K+"[]";for(var re=0;re<Re.length;++re){var te=Re[re],ce=typeof te=="object"&&te&&typeof te.value<"u"?te.value:c[te];if(!(m&&ce===null)){var de=T&&h?String(te).replace(/\./g,"%2E"):String(te),Oe=Yr(c)?typeof n=="function"?n(K,de):K:K+(T?"."+de:"["+de+"]");f.set(e,l);var ze=WS();ze.set(dm,f),KS(ne,t(ce,Oe,n,o,s,p,m,h,n==="comma"&&E&&Yr(c)?null:v,P,x,T,w,S,D,E,u,ze))}}return ne},"stringify"),j1=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=Ka.default;if(typeof e.format<"u"){if(!z1.call(Ka.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var o=Ka.formatters[n],s=bt.filter;(typeof e.filter=="function"||Yr(e.filter))&&(s=e.filter);var p;if(e.arrayFormat in ZS?p=e.arrayFormat:"indices"in e?p=e.indices?"indices":"repeat":p=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:p,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");JS.exports=function(t,e){var r=t,n=j1(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Yr(n.filter)&&(s=n.filter,o=s);var p=[];if(typeof r!="object"||r===null)return"";var m=ZS[n.arrayFormat],h=m==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var v=WS(),P=0;P<o.length;++P){var x=o[P],T=r[x];n.skipNulls&&T===null||KS(p,L1(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 w=p.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&"),w.length>0?S+w:""}});var ex=L((Gee,QS)=>{"use strict";var Xr=lm(),Cc=Object.prototype.hasOwnProperty,pm=Array.isArray,st={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Xr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},q1=i(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),XS=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"),B1="utf8=%26%2310003%3B",V1="utf8=%E2%9C%93",G1=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,p=o.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&p.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<p.length;++h)p[h].indexOf("utf8=")===0&&(p[h]===V1?v="utf-8":p[h]===B1&&(v="iso-8859-1"),m=h,h=p.length);for(h=0;h<p.length;++h)if(h!==m){var P=p[h],x=P.indexOf("]="),T=x===-1?P.indexOf("="):x+1,w,S;if(T===-1?(w=r.decoder(P,st.decoder,v,"key"),S=r.strictNullHandling?null:""):(w=r.decoder(P.slice(0,T),st.decoder,v,"key"),w!==null&&(S=Xr.maybeMap(XS(P.slice(T+1),r,pm(n[w])?n[w].length:0),function(E){return r.decoder(E,st.decoder,v,"value")}))),S&&r.interpretNumericEntities&&v==="iso-8859-1"&&(S=q1(String(S))),P.indexOf("[]=")>-1&&(S=pm(S)?[S]:S),r.comma&&pm(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=Xr.combine([],S,r.arrayLimit,r.plainObjects)}if(w!==null){var D=Cc.call(n,w);D&&(r.duplicates==="combine"||P.indexOf("[]=")>-1)?n[w]=Xr.combine(n[w],S,r.arrayLimit,r.plainObjects):(!D||r.duplicates==="last")&&(n[w]=S)}}return n},"parseQueryStringValues"),H1=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 p=n?e:XS(e,r,o),m=t.length-1;m>=0;--m){var h,v=t[m];if(v==="[]"&&r.parseArrays)Xr.isOverflow(p)?h=p:h=r.allowEmptyArrays&&(p===""||r.strictNullHandling&&p===null)?[]:Xr.combine([],p,r.arrayLimit,r.plainObjects);else{h=r.plainObjects?{__proto__:null}:{};var P=v.charAt(0)==="["&&v.charAt(v.length-1)==="]"?v.slice(1,-1):v,x=r.decodeDotInKeys?P.replace(/%2E/g,"."):P,T=parseInt(x,10),w=!isNaN(T)&&v!==x&&String(T)===x&&T>=0&&r.parseArrays;if(!r.parseArrays&&x==="")h={0:p};else if(w&&T<r.arrayLimit)h=[],h[T]=p;else{if(w&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");w?(h[T]=p,Xr.markOverflow(h,T)):x!=="__proto__"&&(h[x]=p)}}p=h}return p},"parseObject"),W1=i(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Cc.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,p=o.exec(n),m=p?n.slice(0,p.index):n,h=[];if(m){if(!r.plainObjects&&Cc.call(Object.prototype,m)&&!r.allowPrototypes)return;h[h.length]=m}for(var v=0;(p=s.exec(n))!==null&&v<r.depth;){v+=1;var P=p[1].slice(1,-1);if(!r.plainObjects&&Cc.call(Object.prototype,P)&&!r.allowPrototypes)return;h[h.length]=p[1]}if(p){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");h[h.length]="["+n.slice(p.index)+"]"}return h},"splitKeyIntoSegments"),Z1=i(function(e,r,n,o){if(e){var s=W1(e,n);if(s)return H1(s,r,n,o)}},"parseQueryStringKeys"),K1=i(function(e){if(!e)return st;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"?st.charset:e.charset,n=typeof e.duplicates>"u"?st.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:st.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:st.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:st.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:st.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:st.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:st.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:st.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:st.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:st.decoder,delimiter:typeof e.delimiter=="string"||Xr.isRegExp(e.delimiter)?e.delimiter:st.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:st.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:st.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:st.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:st.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:st.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:st.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:st.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");QS.exports=function(t,e){var r=K1(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?G1(t,r):t,o=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),p=0;p<s.length;++p){var m=s[p],h=Z1(m,n[m],r,typeof t=="string");o=Xr.merge(o,h,r)}return r.allowSparse===!0?o:Xr.compact(o)}});var fm=L((Wee,tx)=>{"use strict";var J1=YS(),Y1=ex(),X1=Dc();tx.exports={formats:X1,parse:Y1,stringify:J1}});var nx=L((mm,rx)=>{(function(t,e){typeof mm=="object"?rx.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(mm,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],p=[];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))),p.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(o==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(h){p.push(this.encodeValue(r,h,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(h){this.isDefined(s[h])&&p.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)?p.push(this.encodeUnreserved(n)+"="+m.join(",")):m.length!==0&&p.push(m.join(","))}else r===";"?this.isDefined(s)&&p.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?p.push(this.encodeUnreserved(n)+"="):s===""&&p.push("");return p},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:i(function(o){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,p,m){if(p){var h=null,v=[];if(n.indexOf(p.charAt(0))!==-1&&(h=p.charAt(0),p=p.substr(1)),p.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 P=",";return h==="?"?P="&":h!=="#"&&(P=h),(v.length!==0?h:"")+v.join(P)}else return v.join(",")}else return r.encodeReserved(m)})},"expand")}},new t})});var ix=L(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.isBrowser=Q1;function Q1(){return typeof window<"u"}i(Q1,"isBrowser")});var kc=L(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.headersToClassicHeaders=ox;Nc.marshallGaxiosResponse=eL;function ox(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(ox,"headersToClassicHeaders");function eL(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:ox(t?.headers)}})}i(eL,"marshallGaxiosResponse")});var ux=L(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.sessions=void 0;ar.request=fL;ar.closeSession=gm;var sx=require("http2"),tL=require("zlib"),rL=require("url"),nL=fm(),iL=ca(),oL=require("stream"),aL=require("util"),sL=require("process"),uL=kc(),{HTTP2_HEADER_CONTENT_ENCODING:cL,HTTP2_HEADER_CONTENT_TYPE:ax,HTTP2_HEADER_METHOD:lL,HTTP2_HEADER_PATH:dL,HTTP2_HEADER_STATUS:pL}=sx.constants,Ja=!!sL.env.HTTP2_DEBUG;ar.sessions={};async function fL(t){let e=iL(!0,{},t);e.validateStatus=e.validateStatus||mL,e.responseType=e.responseType||"json";let r=new rL.URL(e.url),n=hL(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||nL.stringify)(e.params);o+=`?${x}`}let s=(0,uL.headersToClassicHeaders)(e.headers);s[dL]=o,s[lL]=t.method||"GET",e.headers=s,s[ax]||e.responseType!=="text"&&(s[ax]="application/json");let p={config:t,headers:{},status:0,data:{},statusText:""},m=[],h=n.session,v;return new Promise((P,x)=>{try{v=h.request(s).on("response",T=>{Object.assign(p,{headers:T,status:T[pL]});let w=v;if(T[cL]==="gzip"&&(w=v.pipe(tL.createGunzip())),e.responseType==="stream"){p.data=w,P(p);return}w.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);p.data=D}if(!e.validateStatus(p.status)){let E=`Request failed with status code ${p.status}. `;if(p.data&&typeof p.data=="object"){let u=aL.inspect(p.data,{depth:5});E=`${E}
59
- '${u}`}x(new Error(E,{cause:p}))}P(p)})}).on("error",T=>{x(T)})}catch(T){gm(r).then(()=>x(T)).catch(x);return}if(p.request=v,t.data){if(t.data instanceof oL.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(()=>gm(r),500)})}i(fL,"request");function mL(t){return t>=200&&t<300}i(mL,"validateStatus");function hL(t){if(ar.sessions[t])Ja&&console.log(`Used cached client for ${t}`);else{Ja&&console.log(`Creating client for ${t}`);let e=sx.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete ar.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete ar.sessions[t]}),ar.sessions[t]={session:e}}return ar.sessions[t]}i(hL,"_getClient");async function gm(t){let e=ar.sessions[t.host];if(!e)return;let{session:r}=e;delete ar.sessions[t.host],Ja&&console.error(`Closing ${t.host}`),r.close(()=>{Ja&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(Ja&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}i(gm,"closeSession")});var cx=L((tte,gL)=>{gL.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 zc=L(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.createAPIRequest=wL;var ym=ht(),yL=fm(),mx=require("stream"),lx=nx(),dx=ca(),_m=ix(),vL=ux(),vm=kc(),hx=cx(),px=i(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function _L(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}i(_L,"isReadableStream");function PL(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}i(PL,"getMissingParams");function wL(t,e){if(e)fx(t).then(r=>e(null,r),e);else return fx(t)}i(wL,"createAPIRequest");async function fx(t){let e=dx(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=dx(!0,{},e.params,t.params);e.userAgentDirectives=e.userAgentDirectives||[];let n=r.media||{},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,p=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let m=(0,vm.headersToClassicHeaders)(r.headers||{});bL(m,e.apiVersion),delete r.headers,Object.keys(r).forEach(w=>{if(w.slice(-1)==="_"){let S=w.slice(0,-1);r[S]=r[w],delete r[w]}});let h=PL(r,t.requiredParams);if(h)throw new Error("Missing required parameters: "+h.join(", "));if(e.url){let w=e.url;typeof w=="object"&&(w=w.toString()),e.url=lx.parse(w).expand(r)}if(t.mediaUrl&&(t.mediaUrl=lx.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let w=new URL(e.url),S=w.href.substr(w.origin.length);e.url=new URL(S,t.context._options.rootUrl).href}e.paramsSerializer=w=>yL.stringify(w,{arrayFormat:"repeat"}),t.pathParams.forEach(w=>delete r[w]),typeof s=="string"&&(r.key=r.key||s,s=void 0);function v(w){let S=px(),D=`--${S}--`,E=new mx.PassThrough({flush(c){this.push(`\r
60
- `),this.push(D),c()}}),u=new Pm,f=_L(w[1].body);m["content-type"]=`multipart/related; boundary=${S}`;for(let c of w){let y=`--${S}\r
58
+ `+e.prev}o(rm,"indentedJoin");function Sc(t,e){var r=tm(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=wn(t,i)?e(t[i],t):""}var s=typeof Jf=="function"?Jf(t):[],d;if(Ei){d={};for(var m=0;m<s.length;m++)d["$"+s[m]]=s[m]}for(var h in t)wn(t,h)&&(r&&String(Number(h))===h&&h<t.length||Ei&&d["$"+h]instanceof Symbol||(OS.call(/[^\w$]/,h)?n.push(e(h,t)+": "+e(t[h],t)):n.push(h+": "+e(t[h],t))));if(typeof Jf=="function")for(var v=0;v<s.length;v++)CS.call(t,s[v])&&n.push("["+e(s[v])+"]: "+e(t[s[v]],t));return n}o(Sc,"arrObjKeys")});var jS=L((gte,LS)=>{"use strict";var l1=Ha(),d1=jn(),Ic=o(function(t,e,r){for(var n=t,i;(i=n.next)!=null;n=i)if(i.key===e)return n.next=i.next,r||(i.next=t.next,t.next=i),i},"listGetNode"),p1=o(function(t,e){if(t){var r=Ic(t,e);return r&&r.value}},"listGet"),f1=o(function(t,e,r){var n=Ic(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),m1=o(function(t,e){return t?!!Ic(t,e):!1},"listHas"),h1=o(function(t,e){if(t)return Ic(t,e,!0)},"listDelete");LS.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new d1("Side channel does not contain "+l1(n))},"assert"),delete:o(function(n){var i=h1(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return p1(e,n)},"get"),has:o(function(n){return m1(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),f1(e,n,i)},"set")};return r},"getSideChannelList")});var am=L((vte,VS)=>{"use strict";var qS=ua(),BS=_d(),g1=BS([qS("%String.prototype.indexOf%")]);VS.exports=o(function(e,r){var n=qS(e,!!r);return typeof n=="function"&&g1(e,".prototype.")>-1?BS([n]):n},"callBoundIntrinsic")});var sm=L((Pte,HS)=>{"use strict";var y1=ua(),Wa=am(),v1=Ha(),_1=jn(),GS=y1("%Map%",!0),P1=Wa("Map.prototype.get",!0),w1=Wa("Map.prototype.set",!0),b1=Wa("Map.prototype.has",!0),T1=Wa("Map.prototype.delete",!0),S1=Wa("Map.prototype.size",!0);HS.exports=!!GS&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new _1("Side channel does not contain "+v1(n))},"assert"),delete:o(function(n){if(e){var i=T1(e,n);return S1(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return P1(e,n)},"get"),has:o(function(n){return e?b1(e,n):!1},"has"),set:o(function(n,i){e||(e=new GS),w1(e,n,i)},"set")};return r},"getSideChannelMap")});var ZS=L((bte,WS)=>{"use strict";var x1=ua(),Rc=am(),E1=Ha(),Ac=sm(),I1=jn(),Ii=x1("%WeakMap%",!0),A1=Rc("WeakMap.prototype.get",!0),R1=Rc("WeakMap.prototype.set",!0),D1=Rc("WeakMap.prototype.has",!0),$1=Rc("WeakMap.prototype.delete",!0);WS.exports=Ii?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new I1("Side channel does not contain "+E1(i))},"assert"),delete:o(function(i){if(Ii&&i&&(typeof i=="object"||typeof i=="function")){if(e)return $1(e,i)}else if(Ac&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return Ii&&i&&(typeof i=="object"||typeof i=="function")&&e?A1(e,i):r&&r.get(i)},"get"),has:o(function(i){return Ii&&i&&(typeof i=="object"||typeof i=="function")&&e?D1(e,i):!!r&&r.has(i)},"has"),set:o(function(i,s){Ii&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Ii),R1(e,i,s)):Ac&&(r||(r=Ac()),r.set(i,s))},"set")};return n},"getSideChannelWeakMap"):Ac});var um=L((Ste,KS)=>{"use strict";var O1=jn(),C1=Ha(),N1=jS(),z1=sm(),k1=ZS(),U1=k1||z1||N1;KS.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new O1("Side channel does not contain "+C1(n))},"assert"),delete:o(function(n){return!!e&&e.delete(n)},"delete"),get:o(function(n){return e&&e.get(n)},"get"),has:o(function(n){return!!e&&e.has(n)},"has"),set:o(function(n,i){e||(e=U1()),e.set(n,i)},"set")};return r},"getSideChannel")});var Dc=L((Ete,JS)=>{"use strict";var M1=String.prototype.replace,F1=/%20/g,cm={RFC1738:"RFC1738",RFC3986:"RFC3986"};JS.exports={default:cm.RFC3986,formatters:{RFC1738:o(function(t){return M1.call(t,F1,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:cm.RFC1738,RFC3986:cm.RFC3986}});var fm=L((Ate,YS)=>{"use strict";var L1=Dc(),j1=um(),lm=Object.prototype.hasOwnProperty,To=Array.isArray,$c=j1(),Ai=o(function(e,r){return $c.set(e,r),e},"markOverflow"),So=o(function(e){return $c.has(e)},"isOverflow"),Za=o(function(e){return $c.get(e)},"getMaxIndex"),pm=o(function(e,r){$c.set(e,r)},"setMaxIndex"),Jr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),q1=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(To(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&(i[i.length]=n[s]);r.obj[r.prop]=i}}},"compactQueue"),Ka=o(function(e,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},"arrayToObject"),B1=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(To(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return Ai(Ka(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(So(e)){var s=Za(e)+1;e[s]=r,pm(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!lm.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(So(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 Ai(m,Za(r)+1)}var _=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&_.length>n.arrayLimit?Ai(Ka(_,n),_.length-1):_}var x=e;return To(e)&&!To(r)&&(x=Ka(e,n)),To(e)&&To(r)?(r.forEach(function(T,w){if(lm.call(e,w)){var S=e[w];S&&typeof S=="object"&&T&&typeof T=="object"?e[w]=t(S,T,n):e[e.length]=T}else e[w]=T}),e):Object.keys(r).reduce(function(T,w){var S=r[w];if(lm.call(T,w)?T[w]=t(T[w],S,n):T[w]=S,So(r)&&!So(T)&&Ai(T,Za(r)),So(T)){var D=parseInt(w,10);String(D)===w&&D>=0&&D>Za(T)&&pm(T,D)}return T},x)},"merge"),V1=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),G1=o(function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},"decode"),dm=1024,H1=o(function(e,r,n,i,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(w){return"%26%23"+parseInt(w.slice(2),16)+"%3B"});for(var m="",h=0;h<d.length;h+=dm){for(var v=d.length>=dm?d.slice(h,h+dm):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===L1.RFC1738&&(T===40||T===41)){_[_.length]=v.charAt(x);continue}if(T<128){_[_.length]=Jr[T];continue}if(T<2048){_[_.length]=Jr[192|T>>6]+Jr[128|T&63];continue}if(T<55296||T>=57344){_[_.length]=Jr[224|T>>12]+Jr[128|T>>6&63]+Jr[128|T&63];continue}x+=1,T=65536+((T&1023)<<10|v.charCodeAt(x)&1023),_[_.length]=Jr[240|T>>18]+Jr[128|T>>12&63]+Jr[128|T>>6&63]+Jr[128|T&63]}m+=_.join("")}return m},"encode"),W1=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],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 q1(r),e},"compact"),Z1=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),K1=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),J1=o(function(e,r,n,i){if(So(e)){var s=Za(e)+1;return e[s]=r,pm(e,s),e}var d=[].concat(e,r);return d.length>n?Ai(Ka(d,{plainObjects:i}),d.length-1):d},"combine"),Y1=o(function(e,r){if(To(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");YS.exports={arrayToObject:Ka,assign:V1,combine:J1,compact:W1,decode:G1,encode:H1,isBuffer:K1,isOverflow:So,isRegExp:Z1,markOverflow:Ai,maybeMap:Y1,merge:B1}});var nx=L((Dte,rx)=>{"use strict";var QS=um(),Oc=fm(),Ja=Dc(),X1=Object.prototype.hasOwnProperty,ex={brackets:o(function(e){return e+"[]"},"brackets"),comma:"comma",indices:o(function(e,r){return e+"["+r+"]"},"indices"),repeat:o(function(e){return e},"repeat")},Yr=Array.isArray,Q1=Array.prototype.push,tx=o(function(t,e){Q1.apply(t,Yr(e)?e:[e])},"pushToArray"),eL=Date.prototype.toISOString,XS=Ja.default,bt={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Oc.encode,encodeValuesOnly:!1,filter:void 0,format:XS,formatter:Ja.formatters[XS],indices:!1,serializeDate:o(function(e){return eL.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},tL=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),mm={},rL=o(function t(e,r,n,i,s,d,m,h,v,_,x,T,w,S,D,E,u,f){for(var c=e,y=f,l=0,b=!1;(y=y.get(mm))!==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(mm)>"u"&&(l=0)}if(typeof _=="function"?c=_(r,c):c instanceof Date?c=w(c):n==="comma"&&Yr(c)&&(c=Oc.maybeMap(c,function(Ke){return Ke instanceof Date?w(Ke):Ke})),c===null){if(d)return v&&!E?v(r,bt.encoder,u,"key",S):r;c=""}if(tL(c)||Oc.isBuffer(c)){if(v){var ie=E?r:v(r,bt.encoder,u,"key",S);return[D(ie)+"="+D(v(c,bt.encoder,u,"value",S))]}return[D(r)+"="+D(String(c))]}var ne=[];if(typeof c>"u")return ne;var Oe;if(n==="comma"&&Yr(c))E&&v&&(c=Oc.maybeMap(c,v)),Oe=[{value:c.length>0?c.join(",")||null:void 0}];else if(Yr(_))Oe=_;else{var se=Object.keys(c);Oe=x?se.sort(x):se}var X=h?String(r).replace(/\./g,"%2E"):String(r),J=i&&Yr(c)&&c.length===1?X+"[]":X;if(s&&Yr(c)&&c.length===0)return J+"[]";for(var re=0;re<Oe.length;++re){var te=Oe[re],ce=typeof te=="object"&&te&&typeof te.value<"u"?te.value:c[te];if(!(m&&ce===null)){var de=T&&h?String(te).replace(/\./g,"%2E"):String(te),ze=Yr(c)?typeof n=="function"?n(J,de):J:J+(T?"."+de:"["+de+"]");f.set(e,l);var Ue=QS();Ue.set(mm,f),tx(ne,t(ce,ze,n,i,s,d,m,h,n==="comma"&&E&&Yr(c)?null:v,_,x,T,w,S,D,E,u,Ue))}}return ne},"stringify"),nL=o(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=Ja.default;if(typeof e.format<"u"){if(!X1.call(Ja.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Ja.formatters[n],s=bt.filter;(typeof e.filter=="function"||Yr(e.filter))&&(s=e.filter);var d;if(e.arrayFormat in ex?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:i,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");rx.exports=function(t,e){var r=t,n=nL(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Yr(n.filter)&&(s=n.filter,i=s);var d=[];if(typeof r!="object"||r===null)return"";var m=ex[n.arrayFormat],h=m==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var v=QS(),_=0;_<i.length;++_){var x=i[_],T=r[x];n.skipNulls&&T===null||tx(d,rL(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 w=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&"),w.length>0?S+w:""}});var ax=L((Ote,ix)=>{"use strict";var Xr=fm(),Cc=Object.prototype.hasOwnProperty,hm=Array.isArray,ct={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Xr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},oL=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),ox=o(function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},"parseArrayValue"),iL="utf8=%26%2310003%3B",aL="utf8=%E2%9C%93",sL=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,d=i.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]===aL?v="utf-8":d[h]===iL&&(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,w,S;if(T===-1?(w=r.decoder(_,ct.decoder,v,"key"),S=r.strictNullHandling?null:""):(w=r.decoder(_.slice(0,T),ct.decoder,v,"key"),w!==null&&(S=Xr.maybeMap(ox(_.slice(T+1),r,hm(n[w])?n[w].length:0),function(E){return r.decoder(E,ct.decoder,v,"value")}))),S&&r.interpretNumericEntities&&v==="iso-8859-1"&&(S=oL(String(S))),_.indexOf("[]=")>-1&&(S=hm(S)?[S]:S),r.comma&&hm(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=Xr.combine([],S,r.arrayLimit,r.plainObjects)}if(w!==null){var D=Cc.call(n,w);D&&(r.duplicates==="combine"||_.indexOf("[]=")>-1)?n[w]=Xr.combine(n[w],S,r.arrayLimit,r.plainObjects):(!D||r.duplicates==="last")&&(n[w]=S)}}return n},"parseQueryStringValues"),uL=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");i=Array.isArray(e)&&e[s]?e[s].length:0}for(var d=n?e:ox(e,r,i),m=t.length-1;m>=0;--m){var h,v=t[m];if(v==="[]"&&r.parseArrays)Xr.isOverflow(d)?h=d:h=r.allowEmptyArrays&&(d===""||r.strictNullHandling&&d===null)?[]:Xr.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),w=!isNaN(T)&&v!==x&&String(T)===x&&T>=0&&r.parseArrays;if(!r.parseArrays&&x==="")h={0:d};else if(w&&T<r.arrayLimit)h=[],h[T]=d;else{if(w&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");w?(h[T]=d,Xr.markOverflow(h,T)):x!=="__proto__"&&(h[x]=d)}}d=h}return d},"parseObject"),cL=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Cc.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,d=i.exec(n),m=d?n.slice(0,d.index):n,h=[];if(m){if(!r.plainObjects&&Cc.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&&Cc.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"),lL=o(function(e,r,n,i){if(e){var s=cL(e,n);if(s)return uL(s,r,n,i)}},"parseQueryStringKeys"),dL=o(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 i=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:ct.allowDots:!!e.allowDots;return{allowDots:i,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"||Xr.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");ix.exports=function(t,e){var r=dL(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?sL(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),d=0;d<s.length;++d){var m=s[d],h=lL(m,n[m],r,typeof t=="string");i=Xr.merge(i,h,r)}return r.allowSparse===!0?i:Xr.compact(i)}});var gm=L((Nte,sx)=>{"use strict";var pL=nx(),fL=ax(),mL=Dc();sx.exports={formats:mL,parse:fL,stringify:pL}});var cx=L((ym,ux)=>{(function(t,e){typeof ym=="object"?ux.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(ym,function(){function t(){}return o(t,"UrlTemplate"),t.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(r){return/%[0-9A-Fa-f]/.test(r)||(r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")),r}).join("")},t.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})},t.prototype.encodeValue=function(e,r,n){return r=e==="+"||e==="#"?this.encodeReserved(r):this.encodeUnreserved(r),n?this.encodeUnreserved(n)+"="+r:r},t.prototype.isDefined=function(e){return e!=null},t.prototype.isKeyOperator=function(e){return e===";"||e==="&"||e==="?"},t.prototype.getValues=function(e,r,n,i){var s=e[n],d=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),d.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(i==="*")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:o(function(i){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(i,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 lx=L(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});vm.isBrowser=hL;function hL(){return typeof window<"u"}o(hL,"isBrowser")});var zc=L(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.headersToClassicHeaders=dx;Nc.marshallGaxiosResponse=gL;function dx(t){let e={};if(t instanceof Headers)t.forEach((r,n)=>{e[n]=r});else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else e=t||{};return e}o(dx,"headersToClassicHeaders");function gL(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:dx(t?.headers)}})}o(gL,"marshallGaxiosResponse")});var mx=L(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.sessions=void 0;ar.request=RL;ar.closeSession=_m;var fx=require("http2"),yL=require("zlib"),vL=require("url"),_L=gm(),PL=la(),wL=require("stream"),bL=require("util"),TL=require("process"),SL=zc(),{HTTP2_HEADER_CONTENT_ENCODING:xL,HTTP2_HEADER_CONTENT_TYPE:px,HTTP2_HEADER_METHOD:EL,HTTP2_HEADER_PATH:IL,HTTP2_HEADER_STATUS:AL}=fx.constants,Ya=!!TL.env.HTTP2_DEBUG;ar.sessions={};async function RL(t){let e=PL(!0,{},t);e.validateStatus=e.validateStatus||DL,e.responseType=e.responseType||"json";let r=new vL.URL(e.url),n=$L(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let x=(t.paramsSerializer||_L.stringify)(e.params);i+=`?${x}`}let s=(0,SL.headersToClassicHeaders)(e.headers);s[IL]=i,s[EL]=t.method||"GET",e.headers=s,s[px]||e.responseType!=="text"&&(s[px]="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[AL]});let w=v;if(T[xL]==="gzip"&&(w=v.pipe(yL.createGunzip())),e.responseType==="stream"){d.data=w,_(d);return}w.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){_m(r).then(()=>x(T)).catch(x);return}if(d.request=v,t.data){if(t.data instanceof wL.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(()=>_m(r),500)})}o(RL,"request");function DL(t){return t>=200&&t<300}o(DL,"validateStatus");function $L(t){if(ar.sessions[t])Ya&&console.log(`Used cached client for ${t}`);else{Ya&&console.log(`Creating client for ${t}`);let e=fx.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete ar.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete ar.sessions[t]}),ar.sessions[t]={session:e}}return ar.sessions[t]}o($L,"_getClient");async function _m(t){let e=ar.sessions[t.host];if(!e)return;let{session:r}=e;delete ar.sessions[t.host],Ya&&console.error(`Closing ${t.host}`),r.close(()=>{Ya&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(Ya&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}o(_m,"closeSession")});var hx=L((qte,OL)=>{OL.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 kc=L(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.createAPIRequest=UL;var Pm=gt(),CL=gm(),Px=require("stream"),gx=cx(),yx=la(),bm=lx(),NL=mx(),wm=zc(),wx=hx(),vx=o(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function zL(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}o(zL,"isReadableStream");function kL(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}o(kL,"getMissingParams");function UL(t,e){if(e)_x(t).then(r=>e(null,r),e);else return _x(t)}o(UL,"createAPIRequest");async function _x(t){let e=yx(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=yx(!0,{},e.params,t.params);e.userAgentDirectives=e.userAgentDirectives||[];let n=r.media||{},i=r.requestBody;!r.requestBody&&r.resource&&(!t.requiredParams.includes("resource")||typeof r.resource!="string")&&(i=r.resource,delete r.resource),delete r.requestBody;let s=r.auth||e.auth,d=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let m=(0,wm.headersToClassicHeaders)(r.headers||{});ML(m,e.apiVersion),delete r.headers,Object.keys(r).forEach(w=>{if(w.slice(-1)==="_"){let S=w.slice(0,-1);r[S]=r[w],delete r[w]}});let h=kL(r,t.requiredParams);if(h)throw new Error("Missing required parameters: "+h.join(", "));if(e.url){let w=e.url;typeof w=="object"&&(w=w.toString()),e.url=gx.parse(w).expand(r)}if(t.mediaUrl&&(t.mediaUrl=gx.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let w=new URL(e.url),S=w.href.substr(w.origin.length);e.url=new URL(S,t.context._options.rootUrl).href}e.paramsSerializer=w=>CL.stringify(w,{arrayFormat:"repeat"}),t.pathParams.forEach(w=>delete r[w]),typeof s=="string"&&(r.key=r.key||s,s=void 0);function v(w){let S=vx(),D=`--${S}--`,E=new Px.PassThrough({flush(c){this.push(`\r
60
+ `),this.push(D),c()}}),u=new Tm,f=zL(w[1].body);m["content-type"]=`multipart/related; boundary=${S}`;for(let c of w){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(w){let S=px(),D=`--${S}--`;m["content-type"]=`multipart/related; boundary=${S}`;let E="";for(let u of w){let f=`--${S}\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}o(v,"multipartUpload");function _(w){let S=vx(),D=`--${S}--`;m["content-type"]=`multipart/related; boundary=${S}`;let E="";for(let u of w){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(P,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,o){r.uploadType="multipart";let w=[{"content-type":"application/json",body:JSON.stringify(o)},{"content-type":n.mimeType||o&&o.mimeType||p,body:n.body}];(0,_m.isBrowser)()?P(w):v(w)}else r.uploadType="media",Object.assign(m,{"content-type":n.mimeType||p}),e.data=n.body;else e.data=o||void 0;if(e.headers=ym.Gaxios.mergeHeaders(e.headers||{},m),e.params=r,!(0,_m.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:hx.version,comment:"gzip"});let w=e.userAgentDirectives.map(S=>{let D=`${S.product}/${S.version}`;return S.comment&&(D+=` (${S.comment})`),D}).join(" ");e.headers.set("User-Agent",w)}if(e.validateStatus||(e.validateStatus=w=>w>=200&&w<300||w===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 w=new URL(e.url);w.hostname.endsWith(".googleapis.com")&&(w.hostname=w.hostname.replace(/googleapis\.com$/,T),e.url=w.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let w=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(w&&T!==w)throw new Error(`The configured universe domain (${T}) does not match the universe domain found in the credentials (${w}). 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=ym.Gaxios.mergeHeaders(D.headers,S),vL.request(D)}else{let S=await s.request(e);return(0,vm.marshallGaxiosResponse)(S)}}else return new ym.Gaxios().request(e).then(w=>(0,vm.marshallGaxiosResponse)(w))}i(fx,"createAPIRequestAsync");var Pm=class extends mx.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 bL(t,e){(0,_m.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${hx.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}i(bL,"populateAPIHeader")});var gx=L(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.AuthPlus=void 0;var wn=La(),bm=class extends wn.GoogleAuth{static{i(this,"AuthPlus")}JWT=wn.JWT;Compute=wn.Compute;OAuth2=wn.OAuth2Client;GoogleAuth=wn.GoogleAuth;AwsClient=wn.AwsClient;IdentityPoolClient=wn.IdentityPoolClient;ExternalAccountClient=wn.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new wn.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()}};Uc.AuthPlus=bm});var Sm=L(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.Endpoint=void 0;var yx=zc(),Tm=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 p=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,p,o)}}}applyMethodsFromSchema(e,r,n,o){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let p=n.methods[s];e[s]=this.makeMethod(r,p,o)}}}makeMethod(e,r,n){return(o,s)=>{let p=typeof o=="function"?{}:o;s=typeof o=="function"?o:s;let m=vx(e.rootUrl+e.servicePath+r.path),h={options:{url:m.substring(1,m.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:p,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=vx(e.rootUrl+r.mediaUpload.protocols.simple.path);h.mediaUrl=v.substring(1,v.length-1)}if(!s)return(0,yx.createAPIRequest)(h);(0,yx.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}};Mc.Endpoint=Tm;function vx(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}i(vx,"buildurl")});var Px=L(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.Discovery=void 0;var TL=require("fs"),SL=ht(),xL=require("url"),_x=require("util"),EL=zc(),IL=Sm(),AL=_x.promisify(TL.readFile),xm=class{static{i(this,"Discovery")}transporter=new SL.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new IL.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}})),p={},m={};for(let h of s)m[h.api.name]||(p[h.api.name]={},m[h.api.name]=v=>{let P=typeof v,x;if(P==="string")x=v,v={};else if(P==="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(_x.format('Unable to load endpoint %s("%s"): %s',h.api.name,x,T.message))}}),p[h.api.name][h.api.version]=h.endpointCreator;return m}async discoverAPI(e){if(typeof e=="string"){let r=xL.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await AL(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,EL.createAPIRequest)(o);return this.makeEndpoint(s.data)}}};Fc.Discovery=xm});var Ya=L($e=>{"use strict";var RL=$e&&$e.__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]})),DL=$e&&$e.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&RL(e,t,r)};Object.defineProperty($e,"__esModule",{value:!0});$e.Endpoint=$e.Discovery=$e.AuthPlus=$e.createAPIRequest=$e.getAPI=$e.GaxiosError=$e.Gaxios=$e.AwsClient=$e.IdentityPoolClient=$e.BaseExternalAccountClient=$e.ExternalAccountClient=$e.GoogleAuth=$e.UserRefreshClient=$e.Compute=$e.JWT=$e.OAuth2Client=$e.gaxios=$e.googleAuthLibrary=void 0;$e.googleAuthLibrary=La();$e.gaxios=ht();var bn=La();Object.defineProperty($e,"OAuth2Client",{enumerable:!0,get:i(function(){return bn.OAuth2Client},"get")});Object.defineProperty($e,"JWT",{enumerable:!0,get:i(function(){return bn.JWT},"get")});Object.defineProperty($e,"Compute",{enumerable:!0,get:i(function(){return bn.Compute},"get")});Object.defineProperty($e,"UserRefreshClient",{enumerable:!0,get:i(function(){return bn.UserRefreshClient},"get")});Object.defineProperty($e,"GoogleAuth",{enumerable:!0,get:i(function(){return bn.GoogleAuth},"get")});Object.defineProperty($e,"ExternalAccountClient",{enumerable:!0,get:i(function(){return bn.ExternalAccountClient},"get")});Object.defineProperty($e,"BaseExternalAccountClient",{enumerable:!0,get:i(function(){return bn.BaseExternalAccountClient},"get")});Object.defineProperty($e,"IdentityPoolClient",{enumerable:!0,get:i(function(){return bn.IdentityPoolClient},"get")});Object.defineProperty($e,"AwsClient",{enumerable:!0,get:i(function(){return bn.AwsClient},"get")});var wx=ht();Object.defineProperty($e,"Gaxios",{enumerable:!0,get:i(function(){return wx.Gaxios},"get")});Object.defineProperty($e,"GaxiosError",{enumerable:!0,get:i(function(){return wx.GaxiosError},"get")});var $L=dS();Object.defineProperty($e,"getAPI",{enumerable:!0,get:i(function(){return $L.getAPI},"get")});var OL=zc();Object.defineProperty($e,"createAPIRequest",{enumerable:!0,get:i(function(){return OL.createAPIRequest},"get")});var CL=gx();Object.defineProperty($e,"AuthPlus",{enumerable:!0,get:i(function(){return CL.AuthPlus},"get")});var NL=Px();Object.defineProperty($e,"Discovery",{enumerable:!0,get:i(function(){return NL.Discovery},"get")});var kL=Sm();Object.defineProperty($e,"Endpoint",{enumerable:!0,get:i(function(){return kL.Endpoint},"get")});DL(kc(),$e)});var Tx=L(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.drive_v2=void 0;var B=Ya(),bx;(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 p(this.context),this.comments=new m(this.context),this.drives=new h(this.context),this.files=new v(this.context),this.parents=new P(this.context),this.permissions=new x(this.context),this.properties=new T(this.context),this.replies=new w(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 p{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=p;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 P{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=P;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 w{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=w;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})(bx||(Lc.drive_v2=bx={}))});var xx=L(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.drive_v3=void 0;var W=Ya(),Sx;(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 p(this.context),this.channels=new m(this.context),this.comments=new h(this.context),this.drives=new v(this.context),this.files=new P(this.context),this.operations=new x(this.context),this.permissions=new T(this.context),this.replies=new w(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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Apps=s;class p{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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Changes=p;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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Drives=v;class P{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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Files=P;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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Permissions=T;class w{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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Replies=w;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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.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,W.createAPIRequest)(g,c);else return(0,W.createAPIRequest)(g)}}t.Resource$Teamdrives=D})(Sx||(jc.drive_v3=Sx={}))});var Ae=L(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.AuthPlus=qt.drive_v3=qt.drive_v2=qt.auth=qt.VERSIONS=void 0;qt.drive=zL;var Ex=Ya(),Ix=Tx();Object.defineProperty(qt,"drive_v2",{enumerable:!0,get:i(function(){return Ix.drive_v2},"get")});var Ax=xx();Object.defineProperty(qt,"drive_v3",{enumerable:!0,get:i(function(){return Ax.drive_v3},"get")});qt.VERSIONS={v2:Ix.drive_v2.Drive,v3:Ax.drive_v3.Drive};function zL(t){return(0,Ex.getAPI)("drive",t,qt.VERSIONS,this)}i(zL,"drive");var UL=new Ex.AuthPlus;qt.auth=UL;var ML=Ya();Object.defineProperty(qt,"AuthPlus",{enumerable:!0,get:i(function(){return ML.AuthPlus},"get")})});var qc=L((Em,Im)=>{(function(t,e){typeof Em=="object"&&typeof Im<"u"?Im.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Em,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",o="second",s="minute",p="hour",m="day",h="week",v="month",P="quarter",x="year",T="date",w="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 Y=["th","st","nd","rd"],K=se%100;return"["+se+(Y[(K-20)%10]||Y[K]||Y[0])+"]"},"ordinal")},u=i(function(se,Y,K){var re=String(se);return!re||re.length>=Y?se:""+Array(Y+1-re.length).join(K)+se},"m"),f={s:u,z:i(function(se){var Y=-se.utcOffset(),K=Math.abs(Y),re=Math.floor(K/60),te=K%60;return(Y<=0?"+":"-")+u(re,2,"0")+":"+u(te,2,"0")},"z"),m:i(function se(Y,K){if(Y.date()<K.date())return-se(K,Y);var re=12*(K.year()-Y.year())+(K.month()-Y.month()),te=Y.clone().add(re,v),ce=K-te<0,de=Y.clone().add(re+(ce?-1:1),v);return+(-(re+(K-te)/(ce?te-de:de-te))||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:p,m:s,s:o,ms:n,Q:P}[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 ne},"p"),b=i(function se(Y,K,re){var te;if(!Y)return c;if(typeof Y=="string"){var ce=Y.toLowerCase();y[ce]&&(te=ce),K&&(y[ce]=K,te=ce);var de=Y.split("-");if(!te&&de.length>1)return se(de[0])}else{var Oe=Y.name;y[Oe]=Y,te=Oe}return!re&&te&&(c=te),te||!re&&c},"t"),g=i(function(se,Y){if(l(se))return se.clone();var K=typeof Y=="object"?Y:{};return K.date=se,K.args=arguments,new ne(K)},"w"),oe=f;oe.l=b,oe.i=l,oe.w=function(se,Y){return g(se,{locale:Y.$L,utc:Y.$u,x:Y.$x,$offset:Y.$offset})};var ne=(function(){function se(K){this.$L=b(K.locale,null,!0),this.parse(K)}i(se,"M");var Y=se.prototype;return Y.parse=function(K){this.$d=(function(re){var te=re.date,ce=re.utc;if(te===null)return new Date(NaN);if(oe.u(te))return new Date;if(te instanceof Date)return new Date(te);if(typeof te=="string"&&!/Z$/i.test(te)){var de=te.match(S);if(de){var Oe=de[2]-1||0,ze=(de[7]||"0").substring(0,3);return ce?new Date(Date.UTC(de[1],Oe,de[3]||1,de[4]||0,de[5]||0,de[6]||0,ze)):new Date(de[1],Oe,de[3]||1,de[4]||0,de[5]||0,de[6]||0,ze)}}return new Date(te)})(K),this.$x=K.x||{},this.init()},Y.init=function(){var K=this.$d;this.$y=K.getFullYear(),this.$M=K.getMonth(),this.$D=K.getDate(),this.$W=K.getDay(),this.$H=K.getHours(),this.$m=K.getMinutes(),this.$s=K.getSeconds(),this.$ms=K.getMilliseconds()},Y.$utils=function(){return oe},Y.isValid=function(){return this.$d.toString()!==w},Y.isSame=function(K,re){var te=g(K);return this.startOf(re)<=te&&te<=this.endOf(re)},Y.isAfter=function(K,re){return g(K)<this.startOf(re)},Y.isBefore=function(K,re){return this.endOf(re)<g(K)},Y.$g=function(K,re,te){return oe.u(K)?this[re]:this.set(te,K)},Y.unix=function(){return Math.floor(this.valueOf()/1e3)},Y.valueOf=function(){return this.$d.getTime()},Y.startOf=function(K,re){var te=this,ce=!!oe.u(re)||re,de=oe.p(K),Oe=i(function(Vt,Ze){var Je=oe.w(te.$u?Date.UTC(te.$y,Ze,Vt):new Date(te.$y,Ze,Vt),te);return ce?Je:Je.endOf(m)},"l"),ze=i(function(Vt,Ze){return oe.w(te.toDate()[Vt].apply(te.toDate("s"),(ce?[0,0,0,0]:[23,59,59,999]).slice(Ze)),te)},"$"),Ke=this.$W,Qe=this.$M,Tt=this.$D,ie="set"+(this.$u?"UTC":"");switch(de){case x:return ce?Oe(1,0):Oe(31,11);case v:return ce?Oe(1,Qe):Oe(0,Qe+1);case h:var ut=this.$locale().weekStart||0,ft=(Ke<ut?Ke+7:Ke)-ut;return Oe(ce?Tt-ft:Tt+(6-ft),Qe);case m:case T:return ze(ie+"Hours",0);case p:return ze(ie+"Minutes",1);case s:return ze(ie+"Seconds",2);case o:return ze(ie+"Milliseconds",3);default:return this.clone()}},Y.endOf=function(K){return this.startOf(K,!1)},Y.$set=function(K,re){var te,ce=oe.p(K),de="set"+(this.$u?"UTC":""),Oe=(te={},te[m]=de+"Date",te[T]=de+"Date",te[v]=de+"Month",te[x]=de+"FullYear",te[p]=de+"Hours",te[s]=de+"Minutes",te[o]=de+"Seconds",te[n]=de+"Milliseconds",te)[ce],ze=ce===m?this.$D+(re-this.$W):re;if(ce===v||ce===x){var Ke=this.clone().set(T,1);Ke.$d[Oe](ze),Ke.init(),this.$d=Ke.set(T,Math.min(this.$D,Ke.daysInMonth())).$d}else Oe&&this.$d[Oe](ze);return this.init(),this},Y.set=function(K,re){return this.clone().$set(K,re)},Y.get=function(K){return this[oe.p(K)]()},Y.add=function(K,re){var te,ce=this;K=Number(K);var de=oe.p(re),Oe=i(function(Qe){var Tt=g(ce);return oe.w(Tt.date(Tt.date()+Math.round(Qe*K)),ce)},"y");if(de===v)return this.set(v,this.$M+K);if(de===x)return this.set(x,this.$y+K);if(de===m)return Oe(1);if(de===h)return Oe(7);var ze=(te={},te[s]=e,te[p]=r,te[o]=t,te)[de]||1,Ke=this.$d.getTime()+K*ze;return oe.w(Ke,this)},Y.subtract=function(K,re){return this.add(-1*K,re)},Y.format=function(K){var re=this,te=this.$locale();if(!this.isValid())return te.invalidDate||w;var ce=K||"YYYY-MM-DDTHH:mm:ssZ",de=oe.z(this),Oe=this.$H,ze=this.$m,Ke=this.$M,Qe=te.weekdays,Tt=te.months,ie=te.meridiem,ut=i(function(Ze,Je,I,$){return Ze&&(Ze[Je]||Ze(re,ce))||I[Je].slice(0,$)},"h"),ft=i(function(Ze){return oe.s(Oe%12||12,Ze,"0")},"d"),Vt=ie||function(Ze,Je,I){var $=Ze<12?"AM":"PM";return I?$.toLowerCase():$};return ce.replace(D,(function(Ze,Je){return Je||(function(I){switch(I){case"YY":return String(re.$y).slice(-2);case"YYYY":return oe.s(re.$y,4,"0");case"M":return Ke+1;case"MM":return oe.s(Ke+1,2,"0");case"MMM":return ut(te.monthsShort,Ke,Tt,3);case"MMMM":return ut(Tt,Ke);case"D":return re.$D;case"DD":return oe.s(re.$D,2,"0");case"d":return String(re.$W);case"dd":return ut(te.weekdaysMin,re.$W,Qe,2);case"ddd":return ut(te.weekdaysShort,re.$W,Qe,3);case"dddd":return Qe[re.$W];case"H":return String(Oe);case"HH":return oe.s(Oe,2,"0");case"h":return ft(1);case"hh":return ft(2);case"a":return Vt(Oe,ze,!0);case"A":return Vt(Oe,ze,!1);case"m":return String(ze);case"mm":return oe.s(ze,2,"0");case"s":return String(re.$s);case"ss":return oe.s(re.$s,2,"0");case"SSS":return oe.s(re.$ms,3,"0");case"Z":return de}return null})(Ze)||de.replace(":","")}))},Y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Y.diff=function(K,re,te){var ce,de=this,Oe=oe.p(re),ze=g(K),Ke=(ze.utcOffset()-this.utcOffset())*e,Qe=this-ze,Tt=i(function(){return oe.m(de,ze)},"D");switch(Oe){case x:ce=Tt()/12;break;case v:ce=Tt();break;case P:ce=Tt()/3;break;case h:ce=(Qe-Ke)/6048e5;break;case m:ce=(Qe-Ke)/864e5;break;case p:ce=Qe/r;break;case s:ce=Qe/e;break;case o:ce=Qe/t;break;default:ce=Qe}return te?ce:oe.a(ce)},Y.daysInMonth=function(){return this.endOf(v).$D},Y.$locale=function(){return y[this.$L]},Y.locale=function(K,re){if(!K)return this.$L;var te=this.clone(),ce=b(K,re,!0);return ce&&(te.$L=ce),te},Y.clone=function(){return oe.w(this.$d,this)},Y.toDate=function(){return new Date(this.valueOf())},Y.toJSON=function(){return this.isValid()?this.toISOString():null},Y.toISOString=function(){return this.$d.toISOString()},Y.toString=function(){return this.$d.toUTCString()},se})(),Re=ne.prototype;return g.prototype=Re,[["$ms",n],["$s",o],["$m",s],["$H",p],["$W",m],["$M",v],["$y",x],["$D",T]].forEach((function(se){Re[se[1]]=function(Y){return this.$g(Y,se[0],se[1])}})),g.extend=function(se,Y){return se.$i||(se(Y,ne,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 VL={};xs(VL,{createGoogleClient:()=>ae,getAccessToken:()=>pt,googleDrive:()=>BL,googleDriveAuth:()=>J});module.exports=P0(VL);var w0=Object.freeze({status:"aborted"});function fe(t,e,r){function n(m,h){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:h,constr:p,traits:new Set},enumerable:!1}),m._zod.traits.has(t))return;m._zod.traits.add(t),e(m,h);let v=p.prototype,P=Object.keys(v);for(let x=0;x<P.length;x++){let T=P[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 p(m){var h;let v=r?.Parent?new s:this;n(v,m),(h=v._zod).deferred??(h.deferred=[]);for(let P of v._zod.deferred)P();return v}return i(p,"_"),Object.defineProperty(p,"init",{value:n}),Object.defineProperty(p,Symbol.hasInstance,{value:i(m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(t),"value")}),Object.defineProperty(p,"name",{value:t}),p}i(fe,"$constructor");var Cr=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Es=class extends Error{static{i(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},_l={};function sn(t){return t&&Object.assign(_l,t),_l}i(sn,"config");function wl(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(wl,"getEnumValues");function zh(t,e){return typeof e=="bigint"?e.toString():e}i(zh,"jsonStringifyReplacer");function As(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(As,"cached");function Uh(t){return t==null}i(Uh,"nullish");function Rs(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}i(Rs,"cleanRegex");var kh=Symbol("evaluating");function gt(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==kh)return n===void 0&&(n=kh,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}i(gt,"defineLazy");var bl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Uo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}i(Uo,"isObject");var b0=As(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Mh(t){if(Uo(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Uo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(Mh,"isPlainObject");var Fh=new Set(["string","number","symbol"]);function Mi(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Mi,"escapeRegex");function Ds(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}i(Ds,"clone");function ot(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(ot,"normalizeParams");function Lh(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}i(Lh,"optionalKeys");var jh={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 $n(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}i($n,"prefixIssues");function Is(t){return typeof t=="string"?t:t?.message}i(Is,"unwrapMessage");function On(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=Is(t.inst?._zod.def?.error?.(t))??Is(e?.error?.(t))??Is(r.customError?.(t))??Is(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}i(On,"finalizeIssue");function qh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}i(qh,"getLengthableOrigin");function Tl(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}i(Tl,"issue");var Bh=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,zh,2),Object.defineProperty(t,"toString",{value:i(()=>t.message,"value"),enumerable:!1})},"initializer"),Vh=fe("$ZodError",Bh),Mo=fe("$ZodError",Bh,{Parent:Error});var S0=i(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},p=e._zod.run({value:r,issues:[]},s);if(p instanceof Promise)throw new Cr;if(p.issues.length){let m=new(o?.Err??t)(p.issues.map(h=>On(h,s,sn())));throw bl(m,o?.callee),m}return p.value},"_parse"),$s=S0(Mo),x0=i(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},p=e._zod.run({value:r,issues:[]},s);if(p instanceof Promise&&(p=await p),p.issues.length){let m=new(o?.Err??t)(p.issues.map(h=>On(h,s,sn())));throw bl(m,o?.callee),m}return p.value},"_parseAsync"),Os=x0(Mo),E0=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 Cr;return s.issues.length?{success:!1,error:new(t??Vh)(s.issues.map(p=>On(p,o,sn())))}:{success:!0,data:s.value}},"_safeParse"),Fo=E0(Mo),I0=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(p=>On(p,o,sn())))}:{success:!0,data:s.value}},"_safeParseAsync"),Lo=I0(Mo);var A0="(?:(?:\\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])))",R0=new RegExp(`^${A0}$`);var Gh=i(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Hh=/^-?\d+n?$/,Wh=/^-?\d+$/,Sl=/^-?\d+(?:\.\d+)?$/,Zh=/^(?:true|false)$/i;var Cn=fe("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),D0={number:"number",bigint:"bigint",object:"date"};var Kh=fe("$ZodCheckGreaterThan",(t,e)=>{Cn.init(t,e);let r=D0[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 Jh=fe("$ZodCheckNumberFormat",(t,e)=>{Cn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=jh[e.format];t._zod.onattach.push(p=>{let m=p._zod.bag;m.format=e.format,m.minimum=o,m.maximum=s,r&&(m.pattern=Wh)}),t._zod.check=p=>{let m=p.value;if(r){if(!Number.isInteger(m)){p.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:m,inst:t});return}if(!Number.isSafeInteger(m)){m>0?p.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}):p.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&&p.issues.push({origin:"number",input:m,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),m>s&&p.issues.push({origin:"number",input:m,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var Yh=fe("$ZodCheckMinLength",(t,e)=>{var r;Cn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Uh(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 p=qh(o);n.issues.push({origin:p,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}});var xl=fe("$ZodCheckStringFormat",(t,e)=>{var r,n;Cn.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=()=>{})}),Xh=fe("$ZodCheckRegex",(t,e)=>{xl.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 eg={major:4,minor:3,patch:6};var ct=fe("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=eg;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((p,m,h)=>{let v=Fi(p),P;for(let x of m){if(x._zod.def.when){if(!x._zod.def.when(p))continue}else if(v)continue;let T=p.issues.length,w=x._zod.check(p);if(w instanceof Promise&&h?.async===!1)throw new Cr;if(P||w instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await w,p.issues.length!==T&&(v||(v=Fi(p,T)))});else{if(p.issues.length===T)continue;v||(v=Fi(p,T))}}return P?P.then(()=>p):p},"runChecks"),s=i((p,m,h)=>{if(Fi(p))return p.aborted=!0,p;let v=o(m,n,h);if(v instanceof Promise){if(h.async===!1)throw new Cr;return v.then(P=>t._zod.parse(P,h))}return t._zod.parse(v,h)},"handleCanaryResult");t._zod.run=(p,m)=>{if(m.skipChecks)return t._zod.parse(p,m);if(m.direction==="backward"){let v=t._zod.parse({value:p.value,issues:[]},{...m,skipChecks:!0});return v instanceof Promise?v.then(P=>s(P,p,m)):s(v,p,m)}let h=t._zod.parse(p,m);if(h instanceof Promise){if(m.async===!1)throw new Cr;return h.then(v=>o(v,n,m))}return o(h,n,m)}}gt(t,"~standard",()=>({validate:i(o=>{try{let s=Fo(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Lo(t,o).then(p=>p.success?{value:p.data}:{issues:p.error?.issues})}},"validate"),vendor:"zod",version:1}))}),ks=fe("$ZodString",(t,e)=>{ct.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Gh(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}}),El=fe("$ZodStringFormat",(t,e)=>{xl.init(t,e),ks.init(t,e)});var og=fe("$ZodURL",(t,e)=>{El.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 Il=fe("$ZodNumber",(t,e)=>{ct.init(t,e),t._zod.pattern=t._zod.bag.pattern??Sl,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}}),ag=fe("$ZodNumberFormat",(t,e)=>{Jh.init(t,e),Il.init(t,e)}),Al=fe("$ZodBoolean",(t,e)=>{ct.init(t,e),t._zod.pattern=Zh,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}}),sg=fe("$ZodBigInt",(t,e)=>{ct.init(t,e),t._zod.pattern=Hh,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 ug=fe("$ZodAny",(t,e)=>{ct.init(t,e),t._zod.parse=r=>r}),cg=fe("$ZodUnknown",(t,e)=>{ct.init(t,e),t._zod.parse=r=>r});var lg=fe("$ZodVoid",(t,e)=>{ct.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}}),dg=fe("$ZodDate",(t,e)=>{ct.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 tg(t,e,r){t.issues.length&&e.issues.push(...$n(r,t.issues)),e.value[r]=t.value}i(tg,"handleArrayResult");var pg=fe("$ZodArray",(t,e)=>{ct.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 p=0;p<o.length;p++){let m=o[p],h=e.element._zod.run({value:m,issues:[]},n);h instanceof Promise?s.push(h.then(v=>tg(v,r,p))):tg(h,r,p)}return s.length?Promise.all(s).then(()=>r):r}});function Ns(t,e,r,n,o){if(t.issues.length){if(o&&!(r in n))return;e.issues.push(...$n(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}i(Ns,"handlePropertyResult");function $0(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=Lh(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}i($0,"normalizeDef");function O0(t,e,r,n,o,s){let p=[],m=o.keySet,h=o.catchall._zod,v=h.def.type,P=h.optout==="optional";for(let x in e){if(m.has(x))continue;if(v==="never"){p.push(x);continue}let T=h.run({value:e[x],issues:[]},n);T instanceof Promise?t.push(T.then(w=>Ns(w,r,x,e,P))):Ns(T,r,x,e,P)}return p.length&&r.issues.push({code:"unrecognized_keys",keys:p,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}i(O0,"handleCatchall");var fg=fe("$ZodObject",(t,e)=>{if(ct.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=As(()=>$0(e));gt(t._zod,"propValues",()=>{let m=e.shape,h={};for(let v in m){let P=m[v]._zod;if(P.values){h[v]??(h[v]=new Set);for(let x of P.values)h[v].add(x)}}return h});let o=Uo,s=e.catchall,p;t._zod.parse=(m,h)=>{p??(p=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 P=[],x=p.shape;for(let T of p.keys){let w=x[T],S=w._zod.optout==="optional",D=w._zod.run({value:v[T],issues:[]},h);D instanceof Promise?P.push(D.then(E=>Ns(E,m,T,v,S))):Ns(D,m,T,v,S)}return s?O0(P,v,m,h,n.value,t):P.length?Promise.all(P).then(()=>m):m}});function rg(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(p=>On(p,n,sn())))}),e)}i(rg,"handleUnionResults");var Rl=fe("$ZodUnion",(t,e)=>{ct.init(t,e),gt(t._zod,"optin",()=>e.options.some(o=>o._zod.optin==="optional")?"optional":void 0),gt(t._zod,"optout",()=>e.options.some(o=>o._zod.optout==="optional")?"optional":void 0),gt(t._zod,"values",()=>{if(e.options.every(o=>o._zod.values))return new Set(e.options.flatMap(o=>Array.from(o._zod.values)))}),gt(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=>Rs(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 p=!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),p=!0;else{if(v.issues.length===0)return v;m.push(v)}}return p?Promise.all(m).then(h=>rg(h,o,t,s)):rg(m,o,t,s)}});var mg=fe("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Rl.init(t,e);let r=t._zod.parse;gt(t._zod,"propValues",()=>{let o={};for(let s of e.options){let p=s._zod.propValues;if(!p||Object.keys(p).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[m,h]of Object.entries(p)){o[m]||(o[m]=new Set);for(let v of h)o[m].add(v)}}return o});let n=As(()=>{let o=e.options,s=new Map;for(let p of o){let m=p._zod.propValues?.[e.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(p)}"`);for(let h of m){if(s.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);s.set(h,p)}}return s});t._zod.parse=(o,s)=>{let p=o.value;if(!Uo(p))return o.issues.push({code:"invalid_type",expected:"object",input:p,inst:t}),o;let m=n.value.get(p?.[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:p,path:[e.discriminator],inst:t}),o)}});var hg=fe("$ZodRecord",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Mh(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[],p=e.keyType._zod.values;if(p){r.value={};let m=new Set;for(let v of p)if(typeof v=="string"||typeof v=="number"||typeof v=="symbol"){m.add(typeof v=="number"?v.toString():v);let P=e.valueType._zod.run({value:o[v],issues:[]},n);P instanceof Promise?s.push(P.then(x=>{x.issues.length&&r.issues.push(...$n(v,x.issues)),r.value[v]=x.value})):(P.issues.length&&r.issues.push(...$n(v,P.issues)),r.value[v]=P.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"&&Sl.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=>On(x,n,sn())),input:m,path:[m],inst:t});continue}let P=e.valueType._zod.run({value:o[m],issues:[]},n);P instanceof Promise?s.push(P.then(x=>{x.issues.length&&r.issues.push(...$n(m,x.issues)),r.value[h.value]=x.value})):(P.issues.length&&r.issues.push(...$n(m,P.issues)),r.value[h.value]=P.value)}}return s.length?Promise.all(s).then(()=>r):r}});var gg=fe("$ZodEnum",(t,e)=>{ct.init(t,e);let r=wl(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>Fh.has(typeof o)).map(o=>typeof o=="string"?Mi(o):o.toString()).join("|")})$`),t._zod.parse=(o,s)=>{let p=o.value;return n.has(p)||o.issues.push({code:"invalid_value",values:r,input:p,inst:t}),o}}),yg=fe("$ZodLiteral",(t,e)=>{if(ct.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 vg=fe("$ZodTransform",(t,e)=>{ct.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Es(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(p=>(r.value=p,r));if(o instanceof Promise)throw new Cr;return r.value=o,r}});function ng(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}i(ng,"handleOptionalResult");var _g=fe("$ZodOptional",(t,e)=>{ct.init(t,e),t._zod.optin="optional",t._zod.optout="optional",gt(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),gt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rs(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=>ng(s,r.value)):ng(o,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var Pg=fe("$ZodNullable",(t,e)=>{ct.init(t,e),gt(t._zod,"optin",()=>e.innerType._zod.optin),gt(t._zod,"optout",()=>e.innerType._zod.optout),gt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Rs(r.source)}|null)$`):void 0}),gt(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 wg=fe("$ZodPipe",(t,e)=>{ct.init(t,e),gt(t._zod,"values",()=>e.in._zod.values),gt(t._zod,"optin",()=>e.in._zod.optin),gt(t._zod,"optout",()=>e.out._zod.optout),gt(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(p=>Cs(p,e.in,n)):Cs(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Cs(s,e.out,n)):Cs(o,e.out,n)}});function Cs(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}i(Cs,"handlePipeResult");var bg=fe("$ZodCustom",(t,e)=>{Cn.init(t,e),ct.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=>ig(s,r,n,t));ig(o,r,n,t)}});function ig(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(Tl(o))}}i(ig,"handleRefineResult");var Sg;var Dl=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 xg(){return new Dl}i(xg,"registry");(Sg=globalThis).__zod_globalRegistry??(Sg.__zod_globalRegistry=xg());var $l=globalThis.__zod_globalRegistry;function Eg(t,e){return new t({type:"string",...ot(e)})}i(Eg,"_string");function Ig(t,e){return new t({type:"string",coerce:!0,...ot(e)})}i(Ig,"_coercedString");function Ag(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...ot(e)})}i(Ag,"_url");function Rg(t,e){return new t({type:"number",checks:[],...ot(e)})}i(Rg,"_number");function Dg(t,e){return new t({type:"number",coerce:!0,checks:[],...ot(e)})}i(Dg,"_coercedNumber");function $g(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...ot(e)})}i($g,"_int");function Og(t,e){return new t({type:"boolean",...ot(e)})}i(Og,"_boolean");function Cg(t,e){return new t({type:"boolean",coerce:!0,...ot(e)})}i(Cg,"_coercedBoolean");function Ng(t,e){return new t({type:"bigint",coerce:!0,...ot(e)})}i(Ng,"_coercedBigint");function kg(t){return new t({type:"any"})}i(kg,"_any");function zg(t){return new t({type:"unknown"})}i(zg,"_unknown");function Ug(t,e){return new t({type:"void",...ot(e)})}i(Ug,"_void");function Mg(t,e){return new t({type:"date",coerce:!0,...ot(e)})}i(Mg,"_coercedDate");function zs(t,e){return new Kh({check:"greater_than",...ot(e),value:t,inclusive:!0})}i(zs,"_gte");function wr(t,e){return new Yh({check:"min_length",...ot(e),minimum:t})}i(wr,"_minLength");function Nn(t,e){return new Xh({check:"string_format",format:"regex",...ot(e),pattern:t})}i(Nn,"_regex");function Fg(t,e,r){let n=ot(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}i(Fg,"_custom");var yt=fe("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");ct.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>$s(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Fo(t,r,n),t.parseAsync=async(r,n)=>Os(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Lo(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)=>Ds(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),Ms=fe("ZodMiniString",(t,e)=>{ks.init(t,e),yt.init(t,e)});function A(t){return Eg(Ms,t)}i(A,"string");var Lg=fe("ZodMiniStringFormat",(t,e)=>{El.init(t,e),Ms.init(t,e)});var G0=fe("ZodMiniURL",(t,e)=>{og.init(t,e),Lg.init(t,e)});function jg(t){return Ag(G0,t)}i(jg,"url");var Fs=fe("ZodMiniNumber",(t,e)=>{Il.init(t,e),yt.init(t,e)});function Ct(t){return Rg(Fs,t)}i(Ct,"number");var H0=fe("ZodMiniNumberFormat",(t,e)=>{ag.init(t,e),Fs.init(t,e)});function qg(t){return $g(H0,t)}i(qg,"int");var Ol=fe("ZodMiniBoolean",(t,e)=>{Al.init(t,e),yt.init(t,e)});function Ge(t){return Og(Ol,t)}i(Ge,"boolean");var Bg=fe("ZodMiniBigInt",(t,e)=>{sg.init(t,e),yt.init(t,e)});var W0=fe("ZodMiniAny",(t,e)=>{ug.init(t,e),yt.init(t,e)});function qo(){return kg(W0)}i(qo,"any");var Z0=fe("ZodMiniUnknown",(t,e)=>{cg.init(t,e),yt.init(t,e)});function xe(){return zg(Z0)}i(xe,"unknown");var K0=fe("ZodMiniVoid",(t,e)=>{lg.init(t,e),yt.init(t,e)});function Vg(t){return Ug(K0,t)}i(Vg,"_void");var Gg=fe("ZodMiniDate",(t,e)=>{dg.init(t,e),yt.init(t,e)});var J0=fe("ZodMiniArray",(t,e)=>{pg.init(t,e),yt.init(t,e)});function Ce(t,e){return new J0({type:"array",element:t,...ot(e)})}i(Ce,"array");var Y0=fe("ZodMiniObject",(t,e)=>{fg.init(t,e),yt.init(t,e),gt(t,"shape",()=>e.shape)});function M(t,e){let r={type:"object",shape:t??{},...ot(e)};return new Y0(r)}i(M,"object");var X0=fe("ZodMiniUnion",(t,e)=>{Rl.init(t,e),yt.init(t,e)});function Ne(t,e){return new X0({type:"union",options:t,...ot(e)})}i(Ne,"union");var Q0=fe("ZodMiniDiscriminatedUnion",(t,e)=>{mg.init(t,e),yt.init(t,e)});function kn(t,e,r){return new Q0({type:"union",options:e,discriminator:t,...ot(r)})}i(kn,"discriminatedUnion");var eD=fe("ZodMiniRecord",(t,e)=>{hg.init(t,e),yt.init(t,e)});function Ee(t,e,r){return new eD({type:"record",keyType:t,valueType:e,...ot(r)})}i(Ee,"record");var tD=fe("ZodMiniEnum",(t,e)=>{gg.init(t,e),yt.init(t,e),t.options=Object.values(e.entries)});function Me(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new tD({type:"enum",entries:r,...ot(e)})}i(Me,"_enum");var rD=fe("ZodMiniLiteral",(t,e)=>{yg.init(t,e),yt.init(t,e)});function _e(t,e){return new rD({type:"literal",values:Array.isArray(t)?t:[t],...ot(e)})}i(_e,"literal");var nD=fe("ZodMiniTransform",(t,e)=>{vg.init(t,e),yt.init(t,e)});function zn(t){return new nD({type:"transform",transform:t})}i(zn,"transform");var iD=fe("ZodMiniOptional",(t,e)=>{_g.init(t,e),yt.init(t,e)});function Q(t){return new iD({type:"optional",innerType:t})}i(Q,"optional");var oD=fe("ZodMiniNullable",(t,e)=>{Pg.init(t,e),yt.init(t,e)});function Bo(t){return new oD({type:"nullable",innerType:t})}i(Bo,"nullable");var aD=fe("ZodMiniPipe",(t,e)=>{wg.init(t,e),yt.init(t,e)});function Un(t,e){return new aD({type:"pipe",in:t,out:e})}i(Un,"pipe");var sD=fe("ZodMiniCustom",(t,e)=>{bg.init(t,e),yt.init(t,e)});function Ls(t,e){return Fg(sD,t??(()=>!0),e)}i(Ls,"custom");var Vo={};xs(Vo,{bigint:()=>fD,boolean:()=>pD,date:()=>mD,number:()=>dD,string:()=>lD});function lD(t){return Ig(Ms,t)}i(lD,"string");function dD(t){return Dg(Fs,t)}i(dD,"number");function pD(t){return Cg(Ol,t)}i(pD,"boolean");function fD(t){return Ng(Bg,t)}i(fD,"bigint");function mD(t){return Mg(Gg,t)}i(mD,"date");var Nl=M({retryOnFailure:M({defaultValue:Q(Ge()),hide:Q(Ge())}),continueOnFailure:M({defaultValue:Q(Ge()),hide:Q(Ge())})}),Cl=class{constructor(e,r,n,o,s,p,m,h,v,P,x){this.name=e;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=p;this.requireAuth=m;this.errorHandlingOptions=h;this.outputSchema=v;this.audience=P;this.aiMetadata=x}static{i(this,"IAction")}},ee=i(t=>new Cl(t.name,t.displayName,t.description,t.props,t.run,t.test??t.run,t.requireAuth??!0,t.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},t.outputSchema,t.audience,t.aiMetadata),"createAction");var He=M({displayName:A(),description:Q(A())}),ke=i((t,e)=>M({type:_e(e),required:Ge(),defaultValue:Q(qo())}),"TPropertyValue");var Wt=M({...He.shape,...ke(A(),"SHORT_TEXT").shape}),un=M({...He.shape,...ke(A(),"LONG_TEXT").shape});var Wg=M({label:A(),value:xe()}),js=M({disabled:Q(Ge()),placeholder:Q(A()),options:Ce(Wg)});var Zt=M({...He.shape,options:js,...ke(xe(),"STATIC_DROPDOWN").shape}),cn=M({...He.shape,options:js,...ke(Ce(xe()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var kl=M({...He.shape,...ke(xe(),"DROPDOWN").shape,refreshers:Ce(A())}),Go=M({...He.shape,...ke(Ce(xe()),"MULTI_SELECT_DROPDOWN").shape,refreshers:Ce(A())});var ln=M({...He.shape,...ke(Ge(),"CHECKBOX").shape});var dn=M({...He.shape,...ke(Ct(),"NUMBER").shape});var Ho=M({...He.shape,streaming:Q(Ge()),...ke(xe(),"FILE").shape});var Wo=M({...He.shape,...ke(A(),"DATE_TIME").shape});var Zg=Ee(A(),Ne([Wt,un,Zt,Go,cn,ln,dn,Ho,Wo])),Zo=M({...He.shape,properties:Zg,...ke(Ce(xe()),"ARRAY").shape});var Ko=M({...He.shape,...ke(Ne([Ee(A(),xe())]),"JSON").shape});var Kg=Ne([Wt,Zt,Ko,Zo,cn]),gD=Ee(A(),Kg),zl=M({refreshers:Ce(A()),...He.shape,...ke(xe(),"DYNAMIC").shape});var qs=M({...He.shape,...ke(Vg(),"MARKDOWN").shape});var Jo=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Jo||{}),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 Yo=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Yo||{}),Ul="both_client_credentials_and_authorization_code";var pn=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(pn||{}),Xo=(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))(Xo||{}),yD=M({strategy:Me(Xo),paramName:Q(A())}),Qo=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Qo||{});var Bs=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Bs||{}),Jg=M({status:Q(Ct()),body:Q(xe()),headers:Q(Ee(A(),A()))}),Yg=M({type:_e("DELAY"),resumeDateTime:A(),requestIdToReply:Q(A()),handlerId:Q(A()),streamStepProgress:Q(Me(Bs))}),Xg=M({type:_e("WEBHOOK"),requestId:A(),requestIdToReply:Q(A()),response:Jg,handlerId:Q(A()),streamStepProgress:Q(Me(Bs))}),vD=Ne([Yg,Xg]);var _D=M({body:xe(),rawBody:Q(xe()),headers:Ee(A(),A()),queryParams:Ee(A(),A())});function mt(t){return t==null}i(mt,"isNil");function ea(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}i(ea,"isEmpty");function Vs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}i(Vs,"assertNotNullOrUndefined");var Ml=ue(require("crypto"),1);var PD=128,Mn,qi,wD=i(t=>{if(t<0)throw new RangeError("Wrong ID size");try{!Mn||Mn.length<t?(Mn=Buffer.allocUnsafe(t*PD),Ml.default.randomFillSync(Mn),qi=0):qi+t>Mn.length&&(Ml.default.randomFillSync(Mn),qi=0)}catch(e){throw Mn=void 0,e}qi+=t},"fillPool"),bD=i(t=>(wD(t|=0),Mn.subarray(qi-t,qi)),"random"),TD=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 p="";for(;;){let m=r(o),h=o;for(;h--;)if(p+=t[m[h]&n]||"",p.length===s)return p}}},"customRandom"),ey=i((t,e=21)=>TD(t,e,bD),"customAlphabet");var SD="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ty=21,SW=A().check(Nn(new RegExp(`^[0-9a-zA-Z]{${ty}}$`))),xD=ey(SD,ty);var Fn=Un(zn(t=>t instanceof Date?t.toISOString():t),A()),cr={id:A(),created:Fn,updated:Fn},at=i(t=>Q(Bo(t)),"Nullable");function Fl(t){return Q(Bo(Me(t)))}i(Fl,"NullableEnum");var IW=Un(zn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),Q(Ge())),Gs=i(t=>Un(zn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),Q(Ce(t))),"OptionalArrayFromQuery");var DW=Ee(A(),xe());var ta=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(ta||{});var qW=A().check(Nn(/^#[0-9A-Fa-f]{6}$/));var VW=M({filename:A(),data:xe(),type:_e("file"),mimetype:Q(A())});var ED=ue(ny());var YW=M({...cr,name:A(),permissions:Ce(A()),platformId:at(A()),type:A(),userCount:Q(Ct())});var iy=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(iy||{}),Ll=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ll||{}),jl=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(jl||{});var ql=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(ql||{});var Bl=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Bl||{});var ID=M({mode:Me(iy),value:xe()}),AD=M({auth:Q(A()),fields:Ee(A(),ID)}),RD=M({pieceName:A(),pieceVersion:A(),actionName:A(),predefinedInput:Q(AD)}),DD=M({type:_e("PIECE"),toolName:A().check(wr(1)),pieceMetadata:RD}),$D=M({type:_e("none")}),OD=M({type:_e("access_token"),accessToken:A()}),CD=M({type:_e("api_key"),apiKey:A(),apiKeyHeader:A()}),ND=M({type:_e("headers"),headers:Ee(A(),A())}),kD=kn("type",[$D,OD,CD,ND]),oy=M({type:_e("FLOW"),toolName:A().check(wr(1)),externalFlowId:A(),flowDisplayName:Q(A())}),ay=M({type:_e("MCP"),toolName:A().check(wr(1)),serverUrl:jg(),protocol:Me(jl),auth:kD}),sy=M({type:_e("KNOWLEDGE_BASE"),toolName:A().check(wr(1)),sourceType:Me(Ll),sourceId:A(),sourceName:A()}),zD=kn("type",[DD,oy,ay,sy]),UD=M({displayName:A(),description:Q(A()),type:Me(ql)}),uy=M({type:_e("MARKDOWN"),markdown:A()}),Bi={type:_e("TOOL_CALL"),input:at(Ee(A(),xe())),output:Q(xe()),toolName:A(),status:Me(Bl),toolCallId:A(),startTime:A(),endTime:Q(A())},AZ=M(Bi),cy=kn("toolCallType",[M({...Bi,toolCallType:_e("PIECE"),pieceName:A(),pieceVersion:A(),actionName:A()}),M({...Bi,toolCallType:_e("FLOW"),displayName:A(),externalFlowId:A()}),M({...Bi,toolCallType:_e("MCP"),displayName:A(),serverUrl:A()}),M({...Bi,toolCallType:_e("KNOWLEDGE_BASE"),displayName:A(),sourceType:A()}),M({...Bi,toolCallType:_e("UNKNOWN"),displayName:A()})]),MD=Ne([uy,cy]);var Vl=(r=>(r.IMAGE="image",r.TEXT="text",r))(Vl||{}),fn=M({apiKey:A()}),FD=fn,LD=M({apiKey:A(),apiKeyHash:A()}),jD=fn,qD=fn,BD=fn,VD=fn,GD=fn,HD=fn,WD=fn,my=M({accessKeyId:A().check(wr(1)),secretAccessKey:A().check(wr(1))}),ZD=M({}),KD=M({}),JD=M({}),YD=M({}),XD=M({}),QD=M({}),hy=M({modelId:A(),modelName:A(),modelType:Me(Vl)}),gy=M({apiKeyHeader:A(),baseUrl:A(),models:Ce(hy),defaultHeaders:Q(Ee(A(),A()))}),yy=M({accountId:A(),gatewayId:A(),models:Ce(hy),vertexProject:Q(A()),vertexRegion:Q(A())}),vy=M({resourceName:A(),apiVersion:Un(zn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),Q(A()))}),_y=M({region:A().check(wr(1))}),e$=Ne([FD,BD,VD,GD,HD,qD,jD,LD,my,WD]),Py=Ne([gy,yy,vy,_y,ZD,JD,YD,XD,KD,QD]),t$=M({id:A(),name:A(),type:Me(Vl)}),r$=M({id:A(),name:A(),provider:Me(ta),config:Py,enabledForChat:Ge()}),n$=M({provider:Me(ta),config:Py,auth:e$,platformId:A()});var OZ={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ly=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],i$=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],o$=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],dy=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],a$=["grok-4.20","grok-4.1-fast"],s$={openai:ly,anthropic:i$,google:dy,activepieces:[...o$.map(t=>`anthropic/${t}`),...ly.map(t=>`openai/${t}`),...dy.map(t=>`google/${t}`),...a$.map(t=>`x-ai/${t}`)]};var py=128e3,u$={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function c$({provider:t}){return t?u$[t]??py:py}i(c$,"getMaxContextTokens");var fy={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"},l$={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},d$=new Set(["anthropic","mistral"]);function Nr(t){return{chatModels:s$[t],maxContextTokens:c$({provider:t}),defaultEmbeddingModel:fy[t],supportsEmbedding:fy[t]!==void 0,supportsImageGeneration:!d$.has(t),webSearch:l$[t]}}i(Nr,"buildProviderCapabilities");var p$={openai:Nr("openai"),anthropic:Nr("anthropic"),openrouter:Nr("openrouter"),azure:Nr("azure"),google:Nr("google"),"cloudflare-gateway":Nr("cloudflare-gateway"),custom:Nr("custom"),bedrock:Nr("bedrock"),mistral:Nr("mistral"),activepieces:Nr("activepieces")};var f$=M({base64Url:A(),fileName:A(),extension:Q(A())}),m$=M({mimeType:A(),url:A(),fileName:Q(A())}),Gl=Ne([f$,m$]);var h$=Ne([M({type:_e("file"),value:Gl}),M({type:_e("markdown"),value:A(),files:Q(Ce(Gl))})]),g$=M({sessionId:A(),message:A(),files:Q(Ce(A()))});var by=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(by||{}),Ty=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ty||{}),Hl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Hl||{});var y$=Ne([M({...cr,name:A(),externalId:A(),type:_e("STATIC_DROPDOWN"),tableId:A(),projectId:A(),data:M({options:Ce(M({value:A()}))})}),M({...cr,name:A(),externalId:A(),type:Ne([_e("TEXT"),_e("NUMBER"),_e("DATE")]),tableId:A(),projectId:A()})]),v$=M({...cr,name:A(),folderId:at(A()),projectId:A(),externalId:A(),status:Fl(Ty),trigger:Fl(by)}),_$=M({...cr,tableId:A(),projectId:A(),cells:Ee(A(),M({updated:A(),created:A(),value:xe(),fieldName:A()}))}),P$=M({events:Ce(Me(Hl)),webhookUrl:A(),flowId:A()}),w$=M({fields:Ce(M({id:A(),name:A()})),rows:Ce(Ee(A(),A())),name:A()}),b$=M({projectId:A(),limit:Q(Vo.number()),cursor:Q(A()),name:Q(A()),externalIds:Gs(A()),folderId:Q(A()),folderIds:Gs(A())}),T$=M({records:Ce(Ce(M({fieldId:A(),value:xy()}))),tableId:A()}),S$=M({cells:Q(Ce(M({fieldId:A(),value:xy()}))),tableId:A(),agentUpdate:Q(Ge())}),Sy=kn("operator",[si("eq"),si("neq"),si("gt"),si("gte"),si("lt"),si("lte"),si("co"),wy("exists"),wy("not_exists")]),x$=M({tableId:A(),limit:Q(Vo.number()),cursor:Q(A()),filters:Gs(Sy)});function xy(){return Un(zn(t=>t==null?t:String(t)),Bo(A()))}i(xy,"coerceToString");function si(t){return M({fieldId:A(),operator:_e(t),value:A()})}i(si,"valueFilter");function wy(t){return M({fieldId:A(),operator:_e(t)})}i(wy,"existenceFilter");var E$=M({status:Q(Ct()),body:Q(xe()),headers:Q(Ee(A(),A()))}),I$=M({...cr,deleted:at(Fn),ownerId:A(),displayName:A(),platformId:A(),externalId:at(A())});var Ey=M({name:A(),description:Q(A()),type:A(),required:Ge()}),A$=M({pieceName:A(),triggerName:A(),input:M({toolName:A(),toolDescription:A(),inputSchema:Ce(Ey),returnsResponse:Ge()})});var Iy="^[0-9]+\\.[0-9]+\\.[0-9]+$",YZ=new RegExp(Iy),D$="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",XZ=A().check(Nn(new RegExp(Iy))),QZ=A().check(Nn(new RegExp(D$))),$$=M({packageType:_e("ARCHIVE"),pieceType:Me(Li),pieceName:A(),pieceVersion:A(),archiveId:A(),platformId:A()}),Ay=M({packageType:_e("REGISTRY"),pieceType:_e("OFFICIAL"),pieceName:A(),pieceVersion:A()}),Ry=M({packageType:_e("REGISTRY"),pieceType:_e("CUSTOM"),pieceName:A(),pieceVersion:A(),platformId:A()}),e3=Ne([Ay,Ry]),t3=Ne([$$,Ay,Ry]);var O$=kn("type",[M({type:_e("CRON_EXPRESSION"),cronExpression:A(),timezone:A()}),M({type:_e("INTERVAL"),intervalMs:qg().check(zs(6e4))})]),r3=M({...cr,type:Me(pn),projectId:A(),flowId:A(),triggerName:A(),schedule:at(O$),flowVersionId:A(),pieceName:A(),pieceVersion:A(),deleted:at(A()),simulate:Ge()}),Dy=(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))(Dy||{}),$y=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))($y||{}),Oy=(r=>(r.S3="S3",r.DB="DB",r))(Oy||{}),n3=M({...cr,projectId:at(A()),platformId:at(A()),type:Me(Dy),compression:Me($y),data:Q(xe()),location:Me(Oy),size:at(Ct()),fileName:at(A()),s3Key:at(A()),metadata:at(Ee(A(),A()))}),Cy=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Cy||{}),Ny=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ny||{}),i3=M({id:A(),email:A(),firstName:A(),status:Me(Ny),externalId:at(A()),platformId:at(A()),platformRole:Me(Cy),lastName:A(),created:Fn,updated:Fn,lastActiveDate:at(Fn),imageUrl:at(A())});var Zl=M({...He.shape,...ke(Ee(A(),xe()),"OBJECT").shape});var Uy=M({...He.shape,...ke(A(),"COLOR").shape});var Kl=Ne([Wt,un,qs,ln,Zt,cn,kl,Go,zl,dn,Zo,Zl,Ko,Wo,Ho,Uy]),C={ShortText(t){return{...t,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(t){return{...t,valueSchema:void 0,type:"CHECKBOX"}},LongText(t){return{...t,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(t){return{displayName:"Markdown",required:!1,description:t.value,type:"MARKDOWN",valueSchema:void 0,variant:t.variant??"INFO"}},Number(t){return{...t,valueSchema:void 0,type:"NUMBER"}},Json(t){return{...t,valueSchema:void 0,type:"JSON"}},Array(t){return{...t,valueSchema:void 0,type:"ARRAY"}},Object(t){return{...t,valueSchema:void 0,type:"OBJECT"}},Dropdown(t){return{...t,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(t){return{...t,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(t){return{...t,valueSchema:void 0,type:"DATE_TIME"}},File(t){return{...t,valueSchema:void 0,type:"FILE"}},Custom(t){let e=t.code.toString();return{...t,code:e,valueSchema:void 0,type:"CUSTOM"}},Color(t){return{...t,valueSchema:void 0,type:"COLOR"}}};var kr=M({displayName:A(),description:Q(A()),hasConnectionIdentifier:Q(Ge())});var My=M({username:A(),password:A()}),Jl=M({...kr.shape,username:M({displayName:A(),description:Q(A())}),password:M({displayName:A(),description:Q(A())}),...ke(My,"BASIC_AUTH").shape});var z$=Ee(A(),Ne([Wt,un,dn,ln,Zt])),Yl=M({...kr.shape,props:z$,...ke(xe(),"CUSTOM_AUTH").shape});var ui=M({...kr.shape,...ke(M({auth:A()}),"SECRET_TEXT").shape});var U$=Ee(A(),Ne([Wt,un,ui,dn,ln,Zt,cn,qs])),Fy=M({...kr.shape,props:U$,...ke(xe(),"OIDC").shape});var Xl=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Xl||{}),Ly=Ne([Wt,ui,Zt]),jy=Ee(A(),Ly),M$=M({props:Q(Ee(A(),Ly)),authUrl:A(),tokenUrl:A(),scope:Ce(A()),prompt:Q(Ne([_e("none"),_e("consent"),_e("login"),_e("omit")])),pkce:Q(Ge()),pkceMethod:Q(Ne([_e("plain"),_e("S256")])),authorizationMethod:Q(Me(Xl)),grantType:Q(Ne([Me(Yo),_e(Ul)])),extra:Q(Ee(A(),A()))}),qy=M({access_token:A(),props:Q(jy),data:Ee(A(),qo())}),Ql=M({...kr.shape,...M$.shape,...ke(qy,"OAUTH2").shape});var Vi=Ne([Jl,Yl,Fy,Ql,ui]),ra="Connection",Ws={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||ra}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||ra,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||ra}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||ra}},None(){}};var zK={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 F$=M({...He.shape,...ke(xe(),"CUSTOM").shape,code:A()});var L$=Ne([Kl,Vi]),ed=Ee(A(),L$),rJ=Ee(A(),Kl);var By=Ne([M({strategy:_e("CRON"),cronExpression:A()}),M({strategy:_e("NONE")})]),Gi=class{constructor(e,r,n,o,s,p,m,h,v,P,x,T,w,S,D,E,u,f,c){this.name=e;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=p;this.handshakeConfiguration=m;this.onHandshake=h;this.renewConfiguration=v;this.onRenew=P;this.onEnable=x;this.onDisable=T;this.onStart=w;this.run=S;this.test=D;this.sampleData=E;this.testStrategy=u;this.outputSchema=f;this.aiMetadata=c}static{i(this,"ITrigger")}},Zs=i(t=>{switch(t.type){case"WEBHOOK":return new Gi(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,t.handshakeConfiguration??{strategy:"NONE"},t.onHandshake??(async()=>({status:200})),t.renewConfiguration??{strategy:"NONE"},t.onRenew??(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,t.test?"TEST_FUNCTION":"SIMULATION",t.outputSchema,t.aiMetadata);case"POLLING":return new Gi(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata);case"MANUAL":return new Gi(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata);case"APP_WEBHOOK":return new Gi(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)}},"createTrigger");var Vy="2",Ks="0.82.0";var td=class{constructor(e,r,n,o,s,p,m,h,v=Ks,P,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=P;this.description=x;this.deprecated=T;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Vy}),"getContextInfo");(!q$(v)||B$(v,Ks))&&(this.minimumSupportedRelease=Ks),s.forEach(w=>this._actions[w.name]=w),p.forEach(w=>this._triggers[w.name]=w)}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:j$(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}},Hy=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 td(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 j$(t){if(t!==void 0)return Array.isArray(t)?t.map(Gy):Gy(t)}i(j$,"withConnectionIdentifierFlag");function Gy(t){return{...t,hasConnectionIdentifier:t.getConnectionIdentifier!==void 0}}i(Gy,"flagConnectionIdentifier");function q$(t){return/^\d+\.\d+\.\d+$/.test(t)}i(q$,"isValidSimpleSemver");function B$(t,e){let[r,n,o]=t.split(".").map(Number),[s,p,m]=e.split(".").map(Number);return r!==s?r<s:n!==p?n<p:o<m}i(B$,"isSemverLessThan");var V$=Q(Ee(A(),Ee(A(),A()))),Wy=M({id:Q(A()),name:A(),displayName:A(),logoUrl:A(),description:A(),authors:Ce(A()),platformId:Q(A()),directoryPath:Q(A()),auth:Q(Ne([Vi,Ce(Vi)])),version:A(),categories:Q(Ce(Me(ji))),minimumSupportedRelease:Q(A()),maximumSupportedRelease:Q(A()),deprecated:Q(Ge()),i18n:V$}),G$=Me(["human","ai","both"]),Zy=M({description:Q(A()),idempotent:Q(Ge())}),Ky=M({name:A(),displayName:A(),description:A(),props:ed,requireAuth:Ge(),errorHandlingOptions:Q(Nl),outputSchema:Q(Ls()),audience:Q(G$),aiMetadata:Q(Zy)}),Jy=M({name:A(),displayName:A(),description:A(),props:ed,errorHandlingOptions:Q(Nl),type:Me(pn),sampleData:xe(),handshakeConfiguration:Q(Ls()),renewConfiguration:Q(By),testStrategy:Me(Qo),outputSchema:Q(Ls()),aiMetadata:Q(Zy)}),H$=M({...Wy.shape,actions:Ee(A(),Ky),triggers:Ee(A(),Jy)}),W$=M({...Wy.shape,actions:Ct(),triggers:Ct(),suggestedActions:Q(Ce(Ky)),suggestedTriggers:Q(Ce(Jy))}),Yy=M({projectUsage:Ct(),pieceType:Me(Li),packageType:Me(Jo),platformId:Q(A()),archiveId:Q(A())}),r8=M({...H$.shape,...Yy.shape}),n8=M({...W$.shape,...Yy.shape}),i8=M({name:A(),version:A()});var Z$=ue(require("path")),K$=ue(require("fs/promises"));var Hi=require("node:stream");var Js=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,p)=>{o.append(p,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 Ys=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(e=new rd,r=new nd){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},rd=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},nd=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 na=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 Xy({error:t,requestBody:e}){return t instanceof na?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}i(Xy,"toFailsafeOutput");var zr=(p=>(p.GET="GET",p.POST="POST",p.PATCH="PATCH",p.PUT="PUT",p.DELETE="DELETE",p.HEAD="HEAD",p))(zr||{});var Xs=class extends Js{static{i(this,"FetchHttpClient")}constructor(e="",r=new Ys){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),p=e.queryParams??{};for(let[c,y]of Object.entries(p))o.append(c,y);let m=o.toString(),h=m?`${n}?${m}`:n,v=e.responseType??"json",P=e.followRedirects??!0,x=e.retries??0,{body:T,extraHeaders:w,isStream:S}=J$(e.method)?Y$(e.body,s):{body:void 0,extraHeaders:{},isStream:!1},D=Q$({...s,...w}),E=await X$(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:P?"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=P?300:400;if(E.status<200||E.status>=u){let c=await Qy(E,v==="stream"?"text":v),y=new na(e.body,{status:E.status,responseBody:c});throw console.error("[HttpClient#(sanitized error message)] Request failed:",y),y}let f=await Qy(E,v);return{status:E.status,headers:eO(E.headers),body:f}}};function J$(t){return t!=="GET"&&t!=="HEAD"}i(J$,"acceptsRequestBody");function Y$(t,e){if(tv(t))return{body:void 0,extraHeaders:{},isStream:!1};if(tO(t)){let n=new Hi.PassThrough;return t.on("error",o=>n.destroy(o)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return t instanceof Hi.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(Y$,"serializeBody");async function Qy(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"stream":return tv(t.body)?Hi.Readable.from([]):Hi.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(Qy,"parseResponseBody");async function X$(t,e){let r;for(let n=0;n<=e;n++)try{let o=await t();if(o.status>=500&&n<e){await ev(n);continue}return o}catch(o){if(r=o,n<e){await ev(n);continue}throw o}throw r}i(X$,"sendWithRetries");function ev(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}i(ev,"backoff");function Q$(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(Q$,"normalizeHeaders");function eO(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}i(eO,"toHttpHeaders");function tO(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}i(tO,"isNodeFormData");function tv(t){return t==null}i(tv,"isNil");var wt=new Xs;var qC=ue(require("fs")),nP=ue(ua());var BC={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function VC(t){let e=t.split(";")[0].trim().toLowerCase();return BC[e]??""}i(VC,"contentTypeToExtension");var GC=i(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),HC=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 iP({auth:t,baseUrl:e,authMapping:r,description:n,displayName:o,name:s,props:p,extraProps:m,authLocation:h="headers"}){return ee({audience:"human",name:s||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:C.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:i(async({auth:v})=>({url:C.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
69
- i.e ${HC(e,v)}/resource or /resource`,required:!0,defaultValue:v?e(v):"",...p?.url??{}})}),"props")}),method:C.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(zr).map(v=>({label:v,value:v}))},...p?.method??{}}),headers:C.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...p?.headers??{}}),queryParams:C.Object({displayName:"Query Parameters",required:!0,...p?.queryParams??{}}),body_type:C.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:C.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:v})=>{if(!v)return{};let P=v,x={};switch(P){case"none":break;case"json":x.data=C.Json({displayName:"JSON Body",required:!0,...p?.body??{}});break;case"raw":x.data=C.LongText({displayName:"Raw Body",required:!0});break;case"form_data":x.data=C.Array({displayName:"Form Data",required:!0,properties:{fieldName:C.ShortText({displayName:"Field Name",required:!0}),fieldType:C.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:C.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:C.File({displayName:"File Field Value",required:!1})}});break}return x},"props")}),response_is_binary:C.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:C.Checkbox({displayName:"No Error on Failure",required:!1,...p?.failsafe??{}}),timeout:C.Number({displayName:"Timeout (in seconds)",required:!1,...p?.timeout??{}}),followRedirects:C.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...m},run:i(async v=>{let{method:P,url:x,headers:T,queryParams:w,body:S,body_type:D,failsafe:E,timeout:u,response_is_binary:f,followRedirects:c}=v.propsValue;Vs(P,"Method"),Vs(x,"URL");let y=mt(r)?{}:await r(v.auth,v.propsValue),l=x.url,b=l.startsWith("http://")||l.startsWith("https://")?l:GC({baseUrl:e(v.auth),relativePath:l}),g={method:P,url:b,headers:{...T??{},...h==="headers"||!mt(h)?y:{}},queryParams:{...h==="queryParams"?y:{},...w??{}},timeout:u?u*1e3:0,followRedirects:c};if(f&&(g.responseType="arraybuffer"),S)if(D&&D!=="none"){let oe=S.data;if(D==="form_data"){let ne=oe,Re=new nP.default;for(let{fieldName:se,fieldType:Y,textFieldValue:K,fileFieldValue:re}of ne)Y==="text"&&!ea(K)?Re.append(se,K):Y==="file"&&!ea(re)&&Re.append(se,re.data,{filename:re?.filename});g.body=Re,g.headers={...g.headers,...Re.getHeaders()}}else g.body=oe}else D||(g.body=S);try{let oe=await wt.sendRequest(g);return await WC(v.files,oe.body,oe.status,oe.headers,f)}catch(oe){if(E)return Xy({error:oe,requestBody:g.body});throw oe}},"run")})}i(iP,"createCustomApiCallAction");var WC=i(async(t,e,r,n,o)=>{let s;if(o&&ZC(e)){let p=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],m=VC(p??"")||"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"),ZC=i(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var Ur={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:o,files:s,server:p}){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:p}),v=h.reduce((P,x)=>Math.max(P,x.epochMilliSeconds),m);return await e.put("lastPoll",v),h.filter(P=>P.epochMilliSeconds>m).map(P=>P.data)}case 1:{let m=await e.get("lastItem"),h=await t.items({store:e,auth:r,propsValue:n,lastItemId:m,files:s,server:p}),v=h.findIndex(T=>T.id===m),P=[];mt(m)||v==-1?P=h??[]:P=h?.slice(0,v)??[],mt(o)||(P=P.slice(-o));let x=P?.[0]?.id;return mt(x)||await e.put("lastItem",x),P.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 p=[];switch(t.strategy){case 0:{p=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{p=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:o,server:s});break}}return KC(p.map(m=>m.data))}};function KC(t){return t.length<=5?t:t.slice(0,5)}i(KC,"getFirstFiveOrAll");var Tc=ue(La());var lS=["https://www.googleapis.com/auth/drive","email"],J=[Ws.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:lS}),Ws.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:C.LongText({displayName:"Service Account JSON Key",required:!0}),userEmail:C.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 pt({type:"CUSTOM_AUTH",props:{...t}})}catch(e){return{valid:!1,error:e.message}}return{valid:!0}},"validate")})];async function ae(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 Tc.JWT({email:r.client_email,key:r.private_key,scopes:lS,subject:t.props.userEmail})}let e=new Tc.OAuth2Client;return e.setCredentials(t),e}i(ae,"createGoogleClient");var pt=i(async t=>{if(t.type==="CUSTOM_AUTH"){let r=await(await ae(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 EE=ue(Ae());var Am=ue(qc()),Rm=ue(Ae());var FL=1e3,LL=i(t=>t.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),"escapeDriveQueryLiteral"),Le={properties:{parentFolder:C.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)=>{if(!t)return{disabled:!0,options:[],placeholder:"Please authenticate first"};let o=await pt(t),s=r?.searchValue?.trim()??"",p=["mimeType='application/vnd.google-apps.folder'","trashed = false"];s.length>0&&p.push(`name contains '${LL(s)}'`);let m={method:"GET",url:"https://www.googleapis.com/drive/v3/files",queryParams:{q:p.join(" and "),includeItemsFromAllDrives:e?"true":"false",supportsAllDrives:"true",corpora:e?"allDrives":"user",pageSize:String(FL),fields:"nextPageToken, files(id, name)"},authentication:{type:"BEARER_TOKEN",token:o}},h=[],v=!1;try{let P=await wt.sendRequest(m);h=P.body.files??[],v=!!P.body.nextPageToken}catch(P){throw new Error(`Failed to get folders
70
- Error:${P}`)}return{disabled:!1,placeholder:v?`Showing first ${h.length} matches \u2014 type to narrow the list, or switch to Dynamic value to paste an ID.`:void 0,options:h.map(P=>({label:P.name,value:P.id}))}},"options")}),include_team_drives:C.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},async getFiles(t,e,r){let n=await ae(t),o=(0,Rm.drive)({version:"v3",auth:n}),s=[];e?.parent&&s.push(`'${e.parent}' in parents`),e?.createdTime&&s.push(`createdTime ${e.createdTimeOp??">"} '${(0,Am.default)(e.createdTime).format()}'`),s.push("trashed = false");let p=[],m;do{let h={q:s.concat("mimeType!='application/vnd.google-apps.folder'").join(" and "),fields:"nextPageToken, files(id, name, mimeType, webViewLink, kind, 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);p.push(...v.data.files??[]),m=v.data.nextPageToken??void 0}while(m);return p},async getFolders(t,e,r){let n=await ae(t),o=(0,Rm.drive)({version:"v3",auth:n}),s=["mimeType='application/vnd.google-apps.folder'"];e?.parent&&s.push(`'${e.parent}' in parents`),e?.createdTime&&s.push(`createdTime ${e.createdTimeOp??">"} '${(0,Am.default)(e.createdTime).format()}'`),s.push("trashed = false");let p=[],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);p.push(...v.data.files??[]),m=v.data.nextPageToken??void 0}while(m);return p}};var Rx={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Dx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},$x={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Ox={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},Cx={fields:[{key:"name",label:"Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Nx={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"}]},kx={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"}]}]},zx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Ux={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Mx={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"}]}]},Fx={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"}]},Lx={fields:[{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]},jx={fields:[{key:"removed",label:"Removed",value:"removed",format:"boolean"},{key:"message",label:"Message",value:"message"}]},qx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Bx={fields:[{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:"id",label:"File ID"}]},Vx={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"createdTime",label:"Created Time",format:"datetime"}]},jL=[{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"}]}],Gx={fields:jL},Hx={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"}]},Wx={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"}]}]},Zx={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"}]},Kx={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"}]}]},Jx={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"}]}]},Yx={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"}]}]},Xx={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"}]},Qx={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"}]}]},eE={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"}]}]},tE={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"}]}]},rE={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"}]},nE={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"}]},iE={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"}]},oE={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"}]},aE={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"}]},sE={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"}]}]},uE={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"}]}]},cE={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"}]}]}]},lE={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"}]}]},dE={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"}]}]},pE={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"}]}]},fE={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"}]}]}]},mE={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"}]}]},hE={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"}]},gE={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"}]},yE={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"}]},vE={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"}]},_E={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},PE={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},wE={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},bE={fields:[{key:"success",label:"Success",format:"boolean"},{key:"reply_id",label:"Reply ID"}]},TE={fields:[{key:"deleted",label:"Deleted",format:"boolean"},{key:"driveId",label:"Drive ID"}]},SE={fields:[{key:"success",label:"Success",format:"boolean"},{key:"driveId",label:"Drive ID"}]},xE={fields:[{key:"removed",label:"Removed",format:"boolean"},{key:"message",label:"Message"}]};var IE=ee({auth:J,name:"update_permissions",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:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:C.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:C.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:Le.properties.include_team_drives,send_invitation_email:C.Checkbox({displayName:"Send invitation email",description:"Send an email to the user to notify them of the new permissions",required:!0})},outputSchema:Lx,async run(t){let{fileId:e,user_email:r,permission_name:n,send_invitation_email:o,include_team_drives:s}=t.propsValue,p=await ae(t.auth),m=(0,EE.drive)({version:"v3",auth:p}),h={type:"user",role:n,emailAddress:r};return(await m.permissions.create({requestBody:h,fileId:e,sendNotificationEmail:o,supportsAllDrives:s})).data}});var AE=ue(Ae());var RE=ee({auth:J,name:"create_new_gdrive_folder",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:C.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parentFolder:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives},outputSchema:Rx,async run(t){let e=await ae(t.auth);return(await(0,AE.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 DE=ue(Ae());var $E=ee({auth:J,name:"create_new_gdrive_file",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:C.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:C.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),fileType:C.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:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives},outputSchema:Dx,async run(t){let e=await ae(t.auth),r=(0,DE.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 OE=ue(Ae());var CE=ee({auth:J,name:"delete_permissions",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:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:C.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:C.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:jx,async run(t){let[e,r]=[t.propsValue.fileId,t.propsValue.user_email],n=await ae(t.auth),o=(0,OE.drive)({version:"v3",auth:n}),s=await o.permissions.list({fileId:e,fields:"permissions(id, emailAddress, role)"});if(s.data.permissions){for(let p of s.data.permissions)if(p.emailAddress===r&&p.role===t.propsValue.permission_name)return await o.permissions.delete({fileId:e,permissionId:p.id?p.id:""}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var NE=ue(Ae());var kE=ee({displayName:"Duplicate File",auth:J,name:"duplicate_file",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:C.ShortText({displayName:"File ID",description:"The ID of the file to duplicate",required:!0}),name:C.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folderId:C.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be duplicated",required:!0}),mimeType:C.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:Le.properties.include_team_drives},outputSchema:zx,async run(t){let e=await ae(t.auth),r=t.propsValue.fileId,n=t.propsValue.name,o=t.propsValue.folderId,s=t.propsValue.mimeType,p=(0,NE.drive)({version:"v3",auth:e}),m={name:n,parents:[o]};s&&(m.mimeType=s);let h=await p.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 zE=ue(Ae());var UE=ee({auth:J,name:"get-file-or-folder-by-id",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:C.ShortText({displayName:"File / Folder Id",description:"The Id of the file/folder to search for.",required:!0}),include_team_drives:Le.properties.include_team_drives},outputSchema:Cx,async run(t){let e=await ae(t.auth),n=await(0,zE.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.id,supportsAllDrives:t.propsValue.include_team_drives});return n.data?n.data:null}});var Dm=ue(require("querystring"));var FE=require("node:stream"),LE=ue(Ln());async function jE(t,e){let r=await pt(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(jE,"getMimeType");var ME=i(async(t,e,r,n,o)=>{let s=await jE(e,r),p=await pt(e),m=await fetch(t,{headers:{Authorization:`Bearer ${p}`}}).catch(x=>Promise.reject(new Error(`Error when download file:
68
+ `)}E+=D,e.data=E}if(o(_,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let w=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||d,body:n.body}];(0,bm.isBrowser)()?_(w):v(w)}else r.uploadType="media",Object.assign(m,{"content-type":n.mimeType||d}),e.data=n.body;else e.data=i||void 0;if(e.headers=Pm.Gaxios.mergeHeaders(e.headers||{},m),e.params=r,!(0,bm.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:wx.version,comment:"gzip"});let w=e.userAgentDirectives.map(S=>{let D=`${S.product}/${S.version}`;return S.comment&&(D+=` (${S.comment})`),D}).join(" ");e.headers.set("User-Agent",w)}if(e.validateStatus||(e.validateStatus=w=>w>=200&&w<300||w===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 w=new URL(e.url);w.hostname.endsWith(".googleapis.com")&&(w.hostname=w.hostname.replace(/googleapis\.com$/,T),e.url=w.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let w=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(w&&T!==w)throw new Error(`The configured universe domain (${T}) does not match the universe domain found in the credentials (${w}). 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=Pm.Gaxios.mergeHeaders(D.headers,S),NL.request(D)}else{let S=await s.request(e);return(0,wm.marshallGaxiosResponse)(S)}}else return new Pm.Gaxios().request(e).then(w=>(0,wm.marshallGaxiosResponse)(w))}o(_x,"createAPIRequestAsync");var Tm=class extends Px.Transform{static{o(this,"ProgressStream")}bytesRead=0;_transform(e,r,n){this.bytesRead+=e.length,this.emit("progress",this.bytesRead),this.push(e),n()}};function ML(t,e){(0,bm.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${wx.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(ML,"populateAPIHeader")});var bx=L(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.AuthPlus=void 0;var bn=ja(),xm=class extends bn.GoogleAuth{static{o(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()}};Uc.AuthPlus=xm});var Im=L(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.Endpoint=void 0;var Tx=kc(),Em=class{static{o(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,i){if(this.applyMethodsFromSchema(e,r,n,i),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let d=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,d,i)}}}applyMethodsFromSchema(e,r,n,i){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,i)}}}makeMethod(e,r,n){return(i,s)=>{let d=typeof i=="function"?{}:i;s=typeof i=="function"?i:s;let m=Sx(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=Sx(e.rootUrl+r.mediaUpload.protocols.simple.path);h.mediaUrl=v.substring(1,v.length-1)}if(!s)return(0,Tx.createAPIRequest)(h);(0,Tx.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}};Mc.Endpoint=Em;function Sx(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(Sx,"buildurl")});var Ex=L(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.Discovery=void 0;var FL=require("fs"),LL=gt(),jL=require("url"),xx=require("util"),qL=kc(),BL=Im(),VL=xx.promisify(FL.readFile),Am=class{static{o(this,"Discovery")}transporter=new LL.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new BL.Endpoint(r);return n.applySchema(n,e,e,n),n}}log(...e){this.options&&this.options.debug&&console.log(...e)}async discoverAllAPIs(e){let r=new Headers(this.options.includePrivate?{}:{"X-User-Ip":"0.0.0.0"}),i=(await this.transporter.request({url:e,headers:r})).data.items,s=await Promise.all(i.map(async 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(xx.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=jL.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await VL(e,{encoding:"utf8"});return this.makeEndpoint(JSON.parse(n))}else{this.log("Requesting "+e);let n=await this.transporter.request({url:e});return this.makeEndpoint(n.data)}}else{let r=e;this.log("Requesting "+r.url);let n=r.url;delete r.url;let i={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},s=await(0,qL.createAPIRequest)(i);return this.makeEndpoint(s.data)}}};Fc.Discovery=Am});var Xa=L(Ne=>{"use strict";var GL=Ne&&Ne.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HL=Ne&&Ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GL(e,t,r)};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.Endpoint=Ne.Discovery=Ne.AuthPlus=Ne.createAPIRequest=Ne.getAPI=Ne.GaxiosError=Ne.Gaxios=Ne.AwsClient=Ne.IdentityPoolClient=Ne.BaseExternalAccountClient=Ne.ExternalAccountClient=Ne.GoogleAuth=Ne.UserRefreshClient=Ne.Compute=Ne.JWT=Ne.OAuth2Client=Ne.gaxios=Ne.googleAuthLibrary=void 0;Ne.googleAuthLibrary=ja();Ne.gaxios=gt();var Tn=ja();Object.defineProperty(Ne,"OAuth2Client",{enumerable:!0,get:o(function(){return Tn.OAuth2Client},"get")});Object.defineProperty(Ne,"JWT",{enumerable:!0,get:o(function(){return Tn.JWT},"get")});Object.defineProperty(Ne,"Compute",{enumerable:!0,get:o(function(){return Tn.Compute},"get")});Object.defineProperty(Ne,"UserRefreshClient",{enumerable:!0,get:o(function(){return Tn.UserRefreshClient},"get")});Object.defineProperty(Ne,"GoogleAuth",{enumerable:!0,get:o(function(){return Tn.GoogleAuth},"get")});Object.defineProperty(Ne,"ExternalAccountClient",{enumerable:!0,get:o(function(){return Tn.ExternalAccountClient},"get")});Object.defineProperty(Ne,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return Tn.BaseExternalAccountClient},"get")});Object.defineProperty(Ne,"IdentityPoolClient",{enumerable:!0,get:o(function(){return Tn.IdentityPoolClient},"get")});Object.defineProperty(Ne,"AwsClient",{enumerable:!0,get:o(function(){return Tn.AwsClient},"get")});var Ix=gt();Object.defineProperty(Ne,"Gaxios",{enumerable:!0,get:o(function(){return Ix.Gaxios},"get")});Object.defineProperty(Ne,"GaxiosError",{enumerable:!0,get:o(function(){return Ix.GaxiosError},"get")});var WL=yS();Object.defineProperty(Ne,"getAPI",{enumerable:!0,get:o(function(){return WL.getAPI},"get")});var ZL=kc();Object.defineProperty(Ne,"createAPIRequest",{enumerable:!0,get:o(function(){return ZL.createAPIRequest},"get")});var KL=bx();Object.defineProperty(Ne,"AuthPlus",{enumerable:!0,get:o(function(){return KL.AuthPlus},"get")});var JL=Ex();Object.defineProperty(Ne,"Discovery",{enumerable:!0,get:o(function(){return JL.Discovery},"get")});var YL=Im();Object.defineProperty(Ne,"Endpoint",{enumerable:!0,get:o(function(){return YL.Endpoint},"get")});HL(zc(),Ne)});var Rx=L(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.drive_v2=void 0;var B=Xa(),Ax;(function(t){class e{static{o(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 i(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 w(this.context),this.revisions=new S(this.context),this.teamdrives=new D(this.context)}}t.Drive=e;class r{static{o(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{o(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 i{static{o(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=i;class s{static{o(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{o(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{o(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{o(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{o(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{o(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{o(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{o(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 w{static{o(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=w;class S{static{o(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{o(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})(Ax||(Lc.drive_v2=Ax={}))});var $x=L(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.drive_v3=void 0;var Z=Xa(),Dx;(function(t){class e{static{o(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 i(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 w(this.context),this.revisions=new S(this.context),this.teamdrives=new D(this.context)}}t.Drive=e;class r{static{o(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{o(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 i{static{o(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=i;class s{static{o(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{o(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{o(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{o(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{o(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{o(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{o(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{o(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 w{static{o(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=w;class S{static{o(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{o(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})(Dx||(jc.drive_v3=Dx={}))});var $e=L(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.AuthPlus=qt.drive_v3=qt.drive_v2=qt.auth=qt.VERSIONS=void 0;qt.drive=XL;var Ox=Xa(),Cx=Rx();Object.defineProperty(qt,"drive_v2",{enumerable:!0,get:o(function(){return Cx.drive_v2},"get")});var Nx=$x();Object.defineProperty(qt,"drive_v3",{enumerable:!0,get:o(function(){return Nx.drive_v3},"get")});qt.VERSIONS={v2:Cx.drive_v2.Drive,v3:Nx.drive_v3.Drive};function XL(t){return(0,Ox.getAPI)("drive",t,qt.VERSIONS,this)}o(XL,"drive");var QL=new Ox.AuthPlus;qt.auth=QL;var ej=Xa();Object.defineProperty(qt,"AuthPlus",{enumerable:!0,get:o(function(){return ej.AuthPlus},"get")})});var qc=L((Rm,Dm)=>{(function(t,e){typeof Rm=="object"&&typeof Dm<"u"?Dm.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Rm,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",s="minute",d="hour",m="day",h="week",v="month",_="quarter",x="year",T="date",w="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:o(function(se){var X=["th","st","nd","rd"],J=se%100;return"["+se+(X[(J-20)%10]||X[J]||X[0])+"]"},"ordinal")},u=o(function(se,X,J){var re=String(se);return!re||re.length>=X?se:""+Array(X+1-re.length).join(J)+se},"m"),f={s:u,z:o(function(se){var X=-se.utcOffset(),J=Math.abs(X),re=Math.floor(J/60),te=J%60;return(X<=0?"+":"-")+u(re,2,"0")+":"+u(te,2,"0")},"z"),m:o(function se(X,J){if(X.date()<J.date())return-se(J,X);var re=12*(J.year()-X.year())+(J.month()-X.month()),te=X.clone().add(re,v),ce=J-te<0,de=X.clone().add(re+(ce?-1:1),v);return+(-(re+(J-te)/(ce?te-de:de-te))||0)},"t"),a:o(function(se){return se<0?Math.ceil(se)||0:Math.floor(se)},"a"),p:o(function(se){return{M:v,y:x,w:h,d:m,D:T,h:d,m:s,s:i,ms:n,Q:_}[se]||String(se||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(se){return se===void 0},"u")},c="en",y={};y[c]=E;var l=o(function(se){return se instanceof ne},"p"),b=o(function se(X,J,re){var te;if(!X)return c;if(typeof X=="string"){var ce=X.toLowerCase();y[ce]&&(te=ce),J&&(y[ce]=J,te=ce);var de=X.split("-");if(!te&&de.length>1)return se(de[0])}else{var ze=X.name;y[ze]=X,te=ze}return!re&&te&&(c=te),te||!re&&c},"t"),g=o(function(se,X){if(l(se))return se.clone();var J=typeof X=="object"?X:{};return J.date=se,J.args=arguments,new ne(J)},"w"),ie=f;ie.l=b,ie.i=l,ie.w=function(se,X){return g(se,{locale:X.$L,utc:X.$u,x:X.$x,$offset:X.$offset})};var ne=(function(){function se(J){this.$L=b(J.locale,null,!0),this.parse(J)}o(se,"M");var X=se.prototype;return X.parse=function(J){this.$d=(function(re){var te=re.date,ce=re.utc;if(te===null)return new Date(NaN);if(ie.u(te))return new Date;if(te instanceof Date)return new Date(te);if(typeof te=="string"&&!/Z$/i.test(te)){var de=te.match(S);if(de){var ze=de[2]-1||0,Ue=(de[7]||"0").substring(0,3);return ce?new Date(Date.UTC(de[1],ze,de[3]||1,de[4]||0,de[5]||0,de[6]||0,Ue)):new Date(de[1],ze,de[3]||1,de[4]||0,de[5]||0,de[6]||0,Ue)}}return new Date(te)})(J),this.$x=J.x||{},this.init()},X.init=function(){var J=this.$d;this.$y=J.getFullYear(),this.$M=J.getMonth(),this.$D=J.getDate(),this.$W=J.getDay(),this.$H=J.getHours(),this.$m=J.getMinutes(),this.$s=J.getSeconds(),this.$ms=J.getMilliseconds()},X.$utils=function(){return ie},X.isValid=function(){return this.$d.toString()!==w},X.isSame=function(J,re){var te=g(J);return this.startOf(re)<=te&&te<=this.endOf(re)},X.isAfter=function(J,re){return g(J)<this.startOf(re)},X.isBefore=function(J,re){return this.endOf(re)<g(J)},X.$g=function(J,re,te){return ie.u(J)?this[re]:this.set(te,J)},X.unix=function(){return Math.floor(this.valueOf()/1e3)},X.valueOf=function(){return this.$d.getTime()},X.startOf=function(J,re){var te=this,ce=!!ie.u(re)||re,de=ie.p(J),ze=o(function(Vt,Ze){var Je=ie.w(te.$u?Date.UTC(te.$y,Ze,Vt):new Date(te.$y,Ze,Vt),te);return ce?Je:Je.endOf(m)},"l"),Ue=o(function(Vt,Ze){return ie.w(te.toDate()[Vt].apply(te.toDate("s"),(ce?[0,0,0,0]:[23,59,59,999]).slice(Ze)),te)},"$"),Ke=this.$W,Qe=this.$M,Tt=this.$D,oe="set"+(this.$u?"UTC":"");switch(de){case x:return ce?ze(1,0):ze(31,11);case v:return ce?ze(1,Qe):ze(0,Qe+1);case h:var lt=this.$locale().weekStart||0,ft=(Ke<lt?Ke+7:Ke)-lt;return ze(ce?Tt-ft:Tt+(6-ft),Qe);case m:case T:return Ue(oe+"Hours",0);case d:return Ue(oe+"Minutes",1);case s:return Ue(oe+"Seconds",2);case i:return Ue(oe+"Milliseconds",3);default:return this.clone()}},X.endOf=function(J){return this.startOf(J,!1)},X.$set=function(J,re){var te,ce=ie.p(J),de="set"+(this.$u?"UTC":""),ze=(te={},te[m]=de+"Date",te[T]=de+"Date",te[v]=de+"Month",te[x]=de+"FullYear",te[d]=de+"Hours",te[s]=de+"Minutes",te[i]=de+"Seconds",te[n]=de+"Milliseconds",te)[ce],Ue=ce===m?this.$D+(re-this.$W):re;if(ce===v||ce===x){var Ke=this.clone().set(T,1);Ke.$d[ze](Ue),Ke.init(),this.$d=Ke.set(T,Math.min(this.$D,Ke.daysInMonth())).$d}else ze&&this.$d[ze](Ue);return this.init(),this},X.set=function(J,re){return this.clone().$set(J,re)},X.get=function(J){return this[ie.p(J)]()},X.add=function(J,re){var te,ce=this;J=Number(J);var de=ie.p(re),ze=o(function(Qe){var Tt=g(ce);return ie.w(Tt.date(Tt.date()+Math.round(Qe*J)),ce)},"y");if(de===v)return this.set(v,this.$M+J);if(de===x)return this.set(x,this.$y+J);if(de===m)return ze(1);if(de===h)return ze(7);var Ue=(te={},te[s]=e,te[d]=r,te[i]=t,te)[de]||1,Ke=this.$d.getTime()+J*Ue;return ie.w(Ke,this)},X.subtract=function(J,re){return this.add(-1*J,re)},X.format=function(J){var re=this,te=this.$locale();if(!this.isValid())return te.invalidDate||w;var ce=J||"YYYY-MM-DDTHH:mm:ssZ",de=ie.z(this),ze=this.$H,Ue=this.$m,Ke=this.$M,Qe=te.weekdays,Tt=te.months,oe=te.meridiem,lt=o(function(Ze,Je,A,$){return Ze&&(Ze[Je]||Ze(re,ce))||A[Je].slice(0,$)},"h"),ft=o(function(Ze){return ie.s(ze%12||12,Ze,"0")},"d"),Vt=oe||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(re.$y).slice(-2);case"YYYY":return ie.s(re.$y,4,"0");case"M":return Ke+1;case"MM":return ie.s(Ke+1,2,"0");case"MMM":return lt(te.monthsShort,Ke,Tt,3);case"MMMM":return lt(Tt,Ke);case"D":return re.$D;case"DD":return ie.s(re.$D,2,"0");case"d":return String(re.$W);case"dd":return lt(te.weekdaysMin,re.$W,Qe,2);case"ddd":return lt(te.weekdaysShort,re.$W,Qe,3);case"dddd":return Qe[re.$W];case"H":return String(ze);case"HH":return ie.s(ze,2,"0");case"h":return ft(1);case"hh":return ft(2);case"a":return Vt(ze,Ue,!0);case"A":return Vt(ze,Ue,!1);case"m":return String(Ue);case"mm":return ie.s(Ue,2,"0");case"s":return String(re.$s);case"ss":return ie.s(re.$s,2,"0");case"SSS":return ie.s(re.$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(J,re,te){var ce,de=this,ze=ie.p(re),Ue=g(J),Ke=(Ue.utcOffset()-this.utcOffset())*e,Qe=this-Ue,Tt=o(function(){return ie.m(de,Ue)},"D");switch(ze){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 i:ce=Qe/t;break;default:ce=Qe}return te?ce:ie.a(ce)},X.daysInMonth=function(){return this.endOf(v).$D},X.$locale=function(){return y[this.$L]},X.locale=function(J,re){if(!J)return this.$L;var te=this.clone(),ce=b(J,re,!0);return ce&&(te.$L=ce),te},X.clone=function(){return ie.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})(),Oe=ne.prototype;return g.prototype=Oe,[["$ms",n],["$s",i],["$m",s],["$H",d],["$W",m],["$M",v],["$y",x],["$D",T]].forEach((function(se){Oe[se[1]]=function(X){return this.$g(X,se[0],se[1])}})),g.extend=function(se,X){return se.$i||(se(X,ne,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 _j={};Es(_j,{createGoogleClient:()=>ae,getAccessToken:()=>ot,googleDrive:()=>vj,googleDriveAuth:()=>Y});module.exports=N0(_j);var z0=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))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(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 o(d,"_"),Object.defineProperty(d,"init",{value:n}),Object.defineProperty(d,Symbol.hasInstance,{value:o(m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(t),"value")}),Object.defineProperty(d,"name",{value:t}),d}o(fe,"$constructor");var Nr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Is=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},_l={};function sn(t){return t&&Object.assign(_l,t),_l}o(sn,"config");function wl(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}o(wl,"getEnumValues");function Fh(t,e){return typeof e=="bigint"?e.toString():e}o(Fh,"jsonStringifyReplacer");function Rs(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Rs,"cached");function Lh(t){return t==null}o(Lh,"nullish");function Ds(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(Ds,"cleanRegex");var Mh=Symbol("evaluating");function yt(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Mh)return n===void 0&&(n=Mh,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(yt,"defineLazy");var bl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Mi(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(Mi,"isObject");var k0=Rs(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function jh(t){if(Mi(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Mi(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(jh,"isPlainObject");var qh=new Set(["string","number","symbol"]);function Fo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Fo,"escapeRegex");function $s(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o($s,"clone");function at(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:o(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:o(()=>e.error,"error")}:e}o(at,"normalizeParams");function Bh(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(Bh,"optionalKeys");var Vh={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 Lo(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}o(Lo,"aborted");function On(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(On,"prefixIssues");function As(t){return typeof t=="string"?t:t?.message}o(As,"unwrapMessage");function Cn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=As(t.inst?._zod.def?.error?.(t))??As(e?.error?.(t))??As(r.customError?.(t))??As(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(Cn,"finalizeIssue");function Gh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(Gh,"getLengthableOrigin");function Tl(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o(Tl,"issue");var Hh=o((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Fh,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),Wh=fe("$ZodError",Hh),Fi=fe("$ZodError",Hh,{Parent:Error});var M0=o(t=>(e,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},d=e._zod.run({value:r,issues:[]},s);if(d instanceof Promise)throw new Nr;if(d.issues.length){let m=new(i?.Err??t)(d.issues.map(h=>Cn(h,s,sn())));throw bl(m,i?.callee),m}return d.value},"_parse"),Os=M0(Fi),F0=o(t=>async(e,r,n,i)=>{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(i?.Err??t)(d.issues.map(h=>Cn(h,s,sn())));throw bl(m,i?.callee),m}return d.value},"_parseAsync"),Cs=F0(Fi),L0=o(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Nr;return s.issues.length?{success:!1,error:new(t??Wh)(s.issues.map(d=>Cn(d,i,sn())))}:{success:!0,data:s.value}},"_safeParse"),Li=L0(Fi),j0=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(d=>Cn(d,i,sn())))}:{success:!0,data:s.value}},"_safeParseAsync"),ji=j0(Fi);var q0="(?:(?:\\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])))",B0=new RegExp(`^${q0}$`);var Zh=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Kh=/^-?\d+n?$/,Jh=/^-?\d+$/,Sl=/^-?\d+(?:\.\d+)?$/,Yh=/^(?: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=[])}),V0={number:"number",bigint:"bigint",object:"date"};var Xh=fe("$ZodCheckGreaterThan",(t,e)=>{Nn.init(t,e);let r=V0[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}});var Qh=fe("$ZodCheckNumberFormat",(t,e)=>{Nn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,s]=Vh[e.format];t._zod.onattach.push(d=>{let m=d._zod.bag;m.format=e.format,m.minimum=i,m.maximum=s,r&&(m.pattern=Jh)}),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<i&&d.issues.push({origin:"number",input:m,code:"too_small",minimum:i,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 eg=fe("$ZodCheckMinLength",(t,e)=>{var r;Nn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Lh(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let d=Gh(i);n.issues.push({origin:d,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var xl=fe("$ZodCheckStringFormat",(t,e)=>{var r,n;Nn.init(t,e),t._zod.onattach.push(i=>{let s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),tg=fe("$ZodCheckRegex",(t,e)=>{xl.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 ng={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=ng;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let s of i._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=o((d,m,h)=>{let v=Lo(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,w=x._zod.check(d);if(w instanceof Promise&&h?.async===!1)throw new Nr;if(_||w instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await w,d.issues.length!==T&&(v||(v=Lo(d,T)))});else{if(d.issues.length===T)continue;v||(v=Lo(d,T))}}return _?_.then(()=>d):d},"runChecks"),s=o((d,m,h)=>{if(Lo(d))return d.aborted=!0,d;let v=i(m,n,h);if(v instanceof Promise){if(h.async===!1)throw new Nr;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 Nr;return h.then(v=>i(v,n,m))}return i(h,n,m)}}yt(t,"~standard",()=>({validate:o(i=>{try{let s=Li(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return ji(t,i).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},"validate"),vendor:"zod",version:1}))}),ks=fe("$ZodString",(t,e)=>{dt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Zh(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}}),El=fe("$ZodStringFormat",(t,e)=>{xl.init(t,e),ks.init(t,e)});var ug=fe("$ZodURL",(t,e)=>{El.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}});var Il=fe("$ZodNumber",(t,e)=>{dt.init(t,e),t._zod.pattern=t._zod.bag.pattern??Sl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}}),cg=fe("$ZodNumberFormat",(t,e)=>{Qh.init(t,e),Il.init(t,e)}),Al=fe("$ZodBoolean",(t,e)=>{dt.init(t,e),t._zod.pattern=Yh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),lg=fe("$ZodBigInt",(t,e)=>{dt.init(t,e),t._zod.pattern=Kh,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 dg=fe("$ZodAny",(t,e)=>{dt.init(t,e),t._zod.parse=r=>r}),pg=fe("$ZodUnknown",(t,e)=>{dt.init(t,e),t._zod.parse=r=>r});var fg=fe("$ZodVoid",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),mg=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 i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:t}),r}});function og(t,e,r){t.issues.length&&e.issues.push(...On(r,t.issues)),e.value[r]=t.value}o(og,"handleArrayResult");var hg=fe("$ZodArray",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let s=[];for(let d=0;d<i.length;d++){let m=i[d],h=e.element._zod.run({value:m,issues:[]},n);h instanceof Promise?s.push(h.then(v=>og(v,r,d))):og(h,r,d)}return s.length?Promise.all(s).then(()=>r):r}});function zs(t,e,r,n,i){if(t.issues.length){if(i&&!(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}o(zs,"handlePropertyResult");function G0(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=Bh(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(G0,"normalizeDef");function H0(t,e,r,n,i,s){let d=[],m=i.keySet,h=i.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(w=>zs(w,r,x,e,_))):zs(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}o(H0,"handleCatchall");var gg=fe("$ZodObject",(t,e)=>{if(dt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let m=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let h={...m};return Object.defineProperty(e,"shape",{value:h}),h},"get")})}let n=Rs(()=>G0(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 i=Mi,s=e.catchall,d;t._zod.parse=(m,h)=>{d??(d=n.value);let v=m.value;if(!i(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 w=x[T],S=w._zod.optout==="optional",D=w._zod.run({value:v[T],issues:[]},h);D instanceof Promise?_.push(D.then(E=>zs(E,m,T,v,S))):zs(D,m,T,v,S)}return s?H0(_,v,m,h,n.value,t):_.length?Promise.all(_).then(()=>m):m}});function ig(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let i=t.filter(s=>!Lo(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(d=>Cn(d,n,sn())))}),e)}o(ig,"handleUnionResults");var Rl=fe("$ZodUnion",(t,e)=>{dt.init(t,e),yt(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),yt(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),yt(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),yt(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Ds(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,s)=>{if(r)return n(i,s);let d=!1,m=[];for(let h of e.options){let v=h._zod.run({value:i.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=>ig(h,i,t,s)):ig(m,i,t,s)}});var yg=fe("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Rl.init(t,e);let r=t._zod.parse;yt(t._zod,"propValues",()=>{let i={};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)){i[m]||(i[m]=new Set);for(let v of h)i[m].add(v)}}return i});let n=Rs(()=>{let i=e.options,s=new Map;for(let d of i){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=(i,s)=>{let d=i.value;if(!Mi(d))return i.issues.push({code:"invalid_type",expected:"object",input:d,inst:t}),i;let m=n.value.get(d?.[e.discriminator]);return m?m._zod.run(i,s):e.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:d,path:[e.discriminator],inst:t}),i)}});var vg=fe("$ZodRecord",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!jh(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,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:i[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 i)m.has(v)||(h=h??[],h.push(v));h&&h.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:h})}else{r.value={};for(let m of Reflect.ownKeys(i)){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"&&Sl.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]=i[m]:r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(x=>Cn(x,n,sn())),input:m,path:[m],inst:t});continue}let _=e.valueType._zod.run({value:i[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 _g=fe("$ZodEnum",(t,e)=>{dt.init(t,e);let r=wl(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>qh.has(typeof i)).map(i=>typeof i=="string"?Fo(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{let d=i.value;return n.has(d)||i.issues.push({code:"invalid_value",values:r,input:d,inst:t}),i}}),Pg=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"?Fo(n):n?Fo(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var wg=fe("$ZodTransform",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Is(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(d=>(r.value=d,r));if(i instanceof Promise)throw new Nr;return r.value=i,r}});function ag(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(ag,"handleOptionalResult");var bg=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(`^(${Ds(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>ag(s,r.value)):ag(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var Tg=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(`^(${Ds(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 Sg=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=>Ns(d,e.in,n)):Ns(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Ns(s,e.out,n)):Ns(i,e.out,n)}});function Ns(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(Ns,"handlePipeResult");var xg=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,i=e.fn(n);if(i instanceof Promise)return i.then(s=>sg(s,r,n,t));sg(i,r,n,t)}});function sg(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(Tl(i))}}o(sg,"handleRefineResult");var Ig;var Dl=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ag(){return new Dl}o(Ag,"registry");(Ig=globalThis).__zod_globalRegistry??(Ig.__zod_globalRegistry=Ag());var $l=globalThis.__zod_globalRegistry;function Rg(t,e){return new t({type:"string",...at(e)})}o(Rg,"_string");function Dg(t,e){return new t({type:"string",coerce:!0,...at(e)})}o(Dg,"_coercedString");function $g(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...at(e)})}o($g,"_url");function Og(t,e){return new t({type:"number",checks:[],...at(e)})}o(Og,"_number");function Cg(t,e){return new t({type:"number",coerce:!0,checks:[],...at(e)})}o(Cg,"_coercedNumber");function Ng(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...at(e)})}o(Ng,"_int");function zg(t,e){return new t({type:"boolean",...at(e)})}o(zg,"_boolean");function kg(t,e){return new t({type:"boolean",coerce:!0,...at(e)})}o(kg,"_coercedBoolean");function Ug(t,e){return new t({type:"bigint",coerce:!0,...at(e)})}o(Ug,"_coercedBigint");function Mg(t){return new t({type:"any"})}o(Mg,"_any");function Fg(t){return new t({type:"unknown"})}o(Fg,"_unknown");function Lg(t,e){return new t({type:"void",...at(e)})}o(Lg,"_void");function jg(t,e){return new t({type:"date",coerce:!0,...at(e)})}o(jg,"_coercedDate");function Us(t,e){return new Xh({check:"greater_than",...at(e),value:t,inclusive:!0})}o(Us,"_gte");function wr(t,e){return new eg({check:"min_length",...at(e),minimum:t})}o(wr,"_minLength");function zn(t,e){return new tg({check:"string_format",format:"regex",...at(e),pattern:t})}o(zn,"_regex");function qg(t,e,r){let n=at(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(qg,"_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)=>Os(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Li(t,r,n),t.parseAsync=async(r,n)=>Cs(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>ji(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)=>$s(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),Fs=fe("ZodMiniString",(t,e)=>{ks.init(t,e),vt.init(t,e)});function I(t){return Rg(Fs,t)}o(I,"string");var Bg=fe("ZodMiniStringFormat",(t,e)=>{El.init(t,e),Fs.init(t,e)});var iD=fe("ZodMiniURL",(t,e)=>{ug.init(t,e),Bg.init(t,e)});function Vg(t){return $g(iD,t)}o(Vg,"url");var Ls=fe("ZodMiniNumber",(t,e)=>{Il.init(t,e),vt.init(t,e)});function xt(t){return Og(Ls,t)}o(xt,"number");var aD=fe("ZodMiniNumberFormat",(t,e)=>{cg.init(t,e),Ls.init(t,e)});function Gg(t){return Ng(aD,t)}o(Gg,"int");var Ol=fe("ZodMiniBoolean",(t,e)=>{Al.init(t,e),vt.init(t,e)});function Ge(t){return zg(Ol,t)}o(Ge,"boolean");var Hg=fe("ZodMiniBigInt",(t,e)=>{lg.init(t,e),vt.init(t,e)});var sD=fe("ZodMiniAny",(t,e)=>{dg.init(t,e),vt.init(t,e)});function Bi(){return Mg(sD)}o(Bi,"any");var uD=fe("ZodMiniUnknown",(t,e)=>{pg.init(t,e),vt.init(t,e)});function Ae(){return Fg(uD)}o(Ae,"unknown");var cD=fe("ZodMiniVoid",(t,e)=>{fg.init(t,e),vt.init(t,e)});function Wg(t){return Lg(cD,t)}o(Wg,"_void");var Zg=fe("ZodMiniDate",(t,e)=>{mg.init(t,e),vt.init(t,e)});var lD=fe("ZodMiniArray",(t,e)=>{hg.init(t,e),vt.init(t,e)});function Se(t,e){return new lD({type:"array",element:t,...at(e)})}o(Se,"array");var dD=fe("ZodMiniObject",(t,e)=>{gg.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 dD(r)}o(U,"object");var pD=fe("ZodMiniUnion",(t,e)=>{Rl.init(t,e),vt.init(t,e)});function ke(t,e){return new pD({type:"union",options:t,...at(e)})}o(ke,"union");var fD=fe("ZodMiniDiscriminatedUnion",(t,e)=>{yg.init(t,e),vt.init(t,e)});function kn(t,e,r){return new fD({type:"union",options:e,discriminator:t,...at(r)})}o(kn,"discriminatedUnion");var mD=fe("ZodMiniRecord",(t,e)=>{vg.init(t,e),vt.init(t,e)});function Re(t,e,r){return new mD({type:"record",keyType:t,valueType:e,...at(r)})}o(Re,"record");var hD=fe("ZodMiniEnum",(t,e)=>{_g.init(t,e),vt.init(t,e),t.options=Object.values(e.entries)});function we(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new hD({type:"enum",entries:r,...at(e)})}o(we,"_enum");var gD=fe("ZodMiniLiteral",(t,e)=>{Pg.init(t,e),vt.init(t,e)});function ve(t,e){return new gD({type:"literal",values:Array.isArray(t)?t:[t],...at(e)})}o(ve,"literal");var yD=fe("ZodMiniTransform",(t,e)=>{wg.init(t,e),vt.init(t,e)});function Un(t){return new yD({type:"transform",transform:t})}o(Un,"transform");var vD=fe("ZodMiniOptional",(t,e)=>{bg.init(t,e),vt.init(t,e)});function W(t){return new vD({type:"optional",innerType:t})}o(W,"optional");var _D=fe("ZodMiniNullable",(t,e)=>{Tg.init(t,e),vt.init(t,e)});function Vi(t){return new _D({type:"nullable",innerType:t})}o(Vi,"nullable");var PD=fe("ZodMiniPipe",(t,e)=>{Sg.init(t,e),vt.init(t,e)});function Mn(t,e){return new PD({type:"pipe",in:t,out:e})}o(Mn,"pipe");var wD=fe("ZodMiniCustom",(t,e)=>{xg.init(t,e),vt.init(t,e)});function js(t,e){return qg(wD,t??(()=>!0),e)}o(js,"custom");var Gi={};Es(Gi,{bigint:()=>ID,boolean:()=>ED,date:()=>AD,number:()=>xD,string:()=>SD});function SD(t){return Dg(Fs,t)}o(SD,"string");function xD(t){return Cg(Ls,t)}o(xD,"number");function ED(t){return kg(Ol,t)}o(ED,"boolean");function ID(t){return Ug(Hg,t)}o(ID,"bigint");function AD(t){return jg(Zg,t)}o(AD,"date");var Nl=U({retryOnFailure:U({defaultValue:W(Ge()),hide:W(Ge())}),continueOnFailure:U({defaultValue:W(Ge()),hide:W(Ge())})}),Cl=class{constructor(e,r,n,i,s,d,m,h,v,_,x,T,w){this.name=e;this.displayName=r;this.description=n;this.props=i;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=w}static{o(this,"IAction")}},ee=o(t=>new Cl(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(Ge()),width:W(we(["half","full"])),icon:W(I()),placeholder:W(I())}),De=o((t,e)=>U({type:ve(e),required:Ge(),defaultValue:W(Bi())}),"TPropertyValue");var Wt=U({...qe.shape,...De(I(),"SHORT_TEXT").shape}),un=U({...qe.shape,...De(I(),"LONG_TEXT").shape});var Jg=U({label:I(),value:Ae(),description:W(I()),icon:W(I())}),qs=U({disabled:W(Ge()),placeholder:W(I()),options:Se(Jg)});var DD=we(["cards"]),Zt=U({...qe.shape,options:qs,display:W(DD),...De(Ae(),"STATIC_DROPDOWN").shape}),cn=U({...qe.shape,options:qs,...De(Se(Ae()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var zl=U({...qe.shape,...De(Ae(),"DROPDOWN").shape,refreshers:Se(I())}),Hi=U({...qe.shape,...De(Se(Ae()),"MULTI_SELECT_DROPDOWN").shape,refreshers:Se(I())});var ln=U({...qe.shape,reveals:W(Se(I())),...De(Ge(),"CHECKBOX").shape});var dn=U({...qe.shape,display:W(we(["stepper"])),min:W(xt()),max:W(xt()),step:W(xt()),...De(xt(),"NUMBER").shape});var Wi=U({...qe.shape,streaming:W(Ge()),...De(Ae(),"FILE").shape});var Zi=U({...qe.shape,...De(I(),"DATE_TIME").shape});var Yg=Re(I(),ke([Wt,un,Zt,Hi,cn,ln,dn,Wi,Zi])),Ki=U({...qe.shape,properties:Yg,...De(Se(Ae()),"ARRAY").shape});var Xg=we(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Qg=U({preset:W(Xg),after:W(I()),before:W(I())}),kl=U({...qe.shape,display:W(we(["dropdown"])),...De(Qg,"DATE_RANGE").shape});var Ji=U({...qe.shape,...De(ke([Re(I(),Ae())]),"JSON").shape});var ey=ke([Wt,Zt,Ji,Ki,cn]),$D=Re(I(),ey),Ul=U({refreshers:Se(I()),...qe.shape,...De(Ae(),"DYNAMIC").shape});var Bs=U({...qe.shape,...De(Wg(),"MARKDOWN").shape});var Yi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Yi||{}),jo=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(jo||{}),qo=(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))(qo||{});var Xi=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Xi||{}),Ml="both_client_credentials_and_authorization_code";var pn=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(pn||{}),Qi=(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))(Qi||{}),OD=U({strategy:we(Qi),paramName:W(I())}),ea=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ea||{});var Vs=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Vs||{}),ty=U({status:W(xt()),body:W(Ae()),headers:W(Re(I(),I()))}),ry=U({type:ve("DELAY"),resumeDateTime:I(),requestIdToReply:W(I()),handlerId:W(I()),streamStepProgress:W(we(Vs))}),ny=U({type:ve("WEBHOOK"),requestId:I(),requestIdToReply:W(I()),response:ty,handlerId:W(I()),streamStepProgress:W(we(Vs))}),CD=ke([ry,ny]);var ND=U({body:Ae(),rawBody:W(Ae()),headers:Re(I(),I()),queryParams:Re(I(),I())});function mt(t){return t==null}o(mt,"isNil");function ta(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(ta,"isEmpty");function Gs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(Gs,"assertNotNullOrUndefined");var Fl=ue(require("crypto"),1);var zD=128,Fn,Bo,kD=o(t=>{if(t<0)throw new RangeError("Wrong ID size");try{!Fn||Fn.length<t?(Fn=Buffer.allocUnsafe(t*zD),Fl.default.randomFillSync(Fn),Bo=0):Bo+t>Fn.length&&(Fl.default.randomFillSync(Fn),Bo=0)}catch(e){throw Fn=void 0,e}Bo+=t},"fillPool"),UD=o(t=>(kD(t|=0),Fn.subarray(Bo-t,Bo)),"random"),MD=o((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(s=e)=>{if(s<=0)return"";let d="";for(;;){let m=r(i),h=i;for(;h--;)if(d+=t[m[h]&n]||"",d.length===s)return d}}},"customRandom"),iy=o((t,e=21)=>MD(t,e,UD),"customAlphabet");var FD="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ay=21,nZ=I().check(zn(new RegExp(`^[0-9a-zA-Z]{${ay}}$`))),LD=iy(FD,ay);var Ln=Mn(Un(t=>t instanceof Date?t.toISOString():t),I()),cr={id:I(),created:Ln,updated:Ln},ut=o(t=>W(Vi(t)),"Nullable");function Ll(t){return W(Vi(we(t)))}o(Ll,"NullableEnum");var aZ=Mn(Un(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),W(Ge())),Hs=o(t=>Mn(Un(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),W(Se(t))),"OptionalArrayFromQuery");var cZ=Re(I(),Ae());var ra=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(ra||{});var wZ=I().check(zn(/^#[0-9A-Fa-f]{6}$/));var TZ=U({filename:I(),data:Ae(),type:ve("file"),mimetype:W(I())});var jD=ue(uy());var DZ=U({...cr,name:I(),permissions:Se(I()),platformId:ut(I()),type:I(),userCount:W(xt())});var cy=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(cy||{}),jl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(jl||{}),ql=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(ql||{});var Bl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Bl||{});var Vl=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Vl||{});var qD=U({mode:we(cy),value:Ae()}),BD=U({auth:W(I()),fields:Re(I(),qD)}),VD=U({pieceName:I(),pieceVersion:I(),actionName:I(),predefinedInput:W(BD)}),GD=U({type:ve("PIECE"),toolName:I().check(wr(1)),pieceMetadata:VD}),HD=U({type:ve("none")}),WD=U({type:ve("access_token"),accessToken:I()}),ZD=U({type:ve("api_key"),apiKey:I(),apiKeyHeader:I()}),KD=U({type:ve("headers"),headers:Re(I(),I())}),JD=kn("type",[HD,WD,ZD,KD]),ly=U({type:ve("FLOW"),toolName:I().check(wr(1)),externalFlowId:I(),flowDisplayName:W(I())}),dy=U({type:ve("MCP"),toolName:I().check(wr(1)),serverUrl:Vg(),protocol:we(ql),auth:JD}),py=U({type:ve("KNOWLEDGE_BASE"),toolName:I().check(wr(1)),sourceType:we(jl),sourceId:I(),sourceName:I()}),YD=kn("type",[GD,ly,dy,py]),XD=U({displayName:I(),description:W(I()),type:we(Bl)}),fy=U({type:ve("MARKDOWN"),markdown:I()}),Vo={type:ve("TOOL_CALL"),input:ut(Re(I(),Ae())),output:W(Ae()),toolName:I(),status:we(Vl),toolCallId:I(),startTime:I(),endTime:W(I())},s3=U(Vo),my=kn("toolCallType",[U({...Vo,toolCallType:ve("PIECE"),pieceName:I(),pieceVersion:I(),actionName:I()}),U({...Vo,toolCallType:ve("FLOW"),displayName:I(),externalFlowId:I()}),U({...Vo,toolCallType:ve("MCP"),displayName:I(),serverUrl:I()}),U({...Vo,toolCallType:ve("KNOWLEDGE_BASE"),displayName:I(),sourceType:I()}),U({...Vo,toolCallType:ve("UNKNOWN"),displayName:I()})]),QD=ke([fy,my]);var Gl=(r=>(r.IMAGE="image",r.TEXT="text",r))(Gl||{}),fn=U({apiKey:I()}),e$=fn,t$=U({apiKey:I(),apiKeyHash:I()}),r$=fn,n$=fn,o$=fn,i$=fn,a$=fn,s$=fn,u$=fn,_y=U({accessKeyId:I().check(wr(1)),secretAccessKey:I().check(wr(1))}),c$=U({}),l$=U({}),d$=U({}),p$=U({}),f$=U({}),m$=U({}),Py=U({modelId:I(),modelName:I(),modelType:we(Gl)}),wy=U({apiKeyHeader:I(),baseUrl:I(),models:Se(Py),defaultHeaders:W(Re(I(),I()))}),by=U({accountId:I(),gatewayId:I(),models:Se(Py),vertexProject:W(I()),vertexRegion:W(I())}),Ty=U({resourceName:I(),apiVersion:Mn(Un(t=>typeof t=="string"&&t.trim().length===0?void 0:t),W(I()))}),Sy=U({region:I().check(wr(1))}),h$=ke([e$,o$,i$,a$,s$,n$,r$,t$,_y,u$]),xy=ke([wy,by,Ty,Sy,c$,d$,p$,f$,l$,m$]),g$=U({id:I(),name:I(),type:we(Gl)}),y$=U({id:I(),name:I(),provider:we(ra),config:xy,enabledForChat:Ge()}),v$=U({provider:we(ra),config:xy,auth:h$,platformId:I()});var d3={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},hy=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],_$=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],P$=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],gy=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],w$=["grok-4.20","grok-4.1-fast"],b$={openai:hy,anthropic:_$,google:gy,activepieces:[...P$.map(t=>`anthropic/${t}`),...hy.map(t=>`openai/${t}`),...gy.map(t=>`google/${t}`),...w$.map(t=>`x-ai/${t}`)]};var yy=128e3,T$={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function S$({provider:t}){return t?T$[t]??yy:yy}o(S$,"getMaxContextTokens");var vy={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"},x$={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},E$=new Set(["anthropic","mistral"]);function zr(t){return{chatModels:b$[t],maxContextTokens:S$({provider:t}),defaultEmbeddingModel:vy[t],supportsEmbedding:vy[t]!==void 0,supportsImageGeneration:!E$.has(t),webSearch:x$[t]}}o(zr,"buildProviderCapabilities");var I$={openai:zr("openai"),anthropic:zr("anthropic"),openrouter:zr("openrouter"),azure:zr("azure"),google:zr("google"),"cloudflare-gateway":zr("cloudflare-gateway"),custom:zr("custom"),bedrock:zr("bedrock"),mistral:zr("mistral"),activepieces:zr("activepieces")};var A$=U({base64Url:I(),fileName:I(),extension:W(I())}),R$=U({mimeType:I(),url:I(),fileName:W(I())}),Hl=ke([A$,R$]);var D$=ke([U({type:ve("file"),value:Hl}),U({type:ve("markdown"),value:I(),files:W(Se(Hl))})]),$$=U({sessionId:I(),message:I(),files:W(Se(I()))});var Iy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Iy||{}),Ay=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ay||{}),Wl=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Wl||{});var O$=ke([U({...cr,name:I(),externalId:I(),type:ve("STATIC_DROPDOWN"),tableId:I(),projectId:I(),data:U({options:Se(U({value:I()}))})}),U({...cr,name:I(),externalId:I(),type:ke([ve("TEXT"),ve("NUMBER"),ve("DATE"),ve("DATETIME")]),tableId:I(),projectId:I()})]),C$=U({...cr,name:I(),folderId:ut(I()),projectId:I(),externalId:I(),status:Ll(Ay),trigger:Ll(Iy)}),N$=U({...cr,tableId:I(),projectId:I(),cells:Re(I(),U({updated:I(),created:I(),value:Ae(),fieldName:I()}))}),z$=U({events:Se(we(Wl)),webhookUrl:I(),flowId:I()}),k$=U({fields:Se(U({id:I(),name:I()})),rows:Se(Re(I(),I())),name:I()}),U$=U({projectId:I(),limit:W(Gi.number()),cursor:W(I()),name:W(I()),externalIds:Hs(I()),folderId:W(I()),folderIds:Hs(I())}),M$=U({records:Se(Se(U({fieldId:I(),value:Dy()}))),tableId:I()}),F$=U({cells:W(Se(U({fieldId:I(),value:Dy()}))),tableId:I(),agentUpdate:W(Ge())}),Ry=kn("operator",[so("eq"),so("neq"),so("gt"),so("gte"),so("lt"),so("lte"),so("co"),Ey("exists"),Ey("not_exists")]),L$=U({tableId:I(),limit:W(Gi.number()),cursor:W(I()),filters:Hs(Ry)});function Dy(){return Mn(Un(t=>t==null?t:String(t)),Vi(I()))}o(Dy,"coerceToString");function so(t){return U({fieldId:I(),operator:ve(t),value:I()})}o(so,"valueFilter");function Ey(t){return U({fieldId:I(),operator:ve(t)})}o(Ey,"existenceFilter");var j$=U({status:W(xt()),body:W(Ae()),headers:W(Re(I(),I()))}),q$=U({...cr,deleted:ut(Ln),ownerId:I(),displayName:I(),platformId:I(),externalId:ut(I())});var $y=U({name:I(),description:W(I()),type:I(),required:Ge()}),B$=U({pieceName:I(),triggerName:I(),input:U({toolName:I(),toolDescription:I(),inputSchema:Se($y),returnsResponse:Ge()})});var Oy="^[0-9]+\\.[0-9]+\\.[0-9]+$",D3=new RegExp(Oy),G$="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",$3=I().check(zn(new RegExp(Oy))),O3=I().check(zn(new RegExp(G$))),H$=U({packageType:ve("ARCHIVE"),pieceType:we(jo),pieceName:I(),pieceVersion:I(),archiveId:I(),platformId:I()}),Cy=U({packageType:ve("REGISTRY"),pieceType:ve("OFFICIAL"),pieceName:I(),pieceVersion:I()}),Ny=U({packageType:ve("REGISTRY"),pieceType:ve("CUSTOM"),pieceName:I(),pieceVersion:I(),platformId:I()}),C3=ke([Cy,Ny]),N3=ke([H$,Cy,Ny]);var W$=kn("type",[U({type:ve("CRON_EXPRESSION"),cronExpression:I(),timezone:I()}),U({type:ve("INTERVAL"),intervalMs:Gg().check(Us(6e4))})]),z3=U({...cr,type:we(pn),projectId:I(),flowId:I(),triggerName:I(),schedule:ut(W$),flowVersionId:I(),pieceName:I(),pieceVersion:I(),deleted:ut(I()),simulate:Ge()}),zy=(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))(zy||{}),ky=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ky||{}),Uy=(r=>(r.S3="S3",r.DB="DB",r))(Uy||{}),k3=U({...cr,projectId:ut(I()),platformId:ut(I()),type:we(zy),compression:we(ky),data:W(Ae()),location:we(Uy),size:ut(xt()),fileName:ut(I()),s3Key:ut(I()),metadata:ut(Re(I(),I()))}),My=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(My||{}),Fy=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Fy||{}),U3=U({id:I(),email:I(),firstName:I(),status:we(Fy),externalId:ut(I()),platformId:ut(I()),platformRole:we(My),lastName:I(),created:Ln,updated:Ln,lastActiveDate:ut(Ln),imageUrl:ut(I())});var Jl=U({...qe.shape,...De(Re(I(),Ae()),"OBJECT").shape});var Yl=U({...qe.shape,formatProperty:W(I()),...De(I(),"RICH_TEXT").shape});var jy=U({...qe.shape,...De(I(),"COLOR").shape});var Xl=ke([Wt,un,Yl,Bs,ln,Zt,cn,zl,Hi,Ul,dn,Ki,Jl,Ji,Zi,kl,Wi,jy]),C={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 kr=U({displayName:I(),description:W(I()),hasConnectionIdentifier:W(Ge())});var qy=U({username:I(),password:I()}),Ql=U({...kr.shape,username:U({displayName:I(),description:W(I())}),password:U({displayName:I(),description:W(I())}),...De(qy,"BASIC_AUTH").shape});var Y$=Re(I(),ke([Wt,un,dn,ln,Zt])),ed=U({...kr.shape,props:Y$,...De(Ae(),"CUSTOM_AUTH").shape});var uo=U({...kr.shape,...De(U({auth:I()}),"SECRET_TEXT").shape});var X$=Re(I(),ke([Wt,un,uo,dn,ln,Zt,cn,Bs])),By=U({...kr.shape,props:X$,...De(Ae(),"OIDC").shape});var td=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(td||{}),Vy=ke([Wt,uo,Zt]),Gy=Re(I(),Vy),Q$=U({props:W(Re(I(),Vy)),authUrl:I(),tokenUrl:I(),scope:Se(I()),prompt:W(ke([ve("none"),ve("consent"),ve("login"),ve("omit")])),pkce:W(Ge()),pkceMethod:W(ke([ve("plain"),ve("S256")])),authorizationMethod:W(we(td)),grantType:W(ke([we(Xi),ve(Ml)])),extra:W(Re(I(),I()))}),Hy=U({access_token:I(),props:W(Gy),data:Re(I(),Bi())}),rd=U({...kr.shape,...Q$.shape,...De(Hy,"OAUTH2").shape});var Go=ke([Ql,ed,By,rd,uo]),na="Connection",Ho={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||na}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||na,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||na}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||na}},None(){}};var PJ={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 eO=U({...qe.shape,...De(Ae(),"CUSTOM").shape,code:I()});var tO=ke([Xl,Go]),nd=Re(I(),tO),jJ=Re(I(),Xl);var Wy=ke([U({strategy:ve("CRON"),cronExpression:I()}),U({strategy:ve("NONE")})]),Wo=class{constructor(e,r,n,i,s,d,m,h,v,_,x,T,w,S,D,E,u,f,c,y,l){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;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=w;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{o(this,"ITrigger")}},Zs=o(t=>{switch(t.type){case"WEBHOOK":return new Wo(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 Wo(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 Wo(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 Wo(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 Zy="2",Ks="0.82.0";var od=class{constructor(e,r,n,i,s,d,m,h,v=Ks,_,x="",T){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=m;this.auth=h;this.minimumSupportedRelease=v;this.maximumSupportedRelease=_;this.description=x;this.deprecated=T;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Zy}),"getContextInfo");(!nO(v)||oO(v,Ks))&&(this.minimumSupportedRelease=Ks),s.forEach(w=>this._actions[w.name]=w),d.forEach(w=>this._triggers[w.name]=w)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:rO(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}},Jy=o(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new od(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 rO(t){if(t!==void 0)return Array.isArray(t)?t.map(Ky):Ky(t)}o(rO,"withConnectionIdentifierFlag");function Ky(t){return{...t,hasConnectionIdentifier:t.getConnectionIdentifier!==void 0}}o(Ky,"flagConnectionIdentifier");function nO(t){return/^\d+\.\d+\.\d+$/.test(t)}o(nO,"isValidSimpleSemver");function oO(t,e){let[r,n,i]=t.split(".").map(Number),[s,d,m]=e.split(".").map(Number);return r!==s?r<s:n!==d?n<d:i<m}o(oO,"isSemverLessThan");var iO=W(Re(I(),Re(I(),I()))),Yy=U({id:W(I()),name:I(),displayName:I(),logoUrl:I(),description:I(),authors:Se(I()),platformId:W(I()),directoryPath:W(I()),auth:W(ke([Go,Se(Go)])),version:I(),categories:W(Se(we(qo))),minimumSupportedRelease:W(I()),maximumSupportedRelease:W(I()),deprecated:W(Ge()),i18n:iO}),aO=we(["human","ai","both"]),Xy=U({description:W(I()),idempotent:W(Ge())}),Qy=we(["READ","WRITE"]),sO=we(["tabs","section","summary","builder","footer"]),ev=U({key:I(),display:sO,label:W(I()),description:W(I()),icon:W(I()),props:Se(I())}),tv=U({name:I(),displayName:I(),description:I(),props:nd,propertyGroups:W(Se(ev)),requireAuth:Ge(),errorHandlingOptions:W(Nl),outputSchema:W(js()),audience:W(aO),aiMetadata:W(Xy),classification:W(Qy)}),rv=U({name:I(),displayName:I(),description:I(),props:nd,propertyGroups:W(Se(ev)),errorHandlingOptions:W(Nl),type:we(pn),sampleData:Ae(),handshakeConfiguration:W(js()),renewConfiguration:W(Wy),testStrategy:we(ea),outputSchema:W(js()),aiMetadata:W(Xy),classification:W(Qy)}),uO=U({...Yy.shape,actions:Re(I(),tv),triggers:Re(I(),rv)}),cO=U({...Yy.shape,actions:xt(),triggers:xt(),suggestedActions:W(Se(tv)),suggestedTriggers:W(Se(rv))}),nv=U({projectUsage:xt(),pieceType:we(jo),packageType:we(Yi),platformId:W(I()),archiveId:W(I())}),B8=U({...uO.shape,...nv.shape}),V8=U({...cO.shape,...nv.shape}),G8=U({name:I(),version:I()});var lO=ue(require("path")),dO=ue(require("fs/promises"));var Zo=require("node:stream");var Js=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,d)=>{i.append(d,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};return e.authentication&&this.populateAuthentication(e.authentication,r),e.body&&(e.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var Ys=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new id,r=new ad){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},id=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},ad=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(e,r){let n=`${e.username}:${e.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var oa=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function ov({error:t,requestBody:e}){return t instanceof oa?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}o(ov,"toFailsafeOutput");var br=(d=>(d.GET="GET",d.POST="POST",d.PATCH="PATCH",d.PUT="PUT",d.DELETE="DELETE",d.HEAD="HEAD",d))(br||{});var Xs=class extends Js{static{o(this,"FetchHttpClient")}constructor(e="",r=new Ys){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),s=this.getHeaders(e),d=e.queryParams??{};for(let[c,y]of Object.entries(d))i.append(c,y);let m=i.toString(),h=m?`${n}?${m}`:n,v=e.responseType??"json",_=e.followRedirects??!0,x=e.retries??0,{body:T,extraHeaders:w,isStream:S}=pO(e.method)?fO(e.body,s):{body:void 0,extraHeaders:{},isStream:!1},D=hO({...s,...w}),E=await mO(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 iv(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 iv(E,v);return{status:E.status,headers:gO(E.headers),body:f}}};function pO(t){return t!=="GET"&&t!=="HEAD"}o(pO,"acceptsRequestBody");function fO(t,e){if(sv(t))return{body:void 0,extraHeaders:{},isStream:!1};if(yO(t)){let n=new Zo.PassThrough;return t.on("error",i=>n.destroy(i)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return t instanceof Zo.Readable?{body:t,extraHeaders:{},isStream:!0}:typeof t=="string"||Buffer.isBuffer(t)||t instanceof URLSearchParams||t instanceof ArrayBuffer||typeof FormData<"u"&&t instanceof FormData||typeof Blob<"u"&&t instanceof Blob?{body:t,extraHeaders:{},isStream:!1}:(e["Content-Type"]??e["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(t).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(t),extraHeaders:{},isStream:!1}}o(fO,"serializeBody");async function iv(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"stream":return sv(t.body)?Zo.Readable.from([]):Zo.Readable.fromWeb(t.body);case"blob":return await t.blob();case"text":return await t.text();default:{let r=await t.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(iv,"parseResponseBody");async function mO(t,e){let r;for(let n=0;n<=e;n++)try{let i=await t();if(i.status>=500&&n<e){await av(n);continue}return i}catch(i){if(r=i,n<e){await av(n);continue}throw i}throw r}o(mO,"sendWithRetries");function av(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(av,"backoff");function hO(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return e}o(hO,"normalizeHeaders");function gO(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(gO,"toHttpHeaders");function yO(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}o(yO,"isNodeFormData");function sv(t){return t==null}o(sv,"isNil");var ht=new Xs;var oN=ue(require("fs")),cP=ue(ca());var iN={"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 aN(t){let e=t.split(";")[0].trim().toLowerCase();return iN[e]??""}o(aN,"contentTypeToExtension");var sN=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),uN=o((t,e)=>{let r="https://api.example.com";try{let n=e?t(e):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function lP({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:s,props:d,extraProps:m,authLocation:h="headers"}){return ee({audience:"human",name:s||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:C.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:v})=>({url:C.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
69
+ i.e ${uN(e,v)}/resource or /resource`,required:!0,defaultValue:v?e(v):"",...d?.url??{}})}),"props")}),method:C.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(br).map(v=>({label:v,value:v}))},...d?.method??{}}),headers:C.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...d?.headers??{}}),queryParams:C.Object({displayName:"Query Parameters",required:!0,...d?.queryParams??{}}),body_type:C.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:C.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:v})=>{if(!v)return{};let _=v,x={};switch(_){case"none":break;case"json":x.data=C.Json({displayName:"JSON Body",required:!0,...d?.body??{}});break;case"raw":x.data=C.LongText({displayName:"Raw Body",required:!0});break;case"form_data":x.data=C.Array({displayName:"Form Data",required:!0,properties:{fieldName:C.ShortText({displayName:"Field Name",required:!0}),fieldType:C.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:C.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:C.File({displayName:"File Field Value",required:!1})}});break}return x},"props")}),response_is_binary:C.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:C.Checkbox({displayName:"No Error on Failure",required:!1,...d?.failsafe??{}}),timeout:C.Number({displayName:"Timeout (in seconds)",required:!1,...d?.timeout??{}}),followRedirects:C.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...m},run:o(async v=>{let{method:_,url:x,headers:T,queryParams:w,body:S,body_type:D,failsafe:E,timeout:u,response_is_binary:f,followRedirects:c}=v.propsValue;Gs(_,"Method"),Gs(x,"URL");let y=mt(r)?{}:await r(v.auth,v.propsValue),l=x.url,b=l.startsWith("http://")||l.startsWith("https://")?l:sN({baseUrl:e(v.auth),relativePath:l}),g={method:_,url:b,headers:{...T??{},...h==="headers"||!mt(h)?y:{}},queryParams:{...h==="queryParams"?y:{},...w??{}},timeout:u?u*1e3:0,followRedirects:c};if(f&&(g.responseType="arraybuffer"),S)if(D&&D!=="none"){let ie=S.data;if(D==="form_data"){let ne=ie,Oe=new cP.default;for(let{fieldName:se,fieldType:X,textFieldValue:J,fileFieldValue:re}of ne)X==="text"&&!ta(J)?Oe.append(se,J):X==="file"&&!ta(re)&&Oe.append(se,re.data,{filename:re?.filename});g.body=Oe,g.headers={...g.headers,...Oe.getHeaders()}}else g.body=ie}else D||(g.body=S);try{let ie=await ht.sendRequest(g);return await cN(v.files,ie.body,ie.status,ie.headers,f)}catch(ie){if(E)return ov({error:ie,requestBody:g.body});throw ie}},"run")})}o(lP,"createCustomApiCallAction");var cN=o(async(t,e,r,n,i)=>{let s;if(i&&lN(e)){let d=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],m=aN(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"),lN=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var Ur={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,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(i)||(_=_.slice(-i));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:i,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:i}))?.[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:i,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:i,server:s});break}}return dN(d.map(m=>m.data))}};function dN(t){return t.length<=5?t:t.slice(0,5)}o(dN,"getFirstFiveOrAll");var Tc=ue(ja());var gS=["https://www.googleapis.com/auth/drive","email"],Y=[Ho.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:gS}),Ho.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:C.LongText({displayName:"Service Account JSON Key",required:!0}),userEmail:C.ShortText({displayName:"User Email",required:!1,description:"Email address of the user to impersonate for domain-wide delegation."})},validate:o(async({auth:t})=>{try{await ot({type:"CUSTOM_AUTH",props:{...t}})}catch(e){return{valid:!1,error:e.message}}return{valid:!0}},"validate")})];async function ae(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 Tc.JWT({email:r.client_email,key:r.private_key,scopes:gS,subject:t.props.userEmail})}let e=new Tc.OAuth2Client;return e.setCredentials(t),e}o(ae,"createGoogleClient");var ot=o(async t=>{if(t.type==="CUSTOM_AUTH"){let r=await(await ae(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 CE=ue($e());var $m=ue(qc()),Om=ue($e());var tj=1e3,rj=o(t=>t.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),"escapeDriveQueryLiteral");async function zx({auth:t,searchValue:e,includeTeamDrives:r}){if(!t)return{disabled:!0,options:[],placeholder:"Please authenticate first"};let n=await ot(t),i=e?.trim()??"",s=["mimeType='application/vnd.google-apps.folder'","trashed = false"];i.length>0&&s.push(`name contains '${rj(i)}'`);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(tj),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}))}}o(zx,"fetchFolderDropdownOptions");var Fe={properties:{parentFolder:C.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:Y,refreshers:["include_team_drives"],refreshOnSearch:!0,options:o(async({auth:t,include_team_drives:e},r)=>zx({auth:t,searchValue:r?.searchValue,includeTeamDrives:e}),"options")}),include_team_drives:C.Checkbox({displayName:"Include Team Drives",description:"Determines if folders from Team Drives should be included in the results.",defaultValue:!1,required:!1})},fetchFolderDropdownOptions:zx,async getFiles(t,e,r){let n=await ae(t),i=(0,Om.drive)({version:"v3",auth:n}),s=[];e?.parent&&s.push(`'${e.parent}' in parents`),e?.createdTime&&s.push(`createdTime ${e.createdTimeOp??">"} '${(0,$m.default)(e.createdTime).format()}'`),s.push("trashed = false");let d=[],m;do{let h={q:s.concat("mimeType!='application/vnd.google-apps.folder'").join(" and "),fields:"nextPageToken, files(id, name, mimeType, webViewLink, kind, createdTime)",orderBy:r??"createdTime desc",supportsAllDrives:!0,includeItemsFromAllDrives:e?.includeTeamDrive,corpora:e?.includeTeamDrive?"allDrives":"user"};m&&(h.pageToken=m);let v=await i.files.list(h);d.push(...v.data.files??[]),m=v.data.nextPageToken??void 0}while(m);return d},async getFolders(t,e,r){let n=await ae(t),i=(0,Om.drive)({version:"v3",auth:n}),s=["mimeType='application/vnd.google-apps.folder'"];e?.parent&&s.push(`'${e.parent}' in parents`),e?.createdTime&&s.push(`createdTime ${e.createdTimeOp??">"} '${(0,$m.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 i.files.list(h);d.push(...v.data.files??[]),m=v.data.nextPageToken??void 0}while(m);return d}};var kx={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Ux={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Mx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Fx={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},Lx={fields:[{key:"name",label:"Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},jx={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"}]},qx={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"}]}]},Bx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Vx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Gx={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"}]}]},Hx={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"}]},Wx={fields:[{key:"role",label:"Role"},{key:"type",label:"Type"},{key:"id",label:"Permission ID"}]},Zx={fields:[{key:"removed",label:"Removed",value:"removed",format:"boolean"},{key:"message",label:"Message",value:"message"}]},Kx={fields:[{key:"name",label:"File Name"},{key:"id",label:"File ID"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},Jx={fields:[{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:"id",label:"File ID"}]},Yx={fields:[{key:"name",label:"Folder Name"},{key:"id",label:"Folder ID"},{key:"createdTime",label:"Created Time",format:"datetime"}]},nj=[{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"}]}],Xx={fields:nj},Qx={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"}]},eE={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"}]}]},tE={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"}]},rE={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"}]}]},nE={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"}]}]},oE={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"}]}]},iE={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"}]},aE={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"}]}]},sE={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"}]}]},uE={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"}]}]},cE={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"}]},lE={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"}]},dE={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"}]},pE={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"}]},fE={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"}]},mE={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"}]}]},hE={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"}]}]},gE={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"}]}]}]},yE={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"}]}]},vE={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"}]}]},_E={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"}]}]},PE={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"}]}]}]},wE={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"}]}]},bE={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"}]},TE={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"}]},SE={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"}]},xE={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"}]},EE={fields:[{key:"id",label:"File ID"},{key:"name",label:"File Name"},{key:"mimeType",label:"MIME Type"},{key:"kind",label:"Kind"}]},IE={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},AE={fields:[{key:"file",label:"File URL",value:"",format:"url"}]},RE={fields:[{key:"success",label:"Success",format:"boolean"},{key:"reply_id",label:"Reply ID"}]},DE={fields:[{key:"deleted",label:"Deleted",format:"boolean"},{key:"driveId",label:"Drive ID"}]},$E={fields:[{key:"success",label:"Success",format:"boolean"},{key:"driveId",label:"Drive ID"}]},OE={fields:[{key:"removed",label:"Removed",format:"boolean"},{key:"message",label:"Message"}]};var NE=ee({auth:Y,name:"update_permissions",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:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:C.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:C.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:Fe.properties.include_team_drives,send_invitation_email:C.Checkbox({displayName:"Send invitation email",description:"Send an email to the user to notify them of the new permissions",required:!0})},outputSchema:Wx,async run(t){let{fileId:e,user_email:r,permission_name:n,send_invitation_email:i,include_team_drives:s}=t.propsValue,d=await ae(t.auth),m=(0,CE.drive)({version:"v3",auth:d}),h={type:"user",role:n,emailAddress:r};return(await m.permissions.create({requestBody:h,fileId:e,sendNotificationEmail:i,supportsAllDrives:s})).data}});var zE=ue($e());var kE=ee({auth:Y,name:"create_new_gdrive_folder",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:C.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parentFolder:Fe.properties.parentFolder,include_team_drives:Fe.properties.include_team_drives},outputSchema:kx,async run(t){let e=await ae(t.auth);return(await(0,zE.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 UE=ue($e());var ME=ee({auth:Y,name:"create_new_gdrive_file",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:C.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:C.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),fileType:C.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:Fe.properties.parentFolder,include_team_drives:Fe.properties.include_team_drives},outputSchema:Ux,async run(t){let e=await ae(t.auth),r=(0,UE.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 FE=ue($e());var LE=ee({auth:Y,name:"delete_permissions",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:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),user_email:C.ShortText({displayName:"User email",description:"The email address of the user to update permissions for",required:!0}),permission_name:C.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:Zx,async run(t){let[e,r]=[t.propsValue.fileId,t.propsValue.user_email],n=await ae(t.auth),i=(0,FE.drive)({version:"v3",auth:n}),s=await i.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 i.permissions.delete({fileId:e,permissionId:d.id?d.id:""}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var jE=ue($e());var qE=ee({displayName:"Duplicate File",auth:Y,name:"duplicate_file",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:C.ShortText({displayName:"File ID",description:"The ID of the file to duplicate",required:!0}),name:C.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folderId:C.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be duplicated",required:!0}),mimeType:C.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:Fe.properties.include_team_drives},outputSchema:Bx,async run(t){let e=await ae(t.auth),r=t.propsValue.fileId,n=t.propsValue.name,i=t.propsValue.folderId,s=t.propsValue.mimeType,d=(0,jE.drive)({version:"v3",auth:e}),m={name:n,parents:[i]};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 BE=ue($e());var VE=ee({auth:Y,name:"get-file-or-folder-by-id",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:C.ShortText({displayName:"File / Folder Id",description:"The Id of the file/folder to search for.",required:!0}),include_team_drives:Fe.properties.include_team_drives},outputSchema:Lx,async run(t){let e=await ae(t.auth),n=await(0,BE.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.id,supportsAllDrives:t.propsValue.include_team_drives});return n.data?n.data:null}});var Cm=ue(require("querystring"));var HE=require("node:stream"),WE=ue(mn());async function ZE(t,e){let r=await ot(t);return(await fetch(`https://www.googleapis.com/drive/v3/files/${e}?fields=mimeType&supportsAllDrives=true`,{headers:{Authorization:`Bearer ${r}`}}).then(i=>i.json())).mimeType}o(ZE,"getMimeType");var GE=o(async(t,e,r,n,i)=>{let s=await ZE(e,r),d=await ot(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,LE.extension)(s),v=h?"."+h:"",P=o??r+v;return n.write({fileName:P,data:FE.Readable.fromWeb(m.body)})},"googledlCall");async function Bt(t,e,r,n){let o=await jE(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 ME(`https://www.googleapis.com/drive/v3/files/${r}/export?mimeType=${o}&supportsAllDrives=true`,t,r,e,n)}else return await ME(`https://www.googleapis.com/drive/v3/files/${r}?alt=media&supportsAllDrives=true`,t,r,e,n)}i(Bt,"downloadFileFromDrive");async function qE(t,e,r,n,o,s=0){let p=[];if(s>r)return p;let m=await pt(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"},P=await wt.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Dm.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of P.body.files)p.push({file:x,level:s,parentFolder:e});for(;P.body.nextPageToken;){v.pageToken=P.body.nextPageToken,P=await wt.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Dm.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of P.body.files)p.push({file:x,level:s,parentFolder:e})}if(s+1<r){let x=p.filter(T=>T.file.mimeType==="application/vnd.google-apps.folder");for(let T of x){let w=await qE(t,T.file.id,r,n,o,s+1);p.push(...w)}}return p}i(qE,"getFilesRecursively");var BE=ee({auth:J,name:"list-files",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:C.ShortText({displayName:"Folder ID",description:"Folder ID coming from | New Folder -> id | (or any other source)",required:!0}),include_team_drives:Le.properties.include_team_drives,includeTrashed:C.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depthLevel:C.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:C.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1})},outputSchema:Nx,async run(t){let e={type:"drive#fileList",incompleteSearch:!1,files:[]},r=t.propsValue.depthLevel||1,n=await qE(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 p of n){let m=p.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 P=await Bt(t.auth,t.files,m.id,h);o.push(P)}catch(P){console.warn(`Failed to download file ${m.name}: ${P instanceof Error?P.message:"Download failed"}`)}}e.downloadedFiles=o}return e}});var VE=ee({auth:J,name:"read-file",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:C.ShortText({displayName:"File ID",description:"File ID coming from | New File -> id |",required:!0}),fileName:C.ShortText({displayName:"Destination File name",required:!1})},outputSchema:Ox,run:i(async({auth:t,propsValue:e,files:r})=>Bt(t,r,e.fileId,e.fileName),"run")});var GE=ue(Ae()),HE=require("stream");var WE=ee({displayName:"Save Document as PDF",auth:J,name:"save_file_as_pdf",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:C.ShortText({displayName:"Document ID",description:"The ID of the document to export",required:!0}),folderId:C.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be exported",required:!0}),name:C.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0}),include_team_drives:Le.properties.include_team_drives},outputSchema:Ux,async run(t){let e=await ae(t.auth),r=t.propsValue.documentId,n=t.propsValue.folderId,o=t.propsValue.name,s=(0,GE.drive)({version:"v3",auth:e}),p=await s.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:o+".pdf",parents:[n]},h=Buffer.from(p.data,"base64"),P={mimeType:"application/pdf",body:new HE.Stream.PassThrough().end(h)};return(await s.files.create({requestBody:m,media:P,supportsAllDrives:t.propsValue.include_team_drives})).data}});var ZE=ue(Ae());var KE=ee({auth:J,name:"search-folder",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:C.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:C.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),query:C.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:C.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:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives},outputSchema:kx,async run(t){let e=await ae(t.auth),r=(0,ZE.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 P=await r.files.list(v);if(P.status!==200)throw console.error(P),new Error("Error searching for the file/folder");m.push(...P.data.files??[]),h=P.data.nextPageToken??void 0}while(h);return m.length>0?m:[]}});var JE=ue(Ln()),YE=ue(Ae());var XE=ee({auth:J,name:"upload_gdrive_file",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:C.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:C.File({displayName:"File",description:"The file URL or base64 to upload",required:!0,streaming:!0}),parentFolder:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives},outputSchema:$x,async run(t){let e=t.propsValue.file,r=JE.default.lookup(e.extension??"")||"application/octet-stream",n=await ae(t.auth);return(await(0,YE.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 eI=ue(qc());var Vc={strategy:0,items:i(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await Le.getFiles(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(s=>({epochMilliSeconds:(0,eI.default)(s.createdTime).valueOf(),data:s})),"items")},tI=Zs({auth:J,name:"new_file",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:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives,include_file_content:C.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:Bx,type:"POLLING",onEnable:i(async t=>{await Ur.onEnable(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:i(async t=>{await Ur.onDisable(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:i(async t=>{let e=await Ur.poll(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await QE(e,t)},"run"),test:i(async t=>{let e=await Ur.test(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await QE(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 QE(t,e){let r=JSON.parse(JSON.stringify(t));if(e.propsValue.include_file_content){let n=[];for(let s of r)n.push(Bt(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(QE,"handleFileContent");var rI=ue(qc());var Gc={strategy:0,items:i(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await Le.getFolders(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(s=>({epochMilliSeconds:(0,rI.default)(s.createdTime).valueOf(),data:s})),"items")},nI=Zs({auth:J,name:"new_folder",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:Le.properties.parentFolder,include_team_drives:Le.properties.include_team_drives},outputSchema:Vx,type:"POLLING",onEnable:i(async t=>{await Ur.onEnable(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:i(async t=>{await Ur.onDisable(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:i(async t=>await Ur.poll(Gc,t),"run"),test:i(async t=>await Ur.test(Gc,t),"test"),sampleData:{kind:"drive#file",mimeType:"application/vnd.google-apps.folder",id:"1aMEtTqIYn5651wdK7WLxaK_SDim4mvXW",name:"New Folder WOOOO"}});var iI=ue(Ae());var oI=ee({auth:J,name:"set_public_access",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:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),role:C.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:Fx,async run(t){let e=await ae(t.auth),r=t.propsValue.fileId,n=t.propsValue.role,o=(0,iI.drive)({version:"v3",auth:e}),s={role:n,type:"anyone"},p=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{...p.data,webViewLink:m.data.webViewLink,downloadUrl:null};let h=await Bt(t.auth,t.files,r,m.data.name);return{...p.data,downloadUrl:h}}});var aI=ue(Ae());var sI=ee({auth:J,name:"google-drive-move-file",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:C.ShortText({displayName:"File ID",description:"You can use **Search Folder/File** action to retrieve ID.",required:!0}),include_team_drives:Le.properties.include_team_drives,folderId:Le.properties.parentFolder},outputSchema:Mx,async run(t){let e=t.propsValue.fileId,r=t.propsValue.folderId,n=await ae(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 uI=ue(Ae()),cI=ee({auth:J,name:"delete_gdrive_file",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:C.ShortText({displayName:"File ID",description:"The ID of the file to delete",required:!0}),include_team_drives:Le.properties.include_team_drives},async run(t){let e=await ae(t.auth);return(await(0,uI.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives})).data}});var lI=ue(Ae());var dI=ee({auth:J,name:"trash_gdrive_file",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:C.ShortText({displayName:"File ID",description:"The ID of the file to trash",required:!0}),include_team_drives:Le.properties.include_team_drives},outputSchema:qx,async run(t){let e=await ae(t.auth),r=(0,lI.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 pI=ue(Ae());var fI=ee({auth:J,name:"drive_create_folder",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:gE,props:{folder_name:C.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parent_folder_id:C.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 ae(t.auth);return(await(0,pI.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 mI=ue(ua());var hI=ee({auth:J,name:"drive_create_file_from_text",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:Zx,props:{file_name:C.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:C.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),content_type:C.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:C.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 mI.default;return o.append("Metadata",r,{contentType:"application/json"}),o.append("Media",n,{contentType:t.propsValue.content_type}),(await wt.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 pt(t.auth)}})).body}});var gI=ue(ua());var yI=ue(Ln());var vI=ee({auth:J,name:"drive_upload_file",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:Kx,props:{file_name:C.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:C.File({displayName:"File",description:"The file URL or base64 to upload",required:!0}),parent_folder_id:C.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:yI.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"),p=new gI.default;return p.append("Metadata",o,{contentType:"application/json"}),p.append("Media",s),(await wt.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files",queryParams:{uploadType:"multipart",supportsAllDrives:"true"},body:p,headers:{...p.getHeaders()},authentication:{type:"BEARER_TOKEN",token:await pt(t.auth)}})).body}});var _I=ue(ua());var PI=ue(Ln());var wI=ee({auth:J,name:"drive_upload_from_url",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:_E,props:{source_url:C.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:C.ShortText({displayName:"File name",description:"The name to give the uploaded file in Drive.",required:!0}),mime_type:C.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:C.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 wt.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 p=n||PI.default.lookup(e)||"application/octet-stream",m={mimeType:p,name:r,...o?{parents:[o]}:{}},h=Buffer.from(JSON.stringify(m),"utf-8"),v=Buffer.from(s.body),P=new _I.default;return P.append("Metadata",h,{contentType:"application/json"}),P.append("Media",v,{contentType:p}),(await wt.sendRequest({method:"POST",url:"https://www.googleapis.com/upload/drive/v3/files",queryParams:{uploadType:"multipart",supportsAllDrives:"true"},body:P,headers:{...P.getHeaders()},authentication:{type:"BEARER_TOKEN",token:await pt(t.auth)}})).body}});var bI=ue(Ln());var TI=ee({auth:J,name:"drive_replace_file_content",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:oE,props:{file_id:C.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:C.File({displayName:"New File Content",description:"The file URL or base64 whose bytes will replace the existing content.",required:!0}),mime_type:C.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||bI.default.lookup(r.extension?r.extension:"")||"application/octet-stream",s=Buffer.from(r.base64,"base64");return(await wt.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 pt(t.auth)}})).body}});var SI=ee({auth:J,name:"drive_download_file",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:PE,props:{file_id:C.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:C.ShortText({displayName:"Destination File name",required:!1})},run:i(async({auth:t,propsValue:e,files:r})=>Bt(t,r,e.file_id,e.destination_file_name),"run")});var xI=ue(Ae()),EI=ue(Ln());var II=ee({auth:J,name:"drive_export_workspace_file",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:wE,props:{file_id:C.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:C.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 ae(t.auth),o=(0,xI.drive)({version:"v3",auth:n});try{let s=await o.files.export({fileId:e,mimeType:r},{responseType:"arraybuffer"}),p=(0,EI.extension)(r),m=p?"."+p:"";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 AI=ue(Ae());var RI=ee({auth:J,name:"drive_get_file",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:Gx,props:{file_id:C.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 ae(t.auth),n=await(0,AI.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.file_id,supportsAllDrives:!0});return n.data?n.data:null}});var $m=ue(require("querystring"));async function DI(t,e,r,n,o,s=0){let p=[];if(s>r)return p;let m=await pt(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"},P=await wt.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${$m.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of P.body.files)p.push({file:x,level:s,parentFolder:e});for(;P.body.nextPageToken;){v.pageToken=P.body.nextPageToken,P=await wt.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${$m.default.stringify(v)}`,headers:{Authorization:`Bearer ${m}`}});for(let x of P.body.files)p.push({file:x,level:s,parentFolder:e})}if(s+1<r){let x=p.filter(T=>T.file.mimeType==="application/vnd.google-apps.folder");for(let T of x){let w=await DI(t,T.file.id,r,n,o,s+1);p.push(...w)}}return p}i(DI,"getFilesRecursively");var $I=ee({auth:J,name:"drive_list_files",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:Hx,props:{folder_id:C.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:C.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depth_level:C.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:C.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1}),include_team_drives:C.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 DI(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 p of n){let m=p.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 P=await Bt(t.auth,t.files,m.id,h);o.push(P)}catch(P){console.warn(`Failed to download file ${m.name}: ${P instanceof Error?P.message:"Download failed"}`)}}e.downloadedFiles=o}return e}});var OI=ue(Ae());var CI=ee({auth:J,name:"drive_search_files",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:Wx,props:{query_term:C.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:C.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),value:C.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:C.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:C.ShortText({displayName:"Parent Folder ID",description:"(Optional) Restrict the search to files/folders inside this folder ID.",required:!1}),include_team_drives:C.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 ae(t.auth),r=(0,OI.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 P=await r.files.list(v);if(P.status!==200)throw console.error(P),new Error("Error searching for the file/folder");m.push(...P.data.files??[]),h=P.data.nextPageToken??void 0}while(h);return m.length>0?m:[]}});var NI=ue(Ae());var kI=ee({auth:J,name:"drive_copy_file",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:Jx,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file to duplicate. Resolve it via `drive_search_files`.",required:!0}),name:C.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folder_id:C.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:C.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 ae(t.auth),r=t.propsValue.file_id,n=t.propsValue.name,o=t.propsValue.folder_id,s=t.propsValue.convert_to,p=(0,NI.drive)({version:"v3",auth:e}),m={name:n,parents:[o]};s&&(m.mimeType=s);let h=await p.files.copy({fileId:r,auth:e,requestBody:m,supportsAllDrives:!0});if(h.status!==200)throw new Error("Error duplicating file");return h.data}});var zI=ue(Ae());var UI=ee({auth:J,name:"drive_move_file",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:Yx,props:{file_id:C.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:C.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 ae(t.auth),o=(0,zI.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 MI=ue(Ae());var FI=ee({auth:J,name:"drive_update_file_metadata",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:Xx,props:{file_id:C.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:C.ShortText({displayName:"New Name",description:"A new name for the file or folder. Leave empty to keep the current name.",required:!1}),description:C.ShortText({displayName:"Description",description:"A new description for the file or folder. Leave empty to keep the current description.",required:!1}),starred:C.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 p=await ae(t.auth),m=(0,MI.drive)({version:"v3",auth:p});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 LI=ue(Ae()),jI=require("stream");var qI=ee({auth:J,name:"drive_save_file_as_pdf",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:hE,props:{document_id:C.ShortText({displayName:"Document ID",description:"The ID of the document to export. Resolve it via `drive_search_files`.",required:!0}),folder_id:C.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:C.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0})},async run(t){let e=await ae(t.auth),r=t.propsValue.document_id,n=t.propsValue.folder_id,o=t.propsValue.name,s=(0,LI.drive)({version:"v3",auth:e}),p=await s.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:o+".pdf",parents:[n]},h=Buffer.from(p.data,"base64"),P={mimeType:"application/pdf",body:new jI.Stream.PassThrough().end(h)};return(await s.files.create({requestBody:m,media:P,supportsAllDrives:!0})).data}});var BI=ue(Ae());var VI=ee({auth:J,name:"drive_trash_file",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:nE,props:{file_id:C.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 ae(t.auth),r=(0,BI.drive)({version:"v3",auth:e}),n={trashed:!0};return(await r.files.update({fileId:t.propsValue.file_id,supportsAllDrives:!0,requestBody:n})).data}});var GI=ue(Ae());var HI=ee({auth:J,name:"drive_untrash_file",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:iE,props:{file_id:C.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 ae(t.auth),n=(0,GI.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 WI=ue(Ae()),ZI=ee({auth:J,name:"drive_delete_file",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:C.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 ae(t.auth);return(await(0,WI.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.file_id,supportsAllDrives:!0})).data}});var KI=ue(Ae());var JI=ee({auth:J,name:"drive_empty_trash",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:SE,props:{drive_id:C.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 ae(t.auth),n=(0,KI.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 YI=ue(Ae());var XI=ee({auth:J,name:"drive_share_file",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:Qx,props:{file_id:C.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:C.ShortText({displayName:"User Email",description:"The email address of the user to grant access to.",required:!0}),role:C.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:C.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 ae(t.auth),p=(0,YI.drive)({version:"v3",auth:s}),m={type:"user",role:n,emailAddress:r};return(await p.permissions.create({requestBody:m,fileId:e,sendNotificationEmail:o,supportsAllDrives:!0})).data}});var QI=ue(Ae());var eA=ee({auth:J,name:"drive_set_public_access",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:tE,props:{file_id:C.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:C.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 ae(t.auth),r=t.propsValue.file_id,n=t.propsValue.role,o=(0,QI.drive)({version:"v3",auth:e}),s={role:n,type:"anyone"},p=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{...p.data,webViewLink:m.data.webViewLink,downloadUrl:null};let h=await Bt(t.auth,t.files,r,m.data.name);return{...p.data,downloadUrl:h}}});var tA=ue(Ae());var rA=ee({auth:J,name:"drive_list_permissions",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:eE,props:{file_id:C.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 ae(t.auth),n=(0,tA.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(Ae());var iA=ee({auth:J,name:"drive_update_permission",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:rE,props:{file_id:C.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:C.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:C.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 ae(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(P=>P.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(p){throw p.code===404?new Error(`File or folder not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):p.code===403?new Error(`Permission denied updating the role on file ${e}. You may lack permission to manage sharing on this resource.`):p}}});var oA=ue(Ae());var aA=ee({auth:J,name:"drive_remove_permission",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:xE,props:{file_id:C.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:C.ShortText({displayName:"User Email",description:"The email address of the user whose access to revoke.",required:!0}),role:C.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 ae(t.auth),o=(0,oA.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 p of s.data.permissions)if(p.emailAddress===r&&p.role===t.propsValue.role)return await o.permissions.delete({fileId:e,permissionId:p.id?p.id:"",supportsAllDrives:!0}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var sA=ue(Ae());var uA=ee({auth:J,name:"drive_list_shared_drives",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:sE,props:{query:C.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:C.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 ae(t.auth),o=(0,sA.drive)({version:"v3",auth:n});try{let p=(await o.drives.list({q:e||void 0,pageSize:r||void 0})).data.drives??[];return{drives:p,count:p.length}}catch(s){throw s.code===403?new Error("Permission denied listing shared drives. Your account may not have shared-drive access."):s}}});var cA=ue(Ae());var lA=ee({auth:J,name:"drive_get_shared_drive",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:uE,props:{drive_id:C.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 ae(t.auth),n=(0,cA.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 dA=require("crypto");var pA=ue(Ae());var fA=ee({auth:J,name:"drive_create_shared_drive",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:yE,props:{name:C.ShortText({displayName:"Name",description:"The name of the new shared drive.",required:!0})},async run(t){let{name:e}=t.propsValue,r=await ae(t.auth),n=(0,pA.drive)({version:"v3",auth:r}),o=(0,dA.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 mA=ue(Ae());var hA=ee({auth:J,name:"drive_update_shared_drive",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:vE,props:{drive_id:C.ShortText({displayName:"Shared Drive ID",description:"The ID of the shared drive to update. Resolve it via drive_list_shared_drives.",required:!0}),name:C.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 ae(t.auth),o=(0,mA.drive)({version:"v3",auth:n}),s={};r&&(s.name=r);try{return(await o.drives.update({driveId:e,requestBody:s})).data}catch(p){throw p.code===404?new Error(`Shared drive not found (ID: ${e}). Resolve a valid ID via drive_list_shared_drives.`):p.code===403?new Error(`Permission denied updating shared drive ${e}. You must be an organizer of this drive.`):p}}});var gA=ue(Ae());var yA=ee({auth:J,name:"drive_delete_shared_drive",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:TE,props:{drive_id:C.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 ae(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 vA=ue(Ae());var _A=ee({auth:J,name:"drive_create_comment",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:dE,props:{file_id:C.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:C.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 ae(t.auth),o=(0,vA.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 PA=ue(Ae());var wA=ee({auth:J,name:"drive_list_comments",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:cE,props:{file_id:C.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 ae(t.auth),n=(0,PA.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 bA=ue(Ae());var TA=ee({auth:J,name:"drive_create_reply",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:lE,props:{file_id:C.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:C.ShortText({displayName:"Comment ID",description:"The ID of the comment to reply to. Resolve it via drive_list_comments.",required:!0}),content:C.LongText({displayName:"Content",description:"The plain-text content of the reply.",required:!0}),action:C.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 ae(t.auth),p=(0,bA.drive)({version:"v3",auth:s}),m={content:n};o&&(m.action=o);try{return(await p.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 SA=ue(Ae());var xA=ee({auth:J,name:"drive_get_reply",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:pE,props:{file_id:C.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:C.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:C.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 ae(t.auth),s=(0,SA.drive)({version:"v3",auth:o});try{return(await s.replies.get({fileId:e,commentId:r,replyId:n,fields:"*"})).data}catch(p){throw p.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.`):p.code===403?new Error(`Permission denied fetching reply ${n} on file ${e}. You may lack access to this file.`):p}}});var EA=ue(Ae());var IA=ee({auth:J,name:"drive_list_replies",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:fE,props:{file_id:C.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:C.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 ae(t.auth),o=(0,EA.drive)({version:"v3",auth:n});try{let p=(await o.replies.list({fileId:e,commentId:r,fields:"*"})).data.replies??[];return{replies:p,count:p.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 AA=ue(Ae());var RA=ee({auth:J,name:"drive_update_reply",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:mE,props:{file_id:C.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:C.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:C.ShortText({displayName:"Reply ID",description:"The ID of the reply to update. Resolve it via drive_list_replies.",required:!0}),content:C.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 ae(t.auth),p=(0,AA.drive)({version:"v3",auth:s});try{return(await p.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 DA=ue(Ae());var $A=ee({auth:J,name:"drive_delete_reply",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:bE,props:{file_id:C.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:C.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:C.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 ae(t.auth),s=(0,DA.drive)({version:"v3",auth:o});try{return await s.replies.delete({fileId:e,commentId:r,replyId:n}),{success:!0,reply_id:n}}catch(p){throw p.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.`):p.code===403?new Error(`Permission denied deleting reply ${n} on file ${e}. You can only delete your own replies.`):p}}});var OA=ue(Ae());var CA=ee({auth:J,name:"drive_get_about",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:aE,props:{},async run(t){let e=await ae(t.auth),r=(0,OA.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 BL=Hy({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:[tI,nI],actions:[RE,$E,XE,VE,UE,BE,KE,kE,WE,IE,CE,oI,sI,cI,dI,fI,hI,vI,wI,TI,SI,II,RI,$I,CI,kI,UI,FI,qI,VI,HI,ZI,JI,XI,eA,rA,iA,aA,uA,lA,fA,hA,yA,_A,wA,TA,xA,IA,RA,$A,CA,iP({baseUrl:i(()=>"https://www.googleapis.com/drive/v3","baseUrl"),auth:J,authMapping:i(async t=>({Authorization:`Bearer ${await pt(t)}`}),"authMapping")})],auth:J});0&&(module.exports={createGoogleClient,getAccessToken,googleDrive,googleDriveAuth});
72
+ Download file response: ${m.status} ${m.statusText}`);let h=(0,WE.extension)(s),v=h?"."+h:"",_=i??r+v;return n.write({fileName:_,data:HE.Readable.fromWeb(m.body)})},"googledlCall");async function Bt(t,e,r,n){let i=await ZE(t,r);if(["application/vnd.google-apps.document","application/vnd.google-apps.spreadsheet","application/vnd.google-apps.presentation"].includes(i)){switch(i){case"application/vnd.google-apps.document":i="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case"application/vnd.google-apps.spreadsheet":i="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";break;case"application/vnd.google-apps.presentation":i="application/vnd.openxmlformats-officedocument.presentationml.presentation";break}return await GE(`https://www.googleapis.com/drive/v3/files/${r}/export?mimeType=${i}&supportsAllDrives=true`,t,r,e,n)}else return await GE(`https://www.googleapis.com/drive/v3/files/${r}?alt=media&supportsAllDrives=true`,t,r,e,n)}o(Bt,"downloadFileFromDrive");async function KE(t,e,r,n,i,s=0){let d=[];if(s>r)return d;let m=await ot(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:i?"true":"false",corpora:i?"allDrives":"user",pageSize:"1000"},_=await ht.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Cm.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?${Cm.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 w=await KE(t,T.file.id,r,n,i,s+1);d.push(...w)}}return d}o(KE,"getFilesRecursively");var JE=ee({auth:Y,name:"list-files",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:C.ShortText({displayName:"Folder ID",description:"Folder ID coming from | New Folder -> id | (or any other source)",required:!0}),include_team_drives:Fe.properties.include_team_drives,includeTrashed:C.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depthLevel:C.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:C.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1})},outputSchema:jx,async run(t){let e={type:"drive#fileList",incompleteSearch:!1,files:[]},r=t.propsValue.depthLevel||1,n=await KE(t.auth,t.propsValue.folderId,r,t.propsValue.includeTrashed??!1,t.propsValue.include_team_drives??!1);if(e.files=n.map(i=>i.file),t.propsValue.downloadFiles){let i=[],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 Bt(t.auth,t.files,m.id,h);i.push(_)}catch(_){console.warn(`Failed to download file ${m.name}: ${_ instanceof Error?_.message:"Download failed"}`)}}e.downloadedFiles=i}return e}});var YE=ee({auth:Y,name:"read-file",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:C.ShortText({displayName:"File ID",description:"File ID coming from | New File -> id |",required:!0}),fileName:C.ShortText({displayName:"Destination File name",required:!1})},outputSchema:Fx,run:o(async({auth:t,propsValue:e,files:r})=>Bt(t,r,e.fileId,e.fileName),"run")});var XE=ue($e()),QE=require("stream");var eI=ee({displayName:"Save Document as PDF",auth:Y,name:"save_file_as_pdf",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:C.ShortText({displayName:"Document ID",description:"The ID of the document to export",required:!0}),folderId:C.ShortText({displayName:"Folder ID",description:"The ID of the folder where the file will be exported",required:!0}),name:C.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0}),include_team_drives:Fe.properties.include_team_drives},outputSchema:Vx,async run(t){let e=await ae(t.auth),r=t.propsValue.documentId,n=t.propsValue.folderId,i=t.propsValue.name,s=(0,XE.drive)({version:"v3",auth:e}),d=await s.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:i+".pdf",parents:[n]},h=Buffer.from(d.data,"base64"),_={mimeType:"application/pdf",body:new QE.Stream.PassThrough().end(h)};return(await s.files.create({requestBody:m,media:_,supportsAllDrives:t.propsValue.include_team_drives})).data}});var tI=ue($e());var rI=ee({auth:Y,name:"search-folder",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:C.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:C.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),query:C.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:C.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:Fe.properties.parentFolder,include_team_drives:Fe.properties.include_team_drives},outputSchema:qx,async run(t){let e=await ae(t.auth),r=(0,tI.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 nI=ue(mn()),oI=ue($e());var iI=ee({auth:Y,name:"upload_gdrive_file",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:C.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:C.File({displayName:"File",description:"The file URL or base64 to upload",required:!0,streaming:!0}),parentFolder:Fe.properties.parentFolder,include_team_drives:Fe.properties.include_team_drives},outputSchema:Mx,async run(t){let e=t.propsValue.file,r=nI.default.lookup(e.extension??"")||"application/octet-stream",n=await ae(t.auth);return(await(0,oI.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 sI=ue(qc());var Vc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await Fe.getFiles(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(s=>({epochMilliSeconds:(0,sI.default)(s.createdTime).valueOf(),data:s})),"items")},uI=Zs({auth:Y,name:"new_file",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:Fe.properties.parentFolder,include_team_drives:Fe.properties.include_team_drives,include_file_content:C.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:Jx,type:"POLLING",onEnable:o(async t=>{await Ur.onEnable(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:o(async t=>{await Ur.onDisable(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:o(async t=>{let e=await Ur.poll(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await aI(e,t)},"run"),test:o(async t=>{let e=await Ur.test(Vc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files});return await aI(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 aI(t,e){let r=JSON.parse(JSON.stringify(t));if(e.propsValue.include_file_content){let n=[];for(let s of r)n.push(Bt(e.auth,e.files,s.id,s.name));let i=await Promise.all(n);for(let s=0;s<r.length;s++)r[s].content=i[s]}return r}o(aI,"handleFileContent");var cI=ue(qc());var Gc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>(await Fe.getFolders(t,{parent:e.parentFolder,createdTime:r,includeTeamDrive:e.include_team_drives})??[]).map(s=>({epochMilliSeconds:(0,cI.default)(s.createdTime).valueOf(),data:s})),"items")},lI=Zs({auth:Y,name:"new_folder",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:Fe.properties.parentFolder,include_team_drives:Fe.properties.include_team_drives},outputSchema:Yx,type:"POLLING",onEnable:o(async t=>{await Ur.onEnable(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onEnable"),onDisable:o(async t=>{await Ur.onDisable(Gc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},"onDisable"),run:o(async t=>await Ur.poll(Gc,t),"run"),test:o(async t=>await Ur.test(Gc,t),"test"),sampleData:{kind:"drive#file",mimeType:"application/vnd.google-apps.folder",id:"1aMEtTqIYn5651wdK7WLxaK_SDim4mvXW",name:"New Folder WOOOO"}});var dI=ue($e());var pI=ee({auth:Y,name:"set_public_access",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:C.ShortText({displayName:"File or Folder ID",description:"The ID of the file or folder to update permissions for",required:!0}),role:C.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:Hx,async run(t){let e=await ae(t.auth),r=t.propsValue.fileId,n=t.propsValue.role,i=(0,dI.drive)({version:"v3",auth:e}),s={role:n,type:"anyone"},d=await i.permissions.create({fileId:r,requestBody:s}),m=await i.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 Bt(t.auth,t.files,r,m.data.name);return{...d.data,downloadUrl:h}}});var fI=ue($e());var mI=ee({auth:Y,name:"google-drive-move-file",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:C.ShortText({displayName:"File ID",description:"You can use **Search Folder/File** action to retrieve ID.",required:!0}),include_team_drives:Fe.properties.include_team_drives,folderId:Fe.properties.parentFolder},outputSchema:Gx,async run(t){let e=t.propsValue.fileId,r=t.propsValue.folderId,n=await ae(t.auth),i=(0,fI.drive)({version:"v3",auth:n}),s=await i.files.get({fileId:e,supportsAllDrives:t.propsValue.include_team_drives,fields:"id,parents"});return(await i.files.update({fileId:e,fields:"*",removeParents:s.data.parents?.join(","),addParents:r,supportsAllDrives:t.propsValue.include_team_drives})).data}});var hI=ue($e()),gI=ee({auth:Y,name:"delete_gdrive_file",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:C.ShortText({displayName:"File ID",description:"The ID of the file to delete",required:!0}),include_team_drives:Fe.properties.include_team_drives},async run(t){let e=await ae(t.auth);return(await(0,hI.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.fileId,supportsAllDrives:t.propsValue.include_team_drives})).data}});var yI=ue($e());var vI=ee({auth:Y,name:"trash_gdrive_file",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:C.ShortText({displayName:"File ID",description:"The ID of the file to trash",required:!0}),include_team_drives:Fe.properties.include_team_drives},outputSchema:Kx,async run(t){let e=await ae(t.auth),r=(0,yI.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 _I=require("node:stream"),PI=require("@zip.js/zip.js"),wI=ue(mn()),bI=ue(require("querystring"));var ij=4,aj=16*1024*1024,sj=8*1024*1024,uj=20,TI="application/vnd.google-apps.folder",cj={"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"}}},lj=`
73
+ - ZipCrypto: Legacy encryption method with wide compatibility (not recommended for sensitive data)
74
+ - AES-256: Modern encryption with strong security (may not be supported by older zip clients)
75
+ `;async function dj({auth:t,folderId:e,includeTeamDrives:r}){let n=await ot(t),i=[],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?${bI.default.stringify(s)}`,headers:{Authorization:`Bearer ${n}`}});i.push(...m.body.files??[]),d=m.body.nextPageToken}while(d);return i}o(dj,"listFolderChildren");function pj(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"}}o(pj,"checkSafeItemName");function fj(t,e){if(t.mimeType===TI)return{item:t,name:t.name};let r=cj[t.mimeType];if(r){let n=e[r.key];if(n==="skip")return;let i=r.exportMimeTypes[n],s=(0,wI.extension)(i);return{item:t,name:s?`${t.name}.${s}`:t.name,downloadUrl:`https://www.googleapis.com/drive/v3/files/${t.id}/export?mimeType=${encodeURIComponent(i)}&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`}}o(fj,"resolveItem");function mj(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:"/",i=[];for(let s of r.values()){if(s.length<=1)continue;let d=[...new Set(s)];i.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 i}o(mj,"checkUniqueNames");async function SI({auth:t,folderId:e,relativePrefix:r,nativeFormats:n,includeTeamDrives:i,out:s,errors:d}){let m=await dj({auth:t,folderId:e,includeTeamDrives:i});if(m.length===0){r.length>0&&s.push({relativePath:r,fileId:e,isEmptyFolder:!0,sizeBytes:0});return}let h=m.map(v=>fj(v,n)).filter(v=>v!==void 0);for(let{item:v}of h){let _=pj(v.name,r);_&&d.push(_)}d.push(...mj(h,r));for(let v of h){let _=r.length>0?`${r}/${v.name}`:v.name;if(v.item.mimeType===TI){await SI({auth:t,folderId:v.item.id,relativePrefix:_,nativeFormats:n,includeTeamDrives:i,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:sj})}}o(SI,"walk");async function hj({auth:t,rootFolderId:e,nativeFormats:r,includeTeamDrives:n}){let i=[],s=[];if(await SI({auth:t,folderId:e,relativePrefix:"",nativeFormats:r,includeTeamDrives:n,out:i,errors:s}),s.length>0){let d=[...s].sort((v,_)=>v.location.localeCompare(_.location)||v.name.localeCompare(_.name)),m=d.slice(0,uj),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
+ ${h.join(`
77
+ `)}`)}return i}o(hj,"collectZipEntries");function gj(t){let e=[],r=[],n=0;for(let i of t){let s=n+i.sizeBytes>aj,d=r.length>=ij;r.length>0&&(s||d)&&(e.push(r),r=[],n=0),r.push(i),n+=i.sizeBytes}return r.length>0&&e.push(r),e}o(gj,"batchByBytes");async function yj({auth:t,entry:e,zipWriter:r,fileAddOptions:n}){if(!e.downloadUrl)throw new Error(`No download URL for entry "${e.relativePath}"`);let i=await ot(t),s=await fetch(e.downloadUrl,{headers:{Authorization:`Bearer ${i}`}});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)}o(yj,"downloadAndAddZipEntry");var xI=ee({auth:Y,name:"drive_export_folder_as_zip",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:C.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:C.Dropdown({displayName:"Folder",description:"The Drive folder to export (including all subfolders).",required:!0,auth:Y,refreshers:["includeTeamDrives"],refreshOnSearch:!0,options:o(async({auth:t,includeTeamDrives:e},r)=>Fe.fetchFolderDropdownOptions({auth:t,searchValue:r?.searchValue,includeTeamDrives:e}),"options")}),includeTeamDrives:C.Checkbox({displayName:"Include Team Drives",required:!1,defaultValue:!1}),googleDocsFormat:C.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:C.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:C.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:C.ShortText({displayName:"Output Zip File Name",required:!0,defaultValue:"export.zip"}),usePassword:C.Checkbox({displayName:"Use password",description:"Enable password protection for the zip file",required:!1,defaultValue:!1}),passwordOptions:C.DynamicProperties({displayName:"Password options",required:!1,auth:Ho.None(),refreshers:["usePassword"],props:o(async({usePassword:t})=>t?{password:C.ShortText({displayName:"Password",required:!0}),encryptionMethod:C.StaticDropdown({displayName:"Encryption Method",description:lj,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 hj({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 i=new TransformStream,s=new PI.ZipWriter(i.writable),d=_I.Readable.fromWeb(i.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 gj(h))await Promise.all(_.map(x=>yj({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 EI=ue($e());var II=ee({auth:Y,name:"drive_create_folder",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:TE,props:{folder_name:C.ShortText({displayName:"Folder name",description:"The name of the new folder",required:!0}),parent_folder_id:C.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 ae(t.auth);return(await(0,EI.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 AI=ue(ca());var RI=ee({auth:Y,name:"drive_create_file_from_text",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:tE,props:{file_name:C.ShortText({displayName:"File name",description:"The name of the new text file",required:!0}),text:C.LongText({displayName:"Text",description:"The text content to add to file",required:!0}),content_type:C.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:C.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"),i=new AI.default;return i.append("Metadata",r,{contentType:"application/json"}),i.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:i,headers:{...i.getHeaders()},queryParams:{supportsAllDrives:"true"},authentication:{type:"BEARER_TOKEN",token:await ot(t.auth)}})).body}});var DI=ue(ca());var $I=ue(mn());var OI=ee({auth:Y,name:"drive_upload_file",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:rE,props:{file_name:C.ShortText({displayName:"File name",description:"The name of the file",required:!0}),file:C.File({displayName:"File",description:"The file URL or base64 to upload",required:!0}),parent_folder_id:C.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:$I.default.lookup(e.extension?e.extension:""),name:t.propsValue.file_name,...t.propsValue.parent_folder_id?{parents:[t.propsValue.parent_folder_id]}:{}},i=Buffer.from(JSON.stringify(n),"utf-8"),s=Buffer.from(e.base64,"base64"),d=new DI.default;return d.append("Metadata",i,{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 ot(t.auth)}})).body}});var CI=ue(ca());var NI=ue(mn());var zI=ee({auth:Y,name:"drive_upload_from_url",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:EE,props:{source_url:C.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:C.ShortText({displayName:"File name",description:"The name to give the uploaded file in Drive.",required:!0}),mime_type:C.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:C.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:i}=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||NI.default.lookup(e)||"application/octet-stream",m={mimeType:d,name:r,...i?{parents:[i]}:{}},h=Buffer.from(JSON.stringify(m),"utf-8"),v=Buffer.from(s.body),_=new CI.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 ot(t.auth)}})).body}});var kI=ue(mn());var UI=ee({auth:Y,name:"drive_replace_file_content",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:pE,props:{file_id:C.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:C.File({displayName:"New File Content",description:"The file URL or base64 whose bytes will replace the existing content.",required:!0}),mime_type:C.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,i=n||kI.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":i},authentication:{type:"BEARER_TOKEN",token:await ot(t.auth)}})).body}});var MI=ee({auth:Y,name:"drive_download_file",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:IE,props:{file_id:C.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:C.ShortText({displayName:"Destination File name",required:!1})},run:o(async({auth:t,propsValue:e,files:r})=>Bt(t,r,e.file_id,e.destination_file_name),"run")});var FI=ue($e()),LI=ue(mn());var jI=ee({auth:Y,name:"drive_export_workspace_file",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:AE,props:{file_id:C.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:C.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 ae(t.auth),i=(0,FI.drive)({version:"v3",auth:n});try{let s=await i.files.export({fileId:e,mimeType:r},{responseType:"arraybuffer"}),d=(0,LI.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 qI=ue($e());var BI=ee({auth:Y,name:"drive_get_file",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:Xx,props:{file_id:C.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 ae(t.auth),n=await(0,qI.drive)({version:"v3",auth:e}).files.get({fileId:t.propsValue.file_id,supportsAllDrives:!0});return n.data?n.data:null}});var Nm=ue(require("querystring"));async function VI(t,e,r,n,i,s=0){let d=[];if(s>r)return d;let m=await ot(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:i?"true":"false",corpora:i?"allDrives":"user",pageSize:"1000"},_=await ht.sendRequest({method:"GET",url:`https://www.googleapis.com/drive/v3/files?${Nm.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?${Nm.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 w=await VI(t,T.file.id,r,n,i,s+1);d.push(...w)}}return d}o(VI,"getFilesRecursively");var GI=ee({auth:Y,name:"drive_list_files",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:Qx,props:{folder_id:C.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:C.Checkbox({displayName:"Include Trashed",description:"Include new files that have been trashed.",required:!1,defaultValue:!1}),depth_level:C.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:C.Checkbox({displayName:"Download Files",description:"Download all file contents in a list",required:!1,defaultValue:!1}),include_team_drives:C.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 VI(t.auth,t.propsValue.folder_id,r,t.propsValue.include_trashed??!1,t.propsValue.include_team_drives??!1);if(e.files=n.map(i=>i.file),t.propsValue.download_files){let i=[],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 Bt(t.auth,t.files,m.id,h);i.push(_)}catch(_){console.warn(`Failed to download file ${m.name}: ${_ instanceof Error?_.message:"Download failed"}`)}}e.downloadedFiles=i}return e}});var HI=ue($e());var WI=ee({auth:Y,name:"drive_search_files",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:eE,props:{query_term:C.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:C.StaticDropdown({displayName:"Operator",description:"The operator to create criteria.",required:!0,options:{options:[{label:"Contains",value:"contains"},{label:"Equals",value:"="}]},defaultValue:"contains"}),value:C.ShortText({displayName:"Value",description:"Value of the field of file/folder to search for.",required:!0}),type:C.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:C.ShortText({displayName:"Parent Folder ID",description:"(Optional) Restrict the search to files/folders inside this folder ID.",required:!1}),include_team_drives:C.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 ae(t.auth),r=(0,HI.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 ZI=ue($e());var KI=ee({auth:Y,name:"drive_copy_file",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:nE,props:{file_id:C.ShortText({displayName:"File ID",description:"The ID of the file to duplicate. Resolve it via `drive_search_files`.",required:!0}),name:C.ShortText({displayName:"Name",description:"The name of the new file",required:!0}),folder_id:C.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:C.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 ae(t.auth),r=t.propsValue.file_id,n=t.propsValue.name,i=t.propsValue.folder_id,s=t.propsValue.convert_to,d=(0,ZI.drive)({version:"v3",auth:e}),m={name:n,parents:[i]};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 JI=ue($e());var YI=ee({auth:Y,name:"drive_move_file",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:oE,props:{file_id:C.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:C.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 ae(t.auth),i=(0,JI.drive)({version:"v3",auth:n}),s=await i.files.get({fileId:e,supportsAllDrives:!0,fields:"id,parents"});return(await i.files.update({fileId:e,fields:"*",removeParents:s.data.parents?.join(","),addParents:r,supportsAllDrives:!0})).data}});var XI=ue($e());var QI=ee({auth:Y,name:"drive_update_file_metadata",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:iE,props:{file_id:C.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:C.ShortText({displayName:"New Name",description:"A new name for the file or folder. Leave empty to keep the current name.",required:!1}),description:C.ShortText({displayName:"Description",description:"A new description for the file or folder. Leave empty to keep the current description.",required:!1}),starred:C.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:i}=t.propsValue,s={};r!=null&&r!==""&&(s.name=r),n!=null&&(s.description=n),i!=null&&(s.starred=i);let d=await ae(t.auth),m=(0,XI.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 eA=ue($e()),tA=require("stream");var rA=ee({auth:Y,name:"drive_save_file_as_pdf",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:bE,props:{document_id:C.ShortText({displayName:"Document ID",description:"The ID of the document to export. Resolve it via `drive_search_files`.",required:!0}),folder_id:C.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:C.ShortText({displayName:"Name",description:"The name of the new file (do not include the extension)",required:!0})},async run(t){let e=await ae(t.auth),r=t.propsValue.document_id,n=t.propsValue.folder_id,i=t.propsValue.name,s=(0,eA.drive)({version:"v3",auth:e}),d=await s.files.export({fileId:r,mimeType:"application/pdf"},{responseType:"arraybuffer"}),m={name:i+".pdf",parents:[n]},h=Buffer.from(d.data,"base64"),_={mimeType:"application/pdf",body:new tA.Stream.PassThrough().end(h)};return(await s.files.create({requestBody:m,media:_,supportsAllDrives:!0})).data}});var nA=ue($e());var oA=ee({auth:Y,name:"drive_trash_file",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:lE,props:{file_id:C.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 ae(t.auth),r=(0,nA.drive)({version:"v3",auth:e}),n={trashed:!0};return(await r.files.update({fileId:t.propsValue.file_id,supportsAllDrives:!0,requestBody:n})).data}});var iA=ue($e());var aA=ee({auth:Y,name:"drive_untrash_file",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:dE,props:{file_id:C.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 ae(t.auth),n=(0,iA.drive)({version:"v3",auth:r});try{return(await n.files.update({fileId:e,supportsAllDrives:!0,requestBody:{trashed:!1}})).data}catch(i){throw i.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):i.code===403?new Error(`Permission denied restoring file ${e}. You may lack permission to restore this resource.`):i}}});var sA=ue($e()),uA=ee({auth:Y,name:"drive_delete_file",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:C.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 ae(t.auth);return(await(0,sA.drive)({version:"v3",auth:e}).files.delete({fileId:t.propsValue.file_id,supportsAllDrives:!0})).data}});var cA=ue($e());var lA=ee({auth:Y,name:"drive_empty_trash",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:$E,props:{drive_id:C.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 ae(t.auth),n=(0,cA.drive)({version:"v3",auth:r});try{return await n.files.emptyTrash({...e?{driveId:e}:{}}),{success:!0,driveId:e??null}}catch(i){throw i.code===403?new Error("Permission denied emptying the trash. You may lack permission to empty this trash."):i}}});var dA=ue($e());var pA=ee({auth:Y,name:"drive_share_file",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:aE,props:{file_id:C.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:C.ShortText({displayName:"User Email",description:"The email address of the user to grant access to.",required:!0}),role:C.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:C.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:i}=t.propsValue,s=await ae(t.auth),d=(0,dA.drive)({version:"v3",auth:s}),m={type:"user",role:n,emailAddress:r};return(await d.permissions.create({requestBody:m,fileId:e,sendNotificationEmail:i,supportsAllDrives:!0})).data}});var fA=ue($e());var mA=ee({auth:Y,name:"drive_set_public_access",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:uE,props:{file_id:C.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:C.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 ae(t.auth),r=t.propsValue.file_id,n=t.propsValue.role,i=(0,fA.drive)({version:"v3",auth:e}),s={role:n,type:"anyone"},d=await i.permissions.create({fileId:r,requestBody:s,supportsAllDrives:!0}),m=await i.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 Bt(t.auth,t.files,r,m.data.name);return{...d.data,downloadUrl:h}}});var hA=ue($e());var gA=ee({auth:Y,name:"drive_list_permissions",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:sE,props:{file_id:C.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 ae(t.auth),n=(0,hA.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(i){throw i.code===404?new Error(`File or folder not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):i.code===403?new Error(`Permission denied listing permissions for file ${e}. You may lack access to this resource.`):i}}});var yA=ue($e());var vA=ee({auth:Y,name:"drive_update_permission",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:cE,props:{file_id:C.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:C.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:C.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,i=await ae(t.auth),s=(0,yA.drive)({version:"v3",auth:i});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 _A=ue($e());var PA=ee({auth:Y,name:"drive_remove_permission",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:OE,props:{file_id:C.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:C.ShortText({displayName:"User Email",description:"The email address of the user whose access to revoke.",required:!0}),role:C.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 ae(t.auth),i=(0,_A.drive)({version:"v3",auth:n}),s=await i.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 i.permissions.delete({fileId:e,permissionId:d.id?d.id:"",supportsAllDrives:!0}),{removed:!0,message:"Permission removed"}}return{removed:!1,message:"Permission not found"}}});var wA=ue($e());var bA=ee({auth:Y,name:"drive_list_shared_drives",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:mE,props:{query:C.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:C.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 ae(t.auth),i=(0,wA.drive)({version:"v3",auth:n});try{let d=(await i.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 TA=ue($e());var SA=ee({auth:Y,name:"drive_get_shared_drive",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:hE,props:{drive_id:C.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 ae(t.auth),n=(0,TA.drive)({version:"v3",auth:r});try{return(await n.drives.get({driveId:e})).data}catch(i){throw i.code===404?new Error(`Shared drive not found (ID: ${e}). Resolve a valid ID via drive_list_shared_drives.`):i.code===403?new Error(`Permission denied accessing shared drive ${e}. You may not be a member of this drive.`):i}}});var xA=require("crypto");var EA=ue($e());var IA=ee({auth:Y,name:"drive_create_shared_drive",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:SE,props:{name:C.ShortText({displayName:"Name",description:"The name of the new shared drive.",required:!0})},async run(t){let{name:e}=t.propsValue,r=await ae(t.auth),n=(0,EA.drive)({version:"v3",auth:r}),i=(0,xA.randomUUID)();try{return(await n.drives.create({requestId:i,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 AA=ue($e());var RA=ee({auth:Y,name:"drive_update_shared_drive",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:xE,props:{drive_id:C.ShortText({displayName:"Shared Drive ID",description:"The ID of the shared drive to update. Resolve it via drive_list_shared_drives.",required:!0}),name:C.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 ae(t.auth),i=(0,AA.drive)({version:"v3",auth:n}),s={};r&&(s.name=r);try{return(await i.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 DA=ue($e());var $A=ee({auth:Y,name:"drive_delete_shared_drive",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:DE,props:{drive_id:C.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 ae(t.auth),n=(0,DA.drive)({version:"v3",auth:r});try{return await n.drives.delete({driveId:e}),{deleted:!0,driveId:e}}catch(i){throw i.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.`):i.code===400?new Error(`Cannot delete shared drive ${e}: it must be empty before deletion. Remove or trash all of its files first.`):i.code===403?new Error(`Permission denied deleting shared drive ${e}. You must be an organizer of this drive.`):i}}});var OA=ue($e());var CA=ee({auth:Y,name:"drive_create_comment",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:vE,props:{file_id:C.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:C.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 ae(t.auth),i=(0,OA.drive)({version:"v3",auth:n});try{return(await i.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 NA=ue($e());var zA=ee({auth:Y,name:"drive_list_comments",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:gE,props:{file_id:C.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 ae(t.auth),n=(0,NA.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(i){throw i.code===404?new Error(`File not found (ID: ${e}). Resolve a valid ID via drive_search_files or drive_get_file.`):i.code===403?new Error(`Permission denied listing comments for file ${e}. You may lack access to this file.`):i}}});var kA=ue($e());var UA=ee({auth:Y,name:"drive_create_reply",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:yE,props:{file_id:C.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:C.ShortText({displayName:"Comment ID",description:"The ID of the comment to reply to. Resolve it via drive_list_comments.",required:!0}),content:C.LongText({displayName:"Content",description:"The plain-text content of the reply.",required:!0}),action:C.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:i}=t.propsValue,s=await ae(t.auth),d=(0,kA.drive)({version:"v3",auth:s}),m={content:n};i&&(m.action=i);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 MA=ue($e());var FA=ee({auth:Y,name:"drive_get_reply",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:_E,props:{file_id:C.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:C.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:C.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,i=await ae(t.auth),s=(0,MA.drive)({version:"v3",auth:i});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 LA=ue($e());var jA=ee({auth:Y,name:"drive_list_replies",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:PE,props:{file_id:C.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:C.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 ae(t.auth),i=(0,LA.drive)({version:"v3",auth:n});try{let d=(await i.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 qA=ue($e());var BA=ee({auth:Y,name:"drive_update_reply",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:wE,props:{file_id:C.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:C.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:C.ShortText({displayName:"Reply ID",description:"The ID of the reply to update. Resolve it via drive_list_replies.",required:!0}),content:C.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:i}=t.propsValue,s=await ae(t.auth),d=(0,qA.drive)({version:"v3",auth:s});try{return(await d.replies.update({fileId:e,commentId:r,replyId:n,fields:"*",requestBody:{content:i}})).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 VA=ue($e());var GA=ee({auth:Y,name:"drive_delete_reply",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:RE,props:{file_id:C.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:C.ShortText({displayName:"Comment ID",description:"The ID of the parent comment. Resolve it via drive_list_comments.",required:!0}),reply_id:C.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,i=await ae(t.auth),s=(0,VA.drive)({version:"v3",auth:i});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 HA=ue($e());var WA=ee({auth:Y,name:"drive_get_about",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:fE,props:{},async run(t){let e=await ae(t.auth),r=(0,HA.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 vj=Jy({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:[uI,lI],actions:[kE,ME,iI,YE,VE,JE,rI,qE,eI,NE,LE,pI,mI,gI,vI,xI,II,RI,OI,zI,UI,MI,jI,BI,GI,WI,KI,YI,QI,rA,oA,aA,uA,lA,pA,mA,gA,vA,PA,bA,SA,IA,RA,$A,CA,zA,UA,FA,jA,BA,GA,WA,lP({baseUrl:o(()=>"https://www.googleapis.com/drive/v3","baseUrl"),auth:Y,authMapping:o(async t=>({Authorization:`Bearer ${await ot(t)}`}),"authMapping")})],auth:Y});0&&(module.exports={createGoogleClient,getAccessToken,googleDrive,googleDriveAuth});
73
78
  /*! Bundled license information:
74
79
 
75
80
  mime-types/index.js: