@activepieces/piece-google-calendar 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +28 -28
package/src/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";var qI=Object.create;var Li=Object.defineProperty;var BI=Object.getOwnPropertyDescriptor;var VI=Object.getOwnPropertyNames;var GI=Object.getPrototypeOf,HI=Object.prototype.hasOwnProperty;var o=(t,e)=>Li(t,"name",{value:e,configurable:!0});var Tt=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var D=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Is=(t,e)=>{for(var r in e)Li(t,r,{get:e[r],enumerable:!0})},dg=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of VI(e))!HI.call(t,i)&&i!==r&&Li(t,i,{get:()=>e[i],enumerable:!(n=BI(e,i))||n.enumerable});return t};var qe=(t,e,r)=>(r=t!=null?qI(GI(t)):{},dg(e||!t||!t.__esModule?Li(r,"default",{value:t,enumerable:!0}):r,t)),WI=t=>dg(Li({},"__esModule",{value:!0}),t);var Dy=D(($y,Ks)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function p(l,g){if(l.indexOf("::")!==l.lastIndexOf("::"))return null;let v=0,E=-1,b=(l.match(d.zoneIndex)||[])[0],C,U;for(b&&(b=b.substring(1),l=l.replace(/%.+$/,""));(E=l.indexOf(":",E+1))>=0;)v++;if(l.substr(0,2)==="::"&&v--,l.substr(-2,2)==="::"&&v--,v>g)return null;for(U=g-v,C=":";U--;)C+="0:";return l=l.replace("::",C),l[0]===":"&&(l=l.slice(1)),l[l.length-1]===":"&&(l=l.slice(0,-1)),g=(function(){let J=l.split(":"),W=[];for(let H=0;H<J.length;H++)W.push(parseInt(J[H],16));return W})(),{parts:g,zoneId:b}}o(p,"expandIPv6");function m(l,g,v,E){if(l.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let b=0,C;for(;E>0;){if(C=v-E,C<0&&(C=0),l[b]>>C!==g[b]>>C)return!1;E-=v,b+=1}return!0}o(m,"matchCIDR");function y(l){if(i.test(l))return parseInt(l,16);if(l[0]==="0"&&!isNaN(parseInt(l[1],10))){if(n.test(l))return parseInt(l,8);throw new Error(`ipaddr: cannot parse ${l} as octal`)}return parseInt(l,10)}o(y,"parseIntAuto");function h(l,g){for(;l.length<g;)l=`0${l}`;return l}o(h,"padPart");let f={};f.IPv4=(function(){function l(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let v,E;for(v=0;v<g.length;v++)if(E=g[v],!(0<=E&&E<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return o(l,"IPv4"),l.prototype.SpecialRanges={unspecified:[[new l([0,0,0,0]),8]],broadcast:[[new l([255,255,255,255]),32]],multicast:[[new l([224,0,0,0]),4]],linkLocal:[[new l([169,254,0,0]),16]],loopback:[[new l([127,0,0,0]),8]],carrierGradeNat:[[new l([100,64,0,0]),10]],private:[[new l([10,0,0,0]),8],[new l([172,16,0,0]),12],[new l([192,168,0,0]),16]],reserved:[[new l([192,0,0,0]),24],[new l([192,0,2,0]),24],[new l([192,88,99,0]),24],[new l([198,18,0,0]),15],[new l([198,51,100,0]),24],[new l([203,0,113,0]),24],[new l([240,0,0,0]),4]],as112:[[new l([192,175,48,0]),24],[new l([192,31,196,0]),24]],amt:[[new l([192,52,193,0]),24]]},l.prototype.kind=function(){return"ipv4"},l.prototype.match=function(g,v){let E;if(v===void 0&&(E=g,g=E[0],v=E[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return m(this.octets,g.octets,8,v)},l.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!1,E={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},b,C,U;for(b=3;b>=0;b-=1)if(C=this.octets[b],C in E){if(U=E[C],v&&U!==0)return null;U!==8&&(v=!0),g+=U}else return null;return 32-g},l.prototype.range=function(){return f.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){return this.octets.slice(0)},l.prototype.toIPv4MappedAddress=function(){return f.IPv6.parse(`::ffff:${this.toString()}`)},l.prototype.toNormalizedString=function(){return this.toString()},l.prototype.toString=function(){return this.octets.join(".")},l})(),f.IPv4.broadcastAddressFromCIDR=function(l){try{let g=this.parseCIDR(l),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],C=0;for(;C<4;)b.push(parseInt(v[C],10)|parseInt(E[C],10)^255),C++;return new this(b)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},f.IPv4.isIPv4=function(l){return this.parser(l)!==null},f.IPv4.isValid=function(l){try{return new this(this.parser(l)),!0}catch{return!1}},f.IPv4.isValidCIDR=function(l){try{return this.parseCIDR(l),!0}catch{return!1}},f.IPv4.isValidFourPartDecimal=function(l){return!!(f.IPv4.isValid(l)&&l.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},f.IPv4.isValidCIDRFourPartDecimal=function(l){let g=l.match(/^(.+)\/(\d+)$/);return!f.IPv4.isValidCIDR(l)||!g?!1:f.IPv4.isValidFourPartDecimal(g[1])},f.IPv4.networkAddressFromCIDR=function(l){let g,v,E,b,C;try{for(g=this.parseCIDR(l),E=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],v=0;v<4;)b.push(parseInt(E[v],10)&parseInt(C[v],10)),v++;return new this(b)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},f.IPv4.parse=function(l){let g=this.parser(l);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},f.IPv4.parseCIDR=function(l){let g;if(g=l.match(/^(.+)\/(\d+)$/)){let v=parseInt(g[2]);if(v>=0&&v<=32){let E=[this.parse(g[1]),v];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")},f.IPv4.parser=function(l){let g,v,E;if(g=l.match(r.fourOctet))return(function(){let b=g.slice(1,6),C=[];for(let U=0;U<b.length;U++)v=b[U],C.push(y(v));return C})();if(g=l.match(r.longValue)){if(E=y(g[1]),E>4294967295||E<0)throw new Error("ipaddr: address outside defined range");return(function(){let b=[],C;for(C=0;C<=24;C+=8)b.push(E>>C&255);return b})().reverse()}else return(g=l.match(r.twoOctet))?(function(){let b=g.slice(1,4),C=[];if(E=y(b[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return C.push(y(b[0])),C.push(E>>16&255),C.push(E>>8&255),C.push(E&255),C})():(g=l.match(r.threeOctet))?(function(){let b=g.slice(1,5),C=[];if(E=y(b[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return C.push(y(b[0])),C.push(y(b[1])),C.push(E>>8&255),C.push(E&255),C})():null},f.IPv4.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>32)throw new Error("ipaddr: invalid IPv4 prefix length");let g=[0,0,0,0],v=0,E=Math.floor(l/8);for(;v<E;)g[v]=255,v++;return E<4&&(g[E]=Math.pow(2,l%8)-1<<8-l%8),new this(g)},f.IPv6=(function(){function l(g,v){let E,b;if(g.length===16)for(this.parts=[],E=0;E<=14;E+=2)this.parts.push(g[E]<<8|g[E+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(E=0;E<this.parts.length;E++)if(b=this.parts[E],!(0<=b&&b<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");v&&(this.zoneId=v)}return o(l,"IPv6"),l.prototype.SpecialRanges={unspecified:[new l([0,0,0,0,0,0,0,0]),128],linkLocal:[new l([65152,0,0,0,0,0,0,0]),10],multicast:[new l([65280,0,0,0,0,0,0,0]),8],loopback:[new l([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new l([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new l([0,0,0,0,0,65535,0,0]),96],discard:[new l([256,0,0,0,0,0,0,0]),64],rfc6145:[new l([0,0,0,0,65535,0,0,0]),96],rfc6052:[new l([100,65435,0,0,0,0,0,0]),96],"6to4":[new l([8194,0,0,0,0,0,0,0]),16],teredo:[new l([8193,0,0,0,0,0,0,0]),32],benchmarking:[new l([8193,2,0,0,0,0,0,0]),48],amt:[new l([8193,3,0,0,0,0,0,0]),32],as112v6:[[new l([8193,4,274,0,0,0,0,0]),48],[new l([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new l([8193,16,0,0,0,0,0,0]),28],orchid2:[new l([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new l([8193,48,0,0,0,0,0,0]),28],reserved:[[new l([8193,0,0,0,0,0,0,0]),23],[new l([8193,3512,0,0,0,0,0,0]),32]]},l.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},l.prototype.kind=function(){return"ipv6"},l.prototype.match=function(g,v){let E;if(v===void 0&&(E=g,g=E[0],v=E[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return m(this.parts,g.parts,16,v)},l.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!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},b,C;for(let U=7;U>=0;U-=1)if(b=this.parts[U],b in E){if(C=E[b],v&&C!==0)return null;C!==16&&(v=!0),g+=C}else return null;return 128-g},l.prototype.range=function(){return f.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){let g,v=[],E=this.parts;for(let b=0;b<E.length;b++)g=E[b],v.push(g>>8),v.push(g&255);return v},l.prototype.toFixedLengthString=function(){let g=(function(){let E=[];for(let b=0;b<this.parts.length;b++)E.push(h(this.parts[b].toString(16),4));return E}).call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},l.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let g=this.parts.slice(-2),v=g[0],E=g[1];return new f.IPv4([v>>8,v&255,E>>8,E&255])},l.prototype.toNormalizedString=function(){let g=(function(){let E=[];for(let b=0;b<this.parts.length;b++)E.push(this.parts[b].toString(16));return E}).call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},l.prototype.toRFC5952String=function(){let g=/((^|:)(0(:|$)){2,})/g,v=this.toNormalizedString(),E=0,b=-1,C;for(;C=g.exec(v);)C[0].length>b&&(E=C.index,b=C[0].length);return b<0?v:`${v.substring(0,E)}::${v.substring(E+b)}`},l.prototype.toString=function(){return this.toRFC5952String()},l})(),f.IPv6.broadcastAddressFromCIDR=function(l){try{let g=this.parseCIDR(l),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],C=0;for(;C<16;)b.push(parseInt(v[C],10)|parseInt(E[C],10)^255),C++;return new this(b)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},f.IPv6.isIPv6=function(l){return this.parser(l)!==null},f.IPv6.isValid=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{let g=this.parser(l);return new this(g.parts,g.zoneId),!0}catch{return!1}},f.IPv6.isValidCIDR=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{return this.parseCIDR(l),!0}catch{return!1}},f.IPv6.networkAddressFromCIDR=function(l){let g,v,E,b,C;try{for(g=this.parseCIDR(l),E=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],v=0;v<16;)b.push(parseInt(E[v],10)&parseInt(C[v],10)),v++;return new this(b)}catch(U){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${U})`)}},f.IPv6.parse=function(l){let g=this.parser(l);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},f.IPv6.parseCIDR=function(l){let g,v,E;if((v=l.match(/^(.+)\/(\d+)$/))&&(g=parseInt(v[2]),g>=0&&g<=128))return E=[this.parse(v[1]),g],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")},f.IPv6.parser=function(l){let g,v,E,b,C,U;if(E=l.match(d.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(d.native.test(l))return p(l,8);if((E=l.match(d.transitional))&&(U=E[6]||"",g=E[1],E[1].endsWith("::")||(g=g.slice(0,-1)),g=p(g+U,6),g.parts)){for(C=[parseInt(E[2]),parseInt(E[3]),parseInt(E[4]),parseInt(E[5])],v=0;v<C.length;v++)if(b=C[v],!(0<=b&&b<=255))return null;return g.parts.push(C[0]<<8|C[1]),g.parts.push(C[2]<<8|C[3]),{parts:g.parts,zoneId:g.zoneId}}return null},f.IPv6.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>128)throw new Error("ipaddr: invalid IPv6 prefix length");let g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0,E=Math.floor(l/8);for(;v<E;)g[v]=255,v++;return E<16&&(g[E]=Math.pow(2,l%8)-1<<8-l%8),new this(g)},f.fromByteArray=function(l){let g=l.length;if(g===4)return new f.IPv4(l);if(g===16)return new f.IPv6(l);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},f.isValid=function(l){return f.IPv6.isValid(l)||f.IPv4.isValid(l)},f.isValidCIDR=function(l){return f.IPv6.isValidCIDR(l)||f.IPv4.isValidCIDR(l)},f.parse=function(l){if(f.IPv6.isValid(l))return f.IPv6.parse(l);if(f.IPv4.isValid(l))return f.IPv4.parse(l);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},f.parseCIDR=function(l){try{return f.IPv6.parseCIDR(l)}catch{try{return f.IPv4.parseCIDR(l)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},f.process=function(l){let g=this.parse(l);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},f.subnetMatch=function(l,g,v){let E,b,C,U;v==null&&(v="unicast");for(b in g)if(Object.prototype.hasOwnProperty.call(g,b)){for(C=g[b],C[0]&&!(C[0]instanceof Array)&&(C=[C]),E=0;E<C.length;E++)if(U=C[E],l.kind()===U[0].kind()&&l.match.apply(l,U))return b}return v},typeof Ks<"u"&&Ks.exports?Ks.exports=f:t.ipaddr=f})($y)});var Dv=D((rJ,$v)=>{var kv=require("stream").Stream,R0=require("util");$v.exports=Ar;function Ar(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(Ar,"DelayedStream");R0.inherits(Ar,kv);Ar.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(Ar.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});Ar.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Ar.prototype.resume=function(){this._released||this.release(),this.source.resume()};Ar.prototype.pause=function(){this.source.pause()};Ar.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};Ar.prototype.pipe=function(){var t=kv.prototype.pipe.apply(this,arguments);return this.resume(),t};Ar.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)};Ar.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=D((oJ,Uv)=>{var C0=require("util"),zv=require("stream").Stream,Nv=Dv();Uv.exports=ft;function ft(){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(ft,"CombinedStream");C0.inherits(ft,zv);ft.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};ft.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};ft.prototype.append=function(t){var e=ft.isStreamLike(t);if(e){if(!(t instanceof Nv)){var r=Nv.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};ft.prototype.pipe=function(t,e){return zv.prototype.pipe.call(this,t,e),this.resume(),t};ft.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}};ft.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=ft.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ft.prototype._pipeNext=function(t){this._currentStream=t;var e=ft.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()};ft.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};ft.prototype.write=function(t){this.emit("data",t)};ft.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ft.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")};ft.prototype.end=function(){this._reset(),this.emit("end")};ft.prototype.destroy=function(){this._reset(),this.emit("close")};ft.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ft.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};ft.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)};ft.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var jv=D((aJ,Lv)=>{"use strict";Lv.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 Bv=D(Ft=>{"use strict";var tu=jv(),O0=require("path").extname,Fv=/^\s*([^;\s]*)(?:;|\s|$)/,k0=/^text\//i;Ft.charset=qv;Ft.charsets={lookup:qv};Ft.contentType=$0;Ft.extension=D0;Ft.extensions=Object.create(null);Ft.lookup=N0;Ft.types=Object.create(null);z0(Ft.extensions,Ft.types);function qv(t){if(!t||typeof t!="string")return!1;var e=Fv.exec(t),r=e&&tu[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&k0.test(e[1])?"UTF-8":!1}o(qv,"charset");function $0(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Ft.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Ft.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o($0,"contentType");function D0(t){if(!t||typeof t!="string")return!1;var e=Fv.exec(t),r=e&&Ft.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(D0,"extension");function N0(t){if(!t||typeof t!="string")return!1;var e=O0("x."+t).toLowerCase().substr(1);return e&&Ft.types[e]||!1}o(N0,"lookup");function z0(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(tu).forEach(o(function(i){var s=tu[i],c=s.extensions;if(!(!c||!c.length)){t[i]=c;for(var d=0;d<c.length;d++){var p=c[d];if(e[p]){var m=r.indexOf(tu[e[p]].source),y=r.indexOf(s.source);if(e[p]!=="application/octet-stream"&&(m>y||m===y&&e[p].substr(0,12)==="application/"))continue}e[p]=i}}},"forEachMimeType"))}o(z0,"populateMaps")});var Gv=D((cJ,Vv)=>{Vv.exports=U0;function U0(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(U0,"defer")});var md=D((dJ,Wv)=>{var Hv=Gv();Wv.exports=M0;function M0(t){var e=!1;return Hv(function(){e=!0}),o(function(n,i){e?t(n,i):Hv(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(M0,"async")});var hd=D((fJ,Zv)=>{Zv.exports=L0;function L0(t){Object.keys(t.jobs).forEach(j0.bind(t)),t.jobs={}}o(L0,"abort");function j0(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(j0,"clean")});var gd=D((hJ,Jv)=>{var Kv=md(),F0=hd();Jv.exports=q0;function q0(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=B0(e,i,t[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?F0(r):r.results[i]=c,n(s,r.results))})}o(q0,"iterate");function B0(t,e,r,n){var i;return t.length==2?i=t(r,Kv(n)):i=t(r,e,Kv(n)),i}o(B0,"runJob")});var yd=D((yJ,Yv)=>{Yv.exports=V0;function V0(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(V0,"state")});var vd=D((_J,Xv)=>{var G0=hd(),H0=md();Xv.exports=W0;function W0(t){Object.keys(this.jobs).length&&(this.index=this.size,G0(this),H0(t)(null,this.results))}o(W0,"terminator")});var e_=D((EJ,Qv)=>{var Z0=gd(),K0=yd(),J0=vd();Qv.exports=Y0;function Y0(t,e,r){for(var n=K0(t);n.index<(n.keyedList||t).length;)Z0(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 J0.bind(n,r)}o(Y0,"parallel")});var _d=D((wJ,ru)=>{var t_=gd(),X0=yd(),Q0=vd();ru.exports=eO;ru.exports.ascending=r_;ru.exports.descending=tO;function eO(t,e,r,n){var i=X0(t,r);return t_(t,e,i,o(function s(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||t).length){t_(t,e,i,s);return}n(null,i.results)},"iteratorHandler")),Q0.bind(i,n)}o(eO,"serialOrdered");function r_(t,e){return t<e?-1:t>e?1:0}o(r_,"ascending");function tO(t,e){return-1*r_(t,e)}o(tO,"descending")});var o_=D((PJ,n_)=>{var rO=_d();n_.exports=nO;function nO(t,e,r){return rO(t,e,null,r)}o(nO,"serial")});var a_=D((AJ,i_)=>{i_.exports={parallel:e_(),serial:o_(),serialOrdered:_d()}});var bd=D((IJ,s_)=>{"use strict";s_.exports=Object});var c_=D((RJ,u_)=>{"use strict";u_.exports=Error});var d_=D((CJ,l_)=>{"use strict";l_.exports=EvalError});var f_=D((OJ,p_)=>{"use strict";p_.exports=RangeError});var h_=D((kJ,m_)=>{"use strict";m_.exports=ReferenceError});var y_=D(($J,g_)=>{"use strict";g_.exports=SyntaxError});var Bn=D((DJ,v_)=>{"use strict";v_.exports=TypeError});var b_=D((NJ,__)=>{"use strict";__.exports=URIError});var S_=D((zJ,E_)=>{"use strict";E_.exports=Math.abs});var T_=D((UJ,w_)=>{"use strict";w_.exports=Math.floor});var x_=D((MJ,P_)=>{"use strict";P_.exports=Math.max});var I_=D((LJ,A_)=>{"use strict";A_.exports=Math.min});var C_=D((jJ,R_)=>{"use strict";R_.exports=Math.pow});var k_=D((FJ,O_)=>{"use strict";O_.exports=Math.round});var D_=D((qJ,$_)=>{"use strict";$_.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var z_=D((VJ,N_)=>{"use strict";var oO=D_();N_.exports=o(function(e){return oO(e)||e===0?e:e<0?-1:1},"sign")});var M_=D((HJ,U_)=>{"use strict";U_.exports=Object.getOwnPropertyDescriptor});var Ed=D((WJ,L_)=>{"use strict";var nu=M_();if(nu)try{nu([],"length")}catch{nu=null}L_.exports=nu});var F_=D((ZJ,j_)=>{"use strict";var ou=Object.defineProperty||!1;if(ou)try{ou({},"a",{value:1})}catch{ou=!1}j_.exports=ou});var Sd=D((KJ,q_)=>{"use strict";q_.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(e,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var G_=D((YJ,V_)=>{"use strict";var B_=typeof Symbol<"u"&&Symbol,iO=Sd();V_.exports=o(function(){return typeof B_!="function"||typeof Symbol!="function"||typeof B_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:iO()},"hasNativeSymbols")});var wd=D((QJ,H_)=>{"use strict";H_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Td=D((e5,W_)=>{"use strict";var aO=bd();W_.exports=aO.getPrototypeOf||null});var J_=D((t5,K_)=>{"use strict";var sO="Function.prototype.bind called on incompatible ",uO=Object.prototype.toString,cO=Math.max,lO="[object Function]",Z_=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"),dO=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"),pO=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");K_.exports=o(function(e){var r=this;if(typeof r!="function"||uO.apply(r)!==lO)throw new TypeError(sO+r);for(var n=dO(arguments,1),i,s=o(function(){if(this instanceof i){var y=r.apply(this,Z_(n,arguments));return Object(y)===y?y:this}return r.apply(e,Z_(n,arguments))},"binder"),c=cO(0,r.length-n.length),d=[],p=0;p<c;p++)d[p]="$"+p;if(i=Function("binder","return function ("+pO(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var m=o(function(){},"Empty");m.prototype=r.prototype,i.prototype=new m,m.prototype=null}return i},"bind")});var Jo=D((n5,Y_)=>{"use strict";var fO=J_();Y_.exports=Function.prototype.bind||fO});var iu=D((o5,X_)=>{"use strict";X_.exports=Function.prototype.call});var Pd=D((i5,Q_)=>{"use strict";Q_.exports=Function.prototype.apply});var tb=D((a5,eb)=>{"use strict";eb.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var nb=D((s5,rb)=>{"use strict";var mO=Jo(),hO=Pd(),gO=iu(),yO=tb();rb.exports=yO||mO.call(gO,hO)});var xd=D((u5,ob)=>{"use strict";var vO=Jo(),_O=Bn(),bO=iu(),EO=nb();ob.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new _O("a function is required");return EO(vO,bO,e)},"callBindBasic")});var lb=D((l5,cb)=>{"use strict";var SO=xd(),ib=Ed(),sb;try{sb=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ad=!!sb&&ib&&ib(Object.prototype,"__proto__"),ub=Object,ab=ub.getPrototypeOf;cb.exports=Ad&&typeof Ad.get=="function"?SO([Ad.get]):typeof ab=="function"?o(function(e){return ab(e==null?e:ub(e))},"getDunder"):!1});var hb=D((p5,mb)=>{"use strict";var db=wd(),pb=Td(),fb=lb();mb.exports=db?o(function(e){return db(e)},"getProto"):pb?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return pb(e)},"getProto"):fb?o(function(e){return fb(e)},"getProto"):null});var Id=D((m5,gb)=>{"use strict";var wO=Function.prototype.call,TO=Object.prototype.hasOwnProperty,PO=Jo();gb.exports=PO.call(wO,TO)});var la=D((h5,Sb)=>{"use strict";var Me,xO=bd(),AO=c_(),IO=d_(),RO=f_(),CO=h_(),ei=y_(),Qo=Bn(),OO=b_(),kO=S_(),$O=T_(),DO=x_(),NO=I_(),zO=C_(),UO=k_(),MO=z_(),bb=Function,Rd=o(function(t){try{return bb('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),sa=Ed(),LO=F_(),Cd=o(function(){throw new Qo},"throwTypeError"),jO=sa?(function(){try{return arguments.callee,Cd}catch{try{return sa(arguments,"callee").get}catch{return Cd}}})():Cd,Yo=G_()(),Pt=hb(),FO=Td(),qO=wd(),Eb=Pd(),ua=iu(),Xo={},BO=typeof Uint8Array>"u"||!Pt?Me:Pt(Uint8Array),fo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Me:ArrayBuffer,"%ArrayIteratorPrototype%":Yo&&Pt?Pt([][Symbol.iterator]()):Me,"%AsyncFromSyncIteratorPrototype%":Me,"%AsyncFunction%":Xo,"%AsyncGenerator%":Xo,"%AsyncGeneratorFunction%":Xo,"%AsyncIteratorPrototype%":Xo,"%Atomics%":typeof Atomics>"u"?Me:Atomics,"%BigInt%":typeof BigInt>"u"?Me:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Me:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Me:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Me:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":AO,"%eval%":eval,"%EvalError%":IO,"%Float16Array%":typeof Float16Array>"u"?Me:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Me:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Me:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Me:FinalizationRegistry,"%Function%":bb,"%GeneratorFunction%":Xo,"%Int8Array%":typeof Int8Array>"u"?Me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Yo&&Pt?Pt(Pt([][Symbol.iterator]())):Me,"%JSON%":typeof JSON=="object"?JSON:Me,"%Map%":typeof Map>"u"?Me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Yo||!Pt?Me:Pt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":xO,"%Object.getOwnPropertyDescriptor%":sa,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Me:Promise,"%Proxy%":typeof Proxy>"u"?Me:Proxy,"%RangeError%":RO,"%ReferenceError%":CO,"%Reflect%":typeof Reflect>"u"?Me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Yo||!Pt?Me:Pt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Yo&&Pt?Pt(""[Symbol.iterator]()):Me,"%Symbol%":Yo?Symbol:Me,"%SyntaxError%":ei,"%ThrowTypeError%":jO,"%TypedArray%":BO,"%TypeError%":Qo,"%Uint8Array%":typeof Uint8Array>"u"?Me:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Me:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Me:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Me:Uint32Array,"%URIError%":OO,"%WeakMap%":typeof WeakMap>"u"?Me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Me:WeakSet,"%Function.prototype.call%":ua,"%Function.prototype.apply%":Eb,"%Object.defineProperty%":LO,"%Object.getPrototypeOf%":FO,"%Math.abs%":kO,"%Math.floor%":$O,"%Math.max%":DO,"%Math.min%":NO,"%Math.pow%":zO,"%Math.round%":UO,"%Math.sign%":MO,"%Reflect.getPrototypeOf%":qO};if(Pt)try{null.error}catch(t){yb=Pt(Pt(t)),fo["%Error.prototype%"]=yb}var yb,VO=o(function t(e){var r;if(e==="%AsyncFunction%")r=Rd("async function () {}");else if(e==="%GeneratorFunction%")r=Rd("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Rd("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Pt&&(r=Pt(i.prototype))}return fo[e]=r,r},"doEval"),vb={__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"]},ca=Jo(),au=Id(),GO=ca.call(ua,Array.prototype.concat),HO=ca.call(Eb,Array.prototype.splice),_b=ca.call(ua,String.prototype.replace),su=ca.call(ua,String.prototype.slice),WO=ca.call(ua,RegExp.prototype.exec),ZO=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,KO=/\\(\\)?/g,JO=o(function(e){var r=su(e,0,1),n=su(e,-1);if(r==="%"&&n!=="%")throw new ei("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new ei("invalid intrinsic syntax, expected opening `%`");var i=[];return _b(e,ZO,function(s,c,d,p){i[i.length]=d?_b(p,KO,"$1"):c||s}),i},"stringToPath"),YO=o(function(e,r){var n=e,i;if(au(vb,n)&&(i=vb[n],n="%"+i[0]+"%"),au(fo,n)){var s=fo[n];if(s===Xo&&(s=VO(n)),typeof s>"u"&&!r)throw new Qo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new ei("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");Sb.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new Qo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Qo('"allowMissing" argument must be a boolean');if(WO(/^%?[^%]*%?$/,e)===null)throw new ei("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=JO(e),i=n.length>0?n[0]:"",s=YO("%"+i+"%",r),c=s.name,d=s.value,p=!1,m=s.alias;m&&(i=m[0],HO(n,GO([0,1],m)));for(var y=1,h=!0;y<n.length;y+=1){var f=n[y],l=su(f,0,1),g=su(f,-1);if((l==='"'||l==="'"||l==="`"||g==='"'||g==="'"||g==="`")&&l!==g)throw new ei("property names with quotes must have matching quotes");if((f==="constructor"||!h)&&(p=!0),i+="."+f,c="%"+i+"%",au(fo,c))d=fo[c];else if(d!=null){if(!(f in d)){if(!r)throw new Qo("base intrinsic for "+e+" exists, but the property is not available.");return}if(sa&&y+1>=n.length){var v=sa(d,f);h=!!v,h&&"get"in v&&!("originalValue"in v.get)?d=v.get:d=d[f]}else h=au(d,f),d=d[f];h&&!p&&(fo[c]=d)}}return d},"GetIntrinsic")});var Tb=D((y5,wb)=>{"use strict";var XO=Sd();wb.exports=o(function(){return XO()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ab=D((_5,xb)=>{"use strict";var QO=la(),Pb=QO("%Object.defineProperty%",!0),ek=Tb()(),tk=Id(),rk=Bn(),uu=ek?Symbol.toStringTag:null;xb.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 rk("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");uu&&(n||!tk(e,uu))&&(Pb?Pb(e,uu,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[uu]=r)},"setToStringTag")});var Rb=D((E5,Ib)=>{"use strict";var nk=Function.prototype.call,ok=Object.prototype.hasOwnProperty,ik=Jo();Ib.exports=ik.call(nk,ok)});var Ob=D((S5,Cb)=>{"use strict";Cb.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var Db=D((w5,$b)=>{"use strict";var Dd=Mv(),ak=require("util"),Od=require("path"),sk=require("http"),uk=require("https"),ck=require("url").parse,lk=require("fs"),dk=require("stream").Stream,pk=require("crypto"),kd=Bv(),fk=a_(),mk=Ab(),Vn=Rb(),$d=Ob();function kb(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(kb,"escapeHeaderParam");function Be(t){if(!(this instanceof Be))return new Be(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Dd.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(Be,"FormData");ak.inherits(Be,Dd);Be.LINE_BREAK=`\r
|
|
2
|
-
`;Be.DEFAULT_CONTENT_TYPE="application/octet-stream";Be.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Dd.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)};Be.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)+Be.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&Vn(e,"httpVersion"))&&!(e instanceof dk))&&(r.knownLength||this._valuesToMeasure.push(e))};Be.prototype._lengthRetriever=function(t,e){Vn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):lk.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):Vn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):Vn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};Be.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),s="",c={"Content-Disposition":["form-data",'name="'+kb(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&$d(c,r.header);var d;for(var p in c)if(Vn(c,p)){if(d=c[p],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=p+": "+d.join("; ")+Be.LINE_BREAK)}return"--"+this.getBoundary()+Be.LINE_BREAK+s+Be.LINE_BREAK};Be.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=Od.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=Od.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&Vn(t,"httpVersion")&&(r=Od.basename(t.client._httpMessage.path||"")),r)return'filename="'+kb(r)+'"'};Be.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=kd.lookup(t.name)),!r&&t&&t.path&&(r=kd.lookup(t.path)),!r&&t&&t.readable&&Vn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=kd.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Be.DEFAULT_CONTENT_TYPE),r};Be.prototype._multiPartFooter=function(){return function(t){var e=Be.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Be.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Be.LINE_BREAK};Be.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)Vn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};Be.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Be.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Be.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(Be.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Be.prototype._generateBoundary=function(){this._boundary="--------------------------"+pk.randomBytes(12).toString("hex")};Be.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};Be.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Be.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}fk.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};Be.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=ck(t),n=$d({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=$d(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=uk.request(n):r=sk.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),e){var d,p=o(function(m,y){return r.removeListener("error",p),r.removeListener("response",d),e.call(this,m,y)},"callback");d=p.bind(this,null),r.on("error",p),r.on("response",d)}}.bind(this)),r};Be.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Be.prototype.toString=function(){return"[object FormData]"};mk(Be.prototype,"FormData");$b.exports=Be});var pa=D((a9,Zb)=>{"use strict";var du=Object.prototype.hasOwnProperty,Wb=Object.prototype.toString,Fb=Object.defineProperty,qb=Object.getOwnPropertyDescriptor,Bb=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):Wb.call(e)==="[object Array]"},"isArray"),Vb=o(function(e){if(!e||Wb.call(e)!=="[object Object]")return!1;var r=du.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&du.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||du.call(e,i)},"isPlainObject"),Gb=o(function(e,r){Fb&&r.name==="__proto__"?Fb(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),Hb=o(function(e,r){if(r==="__proto__")if(du.call(e,r)){if(qb)return qb(e,r).value}else return;return e[r]},"getProperty");Zb.exports=o(function t(){var e,r,n,i,s,c,d=arguments[0],p=1,m=arguments.length,y=!1;for(typeof d=="boolean"&&(y=d,d=arguments[1]||{},p=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});p<m;++p)if(e=arguments[p],e!=null)for(r in e)n=Hb(d,r),i=Hb(e,r),d!==i&&(y&&i&&(Vb(i)||(s=Bb(i)))?(s?(s=!1,c=n&&Bb(n)?n:[]):c=n&&Vb(n)?n:{},Gb(d,{name:r,newValue:t(y,c,i)})):typeof i<"u"&&Gb(d,{name:r,newValue:i}));return d},"extend")});var Kb=D((u9,wk)=>{wk.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 Yb=D((c9,Jb)=>{"use strict";var Tk=Kb();Jb.exports={pkg:Tk}});var Ld=D(fr=>{"use strict";var Qb=fr&&fr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fr,"__esModule",{value:!0});fr.GaxiosError=fr.GAXIOS_ERROR_SYMBOL=void 0;fr.defaultErrorRedactor=eE;var Xb=Qb(pa()),Pk=Qb(Yb()),Ud=Pk.default.pkg;fr.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Ud.name}-gaxios-error`);var Md=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[fr.GAXIOS_ERROR_SYMBOL]=Ud.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&fr.GAXIOS_ERROR_SYMBOL in e&&e[fr.GAXIOS_ERROR_SYMBOL]===Ud.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,Xb.default)(!0,{},r),this.response&&(this.response.config=(0,Xb.default)(!0,{},this.response.config)),this.response){try{this.response.data=xk(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,r="The request failed"){let n=r;if(typeof e.data=="string"&&(n=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){n="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:n;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,s="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let c=[];for(let d of e.data.error.errors)typeof d=="object"&&"message"in d&&typeof d.message=="string"&&c.push(d.message);return Object.assign({message:c.join(`
|
|
3
|
-
`)||n,code:s,status:i},e.data.error)}return Object.assign({message:n,code:s,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};fr.GaxiosError=Md;function xk(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(xk,"translateData");function eE(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((c,d)=>{(/^authentication$/i.test(d)||/^authorization$/i.test(d)||/secret/i.test(d))&&s.set(d,e)})}o(r,"redactHeaders");function n(s,c){if(typeof s=="object"&&s!==null&&typeof s[c]=="string"){let d=s[c];(/grant_type=/i.test(d)||/assertion=/i.test(d)||/secret/i.test(d))&&(s[c]=e)}}o(n,"redactString");function i(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((c,d)=>{(["grant_type","assertion"].includes(d)||/secret/.test(d))&&s.set(d,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return o(i,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),i(t.config.data),n(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(eE({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(eE,"defaultErrorRedactor")});var rE=D(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.getRetryConfig=Ak;async function Ak(t){let e=tE(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||Ik)(t))return{shouldRetry:!1,config:t.config};let i=Rk(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,i):new Promise(c=>{setTimeout(c,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}o(Ak,"getRetryConfig");function Ik(t){let e=tE(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(Ik,"shouldRetryRequest");function tE(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(tE,"getConfig");function Rk(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(Rk,"getNextRetryDelay")});var qd=D(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.GaxiosInterceptorManager=void 0;var Fd=class extends Set{static{o(this,"GaxiosInterceptorManager")}};pu.GaxiosInterceptorManager=Fd});var oE=D((g9,nE)=>{var ti=1e3,ri=ti*60,ni=ri*60,mo=ni*24,Ck=mo*7,Ok=mo*365.25;nE.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return kk(t);if(r==="number"&&isFinite(t))return e.long?Dk(t):$k(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function kk(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*Ok;case"weeks":case"week":case"w":return r*Ck;case"days":case"day":case"d":return r*mo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ni;case"minutes":case"minute":case"mins":case"min":case"m":return r*ri;case"seconds":case"second":case"secs":case"sec":case"s":return r*ti;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(kk,"parse");function $k(t){var e=Math.abs(t);return e>=mo?Math.round(t/mo)+"d":e>=ni?Math.round(t/ni)+"h":e>=ri?Math.round(t/ri)+"m":e>=ti?Math.round(t/ti)+"s":t+"ms"}o($k,"fmtShort");function Dk(t){var e=Math.abs(t);return e>=mo?fu(t,e,mo,"day"):e>=ni?fu(t,e,ni,"hour"):e>=ri?fu(t,e,ri,"minute"):e>=ti?fu(t,e,ti,"second"):t+" ms"}o(Dk,"fmtLong");function fu(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(fu,"plural")});var Bd=D((v9,iE)=>{function Nk(t){r.debug=r,r.default=r,r.coerce=p,r.disable=c,r.enable=i,r.enabled=d,r.humanize=oE(),r.destroy=m,Object.keys(t).forEach(y=>{r[y]=t[y]}),r.names=[],r.skips=[],r.formatters={};function e(y){let h=0;for(let f=0;f<y.length;f++)h=(h<<5)-h+y.charCodeAt(f),h|=0;return r.colors[Math.abs(h)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(y){let h,f=null,l,g;function v(...E){if(!v.enabled)return;let b=v,C=Number(new Date),U=C-(h||C);b.diff=U,b.prev=h,b.curr=C,h=C,E[0]=r.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let J=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(H,K)=>{if(H==="%%")return"%";J++;let te=r.formatters[K];if(typeof te=="function"){let Q=E[J];H=te.call(b,Q),E.splice(J,1),J--}return H}),r.formatArgs.call(b,E),(b.log||r.log).apply(b,E)}return o(v,"debug"),v.namespace=y,v.useColors=r.useColors(),v.color=r.selectColor(y),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:o(()=>f!==null?f:(l!==r.namespaces&&(l=r.namespaces,g=r.enabled(y)),g),"get"),set:o(E=>{f=E},"set")}),typeof r.init=="function"&&r.init(v),v}o(r,"createDebug");function n(y,h){let f=r(this.namespace+(typeof h>"u"?":":h)+y);return f.log=this.log,f}o(n,"extend");function i(y){r.save(y),r.namespaces=y,r.names=[],r.skips=[];let h=(typeof y=="string"?y:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of h)f[0]==="-"?r.skips.push(f.slice(1)):r.names.push(f)}o(i,"enable");function s(y,h){let f=0,l=0,g=-1,v=0;for(;f<y.length;)if(l<h.length&&(h[l]===y[f]||h[l]==="*"))h[l]==="*"?(g=l,v=f,l++):(f++,l++);else if(g!==-1)l=g+1,v++,f=v;else return!1;for(;l<h.length&&h[l]==="*";)l++;return l===h.length}o(s,"matchesTemplate");function c(){let y=[...r.names,...r.skips.map(h=>"-"+h)].join(",");return r.enable(""),y}o(c,"disable");function d(y){for(let h of r.skips)if(s(y,h))return!1;for(let h of r.names)if(s(y,h))return!0;return!1}o(d,"enabled");function p(y){return y instanceof Error?y.stack||y.message:y}o(p,"coerce");function m(){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(m,"destroy"),r.enable(r.load()),r}o(Nk,"setup");iE.exports=Nk});var aE=D((qt,mu)=>{qt.formatArgs=Uk;qt.save=Mk;qt.load=Lk;qt.useColors=zk;qt.storage=jk();qt.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`."))}})();qt.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 zk(){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(zk,"useColors");function Uk(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+mu.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(Uk,"formatArgs");qt.log=console.debug||console.log||(()=>{});function Mk(t){try{t?qt.storage.setItem("debug",t):qt.storage.removeItem("debug")}catch{}}o(Mk,"save");function Lk(){let t;try{t=qt.storage.getItem("debug")||qt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(Lk,"load");function jk(){try{return localStorage}catch{}}o(jk,"localstorage");mu.exports=Bd()(qt);var{formatters:Fk}=mu.exports;Fk.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var uE=D((E9,sE)=>{"use strict";sE.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 dE=D((S9,lE)=>{"use strict";var qk=require("os"),cE=require("tty"),mr=uE(),{env:xt}=process,Gn;mr("no-color")||mr("no-colors")||mr("color=false")||mr("color=never")?Gn=0:(mr("color")||mr("colors")||mr("color=true")||mr("color=always"))&&(Gn=1);"FORCE_COLOR"in xt&&(xt.FORCE_COLOR==="true"?Gn=1:xt.FORCE_COLOR==="false"?Gn=0:Gn=xt.FORCE_COLOR.length===0?1:Math.min(parseInt(xt.FORCE_COLOR,10),3));function Vd(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(Vd,"translateLevel");function Gd(t,e){if(Gn===0)return 0;if(mr("color=16m")||mr("color=full")||mr("color=truecolor"))return 3;if(mr("color=256"))return 2;if(t&&!e&&Gn===void 0)return 0;let r=Gn||0;if(xt.TERM==="dumb")return r;if(process.platform==="win32"){let n=qk.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in xt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in xt)||xt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in xt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(xt.TEAMCITY_VERSION)?1:0;if(xt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in xt){let n=parseInt((xt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(xt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(xt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(xt.TERM)||"COLORTERM"in xt?1:r}o(Gd,"supportsColor");function Bk(t){let e=Gd(t,t&&t.isTTY);return Vd(e)}o(Bk,"getSupportLevel");lE.exports={supportsColor:Bk,stdout:Vd(Gd(!0,cE.isatty(1))),stderr:Vd(Gd(!0,cE.isatty(2)))}});var fE=D((At,gu)=>{var Vk=require("tty"),hu=require("util");At.init=Yk;At.log=Zk;At.formatArgs=Hk;At.save=Kk;At.load=Jk;At.useColors=Gk;At.destroy=hu.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=dE();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 Gk(){return"colors"in At.inspectOpts?!!At.inspectOpts.colors:Vk.isatty(process.stderr.fd)}o(Gk,"useColors");function Hk(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
1
|
+
"use strict";var BI=Object.create;var Li=Object.defineProperty;var VI=Object.getOwnPropertyDescriptor;var GI=Object.getOwnPropertyNames;var HI=Object.getPrototypeOf,WI=Object.prototype.hasOwnProperty;var o=(t,e)=>Li(t,"name",{value:e,configurable:!0});var Tt=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var D=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Is=(t,e)=>{for(var r in e)Li(t,r,{get:e[r],enumerable:!0})},dg=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of GI(e))!WI.call(t,i)&&i!==r&&Li(t,i,{get:()=>e[i],enumerable:!(n=VI(e,i))||n.enumerable});return t};var qe=(t,e,r)=>(r=t!=null?BI(HI(t)):{},dg(e||!t||!t.__esModule?Li(r,"default",{value:t,enumerable:!0}):r,t)),ZI=t=>dg(Li({},"__esModule",{value:!0}),t);var Dy=D(($y,Ks)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function p(l,g){if(l.indexOf("::")!==l.lastIndexOf("::"))return null;let v=0,E=-1,b=(l.match(d.zoneIndex)||[])[0],C,U;for(b&&(b=b.substring(1),l=l.replace(/%.+$/,""));(E=l.indexOf(":",E+1))>=0;)v++;if(l.substr(0,2)==="::"&&v--,l.substr(-2,2)==="::"&&v--,v>g)return null;for(U=g-v,C=":";U--;)C+="0:";return l=l.replace("::",C),l[0]===":"&&(l=l.slice(1)),l[l.length-1]===":"&&(l=l.slice(0,-1)),g=(function(){let J=l.split(":"),Z=[];for(let H=0;H<J.length;H++)Z.push(parseInt(J[H],16));return Z})(),{parts:g,zoneId:b}}o(p,"expandIPv6");function m(l,g,v,E){if(l.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let b=0,C;for(;E>0;){if(C=v-E,C<0&&(C=0),l[b]>>C!==g[b]>>C)return!1;E-=v,b+=1}return!0}o(m,"matchCIDR");function y(l){if(i.test(l))return parseInt(l,16);if(l[0]==="0"&&!isNaN(parseInt(l[1],10))){if(n.test(l))return parseInt(l,8);throw new Error(`ipaddr: cannot parse ${l} as octal`)}return parseInt(l,10)}o(y,"parseIntAuto");function h(l,g){for(;l.length<g;)l=`0${l}`;return l}o(h,"padPart");let f={};f.IPv4=(function(){function l(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let v,E;for(v=0;v<g.length;v++)if(E=g[v],!(0<=E&&E<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return o(l,"IPv4"),l.prototype.SpecialRanges={unspecified:[[new l([0,0,0,0]),8]],broadcast:[[new l([255,255,255,255]),32]],multicast:[[new l([224,0,0,0]),4]],linkLocal:[[new l([169,254,0,0]),16]],loopback:[[new l([127,0,0,0]),8]],carrierGradeNat:[[new l([100,64,0,0]),10]],private:[[new l([10,0,0,0]),8],[new l([172,16,0,0]),12],[new l([192,168,0,0]),16]],reserved:[[new l([192,0,0,0]),24],[new l([192,0,2,0]),24],[new l([192,88,99,0]),24],[new l([198,18,0,0]),15],[new l([198,51,100,0]),24],[new l([203,0,113,0]),24],[new l([240,0,0,0]),4]],as112:[[new l([192,175,48,0]),24],[new l([192,31,196,0]),24]],amt:[[new l([192,52,193,0]),24]]},l.prototype.kind=function(){return"ipv4"},l.prototype.match=function(g,v){let E;if(v===void 0&&(E=g,g=E[0],v=E[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return m(this.octets,g.octets,8,v)},l.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!1,E={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},b,C,U;for(b=3;b>=0;b-=1)if(C=this.octets[b],C in E){if(U=E[C],v&&U!==0)return null;U!==8&&(v=!0),g+=U}else return null;return 32-g},l.prototype.range=function(){return f.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){return this.octets.slice(0)},l.prototype.toIPv4MappedAddress=function(){return f.IPv6.parse(`::ffff:${this.toString()}`)},l.prototype.toNormalizedString=function(){return this.toString()},l.prototype.toString=function(){return this.octets.join(".")},l})(),f.IPv4.broadcastAddressFromCIDR=function(l){try{let g=this.parseCIDR(l),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],C=0;for(;C<4;)b.push(parseInt(v[C],10)|parseInt(E[C],10)^255),C++;return new this(b)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},f.IPv4.isIPv4=function(l){return this.parser(l)!==null},f.IPv4.isValid=function(l){try{return new this(this.parser(l)),!0}catch{return!1}},f.IPv4.isValidCIDR=function(l){try{return this.parseCIDR(l),!0}catch{return!1}},f.IPv4.isValidFourPartDecimal=function(l){return!!(f.IPv4.isValid(l)&&l.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},f.IPv4.isValidCIDRFourPartDecimal=function(l){let g=l.match(/^(.+)\/(\d+)$/);return!f.IPv4.isValidCIDR(l)||!g?!1:f.IPv4.isValidFourPartDecimal(g[1])},f.IPv4.networkAddressFromCIDR=function(l){let g,v,E,b,C;try{for(g=this.parseCIDR(l),E=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],v=0;v<4;)b.push(parseInt(E[v],10)&parseInt(C[v],10)),v++;return new this(b)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},f.IPv4.parse=function(l){let g=this.parser(l);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},f.IPv4.parseCIDR=function(l){let g;if(g=l.match(/^(.+)\/(\d+)$/)){let v=parseInt(g[2]);if(v>=0&&v<=32){let E=[this.parse(g[1]),v];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")},f.IPv4.parser=function(l){let g,v,E;if(g=l.match(r.fourOctet))return(function(){let b=g.slice(1,6),C=[];for(let U=0;U<b.length;U++)v=b[U],C.push(y(v));return C})();if(g=l.match(r.longValue)){if(E=y(g[1]),E>4294967295||E<0)throw new Error("ipaddr: address outside defined range");return(function(){let b=[],C;for(C=0;C<=24;C+=8)b.push(E>>C&255);return b})().reverse()}else return(g=l.match(r.twoOctet))?(function(){let b=g.slice(1,4),C=[];if(E=y(b[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return C.push(y(b[0])),C.push(E>>16&255),C.push(E>>8&255),C.push(E&255),C})():(g=l.match(r.threeOctet))?(function(){let b=g.slice(1,5),C=[];if(E=y(b[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return C.push(y(b[0])),C.push(y(b[1])),C.push(E>>8&255),C.push(E&255),C})():null},f.IPv4.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>32)throw new Error("ipaddr: invalid IPv4 prefix length");let g=[0,0,0,0],v=0,E=Math.floor(l/8);for(;v<E;)g[v]=255,v++;return E<4&&(g[E]=Math.pow(2,l%8)-1<<8-l%8),new this(g)},f.IPv6=(function(){function l(g,v){let E,b;if(g.length===16)for(this.parts=[],E=0;E<=14;E+=2)this.parts.push(g[E]<<8|g[E+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(E=0;E<this.parts.length;E++)if(b=this.parts[E],!(0<=b&&b<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");v&&(this.zoneId=v)}return o(l,"IPv6"),l.prototype.SpecialRanges={unspecified:[new l([0,0,0,0,0,0,0,0]),128],linkLocal:[new l([65152,0,0,0,0,0,0,0]),10],multicast:[new l([65280,0,0,0,0,0,0,0]),8],loopback:[new l([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new l([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new l([0,0,0,0,0,65535,0,0]),96],discard:[new l([256,0,0,0,0,0,0,0]),64],rfc6145:[new l([0,0,0,0,65535,0,0,0]),96],rfc6052:[new l([100,65435,0,0,0,0,0,0]),96],"6to4":[new l([8194,0,0,0,0,0,0,0]),16],teredo:[new l([8193,0,0,0,0,0,0,0]),32],benchmarking:[new l([8193,2,0,0,0,0,0,0]),48],amt:[new l([8193,3,0,0,0,0,0,0]),32],as112v6:[[new l([8193,4,274,0,0,0,0,0]),48],[new l([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new l([8193,16,0,0,0,0,0,0]),28],orchid2:[new l([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new l([8193,48,0,0,0,0,0,0]),28],reserved:[[new l([8193,0,0,0,0,0,0,0]),23],[new l([8193,3512,0,0,0,0,0,0]),32]]},l.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},l.prototype.kind=function(){return"ipv6"},l.prototype.match=function(g,v){let E;if(v===void 0&&(E=g,g=E[0],v=E[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return m(this.parts,g.parts,16,v)},l.prototype.prefixLengthFromSubnetMask=function(){let g=0,v=!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},b,C;for(let U=7;U>=0;U-=1)if(b=this.parts[U],b in E){if(C=E[b],v&&C!==0)return null;C!==16&&(v=!0),g+=C}else return null;return 128-g},l.prototype.range=function(){return f.subnetMatch(this,this.SpecialRanges)},l.prototype.toByteArray=function(){let g,v=[],E=this.parts;for(let b=0;b<E.length;b++)g=E[b],v.push(g>>8),v.push(g&255);return v},l.prototype.toFixedLengthString=function(){let g=(function(){let E=[];for(let b=0;b<this.parts.length;b++)E.push(h(this.parts[b].toString(16),4));return E}).call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},l.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let g=this.parts.slice(-2),v=g[0],E=g[1];return new f.IPv4([v>>8,v&255,E>>8,E&255])},l.prototype.toNormalizedString=function(){let g=(function(){let E=[];for(let b=0;b<this.parts.length;b++)E.push(this.parts[b].toString(16));return E}).call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),g+v},l.prototype.toRFC5952String=function(){let g=/((^|:)(0(:|$)){2,})/g,v=this.toNormalizedString(),E=0,b=-1,C;for(;C=g.exec(v);)C[0].length>b&&(E=C.index,b=C[0].length);return b<0?v:`${v.substring(0,E)}::${v.substring(E+b)}`},l.prototype.toString=function(){return this.toRFC5952String()},l})(),f.IPv6.broadcastAddressFromCIDR=function(l){try{let g=this.parseCIDR(l),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],C=0;for(;C<16;)b.push(parseInt(v[C],10)|parseInt(E[C],10)^255),C++;return new this(b)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},f.IPv6.isIPv6=function(l){return this.parser(l)!==null},f.IPv6.isValid=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{let g=this.parser(l);return new this(g.parts,g.zoneId),!0}catch{return!1}},f.IPv6.isValidCIDR=function(l){if(typeof l=="string"&&l.indexOf(":")===-1)return!1;try{return this.parseCIDR(l),!0}catch{return!1}},f.IPv6.networkAddressFromCIDR=function(l){let g,v,E,b,C;try{for(g=this.parseCIDR(l),E=g[0].toByteArray(),C=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),b=[],v=0;v<16;)b.push(parseInt(E[v],10)&parseInt(C[v],10)),v++;return new this(b)}catch(U){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${U})`)}},f.IPv6.parse=function(l){let g=this.parser(l);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},f.IPv6.parseCIDR=function(l){let g,v,E;if((v=l.match(/^(.+)\/(\d+)$/))&&(g=parseInt(v[2]),g>=0&&g<=128))return E=[this.parse(v[1]),g],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")},f.IPv6.parser=function(l){let g,v,E,b,C,U;if(E=l.match(d.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(d.native.test(l))return p(l,8);if((E=l.match(d.transitional))&&(U=E[6]||"",g=E[1],E[1].endsWith("::")||(g=g.slice(0,-1)),g=p(g+U,6),g.parts)){for(C=[parseInt(E[2]),parseInt(E[3]),parseInt(E[4]),parseInt(E[5])],v=0;v<C.length;v++)if(b=C[v],!(0<=b&&b<=255))return null;return g.parts.push(C[0]<<8|C[1]),g.parts.push(C[2]<<8|C[3]),{parts:g.parts,zoneId:g.zoneId}}return null},f.IPv6.subnetMaskFromPrefixLength=function(l){if(l=parseInt(l),l<0||l>128)throw new Error("ipaddr: invalid IPv6 prefix length");let g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],v=0,E=Math.floor(l/8);for(;v<E;)g[v]=255,v++;return E<16&&(g[E]=Math.pow(2,l%8)-1<<8-l%8),new this(g)},f.fromByteArray=function(l){let g=l.length;if(g===4)return new f.IPv4(l);if(g===16)return new f.IPv6(l);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},f.isValid=function(l){return f.IPv6.isValid(l)||f.IPv4.isValid(l)},f.isValidCIDR=function(l){return f.IPv6.isValidCIDR(l)||f.IPv4.isValidCIDR(l)},f.parse=function(l){if(f.IPv6.isValid(l))return f.IPv6.parse(l);if(f.IPv4.isValid(l))return f.IPv4.parse(l);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},f.parseCIDR=function(l){try{return f.IPv6.parseCIDR(l)}catch{try{return f.IPv4.parseCIDR(l)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},f.process=function(l){let g=this.parse(l);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},f.subnetMatch=function(l,g,v){let E,b,C,U;v==null&&(v="unicast");for(b in g)if(Object.prototype.hasOwnProperty.call(g,b)){for(C=g[b],C[0]&&!(C[0]instanceof Array)&&(C=[C]),E=0;E<C.length;E++)if(U=C[E],l.kind()===U[0].kind()&&l.match.apply(l,U))return b}return v},typeof Ks<"u"&&Ks.exports?Ks.exports=f:t.ipaddr=f})($y)});var Nv=D((aJ,Dv)=>{var $v=require("stream").Stream,O0=require("util");Dv.exports=Ar;function Ar(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(Ar,"DelayedStream");O0.inherits(Ar,$v);Ar.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(Ar.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});Ar.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Ar.prototype.resume=function(){this._released||this.release(),this.source.resume()};Ar.prototype.pause=function(){this.source.pause()};Ar.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};Ar.prototype.pipe=function(){var t=$v.prototype.pipe.apply(this,arguments);return this.resume(),t};Ar.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)};Ar.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 Lv=D((uJ,Mv)=>{var k0=require("util"),Uv=require("stream").Stream,zv=Nv();Mv.exports=ft;function ft(){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(ft,"CombinedStream");k0.inherits(ft,Uv);ft.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};ft.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};ft.prototype.append=function(t){var e=ft.isStreamLike(t);if(e){if(!(t instanceof zv)){var r=zv.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};ft.prototype.pipe=function(t,e){return Uv.prototype.pipe.call(this,t,e),this.resume(),t};ft.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}};ft.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=ft.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ft.prototype._pipeNext=function(t){this._currentStream=t;var e=ft.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()};ft.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};ft.prototype.write=function(t){this.emit("data",t)};ft.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ft.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")};ft.prototype.end=function(){this._reset(),this.emit("end")};ft.prototype.destroy=function(){this._reset(),this.emit("close")};ft.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ft.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};ft.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)};ft.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var Fv=D((lJ,jv)=>{"use strict";jv.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 Vv=D(Ft=>{"use strict";var tu=Fv(),$0=require("path").extname,qv=/^\s*([^;\s]*)(?:;|\s|$)/,D0=/^text\//i;Ft.charset=Bv;Ft.charsets={lookup:Bv};Ft.contentType=N0;Ft.extension=z0;Ft.extensions=Object.create(null);Ft.lookup=U0;Ft.types=Object.create(null);M0(Ft.extensions,Ft.types);function Bv(t){if(!t||typeof t!="string")return!1;var e=qv.exec(t),r=e&&tu[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&D0.test(e[1])?"UTF-8":!1}o(Bv,"charset");function N0(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Ft.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Ft.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(N0,"contentType");function z0(t){if(!t||typeof t!="string")return!1;var e=qv.exec(t),r=e&&Ft.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(z0,"extension");function U0(t){if(!t||typeof t!="string")return!1;var e=$0("x."+t).toLowerCase().substr(1);return e&&Ft.types[e]||!1}o(U0,"lookup");function M0(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(tu).forEach(o(function(i){var s=tu[i],c=s.extensions;if(!(!c||!c.length)){t[i]=c;for(var d=0;d<c.length;d++){var p=c[d];if(e[p]){var m=r.indexOf(tu[e[p]].source),y=r.indexOf(s.source);if(e[p]!=="application/octet-stream"&&(m>y||m===y&&e[p].substr(0,12)==="application/"))continue}e[p]=i}}},"forEachMimeType"))}o(M0,"populateMaps")});var Hv=D((fJ,Gv)=>{Gv.exports=L0;function L0(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(L0,"defer")});var md=D((hJ,Zv)=>{var Wv=Hv();Zv.exports=j0;function j0(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(j0,"async")});var hd=D((yJ,Kv)=>{Kv.exports=F0;function F0(t){Object.keys(t.jobs).forEach(q0.bind(t)),t.jobs={}}o(F0,"abort");function q0(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(q0,"clean")});var gd=D((_J,Yv)=>{var Jv=md(),B0=hd();Yv.exports=V0;function V0(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=G0(e,i,t[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?B0(r):r.results[i]=c,n(s,r.results))})}o(V0,"iterate");function G0(t,e,r,n){var i;return t.length==2?i=t(r,Jv(n)):i=t(r,e,Jv(n)),i}o(G0,"runJob")});var yd=D((EJ,Xv)=>{Xv.exports=H0;function H0(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(H0,"state")});var vd=D((wJ,Qv)=>{var W0=hd(),Z0=md();Qv.exports=K0;function K0(t){Object.keys(this.jobs).length&&(this.index=this.size,W0(this),Z0(t)(null,this.results))}o(K0,"terminator")});var t_=D((PJ,e_)=>{var J0=gd(),Y0=yd(),X0=vd();e_.exports=Q0;function Q0(t,e,r){for(var n=Y0(t);n.index<(n.keyedList||t).length;)J0(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 X0.bind(n,r)}o(Q0,"parallel")});var _d=D((AJ,ru)=>{var r_=gd(),eO=yd(),tO=vd();ru.exports=rO;ru.exports.ascending=n_;ru.exports.descending=nO;function rO(t,e,r,n){var i=eO(t,r);return r_(t,e,i,o(function s(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||t).length){r_(t,e,i,s);return}n(null,i.results)},"iteratorHandler")),tO.bind(i,n)}o(rO,"serialOrdered");function n_(t,e){return t<e?-1:t>e?1:0}o(n_,"ascending");function nO(t,e){return-1*n_(t,e)}o(nO,"descending")});var i_=D((RJ,o_)=>{var oO=_d();o_.exports=iO;function iO(t,e,r){return oO(t,e,null,r)}o(iO,"serial")});var s_=D((OJ,a_)=>{a_.exports={parallel:t_(),serial:i_(),serialOrdered:_d()}});var bd=D((kJ,u_)=>{"use strict";u_.exports=Object});var l_=D(($J,c_)=>{"use strict";c_.exports=Error});var p_=D((DJ,d_)=>{"use strict";d_.exports=EvalError});var m_=D((NJ,f_)=>{"use strict";f_.exports=RangeError});var g_=D((zJ,h_)=>{"use strict";h_.exports=ReferenceError});var v_=D((UJ,y_)=>{"use strict";y_.exports=SyntaxError});var Bn=D((MJ,__)=>{"use strict";__.exports=TypeError});var E_=D((LJ,b_)=>{"use strict";b_.exports=URIError});var w_=D((jJ,S_)=>{"use strict";S_.exports=Math.abs});var P_=D((FJ,T_)=>{"use strict";T_.exports=Math.floor});var A_=D((qJ,x_)=>{"use strict";x_.exports=Math.max});var R_=D((BJ,I_)=>{"use strict";I_.exports=Math.min});var O_=D((VJ,C_)=>{"use strict";C_.exports=Math.pow});var $_=D((GJ,k_)=>{"use strict";k_.exports=Math.round});var N_=D((HJ,D_)=>{"use strict";D_.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var U_=D((ZJ,z_)=>{"use strict";var aO=N_();z_.exports=o(function(e){return aO(e)||e===0?e:e<0?-1:1},"sign")});var L_=D((JJ,M_)=>{"use strict";M_.exports=Object.getOwnPropertyDescriptor});var Ed=D((YJ,j_)=>{"use strict";var nu=L_();if(nu)try{nu([],"length")}catch{nu=null}j_.exports=nu});var q_=D((XJ,F_)=>{"use strict";var ou=Object.defineProperty||!1;if(ou)try{ou({},"a",{value:1})}catch{ou=!1}F_.exports=ou});var Sd=D((QJ,B_)=>{"use strict";B_.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(e,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var H_=D((t5,G_)=>{"use strict";var V_=typeof Symbol<"u"&&Symbol,sO=Sd();G_.exports=o(function(){return typeof V_!="function"||typeof Symbol!="function"||typeof V_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:sO()},"hasNativeSymbols")});var wd=D((n5,W_)=>{"use strict";W_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Td=D((o5,Z_)=>{"use strict";var uO=bd();Z_.exports=uO.getPrototypeOf||null});var Y_=D((i5,J_)=>{"use strict";var cO="Function.prototype.bind called on incompatible ",lO=Object.prototype.toString,dO=Math.max,pO="[object Function]",K_=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"),fO=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"),mO=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");J_.exports=o(function(e){var r=this;if(typeof r!="function"||lO.apply(r)!==pO)throw new TypeError(cO+r);for(var n=fO(arguments,1),i,s=o(function(){if(this instanceof i){var y=r.apply(this,K_(n,arguments));return Object(y)===y?y:this}return r.apply(e,K_(n,arguments))},"binder"),c=dO(0,r.length-n.length),d=[],p=0;p<c;p++)d[p]="$"+p;if(i=Function("binder","return function ("+mO(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var m=o(function(){},"Empty");m.prototype=r.prototype,i.prototype=new m,m.prototype=null}return i},"bind")});var Jo=D((s5,X_)=>{"use strict";var hO=Y_();X_.exports=Function.prototype.bind||hO});var iu=D((u5,Q_)=>{"use strict";Q_.exports=Function.prototype.call});var Pd=D((c5,eb)=>{"use strict";eb.exports=Function.prototype.apply});var rb=D((l5,tb)=>{"use strict";tb.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ob=D((d5,nb)=>{"use strict";var gO=Jo(),yO=Pd(),vO=iu(),_O=rb();nb.exports=_O||gO.call(vO,yO)});var xd=D((p5,ib)=>{"use strict";var bO=Jo(),EO=Bn(),SO=iu(),wO=ob();ib.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new EO("a function is required");return wO(bO,SO,e)},"callBindBasic")});var db=D((m5,lb)=>{"use strict";var TO=xd(),ab=Ed(),ub;try{ub=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ad=!!ub&&ab&&ab(Object.prototype,"__proto__"),cb=Object,sb=cb.getPrototypeOf;lb.exports=Ad&&typeof Ad.get=="function"?TO([Ad.get]):typeof sb=="function"?o(function(e){return sb(e==null?e:cb(e))},"getDunder"):!1});var gb=D((g5,hb)=>{"use strict";var pb=wd(),fb=Td(),mb=db();hb.exports=pb?o(function(e){return pb(e)},"getProto"):fb?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return fb(e)},"getProto"):mb?o(function(e){return mb(e)},"getProto"):null});var Id=D((v5,yb)=>{"use strict";var PO=Function.prototype.call,xO=Object.prototype.hasOwnProperty,AO=Jo();yb.exports=AO.call(PO,xO)});var la=D((_5,wb)=>{"use strict";var Me,IO=bd(),RO=l_(),CO=p_(),OO=m_(),kO=g_(),ei=v_(),Qo=Bn(),$O=E_(),DO=w_(),NO=P_(),zO=A_(),UO=R_(),MO=O_(),LO=$_(),jO=U_(),Eb=Function,Rd=o(function(t){try{return Eb('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),sa=Ed(),FO=q_(),Cd=o(function(){throw new Qo},"throwTypeError"),qO=sa?(function(){try{return arguments.callee,Cd}catch{try{return sa(arguments,"callee").get}catch{return Cd}}})():Cd,Yo=H_()(),Pt=gb(),BO=Td(),VO=wd(),Sb=Pd(),ua=iu(),Xo={},GO=typeof Uint8Array>"u"||!Pt?Me:Pt(Uint8Array),fo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Me:ArrayBuffer,"%ArrayIteratorPrototype%":Yo&&Pt?Pt([][Symbol.iterator]()):Me,"%AsyncFromSyncIteratorPrototype%":Me,"%AsyncFunction%":Xo,"%AsyncGenerator%":Xo,"%AsyncGeneratorFunction%":Xo,"%AsyncIteratorPrototype%":Xo,"%Atomics%":typeof Atomics>"u"?Me:Atomics,"%BigInt%":typeof BigInt>"u"?Me:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Me:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Me:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Me:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":RO,"%eval%":eval,"%EvalError%":CO,"%Float16Array%":typeof Float16Array>"u"?Me:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Me:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Me:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Me:FinalizationRegistry,"%Function%":Eb,"%GeneratorFunction%":Xo,"%Int8Array%":typeof Int8Array>"u"?Me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Yo&&Pt?Pt(Pt([][Symbol.iterator]())):Me,"%JSON%":typeof JSON=="object"?JSON:Me,"%Map%":typeof Map>"u"?Me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Yo||!Pt?Me:Pt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":IO,"%Object.getOwnPropertyDescriptor%":sa,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Me:Promise,"%Proxy%":typeof Proxy>"u"?Me:Proxy,"%RangeError%":OO,"%ReferenceError%":kO,"%Reflect%":typeof Reflect>"u"?Me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Yo||!Pt?Me:Pt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Yo&&Pt?Pt(""[Symbol.iterator]()):Me,"%Symbol%":Yo?Symbol:Me,"%SyntaxError%":ei,"%ThrowTypeError%":qO,"%TypedArray%":GO,"%TypeError%":Qo,"%Uint8Array%":typeof Uint8Array>"u"?Me:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Me:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Me:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Me:Uint32Array,"%URIError%":$O,"%WeakMap%":typeof WeakMap>"u"?Me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Me:WeakSet,"%Function.prototype.call%":ua,"%Function.prototype.apply%":Sb,"%Object.defineProperty%":FO,"%Object.getPrototypeOf%":BO,"%Math.abs%":DO,"%Math.floor%":NO,"%Math.max%":zO,"%Math.min%":UO,"%Math.pow%":MO,"%Math.round%":LO,"%Math.sign%":jO,"%Reflect.getPrototypeOf%":VO};if(Pt)try{null.error}catch(t){vb=Pt(Pt(t)),fo["%Error.prototype%"]=vb}var vb,HO=o(function t(e){var r;if(e==="%AsyncFunction%")r=Rd("async function () {}");else if(e==="%GeneratorFunction%")r=Rd("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Rd("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Pt&&(r=Pt(i.prototype))}return fo[e]=r,r},"doEval"),_b={__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"]},ca=Jo(),au=Id(),WO=ca.call(ua,Array.prototype.concat),ZO=ca.call(Sb,Array.prototype.splice),bb=ca.call(ua,String.prototype.replace),su=ca.call(ua,String.prototype.slice),KO=ca.call(ua,RegExp.prototype.exec),JO=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,YO=/\\(\\)?/g,XO=o(function(e){var r=su(e,0,1),n=su(e,-1);if(r==="%"&&n!=="%")throw new ei("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new ei("invalid intrinsic syntax, expected opening `%`");var i=[];return bb(e,JO,function(s,c,d,p){i[i.length]=d?bb(p,YO,"$1"):c||s}),i},"stringToPath"),QO=o(function(e,r){var n=e,i;if(au(_b,n)&&(i=_b[n],n="%"+i[0]+"%"),au(fo,n)){var s=fo[n];if(s===Xo&&(s=HO(n)),typeof s>"u"&&!r)throw new Qo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new ei("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");wb.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new Qo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Qo('"allowMissing" argument must be a boolean');if(KO(/^%?[^%]*%?$/,e)===null)throw new ei("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=XO(e),i=n.length>0?n[0]:"",s=QO("%"+i+"%",r),c=s.name,d=s.value,p=!1,m=s.alias;m&&(i=m[0],ZO(n,WO([0,1],m)));for(var y=1,h=!0;y<n.length;y+=1){var f=n[y],l=su(f,0,1),g=su(f,-1);if((l==='"'||l==="'"||l==="`"||g==='"'||g==="'"||g==="`")&&l!==g)throw new ei("property names with quotes must have matching quotes");if((f==="constructor"||!h)&&(p=!0),i+="."+f,c="%"+i+"%",au(fo,c))d=fo[c];else if(d!=null){if(!(f in d)){if(!r)throw new Qo("base intrinsic for "+e+" exists, but the property is not available.");return}if(sa&&y+1>=n.length){var v=sa(d,f);h=!!v,h&&"get"in v&&!("originalValue"in v.get)?d=v.get:d=d[f]}else h=au(d,f),d=d[f];h&&!p&&(fo[c]=d)}}return d},"GetIntrinsic")});var Pb=D((E5,Tb)=>{"use strict";var ek=Sd();Tb.exports=o(function(){return ek()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ib=D((w5,Ab)=>{"use strict";var tk=la(),xb=tk("%Object.defineProperty%",!0),rk=Pb()(),nk=Id(),ok=Bn(),uu=rk?Symbol.toStringTag:null;Ab.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 ok("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");uu&&(n||!nk(e,uu))&&(xb?xb(e,uu,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[uu]=r)},"setToStringTag")});var Cb=D((P5,Rb)=>{"use strict";var ik=Function.prototype.call,ak=Object.prototype.hasOwnProperty,sk=Jo();Rb.exports=sk.call(ik,ak)});var kb=D((x5,Ob)=>{"use strict";Ob.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var Nb=D((A5,Db)=>{"use strict";var Dd=Lv(),uk=require("util"),Od=require("path"),ck=require("http"),lk=require("https"),dk=require("url").parse,pk=require("fs"),fk=require("stream").Stream,mk=require("crypto"),kd=Vv(),hk=s_(),gk=Ib(),Vn=Cb(),$d=kb();function $b(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o($b,"escapeHeaderParam");function Be(t){if(!(this instanceof Be))return new Be(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Dd.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(Be,"FormData");uk.inherits(Be,Dd);Be.LINE_BREAK=`\r
|
|
2
|
+
`;Be.DEFAULT_CONTENT_TYPE="application/octet-stream";Be.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Dd.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)};Be.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)+Be.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&Vn(e,"httpVersion"))&&!(e instanceof fk))&&(r.knownLength||this._valuesToMeasure.push(e))};Be.prototype._lengthRetriever=function(t,e){Vn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):pk.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):Vn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):Vn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};Be.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),s="",c={"Content-Disposition":["form-data",'name="'+$b(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&$d(c,r.header);var d;for(var p in c)if(Vn(c,p)){if(d=c[p],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=p+": "+d.join("; ")+Be.LINE_BREAK)}return"--"+this.getBoundary()+Be.LINE_BREAK+s+Be.LINE_BREAK};Be.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=Od.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=Od.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&Vn(t,"httpVersion")&&(r=Od.basename(t.client._httpMessage.path||"")),r)return'filename="'+$b(r)+'"'};Be.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=kd.lookup(t.name)),!r&&t&&t.path&&(r=kd.lookup(t.path)),!r&&t&&t.readable&&Vn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=kd.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Be.DEFAULT_CONTENT_TYPE),r};Be.prototype._multiPartFooter=function(){return function(t){var e=Be.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Be.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Be.LINE_BREAK};Be.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)Vn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};Be.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Be.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Be.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(Be.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Be.prototype._generateBoundary=function(){this._boundary="--------------------------"+mk.randomBytes(12).toString("hex")};Be.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};Be.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Be.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}hk.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};Be.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=dk(t),n=$d({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=$d(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=lk.request(n):r=ck.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),e){var d,p=o(function(m,y){return r.removeListener("error",p),r.removeListener("response",d),e.call(this,m,y)},"callback");d=p.bind(this,null),r.on("error",p),r.on("response",d)}}.bind(this)),r};Be.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Be.prototype.toString=function(){return"[object FormData]"};gk(Be.prototype,"FormData");Db.exports=Be});var pa=D((l9,Kb)=>{"use strict";var du=Object.prototype.hasOwnProperty,Zb=Object.prototype.toString,qb=Object.defineProperty,Bb=Object.getOwnPropertyDescriptor,Vb=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):Zb.call(e)==="[object Array]"},"isArray"),Gb=o(function(e){if(!e||Zb.call(e)!=="[object Object]")return!1;var r=du.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&du.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||du.call(e,i)},"isPlainObject"),Hb=o(function(e,r){qb&&r.name==="__proto__"?qb(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),Wb=o(function(e,r){if(r==="__proto__")if(du.call(e,r)){if(Bb)return Bb(e,r).value}else return;return e[r]},"getProperty");Kb.exports=o(function t(){var e,r,n,i,s,c,d=arguments[0],p=1,m=arguments.length,y=!1;for(typeof d=="boolean"&&(y=d,d=arguments[1]||{},p=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});p<m;++p)if(e=arguments[p],e!=null)for(r in e)n=Wb(d,r),i=Wb(e,r),d!==i&&(y&&i&&(Gb(i)||(s=Vb(i)))?(s?(s=!1,c=n&&Vb(n)?n:[]):c=n&&Gb(n)?n:{},Hb(d,{name:r,newValue:t(y,c,i)})):typeof i<"u"&&Hb(d,{name:r,newValue:i}));return d},"extend")});var Jb=D((p9,Pk)=>{Pk.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 Xb=D((f9,Yb)=>{"use strict";var xk=Jb();Yb.exports={pkg:xk}});var Ld=D(fr=>{"use strict";var eE=fr&&fr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fr,"__esModule",{value:!0});fr.GaxiosError=fr.GAXIOS_ERROR_SYMBOL=void 0;fr.defaultErrorRedactor=tE;var Qb=eE(pa()),Ak=eE(Xb()),Ud=Ak.default.pkg;fr.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Ud.name}-gaxios-error`);var Md=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[fr.GAXIOS_ERROR_SYMBOL]=Ud.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&fr.GAXIOS_ERROR_SYMBOL in e&&e[fr.GAXIOS_ERROR_SYMBOL]===Ud.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,Qb.default)(!0,{},r),this.response&&(this.response.config=(0,Qb.default)(!0,{},this.response.config)),this.response){try{this.response.data=Ik(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,r="The request failed"){let n=r;if(typeof e.data=="string"&&(n=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){n="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:n;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,s="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let c=[];for(let d of e.data.error.errors)typeof d=="object"&&"message"in d&&typeof d.message=="string"&&c.push(d.message);return Object.assign({message:c.join(`
|
|
3
|
+
`)||n,code:s,status:i},e.data.error)}return Object.assign({message:n,code:s,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};fr.GaxiosError=Md;function Ik(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(Ik,"translateData");function tE(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((c,d)=>{(/^authentication$/i.test(d)||/^authorization$/i.test(d)||/secret/i.test(d))&&s.set(d,e)})}o(r,"redactHeaders");function n(s,c){if(typeof s=="object"&&s!==null&&typeof s[c]=="string"){let d=s[c];(/grant_type=/i.test(d)||/assertion=/i.test(d)||/secret/i.test(d))&&(s[c]=e)}}o(n,"redactString");function i(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((c,d)=>{(["grant_type","assertion"].includes(d)||/secret/.test(d))&&s.set(d,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return o(i,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),i(t.config.data),n(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(tE({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(tE,"defaultErrorRedactor")});var nE=D(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.getRetryConfig=Rk;async function Rk(t){let e=rE(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||Ck)(t))return{shouldRetry:!1,config:t.config};let i=Ok(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,i):new Promise(c=>{setTimeout(c,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}o(Rk,"getRetryConfig");function Ck(t){let e=rE(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(Ck,"shouldRetryRequest");function rE(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(rE,"getConfig");function Ok(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(Ok,"getNextRetryDelay")});var qd=D(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.GaxiosInterceptorManager=void 0;var Fd=class extends Set{static{o(this,"GaxiosInterceptorManager")}};pu.GaxiosInterceptorManager=Fd});var iE=D((b9,oE)=>{var ti=1e3,ri=ti*60,ni=ri*60,mo=ni*24,kk=mo*7,$k=mo*365.25;oE.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Dk(t);if(r==="number"&&isFinite(t))return e.long?zk(t):Nk(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Dk(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*$k;case"weeks":case"week":case"w":return r*kk;case"days":case"day":case"d":return r*mo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ni;case"minutes":case"minute":case"mins":case"min":case"m":return r*ri;case"seconds":case"second":case"secs":case"sec":case"s":return r*ti;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(Dk,"parse");function Nk(t){var e=Math.abs(t);return e>=mo?Math.round(t/mo)+"d":e>=ni?Math.round(t/ni)+"h":e>=ri?Math.round(t/ri)+"m":e>=ti?Math.round(t/ti)+"s":t+"ms"}o(Nk,"fmtShort");function zk(t){var e=Math.abs(t);return e>=mo?fu(t,e,mo,"day"):e>=ni?fu(t,e,ni,"hour"):e>=ri?fu(t,e,ri,"minute"):e>=ti?fu(t,e,ti,"second"):t+" ms"}o(zk,"fmtLong");function fu(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(fu,"plural")});var Bd=D((S9,aE)=>{function Uk(t){r.debug=r,r.default=r,r.coerce=p,r.disable=c,r.enable=i,r.enabled=d,r.humanize=iE(),r.destroy=m,Object.keys(t).forEach(y=>{r[y]=t[y]}),r.names=[],r.skips=[],r.formatters={};function e(y){let h=0;for(let f=0;f<y.length;f++)h=(h<<5)-h+y.charCodeAt(f),h|=0;return r.colors[Math.abs(h)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(y){let h,f=null,l,g;function v(...E){if(!v.enabled)return;let b=v,C=Number(new Date),U=C-(h||C);b.diff=U,b.prev=h,b.curr=C,h=C,E[0]=r.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let J=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(H,K)=>{if(H==="%%")return"%";J++;let te=r.formatters[K];if(typeof te=="function"){let Q=E[J];H=te.call(b,Q),E.splice(J,1),J--}return H}),r.formatArgs.call(b,E),(b.log||r.log).apply(b,E)}return o(v,"debug"),v.namespace=y,v.useColors=r.useColors(),v.color=r.selectColor(y),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:o(()=>f!==null?f:(l!==r.namespaces&&(l=r.namespaces,g=r.enabled(y)),g),"get"),set:o(E=>{f=E},"set")}),typeof r.init=="function"&&r.init(v),v}o(r,"createDebug");function n(y,h){let f=r(this.namespace+(typeof h>"u"?":":h)+y);return f.log=this.log,f}o(n,"extend");function i(y){r.save(y),r.namespaces=y,r.names=[],r.skips=[];let h=(typeof y=="string"?y:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of h)f[0]==="-"?r.skips.push(f.slice(1)):r.names.push(f)}o(i,"enable");function s(y,h){let f=0,l=0,g=-1,v=0;for(;f<y.length;)if(l<h.length&&(h[l]===y[f]||h[l]==="*"))h[l]==="*"?(g=l,v=f,l++):(f++,l++);else if(g!==-1)l=g+1,v++,f=v;else return!1;for(;l<h.length&&h[l]==="*";)l++;return l===h.length}o(s,"matchesTemplate");function c(){let y=[...r.names,...r.skips.map(h=>"-"+h)].join(",");return r.enable(""),y}o(c,"disable");function d(y){for(let h of r.skips)if(s(y,h))return!1;for(let h of r.names)if(s(y,h))return!0;return!1}o(d,"enabled");function p(y){return y instanceof Error?y.stack||y.message:y}o(p,"coerce");function m(){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(m,"destroy"),r.enable(r.load()),r}o(Uk,"setup");aE.exports=Uk});var sE=D((qt,mu)=>{qt.formatArgs=Lk;qt.save=jk;qt.load=Fk;qt.useColors=Mk;qt.storage=qk();qt.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`."))}})();qt.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 Mk(){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(Mk,"useColors");function Lk(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+mu.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(Lk,"formatArgs");qt.log=console.debug||console.log||(()=>{});function jk(t){try{t?qt.storage.setItem("debug",t):qt.storage.removeItem("debug")}catch{}}o(jk,"save");function Fk(){let t;try{t=qt.storage.getItem("debug")||qt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(Fk,"load");function qk(){try{return localStorage}catch{}}o(qk,"localstorage");mu.exports=Bd()(qt);var{formatters:Bk}=mu.exports;Bk.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var cE=D((P9,uE)=>{"use strict";uE.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 pE=D((x9,dE)=>{"use strict";var Vk=require("os"),lE=require("tty"),mr=cE(),{env:xt}=process,Gn;mr("no-color")||mr("no-colors")||mr("color=false")||mr("color=never")?Gn=0:(mr("color")||mr("colors")||mr("color=true")||mr("color=always"))&&(Gn=1);"FORCE_COLOR"in xt&&(xt.FORCE_COLOR==="true"?Gn=1:xt.FORCE_COLOR==="false"?Gn=0:Gn=xt.FORCE_COLOR.length===0?1:Math.min(parseInt(xt.FORCE_COLOR,10),3));function Vd(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(Vd,"translateLevel");function Gd(t,e){if(Gn===0)return 0;if(mr("color=16m")||mr("color=full")||mr("color=truecolor"))return 3;if(mr("color=256"))return 2;if(t&&!e&&Gn===void 0)return 0;let r=Gn||0;if(xt.TERM==="dumb")return r;if(process.platform==="win32"){let n=Vk.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in xt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in xt)||xt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in xt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(xt.TEAMCITY_VERSION)?1:0;if(xt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in xt){let n=parseInt((xt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(xt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(xt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(xt.TERM)||"COLORTERM"in xt?1:r}o(Gd,"supportsColor");function Gk(t){let e=Gd(t,t&&t.isTTY);return Vd(e)}o(Gk,"getSupportLevel");dE.exports={supportsColor:Gk,stdout:Vd(Gd(!0,lE.isatty(1))),stderr:Vd(Gd(!0,lE.isatty(2)))}});var mE=D((At,gu)=>{var Hk=require("tty"),hu=require("util");At.init=Qk;At.log=Jk;At.formatArgs=Zk;At.save=Yk;At.load=Xk;At.useColors=Wk;At.destroy=hu.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=pE();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 Wk(){return"colors"in At.inspectOpts?!!At.inspectOpts.colors:Hk.isatty(process.stderr.fd)}o(Wk,"useColors");function Zk(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
4
4
|
`).join(`
|
|
5
|
-
`+s),t.push(i+"m+"+gu.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=
|
|
6
|
-
`)}o(
|
|
7
|
-
`).map(e=>e.trim()).join(" ")};
|
|
8
|
-
`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new
|
|
5
|
+
`+s),t.push(i+"m+"+gu.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Kk()+e+" "+t[0]}o(Zk,"formatArgs");function Kk(){return At.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(Kk,"getDate");function Jk(...t){return process.stderr.write(hu.formatWithOptions(At.inspectOpts,...t)+`
|
|
6
|
+
`)}o(Jk,"log");function Yk(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o(Yk,"save");function Xk(){return process.env.DEBUG}o(Xk,"load");function Qk(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(Qk,"init");gu.exports=Bd()(At);var{formatters:fE}=gu.exports;fE.o=function(t){return this.inspectOpts.colors=this.useColors,hu.inspect(t,this.inspectOpts).split(`
|
|
7
|
+
`).map(e=>e.trim()).join(" ")};fE.O=function(t){return this.inspectOpts.colors=this.useColors,hu.inspect(t,this.inspectOpts)}});var Wd=D((R9,Hd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Hd.exports=sE():Hd.exports=mE()});var yE=D(Bt=>{"use strict";var e$=Bt&&Bt.__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]})),t$=Bt&&Bt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hE=Bt&&Bt.__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)&&e$(e,t,r);return t$(e,t),e};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.req=Bt.json=Bt.toBuffer=void 0;var r$=hE(require("http")),n$=hE(require("https"));async function gE(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}o(gE,"toBuffer");Bt.toBuffer=gE;async function o$(t){let r=(await gE(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}o(o$,"json");Bt.json=o$;function i$(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?n$:r$).request(t,e),i=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=i.then.bind(i),n}o(i$,"req");Bt.req=i$});var EE=D(Yt=>{"use strict";var _E=Yt&&Yt.__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]})),a$=Yt&&Yt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bE=Yt&&Yt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&_E(e,t,r);return a$(e,t),e},s$=Yt&&Yt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_E(e,t,r)};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.Agent=void 0;var u$=bE(require("net")),vE=bE(require("http")),c$=require("https");s$(yE(),Yt);var Fr=Symbol("AgentBaseInternalState"),Zd=class extends vE.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Fr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
|
|
8
|
+
`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new u$.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)?c$.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let i={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(i),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(d=>{if(this.decrementSockets(s,c),d instanceof vE.Agent)try{return d.addRequest(e,i)}catch(p){return n(p)}this[Fr].currentSocket=d,super.createSocket(e,r,n)},d=>{this.decrementSockets(s,c),n(d)})}createConnection(){let e=this[Fr].currentSocket;if(this[Fr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Fr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Fr]&&(this[Fr].defaultPort=e)}get protocol(){return this[Fr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Fr]&&(this[Fr].protocol=e)}};Yt.Agent=Zd});var SE=D(oi=>{"use strict";var l$=oi&&oi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oi,"__esModule",{value:!0});oi.parseProxyResponse=void 0;var d$=l$(Wd()),yu=(0,d$.default)("https-proxy-agent:parse-proxy-response");function p$(t){return new Promise((e,r)=>{let n=0,i=[];function s(){let y=t.read();y?m(y):t.once("readable",s)}o(s,"read");function c(){t.removeListener("end",d),t.removeListener("error",p),t.removeListener("readable",s)}o(c,"cleanup");function d(){c(),yu("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}o(d,"onend");function p(y){c(),yu("onerror %o",y),r(y)}o(p,"onerror");function m(y){i.push(y),n+=y.length;let h=Buffer.concat(i,n),f=h.indexOf(`\r
|
|
9
9
|
\r
|
|
10
10
|
`);if(f===-1){yu("have not received end of HTTP headers yet..."),s();return}let l=h.slice(0,f).toString("ascii").split(`\r
|
|
11
|
-
`),g=l.shift();if(!g)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let v=g.split(" "),E=+v[1],b=v.slice(2).join(" "),C={};for(let U of l){if(!U)continue;let J=U.indexOf(":");if(J===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${U}"`));let
|
|
11
|
+
`),g=l.shift();if(!g)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let v=g.split(" "),E=+v[1],b=v.slice(2).join(" "),C={};for(let U of l){if(!U)continue;let J=U.indexOf(":");if(J===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${U}"`));let Z=U.slice(0,J).toLowerCase(),H=U.slice(J+1).trimStart(),K=C[Z];typeof K=="string"?C[Z]=[K,H]:Array.isArray(K)?K.push(H):C[Z]=H}yu("got proxy server response: %o %o",g,C),c(),e({connect:{statusCode:E,statusText:b,headers:C},buffered:h})}o(m,"ondata"),t.on("error",p),t.on("end",d),s()})}o(p$,"parseProxyResponse");oi.parseProxyResponse=p$});var IE=D(hr=>{"use strict";var f$=hr&&hr.__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]})),m$=hr&&hr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xE=hr&&hr.__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)&&f$(e,t,r);return m$(e,t),e},AE=hr&&hr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hr,"__esModule",{value:!0});hr.HttpsProxyAgent=void 0;var vu=xE(require("net")),wE=xE(require("tls")),h$=AE(require("assert")),g$=AE(Wd()),y$=EE(),v$=require("url"),_$=SE(),fa=(0,g$.default)("https-proxy-agent"),TE=o(t=>t.servername===void 0&&t.host&&!vu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),_u=class extends y$.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new v$.URL(e):e,this.proxyHeaders=r?.headers??{},fa("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?PE(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:"?(fa("Creating `tls.Socket`: %o",this.connectOpts),i=wE.connect(TE(this.connectOpts))):(fa("Creating `net.Socket`: %o",this.connectOpts),i=vu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=vu.isIPv6(r.host)?`[${r.host}]`:r.host,d=`CONNECT ${c}:${r.port} HTTP/1.1\r
|
|
12
12
|
`;if(n.username||n.password){let f=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(f).toString("base64")}`}s.Host=`${c}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let f of Object.keys(s))d+=`${f}: ${s[f]}\r
|
|
13
|
-
`;let p=(0,
|
|
14
|
-
`);let{connect:m,buffered:y}=await p;if(e.emit("proxyConnect",m),this.emit("proxyConnect",m,e),m.statusCode===200)return e.once("socket",v$),r.secureEndpoint?(fa("Upgrading socket connection to TLS"),SE.connect({...TE(wE(r),"host","path","port"),socket:i})):i;i.destroy();let h=new vu.Socket({writable:!1});return h.readable=!0,e.once("socket",f=>{fa("Replaying proxy buffer for failed request"),(0,f$.default)(f.listenerCount("data")>0),f.push(y),f.push(null)}),h}};_u.protocols=["http","https"];hr.HttpsProxyAgent=_u;function v$(t){t.resume()}o(v$,"resume");function TE(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(TE,"omit")});function _$(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,s=r[0]||"text/plain",c=s;for(let y=1;y<r.length;y++)r[y]==="base64"?i=!0:r[y]&&(c+=`;${r[y]}`,r[y].indexOf("charset=")===0&&(n=r[y].substring(8)));!r[0]&&!n.length&&(c+=";charset=US-ASCII",n="US-ASCII");let d=i?"base64":"ascii",p=unescape(t.substring(e+1)),m=Buffer.from(p,d);return m.type=s,m.typeFull=c,m.charset=n,m}var IE,RE=Tt(()=>{o(_$,"dataUriToBuffer");IE=_$});var OE=D((bu,CE)=>{(function(t,e){typeof bu=="object"&&typeof CE<"u"?e(bu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(bu,(function(t){"use strict";function e(){}o(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(r,"typeIsObject");let n=e;function i(a,u){try{Object.defineProperty(a,"name",{value:u,configurable:!0})}catch{}}o(i,"setFunctionName");let s=Promise,c=Promise.prototype.then,d=Promise.reject.bind(s);function p(a){return new s(a)}o(p,"newPromise");function m(a){return p(u=>u(a))}o(m,"promiseResolvedWith");function y(a){return d(a)}o(y,"promiseRejectedWith");function h(a,u,_){return c.call(a,u,_)}o(h,"PerformPromiseThen");function f(a,u,_){h(h(a,u,_),void 0,n)}o(f,"uponPromise");function l(a,u){f(a,u)}o(l,"uponFulfillment");function g(a,u){f(a,void 0,u)}o(g,"uponRejection");function v(a,u,_){return h(a,u,_)}o(v,"transformPromiseWith");function E(a){h(a,void 0,n)}o(E,"setPromiseIsHandledToTrue");let b=o(a=>{if(typeof queueMicrotask=="function")b=queueMicrotask;else{let u=m(void 0);b=o(_=>h(u,_),"_queueMicrotask")}return b(a)},"_queueMicrotask");function C(a,u,_){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,u,_)}o(C,"reflectCall");function U(a,u,_){try{return m(C(a,u,_))}catch(T){return y(T)}}o(U,"promiseCall");let J=16384;class W{static{o(this,"SimpleQueue")}constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(u){let _=this._back,T=_;_._elements.length===J-1&&(T={_elements:[],_next:void 0}),_._elements.push(u),T!==_&&(this._back=T,_._next=T),++this._size}shift(){let u=this._front,_=u,T=this._cursor,A=T+1,L=u._elements,q=L[T];return A===J&&(_=u._next,A=0),--this._size,this._cursor=A,u!==_&&(this._front=_),L[T]=void 0,q}forEach(u){let _=this._cursor,T=this._front,A=T._elements;for(;(_!==A.length||T._next!==void 0)&&!(_===A.length&&(T=T._next,A=T._elements,_=0,A.length===0));)u(A[_]),++_}peek(){let u=this._front,_=this._cursor;return u._elements[_]}}let H=Symbol("[[AbortSteps]]"),K=Symbol("[[ErrorSteps]]"),te=Symbol("[[CancelSteps]]"),Q=Symbol("[[PullSteps]]"),xe=Symbol("[[ReleaseSteps]]");function re(a,u){a._ownerReadableStream=u,u._reader=a,u._state==="readable"?Y(a):u._state==="closed"?ue(a):ie(a,u._storedError)}o(re,"ReadableStreamReaderGenericInitialize");function V(a,u){let _=a._ownerReadableStream;return Tr(_,u)}o(V,"ReadableStreamReaderGenericCancel");function B(a){let u=a._ownerReadableStream;u._state==="readable"?Ce(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):De(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._readableStreamController[xe](),u._reader=void 0,a._ownerReadableStream=void 0}o(B,"ReadableStreamReaderGenericRelease");function X(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(X,"readerLockException");function Y(a){a._closedPromise=p((u,_)=>{a._closedPromise_resolve=u,a._closedPromise_reject=_})}o(Y,"defaultReaderClosedPromiseInitialize");function ie(a,u){Y(a),Ce(a,u)}o(ie,"defaultReaderClosedPromiseInitializeAsRejected");function ue(a){Y(a),Ke(a)}o(ue,"defaultReaderClosedPromiseInitializeAsResolved");function Ce(a,u){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ce,"defaultReaderClosedPromiseReject");function De(a,u){ie(a,u)}o(De,"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 et=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},wt=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function ee(a){return typeof a=="object"||typeof a=="function"}o(ee,"isDictionary");function lt(a,u){if(a!==void 0&&!ee(a))throw new TypeError(`${u} is not an object.`)}o(lt,"assertDictionary");function mt(a,u){if(typeof a!="function")throw new TypeError(`${u} is not a function.`)}o(mt,"assertFunction");function Ht(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(Ht,"isObject");function We(a,u){if(!Ht(a))throw new TypeError(`${u} is not an object.`)}o(We,"assertObject");function Ye(a,u,_){if(a===void 0)throw new TypeError(`Parameter ${u} is required in '${_}'.`)}o(Ye,"assertRequiredArgument");function S(a,u,_){if(a===void 0)throw new TypeError(`${u} is required in '${_}'.`)}o(S,"assertRequiredField");function P(a){return Number(a)}o(P,"convertUnrestrictedDouble");function x(a){return a===0?0:a}o(x,"censorNegativeZero");function z(a){return x(wt(a))}o(z,"integerPart");function R(a,u){let T=Number.MAX_SAFE_INTEGER,A=Number(a);if(A=x(A),!et(A))throw new TypeError(`${u} is not a finite number`);if(A=z(A),A<0||A>T)throw new TypeError(`${u} is outside the accepted range of 0 to ${T}, inclusive`);return!et(A)||A===0?0:A}o(R,"convertUnsignedLongLongWithEnforceRange");function $(a,u){if(!On(a))throw new TypeError(`${u} is not a ReadableStream.`)}o($,"assertReadableStream");function j(a){return new G(a)}o(j,"AcquireReadableStreamDefaultReader");function I(a,u){a._reader._readRequests.push(u)}o(I,"ReadableStreamAddReadRequest");function O(a,u,_){let A=a._reader._readRequests.shift();_?A._closeSteps():A._chunkSteps(u)}o(O,"ReadableStreamFulfillReadRequest");function M(a){return a._reader._readRequests.length}o(M,"ReadableStreamGetNumReadRequests");function N(a){let u=a._reader;return!(u===void 0||!ce(u))}o(N,"ReadableStreamHasDefaultReader");class G{static{o(this,"ReadableStreamDefaultReader")}constructor(u){if(Ye(u,1,"ReadableStreamDefaultReader"),$(u,"First parameter"),kn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");re(this,u),this._readRequests=new W}get closed(){return ce(this)?this._closedPromise:y(at("closed"))}cancel(u=void 0){return ce(this)?this._ownerReadableStream===void 0?y(X("cancel")):V(this,u):y(at("cancel"))}read(){if(!ce(this))return y(at("read"));if(this._ownerReadableStream===void 0)return y(X("read from"));let u,_,T=p((L,q)=>{u=L,_=q});return pe(this,{_chunkSteps:o(L=>u({value:L,done:!1}),"_chunkSteps"),_closeSteps:o(()=>u({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(L=>_(L),"_errorSteps")}),T}releaseLock(){if(!ce(this))throw at("releaseLock");this._ownerReadableStream!==void 0&&Fe(this)}}Object.defineProperties(G.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(G.prototype.cancel,"cancel"),i(G.prototype.read,"read"),i(G.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(G.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ce(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof G}o(ce,"IsReadableStreamDefaultReader");function pe(a,u){let _=a._ownerReadableStream;_._disturbed=!0,_._state==="closed"?u._closeSteps():_._state==="errored"?u._errorSteps(_._storedError):_._readableStreamController[Q](u)}o(pe,"ReadableStreamDefaultReaderRead");function Fe(a){B(a);let u=new TypeError("Reader was released");ot(a,u)}o(Fe,"ReadableStreamDefaultReaderRelease");function ot(a,u){let _=a._readRequests;a._readRequests=new W,_.forEach(T=>{T._errorSteps(u)})}o(ot,"ReadableStreamDefaultReaderErrorReadRequests");function at(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(at,"defaultReaderBrandCheckException");let je=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Ge{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(u,_){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=_}next(){let u=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?v(this._ongoingPromise,u,u):u(),this._ongoingPromise}return(u){let _=o(()=>this._returnSteps(u),"returnSteps");return this._ongoingPromise?v(this._ongoingPromise,_,_):_()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let u=this._reader,_,T,A=p((q,se)=>{_=q,T=se});return pe(u,{_chunkSteps:o(q=>{this._ongoingPromise=void 0,b(()=>_({value:q,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),_({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(q=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),T(q)},"_errorSteps")}),A}_returnSteps(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;let _=this._reader;if(!this._preventCancel){let T=V(_,u);return B(_),v(T,()=>({value:u,done:!0}))}return B(_),m({value:u,done:!0})}}let bt={next(){return Ro(this)?this._asyncIteratorImpl.next():y(Co("next"))},return(a){return Ro(this)?this._asyncIteratorImpl.return(a):y(Co("return"))}};Object.setPrototypeOf(bt,je);function Io(a,u){let _=j(a),T=new Ge(_,u),A=Object.create(bt);return A._asyncIteratorImpl=T,A}o(Io,"AcquireReadableStreamAsyncIterator");function Ro(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof Ge}catch{return!1}}o(Ro,"IsReadableStreamAsyncIterator");function Co(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(Co,"streamAsyncIteratorBrandCheckException");let Wt=Number.isNaN||function(a){return a!==a};var rn,Rt,Et;function Xe(a){return a.slice()}o(Xe,"CreateArrayFromList");function ch(a,u,_,T,A){new Uint8Array(a).set(new Uint8Array(_,T,A),u)}o(ch,"CopyDataBlockBytes");let nn=o(a=>(typeof a.transfer=="function"?nn=o(u=>u.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?nn=o(u=>structuredClone(u,{transfer:[u]}),"TransferArrayBuffer"):nn=o(u=>u,"TransferArrayBuffer"),nn(a)),"TransferArrayBuffer"),An=o(a=>(typeof a.detached=="boolean"?An=o(u=>u.detached,"IsDetachedBuffer"):An=o(u=>u.byteLength===0,"IsDetachedBuffer"),An(a)),"IsDetachedBuffer");function lh(a,u,_){if(a.slice)return a.slice(u,_);let T=_-u,A=new ArrayBuffer(T);return ch(A,0,a,u,T),A}o(lh,"ArrayBufferSlice");function ts(a,u){let _=a[u];if(_!=null){if(typeof _!="function")throw new TypeError(`${String(u)} is not a function`);return _}}o(ts,"GetMethod");function sA(a){let u={[Symbol.iterator]:()=>a.iterator},_=(async function*(){return yield*u})(),T=_.next;return{iterator:_,nextMethod:T,done:!1}}o(sA,"CreateAsyncFromSyncIterator");let rl=(Et=(rn=Symbol.asyncIterator)!==null&&rn!==void 0?rn:(Rt=Symbol.for)===null||Rt===void 0?void 0:Rt.call(Symbol,"Symbol.asyncIterator"))!==null&&Et!==void 0?Et:"@@asyncIterator";function dh(a,u="sync",_){if(_===void 0)if(u==="async"){if(_=ts(a,rl),_===void 0){let L=ts(a,Symbol.iterator),q=dh(a,"sync",L);return sA(q)}}else _=ts(a,Symbol.iterator);if(_===void 0)throw new TypeError("The object is not iterable");let T=C(_,a,[]);if(!r(T))throw new TypeError("The iterator method must return an object");let A=T.next;return{iterator:T,nextMethod:A,done:!1}}o(dh,"GetIterator");function uA(a){let u=C(a.nextMethod,a.iterator,[]);if(!r(u))throw new TypeError("The iterator.next() method must return an object");return u}o(uA,"IteratorNext");function cA(a){return!!a.done}o(cA,"IteratorComplete");function lA(a){return a.value}o(lA,"IteratorValue");function dA(a){return!(typeof a!="number"||Wt(a)||a<0)}o(dA,"IsNonNegativeNumber");function ph(a){let u=lh(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(u)}o(ph,"CloneAsUint8Array");function nl(a){let u=a._queue.shift();return a._queueTotalSize-=u.size,a._queueTotalSize<0&&(a._queueTotalSize=0),u.value}o(nl,"DequeueValue");function ol(a,u,_){if(!dA(_)||_===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:u,size:_}),a._queueTotalSize+=_}o(ol,"EnqueueValueWithSize");function pA(a){return a._queue.peek().value}o(pA,"PeekQueueValue");function In(a){a._queue=new W,a._queueTotalSize=0}o(In,"ResetQueue");function fh(a){return a===DataView}o(fh,"isDataViewConstructor");function fA(a){return fh(a.constructor)}o(fA,"isDataView");function mA(a){return fh(a)?1:a.BYTES_PER_ELEMENT}o(mA,"arrayBufferViewElementSize");class to{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!il(this))throw ll("view");return this._view}respond(u){if(!il(this))throw ll("respond");if(Ye(u,1,"respond"),u=R(u,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(An(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");is(this._associatedReadableByteStreamController,u)}respondWithNewView(u){if(!il(this))throw ll("respondWithNewView");if(Ye(u,1,"respondWithNewView"),!ArrayBuffer.isView(u))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(An(u.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");as(this._associatedReadableByteStreamController,u)}}Object.defineProperties(to.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(to.prototype.respond,"respond"),i(to.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(to.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class on{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ro(this))throw ki("byobRequest");return cl(this)}get desiredSize(){if(!ro(this))throw ki("desiredSize");return wh(this)}close(){if(!ro(this))throw ki("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let u=this._controlledReadableByteStream._state;if(u!=="readable")throw new TypeError(`The stream (in ${u} state) is not in the readable state and cannot be closed`);Oi(this)}enqueue(u){if(!ro(this))throw ki("enqueue");if(Ye(u,1,"enqueue"),!ArrayBuffer.isView(u))throw new TypeError("chunk must be an array buffer view");if(u.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(u.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let _=this._controlledReadableByteStream._state;if(_!=="readable")throw new TypeError(`The stream (in ${_} state) is not in the readable state and cannot be enqueued to`);os(this,u)}error(u=void 0){if(!ro(this))throw ki("error");cr(this,u)}[te](u){mh(this),In(this);let _=this._cancelAlgorithm(u);return ns(this),_}[Q](u){let _=this._controlledReadableByteStream;if(this._queueTotalSize>0){Sh(this,u);return}let T=this._autoAllocateChunkSize;if(T!==void 0){let A;try{A=new ArrayBuffer(T)}catch(q){u._errorSteps(q);return}let L={buffer:A,bufferByteLength:T,byteOffset:0,byteLength:T,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(L)}I(_,u),no(this)}[xe](){if(this._pendingPullIntos.length>0){let u=this._pendingPullIntos.peek();u.readerType="none",this._pendingPullIntos=new W,this._pendingPullIntos.push(u)}}}Object.defineProperties(on.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(on.prototype.close,"close"),i(on.prototype.enqueue,"enqueue"),i(on.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(on.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function ro(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof on}o(ro,"IsReadableByteStreamController");function il(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof to}o(il,"IsReadableStreamBYOBRequest");function no(a){if(!_A(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let _=a._pullAlgorithm();f(_,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,no(a)),null),T=>(cr(a,T),null))}o(no,"ReadableByteStreamControllerCallPullIfNeeded");function mh(a){sl(a),a._pendingPullIntos=new W}o(mh,"ReadableByteStreamControllerClearPendingPullIntos");function al(a,u){let _=!1;a._state==="closed"&&(_=!0);let T=hh(u);u.readerType==="default"?O(a,T,_):PA(a,T,_)}o(al,"ReadableByteStreamControllerCommitPullIntoDescriptor");function hh(a){let u=a.bytesFilled,_=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,u/_)}o(hh,"ReadableByteStreamControllerConvertPullIntoDescriptor");function rs(a,u,_,T){a._queue.push({buffer:u,byteOffset:_,byteLength:T}),a._queueTotalSize+=T}o(rs,"ReadableByteStreamControllerEnqueueChunkToQueue");function gh(a,u,_,T){let A;try{A=lh(u,_,_+T)}catch(L){throw cr(a,L),L}rs(a,A,0,T)}o(gh,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function yh(a,u){u.bytesFilled>0&&gh(a,u.buffer,u.byteOffset,u.bytesFilled),Oo(a)}o(yh,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function vh(a,u){let _=Math.min(a._queueTotalSize,u.byteLength-u.bytesFilled),T=u.bytesFilled+_,A=_,L=!1,q=T%u.elementSize,se=T-q;se>=u.minimumFill&&(A=se-u.bytesFilled,L=!0);let _e=a._queue;for(;A>0;){let me=_e.peek(),Ae=Math.min(A,me.byteLength),Ne=u.byteOffset+u.bytesFilled;ch(u.buffer,Ne,me.buffer,me.byteOffset,Ae),me.byteLength===Ae?_e.shift():(me.byteOffset+=Ae,me.byteLength-=Ae),a._queueTotalSize-=Ae,_h(a,Ae,u),A-=Ae}return L}o(vh,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function _h(a,u,_){_.bytesFilled+=u}o(_h,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function bh(a){a._queueTotalSize===0&&a._closeRequested?(ns(a),Mi(a._controlledReadableByteStream)):no(a)}o(bh,"ReadableByteStreamControllerHandleQueueDrain");function sl(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(sl,"ReadableByteStreamControllerInvalidateBYOBRequest");function ul(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let u=a._pendingPullIntos.peek();vh(a,u)&&(Oo(a),al(a._controlledReadableByteStream,u))}}o(ul,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function hA(a){let u=a._controlledReadableByteStream._reader;for(;u._readRequests.length>0;){if(a._queueTotalSize===0)return;let _=u._readRequests.shift();Sh(a,_)}}o(hA,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function gA(a,u,_,T){let A=a._controlledReadableByteStream,L=u.constructor,q=mA(L),{byteOffset:se,byteLength:_e}=u,me=_*q,Ae;try{Ae=nn(u.buffer)}catch(tt){T._errorSteps(tt);return}let Ne={buffer:Ae,bufferByteLength:Ae.byteLength,byteOffset:se,byteLength:_e,bytesFilled:0,minimumFill:me,elementSize:q,viewConstructor:L,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Ne),xh(A,T);return}if(A._state==="closed"){let tt=new L(Ne.buffer,Ne.byteOffset,0);T._closeSteps(tt);return}if(a._queueTotalSize>0){if(vh(a,Ne)){let tt=hh(Ne);bh(a),T._chunkSteps(tt);return}if(a._closeRequested){let tt=new TypeError("Insufficient bytes to fill elements in the given buffer");cr(a,tt),T._errorSteps(tt);return}}a._pendingPullIntos.push(Ne),xh(A,T),no(a)}o(gA,"ReadableByteStreamControllerPullInto");function yA(a,u){u.readerType==="none"&&Oo(a);let _=a._controlledReadableByteStream;if(dl(_))for(;Ah(_)>0;){let T=Oo(a);al(_,T)}}o(yA,"ReadableByteStreamControllerRespondInClosedState");function vA(a,u,_){if(_h(a,u,_),_.readerType==="none"){yh(a,_),ul(a);return}if(_.bytesFilled<_.minimumFill)return;Oo(a);let T=_.bytesFilled%_.elementSize;if(T>0){let A=_.byteOffset+_.bytesFilled;gh(a,_.buffer,A-T,T)}_.bytesFilled-=T,al(a._controlledReadableByteStream,_),ul(a)}o(vA,"ReadableByteStreamControllerRespondInReadableState");function Eh(a,u){let _=a._pendingPullIntos.peek();sl(a),a._controlledReadableByteStream._state==="closed"?yA(a,_):vA(a,u,_),no(a)}o(Eh,"ReadableByteStreamControllerRespondInternal");function Oo(a){return a._pendingPullIntos.shift()}o(Oo,"ReadableByteStreamControllerShiftPendingPullInto");function _A(a){let u=a._controlledReadableByteStream;return u._state!=="readable"||a._closeRequested||!a._started?!1:!!(N(u)&&M(u)>0||dl(u)&&Ah(u)>0||wh(a)>0)}o(_A,"ReadableByteStreamControllerShouldCallPull");function ns(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(ns,"ReadableByteStreamControllerClearAlgorithms");function Oi(a){let u=a._controlledReadableByteStream;if(!(a._closeRequested||u._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let _=a._pendingPullIntos.peek();if(_.bytesFilled%_.elementSize!==0){let T=new TypeError("Insufficient bytes to fill elements in the given buffer");throw cr(a,T),T}}ns(a),Mi(u)}}o(Oi,"ReadableByteStreamControllerClose");function os(a,u){let _=a._controlledReadableByteStream;if(a._closeRequested||_._state!=="readable")return;let{buffer:T,byteOffset:A,byteLength:L}=u;if(An(T))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let q=nn(T);if(a._pendingPullIntos.length>0){let se=a._pendingPullIntos.peek();if(An(se.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");sl(a),se.buffer=nn(se.buffer),se.readerType==="none"&&yh(a,se)}if(N(_))if(hA(a),M(_)===0)rs(a,q,A,L);else{a._pendingPullIntos.length>0&&Oo(a);let se=new Uint8Array(q,A,L);O(_,se,!1)}else dl(_)?(rs(a,q,A,L),ul(a)):rs(a,q,A,L);no(a)}o(os,"ReadableByteStreamControllerEnqueue");function cr(a,u){let _=a._controlledReadableByteStream;_._state==="readable"&&(mh(a),In(a),ns(a),Yh(_,u))}o(cr,"ReadableByteStreamControllerError");function Sh(a,u){let _=a._queue.shift();a._queueTotalSize-=_.byteLength,bh(a);let T=new Uint8Array(_.buffer,_.byteOffset,_.byteLength);u._chunkSteps(T)}o(Sh,"ReadableByteStreamControllerFillReadRequestFromQueue");function cl(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let u=a._pendingPullIntos.peek(),_=new Uint8Array(u.buffer,u.byteOffset+u.bytesFilled,u.byteLength-u.bytesFilled),T=Object.create(to.prototype);EA(T,a,_),a._byobRequest=T}return a._byobRequest}o(cl,"ReadableByteStreamControllerGetBYOBRequest");function wh(a){let u=a._controlledReadableByteStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(wh,"ReadableByteStreamControllerGetDesiredSize");function is(a,u){let _=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(u===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(_.bytesFilled+u>_.byteLength)throw new RangeError("bytesWritten out of range")}_.buffer=nn(_.buffer),Eh(a,u)}o(is,"ReadableByteStreamControllerRespond");function as(a,u){let _=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(u.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(_.byteOffset+_.bytesFilled!==u.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(_.bufferByteLength!==u.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(_.bytesFilled+u.byteLength>_.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let A=u.byteLength;_.buffer=nn(u.buffer),Eh(a,A)}o(as,"ReadableByteStreamControllerRespondWithNewView");function Th(a,u,_,T,A,L,q){u._controlledReadableByteStream=a,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,In(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=L,u._pullAlgorithm=T,u._cancelAlgorithm=A,u._autoAllocateChunkSize=q,u._pendingPullIntos=new W,a._readableStreamController=u;let se=_();f(m(se),()=>(u._started=!0,no(u),null),_e=>(cr(u,_e),null))}o(Th,"SetUpReadableByteStreamController");function bA(a,u,_){let T=Object.create(on.prototype),A,L,q;u.start!==void 0?A=o(()=>u.start(T),"startAlgorithm"):A=o(()=>{},"startAlgorithm"),u.pull!==void 0?L=o(()=>u.pull(T),"pullAlgorithm"):L=o(()=>m(void 0),"pullAlgorithm"),u.cancel!==void 0?q=o(_e=>u.cancel(_e),"cancelAlgorithm"):q=o(()=>m(void 0),"cancelAlgorithm");let se=u.autoAllocateChunkSize;if(se===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Th(a,T,A,L,q,_,se)}o(bA,"SetUpReadableByteStreamControllerFromUnderlyingSource");function EA(a,u,_){a._associatedReadableByteStreamController=u,a._view=_}o(EA,"SetUpReadableStreamBYOBRequest");function ll(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(ll,"byobRequestBrandCheckException");function ki(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(ki,"byteStreamControllerBrandCheckException");function SA(a,u){lt(a,u);let _=a?.mode;return{mode:_===void 0?void 0:wA(_,`${u} has member 'mode' that`)}}o(SA,"convertReaderOptions");function wA(a,u){if(a=`${a}`,a!=="byob")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(wA,"convertReadableStreamReaderMode");function TA(a,u){var _;lt(a,u);let T=(_=a?.min)!==null&&_!==void 0?_:1;return{min:R(T,`${u} has member 'min' that`)}}o(TA,"convertByobReadOptions");function Ph(a){return new Rn(a)}o(Ph,"AcquireReadableStreamBYOBReader");function xh(a,u){a._reader._readIntoRequests.push(u)}o(xh,"ReadableStreamAddReadIntoRequest");function PA(a,u,_){let A=a._reader._readIntoRequests.shift();_?A._closeSteps(u):A._chunkSteps(u)}o(PA,"ReadableStreamFulfillReadIntoRequest");function Ah(a){return a._reader._readIntoRequests.length}o(Ah,"ReadableStreamGetNumReadIntoRequests");function dl(a){let u=a._reader;return!(u===void 0||!oo(u))}o(dl,"ReadableStreamHasBYOBReader");class Rn{static{o(this,"ReadableStreamBYOBReader")}constructor(u){if(Ye(u,1,"ReadableStreamBYOBReader"),$(u,"First parameter"),kn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ro(u._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");re(this,u),this._readIntoRequests=new W}get closed(){return oo(this)?this._closedPromise:y(ss("closed"))}cancel(u=void 0){return oo(this)?this._ownerReadableStream===void 0?y(X("cancel")):V(this,u):y(ss("cancel"))}read(u,_={}){if(!oo(this))return y(ss("read"));if(!ArrayBuffer.isView(u))return y(new TypeError("view must be an array buffer view"));if(u.byteLength===0)return y(new TypeError("view must have non-zero byteLength"));if(u.buffer.byteLength===0)return y(new TypeError("view's buffer must have non-zero byteLength"));if(An(u.buffer))return y(new TypeError("view's buffer has been detached"));let T;try{T=TA(_,"options")}catch(me){return y(me)}let A=T.min;if(A===0)return y(new TypeError("options.min must be greater than 0"));if(fA(u)){if(A>u.byteLength)return y(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(A>u.length)return y(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return y(X("read from"));let L,q,se=p((me,Ae)=>{L=me,q=Ae});return Ih(this,u,A,{_chunkSteps:o(me=>L({value:me,done:!1}),"_chunkSteps"),_closeSteps:o(me=>L({value:me,done:!0}),"_closeSteps"),_errorSteps:o(me=>q(me),"_errorSteps")}),se}releaseLock(){if(!oo(this))throw ss("releaseLock");this._ownerReadableStream!==void 0&&xA(this)}}Object.defineProperties(Rn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(Rn.prototype.cancel,"cancel"),i(Rn.prototype.read,"read"),i(Rn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function oo(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof Rn}o(oo,"IsReadableStreamBYOBReader");function Ih(a,u,_,T){let A=a._ownerReadableStream;A._disturbed=!0,A._state==="errored"?T._errorSteps(A._storedError):gA(A._readableStreamController,u,_,T)}o(Ih,"ReadableStreamBYOBReaderRead");function xA(a){B(a);let u=new TypeError("Reader was released");Rh(a,u)}o(xA,"ReadableStreamBYOBReaderRelease");function Rh(a,u){let _=a._readIntoRequests;a._readIntoRequests=new W,_.forEach(T=>{T._errorSteps(u)})}o(Rh,"ReadableStreamBYOBReaderErrorReadIntoRequests");function ss(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(ss,"byobReaderBrandCheckException");function $i(a,u){let{highWaterMark:_}=a;if(_===void 0)return u;if(Wt(_)||_<0)throw new RangeError("Invalid highWaterMark");return _}o($i,"ExtractHighWaterMark");function us(a){let{size:u}=a;return u||(()=>1)}o(us,"ExtractSizeAlgorithm");function cs(a,u){lt(a,u);let _=a?.highWaterMark,T=a?.size;return{highWaterMark:_===void 0?void 0:P(_),size:T===void 0?void 0:AA(T,`${u} has member 'size' that`)}}o(cs,"convertQueuingStrategy");function AA(a,u){return mt(a,u),_=>P(a(_))}o(AA,"convertQueuingStrategySize");function IA(a,u){lt(a,u);let _=a?.abort,T=a?.close,A=a?.start,L=a?.type,q=a?.write;return{abort:_===void 0?void 0:RA(_,a,`${u} has member 'abort' that`),close:T===void 0?void 0:CA(T,a,`${u} has member 'close' that`),start:A===void 0?void 0:OA(A,a,`${u} has member 'start' that`),write:q===void 0?void 0:kA(q,a,`${u} has member 'write' that`),type:L}}o(IA,"convertUnderlyingSink");function RA(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(RA,"convertUnderlyingSinkAbortCallback");function CA(a,u,_){return mt(a,_),()=>U(a,u,[])}o(CA,"convertUnderlyingSinkCloseCallback");function OA(a,u,_){return mt(a,_),T=>C(a,u,[T])}o(OA,"convertUnderlyingSinkStartCallback");function kA(a,u,_){return mt(a,_),(T,A)=>U(a,u,[T,A])}o(kA,"convertUnderlyingSinkWriteCallback");function Ch(a,u){if(!ko(a))throw new TypeError(`${u} is not a WritableStream.`)}o(Ch,"assertWritableStream");function $A(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o($A,"isAbortSignal");let DA=typeof AbortController=="function";function NA(){if(DA)return new AbortController}o(NA,"createAbortController");class Cn{static{o(this,"WritableStream")}constructor(u={},_={}){u===void 0?u=null:We(u,"First parameter");let T=cs(_,"Second parameter"),A=IA(u,"First parameter");if(kh(this),A.type!==void 0)throw new RangeError("Invalid type is specified");let q=us(T),se=$i(T,1);KA(this,A,se,q)}get locked(){if(!ko(this))throw ms("locked");return $o(this)}abort(u=void 0){return ko(this)?$o(this)?y(new TypeError("Cannot abort a stream that already has a writer")):ls(this,u):y(ms("abort"))}close(){return ko(this)?$o(this)?y(new TypeError("Cannot close a stream that already has a writer")):Ur(this)?y(new TypeError("Cannot close an already-closing stream")):$h(this):y(ms("close"))}getWriter(){if(!ko(this))throw ms("getWriter");return Oh(this)}}Object.defineProperties(Cn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(Cn.prototype.abort,"abort"),i(Cn.prototype.close,"close"),i(Cn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Cn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function Oh(a){return new an(a)}o(Oh,"AcquireWritableStreamDefaultWriter");function zA(a,u,_,T,A=1,L=()=>1){let q=Object.create(Cn.prototype);kh(q);let se=Object.create(Do.prototype);return Lh(q,se,a,u,_,T,A,L),q}o(zA,"CreateWritableStream");function kh(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new W,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}o(kh,"InitializeWritableStream");function ko(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof Cn}o(ko,"IsWritableStream");function $o(a){return a._writer!==void 0}o($o,"IsWritableStreamLocked");function ls(a,u){var _;if(a._state==="closed"||a._state==="errored")return m(void 0);a._writableStreamController._abortReason=u,(_=a._writableStreamController._abortController)===null||_===void 0||_.abort(u);let T=a._state;if(T==="closed"||T==="errored")return m(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let A=!1;T==="erroring"&&(A=!0,u=void 0);let L=p((q,se)=>{a._pendingAbortRequest={_promise:void 0,_resolve:q,_reject:se,_reason:u,_wasAlreadyErroring:A}});return a._pendingAbortRequest._promise=L,A||fl(a,u),L}o(ls,"WritableStreamAbort");function $h(a){let u=a._state;if(u==="closed"||u==="errored")return y(new TypeError(`The stream (in ${u} state) is not in the writable state and cannot be closed`));let _=p((A,L)=>{let q={_resolve:A,_reject:L};a._closeRequest=q}),T=a._writer;return T!==void 0&&a._backpressure&&u==="writable"&&El(T),JA(a._writableStreamController),_}o($h,"WritableStreamClose");function UA(a){return p((_,T)=>{let A={_resolve:_,_reject:T};a._writeRequests.push(A)})}o(UA,"WritableStreamAddWriteRequest");function pl(a,u){if(a._state==="writable"){fl(a,u);return}ml(a)}o(pl,"WritableStreamDealWithRejection");function fl(a,u){let _=a._writableStreamController;a._state="erroring",a._storedError=u;let T=a._writer;T!==void 0&&Nh(T,u),!qA(a)&&_._started&&ml(a)}o(fl,"WritableStreamStartErroring");function ml(a){a._state="errored",a._writableStreamController[K]();let u=a._storedError;if(a._writeRequests.forEach(A=>{A._reject(u)}),a._writeRequests=new W,a._pendingAbortRequest===void 0){ds(a);return}let _=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,_._wasAlreadyErroring){_._reject(u),ds(a);return}let T=a._writableStreamController[H](_._reason);f(T,()=>(_._resolve(),ds(a),null),A=>(_._reject(A),ds(a),null))}o(ml,"WritableStreamFinishErroring");function MA(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(MA,"WritableStreamFinishInFlightWrite");function LA(a,u){a._inFlightWriteRequest._reject(u),a._inFlightWriteRequest=void 0,pl(a,u)}o(LA,"WritableStreamFinishInFlightWriteWithError");function jA(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&&Bh(_)}o(jA,"WritableStreamFinishInFlightClose");function FA(a,u){a._inFlightCloseRequest._reject(u),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(u),a._pendingAbortRequest=void 0),pl(a,u)}o(FA,"WritableStreamFinishInFlightCloseWithError");function Ur(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Ur,"WritableStreamCloseQueuedOrInFlight");function qA(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o(qA,"WritableStreamHasOperationMarkedInFlight");function BA(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(BA,"WritableStreamMarkCloseRequestInFlight");function VA(a){a._inFlightWriteRequest=a._writeRequests.shift()}o(VA,"WritableStreamMarkFirstWriteRequestInFlight");function ds(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let u=a._writer;u!==void 0&&_l(u,a._storedError)}o(ds,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function hl(a,u){let _=a._writer;_!==void 0&&u!==a._backpressure&&(u?nI(_):El(_)),a._backpressure=u}o(hl,"WritableStreamUpdateBackpressure");class an{static{o(this,"WritableStreamDefaultWriter")}constructor(u){if(Ye(u,1,"WritableStreamDefaultWriter"),Ch(u,"First parameter"),$o(u))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;let _=u._state;if(_==="writable")!Ur(u)&&u._backpressure?gs(this):Vh(this),hs(this);else if(_==="erroring")bl(this,u._storedError),hs(this);else if(_==="closed")Vh(this),tI(this);else{let T=u._storedError;bl(this,T),qh(this,T)}}get closed(){return io(this)?this._closedPromise:y(ao("closed"))}get desiredSize(){if(!io(this))throw ao("desiredSize");if(this._ownerWritableStream===void 0)throw Ni("desiredSize");return ZA(this)}get ready(){return io(this)?this._readyPromise:y(ao("ready"))}abort(u=void 0){return io(this)?this._ownerWritableStream===void 0?y(Ni("abort")):GA(this,u):y(ao("abort"))}close(){if(!io(this))return y(ao("close"));let u=this._ownerWritableStream;return u===void 0?y(Ni("close")):Ur(u)?y(new TypeError("Cannot close an already-closing stream")):Dh(this)}releaseLock(){if(!io(this))throw ao("releaseLock");this._ownerWritableStream!==void 0&&zh(this)}write(u=void 0){return io(this)?this._ownerWritableStream===void 0?y(Ni("write to")):Uh(this,u):y(ao("write"))}}Object.defineProperties(an.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(an.prototype.abort,"abort"),i(an.prototype.close,"close"),i(an.prototype.releaseLock,"releaseLock"),i(an.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(an.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function io(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof an}o(io,"IsWritableStreamDefaultWriter");function GA(a,u){let _=a._ownerWritableStream;return ls(_,u)}o(GA,"WritableStreamDefaultWriterAbort");function Dh(a){let u=a._ownerWritableStream;return $h(u)}o(Dh,"WritableStreamDefaultWriterClose");function HA(a){let u=a._ownerWritableStream,_=u._state;return Ur(u)||_==="closed"?m(void 0):_==="errored"?y(u._storedError):Dh(a)}o(HA,"WritableStreamDefaultWriterCloseWithErrorPropagation");function WA(a,u){a._closedPromiseState==="pending"?_l(a,u):rI(a,u)}o(WA,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function Nh(a,u){a._readyPromiseState==="pending"?Gh(a,u):oI(a,u)}o(Nh,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function ZA(a){let u=a._ownerWritableStream,_=u._state;return _==="errored"||_==="erroring"?null:_==="closed"?0:jh(u._writableStreamController)}o(ZA,"WritableStreamDefaultWriterGetDesiredSize");function zh(a){let u=a._ownerWritableStream,_=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Nh(a,_),WA(a,_),u._writer=void 0,a._ownerWritableStream=void 0}o(zh,"WritableStreamDefaultWriterRelease");function Uh(a,u){let _=a._ownerWritableStream,T=_._writableStreamController,A=YA(T,u);if(_!==a._ownerWritableStream)return y(Ni("write to"));let L=_._state;if(L==="errored")return y(_._storedError);if(Ur(_)||L==="closed")return y(new TypeError("The stream is closing or closed and cannot be written to"));if(L==="erroring")return y(_._storedError);let q=UA(_);return XA(T,u,A),q}o(Uh,"WritableStreamDefaultWriterWrite");let Mh={};class Do{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!gl(this))throw vl("abortReason");return this._abortReason}get signal(){if(!gl(this))throw vl("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(u=void 0){if(!gl(this))throw vl("error");this._controlledWritableStream._state==="writable"&&Fh(this,u)}[H](u){let _=this._abortAlgorithm(u);return ps(this),_}[K](){In(this)}}Object.defineProperties(Do.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Do.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function gl(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Do}o(gl,"IsWritableStreamDefaultController");function Lh(a,u,_,T,A,L,q,se){u._controlledWritableStream=a,a._writableStreamController=u,u._queue=void 0,u._queueTotalSize=void 0,In(u),u._abortReason=void 0,u._abortController=NA(),u._started=!1,u._strategySizeAlgorithm=se,u._strategyHWM=q,u._writeAlgorithm=T,u._closeAlgorithm=A,u._abortAlgorithm=L;let _e=yl(u);hl(a,_e);let me=_(),Ae=m(me);f(Ae,()=>(u._started=!0,fs(u),null),Ne=>(u._started=!0,pl(a,Ne),null))}o(Lh,"SetUpWritableStreamDefaultController");function KA(a,u,_,T){let A=Object.create(Do.prototype),L,q,se,_e;u.start!==void 0?L=o(()=>u.start(A),"startAlgorithm"):L=o(()=>{},"startAlgorithm"),u.write!==void 0?q=o(me=>u.write(me,A),"writeAlgorithm"):q=o(()=>m(void 0),"writeAlgorithm"),u.close!==void 0?se=o(()=>u.close(),"closeAlgorithm"):se=o(()=>m(void 0),"closeAlgorithm"),u.abort!==void 0?_e=o(me=>u.abort(me),"abortAlgorithm"):_e=o(()=>m(void 0),"abortAlgorithm"),Lh(a,A,L,q,se,_e,_,T)}o(KA,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function ps(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(ps,"WritableStreamDefaultControllerClearAlgorithms");function JA(a){ol(a,Mh,0),fs(a)}o(JA,"WritableStreamDefaultControllerClose");function YA(a,u){try{return a._strategySizeAlgorithm(u)}catch(_){return Di(a,_),1}}o(YA,"WritableStreamDefaultControllerGetChunkSize");function jh(a){return a._strategyHWM-a._queueTotalSize}o(jh,"WritableStreamDefaultControllerGetDesiredSize");function XA(a,u,_){try{ol(a,u,_)}catch(A){Di(a,A);return}let T=a._controlledWritableStream;if(!Ur(T)&&T._state==="writable"){let A=yl(a);hl(T,A)}fs(a)}o(XA,"WritableStreamDefaultControllerWrite");function fs(a){let u=a._controlledWritableStream;if(!a._started||u._inFlightWriteRequest!==void 0)return;if(u._state==="erroring"){ml(u);return}if(a._queue.length===0)return;let T=pA(a);T===Mh?QA(a):eI(a,T)}o(fs,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Di(a,u){a._controlledWritableStream._state==="writable"&&Fh(a,u)}o(Di,"WritableStreamDefaultControllerErrorIfNeeded");function QA(a){let u=a._controlledWritableStream;BA(u),nl(a);let _=a._closeAlgorithm();ps(a),f(_,()=>(jA(u),null),T=>(FA(u,T),null))}o(QA,"WritableStreamDefaultControllerProcessClose");function eI(a,u){let _=a._controlledWritableStream;VA(_);let T=a._writeAlgorithm(u);f(T,()=>{MA(_);let A=_._state;if(nl(a),!Ur(_)&&A==="writable"){let L=yl(a);hl(_,L)}return fs(a),null},A=>(_._state==="writable"&&ps(a),LA(_,A),null))}o(eI,"WritableStreamDefaultControllerProcessWrite");function yl(a){return jh(a)<=0}o(yl,"WritableStreamDefaultControllerGetBackpressure");function Fh(a,u){let _=a._controlledWritableStream;ps(a),fl(_,u)}o(Fh,"WritableStreamDefaultControllerError");function ms(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(ms,"streamBrandCheckException$2");function vl(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(vl,"defaultControllerBrandCheckException$2");function ao(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(ao,"defaultWriterBrandCheckException");function Ni(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(Ni,"defaultWriterLockException");function hs(a){a._closedPromise=p((u,_)=>{a._closedPromise_resolve=u,a._closedPromise_reject=_,a._closedPromiseState="pending"})}o(hs,"defaultWriterClosedPromiseInitialize");function qh(a,u){hs(a),_l(a,u)}o(qh,"defaultWriterClosedPromiseInitializeAsRejected");function tI(a){hs(a),Bh(a)}o(tI,"defaultWriterClosedPromiseInitializeAsResolved");function _l(a,u){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}o(_l,"defaultWriterClosedPromiseReject");function rI(a,u){qh(a,u)}o(rI,"defaultWriterClosedPromiseResetToRejected");function Bh(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(Bh,"defaultWriterClosedPromiseResolve");function gs(a){a._readyPromise=p((u,_)=>{a._readyPromise_resolve=u,a._readyPromise_reject=_}),a._readyPromiseState="pending"}o(gs,"defaultWriterReadyPromiseInitialize");function bl(a,u){gs(a),Gh(a,u)}o(bl,"defaultWriterReadyPromiseInitializeAsRejected");function Vh(a){gs(a),El(a)}o(Vh,"defaultWriterReadyPromiseInitializeAsResolved");function Gh(a,u){a._readyPromise_reject!==void 0&&(E(a._readyPromise),a._readyPromise_reject(u),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}o(Gh,"defaultWriterReadyPromiseReject");function nI(a){gs(a)}o(nI,"defaultWriterReadyPromiseReset");function oI(a,u){bl(a,u)}o(oI,"defaultWriterReadyPromiseResetToRejected");function El(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(El,"defaultWriterReadyPromiseResolve");function iI(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(iI,"getGlobals");let Sl=iI();function aI(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(aI,"isDOMExceptionConstructor");function sI(){let a=Sl?.DOMException;return aI(a)?a:void 0}o(sI,"getFromGlobal");function uI(){let a=o(function(_,T){this.message=_||"",this.name=T||"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(uI,"createPolyfill");let cI=sI()||uI();function Hh(a,u,_,T,A,L){let q=j(a),se=Oh(u);a._disturbed=!0;let _e=!1,me=m(void 0);return p((Ae,Ne)=>{let tt;if(L!==void 0){if(tt=o(()=>{let he=L.reason!==void 0?L.reason:new cI("Aborted","AbortError"),Le=[];T||Le.push(()=>u._state==="writable"?ls(u,he):m(void 0)),A||Le.push(()=>a._state==="readable"?Tr(a,he):m(void 0)),Mt(()=>Promise.all(Le.map(rt=>rt())),!0,he)},"abortAlgorithm"),L.aborted){tt();return}L.addEventListener("abort",tt)}function Pr(){return p((he,Le)=>{function rt(Zt){Zt?he():h(Mo(),rt,Le)}o(rt,"next"),rt(!1)})}o(Pr,"pipeLoop");function Mo(){return _e?m(!0):h(se._readyPromise,()=>p((he,Le)=>{pe(q,{_chunkSteps:o(rt=>{me=h(Uh(se,rt),void 0,e),he(!1)},"_chunkSteps"),_closeSteps:o(()=>he(!0),"_closeSteps"),_errorSteps:Le})}))}if(o(Mo,"pipeStep"),un(a,q._closedPromise,he=>(T?lr(!0,he):Mt(()=>ls(u,he),!0,he),null)),un(u,se._closedPromise,he=>(A?lr(!0,he):Mt(()=>Tr(a,he),!0,he),null)),Dt(a,q._closedPromise,()=>(_?lr():Mt(()=>HA(se)),null)),Ur(u)||u._state==="closed"){let he=new TypeError("the destination writable stream closed before all data could be piped to it");A?lr(!0,he):Mt(()=>Tr(a,he),!0,he)}E(Pr());function Dn(){let he=me;return h(me,()=>he!==me?Dn():void 0)}o(Dn,"waitForWritesToFinish");function un(he,Le,rt){he._state==="errored"?rt(he._storedError):g(Le,rt)}o(un,"isOrBecomesErrored");function Dt(he,Le,rt){he._state==="closed"?rt():l(Le,rt)}o(Dt,"isOrBecomesClosed");function Mt(he,Le,rt){if(_e)return;_e=!0,u._state==="writable"&&!Ur(u)?l(Dn(),Zt):Zt();function Zt(){return f(he(),()=>cn(Le,rt),Lo=>cn(!0,Lo)),null}o(Zt,"doTheRest")}o(Mt,"shutdownWithAction");function lr(he,Le){_e||(_e=!0,u._state==="writable"&&!Ur(u)?l(Dn(),()=>cn(he,Le)):cn(he,Le))}o(lr,"shutdown");function cn(he,Le){return zh(se),B(q),L!==void 0&&L.removeEventListener("abort",tt),he?Ne(Le):Ae(void 0),null}o(cn,"finalize")})}o(Hh,"ReadableStreamPipeTo");class sn{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ys(this))throw _s("desiredSize");return wl(this)}close(){if(!ys(this))throw _s("close");if(!zo(this))throw new TypeError("The stream is not in a state that permits close");so(this)}enqueue(u=void 0){if(!ys(this))throw _s("enqueue");if(!zo(this))throw new TypeError("The stream is not in a state that permits enqueue");return No(this,u)}error(u=void 0){if(!ys(this))throw _s("error");wr(this,u)}[te](u){In(this);let _=this._cancelAlgorithm(u);return vs(this),_}[Q](u){let _=this._controlledReadableStream;if(this._queue.length>0){let T=nl(this);this._closeRequested&&this._queue.length===0?(vs(this),Mi(_)):zi(this),u._chunkSteps(T)}else I(_,u),zi(this)}[xe](){}}Object.defineProperties(sn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(sn.prototype.close,"close"),i(sn.prototype.enqueue,"enqueue"),i(sn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(sn.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function ys(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof sn}o(ys,"IsReadableStreamDefaultController");function zi(a){if(!Wh(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let _=a._pullAlgorithm();f(_,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,zi(a)),null),T=>(wr(a,T),null))}o(zi,"ReadableStreamDefaultControllerCallPullIfNeeded");function Wh(a){let u=a._controlledReadableStream;return!zo(a)||!a._started?!1:!!(kn(u)&&M(u)>0||wl(a)>0)}o(Wh,"ReadableStreamDefaultControllerShouldCallPull");function vs(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(vs,"ReadableStreamDefaultControllerClearAlgorithms");function so(a){if(!zo(a))return;let u=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(vs(a),Mi(u))}o(so,"ReadableStreamDefaultControllerClose");function No(a,u){if(!zo(a))return;let _=a._controlledReadableStream;if(kn(_)&&M(_)>0)O(_,u,!1);else{let T;try{T=a._strategySizeAlgorithm(u)}catch(A){throw wr(a,A),A}try{ol(a,u,T)}catch(A){throw wr(a,A),A}}zi(a)}o(No,"ReadableStreamDefaultControllerEnqueue");function wr(a,u){let _=a._controlledReadableStream;_._state==="readable"&&(In(a),vs(a),Yh(_,u))}o(wr,"ReadableStreamDefaultControllerError");function wl(a){let u=a._controlledReadableStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(wl,"ReadableStreamDefaultControllerGetDesiredSize");function lI(a){return!Wh(a)}o(lI,"ReadableStreamDefaultControllerHasBackpressure");function zo(a){let u=a._controlledReadableStream._state;return!a._closeRequested&&u==="readable"}o(zo,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Zh(a,u,_,T,A,L,q){u._controlledReadableStream=a,u._queue=void 0,u._queueTotalSize=void 0,In(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=q,u._strategyHWM=L,u._pullAlgorithm=T,u._cancelAlgorithm=A,a._readableStreamController=u;let se=_();f(m(se),()=>(u._started=!0,zi(u),null),_e=>(wr(u,_e),null))}o(Zh,"SetUpReadableStreamDefaultController");function dI(a,u,_,T){let A=Object.create(sn.prototype),L,q,se;u.start!==void 0?L=o(()=>u.start(A),"startAlgorithm"):L=o(()=>{},"startAlgorithm"),u.pull!==void 0?q=o(()=>u.pull(A),"pullAlgorithm"):q=o(()=>m(void 0),"pullAlgorithm"),u.cancel!==void 0?se=o(_e=>u.cancel(_e),"cancelAlgorithm"):se=o(()=>m(void 0),"cancelAlgorithm"),Zh(a,A,L,q,se,_,T)}o(dI,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function _s(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o(_s,"defaultControllerBrandCheckException$1");function pI(a,u){return ro(a._readableStreamController)?mI(a):fI(a)}o(pI,"ReadableStreamTee");function fI(a,u){let _=j(a),T=!1,A=!1,L=!1,q=!1,se,_e,me,Ae,Ne,tt=p(Dt=>{Ne=Dt});function Pr(){return T?(A=!0,m(void 0)):(T=!0,pe(_,{_chunkSteps:o(Mt=>{b(()=>{A=!1;let lr=Mt,cn=Mt;L||No(me._readableStreamController,lr),q||No(Ae._readableStreamController,cn),T=!1,A&&Pr()})},"_chunkSteps"),_closeSteps:o(()=>{T=!1,L||so(me._readableStreamController),q||so(Ae._readableStreamController),(!L||!q)&&Ne(void 0)},"_closeSteps"),_errorSteps:o(()=>{T=!1},"_errorSteps")}),m(void 0))}o(Pr,"pullAlgorithm");function Mo(Dt){if(L=!0,se=Dt,q){let Mt=Xe([se,_e]),lr=Tr(a,Mt);Ne(lr)}return tt}o(Mo,"cancel1Algorithm");function Dn(Dt){if(q=!0,_e=Dt,L){let Mt=Xe([se,_e]),lr=Tr(a,Mt);Ne(lr)}return tt}o(Dn,"cancel2Algorithm");function un(){}return o(un,"startAlgorithm"),me=Ui(un,Pr,Mo),Ae=Ui(un,Pr,Dn),g(_._closedPromise,Dt=>(wr(me._readableStreamController,Dt),wr(Ae._readableStreamController,Dt),(!L||!q)&&Ne(void 0),null)),[me,Ae]}o(fI,"ReadableStreamDefaultTee");function mI(a){let u=j(a),_=!1,T=!1,A=!1,L=!1,q=!1,se,_e,me,Ae,Ne,tt=p(he=>{Ne=he});function Pr(he){g(he._closedPromise,Le=>(he!==u||(cr(me._readableStreamController,Le),cr(Ae._readableStreamController,Le),(!L||!q)&&Ne(void 0)),null))}o(Pr,"forwardReaderError");function Mo(){oo(u)&&(B(u),u=j(a),Pr(u)),pe(u,{_chunkSteps:o(Le=>{b(()=>{T=!1,A=!1;let rt=Le,Zt=Le;if(!L&&!q)try{Zt=ph(Le)}catch(Lo){cr(me._readableStreamController,Lo),cr(Ae._readableStreamController,Lo),Ne(Tr(a,Lo));return}L||os(me._readableStreamController,rt),q||os(Ae._readableStreamController,Zt),_=!1,T?un():A&&Dt()})},"_chunkSteps"),_closeSteps:o(()=>{_=!1,L||Oi(me._readableStreamController),q||Oi(Ae._readableStreamController),me._readableStreamController._pendingPullIntos.length>0&&is(me._readableStreamController,0),Ae._readableStreamController._pendingPullIntos.length>0&&is(Ae._readableStreamController,0),(!L||!q)&&Ne(void 0)},"_closeSteps"),_errorSteps:o(()=>{_=!1},"_errorSteps")})}o(Mo,"pullWithDefaultReader");function Dn(he,Le){ce(u)&&(B(u),u=Ph(a),Pr(u));let rt=Le?Ae:me,Zt=Le?me:Ae;Ih(u,he,1,{_chunkSteps:o(jo=>{b(()=>{T=!1,A=!1;let Fo=Le?q:L;if(Le?L:q)Fo||as(rt._readableStreamController,jo);else{let lg;try{lg=ph(jo)}catch(Il){cr(rt._readableStreamController,Il),cr(Zt._readableStreamController,Il),Ne(Tr(a,Il));return}Fo||as(rt._readableStreamController,jo),os(Zt._readableStreamController,lg)}_=!1,T?un():A&&Dt()})},"_chunkSteps"),_closeSteps:o(jo=>{_=!1;let Fo=Le?q:L,As=Le?L:q;Fo||Oi(rt._readableStreamController),As||Oi(Zt._readableStreamController),jo!==void 0&&(Fo||as(rt._readableStreamController,jo),!As&&Zt._readableStreamController._pendingPullIntos.length>0&&is(Zt._readableStreamController,0)),(!Fo||!As)&&Ne(void 0)},"_closeSteps"),_errorSteps:o(()=>{_=!1},"_errorSteps")})}o(Dn,"pullWithBYOBReader");function un(){if(_)return T=!0,m(void 0);_=!0;let he=cl(me._readableStreamController);return he===null?Mo():Dn(he._view,!1),m(void 0)}o(un,"pull1Algorithm");function Dt(){if(_)return A=!0,m(void 0);_=!0;let he=cl(Ae._readableStreamController);return he===null?Mo():Dn(he._view,!0),m(void 0)}o(Dt,"pull2Algorithm");function Mt(he){if(L=!0,se=he,q){let Le=Xe([se,_e]),rt=Tr(a,Le);Ne(rt)}return tt}o(Mt,"cancel1Algorithm");function lr(he){if(q=!0,_e=he,L){let Le=Xe([se,_e]),rt=Tr(a,Le);Ne(rt)}return tt}o(lr,"cancel2Algorithm");function cn(){}return o(cn,"startAlgorithm"),me=Jh(cn,un,Mt),Ae=Jh(cn,Dt,lr),Pr(u),[me,Ae]}o(mI,"ReadableByteStreamTee");function hI(a){return r(a)&&typeof a.getReader<"u"}o(hI,"isReadableStreamLike");function gI(a){return hI(a)?vI(a.getReader()):yI(a)}o(gI,"ReadableStreamFrom");function yI(a){let u,_=dh(a,"async"),T=e;function A(){let q;try{q=uA(_)}catch(_e){return y(_e)}let se=m(q);return v(se,_e=>{if(!r(_e))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(cA(_e))so(u._readableStreamController);else{let Ae=lA(_e);No(u._readableStreamController,Ae)}})}o(A,"pullAlgorithm");function L(q){let se=_.iterator,_e;try{_e=ts(se,"return")}catch(Ne){return y(Ne)}if(_e===void 0)return m(void 0);let me;try{me=C(_e,se,[q])}catch(Ne){return y(Ne)}let Ae=m(me);return v(Ae,Ne=>{if(!r(Ne))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(L,"cancelAlgorithm"),u=Ui(T,A,L,0),u}o(yI,"ReadableStreamFromIterable");function vI(a){let u,_=e;function T(){let L;try{L=a.read()}catch(q){return y(q)}return v(L,q=>{if(!r(q))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(q.done)so(u._readableStreamController);else{let se=q.value;No(u._readableStreamController,se)}})}o(T,"pullAlgorithm");function A(L){try{return m(a.cancel(L))}catch(q){return y(q)}}return o(A,"cancelAlgorithm"),u=Ui(_,T,A,0),u}o(vI,"ReadableStreamFromDefaultReader");function _I(a,u){lt(a,u);let _=a,T=_?.autoAllocateChunkSize,A=_?.cancel,L=_?.pull,q=_?.start,se=_?.type;return{autoAllocateChunkSize:T===void 0?void 0:R(T,`${u} has member 'autoAllocateChunkSize' that`),cancel:A===void 0?void 0:bI(A,_,`${u} has member 'cancel' that`),pull:L===void 0?void 0:EI(L,_,`${u} has member 'pull' that`),start:q===void 0?void 0:SI(q,_,`${u} has member 'start' that`),type:se===void 0?void 0:wI(se,`${u} has member 'type' that`)}}o(_I,"convertUnderlyingDefaultOrByteSource");function bI(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(bI,"convertUnderlyingSourceCancelCallback");function EI(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(EI,"convertUnderlyingSourcePullCallback");function SI(a,u,_){return mt(a,_),T=>C(a,u,[T])}o(SI,"convertUnderlyingSourceStartCallback");function wI(a,u){if(a=`${a}`,a!=="bytes")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(wI,"convertReadableStreamType");function TI(a,u){return lt(a,u),{preventCancel:!!a?.preventCancel}}o(TI,"convertIteratorOptions");function Kh(a,u){lt(a,u);let _=a?.preventAbort,T=a?.preventCancel,A=a?.preventClose,L=a?.signal;return L!==void 0&&PI(L,`${u} has member 'signal' that`),{preventAbort:!!_,preventCancel:!!T,preventClose:!!A,signal:L}}o(Kh,"convertPipeOptions");function PI(a,u){if(!$A(a))throw new TypeError(`${u} is not an AbortSignal.`)}o(PI,"assertAbortSignal");function xI(a,u){lt(a,u);let _=a?.readable;S(_,"readable","ReadableWritablePair"),$(_,`${u} has member 'readable' that`);let T=a?.writable;return S(T,"writable","ReadableWritablePair"),Ch(T,`${u} has member 'writable' that`),{readable:_,writable:T}}o(xI,"convertReadableWritablePair");class Ct{static{o(this,"ReadableStream")}constructor(u={},_={}){u===void 0?u=null:We(u,"First parameter");let T=cs(_,"Second parameter"),A=_I(u,"First parameter");if(Tl(this),A.type==="bytes"){if(T.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let L=$i(T,0);bA(this,A,L)}else{let L=us(T),q=$i(T,1);dI(this,A,q,L)}}get locked(){if(!On(this))throw uo("locked");return kn(this)}cancel(u=void 0){return On(this)?kn(this)?y(new TypeError("Cannot cancel a stream that already has a reader")):Tr(this,u):y(uo("cancel"))}getReader(u=void 0){if(!On(this))throw uo("getReader");return SA(u,"First parameter").mode===void 0?j(this):Ph(this)}pipeThrough(u,_={}){if(!On(this))throw uo("pipeThrough");Ye(u,1,"pipeThrough");let T=xI(u,"First parameter"),A=Kh(_,"Second parameter");if(kn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if($o(T.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let L=Hh(this,T.writable,A.preventClose,A.preventAbort,A.preventCancel,A.signal);return E(L),T.readable}pipeTo(u,_={}){if(!On(this))return y(uo("pipeTo"));if(u===void 0)return y("Parameter 1 is required in 'pipeTo'.");if(!ko(u))return y(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let T;try{T=Kh(_,"Second parameter")}catch(A){return y(A)}return kn(this)?y(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):$o(u)?y(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Hh(this,u,T.preventClose,T.preventAbort,T.preventCancel,T.signal)}tee(){if(!On(this))throw uo("tee");let u=pI(this);return Xe(u)}values(u=void 0){if(!On(this))throw uo("values");let _=TI(u,"First parameter");return Io(this,_.preventCancel)}[rl](u){return this.values(u)}static from(u){return gI(u)}}Object.defineProperties(Ct,{from:{enumerable:!0}}),Object.defineProperties(Ct.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(Ct.from,"from"),i(Ct.prototype.cancel,"cancel"),i(Ct.prototype.getReader,"getReader"),i(Ct.prototype.pipeThrough,"pipeThrough"),i(Ct.prototype.pipeTo,"pipeTo"),i(Ct.prototype.tee,"tee"),i(Ct.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ct.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Ct.prototype,rl,{value:Ct.prototype.values,writable:!0,configurable:!0});function Ui(a,u,_,T=1,A=()=>1){let L=Object.create(Ct.prototype);Tl(L);let q=Object.create(sn.prototype);return Zh(L,q,a,u,_,T,A),L}o(Ui,"CreateReadableStream");function Jh(a,u,_){let T=Object.create(Ct.prototype);Tl(T);let A=Object.create(on.prototype);return Th(T,A,a,u,_,0,void 0),T}o(Jh,"CreateReadableByteStream");function Tl(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(Tl,"InitializeReadableStream");function On(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof Ct}o(On,"IsReadableStream");function kn(a){return a._reader!==void 0}o(kn,"IsReadableStreamLocked");function Tr(a,u){if(a._disturbed=!0,a._state==="closed")return m(void 0);if(a._state==="errored")return y(a._storedError);Mi(a);let _=a._reader;if(_!==void 0&&oo(_)){let A=_._readIntoRequests;_._readIntoRequests=new W,A.forEach(L=>{L._closeSteps(void 0)})}let T=a._readableStreamController[te](u);return v(T,e)}o(Tr,"ReadableStreamCancel");function Mi(a){a._state="closed";let u=a._reader;if(u!==void 0&&(Ke(u),ce(u))){let _=u._readRequests;u._readRequests=new W,_.forEach(T=>{T._closeSteps()})}}o(Mi,"ReadableStreamClose");function Yh(a,u){a._state="errored",a._storedError=u;let _=a._reader;_!==void 0&&(Ce(_,u),ce(_)?ot(_,u):Rh(_,u))}o(Yh,"ReadableStreamError");function uo(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(uo,"streamBrandCheckException$1");function Xh(a,u){lt(a,u);let _=a?.highWaterMark;return S(_,"highWaterMark","QueuingStrategyInit"),{highWaterMark:P(_)}}o(Xh,"convertQueuingStrategyInit");let Qh=o(a=>a.byteLength,"byteLengthSizeFunction");i(Qh,"size");class bs{static{o(this,"ByteLengthQueuingStrategy")}constructor(u){Ye(u,1,"ByteLengthQueuingStrategy"),u=Xh(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!tg(this))throw eg("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!tg(this))throw eg("size");return Qh}}Object.defineProperties(bs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bs.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function eg(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(eg,"byteLengthBrandCheckException");function tg(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof bs}o(tg,"IsByteLengthQueuingStrategy");let rg=o(()=>1,"countSizeFunction");i(rg,"size");class Es{static{o(this,"CountQueuingStrategy")}constructor(u){Ye(u,1,"CountQueuingStrategy"),u=Xh(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!og(this))throw ng("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!og(this))throw ng("size");return rg}}Object.defineProperties(Es.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Es.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function ng(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o(ng,"countBrandCheckException");function og(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof Es}o(og,"IsCountQueuingStrategy");function AI(a,u){lt(a,u);let _=a?.cancel,T=a?.flush,A=a?.readableType,L=a?.start,q=a?.transform,se=a?.writableType;return{cancel:_===void 0?void 0:OI(_,a,`${u} has member 'cancel' that`),flush:T===void 0?void 0:II(T,a,`${u} has member 'flush' that`),readableType:A,start:L===void 0?void 0:RI(L,a,`${u} has member 'start' that`),transform:q===void 0?void 0:CI(q,a,`${u} has member 'transform' that`),writableType:se}}o(AI,"convertTransformer");function II(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(II,"convertTransformerFlushCallback");function RI(a,u,_){return mt(a,_),T=>C(a,u,[T])}o(RI,"convertTransformerStartCallback");function CI(a,u,_){return mt(a,_),(T,A)=>U(a,u,[T,A])}o(CI,"convertTransformerTransformCallback");function OI(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(OI,"convertTransformerCancelCallback");class Ss{static{o(this,"TransformStream")}constructor(u={},_={},T={}){u===void 0&&(u=null);let A=cs(_,"Second parameter"),L=cs(T,"Third parameter"),q=AI(u,"First parameter");if(q.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(q.writableType!==void 0)throw new RangeError("Invalid writableType specified");let se=$i(L,0),_e=us(L),me=$i(A,1),Ae=us(A),Ne,tt=p(Pr=>{Ne=Pr});kI(this,tt,me,Ae,se,_e),DI(this,q),q.start!==void 0?Ne(q.start(this._transformStreamController)):Ne(void 0)}get readable(){if(!ig(this))throw cg("readable");return this._readable}get writable(){if(!ig(this))throw cg("writable");return this._writable}}Object.defineProperties(Ss.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ss.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function kI(a,u,_,T,A,L){function q(){return u}o(q,"startAlgorithm");function se(tt){return UI(a,tt)}o(se,"writeAlgorithm");function _e(tt){return MI(a,tt)}o(_e,"abortAlgorithm");function me(){return LI(a)}o(me,"closeAlgorithm"),a._writable=zA(q,se,me,_e,_,T);function Ae(){return jI(a)}o(Ae,"pullAlgorithm");function Ne(tt){return FI(a,tt)}o(Ne,"cancelAlgorithm"),a._readable=Ui(q,Ae,Ne,A,L),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,ws(a,!0),a._transformStreamController=void 0}o(kI,"InitializeTransformStream");function ig(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof Ss}o(ig,"IsTransformStream");function ag(a,u){wr(a._readable._readableStreamController,u),Pl(a,u)}o(ag,"TransformStreamError");function Pl(a,u){Ps(a._transformStreamController),Di(a._writable._writableStreamController,u),xl(a)}o(Pl,"TransformStreamErrorWritableAndUnblockWrite");function xl(a){a._backpressure&&ws(a,!1)}o(xl,"TransformStreamUnblockWrite");function ws(a,u){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=p(_=>{a._backpressureChangePromise_resolve=_}),a._backpressure=u}o(ws,"TransformStreamSetBackpressure");class $n{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ts(this))throw xs("desiredSize");let u=this._controlledTransformStream._readable._readableStreamController;return wl(u)}enqueue(u=void 0){if(!Ts(this))throw xs("enqueue");sg(this,u)}error(u=void 0){if(!Ts(this))throw xs("error");NI(this,u)}terminate(){if(!Ts(this))throw xs("terminate");zI(this)}}Object.defineProperties($n.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i($n.prototype.enqueue,"enqueue"),i($n.prototype.error,"error"),i($n.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($n.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function Ts(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof $n}o(Ts,"IsTransformStreamDefaultController");function $I(a,u,_,T,A){u._controlledTransformStream=a,a._transformStreamController=u,u._transformAlgorithm=_,u._flushAlgorithm=T,u._cancelAlgorithm=A,u._finishPromise=void 0,u._finishPromise_resolve=void 0,u._finishPromise_reject=void 0}o($I,"SetUpTransformStreamDefaultController");function DI(a,u){let _=Object.create($n.prototype),T,A,L;u.transform!==void 0?T=o(q=>u.transform(q,_),"transformAlgorithm"):T=o(q=>{try{return sg(_,q),m(void 0)}catch(se){return y(se)}},"transformAlgorithm"),u.flush!==void 0?A=o(()=>u.flush(_),"flushAlgorithm"):A=o(()=>m(void 0),"flushAlgorithm"),u.cancel!==void 0?L=o(q=>u.cancel(q),"cancelAlgorithm"):L=o(()=>m(void 0),"cancelAlgorithm"),$I(a,_,T,A,L)}o(DI,"SetUpTransformStreamDefaultControllerFromTransformer");function Ps(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(Ps,"TransformStreamDefaultControllerClearAlgorithms");function sg(a,u){let _=a._controlledTransformStream,T=_._readable._readableStreamController;if(!zo(T))throw new TypeError("Readable side is not in a state that permits enqueue");try{No(T,u)}catch(L){throw Pl(_,L),_._readable._storedError}lI(T)!==_._backpressure&&ws(_,!0)}o(sg,"TransformStreamDefaultControllerEnqueue");function NI(a,u){ag(a._controlledTransformStream,u)}o(NI,"TransformStreamDefaultControllerError");function ug(a,u){let _=a._transformAlgorithm(u);return v(_,void 0,T=>{throw ag(a._controlledTransformStream,T),T})}o(ug,"TransformStreamDefaultControllerPerformTransform");function zI(a){let u=a._controlledTransformStream,_=u._readable._readableStreamController;so(_);let T=new TypeError("TransformStream terminated");Pl(u,T)}o(zI,"TransformStreamDefaultControllerTerminate");function UI(a,u){let _=a._transformStreamController;if(a._backpressure){let T=a._backpressureChangePromise;return v(T,()=>{let A=a._writable;if(A._state==="erroring")throw A._storedError;return ug(_,u)})}return ug(_,u)}o(UI,"TransformStreamDefaultSinkWriteAlgorithm");function MI(a,u){let _=a._transformStreamController;if(_._finishPromise!==void 0)return _._finishPromise;let T=a._readable;_._finishPromise=p((L,q)=>{_._finishPromise_resolve=L,_._finishPromise_reject=q});let A=_._cancelAlgorithm(u);return Ps(_),f(A,()=>(T._state==="errored"?Uo(_,T._storedError):(wr(T._readableStreamController,u),Al(_)),null),L=>(wr(T._readableStreamController,L),Uo(_,L),null)),_._finishPromise}o(MI,"TransformStreamDefaultSinkAbortAlgorithm");function LI(a){let u=a._transformStreamController;if(u._finishPromise!==void 0)return u._finishPromise;let _=a._readable;u._finishPromise=p((A,L)=>{u._finishPromise_resolve=A,u._finishPromise_reject=L});let T=u._flushAlgorithm();return Ps(u),f(T,()=>(_._state==="errored"?Uo(u,_._storedError):(so(_._readableStreamController),Al(u)),null),A=>(wr(_._readableStreamController,A),Uo(u,A),null)),u._finishPromise}o(LI,"TransformStreamDefaultSinkCloseAlgorithm");function jI(a){return ws(a,!1),a._backpressureChangePromise}o(jI,"TransformStreamDefaultSourcePullAlgorithm");function FI(a,u){let _=a._transformStreamController;if(_._finishPromise!==void 0)return _._finishPromise;let T=a._writable;_._finishPromise=p((L,q)=>{_._finishPromise_resolve=L,_._finishPromise_reject=q});let A=_._cancelAlgorithm(u);return Ps(_),f(A,()=>(T._state==="errored"?Uo(_,T._storedError):(Di(T._writableStreamController,u),xl(a),Al(_)),null),L=>(Di(T._writableStreamController,L),xl(a),Uo(_,L),null)),_._finishPromise}o(FI,"TransformStreamDefaultSourceCancelAlgorithm");function xs(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(xs,"defaultControllerBrandCheckException");function Al(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Al,"defaultControllerFinishPromiseResolve");function Uo(a,u){a._finishPromise_reject!==void 0&&(E(a._finishPromise),a._finishPromise_reject(u),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Uo,"defaultControllerFinishPromiseReject");function cg(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(cg,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=bs,t.CountQueuingStrategy=Es,t.ReadableByteStreamController=on,t.ReadableStream=Ct,t.ReadableStreamBYOBReader=Rn,t.ReadableStreamBYOBRequest=to,t.ReadableStreamDefaultController=sn,t.ReadableStreamDefaultReader=G,t.TransformStream=Ss,t.TransformStreamDefaultController=$n,t.WritableStream=Cn,t.WritableStreamDefaultController=Do,t.WritableStreamDefaultWriter=an}))});var kE=D(()=>{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,OE())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=o(function(r){let n=0,i=this;return new ReadableStream({type:"bytes",async pull(s){let d=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=d.byteLength,s.enqueue(new Uint8Array(d)),n===i.size&&s.close()}})},"name"))}catch{}});async function*Kd(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,$E),c=r.buffer.slice(n,n+s);n+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let c=await i.slice(n,Math.min(i.size,n+$E)).arrayBuffer();n+=c.byteLength,yield new Uint8Array(c)}}}var j9,$E,DE,b$,Ir,ma=Tt(()=>{j9=qe(kE(),1);$E=65536;o(Kd,"toIterator");DE=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 c;ArrayBuffer.isView(s)?c=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?c=new Uint8Array(s.slice(0)):s instanceof Jd?c=s:c=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Kd(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 Kd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Kd(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let n=await e.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,n=""){let{size:i}=this,s=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),d=Math.max(c-s,0),p=this.#e,m=[],y=0;for(let f of p){if(y>=d)break;let l=ArrayBuffer.isView(f)?f.byteLength:f.size;if(s&&l<=s)s-=l,c-=l;else{let g;ArrayBuffer.isView(f)?(g=f.subarray(s,Math.min(l,c)),y+=g.byteLength):(g=f.slice(s,Math.min(l,c)),y+=g.size),c-=l,m.push(g),s=0}}let h=new Jd([],{type:String(n).toLowerCase()});return h.#r=d,h.#e=m,h}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(DE.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});b$=DE,Ir=b$});var E$,S$,Hn,Yd=Tt(()=>{ma();E$=class extends Ir{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 Ir&&/^(File)$/.test(e[Symbol.toStringTag])}},S$=E$,Hn=S$});function UE(t,e=Ir){var r=`${NE()}${NE()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
|
|
13
|
+
`;let p=(0,_$.parseProxyResponse)(i);i.write(`${d}\r
|
|
14
|
+
`);let{connect:m,buffered:y}=await p;if(e.emit("proxyConnect",m),this.emit("proxyConnect",m,e),m.statusCode===200)return e.once("socket",b$),r.secureEndpoint?(fa("Upgrading socket connection to TLS"),wE.connect({...PE(TE(r),"host","path","port"),socket:i})):i;i.destroy();let h=new vu.Socket({writable:!1});return h.readable=!0,e.once("socket",f=>{fa("Replaying proxy buffer for failed request"),(0,h$.default)(f.listenerCount("data")>0),f.push(y),f.push(null)}),h}};_u.protocols=["http","https"];hr.HttpsProxyAgent=_u;function b$(t){t.resume()}o(b$,"resume");function PE(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(PE,"omit")});function E$(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,s=r[0]||"text/plain",c=s;for(let y=1;y<r.length;y++)r[y]==="base64"?i=!0:r[y]&&(c+=`;${r[y]}`,r[y].indexOf("charset=")===0&&(n=r[y].substring(8)));!r[0]&&!n.length&&(c+=";charset=US-ASCII",n="US-ASCII");let d=i?"base64":"ascii",p=unescape(t.substring(e+1)),m=Buffer.from(p,d);return m.type=s,m.typeFull=c,m.charset=n,m}var RE,CE=Tt(()=>{o(E$,"dataUriToBuffer");RE=E$});var kE=D((bu,OE)=>{(function(t,e){typeof bu=="object"&&typeof OE<"u"?e(bu):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(bu,(function(t){"use strict";function e(){}o(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(r,"typeIsObject");let n=e;function i(a,u){try{Object.defineProperty(a,"name",{value:u,configurable:!0})}catch{}}o(i,"setFunctionName");let s=Promise,c=Promise.prototype.then,d=Promise.reject.bind(s);function p(a){return new s(a)}o(p,"newPromise");function m(a){return p(u=>u(a))}o(m,"promiseResolvedWith");function y(a){return d(a)}o(y,"promiseRejectedWith");function h(a,u,_){return c.call(a,u,_)}o(h,"PerformPromiseThen");function f(a,u,_){h(h(a,u,_),void 0,n)}o(f,"uponPromise");function l(a,u){f(a,u)}o(l,"uponFulfillment");function g(a,u){f(a,void 0,u)}o(g,"uponRejection");function v(a,u,_){return h(a,u,_)}o(v,"transformPromiseWith");function E(a){h(a,void 0,n)}o(E,"setPromiseIsHandledToTrue");let b=o(a=>{if(typeof queueMicrotask=="function")b=queueMicrotask;else{let u=m(void 0);b=o(_=>h(u,_),"_queueMicrotask")}return b(a)},"_queueMicrotask");function C(a,u,_){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,u,_)}o(C,"reflectCall");function U(a,u,_){try{return m(C(a,u,_))}catch(T){return y(T)}}o(U,"promiseCall");let J=16384;class Z{static{o(this,"SimpleQueue")}constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(u){let _=this._back,T=_;_._elements.length===J-1&&(T={_elements:[],_next:void 0}),_._elements.push(u),T!==_&&(this._back=T,_._next=T),++this._size}shift(){let u=this._front,_=u,T=this._cursor,A=T+1,L=u._elements,q=L[T];return A===J&&(_=u._next,A=0),--this._size,this._cursor=A,u!==_&&(this._front=_),L[T]=void 0,q}forEach(u){let _=this._cursor,T=this._front,A=T._elements;for(;(_!==A.length||T._next!==void 0)&&!(_===A.length&&(T=T._next,A=T._elements,_=0,A.length===0));)u(A[_]),++_}peek(){let u=this._front,_=this._cursor;return u._elements[_]}}let H=Symbol("[[AbortSteps]]"),K=Symbol("[[ErrorSteps]]"),te=Symbol("[[CancelSteps]]"),Q=Symbol("[[PullSteps]]"),xe=Symbol("[[ReleaseSteps]]");function re(a,u){a._ownerReadableStream=u,u._reader=a,u._state==="readable"?Y(a):u._state==="closed"?ue(a):ie(a,u._storedError)}o(re,"ReadableStreamReaderGenericInitialize");function V(a,u){let _=a._ownerReadableStream;return Tr(_,u)}o(V,"ReadableStreamReaderGenericCancel");function B(a){let u=a._ownerReadableStream;u._state==="readable"?Ce(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):De(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._readableStreamController[xe](),u._reader=void 0,a._ownerReadableStream=void 0}o(B,"ReadableStreamReaderGenericRelease");function X(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(X,"readerLockException");function Y(a){a._closedPromise=p((u,_)=>{a._closedPromise_resolve=u,a._closedPromise_reject=_})}o(Y,"defaultReaderClosedPromiseInitialize");function ie(a,u){Y(a),Ce(a,u)}o(ie,"defaultReaderClosedPromiseInitializeAsRejected");function ue(a){Y(a),Ke(a)}o(ue,"defaultReaderClosedPromiseInitializeAsResolved");function Ce(a,u){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ce,"defaultReaderClosedPromiseReject");function De(a,u){ie(a,u)}o(De,"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 et=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},wt=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function ee(a){return typeof a=="object"||typeof a=="function"}o(ee,"isDictionary");function lt(a,u){if(a!==void 0&&!ee(a))throw new TypeError(`${u} is not an object.`)}o(lt,"assertDictionary");function mt(a,u){if(typeof a!="function")throw new TypeError(`${u} is not a function.`)}o(mt,"assertFunction");function Ht(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(Ht,"isObject");function We(a,u){if(!Ht(a))throw new TypeError(`${u} is not an object.`)}o(We,"assertObject");function Ye(a,u,_){if(a===void 0)throw new TypeError(`Parameter ${u} is required in '${_}'.`)}o(Ye,"assertRequiredArgument");function S(a,u,_){if(a===void 0)throw new TypeError(`${u} is required in '${_}'.`)}o(S,"assertRequiredField");function P(a){return Number(a)}o(P,"convertUnrestrictedDouble");function x(a){return a===0?0:a}o(x,"censorNegativeZero");function z(a){return x(wt(a))}o(z,"integerPart");function R(a,u){let T=Number.MAX_SAFE_INTEGER,A=Number(a);if(A=x(A),!et(A))throw new TypeError(`${u} is not a finite number`);if(A=z(A),A<0||A>T)throw new TypeError(`${u} is outside the accepted range of 0 to ${T}, inclusive`);return!et(A)||A===0?0:A}o(R,"convertUnsignedLongLongWithEnforceRange");function $(a,u){if(!On(a))throw new TypeError(`${u} is not a ReadableStream.`)}o($,"assertReadableStream");function j(a){return new G(a)}o(j,"AcquireReadableStreamDefaultReader");function I(a,u){a._reader._readRequests.push(u)}o(I,"ReadableStreamAddReadRequest");function O(a,u,_){let A=a._reader._readRequests.shift();_?A._closeSteps():A._chunkSteps(u)}o(O,"ReadableStreamFulfillReadRequest");function M(a){return a._reader._readRequests.length}o(M,"ReadableStreamGetNumReadRequests");function N(a){let u=a._reader;return!(u===void 0||!ce(u))}o(N,"ReadableStreamHasDefaultReader");class G{static{o(this,"ReadableStreamDefaultReader")}constructor(u){if(Ye(u,1,"ReadableStreamDefaultReader"),$(u,"First parameter"),kn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");re(this,u),this._readRequests=new Z}get closed(){return ce(this)?this._closedPromise:y(at("closed"))}cancel(u=void 0){return ce(this)?this._ownerReadableStream===void 0?y(X("cancel")):V(this,u):y(at("cancel"))}read(){if(!ce(this))return y(at("read"));if(this._ownerReadableStream===void 0)return y(X("read from"));let u,_,T=p((L,q)=>{u=L,_=q});return pe(this,{_chunkSteps:o(L=>u({value:L,done:!1}),"_chunkSteps"),_closeSteps:o(()=>u({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(L=>_(L),"_errorSteps")}),T}releaseLock(){if(!ce(this))throw at("releaseLock");this._ownerReadableStream!==void 0&&Fe(this)}}Object.defineProperties(G.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(G.prototype.cancel,"cancel"),i(G.prototype.read,"read"),i(G.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(G.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ce(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof G}o(ce,"IsReadableStreamDefaultReader");function pe(a,u){let _=a._ownerReadableStream;_._disturbed=!0,_._state==="closed"?u._closeSteps():_._state==="errored"?u._errorSteps(_._storedError):_._readableStreamController[Q](u)}o(pe,"ReadableStreamDefaultReaderRead");function Fe(a){B(a);let u=new TypeError("Reader was released");it(a,u)}o(Fe,"ReadableStreamDefaultReaderRelease");function it(a,u){let _=a._readRequests;a._readRequests=new Z,_.forEach(T=>{T._errorSteps(u)})}o(it,"ReadableStreamDefaultReaderErrorReadRequests");function at(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(at,"defaultReaderBrandCheckException");let je=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class He{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(u,_){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=_}next(){let u=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?v(this._ongoingPromise,u,u):u(),this._ongoingPromise}return(u){let _=o(()=>this._returnSteps(u),"returnSteps");return this._ongoingPromise?v(this._ongoingPromise,_,_):_()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let u=this._reader,_,T,A=p((q,se)=>{_=q,T=se});return pe(u,{_chunkSteps:o(q=>{this._ongoingPromise=void 0,b(()=>_({value:q,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),_({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(q=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),T(q)},"_errorSteps")}),A}_returnSteps(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;let _=this._reader;if(!this._preventCancel){let T=V(_,u);return B(_),v(T,()=>({value:u,done:!0}))}return B(_),m({value:u,done:!0})}}let bt={next(){return Ro(this)?this._asyncIteratorImpl.next():y(Co("next"))},return(a){return Ro(this)?this._asyncIteratorImpl.return(a):y(Co("return"))}};Object.setPrototypeOf(bt,je);function Io(a,u){let _=j(a),T=new He(_,u),A=Object.create(bt);return A._asyncIteratorImpl=T,A}o(Io,"AcquireReadableStreamAsyncIterator");function Ro(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof He}catch{return!1}}o(Ro,"IsReadableStreamAsyncIterator");function Co(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(Co,"streamAsyncIteratorBrandCheckException");let Wt=Number.isNaN||function(a){return a!==a};var rn,Rt,Et;function Xe(a){return a.slice()}o(Xe,"CreateArrayFromList");function ch(a,u,_,T,A){new Uint8Array(a).set(new Uint8Array(_,T,A),u)}o(ch,"CopyDataBlockBytes");let nn=o(a=>(typeof a.transfer=="function"?nn=o(u=>u.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?nn=o(u=>structuredClone(u,{transfer:[u]}),"TransferArrayBuffer"):nn=o(u=>u,"TransferArrayBuffer"),nn(a)),"TransferArrayBuffer"),An=o(a=>(typeof a.detached=="boolean"?An=o(u=>u.detached,"IsDetachedBuffer"):An=o(u=>u.byteLength===0,"IsDetachedBuffer"),An(a)),"IsDetachedBuffer");function lh(a,u,_){if(a.slice)return a.slice(u,_);let T=_-u,A=new ArrayBuffer(T);return ch(A,0,a,u,T),A}o(lh,"ArrayBufferSlice");function ts(a,u){let _=a[u];if(_!=null){if(typeof _!="function")throw new TypeError(`${String(u)} is not a function`);return _}}o(ts,"GetMethod");function uA(a){let u={[Symbol.iterator]:()=>a.iterator},_=(async function*(){return yield*u})(),T=_.next;return{iterator:_,nextMethod:T,done:!1}}o(uA,"CreateAsyncFromSyncIterator");let rl=(Et=(rn=Symbol.asyncIterator)!==null&&rn!==void 0?rn:(Rt=Symbol.for)===null||Rt===void 0?void 0:Rt.call(Symbol,"Symbol.asyncIterator"))!==null&&Et!==void 0?Et:"@@asyncIterator";function dh(a,u="sync",_){if(_===void 0)if(u==="async"){if(_=ts(a,rl),_===void 0){let L=ts(a,Symbol.iterator),q=dh(a,"sync",L);return uA(q)}}else _=ts(a,Symbol.iterator);if(_===void 0)throw new TypeError("The object is not iterable");let T=C(_,a,[]);if(!r(T))throw new TypeError("The iterator method must return an object");let A=T.next;return{iterator:T,nextMethod:A,done:!1}}o(dh,"GetIterator");function cA(a){let u=C(a.nextMethod,a.iterator,[]);if(!r(u))throw new TypeError("The iterator.next() method must return an object");return u}o(cA,"IteratorNext");function lA(a){return!!a.done}o(lA,"IteratorComplete");function dA(a){return a.value}o(dA,"IteratorValue");function pA(a){return!(typeof a!="number"||Wt(a)||a<0)}o(pA,"IsNonNegativeNumber");function ph(a){let u=lh(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(u)}o(ph,"CloneAsUint8Array");function nl(a){let u=a._queue.shift();return a._queueTotalSize-=u.size,a._queueTotalSize<0&&(a._queueTotalSize=0),u.value}o(nl,"DequeueValue");function ol(a,u,_){if(!pA(_)||_===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:u,size:_}),a._queueTotalSize+=_}o(ol,"EnqueueValueWithSize");function fA(a){return a._queue.peek().value}o(fA,"PeekQueueValue");function In(a){a._queue=new Z,a._queueTotalSize=0}o(In,"ResetQueue");function fh(a){return a===DataView}o(fh,"isDataViewConstructor");function mA(a){return fh(a.constructor)}o(mA,"isDataView");function hA(a){return fh(a)?1:a.BYTES_PER_ELEMENT}o(hA,"arrayBufferViewElementSize");class to{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!il(this))throw ll("view");return this._view}respond(u){if(!il(this))throw ll("respond");if(Ye(u,1,"respond"),u=R(u,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(An(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");is(this._associatedReadableByteStreamController,u)}respondWithNewView(u){if(!il(this))throw ll("respondWithNewView");if(Ye(u,1,"respondWithNewView"),!ArrayBuffer.isView(u))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(An(u.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");as(this._associatedReadableByteStreamController,u)}}Object.defineProperties(to.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(to.prototype.respond,"respond"),i(to.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(to.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class on{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!ro(this))throw ki("byobRequest");return cl(this)}get desiredSize(){if(!ro(this))throw ki("desiredSize");return wh(this)}close(){if(!ro(this))throw ki("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let u=this._controlledReadableByteStream._state;if(u!=="readable")throw new TypeError(`The stream (in ${u} state) is not in the readable state and cannot be closed`);Oi(this)}enqueue(u){if(!ro(this))throw ki("enqueue");if(Ye(u,1,"enqueue"),!ArrayBuffer.isView(u))throw new TypeError("chunk must be an array buffer view");if(u.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(u.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let _=this._controlledReadableByteStream._state;if(_!=="readable")throw new TypeError(`The stream (in ${_} state) is not in the readable state and cannot be enqueued to`);os(this,u)}error(u=void 0){if(!ro(this))throw ki("error");cr(this,u)}[te](u){mh(this),In(this);let _=this._cancelAlgorithm(u);return ns(this),_}[Q](u){let _=this._controlledReadableByteStream;if(this._queueTotalSize>0){Sh(this,u);return}let T=this._autoAllocateChunkSize;if(T!==void 0){let A;try{A=new ArrayBuffer(T)}catch(q){u._errorSteps(q);return}let L={buffer:A,bufferByteLength:T,byteOffset:0,byteLength:T,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(L)}I(_,u),no(this)}[xe](){if(this._pendingPullIntos.length>0){let u=this._pendingPullIntos.peek();u.readerType="none",this._pendingPullIntos=new Z,this._pendingPullIntos.push(u)}}}Object.defineProperties(on.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(on.prototype.close,"close"),i(on.prototype.enqueue,"enqueue"),i(on.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(on.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function ro(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof on}o(ro,"IsReadableByteStreamController");function il(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof to}o(il,"IsReadableStreamBYOBRequest");function no(a){if(!bA(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let _=a._pullAlgorithm();f(_,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,no(a)),null),T=>(cr(a,T),null))}o(no,"ReadableByteStreamControllerCallPullIfNeeded");function mh(a){sl(a),a._pendingPullIntos=new Z}o(mh,"ReadableByteStreamControllerClearPendingPullIntos");function al(a,u){let _=!1;a._state==="closed"&&(_=!0);let T=hh(u);u.readerType==="default"?O(a,T,_):xA(a,T,_)}o(al,"ReadableByteStreamControllerCommitPullIntoDescriptor");function hh(a){let u=a.bytesFilled,_=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,u/_)}o(hh,"ReadableByteStreamControllerConvertPullIntoDescriptor");function rs(a,u,_,T){a._queue.push({buffer:u,byteOffset:_,byteLength:T}),a._queueTotalSize+=T}o(rs,"ReadableByteStreamControllerEnqueueChunkToQueue");function gh(a,u,_,T){let A;try{A=lh(u,_,_+T)}catch(L){throw cr(a,L),L}rs(a,A,0,T)}o(gh,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function yh(a,u){u.bytesFilled>0&&gh(a,u.buffer,u.byteOffset,u.bytesFilled),Oo(a)}o(yh,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function vh(a,u){let _=Math.min(a._queueTotalSize,u.byteLength-u.bytesFilled),T=u.bytesFilled+_,A=_,L=!1,q=T%u.elementSize,se=T-q;se>=u.minimumFill&&(A=se-u.bytesFilled,L=!0);let _e=a._queue;for(;A>0;){let me=_e.peek(),Ae=Math.min(A,me.byteLength),Ne=u.byteOffset+u.bytesFilled;ch(u.buffer,Ne,me.buffer,me.byteOffset,Ae),me.byteLength===Ae?_e.shift():(me.byteOffset+=Ae,me.byteLength-=Ae),a._queueTotalSize-=Ae,_h(a,Ae,u),A-=Ae}return L}o(vh,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function _h(a,u,_){_.bytesFilled+=u}o(_h,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function bh(a){a._queueTotalSize===0&&a._closeRequested?(ns(a),Mi(a._controlledReadableByteStream)):no(a)}o(bh,"ReadableByteStreamControllerHandleQueueDrain");function sl(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(sl,"ReadableByteStreamControllerInvalidateBYOBRequest");function ul(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let u=a._pendingPullIntos.peek();vh(a,u)&&(Oo(a),al(a._controlledReadableByteStream,u))}}o(ul,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function gA(a){let u=a._controlledReadableByteStream._reader;for(;u._readRequests.length>0;){if(a._queueTotalSize===0)return;let _=u._readRequests.shift();Sh(a,_)}}o(gA,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function yA(a,u,_,T){let A=a._controlledReadableByteStream,L=u.constructor,q=hA(L),{byteOffset:se,byteLength:_e}=u,me=_*q,Ae;try{Ae=nn(u.buffer)}catch(tt){T._errorSteps(tt);return}let Ne={buffer:Ae,bufferByteLength:Ae.byteLength,byteOffset:se,byteLength:_e,bytesFilled:0,minimumFill:me,elementSize:q,viewConstructor:L,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Ne),xh(A,T);return}if(A._state==="closed"){let tt=new L(Ne.buffer,Ne.byteOffset,0);T._closeSteps(tt);return}if(a._queueTotalSize>0){if(vh(a,Ne)){let tt=hh(Ne);bh(a),T._chunkSteps(tt);return}if(a._closeRequested){let tt=new TypeError("Insufficient bytes to fill elements in the given buffer");cr(a,tt),T._errorSteps(tt);return}}a._pendingPullIntos.push(Ne),xh(A,T),no(a)}o(yA,"ReadableByteStreamControllerPullInto");function vA(a,u){u.readerType==="none"&&Oo(a);let _=a._controlledReadableByteStream;if(dl(_))for(;Ah(_)>0;){let T=Oo(a);al(_,T)}}o(vA,"ReadableByteStreamControllerRespondInClosedState");function _A(a,u,_){if(_h(a,u,_),_.readerType==="none"){yh(a,_),ul(a);return}if(_.bytesFilled<_.minimumFill)return;Oo(a);let T=_.bytesFilled%_.elementSize;if(T>0){let A=_.byteOffset+_.bytesFilled;gh(a,_.buffer,A-T,T)}_.bytesFilled-=T,al(a._controlledReadableByteStream,_),ul(a)}o(_A,"ReadableByteStreamControllerRespondInReadableState");function Eh(a,u){let _=a._pendingPullIntos.peek();sl(a),a._controlledReadableByteStream._state==="closed"?vA(a,_):_A(a,u,_),no(a)}o(Eh,"ReadableByteStreamControllerRespondInternal");function Oo(a){return a._pendingPullIntos.shift()}o(Oo,"ReadableByteStreamControllerShiftPendingPullInto");function bA(a){let u=a._controlledReadableByteStream;return u._state!=="readable"||a._closeRequested||!a._started?!1:!!(N(u)&&M(u)>0||dl(u)&&Ah(u)>0||wh(a)>0)}o(bA,"ReadableByteStreamControllerShouldCallPull");function ns(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(ns,"ReadableByteStreamControllerClearAlgorithms");function Oi(a){let u=a._controlledReadableByteStream;if(!(a._closeRequested||u._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let _=a._pendingPullIntos.peek();if(_.bytesFilled%_.elementSize!==0){let T=new TypeError("Insufficient bytes to fill elements in the given buffer");throw cr(a,T),T}}ns(a),Mi(u)}}o(Oi,"ReadableByteStreamControllerClose");function os(a,u){let _=a._controlledReadableByteStream;if(a._closeRequested||_._state!=="readable")return;let{buffer:T,byteOffset:A,byteLength:L}=u;if(An(T))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let q=nn(T);if(a._pendingPullIntos.length>0){let se=a._pendingPullIntos.peek();if(An(se.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");sl(a),se.buffer=nn(se.buffer),se.readerType==="none"&&yh(a,se)}if(N(_))if(gA(a),M(_)===0)rs(a,q,A,L);else{a._pendingPullIntos.length>0&&Oo(a);let se=new Uint8Array(q,A,L);O(_,se,!1)}else dl(_)?(rs(a,q,A,L),ul(a)):rs(a,q,A,L);no(a)}o(os,"ReadableByteStreamControllerEnqueue");function cr(a,u){let _=a._controlledReadableByteStream;_._state==="readable"&&(mh(a),In(a),ns(a),Yh(_,u))}o(cr,"ReadableByteStreamControllerError");function Sh(a,u){let _=a._queue.shift();a._queueTotalSize-=_.byteLength,bh(a);let T=new Uint8Array(_.buffer,_.byteOffset,_.byteLength);u._chunkSteps(T)}o(Sh,"ReadableByteStreamControllerFillReadRequestFromQueue");function cl(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let u=a._pendingPullIntos.peek(),_=new Uint8Array(u.buffer,u.byteOffset+u.bytesFilled,u.byteLength-u.bytesFilled),T=Object.create(to.prototype);SA(T,a,_),a._byobRequest=T}return a._byobRequest}o(cl,"ReadableByteStreamControllerGetBYOBRequest");function wh(a){let u=a._controlledReadableByteStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(wh,"ReadableByteStreamControllerGetDesiredSize");function is(a,u){let _=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(u===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(_.bytesFilled+u>_.byteLength)throw new RangeError("bytesWritten out of range")}_.buffer=nn(_.buffer),Eh(a,u)}o(is,"ReadableByteStreamControllerRespond");function as(a,u){let _=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(u.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(_.byteOffset+_.bytesFilled!==u.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(_.bufferByteLength!==u.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(_.bytesFilled+u.byteLength>_.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let A=u.byteLength;_.buffer=nn(u.buffer),Eh(a,A)}o(as,"ReadableByteStreamControllerRespondWithNewView");function Th(a,u,_,T,A,L,q){u._controlledReadableByteStream=a,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,In(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=L,u._pullAlgorithm=T,u._cancelAlgorithm=A,u._autoAllocateChunkSize=q,u._pendingPullIntos=new Z,a._readableStreamController=u;let se=_();f(m(se),()=>(u._started=!0,no(u),null),_e=>(cr(u,_e),null))}o(Th,"SetUpReadableByteStreamController");function EA(a,u,_){let T=Object.create(on.prototype),A,L,q;u.start!==void 0?A=o(()=>u.start(T),"startAlgorithm"):A=o(()=>{},"startAlgorithm"),u.pull!==void 0?L=o(()=>u.pull(T),"pullAlgorithm"):L=o(()=>m(void 0),"pullAlgorithm"),u.cancel!==void 0?q=o(_e=>u.cancel(_e),"cancelAlgorithm"):q=o(()=>m(void 0),"cancelAlgorithm");let se=u.autoAllocateChunkSize;if(se===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Th(a,T,A,L,q,_,se)}o(EA,"SetUpReadableByteStreamControllerFromUnderlyingSource");function SA(a,u,_){a._associatedReadableByteStreamController=u,a._view=_}o(SA,"SetUpReadableStreamBYOBRequest");function ll(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(ll,"byobRequestBrandCheckException");function ki(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(ki,"byteStreamControllerBrandCheckException");function wA(a,u){lt(a,u);let _=a?.mode;return{mode:_===void 0?void 0:TA(_,`${u} has member 'mode' that`)}}o(wA,"convertReaderOptions");function TA(a,u){if(a=`${a}`,a!=="byob")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(TA,"convertReadableStreamReaderMode");function PA(a,u){var _;lt(a,u);let T=(_=a?.min)!==null&&_!==void 0?_:1;return{min:R(T,`${u} has member 'min' that`)}}o(PA,"convertByobReadOptions");function Ph(a){return new Rn(a)}o(Ph,"AcquireReadableStreamBYOBReader");function xh(a,u){a._reader._readIntoRequests.push(u)}o(xh,"ReadableStreamAddReadIntoRequest");function xA(a,u,_){let A=a._reader._readIntoRequests.shift();_?A._closeSteps(u):A._chunkSteps(u)}o(xA,"ReadableStreamFulfillReadIntoRequest");function Ah(a){return a._reader._readIntoRequests.length}o(Ah,"ReadableStreamGetNumReadIntoRequests");function dl(a){let u=a._reader;return!(u===void 0||!oo(u))}o(dl,"ReadableStreamHasBYOBReader");class Rn{static{o(this,"ReadableStreamBYOBReader")}constructor(u){if(Ye(u,1,"ReadableStreamBYOBReader"),$(u,"First parameter"),kn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!ro(u._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");re(this,u),this._readIntoRequests=new Z}get closed(){return oo(this)?this._closedPromise:y(ss("closed"))}cancel(u=void 0){return oo(this)?this._ownerReadableStream===void 0?y(X("cancel")):V(this,u):y(ss("cancel"))}read(u,_={}){if(!oo(this))return y(ss("read"));if(!ArrayBuffer.isView(u))return y(new TypeError("view must be an array buffer view"));if(u.byteLength===0)return y(new TypeError("view must have non-zero byteLength"));if(u.buffer.byteLength===0)return y(new TypeError("view's buffer must have non-zero byteLength"));if(An(u.buffer))return y(new TypeError("view's buffer has been detached"));let T;try{T=PA(_,"options")}catch(me){return y(me)}let A=T.min;if(A===0)return y(new TypeError("options.min must be greater than 0"));if(mA(u)){if(A>u.byteLength)return y(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(A>u.length)return y(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return y(X("read from"));let L,q,se=p((me,Ae)=>{L=me,q=Ae});return Ih(this,u,A,{_chunkSteps:o(me=>L({value:me,done:!1}),"_chunkSteps"),_closeSteps:o(me=>L({value:me,done:!0}),"_closeSteps"),_errorSteps:o(me=>q(me),"_errorSteps")}),se}releaseLock(){if(!oo(this))throw ss("releaseLock");this._ownerReadableStream!==void 0&&AA(this)}}Object.defineProperties(Rn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(Rn.prototype.cancel,"cancel"),i(Rn.prototype.read,"read"),i(Rn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Rn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function oo(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof Rn}o(oo,"IsReadableStreamBYOBReader");function Ih(a,u,_,T){let A=a._ownerReadableStream;A._disturbed=!0,A._state==="errored"?T._errorSteps(A._storedError):yA(A._readableStreamController,u,_,T)}o(Ih,"ReadableStreamBYOBReaderRead");function AA(a){B(a);let u=new TypeError("Reader was released");Rh(a,u)}o(AA,"ReadableStreamBYOBReaderRelease");function Rh(a,u){let _=a._readIntoRequests;a._readIntoRequests=new Z,_.forEach(T=>{T._errorSteps(u)})}o(Rh,"ReadableStreamBYOBReaderErrorReadIntoRequests");function ss(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(ss,"byobReaderBrandCheckException");function $i(a,u){let{highWaterMark:_}=a;if(_===void 0)return u;if(Wt(_)||_<0)throw new RangeError("Invalid highWaterMark");return _}o($i,"ExtractHighWaterMark");function us(a){let{size:u}=a;return u||(()=>1)}o(us,"ExtractSizeAlgorithm");function cs(a,u){lt(a,u);let _=a?.highWaterMark,T=a?.size;return{highWaterMark:_===void 0?void 0:P(_),size:T===void 0?void 0:IA(T,`${u} has member 'size' that`)}}o(cs,"convertQueuingStrategy");function IA(a,u){return mt(a,u),_=>P(a(_))}o(IA,"convertQueuingStrategySize");function RA(a,u){lt(a,u);let _=a?.abort,T=a?.close,A=a?.start,L=a?.type,q=a?.write;return{abort:_===void 0?void 0:CA(_,a,`${u} has member 'abort' that`),close:T===void 0?void 0:OA(T,a,`${u} has member 'close' that`),start:A===void 0?void 0:kA(A,a,`${u} has member 'start' that`),write:q===void 0?void 0:$A(q,a,`${u} has member 'write' that`),type:L}}o(RA,"convertUnderlyingSink");function CA(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(CA,"convertUnderlyingSinkAbortCallback");function OA(a,u,_){return mt(a,_),()=>U(a,u,[])}o(OA,"convertUnderlyingSinkCloseCallback");function kA(a,u,_){return mt(a,_),T=>C(a,u,[T])}o(kA,"convertUnderlyingSinkStartCallback");function $A(a,u,_){return mt(a,_),(T,A)=>U(a,u,[T,A])}o($A,"convertUnderlyingSinkWriteCallback");function Ch(a,u){if(!ko(a))throw new TypeError(`${u} is not a WritableStream.`)}o(Ch,"assertWritableStream");function DA(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o(DA,"isAbortSignal");let NA=typeof AbortController=="function";function zA(){if(NA)return new AbortController}o(zA,"createAbortController");class Cn{static{o(this,"WritableStream")}constructor(u={},_={}){u===void 0?u=null:We(u,"First parameter");let T=cs(_,"Second parameter"),A=RA(u,"First parameter");if(kh(this),A.type!==void 0)throw new RangeError("Invalid type is specified");let q=us(T),se=$i(T,1);JA(this,A,se,q)}get locked(){if(!ko(this))throw ms("locked");return $o(this)}abort(u=void 0){return ko(this)?$o(this)?y(new TypeError("Cannot abort a stream that already has a writer")):ls(this,u):y(ms("abort"))}close(){return ko(this)?$o(this)?y(new TypeError("Cannot close a stream that already has a writer")):Ur(this)?y(new TypeError("Cannot close an already-closing stream")):$h(this):y(ms("close"))}getWriter(){if(!ko(this))throw ms("getWriter");return Oh(this)}}Object.defineProperties(Cn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(Cn.prototype.abort,"abort"),i(Cn.prototype.close,"close"),i(Cn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Cn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function Oh(a){return new an(a)}o(Oh,"AcquireWritableStreamDefaultWriter");function UA(a,u,_,T,A=1,L=()=>1){let q=Object.create(Cn.prototype);kh(q);let se=Object.create(Do.prototype);return Lh(q,se,a,u,_,T,A,L),q}o(UA,"CreateWritableStream");function kh(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new Z,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}o(kh,"InitializeWritableStream");function ko(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof Cn}o(ko,"IsWritableStream");function $o(a){return a._writer!==void 0}o($o,"IsWritableStreamLocked");function ls(a,u){var _;if(a._state==="closed"||a._state==="errored")return m(void 0);a._writableStreamController._abortReason=u,(_=a._writableStreamController._abortController)===null||_===void 0||_.abort(u);let T=a._state;if(T==="closed"||T==="errored")return m(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let A=!1;T==="erroring"&&(A=!0,u=void 0);let L=p((q,se)=>{a._pendingAbortRequest={_promise:void 0,_resolve:q,_reject:se,_reason:u,_wasAlreadyErroring:A}});return a._pendingAbortRequest._promise=L,A||fl(a,u),L}o(ls,"WritableStreamAbort");function $h(a){let u=a._state;if(u==="closed"||u==="errored")return y(new TypeError(`The stream (in ${u} state) is not in the writable state and cannot be closed`));let _=p((A,L)=>{let q={_resolve:A,_reject:L};a._closeRequest=q}),T=a._writer;return T!==void 0&&a._backpressure&&u==="writable"&&El(T),YA(a._writableStreamController),_}o($h,"WritableStreamClose");function MA(a){return p((_,T)=>{let A={_resolve:_,_reject:T};a._writeRequests.push(A)})}o(MA,"WritableStreamAddWriteRequest");function pl(a,u){if(a._state==="writable"){fl(a,u);return}ml(a)}o(pl,"WritableStreamDealWithRejection");function fl(a,u){let _=a._writableStreamController;a._state="erroring",a._storedError=u;let T=a._writer;T!==void 0&&Nh(T,u),!BA(a)&&_._started&&ml(a)}o(fl,"WritableStreamStartErroring");function ml(a){a._state="errored",a._writableStreamController[K]();let u=a._storedError;if(a._writeRequests.forEach(A=>{A._reject(u)}),a._writeRequests=new Z,a._pendingAbortRequest===void 0){ds(a);return}let _=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,_._wasAlreadyErroring){_._reject(u),ds(a);return}let T=a._writableStreamController[H](_._reason);f(T,()=>(_._resolve(),ds(a),null),A=>(_._reject(A),ds(a),null))}o(ml,"WritableStreamFinishErroring");function LA(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(LA,"WritableStreamFinishInFlightWrite");function jA(a,u){a._inFlightWriteRequest._reject(u),a._inFlightWriteRequest=void 0,pl(a,u)}o(jA,"WritableStreamFinishInFlightWriteWithError");function FA(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&&Bh(_)}o(FA,"WritableStreamFinishInFlightClose");function qA(a,u){a._inFlightCloseRequest._reject(u),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(u),a._pendingAbortRequest=void 0),pl(a,u)}o(qA,"WritableStreamFinishInFlightCloseWithError");function Ur(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Ur,"WritableStreamCloseQueuedOrInFlight");function BA(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o(BA,"WritableStreamHasOperationMarkedInFlight");function VA(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(VA,"WritableStreamMarkCloseRequestInFlight");function GA(a){a._inFlightWriteRequest=a._writeRequests.shift()}o(GA,"WritableStreamMarkFirstWriteRequestInFlight");function ds(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let u=a._writer;u!==void 0&&_l(u,a._storedError)}o(ds,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function hl(a,u){let _=a._writer;_!==void 0&&u!==a._backpressure&&(u?oI(_):El(_)),a._backpressure=u}o(hl,"WritableStreamUpdateBackpressure");class an{static{o(this,"WritableStreamDefaultWriter")}constructor(u){if(Ye(u,1,"WritableStreamDefaultWriter"),Ch(u,"First parameter"),$o(u))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;let _=u._state;if(_==="writable")!Ur(u)&&u._backpressure?gs(this):Vh(this),hs(this);else if(_==="erroring")bl(this,u._storedError),hs(this);else if(_==="closed")Vh(this),rI(this);else{let T=u._storedError;bl(this,T),qh(this,T)}}get closed(){return io(this)?this._closedPromise:y(ao("closed"))}get desiredSize(){if(!io(this))throw ao("desiredSize");if(this._ownerWritableStream===void 0)throw Ni("desiredSize");return KA(this)}get ready(){return io(this)?this._readyPromise:y(ao("ready"))}abort(u=void 0){return io(this)?this._ownerWritableStream===void 0?y(Ni("abort")):HA(this,u):y(ao("abort"))}close(){if(!io(this))return y(ao("close"));let u=this._ownerWritableStream;return u===void 0?y(Ni("close")):Ur(u)?y(new TypeError("Cannot close an already-closing stream")):Dh(this)}releaseLock(){if(!io(this))throw ao("releaseLock");this._ownerWritableStream!==void 0&&zh(this)}write(u=void 0){return io(this)?this._ownerWritableStream===void 0?y(Ni("write to")):Uh(this,u):y(ao("write"))}}Object.defineProperties(an.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(an.prototype.abort,"abort"),i(an.prototype.close,"close"),i(an.prototype.releaseLock,"releaseLock"),i(an.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(an.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function io(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof an}o(io,"IsWritableStreamDefaultWriter");function HA(a,u){let _=a._ownerWritableStream;return ls(_,u)}o(HA,"WritableStreamDefaultWriterAbort");function Dh(a){let u=a._ownerWritableStream;return $h(u)}o(Dh,"WritableStreamDefaultWriterClose");function WA(a){let u=a._ownerWritableStream,_=u._state;return Ur(u)||_==="closed"?m(void 0):_==="errored"?y(u._storedError):Dh(a)}o(WA,"WritableStreamDefaultWriterCloseWithErrorPropagation");function ZA(a,u){a._closedPromiseState==="pending"?_l(a,u):nI(a,u)}o(ZA,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function Nh(a,u){a._readyPromiseState==="pending"?Gh(a,u):iI(a,u)}o(Nh,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function KA(a){let u=a._ownerWritableStream,_=u._state;return _==="errored"||_==="erroring"?null:_==="closed"?0:jh(u._writableStreamController)}o(KA,"WritableStreamDefaultWriterGetDesiredSize");function zh(a){let u=a._ownerWritableStream,_=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Nh(a,_),ZA(a,_),u._writer=void 0,a._ownerWritableStream=void 0}o(zh,"WritableStreamDefaultWriterRelease");function Uh(a,u){let _=a._ownerWritableStream,T=_._writableStreamController,A=XA(T,u);if(_!==a._ownerWritableStream)return y(Ni("write to"));let L=_._state;if(L==="errored")return y(_._storedError);if(Ur(_)||L==="closed")return y(new TypeError("The stream is closing or closed and cannot be written to"));if(L==="erroring")return y(_._storedError);let q=MA(_);return QA(T,u,A),q}o(Uh,"WritableStreamDefaultWriterWrite");let Mh={};class Do{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!gl(this))throw vl("abortReason");return this._abortReason}get signal(){if(!gl(this))throw vl("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(u=void 0){if(!gl(this))throw vl("error");this._controlledWritableStream._state==="writable"&&Fh(this,u)}[H](u){let _=this._abortAlgorithm(u);return ps(this),_}[K](){In(this)}}Object.defineProperties(Do.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Do.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function gl(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof Do}o(gl,"IsWritableStreamDefaultController");function Lh(a,u,_,T,A,L,q,se){u._controlledWritableStream=a,a._writableStreamController=u,u._queue=void 0,u._queueTotalSize=void 0,In(u),u._abortReason=void 0,u._abortController=zA(),u._started=!1,u._strategySizeAlgorithm=se,u._strategyHWM=q,u._writeAlgorithm=T,u._closeAlgorithm=A,u._abortAlgorithm=L;let _e=yl(u);hl(a,_e);let me=_(),Ae=m(me);f(Ae,()=>(u._started=!0,fs(u),null),Ne=>(u._started=!0,pl(a,Ne),null))}o(Lh,"SetUpWritableStreamDefaultController");function JA(a,u,_,T){let A=Object.create(Do.prototype),L,q,se,_e;u.start!==void 0?L=o(()=>u.start(A),"startAlgorithm"):L=o(()=>{},"startAlgorithm"),u.write!==void 0?q=o(me=>u.write(me,A),"writeAlgorithm"):q=o(()=>m(void 0),"writeAlgorithm"),u.close!==void 0?se=o(()=>u.close(),"closeAlgorithm"):se=o(()=>m(void 0),"closeAlgorithm"),u.abort!==void 0?_e=o(me=>u.abort(me),"abortAlgorithm"):_e=o(()=>m(void 0),"abortAlgorithm"),Lh(a,A,L,q,se,_e,_,T)}o(JA,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function ps(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(ps,"WritableStreamDefaultControllerClearAlgorithms");function YA(a){ol(a,Mh,0),fs(a)}o(YA,"WritableStreamDefaultControllerClose");function XA(a,u){try{return a._strategySizeAlgorithm(u)}catch(_){return Di(a,_),1}}o(XA,"WritableStreamDefaultControllerGetChunkSize");function jh(a){return a._strategyHWM-a._queueTotalSize}o(jh,"WritableStreamDefaultControllerGetDesiredSize");function QA(a,u,_){try{ol(a,u,_)}catch(A){Di(a,A);return}let T=a._controlledWritableStream;if(!Ur(T)&&T._state==="writable"){let A=yl(a);hl(T,A)}fs(a)}o(QA,"WritableStreamDefaultControllerWrite");function fs(a){let u=a._controlledWritableStream;if(!a._started||u._inFlightWriteRequest!==void 0)return;if(u._state==="erroring"){ml(u);return}if(a._queue.length===0)return;let T=fA(a);T===Mh?eI(a):tI(a,T)}o(fs,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Di(a,u){a._controlledWritableStream._state==="writable"&&Fh(a,u)}o(Di,"WritableStreamDefaultControllerErrorIfNeeded");function eI(a){let u=a._controlledWritableStream;VA(u),nl(a);let _=a._closeAlgorithm();ps(a),f(_,()=>(FA(u),null),T=>(qA(u,T),null))}o(eI,"WritableStreamDefaultControllerProcessClose");function tI(a,u){let _=a._controlledWritableStream;GA(_);let T=a._writeAlgorithm(u);f(T,()=>{LA(_);let A=_._state;if(nl(a),!Ur(_)&&A==="writable"){let L=yl(a);hl(_,L)}return fs(a),null},A=>(_._state==="writable"&&ps(a),jA(_,A),null))}o(tI,"WritableStreamDefaultControllerProcessWrite");function yl(a){return jh(a)<=0}o(yl,"WritableStreamDefaultControllerGetBackpressure");function Fh(a,u){let _=a._controlledWritableStream;ps(a),fl(_,u)}o(Fh,"WritableStreamDefaultControllerError");function ms(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(ms,"streamBrandCheckException$2");function vl(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(vl,"defaultControllerBrandCheckException$2");function ao(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(ao,"defaultWriterBrandCheckException");function Ni(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(Ni,"defaultWriterLockException");function hs(a){a._closedPromise=p((u,_)=>{a._closedPromise_resolve=u,a._closedPromise_reject=_,a._closedPromiseState="pending"})}o(hs,"defaultWriterClosedPromiseInitialize");function qh(a,u){hs(a),_l(a,u)}o(qh,"defaultWriterClosedPromiseInitializeAsRejected");function rI(a){hs(a),Bh(a)}o(rI,"defaultWriterClosedPromiseInitializeAsResolved");function _l(a,u){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}o(_l,"defaultWriterClosedPromiseReject");function nI(a,u){qh(a,u)}o(nI,"defaultWriterClosedPromiseResetToRejected");function Bh(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(Bh,"defaultWriterClosedPromiseResolve");function gs(a){a._readyPromise=p((u,_)=>{a._readyPromise_resolve=u,a._readyPromise_reject=_}),a._readyPromiseState="pending"}o(gs,"defaultWriterReadyPromiseInitialize");function bl(a,u){gs(a),Gh(a,u)}o(bl,"defaultWriterReadyPromiseInitializeAsRejected");function Vh(a){gs(a),El(a)}o(Vh,"defaultWriterReadyPromiseInitializeAsResolved");function Gh(a,u){a._readyPromise_reject!==void 0&&(E(a._readyPromise),a._readyPromise_reject(u),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}o(Gh,"defaultWriterReadyPromiseReject");function oI(a){gs(a)}o(oI,"defaultWriterReadyPromiseReset");function iI(a,u){bl(a,u)}o(iI,"defaultWriterReadyPromiseResetToRejected");function El(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(El,"defaultWriterReadyPromiseResolve");function aI(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(aI,"getGlobals");let Sl=aI();function sI(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(sI,"isDOMExceptionConstructor");function uI(){let a=Sl?.DOMException;return sI(a)?a:void 0}o(uI,"getFromGlobal");function cI(){let a=o(function(_,T){this.message=_||"",this.name=T||"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(cI,"createPolyfill");let lI=uI()||cI();function Hh(a,u,_,T,A,L){let q=j(a),se=Oh(u);a._disturbed=!0;let _e=!1,me=m(void 0);return p((Ae,Ne)=>{let tt;if(L!==void 0){if(tt=o(()=>{let he=L.reason!==void 0?L.reason:new lI("Aborted","AbortError"),Le=[];T||Le.push(()=>u._state==="writable"?ls(u,he):m(void 0)),A||Le.push(()=>a._state==="readable"?Tr(a,he):m(void 0)),Mt(()=>Promise.all(Le.map(nt=>nt())),!0,he)},"abortAlgorithm"),L.aborted){tt();return}L.addEventListener("abort",tt)}function Pr(){return p((he,Le)=>{function nt(Zt){Zt?he():h(Mo(),nt,Le)}o(nt,"next"),nt(!1)})}o(Pr,"pipeLoop");function Mo(){return _e?m(!0):h(se._readyPromise,()=>p((he,Le)=>{pe(q,{_chunkSteps:o(nt=>{me=h(Uh(se,nt),void 0,e),he(!1)},"_chunkSteps"),_closeSteps:o(()=>he(!0),"_closeSteps"),_errorSteps:Le})}))}if(o(Mo,"pipeStep"),un(a,q._closedPromise,he=>(T?lr(!0,he):Mt(()=>ls(u,he),!0,he),null)),un(u,se._closedPromise,he=>(A?lr(!0,he):Mt(()=>Tr(a,he),!0,he),null)),Dt(a,q._closedPromise,()=>(_?lr():Mt(()=>WA(se)),null)),Ur(u)||u._state==="closed"){let he=new TypeError("the destination writable stream closed before all data could be piped to it");A?lr(!0,he):Mt(()=>Tr(a,he),!0,he)}E(Pr());function Dn(){let he=me;return h(me,()=>he!==me?Dn():void 0)}o(Dn,"waitForWritesToFinish");function un(he,Le,nt){he._state==="errored"?nt(he._storedError):g(Le,nt)}o(un,"isOrBecomesErrored");function Dt(he,Le,nt){he._state==="closed"?nt():l(Le,nt)}o(Dt,"isOrBecomesClosed");function Mt(he,Le,nt){if(_e)return;_e=!0,u._state==="writable"&&!Ur(u)?l(Dn(),Zt):Zt();function Zt(){return f(he(),()=>cn(Le,nt),Lo=>cn(!0,Lo)),null}o(Zt,"doTheRest")}o(Mt,"shutdownWithAction");function lr(he,Le){_e||(_e=!0,u._state==="writable"&&!Ur(u)?l(Dn(),()=>cn(he,Le)):cn(he,Le))}o(lr,"shutdown");function cn(he,Le){return zh(se),B(q),L!==void 0&&L.removeEventListener("abort",tt),he?Ne(Le):Ae(void 0),null}o(cn,"finalize")})}o(Hh,"ReadableStreamPipeTo");class sn{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ys(this))throw _s("desiredSize");return wl(this)}close(){if(!ys(this))throw _s("close");if(!zo(this))throw new TypeError("The stream is not in a state that permits close");so(this)}enqueue(u=void 0){if(!ys(this))throw _s("enqueue");if(!zo(this))throw new TypeError("The stream is not in a state that permits enqueue");return No(this,u)}error(u=void 0){if(!ys(this))throw _s("error");wr(this,u)}[te](u){In(this);let _=this._cancelAlgorithm(u);return vs(this),_}[Q](u){let _=this._controlledReadableStream;if(this._queue.length>0){let T=nl(this);this._closeRequested&&this._queue.length===0?(vs(this),Mi(_)):zi(this),u._chunkSteps(T)}else I(_,u),zi(this)}[xe](){}}Object.defineProperties(sn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(sn.prototype.close,"close"),i(sn.prototype.enqueue,"enqueue"),i(sn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(sn.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function ys(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof sn}o(ys,"IsReadableStreamDefaultController");function zi(a){if(!Wh(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let _=a._pullAlgorithm();f(_,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,zi(a)),null),T=>(wr(a,T),null))}o(zi,"ReadableStreamDefaultControllerCallPullIfNeeded");function Wh(a){let u=a._controlledReadableStream;return!zo(a)||!a._started?!1:!!(kn(u)&&M(u)>0||wl(a)>0)}o(Wh,"ReadableStreamDefaultControllerShouldCallPull");function vs(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(vs,"ReadableStreamDefaultControllerClearAlgorithms");function so(a){if(!zo(a))return;let u=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(vs(a),Mi(u))}o(so,"ReadableStreamDefaultControllerClose");function No(a,u){if(!zo(a))return;let _=a._controlledReadableStream;if(kn(_)&&M(_)>0)O(_,u,!1);else{let T;try{T=a._strategySizeAlgorithm(u)}catch(A){throw wr(a,A),A}try{ol(a,u,T)}catch(A){throw wr(a,A),A}}zi(a)}o(No,"ReadableStreamDefaultControllerEnqueue");function wr(a,u){let _=a._controlledReadableStream;_._state==="readable"&&(In(a),vs(a),Yh(_,u))}o(wr,"ReadableStreamDefaultControllerError");function wl(a){let u=a._controlledReadableStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(wl,"ReadableStreamDefaultControllerGetDesiredSize");function dI(a){return!Wh(a)}o(dI,"ReadableStreamDefaultControllerHasBackpressure");function zo(a){let u=a._controlledReadableStream._state;return!a._closeRequested&&u==="readable"}o(zo,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Zh(a,u,_,T,A,L,q){u._controlledReadableStream=a,u._queue=void 0,u._queueTotalSize=void 0,In(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=q,u._strategyHWM=L,u._pullAlgorithm=T,u._cancelAlgorithm=A,a._readableStreamController=u;let se=_();f(m(se),()=>(u._started=!0,zi(u),null),_e=>(wr(u,_e),null))}o(Zh,"SetUpReadableStreamDefaultController");function pI(a,u,_,T){let A=Object.create(sn.prototype),L,q,se;u.start!==void 0?L=o(()=>u.start(A),"startAlgorithm"):L=o(()=>{},"startAlgorithm"),u.pull!==void 0?q=o(()=>u.pull(A),"pullAlgorithm"):q=o(()=>m(void 0),"pullAlgorithm"),u.cancel!==void 0?se=o(_e=>u.cancel(_e),"cancelAlgorithm"):se=o(()=>m(void 0),"cancelAlgorithm"),Zh(a,A,L,q,se,_,T)}o(pI,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function _s(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o(_s,"defaultControllerBrandCheckException$1");function fI(a,u){return ro(a._readableStreamController)?hI(a):mI(a)}o(fI,"ReadableStreamTee");function mI(a,u){let _=j(a),T=!1,A=!1,L=!1,q=!1,se,_e,me,Ae,Ne,tt=p(Dt=>{Ne=Dt});function Pr(){return T?(A=!0,m(void 0)):(T=!0,pe(_,{_chunkSteps:o(Mt=>{b(()=>{A=!1;let lr=Mt,cn=Mt;L||No(me._readableStreamController,lr),q||No(Ae._readableStreamController,cn),T=!1,A&&Pr()})},"_chunkSteps"),_closeSteps:o(()=>{T=!1,L||so(me._readableStreamController),q||so(Ae._readableStreamController),(!L||!q)&&Ne(void 0)},"_closeSteps"),_errorSteps:o(()=>{T=!1},"_errorSteps")}),m(void 0))}o(Pr,"pullAlgorithm");function Mo(Dt){if(L=!0,se=Dt,q){let Mt=Xe([se,_e]),lr=Tr(a,Mt);Ne(lr)}return tt}o(Mo,"cancel1Algorithm");function Dn(Dt){if(q=!0,_e=Dt,L){let Mt=Xe([se,_e]),lr=Tr(a,Mt);Ne(lr)}return tt}o(Dn,"cancel2Algorithm");function un(){}return o(un,"startAlgorithm"),me=Ui(un,Pr,Mo),Ae=Ui(un,Pr,Dn),g(_._closedPromise,Dt=>(wr(me._readableStreamController,Dt),wr(Ae._readableStreamController,Dt),(!L||!q)&&Ne(void 0),null)),[me,Ae]}o(mI,"ReadableStreamDefaultTee");function hI(a){let u=j(a),_=!1,T=!1,A=!1,L=!1,q=!1,se,_e,me,Ae,Ne,tt=p(he=>{Ne=he});function Pr(he){g(he._closedPromise,Le=>(he!==u||(cr(me._readableStreamController,Le),cr(Ae._readableStreamController,Le),(!L||!q)&&Ne(void 0)),null))}o(Pr,"forwardReaderError");function Mo(){oo(u)&&(B(u),u=j(a),Pr(u)),pe(u,{_chunkSteps:o(Le=>{b(()=>{T=!1,A=!1;let nt=Le,Zt=Le;if(!L&&!q)try{Zt=ph(Le)}catch(Lo){cr(me._readableStreamController,Lo),cr(Ae._readableStreamController,Lo),Ne(Tr(a,Lo));return}L||os(me._readableStreamController,nt),q||os(Ae._readableStreamController,Zt),_=!1,T?un():A&&Dt()})},"_chunkSteps"),_closeSteps:o(()=>{_=!1,L||Oi(me._readableStreamController),q||Oi(Ae._readableStreamController),me._readableStreamController._pendingPullIntos.length>0&&is(me._readableStreamController,0),Ae._readableStreamController._pendingPullIntos.length>0&&is(Ae._readableStreamController,0),(!L||!q)&&Ne(void 0)},"_closeSteps"),_errorSteps:o(()=>{_=!1},"_errorSteps")})}o(Mo,"pullWithDefaultReader");function Dn(he,Le){ce(u)&&(B(u),u=Ph(a),Pr(u));let nt=Le?Ae:me,Zt=Le?me:Ae;Ih(u,he,1,{_chunkSteps:o(jo=>{b(()=>{T=!1,A=!1;let Fo=Le?q:L;if(Le?L:q)Fo||as(nt._readableStreamController,jo);else{let lg;try{lg=ph(jo)}catch(Il){cr(nt._readableStreamController,Il),cr(Zt._readableStreamController,Il),Ne(Tr(a,Il));return}Fo||as(nt._readableStreamController,jo),os(Zt._readableStreamController,lg)}_=!1,T?un():A&&Dt()})},"_chunkSteps"),_closeSteps:o(jo=>{_=!1;let Fo=Le?q:L,As=Le?L:q;Fo||Oi(nt._readableStreamController),As||Oi(Zt._readableStreamController),jo!==void 0&&(Fo||as(nt._readableStreamController,jo),!As&&Zt._readableStreamController._pendingPullIntos.length>0&&is(Zt._readableStreamController,0)),(!Fo||!As)&&Ne(void 0)},"_closeSteps"),_errorSteps:o(()=>{_=!1},"_errorSteps")})}o(Dn,"pullWithBYOBReader");function un(){if(_)return T=!0,m(void 0);_=!0;let he=cl(me._readableStreamController);return he===null?Mo():Dn(he._view,!1),m(void 0)}o(un,"pull1Algorithm");function Dt(){if(_)return A=!0,m(void 0);_=!0;let he=cl(Ae._readableStreamController);return he===null?Mo():Dn(he._view,!0),m(void 0)}o(Dt,"pull2Algorithm");function Mt(he){if(L=!0,se=he,q){let Le=Xe([se,_e]),nt=Tr(a,Le);Ne(nt)}return tt}o(Mt,"cancel1Algorithm");function lr(he){if(q=!0,_e=he,L){let Le=Xe([se,_e]),nt=Tr(a,Le);Ne(nt)}return tt}o(lr,"cancel2Algorithm");function cn(){}return o(cn,"startAlgorithm"),me=Jh(cn,un,Mt),Ae=Jh(cn,Dt,lr),Pr(u),[me,Ae]}o(hI,"ReadableByteStreamTee");function gI(a){return r(a)&&typeof a.getReader<"u"}o(gI,"isReadableStreamLike");function yI(a){return gI(a)?_I(a.getReader()):vI(a)}o(yI,"ReadableStreamFrom");function vI(a){let u,_=dh(a,"async"),T=e;function A(){let q;try{q=cA(_)}catch(_e){return y(_e)}let se=m(q);return v(se,_e=>{if(!r(_e))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(lA(_e))so(u._readableStreamController);else{let Ae=dA(_e);No(u._readableStreamController,Ae)}})}o(A,"pullAlgorithm");function L(q){let se=_.iterator,_e;try{_e=ts(se,"return")}catch(Ne){return y(Ne)}if(_e===void 0)return m(void 0);let me;try{me=C(_e,se,[q])}catch(Ne){return y(Ne)}let Ae=m(me);return v(Ae,Ne=>{if(!r(Ne))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(L,"cancelAlgorithm"),u=Ui(T,A,L,0),u}o(vI,"ReadableStreamFromIterable");function _I(a){let u,_=e;function T(){let L;try{L=a.read()}catch(q){return y(q)}return v(L,q=>{if(!r(q))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(q.done)so(u._readableStreamController);else{let se=q.value;No(u._readableStreamController,se)}})}o(T,"pullAlgorithm");function A(L){try{return m(a.cancel(L))}catch(q){return y(q)}}return o(A,"cancelAlgorithm"),u=Ui(_,T,A,0),u}o(_I,"ReadableStreamFromDefaultReader");function bI(a,u){lt(a,u);let _=a,T=_?.autoAllocateChunkSize,A=_?.cancel,L=_?.pull,q=_?.start,se=_?.type;return{autoAllocateChunkSize:T===void 0?void 0:R(T,`${u} has member 'autoAllocateChunkSize' that`),cancel:A===void 0?void 0:EI(A,_,`${u} has member 'cancel' that`),pull:L===void 0?void 0:SI(L,_,`${u} has member 'pull' that`),start:q===void 0?void 0:wI(q,_,`${u} has member 'start' that`),type:se===void 0?void 0:TI(se,`${u} has member 'type' that`)}}o(bI,"convertUnderlyingDefaultOrByteSource");function EI(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(EI,"convertUnderlyingSourceCancelCallback");function SI(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(SI,"convertUnderlyingSourcePullCallback");function wI(a,u,_){return mt(a,_),T=>C(a,u,[T])}o(wI,"convertUnderlyingSourceStartCallback");function TI(a,u){if(a=`${a}`,a!=="bytes")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(TI,"convertReadableStreamType");function PI(a,u){return lt(a,u),{preventCancel:!!a?.preventCancel}}o(PI,"convertIteratorOptions");function Kh(a,u){lt(a,u);let _=a?.preventAbort,T=a?.preventCancel,A=a?.preventClose,L=a?.signal;return L!==void 0&&xI(L,`${u} has member 'signal' that`),{preventAbort:!!_,preventCancel:!!T,preventClose:!!A,signal:L}}o(Kh,"convertPipeOptions");function xI(a,u){if(!DA(a))throw new TypeError(`${u} is not an AbortSignal.`)}o(xI,"assertAbortSignal");function AI(a,u){lt(a,u);let _=a?.readable;S(_,"readable","ReadableWritablePair"),$(_,`${u} has member 'readable' that`);let T=a?.writable;return S(T,"writable","ReadableWritablePair"),Ch(T,`${u} has member 'writable' that`),{readable:_,writable:T}}o(AI,"convertReadableWritablePair");class Ct{static{o(this,"ReadableStream")}constructor(u={},_={}){u===void 0?u=null:We(u,"First parameter");let T=cs(_,"Second parameter"),A=bI(u,"First parameter");if(Tl(this),A.type==="bytes"){if(T.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let L=$i(T,0);EA(this,A,L)}else{let L=us(T),q=$i(T,1);pI(this,A,q,L)}}get locked(){if(!On(this))throw uo("locked");return kn(this)}cancel(u=void 0){return On(this)?kn(this)?y(new TypeError("Cannot cancel a stream that already has a reader")):Tr(this,u):y(uo("cancel"))}getReader(u=void 0){if(!On(this))throw uo("getReader");return wA(u,"First parameter").mode===void 0?j(this):Ph(this)}pipeThrough(u,_={}){if(!On(this))throw uo("pipeThrough");Ye(u,1,"pipeThrough");let T=AI(u,"First parameter"),A=Kh(_,"Second parameter");if(kn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if($o(T.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let L=Hh(this,T.writable,A.preventClose,A.preventAbort,A.preventCancel,A.signal);return E(L),T.readable}pipeTo(u,_={}){if(!On(this))return y(uo("pipeTo"));if(u===void 0)return y("Parameter 1 is required in 'pipeTo'.");if(!ko(u))return y(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let T;try{T=Kh(_,"Second parameter")}catch(A){return y(A)}return kn(this)?y(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):$o(u)?y(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Hh(this,u,T.preventClose,T.preventAbort,T.preventCancel,T.signal)}tee(){if(!On(this))throw uo("tee");let u=fI(this);return Xe(u)}values(u=void 0){if(!On(this))throw uo("values");let _=PI(u,"First parameter");return Io(this,_.preventCancel)}[rl](u){return this.values(u)}static from(u){return yI(u)}}Object.defineProperties(Ct,{from:{enumerable:!0}}),Object.defineProperties(Ct.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(Ct.from,"from"),i(Ct.prototype.cancel,"cancel"),i(Ct.prototype.getReader,"getReader"),i(Ct.prototype.pipeThrough,"pipeThrough"),i(Ct.prototype.pipeTo,"pipeTo"),i(Ct.prototype.tee,"tee"),i(Ct.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ct.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(Ct.prototype,rl,{value:Ct.prototype.values,writable:!0,configurable:!0});function Ui(a,u,_,T=1,A=()=>1){let L=Object.create(Ct.prototype);Tl(L);let q=Object.create(sn.prototype);return Zh(L,q,a,u,_,T,A),L}o(Ui,"CreateReadableStream");function Jh(a,u,_){let T=Object.create(Ct.prototype);Tl(T);let A=Object.create(on.prototype);return Th(T,A,a,u,_,0,void 0),T}o(Jh,"CreateReadableByteStream");function Tl(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(Tl,"InitializeReadableStream");function On(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof Ct}o(On,"IsReadableStream");function kn(a){return a._reader!==void 0}o(kn,"IsReadableStreamLocked");function Tr(a,u){if(a._disturbed=!0,a._state==="closed")return m(void 0);if(a._state==="errored")return y(a._storedError);Mi(a);let _=a._reader;if(_!==void 0&&oo(_)){let A=_._readIntoRequests;_._readIntoRequests=new Z,A.forEach(L=>{L._closeSteps(void 0)})}let T=a._readableStreamController[te](u);return v(T,e)}o(Tr,"ReadableStreamCancel");function Mi(a){a._state="closed";let u=a._reader;if(u!==void 0&&(Ke(u),ce(u))){let _=u._readRequests;u._readRequests=new Z,_.forEach(T=>{T._closeSteps()})}}o(Mi,"ReadableStreamClose");function Yh(a,u){a._state="errored",a._storedError=u;let _=a._reader;_!==void 0&&(Ce(_,u),ce(_)?it(_,u):Rh(_,u))}o(Yh,"ReadableStreamError");function uo(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(uo,"streamBrandCheckException$1");function Xh(a,u){lt(a,u);let _=a?.highWaterMark;return S(_,"highWaterMark","QueuingStrategyInit"),{highWaterMark:P(_)}}o(Xh,"convertQueuingStrategyInit");let Qh=o(a=>a.byteLength,"byteLengthSizeFunction");i(Qh,"size");class bs{static{o(this,"ByteLengthQueuingStrategy")}constructor(u){Ye(u,1,"ByteLengthQueuingStrategy"),u=Xh(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!tg(this))throw eg("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!tg(this))throw eg("size");return Qh}}Object.defineProperties(bs.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bs.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function eg(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(eg,"byteLengthBrandCheckException");function tg(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof bs}o(tg,"IsByteLengthQueuingStrategy");let rg=o(()=>1,"countSizeFunction");i(rg,"size");class Es{static{o(this,"CountQueuingStrategy")}constructor(u){Ye(u,1,"CountQueuingStrategy"),u=Xh(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!og(this))throw ng("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!og(this))throw ng("size");return rg}}Object.defineProperties(Es.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Es.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function ng(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o(ng,"countBrandCheckException");function og(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof Es}o(og,"IsCountQueuingStrategy");function II(a,u){lt(a,u);let _=a?.cancel,T=a?.flush,A=a?.readableType,L=a?.start,q=a?.transform,se=a?.writableType;return{cancel:_===void 0?void 0:kI(_,a,`${u} has member 'cancel' that`),flush:T===void 0?void 0:RI(T,a,`${u} has member 'flush' that`),readableType:A,start:L===void 0?void 0:CI(L,a,`${u} has member 'start' that`),transform:q===void 0?void 0:OI(q,a,`${u} has member 'transform' that`),writableType:se}}o(II,"convertTransformer");function RI(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(RI,"convertTransformerFlushCallback");function CI(a,u,_){return mt(a,_),T=>C(a,u,[T])}o(CI,"convertTransformerStartCallback");function OI(a,u,_){return mt(a,_),(T,A)=>U(a,u,[T,A])}o(OI,"convertTransformerTransformCallback");function kI(a,u,_){return mt(a,_),T=>U(a,u,[T])}o(kI,"convertTransformerCancelCallback");class Ss{static{o(this,"TransformStream")}constructor(u={},_={},T={}){u===void 0&&(u=null);let A=cs(_,"Second parameter"),L=cs(T,"Third parameter"),q=II(u,"First parameter");if(q.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(q.writableType!==void 0)throw new RangeError("Invalid writableType specified");let se=$i(L,0),_e=us(L),me=$i(A,1),Ae=us(A),Ne,tt=p(Pr=>{Ne=Pr});$I(this,tt,me,Ae,se,_e),NI(this,q),q.start!==void 0?Ne(q.start(this._transformStreamController)):Ne(void 0)}get readable(){if(!ig(this))throw cg("readable");return this._readable}get writable(){if(!ig(this))throw cg("writable");return this._writable}}Object.defineProperties(Ss.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ss.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function $I(a,u,_,T,A,L){function q(){return u}o(q,"startAlgorithm");function se(tt){return MI(a,tt)}o(se,"writeAlgorithm");function _e(tt){return LI(a,tt)}o(_e,"abortAlgorithm");function me(){return jI(a)}o(me,"closeAlgorithm"),a._writable=UA(q,se,me,_e,_,T);function Ae(){return FI(a)}o(Ae,"pullAlgorithm");function Ne(tt){return qI(a,tt)}o(Ne,"cancelAlgorithm"),a._readable=Ui(q,Ae,Ne,A,L),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,ws(a,!0),a._transformStreamController=void 0}o($I,"InitializeTransformStream");function ig(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof Ss}o(ig,"IsTransformStream");function ag(a,u){wr(a._readable._readableStreamController,u),Pl(a,u)}o(ag,"TransformStreamError");function Pl(a,u){Ps(a._transformStreamController),Di(a._writable._writableStreamController,u),xl(a)}o(Pl,"TransformStreamErrorWritableAndUnblockWrite");function xl(a){a._backpressure&&ws(a,!1)}o(xl,"TransformStreamUnblockWrite");function ws(a,u){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=p(_=>{a._backpressureChangePromise_resolve=_}),a._backpressure=u}o(ws,"TransformStreamSetBackpressure");class $n{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Ts(this))throw xs("desiredSize");let u=this._controlledTransformStream._readable._readableStreamController;return wl(u)}enqueue(u=void 0){if(!Ts(this))throw xs("enqueue");sg(this,u)}error(u=void 0){if(!Ts(this))throw xs("error");zI(this,u)}terminate(){if(!Ts(this))throw xs("terminate");UI(this)}}Object.defineProperties($n.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i($n.prototype.enqueue,"enqueue"),i($n.prototype.error,"error"),i($n.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($n.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function Ts(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof $n}o(Ts,"IsTransformStreamDefaultController");function DI(a,u,_,T,A){u._controlledTransformStream=a,a._transformStreamController=u,u._transformAlgorithm=_,u._flushAlgorithm=T,u._cancelAlgorithm=A,u._finishPromise=void 0,u._finishPromise_resolve=void 0,u._finishPromise_reject=void 0}o(DI,"SetUpTransformStreamDefaultController");function NI(a,u){let _=Object.create($n.prototype),T,A,L;u.transform!==void 0?T=o(q=>u.transform(q,_),"transformAlgorithm"):T=o(q=>{try{return sg(_,q),m(void 0)}catch(se){return y(se)}},"transformAlgorithm"),u.flush!==void 0?A=o(()=>u.flush(_),"flushAlgorithm"):A=o(()=>m(void 0),"flushAlgorithm"),u.cancel!==void 0?L=o(q=>u.cancel(q),"cancelAlgorithm"):L=o(()=>m(void 0),"cancelAlgorithm"),DI(a,_,T,A,L)}o(NI,"SetUpTransformStreamDefaultControllerFromTransformer");function Ps(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(Ps,"TransformStreamDefaultControllerClearAlgorithms");function sg(a,u){let _=a._controlledTransformStream,T=_._readable._readableStreamController;if(!zo(T))throw new TypeError("Readable side is not in a state that permits enqueue");try{No(T,u)}catch(L){throw Pl(_,L),_._readable._storedError}dI(T)!==_._backpressure&&ws(_,!0)}o(sg,"TransformStreamDefaultControllerEnqueue");function zI(a,u){ag(a._controlledTransformStream,u)}o(zI,"TransformStreamDefaultControllerError");function ug(a,u){let _=a._transformAlgorithm(u);return v(_,void 0,T=>{throw ag(a._controlledTransformStream,T),T})}o(ug,"TransformStreamDefaultControllerPerformTransform");function UI(a){let u=a._controlledTransformStream,_=u._readable._readableStreamController;so(_);let T=new TypeError("TransformStream terminated");Pl(u,T)}o(UI,"TransformStreamDefaultControllerTerminate");function MI(a,u){let _=a._transformStreamController;if(a._backpressure){let T=a._backpressureChangePromise;return v(T,()=>{let A=a._writable;if(A._state==="erroring")throw A._storedError;return ug(_,u)})}return ug(_,u)}o(MI,"TransformStreamDefaultSinkWriteAlgorithm");function LI(a,u){let _=a._transformStreamController;if(_._finishPromise!==void 0)return _._finishPromise;let T=a._readable;_._finishPromise=p((L,q)=>{_._finishPromise_resolve=L,_._finishPromise_reject=q});let A=_._cancelAlgorithm(u);return Ps(_),f(A,()=>(T._state==="errored"?Uo(_,T._storedError):(wr(T._readableStreamController,u),Al(_)),null),L=>(wr(T._readableStreamController,L),Uo(_,L),null)),_._finishPromise}o(LI,"TransformStreamDefaultSinkAbortAlgorithm");function jI(a){let u=a._transformStreamController;if(u._finishPromise!==void 0)return u._finishPromise;let _=a._readable;u._finishPromise=p((A,L)=>{u._finishPromise_resolve=A,u._finishPromise_reject=L});let T=u._flushAlgorithm();return Ps(u),f(T,()=>(_._state==="errored"?Uo(u,_._storedError):(so(_._readableStreamController),Al(u)),null),A=>(wr(_._readableStreamController,A),Uo(u,A),null)),u._finishPromise}o(jI,"TransformStreamDefaultSinkCloseAlgorithm");function FI(a){return ws(a,!1),a._backpressureChangePromise}o(FI,"TransformStreamDefaultSourcePullAlgorithm");function qI(a,u){let _=a._transformStreamController;if(_._finishPromise!==void 0)return _._finishPromise;let T=a._writable;_._finishPromise=p((L,q)=>{_._finishPromise_resolve=L,_._finishPromise_reject=q});let A=_._cancelAlgorithm(u);return Ps(_),f(A,()=>(T._state==="errored"?Uo(_,T._storedError):(Di(T._writableStreamController,u),xl(a),Al(_)),null),L=>(Di(T._writableStreamController,L),xl(a),Uo(_,L),null)),_._finishPromise}o(qI,"TransformStreamDefaultSourceCancelAlgorithm");function xs(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(xs,"defaultControllerBrandCheckException");function Al(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Al,"defaultControllerFinishPromiseResolve");function Uo(a,u){a._finishPromise_reject!==void 0&&(E(a._finishPromise),a._finishPromise_reject(u),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Uo,"defaultControllerFinishPromiseReject");function cg(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(cg,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=bs,t.CountQueuingStrategy=Es,t.ReadableByteStreamController=on,t.ReadableStream=Ct,t.ReadableStreamBYOBReader=Rn,t.ReadableStreamBYOBRequest=to,t.ReadableStreamDefaultController=sn,t.ReadableStreamDefaultReader=G,t.TransformStream=Ss,t.TransformStreamDefaultController=$n,t.WritableStream=Cn,t.WritableStreamDefaultController=Do,t.WritableStreamDefaultWriter=an}))});var $E=D(()=>{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,kE())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=o(function(r){let n=0,i=this;return new ReadableStream({type:"bytes",async pull(s){let d=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=d.byteLength,s.enqueue(new Uint8Array(d)),n===i.size&&s.close()}})},"name"))}catch{}});async function*Kd(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,DE),c=r.buffer.slice(n,n+s);n+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let c=await i.slice(n,Math.min(i.size,n+DE)).arrayBuffer();n+=c.byteLength,yield new Uint8Array(c)}}}var V9,DE,NE,S$,Ir,ma=Tt(()=>{V9=qe($E(),1);DE=65536;o(Kd,"toIterator");NE=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 c;ArrayBuffer.isView(s)?c=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?c=new Uint8Array(s.slice(0)):s instanceof Jd?c=s:c=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of Kd(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 Kd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Kd(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let n=await e.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,n=""){let{size:i}=this,s=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),d=Math.max(c-s,0),p=this.#e,m=[],y=0;for(let f of p){if(y>=d)break;let l=ArrayBuffer.isView(f)?f.byteLength:f.size;if(s&&l<=s)s-=l,c-=l;else{let g;ArrayBuffer.isView(f)?(g=f.subarray(s,Math.min(l,c)),y+=g.byteLength):(g=f.slice(s,Math.min(l,c)),y+=g.size),c-=l,m.push(g),s=0}}let h=new Jd([],{type:String(n).toLowerCase()});return h.#r=d,h.#e=m,h}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(NE.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});S$=NE,Ir=S$});var w$,T$,Hn,Yd=Tt(()=>{ma();w$=class extends Ir{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 Ir&&/^(File)$/.test(e[Symbol.toStringTag])}},T$=w$,Hn=T$});function ME(t,e=Ir){var r=`${zE()}${zE()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
|
|
15
15
|
Content-Disposition: form-data; name="`;return t.forEach((s,c)=>typeof s=="string"?n.push(i+Xd(c)+`"\r
|
|
16
16
|
\r
|
|
17
17
|
${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
@@ -20,53 +20,53 @@ ${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
|
20
20
|
Content-Type: ${s.type||"application/octet-stream"}\r
|
|
21
21
|
\r
|
|
22
22
|
`,s,`\r
|
|
23
|
-
`)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var ha,
|
|
24
|
-
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),ho=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"),Wn=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[ha](){return"FormData"}[
|
|
25
|
-
--`+e;let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n),this.boundaryChars[r[n]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=nt.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:s,boundary:c,boundaryChars:d,index:p,state:m,flags:y}=this,h=this.boundary.length,f=h-1,l=e.length,g,v,E=o(J=>{this[J+"Mark"]=r},"mark"),b=o(J=>{delete this[J+"Mark"]},"clear"),C=o((J,W,H,K)=>{(W===void 0||W!==H)&&this[J](K&&K.subarray(W,H))},"callback"),U=o((J,W)=>{let H=J+"Mark";H in this&&(W?(C(J,this[H],r,e),delete this[H]):(C(J,this[H],e.length,e),this[H]=0))},"dataCallback");for(r=0;r<n;r++)switch(g=e[r],m){case nt.START_BOUNDARY:if(p===c.length-2){if(g===ya)y|=Zn.LAST_BOUNDARY;else if(g!==Au)return;p++;break}else if(p-1===c.length-2){if(y&Zn.LAST_BOUNDARY&&g===ya)m=nt.END,y=0;else if(!(y&Zn.LAST_BOUNDARY)&&g===xu)p=0,C("onPartBegin"),m=nt.HEADER_FIELD_START;else return;break}g!==c[p+2]&&(p=-2),g===c[p+2]&&p++;break;case nt.HEADER_FIELD_START:m=nt.HEADER_FIELD,E("onHeaderField"),p=0;case nt.HEADER_FIELD:if(g===Au){b("onHeaderField"),m=nt.HEADERS_ALMOST_DONE;break}if(p++,g===ya)break;if(g===A$){if(p===1)return;U("onHeaderField",!0),m=nt.HEADER_VALUE_START;break}if(v=C$(g),v<I$||v>R$)return;break;case nt.HEADER_VALUE_START:if(g===x$)break;E("onHeaderValue"),m=nt.HEADER_VALUE;case nt.HEADER_VALUE:g===Au&&(U("onHeaderValue",!0),C("onHeaderEnd"),m=nt.HEADER_VALUE_ALMOST_DONE);break;case nt.HEADER_VALUE_ALMOST_DONE:if(g!==xu)return;m=nt.HEADER_FIELD_START;break;case nt.HEADERS_ALMOST_DONE:if(g!==xu)return;C("onHeadersEnd"),m=nt.PART_DATA_START;break;case nt.PART_DATA_START:m=nt.PART_DATA,E("onPartData");case nt.PART_DATA:if(i=p,p===0){for(r+=f;r<l&&!(e[r]in d);)r+=h;r-=f,g=e[r]}if(p<c.length)c[p]===g?(p===0&&U("onPartData",!0),p++):p=0;else if(p===c.length)p++,g===Au?y|=Zn.PART_BOUNDARY:g===ya?y|=Zn.LAST_BOUNDARY:p=0;else if(p-1===c.length)if(y&Zn.PART_BOUNDARY){if(p=0,g===xu){y&=~Zn.PART_BOUNDARY,C("onPartEnd"),C("onPartBegin"),m=nt.HEADER_FIELD_START;break}}else y&Zn.LAST_BOUNDARY&&g===ya?(C("onPartEnd"),m=nt.END,y=0):p=0;if(p>0)s[p-1]=g;else if(i>0){let J=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);C("onPartData",0,i,J),i=0,E("onPartData"),r--}break;case nt.END:break;default:throw new Error(`Unexpected state entered: ${m}`)}U("onHeaderField"),U("onHeaderValue"),U("onPartData"),this.index=p,this.state=m,this.flags=y}end(){if(this.state===nt.HEADER_FIELD_START&&this.index===0||this.state===nt.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==nt.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o(O$,"_fileName");o(k$,"toFormData")});async function op(t){if(t[Vt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Vt].disturbed=!0,t[Vt].error)throw t[Vt].error;let{body:e}=t;if(e===null)return Xt.Buffer.alloc(0);if(!(e instanceof gr.default))return Xt.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 zt(`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 gn?i:new zt(`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")?Xt.Buffer.from(r.join("")):Xt.Buffer.concat(r,n)}catch(i){throw new zt(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new zt(`Premature close of server response while trying to fetch ${t.url}`)}var gr,yn,Xt,$$,Vt,Br,ii,D$,Iu,eS,tS,Ru=Tt(()=>{gr=qe(require("node:stream"),1),yn=require("node:util"),Xt=require("node:buffer");ma();Eu();Qd();Su();Tu();$$=(0,yn.promisify)(gr.default.pipeline),Vt=Symbol("Body internals"),Br=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:ep(e)?e=Xt.Buffer.from(e.toString()):ga(e)||Xt.Buffer.isBuffer(e)||(yn.types.isAnyArrayBuffer(e)?e=Xt.Buffer.from(e):ArrayBuffer.isView(e)?e=Xt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof gr.default||(e instanceof Wn?(e=UE(e),n=e.type.split("=")[1]):e=Xt.Buffer.from(String(e))));let i=e;Xt.Buffer.isBuffer(e)?i=gr.default.Readable.from(e):ga(e)&&(i=gr.default.Readable.from(e.stream())),this[Vt]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof gr.default&&e.on("error",s=>{let c=s instanceof gn?s:new zt(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Vt].error=c})}get body(){return this[Vt].stream}get bodyUsed(){return this[Vt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await op(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 Wn,i=new URLSearchParams(await this.text());for(let[s,c]of i)n.append(s,c);return n}let{toFormData:r}=await Promise.resolve().then(()=>(QE(),XE));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Vt].body&&this[Vt].body.type||"",r=await this.arrayBuffer();return new Ir([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await op(this);return new TextDecoder().decode(e)}buffer(){return op(this)}};Br.prototype.buffer=(0,yn.deprecate)(Br.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Br.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,yn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(op,"consumeBody");ii=o((t,e)=>{let r,n,{body:i}=t[Vt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof gr.default&&typeof i.getBoundary!="function"&&(r=new gr.PassThrough({highWaterMark:e}),n=new gr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[Vt].stream=r,i=n),i},"clone"),D$=(0,yn.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"),Iu=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":ep(t)?"application/x-www-form-urlencoded;charset=UTF-8":ga(t)?t.type||null:Xt.Buffer.isBuffer(t)||yn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Wn?`multipart/form-data; boundary=${e[Vt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${D$(t)}`:t instanceof gr.default?null:"text/plain;charset=UTF-8","extractContentType"),eS=o(t=>{let{body:e}=t[Vt];return e===null?0:ga(e)?e.size:Xt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),tS=o(async(t,{body:e})=>{e===null?t.end():await $$(e,t)},"writeToStream")});function rS(t=[]){return new Gt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return Cu(e),ap(e,String(r)),!0}catch{return!1}}))}var ip,va,Cu,ap,Gt,Ou=Tt(()=>{ip=require("node:util"),va=qe(require("node:http"),1),Cu=typeof va.default.validateHeaderName=="function"?va.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}},ap=typeof va.default.validateHeaderValue=="function"?va.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}},Gt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,s]of Object.entries(n))r.push(...s.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!ip.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"||ip.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])=>(Cu(n),ap(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,s){switch(i){case"append":case"set":return(c,d)=>(Cu(c),ap(c,String(d)),URLSearchParams.prototype[i].call(n,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(Cu(c),URLSearchParams.prototype[i].call(n,String(c).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(Gt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(rS,"fromRawHeaders")});var N$,_a,sp=Tt(()=>{N$=new Set([301,302,303,307,308]),_a=o(t=>N$.has(t),"isRedirect")});var Rr,Qt,nS=Tt(()=>{Ou();Ru();sp();Rr=Symbol("Response internals"),Qt=class t extends Br{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new Gt(r.headers);if(e!==null&&!i.has("Content-Type")){let s=Iu(e,this);s&&i.append("Content-Type",s)}this[Rr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Rr].type}get url(){return this[Rr].url||""}get status(){return this[Rr].status}get ok(){return this[Rr].status>=200&&this[Rr].status<300}get redirected(){return this[Rr].counter>0}get statusText(){return this[Rr].statusText}get headers(){return this[Rr].headers}get highWaterMark(){return this[Rr].highWaterMark}clone(){return new t(ii(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(!_a(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[Rr].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 Gt(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(Qt.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var oS,iS=Tt(()=>{oS=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 aS(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 lS(t){if(!uS.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function z$(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,sS.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 ai(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:z$(t)}function dS(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=aS(i),c=aS(i,!0);s.toString().length>4096&&(s=c),e&&(s=e(s)),r&&(c=r(c));let d=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return s;case"strict-origin":return ai(s)&&!ai(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return s.origin===d.origin?s:ai(s)&&!ai(d)?"no-referrer":c;case"same-origin":return s.origin===d.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===d.origin?s:c;case"no-referrer-when-downgrade":return ai(s)&&!ai(d)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function pS(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&uS.has(n)&&(r=n);return r}var sS,uS,cS,up=Tt(()=>{sS=require("node:net");o(aS,"stripURLForUseAsAReferrer");uS=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),cS="strict-origin-when-cross-origin";o(lS,"validateReferrerPolicy");o(z$,"isOriginPotentiallyTrustworthy");o(ai,"isUrlPotentiallyTrustworthy");o(dS,"determineRequestsReferrer");o(pS,"parseReferrerPolicyFromHeader")});var fS,mS,It,ba,U$,Kn,hS,gS=Tt(()=>{fS=require("node:url"),mS=require("node:util");Ou();Ru();Tu();iS();up();It=Symbol("Request internals"),ba=o(t=>typeof t=="object"&&typeof t[It]=="object","isRequest"),U$=(0,mS.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Kn=class t extends Br{static{o(this,"Request")}constructor(e,r={}){let n;if(ba(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()),!ba(r)&&"data"in r&&U$(),(r.body!=null||ba(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:ba(e)&&e.body!==null?ii(e):null;super(s,{size:r.size||e.size||0});let c=new Gt(r.headers||e.headers||{});if(s!==null&&!c.has("Content-Type")){let m=Iu(s,this);m&&c.set("Content-Type",m)}let d=ba(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!ME(d))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let p=r.referrer==null?e.referrer:r.referrer;if(p==="")p="no-referrer";else if(p){let m=new URL(p);p=/^about:(\/\/)?client$/.test(m)?"client":m}else p=void 0;this[It]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:n,signal:d,referrer:p},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[It].method}get url(){return(0,fS.format)(this[It].parsedURL)}get headers(){return this[It].headers}get redirect(){return this[It].redirect}get signal(){return this[It].signal}get referrer(){if(this[It].referrer==="no-referrer")return"";if(this[It].referrer==="client")return"about:client";if(this[It].referrer)return this[It].referrer.toString()}get referrerPolicy(){return this[It].referrerPolicy}set referrerPolicy(e){this[It].referrerPolicy=lS(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Kn.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}});hS=o(t=>{let{parsedURL:e}=t[It],r=new Gt(t[It].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(n="0"),t.body!==null){let d=eS(t);typeof d=="number"&&!Number.isNaN(d)&&(n=String(d))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=cS),t.referrer&&t.referrer!=="no-referrer"?t[It].referrer=dS(t):t[It].referrer="no-referrer",t[It].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=oS(e),c={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}},"getNodeRequestOptions")});var Ea,yS=Tt(()=>{Su();Ea=class extends gn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var bS={};Is(bS,{AbortError:()=>Ea,Blob:()=>Ir,FetchError:()=>zt,File:()=>Hn,FormData:()=>Wn,Headers:()=>Gt,Request:()=>Kn,Response:()=>Qt,blobFrom:()=>HE,blobFromSync:()=>GE,default:()=>cp,fileFrom:()=>WE,fileFromSync:()=>ZE,isRedirect:()=>_a});async function cp(t,e){return new Promise((r,n)=>{let i=new Kn(t,e),{parsedURL:s,options:c}=hS(i);if(!M$.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let g=IE(i.url),v=new Qt(g,{headers:{"Content-Type":g.typeFull}});r(v);return}let d=(s.protocol==="https:"?_S.default:vS.default).request,{signal:p}=i,m=null,y=o(()=>{let g=new Ea("The operation was aborted.");n(g),i.body&&i.body instanceof er.default.Readable&&i.body.destroy(g),!(!m||!m.body)&&m.body.emit("error",g)},"abort");if(p&&p.aborted){y();return}let h=o(()=>{y(),l()},"abortAndFinalize"),f=d(s.toString(),c);p&&p.addEventListener("abort",h);let l=o(()=>{f.abort(),p&&p.removeEventListener("abort",h)},"finalize");f.on("error",g=>{n(new zt(`request to ${i.url} failed, reason: ${g.message}`,"system",g)),l()}),L$(f,g=>{m&&m.body&&m.body.destroy(g)}),process.version<"v14"&&f.on("socket",g=>{let v;g.prependListener("end",()=>{v=g._eventsCount}),g.prependListener("close",E=>{if(m&&v<g._eventsCount&&!E){let b=new Error("Premature close");b.code="ERR_STREAM_PREMATURE_CLOSE",m.body.emit("error",b)}})}),f.on("response",g=>{f.setTimeout(0);let v=rS(g.rawHeaders);if(_a(g.statusCode)){let J=v.get("Location"),W=null;try{W=J===null?null:new URL(J,i.url)}catch{if(i.redirect!=="manual"){n(new zt(`uri requested responds with an invalid redirect URL: ${J}`,"invalid-redirect")),l();return}}switch(i.redirect){case"error":n(new zt(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),l();return;case"manual":break;case"follow":{if(W===null)break;if(i.counter>=i.follow){n(new zt(`maximum redirect reached at: ${i.url}`,"max-redirect")),l();return}let H={headers:new Gt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:ii(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!LE(i.url,W)||!jE(i.url,W))for(let te of["authorization","www-authenticate","cookie","cookie2"])H.headers.delete(te);if(g.statusCode!==303&&i.body&&e.body instanceof er.default.Readable){n(new zt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),l();return}(g.statusCode===303||(g.statusCode===301||g.statusCode===302)&&i.method==="POST")&&(H.method="GET",H.body=void 0,H.headers.delete("content-length"));let K=pS(v);K&&(H.referrerPolicy=K),r(cp(new Kn(W,H))),l();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}p&&g.once("end",()=>{p.removeEventListener("abort",h)});let E=(0,er.pipeline)(g,new er.PassThrough,J=>{J&&n(J)});process.version<"v12.10"&&g.on("aborted",h);let b={url:i.url,status:g.statusCode,statusText:g.statusMessage,headers:v,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},C=v.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||C===null||g.statusCode===204||g.statusCode===304){m=new Qt(E,b),r(m);return}let U={flush:vo.default.Z_SYNC_FLUSH,finishFlush:vo.default.Z_SYNC_FLUSH};if(C==="gzip"||C==="x-gzip"){E=(0,er.pipeline)(E,vo.default.createGunzip(U),J=>{J&&n(J)}),m=new Qt(E,b),r(m);return}if(C==="deflate"||C==="x-deflate"){let J=(0,er.pipeline)(g,new er.PassThrough,W=>{W&&n(W)});J.once("data",W=>{(W[0]&15)===8?E=(0,er.pipeline)(E,vo.default.createInflate(),H=>{H&&n(H)}):E=(0,er.pipeline)(E,vo.default.createInflateRaw(),H=>{H&&n(H)}),m=new Qt(E,b),r(m)}),J.once("end",()=>{m||(m=new Qt(E,b),r(m))});return}if(C==="br"){E=(0,er.pipeline)(E,vo.default.createBrotliDecompress(),J=>{J&&n(J)}),m=new Qt(E,b),r(m);return}m=new Qt(E,b),r(m)}),tS(f,i).catch(n)})}function L$(t,e){let r=Sa.Buffer.from(`0\r
|
|
23
|
+
`)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var ha,P$,x$,zE,A$,UE,Xd,ho,Wn,Eu=Tt(()=>{ma();Yd();({toStringTag:ha,iterator:P$,hasInstance:x$}=Symbol),zE=Math.random,A$="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),UE=o((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[ha])?[(r=r!==void 0?r+"":e[ha]=="File"?e.name:"blob",t),e.name!==r||e[ha]=="blob"?new Hn([e],r,e):e]:[t,e+""]),"f"),Xd=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"),ho=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"),Wn=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[ha](){return"FormData"}[P$](){return this.entries()}static[x$](e){return e&&typeof e=="object"&&e[ha]==="FormData"&&!A$.some(r=>typeof e[r]!="function")}append(...e){ho("append",arguments,2),this.#e.push(UE(...e))}delete(e){ho("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){ho("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 ho("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return ho("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){ho("forEach",arguments,1);for(var[n,i]of this)e.call(r,i,n,this)}set(...e){ho("set",arguments,2);var r=[],n=!0;e=UE(...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(ME,"formDataToBlob")});var gn,Su=Tt(()=>{gn=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 zt,Qd=Tt(()=>{Su();zt=class extends gn{static{o(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var wu,ep,ga,LE,jE,FE,Tu=Tt(()=>{wu=Symbol.toStringTag,ep=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[wu]==="URLSearchParams","isURLSearchParameters"),ga=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[wu]),"isBlob"),LE=o(t=>typeof t=="object"&&(t[wu]==="AbortSignal"||t[wu]==="EventTarget"),"isAbortSignal"),jE=o((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),FE=o((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var BE=D((cY,qE)=>{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)}qE.exports=globalThis.DOMException});var go,VE,GE,tp,HE,WE,ZE,KE,JE,YE,Pu,rp=Tt(()=>{go=require("node:fs"),VE=require("node:path"),GE=qe(BE(),1);Yd();ma();({stat:tp}=go.promises),HE=o((t,e)=>JE((0,go.statSync)(t),t,e),"blobFromSync"),WE=o((t,e)=>tp(t).then(r=>JE(r,t,e)),"blobFrom"),ZE=o((t,e)=>tp(t).then(r=>YE(r,t,e)),"fileFrom"),KE=o((t,e)=>YE((0,go.statSync)(t),t,e),"fileFromSync"),JE=o((t,e,r="")=>new Ir([new Pu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),YE=o((t,e,r="")=>new Hn([new Pu({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,VE.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),Pu=class t{static{o(this,"BlobDataItem")}#e;#t;constructor(e){this.#e=e.path,this.#t=e.start,this.size=e.size,this.lastModified=e.lastModified}slice(e,r){return new t({path:this.#e,lastModified:this.lastModified,size:r-e,start:this.#t+e})}async*stream(){let{mtimeMs:e}=await tp(this.#e);if(e>this.lastModified)throw new GE.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,go.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var QE={};Is(QE,{toFormData:()=>D$});function $$(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 D$(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 np(r[1]||r[2]),i,s,c,d,p,m,y=[],h=new Wn,f=o(b=>{c+=E.decode(b,{stream:!0})},"onPartData"),l=o(b=>{y.push(b)},"appendToFile"),g=o(()=>{let b=new Hn(y,m,{type:p});h.append(d,b)},"appendFileToFormData"),v=o(()=>{h.append(d,c)},"appendEntryToFormData"),E=new TextDecoder("utf-8");E.decode(),n.onPartBegin=function(){n.onPartData=f,n.onPartEnd=v,i="",s="",c="",d="",p="",m=null,y.length=0},n.onHeaderField=function(b){i+=E.decode(b,{stream:!0})},n.onHeaderValue=function(b){s+=E.decode(b,{stream:!0})},n.onHeaderEnd=function(){if(s+=E.decode(),i=i.toLowerCase(),i==="content-disposition"){let b=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);b&&(d=b[2]||b[3]||""),m=$$(s),m&&(n.onPartData=l,n.onPartEnd=g)}else i==="content-type"&&(p=s);s="",i=""};for await(let b of t)n.write(b);return n.end(),h}var qr,ot,XE,Zn,xu,Au,I$,ya,R$,C$,O$,k$,yo,np,eS=Tt(()=>{rp();Eu();qr=0,ot={START_BOUNDARY:qr++,HEADER_FIELD_START:qr++,HEADER_FIELD:qr++,HEADER_VALUE_START:qr++,HEADER_VALUE:qr++,HEADER_VALUE_ALMOST_DONE:qr++,HEADERS_ALMOST_DONE:qr++,PART_DATA_START:qr++,PART_DATA:qr++,END:qr++},XE=1,Zn={PART_BOUNDARY:XE,LAST_BOUNDARY:XE*=2},xu=10,Au=13,I$=32,ya=45,R$=58,C$=97,O$=122,k$=o(t=>t|32,"lower"),yo=o(()=>{},"noop"),np=class{static{o(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=yo,this.onHeaderField=yo,this.onHeadersEnd=yo,this.onHeaderValue=yo,this.onPartBegin=yo,this.onPartData=yo,this.onPartEnd=yo,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=ot.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:s,boundary:c,boundaryChars:d,index:p,state:m,flags:y}=this,h=this.boundary.length,f=h-1,l=e.length,g,v,E=o(J=>{this[J+"Mark"]=r},"mark"),b=o(J=>{delete this[J+"Mark"]},"clear"),C=o((J,Z,H,K)=>{(Z===void 0||Z!==H)&&this[J](K&&K.subarray(Z,H))},"callback"),U=o((J,Z)=>{let H=J+"Mark";H in this&&(Z?(C(J,this[H],r,e),delete this[H]):(C(J,this[H],e.length,e),this[H]=0))},"dataCallback");for(r=0;r<n;r++)switch(g=e[r],m){case ot.START_BOUNDARY:if(p===c.length-2){if(g===ya)y|=Zn.LAST_BOUNDARY;else if(g!==Au)return;p++;break}else if(p-1===c.length-2){if(y&Zn.LAST_BOUNDARY&&g===ya)m=ot.END,y=0;else if(!(y&Zn.LAST_BOUNDARY)&&g===xu)p=0,C("onPartBegin"),m=ot.HEADER_FIELD_START;else return;break}g!==c[p+2]&&(p=-2),g===c[p+2]&&p++;break;case ot.HEADER_FIELD_START:m=ot.HEADER_FIELD,E("onHeaderField"),p=0;case ot.HEADER_FIELD:if(g===Au){b("onHeaderField"),m=ot.HEADERS_ALMOST_DONE;break}if(p++,g===ya)break;if(g===R$){if(p===1)return;U("onHeaderField",!0),m=ot.HEADER_VALUE_START;break}if(v=k$(g),v<C$||v>O$)return;break;case ot.HEADER_VALUE_START:if(g===I$)break;E("onHeaderValue"),m=ot.HEADER_VALUE;case ot.HEADER_VALUE:g===Au&&(U("onHeaderValue",!0),C("onHeaderEnd"),m=ot.HEADER_VALUE_ALMOST_DONE);break;case ot.HEADER_VALUE_ALMOST_DONE:if(g!==xu)return;m=ot.HEADER_FIELD_START;break;case ot.HEADERS_ALMOST_DONE:if(g!==xu)return;C("onHeadersEnd"),m=ot.PART_DATA_START;break;case ot.PART_DATA_START:m=ot.PART_DATA,E("onPartData");case ot.PART_DATA:if(i=p,p===0){for(r+=f;r<l&&!(e[r]in d);)r+=h;r-=f,g=e[r]}if(p<c.length)c[p]===g?(p===0&&U("onPartData",!0),p++):p=0;else if(p===c.length)p++,g===Au?y|=Zn.PART_BOUNDARY:g===ya?y|=Zn.LAST_BOUNDARY:p=0;else if(p-1===c.length)if(y&Zn.PART_BOUNDARY){if(p=0,g===xu){y&=~Zn.PART_BOUNDARY,C("onPartEnd"),C("onPartBegin"),m=ot.HEADER_FIELD_START;break}}else y&Zn.LAST_BOUNDARY&&g===ya?(C("onPartEnd"),m=ot.END,y=0):p=0;if(p>0)s[p-1]=g;else if(i>0){let J=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);C("onPartData",0,i,J),i=0,E("onPartData"),r--}break;case ot.END:break;default:throw new Error(`Unexpected state entered: ${m}`)}U("onHeaderField"),U("onHeaderValue"),U("onPartData"),this.index=p,this.state=m,this.flags=y}end(){if(this.state===ot.HEADER_FIELD_START&&this.index===0||this.state===ot.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==ot.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o($$,"_fileName");o(D$,"toFormData")});async function op(t){if(t[Vt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Vt].disturbed=!0,t[Vt].error)throw t[Vt].error;let{body:e}=t;if(e===null)return Xt.Buffer.alloc(0);if(!(e instanceof gr.default))return Xt.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 zt(`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 gn?i:new zt(`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")?Xt.Buffer.from(r.join("")):Xt.Buffer.concat(r,n)}catch(i){throw new zt(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new zt(`Premature close of server response while trying to fetch ${t.url}`)}var gr,yn,Xt,N$,Vt,Br,ii,z$,Iu,tS,rS,Ru=Tt(()=>{gr=qe(require("node:stream"),1),yn=require("node:util"),Xt=require("node:buffer");ma();Eu();Qd();Su();Tu();N$=(0,yn.promisify)(gr.default.pipeline),Vt=Symbol("Body internals"),Br=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:ep(e)?e=Xt.Buffer.from(e.toString()):ga(e)||Xt.Buffer.isBuffer(e)||(yn.types.isAnyArrayBuffer(e)?e=Xt.Buffer.from(e):ArrayBuffer.isView(e)?e=Xt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof gr.default||(e instanceof Wn?(e=ME(e),n=e.type.split("=")[1]):e=Xt.Buffer.from(String(e))));let i=e;Xt.Buffer.isBuffer(e)?i=gr.default.Readable.from(e):ga(e)&&(i=gr.default.Readable.from(e.stream())),this[Vt]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof gr.default&&e.on("error",s=>{let c=s instanceof gn?s:new zt(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[Vt].error=c})}get body(){return this[Vt].stream}get bodyUsed(){return this[Vt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await op(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 Wn,i=new URLSearchParams(await this.text());for(let[s,c]of i)n.append(s,c);return n}let{toFormData:r}=await Promise.resolve().then(()=>(eS(),QE));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Vt].body&&this[Vt].body.type||"",r=await this.arrayBuffer();return new Ir([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await op(this);return new TextDecoder().decode(e)}buffer(){return op(this)}};Br.prototype.buffer=(0,yn.deprecate)(Br.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Br.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,yn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(op,"consumeBody");ii=o((t,e)=>{let r,n,{body:i}=t[Vt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof gr.default&&typeof i.getBoundary!="function"&&(r=new gr.PassThrough({highWaterMark:e}),n=new gr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[Vt].stream=r,i=n),i},"clone"),z$=(0,yn.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"),Iu=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":ep(t)?"application/x-www-form-urlencoded;charset=UTF-8":ga(t)?t.type||null:Xt.Buffer.isBuffer(t)||yn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof Wn?`multipart/form-data; boundary=${e[Vt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${z$(t)}`:t instanceof gr.default?null:"text/plain;charset=UTF-8","extractContentType"),tS=o(t=>{let{body:e}=t[Vt];return e===null?0:ga(e)?e.size:Xt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),rS=o(async(t,{body:e})=>{e===null?t.end():await N$(e,t)},"writeToStream")});function nS(t=[]){return new Gt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return Cu(e),ap(e,String(r)),!0}catch{return!1}}))}var ip,va,Cu,ap,Gt,Ou=Tt(()=>{ip=require("node:util"),va=qe(require("node:http"),1),Cu=typeof va.default.validateHeaderName=="function"?va.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}},ap=typeof va.default.validateHeaderValue=="function"?va.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}},Gt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,s]of Object.entries(n))r.push(...s.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!ip.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"||ip.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])=>(Cu(n),ap(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,s){switch(i){case"append":case"set":return(c,d)=>(Cu(c),ap(c,String(d)),URLSearchParams.prototype[i].call(n,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(Cu(c),URLSearchParams.prototype[i].call(n,String(c).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(Gt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(nS,"fromRawHeaders")});var U$,_a,sp=Tt(()=>{U$=new Set([301,302,303,307,308]),_a=o(t=>U$.has(t),"isRedirect")});var Rr,Qt,oS=Tt(()=>{Ou();Ru();sp();Rr=Symbol("Response internals"),Qt=class t extends Br{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new Gt(r.headers);if(e!==null&&!i.has("Content-Type")){let s=Iu(e,this);s&&i.append("Content-Type",s)}this[Rr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[Rr].type}get url(){return this[Rr].url||""}get status(){return this[Rr].status}get ok(){return this[Rr].status>=200&&this[Rr].status<300}get redirected(){return this[Rr].counter>0}get statusText(){return this[Rr].statusText}get headers(){return this[Rr].headers}get highWaterMark(){return this[Rr].highWaterMark}clone(){return new t(ii(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(!_a(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[Rr].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 Gt(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(Qt.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var iS,aS=Tt(()=>{iS=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 sS(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 dS(t){if(!cS.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function M$(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,uS.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 ai(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:M$(t)}function pS(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=sS(i),c=sS(i,!0);s.toString().length>4096&&(s=c),e&&(s=e(s)),r&&(c=r(c));let d=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return s;case"strict-origin":return ai(s)&&!ai(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return s.origin===d.origin?s:ai(s)&&!ai(d)?"no-referrer":c;case"same-origin":return s.origin===d.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===d.origin?s:c;case"no-referrer-when-downgrade":return ai(s)&&!ai(d)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function fS(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&cS.has(n)&&(r=n);return r}var uS,cS,lS,up=Tt(()=>{uS=require("node:net");o(sS,"stripURLForUseAsAReferrer");cS=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),lS="strict-origin-when-cross-origin";o(dS,"validateReferrerPolicy");o(M$,"isOriginPotentiallyTrustworthy");o(ai,"isUrlPotentiallyTrustworthy");o(pS,"determineRequestsReferrer");o(fS,"parseReferrerPolicyFromHeader")});var mS,hS,It,ba,L$,Kn,gS,yS=Tt(()=>{mS=require("node:url"),hS=require("node:util");Ou();Ru();Tu();aS();up();It=Symbol("Request internals"),ba=o(t=>typeof t=="object"&&typeof t[It]=="object","isRequest"),L$=(0,hS.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Kn=class t extends Br{static{o(this,"Request")}constructor(e,r={}){let n;if(ba(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()),!ba(r)&&"data"in r&&L$(),(r.body!=null||ba(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:ba(e)&&e.body!==null?ii(e):null;super(s,{size:r.size||e.size||0});let c=new Gt(r.headers||e.headers||{});if(s!==null&&!c.has("Content-Type")){let m=Iu(s,this);m&&c.set("Content-Type",m)}let d=ba(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!LE(d))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let p=r.referrer==null?e.referrer:r.referrer;if(p==="")p="no-referrer";else if(p){let m=new URL(p);p=/^about:(\/\/)?client$/.test(m)?"client":m}else p=void 0;this[It]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:n,signal:d,referrer:p},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[It].method}get url(){return(0,mS.format)(this[It].parsedURL)}get headers(){return this[It].headers}get redirect(){return this[It].redirect}get signal(){return this[It].signal}get referrer(){if(this[It].referrer==="no-referrer")return"";if(this[It].referrer==="client")return"about:client";if(this[It].referrer)return this[It].referrer.toString()}get referrerPolicy(){return this[It].referrerPolicy}set referrerPolicy(e){this[It].referrerPolicy=dS(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Kn.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}});gS=o(t=>{let{parsedURL:e}=t[It],r=new Gt(t[It].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(n="0"),t.body!==null){let d=tS(t);typeof d=="number"&&!Number.isNaN(d)&&(n=String(d))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=lS),t.referrer&&t.referrer!=="no-referrer"?t[It].referrer=pS(t):t[It].referrer="no-referrer",t[It].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=iS(e),c={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}},"getNodeRequestOptions")});var Ea,vS=Tt(()=>{Su();Ea=class extends gn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var ES={};Is(ES,{AbortError:()=>Ea,Blob:()=>Ir,FetchError:()=>zt,File:()=>Hn,FormData:()=>Wn,Headers:()=>Gt,Request:()=>Kn,Response:()=>Qt,blobFrom:()=>WE,blobFromSync:()=>HE,default:()=>cp,fileFrom:()=>ZE,fileFromSync:()=>KE,isRedirect:()=>_a});async function cp(t,e){return new Promise((r,n)=>{let i=new Kn(t,e),{parsedURL:s,options:c}=gS(i);if(!j$.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let g=RE(i.url),v=new Qt(g,{headers:{"Content-Type":g.typeFull}});r(v);return}let d=(s.protocol==="https:"?bS.default:_S.default).request,{signal:p}=i,m=null,y=o(()=>{let g=new Ea("The operation was aborted.");n(g),i.body&&i.body instanceof er.default.Readable&&i.body.destroy(g),!(!m||!m.body)&&m.body.emit("error",g)},"abort");if(p&&p.aborted){y();return}let h=o(()=>{y(),l()},"abortAndFinalize"),f=d(s.toString(),c);p&&p.addEventListener("abort",h);let l=o(()=>{f.abort(),p&&p.removeEventListener("abort",h)},"finalize");f.on("error",g=>{n(new zt(`request to ${i.url} failed, reason: ${g.message}`,"system",g)),l()}),F$(f,g=>{m&&m.body&&m.body.destroy(g)}),process.version<"v14"&&f.on("socket",g=>{let v;g.prependListener("end",()=>{v=g._eventsCount}),g.prependListener("close",E=>{if(m&&v<g._eventsCount&&!E){let b=new Error("Premature close");b.code="ERR_STREAM_PREMATURE_CLOSE",m.body.emit("error",b)}})}),f.on("response",g=>{f.setTimeout(0);let v=nS(g.rawHeaders);if(_a(g.statusCode)){let J=v.get("Location"),Z=null;try{Z=J===null?null:new URL(J,i.url)}catch{if(i.redirect!=="manual"){n(new zt(`uri requested responds with an invalid redirect URL: ${J}`,"invalid-redirect")),l();return}}switch(i.redirect){case"error":n(new zt(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),l();return;case"manual":break;case"follow":{if(Z===null)break;if(i.counter>=i.follow){n(new zt(`maximum redirect reached at: ${i.url}`,"max-redirect")),l();return}let H={headers:new Gt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:ii(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!jE(i.url,Z)||!FE(i.url,Z))for(let te of["authorization","www-authenticate","cookie","cookie2"])H.headers.delete(te);if(g.statusCode!==303&&i.body&&e.body instanceof er.default.Readable){n(new zt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),l();return}(g.statusCode===303||(g.statusCode===301||g.statusCode===302)&&i.method==="POST")&&(H.method="GET",H.body=void 0,H.headers.delete("content-length"));let K=fS(v);K&&(H.referrerPolicy=K),r(cp(new Kn(Z,H))),l();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}p&&g.once("end",()=>{p.removeEventListener("abort",h)});let E=(0,er.pipeline)(g,new er.PassThrough,J=>{J&&n(J)});process.version<"v12.10"&&g.on("aborted",h);let b={url:i.url,status:g.statusCode,statusText:g.statusMessage,headers:v,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},C=v.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||C===null||g.statusCode===204||g.statusCode===304){m=new Qt(E,b),r(m);return}let U={flush:vo.default.Z_SYNC_FLUSH,finishFlush:vo.default.Z_SYNC_FLUSH};if(C==="gzip"||C==="x-gzip"){E=(0,er.pipeline)(E,vo.default.createGunzip(U),J=>{J&&n(J)}),m=new Qt(E,b),r(m);return}if(C==="deflate"||C==="x-deflate"){let J=(0,er.pipeline)(g,new er.PassThrough,Z=>{Z&&n(Z)});J.once("data",Z=>{(Z[0]&15)===8?E=(0,er.pipeline)(E,vo.default.createInflate(),H=>{H&&n(H)}):E=(0,er.pipeline)(E,vo.default.createInflateRaw(),H=>{H&&n(H)}),m=new Qt(E,b),r(m)}),J.once("end",()=>{m||(m=new Qt(E,b),r(m))});return}if(C==="br"){E=(0,er.pipeline)(E,vo.default.createBrotliDecompress(),J=>{J&&n(J)}),m=new Qt(E,b),r(m);return}m=new Qt(E,b),r(m)}),rS(f,i).catch(n)})}function F$(t,e){let r=Sa.Buffer.from(`0\r
|
|
26
26
|
\r
|
|
27
|
-
`),n=!1,i=!1,s;t.on("response",c=>{let{headers:d}=c;n=d["transfer-encoding"]==="chunked"&&!d["content-length"]}),t.on("socket",c=>{let d=o(()=>{if(n&&!i){let m=new Error("Premature close");m.code="ERR_STREAM_PREMATURE_CLOSE",e(m)}},"onSocketClose"),p=o(m=>{i=Sa.Buffer.compare(m.slice(-5),r)===0,!i&&s&&(i=Sa.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&Sa.Buffer.compare(m.slice(-2),r.slice(3))===0),s=m},"onData");c.prependListener("close",d),c.on("data",p),t.on("close",()=>{c.removeListener("close",d),c.removeListener("data",p)})})}var
|
|
27
|
+
`),n=!1,i=!1,s;t.on("response",c=>{let{headers:d}=c;n=d["transfer-encoding"]==="chunked"&&!d["content-length"]}),t.on("socket",c=>{let d=o(()=>{if(n&&!i){let m=new Error("Premature close");m.code="ERR_STREAM_PREMATURE_CLOSE",e(m)}},"onSocketClose"),p=o(m=>{i=Sa.Buffer.compare(m.slice(-5),r)===0,!i&&s&&(i=Sa.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&Sa.Buffer.compare(m.slice(-2),r.slice(3))===0),s=m},"onData");c.prependListener("close",d),c.on("data",p),t.on("close",()=>{c.removeListener("close",d),c.removeListener("data",p)})})}var _S,bS,vo,er,Sa,j$,SS=Tt(()=>{_S=qe(require("node:http"),1),bS=qe(require("node:https"),1),vo=qe(require("node:zlib"),1),er=qe(require("node:stream"),1),Sa=require("node:buffer");CE();Ru();oS();Ou();yS();Qd();vS();sp();Eu();Tu();up();rp();j$=new Set(["data:","http:","https:"]);o(cp,"fetch");o(F$,"fixResponseChunkedTransferBadEnding")});var PS=D(ui=>{"use strict";var q$=ui&&ui.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},si;Object.defineProperty(ui,"__esModule",{value:!0});ui.Gaxios=void 0;var B$=q$(pa()),V$=require("https"),_o=Ld(),G$=nE(),wS=require("stream"),TS=qd(),H$=o(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),W$=204,ku=class{static{o(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new TS.GaxiosInterceptorManager,response:new TS.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&&si.mergeHeaders(s,r.headers),n&&si.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 si.#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=_o.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new _o.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof _o.GaxiosError?n=r:r instanceof Error?n=new _o.GaxiosError(r.message,e,void 0,r):n=new _o.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:i,config:s}=await(0,G$.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===W$)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new _o.GaxiosError("Response's `Content-Length` is over the limit.",e,Object.assign(r,{config:e}));switch(e.responseType){case"stream":return r.body;case"json":{let n=await r.text();try{return JSON.parse(n)}catch{return n}}case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"text":return r.text();default:return this.getResponseDataFromContentType(r)}}#e(e,r=[]){let n=new URL(e),i=[...r],s=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let c of s)i.push(c.trim());for(let c of i)if(c instanceof RegExp){if(c.test(n.toString()))return!1}else if(c instanceof URL){if(c.origin===n.origin)return!1}else if(c.startsWith("*.")||c.startsWith(".")){let d=c.replace(/^\*\./,".");if(n.hostname.endsWith(d))return!1}else if(c===n.origin||c===n.hostname||c===n.href)return!1;return!0}async#t(e){let r=Promise.resolve(e);for(let n of this.interceptors.request.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#r(e){let r=Promise.resolve(e);for(let n of this.interceptors.response.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#n(e){let r=new Headers(this.defaults.headers);si.mergeHeaders(r,e.headers);let n=(0,B$.default)(!0,{},this.defaults,e);if(!n.url)throw new Error("URL is required.");if(n.baseURL&&(n.url=new URL(n.url,n.baseURL)),n.url=new URL(n.url),n.params)if(n.paramsSerializer){let c=n.paramsSerializer(n.params);c.startsWith("?")&&(c=c.slice(1));let d=n.url.toString().includes("?")?"&":"?";n.url=n.url+d+c}else{let c=n.url instanceof URL?n.url:new URL(n.url);for(let[d,p]of new URLSearchParams(n.params))c.searchParams.append(d,p);n.url=c}typeof e.maxContentLength=="number"&&(n.size=e.maxContentLength),typeof e.maxRedirects=="number"&&(n.follow=e.maxRedirects);let i=typeof n.data=="string"||n.data instanceof ArrayBuffer||n.data instanceof Blob||globalThis.File&&n.data instanceof File||n.data instanceof FormData||n.data instanceof wS.Readable||n.data instanceof ReadableStream||n.data instanceof String||n.data instanceof URLSearchParams||ArrayBuffer.isView(n.data)||["Blob","File","FormData"].includes(n.data?.constructor?.name||"");if(n.multipart?.length){let c=await H$();r.set("content-type",`multipart/related; boundary=${c}`),n.body=wS.Readable.from(this.getMultipartRequest(n.multipart,c))}else i?n.body=n.data:typeof n.data=="object"?r.get("Content-Type")==="application/x-www-form-urlencoded"?n.body=n.paramsSerializer?n.paramsSerializer(n.data):new URLSearchParams(n.data):(r.has("content-type")||r.set("content-type","application/json"),n.body=JSON.stringify(n.data)):n.data&&(n.body=n.data);n.validateStatus=n.validateStatus||this.validateStatus,n.responseType=n.responseType||"unknown",!r.has("accept")&&n.responseType==="json"&&r.set("accept","application/json");let s=n.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!n.agent)if(s&&this.#e(n.url,n.noProxy)){let c=await si.#s();this.agentCache.has(s)?n.agent=this.agentCache.get(s):(n.agent=new c(s,{cert:n.cert,key:n.key}),this.agentCache.set(s,n.agent))}else n.cert&&n.key&&(this.agentCache.has(n.key)?n.agent=this.agentCache.get(n.key):(n.agent=new V$.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=_o.defaultErrorRedactor),n.body&&!("duplex"in n)&&(n.duplex="half"),this.#o(n),Object.assign(n,{headers:r,url:n.url instanceof URL?n.url:new URL(n.url)})}#o(e){if(e.timeout){let r=AbortSignal.timeout(e.timeout);e.signal&&!e.signal.aborted?e.signal=AbortSignal.any([e.signal,r]):e.signal=r}}validateStatus(e){return e>=200&&e<300}async getResponseDataFromContentType(e){let r=e.headers.get("Content-Type");if(r===null)return e.text();if(r=r.toLowerCase(),r.includes("application/json")){let n=await e.text();try{n=JSON.parse(n)}catch{}return n}else return r.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,r){let n=`--${r}--`;for(let i of e){let s=i.headers.get("Content-Type")||"application/octet-stream";yield`--${r}\r
|
|
28
28
|
Content-Type: ${s}\r
|
|
29
29
|
\r
|
|
30
30
|
`,typeof i.content=="string"?yield i.content:yield*i.content,yield`\r
|
|
31
|
-
`}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>qe(AE()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(ES(),bS))).default,this.#a}static mergeHeaders(e,...r){e=e instanceof Headers?e:new Headers(e);for(let n of r)(n instanceof Headers?n:new Headers(n)).forEach((s,c)=>{c==="set-cookie"?e.append(c,s):e.set(c,s)});return e}};ui.Gaxios=ku;si=ku});var ht=D(Ut=>{"use strict";var H$=Ut&&Ut.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),W$=Ut&&Ut.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&H$(e,t,r)};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.instance=Ut.Gaxios=Ut.GaxiosError=void 0;Ut.request=K$;var PS=TS();Object.defineProperty(Ut,"Gaxios",{enumerable:!0,get:o(function(){return PS.Gaxios},"get")});var Z$=Ld();Object.defineProperty(Ut,"GaxiosError",{enumerable:!0,get:o(function(){return Z$.GaxiosError},"get")});W$(qd(),Ut);Ut.instance=new PS.Gaxios;async function K$(t){return Ut.instance.request(t)}o(K$,"request")});var lp=D((xS,$u)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,s="[BigNumber Error] ",c=s+"Number primitive has more than 15 significant digits: ",d=1e14,p=14,m=9007199254740991,y=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],h=1e7,f=1e9;function l(W){var H,K,te,Q=ee.prototype={constructor:ee,toString:null,valueOf:null},xe=new ee(1),re=20,V=4,B=-7,X=21,Y=-1e7,ie=1e7,ue=!1,Ce=1,De=0,Ke={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},et="0123456789abcdefghijklmnopqrstuvwxyz",wt=!0;function ee(S,P){var x,z,R,$,j,I,O,M,N=this;if(!(N instanceof ee))return new ee(S,P);if(P==null){if(S&&S._isBigNumber===!0){N.s=S.s,!S.c||S.e>ie?N.c=N.e=null:S.e<Y?N.c=[N.e=0]:(N.e=S.e,N.c=S.c.slice());return}if((I=typeof S=="number")&&S*0==0){if(N.s=1/S<0?(S=-S,-1):1,S===~~S){for($=0,j=S;j>=10;j/=10,$++);$>ie?N.c=N.e=null:(N.e=$,N.c=[S]);return}M=String(S)}else{if(!r.test(M=String(S)))return te(N,M,I);N.s=M.charCodeAt(0)==45?(M=M.slice(1),-1):1}($=M.indexOf("."))>-1&&(M=M.replace(".","")),(j=M.search(/e/i))>0?($<0&&($=j),$+=+M.slice(j+1),M=M.substring(0,j)):$<0&&($=M.length)}else{if(b(P,2,et.length,"Base"),P==10&&wt)return N=new ee(S),We(N,re+N.e+1,V);if(M=String(S),I=typeof S=="number"){if(S*0!=0)return te(N,M,I,P);if(N.s=1/S<0?(M=M.slice(1),-1):1,ee.DEBUG&&M.replace(/^0\.0*|\./,"").length>15)throw Error(c+S)}else N.s=M.charCodeAt(0)===45?(M=M.slice(1),-1):1;for(x=et.slice(0,P),$=j=0,O=M.length;j<O;j++)if(x.indexOf(z=M.charAt(j))<0){if(z=="."){if(j>$){$=O;continue}}else if(!R&&(M==M.toUpperCase()&&(M=M.toLowerCase())||M==M.toLowerCase()&&(M=M.toUpperCase()))){R=!0,j=-1,$=0;continue}return te(N,String(S),I,P)}I=!1,M=K(M,P,10,N.s),($=M.indexOf("."))>-1?M=M.replace(".",""):$=M.length}for(j=0;M.charCodeAt(j)===48;j++);for(O=M.length;M.charCodeAt(--O)===48;);if(M=M.slice(j,++O)){if(O-=j,I&&ee.DEBUG&&O>15&&(S>m||S!==i(S)))throw Error(c+N.s*S);if(($=$-j-1)>ie)N.c=N.e=null;else if($<Y)N.c=[N.e=0];else{if(N.e=$,N.c=[],j=($+1)%p,$<0&&(j+=p),j<O){for(j&&N.c.push(+M.slice(0,j)),O-=p;j<O;)N.c.push(+M.slice(j,j+=p));j=p-(M=M.slice(j)).length}else j-=O;for(;j--;M+="0");N.c.push(+M)}}else N.c=[N.e=0]}o(ee,"BigNumber"),ee.clone=l,ee.ROUND_UP=0,ee.ROUND_DOWN=1,ee.ROUND_CEIL=2,ee.ROUND_FLOOR=3,ee.ROUND_HALF_UP=4,ee.ROUND_HALF_DOWN=5,ee.ROUND_HALF_EVEN=6,ee.ROUND_HALF_CEIL=7,ee.ROUND_HALF_FLOOR=8,ee.EUCLID=9,ee.config=ee.set=function(S){var P,x;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(P="DECIMAL_PLACES")&&(x=S[P],b(x,0,f,P),re=x),S.hasOwnProperty(P="ROUNDING_MODE")&&(x=S[P],b(x,0,8,P),V=x),S.hasOwnProperty(P="EXPONENTIAL_AT")&&(x=S[P],x&&x.pop?(b(x[0],-f,0,P),b(x[1],0,f,P),B=x[0],X=x[1]):(b(x,-f,f,P),B=-(X=x<0?-x:x))),S.hasOwnProperty(P="RANGE"))if(x=S[P],x&&x.pop)b(x[0],-f,-1,P),b(x[1],1,f,P),Y=x[0],ie=x[1];else if(b(x,-f,f,P),x)Y=-(ie=x<0?-x:x);else throw Error(s+P+" cannot be zero: "+x);if(S.hasOwnProperty(P="CRYPTO"))if(x=S[P],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ue=x;else throw ue=!x,Error(s+"crypto unavailable");else ue=x;else throw Error(s+P+" not true or false: "+x);if(S.hasOwnProperty(P="MODULO_MODE")&&(x=S[P],b(x,0,9,P),Ce=x),S.hasOwnProperty(P="POW_PRECISION")&&(x=S[P],b(x,0,f,P),De=x),S.hasOwnProperty(P="FORMAT"))if(x=S[P],typeof x=="object")Ke=x;else throw Error(s+P+" not an object: "+x);if(S.hasOwnProperty(P="ALPHABET"))if(x=S[P],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))wt=x.slice(0,10)=="0123456789",et=x;else throw Error(s+P+" invalid: "+x)}else throw Error(s+"Object expected: "+S);return{DECIMAL_PLACES:re,ROUNDING_MODE:V,EXPONENTIAL_AT:[B,X],RANGE:[Y,ie],CRYPTO:ue,MODULO_MODE:Ce,POW_PRECISION:De,FORMAT:Ke,ALPHABET:et}},ee.isBigNumber=function(S){if(!S||S._isBigNumber!==!0)return!1;if(!ee.DEBUG)return!0;var P,x,z=S.c,R=S.e,$=S.s;e:if({}.toString.call(z)=="[object Array]"){if(($===1||$===-1)&&R>=-f&&R<=f&&R===i(R)){if(z[0]===0){if(R===0&&z.length===1)return!0;break e}if(P=(R+1)%p,P<1&&(P+=p),String(z[0]).length==P){for(P=0;P<z.length;P++)if(x=z[P],x<0||x>=d||x!==i(x))break e;if(x!==0)return!0}}}else if(z===null&&R===null&&($===null||$===1||$===-1))return!0;throw Error(s+"Invalid BigNumber: "+S)},ee.maximum=ee.max=function(){return mt(arguments,-1)},ee.minimum=ee.min=function(){return mt(arguments,1)},ee.random=(function(){var S=9007199254740992,P=Math.random()*S&2097151?function(){return i(Math.random()*S)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var z,R,$,j,I,O=0,M=[],N=new ee(xe);if(x==null?x=re:b(x,0,f),j=n(x/p),ue)if(crypto.getRandomValues){for(z=crypto.getRandomValues(new Uint32Array(j*=2));O<j;)I=z[O]*131072+(z[O+1]>>>11),I>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),z[O]=R[0],z[O+1]=R[1]):(M.push(I%1e14),O+=2);O=j/2}else if(crypto.randomBytes){for(z=crypto.randomBytes(j*=7);O<j;)I=(z[O]&31)*281474976710656+z[O+1]*1099511627776+z[O+2]*4294967296+z[O+3]*16777216+(z[O+4]<<16)+(z[O+5]<<8)+z[O+6],I>=9e15?crypto.randomBytes(7).copy(z,O):(M.push(I%1e14),O+=7);O=j/7}else throw ue=!1,Error(s+"crypto unavailable");if(!ue)for(;O<j;)I=P(),I<9e15&&(M[O++]=I%1e14);for(j=M[--O],x%=p,j&&x&&(I=y[p-x],M[O]=i(j/I)*I);M[O]===0;M.pop(),O--);if(O<0)M=[$=0];else{for($=-1;M[0]===0;M.splice(0,1),$-=p);for(O=1,I=M[0];I>=10;I/=10,O++);O<p&&($-=p-O)}return N.e=$,N.c=M,N}})(),ee.sum=function(){for(var S=1,P=arguments,x=new ee(P[0]);S<P.length;)x=x.plus(P[S++]);return x},K=(function(){var S="0123456789";function P(x,z,R,$){for(var j,I=[0],O,M=0,N=x.length;M<N;){for(O=I.length;O--;I[O]*=z);for(I[0]+=$.indexOf(x.charAt(M++)),j=0;j<I.length;j++)I[j]>R-1&&(I[j+1]==null&&(I[j+1]=0),I[j+1]+=I[j]/R|0,I[j]%=R)}return I.reverse()}return o(P,"toBaseOut"),function(x,z,R,$,j){var I,O,M,N,G,ce,pe,Fe,ot=x.indexOf("."),at=re,je=V;for(ot>=0&&(N=De,De=0,x=x.replace(".",""),Fe=new ee(z),ce=Fe.pow(x.length-ot),De=N,Fe.c=P(J(v(ce.c),ce.e,"0"),10,R,S),Fe.e=Fe.c.length),pe=P(x,z,R,j?(I=et,S):(I=S,et)),M=N=pe.length;pe[--N]==0;pe.pop());if(!pe[0])return I.charAt(0);if(ot<0?--M:(ce.c=pe,ce.e=M,ce.s=$,ce=H(ce,Fe,at,je,R),pe=ce.c,G=ce.r,M=ce.e),O=M+at+1,ot=pe[O],N=R/2,G=G||O<0||pe[O+1]!=null,G=je<4?(ot!=null||G)&&(je==0||je==(ce.s<0?3:2)):ot>N||ot==N&&(je==4||G||je==6&&pe[O-1]&1||je==(ce.s<0?8:7)),O<1||!pe[0])x=G?J(I.charAt(1),-at,I.charAt(0)):I.charAt(0);else{if(pe.length=O,G)for(--R;++pe[--O]>R;)pe[O]=0,O||(++M,pe=[1].concat(pe));for(N=pe.length;!pe[--N];);for(ot=0,x="";ot<=N;x+=I.charAt(pe[ot++]));x=J(x,M,I.charAt(0))}return x}})(),H=(function(){function S(z,R,$){var j,I,O,M,N=0,G=z.length,ce=R%h,pe=R/h|0;for(z=z.slice();G--;)O=z[G]%h,M=z[G]/h|0,j=pe*O+M*ce,I=ce*O+j%h*h+N,N=(I/$|0)+(j/h|0)+pe*M,z[G]=I%$;return N&&(z=[N].concat(z)),z}o(S,"multiply");function P(z,R,$,j){var I,O;if($!=j)O=$>j?1:-1;else for(I=O=0;I<$;I++)if(z[I]!=R[I]){O=z[I]>R[I]?1:-1;break}return O}o(P,"compare");function x(z,R,$,j){for(var I=0;$--;)z[$]-=I,I=z[$]<R[$]?1:0,z[$]=I*j+z[$]-R[$];for(;!z[0]&&z.length>1;z.splice(0,1));}return o(x,"subtract"),function(z,R,$,j,I){var O,M,N,G,ce,pe,Fe,ot,at,je,Ge,bt,Io,Ro,Co,Wt,rn,Rt=z.s==R.s?1:-1,Et=z.c,Xe=R.c;if(!Et||!Et[0]||!Xe||!Xe[0])return new ee(!z.s||!R.s||(Et?Xe&&Et[0]==Xe[0]:!Xe)?NaN:Et&&Et[0]==0||!Xe?Rt*0:Rt/0);for(ot=new ee(Rt),at=ot.c=[],M=z.e-R.e,Rt=$+M+1,I||(I=d,M=g(z.e/p)-g(R.e/p),Rt=Rt/p|0),N=0;Xe[N]==(Et[N]||0);N++);if(Xe[N]>(Et[N]||0)&&M--,Rt<0)at.push(1),G=!0;else{for(Ro=Et.length,Wt=Xe.length,N=0,Rt+=2,ce=i(I/(Xe[0]+1)),ce>1&&(Xe=S(Xe,ce,I),Et=S(Et,ce,I),Wt=Xe.length,Ro=Et.length),Io=Wt,je=Et.slice(0,Wt),Ge=je.length;Ge<Wt;je[Ge++]=0);rn=Xe.slice(),rn=[0].concat(rn),Co=Xe[0],Xe[1]>=I/2&&Co++;do{if(ce=0,O=P(Xe,je,Wt,Ge),O<0){if(bt=je[0],Wt!=Ge&&(bt=bt*I+(je[1]||0)),ce=i(bt/Co),ce>1)for(ce>=I&&(ce=I-1),pe=S(Xe,ce,I),Fe=pe.length,Ge=je.length;P(pe,je,Fe,Ge)==1;)ce--,x(pe,Wt<Fe?rn:Xe,Fe,I),Fe=pe.length,O=1;else ce==0&&(O=ce=1),pe=Xe.slice(),Fe=pe.length;if(Fe<Ge&&(pe=[0].concat(pe)),x(je,pe,Ge,I),Ge=je.length,O==-1)for(;P(Xe,je,Wt,Ge)<1;)ce++,x(je,Wt<Ge?rn:Xe,Ge,I),Ge=je.length}else O===0&&(ce++,je=[0]);at[N++]=ce,je[0]?je[Ge++]=Et[Io]||0:(je=[Et[Io]],Ge=1)}while((Io++<Ro||je[0]!=null)&&Rt--);G=je[0]!=null,at[0]||at.splice(0,1)}if(I==d){for(N=1,Rt=at[0];Rt>=10;Rt/=10,N++);We(ot,$+(ot.e=N+M*p-1)+1,j,G)}else ot.e=M,ot.r=+G;return ot}})();function lt(S,P,x,z){var R,$,j,I,O;if(x==null?x=V:b(x,0,8),!S.c)return S.toString();if(R=S.c[0],j=S.e,P==null)O=v(S.c),O=z==1||z==2&&(j<=B||j>=X)?U(O,j):J(O,j,"0");else if(S=We(new ee(S),P,x),$=S.e,O=v(S.c),I=O.length,z==1||z==2&&(P<=$||$<=B)){for(;I<P;O+="0",I++);O=U(O,$)}else if(P-=j+(z===2&&$>j),O=J(O,$,"0"),$+1>I){if(--P>0)for(O+=".";P--;O+="0");}else if(P+=$-I,P>0)for($+1==I&&(O+=".");P--;O+="0");return S.s<0&&R?"-"+O:O}o(lt,"format");function mt(S,P){for(var x,z,R=1,$=new ee(S[0]);R<S.length;R++)z=new ee(S[R]),(!z.s||(x=E($,z))===P||x===0&&$.s===P)&&($=z);return $}o(mt,"maxOrMin");function Ht(S,P,x){for(var z=1,R=P.length;!P[--R];P.pop());for(R=P[0];R>=10;R/=10,z++);return(x=z+x*p-1)>ie?S.c=S.e=null:x<Y?S.c=[S.e=0]:(S.e=x,S.c=P),S}o(Ht,"normalise"),te=(function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,x=/^\.([^.]+)$/,z=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,j,I,O){var M,N=I?j:j.replace(R,"");if(z.test(N))$.s=isNaN(N)?null:N<0?-1:1;else{if(!I&&(N=N.replace(S,function(G,ce,pe){return M=(pe=pe.toLowerCase())=="x"?16:pe=="b"?2:8,!O||O==M?ce:G}),O&&(M=O,N=N.replace(P,"$1").replace(x,"0.$1")),j!=N))return new ee(N,M);if(ee.DEBUG)throw Error(s+"Not a"+(O?" base "+O:"")+" number: "+j);$.s=null}$.c=$.e=null}})();function We(S,P,x,z){var R,$,j,I,O,M,N,G=S.c,ce=y;if(G){e:{for(R=1,I=G[0];I>=10;I/=10,R++);if($=P-R,$<0)$+=p,j=P,O=G[M=0],N=i(O/ce[R-j-1]%10);else if(M=n(($+1)/p),M>=G.length)if(z){for(;G.length<=M;G.push(0));O=N=0,R=1,$%=p,j=$-p+1}else break e;else{for(O=I=G[M],R=1;I>=10;I/=10,R++);$%=p,j=$-p+R,N=j<0?0:i(O/ce[R-j-1]%10)}if(z=z||P<0||G[M+1]!=null||(j<0?O:O%ce[R-j-1]),z=x<4?(N||z)&&(x==0||x==(S.s<0?3:2)):N>5||N==5&&(x==4||z||x==6&&($>0?j>0?O/ce[R-j]:0:G[M-1])%10&1||x==(S.s<0?8:7)),P<1||!G[0])return G.length=0,z?(P-=S.e+1,G[0]=ce[(p-P%p)%p],S.e=-P||0):G[0]=S.e=0,S;if($==0?(G.length=M,I=1,M--):(G.length=M+1,I=ce[p-$],G[M]=j>0?i(O/ce[R-j]%ce[j])*I:0),z)for(;;)if(M==0){for($=1,j=G[0];j>=10;j/=10,$++);for(j=G[0]+=I,I=1;j>=10;j/=10,I++);$!=I&&(S.e++,G[0]==d&&(G[0]=1));break}else{if(G[M]+=I,G[M]!=d)break;G[M--]=0,I=1}for($=G.length;G[--$]===0;G.pop());}S.e>ie?S.c=S.e=null:S.e<Y&&(S.c=[S.e=0])}return S}o(We,"round");function Ye(S){var P,x=S.e;return x===null?S.toString():(P=v(S.c),P=x<=B||x>=X?U(P,x):J(P,x,"0"),S.s<0?"-"+P:P)}return o(Ye,"valueOf"),Q.absoluteValue=Q.abs=function(){var S=new ee(this);return S.s<0&&(S.s=1),S},Q.comparedTo=function(S,P){return E(this,new ee(S,P))},Q.decimalPlaces=Q.dp=function(S,P){var x,z,R,$=this;if(S!=null)return b(S,0,f),P==null?P=V:b(P,0,8),We(new ee($),S+$.e+1,P);if(!(x=$.c))return null;if(z=((R=x.length-1)-g(this.e/p))*p,R=x[R])for(;R%10==0;R/=10,z--);return z<0&&(z=0),z},Q.dividedBy=Q.div=function(S,P){return H(this,new ee(S,P),re,V)},Q.dividedToIntegerBy=Q.idiv=function(S,P){return H(this,new ee(S,P),0,1)},Q.exponentiatedBy=Q.pow=function(S,P){var x,z,R,$,j,I,O,M,N,G=this;if(S=new ee(S),S.c&&!S.isInteger())throw Error(s+"Exponent not an integer: "+Ye(S));if(P!=null&&(P=new ee(P)),I=S.e>14,!G.c||!G.c[0]||G.c[0]==1&&!G.e&&G.c.length==1||!S.c||!S.c[0])return N=new ee(Math.pow(+Ye(G),I?S.s*(2-C(S)):+Ye(S))),P?N.mod(P):N;if(O=S.s<0,P){if(P.c?!P.c[0]:!P.s)return new ee(NaN);z=!O&&G.isInteger()&&P.isInteger(),z&&(G=G.mod(P))}else{if(S.e>9&&(G.e>0||G.e<-1||(G.e==0?G.c[0]>1||I&&G.c[1]>=24e7:G.c[0]<8e13||I&&G.c[0]<=9999975e7)))return $=G.s<0&&C(S)?-0:0,G.e>-1&&($=1/$),new ee(O?1/$:$);De&&($=n(De/p+2))}for(I?(x=new ee(.5),O&&(S.s=1),M=C(S)):(R=Math.abs(+Ye(S)),M=R%2),N=new ee(xe);;){if(M){if(N=N.times(G),!N.c)break;$?N.c.length>$&&(N.c.length=$):z&&(N=N.mod(P))}if(R){if(R=i(R/2),R===0)break;M=R%2}else if(S=S.times(x),We(S,S.e+1,1),S.e>14)M=C(S);else{if(R=+Ye(S),R===0)break;M=R%2}G=G.times(G),$?G.c&&G.c.length>$&&(G.c.length=$):z&&(G=G.mod(P))}return z?N:(O&&(N=xe.div(N)),P?N.mod(P):$?We(N,De,V,j):N)},Q.integerValue=function(S){var P=new ee(this);return S==null?S=V:b(S,0,8),We(P,P.e+1,S)},Q.isEqualTo=Q.eq=function(S,P){return E(this,new ee(S,P))===0},Q.isFinite=function(){return!!this.c},Q.isGreaterThan=Q.gt=function(S,P){return E(this,new ee(S,P))>0},Q.isGreaterThanOrEqualTo=Q.gte=function(S,P){return(P=E(this,new ee(S,P)))===1||P===0},Q.isInteger=function(){return!!this.c&&g(this.e/p)>this.c.length-2},Q.isLessThan=Q.lt=function(S,P){return E(this,new ee(S,P))<0},Q.isLessThanOrEqualTo=Q.lte=function(S,P){return(P=E(this,new ee(S,P)))===-1||P===0},Q.isNaN=function(){return!this.s},Q.isNegative=function(){return this.s<0},Q.isPositive=function(){return this.s>0},Q.isZero=function(){return!!this.c&&this.c[0]==0},Q.minus=function(S,P){var x,z,R,$,j=this,I=j.s;if(S=new ee(S,P),P=S.s,!I||!P)return new ee(NaN);if(I!=P)return S.s=-P,j.plus(S);var O=j.e/p,M=S.e/p,N=j.c,G=S.c;if(!O||!M){if(!N||!G)return N?(S.s=-P,S):new ee(G?j:NaN);if(!N[0]||!G[0])return G[0]?(S.s=-P,S):new ee(N[0]?j:V==3?-0:0)}if(O=g(O),M=g(M),N=N.slice(),I=O-M){for(($=I<0)?(I=-I,R=N):(M=O,R=G),R.reverse(),P=I;P--;R.push(0));R.reverse()}else for(z=($=(I=N.length)<(P=G.length))?I:P,I=P=0;P<z;P++)if(N[P]!=G[P]){$=N[P]<G[P];break}if($&&(R=N,N=G,G=R,S.s=-S.s),P=(z=G.length)-(x=N.length),P>0)for(;P--;N[x++]=0);for(P=d-1;z>I;){if(N[--z]<G[z]){for(x=z;x&&!N[--x];N[x]=P);--N[x],N[z]+=d}N[z]-=G[z]}for(;N[0]==0;N.splice(0,1),--M);return N[0]?Ht(S,N,M):(S.s=V==3?-1:1,S.c=[S.e=0],S)},Q.modulo=Q.mod=function(S,P){var x,z,R=this;return S=new ee(S,P),!R.c||!S.s||S.c&&!S.c[0]?new ee(NaN):!S.c||R.c&&!R.c[0]?new ee(R):(Ce==9?(z=S.s,S.s=1,x=H(R,S,0,3),S.s=z,x.s*=z):x=H(R,S,0,Ce),S=R.minus(x.times(S)),!S.c[0]&&Ce==1&&(S.s=R.s),S)},Q.multipliedBy=Q.times=function(S,P){var x,z,R,$,j,I,O,M,N,G,ce,pe,Fe,ot,at,je=this,Ge=je.c,bt=(S=new ee(S,P)).c;if(!Ge||!bt||!Ge[0]||!bt[0])return!je.s||!S.s||Ge&&!Ge[0]&&!bt||bt&&!bt[0]&&!Ge?S.c=S.e=S.s=null:(S.s*=je.s,!Ge||!bt?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(z=g(je.e/p)+g(S.e/p),S.s*=je.s,O=Ge.length,G=bt.length,O<G&&(Fe=Ge,Ge=bt,bt=Fe,R=O,O=G,G=R),R=O+G,Fe=[];R--;Fe.push(0));for(ot=d,at=h,R=G;--R>=0;){for(x=0,ce=bt[R]%at,pe=bt[R]/at|0,j=O,$=R+j;$>R;)M=Ge[--j]%at,N=Ge[j]/at|0,I=pe*M+N*ce,M=ce*M+I%at*at+Fe[$]+x,x=(M/ot|0)+(I/at|0)+pe*N,Fe[$--]=M%ot;Fe[$]=x}return x?++z:Fe.splice(0,1),Ht(S,Fe,z)},Q.negated=function(){var S=new ee(this);return S.s=-S.s||null,S},Q.plus=function(S,P){var x,z=this,R=z.s;if(S=new ee(S,P),P=S.s,!R||!P)return new ee(NaN);if(R!=P)return S.s=-P,z.minus(S);var $=z.e/p,j=S.e/p,I=z.c,O=S.c;if(!$||!j){if(!I||!O)return new ee(R/0);if(!I[0]||!O[0])return O[0]?S:new ee(I[0]?z:R*0)}if($=g($),j=g(j),I=I.slice(),R=$-j){for(R>0?(j=$,x=O):(R=-R,x=I),x.reverse();R--;x.push(0));x.reverse()}for(R=I.length,P=O.length,R-P<0&&(x=O,O=I,I=x,P=R),R=0;P;)R=(I[--P]=I[P]+O[P]+R)/d|0,I[P]=d===I[P]?0:I[P]%d;return R&&(I=[R].concat(I),++j),Ht(S,I,j)},Q.precision=Q.sd=function(S,P){var x,z,R,$=this;if(S!=null&&S!==!!S)return b(S,1,f),P==null?P=V:b(P,0,8),We(new ee($),S,P);if(!(x=$.c))return null;if(R=x.length-1,z=R*p+1,R=x[R]){for(;R%10==0;R/=10,z--);for(R=x[0];R>=10;R/=10,z++);}return S&&$.e+1>z&&(z=$.e+1),z},Q.shiftedBy=function(S){return b(S,-m,m),this.times("1e"+S)},Q.squareRoot=Q.sqrt=function(){var S,P,x,z,R,$=this,j=$.c,I=$.s,O=$.e,M=re+4,N=new ee("0.5");if(I!==1||!j||!j[0])return new ee(!I||I<0&&(!j||j[0])?NaN:j?$:1/0);if(I=Math.sqrt(+Ye($)),I==0||I==1/0?(P=v(j),(P.length+O)%2==0&&(P+="0"),I=Math.sqrt(+P),O=g((O+1)/2)-(O<0||O%2),I==1/0?P="5e"+O:(P=I.toExponential(),P=P.slice(0,P.indexOf("e")+1)+O),x=new ee(P)):x=new ee(I+""),x.c[0]){for(O=x.e,I=O+M,I<3&&(I=0);;)if(R=x,x=N.times(R.plus(H($,R,M,1))),v(R.c).slice(0,I)===(P=v(x.c)).slice(0,I))if(x.e<O&&--I,P=P.slice(I-3,I+1),P=="9999"||!z&&P=="4999"){if(!z&&(We(R,R.e+re+2,0),R.times(R).eq($))){x=R;break}M+=4,I+=4,z=1}else{(!+P||!+P.slice(1)&&P.charAt(0)=="5")&&(We(x,x.e+re+2,1),S=!x.times(x).eq($));break}}return We(x,x.e+re+1,V,S)},Q.toExponential=function(S,P){return S!=null&&(b(S,0,f),S++),lt(this,S,P,1)},Q.toFixed=function(S,P){return S!=null&&(b(S,0,f),S=S+this.e+1),lt(this,S,P)},Q.toFormat=function(S,P,x){var z,R=this;if(x==null)S!=null&&P&&typeof P=="object"?(x=P,P=null):S&&typeof S=="object"?(x=S,S=P=null):x=Ke;else if(typeof x!="object")throw Error(s+"Argument not an object: "+x);if(z=R.toFixed(S,P),R.c){var $,j=z.split("."),I=+x.groupSize,O=+x.secondaryGroupSize,M=x.groupSeparator||"",N=j[0],G=j[1],ce=R.s<0,pe=ce?N.slice(1):N,Fe=pe.length;if(O&&($=I,I=O,O=$,Fe-=$),I>0&&Fe>0){for($=Fe%I||I,N=pe.substr(0,$);$<Fe;$+=I)N+=M+pe.substr($,I);O>0&&(N+=M+pe.slice($)),ce&&(N="-"+N)}z=G?N+(x.decimalSeparator||"")+((O=+x.fractionGroupSize)?G.replace(new RegExp("\\d{"+O+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):G):N}return(x.prefix||"")+z+(x.suffix||"")},Q.toFraction=function(S){var P,x,z,R,$,j,I,O,M,N,G,ce,pe=this,Fe=pe.c;if(S!=null&&(I=new ee(S),!I.isInteger()&&(I.c||I.s!==1)||I.lt(xe)))throw Error(s+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+Ye(I));if(!Fe)return new ee(pe);for(P=new ee(xe),M=x=new ee(xe),z=O=new ee(xe),ce=v(Fe),$=P.e=ce.length-pe.e-1,P.c[0]=y[(j=$%p)<0?p+j:j],S=!S||I.comparedTo(P)>0?$>0?P:M:I,j=ie,ie=1/0,I=new ee(ce),O.c[0]=0;N=H(I,P,0,1),R=x.plus(N.times(z)),R.comparedTo(S)!=1;)x=z,z=R,M=O.plus(N.times(R=M)),O=R,P=I.minus(N.times(R=P)),I=R;return R=H(S.minus(x),z,0,1),O=O.plus(R.times(M)),x=x.plus(R.times(z)),O.s=M.s=pe.s,$=$*2,G=H(M,z,$,V).minus(pe).abs().comparedTo(H(O,x,$,V).minus(pe).abs())<1?[M,z]:[O,x],ie=j,G},Q.toNumber=function(){return+Ye(this)},Q.toPrecision=function(S,P){return S!=null&&b(S,1,f),lt(this,S,P,2)},Q.toString=function(S){var P,x=this,z=x.s,R=x.e;return R===null?z?(P="Infinity",z<0&&(P="-"+P)):P="NaN":(S==null?P=R<=B||R>=X?U(v(x.c),R):J(v(x.c),R,"0"):S===10&&wt?(x=We(new ee(x),re+R+1,V),P=J(v(x.c),x.e,"0")):(b(S,2,et.length,"Base"),P=K(J(v(x.c),R,"0"),10,S,z,!0)),z<0&&x.c[0]&&(P="-"+P)),P},Q.valueOf=Q.toJSON=function(){return Ye(this)},Q._isBigNumber=!0,W!=null&&ee.set(W),ee}o(l,"clone");function g(W){var H=W|0;return W>0||W===H?H:H-1}o(g,"bitFloor");function v(W){for(var H,K,te=1,Q=W.length,xe=W[0]+"";te<Q;){for(H=W[te++]+"",K=p-H.length;K--;H="0"+H);xe+=H}for(Q=xe.length;xe.charCodeAt(--Q)===48;);return xe.slice(0,Q+1||1)}o(v,"coeffToString");function E(W,H){var K,te,Q=W.c,xe=H.c,re=W.s,V=H.s,B=W.e,X=H.e;if(!re||!V)return null;if(K=Q&&!Q[0],te=xe&&!xe[0],K||te)return K?te?0:-V:re;if(re!=V)return re;if(K=re<0,te=B==X,!Q||!xe)return te?0:!Q^K?1:-1;if(!te)return B>X^K?1:-1;for(V=(B=Q.length)<(X=xe.length)?B:X,re=0;re<V;re++)if(Q[re]!=xe[re])return Q[re]>xe[re]^K?1:-1;return B==X?0:B>X^K?1:-1}o(E,"compare");function b(W,H,K,te){if(W<H||W>K||W!==i(W))throw Error(s+(te||"Argument")+(typeof W=="number"?W<H||W>K?" out of range: ":" not an integer: ":" not a primitive number: ")+String(W))}o(b,"intCheck");function C(W){var H=W.c.length-1;return g(W.e/p)==H&&W.c[H]%2!=0}o(C,"isOdd");function U(W,H){return(W.length>1?W.charAt(0)+"."+W.slice(1):W)+(H<0?"e":"e+")+H}o(U,"toExponential");function J(W,H,K){var te,Q;if(H<0){for(Q=K+".";++H;Q+=K);W=Q+W}else if(te=W.length,++H>te){for(Q=K,H-=te;--H;Q+=K);W+=Q}else H<te&&(W=W.slice(0,H)+"."+W.slice(H));return W}o(J,"toFixedPoint"),e=l(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof $u<"u"&&$u.exports?$u.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(xS)});var CS=D((sX,RS)=>{var AS=lp(),IS=RS.exports;(function(){"use strict";function t(m){return m<10?"0"+m:m}o(t,"f");var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;function d(m){return r.lastIndex=0,r.test(m)?'"'+m.replace(r,function(y){var h=s[y];return typeof h=="string"?h:"\\u"+("0000"+y.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+m+'"'}o(d,"quote");function p(m,y){var h,f,l,g,v=n,E,b=y[m],C=b!=null&&(b instanceof AS||AS.isBigNumber(b));switch(b&&typeof b=="object"&&typeof b.toJSON=="function"&&(b=b.toJSON(m)),typeof c=="function"&&(b=c.call(y,m,b)),typeof b){case"string":return C?b:d(b);case"number":return isFinite(b)?String(b):"null";case"boolean":case"null":case"bigint":return String(b);case"object":if(!b)return"null";if(n+=i,E=[],Object.prototype.toString.apply(b)==="[object Array]"){for(g=b.length,h=0;h<g;h+=1)E[h]=p(h,b)||"null";return l=E.length===0?"[]":n?`[
|
|
31
|
+
`}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>qe(IE()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(SS(),ES))).default,this.#a}static mergeHeaders(e,...r){e=e instanceof Headers?e:new Headers(e);for(let n of r)(n instanceof Headers?n:new Headers(n)).forEach((s,c)=>{c==="set-cookie"?e.append(c,s):e.set(c,s)});return e}};ui.Gaxios=ku;si=ku});var ht=D(Ut=>{"use strict";var Z$=Ut&&Ut.__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]})),K$=Ut&&Ut.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Z$(e,t,r)};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.instance=Ut.Gaxios=Ut.GaxiosError=void 0;Ut.request=Y$;var xS=PS();Object.defineProperty(Ut,"Gaxios",{enumerable:!0,get:o(function(){return xS.Gaxios},"get")});var J$=Ld();Object.defineProperty(Ut,"GaxiosError",{enumerable:!0,get:o(function(){return J$.GaxiosError},"get")});K$(qd(),Ut);Ut.instance=new xS.Gaxios;async function Y$(t){return Ut.instance.request(t)}o(Y$,"request")});var lp=D((AS,$u)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,s="[BigNumber Error] ",c=s+"Number primitive has more than 15 significant digits: ",d=1e14,p=14,m=9007199254740991,y=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],h=1e7,f=1e9;function l(Z){var H,K,te,Q=ee.prototype={constructor:ee,toString:null,valueOf:null},xe=new ee(1),re=20,V=4,B=-7,X=21,Y=-1e7,ie=1e7,ue=!1,Ce=1,De=0,Ke={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},et="0123456789abcdefghijklmnopqrstuvwxyz",wt=!0;function ee(S,P){var x,z,R,$,j,I,O,M,N=this;if(!(N instanceof ee))return new ee(S,P);if(P==null){if(S&&S._isBigNumber===!0){N.s=S.s,!S.c||S.e>ie?N.c=N.e=null:S.e<Y?N.c=[N.e=0]:(N.e=S.e,N.c=S.c.slice());return}if((I=typeof S=="number")&&S*0==0){if(N.s=1/S<0?(S=-S,-1):1,S===~~S){for($=0,j=S;j>=10;j/=10,$++);$>ie?N.c=N.e=null:(N.e=$,N.c=[S]);return}M=String(S)}else{if(!r.test(M=String(S)))return te(N,M,I);N.s=M.charCodeAt(0)==45?(M=M.slice(1),-1):1}($=M.indexOf("."))>-1&&(M=M.replace(".","")),(j=M.search(/e/i))>0?($<0&&($=j),$+=+M.slice(j+1),M=M.substring(0,j)):$<0&&($=M.length)}else{if(b(P,2,et.length,"Base"),P==10&&wt)return N=new ee(S),We(N,re+N.e+1,V);if(M=String(S),I=typeof S=="number"){if(S*0!=0)return te(N,M,I,P);if(N.s=1/S<0?(M=M.slice(1),-1):1,ee.DEBUG&&M.replace(/^0\.0*|\./,"").length>15)throw Error(c+S)}else N.s=M.charCodeAt(0)===45?(M=M.slice(1),-1):1;for(x=et.slice(0,P),$=j=0,O=M.length;j<O;j++)if(x.indexOf(z=M.charAt(j))<0){if(z=="."){if(j>$){$=O;continue}}else if(!R&&(M==M.toUpperCase()&&(M=M.toLowerCase())||M==M.toLowerCase()&&(M=M.toUpperCase()))){R=!0,j=-1,$=0;continue}return te(N,String(S),I,P)}I=!1,M=K(M,P,10,N.s),($=M.indexOf("."))>-1?M=M.replace(".",""):$=M.length}for(j=0;M.charCodeAt(j)===48;j++);for(O=M.length;M.charCodeAt(--O)===48;);if(M=M.slice(j,++O)){if(O-=j,I&&ee.DEBUG&&O>15&&(S>m||S!==i(S)))throw Error(c+N.s*S);if(($=$-j-1)>ie)N.c=N.e=null;else if($<Y)N.c=[N.e=0];else{if(N.e=$,N.c=[],j=($+1)%p,$<0&&(j+=p),j<O){for(j&&N.c.push(+M.slice(0,j)),O-=p;j<O;)N.c.push(+M.slice(j,j+=p));j=p-(M=M.slice(j)).length}else j-=O;for(;j--;M+="0");N.c.push(+M)}}else N.c=[N.e=0]}o(ee,"BigNumber"),ee.clone=l,ee.ROUND_UP=0,ee.ROUND_DOWN=1,ee.ROUND_CEIL=2,ee.ROUND_FLOOR=3,ee.ROUND_HALF_UP=4,ee.ROUND_HALF_DOWN=5,ee.ROUND_HALF_EVEN=6,ee.ROUND_HALF_CEIL=7,ee.ROUND_HALF_FLOOR=8,ee.EUCLID=9,ee.config=ee.set=function(S){var P,x;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(P="DECIMAL_PLACES")&&(x=S[P],b(x,0,f,P),re=x),S.hasOwnProperty(P="ROUNDING_MODE")&&(x=S[P],b(x,0,8,P),V=x),S.hasOwnProperty(P="EXPONENTIAL_AT")&&(x=S[P],x&&x.pop?(b(x[0],-f,0,P),b(x[1],0,f,P),B=x[0],X=x[1]):(b(x,-f,f,P),B=-(X=x<0?-x:x))),S.hasOwnProperty(P="RANGE"))if(x=S[P],x&&x.pop)b(x[0],-f,-1,P),b(x[1],1,f,P),Y=x[0],ie=x[1];else if(b(x,-f,f,P),x)Y=-(ie=x<0?-x:x);else throw Error(s+P+" cannot be zero: "+x);if(S.hasOwnProperty(P="CRYPTO"))if(x=S[P],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ue=x;else throw ue=!x,Error(s+"crypto unavailable");else ue=x;else throw Error(s+P+" not true or false: "+x);if(S.hasOwnProperty(P="MODULO_MODE")&&(x=S[P],b(x,0,9,P),Ce=x),S.hasOwnProperty(P="POW_PRECISION")&&(x=S[P],b(x,0,f,P),De=x),S.hasOwnProperty(P="FORMAT"))if(x=S[P],typeof x=="object")Ke=x;else throw Error(s+P+" not an object: "+x);if(S.hasOwnProperty(P="ALPHABET"))if(x=S[P],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))wt=x.slice(0,10)=="0123456789",et=x;else throw Error(s+P+" invalid: "+x)}else throw Error(s+"Object expected: "+S);return{DECIMAL_PLACES:re,ROUNDING_MODE:V,EXPONENTIAL_AT:[B,X],RANGE:[Y,ie],CRYPTO:ue,MODULO_MODE:Ce,POW_PRECISION:De,FORMAT:Ke,ALPHABET:et}},ee.isBigNumber=function(S){if(!S||S._isBigNumber!==!0)return!1;if(!ee.DEBUG)return!0;var P,x,z=S.c,R=S.e,$=S.s;e:if({}.toString.call(z)=="[object Array]"){if(($===1||$===-1)&&R>=-f&&R<=f&&R===i(R)){if(z[0]===0){if(R===0&&z.length===1)return!0;break e}if(P=(R+1)%p,P<1&&(P+=p),String(z[0]).length==P){for(P=0;P<z.length;P++)if(x=z[P],x<0||x>=d||x!==i(x))break e;if(x!==0)return!0}}}else if(z===null&&R===null&&($===null||$===1||$===-1))return!0;throw Error(s+"Invalid BigNumber: "+S)},ee.maximum=ee.max=function(){return mt(arguments,-1)},ee.minimum=ee.min=function(){return mt(arguments,1)},ee.random=(function(){var S=9007199254740992,P=Math.random()*S&2097151?function(){return i(Math.random()*S)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var z,R,$,j,I,O=0,M=[],N=new ee(xe);if(x==null?x=re:b(x,0,f),j=n(x/p),ue)if(crypto.getRandomValues){for(z=crypto.getRandomValues(new Uint32Array(j*=2));O<j;)I=z[O]*131072+(z[O+1]>>>11),I>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),z[O]=R[0],z[O+1]=R[1]):(M.push(I%1e14),O+=2);O=j/2}else if(crypto.randomBytes){for(z=crypto.randomBytes(j*=7);O<j;)I=(z[O]&31)*281474976710656+z[O+1]*1099511627776+z[O+2]*4294967296+z[O+3]*16777216+(z[O+4]<<16)+(z[O+5]<<8)+z[O+6],I>=9e15?crypto.randomBytes(7).copy(z,O):(M.push(I%1e14),O+=7);O=j/7}else throw ue=!1,Error(s+"crypto unavailable");if(!ue)for(;O<j;)I=P(),I<9e15&&(M[O++]=I%1e14);for(j=M[--O],x%=p,j&&x&&(I=y[p-x],M[O]=i(j/I)*I);M[O]===0;M.pop(),O--);if(O<0)M=[$=0];else{for($=-1;M[0]===0;M.splice(0,1),$-=p);for(O=1,I=M[0];I>=10;I/=10,O++);O<p&&($-=p-O)}return N.e=$,N.c=M,N}})(),ee.sum=function(){for(var S=1,P=arguments,x=new ee(P[0]);S<P.length;)x=x.plus(P[S++]);return x},K=(function(){var S="0123456789";function P(x,z,R,$){for(var j,I=[0],O,M=0,N=x.length;M<N;){for(O=I.length;O--;I[O]*=z);for(I[0]+=$.indexOf(x.charAt(M++)),j=0;j<I.length;j++)I[j]>R-1&&(I[j+1]==null&&(I[j+1]=0),I[j+1]+=I[j]/R|0,I[j]%=R)}return I.reverse()}return o(P,"toBaseOut"),function(x,z,R,$,j){var I,O,M,N,G,ce,pe,Fe,it=x.indexOf("."),at=re,je=V;for(it>=0&&(N=De,De=0,x=x.replace(".",""),Fe=new ee(z),ce=Fe.pow(x.length-it),De=N,Fe.c=P(J(v(ce.c),ce.e,"0"),10,R,S),Fe.e=Fe.c.length),pe=P(x,z,R,j?(I=et,S):(I=S,et)),M=N=pe.length;pe[--N]==0;pe.pop());if(!pe[0])return I.charAt(0);if(it<0?--M:(ce.c=pe,ce.e=M,ce.s=$,ce=H(ce,Fe,at,je,R),pe=ce.c,G=ce.r,M=ce.e),O=M+at+1,it=pe[O],N=R/2,G=G||O<0||pe[O+1]!=null,G=je<4?(it!=null||G)&&(je==0||je==(ce.s<0?3:2)):it>N||it==N&&(je==4||G||je==6&&pe[O-1]&1||je==(ce.s<0?8:7)),O<1||!pe[0])x=G?J(I.charAt(1),-at,I.charAt(0)):I.charAt(0);else{if(pe.length=O,G)for(--R;++pe[--O]>R;)pe[O]=0,O||(++M,pe=[1].concat(pe));for(N=pe.length;!pe[--N];);for(it=0,x="";it<=N;x+=I.charAt(pe[it++]));x=J(x,M,I.charAt(0))}return x}})(),H=(function(){function S(z,R,$){var j,I,O,M,N=0,G=z.length,ce=R%h,pe=R/h|0;for(z=z.slice();G--;)O=z[G]%h,M=z[G]/h|0,j=pe*O+M*ce,I=ce*O+j%h*h+N,N=(I/$|0)+(j/h|0)+pe*M,z[G]=I%$;return N&&(z=[N].concat(z)),z}o(S,"multiply");function P(z,R,$,j){var I,O;if($!=j)O=$>j?1:-1;else for(I=O=0;I<$;I++)if(z[I]!=R[I]){O=z[I]>R[I]?1:-1;break}return O}o(P,"compare");function x(z,R,$,j){for(var I=0;$--;)z[$]-=I,I=z[$]<R[$]?1:0,z[$]=I*j+z[$]-R[$];for(;!z[0]&&z.length>1;z.splice(0,1));}return o(x,"subtract"),function(z,R,$,j,I){var O,M,N,G,ce,pe,Fe,it,at,je,He,bt,Io,Ro,Co,Wt,rn,Rt=z.s==R.s?1:-1,Et=z.c,Xe=R.c;if(!Et||!Et[0]||!Xe||!Xe[0])return new ee(!z.s||!R.s||(Et?Xe&&Et[0]==Xe[0]:!Xe)?NaN:Et&&Et[0]==0||!Xe?Rt*0:Rt/0);for(it=new ee(Rt),at=it.c=[],M=z.e-R.e,Rt=$+M+1,I||(I=d,M=g(z.e/p)-g(R.e/p),Rt=Rt/p|0),N=0;Xe[N]==(Et[N]||0);N++);if(Xe[N]>(Et[N]||0)&&M--,Rt<0)at.push(1),G=!0;else{for(Ro=Et.length,Wt=Xe.length,N=0,Rt+=2,ce=i(I/(Xe[0]+1)),ce>1&&(Xe=S(Xe,ce,I),Et=S(Et,ce,I),Wt=Xe.length,Ro=Et.length),Io=Wt,je=Et.slice(0,Wt),He=je.length;He<Wt;je[He++]=0);rn=Xe.slice(),rn=[0].concat(rn),Co=Xe[0],Xe[1]>=I/2&&Co++;do{if(ce=0,O=P(Xe,je,Wt,He),O<0){if(bt=je[0],Wt!=He&&(bt=bt*I+(je[1]||0)),ce=i(bt/Co),ce>1)for(ce>=I&&(ce=I-1),pe=S(Xe,ce,I),Fe=pe.length,He=je.length;P(pe,je,Fe,He)==1;)ce--,x(pe,Wt<Fe?rn:Xe,Fe,I),Fe=pe.length,O=1;else ce==0&&(O=ce=1),pe=Xe.slice(),Fe=pe.length;if(Fe<He&&(pe=[0].concat(pe)),x(je,pe,He,I),He=je.length,O==-1)for(;P(Xe,je,Wt,He)<1;)ce++,x(je,Wt<He?rn:Xe,He,I),He=je.length}else O===0&&(ce++,je=[0]);at[N++]=ce,je[0]?je[He++]=Et[Io]||0:(je=[Et[Io]],He=1)}while((Io++<Ro||je[0]!=null)&&Rt--);G=je[0]!=null,at[0]||at.splice(0,1)}if(I==d){for(N=1,Rt=at[0];Rt>=10;Rt/=10,N++);We(it,$+(it.e=N+M*p-1)+1,j,G)}else it.e=M,it.r=+G;return it}})();function lt(S,P,x,z){var R,$,j,I,O;if(x==null?x=V:b(x,0,8),!S.c)return S.toString();if(R=S.c[0],j=S.e,P==null)O=v(S.c),O=z==1||z==2&&(j<=B||j>=X)?U(O,j):J(O,j,"0");else if(S=We(new ee(S),P,x),$=S.e,O=v(S.c),I=O.length,z==1||z==2&&(P<=$||$<=B)){for(;I<P;O+="0",I++);O=U(O,$)}else if(P-=j+(z===2&&$>j),O=J(O,$,"0"),$+1>I){if(--P>0)for(O+=".";P--;O+="0");}else if(P+=$-I,P>0)for($+1==I&&(O+=".");P--;O+="0");return S.s<0&&R?"-"+O:O}o(lt,"format");function mt(S,P){for(var x,z,R=1,$=new ee(S[0]);R<S.length;R++)z=new ee(S[R]),(!z.s||(x=E($,z))===P||x===0&&$.s===P)&&($=z);return $}o(mt,"maxOrMin");function Ht(S,P,x){for(var z=1,R=P.length;!P[--R];P.pop());for(R=P[0];R>=10;R/=10,z++);return(x=z+x*p-1)>ie?S.c=S.e=null:x<Y?S.c=[S.e=0]:(S.e=x,S.c=P),S}o(Ht,"normalise"),te=(function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,x=/^\.([^.]+)$/,z=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,j,I,O){var M,N=I?j:j.replace(R,"");if(z.test(N))$.s=isNaN(N)?null:N<0?-1:1;else{if(!I&&(N=N.replace(S,function(G,ce,pe){return M=(pe=pe.toLowerCase())=="x"?16:pe=="b"?2:8,!O||O==M?ce:G}),O&&(M=O,N=N.replace(P,"$1").replace(x,"0.$1")),j!=N))return new ee(N,M);if(ee.DEBUG)throw Error(s+"Not a"+(O?" base "+O:"")+" number: "+j);$.s=null}$.c=$.e=null}})();function We(S,P,x,z){var R,$,j,I,O,M,N,G=S.c,ce=y;if(G){e:{for(R=1,I=G[0];I>=10;I/=10,R++);if($=P-R,$<0)$+=p,j=P,O=G[M=0],N=i(O/ce[R-j-1]%10);else if(M=n(($+1)/p),M>=G.length)if(z){for(;G.length<=M;G.push(0));O=N=0,R=1,$%=p,j=$-p+1}else break e;else{for(O=I=G[M],R=1;I>=10;I/=10,R++);$%=p,j=$-p+R,N=j<0?0:i(O/ce[R-j-1]%10)}if(z=z||P<0||G[M+1]!=null||(j<0?O:O%ce[R-j-1]),z=x<4?(N||z)&&(x==0||x==(S.s<0?3:2)):N>5||N==5&&(x==4||z||x==6&&($>0?j>0?O/ce[R-j]:0:G[M-1])%10&1||x==(S.s<0?8:7)),P<1||!G[0])return G.length=0,z?(P-=S.e+1,G[0]=ce[(p-P%p)%p],S.e=-P||0):G[0]=S.e=0,S;if($==0?(G.length=M,I=1,M--):(G.length=M+1,I=ce[p-$],G[M]=j>0?i(O/ce[R-j]%ce[j])*I:0),z)for(;;)if(M==0){for($=1,j=G[0];j>=10;j/=10,$++);for(j=G[0]+=I,I=1;j>=10;j/=10,I++);$!=I&&(S.e++,G[0]==d&&(G[0]=1));break}else{if(G[M]+=I,G[M]!=d)break;G[M--]=0,I=1}for($=G.length;G[--$]===0;G.pop());}S.e>ie?S.c=S.e=null:S.e<Y&&(S.c=[S.e=0])}return S}o(We,"round");function Ye(S){var P,x=S.e;return x===null?S.toString():(P=v(S.c),P=x<=B||x>=X?U(P,x):J(P,x,"0"),S.s<0?"-"+P:P)}return o(Ye,"valueOf"),Q.absoluteValue=Q.abs=function(){var S=new ee(this);return S.s<0&&(S.s=1),S},Q.comparedTo=function(S,P){return E(this,new ee(S,P))},Q.decimalPlaces=Q.dp=function(S,P){var x,z,R,$=this;if(S!=null)return b(S,0,f),P==null?P=V:b(P,0,8),We(new ee($),S+$.e+1,P);if(!(x=$.c))return null;if(z=((R=x.length-1)-g(this.e/p))*p,R=x[R])for(;R%10==0;R/=10,z--);return z<0&&(z=0),z},Q.dividedBy=Q.div=function(S,P){return H(this,new ee(S,P),re,V)},Q.dividedToIntegerBy=Q.idiv=function(S,P){return H(this,new ee(S,P),0,1)},Q.exponentiatedBy=Q.pow=function(S,P){var x,z,R,$,j,I,O,M,N,G=this;if(S=new ee(S),S.c&&!S.isInteger())throw Error(s+"Exponent not an integer: "+Ye(S));if(P!=null&&(P=new ee(P)),I=S.e>14,!G.c||!G.c[0]||G.c[0]==1&&!G.e&&G.c.length==1||!S.c||!S.c[0])return N=new ee(Math.pow(+Ye(G),I?S.s*(2-C(S)):+Ye(S))),P?N.mod(P):N;if(O=S.s<0,P){if(P.c?!P.c[0]:!P.s)return new ee(NaN);z=!O&&G.isInteger()&&P.isInteger(),z&&(G=G.mod(P))}else{if(S.e>9&&(G.e>0||G.e<-1||(G.e==0?G.c[0]>1||I&&G.c[1]>=24e7:G.c[0]<8e13||I&&G.c[0]<=9999975e7)))return $=G.s<0&&C(S)?-0:0,G.e>-1&&($=1/$),new ee(O?1/$:$);De&&($=n(De/p+2))}for(I?(x=new ee(.5),O&&(S.s=1),M=C(S)):(R=Math.abs(+Ye(S)),M=R%2),N=new ee(xe);;){if(M){if(N=N.times(G),!N.c)break;$?N.c.length>$&&(N.c.length=$):z&&(N=N.mod(P))}if(R){if(R=i(R/2),R===0)break;M=R%2}else if(S=S.times(x),We(S,S.e+1,1),S.e>14)M=C(S);else{if(R=+Ye(S),R===0)break;M=R%2}G=G.times(G),$?G.c&&G.c.length>$&&(G.c.length=$):z&&(G=G.mod(P))}return z?N:(O&&(N=xe.div(N)),P?N.mod(P):$?We(N,De,V,j):N)},Q.integerValue=function(S){var P=new ee(this);return S==null?S=V:b(S,0,8),We(P,P.e+1,S)},Q.isEqualTo=Q.eq=function(S,P){return E(this,new ee(S,P))===0},Q.isFinite=function(){return!!this.c},Q.isGreaterThan=Q.gt=function(S,P){return E(this,new ee(S,P))>0},Q.isGreaterThanOrEqualTo=Q.gte=function(S,P){return(P=E(this,new ee(S,P)))===1||P===0},Q.isInteger=function(){return!!this.c&&g(this.e/p)>this.c.length-2},Q.isLessThan=Q.lt=function(S,P){return E(this,new ee(S,P))<0},Q.isLessThanOrEqualTo=Q.lte=function(S,P){return(P=E(this,new ee(S,P)))===-1||P===0},Q.isNaN=function(){return!this.s},Q.isNegative=function(){return this.s<0},Q.isPositive=function(){return this.s>0},Q.isZero=function(){return!!this.c&&this.c[0]==0},Q.minus=function(S,P){var x,z,R,$,j=this,I=j.s;if(S=new ee(S,P),P=S.s,!I||!P)return new ee(NaN);if(I!=P)return S.s=-P,j.plus(S);var O=j.e/p,M=S.e/p,N=j.c,G=S.c;if(!O||!M){if(!N||!G)return N?(S.s=-P,S):new ee(G?j:NaN);if(!N[0]||!G[0])return G[0]?(S.s=-P,S):new ee(N[0]?j:V==3?-0:0)}if(O=g(O),M=g(M),N=N.slice(),I=O-M){for(($=I<0)?(I=-I,R=N):(M=O,R=G),R.reverse(),P=I;P--;R.push(0));R.reverse()}else for(z=($=(I=N.length)<(P=G.length))?I:P,I=P=0;P<z;P++)if(N[P]!=G[P]){$=N[P]<G[P];break}if($&&(R=N,N=G,G=R,S.s=-S.s),P=(z=G.length)-(x=N.length),P>0)for(;P--;N[x++]=0);for(P=d-1;z>I;){if(N[--z]<G[z]){for(x=z;x&&!N[--x];N[x]=P);--N[x],N[z]+=d}N[z]-=G[z]}for(;N[0]==0;N.splice(0,1),--M);return N[0]?Ht(S,N,M):(S.s=V==3?-1:1,S.c=[S.e=0],S)},Q.modulo=Q.mod=function(S,P){var x,z,R=this;return S=new ee(S,P),!R.c||!S.s||S.c&&!S.c[0]?new ee(NaN):!S.c||R.c&&!R.c[0]?new ee(R):(Ce==9?(z=S.s,S.s=1,x=H(R,S,0,3),S.s=z,x.s*=z):x=H(R,S,0,Ce),S=R.minus(x.times(S)),!S.c[0]&&Ce==1&&(S.s=R.s),S)},Q.multipliedBy=Q.times=function(S,P){var x,z,R,$,j,I,O,M,N,G,ce,pe,Fe,it,at,je=this,He=je.c,bt=(S=new ee(S,P)).c;if(!He||!bt||!He[0]||!bt[0])return!je.s||!S.s||He&&!He[0]&&!bt||bt&&!bt[0]&&!He?S.c=S.e=S.s=null:(S.s*=je.s,!He||!bt?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(z=g(je.e/p)+g(S.e/p),S.s*=je.s,O=He.length,G=bt.length,O<G&&(Fe=He,He=bt,bt=Fe,R=O,O=G,G=R),R=O+G,Fe=[];R--;Fe.push(0));for(it=d,at=h,R=G;--R>=0;){for(x=0,ce=bt[R]%at,pe=bt[R]/at|0,j=O,$=R+j;$>R;)M=He[--j]%at,N=He[j]/at|0,I=pe*M+N*ce,M=ce*M+I%at*at+Fe[$]+x,x=(M/it|0)+(I/at|0)+pe*N,Fe[$--]=M%it;Fe[$]=x}return x?++z:Fe.splice(0,1),Ht(S,Fe,z)},Q.negated=function(){var S=new ee(this);return S.s=-S.s||null,S},Q.plus=function(S,P){var x,z=this,R=z.s;if(S=new ee(S,P),P=S.s,!R||!P)return new ee(NaN);if(R!=P)return S.s=-P,z.minus(S);var $=z.e/p,j=S.e/p,I=z.c,O=S.c;if(!$||!j){if(!I||!O)return new ee(R/0);if(!I[0]||!O[0])return O[0]?S:new ee(I[0]?z:R*0)}if($=g($),j=g(j),I=I.slice(),R=$-j){for(R>0?(j=$,x=O):(R=-R,x=I),x.reverse();R--;x.push(0));x.reverse()}for(R=I.length,P=O.length,R-P<0&&(x=O,O=I,I=x,P=R),R=0;P;)R=(I[--P]=I[P]+O[P]+R)/d|0,I[P]=d===I[P]?0:I[P]%d;return R&&(I=[R].concat(I),++j),Ht(S,I,j)},Q.precision=Q.sd=function(S,P){var x,z,R,$=this;if(S!=null&&S!==!!S)return b(S,1,f),P==null?P=V:b(P,0,8),We(new ee($),S,P);if(!(x=$.c))return null;if(R=x.length-1,z=R*p+1,R=x[R]){for(;R%10==0;R/=10,z--);for(R=x[0];R>=10;R/=10,z++);}return S&&$.e+1>z&&(z=$.e+1),z},Q.shiftedBy=function(S){return b(S,-m,m),this.times("1e"+S)},Q.squareRoot=Q.sqrt=function(){var S,P,x,z,R,$=this,j=$.c,I=$.s,O=$.e,M=re+4,N=new ee("0.5");if(I!==1||!j||!j[0])return new ee(!I||I<0&&(!j||j[0])?NaN:j?$:1/0);if(I=Math.sqrt(+Ye($)),I==0||I==1/0?(P=v(j),(P.length+O)%2==0&&(P+="0"),I=Math.sqrt(+P),O=g((O+1)/2)-(O<0||O%2),I==1/0?P="5e"+O:(P=I.toExponential(),P=P.slice(0,P.indexOf("e")+1)+O),x=new ee(P)):x=new ee(I+""),x.c[0]){for(O=x.e,I=O+M,I<3&&(I=0);;)if(R=x,x=N.times(R.plus(H($,R,M,1))),v(R.c).slice(0,I)===(P=v(x.c)).slice(0,I))if(x.e<O&&--I,P=P.slice(I-3,I+1),P=="9999"||!z&&P=="4999"){if(!z&&(We(R,R.e+re+2,0),R.times(R).eq($))){x=R;break}M+=4,I+=4,z=1}else{(!+P||!+P.slice(1)&&P.charAt(0)=="5")&&(We(x,x.e+re+2,1),S=!x.times(x).eq($));break}}return We(x,x.e+re+1,V,S)},Q.toExponential=function(S,P){return S!=null&&(b(S,0,f),S++),lt(this,S,P,1)},Q.toFixed=function(S,P){return S!=null&&(b(S,0,f),S=S+this.e+1),lt(this,S,P)},Q.toFormat=function(S,P,x){var z,R=this;if(x==null)S!=null&&P&&typeof P=="object"?(x=P,P=null):S&&typeof S=="object"?(x=S,S=P=null):x=Ke;else if(typeof x!="object")throw Error(s+"Argument not an object: "+x);if(z=R.toFixed(S,P),R.c){var $,j=z.split("."),I=+x.groupSize,O=+x.secondaryGroupSize,M=x.groupSeparator||"",N=j[0],G=j[1],ce=R.s<0,pe=ce?N.slice(1):N,Fe=pe.length;if(O&&($=I,I=O,O=$,Fe-=$),I>0&&Fe>0){for($=Fe%I||I,N=pe.substr(0,$);$<Fe;$+=I)N+=M+pe.substr($,I);O>0&&(N+=M+pe.slice($)),ce&&(N="-"+N)}z=G?N+(x.decimalSeparator||"")+((O=+x.fractionGroupSize)?G.replace(new RegExp("\\d{"+O+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):G):N}return(x.prefix||"")+z+(x.suffix||"")},Q.toFraction=function(S){var P,x,z,R,$,j,I,O,M,N,G,ce,pe=this,Fe=pe.c;if(S!=null&&(I=new ee(S),!I.isInteger()&&(I.c||I.s!==1)||I.lt(xe)))throw Error(s+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+Ye(I));if(!Fe)return new ee(pe);for(P=new ee(xe),M=x=new ee(xe),z=O=new ee(xe),ce=v(Fe),$=P.e=ce.length-pe.e-1,P.c[0]=y[(j=$%p)<0?p+j:j],S=!S||I.comparedTo(P)>0?$>0?P:M:I,j=ie,ie=1/0,I=new ee(ce),O.c[0]=0;N=H(I,P,0,1),R=x.plus(N.times(z)),R.comparedTo(S)!=1;)x=z,z=R,M=O.plus(N.times(R=M)),O=R,P=I.minus(N.times(R=P)),I=R;return R=H(S.minus(x),z,0,1),O=O.plus(R.times(M)),x=x.plus(R.times(z)),O.s=M.s=pe.s,$=$*2,G=H(M,z,$,V).minus(pe).abs().comparedTo(H(O,x,$,V).minus(pe).abs())<1?[M,z]:[O,x],ie=j,G},Q.toNumber=function(){return+Ye(this)},Q.toPrecision=function(S,P){return S!=null&&b(S,1,f),lt(this,S,P,2)},Q.toString=function(S){var P,x=this,z=x.s,R=x.e;return R===null?z?(P="Infinity",z<0&&(P="-"+P)):P="NaN":(S==null?P=R<=B||R>=X?U(v(x.c),R):J(v(x.c),R,"0"):S===10&&wt?(x=We(new ee(x),re+R+1,V),P=J(v(x.c),x.e,"0")):(b(S,2,et.length,"Base"),P=K(J(v(x.c),R,"0"),10,S,z,!0)),z<0&&x.c[0]&&(P="-"+P)),P},Q.valueOf=Q.toJSON=function(){return Ye(this)},Q._isBigNumber=!0,Z!=null&&ee.set(Z),ee}o(l,"clone");function g(Z){var H=Z|0;return Z>0||Z===H?H:H-1}o(g,"bitFloor");function v(Z){for(var H,K,te=1,Q=Z.length,xe=Z[0]+"";te<Q;){for(H=Z[te++]+"",K=p-H.length;K--;H="0"+H);xe+=H}for(Q=xe.length;xe.charCodeAt(--Q)===48;);return xe.slice(0,Q+1||1)}o(v,"coeffToString");function E(Z,H){var K,te,Q=Z.c,xe=H.c,re=Z.s,V=H.s,B=Z.e,X=H.e;if(!re||!V)return null;if(K=Q&&!Q[0],te=xe&&!xe[0],K||te)return K?te?0:-V:re;if(re!=V)return re;if(K=re<0,te=B==X,!Q||!xe)return te?0:!Q^K?1:-1;if(!te)return B>X^K?1:-1;for(V=(B=Q.length)<(X=xe.length)?B:X,re=0;re<V;re++)if(Q[re]!=xe[re])return Q[re]>xe[re]^K?1:-1;return B==X?0:B>X^K?1:-1}o(E,"compare");function b(Z,H,K,te){if(Z<H||Z>K||Z!==i(Z))throw Error(s+(te||"Argument")+(typeof Z=="number"?Z<H||Z>K?" out of range: ":" not an integer: ":" not a primitive number: ")+String(Z))}o(b,"intCheck");function C(Z){var H=Z.c.length-1;return g(Z.e/p)==H&&Z.c[H]%2!=0}o(C,"isOdd");function U(Z,H){return(Z.length>1?Z.charAt(0)+"."+Z.slice(1):Z)+(H<0?"e":"e+")+H}o(U,"toExponential");function J(Z,H,K){var te,Q;if(H<0){for(Q=K+".";++H;Q+=K);Z=Q+Z}else if(te=Z.length,++H>te){for(Q=K,H-=te;--H;Q+=K);Z+=Q}else H<te&&(Z=Z.slice(0,H)+"."+Z.slice(H));return Z}o(J,"toFixedPoint"),e=l(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof $u<"u"&&$u.exports?$u.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(AS)});var OS=D((dX,CS)=>{var IS=lp(),RS=CS.exports;(function(){"use strict";function t(m){return m<10?"0"+m:m}o(t,"f");var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;function d(m){return r.lastIndex=0,r.test(m)?'"'+m.replace(r,function(y){var h=s[y];return typeof h=="string"?h:"\\u"+("0000"+y.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+m+'"'}o(d,"quote");function p(m,y){var h,f,l,g,v=n,E,b=y[m],C=b!=null&&(b instanceof IS||IS.isBigNumber(b));switch(b&&typeof b=="object"&&typeof b.toJSON=="function"&&(b=b.toJSON(m)),typeof c=="function"&&(b=c.call(y,m,b)),typeof b){case"string":return C?b:d(b);case"number":return isFinite(b)?String(b):"null";case"boolean":case"null":case"bigint":return String(b);case"object":if(!b)return"null";if(n+=i,E=[],Object.prototype.toString.apply(b)==="[object Array]"){for(g=b.length,h=0;h<g;h+=1)E[h]=p(h,b)||"null";return l=E.length===0?"[]":n?`[
|
|
32
32
|
`+n+E.join(`,
|
|
33
33
|
`+n)+`
|
|
34
34
|
`+v+"]":"["+E.join(",")+"]",n=v,l}if(c&&typeof c=="object")for(g=c.length,h=0;h<g;h+=1)typeof c[h]=="string"&&(f=c[h],l=p(f,b),l&&E.push(d(f)+(n?": ":":")+l));else Object.keys(b).forEach(function(U){var J=p(U,b);J&&E.push(d(U)+(n?": ":":")+J)});return l=E.length===0?"{}":n?`{
|
|
35
35
|
`+n+E.join(`,
|
|
36
36
|
`+n)+`
|
|
37
|
-
`+v+"}":"{"+E.join(",")+"}",n=v,l}}o(p,"str"),typeof
|
|
38
|
-
`,r:"\r",t:" "},s,c=o(function(v){throw{name:"SyntaxError",message:v,at:r,text:s}},"error"),d=o(function(v){return v&&v!==n&&c("Expected '"+v+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),p=o(function(){var v,E="";for(n==="-"&&(E="-",d("-"));n>="0"&&n<="9";)E+=n,d();if(n===".")for(E+=".";d()&&n>="0"&&n<="9";)E+=n;if(n==="e"||n==="E")for(E+=n,d(),(n==="-"||n==="+")&&(E+=n,d());n>="0"&&n<="9";)E+=n,d();if(v=+E,!isFinite(v))c("Bad number");else return Du==null&&(Du=lp()),E.length>15?e.storeAsString?E:e.useNativeBigInt?BigInt(E):new Du(E):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(v):new Du(v):v},"number"),m=o(function(){var v,E,b="",C;if(n==='"')for(var U=r;d();){if(n==='"')return r-1>U&&(b+=s.substring(U,r-1)),d(),b;if(n==="\\"){if(r-1>U&&(b+=s.substring(U,r-1)),d(),n==="u"){for(C=0,E=0;E<4&&(v=parseInt(d(),16),!!isFinite(v));E+=1)C=C*16+v;b+=String.fromCharCode(C)}else if(typeof i[n]=="string")b+=i[n];else break;U=r}}c("Bad string")},"string"),y=o(function(){for(;n&&n<=" ";)d()},"white"),h=o(function(){switch(n){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}c("Unexpected '"+n+"'")},"word"),f,l=o(function(){var v=[];if(n==="["){if(d("["),y(),n==="]")return d("]"),v;for(;n;){if(v.push(f()),y(),n==="]")return d("]"),v;d(","),y()}}c("Bad array")},"array"),g=o(function(){var v,E=Object.create(null);if(n==="{"){if(d("{"),y(),n==="}")return d("}"),E;for(;n;){if(v=m(),y(),d(":"),e.strict===!0&&Object.hasOwnProperty.call(E,v)&&c('Duplicate key "'+v+'"'),J$.test(v)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?f():E[v]=f():Y$.test(v)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?f():E[v]=f():E[v]=f(),y(),n==="}")return d("}"),E;d(","),y()}}c("Bad object")},"object");return f=o(function(){switch(y(),n){case"{":return g();case"[":return l();case'"':return m();case"-":return p();default:return n>="0"&&n<="9"?p():h()}},"value"),function(v,E){var b;return s=v+"",r=0,n=" ",b=f(),y(),n&&c("Syntax error"),typeof E=="function"?o((function C(U,J){var W,H,K=U[J];return K&&typeof K=="object"&&Object.keys(K).forEach(function(te){H=C(K,te),H!==void 0?K[te]=H:delete K[te]}),E.call(U,J,K)}),"walk")({"":b},""):b}},"json_parse");OS.exports=X$});var NS=D((dX,Nu)=>{var $S=CS().stringify,DS=kS();Nu.exports=function(t){return{parse:DS(t),stringify:$S}};Nu.exports.parse=DS();Nu.exports.stringify=$S});var dp=D(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.GCE_LINUX_BIOS_PATHS=void 0;Cr.isGoogleCloudServerless=MS;Cr.isGoogleComputeEngineLinux=LS;Cr.isGoogleComputeEngineMACAddress=jS;Cr.isGoogleComputeEngine=FS;Cr.detectGCPResidency=eD;var zS=require("fs"),US=require("os");Cr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var Q$=/^42:01/;function MS(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(MS,"isGoogleCloudServerless");function LS(){if((0,US.platform)()!=="linux")return!1;try{(0,zS.statSync)(Cr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,zS.readFileSync)(Cr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(LS,"isGoogleComputeEngineLinux");function jS(){let t=(0,US.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(Q$.test(r))return!0}return!1}o(jS,"isGoogleComputeEngineMACAddress");function FS(){return LS()||jS()}o(FS,"isGoogleComputeEngine");function eD(){return MS()||FS()}o(eD,"detectGCPResidency")});var qS=D(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.Colours=void 0;var $t=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="")}};zu.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 HS=D(Qe=>{"use strict";var tD=Qe&&Qe.__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]})),rD=Qe&&Qe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BS=Qe&&Qe.__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"&&tD(r,e,n[i]);return rD(r,e),r}})();Object.defineProperty(Qe,"__esModule",{value:!0});Qe.env=Qe.DebugLogBackendBase=Qe.placeholder=Qe.AdhocDebugLogger=Qe.LogSeverity=void 0;Qe.getNodeBackend=fp;Qe.getDebugBackend=oD;Qe.getStructuredBackend=iD;Qe.setBackend=aD;Qe.log=GS;var nD=require("events"),wa=BS(require("process")),VS=BS(require("util")),tr=qS(),Or;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Or||(Qe.LogSeverity=Or={}));var Ta=class extends nD.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(Or.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Or.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Or.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Or.ERROR,...n),this.func.sublog=n=>GS(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)}};Qe.AdhocDebugLogger=Ta;Qe.placeholder=new Ta("",()=>{}).func;var ci=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=wa.env[Qe.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)}}};Qe.DebugLogBackendBase=ci;var pp=class extends ci{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=`${tr.Colours.green}${e}${tr.Colours.reset}`,c=`${tr.Colours.yellow}${wa.pid}${tr.Colours.reset}`,d;switch(r.severity){case Or.ERROR:d=`${tr.Colours.red}${r.severity}${tr.Colours.reset}`;break;case Or.INFO:d=`${tr.Colours.magenta}${r.severity}${tr.Colours.reset}`;break;case Or.WARNING:d=`${tr.Colours.yellow}${r.severity}${tr.Colours.reset}`;break;default:d=(i=r.severity)!==null&&i!==void 0?i:Or.DEFAULT;break}let p=VS.formatWithOptions({colors:tr.Colours.enabled},...n),m=Object.assign({},r);delete m.severity;let y=Object.getOwnPropertyNames(m).length?JSON.stringify(m):"",h=y?`${tr.Colours.grey}${y}${tr.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,s,d,p,y?` ${h}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function fp(){return new pp}o(fp,"getNodeBackend");var mp=class extends ci{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 oD(t){return new mp(t)}o(oD,"getDebugBackend");var hp=class extends ci{static{o(this,"StructuredBackend")}constructor(e){var r;super(),this.upstream=(r=e)!==null&&r!==void 0?r:void 0}makeLogger(e){var r;let n=(r=this.upstream)===null||r===void 0?void 0:r.makeLogger(e);return(i,...s)=>{var c;let d=(c=i.severity)!==null&&c!==void 0?c:Or.INFO,p=Object.assign({severity:d,message:VS.format(...s)},i),m=JSON.stringify(p);n?n(i,m):console.log("%s",m)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function iD(t){return new hp(t)}o(iD,"getStructuredBackend");Qe.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var gp=new Map,rr;function aD(t){rr=t,gp.clear()}o(aD,"setBackend");function GS(t,e){if(!rr&&!wa.env[Qe.env.nodeEnables]||!t)return Qe.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=gp.get(t);if(r)return r.func;if(rr===null)return Qe.placeholder;rr===void 0&&(rr=fp());let n=(()=>{let i;return new Ta(t,(c,...d)=>{if(i!==rr){if(rr===null)return;rr===void 0&&(rr=fp()),i=rr}rr?.log(t,c,...d)})})();return gp.set(t,n),n.func}o(GS,"log")});var yp=D(bo=>{"use strict";var sD=bo&&bo.__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]})),uD=bo&&bo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sD(e,t,r)};Object.defineProperty(bo,"__esModule",{value:!0});uD(HS(),bo)});var xa=D(ye=>{"use strict";var ZS=ye&&ye.__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]})),cD=ye&&ye.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lD=ye&&ye.__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"&&ZS(r,e,n[i]);return cD(r,e),r}})(),dD=ye&&ye.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZS(e,t,r)};Object.defineProperty(ye,"__esModule",{value:!0});ye.gcpResidencyCache=ye.METADATA_SERVER_DETECTION=ye.HEADERS=ye.HEADER_VALUE=ye.HEADER_NAME=ye.SECONDARY_HOST_ADDRESS=ye.HOST_ADDRESS=ye.BASE_PATH=void 0;ye.instance=yD;ye.project=vD;ye.universe=_D;ye.bulk=bD;ye.isAvailable=SD;ye.resetIsAvailableCache=wD;ye.getGCPResidency=bp;ye.setGCPResidency=KS;ye.requestTimeout=JS;var vp=ht(),pD=NS(),fD=dp(),mD=lD(yp());ye.BASE_PATH="/computeMetadata/v1";ye.HOST_ADDRESS="http://169.254.169.254";ye.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";ye.HEADER_NAME="Metadata-Flavor";ye.HEADER_VALUE="Google";ye.HEADERS=Object.freeze({[ye.HEADER_NAME]:ye.HEADER_VALUE});var WS=mD.log("gcp-metadata");ye.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 _p(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||ye.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(ye.BASE_PATH,t).href}o(_p,"getBaseUrl");function hD(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(hD,"validate");async function Pa(t,e={},r=3,n=!1){let i=new Headers(ye.HEADERS),s="",c={};if(typeof t=="object"){let h=t;new Headers(h.headers).forEach((f,l)=>i.set(l,f)),s=h.metadataKey,c=h.params||c,r=h.noResponseRetries||r,n=h.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(hD(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((h,f)=>i.set(f,h)),c=e.params||c);let d=n?gD:vp.request,p={url:`${_p()}/${s}`,headers:i,retryConfig:{noResponseRetries:r},params:c,responseType:"text",timeout:JS()};WS.info("instance request %j",p);let m=await d(p);WS.info("instance metadata is %s",m.data);let y=m.headers.get(ye.HEADER_NAME);if(y!==ye.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${ye.HEADER_NAME} header. Expected '${ye.HEADER_VALUE}', got ${y?`'${y}'`:"no header"}`);if(typeof m.data=="string")try{return pD.parse(m.data)}catch{}return m.data}o(Pa,"metadataAccessor");async function gD(t){let e={...t,url:t.url?.toString().replace(_p(),_p(ye.SECONDARY_HOST_ADDRESS))},r=(0,vp.request)(t),n=(0,vp.request)(e);return Promise.any([r,n])}o(gD,"fastFailMetadataRequest");function yD(t){return Pa("instance",t)}o(yD,"instance");function vD(t){return Pa("project",t)}o(vD,"project");function _D(t){return Pa("universe",t)}o(_D,"universe");async function bD(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await Pa(r),i=r.metadataKey;e[i]=n})())),e}o(bD,"bulk");function ED(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(ED,"detectGCPAvailableRetries");var Uu;async function SD(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in ye.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(ye.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return bp();case"ping-only":}}try{return Uu===void 0&&(Uu=Pa("instance",void 0,ED(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Uu,!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(SD,"isAvailable");function wD(){Uu=void 0}o(wD,"resetIsAvailableCache");ye.gcpResidencyCache=null;function bp(){return ye.gcpResidencyCache===null&&KS(),ye.gcpResidencyCache}o(bp,"getGCPResidency");function KS(t=null){ye.gcpResidencyCache=t!==null?t:(0,fD.detectGCPResidency)()}o(KS,"setGCPResidency");function JS(){return bp()?0:3e3}o(JS,"requestTimeout");dD(dp(),ye)});var QS=D(Mu=>{"use strict";Mu.byteLength=PD;Mu.toByteArray=AD;Mu.fromByteArray=CD;var Vr=[],yr=[],TD=typeof Uint8Array<"u"?Uint8Array:Array,Ep="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Eo=0,YS=Ep.length;Eo<YS;++Eo)Vr[Eo]=Ep[Eo],yr[Ep.charCodeAt(Eo)]=Eo;var Eo,YS;yr[45]=62;yr[95]=63;function XS(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(XS,"getLens");function PD(t){var e=XS(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(PD,"byteLength");function xD(t,e,r){return(e+r)*3/4-r}o(xD,"_byteLength");function AD(t){var e,r=XS(t),n=r[0],i=r[1],s=new TD(xD(t,n,i)),c=0,d=i>0?n-4:n,p;for(p=0;p<d;p+=4)e=yr[t.charCodeAt(p)]<<18|yr[t.charCodeAt(p+1)]<<12|yr[t.charCodeAt(p+2)]<<6|yr[t.charCodeAt(p+3)],s[c++]=e>>16&255,s[c++]=e>>8&255,s[c++]=e&255;return i===2&&(e=yr[t.charCodeAt(p)]<<2|yr[t.charCodeAt(p+1)]>>4,s[c++]=e&255),i===1&&(e=yr[t.charCodeAt(p)]<<10|yr[t.charCodeAt(p+1)]<<4|yr[t.charCodeAt(p+2)]>>2,s[c++]=e>>8&255,s[c++]=e&255),s}o(AD,"toByteArray");function ID(t){return Vr[t>>18&63]+Vr[t>>12&63]+Vr[t>>6&63]+Vr[t&63]}o(ID,"tripletToBase64");function RD(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(ID(n));return i.join("")}o(RD,"encodeChunk");function CD(t){for(var e,r=t.length,n=r%3,i=[],s=16383,c=0,d=r-n;c<d;c+=s)i.push(RD(t,c,c+s>d?d:c+s));return n===1?(e=t[r-1],i.push(Vr[e>>2]+Vr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Vr[e>>10]+Vr[e>>4&63]+Vr[e<<2&63]+"=")),i.join("")}o(CD,"fromByteArray")});var wp=D(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.fromArrayBufferToHex=OD;function OD(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(OD,"fromArrayBufferToHex")});var ew=D(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.BrowserCrypto=void 0;var li=QS(),kD=wp(),Tp=class t{static{o(this,"BrowserCrypto")}constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return li.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),li.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),c=li.toByteArray(t.padBase64(n)),d=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,d,c,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),c=await window.crypto.subtle.sign(n,s,i);return li.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let r=li.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return li.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,kD.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))}};Lu.BrowserCrypto=Tp});var tw=D(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.NodeCrypto=void 0;var di=require("crypto"),Pp=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return di.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return di.randomBytes(e).toString("base64")}async verify(e,r,n){let i=di.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=di.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 di.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:DD(e);return $D(di.createHmac("sha256",n).update(r).digest())}};ju.NodeCrypto=Pp;function $D(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o($D,"toArrayBuffer");function DD(t){return Buffer.from(t)}o(DD,"toBuffer")});var Aa=D(vn=>{"use strict";var ND=vn&&vn.__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]})),zD=vn&&vn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ND(e,t,r)};Object.defineProperty(vn,"__esModule",{value:!0});vn.createCrypto=LD;vn.hasBrowserCrypto=rw;var UD=ew(),MD=tw();zD(wp(),vn);function LD(){return rw()?new UD.BrowserCrypto:new MD.NodeCrypto}o(LD,"createCrypto");function rw(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(rw,"hasBrowserCrypto")});var pi=D((xp,ow)=>{var Fu=require("buffer"),Gr=Fu.Buffer;function nw(t,e){for(var r in t)e[r]=t[r]}o(nw,"copyProps");Gr.from&&Gr.alloc&&Gr.allocUnsafe&&Gr.allocUnsafeSlow?ow.exports=Fu:(nw(Fu,xp),xp.Buffer=So);function So(t,e,r){return Gr(t,e,r)}o(So,"SafeBuffer");So.prototype=Object.create(Gr.prototype);nw(Gr,So);So.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Gr(t,e,r)};So.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Gr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};So.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Gr(t)};So.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Fu.SlowBuffer(t)}});var aw=D(($X,iw)=>{"use strict";function Ap(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(Ap,"getParamSize");var jD={ES256:Ap(256),ES384:Ap(384),ES512:Ap(521)};function FD(t){var e=jD[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(FD,"getParamBytesForAlg");iw.exports=FD});var Ip=D((NX,pw)=>{"use strict";var qu=pi().Buffer,uw=aw(),Bu=128,cw=0,qD=32,BD=16,VD=2,lw=BD|qD|cw<<6,Vu=VD|cw<<6;function GD(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(GD,"base64Url");function dw(t){if(qu.isBuffer(t))return t;if(typeof t=="string")return qu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(dw,"signatureAsBuffer");function HD(t,e){t=dw(t);var r=uw(e),n=r+1,i=t.length,s=0;if(t[s++]!==lw)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(Bu|1)&&(c=t[s++]),i-s<c)throw new Error('"seq" specified length of "'+c+'", only "'+(i-s)+'" remaining');if(t[s++]!==Vu)throw new Error('Could not find expected "int" for "r"');var d=t[s++];if(i-s-2<d)throw new Error('"r" specified length of "'+d+'", only "'+(i-s-2)+'" available');if(n<d)throw new Error('"r" specified length of "'+d+'", max of "'+n+'" is acceptable');var p=s;if(s+=d,t[s++]!==Vu)throw new Error('Could not find expected "int" for "s"');var m=t[s++];if(i-s!==m)throw new Error('"s" specified length of "'+m+'", expected "'+(i-s)+'"');if(n<m)throw new Error('"s" specified length of "'+m+'", max of "'+n+'" is acceptable');var y=s;if(s+=m,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var h=r-d,f=r-m,l=qu.allocUnsafe(h+d+f+m);for(s=0;s<h;++s)l[s]=0;t.copy(l,s,p+Math.max(-h,0),p+d),s=r;for(var g=s;s<g+f;++s)l[s]=0;return t.copy(l,s,y+Math.max(-f,0),y+m),l=l.toString("base64"),l=GD(l),l}o(HD,"derToJose");function sw(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=Bu;return i&&--n,n}o(sw,"countPadding");function WD(t,e){t=dw(t);var r=uw(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=sw(t,0,r),s=sw(t,r,t.length),c=r-i,d=r-s,p=2+c+1+1+d,m=p<Bu,y=qu.allocUnsafe((m?2:3)+p),h=0;return y[h++]=lw,m?y[h++]=p:(y[h++]=Bu|1,y[h++]=p&255),y[h++]=Vu,y[h++]=c,i<0?(y[h++]=0,h+=t.copy(y,h,0,r)):h+=t.copy(y,h,i,r),y[h++]=Vu,y[h++]=d,s<0?(y[h++]=0,t.copy(y,h,r)):t.copy(y,h,r+s),y}o(WD,"joseToDer");pw.exports={derToJose:HD,joseToDer:WD}});var kr=D(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.LRUCache=void 0;_n.snakeToCamel=mw;_n.originalOrCamelOptions=YD;_n.removeUndefinedValuesInObject=XD;_n.isValidFile=QD;_n.getWellKnownCertificateConfigFileLocation=eN;var ZD=require("fs"),KD=require("os"),Rp=require("path"),JD="certificate_config.json",fw="gcloud";function mw(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(mw,"snakeToCamel");function YD(t){function e(r){let n=t||{};return n[r]??n[mw(r)]}return o(e,"get"),{get:e}}o(YD,"originalOrCamelOptions");var Cp=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()}};_n.LRUCache=Cp;function XD(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(XD,"removeUndefinedValuesInObject");async function QD(t){try{return(await ZD.promises.lstat(t)).isFile()}catch{return!1}}o(QD,"isValidFile");function eN(){let t=process.env.CLOUDSDK_CONFIG||(tN()?Rp.join(process.env.APPDATA||"",fw):Rp.join(process.env.HOME||"",".config",fw));return Rp.join(t,JD)}o(eN,"getWellKnownCertificateConfigFileLocation");function tN(){return KD.platform().startsWith("win")}o(tN,"_isWindows")});var hw=D((LX,rN)=>{rN.exports={name:"google-auth-library",version:"10.5.0",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:"googleapis/google-auth-library-nodejs.git",keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.0.0","gcp-metadata":"^8.0.0","google-logging-utils":"^1.0.0",gtoken:"^8.0.0",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","assert-rejects":"^1.0.0",c8:"^10.0.0",codecov:"^3.0.2",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","ts-loader":"^8.0.0",typescript:"5.8.2",webpack:"^5.21.2","webpack-cli":"^4.0.0"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start","docs-test":"echo 'disabled until linkinator is fixed'","predocs-test":"npm run docs",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0"}});var Op=D(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.USER_AGENT=Jn.PRODUCT_NAME=Jn.pkg=void 0;var gw=hw();Jn.pkg=gw;var yw="google-api-nodejs-client";Jn.PRODUCT_NAME=yw;var nN=`${yw}/${gw.version}`;Jn.USER_AGENT=nN});var nr=D($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.AuthClient=$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=$r.DEFAULT_UNIVERSE=void 0;var oN=require("events"),kp=ht(),iN=kr(),aN=yp(),$p=Op();$r.DEFAULT_UNIVERSE="googleapis.com";$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var Dp=class t extends oN.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=$r.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,iN.originalOrCamelOptions)(e);this.apiKey=e.apiKey,this.projectId=r.get("project_id")??null,this.quotaProjectId=r.get("quota_project_id"),this.credentials=r.get("credentials")??{},this.universeDomain=r.get("universe_domain")??$r.DEFAULT_UNIVERSE,this.transporter=e.transporter??new kp.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&&kp.Gaxios.mergeHeaders(s,r.headers),n&&kp.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,aN.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(`${$p.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${$p.USER_AGENT}`):e.headers.set("User-Agent",$p.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let c={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,s,c):t.log.info("[%s] request %j",s,c)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},"resolved"),rejected:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e},"rejected")};static setMethodName(e,r){try{let n=e;n[t.RequestMethodNameSymbol]=r}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};$r.AuthClient=Dp});var zp=D(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.LoginTicket=void 0;var Np=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()}}};Gu.LoginTicket=Np});var wo=D(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.OAuth2Client=Hr.ClientAuthentication=Hr.CertificateFormat=Hr.CodeChallengeMethod=void 0;var vw=ht(),sN=require("querystring"),uN=require("stream"),cN=Ip(),_w=kr(),Up=Aa(),fi=nr(),lN=zp(),bw;(function(t){t.Plain="plain",t.S256="S256"})(bw||(Hr.CodeChallengeMethod=bw={}));var bn;(function(t){t.PEM="PEM",t.JWK="JWK"})(bn||(Hr.CertificateFormat=bn={}));var Ia;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(Ia||(Hr.ClientAuthentication=Ia={}));var Mp=class t extends fi.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=bn.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(e={},r,n){super(typeof e=="object"?e:{}),typeof e!="object"&&(e={clientId:e,clientSecret:r,redirectUri:n}),this._clientId=e.clientId||e.client_id,this._clientSecret=e.clientSecret||e.client_secret,this.redirectUri=e.redirectUri||e.redirect_uris?.[0],this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...e.endpoints},this.clientAuthentication=e.clientAuthentication||Ia.ClientSecretPost,this.issuers=e.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+sN.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,Up.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===Ia.ClientSecretBasic){let p=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${p.toString("base64")}`)}this.clientAuthentication===Ia.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,_w.removeUndefinedValuesInObject)(i)),headers:n};fi.AuthClient.setMethodName(s,"getTokenAsync");let c=await this.transporter.request(s),d=c.data;return c.data&&c.data.expires_in&&(d.expiry_date=new Date().getTime()+c.data.expires_in*1e3,delete d.expires_in),this.emit("tokens",d),{tokens:d,res:c}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let r=this.refreshTokenNoCache(e).then(n=>(this.refreshTokenPromises.delete(e),n),n=>{throw this.refreshTokenPromises.delete(e),n});return this.refreshTokenPromises.set(e,r),r}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let r=this.endpoints.oauth2TokenUrl.toString(),n={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},i;try{let c={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,_w.removeUndefinedValuesInObject)(n))};fi.AuthClient.setMethodName(c,"refreshTokenNoCache"),i=await this.transporter.request(c)}catch(c){throw c instanceof vw.GaxiosError&&c.message==="invalid_grant"&&c.response?.data&&/ReAuth/i.test(c.response.data.error_description)&&(c.message=JSON.stringify(c.response.data)),c}let s=i.data;return i.data&&i.data.expires_in&&(s.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(r=>e(null,r.credentials,r.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),r=e.tokens;return r.refresh_token=this.credentials.refresh_token,this.credentials=r,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(r=>e(null,r.token,r.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let n=await this.processAndValidateRefreshHandler();if(n?.access_token)return this.setCredentials(n),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let r=this.credentials;if(!r.access_token&&!r.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(r.access_token&&!this.isTokenExpiring()){r.token_type=r.token_type||"Bearer";let d=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(d)}}if(this.refreshHandler){let d=await this.processAndValidateRefreshHandler();if(d?.access_token){this.setCredentials(d);let p=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(p)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,i=null;try{n=await this.refreshToken(r.refresh_token),i=n.tokens}catch(d){let p=d;throw p.response&&(p.response.status===403||p.response.status===404)&&(p.message=`Could not refresh access token: ${p.message}`),p}let s=this.credentials;s.token_type=s.token_type||"Bearer",i.refresh_token=s.refresh_token,this.credentials=i;let c=new Headers({authorization:s.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(c),res:n.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let r=new URL(this.endpoints.oauth2RevokeUrl);return r.searchParams.append("token",e),r}revokeToken(e,r){let n={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(fi.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=vw.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,n.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(n){let i=n.response;if(i){let s=i.status,c=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),d=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,p=i.config.data instanceof uN.Readable,m=s===401||s===403;if(!r&&m&&!p&&c)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&m&&!p&&d){let y=await this.processAndValidateRefreshHandler();return y?.access_token&&this.setCredentials(y),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,Up.hasBrowserCrypto)()?bn.JWK:bn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case bn.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case bn.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let m={...t.RETRY_CONFIG,url:i};fi.AuthClient.setMethodName(m,"getFederatedSignonCertsAsync"),n=await this.transporter.request(m)}catch(m){throw m instanceof Error&&(m.message=`Failed to retrieve verification certificates: ${m.message}`),m}let s=n?.headers.get("cache-control"),c=-1;if(s){let m=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;m&&(c=Number(m)*1e3)}let d={};switch(r){case bn.PEM:d=n.data;break;case bn.JWK:for(let m of n.data.keys)d[m.kid]=m;break;default:throw new Error(`Unsupported certificate format ${r}`)}let p=new Date;return this.certificateExpiry=c===-1?null:new Date(p.getTime()+c),this.certificateCache=d,this.certificateCacheFormat=r,{certs:d,format:r,res:n}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(r=>e(null,r.pubkeys,r.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,r=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let n={...t.RETRY_CONFIG,url:r};fi.AuthClient.setMethodName(n,"getIapPublicKeysAsync"),e=await this.transporter.request(n)}catch(n){throw n instanceof Error&&(n.message=`Failed to retrieve verification certificates: ${n.message}`),n}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,r,n,i,s){let c=(0,Up.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let d=e.split(".");if(d.length!==3)throw new Error("Wrong number of segments in token: "+e);let p=d[0]+"."+d[1],m=d[2],y,h;try{y=JSON.parse(c.decodeBase64StringUtf8(d[0]))}catch(U){throw U instanceof Error&&(U.message=`Can't parse token envelope: ${d[0]}': ${U.message}`),U}if(!y)throw new Error("Can't parse token envelope: "+d[0]);try{h=JSON.parse(c.decodeBase64StringUtf8(d[1]))}catch(U){throw U instanceof Error&&(U.message=`Can't parse token payload '${d[0]}`),U}if(!h)throw new Error("Can't parse token payload: "+d[1]);if(!Object.prototype.hasOwnProperty.call(r,y.kid))throw new Error("No pem found for envelope: "+JSON.stringify(y));let f=r[y.kid];if(y.alg==="ES256"&&(m=cN.joseToDer(m,"ES256").toString("base64")),!await c.verify(f,p,m))throw new Error("Invalid token signature: "+e);if(!h.iat)throw new Error("No issue time in token: "+JSON.stringify(h));if(!h.exp)throw new Error("No expiration time in token: "+JSON.stringify(h));let g=Number(h.iat);if(isNaN(g))throw new Error("iat field using invalid format");let v=Number(h.exp);if(isNaN(v))throw new Error("exp field using invalid format");let E=new Date().getTime()/1e3;if(v>=E+s)throw new Error("Expiration time too far in future: "+JSON.stringify(h));let b=g-t.CLOCK_SKEW_SECS_,C=v+t.CLOCK_SKEW_SECS_;if(E<b)throw new Error("Token used too early, "+E+" < "+b+": "+JSON.stringify(h));if(E>C)throw new Error("Token used too late, "+E+" > "+C+": "+JSON.stringify(h));if(i&&i.indexOf(h.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+h.iss);if(typeof n<"u"&&n!==null){let U=h.aud,J=!1;if(n.constructor===Array?J=n.indexOf(U)>-1:J=U===n,!J)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new lN.LoginTicket(y,h)}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}};Hr.OAuth2Client=Mp});var jp=D(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.Compute=void 0;var dN=ht(),Ew=xa(),pN=wo(),Lp=class extends pN.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 Ew.instance(i)}catch(i){throw i instanceof dN.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 Ew.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))}};Hu.Compute=Lp});var qp=D(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.IdTokenClient=void 0;var fN=wo(),Fp=class extends fN.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}};Wu.IdTokenClient=Fp});var Bp=D(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.GCPEnv=void 0;mi.clear=mN;mi.getEnv=hN;var Sw=xa(),Wr;(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"})(Wr||(mi.GCPEnv=Wr={}));var Ra;function mN(){Ra=void 0}o(mN,"clear");async function hN(){return Ra||(Ra=gN(),Ra)}o(hN,"getEnv");async function gN(){let t=Wr.NONE;return yN()?t=Wr.APP_ENGINE:vN()?t=Wr.CLOUD_FUNCTIONS:await SN()?await EN()?t=Wr.KUBERNETES_ENGINE:_N()?t=Wr.CLOUD_RUN:bN()?t=Wr.CLOUD_RUN_JOBS:t=Wr.COMPUTE_ENGINE:t=Wr.NONE,t}o(gN,"getEnvMemoized");function yN(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(yN,"isAppEngine");function vN(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(vN,"isCloudFunction");function _N(){return!!process.env.K_CONFIGURATION}o(_N,"isCloudRun");function bN(){return!!process.env.CLOUD_RUN_JOB}o(bN,"isCloudRunJob");async function EN(){try{return await Sw.instance("attributes/cluster-name"),!0}catch{return!1}}o(EN,"isKubernetesEngine");async function SN(){return Sw.isAvailable()}o(SN,"isComputeEngine")});var Vp=D((QX,ww)=>{var Zu=pi().Buffer,wN=require("stream"),TN=require("util");function Ku(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Zu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Zu.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}o(Ku,"DataStream");TN.inherits(Ku,wN);Ku.prototype.write=o(function(e){this.buffer=Zu.concat([this.buffer,Zu.from(e)]),this.emit("data",e)},"write");Ku.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");ww.exports=Ku});var Pw=D((t7,Tw)=>{"use strict";var Ca=require("buffer").Buffer,Gp=require("buffer").SlowBuffer;Tw.exports=Ju;function Ju(t,e){if(!Ca.isBuffer(t)||!Ca.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(Ju,"bufferEq");Ju.install=function(){Ca.prototype.equal=Gp.prototype.equal=o(function(e){return Ju(this,e)},"equal")};var PN=Ca.prototype.equal,xN=Gp.prototype.equal;Ju.restore=function(){Ca.prototype.equal=PN,Gp.prototype.equal=xN}});var Kp=D((n7,Dw)=>{var gi=pi().Buffer,vr=require("crypto"),Aw=Ip(),xw=require("util"),AN=`"%s" is not a valid algorithm.
|
|
37
|
+
`+v+"}":"{"+E.join(",")+"}",n=v,l}}o(p,"str"),typeof RS.stringify!="function"&&(RS.stringify=function(m,y,h){var f;if(n="",i="",typeof h=="number")for(f=0;f<h;f+=1)i+=" ";else typeof h=="string"&&(i=h);if(c=y,y&&typeof y!="function"&&(typeof y!="object"||typeof y.length!="number"))throw new Error("JSON.stringify");return p("",{"":m})})})()});var $S=D((fX,kS)=>{var Du=null,X$=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,Q$=/(?: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)/,eD=o(function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(t!=null){if(t.strict===!0&&(e.strict=!0),t.storeAsString===!0&&(e.storeAsString=!0),e.alwaysParseAsBig=t.alwaysParseAsBig===!0?t.alwaysParseAsBig:!1,e.useNativeBigInt=t.useNativeBigInt===!0?t.useNativeBigInt:!1,typeof t.constructorAction<"u")if(t.constructorAction==="error"||t.constructorAction==="ignore"||t.constructorAction==="preserve")e.constructorAction=t.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(typeof t.protoAction<"u")if(t.protoAction==="error"||t.protoAction==="ignore"||t.protoAction==="preserve")e.protoAction=t.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var r,n,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
38
|
+
`,r:"\r",t:" "},s,c=o(function(v){throw{name:"SyntaxError",message:v,at:r,text:s}},"error"),d=o(function(v){return v&&v!==n&&c("Expected '"+v+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),p=o(function(){var v,E="";for(n==="-"&&(E="-",d("-"));n>="0"&&n<="9";)E+=n,d();if(n===".")for(E+=".";d()&&n>="0"&&n<="9";)E+=n;if(n==="e"||n==="E")for(E+=n,d(),(n==="-"||n==="+")&&(E+=n,d());n>="0"&&n<="9";)E+=n,d();if(v=+E,!isFinite(v))c("Bad number");else return Du==null&&(Du=lp()),E.length>15?e.storeAsString?E:e.useNativeBigInt?BigInt(E):new Du(E):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(v):new Du(v):v},"number"),m=o(function(){var v,E,b="",C;if(n==='"')for(var U=r;d();){if(n==='"')return r-1>U&&(b+=s.substring(U,r-1)),d(),b;if(n==="\\"){if(r-1>U&&(b+=s.substring(U,r-1)),d(),n==="u"){for(C=0,E=0;E<4&&(v=parseInt(d(),16),!!isFinite(v));E+=1)C=C*16+v;b+=String.fromCharCode(C)}else if(typeof i[n]=="string")b+=i[n];else break;U=r}}c("Bad string")},"string"),y=o(function(){for(;n&&n<=" ";)d()},"white"),h=o(function(){switch(n){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}c("Unexpected '"+n+"'")},"word"),f,l=o(function(){var v=[];if(n==="["){if(d("["),y(),n==="]")return d("]"),v;for(;n;){if(v.push(f()),y(),n==="]")return d("]"),v;d(","),y()}}c("Bad array")},"array"),g=o(function(){var v,E=Object.create(null);if(n==="{"){if(d("{"),y(),n==="}")return d("}"),E;for(;n;){if(v=m(),y(),d(":"),e.strict===!0&&Object.hasOwnProperty.call(E,v)&&c('Duplicate key "'+v+'"'),X$.test(v)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?f():E[v]=f():Q$.test(v)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?f():E[v]=f():E[v]=f(),y(),n==="}")return d("}"),E;d(","),y()}}c("Bad object")},"object");return f=o(function(){switch(y(),n){case"{":return g();case"[":return l();case'"':return m();case"-":return p();default:return n>="0"&&n<="9"?p():h()}},"value"),function(v,E){var b;return s=v+"",r=0,n=" ",b=f(),y(),n&&c("Syntax error"),typeof E=="function"?o((function C(U,J){var Z,H,K=U[J];return K&&typeof K=="object"&&Object.keys(K).forEach(function(te){H=C(K,te),H!==void 0?K[te]=H:delete K[te]}),E.call(U,J,K)}),"walk")({"":b},""):b}},"json_parse");kS.exports=eD});var zS=D((hX,Nu)=>{var DS=OS().stringify,NS=$S();Nu.exports=function(t){return{parse:NS(t),stringify:DS}};Nu.exports.parse=NS();Nu.exports.stringify=DS});var dp=D(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.GCE_LINUX_BIOS_PATHS=void 0;Cr.isGoogleCloudServerless=LS;Cr.isGoogleComputeEngineLinux=jS;Cr.isGoogleComputeEngineMACAddress=FS;Cr.isGoogleComputeEngine=qS;Cr.detectGCPResidency=rD;var US=require("fs"),MS=require("os");Cr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var tD=/^42:01/;function LS(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(LS,"isGoogleCloudServerless");function jS(){if((0,MS.platform)()!=="linux")return!1;try{(0,US.statSync)(Cr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,US.readFileSync)(Cr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(jS,"isGoogleComputeEngineLinux");function FS(){let t=(0,MS.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(tD.test(r))return!0}return!1}o(FS,"isGoogleComputeEngineMACAddress");function qS(){return jS()||FS()}o(qS,"isGoogleComputeEngine");function rD(){return LS()||qS()}o(rD,"detectGCPResidency")});var BS=D(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.Colours=void 0;var $t=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="")}};zu.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 WS=D(Qe=>{"use strict";var nD=Qe&&Qe.__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]})),oD=Qe&&Qe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),VS=Qe&&Qe.__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"&&nD(r,e,n[i]);return oD(r,e),r}})();Object.defineProperty(Qe,"__esModule",{value:!0});Qe.env=Qe.DebugLogBackendBase=Qe.placeholder=Qe.AdhocDebugLogger=Qe.LogSeverity=void 0;Qe.getNodeBackend=fp;Qe.getDebugBackend=aD;Qe.getStructuredBackend=sD;Qe.setBackend=uD;Qe.log=HS;var iD=require("events"),wa=VS(require("process")),GS=VS(require("util")),tr=BS(),Or;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(Or||(Qe.LogSeverity=Or={}));var Ta=class extends iD.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(Or.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(Or.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(Or.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(Or.ERROR,...n),this.func.sublog=n=>HS(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)}};Qe.AdhocDebugLogger=Ta;Qe.placeholder=new Ta("",()=>{}).func;var ci=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=wa.env[Qe.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)}}};Qe.DebugLogBackendBase=ci;var pp=class extends ci{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=`${tr.Colours.green}${e}${tr.Colours.reset}`,c=`${tr.Colours.yellow}${wa.pid}${tr.Colours.reset}`,d;switch(r.severity){case Or.ERROR:d=`${tr.Colours.red}${r.severity}${tr.Colours.reset}`;break;case Or.INFO:d=`${tr.Colours.magenta}${r.severity}${tr.Colours.reset}`;break;case Or.WARNING:d=`${tr.Colours.yellow}${r.severity}${tr.Colours.reset}`;break;default:d=(i=r.severity)!==null&&i!==void 0?i:Or.DEFAULT;break}let p=GS.formatWithOptions({colors:tr.Colours.enabled},...n),m=Object.assign({},r);delete m.severity;let y=Object.getOwnPropertyNames(m).length?JSON.stringify(m):"",h=y?`${tr.Colours.grey}${y}${tr.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,s,d,p,y?` ${h}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function fp(){return new pp}o(fp,"getNodeBackend");var mp=class extends ci{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 aD(t){return new mp(t)}o(aD,"getDebugBackend");var hp=class extends ci{static{o(this,"StructuredBackend")}constructor(e){var r;super(),this.upstream=(r=e)!==null&&r!==void 0?r:void 0}makeLogger(e){var r;let n=(r=this.upstream)===null||r===void 0?void 0:r.makeLogger(e);return(i,...s)=>{var c;let d=(c=i.severity)!==null&&c!==void 0?c:Or.INFO,p=Object.assign({severity:d,message:GS.format(...s)},i),m=JSON.stringify(p);n?n(i,m):console.log("%s",m)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function sD(t){return new hp(t)}o(sD,"getStructuredBackend");Qe.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var gp=new Map,rr;function uD(t){rr=t,gp.clear()}o(uD,"setBackend");function HS(t,e){if(!rr&&!wa.env[Qe.env.nodeEnables]||!t)return Qe.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=gp.get(t);if(r)return r.func;if(rr===null)return Qe.placeholder;rr===void 0&&(rr=fp());let n=(()=>{let i;return new Ta(t,(c,...d)=>{if(i!==rr){if(rr===null)return;rr===void 0&&(rr=fp()),i=rr}rr?.log(t,c,...d)})})();return gp.set(t,n),n.func}o(HS,"log")});var yp=D(bo=>{"use strict";var cD=bo&&bo.__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]})),lD=bo&&bo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cD(e,t,r)};Object.defineProperty(bo,"__esModule",{value:!0});lD(WS(),bo)});var xa=D(ye=>{"use strict";var KS=ye&&ye.__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]})),dD=ye&&ye.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pD=ye&&ye.__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"&&KS(r,e,n[i]);return dD(r,e),r}})(),fD=ye&&ye.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&KS(e,t,r)};Object.defineProperty(ye,"__esModule",{value:!0});ye.gcpResidencyCache=ye.METADATA_SERVER_DETECTION=ye.HEADERS=ye.HEADER_VALUE=ye.HEADER_NAME=ye.SECONDARY_HOST_ADDRESS=ye.HOST_ADDRESS=ye.BASE_PATH=void 0;ye.instance=_D;ye.project=bD;ye.universe=ED;ye.bulk=SD;ye.isAvailable=TD;ye.resetIsAvailableCache=PD;ye.getGCPResidency=bp;ye.setGCPResidency=JS;ye.requestTimeout=YS;var vp=ht(),mD=zS(),hD=dp(),gD=pD(yp());ye.BASE_PATH="/computeMetadata/v1";ye.HOST_ADDRESS="http://169.254.169.254";ye.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";ye.HEADER_NAME="Metadata-Flavor";ye.HEADER_VALUE="Google";ye.HEADERS=Object.freeze({[ye.HEADER_NAME]:ye.HEADER_VALUE});var ZS=gD.log("gcp-metadata");ye.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 _p(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||ye.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(ye.BASE_PATH,t).href}o(_p,"getBaseUrl");function yD(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(yD,"validate");async function Pa(t,e={},r=3,n=!1){let i=new Headers(ye.HEADERS),s="",c={};if(typeof t=="object"){let h=t;new Headers(h.headers).forEach((f,l)=>i.set(l,f)),s=h.metadataKey,c=h.params||c,r=h.noResponseRetries||r,n=h.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(yD(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((h,f)=>i.set(f,h)),c=e.params||c);let d=n?vD:vp.request,p={url:`${_p()}/${s}`,headers:i,retryConfig:{noResponseRetries:r},params:c,responseType:"text",timeout:YS()};ZS.info("instance request %j",p);let m=await d(p);ZS.info("instance metadata is %s",m.data);let y=m.headers.get(ye.HEADER_NAME);if(y!==ye.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${ye.HEADER_NAME} header. Expected '${ye.HEADER_VALUE}', got ${y?`'${y}'`:"no header"}`);if(typeof m.data=="string")try{return mD.parse(m.data)}catch{}return m.data}o(Pa,"metadataAccessor");async function vD(t){let e={...t,url:t.url?.toString().replace(_p(),_p(ye.SECONDARY_HOST_ADDRESS))},r=(0,vp.request)(t),n=(0,vp.request)(e);return Promise.any([r,n])}o(vD,"fastFailMetadataRequest");function _D(t){return Pa("instance",t)}o(_D,"instance");function bD(t){return Pa("project",t)}o(bD,"project");function ED(t){return Pa("universe",t)}o(ED,"universe");async function SD(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await Pa(r),i=r.metadataKey;e[i]=n})())),e}o(SD,"bulk");function wD(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(wD,"detectGCPAvailableRetries");var Uu;async function TD(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in ye.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(ye.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return bp();case"ping-only":}}try{return Uu===void 0&&(Uu=Pa("instance",void 0,wD(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Uu,!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(TD,"isAvailable");function PD(){Uu=void 0}o(PD,"resetIsAvailableCache");ye.gcpResidencyCache=null;function bp(){return ye.gcpResidencyCache===null&&JS(),ye.gcpResidencyCache}o(bp,"getGCPResidency");function JS(t=null){ye.gcpResidencyCache=t!==null?t:(0,hD.detectGCPResidency)()}o(JS,"setGCPResidency");function YS(){return bp()?0:3e3}o(YS,"requestTimeout");fD(dp(),ye)});var ew=D(Mu=>{"use strict";Mu.byteLength=AD;Mu.toByteArray=RD;Mu.fromByteArray=kD;var Vr=[],yr=[],xD=typeof Uint8Array<"u"?Uint8Array:Array,Ep="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Eo=0,XS=Ep.length;Eo<XS;++Eo)Vr[Eo]=Ep[Eo],yr[Ep.charCodeAt(Eo)]=Eo;var Eo,XS;yr[45]=62;yr[95]=63;function QS(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(QS,"getLens");function AD(t){var e=QS(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(AD,"byteLength");function ID(t,e,r){return(e+r)*3/4-r}o(ID,"_byteLength");function RD(t){var e,r=QS(t),n=r[0],i=r[1],s=new xD(ID(t,n,i)),c=0,d=i>0?n-4:n,p;for(p=0;p<d;p+=4)e=yr[t.charCodeAt(p)]<<18|yr[t.charCodeAt(p+1)]<<12|yr[t.charCodeAt(p+2)]<<6|yr[t.charCodeAt(p+3)],s[c++]=e>>16&255,s[c++]=e>>8&255,s[c++]=e&255;return i===2&&(e=yr[t.charCodeAt(p)]<<2|yr[t.charCodeAt(p+1)]>>4,s[c++]=e&255),i===1&&(e=yr[t.charCodeAt(p)]<<10|yr[t.charCodeAt(p+1)]<<4|yr[t.charCodeAt(p+2)]>>2,s[c++]=e>>8&255,s[c++]=e&255),s}o(RD,"toByteArray");function CD(t){return Vr[t>>18&63]+Vr[t>>12&63]+Vr[t>>6&63]+Vr[t&63]}o(CD,"tripletToBase64");function OD(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(CD(n));return i.join("")}o(OD,"encodeChunk");function kD(t){for(var e,r=t.length,n=r%3,i=[],s=16383,c=0,d=r-n;c<d;c+=s)i.push(OD(t,c,c+s>d?d:c+s));return n===1?(e=t[r-1],i.push(Vr[e>>2]+Vr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Vr[e>>10]+Vr[e>>4&63]+Vr[e<<2&63]+"=")),i.join("")}o(kD,"fromByteArray")});var wp=D(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.fromArrayBufferToHex=$D;function $D(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o($D,"fromArrayBufferToHex")});var tw=D(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.BrowserCrypto=void 0;var li=ew(),DD=wp(),Tp=class t{static{o(this,"BrowserCrypto")}constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return li.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),li.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),c=li.toByteArray(t.padBase64(n)),d=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,d,c,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),c=await window.crypto.subtle.sign(n,s,i);return li.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let r=li.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return li.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,DD.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))}};Lu.BrowserCrypto=Tp});var rw=D(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.NodeCrypto=void 0;var di=require("crypto"),Pp=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return di.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return di.randomBytes(e).toString("base64")}async verify(e,r,n){let i=di.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=di.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 di.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:zD(e);return ND(di.createHmac("sha256",n).update(r).digest())}};ju.NodeCrypto=Pp;function ND(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(ND,"toArrayBuffer");function zD(t){return Buffer.from(t)}o(zD,"toBuffer")});var Aa=D(vn=>{"use strict";var UD=vn&&vn.__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]})),MD=vn&&vn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UD(e,t,r)};Object.defineProperty(vn,"__esModule",{value:!0});vn.createCrypto=FD;vn.hasBrowserCrypto=nw;var LD=tw(),jD=rw();MD(wp(),vn);function FD(){return nw()?new LD.BrowserCrypto:new jD.NodeCrypto}o(FD,"createCrypto");function nw(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(nw,"hasBrowserCrypto")});var pi=D((xp,iw)=>{var Fu=require("buffer"),Gr=Fu.Buffer;function ow(t,e){for(var r in t)e[r]=t[r]}o(ow,"copyProps");Gr.from&&Gr.alloc&&Gr.allocUnsafe&&Gr.allocUnsafeSlow?iw.exports=Fu:(ow(Fu,xp),xp.Buffer=So);function So(t,e,r){return Gr(t,e,r)}o(So,"SafeBuffer");So.prototype=Object.create(Gr.prototype);ow(Gr,So);So.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Gr(t,e,r)};So.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Gr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};So.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Gr(t)};So.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Fu.SlowBuffer(t)}});var sw=D((UX,aw)=>{"use strict";function Ap(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(Ap,"getParamSize");var qD={ES256:Ap(256),ES384:Ap(384),ES512:Ap(521)};function BD(t){var e=qD[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(BD,"getParamBytesForAlg");aw.exports=BD});var Ip=D((LX,fw)=>{"use strict";var qu=pi().Buffer,cw=sw(),Bu=128,lw=0,VD=32,GD=16,HD=2,dw=GD|VD|lw<<6,Vu=HD|lw<<6;function WD(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(WD,"base64Url");function pw(t){if(qu.isBuffer(t))return t;if(typeof t=="string")return qu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(pw,"signatureAsBuffer");function ZD(t,e){t=pw(t);var r=cw(e),n=r+1,i=t.length,s=0;if(t[s++]!==dw)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(Bu|1)&&(c=t[s++]),i-s<c)throw new Error('"seq" specified length of "'+c+'", only "'+(i-s)+'" remaining');if(t[s++]!==Vu)throw new Error('Could not find expected "int" for "r"');var d=t[s++];if(i-s-2<d)throw new Error('"r" specified length of "'+d+'", only "'+(i-s-2)+'" available');if(n<d)throw new Error('"r" specified length of "'+d+'", max of "'+n+'" is acceptable');var p=s;if(s+=d,t[s++]!==Vu)throw new Error('Could not find expected "int" for "s"');var m=t[s++];if(i-s!==m)throw new Error('"s" specified length of "'+m+'", expected "'+(i-s)+'"');if(n<m)throw new Error('"s" specified length of "'+m+'", max of "'+n+'" is acceptable');var y=s;if(s+=m,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var h=r-d,f=r-m,l=qu.allocUnsafe(h+d+f+m);for(s=0;s<h;++s)l[s]=0;t.copy(l,s,p+Math.max(-h,0),p+d),s=r;for(var g=s;s<g+f;++s)l[s]=0;return t.copy(l,s,y+Math.max(-f,0),y+m),l=l.toString("base64"),l=WD(l),l}o(ZD,"derToJose");function uw(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=Bu;return i&&--n,n}o(uw,"countPadding");function KD(t,e){t=pw(t);var r=cw(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=uw(t,0,r),s=uw(t,r,t.length),c=r-i,d=r-s,p=2+c+1+1+d,m=p<Bu,y=qu.allocUnsafe((m?2:3)+p),h=0;return y[h++]=dw,m?y[h++]=p:(y[h++]=Bu|1,y[h++]=p&255),y[h++]=Vu,y[h++]=c,i<0?(y[h++]=0,h+=t.copy(y,h,0,r)):h+=t.copy(y,h,i,r),y[h++]=Vu,y[h++]=d,s<0?(y[h++]=0,t.copy(y,h,r)):t.copy(y,h,r+s),y}o(KD,"joseToDer");fw.exports={derToJose:ZD,joseToDer:KD}});var kr=D(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.LRUCache=void 0;_n.snakeToCamel=hw;_n.originalOrCamelOptions=QD;_n.removeUndefinedValuesInObject=eN;_n.isValidFile=tN;_n.getWellKnownCertificateConfigFileLocation=rN;var JD=require("fs"),YD=require("os"),Rp=require("path"),XD="certificate_config.json",mw="gcloud";function hw(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(hw,"snakeToCamel");function QD(t){function e(r){let n=t||{};return n[r]??n[hw(r)]}return o(e,"get"),{get:e}}o(QD,"originalOrCamelOptions");var Cp=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()}};_n.LRUCache=Cp;function eN(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(eN,"removeUndefinedValuesInObject");async function tN(t){try{return(await JD.promises.lstat(t)).isFile()}catch{return!1}}o(tN,"isValidFile");function rN(){let t=process.env.CLOUDSDK_CONFIG||(nN()?Rp.join(process.env.APPDATA||"",mw):Rp.join(process.env.HOME||"",".config",mw));return Rp.join(t,XD)}o(rN,"getWellKnownCertificateConfigFileLocation");function nN(){return YD.platform().startsWith("win")}o(nN,"_isWindows")});var gw=D((BX,oN)=>{oN.exports={name:"google-auth-library",version:"10.5.0",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:"googleapis/google-auth-library-nodejs.git",keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.0.0","gcp-metadata":"^8.0.0","google-logging-utils":"^1.0.0",gtoken:"^8.0.0",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","assert-rejects":"^1.0.0",c8:"^10.0.0",codecov:"^3.0.2",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","ts-loader":"^8.0.0",typescript:"5.8.2",webpack:"^5.21.2","webpack-cli":"^4.0.0"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start","docs-test":"echo 'disabled until linkinator is fixed'","predocs-test":"npm run docs",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0"}});var Op=D(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.USER_AGENT=Jn.PRODUCT_NAME=Jn.pkg=void 0;var yw=gw();Jn.pkg=yw;var vw="google-api-nodejs-client";Jn.PRODUCT_NAME=vw;var iN=`${vw}/${yw.version}`;Jn.USER_AGENT=iN});var nr=D($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.AuthClient=$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=$r.DEFAULT_UNIVERSE=void 0;var aN=require("events"),kp=ht(),sN=kr(),uN=yp(),$p=Op();$r.DEFAULT_UNIVERSE="googleapis.com";$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var Dp=class t extends aN.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=$r.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=$r.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,sN.originalOrCamelOptions)(e);this.apiKey=e.apiKey,this.projectId=r.get("project_id")??null,this.quotaProjectId=r.get("quota_project_id"),this.credentials=r.get("credentials")??{},this.universeDomain=r.get("universe_domain")??$r.DEFAULT_UNIVERSE,this.transporter=e.transporter??new kp.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&&kp.Gaxios.mergeHeaders(s,r.headers),n&&kp.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,uN.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(`${$p.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${$p.USER_AGENT}`):e.headers.set("User-Agent",$p.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let c={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,s,c):t.log.info("[%s] request %j",s,c)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},"resolved"),rejected:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e},"rejected")};static setMethodName(e,r){try{let n=e;n[t.RequestMethodNameSymbol]=r}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};$r.AuthClient=Dp});var zp=D(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.LoginTicket=void 0;var Np=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()}}};Gu.LoginTicket=Np});var wo=D(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.OAuth2Client=Hr.ClientAuthentication=Hr.CertificateFormat=Hr.CodeChallengeMethod=void 0;var _w=ht(),cN=require("querystring"),lN=require("stream"),dN=Ip(),bw=kr(),Up=Aa(),fi=nr(),pN=zp(),Ew;(function(t){t.Plain="plain",t.S256="S256"})(Ew||(Hr.CodeChallengeMethod=Ew={}));var bn;(function(t){t.PEM="PEM",t.JWK="JWK"})(bn||(Hr.CertificateFormat=bn={}));var Ia;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(Ia||(Hr.ClientAuthentication=Ia={}));var Mp=class t extends fi.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=bn.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(e={},r,n){super(typeof e=="object"?e:{}),typeof e!="object"&&(e={clientId:e,clientSecret:r,redirectUri:n}),this._clientId=e.clientId||e.client_id,this._clientSecret=e.clientSecret||e.client_secret,this.redirectUri=e.redirectUri||e.redirect_uris?.[0],this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...e.endpoints},this.clientAuthentication=e.clientAuthentication||Ia.ClientSecretPost,this.issuers=e.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+cN.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,Up.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===Ia.ClientSecretBasic){let p=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${p.toString("base64")}`)}this.clientAuthentication===Ia.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,bw.removeUndefinedValuesInObject)(i)),headers:n};fi.AuthClient.setMethodName(s,"getTokenAsync");let c=await this.transporter.request(s),d=c.data;return c.data&&c.data.expires_in&&(d.expiry_date=new Date().getTime()+c.data.expires_in*1e3,delete d.expires_in),this.emit("tokens",d),{tokens:d,res:c}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let r=this.refreshTokenNoCache(e).then(n=>(this.refreshTokenPromises.delete(e),n),n=>{throw this.refreshTokenPromises.delete(e),n});return this.refreshTokenPromises.set(e,r),r}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let r=this.endpoints.oauth2TokenUrl.toString(),n={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},i;try{let c={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,bw.removeUndefinedValuesInObject)(n))};fi.AuthClient.setMethodName(c,"refreshTokenNoCache"),i=await this.transporter.request(c)}catch(c){throw c instanceof _w.GaxiosError&&c.message==="invalid_grant"&&c.response?.data&&/ReAuth/i.test(c.response.data.error_description)&&(c.message=JSON.stringify(c.response.data)),c}let s=i.data;return i.data&&i.data.expires_in&&(s.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(r=>e(null,r.credentials,r.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),r=e.tokens;return r.refresh_token=this.credentials.refresh_token,this.credentials=r,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(r=>e(null,r.token,r.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let n=await this.processAndValidateRefreshHandler();if(n?.access_token)return this.setCredentials(n),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let r=this.credentials;if(!r.access_token&&!r.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(r.access_token&&!this.isTokenExpiring()){r.token_type=r.token_type||"Bearer";let d=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(d)}}if(this.refreshHandler){let d=await this.processAndValidateRefreshHandler();if(d?.access_token){this.setCredentials(d);let p=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(p)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,i=null;try{n=await this.refreshToken(r.refresh_token),i=n.tokens}catch(d){let p=d;throw p.response&&(p.response.status===403||p.response.status===404)&&(p.message=`Could not refresh access token: ${p.message}`),p}let s=this.credentials;s.token_type=s.token_type||"Bearer",i.refresh_token=s.refresh_token,this.credentials=i;let c=new Headers({authorization:s.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(c),res:n.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let r=new URL(this.endpoints.oauth2RevokeUrl);return r.searchParams.append("token",e),r}revokeToken(e,r){let n={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(fi.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=_w.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,n.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(n){let i=n.response;if(i){let s=i.status,c=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),d=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,p=i.config.data instanceof lN.Readable,m=s===401||s===403;if(!r&&m&&!p&&c)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&m&&!p&&d){let y=await this.processAndValidateRefreshHandler();return y?.access_token&&this.setCredentials(y),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,Up.hasBrowserCrypto)()?bn.JWK:bn.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case bn.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case bn.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let m={...t.RETRY_CONFIG,url:i};fi.AuthClient.setMethodName(m,"getFederatedSignonCertsAsync"),n=await this.transporter.request(m)}catch(m){throw m instanceof Error&&(m.message=`Failed to retrieve verification certificates: ${m.message}`),m}let s=n?.headers.get("cache-control"),c=-1;if(s){let m=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;m&&(c=Number(m)*1e3)}let d={};switch(r){case bn.PEM:d=n.data;break;case bn.JWK:for(let m of n.data.keys)d[m.kid]=m;break;default:throw new Error(`Unsupported certificate format ${r}`)}let p=new Date;return this.certificateExpiry=c===-1?null:new Date(p.getTime()+c),this.certificateCache=d,this.certificateCacheFormat=r,{certs:d,format:r,res:n}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(r=>e(null,r.pubkeys,r.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,r=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let n={...t.RETRY_CONFIG,url:r};fi.AuthClient.setMethodName(n,"getIapPublicKeysAsync"),e=await this.transporter.request(n)}catch(n){throw n instanceof Error&&(n.message=`Failed to retrieve verification certificates: ${n.message}`),n}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,r,n,i,s){let c=(0,Up.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let d=e.split(".");if(d.length!==3)throw new Error("Wrong number of segments in token: "+e);let p=d[0]+"."+d[1],m=d[2],y,h;try{y=JSON.parse(c.decodeBase64StringUtf8(d[0]))}catch(U){throw U instanceof Error&&(U.message=`Can't parse token envelope: ${d[0]}': ${U.message}`),U}if(!y)throw new Error("Can't parse token envelope: "+d[0]);try{h=JSON.parse(c.decodeBase64StringUtf8(d[1]))}catch(U){throw U instanceof Error&&(U.message=`Can't parse token payload '${d[0]}`),U}if(!h)throw new Error("Can't parse token payload: "+d[1]);if(!Object.prototype.hasOwnProperty.call(r,y.kid))throw new Error("No pem found for envelope: "+JSON.stringify(y));let f=r[y.kid];if(y.alg==="ES256"&&(m=dN.joseToDer(m,"ES256").toString("base64")),!await c.verify(f,p,m))throw new Error("Invalid token signature: "+e);if(!h.iat)throw new Error("No issue time in token: "+JSON.stringify(h));if(!h.exp)throw new Error("No expiration time in token: "+JSON.stringify(h));let g=Number(h.iat);if(isNaN(g))throw new Error("iat field using invalid format");let v=Number(h.exp);if(isNaN(v))throw new Error("exp field using invalid format");let E=new Date().getTime()/1e3;if(v>=E+s)throw new Error("Expiration time too far in future: "+JSON.stringify(h));let b=g-t.CLOCK_SKEW_SECS_,C=v+t.CLOCK_SKEW_SECS_;if(E<b)throw new Error("Token used too early, "+E+" < "+b+": "+JSON.stringify(h));if(E>C)throw new Error("Token used too late, "+E+" > "+C+": "+JSON.stringify(h));if(i&&i.indexOf(h.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+h.iss);if(typeof n<"u"&&n!==null){let U=h.aud,J=!1;if(n.constructor===Array?J=n.indexOf(U)>-1:J=U===n,!J)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new pN.LoginTicket(y,h)}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}};Hr.OAuth2Client=Mp});var jp=D(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.Compute=void 0;var fN=ht(),Sw=xa(),mN=wo(),Lp=class extends mN.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 Sw.instance(i)}catch(i){throw i instanceof fN.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 Sw.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))}};Hu.Compute=Lp});var qp=D(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.IdTokenClient=void 0;var hN=wo(),Fp=class extends hN.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}};Wu.IdTokenClient=Fp});var Bp=D(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.GCPEnv=void 0;mi.clear=gN;mi.getEnv=yN;var ww=xa(),Wr;(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"})(Wr||(mi.GCPEnv=Wr={}));var Ra;function gN(){Ra=void 0}o(gN,"clear");async function yN(){return Ra||(Ra=vN(),Ra)}o(yN,"getEnv");async function vN(){let t=Wr.NONE;return _N()?t=Wr.APP_ENGINE:bN()?t=Wr.CLOUD_FUNCTIONS:await TN()?await wN()?t=Wr.KUBERNETES_ENGINE:EN()?t=Wr.CLOUD_RUN:SN()?t=Wr.CLOUD_RUN_JOBS:t=Wr.COMPUTE_ENGINE:t=Wr.NONE,t}o(vN,"getEnvMemoized");function _N(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(_N,"isAppEngine");function bN(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(bN,"isCloudFunction");function EN(){return!!process.env.K_CONFIGURATION}o(EN,"isCloudRun");function SN(){return!!process.env.CLOUD_RUN_JOB}o(SN,"isCloudRunJob");async function wN(){try{return await ww.instance("attributes/cluster-name"),!0}catch{return!1}}o(wN,"isKubernetesEngine");async function TN(){return ww.isAvailable()}o(TN,"isComputeEngine")});var Vp=D((n7,Tw)=>{var Zu=pi().Buffer,PN=require("stream"),xN=require("util");function Ku(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Zu.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Zu.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}o(Ku,"DataStream");xN.inherits(Ku,PN);Ku.prototype.write=o(function(e){this.buffer=Zu.concat([this.buffer,Zu.from(e)]),this.emit("data",e)},"write");Ku.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");Tw.exports=Ku});var xw=D((i7,Pw)=>{"use strict";var Ca=require("buffer").Buffer,Gp=require("buffer").SlowBuffer;Pw.exports=Ju;function Ju(t,e){if(!Ca.isBuffer(t)||!Ca.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(Ju,"bufferEq");Ju.install=function(){Ca.prototype.equal=Gp.prototype.equal=o(function(e){return Ju(this,e)},"equal")};var AN=Ca.prototype.equal,IN=Gp.prototype.equal;Ju.restore=function(){Ca.prototype.equal=AN,Gp.prototype.equal=IN}});var Kp=D((s7,Nw)=>{var gi=pi().Buffer,vr=require("crypto"),Iw=Ip(),Aw=require("util"),RN=`"%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".`,Oa="secret must be a string or buffer",hi="key must be a string or a buffer",IN="key must be a string, a buffer or an object",Wp=typeof vr.createPublicKey=="function";Wp&&(hi+=" or a KeyObject",Oa+="or a KeyObject");function Iw(t){if(!gi.isBuffer(t)&&typeof t!="string"&&(!Wp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Dr(hi)}o(Iw,"checkIsPublicKey");function Rw(t){if(!gi.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Dr(IN)}o(Rw,"checkIsPrivateKey");function RN(t){if(!gi.isBuffer(t)){if(typeof t=="string")return t;if(!Wp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Dr(Oa)}}o(RN,"checkIsSecretKey");function Zp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Zp,"fromBase64");function Cw(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(Cw,"toBase64");function Dr(t){var e=[].slice.call(arguments,1),r=xw.format.bind(xw,t).apply(null,e);return new TypeError(r)}o(Dr,"typeError");function CN(t){return gi.isBuffer(t)||typeof t=="string"}o(CN,"bufferOrString");function ka(t){return CN(t)||(t=JSON.stringify(t)),t}o(ka,"normalizeInput");function Ow(t){return o(function(r,n){RN(n),r=ka(r);var i=vr.createHmac("sha"+t,n),s=(i.update(r),i.digest("base64"));return Zp(s)},"sign")}o(Ow,"createHmacSigner");var Hp,ON="timingSafeEqual"in vr?o(function(e,r){return e.byteLength!==r.byteLength?!1:vr.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return Hp||(Hp=Pw()),Hp(e,r)},"timingSafeEqual");function kN(t){return o(function(r,n,i){var s=Ow(t)(r,i);return ON(gi.from(n),gi.from(s))},"verify")}o(kN,"createHmacVerifier");function kw(t){return o(function(r,n){Rw(n),r=ka(r);var i=vr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign(n,"base64"));return Zp(s)},"sign")}o(kw,"createKeySigner");function $w(t){return o(function(r,n,i){Iw(i),r=ka(r),n=Cw(n);var s=vr.createVerify("RSA-SHA"+t);return s.update(r),s.verify(i,n,"base64")},"verify")}o($w,"createKeyVerifier");function $N(t){return o(function(r,n){Rw(n),r=ka(r);var i=vr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign({key:n,padding:vr.constants.RSA_PKCS1_PSS_PADDING,saltLength:vr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Zp(s)},"sign")}o($N,"createPSSKeySigner");function DN(t){return o(function(r,n,i){Iw(i),r=ka(r),n=Cw(n);var s=vr.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:i,padding:vr.constants.RSA_PKCS1_PSS_PADDING,saltLength:vr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(DN,"createPSSKeyVerifier");function NN(t){var e=kw(t);return o(function(){var n=e.apply(null,arguments);return n=Aw.derToJose(n,"ES"+t),n},"sign")}o(NN,"createECDSASigner");function zN(t){var e=$w(t);return o(function(n,i,s){i=Aw.joseToDer(i,"ES"+t).toString("base64");var c=e(n,i,s);return c},"verify")}o(zN,"createECDSAVerifer");function UN(){return o(function(){return""},"sign")}o(UN,"createNoneSigner");function MN(){return o(function(e,r){return r===""},"verify")}o(MN,"createNoneVerifier");Dw.exports=o(function(e){var r={hs:Ow,rs:kw,ps:$N,es:NN,none:UN},n={hs:kN,rs:$w,ps:DN,es:zN,none:MN},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Dr(AN,e);var s=(i[1]||i[3]).toLowerCase(),c=i[2];return{sign:r[s](c),verify:n[s](c)}},"jwa")});var Jp=D((i7,Nw)=>{var LN=require("buffer").Buffer;Nw.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||LN.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var Fw=D((s7,jw)=>{var jN=pi().Buffer,zw=Vp(),FN=Kp(),qN=require("stream"),Uw=Jp(),Yp=require("util");function Mw(t,e){return jN.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Mw,"base64url");function BN(t,e,r){r=r||"utf8";var n=Mw(Uw(t),"binary"),i=Mw(Uw(e),r);return Yp.format("%s.%s",n,i)}o(BN,"jwsSecuredInput");function Lw(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=FN(e.alg),c=BN(e,r,i),d=s.sign(c,n);return Yp.format("%s.%s",c,d)}o(Lw,"jwsSign");function Yu(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 zw(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new zw(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(Yu,"SignStream");Yp.inherits(Yu,qN);Yu.prototype.sign=o(function(){try{var e=Lw({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");Yu.sign=Lw;jw.exports=Yu});var Yw=D((c7,Jw)=>{var Bw=pi().Buffer,qw=Vp(),VN=Kp(),GN=require("stream"),Vw=Jp(),HN=require("util"),WN=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function ZN(t){return Object.prototype.toString.call(t)==="[object Object]"}o(ZN,"isObject");function KN(t){if(ZN(t))return t;try{return JSON.parse(t)}catch{return}}o(KN,"safeJsonParse");function Gw(t){var e=t.split(".",1)[0];return KN(Bw.from(e,"base64").toString("binary"))}o(Gw,"headerFromJWS");function JN(t){return t.split(".",2).join(".")}o(JN,"securedInputFromJWS");function Hw(t){return t.split(".")[2]}o(Hw,"signatureFromJWS");function YN(t,e){e=e||"utf8";var r=t.split(".")[1];return Bw.from(r,"base64").toString(e)}o(YN,"payloadFromJWS");function Ww(t){return WN.test(t)&&!!Gw(t)}o(Ww,"isValidJws");function Zw(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=Vw(t);var i=Hw(t),s=JN(t),c=VN(e);return c.verify(s,i,r)}o(Zw,"jwsVerify");function Kw(t,e){if(e=e||{},t=Vw(t),!Ww(t))return null;var r=Gw(t);if(!r)return null;var n=YN(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:Hw(t)}}o(Kw,"jwsDecode");function yi(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 qw(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new qw(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(yi,"VerifyStream");HN.inherits(yi,GN);yi.prototype.verify=o(function(){try{var e=Zw(this.signature.buffer,this.algorithm,this.key.buffer),r=Kw(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");yi.decode=Kw;yi.isValid=Ww;yi.verify=Zw;Jw.exports=yi});var Xp=D(Yn=>{var Xw=Fw(),Xu=Yw(),XN=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Yn.ALGORITHMS=XN;Yn.sign=Xw.sign;Yn.verify=Xu.verify;Yn.decode=Xu.decode;Yn.isValid=Xu.isValid;Yn.createSign=o(function(e){return new Xw(e)},"createSign");Yn.createVerify=o(function(e){return new Xu(e)},"createVerify")});var fT=D(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.GoogleToken=void 0;var Qw=Qu(require("fs")),QN=ht(),ez=Qu(Xp()),tz=Qu(require("path")),rz=require("util");function Qu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Qu=o(function(s,c){if(!c&&s&&s.__esModule)return s;var d,p,m={__proto__:null,default:s};if(s===null||En(s)!="object"&&typeof s!="function")return m;if(d=c?n:r){if(d.has(s))return d.get(s);d.set(s,m)}for(var y in s)y!=="default"&&{}.hasOwnProperty.call(s,y)&&((p=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,y))&&(p.get||p.set)?d(m,y,p):m[y]=s[y]);return m},"_interopRequireWildcard"))(t,e)}o(Qu,"_interopRequireWildcard");function En(t){"@babel/helpers - typeof";return En=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},En(t)}o(En,"_typeof");function nz(t,e){uT(t,e),e.add(t)}o(nz,"_classPrivateMethodInitSpec");function oz(t,e,r){uT(t,e),e.set(t,r)}o(oz,"_classPrivateFieldInitSpec");function uT(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(uT,"_checkPrivateRedeclaration");function eT(t,e,r){return t.set(Nr(t,e),r),r}o(eT,"_classPrivateFieldSet");function tT(t,e){return t.get(Nr(t,e))}o(tT,"_classPrivateFieldGet");function Nr(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(Nr,"_assertClassBrand");function rT(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,dT(n.key),n)}}o(rT,"_defineProperties");function cT(t,e,r){return e&&rT(t.prototype,e),r&&rT(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(cT,"_createClass");function lT(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(lT,"_classCallCheck");function iz(t,e,r){return e=za(e),az(t,of()?Reflect.construct(e,r||[],za(t).constructor):e.apply(t,r))}o(iz,"_callSuper");function az(t,e){if(e&&(En(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sz(t)}o(az,"_possibleConstructorReturn");function sz(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(sz,"_assertThisInitialized");function uz(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Na(t,e)}o(uz,"_inherits");function Qp(t){var e=typeof Map=="function"?new Map:void 0;return Qp=o(function(n){if(n===null||!lz(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 cz(n,arguments,za(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Na(i,n)},"_wrapNativeSuper"),Qp(t)}o(Qp,"_wrapNativeSuper");function cz(t,e,r){if(of())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Na(i,r.prototype),i}o(cz,"_construct");function of(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(of=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(of,"_isNativeReflectConstruct");function lz(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(lz,"_isNativeFunction");function Na(t,e){return Na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Na(t,e)}o(Na,"_setPrototypeOf");function za(t){return za=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},za(t)}o(za,"_getPrototypeOf");function or(t,e,r){return(e=dT(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(or,"_defineProperty");function dT(t){var e=dz(t,"string");return En(e)=="symbol"?e:e+""}o(dT,"_toPropertyKey");function dz(t,e){if(En(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(En(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(dz,"_toPrimitive");function ar(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(l,g,v,E){var b=g&&g.prototype instanceof d?g:d,C=Object.create(b.prototype);return ir(C,"_invoke",(function(U,J,W){var H,K,te,Q=0,xe=W||[],re=!1,V={p:0,n:0,v:t,a:B,f:B.bind(t,4),d:o(function(Y,ie){return H=Y,K=0,te=t,V.n=ie,c},"d")};function B(X,Y){for(K=X,te=Y,e=0;!re&&Q&&!ie&&e<xe.length;e++){var ie,ue=xe[e],Ce=V.p,De=ue[2];X>3?(ie=De===Y)&&(te=ue[(K=ue[4])?5:(K=3,3)],ue[4]=ue[5]=t):ue[0]<=Ce&&((ie=X<2&&Ce<ue[1])?(K=0,V.v=Y,V.n=ue[1]):Ce<De&&(ie=X<3||ue[0]>Y||Y>De)&&(ue[4]=X,ue[5]=Y,V.n=De,K=0))}if(ie||X>1)return c;throw re=!0,Y}return o(B,"d"),function(X,Y,ie){if(Q>1)throw TypeError("Generator is already running");for(re&&Y===1&&B(Y,ie),K=Y,te=ie;(e=K<2?t:te)||!re;){H||(K?K<3?(K>1&&(V.n=-1),B(K,te)):V.n=te:V.v=te);try{if(Q=2,H){if(K||(X="next"),e=H[X]){if(!(e=e.call(H,te)))throw TypeError("iterator result is not an object");if(!e.done)return e;te=e.value,K<2&&(K=0)}else K===1&&(e=H.return)&&e.call(H),K<2&&(te=TypeError("The iterator does not provide a '"+X+"' method"),K=1);H=t}else if((e=(re=V.n<0)?te:U.call(J,V))!==c)break}catch(ue){H=t,K=1,te=ue}finally{Q=1}}return{value:e,done:re}}})(l,v,E),!0),C}o(s,"i");var c={};function d(){}o(d,"Generator");function p(){}o(p,"GeneratorFunction");function m(){}o(m,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var y=[][n]?e(e([][n]())):(ir(e={},n,function(){return this}),e),h=m.prototype=d.prototype=Object.create(y);function f(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,m):(l.__proto__=m,ir(l,i,"GeneratorFunction")),l.prototype=Object.create(h),l}return o(f,"f"),p.prototype=m,ir(h,"constructor",m),ir(m,"constructor",p),p.displayName="GeneratorFunction",ir(m,i,"GeneratorFunction"),ir(h),ir(h,i,"Generator"),ir(h,n,function(){return this}),ir(h,"toString",function(){return"[object Generator]"}),(ar=o(function(){return{w:s,m:f}},"_regenerator"))()}o(ar,"_regenerator");function ir(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}ir=o(function(c,d,p,m){if(d)i?i(c,d,{value:p,enumerable:!m,configurable:!m,writable:!m}):c[d]=p;else{var y=o(function(f,l){ir(c,f,function(g){return this._invoke(f,l,g)})},"o");y("next",0),y("throw",1),y("return",2)}},"_regeneratorDefine"),ir(t,e,r,n)}o(ir,"_regeneratorDefine2");function nT(t,e,r,n,i,s,c){try{var d=t[s](c),p=d.value}catch(m){return void r(m)}d.done?e(p):Promise.resolve(p).then(n,i)}o(nT,"asyncGeneratorStep");function vi(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function c(p){nT(s,n,i,c,d,"next",p)}o(c,"_next");function d(p){nT(s,n,i,c,d,"throw",p)}o(d,"_throw"),c(void 0)})}}o(vi,"_asyncToGenerator");var oT=Qw.readFile?(0,rz.promisify)(Qw.readFile):vi(ar().m(o(function t(){return ar().w(function(e){for(;;)switch(e.n){case 0:throw new Da("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),iT="https://oauth2.googleapis.com/token",pz="https://oauth2.googleapis.com/revoke?token=",Da=(function(t){function e(r,n){var i;return lT(this,e),i=iz(this,e,[r]),or(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),uz(e,t),cT(e)})(Qp(Error)),$a=new WeakMap,Zr=new WeakSet,f7=ec.GoogleToken=(function(){function t(e){lT(this,t),nz(this,Zr),or(this,"expiresAt",void 0),or(this,"key",void 0),or(this,"keyFile",void 0),or(this,"iss",void 0),or(this,"sub",void 0),or(this,"scope",void 0),or(this,"rawToken",void 0),or(this,"tokenExpires",void 0),or(this,"email",void 0),or(this,"additionalClaims",void 0),or(this,"eagerRefreshThresholdMillis",void 0),or(this,"transporter",{request:o(function(n){return(0,QN.request)(n)},"request")}),oz(this,$a,void 0),Nr(Zr,this,pT).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(En(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;Nr(Zr,this,aT).call(this,n).then(function(s){return i(null,s)},r);return}return Nr(Zr,this,aT).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=vi(ar().m(o(function n(i){var s,c,d,p,m,y,h;return ar().w(function(f){for(;;)switch(f.n){case 0:s=tz.extname(i),h=s,f.n=h===".json"?1:h===".der"||h===".crt"||h===".pem"?4:h===".p12"||h===".pfx"?6:7;break;case 1:return f.n=2,oT(i,"utf8");case 2:if(c=f.v,d=JSON.parse(c),p=d.private_key,m=d.client_email,!(!p||!m)){f.n=3;break}throw new Da("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return f.a(2,{privateKey:p,clientEmail:m});case 4:return f.n=5,oT(i,"utf8");case 5:return y=f.v,f.a(2,{privateKey:y});case 6:throw new Da("*.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 Da("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return f.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){Nr(Zr,this,sT).call(this).then(function(){return r()},r);return}return Nr(Zr,this,sT).call(this)},"revokeToken")}])})();function aT(t){return ef.apply(this,arguments)}o(aT,"_getTokenAsync");function ef(){return ef=vi(ar().m(o(function t(e){return ar().w(function(r){for(;;)switch(r.n){case 0:if(!(tT($a,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,tT($a,this));case 1:return r.p=1,r.n=2,eT($a,this,Nr(Zr,this,fz).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,eT($a,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),ef.apply(this,arguments)}o(ef,"_getTokenAsync2");function fz(t){return tf.apply(this,arguments)}o(fz,"_getTokenAsyncInner");function tf(){return tf=vi(ar().m(o(function t(e){var r;return ar().w(function(n){for(;;)switch(n.n){case 0:if(!(this.isTokenExpiring()===!1&&e.forceRefresh===!1)){n.n=1;break}return n.a(2,Promise.resolve(this.rawToken));case 1:if(!(!this.key&&!this.keyFile)){n.n=2;break}throw new Error("No key or keyFile set.");case 2:if(!(!this.key&&this.keyFile)){n.n=4;break}return n.n=3,this.getCredentials(this.keyFile);case 3:r=n.v,this.key=r.privateKey,this.iss=r.clientEmail||this.iss,r.clientEmail||Nr(Zr,this,mz).call(this);case 4:return n.a(2,Nr(Zr,this,hz).call(this))}},t,this)},"_callee4"))),tf.apply(this,arguments)}o(tf,"_getTokenAsyncInner2");function mz(){if(!this.iss)throw new Da("email is required.","MISSING_CREDENTIALS")}o(mz,"_ensureEmail");function sT(){return rf.apply(this,arguments)}o(sT,"_revokeTokenAsync");function rf(){return rf=vi(ar().m(o(function t(){var e;return ar().w(function(r){for(;;)switch(r.n){case 0:if(this.accessToken){r.n=1;break}throw new Error("No token to revoke.");case 1:return e=pz+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Nr(Zr,this,pT).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"))),rf.apply(this,arguments)}o(rf,"_revokeTokenAsync2");function pT(){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,En(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(pT,"_configure");function hz(){return nf.apply(this,arguments)}o(hz,"_requestToken");function nf(){return nf=vi(ar().m(o(function t(){var e,r,n,i,s,c,d,p,m,y;return ar().w(function(h){for(;;)switch(h.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:iT,exp:e+3600,iat:e,sub:this.sub},r),i=ez.sign({header:{alg:"RS256"},payload:n,secret:this.key}),h.p=1,h.n=2,this.transporter.request({method:"POST",url:iT,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=h.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,h.a(2,this.rawToken);case 3:throw h.p=3,y=h.v,this.rawToken=void 0,this.tokenExpires=void 0,p=y.response&&(c=y.response)!==null&&c!==void 0&&c.data?(d=y.response)===null||d===void 0?void 0:d.data:{},p.error&&(m=p.error_description?": ".concat(p.error_description):"",y.message="".concat(p.error).concat(m)),y;case 4:return h.a(2)}},t,this,[[1,3]])},"_callee6"))),nf.apply(this,arguments)}o(nf,"_requestToken2")});var sf=D(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.JWTAccess=void 0;var gz=Xp(),yz=kr(),mT={alg:"RS256",typ:"JWT"},af=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new yz.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??300*1e3}getCachedKey(e,r){let n=e;if(r&&Array.isArray(r)&&r.length?n=e?`${e}_${r.join("_")}`:`${r.join("_")}`:typeof r=="string"&&(n=e?`${e}_${r}`:r),!n)throw Error("Scopes or url must be provided");return n}getRequestHeaders(e,r,n){let i=this.getCachedKey(e,n),s=this.cache.get(i),c=Date.now();if(s&&s.expiration-c>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let d=Math.floor(Date.now()/1e3),p=t.getExpirationTime(d),m;if(Array.isArray(n)&&(n=n.join(" ")),n?m={iss:this.email,sub:this.email,scope:n,exp:p,iat:d}:m={iss:this.email,sub:this.email,aud:e,exp:p,iat:d},r){for(let g in m)if(r[g])throw new Error(`The '${g}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let y=this.keyId?{...mT,kid:this.keyId}:mT,h=Object.assign(m,r),f=gz.sign({header:y,payload:h,secret:this.key}),l=new Headers({authorization:`Bearer ${f}`});return this.cache.set(i,{expiration:p*1e3,headers:l}),l}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)}})})}};tc.JWTAccess=af});var cf=D(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.JWT=void 0;var hT=fT(),vz=sf(),_z=wo(),rc=nr(),uf=class t extends _z.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!==rc.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==rc.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${rc.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 vz.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!==rc.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 hT.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 hT.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.")}};nc.JWT=uf});var df=D(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.UserRefreshClient=_i.USER_REFRESH_ACCOUNT_TYPE=void 0;var bz=wo(),Ez=nr();_i.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var lf=class t extends bz.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,s){let c=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:s};super(c),this._refreshToken=c.refreshToken,this.credentials.refresh_token=c.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let r={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e})};return Ez.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}};_i.UserRefreshClient=lf});var ff=D(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.Impersonated=bi.IMPERSONATED_ACCOUNT_TYPE=void 0;var gT=wo(),Sz=ht(),wz=kr();bi.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var pf=class t extends gT.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 gT.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,wz.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 Sz.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}};bi.Impersonated=pf});var hf=D(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.OAuthClientAuthHandler=void 0;Ua.getErrorFromOAuthErrorResponse=xz;var Ei=ht(),Tz=Aa(),Pz=["PUT","POST","PATCH"],mf=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,Tz.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new Ei.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new Ei.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=Ei.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=Ei.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=Ei.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${i}`);Ei.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!Pz.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"]}}}};Ua.OAuthClientAuthHandler=mf;function xz(t,e){let r=t.error,n=t.error_description,i=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof i<"u"&&(s+=` - ${i}`);let c=new Error(s);if(e){let d=Object.keys(e);e.stack&&d.push("stack"),d.forEach(p=>{p!=="message"&&Object.defineProperty(c,p,{value:e[p],writable:!1,enumerable:!0})})}return c}o(xz,"getErrorFromOAuthErrorResponse")});var ic=D(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.StsCredentials=void 0;var Az=ht(),Iz=nr(),yT=hf(),Rz=kr(),gf=class t extends yT.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,Rz.removeUndefinedValuesInObject)(i))};Iz.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let c=await this.transporter.request(s),d=c.data;return d.res=c,d}catch(c){throw c instanceof Az.GaxiosError&&c.response?(0,yT.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}};oc.StsCredentials=gf});var Xn=D(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.BaseExternalAccountClient=_r.CLOUD_RESOURCE_MANAGER=_r.EXTERNAL_ACCOUNT_TYPE=_r.EXPIRATION_TIME_OFFSET=void 0;var Cz=ht(),Oz=require("stream"),yf=nr(),kz=ic(),vT=kr(),$z=Op(),Dz="urn:ietf:params:oauth:grant-type:token-exchange",Nz="urn:ietf:params:oauth:token-type:access_token",vf="https://www.googleapis.com/auth/cloud-platform",zz=3600;_r.EXPIRATION_TIME_OFFSET=300*1e3;_r.EXTERNAL_ACCOUNT_TYPE="external_account";_r.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var Uz="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",Mz="https://sts.{universeDomain}/v1/token",_f=class t extends yf.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,vT.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==_r.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${_r.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")??Mz.replace("{universeDomain}",this.universeDomain);let c=r.get("subject_token_type"),d=r.get("workforce_pool_user_project"),p=r.get("service_account_impersonation_url"),m=r.get("service_account_impersonation"),y=(0,vT.originalOrCamelOptions)(m).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 kz.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[vf],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=c,this.workforcePoolUserProject=d;let h=new RegExp(Uz);if(this.workforcePoolUserProject&&!this.audience.match(h))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=p,this.serviceAccountImpersonationLifetime=y,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=zz),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}`};yf.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=Cz.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof Oz.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),r={grantType:Dz,audience:this.audience,requestedTokenType:Nz,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[vf]: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"}};yf.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||[vf]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${$z.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};_r.BaseExternalAccountClient=_f});var _T=D(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.FileSubjectTokenSupplier=void 0;var Ef=require("util"),Sf=require("fs"),Lz=(0,Ef.promisify)(Sf.readFile??(()=>{})),jz=(0,Ef.promisify)(Sf.realpath??(()=>{})),Fz=(0,Ef.promisify)(Sf.lstat??(()=>{})),bf=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 jz(e),!(await Fz(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 Lz(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}};ac.FileSubjectTokenSupplier=bf});var bT=D(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.UrlSubjectTokenSupplier=void 0;var qz=nr(),wf=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};qz.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}};sc.UrlSubjectTokenSupplier=wf});var ET=D(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.CertificateSubjectTokenSupplier=sr.InvalidConfigurationError=sr.CertificateSourceUnavailableError=sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var uc=kr(),cc=require("fs"),lc=require("crypto"),Bz=require("https");sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Kr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};sr.CertificateSourceUnavailableError=Kr;var br=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};sr.InvalidConfigurationError=br;var Tf=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new br("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new br("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new br("Cannot create mTLS Agent with missing certificate or key");return new Bz.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,uc.isValidFile)(e))return e;throw new Kr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,uc.isValidFile)(r))return r;throw new Kr(`Path from environment variable "${sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,uc.getWellKnownCertificateConfigFileLocation)();if(await(0,uc.isValidFile)(n))return n;throw new Kr(`Could not find certificate configuration file. Searched override path, the "${sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await cc.promises.readFile(e,"utf8")}catch{throw new Kr(`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 br(`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 br?n:new br(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await cc.promises.readFile(e),new lc.X509Certificate(n)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Kr(`Failed to read certificate file at ${e}: ${c}`)}try{i=await cc.promises.readFile(r),(0,lc.createPrivateKey)(i)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Kr(`Failed to read private key file at ${r}: ${c}`)}return{cert:n,key:i}}async#n(e){let r=new lc.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await cc.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((p,m)=>{try{return new lc.X509Certificate(p)}catch(y){let h=y instanceof Error?y.message:String(y);throw new br(`Failed to parse certificate at index ${m} in trust chain file ${this.trustChainPath}: ${h}`)}}),c=s.findIndex(p=>r.raw.equals(p.raw)),d;if(c===-1)d=[r,...s];else if(c===0)d=s;else throw new br(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${c}).`);return JSON.stringify(d.map(p=>p.raw.toString("base64")))}catch(n){if(n instanceof br)throw n;let i=n instanceof Error?n.message:String(n);throw new Kr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};sr.CertificateSubjectTokenSupplier=Tf});var Af=D(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.IdentityPoolClient=void 0;var Vz=Xn(),Pf=kr(),Gz=_T(),Hz=bT(),ST=ET(),Wz=ic(),wT=ht(),xf=class t extends Vz.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,Pf.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,Pf.originalOrCamelOptions)(n),c=(0,Pf.originalOrCamelOptions)(s.get("format")),d=c.get("type")||"text",p=c.get("subject_token_field_name");if(d!=="json"&&d!=="text")throw new Error(`Invalid credential_source format "${d}"`);if(d==="json"&&!p)throw new Error("Missing subject_token_field_name for JSON credential_source format");let m=s.get("file"),y=s.get("url"),h=s.get("certificate"),f=s.get("headers");if(m&&y||y&&h||m&&h)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(m)this.credentialSourceType="file",this.subjectTokenSupplier=new Gz.FileSubjectTokenSupplier({filePath:m,formatType:d,subjectTokenFieldName:p});else if(y)this.credentialSourceType="url",this.subjectTokenSupplier=new Hz.UrlSubjectTokenSupplier({url:y,formatType:d,subjectTokenFieldName:p,headers:f,additionalGaxiosOptions:t.RETRY_CONFIG});else if(h){this.credentialSourceType="certificate";let l=new ST.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:h.use_default_certificate_config,certificateConfigLocation:h.certificate_config_location,trustChainPath:h.trust_chain_path});this.subjectTokenSupplier=l}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 ST.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new Wz.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}};dc.IdentityPoolClient=xf});var Rf=D(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.AwsRequestSigner=void 0;var pc=ht(),PT=Aa(),TT="AWS4-HMAC-SHA256",Zz="aws4_request",If=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,PT.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let r=typeof e.data=="object"?JSON.stringify(e.data):e.data,n=e.url,i=e.method||"GET",s=e.body||r,c=e.headers,d=await this.getCredentials(),p=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 m=await Jz({crypto:this.crypto,host:p.host,canonicalUri:p.pathname,canonicalQuerystring:p.search.slice(1),method:i,region:this.region,securityCredentials:d,requestPayload:s,additionalAmzHeaders:c}),y=pc.Gaxios.mergeHeaders(m.amzDate?{"x-amz-date":m.amzDate}:{},{authorization:m.authorizationHeader,host:p.host},c||{});d.token&&pc.Gaxios.mergeHeaders(y,{"x-amz-security-token":d.token});let h={url:n,method:i,headers:y};return s!==void 0&&(h.body=s),h}};fc.AwsRequestSigner=If;async function Ma(t,e,r){return await t.signWithHmacSha256(e,r)}o(Ma,"sign");async function Kz(t,e,r,n,i){let s=await Ma(t,`AWS4${e}`,r),c=await Ma(t,s,n),d=await Ma(t,c,i);return await Ma(t,d,"aws4_request")}o(Kz,"getSigningKey");async function Jz(t){let e=pc.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,s=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),c=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let d=pc.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),p="",m=[...d.keys()].sort();m.forEach(C=>{p+=`${C}:${d.get(C)}
|
|
40
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Oa="secret must be a string or buffer",hi="key must be a string or a buffer",CN="key must be a string, a buffer or an object",Wp=typeof vr.createPublicKey=="function";Wp&&(hi+=" or a KeyObject",Oa+="or a KeyObject");function Rw(t){if(!gi.isBuffer(t)&&typeof t!="string"&&(!Wp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Dr(hi)}o(Rw,"checkIsPublicKey");function Cw(t){if(!gi.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Dr(CN)}o(Cw,"checkIsPrivateKey");function ON(t){if(!gi.isBuffer(t)){if(typeof t=="string")return t;if(!Wp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Dr(Oa)}}o(ON,"checkIsSecretKey");function Zp(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Zp,"fromBase64");function Ow(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(Ow,"toBase64");function Dr(t){var e=[].slice.call(arguments,1),r=Aw.format.bind(Aw,t).apply(null,e);return new TypeError(r)}o(Dr,"typeError");function kN(t){return gi.isBuffer(t)||typeof t=="string"}o(kN,"bufferOrString");function ka(t){return kN(t)||(t=JSON.stringify(t)),t}o(ka,"normalizeInput");function kw(t){return o(function(r,n){ON(n),r=ka(r);var i=vr.createHmac("sha"+t,n),s=(i.update(r),i.digest("base64"));return Zp(s)},"sign")}o(kw,"createHmacSigner");var Hp,$N="timingSafeEqual"in vr?o(function(e,r){return e.byteLength!==r.byteLength?!1:vr.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return Hp||(Hp=xw()),Hp(e,r)},"timingSafeEqual");function DN(t){return o(function(r,n,i){var s=kw(t)(r,i);return $N(gi.from(n),gi.from(s))},"verify")}o(DN,"createHmacVerifier");function $w(t){return o(function(r,n){Cw(n),r=ka(r);var i=vr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign(n,"base64"));return Zp(s)},"sign")}o($w,"createKeySigner");function Dw(t){return o(function(r,n,i){Rw(i),r=ka(r),n=Ow(n);var s=vr.createVerify("RSA-SHA"+t);return s.update(r),s.verify(i,n,"base64")},"verify")}o(Dw,"createKeyVerifier");function NN(t){return o(function(r,n){Cw(n),r=ka(r);var i=vr.createSign("RSA-SHA"+t),s=(i.update(r),i.sign({key:n,padding:vr.constants.RSA_PKCS1_PSS_PADDING,saltLength:vr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Zp(s)},"sign")}o(NN,"createPSSKeySigner");function zN(t){return o(function(r,n,i){Rw(i),r=ka(r),n=Ow(n);var s=vr.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:i,padding:vr.constants.RSA_PKCS1_PSS_PADDING,saltLength:vr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(zN,"createPSSKeyVerifier");function UN(t){var e=$w(t);return o(function(){var n=e.apply(null,arguments);return n=Iw.derToJose(n,"ES"+t),n},"sign")}o(UN,"createECDSASigner");function MN(t){var e=Dw(t);return o(function(n,i,s){i=Iw.joseToDer(i,"ES"+t).toString("base64");var c=e(n,i,s);return c},"verify")}o(MN,"createECDSAVerifer");function LN(){return o(function(){return""},"sign")}o(LN,"createNoneSigner");function jN(){return o(function(e,r){return r===""},"verify")}o(jN,"createNoneVerifier");Nw.exports=o(function(e){var r={hs:kw,rs:$w,ps:NN,es:UN,none:LN},n={hs:DN,rs:Dw,ps:zN,es:MN,none:jN},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Dr(RN,e);var s=(i[1]||i[3]).toLowerCase(),c=i[2];return{sign:r[s](c),verify:n[s](c)}},"jwa")});var Jp=D((c7,zw)=>{var FN=require("buffer").Buffer;zw.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||FN.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var qw=D((d7,Fw)=>{var qN=pi().Buffer,Uw=Vp(),BN=Kp(),VN=require("stream"),Mw=Jp(),Yp=require("util");function Lw(t,e){return qN.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(Lw,"base64url");function GN(t,e,r){r=r||"utf8";var n=Lw(Mw(t),"binary"),i=Lw(Mw(e),r);return Yp.format("%s.%s",n,i)}o(GN,"jwsSecuredInput");function jw(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=BN(e.alg),c=GN(e,r,i),d=s.sign(c,n);return Yp.format("%s.%s",c,d)}o(jw,"jwsSign");function Yu(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 Uw(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Uw(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(Yu,"SignStream");Yp.inherits(Yu,VN);Yu.prototype.sign=o(function(){try{var e=jw({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");Yu.sign=jw;Fw.exports=Yu});var Xw=D((f7,Yw)=>{var Vw=pi().Buffer,Bw=Vp(),HN=Kp(),WN=require("stream"),Gw=Jp(),ZN=require("util"),KN=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function JN(t){return Object.prototype.toString.call(t)==="[object Object]"}o(JN,"isObject");function YN(t){if(JN(t))return t;try{return JSON.parse(t)}catch{return}}o(YN,"safeJsonParse");function Hw(t){var e=t.split(".",1)[0];return YN(Vw.from(e,"base64").toString("binary"))}o(Hw,"headerFromJWS");function XN(t){return t.split(".",2).join(".")}o(XN,"securedInputFromJWS");function Ww(t){return t.split(".")[2]}o(Ww,"signatureFromJWS");function QN(t,e){e=e||"utf8";var r=t.split(".")[1];return Vw.from(r,"base64").toString(e)}o(QN,"payloadFromJWS");function Zw(t){return KN.test(t)&&!!Hw(t)}o(Zw,"isValidJws");function Kw(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=Gw(t);var i=Ww(t),s=XN(t),c=HN(e);return c.verify(s,i,r)}o(Kw,"jwsVerify");function Jw(t,e){if(e=e||{},t=Gw(t),!Zw(t))return null;var r=Hw(t);if(!r)return null;var n=QN(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:Ww(t)}}o(Jw,"jwsDecode");function yi(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 Bw(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new Bw(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(yi,"VerifyStream");ZN.inherits(yi,WN);yi.prototype.verify=o(function(){try{var e=Kw(this.signature.buffer,this.algorithm,this.key.buffer),r=Jw(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");yi.decode=Jw;yi.isValid=Zw;yi.verify=Kw;Yw.exports=yi});var Xp=D(Yn=>{var Qw=qw(),Xu=Xw(),ez=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Yn.ALGORITHMS=ez;Yn.sign=Qw.sign;Yn.verify=Xu.verify;Yn.decode=Xu.decode;Yn.isValid=Xu.isValid;Yn.createSign=o(function(e){return new Qw(e)},"createSign");Yn.createVerify=o(function(e){return new Xu(e)},"createVerify")});var mT=D(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.GoogleToken=void 0;var eT=Qu(require("fs")),tz=ht(),rz=Qu(Xp()),nz=Qu(require("path")),oz=require("util");function Qu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(Qu=o(function(s,c){if(!c&&s&&s.__esModule)return s;var d,p,m={__proto__:null,default:s};if(s===null||En(s)!="object"&&typeof s!="function")return m;if(d=c?n:r){if(d.has(s))return d.get(s);d.set(s,m)}for(var y in s)y!=="default"&&{}.hasOwnProperty.call(s,y)&&((p=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,y))&&(p.get||p.set)?d(m,y,p):m[y]=s[y]);return m},"_interopRequireWildcard"))(t,e)}o(Qu,"_interopRequireWildcard");function En(t){"@babel/helpers - typeof";return En=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},En(t)}o(En,"_typeof");function iz(t,e){cT(t,e),e.add(t)}o(iz,"_classPrivateMethodInitSpec");function az(t,e,r){cT(t,e),e.set(t,r)}o(az,"_classPrivateFieldInitSpec");function cT(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(cT,"_checkPrivateRedeclaration");function tT(t,e,r){return t.set(Nr(t,e),r),r}o(tT,"_classPrivateFieldSet");function rT(t,e){return t.get(Nr(t,e))}o(rT,"_classPrivateFieldGet");function Nr(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(Nr,"_assertClassBrand");function nT(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pT(n.key),n)}}o(nT,"_defineProperties");function lT(t,e,r){return e&&nT(t.prototype,e),r&&nT(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(lT,"_createClass");function dT(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(dT,"_classCallCheck");function sz(t,e,r){return e=za(e),uz(t,of()?Reflect.construct(e,r||[],za(t).constructor):e.apply(t,r))}o(sz,"_callSuper");function uz(t,e){if(e&&(En(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cz(t)}o(uz,"_possibleConstructorReturn");function cz(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(cz,"_assertThisInitialized");function lz(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Na(t,e)}o(lz,"_inherits");function Qp(t){var e=typeof Map=="function"?new Map:void 0;return Qp=o(function(n){if(n===null||!pz(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 dz(n,arguments,za(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Na(i,n)},"_wrapNativeSuper"),Qp(t)}o(Qp,"_wrapNativeSuper");function dz(t,e,r){if(of())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Na(i,r.prototype),i}o(dz,"_construct");function of(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(of=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(of,"_isNativeReflectConstruct");function pz(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(pz,"_isNativeFunction");function Na(t,e){return Na=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Na(t,e)}o(Na,"_setPrototypeOf");function za(t){return za=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},za(t)}o(za,"_getPrototypeOf");function or(t,e,r){return(e=pT(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(or,"_defineProperty");function pT(t){var e=fz(t,"string");return En(e)=="symbol"?e:e+""}o(pT,"_toPropertyKey");function fz(t,e){if(En(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(En(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(fz,"_toPrimitive");function ar(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(l,g,v,E){var b=g&&g.prototype instanceof d?g:d,C=Object.create(b.prototype);return ir(C,"_invoke",(function(U,J,Z){var H,K,te,Q=0,xe=Z||[],re=!1,V={p:0,n:0,v:t,a:B,f:B.bind(t,4),d:o(function(Y,ie){return H=Y,K=0,te=t,V.n=ie,c},"d")};function B(X,Y){for(K=X,te=Y,e=0;!re&&Q&&!ie&&e<xe.length;e++){var ie,ue=xe[e],Ce=V.p,De=ue[2];X>3?(ie=De===Y)&&(te=ue[(K=ue[4])?5:(K=3,3)],ue[4]=ue[5]=t):ue[0]<=Ce&&((ie=X<2&&Ce<ue[1])?(K=0,V.v=Y,V.n=ue[1]):Ce<De&&(ie=X<3||ue[0]>Y||Y>De)&&(ue[4]=X,ue[5]=Y,V.n=De,K=0))}if(ie||X>1)return c;throw re=!0,Y}return o(B,"d"),function(X,Y,ie){if(Q>1)throw TypeError("Generator is already running");for(re&&Y===1&&B(Y,ie),K=Y,te=ie;(e=K<2?t:te)||!re;){H||(K?K<3?(K>1&&(V.n=-1),B(K,te)):V.n=te:V.v=te);try{if(Q=2,H){if(K||(X="next"),e=H[X]){if(!(e=e.call(H,te)))throw TypeError("iterator result is not an object");if(!e.done)return e;te=e.value,K<2&&(K=0)}else K===1&&(e=H.return)&&e.call(H),K<2&&(te=TypeError("The iterator does not provide a '"+X+"' method"),K=1);H=t}else if((e=(re=V.n<0)?te:U.call(J,V))!==c)break}catch(ue){H=t,K=1,te=ue}finally{Q=1}}return{value:e,done:re}}})(l,v,E),!0),C}o(s,"i");var c={};function d(){}o(d,"Generator");function p(){}o(p,"GeneratorFunction");function m(){}o(m,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var y=[][n]?e(e([][n]())):(ir(e={},n,function(){return this}),e),h=m.prototype=d.prototype=Object.create(y);function f(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,m):(l.__proto__=m,ir(l,i,"GeneratorFunction")),l.prototype=Object.create(h),l}return o(f,"f"),p.prototype=m,ir(h,"constructor",m),ir(m,"constructor",p),p.displayName="GeneratorFunction",ir(m,i,"GeneratorFunction"),ir(h),ir(h,i,"Generator"),ir(h,n,function(){return this}),ir(h,"toString",function(){return"[object Generator]"}),(ar=o(function(){return{w:s,m:f}},"_regenerator"))()}o(ar,"_regenerator");function ir(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}ir=o(function(c,d,p,m){if(d)i?i(c,d,{value:p,enumerable:!m,configurable:!m,writable:!m}):c[d]=p;else{var y=o(function(f,l){ir(c,f,function(g){return this._invoke(f,l,g)})},"o");y("next",0),y("throw",1),y("return",2)}},"_regeneratorDefine"),ir(t,e,r,n)}o(ir,"_regeneratorDefine2");function oT(t,e,r,n,i,s,c){try{var d=t[s](c),p=d.value}catch(m){return void r(m)}d.done?e(p):Promise.resolve(p).then(n,i)}o(oT,"asyncGeneratorStep");function vi(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function c(p){oT(s,n,i,c,d,"next",p)}o(c,"_next");function d(p){oT(s,n,i,c,d,"throw",p)}o(d,"_throw"),c(void 0)})}}o(vi,"_asyncToGenerator");var iT=eT.readFile?(0,oz.promisify)(eT.readFile):vi(ar().m(o(function t(){return ar().w(function(e){for(;;)switch(e.n){case 0:throw new Da("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),aT="https://oauth2.googleapis.com/token",mz="https://oauth2.googleapis.com/revoke?token=",Da=(function(t){function e(r,n){var i;return dT(this,e),i=sz(this,e,[r]),or(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),lz(e,t),lT(e)})(Qp(Error)),$a=new WeakMap,Zr=new WeakSet,y7=ec.GoogleToken=(function(){function t(e){dT(this,t),iz(this,Zr),or(this,"expiresAt",void 0),or(this,"key",void 0),or(this,"keyFile",void 0),or(this,"iss",void 0),or(this,"sub",void 0),or(this,"scope",void 0),or(this,"rawToken",void 0),or(this,"tokenExpires",void 0),or(this,"email",void 0),or(this,"additionalClaims",void 0),or(this,"eagerRefreshThresholdMillis",void 0),or(this,"transporter",{request:o(function(n){return(0,tz.request)(n)},"request")}),az(this,$a,void 0),Nr(Zr,this,fT).call(this,e)}return o(t,"GoogleToken"),lT(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(En(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;Nr(Zr,this,sT).call(this,n).then(function(s){return i(null,s)},r);return}return Nr(Zr,this,sT).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=vi(ar().m(o(function n(i){var s,c,d,p,m,y,h;return ar().w(function(f){for(;;)switch(f.n){case 0:s=nz.extname(i),h=s,f.n=h===".json"?1:h===".der"||h===".crt"||h===".pem"?4:h===".p12"||h===".pfx"?6:7;break;case 1:return f.n=2,iT(i,"utf8");case 2:if(c=f.v,d=JSON.parse(c),p=d.private_key,m=d.client_email,!(!p||!m)){f.n=3;break}throw new Da("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return f.a(2,{privateKey:p,clientEmail:m});case 4:return f.n=5,iT(i,"utf8");case 5:return y=f.v,f.a(2,{privateKey:y});case 6:throw new Da("*.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 Da("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return f.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){Nr(Zr,this,uT).call(this).then(function(){return r()},r);return}return Nr(Zr,this,uT).call(this)},"revokeToken")}])})();function sT(t){return ef.apply(this,arguments)}o(sT,"_getTokenAsync");function ef(){return ef=vi(ar().m(o(function t(e){return ar().w(function(r){for(;;)switch(r.n){case 0:if(!(rT($a,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,rT($a,this));case 1:return r.p=1,r.n=2,tT($a,this,Nr(Zr,this,hz).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,tT($a,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),ef.apply(this,arguments)}o(ef,"_getTokenAsync2");function hz(t){return tf.apply(this,arguments)}o(hz,"_getTokenAsyncInner");function tf(){return tf=vi(ar().m(o(function t(e){var r;return ar().w(function(n){for(;;)switch(n.n){case 0:if(!(this.isTokenExpiring()===!1&&e.forceRefresh===!1)){n.n=1;break}return n.a(2,Promise.resolve(this.rawToken));case 1:if(!(!this.key&&!this.keyFile)){n.n=2;break}throw new Error("No key or keyFile set.");case 2:if(!(!this.key&&this.keyFile)){n.n=4;break}return n.n=3,this.getCredentials(this.keyFile);case 3:r=n.v,this.key=r.privateKey,this.iss=r.clientEmail||this.iss,r.clientEmail||Nr(Zr,this,gz).call(this);case 4:return n.a(2,Nr(Zr,this,yz).call(this))}},t,this)},"_callee4"))),tf.apply(this,arguments)}o(tf,"_getTokenAsyncInner2");function gz(){if(!this.iss)throw new Da("email is required.","MISSING_CREDENTIALS")}o(gz,"_ensureEmail");function uT(){return rf.apply(this,arguments)}o(uT,"_revokeTokenAsync");function rf(){return rf=vi(ar().m(o(function t(){var e;return ar().w(function(r){for(;;)switch(r.n){case 0:if(this.accessToken){r.n=1;break}throw new Error("No token to revoke.");case 1:return e=mz+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Nr(Zr,this,fT).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"))),rf.apply(this,arguments)}o(rf,"_revokeTokenAsync2");function fT(){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,En(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(fT,"_configure");function yz(){return nf.apply(this,arguments)}o(yz,"_requestToken");function nf(){return nf=vi(ar().m(o(function t(){var e,r,n,i,s,c,d,p,m,y;return ar().w(function(h){for(;;)switch(h.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:aT,exp:e+3600,iat:e,sub:this.sub},r),i=rz.sign({header:{alg:"RS256"},payload:n,secret:this.key}),h.p=1,h.n=2,this.transporter.request({method:"POST",url:aT,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=h.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,h.a(2,this.rawToken);case 3:throw h.p=3,y=h.v,this.rawToken=void 0,this.tokenExpires=void 0,p=y.response&&(c=y.response)!==null&&c!==void 0&&c.data?(d=y.response)===null||d===void 0?void 0:d.data:{},p.error&&(m=p.error_description?": ".concat(p.error_description):"",y.message="".concat(p.error).concat(m)),y;case 4:return h.a(2)}},t,this,[[1,3]])},"_callee6"))),nf.apply(this,arguments)}o(nf,"_requestToken2")});var sf=D(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.JWTAccess=void 0;var vz=Xp(),_z=kr(),hT={alg:"RS256",typ:"JWT"},af=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new _z.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??300*1e3}getCachedKey(e,r){let n=e;if(r&&Array.isArray(r)&&r.length?n=e?`${e}_${r.join("_")}`:`${r.join("_")}`:typeof r=="string"&&(n=e?`${e}_${r}`:r),!n)throw Error("Scopes or url must be provided");return n}getRequestHeaders(e,r,n){let i=this.getCachedKey(e,n),s=this.cache.get(i),c=Date.now();if(s&&s.expiration-c>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let d=Math.floor(Date.now()/1e3),p=t.getExpirationTime(d),m;if(Array.isArray(n)&&(n=n.join(" ")),n?m={iss:this.email,sub:this.email,scope:n,exp:p,iat:d}:m={iss:this.email,sub:this.email,aud:e,exp:p,iat:d},r){for(let g in m)if(r[g])throw new Error(`The '${g}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let y=this.keyId?{...hT,kid:this.keyId}:hT,h=Object.assign(m,r),f=vz.sign({header:y,payload:h,secret:this.key}),l=new Headers({authorization:`Bearer ${f}`});return this.cache.set(i,{expiration:p*1e3,headers:l}),l}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)}})})}};tc.JWTAccess=af});var cf=D(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.JWT=void 0;var gT=mT(),bz=sf(),Ez=wo(),rc=nr(),uf=class t extends Ez.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!==rc.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==rc.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${rc.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 bz.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!==rc.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 gT.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:{target_audience:e},transporter:this.transporter});if(await r.getToken({forceRefresh:!0}),!r.idToken)throw new Error("Unknown error: Failed to fetch ID token");return r.idToken}hasUserScopes(){return this.scopes?this.scopes.length>0:!1}hasAnyScopes(){return!!(this.scopes&&this.scopes.length>0||this.defaultScopes&&this.defaultScopes.length>0)}authorize(e){if(e)this.authorizeAsync().then(r=>e(null,r),e);else return this.authorizeAsync()}async authorizeAsync(){let e=await this.refreshToken();if(!e)throw new Error("No result returned");return this.credentials=e.tokens,this.credentials.refresh_token="jwt-placeholder",this.key=this.gtoken.key,this.email=this.gtoken.iss,e.tokens}async refreshTokenNoCache(){let e=this.createGToken(),n={access_token:(await e.getToken({forceRefresh:this.isTokenExpiring()})).access_token,token_type:"Bearer",expiry_date:e.expiresAt,id_token:e.idToken};return this.emit("tokens",n),{res:null,tokens:n}}createGToken(){return this.gtoken||(this.gtoken=new gT.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let 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.")}};nc.JWT=uf});var df=D(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.UserRefreshClient=_i.USER_REFRESH_ACCOUNT_TYPE=void 0;var Sz=wo(),wz=nr();_i.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var lf=class t extends Sz.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,s){let c=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:s};super(c),this._refreshToken=c.refreshToken,this.credentials.refresh_token=c.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let r={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e})};return wz.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}};_i.UserRefreshClient=lf});var ff=D(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.Impersonated=bi.IMPERSONATED_ACCOUNT_TYPE=void 0;var yT=wo(),Tz=ht(),Pz=kr();bi.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var pf=class t extends yT.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 yT.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,Pz.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 Tz.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}};bi.Impersonated=pf});var hf=D(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.OAuthClientAuthHandler=void 0;Ua.getErrorFromOAuthErrorResponse=Iz;var Ei=ht(),xz=Aa(),Az=["PUT","POST","PATCH"],mf=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,xz.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new Ei.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new Ei.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=Ei.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=Ei.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=Ei.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${i}`);Ei.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!Az.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"]}}}};Ua.OAuthClientAuthHandler=mf;function Iz(t,e){let r=t.error,n=t.error_description,i=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof i<"u"&&(s+=` - ${i}`);let c=new Error(s);if(e){let d=Object.keys(e);e.stack&&d.push("stack"),d.forEach(p=>{p!=="message"&&Object.defineProperty(c,p,{value:e[p],writable:!1,enumerable:!0})})}return c}o(Iz,"getErrorFromOAuthErrorResponse")});var ic=D(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.StsCredentials=void 0;var Rz=ht(),Cz=nr(),vT=hf(),Oz=kr(),gf=class t extends vT.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,Oz.removeUndefinedValuesInObject)(i))};Cz.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let c=await this.transporter.request(s),d=c.data;return d.res=c,d}catch(c){throw c instanceof Rz.GaxiosError&&c.response?(0,vT.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}};oc.StsCredentials=gf});var Xn=D(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.BaseExternalAccountClient=_r.CLOUD_RESOURCE_MANAGER=_r.EXTERNAL_ACCOUNT_TYPE=_r.EXPIRATION_TIME_OFFSET=void 0;var kz=ht(),$z=require("stream"),yf=nr(),Dz=ic(),_T=kr(),Nz=Op(),zz="urn:ietf:params:oauth:grant-type:token-exchange",Uz="urn:ietf:params:oauth:token-type:access_token",vf="https://www.googleapis.com/auth/cloud-platform",Mz=3600;_r.EXPIRATION_TIME_OFFSET=300*1e3;_r.EXTERNAL_ACCOUNT_TYPE="external_account";_r.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var Lz="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",jz="https://sts.{universeDomain}/v1/token",_f=class t extends yf.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,_T.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==_r.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${_r.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")??jz.replace("{universeDomain}",this.universeDomain);let c=r.get("subject_token_type"),d=r.get("workforce_pool_user_project"),p=r.get("service_account_impersonation_url"),m=r.get("service_account_impersonation"),y=(0,_T.originalOrCamelOptions)(m).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 Dz.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[vf],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=c,this.workforcePoolUserProject=d;let h=new RegExp(Lz);if(this.workforcePoolUserProject&&!this.audience.match(h))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=p,this.serviceAccountImpersonationLifetime=y,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=Mz),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}`};yf.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=kz.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof $z.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),r={grantType:zz,audience:this.audience,requestedTokenType:Uz,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[vf]: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"}};yf.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||[vf]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${Nz.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};_r.BaseExternalAccountClient=_f});var bT=D(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.FileSubjectTokenSupplier=void 0;var Ef=require("util"),Sf=require("fs"),Fz=(0,Ef.promisify)(Sf.readFile??(()=>{})),qz=(0,Ef.promisify)(Sf.realpath??(()=>{})),Bz=(0,Ef.promisify)(Sf.lstat??(()=>{})),bf=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 qz(e),!(await Bz(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 Fz(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}};ac.FileSubjectTokenSupplier=bf});var ET=D(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.UrlSubjectTokenSupplier=void 0;var Vz=nr(),wf=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};Vz.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}};sc.UrlSubjectTokenSupplier=wf});var ST=D(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.CertificateSubjectTokenSupplier=sr.InvalidConfigurationError=sr.CertificateSourceUnavailableError=sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var uc=kr(),cc=require("fs"),lc=require("crypto"),Gz=require("https");sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var Kr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};sr.CertificateSourceUnavailableError=Kr;var br=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};sr.InvalidConfigurationError=br;var Tf=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new br("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new br("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new br("Cannot create mTLS Agent with missing certificate or key");return new Gz.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,uc.isValidFile)(e))return e;throw new Kr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,uc.isValidFile)(r))return r;throw new Kr(`Path from environment variable "${sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,uc.getWellKnownCertificateConfigFileLocation)();if(await(0,uc.isValidFile)(n))return n;throw new Kr(`Could not find certificate configuration file. Searched override path, the "${sr.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await cc.promises.readFile(e,"utf8")}catch{throw new Kr(`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 br(`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 br?n:new br(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await cc.promises.readFile(e),new lc.X509Certificate(n)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Kr(`Failed to read certificate file at ${e}: ${c}`)}try{i=await cc.promises.readFile(r),(0,lc.createPrivateKey)(i)}catch(s){let c=s instanceof Error?s.message:String(s);throw new Kr(`Failed to read private key file at ${r}: ${c}`)}return{cert:n,key:i}}async#n(e){let r=new lc.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await cc.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((p,m)=>{try{return new lc.X509Certificate(p)}catch(y){let h=y instanceof Error?y.message:String(y);throw new br(`Failed to parse certificate at index ${m} in trust chain file ${this.trustChainPath}: ${h}`)}}),c=s.findIndex(p=>r.raw.equals(p.raw)),d;if(c===-1)d=[r,...s];else if(c===0)d=s;else throw new br(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${c}).`);return JSON.stringify(d.map(p=>p.raw.toString("base64")))}catch(n){if(n instanceof br)throw n;let i=n instanceof Error?n.message:String(n);throw new Kr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};sr.CertificateSubjectTokenSupplier=Tf});var Af=D(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.IdentityPoolClient=void 0;var Hz=Xn(),Pf=kr(),Wz=bT(),Zz=ET(),wT=ST(),Kz=ic(),TT=ht(),xf=class t extends Hz.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,Pf.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,Pf.originalOrCamelOptions)(n),c=(0,Pf.originalOrCamelOptions)(s.get("format")),d=c.get("type")||"text",p=c.get("subject_token_field_name");if(d!=="json"&&d!=="text")throw new Error(`Invalid credential_source format "${d}"`);if(d==="json"&&!p)throw new Error("Missing subject_token_field_name for JSON credential_source format");let m=s.get("file"),y=s.get("url"),h=s.get("certificate"),f=s.get("headers");if(m&&y||y&&h||m&&h)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(m)this.credentialSourceType="file",this.subjectTokenSupplier=new Wz.FileSubjectTokenSupplier({filePath:m,formatType:d,subjectTokenFieldName:p});else if(y)this.credentialSourceType="url",this.subjectTokenSupplier=new Zz.UrlSubjectTokenSupplier({url:y,formatType:d,subjectTokenFieldName:p,headers:f,additionalGaxiosOptions:t.RETRY_CONFIG});else if(h){this.credentialSourceType="certificate";let l=new wT.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:h.use_default_certificate_config,certificateConfigLocation:h.certificate_config_location,trustChainPath:h.trust_chain_path});this.subjectTokenSupplier=l}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 wT.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new Kz.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new TT.Gaxios({agent:r})}),this.transporter=new TT.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};dc.IdentityPoolClient=xf});var Rf=D(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.AwsRequestSigner=void 0;var pc=ht(),xT=Aa(),PT="AWS4-HMAC-SHA256",Jz="aws4_request",If=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,xT.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let r=typeof e.data=="object"?JSON.stringify(e.data):e.data,n=e.url,i=e.method||"GET",s=e.body||r,c=e.headers,d=await this.getCredentials(),p=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 m=await Xz({crypto:this.crypto,host:p.host,canonicalUri:p.pathname,canonicalQuerystring:p.search.slice(1),method:i,region:this.region,securityCredentials:d,requestPayload:s,additionalAmzHeaders:c}),y=pc.Gaxios.mergeHeaders(m.amzDate?{"x-amz-date":m.amzDate}:{},{authorization:m.authorizationHeader,host:p.host},c||{});d.token&&pc.Gaxios.mergeHeaders(y,{"x-amz-security-token":d.token});let h={url:n,method:i,headers:y};return s!==void 0&&(h.body=s),h}};fc.AwsRequestSigner=If;async function Ma(t,e,r){return await t.signWithHmacSha256(e,r)}o(Ma,"sign");async function Yz(t,e,r,n,i){let s=await Ma(t,`AWS4${e}`,r),c=await Ma(t,s,n),d=await Ma(t,c,i);return await Ma(t,d,"aws4_request")}o(Yz,"getSigningKey");async function Xz(t){let e=pc.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,s=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),c=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let d=pc.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),p="",m=[...d.keys()].sort();m.forEach(C=>{p+=`${C}:${d.get(C)}
|
|
41
41
|
`});let y=m.join(";"),h=await t.crypto.sha256DigestHex(r),f=`${t.method.toUpperCase()}
|
|
42
42
|
${t.canonicalUri}
|
|
43
43
|
${t.canonicalQuerystring}
|
|
44
44
|
${p}
|
|
45
45
|
${y}
|
|
46
|
-
${h}`,l=`${c}/${t.region}/${n}/${
|
|
46
|
+
${h}`,l=`${c}/${t.region}/${n}/${Jz}`,g=`${PT}
|
|
47
47
|
${s}
|
|
48
48
|
${l}
|
|
49
|
-
`+await t.crypto.sha256DigestHex(f),v=await Kz(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,n),E=await Ma(t.crypto,v,g),b=`${TT} Credential=${t.securityCredentials.accessKeyId}/${l}, SignedHeaders=${y}, Signature=${(0,PT.fromArrayBufferToHex)(E)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:b,canonicalQuerystring:t.canonicalQuerystring}}o(Jz,"generateAuthenticationHeaderMap")});var xT=D(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.DefaultAwsSecurityCredentialsSupplier=void 0;var mc=nr(),Cf=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};mc.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 mc.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 mc.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 mc.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}};hc.DefaultAwsSecurityCredentialsSupplier=Cf});var kf=D(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.AwsClient=void 0;var Yz=Rf(),Xz=Xn(),Qz=xT(),AT=kr(),eU=ht(),Of=class t extends Xz.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,AT.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,AT.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let c=s.get("region_url"),d=s.get("url"),p=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new Qz.DefaultAwsSecurityCredentialsSupplier({regionUrl:c,securityCredentialsUrl:d,imdsV2SessionTokenUrl:p}),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 Yz.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 eU.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}))}};gc.AwsClient=Of});var Uf=D(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 yc="urn:ietf:params:oauth:token-type:saml2",$f="urn:ietf:params:oauth:token-type:id_token",Df="urn:ietf:params:oauth:token-type:jwt",Nf=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new vc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new _c("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!==yc&&this.tokenType!==$f&&this.tokenType!==Df)throw new bc(`Executable response must contain a 'token_type' field when successful and it must be one of ${$f}, ${Df}, or ${yc}.`);if(this.tokenType===yc){if(!e.saml_response)throw new La(`Executable response must contain a 'saml_response' field when token_type=${yc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new La(`Executable response must contain a 'id_token' field when token_type=${$f} or ${Df}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new Ec("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new Sc("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};vt.ExecutableResponse=Nf;var Jr=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};vt.ExecutableResponseError=Jr;var vc=class extends Jr{static{o(this,"InvalidVersionFieldError")}};vt.InvalidVersionFieldError=vc;var _c=class extends Jr{static{o(this,"InvalidSuccessFieldError")}};vt.InvalidSuccessFieldError=_c;var zf=class extends Jr{static{o(this,"InvalidExpirationTimeFieldError")}};vt.InvalidExpirationTimeFieldError=zf;var bc=class extends Jr{static{o(this,"InvalidTokenTypeFieldError")}};vt.InvalidTokenTypeFieldError=bc;var Ec=class extends Jr{static{o(this,"InvalidCodeFieldError")}};vt.InvalidCodeFieldError=Ec;var Sc=class extends Jr{static{o(this,"InvalidMessageFieldError")}};vt.InvalidMessageFieldError=Sc;var La=class extends Jr{static{o(this,"InvalidSubjectTokenError")}};vt.InvalidSubjectTokenError=La});var jf=D(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.PluggableAuthHandler=Si.ExecutableError=void 0;var To=Uf(),tU=require("child_process"),Mf=require("fs"),wc=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)}};Si.ExecutableError=wc;var Lf=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=tU.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";i.stdout.on("data",d=>{s+=d}),i.stderr.on("data",d=>{s+=d});let c=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",d=>{if(clearTimeout(c),d===0)try{let p=JSON.parse(s),m=new To.ExecutableResponse(p);return r(m)}catch(p){return p instanceof To.ExecutableResponseError?n(p):n(new To.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new wc(s,d.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await Mf.promises.realpath(this.outputFile)}catch{return}if(!(await Mf.promises.lstat(e)).isFile())return;let r=await Mf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new To.ExecutableResponse(n).isValid()?new To.ExecutableResponse(n):void 0}catch(n){throw n instanceof To.ExecutableResponseError?n:new To.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}};Si.PluggableAuthHandler=Lf});var qf=D(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.PluggableAuthClient=wi.ExecutableError=void 0;var rU=Xn(),nU=Uf(),IT=jf(),oU=jf();Object.defineProperty(wi,"ExecutableError",{enumerable:!0,get:o(function(){return oU.ExecutableError},"get")});var iU=30*1e3,RT=5*1e3,CT=120*1e3,aU="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",OT=1,Ff=class extends rU.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=iU;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<RT||this.timeoutMillis>CT)throw new Error(`Timeout must be between ${RT} and ${CT} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new IT.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[aU]!=="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>OT)throw new Error(`Version of executable is not currently supported, maximum supported version is ${OT}.`);if(!e.success)throw new IT.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new nU.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}};wi.PluggableAuthClient=Ff});var Vf=D(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.ExternalAccountClient=void 0;var sU=Xn(),uU=Af(),cU=kf(),lU=qf(),Bf=class{static{o(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(e){return e&&e.type===sU.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new cU.AwsClient(e):e.credential_source?.executable?new lU.PluggableAuthClient(e):new uU.IdentityPoolClient(e):null}};Tc.ExternalAccountClient=Bf});var Wf=D(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.ExternalAccountAuthorizedUserClient=Ti.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var $T=nr(),kT=hf(),DT=ht(),dU=require("stream"),pU=Xn();Ti.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var fU="https://sts.{universeDomain}/v1/oauthtoken",Gf=class t extends kT.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})};$T.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 DT.GaxiosError&&i.response?(0,kT.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},Hf=class extends $T.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 Gf({tokenRefreshEndpoint:e.token_url??fU.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=pU.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=DT.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof dU.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Ti.ExternalAccountAuthorizedUserClient=Hf});var MT=D(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.GoogleAuth=zr.GoogleAuthExceptionMessages=void 0;var mU=require("child_process"),ja=require("fs"),hU=ht(),Fa=xa(),gU=require("os"),Zf=require("path"),yU=Aa(),vU=jp(),_U=qp(),bU=Bp(),Pi=cf(),NT=df(),xi=ff(),EU=Vf(),qa=Xn(),Kf=nr(),zT=Wf(),UT=kr();zr.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(f),v=await Yz(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,n),E=await Ma(t.crypto,v,g),b=`${PT} Credential=${t.securityCredentials.accessKeyId}/${l}, SignedHeaders=${y}, Signature=${(0,xT.fromArrayBufferToHex)(E)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:b,canonicalQuerystring:t.canonicalQuerystring}}o(Xz,"generateAuthenticationHeaderMap")});var AT=D(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.DefaultAwsSecurityCredentialsSupplier=void 0;var mc=nr(),Cf=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};mc.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 mc.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 mc.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 mc.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}};hc.DefaultAwsSecurityCredentialsSupplier=Cf});var kf=D(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.AwsClient=void 0;var Qz=Rf(),eU=Xn(),tU=AT(),IT=kr(),rU=ht(),Of=class t extends eU.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,IT.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,IT.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let c=s.get("region_url"),d=s.get("url"),p=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new tU.DefaultAwsSecurityCredentialsSupplier({regionUrl:c,securityCredentialsUrl:d,imdsV2SessionTokenUrl:p}),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 Qz.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 rU.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}))}};gc.AwsClient=Of});var Uf=D(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 yc="urn:ietf:params:oauth:token-type:saml2",$f="urn:ietf:params:oauth:token-type:id_token",Df="urn:ietf:params:oauth:token-type:jwt",Nf=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new vc("Executable response must contain a 'version' field.");if(e.success===void 0)throw new _c("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!==yc&&this.tokenType!==$f&&this.tokenType!==Df)throw new bc(`Executable response must contain a 'token_type' field when successful and it must be one of ${$f}, ${Df}, or ${yc}.`);if(this.tokenType===yc){if(!e.saml_response)throw new La(`Executable response must contain a 'saml_response' field when token_type=${yc}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new La(`Executable response must contain a 'id_token' field when token_type=${$f} or ${Df}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new Ec("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new Sc("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};vt.ExecutableResponse=Nf;var Jr=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};vt.ExecutableResponseError=Jr;var vc=class extends Jr{static{o(this,"InvalidVersionFieldError")}};vt.InvalidVersionFieldError=vc;var _c=class extends Jr{static{o(this,"InvalidSuccessFieldError")}};vt.InvalidSuccessFieldError=_c;var zf=class extends Jr{static{o(this,"InvalidExpirationTimeFieldError")}};vt.InvalidExpirationTimeFieldError=zf;var bc=class extends Jr{static{o(this,"InvalidTokenTypeFieldError")}};vt.InvalidTokenTypeFieldError=bc;var Ec=class extends Jr{static{o(this,"InvalidCodeFieldError")}};vt.InvalidCodeFieldError=Ec;var Sc=class extends Jr{static{o(this,"InvalidMessageFieldError")}};vt.InvalidMessageFieldError=Sc;var La=class extends Jr{static{o(this,"InvalidSubjectTokenError")}};vt.InvalidSubjectTokenError=La});var jf=D(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.PluggableAuthHandler=Si.ExecutableError=void 0;var To=Uf(),nU=require("child_process"),Mf=require("fs"),wc=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)}};Si.ExecutableError=wc;var Lf=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=nU.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";i.stdout.on("data",d=>{s+=d}),i.stderr.on("data",d=>{s+=d});let c=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",d=>{if(clearTimeout(c),d===0)try{let p=JSON.parse(s),m=new To.ExecutableResponse(p);return r(m)}catch(p){return p instanceof To.ExecutableResponseError?n(p):n(new To.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new wc(s,d.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await Mf.promises.realpath(this.outputFile)}catch{return}if(!(await Mf.promises.lstat(e)).isFile())return;let r=await Mf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new To.ExecutableResponse(n).isValid()?new To.ExecutableResponse(n):void 0}catch(n){throw n instanceof To.ExecutableResponseError?n:new To.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}};Si.PluggableAuthHandler=Lf});var qf=D(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.PluggableAuthClient=wi.ExecutableError=void 0;var oU=Xn(),iU=Uf(),RT=jf(),aU=jf();Object.defineProperty(wi,"ExecutableError",{enumerable:!0,get:o(function(){return aU.ExecutableError},"get")});var sU=30*1e3,CT=5*1e3,OT=120*1e3,uU="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",kT=1,Ff=class extends oU.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=sU;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<CT||this.timeoutMillis>OT)throw new Error(`Timeout must be between ${CT} and ${OT} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new RT.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[uU]!=="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 RT.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new iU.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}};wi.PluggableAuthClient=Ff});var Vf=D(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.ExternalAccountClient=void 0;var cU=Xn(),lU=Af(),dU=kf(),pU=qf(),Bf=class{static{o(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(e){return e&&e.type===cU.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new dU.AwsClient(e):e.credential_source?.executable?new pU.PluggableAuthClient(e):new lU.IdentityPoolClient(e):null}};Tc.ExternalAccountClient=Bf});var Wf=D(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.ExternalAccountAuthorizedUserClient=Ti.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var DT=nr(),$T=hf(),NT=ht(),fU=require("stream"),mU=Xn();Ti.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var hU="https://sts.{universeDomain}/v1/oauthtoken",Gf=class t extends $T.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})};DT.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 NT.GaxiosError&&i.response?(0,$T.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},Hf=class extends DT.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 Gf({tokenRefreshEndpoint:e.token_url??hU.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=mU.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=NT.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof fU.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Ti.ExternalAccountAuthorizedUserClient=Hf});var LT=D(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.GoogleAuth=zr.GoogleAuthExceptionMessages=void 0;var gU=require("child_process"),ja=require("fs"),yU=ht(),Fa=xa(),vU=require("os"),Zf=require("path"),_U=Aa(),bU=jp(),EU=qp(),SU=Bp(),Pi=cf(),zT=df(),xi=ff(),wU=Vf(),qa=Xn(),Kf=nr(),UT=Wf(),MT=kr();zr.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 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(zr.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===zr.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(zr.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||=Kf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Kf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,UT.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Kf.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 Pi.JWT?r.scopes=this.scopes:r instanceof qa.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof Pi.JWT?r.scopes=this.scopes:r instanceof qa.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new vU.Compute(e));throw new Error(zr.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=Zf.join(i,".config"))}return r&&(r=Zf.join(r,"gcloud","application_default_credentials.json"),ja.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=ja.realpathSync(e),!ja.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=ja.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,UT.originalOrCamelOptions)(r).get("universe_domain");return e.type===NT.USER_REFRESH_ACCOUNT_TYPE?(n=new NT.UserRefreshClient(r),n.fromJSON(e)):e.type===xi.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===qa.EXTERNAL_ACCOUNT_TYPE?(n=EU.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===zT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new zT.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new Pi.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),i&&(n.universeDomain=i),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let i={};if(typeof r=="function"?n=r:i=r,n)this.fromStreamAsync(e,i).then(s=>n(null,s),n);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",i).on("data",c=>s.push(c)).on("end",()=>{try{try{let c=JSON.parse(s.join("")),d=this._cacheClientFromJSON(c,r);return n(d)}catch(c){if(!this.keyFilename)throw c;let d=new Pi.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=d,this.setGapicJWTValues(d),n(d)}}catch(c){return i(c)}})})}fromAPIKey(e,r={}){return new Pi.JWT({...r,apiKey:e})}_isWindows(){let e=gU.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,mU.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!==qa.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 qa.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(zr.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=ja.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 _U.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=hU.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,bU.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,yU.createCrypto)();if(n instanceof Pi.JWT&&n.key)return await s.sign(n.key,e);let c=await this.getCredentials();if(!c.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,c.client_email,e,r)}async signBlob(e,r,n,i){let s=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};zr.GoogleAuth=Jf});var LT=D(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.IAMAuth=void 0;var Yf=class{static{o(this,"IAMAuth")}selector;token;constructor(e,r){this.selector=e,this.token=r,this.selector=e,this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};Pc.IAMAuth=Yf});var jT=D(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.DownscopedClient=Yr.EXPIRATION_TIME_OFFSET=Yr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var SU=ht(),wU=require("stream"),Xf=nr(),TU=ic(),PU="urn:ietf:params:oauth:grant-type:token-exchange",xU="urn:ietf:params:oauth:token-type:access_token",AU="urn:ietf:params:oauth:token-type:access_token";Yr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Yr.EXPIRATION_TIME_OFFSET=300*1e3;var Qf=class extends Xf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Xf.AuthClient?{}:e),e instanceof Xf.AuthClient?(this.authClient=e,this.credentialAccessBoundary=r):(this.authClient=e.authClient,this.credentialAccessBoundary=e.credentialAccessBoundary),this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length>Yr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Yr.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 TU.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=SU.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof wU.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:PU,requestedTokenType:xU,subjectToken:e,subjectTokenType:AU},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}};Yr.DownscopedClient=Qf});var FT=D(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.PassThroughClient=void 0;var IU=nr(),em=class extends IU.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};xc.PassThroughClient=em});var Ba=D(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.GoogleAuth=de.auth=de.PassThroughClient=de.ExternalAccountAuthorizedUserClient=de.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=de.ExecutableError=de.PluggableAuthClient=de.DownscopedClient=de.BaseExternalAccountClient=de.ExternalAccountClient=de.IdentityPoolClient=de.AwsRequestSigner=de.AwsClient=de.UserRefreshClient=de.LoginTicket=de.ClientAuthentication=de.OAuth2Client=de.CodeChallengeMethod=de.Impersonated=de.JWT=de.JWTAccess=de.IdTokenClient=de.IAMAuth=de.GCPEnv=de.Compute=de.DEFAULT_UNIVERSE=de.AuthClient=de.gaxios=de.gcpMetadata=void 0;var qT=MT();Object.defineProperty(de,"GoogleAuth",{enumerable:!0,get:o(function(){return qT.GoogleAuth},"get")});de.gcpMetadata=xa();de.gaxios=ht();var BT=nr();Object.defineProperty(de,"AuthClient",{enumerable:!0,get:o(function(){return BT.AuthClient},"get")});Object.defineProperty(de,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return BT.DEFAULT_UNIVERSE},"get")});var RU=jp();Object.defineProperty(de,"Compute",{enumerable:!0,get:o(function(){return RU.Compute},"get")});var CU=Bp();Object.defineProperty(de,"GCPEnv",{enumerable:!0,get:o(function(){return CU.GCPEnv},"get")});var OU=LT();Object.defineProperty(de,"IAMAuth",{enumerable:!0,get:o(function(){return OU.IAMAuth},"get")});var kU=qp();Object.defineProperty(de,"IdTokenClient",{enumerable:!0,get:o(function(){return kU.IdTokenClient},"get")});var $U=sf();Object.defineProperty(de,"JWTAccess",{enumerable:!0,get:o(function(){return $U.JWTAccess},"get")});var DU=cf();Object.defineProperty(de,"JWT",{enumerable:!0,get:o(function(){return DU.JWT},"get")});var NU=ff();Object.defineProperty(de,"Impersonated",{enumerable:!0,get:o(function(){return NU.Impersonated},"get")});var tm=wo();Object.defineProperty(de,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return tm.CodeChallengeMethod},"get")});Object.defineProperty(de,"OAuth2Client",{enumerable:!0,get:o(function(){return tm.OAuth2Client},"get")});Object.defineProperty(de,"ClientAuthentication",{enumerable:!0,get:o(function(){return tm.ClientAuthentication},"get")});var zU=zp();Object.defineProperty(de,"LoginTicket",{enumerable:!0,get:o(function(){return zU.LoginTicket},"get")});var UU=df();Object.defineProperty(de,"UserRefreshClient",{enumerable:!0,get:o(function(){return UU.UserRefreshClient},"get")});var MU=kf();Object.defineProperty(de,"AwsClient",{enumerable:!0,get:o(function(){return MU.AwsClient},"get")});var LU=Rf();Object.defineProperty(de,"AwsRequestSigner",{enumerable:!0,get:o(function(){return LU.AwsRequestSigner},"get")});var jU=Af();Object.defineProperty(de,"IdentityPoolClient",{enumerable:!0,get:o(function(){return jU.IdentityPoolClient},"get")});var FU=Vf();Object.defineProperty(de,"ExternalAccountClient",{enumerable:!0,get:o(function(){return FU.ExternalAccountClient},"get")});var qU=Xn();Object.defineProperty(de,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return qU.BaseExternalAccountClient},"get")});var BU=jT();Object.defineProperty(de,"DownscopedClient",{enumerable:!0,get:o(function(){return BU.DownscopedClient},"get")});var VT=qf();Object.defineProperty(de,"PluggableAuthClient",{enumerable:!0,get:o(function(){return VT.PluggableAuthClient},"get")});Object.defineProperty(de,"ExecutableError",{enumerable:!0,get:o(function(){return VT.ExecutableError},"get")});var GT=Wf();Object.defineProperty(de,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return GT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(de,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return GT.ExternalAccountAuthorizedUserClient},"get")});var VU=FT();Object.defineProperty(de,"PassThroughClient",{enumerable:!0,get:o(function(){return VU.PassThroughClient},"get")});var GU=new qT.GoogleAuth;de.auth=GU});var Sn=D((nm,om)=>{(function(t,e){typeof nm=="object"&&typeof om<"u"?om.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(nm,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",s="minute",c="hour",d="day",p="week",m="month",y="quarter",h="year",f="date",l="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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(re){var V=["th","st","nd","rd"],B=re%100;return"["+re+(V[(B-20)%10]||V[B]||V[0])+"]"},"ordinal")},b=o(function(re,V,B){var X=String(re);return!X||X.length>=V?re:""+Array(V+1-X.length).join(B)+re},"m"),C={s:b,z:o(function(re){var V=-re.utcOffset(),B=Math.abs(V),X=Math.floor(B/60),Y=B%60;return(V<=0?"+":"-")+b(X,2,"0")+":"+b(Y,2,"0")},"z"),m:o(function re(V,B){if(V.date()<B.date())return-re(B,V);var X=12*(B.year()-V.year())+(B.month()-V.month()),Y=V.clone().add(X,m),ie=B-Y<0,ue=V.clone().add(X+(ie?-1:1),m);return+(-(X+(B-Y)/(ie?Y-ue:ue-Y))||0)},"t"),a:o(function(re){return re<0?Math.ceil(re)||0:Math.floor(re)},"a"),p:o(function(re){return{M:m,y:h,w:p,d,D:f,h:c,m:s,s:i,ms:n,Q:y}[re]||String(re||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(re){return re===void 0},"u")},U="en",J={};J[U]=E;var W=o(function(re){return re instanceof Q},"p"),H=o(function re(V,B,X){var Y;if(!V)return U;if(typeof V=="string"){var ie=V.toLowerCase();J[ie]&&(Y=ie),B&&(J[ie]=B,Y=ie);var ue=V.split("-");if(!Y&&ue.length>1)return re(ue[0])}else{var Ce=V.name;J[Ce]=V,Y=Ce}return!X&&Y&&(U=Y),Y||!X&&U},"t"),K=o(function(re,V){if(W(re))return re.clone();var B=typeof V=="object"?V:{};return B.date=re,B.args=arguments,new Q(B)},"w"),te=C;te.l=H,te.i=W,te.w=function(re,V){return K(re,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var Q=(function(){function re(B){this.$L=H(B.locale,null,!0),this.parse(B)}o(re,"M");var V=re.prototype;return V.parse=function(B){this.$d=(function(X){var Y=X.date,ie=X.utc;if(Y===null)return new Date(NaN);if(te.u(Y))return new Date;if(Y instanceof Date)return new Date(Y);if(typeof Y=="string"&&!/Z$/i.test(Y)){var ue=Y.match(g);if(ue){var Ce=ue[2]-1||0,De=(ue[7]||"0").substring(0,3);return ie?new Date(Date.UTC(ue[1],Ce,ue[3]||1,ue[4]||0,ue[5]||0,ue[6]||0,De)):new Date(ue[1],Ce,ue[3]||1,ue[4]||0,ue[5]||0,ue[6]||0,De)}}return new Date(Y)})(B),this.$x=B.x||{},this.init()},V.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},V.$utils=function(){return te},V.isValid=function(){return this.$d.toString()!==l},V.isSame=function(B,X){var Y=K(B);return this.startOf(X)<=Y&&Y<=this.endOf(X)},V.isAfter=function(B,X){return K(B)<this.startOf(X)},V.isBefore=function(B,X){return this.endOf(X)<K(B)},V.$g=function(B,X,Y){return te.u(B)?this[X]:this.set(Y,B)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(B,X){var Y=this,ie=!!te.u(X)||X,ue=te.p(B),Ce=o(function(Ht,We){var Ye=te.w(Y.$u?Date.UTC(Y.$y,We,Ht):new Date(Y.$y,We,Ht),Y);return ie?Ye:Ye.endOf(d)},"l"),De=o(function(Ht,We){return te.w(Y.toDate()[Ht].apply(Y.toDate("s"),(ie?[0,0,0,0]:[23,59,59,999]).slice(We)),Y)},"$"),Ke=this.$W,et=this.$M,wt=this.$D,ee="set"+(this.$u?"UTC":"");switch(ue){case h:return ie?Ce(1,0):Ce(31,11);case m:return ie?Ce(1,et):Ce(0,et+1);case p:var lt=this.$locale().weekStart||0,mt=(Ke<lt?Ke+7:Ke)-lt;return Ce(ie?wt-mt:wt+(6-mt),et);case d:case f:return De(ee+"Hours",0);case c:return De(ee+"Minutes",1);case s:return De(ee+"Seconds",2);case i:return De(ee+"Milliseconds",3);default:return this.clone()}},V.endOf=function(B){return this.startOf(B,!1)},V.$set=function(B,X){var Y,ie=te.p(B),ue="set"+(this.$u?"UTC":""),Ce=(Y={},Y[d]=ue+"Date",Y[f]=ue+"Date",Y[m]=ue+"Month",Y[h]=ue+"FullYear",Y[c]=ue+"Hours",Y[s]=ue+"Minutes",Y[i]=ue+"Seconds",Y[n]=ue+"Milliseconds",Y)[ie],De=ie===d?this.$D+(X-this.$W):X;if(ie===m||ie===h){var Ke=this.clone().set(f,1);Ke.$d[Ce](De),Ke.init(),this.$d=Ke.set(f,Math.min(this.$D,Ke.daysInMonth())).$d}else Ce&&this.$d[Ce](De);return this.init(),this},V.set=function(B,X){return this.clone().$set(B,X)},V.get=function(B){return this[te.p(B)]()},V.add=function(B,X){var Y,ie=this;B=Number(B);var ue=te.p(X),Ce=o(function(et){var wt=K(ie);return te.w(wt.date(wt.date()+Math.round(et*B)),ie)},"y");if(ue===m)return this.set(m,this.$M+B);if(ue===h)return this.set(h,this.$y+B);if(ue===d)return Ce(1);if(ue===p)return Ce(7);var De=(Y={},Y[s]=e,Y[c]=r,Y[i]=t,Y)[ue]||1,Ke=this.$d.getTime()+B*De;return te.w(Ke,this)},V.subtract=function(B,X){return this.add(-1*B,X)},V.format=function(B){var X=this,Y=this.$locale();if(!this.isValid())return Y.invalidDate||l;var ie=B||"YYYY-MM-DDTHH:mm:ssZ",ue=te.z(this),Ce=this.$H,De=this.$m,Ke=this.$M,et=Y.weekdays,wt=Y.months,ee=Y.meridiem,lt=o(function(We,Ye,S,P){return We&&(We[Ye]||We(X,ie))||S[Ye].slice(0,P)},"h"),mt=o(function(We){return te.s(Ce%12||12,We,"0")},"d"),Ht=ee||function(We,Ye,S){var P=We<12?"AM":"PM";return S?P.toLowerCase():P};return ie.replace(v,(function(We,Ye){return Ye||(function(S){switch(S){case"YY":return String(X.$y).slice(-2);case"YYYY":return te.s(X.$y,4,"0");case"M":return Ke+1;case"MM":return te.s(Ke+1,2,"0");case"MMM":return lt(Y.monthsShort,Ke,wt,3);case"MMMM":return lt(wt,Ke);case"D":return X.$D;case"DD":return te.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return lt(Y.weekdaysMin,X.$W,et,2);case"ddd":return lt(Y.weekdaysShort,X.$W,et,3);case"dddd":return et[X.$W];case"H":return String(Ce);case"HH":return te.s(Ce,2,"0");case"h":return mt(1);case"hh":return mt(2);case"a":return Ht(Ce,De,!0);case"A":return Ht(Ce,De,!1);case"m":return String(De);case"mm":return te.s(De,2,"0");case"s":return String(X.$s);case"ss":return te.s(X.$s,2,"0");case"SSS":return te.s(X.$ms,3,"0");case"Z":return ue}return null})(We)||ue.replace(":","")}))},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(B,X,Y){var ie,ue=this,Ce=te.p(X),De=K(B),Ke=(De.utcOffset()-this.utcOffset())*e,et=this-De,wt=o(function(){return te.m(ue,De)},"D");switch(Ce){case h:ie=wt()/12;break;case m:ie=wt();break;case y:ie=wt()/3;break;case p:ie=(et-Ke)/6048e5;break;case d:ie=(et-Ke)/864e5;break;case c:ie=et/r;break;case s:ie=et/e;break;case i:ie=et/t;break;default:ie=et}return Y?ie:te.a(ie)},V.daysInMonth=function(){return this.endOf(m).$D},V.$locale=function(){return J[this.$L]},V.locale=function(B,X){if(!B)return this.$L;var Y=this.clone(),ie=H(B,X,!0);return ie&&(Y.$L=ie),Y},V.clone=function(){return te.w(this.$d,this)},V.toDate=function(){return new Date(this.valueOf())},V.toJSON=function(){return this.isValid()?this.toISOString():null},V.toISOString=function(){return this.$d.toISOString()},V.toString=function(){return this.$d.toUTCString()},re})(),xe=Q.prototype;return K.prototype=xe,[["$ms",n],["$s",i],["$m",s],["$H",c],["$W",d],["$M",m],["$y",h],["$D",f]].forEach((function(re){xe[re[1]]=function(V){return this.$g(V,re[0],re[1])}})),K.extend=function(re,V){return re.$i||(re(V,Q,K),re.$i=!0),K},K.locale=H,K.isDayjs=W,K.unix=function(re){return K(1e3*re)},K.en=J[U],K.Ls=J,K.p={},K}))});var HT=D(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.getAPI=HU;function HU(t,e,r,n){let i;if(typeof e=="string")i=e,e={};else if(typeof e=="object")i=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[i],c=new s(e,n);return Object.freeze(c)}catch(s){throw new Error(`Unable to load endpoint ${t}("${i}"): ${s.message}`)}}o(HU,"getAPI")});var ZT=D((AQ,WT)=>{WT.exports=require("util").inspect});var Za=D((IQ,mP)=>{var hm=typeof Map=="function"&&Map.prototype,am=Object.getOwnPropertyDescriptor&&hm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Rc=hm&&am&&typeof am.get=="function"?am.get:null,KT=hm&&Map.prototype.forEach,gm=typeof Set=="function"&&Set.prototype,sm=Object.getOwnPropertyDescriptor&&gm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Cc=gm&&sm&&typeof sm.get=="function"?sm.get:null,JT=gm&&Set.prototype.forEach,WU=typeof WeakMap=="function"&&WeakMap.prototype,Ga=WU?WeakMap.prototype.has:null,ZU=typeof WeakSet=="function"&&WeakSet.prototype,Ha=ZU?WeakSet.prototype.has:null,KU=typeof WeakRef=="function"&&WeakRef.prototype,YT=KU?WeakRef.prototype.deref:null,JU=Boolean.prototype.valueOf,YU=Object.prototype.toString,XU=Function.prototype.toString,QU=String.prototype.match,ym=String.prototype.slice,Qn=String.prototype.replace,eM=String.prototype.toUpperCase,XT=String.prototype.toLowerCase,sP=RegExp.prototype.test,QT=Array.prototype.concat,Xr=Array.prototype.join,tM=Array.prototype.slice,eP=Math.floor,lm=typeof BigInt=="function"?BigInt.prototype.valueOf:null,um=Object.getOwnPropertySymbols,dm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ai=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Wa=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ai||!0)?Symbol.toStringTag:null,uP=Object.prototype.propertyIsEnumerable,tP=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function rP(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||sP.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-eP(-t):eP(t);if(n!==t){var i=String(n),s=ym.call(e,i.length+1);return Qn.call(i,r,"$&_")+"."+Qn.call(Qn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Qn.call(e,r,"$&_")}o(rP,"addNumericSeparator");var pm=ZT(),nP=pm.custom,oP=dP(nP)?nP:null,cP={__proto__:null,double:'"',single:"'"},rM={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};mP.exports=o(function t(e,r,n,i){var s=r||{};if(wn(s,"quoteStyle")&&!wn(cP,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 c=wn(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(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 d=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return fP(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var p=String(e);return d?rP(e,p):p}if(typeof e=="bigint"){var m=String(e)+"n";return d?rP(e,m):m}var y=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=y&&y>0&&typeof e=="object")return fm(e)?"[Array]":"[Object]";var h=bM(s,n);if(typeof i>"u")i=[];else if(pP(i,e)>=0)return"[Circular]";function f(B,X,Y){if(X&&(i=tM.call(i),i.push(X)),Y){var ie={depth:s.depth};return wn(s,"quoteStyle")&&(ie.quoteStyle=s.quoteStyle),t(B,ie,n+1,i)}return t(B,s,n+1,i)}if(o(f,"inspect"),typeof e=="function"&&!iP(e)){var l=dM(e),g=Ic(e,f);return"[Function"+(l?": "+l:" (anonymous)")+"]"+(g.length>0?" { "+Xr.call(g,", ")+" }":"")}if(dP(e)){var v=Ai?Qn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):dm.call(e);return typeof e=="object"&&!Ai?Va(v):v}if(yM(e)){for(var E="<"+XT.call(String(e.nodeName)),b=e.attributes||[],C=0;C<b.length;C++)E+=" "+b[C].name+"="+lP(nM(b[C].value),"double",s);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+XT.call(String(e.nodeName))+">",E}if(fm(e)){if(e.length===0)return"[]";var U=Ic(e,f);return h&&!_M(U)?"["+mm(U,h)+"]":"[ "+Xr.call(U,", ")+" ]"}if(iM(e)){var J=Ic(e,f);return!("cause"in Error.prototype)&&"cause"in e&&!uP.call(e,"cause")?"{ ["+String(e)+"] "+Xr.call(QT.call("[cause]: "+f(e.cause),J),", ")+" }":J.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Xr.call(J,", ")+" }"}if(typeof e=="object"&&c){if(oP&&typeof e[oP]=="function"&&pm)return pm(e,{depth:y-n});if(c!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(pM(e)){var W=[];return KT&&KT.call(e,function(B,X){W.push(f(X,e,!0)+" => "+f(B,e))}),aP("Map",Rc.call(e),W,h)}if(hM(e)){var H=[];return JT&&JT.call(e,function(B){H.push(f(B,e))}),aP("Set",Cc.call(e),H,h)}if(fM(e))return cm("WeakMap");if(gM(e))return cm("WeakSet");if(mM(e))return cm("WeakRef");if(sM(e))return Va(f(Number(e)));if(cM(e))return Va(f(lm.call(e)));if(uM(e))return Va(JU.call(e));if(aM(e))return Va(f(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(!oM(e)&&!iP(e)){var K=Ic(e,f),te=tP?tP(e)===Object.prototype:e instanceof Object||e.constructor===Object,Q=e instanceof Object?"":"null prototype",xe=!te&&Wa&&Object(e)===e&&Wa in e?ym.call(eo(e),8,-1):Q?"Object":"",re=te||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",V=re+(xe||Q?"["+Xr.call(QT.call([],xe||[],Q||[]),": ")+"] ":"");return K.length===0?V+"{}":h?V+"{"+mm(K,h)+"}":V+"{ "+Xr.call(K,", ")+" }"}return String(e)},"inspect_");function lP(t,e,r){var n=r.quoteStyle||e,i=cP[n];return i+t+i}o(lP,"wrapQuotes");function nM(t){return Qn.call(String(t),/"/g,""")}o(nM,"quote");function Po(t){return!Wa||!(typeof t=="object"&&(Wa in t||typeof t[Wa]<"u"))}o(Po,"canTrustToString");function fm(t){return eo(t)==="[object Array]"&&Po(t)}o(fm,"isArray");function oM(t){return eo(t)==="[object Date]"&&Po(t)}o(oM,"isDate");function iP(t){return eo(t)==="[object RegExp]"&&Po(t)}o(iP,"isRegExp");function iM(t){return eo(t)==="[object Error]"&&Po(t)}o(iM,"isError");function aM(t){return eo(t)==="[object String]"&&Po(t)}o(aM,"isString");function sM(t){return eo(t)==="[object Number]"&&Po(t)}o(sM,"isNumber");function uM(t){return eo(t)==="[object Boolean]"&&Po(t)}o(uM,"isBoolean");function dP(t){if(Ai)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!dm)return!1;try{return dm.call(t),!0}catch{}return!1}o(dP,"isSymbol");function cM(t){if(!t||typeof t!="object"||!lm)return!1;try{return lm.call(t),!0}catch{}return!1}o(cM,"isBigInt");var lM=Object.prototype.hasOwnProperty||function(t){return t in this};function wn(t,e){return lM.call(t,e)}o(wn,"has");function eo(t){return YU.call(t)}o(eo,"toStr");function dM(t){if(t.name)return t.name;var e=QU.call(XU.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(dM,"nameOf");function pP(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(pP,"indexOf");function pM(t){if(!Rc||!t||typeof t!="object")return!1;try{Rc.call(t);try{Cc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(pM,"isMap");function fM(t){if(!Ga||!t||typeof t!="object")return!1;try{Ga.call(t,Ga);try{Ha.call(t,Ha)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(fM,"isWeakMap");function mM(t){if(!YT||!t||typeof t!="object")return!1;try{return YT.call(t),!0}catch{}return!1}o(mM,"isWeakRef");function hM(t){if(!Cc||!t||typeof t!="object")return!1;try{Cc.call(t);try{Rc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(hM,"isSet");function gM(t){if(!Ha||!t||typeof t!="object")return!1;try{Ha.call(t,Ha);try{Ga.call(t,Ga)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(gM,"isWeakSet");function yM(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(yM,"isElement");function fP(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return fP(ym.call(t,0,e.maxStringLength),e)+n}var i=rM[e.quoteStyle||"single"];i.lastIndex=0;var s=Qn.call(Qn.call(t,i,"\\$1"),/[\x00-\x1f]/g,vM);return lP(s,"single",e)}o(fP,"inspectString");function vM(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":"")+eM.call(e.toString(16))}o(vM,"lowbyte");function Va(t){return"Object("+t+")"}o(Va,"markBoxed");function cm(t){return t+" { ? }"}o(cm,"weakCollectionOf");function aP(t,e,r,n){var i=n?mm(r,n):Xr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(aP,"collectionOf");function _M(t){for(var e=0;e<t.length;e++)if(pP(t[e],`
|
|
56
|
-
`)>=0)return!1;return!0}o(
|
|
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(zr.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===zr.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(zr.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||=Kf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=Kf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,MT.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=Kf.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 Pi.JWT?r.scopes=this.scopes:r instanceof qa.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof Pi.JWT?r.scopes=this.scopes:r instanceof qa.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new bU.Compute(e));throw new Error(zr.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=Zf.join(i,".config"))}return r&&(r=Zf.join(r,"gcloud","application_default_credentials.json"),ja.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=ja.realpathSync(e),!ja.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=ja.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,MT.originalOrCamelOptions)(r).get("universe_domain");return e.type===zT.USER_REFRESH_ACCOUNT_TYPE?(n=new zT.UserRefreshClient(r),n.fromJSON(e)):e.type===xi.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===qa.EXTERNAL_ACCOUNT_TYPE?(n=wU.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===UT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new UT.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new Pi.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),i&&(n.universeDomain=i),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let i={};if(typeof r=="function"?n=r:i=r,n)this.fromStreamAsync(e,i).then(s=>n(null,s),n);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",i).on("data",c=>s.push(c)).on("end",()=>{try{try{let c=JSON.parse(s.join("")),d=this._cacheClientFromJSON(c,r);return n(d)}catch(c){if(!this.keyFilename)throw c;let d=new Pi.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=d,this.setGapicJWTValues(d),n(d)}}catch(c){return i(c)}})})}fromAPIKey(e,r={}){return new Pi.JWT({...r,apiKey:e})}_isWindows(){let e=vU.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,gU.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!==qa.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 qa.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(zr.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=ja.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 EU.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=yU.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,SU.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,_U.createCrypto)();if(n instanceof Pi.JWT&&n.key)return await s.sign(n.key,e);let c=await this.getCredentials();if(!c.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,c.client_email,e,r)}async signBlob(e,r,n,i){let s=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};zr.GoogleAuth=Jf});var jT=D(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.IAMAuth=void 0;var Yf=class{static{o(this,"IAMAuth")}selector;token;constructor(e,r){this.selector=e,this.token=r,this.selector=e,this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};Pc.IAMAuth=Yf});var FT=D(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.DownscopedClient=Yr.EXPIRATION_TIME_OFFSET=Yr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var TU=ht(),PU=require("stream"),Xf=nr(),xU=ic(),AU="urn:ietf:params:oauth:grant-type:token-exchange",IU="urn:ietf:params:oauth:token-type:access_token",RU="urn:ietf:params:oauth:token-type:access_token";Yr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Yr.EXPIRATION_TIME_OFFSET=300*1e3;var Qf=class extends Xf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Xf.AuthClient?{}:e),e instanceof Xf.AuthClient?(this.authClient=e,this.credentialAccessBoundary=r):(this.authClient=e.authClient,this.credentialAccessBoundary=e.credentialAccessBoundary),this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length>Yr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Yr.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 xU.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=TU.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof PU.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:AU,requestedTokenType:IU,subjectToken:e,subjectTokenType:RU},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}};Yr.DownscopedClient=Qf});var qT=D(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.PassThroughClient=void 0;var CU=nr(),em=class extends CU.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};xc.PassThroughClient=em});var Ba=D(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.GoogleAuth=de.auth=de.PassThroughClient=de.ExternalAccountAuthorizedUserClient=de.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=de.ExecutableError=de.PluggableAuthClient=de.DownscopedClient=de.BaseExternalAccountClient=de.ExternalAccountClient=de.IdentityPoolClient=de.AwsRequestSigner=de.AwsClient=de.UserRefreshClient=de.LoginTicket=de.ClientAuthentication=de.OAuth2Client=de.CodeChallengeMethod=de.Impersonated=de.JWT=de.JWTAccess=de.IdTokenClient=de.IAMAuth=de.GCPEnv=de.Compute=de.DEFAULT_UNIVERSE=de.AuthClient=de.gaxios=de.gcpMetadata=void 0;var BT=LT();Object.defineProperty(de,"GoogleAuth",{enumerable:!0,get:o(function(){return BT.GoogleAuth},"get")});de.gcpMetadata=xa();de.gaxios=ht();var VT=nr();Object.defineProperty(de,"AuthClient",{enumerable:!0,get:o(function(){return VT.AuthClient},"get")});Object.defineProperty(de,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return VT.DEFAULT_UNIVERSE},"get")});var OU=jp();Object.defineProperty(de,"Compute",{enumerable:!0,get:o(function(){return OU.Compute},"get")});var kU=Bp();Object.defineProperty(de,"GCPEnv",{enumerable:!0,get:o(function(){return kU.GCPEnv},"get")});var $U=jT();Object.defineProperty(de,"IAMAuth",{enumerable:!0,get:o(function(){return $U.IAMAuth},"get")});var DU=qp();Object.defineProperty(de,"IdTokenClient",{enumerable:!0,get:o(function(){return DU.IdTokenClient},"get")});var NU=sf();Object.defineProperty(de,"JWTAccess",{enumerable:!0,get:o(function(){return NU.JWTAccess},"get")});var zU=cf();Object.defineProperty(de,"JWT",{enumerable:!0,get:o(function(){return zU.JWT},"get")});var UU=ff();Object.defineProperty(de,"Impersonated",{enumerable:!0,get:o(function(){return UU.Impersonated},"get")});var tm=wo();Object.defineProperty(de,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return tm.CodeChallengeMethod},"get")});Object.defineProperty(de,"OAuth2Client",{enumerable:!0,get:o(function(){return tm.OAuth2Client},"get")});Object.defineProperty(de,"ClientAuthentication",{enumerable:!0,get:o(function(){return tm.ClientAuthentication},"get")});var MU=zp();Object.defineProperty(de,"LoginTicket",{enumerable:!0,get:o(function(){return MU.LoginTicket},"get")});var LU=df();Object.defineProperty(de,"UserRefreshClient",{enumerable:!0,get:o(function(){return LU.UserRefreshClient},"get")});var jU=kf();Object.defineProperty(de,"AwsClient",{enumerable:!0,get:o(function(){return jU.AwsClient},"get")});var FU=Rf();Object.defineProperty(de,"AwsRequestSigner",{enumerable:!0,get:o(function(){return FU.AwsRequestSigner},"get")});var qU=Af();Object.defineProperty(de,"IdentityPoolClient",{enumerable:!0,get:o(function(){return qU.IdentityPoolClient},"get")});var BU=Vf();Object.defineProperty(de,"ExternalAccountClient",{enumerable:!0,get:o(function(){return BU.ExternalAccountClient},"get")});var VU=Xn();Object.defineProperty(de,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return VU.BaseExternalAccountClient},"get")});var GU=FT();Object.defineProperty(de,"DownscopedClient",{enumerable:!0,get:o(function(){return GU.DownscopedClient},"get")});var GT=qf();Object.defineProperty(de,"PluggableAuthClient",{enumerable:!0,get:o(function(){return GT.PluggableAuthClient},"get")});Object.defineProperty(de,"ExecutableError",{enumerable:!0,get:o(function(){return GT.ExecutableError},"get")});var HT=Wf();Object.defineProperty(de,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return HT.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(de,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return HT.ExternalAccountAuthorizedUserClient},"get")});var HU=qT();Object.defineProperty(de,"PassThroughClient",{enumerable:!0,get:o(function(){return HU.PassThroughClient},"get")});var WU=new BT.GoogleAuth;de.auth=WU});var Sn=D((nm,om)=>{(function(t,e){typeof nm=="object"&&typeof om<"u"?om.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(nm,(function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",s="minute",c="hour",d="day",p="week",m="month",y="quarter",h="year",f="date",l="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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(re){var V=["th","st","nd","rd"],B=re%100;return"["+re+(V[(B-20)%10]||V[B]||V[0])+"]"},"ordinal")},b=o(function(re,V,B){var X=String(re);return!X||X.length>=V?re:""+Array(V+1-X.length).join(B)+re},"m"),C={s:b,z:o(function(re){var V=-re.utcOffset(),B=Math.abs(V),X=Math.floor(B/60),Y=B%60;return(V<=0?"+":"-")+b(X,2,"0")+":"+b(Y,2,"0")},"z"),m:o(function re(V,B){if(V.date()<B.date())return-re(B,V);var X=12*(B.year()-V.year())+(B.month()-V.month()),Y=V.clone().add(X,m),ie=B-Y<0,ue=V.clone().add(X+(ie?-1:1),m);return+(-(X+(B-Y)/(ie?Y-ue:ue-Y))||0)},"t"),a:o(function(re){return re<0?Math.ceil(re)||0:Math.floor(re)},"a"),p:o(function(re){return{M:m,y:h,w:p,d,D:f,h:c,m:s,s:i,ms:n,Q:y}[re]||String(re||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(re){return re===void 0},"u")},U="en",J={};J[U]=E;var Z=o(function(re){return re instanceof Q},"p"),H=o(function re(V,B,X){var Y;if(!V)return U;if(typeof V=="string"){var ie=V.toLowerCase();J[ie]&&(Y=ie),B&&(J[ie]=B,Y=ie);var ue=V.split("-");if(!Y&&ue.length>1)return re(ue[0])}else{var Ce=V.name;J[Ce]=V,Y=Ce}return!X&&Y&&(U=Y),Y||!X&&U},"t"),K=o(function(re,V){if(Z(re))return re.clone();var B=typeof V=="object"?V:{};return B.date=re,B.args=arguments,new Q(B)},"w"),te=C;te.l=H,te.i=Z,te.w=function(re,V){return K(re,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var Q=(function(){function re(B){this.$L=H(B.locale,null,!0),this.parse(B)}o(re,"M");var V=re.prototype;return V.parse=function(B){this.$d=(function(X){var Y=X.date,ie=X.utc;if(Y===null)return new Date(NaN);if(te.u(Y))return new Date;if(Y instanceof Date)return new Date(Y);if(typeof Y=="string"&&!/Z$/i.test(Y)){var ue=Y.match(g);if(ue){var Ce=ue[2]-1||0,De=(ue[7]||"0").substring(0,3);return ie?new Date(Date.UTC(ue[1],Ce,ue[3]||1,ue[4]||0,ue[5]||0,ue[6]||0,De)):new Date(ue[1],Ce,ue[3]||1,ue[4]||0,ue[5]||0,ue[6]||0,De)}}return new Date(Y)})(B),this.$x=B.x||{},this.init()},V.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},V.$utils=function(){return te},V.isValid=function(){return this.$d.toString()!==l},V.isSame=function(B,X){var Y=K(B);return this.startOf(X)<=Y&&Y<=this.endOf(X)},V.isAfter=function(B,X){return K(B)<this.startOf(X)},V.isBefore=function(B,X){return this.endOf(X)<K(B)},V.$g=function(B,X,Y){return te.u(B)?this[X]:this.set(Y,B)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(B,X){var Y=this,ie=!!te.u(X)||X,ue=te.p(B),Ce=o(function(Ht,We){var Ye=te.w(Y.$u?Date.UTC(Y.$y,We,Ht):new Date(Y.$y,We,Ht),Y);return ie?Ye:Ye.endOf(d)},"l"),De=o(function(Ht,We){return te.w(Y.toDate()[Ht].apply(Y.toDate("s"),(ie?[0,0,0,0]:[23,59,59,999]).slice(We)),Y)},"$"),Ke=this.$W,et=this.$M,wt=this.$D,ee="set"+(this.$u?"UTC":"");switch(ue){case h:return ie?Ce(1,0):Ce(31,11);case m:return ie?Ce(1,et):Ce(0,et+1);case p:var lt=this.$locale().weekStart||0,mt=(Ke<lt?Ke+7:Ke)-lt;return Ce(ie?wt-mt:wt+(6-mt),et);case d:case f:return De(ee+"Hours",0);case c:return De(ee+"Minutes",1);case s:return De(ee+"Seconds",2);case i:return De(ee+"Milliseconds",3);default:return this.clone()}},V.endOf=function(B){return this.startOf(B,!1)},V.$set=function(B,X){var Y,ie=te.p(B),ue="set"+(this.$u?"UTC":""),Ce=(Y={},Y[d]=ue+"Date",Y[f]=ue+"Date",Y[m]=ue+"Month",Y[h]=ue+"FullYear",Y[c]=ue+"Hours",Y[s]=ue+"Minutes",Y[i]=ue+"Seconds",Y[n]=ue+"Milliseconds",Y)[ie],De=ie===d?this.$D+(X-this.$W):X;if(ie===m||ie===h){var Ke=this.clone().set(f,1);Ke.$d[Ce](De),Ke.init(),this.$d=Ke.set(f,Math.min(this.$D,Ke.daysInMonth())).$d}else Ce&&this.$d[Ce](De);return this.init(),this},V.set=function(B,X){return this.clone().$set(B,X)},V.get=function(B){return this[te.p(B)]()},V.add=function(B,X){var Y,ie=this;B=Number(B);var ue=te.p(X),Ce=o(function(et){var wt=K(ie);return te.w(wt.date(wt.date()+Math.round(et*B)),ie)},"y");if(ue===m)return this.set(m,this.$M+B);if(ue===h)return this.set(h,this.$y+B);if(ue===d)return Ce(1);if(ue===p)return Ce(7);var De=(Y={},Y[s]=e,Y[c]=r,Y[i]=t,Y)[ue]||1,Ke=this.$d.getTime()+B*De;return te.w(Ke,this)},V.subtract=function(B,X){return this.add(-1*B,X)},V.format=function(B){var X=this,Y=this.$locale();if(!this.isValid())return Y.invalidDate||l;var ie=B||"YYYY-MM-DDTHH:mm:ssZ",ue=te.z(this),Ce=this.$H,De=this.$m,Ke=this.$M,et=Y.weekdays,wt=Y.months,ee=Y.meridiem,lt=o(function(We,Ye,S,P){return We&&(We[Ye]||We(X,ie))||S[Ye].slice(0,P)},"h"),mt=o(function(We){return te.s(Ce%12||12,We,"0")},"d"),Ht=ee||function(We,Ye,S){var P=We<12?"AM":"PM";return S?P.toLowerCase():P};return ie.replace(v,(function(We,Ye){return Ye||(function(S){switch(S){case"YY":return String(X.$y).slice(-2);case"YYYY":return te.s(X.$y,4,"0");case"M":return Ke+1;case"MM":return te.s(Ke+1,2,"0");case"MMM":return lt(Y.monthsShort,Ke,wt,3);case"MMMM":return lt(wt,Ke);case"D":return X.$D;case"DD":return te.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return lt(Y.weekdaysMin,X.$W,et,2);case"ddd":return lt(Y.weekdaysShort,X.$W,et,3);case"dddd":return et[X.$W];case"H":return String(Ce);case"HH":return te.s(Ce,2,"0");case"h":return mt(1);case"hh":return mt(2);case"a":return Ht(Ce,De,!0);case"A":return Ht(Ce,De,!1);case"m":return String(De);case"mm":return te.s(De,2,"0");case"s":return String(X.$s);case"ss":return te.s(X.$s,2,"0");case"SSS":return te.s(X.$ms,3,"0");case"Z":return ue}return null})(We)||ue.replace(":","")}))},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(B,X,Y){var ie,ue=this,Ce=te.p(X),De=K(B),Ke=(De.utcOffset()-this.utcOffset())*e,et=this-De,wt=o(function(){return te.m(ue,De)},"D");switch(Ce){case h:ie=wt()/12;break;case m:ie=wt();break;case y:ie=wt()/3;break;case p:ie=(et-Ke)/6048e5;break;case d:ie=(et-Ke)/864e5;break;case c:ie=et/r;break;case s:ie=et/e;break;case i:ie=et/t;break;default:ie=et}return Y?ie:te.a(ie)},V.daysInMonth=function(){return this.endOf(m).$D},V.$locale=function(){return J[this.$L]},V.locale=function(B,X){if(!B)return this.$L;var Y=this.clone(),ie=H(B,X,!0);return ie&&(Y.$L=ie),Y},V.clone=function(){return te.w(this.$d,this)},V.toDate=function(){return new Date(this.valueOf())},V.toJSON=function(){return this.isValid()?this.toISOString():null},V.toISOString=function(){return this.$d.toISOString()},V.toString=function(){return this.$d.toUTCString()},re})(),xe=Q.prototype;return K.prototype=xe,[["$ms",n],["$s",i],["$m",s],["$H",c],["$W",d],["$M",m],["$y",h],["$D",f]].forEach((function(re){xe[re[1]]=function(V){return this.$g(V,re[0],re[1])}})),K.extend=function(re,V){return re.$i||(re(V,Q,K),re.$i=!0),K},K.locale=H,K.isDayjs=Z,K.unix=function(re){return K(1e3*re)},K.en=J[U],K.Ls=J,K.p={},K}))});var WT=D(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.getAPI=ZU;function ZU(t,e,r,n){let i;if(typeof e=="string")i=e,e={};else if(typeof e=="object")i=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[i],c=new s(e,n);return Object.freeze(c)}catch(s){throw new Error(`Unable to load endpoint ${t}("${i}"): ${s.message}`)}}o(ZU,"getAPI")});var KT=D((OQ,ZT)=>{ZT.exports=require("util").inspect});var Za=D((kQ,hP)=>{var hm=typeof Map=="function"&&Map.prototype,am=Object.getOwnPropertyDescriptor&&hm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Rc=hm&&am&&typeof am.get=="function"?am.get:null,JT=hm&&Map.prototype.forEach,gm=typeof Set=="function"&&Set.prototype,sm=Object.getOwnPropertyDescriptor&&gm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Cc=gm&&sm&&typeof sm.get=="function"?sm.get:null,YT=gm&&Set.prototype.forEach,KU=typeof WeakMap=="function"&&WeakMap.prototype,Ga=KU?WeakMap.prototype.has:null,JU=typeof WeakSet=="function"&&WeakSet.prototype,Ha=JU?WeakSet.prototype.has:null,YU=typeof WeakRef=="function"&&WeakRef.prototype,XT=YU?WeakRef.prototype.deref:null,XU=Boolean.prototype.valueOf,QU=Object.prototype.toString,eM=Function.prototype.toString,tM=String.prototype.match,ym=String.prototype.slice,Qn=String.prototype.replace,rM=String.prototype.toUpperCase,QT=String.prototype.toLowerCase,uP=RegExp.prototype.test,eP=Array.prototype.concat,Xr=Array.prototype.join,nM=Array.prototype.slice,tP=Math.floor,lm=typeof BigInt=="function"?BigInt.prototype.valueOf:null,um=Object.getOwnPropertySymbols,dm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ai=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Wa=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ai||!0)?Symbol.toStringTag:null,cP=Object.prototype.propertyIsEnumerable,rP=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function nP(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||uP.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-tP(-t):tP(t);if(n!==t){var i=String(n),s=ym.call(e,i.length+1);return Qn.call(i,r,"$&_")+"."+Qn.call(Qn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Qn.call(e,r,"$&_")}o(nP,"addNumericSeparator");var pm=KT(),oP=pm.custom,iP=pP(oP)?oP:null,lP={__proto__:null,double:'"',single:"'"},oM={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};hP.exports=o(function t(e,r,n,i){var s=r||{};if(wn(s,"quoteStyle")&&!wn(lP,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 c=wn(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(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 d=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return mP(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var p=String(e);return d?nP(e,p):p}if(typeof e=="bigint"){var m=String(e)+"n";return d?nP(e,m):m}var y=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=y&&y>0&&typeof e=="object")return fm(e)?"[Array]":"[Object]";var h=SM(s,n);if(typeof i>"u")i=[];else if(fP(i,e)>=0)return"[Circular]";function f(B,X,Y){if(X&&(i=nM.call(i),i.push(X)),Y){var ie={depth:s.depth};return wn(s,"quoteStyle")&&(ie.quoteStyle=s.quoteStyle),t(B,ie,n+1,i)}return t(B,s,n+1,i)}if(o(f,"inspect"),typeof e=="function"&&!aP(e)){var l=fM(e),g=Ic(e,f);return"[Function"+(l?": "+l:" (anonymous)")+"]"+(g.length>0?" { "+Xr.call(g,", ")+" }":"")}if(pP(e)){var v=Ai?Qn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):dm.call(e);return typeof e=="object"&&!Ai?Va(v):v}if(_M(e)){for(var E="<"+QT.call(String(e.nodeName)),b=e.attributes||[],C=0;C<b.length;C++)E+=" "+b[C].name+"="+dP(iM(b[C].value),"double",s);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+QT.call(String(e.nodeName))+">",E}if(fm(e)){if(e.length===0)return"[]";var U=Ic(e,f);return h&&!EM(U)?"["+mm(U,h)+"]":"[ "+Xr.call(U,", ")+" ]"}if(sM(e)){var J=Ic(e,f);return!("cause"in Error.prototype)&&"cause"in e&&!cP.call(e,"cause")?"{ ["+String(e)+"] "+Xr.call(eP.call("[cause]: "+f(e.cause),J),", ")+" }":J.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Xr.call(J,", ")+" }"}if(typeof e=="object"&&c){if(iP&&typeof e[iP]=="function"&&pm)return pm(e,{depth:y-n});if(c!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(mM(e)){var Z=[];return JT&&JT.call(e,function(B,X){Z.push(f(X,e,!0)+" => "+f(B,e))}),sP("Map",Rc.call(e),Z,h)}if(yM(e)){var H=[];return YT&&YT.call(e,function(B){H.push(f(B,e))}),sP("Set",Cc.call(e),H,h)}if(hM(e))return cm("WeakMap");if(vM(e))return cm("WeakSet");if(gM(e))return cm("WeakRef");if(cM(e))return Va(f(Number(e)));if(dM(e))return Va(f(lm.call(e)));if(lM(e))return Va(XU.call(e));if(uM(e))return Va(f(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(!aM(e)&&!aP(e)){var K=Ic(e,f),te=rP?rP(e)===Object.prototype:e instanceof Object||e.constructor===Object,Q=e instanceof Object?"":"null prototype",xe=!te&&Wa&&Object(e)===e&&Wa in e?ym.call(eo(e),8,-1):Q?"Object":"",re=te||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",V=re+(xe||Q?"["+Xr.call(eP.call([],xe||[],Q||[]),": ")+"] ":"");return K.length===0?V+"{}":h?V+"{"+mm(K,h)+"}":V+"{ "+Xr.call(K,", ")+" }"}return String(e)},"inspect_");function dP(t,e,r){var n=r.quoteStyle||e,i=lP[n];return i+t+i}o(dP,"wrapQuotes");function iM(t){return Qn.call(String(t),/"/g,""")}o(iM,"quote");function Po(t){return!Wa||!(typeof t=="object"&&(Wa in t||typeof t[Wa]<"u"))}o(Po,"canTrustToString");function fm(t){return eo(t)==="[object Array]"&&Po(t)}o(fm,"isArray");function aM(t){return eo(t)==="[object Date]"&&Po(t)}o(aM,"isDate");function aP(t){return eo(t)==="[object RegExp]"&&Po(t)}o(aP,"isRegExp");function sM(t){return eo(t)==="[object Error]"&&Po(t)}o(sM,"isError");function uM(t){return eo(t)==="[object String]"&&Po(t)}o(uM,"isString");function cM(t){return eo(t)==="[object Number]"&&Po(t)}o(cM,"isNumber");function lM(t){return eo(t)==="[object Boolean]"&&Po(t)}o(lM,"isBoolean");function pP(t){if(Ai)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!dm)return!1;try{return dm.call(t),!0}catch{}return!1}o(pP,"isSymbol");function dM(t){if(!t||typeof t!="object"||!lm)return!1;try{return lm.call(t),!0}catch{}return!1}o(dM,"isBigInt");var pM=Object.prototype.hasOwnProperty||function(t){return t in this};function wn(t,e){return pM.call(t,e)}o(wn,"has");function eo(t){return QU.call(t)}o(eo,"toStr");function fM(t){if(t.name)return t.name;var e=tM.call(eM.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(fM,"nameOf");function fP(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(fP,"indexOf");function mM(t){if(!Rc||!t||typeof t!="object")return!1;try{Rc.call(t);try{Cc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(mM,"isMap");function hM(t){if(!Ga||!t||typeof t!="object")return!1;try{Ga.call(t,Ga);try{Ha.call(t,Ha)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(hM,"isWeakMap");function gM(t){if(!XT||!t||typeof t!="object")return!1;try{return XT.call(t),!0}catch{}return!1}o(gM,"isWeakRef");function yM(t){if(!Cc||!t||typeof t!="object")return!1;try{Cc.call(t);try{Rc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(yM,"isSet");function vM(t){if(!Ha||!t||typeof t!="object")return!1;try{Ha.call(t,Ha);try{Ga.call(t,Ga)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(vM,"isWeakSet");function _M(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(_M,"isElement");function mP(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return mP(ym.call(t,0,e.maxStringLength),e)+n}var i=oM[e.quoteStyle||"single"];i.lastIndex=0;var s=Qn.call(Qn.call(t,i,"\\$1"),/[\x00-\x1f]/g,bM);return dP(s,"single",e)}o(mP,"inspectString");function bM(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":"")+rM.call(e.toString(16))}o(bM,"lowbyte");function Va(t){return"Object("+t+")"}o(Va,"markBoxed");function cm(t){return t+" { ? }"}o(cm,"weakCollectionOf");function sP(t,e,r,n){var i=n?mm(r,n):Xr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(sP,"collectionOf");function EM(t){for(var e=0;e<t.length;e++)if(fP(t[e],`
|
|
56
|
+
`)>=0)return!1;return!0}o(EM,"singleLineValues");function SM(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Xr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Xr.call(Array(e+1),r)}}o(SM,"getIndent");function mm(t,e){if(t.length===0)return"";var r=`
|
|
57
57
|
`+e.prev+e.base;return r+Xr.call(t,","+r)+`
|
|
58
|
-
`+e.prev}o(mm,"indentedJoin");function Ic(t,e){var r=fm(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 um=="function"?um(t):[],c;if(Ai){c={};for(var d=0;d<s.length;d++)c["$"+s[d]]=s[d]}for(var p in t)wn(t,p)&&(r&&String(Number(p))===p&&p<t.length||Ai&&c["$"+p]instanceof Symbol||(sP.call(/[^\w$]/,p)?n.push(e(p,t)+": "+e(t[p],t)):n.push(p+": "+e(t[p],t))));if(typeof um=="function")for(var m=0;m<s.length;m++)uP.call(t,s[m])&&n.push("["+e(s[m])+"]: "+e(t[s[m]],t));return n}o(Ic,"arrObjKeys")});var gP=D((CQ,hP)=>{"use strict";var EM=Za(),SM=Bn(),Oc=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"),wM=o(function(t,e){if(t){var r=Oc(t,e);return r&&r.value}},"listGet"),TM=o(function(t,e,r){var n=Oc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),PM=o(function(t,e){return t?!!Oc(t,e):!1},"listHas"),xM=o(function(t,e){if(t)return Oc(t,e,!0)},"listDelete");hP.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new SM("Side channel does not contain "+EM(n))},"assert"),delete:o(function(n){var i=xM(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return wM(e,n)},"get"),has:o(function(n){return PM(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),TM(e,n,i)},"set")};return r},"getSideChannelList")});var vm=D((kQ,_P)=>{"use strict";var yP=la(),vP=xd(),AM=vP([yP("%String.prototype.indexOf%")]);_P.exports=o(function(e,r){var n=yP(e,!!r);return typeof n=="function"&&AM(e,".prototype.")>-1?vP([n]):n},"callBoundIntrinsic")});var _m=D((DQ,EP)=>{"use strict";var IM=la(),Ka=vm(),RM=Za(),CM=Bn(),bP=IM("%Map%",!0),OM=Ka("Map.prototype.get",!0),kM=Ka("Map.prototype.set",!0),$M=Ka("Map.prototype.has",!0),DM=Ka("Map.prototype.delete",!0),NM=Ka("Map.prototype.size",!0);EP.exports=!!bP&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new CM("Side channel does not contain "+RM(n))},"assert"),delete:o(function(n){if(e){var i=DM(e,n);return NM(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return OM(e,n)},"get"),has:o(function(n){return e?$M(e,n):!1},"has"),set:o(function(n,i){e||(e=new bP),kM(e,n,i)},"set")};return r},"getSideChannelMap")});var wP=D((zQ,SP)=>{"use strict";var zM=la(),$c=vm(),UM=Za(),kc=_m(),MM=Bn(),Ii=zM("%WeakMap%",!0),LM=$c("WeakMap.prototype.get",!0),jM=$c("WeakMap.prototype.set",!0),FM=$c("WeakMap.prototype.has",!0),qM=$c("WeakMap.prototype.delete",!0);SP.exports=Ii?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new MM("Side channel does not contain "+UM(i))},"assert"),delete:o(function(i){if(Ii&&i&&(typeof i=="object"||typeof i=="function")){if(e)return qM(e,i)}else if(kc&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return Ii&&i&&(typeof i=="object"||typeof i=="function")&&e?LM(e,i):r&&r.get(i)},"get"),has:o(function(i){return Ii&&i&&(typeof i=="object"||typeof i=="function")&&e?FM(e,i):!!r&&r.has(i)},"has"),set:o(function(i,s){Ii&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Ii),jM(e,i,s)):kc&&(r||(r=kc()),r.set(i,s))},"set")};return n},"getSideChannelWeakMap"):kc});var bm=D((MQ,TP)=>{"use strict";var BM=Bn(),VM=Za(),GM=gP(),HM=_m(),WM=wP(),ZM=WM||HM||GM;TP.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new BM("Side channel does not contain "+VM(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=ZM()),e.set(n,i)},"set")};return r},"getSideChannel")});var Dc=D((jQ,PP)=>{"use strict";var KM=String.prototype.replace,JM=/%20/g,Em={RFC1738:"RFC1738",RFC3986:"RFC3986"};PP.exports={default:Em.RFC3986,formatters:{RFC1738:o(function(t){return KM.call(t,JM,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:Em.RFC1738,RFC3986:Em.RFC3986}});var Pm=D((qQ,xP)=>{"use strict";var YM=Dc(),XM=bm(),Sm=Object.prototype.hasOwnProperty,xo=Array.isArray,Nc=XM(),Ri=o(function(e,r){return Nc.set(e,r),e},"markOverflow"),Ao=o(function(e){return Nc.has(e)},"isOverflow"),Ja=o(function(e){return Nc.get(e)},"getMaxIndex"),Tm=o(function(e,r){Nc.set(e,r)},"setMaxIndex"),Qr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),QM=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(xo(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"),Ya=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"),e1=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(xo(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return Ri(Ya(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(Ao(e)){var s=Ja(e)+1;e[s]=r,Tm(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(Ao(r)){for(var c=Object.keys(r),d=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},p=0;p<c.length;p++){var m=parseInt(c[p],10);d[m+1]=r[c[p]]}return Ri(d,Ja(r)+1)}var y=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&y.length>n.arrayLimit?Ri(Ya(y,n),y.length-1):y}var h=e;return xo(e)&&!xo(r)&&(h=Ya(e,n)),xo(e)&&xo(r)?(r.forEach(function(f,l){if(Sm.call(e,l)){var g=e[l];g&&typeof g=="object"&&f&&typeof f=="object"?e[l]=t(g,f,n):e[e.length]=f}else e[l]=f}),e):Object.keys(r).reduce(function(f,l){var g=r[l];if(Sm.call(f,l)?f[l]=t(f[l],g,n):f[l]=g,Ao(r)&&!Ao(f)&&Ri(f,Ja(r)),Ao(f)){var v=parseInt(l,10);String(v)===l&&v>=0&&v>Ja(f)&&Tm(f,v)}return f},h)},"merge"),t1=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),r1=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"),wm=1024,n1=o(function(e,r,n,i,s){if(e.length===0)return e;var c=e;if(typeof e=="symbol"?c=Symbol.prototype.toString.call(e):typeof e!="string"&&(c=String(e)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var d="",p=0;p<c.length;p+=wm){for(var m=c.length>=wm?c.slice(p,p+wm):c,y=[],h=0;h<m.length;++h){var f=m.charCodeAt(h);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||s===YM.RFC1738&&(f===40||f===41)){y[y.length]=m.charAt(h);continue}if(f<128){y[y.length]=Qr[f];continue}if(f<2048){y[y.length]=Qr[192|f>>6]+Qr[128|f&63];continue}if(f<55296||f>=57344){y[y.length]=Qr[224|f>>12]+Qr[128|f>>6&63]+Qr[128|f&63];continue}h+=1,f=65536+((f&1023)<<10|m.charCodeAt(h)&1023),y[y.length]=Qr[240|f>>18]+Qr[128|f>>12&63]+Qr[128|f>>6&63]+Qr[128|f&63]}d+=y.join("")}return d},"encode"),o1=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],c=s.obj[s.prop],d=Object.keys(c),p=0;p<d.length;++p){var m=d[p],y=c[m];typeof y=="object"&&y!==null&&n.indexOf(y)===-1&&(r[r.length]={obj:c,prop:m},n[n.length]=y)}return QM(r),e},"compact"),i1=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),a1=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),s1=o(function(e,r,n,i){if(Ao(e)){var s=Ja(e)+1;return e[s]=r,Tm(e,s),e}var c=[].concat(e,r);return c.length>n?Ri(Ya(c,{plainObjects:i}),c.length-1):c},"combine"),u1=o(function(e,r){if(xo(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");xP.exports={arrayToObject:Ya,assign:t1,combine:s1,compact:o1,decode:r1,encode:n1,isBuffer:a1,isOverflow:Ao,isRegExp:i1,markOverflow:Ri,maybeMap:u1,merge:e1}});var kP=D((VQ,OP)=>{"use strict";var IP=bm(),zc=Pm(),Xa=Dc(),c1=Object.prototype.hasOwnProperty,RP={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")},en=Array.isArray,l1=Array.prototype.push,CP=o(function(t,e){l1.apply(t,en(e)?e:[e])},"pushToArray"),d1=Date.prototype.toISOString,AP=Xa.default,St={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:zc.encode,encodeValuesOnly:!1,filter:void 0,format:AP,formatter:Xa.formatters[AP],indices:!1,serializeDate:o(function(e){return d1.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},p1=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),xm={},f1=o(function t(e,r,n,i,s,c,d,p,m,y,h,f,l,g,v,E,b,C){for(var U=e,J=C,W=0,H=!1;(J=J.get(xm))!==void 0&&!H;){var K=J.get(e);if(W+=1,typeof K<"u"){if(K===W)throw new RangeError("Cyclic object value");H=!0}typeof J.get(xm)>"u"&&(W=0)}if(typeof y=="function"?U=y(r,U):U instanceof Date?U=l(U):n==="comma"&&en(U)&&(U=zc.maybeMap(U,function(Ke){return Ke instanceof Date?l(Ke):Ke})),U===null){if(c)return m&&!E?m(r,St.encoder,b,"key",g):r;U=""}if(p1(U)||zc.isBuffer(U)){if(m){var te=E?r:m(r,St.encoder,b,"key",g);return[v(te)+"="+v(m(U,St.encoder,b,"value",g))]}return[v(r)+"="+v(String(U))]}var Q=[];if(typeof U>"u")return Q;var xe;if(n==="comma"&&en(U))E&&m&&(U=zc.maybeMap(U,m)),xe=[{value:U.length>0?U.join(",")||null:void 0}];else if(en(y))xe=y;else{var re=Object.keys(U);xe=h?re.sort(h):re}var V=p?String(r).replace(/\./g,"%2E"):String(r),B=i&&en(U)&&U.length===1?V+"[]":V;if(s&&en(U)&&U.length===0)return B+"[]";for(var X=0;X<xe.length;++X){var Y=xe[X],ie=typeof Y=="object"&&Y&&typeof Y.value<"u"?Y.value:U[Y];if(!(d&&ie===null)){var ue=f&&p?String(Y).replace(/\./g,"%2E"):String(Y),Ce=en(U)?typeof n=="function"?n(B,ue):B:B+(f?"."+ue:"["+ue+"]");C.set(e,W);var De=IP();De.set(xm,C),CP(Q,t(ie,Ce,n,i,s,c,d,p,n==="comma"&&E&&en(U)?null:m,y,h,f,l,g,v,E,b,De))}}return Q},"stringify"),m1=o(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.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||St.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=Xa.default;if(typeof e.format<"u"){if(!c1.call(Xa.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Xa.formatters[n],s=St.filter;(typeof e.filter=="function"||en(e.filter))&&(s=e.filter);var c;if(e.arrayFormat in RP?c=e.arrayFormat:"indices"in e?c=e.indices?"indices":"repeat":c=St.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:St.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:St.addQueryPrefix,allowDots:d,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:St.allowEmptyArrays,arrayFormat:c,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:St.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?St.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:St.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:St.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:St.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:St.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:St.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:St.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:St.strictNullHandling}},"normalizeStringifyOptions");OP.exports=function(t,e){var r=t,n=m1(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):en(n.filter)&&(s=n.filter,i=s);var c=[];if(typeof r!="object"||r===null)return"";var d=RP[n.arrayFormat],p=d==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var m=IP(),y=0;y<i.length;++y){var h=i[y],f=r[h];n.skipNulls&&f===null||CP(c,f1(f,h,d,p,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,m))}var l=c.join(n.delimiter),g=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),l.length>0?g+l:""}});var NP=D((HQ,DP)=>{"use strict";var tn=Pm(),Uc=Object.prototype.hasOwnProperty,Am=Array.isArray,ct={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:tn.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},h1=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),$P=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"),g1="utf8=%26%2310003%3B",y1="utf8=%E2%9C%93",v1=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,c=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&c.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var d=-1,p,m=r.charset;if(r.charsetSentinel)for(p=0;p<c.length;++p)c[p].indexOf("utf8=")===0&&(c[p]===y1?m="utf-8":c[p]===g1&&(m="iso-8859-1"),d=p,p=c.length);for(p=0;p<c.length;++p)if(p!==d){var y=c[p],h=y.indexOf("]="),f=h===-1?y.indexOf("="):h+1,l,g;if(f===-1?(l=r.decoder(y,ct.decoder,m,"key"),g=r.strictNullHandling?null:""):(l=r.decoder(y.slice(0,f),ct.decoder,m,"key"),l!==null&&(g=tn.maybeMap($P(y.slice(f+1),r,Am(n[l])?n[l].length:0),function(E){return r.decoder(E,ct.decoder,m,"value")}))),g&&r.interpretNumericEntities&&m==="iso-8859-1"&&(g=h1(String(g))),y.indexOf("[]=")>-1&&(g=Am(g)?[g]:g),r.comma&&Am(g)&&g.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");g=tn.combine([],g,r.arrayLimit,r.plainObjects)}if(l!==null){var v=Uc.call(n,l);v&&(r.duplicates==="combine"||y.indexOf("[]=")>-1)?n[l]=tn.combine(n[l],g,r.arrayLimit,r.plainObjects):(!v||r.duplicates==="last")&&(n[l]=g)}}return n},"parseQueryStringValues"),_1=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");i=Array.isArray(e)&&e[s]?e[s].length:0}for(var c=n?e:$P(e,r,i),d=t.length-1;d>=0;--d){var p,m=t[d];if(m==="[]"&&r.parseArrays)tn.isOverflow(c)?p=c:p=r.allowEmptyArrays&&(c===""||r.strictNullHandling&&c===null)?[]:tn.combine([],c,r.arrayLimit,r.plainObjects);else{p=r.plainObjects?{__proto__:null}:{};var y=m.charAt(0)==="["&&m.charAt(m.length-1)==="]"?m.slice(1,-1):m,h=r.decodeDotInKeys?y.replace(/%2E/g,"."):y,f=parseInt(h,10),l=!isNaN(f)&&m!==h&&String(f)===h&&f>=0&&r.parseArrays;if(!r.parseArrays&&h==="")p={0:c};else if(l&&f<r.arrayLimit)p=[],p[f]=c;else{if(l&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");l?(p[f]=c,tn.markOverflow(p,f)):h!=="__proto__"&&(p[h]=c)}}c=p}return c},"parseObject"),b1=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Uc.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=i.exec(n),d=c?n.slice(0,c.index):n,p=[];if(d){if(!r.plainObjects&&Uc.call(Object.prototype,d)&&!r.allowPrototypes)return;p[p.length]=d}for(var m=0;(c=s.exec(n))!==null&&m<r.depth;){m+=1;var y=c[1].slice(1,-1);if(!r.plainObjects&&Uc.call(Object.prototype,y)&&!r.allowPrototypes)return;p[p.length]=c[1]}if(c){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");p[p.length]="["+n.slice(c.index)+"]"}return p},"splitKeyIntoSegments"),E1=o(function(e,r,n,i){if(e){var s=b1(e,n);if(s)return _1(s,r,n,i)}},"parseQueryStringKeys"),S1=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"||tn.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");DP.exports=function(t,e){var r=S1(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?v1(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),c=0;c<s.length;++c){var d=s[c],p=E1(d,n[d],r,typeof t=="string");i=tn.merge(i,p,r)}return r.allowSparse===!0?i:tn.compact(i)}});var Im=D((ZQ,zP)=>{"use strict";var w1=kP(),T1=NP(),P1=Dc();zP.exports={formats:P1,parse:T1,stringify:w1}});var MP=D((Rm,UP)=>{(function(t,e){typeof Rm=="object"?UP.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(Rm,function(){function t(){}return o(t,"UrlTemplate"),t.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(r){return/%[0-9A-Fa-f]/.test(r)||(r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")),r}).join("")},t.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})},t.prototype.encodeValue=function(e,r,n){return r=e==="+"||e==="#"?this.encodeReserved(r):this.encodeUnreserved(r),n?this.encodeUnreserved(n)+"="+r:r},t.prototype.isDefined=function(e){return e!=null},t.prototype.isKeyOperator=function(e){return e===";"||e==="&"||e==="?"},t.prototype.getValues=function(e,r,n,i){var s=e[n],c=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),c.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(i==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(p){c.push(this.encodeValue(r,p,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(p){this.isDefined(s[p])&&c.push(this.encodeValue(r,s[p],p))},this);else{var d=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(p){d.push(this.encodeValue(r,p))},this):Object.keys(s).forEach(function(p){this.isDefined(s[p])&&(d.push(this.encodeUnreserved(p)),d.push(this.encodeValue(r,s[p].toString())))},this),this.isKeyOperator(r)?c.push(this.encodeUnreserved(n)+"="+d.join(",")):d.length!==0&&c.push(d.join(","))}else r===";"?this.isDefined(s)&&c.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?c.push(this.encodeUnreserved(n)+"="):s===""&&c.push("");return c},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:o(function(i){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,c,d){if(c){var p=null,m=[];if(n.indexOf(c.charAt(0))!==-1&&(p=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(h){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(h);m.push.apply(m,r.getValues(i,p,f[1],f[2]||f[3]))}),p&&p!=="+"){var y=",";return p==="?"?y="&":p!=="#"&&(y=p),(m.length!==0?p:"")+m.join(y)}else return m.join(",")}else return r.encodeReserved(d)})},"expand")}},new t})});var LP=D(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.isBrowser=x1;function x1(){return typeof window<"u"}o(x1,"isBrowser")});var Lc=D(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.headersToClassicHeaders=jP;Mc.marshallGaxiosResponse=A1;function jP(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(jP,"headersToClassicHeaders");function A1(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:jP(t?.headers)}})}o(A1,"marshallGaxiosResponse")});var BP=D(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.sessions=void 0;ur.request=j1;ur.closeSession=Om;var qP=require("http2"),I1=require("zlib"),R1=require("url"),C1=Im(),O1=pa(),k1=require("stream"),$1=require("util"),D1=require("process"),N1=Lc(),{HTTP2_HEADER_CONTENT_ENCODING:z1,HTTP2_HEADER_CONTENT_TYPE:FP,HTTP2_HEADER_METHOD:U1,HTTP2_HEADER_PATH:M1,HTTP2_HEADER_STATUS:L1}=qP.constants,Qa=!!D1.env.HTTP2_DEBUG;ur.sessions={};async function j1(t){let e=O1(!0,{},t);e.validateStatus=e.validateStatus||F1,e.responseType=e.responseType||"json";let r=new R1.URL(e.url),n=q1(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let h=(t.paramsSerializer||C1.stringify)(e.params);i+=`?${h}`}let s=(0,N1.headersToClassicHeaders)(e.headers);s[M1]=i,s[U1]=t.method||"GET",e.headers=s,s[FP]||e.responseType!=="text"&&(s[FP]="application/json");let c={config:t,headers:{},status:0,data:{},statusText:""},d=[],p=n.session,m;return new Promise((y,h)=>{try{m=p.request(s).on("response",f=>{Object.assign(c,{headers:f,status:f[L1]});let l=m;if(f[z1]==="gzip"&&(l=m.pipe(I1.createGunzip())),e.responseType==="stream"){c.data=l,y(c);return}l.on("data",g=>{d.push(g)}).on("error",g=>{h(g)}).on("end",()=>{let g=Buffer.concat(d),v=g;if(g){if(e.responseType==="json")try{v=JSON.parse(g.toString("utf8"))}catch{v=g.toString("utf8")}else e.responseType==="text"?v=g.toString("utf8"):e.responseType==="arraybuffer"&&(v=g.buffer);c.data=v}if(!e.validateStatus(c.status)){let E=`Request failed with status code ${c.status}. `;if(c.data&&typeof c.data=="object"){let b=$1.inspect(c.data,{depth:5});E=`${E}
|
|
59
|
-
'${b}`}h(new Error(E,{cause:c}))}y(c)})}).on("error",f=>{h(f)})}catch(f){Om(r).then(()=>h(f)).catch(h);return}if(c.request=m,t.data){if(t.data instanceof
|
|
60
|
-
`),this.push(v),U()}}),b=new Nm,C=
|
|
58
|
+
`+e.prev}o(mm,"indentedJoin");function Ic(t,e){var r=fm(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 um=="function"?um(t):[],c;if(Ai){c={};for(var d=0;d<s.length;d++)c["$"+s[d]]=s[d]}for(var p in t)wn(t,p)&&(r&&String(Number(p))===p&&p<t.length||Ai&&c["$"+p]instanceof Symbol||(uP.call(/[^\w$]/,p)?n.push(e(p,t)+": "+e(t[p],t)):n.push(p+": "+e(t[p],t))));if(typeof um=="function")for(var m=0;m<s.length;m++)cP.call(t,s[m])&&n.push("["+e(s[m])+"]: "+e(t[s[m]],t));return n}o(Ic,"arrObjKeys")});var yP=D((DQ,gP)=>{"use strict";var wM=Za(),TM=Bn(),Oc=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"),PM=o(function(t,e){if(t){var r=Oc(t,e);return r&&r.value}},"listGet"),xM=o(function(t,e,r){var n=Oc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),AM=o(function(t,e){return t?!!Oc(t,e):!1},"listHas"),IM=o(function(t,e){if(t)return Oc(t,e,!0)},"listDelete");gP.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new TM("Side channel does not contain "+wM(n))},"assert"),delete:o(function(n){var i=IM(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return PM(e,n)},"get"),has:o(function(n){return AM(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),xM(e,n,i)},"set")};return r},"getSideChannelList")});var vm=D((zQ,bP)=>{"use strict";var vP=la(),_P=xd(),RM=_P([vP("%String.prototype.indexOf%")]);bP.exports=o(function(e,r){var n=vP(e,!!r);return typeof n=="function"&&RM(e,".prototype.")>-1?_P([n]):n},"callBoundIntrinsic")});var _m=D((MQ,SP)=>{"use strict";var CM=la(),Ka=vm(),OM=Za(),kM=Bn(),EP=CM("%Map%",!0),$M=Ka("Map.prototype.get",!0),DM=Ka("Map.prototype.set",!0),NM=Ka("Map.prototype.has",!0),zM=Ka("Map.prototype.delete",!0),UM=Ka("Map.prototype.size",!0);SP.exports=!!EP&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new kM("Side channel does not contain "+OM(n))},"assert"),delete:o(function(n){if(e){var i=zM(e,n);return UM(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return $M(e,n)},"get"),has:o(function(n){return e?NM(e,n):!1},"has"),set:o(function(n,i){e||(e=new EP),DM(e,n,i)},"set")};return r},"getSideChannelMap")});var TP=D((jQ,wP)=>{"use strict";var MM=la(),$c=vm(),LM=Za(),kc=_m(),jM=Bn(),Ii=MM("%WeakMap%",!0),FM=$c("WeakMap.prototype.get",!0),qM=$c("WeakMap.prototype.set",!0),BM=$c("WeakMap.prototype.has",!0),VM=$c("WeakMap.prototype.delete",!0);wP.exports=Ii?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new jM("Side channel does not contain "+LM(i))},"assert"),delete:o(function(i){if(Ii&&i&&(typeof i=="object"||typeof i=="function")){if(e)return VM(e,i)}else if(kc&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return Ii&&i&&(typeof i=="object"||typeof i=="function")&&e?FM(e,i):r&&r.get(i)},"get"),has:o(function(i){return Ii&&i&&(typeof i=="object"||typeof i=="function")&&e?BM(e,i):!!r&&r.has(i)},"has"),set:o(function(i,s){Ii&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Ii),qM(e,i,s)):kc&&(r||(r=kc()),r.set(i,s))},"set")};return n},"getSideChannelWeakMap"):kc});var bm=D((qQ,PP)=>{"use strict";var GM=Bn(),HM=Za(),WM=yP(),ZM=_m(),KM=TP(),JM=KM||ZM||WM;PP.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new GM("Side channel does not contain "+HM(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=JM()),e.set(n,i)},"set")};return r},"getSideChannel")});var Dc=D((VQ,xP)=>{"use strict";var YM=String.prototype.replace,XM=/%20/g,Em={RFC1738:"RFC1738",RFC3986:"RFC3986"};xP.exports={default:Em.RFC3986,formatters:{RFC1738:o(function(t){return YM.call(t,XM,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:Em.RFC1738,RFC3986:Em.RFC3986}});var Pm=D((HQ,AP)=>{"use strict";var QM=Dc(),e1=bm(),Sm=Object.prototype.hasOwnProperty,xo=Array.isArray,Nc=e1(),Ri=o(function(e,r){return Nc.set(e,r),e},"markOverflow"),Ao=o(function(e){return Nc.has(e)},"isOverflow"),Ja=o(function(e){return Nc.get(e)},"getMaxIndex"),Tm=o(function(e,r){Nc.set(e,r)},"setMaxIndex"),Qr=(function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t})(),t1=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(xo(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"),Ya=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"),r1=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(xo(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return Ri(Ya(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(Ao(e)){var s=Ja(e)+1;e[s]=r,Tm(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(Ao(r)){for(var c=Object.keys(r),d=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},p=0;p<c.length;p++){var m=parseInt(c[p],10);d[m+1]=r[c[p]]}return Ri(d,Ja(r)+1)}var y=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&y.length>n.arrayLimit?Ri(Ya(y,n),y.length-1):y}var h=e;return xo(e)&&!xo(r)&&(h=Ya(e,n)),xo(e)&&xo(r)?(r.forEach(function(f,l){if(Sm.call(e,l)){var g=e[l];g&&typeof g=="object"&&f&&typeof f=="object"?e[l]=t(g,f,n):e[e.length]=f}else e[l]=f}),e):Object.keys(r).reduce(function(f,l){var g=r[l];if(Sm.call(f,l)?f[l]=t(f[l],g,n):f[l]=g,Ao(r)&&!Ao(f)&&Ri(f,Ja(r)),Ao(f)){var v=parseInt(l,10);String(v)===l&&v>=0&&v>Ja(f)&&Tm(f,v)}return f},h)},"merge"),n1=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),o1=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"),wm=1024,i1=o(function(e,r,n,i,s){if(e.length===0)return e;var c=e;if(typeof e=="symbol"?c=Symbol.prototype.toString.call(e):typeof e!="string"&&(c=String(e)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var d="",p=0;p<c.length;p+=wm){for(var m=c.length>=wm?c.slice(p,p+wm):c,y=[],h=0;h<m.length;++h){var f=m.charCodeAt(h);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||s===QM.RFC1738&&(f===40||f===41)){y[y.length]=m.charAt(h);continue}if(f<128){y[y.length]=Qr[f];continue}if(f<2048){y[y.length]=Qr[192|f>>6]+Qr[128|f&63];continue}if(f<55296||f>=57344){y[y.length]=Qr[224|f>>12]+Qr[128|f>>6&63]+Qr[128|f&63];continue}h+=1,f=65536+((f&1023)<<10|m.charCodeAt(h)&1023),y[y.length]=Qr[240|f>>18]+Qr[128|f>>12&63]+Qr[128|f>>6&63]+Qr[128|f&63]}d+=y.join("")}return d},"encode"),a1=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],c=s.obj[s.prop],d=Object.keys(c),p=0;p<d.length;++p){var m=d[p],y=c[m];typeof y=="object"&&y!==null&&n.indexOf(y)===-1&&(r[r.length]={obj:c,prop:m},n[n.length]=y)}return t1(r),e},"compact"),s1=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),u1=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),c1=o(function(e,r,n,i){if(Ao(e)){var s=Ja(e)+1;return e[s]=r,Tm(e,s),e}var c=[].concat(e,r);return c.length>n?Ri(Ya(c,{plainObjects:i}),c.length-1):c},"combine"),l1=o(function(e,r){if(xo(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");AP.exports={arrayToObject:Ya,assign:n1,combine:c1,compact:a1,decode:o1,encode:i1,isBuffer:u1,isOverflow:Ao,isRegExp:s1,markOverflow:Ri,maybeMap:l1,merge:r1}});var $P=D((ZQ,kP)=>{"use strict";var RP=bm(),zc=Pm(),Xa=Dc(),d1=Object.prototype.hasOwnProperty,CP={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")},en=Array.isArray,p1=Array.prototype.push,OP=o(function(t,e){p1.apply(t,en(e)?e:[e])},"pushToArray"),f1=Date.prototype.toISOString,IP=Xa.default,St={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:zc.encode,encodeValuesOnly:!1,filter:void 0,format:IP,formatter:Xa.formatters[IP],indices:!1,serializeDate:o(function(e){return f1.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},m1=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),xm={},h1=o(function t(e,r,n,i,s,c,d,p,m,y,h,f,l,g,v,E,b,C){for(var U=e,J=C,Z=0,H=!1;(J=J.get(xm))!==void 0&&!H;){var K=J.get(e);if(Z+=1,typeof K<"u"){if(K===Z)throw new RangeError("Cyclic object value");H=!0}typeof J.get(xm)>"u"&&(Z=0)}if(typeof y=="function"?U=y(r,U):U instanceof Date?U=l(U):n==="comma"&&en(U)&&(U=zc.maybeMap(U,function(Ke){return Ke instanceof Date?l(Ke):Ke})),U===null){if(c)return m&&!E?m(r,St.encoder,b,"key",g):r;U=""}if(m1(U)||zc.isBuffer(U)){if(m){var te=E?r:m(r,St.encoder,b,"key",g);return[v(te)+"="+v(m(U,St.encoder,b,"value",g))]}return[v(r)+"="+v(String(U))]}var Q=[];if(typeof U>"u")return Q;var xe;if(n==="comma"&&en(U))E&&m&&(U=zc.maybeMap(U,m)),xe=[{value:U.length>0?U.join(",")||null:void 0}];else if(en(y))xe=y;else{var re=Object.keys(U);xe=h?re.sort(h):re}var V=p?String(r).replace(/\./g,"%2E"):String(r),B=i&&en(U)&&U.length===1?V+"[]":V;if(s&&en(U)&&U.length===0)return B+"[]";for(var X=0;X<xe.length;++X){var Y=xe[X],ie=typeof Y=="object"&&Y&&typeof Y.value<"u"?Y.value:U[Y];if(!(d&&ie===null)){var ue=f&&p?String(Y).replace(/\./g,"%2E"):String(Y),Ce=en(U)?typeof n=="function"?n(B,ue):B:B+(f?"."+ue:"["+ue+"]");C.set(e,Z);var De=RP();De.set(xm,C),OP(Q,t(ie,Ce,n,i,s,c,d,p,n==="comma"&&E&&en(U)?null:m,y,h,f,l,g,v,E,b,De))}}return Q},"stringify"),g1=o(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.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||St.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=Xa.default;if(typeof e.format<"u"){if(!d1.call(Xa.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Xa.formatters[n],s=St.filter;(typeof e.filter=="function"||en(e.filter))&&(s=e.filter);var c;if(e.arrayFormat in CP?c=e.arrayFormat:"indices"in e?c=e.indices?"indices":"repeat":c=St.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:St.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:St.addQueryPrefix,allowDots:d,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:St.allowEmptyArrays,arrayFormat:c,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:St.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?St.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:St.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:St.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:St.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:St.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:St.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:St.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:St.strictNullHandling}},"normalizeStringifyOptions");kP.exports=function(t,e){var r=t,n=g1(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):en(n.filter)&&(s=n.filter,i=s);var c=[];if(typeof r!="object"||r===null)return"";var d=CP[n.arrayFormat],p=d==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var m=RP(),y=0;y<i.length;++y){var h=i[y],f=r[h];n.skipNulls&&f===null||OP(c,h1(f,h,d,p,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,m))}var l=c.join(n.delimiter),g=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),l.length>0?g+l:""}});var zP=D((JQ,NP)=>{"use strict";var tn=Pm(),Uc=Object.prototype.hasOwnProperty,Am=Array.isArray,ct={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:tn.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},y1=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),DP=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"),v1="utf8=%26%2310003%3B",_1="utf8=%E2%9C%93",b1=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,c=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&c.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var d=-1,p,m=r.charset;if(r.charsetSentinel)for(p=0;p<c.length;++p)c[p].indexOf("utf8=")===0&&(c[p]===_1?m="utf-8":c[p]===v1&&(m="iso-8859-1"),d=p,p=c.length);for(p=0;p<c.length;++p)if(p!==d){var y=c[p],h=y.indexOf("]="),f=h===-1?y.indexOf("="):h+1,l,g;if(f===-1?(l=r.decoder(y,ct.decoder,m,"key"),g=r.strictNullHandling?null:""):(l=r.decoder(y.slice(0,f),ct.decoder,m,"key"),l!==null&&(g=tn.maybeMap(DP(y.slice(f+1),r,Am(n[l])?n[l].length:0),function(E){return r.decoder(E,ct.decoder,m,"value")}))),g&&r.interpretNumericEntities&&m==="iso-8859-1"&&(g=y1(String(g))),y.indexOf("[]=")>-1&&(g=Am(g)?[g]:g),r.comma&&Am(g)&&g.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");g=tn.combine([],g,r.arrayLimit,r.plainObjects)}if(l!==null){var v=Uc.call(n,l);v&&(r.duplicates==="combine"||y.indexOf("[]=")>-1)?n[l]=tn.combine(n[l],g,r.arrayLimit,r.plainObjects):(!v||r.duplicates==="last")&&(n[l]=g)}}return n},"parseQueryStringValues"),E1=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");i=Array.isArray(e)&&e[s]?e[s].length:0}for(var c=n?e:DP(e,r,i),d=t.length-1;d>=0;--d){var p,m=t[d];if(m==="[]"&&r.parseArrays)tn.isOverflow(c)?p=c:p=r.allowEmptyArrays&&(c===""||r.strictNullHandling&&c===null)?[]:tn.combine([],c,r.arrayLimit,r.plainObjects);else{p=r.plainObjects?{__proto__:null}:{};var y=m.charAt(0)==="["&&m.charAt(m.length-1)==="]"?m.slice(1,-1):m,h=r.decodeDotInKeys?y.replace(/%2E/g,"."):y,f=parseInt(h,10),l=!isNaN(f)&&m!==h&&String(f)===h&&f>=0&&r.parseArrays;if(!r.parseArrays&&h==="")p={0:c};else if(l&&f<r.arrayLimit)p=[],p[f]=c;else{if(l&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");l?(p[f]=c,tn.markOverflow(p,f)):h!=="__proto__"&&(p[h]=c)}}c=p}return c},"parseObject"),S1=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&Uc.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=i.exec(n),d=c?n.slice(0,c.index):n,p=[];if(d){if(!r.plainObjects&&Uc.call(Object.prototype,d)&&!r.allowPrototypes)return;p[p.length]=d}for(var m=0;(c=s.exec(n))!==null&&m<r.depth;){m+=1;var y=c[1].slice(1,-1);if(!r.plainObjects&&Uc.call(Object.prototype,y)&&!r.allowPrototypes)return;p[p.length]=c[1]}if(c){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");p[p.length]="["+n.slice(c.index)+"]"}return p},"splitKeyIntoSegments"),w1=o(function(e,r,n,i){if(e){var s=S1(e,n);if(s)return E1(s,r,n,i)}},"parseQueryStringKeys"),T1=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"||tn.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");NP.exports=function(t,e){var r=T1(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?b1(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),c=0;c<s.length;++c){var d=s[c],p=w1(d,n[d],r,typeof t=="string");i=tn.merge(i,p,r)}return r.allowSparse===!0?i:tn.compact(i)}});var Im=D((XQ,UP)=>{"use strict";var P1=$P(),x1=zP(),A1=Dc();UP.exports={formats:A1,parse:x1,stringify:P1}});var LP=D((Rm,MP)=>{(function(t,e){typeof Rm=="object"?MP.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(Rm,function(){function t(){}return o(t,"UrlTemplate"),t.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(r){return/%[0-9A-Fa-f]/.test(r)||(r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")),r}).join("")},t.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})},t.prototype.encodeValue=function(e,r,n){return r=e==="+"||e==="#"?this.encodeReserved(r):this.encodeUnreserved(r),n?this.encodeUnreserved(n)+"="+r:r},t.prototype.isDefined=function(e){return e!=null},t.prototype.isKeyOperator=function(e){return e===";"||e==="&"||e==="?"},t.prototype.getValues=function(e,r,n,i){var s=e[n],c=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),c.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(i==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(p){c.push(this.encodeValue(r,p,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(p){this.isDefined(s[p])&&c.push(this.encodeValue(r,s[p],p))},this);else{var d=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(p){d.push(this.encodeValue(r,p))},this):Object.keys(s).forEach(function(p){this.isDefined(s[p])&&(d.push(this.encodeUnreserved(p)),d.push(this.encodeValue(r,s[p].toString())))},this),this.isKeyOperator(r)?c.push(this.encodeUnreserved(n)+"="+d.join(",")):d.length!==0&&c.push(d.join(","))}else r===";"?this.isDefined(s)&&c.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?c.push(this.encodeUnreserved(n)+"="):s===""&&c.push("");return c},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:o(function(i){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,c,d){if(c){var p=null,m=[];if(n.indexOf(c.charAt(0))!==-1&&(p=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(h){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(h);m.push.apply(m,r.getValues(i,p,f[1],f[2]||f[3]))}),p&&p!=="+"){var y=",";return p==="?"?y="&":p!=="#"&&(y=p),(m.length!==0?p:"")+m.join(y)}else return m.join(",")}else return r.encodeReserved(d)})},"expand")}},new t})});var jP=D(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.isBrowser=I1;function I1(){return typeof window<"u"}o(I1,"isBrowser")});var Lc=D(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.headersToClassicHeaders=FP;Mc.marshallGaxiosResponse=R1;function FP(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(FP,"headersToClassicHeaders");function R1(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:FP(t?.headers)}})}o(R1,"marshallGaxiosResponse")});var VP=D(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.sessions=void 0;ur.request=q1;ur.closeSession=Om;var BP=require("http2"),C1=require("zlib"),O1=require("url"),k1=Im(),$1=pa(),D1=require("stream"),N1=require("util"),z1=require("process"),U1=Lc(),{HTTP2_HEADER_CONTENT_ENCODING:M1,HTTP2_HEADER_CONTENT_TYPE:qP,HTTP2_HEADER_METHOD:L1,HTTP2_HEADER_PATH:j1,HTTP2_HEADER_STATUS:F1}=BP.constants,Qa=!!z1.env.HTTP2_DEBUG;ur.sessions={};async function q1(t){let e=$1(!0,{},t);e.validateStatus=e.validateStatus||B1,e.responseType=e.responseType||"json";let r=new O1.URL(e.url),n=V1(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let h=(t.paramsSerializer||k1.stringify)(e.params);i+=`?${h}`}let s=(0,U1.headersToClassicHeaders)(e.headers);s[j1]=i,s[L1]=t.method||"GET",e.headers=s,s[qP]||e.responseType!=="text"&&(s[qP]="application/json");let c={config:t,headers:{},status:0,data:{},statusText:""},d=[],p=n.session,m;return new Promise((y,h)=>{try{m=p.request(s).on("response",f=>{Object.assign(c,{headers:f,status:f[F1]});let l=m;if(f[M1]==="gzip"&&(l=m.pipe(C1.createGunzip())),e.responseType==="stream"){c.data=l,y(c);return}l.on("data",g=>{d.push(g)}).on("error",g=>{h(g)}).on("end",()=>{let g=Buffer.concat(d),v=g;if(g){if(e.responseType==="json")try{v=JSON.parse(g.toString("utf8"))}catch{v=g.toString("utf8")}else e.responseType==="text"?v=g.toString("utf8"):e.responseType==="arraybuffer"&&(v=g.buffer);c.data=v}if(!e.validateStatus(c.status)){let E=`Request failed with status code ${c.status}. `;if(c.data&&typeof c.data=="object"){let b=N1.inspect(c.data,{depth:5});E=`${E}
|
|
59
|
+
'${b}`}h(new Error(E,{cause:c}))}y(c)})}).on("error",f=>{h(f)})}catch(f){Om(r).then(()=>h(f)).catch(h);return}if(c.request=m,t.data){if(t.data instanceof D1.Stream)t.data.pipe(m);else if(typeof t.data=="string"){let f=Buffer.from(t.data);m.end(f)}else if(typeof t.data=="object"){let f=JSON.stringify(t.data);m.end(f)}}n.timeoutHandle=setTimeout(()=>Om(r),500)})}o(q1,"request");function B1(t){return t>=200&&t<300}o(B1,"validateStatus");function V1(t){if(ur.sessions[t])Qa&&console.log(`Used cached client for ${t}`);else{Qa&&console.log(`Creating client for ${t}`);let e=BP.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete ur.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete ur.sessions[t]}),ur.sessions[t]={session:e}}return ur.sessions[t]}o(V1,"_getClient");async function Om(t){let e=ur.sessions[t.host];if(!e)return;let{session:r}=e;delete ur.sessions[t.host],Qa&&console.error(`Closing ${t.host}`),r.close(()=>{Qa&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(Qa&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}o(Om,"closeSession")});var GP=D((aee,G1)=>{G1.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 jc=D(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});zm.createAPIRequest=J1;var km=ht(),H1=Im(),JP=require("stream"),HP=LP(),WP=pa(),Dm=jP(),W1=VP(),$m=Lc(),YP=GP(),ZP=o(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function Z1(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}o(Z1,"isReadableStream");function K1(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}o(K1,"getMissingParams");function J1(t,e){if(e)KP(t).then(r=>e(null,r),e);else return KP(t)}o(J1,"createAPIRequest");async function KP(t){let e=WP(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=WP(!0,{},e.params,t.params);e.userAgentDirectives=e.userAgentDirectives||[];let n=r.media||{},i=r.requestBody;!r.requestBody&&r.resource&&(!t.requiredParams.includes("resource")||typeof r.resource!="string")&&(i=r.resource,delete r.resource),delete r.requestBody;let s=r.auth||e.auth,c=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let d=(0,$m.headersToClassicHeaders)(r.headers||{});Y1(d,e.apiVersion),delete r.headers,Object.keys(r).forEach(l=>{if(l.slice(-1)==="_"){let g=l.slice(0,-1);r[g]=r[l],delete r[l]}});let p=K1(r,t.requiredParams);if(p)throw new Error("Missing required parameters: "+p.join(", "));if(e.url){let l=e.url;typeof l=="object"&&(l=l.toString()),e.url=HP.parse(l).expand(r)}if(t.mediaUrl&&(t.mediaUrl=HP.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let l=new URL(e.url),g=l.href.substr(l.origin.length);e.url=new URL(g,t.context._options.rootUrl).href}e.paramsSerializer=l=>H1.stringify(l,{arrayFormat:"repeat"}),t.pathParams.forEach(l=>delete r[l]),typeof s=="string"&&(r.key=r.key||s,s=void 0);function m(l){let g=ZP(),v=`--${g}--`,E=new JP.PassThrough({flush(U){this.push(`\r
|
|
60
|
+
`),this.push(v),U()}}),b=new Nm,C=Z1(l[1].body);d["content-type"]=`multipart/related; boundary=${g}`;for(let U of l){let J=`--${g}\r
|
|
61
61
|
content-type: ${U["content-type"]}\r
|
|
62
62
|
\r
|
|
63
63
|
`;E.push(J),typeof U.body=="string"?(E.push(U.body),E.push(`\r
|
|
64
|
-
`)):(b.on("progress",
|
|
64
|
+
`)):(b.on("progress",Z=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:Z})}),U.body.pipe(b).pipe(E))}C||(E.push(v),E.push(null)),e.data=E}o(m,"multipartUpload");function y(l){let g=ZP(),v=`--${g}--`;d["content-type"]=`multipart/related; boundary=${g}`;let E="";for(let b of l){let C=`--${g}\r
|
|
65
65
|
content-type: ${b["content-type"]}\r
|
|
66
66
|
\r
|
|
67
67
|
`;E+=C,typeof b.body=="string"&&(E+=b.body,E+=`\r
|
|
68
|
-
`)}E+=v,e.data=E}if(o(y,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let l=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||c,body:n.body}];(0,Dm.isBrowser)()?y(l):m(l)}else r.uploadType="media",Object.assign(d,{"content-type":n.mimeType||c}),e.data=n.body;else e.data=i||void 0;if(e.headers=km.Gaxios.mergeHeaders(e.headers||{},d),e.params=r,!(0,Dm.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:JP.version,comment:"gzip"});let l=e.userAgentDirectives.map(g=>{let v=`${g.product}/${g.version}`;return g.comment&&(v+=` (${g.comment})`),v}).join(" ");e.headers.set("User-Agent",l)}if(e.validateStatus||(e.validateStatus=l=>l>=200&&l<300||l===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 h=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,f=e.universeDomain??e.universe_domain??h??"googleapis.com";if(f!=="googleapis.com"&&e.url){let l=new URL(e.url);l.hostname.endsWith(".googleapis.com")&&(l.hostname=l.hostname.replace(/googleapis\.com$/,f),e.url=l.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let l=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(l&&f!==l)throw new Error(`The configured universe domain (${f}) does not match the universe domain found in the credentials (${l}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let g=await s.getRequestHeaders(e.url),v=Object.assign({},e);return v.headers=km.Gaxios.mergeHeaders(v.headers,g),G1.request(v)}else{let g=await s.request(e);return(0,$m.marshallGaxiosResponse)(g)}}else return new km.Gaxios().request(e).then(l=>(0,$m.marshallGaxiosResponse)(l))}o(ZP,"createAPIRequestAsync");var Nm=class extends KP.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 K1(t,e){(0,Dm.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${JP.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(K1,"populateAPIHeader")});var YP=D(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.AuthPlus=void 0;var Tn=Ba(),Um=class extends Tn.GoogleAuth{static{o(this,"AuthPlus")}JWT=Tn.JWT;Compute=Tn.Compute;OAuth2=Tn.OAuth2Client;GoogleAuth=Tn.GoogleAuth;AwsClient=Tn.AwsClient;IdentityPoolClient=Tn.IdentityPoolClient;ExternalAccountClient=Tn.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new Tn.GoogleAuth(e),this._cachedAuth.getClient()}getProjectId(e){return e?this._cachedAuth?this._cachedAuth.getProjectId(e):super.getProjectId(e):this._cachedAuth?this._cachedAuth.getProjectId():super.getProjectId()}};Fc.AuthPlus=Um});var Lm=D(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.Endpoint=void 0;var XP=jc(),Mm=class{static{o(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,i){if(this.applyMethodsFromSchema(e,r,n,i),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let c=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,c,i)}}}applyMethodsFromSchema(e,r,n,i){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let c=n.methods[s];e[s]=this.makeMethod(r,c,i)}}}makeMethod(e,r,n){return(i,s)=>{let c=typeof i=="function"?{}:i;s=typeof i=="function"?i:s;let d=QP(e.rootUrl+e.servicePath+r.path),p={options:{url:d.substring(1,d.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:c,requiredParams:r.parameterOrder||[],pathParams:this.getPathParams(r.parameters),context:n};if(r.mediaUpload&&r.mediaUpload.protocols&&r.mediaUpload.protocols.simple&&r.mediaUpload.protocols.simple.path){let m=QP(e.rootUrl+r.mediaUpload.protocols.simple.path);p.mediaUrl=m.substring(1,m.length-1)}if(!s)return(0,XP.createAPIRequest)(p);(0,XP.createAPIRequest)(p,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}};qc.Endpoint=Mm;function QP(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(QP,"buildurl")});var tx=D(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.Discovery=void 0;var J1=require("fs"),Y1=ht(),X1=require("url"),ex=require("util"),Q1=jc(),eL=Lm(),tL=ex.promisify(J1.readFile),jm=class{static{o(this,"Discovery")}transporter=new Y1.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new eL.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 p=>{let m=await this.discoverAPI(p.discoveryRestUrl);return{api:p,endpointCreator:m}})),c={},d={};for(let p of s)d[p.api.name]||(c[p.api.name]={},d[p.api.name]=m=>{let y=typeof m,h;if(y==="string")h=m,m={};else if(y==="object")h=m.version,delete m.version;else throw new Error("Argument error: Accepts only string or object");try{let f=p.endpointCreator(m,this);return Object.freeze(f)}catch(f){throw new Error(ex.format('Unable to load endpoint %s("%s"): %s',p.api.name,h,f.message))}}),c[p.api.name][p.api.version]=p.endpointCreator;return d}async discoverAPI(e){if(typeof e=="string"){let r=X1.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await tL(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,Q1.createAPIRequest)(i);return this.makeEndpoint(s.data)}}};Bc.Discovery=jm});var Vc=D(Re=>{"use strict";var rL=Re&&Re.__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]})),nL=Re&&Re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rL(e,t,r)};Object.defineProperty(Re,"__esModule",{value:!0});Re.Endpoint=Re.Discovery=Re.AuthPlus=Re.createAPIRequest=Re.getAPI=Re.GaxiosError=Re.Gaxios=Re.AwsClient=Re.IdentityPoolClient=Re.BaseExternalAccountClient=Re.ExternalAccountClient=Re.GoogleAuth=Re.UserRefreshClient=Re.Compute=Re.JWT=Re.OAuth2Client=Re.gaxios=Re.googleAuthLibrary=void 0;Re.googleAuthLibrary=Ba();Re.gaxios=ht();var Pn=Ba();Object.defineProperty(Re,"OAuth2Client",{enumerable:!0,get:o(function(){return Pn.OAuth2Client},"get")});Object.defineProperty(Re,"JWT",{enumerable:!0,get:o(function(){return Pn.JWT},"get")});Object.defineProperty(Re,"Compute",{enumerable:!0,get:o(function(){return Pn.Compute},"get")});Object.defineProperty(Re,"UserRefreshClient",{enumerable:!0,get:o(function(){return Pn.UserRefreshClient},"get")});Object.defineProperty(Re,"GoogleAuth",{enumerable:!0,get:o(function(){return Pn.GoogleAuth},"get")});Object.defineProperty(Re,"ExternalAccountClient",{enumerable:!0,get:o(function(){return Pn.ExternalAccountClient},"get")});Object.defineProperty(Re,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return Pn.BaseExternalAccountClient},"get")});Object.defineProperty(Re,"IdentityPoolClient",{enumerable:!0,get:o(function(){return Pn.IdentityPoolClient},"get")});Object.defineProperty(Re,"AwsClient",{enumerable:!0,get:o(function(){return Pn.AwsClient},"get")});var rx=ht();Object.defineProperty(Re,"Gaxios",{enumerable:!0,get:o(function(){return rx.Gaxios},"get")});Object.defineProperty(Re,"GaxiosError",{enumerable:!0,get:o(function(){return rx.GaxiosError},"get")});var oL=HT();Object.defineProperty(Re,"getAPI",{enumerable:!0,get:o(function(){return oL.getAPI},"get")});var iL=jc();Object.defineProperty(Re,"createAPIRequest",{enumerable:!0,get:o(function(){return iL.createAPIRequest},"get")});var aL=YP();Object.defineProperty(Re,"AuthPlus",{enumerable:!0,get:o(function(){return aL.AuthPlus},"get")});var sL=tx();Object.defineProperty(Re,"Discovery",{enumerable:!0,get:o(function(){return sL.Discovery},"get")});var uL=Lm();Object.defineProperty(Re,"Endpoint",{enumerable:!0,get:o(function(){return uL.Endpoint},"get")});nL(Lc(),Re)});var ox=D(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.calendar_v3=void 0;var oe=Vc(),nx;(function(t){class e{static{o(this,"Calendar")}context;acl;calendarList;calendars;channels;colors;events;freebusy;settings;constructor(h,f){this.context={_options:h||{},google:f},this.acl=new r(this.context),this.calendarList=new n(this.context),this.calendars=new i(this.context),this.channels=new s(this.context),this.colors=new c(this.context),this.events=new d(this.context),this.freebusy=new p(this.context),this.settings=new m(this.context)}}t.Calendar=e;class r{static{o(this,"Resource$Acl")}context;constructor(h){this.context=h}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Acl=r;class n{static{o(this,"Resource$Calendarlist")}context;constructor(h){this.context=h}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Calendarlist=n;class i{static{o(this,"Resource$Calendars")}context;constructor(h){this.context=h}clear(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/clear").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Calendars=i;class s{static{o(this,"Resource$Channels")}context;constructor(h){this.context=h}stop(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Channels=s;class c{static{o(this,"Resource$Colors")}context;constructor(h){this.context=h}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/colors").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Colors=c;class d{static{o(this,"Resource$Events")}context;constructor(h){this.context=h}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}import(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/import").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}instances(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}/instances").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}move(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}/move").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId","destination"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}quickAdd(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/quickAdd").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId","text"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Events=d;class p{static{o(this,"Resource$Freebusy")}context;constructor(h){this.context=h}query(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/freeBusy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Freebusy=p;class m{static{o(this,"Resource$Settings")}context;constructor(h){this.context=h}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/settings/{setting}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["setting"],pathParams:["setting"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/settings").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/settings/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Settings=m})(nx||(Gc.calendar_v3=nx={}))});var xn=D(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.AuthPlus=Er.calendar_v3=Er.auth=Er.VERSIONS=void 0;Er.calendar=cL;var ix=Vc(),ax=ox();Object.defineProperty(Er,"calendar_v3",{enumerable:!0,get:o(function(){return ax.calendar_v3},"get")});Er.VERSIONS={v3:ax.calendar_v3.Calendar};function cL(t){return(0,ix.getAPI)("calendar",t,Er.VERSIONS,this)}o(cL,"calendar");var lL=new ix.AuthPlus;Er.auth=lL;var dL=Vc();Object.defineProperty(Er,"AuthPlus",{enumerable:!0,get:o(function(){return dL.AuthPlus},"get")})});var $x=D((th,rh)=>{(function(t,e){typeof th=="object"&&typeof rh<"u"?rh.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_utc=e()})(th,(function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,s){var c=i.prototype;s.utc=function(l){var g={date:l,utc:!0,args:arguments};return new i(g)},c.utc=function(l){var g=s(this.toDate(),{locale:this.$L,utc:!0});return l?g.add(this.utcOffset(),t):g},c.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var d=c.parse;c.parse=function(l){l.utc&&(this.$u=!0),this.$utils().u(l.$offset)||(this.$offset=l.$offset),d.call(this,l)};var p=c.init;c.init=function(){if(this.$u){var l=this.$d;this.$y=l.getUTCFullYear(),this.$M=l.getUTCMonth(),this.$D=l.getUTCDate(),this.$W=l.getUTCDay(),this.$H=l.getUTCHours(),this.$m=l.getUTCMinutes(),this.$s=l.getUTCSeconds(),this.$ms=l.getUTCMilliseconds()}else p.call(this)};var m=c.utcOffset;c.utcOffset=function(l,g){var v=this.$utils().u;if(v(l))return this.$u?0:v(this.$offset)?m.call(this):this.$offset;if(typeof l=="string"&&(l=(function(U){U===void 0&&(U="");var J=U.match(e);if(!J)return null;var W=(""+J[0]).match(r)||["-",0,0],H=W[0],K=60*+W[1]+ +W[2];return K===0?0:H==="+"?K:-K})(l),l===null))return this;var E=Math.abs(l)<=16?60*l:l,b=this;if(g)return b.$offset=E,b.$u=l===0,b;if(l!==0){var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(b=this.local().add(E+C,t)).$offset=E,b.$x.$localOffset=C}else b=this.utc();return b};var y=c.format;c.format=function(l){var g=l||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,g)},c.valueOf=function(){var l=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*l},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var h=c.toDate;c.toDate=function(l){return l==="s"&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var f=c.diff;c.diff=function(l,g,v){if(l&&this.$u===l.$u)return f.call(this,l,g,v);var E=this.local(),b=s(l).local();return f.call(E,b,g,v)}}}))});var SL={};Is(SL,{createGoogleClient:()=>_t,getAccessToken:()=>Ie,googleCalendar:()=>EL,googleCalendarAuth:()=>ne});module.exports=WI(SL);var ZI=Object.freeze({status:"aborted"});function le(t,e,r){function n(d,p){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:p,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(t))return;d._zod.traits.add(t),e(d,p);let m=c.prototype,y=Object.keys(m);for(let h=0;h<y.length;h++){let f=y[h];f in d||(d[f]=m[f].bind(d))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(d){var p;let m=r?.Parent?new s:this;n(m,d),(p=m._zod).deferred??(p.deferred=[]);for(let y of m._zod.deferred)y();return m}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}o(le,"$constructor");var Mr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Rs=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Rl={};function ln(t){return t&&Object.assign(Rl,t),Rl}o(ln,"config");function Ol(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(Ol,"getEnumValues");function fg(t,e){return typeof e=="bigint"?e.toString():e}o(fg,"jsonStringifyReplacer");function Os(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Os,"cached");function mg(t){return t==null}o(mg,"nullish");function ks(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(ks,"cleanRegex");var pg=Symbol("evaluating");function gt(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==pg)return n===void 0&&(n=pg,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(gt,"defineLazy");var kl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ji(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(ji,"isObject");var KI=Os(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function hg(t){if(ji(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(ji(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(hg,"isPlainObject");var gg=new Set(["string","number","symbol"]);function qo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(qo,"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 st(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(st,"normalizeParams");function yg(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(yg,"optionalKeys");var vg={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 Bo(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(Bo,"aborted");function Nn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(Nn,"prefixIssues");function Cs(t){return typeof t=="string"?t:t?.message}o(Cs,"unwrapMessage");function zn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=Cs(t.inst?._zod.def?.error?.(t))??Cs(e?.error?.(t))??Cs(r.customError?.(t))??Cs(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(zn,"finalizeIssue");function _g(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(_g,"getLengthableOrigin");function $l(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o($l,"issue");var bg=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,fg,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),Eg=le("$ZodError",bg),Fi=le("$ZodError",bg,{Parent:Error});var YI=o(t=>(e,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new Mr;if(c.issues.length){let d=new(i?.Err??t)(c.issues.map(p=>zn(p,s,ln())));throw kl(d,i?.callee),d}return c.value},"_parse"),Ds=YI(Fi),XI=o(t=>async(e,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??t)(c.issues.map(p=>zn(p,s,ln())));throw kl(d,i?.callee),d}return c.value},"_parseAsync"),Ns=XI(Fi),QI=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 Mr;return s.issues.length?{success:!1,error:new(t??Eg)(s.issues.map(c=>zn(c,i,ln())))}:{success:!0,data:s.value}},"_safeParse"),qi=QI(Fi),eR=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>zn(c,i,ln())))}:{success:!0,data:s.value}},"_safeParseAsync"),Bi=eR(Fi);var tR="(?:(?:\\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])))",rR=new RegExp(`^${tR}$`);var Sg=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),wg=/^-?\d+n?$/,Tg=/^-?\d+$/,Dl=/^-?\d+(?:\.\d+)?$/,Pg=/^(?:true|false)$/i;var Un=le("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),nR={number:"number",bigint:"bigint",object:"date"};var xg=le("$ZodCheckGreaterThan",(t,e)=>{Un.init(t,e);let r=nR[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 Ag=le("$ZodCheckNumberFormat",(t,e)=>{Un.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,s]=vg[e.format];t._zod.onattach.push(c=>{let d=c._zod.bag;d.format=e.format,d.minimum=i,d.maximum=s,r&&(d.pattern=Tg)}),t._zod.check=c=>{let d=c.value;if(r){if(!Number.isInteger(d)){c.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:d,inst:t});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}d<i&&c.issues.push({origin:"number",input:d,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),d>s&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var Ig=le("$ZodCheckMinLength",(t,e)=>{var r;Un.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!mg(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let c=_g(i);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var Nl=le("$ZodCheckStringFormat",(t,e)=>{var r,n;Un.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=()=>{})}),Rg=le("$ZodCheckRegex",(t,e)=>{Nl.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 Og={major:4,minor:3,patch:6};var dt=le("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Og;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let s of i._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=o((c,d,p)=>{let m=Bo(c),y;for(let h of d){if(h._zod.def.when){if(!h._zod.def.when(c))continue}else if(m)continue;let f=c.issues.length,l=h._zod.check(c);if(l instanceof Promise&&p?.async===!1)throw new Mr;if(y||l instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await l,c.issues.length!==f&&(m||(m=Bo(c,f)))});else{if(c.issues.length===f)continue;m||(m=Bo(c,f))}}return y?y.then(()=>c):c},"runChecks"),s=o((c,d,p)=>{if(Bo(c))return c.aborted=!0,c;let m=i(d,n,p);if(m instanceof Promise){if(p.async===!1)throw new Mr;return m.then(y=>t._zod.parse(y,p))}return t._zod.parse(m,p)},"handleCanaryResult");t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){let m=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(y=>s(y,c,d)):s(m,c,d)}let p=t._zod.parse(c,d);if(p instanceof Promise){if(d.async===!1)throw new Mr;return p.then(m=>i(m,n,d))}return i(p,n,d)}}gt(t,"~standard",()=>({validate:o(i=>{try{let s=qi(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Bi(t,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ms=le("$ZodString",(t,e)=>{dt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Sg(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}}),zl=le("$ZodStringFormat",(t,e)=>{Nl.init(t,e),Ms.init(t,e)});var zg=le("$ZodURL",(t,e)=>{zl.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 Ul=le("$ZodNumber",(t,e)=>{dt.init(t,e),t._zod.pattern=t._zod.bag.pattern??Dl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}}),Ug=le("$ZodNumberFormat",(t,e)=>{Ag.init(t,e),Ul.init(t,e)}),Ml=le("$ZodBoolean",(t,e)=>{dt.init(t,e),t._zod.pattern=Pg,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}}),Mg=le("$ZodBigInt",(t,e)=>{dt.init(t,e),t._zod.pattern=wg,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 Lg=le("$ZodAny",(t,e)=>{dt.init(t,e),t._zod.parse=r=>r}),jg=le("$ZodUnknown",(t,e)=>{dt.init(t,e),t._zod.parse=r=>r});var Fg=le("$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}}),qg=le("$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 kg(t,e,r){t.issues.length&&e.issues.push(...Nn(r,t.issues)),e.value[r]=t.value}o(kg,"handleArrayResult");var Bg=le("$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 c=0;c<i.length;c++){let d=i[c],p=e.element._zod.run({value:d,issues:[]},n);p instanceof Promise?s.push(p.then(m=>kg(m,r,c))):kg(p,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Us(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...Nn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(Us,"handlePropertyResult");function oR(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=yg(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(oR,"normalizeDef");function iR(t,e,r,n,i,s){let c=[],d=i.keySet,p=i.catchall._zod,m=p.def.type,y=p.optout==="optional";for(let h in e){if(d.has(h))continue;if(m==="never"){c.push(h);continue}let f=p.run({value:e[h],issues:[]},n);f instanceof Promise?t.push(f.then(l=>Us(l,r,h,e,y))):Us(f,r,h,e,y)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}o(iR,"handleCatchall");var Vg=le("$ZodObject",(t,e)=>{if(dt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let d=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let p={...d};return Object.defineProperty(e,"shape",{value:p}),p},"get")})}let n=Os(()=>oR(e));gt(t._zod,"propValues",()=>{let d=e.shape,p={};for(let m in d){let y=d[m]._zod;if(y.values){p[m]??(p[m]=new Set);for(let h of y.values)p[m].add(h)}}return p});let i=ji,s=e.catchall,c;t._zod.parse=(d,p)=>{c??(c=n.value);let m=d.value;if(!i(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),d;d.value={};let y=[],h=c.shape;for(let f of c.keys){let l=h[f],g=l._zod.optout==="optional",v=l._zod.run({value:m[f],issues:[]},p);v instanceof Promise?y.push(v.then(E=>Us(E,d,f,m,g))):Us(v,d,f,m,g)}return s?iR(y,m,d,p,n.value,t):y.length?Promise.all(y).then(()=>d):d}});function $g(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=>!Bo(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>zn(c,n,ln())))}),e)}o($g,"handleUnionResults");var Ll=le("$ZodUnion",(t,e)=>{dt.init(t,e),gt(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),gt(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),gt(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),gt(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=>ks(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,d=[];for(let p of e.options){let m=p._zod.run({value:i.value,issues:[]},s);if(m instanceof Promise)d.push(m),c=!0;else{if(m.issues.length===0)return m;d.push(m)}}return c?Promise.all(d).then(p=>$g(p,i,t,s)):$g(d,i,t,s)}});var Gg=le("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Ll.init(t,e);let r=t._zod.parse;gt(t._zod,"propValues",()=>{let i={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[d,p]of Object.entries(c)){i[d]||(i[d]=new Set);for(let m of p)i[d].add(m)}}return i});let n=Os(()=>{let i=e.options,s=new Map;for(let c of i){let d=c._zod.propValues?.[e.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let p of d){if(s.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);s.set(p,c)}}return s});t._zod.parse=(i,s)=>{let c=i.value;if(!ji(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),i;let d=n.value.get(c?.[e.discriminator]);return d?d._zod.run(i,s):e.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:c,path:[e.discriminator],inst:t}),i)}});var Hg=le("$ZodRecord",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!hg(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let s=[],c=e.keyType._zod.values;if(c){r.value={};let d=new Set;for(let m of c)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){d.add(typeof m=="number"?m.toString():m);let y=e.valueType._zod.run({value:i[m],issues:[]},n);y instanceof Promise?s.push(y.then(h=>{h.issues.length&&r.issues.push(...Nn(m,h.issues)),r.value[m]=h.value})):(y.issues.length&&r.issues.push(...Nn(m,y.issues)),r.value[m]=y.value)}let p;for(let m in i)d.has(m)||(p=p??[],p.push(m));p&&p.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:p})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let p=e.keyType._zod.run({value:d,issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&Dl.test(d)&&p.issues.length){let h=e.keyType._zod.run({value:Number(d),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(p=h)}if(p.issues.length){e.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(h=>zn(h,n,ln())),input:d,path:[d],inst:t});continue}let y=e.valueType._zod.run({value:i[d],issues:[]},n);y instanceof Promise?s.push(y.then(h=>{h.issues.length&&r.issues.push(...Nn(d,h.issues)),r.value[p.value]=h.value})):(y.issues.length&&r.issues.push(...Nn(d,y.issues)),r.value[p.value]=y.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Wg=le("$ZodEnum",(t,e)=>{dt.init(t,e);let r=Ol(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>gg.has(typeof i)).map(i=>typeof i=="string"?qo(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:t}),i}}),Zg=le("$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"?qo(n):n?qo(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 Kg=le("$ZodTransform",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Rs(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new Mr;return r.value=i,r}});function Dg(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(Dg,"handleOptionalResult");var Jg=le("$ZodOptional",(t,e)=>{dt.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(`^(${ks(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=>Dg(s,r.value)):Dg(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var Yg=le("$ZodNullable",(t,e)=>{dt.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(`^(${ks(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 Xg=le("$ZodPipe",(t,e)=>{dt.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(c=>zs(c,e.in,n)):zs(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>zs(s,e.out,n)):zs(i,e.out,n)}});function zs(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(zs,"handlePipeResult");var Qg=le("$ZodCustom",(t,e)=>{Un.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=>Ng(s,r,n,t));Ng(i,r,n,t)}});function Ng(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($l(i))}}o(Ng,"handleRefineResult");var ty;var jl=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 ry(){return new jl}o(ry,"registry");(ty=globalThis).__zod_globalRegistry??(ty.__zod_globalRegistry=ry());var Fl=globalThis.__zod_globalRegistry;function ny(t,e){return new t({type:"string",...st(e)})}o(ny,"_string");function oy(t,e){return new t({type:"string",coerce:!0,...st(e)})}o(oy,"_coercedString");function iy(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...st(e)})}o(iy,"_url");function ay(t,e){return new t({type:"number",checks:[],...st(e)})}o(ay,"_number");function sy(t,e){return new t({type:"number",coerce:!0,checks:[],...st(e)})}o(sy,"_coercedNumber");function uy(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...st(e)})}o(uy,"_int");function cy(t,e){return new t({type:"boolean",...st(e)})}o(cy,"_boolean");function ly(t,e){return new t({type:"boolean",coerce:!0,...st(e)})}o(ly,"_coercedBoolean");function dy(t,e){return new t({type:"bigint",coerce:!0,...st(e)})}o(dy,"_coercedBigint");function py(t){return new t({type:"any"})}o(py,"_any");function fy(t){return new t({type:"unknown"})}o(fy,"_unknown");function my(t,e){return new t({type:"void",...st(e)})}o(my,"_void");function hy(t,e){return new t({type:"date",coerce:!0,...st(e)})}o(hy,"_coercedDate");function Ls(t,e){return new xg({check:"greater_than",...st(e),value:t,inclusive:!0})}o(Ls,"_gte");function xr(t,e){return new Ig({check:"min_length",...st(e),minimum:t})}o(xr,"_minLength");function Mn(t,e){return new Rg({check:"string_format",format:"regex",...st(e),pattern:t})}o(Mn,"_regex");function gy(t,e,r){let n=st(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(gy,"_custom");var yt=le("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)=>Ds(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>qi(t,r,n),t.parseAsync=async(r,n)=>Ns(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Bi(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=le("ZodMiniString",(t,e)=>{Ms.init(t,e),yt.init(t,e)});function w(t){return ny(Fs,t)}o(w,"string");var yy=le("ZodMiniStringFormat",(t,e)=>{zl.init(t,e),Fs.init(t,e)});var vR=le("ZodMiniURL",(t,e)=>{zg.init(t,e),yy.init(t,e)});function vy(t){return iy(vR,t)}o(vy,"url");var qs=le("ZodMiniNumber",(t,e)=>{Ul.init(t,e),yt.init(t,e)});function Nt(t){return ay(qs,t)}o(Nt,"number");var _R=le("ZodMiniNumberFormat",(t,e)=>{Ug.init(t,e),qs.init(t,e)});function _y(t){return uy(_R,t)}o(_y,"int");var ql=le("ZodMiniBoolean",(t,e)=>{Ml.init(t,e),yt.init(t,e)});function He(t){return cy(ql,t)}o(He,"boolean");var by=le("ZodMiniBigInt",(t,e)=>{Mg.init(t,e),yt.init(t,e)});var bR=le("ZodMiniAny",(t,e)=>{Lg.init(t,e),yt.init(t,e)});function Gi(){return py(bR)}o(Gi,"any");var ER=le("ZodMiniUnknown",(t,e)=>{jg.init(t,e),yt.init(t,e)});function we(){return fy(ER)}o(we,"unknown");var SR=le("ZodMiniVoid",(t,e)=>{Fg.init(t,e),yt.init(t,e)});function Ey(t){return my(SR,t)}o(Ey,"_void");var Sy=le("ZodMiniDate",(t,e)=>{qg.init(t,e),yt.init(t,e)});var wR=le("ZodMiniArray",(t,e)=>{Bg.init(t,e),yt.init(t,e)});function Oe(t,e){return new wR({type:"array",element:t,...st(e)})}o(Oe,"array");var TR=le("ZodMiniObject",(t,e)=>{Vg.init(t,e),yt.init(t,e),gt(t,"shape",()=>e.shape)});function k(t,e){let r={type:"object",shape:t??{},...st(e)};return new TR(r)}o(k,"object");var PR=le("ZodMiniUnion",(t,e)=>{Ll.init(t,e),yt.init(t,e)});function ke(t,e){return new PR({type:"union",options:t,...st(e)})}o(ke,"union");var xR=le("ZodMiniDiscriminatedUnion",(t,e)=>{Gg.init(t,e),yt.init(t,e)});function Ln(t,e,r){return new xR({type:"union",options:e,discriminator:t,...st(r)})}o(Ln,"discriminatedUnion");var AR=le("ZodMiniRecord",(t,e)=>{Hg.init(t,e),yt.init(t,e)});function Te(t,e,r){return new AR({type:"record",keyType:t,valueType:e,...st(r)})}o(Te,"record");var IR=le("ZodMiniEnum",(t,e)=>{Wg.init(t,e),yt.init(t,e),t.options=Object.values(e.entries)});function ze(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new IR({type:"enum",entries:r,...st(e)})}o(ze,"_enum");var RR=le("ZodMiniLiteral",(t,e)=>{Zg.init(t,e),yt.init(t,e)});function ge(t,e){return new RR({type:"literal",values:Array.isArray(t)?t:[t],...st(e)})}o(ge,"literal");var CR=le("ZodMiniTransform",(t,e)=>{Kg.init(t,e),yt.init(t,e)});function jn(t){return new CR({type:"transform",transform:t})}o(jn,"transform");var OR=le("ZodMiniOptional",(t,e)=>{Jg.init(t,e),yt.init(t,e)});function Z(t){return new OR({type:"optional",innerType:t})}o(Z,"optional");var kR=le("ZodMiniNullable",(t,e)=>{Yg.init(t,e),yt.init(t,e)});function Hi(t){return new kR({type:"nullable",innerType:t})}o(Hi,"nullable");var $R=le("ZodMiniPipe",(t,e)=>{Xg.init(t,e),yt.init(t,e)});function Fn(t,e){return new $R({type:"pipe",in:t,out:e})}o(Fn,"pipe");var DR=le("ZodMiniCustom",(t,e)=>{Qg.init(t,e),yt.init(t,e)});function Bs(t,e){return gy(DR,t??(()=>!0),e)}o(Bs,"custom");var Wi={};Is(Wi,{bigint:()=>jR,boolean:()=>LR,date:()=>FR,number:()=>MR,string:()=>UR});function UR(t){return oy(Fs,t)}o(UR,"string");function MR(t){return sy(qs,t)}o(MR,"number");function LR(t){return ly(ql,t)}o(LR,"boolean");function jR(t){return dy(by,t)}o(jR,"bigint");function FR(t){return hy(Sy,t)}o(FR,"date");var Vl=k({retryOnFailure:k({defaultValue:Z(He()),hide:Z(He())}),continueOnFailure:k({defaultValue:Z(He()),hide:Z(He())})}),Bl=class{constructor(e,r,n,i,s,c,d,p,m,y,h){this.name=e;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=d;this.errorHandlingOptions=p;this.outputSchema=m;this.audience=y;this.aiMetadata=h}static{o(this,"IAction")}},ve=o(t=>new Bl(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 Ve=k({displayName:w(),description:Z(w())}),$e=o((t,e)=>k({type:ge(e),required:He(),defaultValue:Z(Gi())}),"TPropertyValue");var Kt=k({...Ve.shape,...$e(w(),"SHORT_TEXT").shape}),dn=k({...Ve.shape,...$e(w(),"LONG_TEXT").shape});var Ty=k({label:w(),value:we()}),Vs=k({disabled:Z(He()),placeholder:Z(w()),options:Oe(Ty)});var Jt=k({...Ve.shape,options:Vs,...$e(we(),"STATIC_DROPDOWN").shape}),pn=k({...Ve.shape,options:Vs,...$e(Oe(we()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Gl=k({...Ve.shape,...$e(we(),"DROPDOWN").shape,refreshers:Oe(w())}),Zi=k({...Ve.shape,...$e(Oe(we()),"MULTI_SELECT_DROPDOWN").shape,refreshers:Oe(w())});var fn=k({...Ve.shape,...$e(He(),"CHECKBOX").shape});var mn=k({...Ve.shape,...$e(Nt(),"NUMBER").shape});var Ki=k({...Ve.shape,streaming:Z(He()),...$e(we(),"FILE").shape});var Ji=k({...Ve.shape,...$e(w(),"DATE_TIME").shape});var Py=Te(w(),ke([Kt,dn,Jt,Zi,pn,fn,mn,Ki,Ji])),Yi=k({...Ve.shape,properties:Py,...$e(Oe(we()),"ARRAY").shape});var Xi=k({...Ve.shape,...$e(ke([Te(w(),we())]),"JSON").shape});var xy=ke([Kt,Jt,Xi,Yi,pn]),BR=Te(w(),xy),Hl=k({refreshers:Oe(w()),...Ve.shape,...$e(we(),"DYNAMIC").shape});var Gs=k({...Ve.shape,...$e(Ey(),"MARKDOWN").shape});var Qi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Qi||{}),Vo=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Vo||{}),Go=(b=>(b.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",b.COMMUNICATION="COMMUNICATION",b.COMMERCE="COMMERCE",b.CORE="CORE",b.UNIVERSAL_AI="UNIVERSAL_AI",b.FLOW_CONTROL="FLOW_CONTROL",b.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",b.ACCOUNTING="ACCOUNTING",b.PRODUCTIVITY="PRODUCTIVITY",b.CONTENT_AND_FILES="CONTENT_AND_FILES",b.DEVELOPER_TOOLS="DEVELOPER_TOOLS",b.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",b.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",b.HUMAN_RESOURCES="HUMAN_RESOURCES",b.PAYMENT_PROCESSING="PAYMENT_PROCESSING",b.MARKETING="MARKETING",b.SALES_AND_CRM="SALES_AND_CRM",b))(Go||{});var ea=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ea||{}),Wl="both_client_credentials_and_authorization_code";var Lt=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Lt||{}),ta=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(ta||{}),VR=k({strategy:ze(ta),paramName:Z(w())}),ra=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ra||{});var Hs=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Hs||{}),Ay=k({status:Z(Nt()),body:Z(we()),headers:Z(Te(w(),w()))}),Iy=k({type:ge("DELAY"),resumeDateTime:w(),requestIdToReply:Z(w()),handlerId:Z(w()),streamStepProgress:Z(ze(Hs))}),Ry=k({type:ge("WEBHOOK"),requestId:w(),requestIdToReply:Z(w()),response:Ay,handlerId:Z(w()),streamStepProgress:Z(ze(Hs))}),GR=ke([Iy,Ry]);var HR=k({body:we(),rawBody:Z(we()),headers:Te(w(),w()),queryParams:Te(w(),w())});function it(t){return t==null}o(it,"isNil");function na(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(na,"isEmpty");function Ws(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(Ws,"assertNotNullOrUndefined");var Zl=qe(require("crypto"),1);var WR=128,co,Ho,ZR=o(t=>{!co||co.length<t?(co=Buffer.allocUnsafe(t*WR),Zl.default.randomFillSync(co),Ho=0):Ho+t>co.length&&(Zl.default.randomFillSync(co),Ho=0),Ho+=t},"fillPool"),KR=o(t=>(ZR(t|=0),co.subarray(Ho-t,Ho)),"random"),JR=o((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(s=e)=>{let c="";for(;;){let d=r(i),p=i;for(;p--;)if(c+=t[d[p]&n]||"",c.length===s)return c}}},"customRandom"),Oy=o((t,e=21)=>JR(t,e,KR),"customAlphabet");var YR="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ky=21,rH=w().check(Mn(new RegExp(`^[0-9a-zA-Z]{${ky}}$`))),XR=Oy(YR,ky);var qn=Fn(jn(t=>t instanceof Date?t.toISOString():t),w()),dr={id:w(),created:qn,updated:qn},ut=o(t=>Z(Hi(t)),"Nullable");function Kl(t){return Z(Hi(ze(t)))}o(Kl,"NullableEnum");var iH=Fn(jn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),Z(He())),Zs=o(t=>Fn(jn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),Z(Oe(t))),"OptionalArrayFromQuery");var uH=Te(w(),we());var oa=(y=>(y.OPENAI="openai",y.OPENROUTER="openrouter",y.ANTHROPIC="anthropic",y.AZURE="azure",y.GOOGLE="google",y.ACTIVEPIECES="activepieces",y.CLOUDFLARE_GATEWAY="cloudflare-gateway",y.CUSTOM="custom",y.BEDROCK="bedrock",y.MISTRAL="mistral",y))(oa||{});var bH=w().check(Mn(/^#[0-9A-Fa-f]{6}$/));var SH=k({filename:w(),data:we(),type:ge("file"),mimetype:Z(w())});var QR=qe(Dy());var RH=k({...dr,name:w(),permissions:Oe(w()),platformId:ut(w()),type:w(),userCount:Z(Nt())});var Ny=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ny||{}),Jl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Jl||{}),Yl=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Yl||{});var Xl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Xl||{});var Ql=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ql||{});var eC=k({mode:ze(Ny),value:we()}),tC=k({auth:Z(w()),fields:Te(w(),eC)}),rC=k({pieceName:w(),pieceVersion:w(),actionName:w(),predefinedInput:Z(tC)}),nC=k({type:ge("PIECE"),toolName:w().check(xr(1)),pieceMetadata:rC}),oC=k({type:ge("none")}),iC=k({type:ge("access_token"),accessToken:w()}),aC=k({type:ge("api_key"),apiKey:w(),apiKeyHeader:w()}),sC=k({type:ge("headers"),headers:Te(w(),w())}),uC=Ln("type",[oC,iC,aC,sC]),zy=k({type:ge("FLOW"),toolName:w().check(xr(1)),externalFlowId:w(),flowDisplayName:Z(w())}),Uy=k({type:ge("MCP"),toolName:w().check(xr(1)),serverUrl:vy(),protocol:ze(Yl),auth:uC}),My=k({type:ge("KNOWLEDGE_BASE"),toolName:w().check(xr(1)),sourceType:ze(Jl),sourceId:w(),sourceName:w()}),cC=Ln("type",[nC,zy,Uy,My]),lC=k({displayName:w(),description:Z(w()),type:ze(Xl)}),Ly=k({type:ge("MARKDOWN"),markdown:w()}),Wo={type:ge("TOOL_CALL"),input:ut(Te(w(),we())),output:Z(we()),toolName:w(),status:ze(Ql),toolCallId:w(),startTime:w(),endTime:Z(w())},aW=k(Wo),jy=Ln("toolCallType",[k({...Wo,toolCallType:ge("PIECE"),pieceName:w(),pieceVersion:w(),actionName:w()}),k({...Wo,toolCallType:ge("FLOW"),displayName:w(),externalFlowId:w()}),k({...Wo,toolCallType:ge("MCP"),displayName:w(),serverUrl:w()}),k({...Wo,toolCallType:ge("KNOWLEDGE_BASE"),displayName:w(),sourceType:w()}),k({...Wo,toolCallType:ge("UNKNOWN"),displayName:w()})]),dC=ke([Ly,jy]);var ed=(r=>(r.IMAGE="image",r.TEXT="text",r))(ed||{}),hn=k({apiKey:w()}),pC=hn,fC=k({apiKey:w(),apiKeyHash:w()}),mC=hn,hC=hn,gC=hn,yC=hn,vC=hn,_C=hn,bC=hn,Gy=k({accessKeyId:w().check(xr(1)),secretAccessKey:w().check(xr(1))}),EC=k({}),SC=k({}),wC=k({}),TC=k({}),PC=k({}),xC=k({}),Hy=k({modelId:w(),modelName:w(),modelType:ze(ed)}),Wy=k({apiKeyHeader:w(),baseUrl:w(),models:Oe(Hy),defaultHeaders:Z(Te(w(),w()))}),Zy=k({accountId:w(),gatewayId:w(),models:Oe(Hy),vertexProject:Z(w()),vertexRegion:Z(w())}),Ky=k({resourceName:w(),apiVersion:Fn(jn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),Z(w()))}),Jy=k({region:w().check(xr(1))}),AC=ke([pC,gC,yC,vC,_C,hC,mC,fC,Gy,bC]),Yy=ke([Wy,Zy,Ky,Jy,EC,wC,TC,PC,SC,xC]),IC=k({id:w(),name:w(),type:ze(ed)}),RC=k({id:w(),name:w(),provider:ze(oa),config:Yy,enabledForChat:He()}),CC=k({provider:ze(oa),config:Yy,auth:AC,platformId:w()});var lW={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Fy=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],OC=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],kC=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],qy=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],$C=["grok-4.20","grok-4.1-fast"],DC={openai:Fy,anthropic:OC,google:qy,activepieces:[...kC.map(t=>`anthropic/${t}`),...Fy.map(t=>`openai/${t}`),...qy.map(t=>`google/${t}`),...$C.map(t=>`x-ai/${t}`)]};var By=128e3,NC={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function zC({provider:t}){return t?NC[t]??By:By}o(zC,"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"},UC={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},MC=new Set(["anthropic","mistral"]);function Lr(t){return{chatModels:DC[t],maxContextTokens:zC({provider:t}),defaultEmbeddingModel:Vy[t],supportsEmbedding:Vy[t]!==void 0,supportsImageGeneration:!MC.has(t),webSearch:UC[t]}}o(Lr,"buildProviderCapabilities");var LC={openai:Lr("openai"),anthropic:Lr("anthropic"),openrouter:Lr("openrouter"),azure:Lr("azure"),google:Lr("google"),"cloudflare-gateway":Lr("cloudflare-gateway"),custom:Lr("custom"),bedrock:Lr("bedrock"),mistral:Lr("mistral"),activepieces:Lr("activepieces")};var jC=k({base64Url:w(),fileName:w(),extension:Z(w())}),FC=k({mimeType:w(),url:w(),fileName:Z(w())}),td=ke([jC,FC]);var qC=ke([k({type:ge("file"),value:td}),k({type:ge("markdown"),value:w(),files:Z(Oe(td))})]),BC=k({sessionId:w(),message:w(),files:Z(Oe(w()))});var Qy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Qy||{}),ev=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ev||{}),rd=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(rd||{});var VC=ke([k({...dr,name:w(),externalId:w(),type:ge("STATIC_DROPDOWN"),tableId:w(),projectId:w(),data:k({options:Oe(k({value:w()}))})}),k({...dr,name:w(),externalId:w(),type:ke([ge("TEXT"),ge("NUMBER"),ge("DATE")]),tableId:w(),projectId:w()})]),GC=k({...dr,name:w(),folderId:ut(w()),projectId:w(),externalId:w(),status:Kl(ev),trigger:Kl(Qy)}),HC=k({...dr,tableId:w(),projectId:w(),cells:Te(w(),k({updated:w(),created:w(),value:we(),fieldName:w()}))}),WC=k({events:Oe(ze(rd)),webhookUrl:w(),flowId:w()}),ZC=k({fields:Oe(k({id:w(),name:w()})),rows:Oe(Te(w(),w())),name:w()}),KC=k({projectId:w(),limit:Z(Wi.number()),cursor:Z(w()),name:Z(w()),externalIds:Zs(w()),folderId:Z(w()),folderIds:Zs(w())}),JC=k({records:Oe(Oe(k({fieldId:w(),value:rv()}))),tableId:w()}),YC=k({cells:Z(Oe(k({fieldId:w(),value:rv()}))),tableId:w(),agentUpdate:Z(He())}),tv=Ln("operator",[lo("eq"),lo("neq"),lo("gt"),lo("gte"),lo("lt"),lo("lte"),lo("co"),Xy("exists"),Xy("not_exists")]),XC=k({tableId:w(),limit:Z(Wi.number()),cursor:Z(w()),filters:Zs(tv)});function rv(){return Fn(jn(t=>t==null?t:String(t)),Hi(w()))}o(rv,"coerceToString");function lo(t){return k({fieldId:w(),operator:ge(t),value:w()})}o(lo,"valueFilter");function Xy(t){return k({fieldId:w(),operator:ge(t)})}o(Xy,"existenceFilter");var QC=k({status:Z(Nt()),body:Z(we()),headers:Z(Te(w(),w()))}),e0=k({...dr,deleted:ut(qn),ownerId:w(),displayName:w(),platformId:w(),externalId:ut(w())});var nv=k({name:w(),description:Z(w()),type:w(),required:He()}),t0=k({pieceName:w(),triggerName:w(),input:k({toolName:w(),toolDescription:w(),inputSchema:Oe(nv),returnsResponse:He()})});var ov="^[0-9]+\\.[0-9]+\\.[0-9]+$",RW=new RegExp(ov),n0="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",CW=w().check(Mn(new RegExp(ov))),OW=w().check(Mn(new RegExp(n0))),o0=k({packageType:ge("ARCHIVE"),pieceType:ze(Vo),pieceName:w(),pieceVersion:w(),archiveId:w(),platformId:w()}),iv=k({packageType:ge("REGISTRY"),pieceType:ge("OFFICIAL"),pieceName:w(),pieceVersion:w()}),av=k({packageType:ge("REGISTRY"),pieceType:ge("CUSTOM"),pieceName:w(),pieceVersion:w(),platformId:w()}),kW=ke([iv,av]),$W=ke([o0,iv,av]);var i0=Ln("type",[k({type:ge("CRON_EXPRESSION"),cronExpression:w(),timezone:w()}),k({type:ge("INTERVAL"),intervalMs:_y().check(Ls(6e4))})]),DW=k({...dr,type:ze(Lt),projectId:w(),flowId:w(),triggerName:w(),schedule:ut(i0),flowVersionId:w(),pieceName:w(),pieceVersion:w(),deleted:ut(w()),simulate:He()}),sv=(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))(sv||{}),uv=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(uv||{}),cv=(r=>(r.S3="S3",r.DB="DB",r))(cv||{}),NW=k({...dr,projectId:ut(w()),platformId:ut(w()),type:ze(sv),compression:ze(uv),data:Z(we()),location:ze(cv),size:ut(Nt()),fileName:ut(w()),s3Key:ut(w()),metadata:ut(Te(w(),w()))}),lv=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(lv||{}),dv=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(dv||{}),zW=k({id:w(),email:w(),firstName:w(),status:ze(dv),externalId:ut(w()),platformId:ut(w()),platformRole:ze(lv),lastName:w(),created:qn,updated:qn,lastActiveDate:ut(qn),imageUrl:ut(w())});var od=k({...Ve.shape,...$e(Te(w(),we()),"OBJECT").shape});var mv=k({...Ve.shape,...$e(w(),"COLOR").shape});var id=ke([Kt,dn,Gs,fn,Jt,pn,Gl,Zi,Hl,mn,Yi,od,Xi,Ji,Ki,mv]),F={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 jr=k({displayName:w(),description:Z(w())});var hv=k({username:w(),password:w()}),ad=k({...jr.shape,username:k({displayName:w(),description:Z(w())}),password:k({displayName:w(),description:Z(w())}),...$e(hv,"BASIC_AUTH").shape});var c0=Te(w(),ke([Kt,dn,mn,fn,Jt])),sd=k({...jr.shape,props:c0,...$e(we(),"CUSTOM_AUTH").shape});var po=k({...jr.shape,...$e(k({auth:w()}),"SECRET_TEXT").shape});var l0=Te(w(),ke([Kt,dn,po,mn,fn,Jt,pn,Gs])),gv=k({...jr.shape,props:l0,...$e(we(),"OIDC").shape});var ud=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(ud||{}),yv=ke([Kt,po,Jt]),vv=Te(w(),yv),d0=k({props:Z(Te(w(),yv)),authUrl:w(),tokenUrl:w(),scope:Oe(w()),prompt:Z(ke([ge("none"),ge("consent"),ge("login"),ge("omit")])),pkce:Z(He()),pkceMethod:Z(ke([ge("plain"),ge("S256")])),authorizationMethod:Z(ze(ud)),grantType:Z(ke([ze(ea),ge(Wl)])),extra:Z(Te(w(),w()))}),_v=k({access_token:w(),props:Z(vv),data:Te(w(),Gi())}),cd=k({...jr.shape,...d0.shape,...$e(_v,"OAUTH2").shape});var Zo=ke([ad,sd,gv,cd,po]),ia="Connection",Js={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||ia}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||ia,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||ia}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||ia}},None(){}};var m3={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 p0=k({...Ve.shape,...$e(we(),"CUSTOM").shape,code:w()});var f0=ke([id,Zo]),ld=Te(w(),f0),D3=Te(w(),id);var bv=ke([k({strategy:ge("CRON"),cronExpression:w()}),k({strategy:ge("NONE")})]),Ko=class{constructor(e,r,n,i,s,c,d,p,m,y,h,f,l,g,v,E,b,C,U){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=d;this.onHandshake=p;this.renewConfiguration=m;this.onRenew=y;this.onEnable=h;this.onDisable=f;this.onStart=l;this.run=g;this.test=v;this.sampleData=E;this.testStrategy=b;this.outputSchema=C;this.aiMetadata=U}static{o(this,"ITrigger")}},jt=o(t=>{switch(t.type){case"WEBHOOK":return new Ko(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 Ko(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 Ko(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 Ko(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,it(t.sampleData)&&it(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var Ev="2",Ys="0.82.0";var dd=class{constructor(e,r,n,i,s,c,d,p,m=Ys,y,h="",f){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=p;this.minimumSupportedRelease=m;this.maximumSupportedRelease=y;this.description=h;this.deprecated=f;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ev}),"getContextInfo");(!m0(m)||h0(m,Ys))&&(this.minimumSupportedRelease=Ys),s.forEach(l=>this._actions[l.name]=l),c.forEach(l=>this._triggers[l.name]=l)}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: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}},Sv=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 dd(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 m0(t){return/^\d+\.\d+\.\d+$/.test(t)}o(m0,"isValidSimpleSemver");function h0(t,e){let[r,n,i]=t.split(".").map(Number),[s,c,d]=e.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<d}o(h0,"isSemverLessThan");var g0=Z(Te(w(),Te(w(),w()))),wv=k({id:Z(w()),name:w(),displayName:w(),logoUrl:w(),description:w(),authors:Oe(w()),platformId:Z(w()),directoryPath:Z(w()),auth:Z(ke([Zo,Oe(Zo)])),version:w(),categories:Z(Oe(ze(Go))),minimumSupportedRelease:Z(w()),maximumSupportedRelease:Z(w()),deprecated:Z(He()),i18n:g0}),y0=ze(["human","ai","both"]),Tv=k({description:Z(w()),idempotent:Z(He())}),Pv=k({name:w(),displayName:w(),description:w(),props:ld,requireAuth:He(),errorHandlingOptions:Z(Vl),outputSchema:Z(Bs()),audience:Z(y0),aiMetadata:Z(Tv)}),xv=k({name:w(),displayName:w(),description:w(),props:ld,errorHandlingOptions:Z(Vl),type:ze(Lt),sampleData:we(),handshakeConfiguration:Z(Bs()),renewConfiguration:Z(bv),testStrategy:ze(ra),outputSchema:Z(Bs()),aiMetadata:Z(Tv)}),v0=k({...wv.shape,actions:Te(w(),Pv),triggers:Te(w(),xv)}),_0=k({...wv.shape,actions:Nt(),triggers:Nt(),suggestedActions:Z(Oe(Pv)),suggestedTriggers:Z(Oe(xv))}),Av=k({projectUsage:Nt(),pieceType:ze(Vo),packageType:ze(Qi),platformId:Z(w()),archiveId:Z(w())}),DK=k({...v0.shape,...Av.shape}),NK=k({..._0.shape,...Av.shape}),zK=k({name:w(),version:w()});var b0=qe(require("path")),E0=qe(require("fs/promises"));var Ov=require("node:stream");var Xs=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};return e.authentication&&this.populateAuthentication(e.authentication,r),e.body&&(e.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var Qs=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new pd,r=new fd){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},pd=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},fd=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 aa=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 Iv({error:t,requestBody:e}){return t instanceof aa?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}o(Iv,"toFailsafeOutput");var Ot=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Ot||{});var eu=class extends Xs{static{o(this,"FetchHttpClient")}constructor(e="",r=new Qs){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),s=this.getHeaders(e),c=e.queryParams??{};for(let[U,J]of Object.entries(c))i.append(U,J);let d=i.toString(),p=d?`${n}?${d}`:n,m=e.responseType??"json",y=e.followRedirects??!0,h=e.retries??0,{body:f,extraHeaders:l,isStream:g}=S0(e.method)?w0(e.body,s):{body:void 0,extraHeaders:{},isStream:!1},v=P0({...s,...l}),E=await T0(async()=>{let U=new AbortController,J=e.timeout&&e.timeout>0?setTimeout(()=>U.abort(),e.timeout):void 0;try{let W={method:e.method.toString(),headers:v,body:f,redirect:y?"follow":"manual",signal:U.signal};return g&&(W.duplex="half"),r?.dispatcher!==void 0&&(W.dispatcher=r.dispatcher),await fetch(p,W)}finally{J!==void 0&&clearTimeout(J)}},h),b=y?300:400;if(E.status<200||E.status>=b){let U=await Rv(E,m),J=new aa(e.body,{status:E.status,responseBody:U});throw console.error("[HttpClient#(sanitized error message)] Request failed:",J),J}let C=await Rv(E,m);return{status:E.status,headers:x0(E.headers),body:C}}};function S0(t){return t!=="GET"&&t!=="HEAD"}o(S0,"acceptsRequestBody");function w0(t,e){if(I0(t))return{body:void 0,extraHeaders:{},isStream:!1};if(A0(t)){let n=new Ov.PassThrough;return t.on("error",i=>n.destroy(i)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return typeof t=="string"||Buffer.isBuffer(t)||t instanceof URLSearchParams||t instanceof ArrayBuffer||typeof FormData<"u"&&t instanceof FormData||typeof Blob<"u"&&t instanceof Blob?{body:t,extraHeaders:{},isStream:!1}:(e["Content-Type"]??e["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(t).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(t),extraHeaders:{},isStream:!1}}o(w0,"serializeBody");async function Rv(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"blob":return await t.blob();case"text":return await t.text();default:{let r=await t.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Rv,"parseResponseBody");async function T0(t,e){let r;for(let n=0;n<=e;n++)try{let i=await t();if(i.status>=500&&n<e){await Cv(n);continue}return i}catch(i){if(r=i,n<e){await Cv(n);continue}throw i}throw r}o(T0,"sendWithRetries");function Cv(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(Cv,"backoff");function P0(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(P0,"normalizeHeaders");function x0(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(x0,"toHttpHeaders");function A0(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}o(A0,"isNodeFormData");function I0(t){return t==null}o(I0,"isNil");var Ue=new eu;var hk=qe(require("fs")),Nb=qe(Db());var gk={"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 yk(t){let e=t.split(";")[0].trim().toLowerCase();return gk[e]??""}o(yk,"contentTypeToExtension");var vk=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),_k=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 zb({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:d,authLocation:p="headers"}){return ve({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:F.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:m})=>({url:F.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
69
|
-
i.e ${_k(e,m)}/resource or /resource`,required:!0,defaultValue:m?e(m):"",...c?.url??{}})}),"props")}),method:F.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Ot).map(m=>({label:m,value:m}))},...c?.method??{}}),headers:F.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:F.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:F.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:F.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:m})=>{if(!m)return{};let y=m,h={};switch(y){case"none":break;case"json":h.data=F.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":h.data=F.LongText({displayName:"Raw Body",required:!0});break;case"form_data":h.data=F.Array({displayName:"Form Data",required:!0,properties:{fieldName:F.ShortText({displayName:"Field Name",required:!0}),fieldType:F.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:F.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:F.File({displayName:"File Field Value",required:!1})}});break}return h},"props")}),response_is_binary:F.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:F.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:F.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:F.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async m=>{let{method:y,url:h,headers:f,queryParams:l,body:g,body_type:v,failsafe:E,timeout:b,response_is_binary:C,followRedirects:U}=m.propsValue;Ws(y,"Method"),Ws(h,"URL");let J=it(r)?{}:await r(m.auth,m.propsValue),W=h.url,H=W.startsWith("http://")||W.startsWith("https://")?W:vk({baseUrl:e(m.auth),relativePath:W}),K={method:y,url:H,headers:{...f??{},...p==="headers"||!it(p)?J:{}},queryParams:{...p==="queryParams"?J:{},...l??{}},timeout:b?b*1e3:0,followRedirects:U};if(C&&(K.responseType="arraybuffer"),g)if(v&&v!=="none"){let te=g.data;if(v==="form_data"){let Q=te,xe=new Nb.default;for(let{fieldName:re,fieldType:V,textFieldValue:B,fileFieldValue:X}of Q)V==="text"&&!na(B)?xe.append(re,B):V==="file"&&!na(X)&&xe.append(re,X.data,{filename:X?.filename});K.body=xe,K.headers={...K.headers,...xe.getHeaders()}}else K.body=te}else v||(K.body=g);try{let te=await Ue.sendRequest(K);return await bk(m.files,te.body,te.status,te.headers,C)}catch(te){if(E)return Iv({error:te,requestBody:K.body});throw te}},"run")})}o(zb,"createCustomApiCallAction");var bk=o(async(t,e,r,n,i)=>{let s;if(i&&Ek(e)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=yk(c??"")||"txt",p;e instanceof ArrayBuffer?p=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?p=e:p=Buffer.from(e),s=await t.write({fileName:`output.${d}`,data:p})}else s=e;return{status:r,headers:n,body:s}},"handleBinaryResponse"),Ek=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var Je={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(t.strategy){case 0:{let d=await e.get("lastPoll");if(it(d))throw new Error("lastPoll doesn't exist in the store.");let p=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:d,server:c}),m=p.reduce((y,h)=>Math.max(y,h.epochMilliSeconds),d);return await e.put("lastPoll",m),p.filter(y=>y.epochMilliSeconds>d).map(y=>y.data)}case 1:{let d=await e.get("lastItem"),p=await t.items({store:e,auth:r,propsValue:n,lastItemId:d,files:s,server:c}),m=p.findIndex(f=>f.id===d),y=[];it(d)||m==-1?y=p??[]:y=p?.slice(0,m)??[],it(i)||(y=y.slice(-i));let h=y?.[0]?.id;return it(h)||await e.put("lastItem",h),y.map(f=>f.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i}){switch(t.strategy){case 0:{await e.put("lastPoll",Date.now());break}case 1:{let c=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;it(c)?await e.delete("lastItem"):await e.put("lastItem",c);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:s}){let c=[];switch(t.strategy){case 0:{c=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:s});break}}return Sk(c.map(d=>d.data))}};function Sk(t){return t.length<=5?t:t.slice(0,5)}o(Sk,"getFirstFiveOrAll");var Ub=require("crypto");async function Nd(t,e){let r={method:"POST",url:`${ae.baseUrl}/channels/stop`,body:{id:t?.id,resourceId:t?.resourceId},authentication:{type:"BEARER_TOKEN",token:await Ie(e)}};await Ue.sendRequest(r)}o(Nd,"stopWatchEvent");async function zd(t,e,r){let n=Date.now()+5184e5,i={method:"POST",url:`${ae.baseUrl}/calendars/${t}/events/watch`,body:{id:(0,Ub.randomUUID)(),type:"web_hook",address:e,expiration:n.toString()},authentication:{type:"BEARER_TOKEN",token:await Ie(r)}},{body:s}=await Ue.sendRequest(i);return s}o(zd,"watchEvent");async function cu({calendarId:t,authProp:e}){let r=await Ie(e),n={singleEvents:"true",showDeleted:"true",maxResults:"2500"},i="",s;do{i&&(n.pageToken=i);let c={method:"GET",url:`${ae.baseUrl}/calendars/${t}/events`,queryParams:n,authentication:{type:"BEARER_TOKEN",token:r}},{body:d}=await Ue.sendRequest(c);i=d.nextPageToken,s=d.nextSyncToken}while(i);return s}o(cu,"getInitialSyncToken");async function Mb({calendarId:t,syncToken:e,authProp:r}){let n=await Ie(r),i={syncToken:e,maxResults:"2500"},s="",c,d=[];do{s&&(i.pageToken=s);let p={method:"GET",url:`${ae.baseUrl}/calendars/${t}/events`,queryParams:i,authentication:{type:"BEARER_TOKEN",token:n}};try{let{body:m}=await Ue.sendRequest(p);m.items?.length>0&&(d=[...d,...m.items]),s=m.nextPageToken,c=m.nextSyncToken}catch(m){if(m?.response?.status===410)return{items:[],nextSyncToken:void 0,syncTokenInvalid:!0};throw m}}while(s);return{items:d,nextSyncToken:c,syncTokenInvalid:!1}}o(Mb,"listEventsWithSyncToken");async function kt(t,e){let r={showDeleted:"false"};e&&(r.minAccessRole=e);let n={method:"GET",url:`${ae.baseUrl}/users/me/calendarList`,queryParams:r,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};return(await Ue.sendRequest(n)).body.items}o(kt,"getCalendars");async function lu(t){let e={method:"GET",url:`${ae.baseUrl}/colors`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};return(await Ue.sendRequest(e)).body}o(lu,"getColors");async function da(t,e,r,n){let i=new Date,s=new Date;s.setDate(i.getDate()-1);let c={updatedMin:n?.toISOString()??s.toISOString(),maxResults:"2500",orderBy:"updated",singleEvents:e?"true":"false",showDeleted:"true"},d=await Ie(r),p={method:"GET",url:`${ae.baseUrl}/calendars/${t}/events`,queryParams:c,authentication:{type:"BEARER_TOKEN",token:d}},m=[],y="";do{c.pageToken=y;let{body:h}=await Ue.sendRequest(p);h.items.length>0&&(m=[...m,...h.items]),y=h.nextPageToken}while(y);return m}o(da,"getEvents");async function Lb(t,e){return(await da(t,!1,e)).pop()}o(Lb,"getLatestEvent");async function jb(t,e,r=50){if(!e)return[];try{let n=new Date,i=new Date;i.setDate(n.getDate()+30);let s={singleEvents:"true",orderBy:"startTime",timeMin:n.toISOString(),timeMax:i.toISOString(),maxResults:r.toString(),showDeleted:"false"},c={method:"GET",url:`${ae.baseUrl}/calendars/${encodeURIComponent(e)}/events`,queryParams:s,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}},d=await Ue.sendRequest(c);return!d.body.items||d.body.items.length===0?[]:d.body.items.map(p=>{let m=p.start?.dateTime||p.start?.date||"",y=m?new Date(m).toLocaleDateString():"",h=m?new Date(m).toLocaleTimeString():"",f=p.summary||"Untitled Event";return y&&(f+=` (${y}`,p.start?.dateTime&&(f+=` at ${h}`),f+=")"),{label:f,value:p.id||""}}).filter(p=>p.value!=="")}catch(n){return console.error("Error fetching events for dropdown:",n),[]}}o(jb,"getEventsForDropdown");var Ac=qe(Ba());var rm=["https://www.googleapis.com/auth/calendar.events","https://www.googleapis.com/auth/calendar.readonly"],ne=[Js.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,pkce:!0,scope:rm}),Js.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 calendars without adding the service account to each one. <br> <br> **Note:** Without a user email, the service account only has access to calendars you explicitly share with it.",required:!0,props:{serviceAccount:F.ShortText({displayName:"Service Account JSON Key",required:!0}),userEmail:F.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 Ie({type:"CUSTOM_AUTH",props:{...t}})}catch(e){return{valid:!1,error:e.message}}return{valid:!0}},"validate")})];async function _t(t){if(t.type==="CUSTOM_AUTH"){let r=JSON.parse(t.props.serviceAccount);return new Ac.JWT({email:r.client_email,key:r.private_key,scopes:rm,subject:t.props.userEmail})}let e=new Ac.OAuth2Client;return e.setCredentials(t),e}o(_t,"createGoogleClient");var Ie=o(async t=>{if(t.type==="CUSTOM_AUTH"){let r=await(await _t(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 ae={baseUrl:"https://www.googleapis.com/calendar/v3",calendarDropdown:o(t=>F.Dropdown({auth:ne,displayName:"Calendar",refreshers:[],required:!0,options:o(async({auth:e})=>e?{disabled:!1,options:(await kt(e,t)).map(i=>({label:i.summary,value:i.id}))}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),"calendarDropdown"),eventDropdown:o((t=!1)=>F.Dropdown({displayName:"Event",refreshers:["calendar_id"],required:t,auth:ne,options:o(async({auth:e,calendar_id:r})=>e?r?{disabled:!1,options:await jb(e,r)}:{disabled:!0,placeholder:"Please select a calendar first",options:[]}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),"eventDropdown"),colorId:F.Dropdown({auth:ne,displayName:"Color",refreshers:[],required:!1,options:o(async({auth:t})=>{if(!t)return{disabled:!0,placeholder:"Please connect your account first",options:[]};let e=await lu(t);return{disabled:!1,options:Object.entries(e.event).map(([r,n])=>({label:n.background,value:r}))}},"options")})};var Zc=qe(Sn()),vx=qe(xn()),_x=require("crypto");var Ze={fields:[{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"id",label:"Event ID"},{key:"eventType",label:"Event Type"},{key:"start",label:"Start",children:[{key:"dateTime",label:"Start Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"end",label:"End",children:[{key:"dateTime",label:"End Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"creator",label:"Creator",children:[{key:"email",label:"Email",format:"email"}]},{key:"organizer",label:"Organizer",children:[{key:"email",label:"Email",format:"email"}]},{key:"created",label:"Created",format:"datetime"},{key:"updated",label:"Updated",format:"datetime"},{key:"iCalUID",label:"iCal UID"}]},sx={fields:[{key:"summary",label:"Name"},{key:"description",label:"Description"},{key:"id",label:"Calendar ID"},{key:"timeZone",label:"Time Zone"},{key:"accessRole",label:"Access Role"},{key:"primary",label:"Primary",format:"boolean"},{key:"isOwned",label:"Is Owned",format:"boolean"},{key:"selected",label:"Selected",format:"boolean"},{key:"isShared",label:"Is Shared",format:"boolean"},{key:"calendarType",label:"Calendar Type"},{key:"backgroundColor",label:"Background Color"},{key:"foregroundColor",label:"Foreground Color"},{key:"colorId",label:"Color ID"}]},Hc={fields:[{key:"status",label:"Status Code"},{key:"summary",label:"Calendar Summary",value:"body.summary"},{key:"timeZone",label:"Time Zone",value:"body.timeZone"},{key:"accessRole",label:"Access Role",value:"body.accessRole"},{key:"updated",label:"Updated",value:"body.updated",format:"datetime"},{key:"items",label:"Events",value:"body.items",labelKey:"summary",listItems:[{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"id",label:"Event ID"},{key:"eventType",label:"Event Type"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"startDateTime",label:"Start",value:"start.dateTime",format:"datetime"},{key:"endDateTime",label:"End",value:"end.dateTime",format:"datetime"},{key:"creatorEmail",label:"Creator Email",value:"creator.email",format:"email"},{key:"organizerEmail",label:"Organizer Email",value:"organizer.email",format:"email"},{key:"created",label:"Created",format:"datetime"},{key:"updated",label:"Updated",format:"datetime"},{key:"iCalUID",label:"iCal UID"}]}]},ux={fields:[{key:"summary",label:"Summary",value:"body.summary"},{key:"status",label:"Status",value:"body.status"},{key:"id",label:"Event ID",value:"body.id"},{key:"htmlLink",label:"Event Link",value:"body.htmlLink",format:"url"},{key:"created",label:"Created",value:"body.created",format:"datetime"},{key:"updated",label:"Updated",value:"body.updated",format:"datetime"},{key:"start",label:"Start",value:"body.start",children:[{key:"dateTime",label:"Start Date/Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"end",label:"End",value:"body.end",children:[{key:"dateTime",label:"End Date/Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"creator",label:"Creator",value:"body.creator",children:[{key:"email",label:"Email",format:"email"}]},{key:"organizer",label:"Organizer",value:"body.organizer",children:[{key:"email",label:"Email",format:"email"}]},{key:"eventType",label:"Event Type",value:"body.eventType"},{key:"iCalUID",label:"iCal UID",value:"body.iCalUID"}]},cx={fields:[{key:"summary",label:"Name"},{key:"id",label:"Calendar ID"},{key:"description",label:"Description"},{key:"location",label:"Location"},{key:"timeZone",label:"Time Zone"}]};var lx={fields:[{key:"calendar",label:"Calendar Colors",dynamicKey:!0,children:[{key:"background",label:"Background Color"},{key:"foreground",label:"Foreground Color"}]},{key:"event",label:"Event Colors",dynamicKey:!0,children:[{key:"background",label:"Background Color"},{key:"foreground",label:"Foreground Color"}]}]},dx={fields:[{key:"calendars",label:"Calendars",labelKey:"summary",listItems:[{key:"id",label:"Calendar ID"},{key:"summary",label:"Name"},{key:"description",label:"Description"},{key:"location",label:"Location"},{key:"timeZone",label:"Time Zone"},{key:"accessRole",label:"Access Role"},{key:"primary",label:"Primary",format:"boolean"},{key:"selected",label:"Selected",format:"boolean"},{key:"backgroundColor",label:"Background Color"},{key:"foregroundColor",label:"Foreground Color"}]},{key:"count",label:"Count",format:"number"}]},px={fields:[{key:"items",label:"Settings",labelKey:"id",listItems:[{key:"id",label:"Setting ID"},{key:"value",label:"Value"}]},{key:"count",label:"Count",format:"number"}]},fx={fields:[{key:"removed",label:"Removed",format:"boolean"},{key:"attendee_email",label:"Attendee Email",format:"email"},{key:"message",label:"Message"},{key:"event",label:"Event",children:Ze.fields}]},mx={fields:[{key:"free_slots",label:"Free Slots",labelKey:"start",listItems:[{key:"start",label:"Start",format:"datetime"},{key:"end",label:"End",format:"datetime"},{key:"duration_minutes",label:"Duration (Minutes)",format:"number"}]},{key:"count",label:"Count",format:"number"}]},pL=[{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"id",label:"Instance Event ID"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"startDateTime",label:"Start",value:"start.dateTime",format:"datetime"},{key:"endDateTime",label:"End",value:"end.dateTime",format:"datetime"},{key:"originalStartDateTime",label:"Original Start",value:"originalStartTime.dateTime",format:"datetime"}],hx={fields:[{key:"instances",label:"Instances",labelKey:"summary",listItems:pL},{key:"count",label:"Count",format:"number"},{key:"nextPageToken",label:"Next Page Token"}]},gx={fields:[{key:"moved",label:"Moved",format:"boolean"},{key:"already_in_destination",label:"Already in Destination",format:"boolean"},{key:"event",label:"Event",children:Ze.fields}]},yx={fields:[{key:"events",label:"Events",labelKey:"summary",listItems:[{key:"calendarId",label:"Calendar ID"},{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"id",label:"Event ID"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"startDateTime",label:"Start",value:"start.dateTime",format:"datetime"},{key:"endDateTime",label:"End",value:"end.dateTime",format:"datetime"}]},{key:"count",label:"Count",format:"number"},{key:"calendars_searched",label:"Calendars Searched",format:"number"},{key:"warning",label:"Warning"}]},Wc={fields:[{key:"timeMin",label:"Time Min",format:"datetime"},{key:"timeMax",label:"Time Max",format:"datetime"},{key:"calendars",label:"Calendars",dynamicKey:!0,children:[{key:"busy",label:"Busy Periods",labelKey:"start",listItems:[{key:"start",label:"Start",format:"datetime"},{key:"end",label:"End",format:"datetime"}]}]}]};var Fm={calendar_id:ae.calendarDropdown("writer"),title:F.ShortText({displayName:"Title of the event",required:!0}),start_date_time:F.DateTime({displayName:"Start date time of the event",required:!0}),end_date_time:F.DateTime({displayName:"End date time of the event",description:"By default it'll be 30 min post start time",required:!1}),location:F.ShortText({displayName:"Location",required:!1}),description:F.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1}),colorId:ae.colorId,attendees:F.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!1}),guests_can_modify:F.Checkbox({displayName:"Guests can modify",defaultValue:!1,required:!1}),guests_can_invite_others:F.Checkbox({displayName:"Guests can invite others",defaultValue:!1,required:!1}),guests_can_see_other_guests:F.Checkbox({displayName:"Guests can see other guests",defaultValue:!1,required:!1}),send_notifications:F.StaticDropdown({displayName:"Send Notifications",defaultValue:"all",options:{options:[{label:"Yes, to everyone",value:"all"},{label:"To non-Google Calendar guests only",value:"externalOnly"},{label:"To no one",value:"none"}]},required:!0}),create_meet_link:F.Checkbox({displayName:"Create Google Meet Link",description:"Automatically create a Google Meet video conference link for this event",defaultValue:!1,required:!1})};async function qm(t){let{calendar_id:e,title:r,start_date_time:n,end_date_time:i,location:s,description:c,colorId:d,guests_can_modify:p,guests_can_invite_others:m,guests_can_see_other_guests:y,create_meet_link:h}=t.propsValue,f={dateTime:(0,Zc.default)(n).format("YYYY-MM-DDTHH:mm:ss.sssZ")},l=i||(0,Zc.default)(n).add(30,"m"),g={dateTime:(0,Zc.default)(l).format("YYYY-MM-DDTHH:mm:ss.sssZ")},v=t.propsValue.attendees,E=t.propsValue.send_notifications,b=[];if(v)for(let H of v)b.push({email:H});let C=await _t(t.auth),U=(0,vx.calendar)({version:"v3",auth:C}),J={summary:r,start:f,end:g,colorId:d,location:s??"",description:c??"",attendees:b,guestsCanInviteOthers:m,guestsCanModify:p,guestsCanSeeOtherGuests:y};return h&&(J.conferenceData={createRequest:{conferenceSolutionKey:{type:"hangoutsMeet"},requestId:(0,_x.randomUUID)()}}),(await U.events.insert({calendarId:e,sendUpdates:E,conferenceDataVersion:h?1:0,requestBody:J})).data}o(qm,"runCreateEvent");var bx=ve({auth:ne,name:"create_google_calendar_event",description:"Add Event",audience:"human",aiMetadata:{description:"Creates a Google Calendar event with structured fields (title, start/end times, location, description, attendees, color, guest permissions) and can optionally attach a Google Meet link. Use this when you have explicit event details; choose Create Quick Event instead when working from a single natural-language phrase. Requires a title and start time (end defaults to 30 minutes after start). Not idempotent: each call creates a new event.",idempotent:!1},displayName:"Create Event",props:Fm,outputSchema:Ze,run:qm});var Ex=ve({auth:ne,name:"create_quick_event",description:"Add Quick Calendar Event",audience:"both",aiMetadata:{description:`Creates a calendar event from a single natural-language phrase (e.g. "Lunch with Sam tomorrow at 1pm") via Google's quickAdd parsing, letting Google infer the time, title, and date. Use when you have free-form text rather than structured fields; prefer Create Event when you have explicit start/end times or attendees. Not idempotent: each call creates a new event.`,idempotent:!1},displayName:"Create Quick Event",props:{calendar_id:ae.calendarDropdown("writer"),text:F.LongText({displayName:"Summary",description:"The text describing the event to be created",required:!0}),send_updates:F.StaticDropdown({displayName:"Send Updates",description:"Guests who should receive notifications about the creation of the new event.",required:!1,options:{disabled:!1,options:[{label:"All",value:"all"},{label:"External Only",value:"externalOnly"},{label:"none",value:"none"}]}})},outputSchema:ux,async run(t){let e=t.propsValue.calendar_id,r=`${ae.baseUrl}/calendars/${e}/events/quickAdd`,n={text:t.propsValue.text,sendUpdates:t.propsValue.send_updates||"none"},i={method:"POST",url:r,body:{},authentication:{type:"BEARER_TOKEN",token:await Ie(t.auth)},queryParams:n};return await Ue.sendRequest(i)}});var Sx=qe(xn());var fL={calendar_id:ae.calendarDropdown("writer"),eventId:F.ShortText({displayName:"Event ID",required:!0})};async function Bm(t){let e=await _t(t.auth),r=t.propsValue.calendar_id,n=t.propsValue.eventId;return(await(0,Sx.calendar)({version:"v3",auth:e}).events.delete({calendarId:r,eventId:n})).data}o(Bm,"runDeleteEvent");var wx=ve({displayName:"Delete Event",auth:ne,name:"delete_event",description:"Deletes an event from Google Calendar.",audience:"human",aiMetadata:{description:"Permanently removes an event from a Google Calendar, identified by calendar and event ID. Use to cancel or delete an existing event. Requires the event ID and cannot be undone. Idempotent: once the event is deleted, repeating the call leaves it absent (a second call may report it as already gone).",idempotent:!0},props:fL,run:Bm});var Vm=qe(Sn());var Gm={calendar_id:ae.calendarDropdown("writer"),event_types:F.StaticMultiSelectDropdown({displayName:"Event types",description:"Select event types",required:!0,defaultValue:["default","focusTime","outOfOffice"],options:{options:[{label:"Default",value:"default"},{label:"Out Of Office",value:"outOfOffice"},{label:"Focus Time",value:"focusTime"},{label:"Working Location",value:"workingLocation"}]}}),search:F.ShortText({displayName:"Search Term",required:!1}),start_date:F.DateTime({displayName:"Date from",required:!1}),end_date:F.DateTime({displayName:"Date to",required:!1}),singleEvents:F.Checkbox({displayName:"Expand Recurring Event?",description:"Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves.",required:!0,defaultValue:!1})};async function Hm(t){let{calendar_id:e,start_date:r,end_date:n,search:i,event_types:s,singleEvents:c}=t.propsValue,d=await Ie(t.auth),p={showDeleted:"false"},m=`${ae.baseUrl}/calendars/${e}/events`;c!==null&&(p.singleEvents=c?"true":"false"),i&&(p.q=`"${i}"`),r&&(p.timeMin=(0,Vm.default)(r).format("YYYY-MM-DDTHH:mm:ss.sssZ")),r&&n&&(p.timeMax=(0,Vm.default)(n).format("YYYY-MM-DDTHH:mm:ss.sssZ")),s.length>0&&(m+=`?${s.map(h=>`eventTypes=${h}`).join("&")}`);let y={method:"GET",url:m,queryParams:p,authentication:{type:"BEARER_TOKEN",token:d}};return await Ue.sendRequest(y)}o(Hm,"runGetEvents");var Tx=ve({auth:ne,name:"google_calendar_get_events",description:"Get Events",audience:"human",aiMetadata:{description:"Lists events from a Google Calendar, optionally filtered by a date range, search term, and event types, and can expand recurring events into individual instances. Use to look up or browse multiple events when you do not already have a specific event ID; use Get Event by ID for a single known event. Read-only and idempotent.",idempotent:!0},displayName:"Get all Events",props:Gm,outputSchema:Hc,run:Hm});var Px=qe(xn());var Wm=qe(Sn());var Kc={calendar_id:ae.calendarDropdown("writer"),eventId:F.ShortText({displayName:"Event ID",required:!0}),title:F.ShortText({displayName:"Title of the event",required:!1}),start_date_time:F.DateTime({displayName:"Start date time of the event",required:!1}),end_date_time:F.DateTime({displayName:"End date time of the event",required:!1}),location:F.ShortText({displayName:"Location",required:!1}),description:F.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1}),colorId:ae.colorId,attendees:F.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!1}),guests_can_modify:F.Checkbox({displayName:"Guests can modify",defaultValue:!1,required:!1}),guests_can_invite_others:F.Checkbox({displayName:"Guests can invite others",defaultValue:!1,required:!1}),guests_can_see_other_guests:F.Checkbox({displayName:"Guests can see other guests",defaultValue:!1,required:!1})};async function Zm(t){let{calendar_id:e,eventId:r,title:n,start_date_time:i,end_date_time:s,location:c,description:d,colorId:p,guests_can_invite_others:m,guests_can_modify:y,guests_can_see_other_guests:h}=t.propsValue,f=t.propsValue.attendees,l=await _t(t.auth),g=(0,Px.calendar)({version:"v3",auth:l}),v=await g.events.get({calendarId:e,eventId:r}),E=[];return Array.isArray(f)&&f.length>0?E=f.map(C=>({email:C})):v.data.attendees&&Array.isArray(v.data.attendees)&&(E=v.data.attendees),(await g.events.update({calendarId:e,eventId:r,requestBody:{summary:n??v.data.summary,attendees:E,description:d??v.data.description,colorId:p,location:c??v.data.location,start:i?{dateTime:(0,Wm.default)(i).format("YYYY-MM-DDTHH:mm:ss.sssZ")}:v.data.start,end:s?{dateTime:(0,Wm.default)(s).format("YYYY-MM-DDTHH:mm:ss.sssZ")}:v.data.end,guestsCanInviteOthers:m??v.data.guestsCanInviteOthers,guestsCanModify:y??v.data.guestsCanModify,guestsCanSeeOtherGuests:h??v.data.guestsCanSeeOtherGuests}})).data}o(Zm,"runUpdateEvent");var xx=ve({displayName:"Update Event",auth:ne,name:"update_event",description:"Updates an event in Google Calendar.",audience:"human",aiMetadata:{description:"Updates the fields of an existing Google Calendar event identified by calendar and event ID (title, times, location, description, color, attendees, guest permissions); unset fields retain their current values. Use to modify or reschedule an event that already exists rather than creating a new one. Requires the event ID. Idempotent: applying the same field values repeatedly leaves the event in the same state.",idempotent:!0},props:Kc,outputSchema:Ze,run:Zm});var Jc={strategy:0,items:o(async({auth:t,propsValue:{calendarId:e,expandRecurringEvent:r},lastFetchEpochMS:n})=>{let i=new Date(n);if(n===0){let d=new Date,p=new Date;p.setDate(d.getDate()-7),i=p}return(await da(e,r,t,i)??[]).map(d=>({epochMilliSeconds:new Date(d.updated).getTime(),data:d}))},"items")},Ax=jt({auth:ne,name:"new_or_updated_event",displayName:"New or Updated Event",description:"Triggers when an event is added or updated",aiMetadata:{description:"Fires when any event in the selected calendar is created or modified, polling by last-updated time. Each fired item is the affected event; can optionally expand recurring events so every occurrence fires separately."},props:{calendar_id:ae.calendarDropdown(),expandRecurringEvent:F.Checkbox({displayName:"Expand Recurring Event?",description:"If true, the trigger will activate for every occurrence of a recurring event.",required:!0,defaultValue:!1})},sampleData:{kind:"calendar#event",etag:"3350849506974000",id:"0nsfi5ttd2b17ac76ma2f37oi9",htmlLink:"https://www.google.com/calendar/event?eid=kgjb90uioj4klrgfmdsnjsjvlgkm",summary:"ap-event-test",created:"2023-02-03T11:36:36.000Z",updated:"2023-02-03T11:45:53.487Z",description:"Sample description",status:"canceled",creator:{email:"test@test.com",self:!0},organizer:{email:"test@test.com",self:!0},start:{dateTime:"2023-02-02T22:30:00+03:00",timeZone:"Asia/Amman"},end:{dateTime:"2023-02-02T23:30:00+03:00",timeZone:"Asia/Amman"},transparency:"transparent",iCalUID:"0nsfi5ttd2b17ac76ma2f37oi9@google.com",sequence:1,attendees:[{email:"attende@test.com",responseStatus:"needsAction"},{email:"test@test.com",organizer:!0,self:!0,responseStatus:"accepted"}],reminders:{useDefault:!0},eventType:"default"},outputSchema:Ze,type:"POLLING",async test({store:t,auth:e,propsValue:r,files:n}){return await Je.test(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent},files:n})},async onEnable({store:t,auth:e,propsValue:r}){await Je.onEnable(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent}})},async onDisable({store:t,auth:e,propsValue:r}){await Je.onDisable(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent}})},async run({store:t,auth:e,propsValue:r,files:n}){return await Je.poll(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent},files:n})}});var Ix=qe(xn());var Rx=ve({auth:ne,name:"google-calendar-add-attendees",displayName:"Add Attendees to Event",description:"Add one or more person to existing event.",audience:"both",aiMetadata:{description:"Adds one or more guests (by email) to an existing Google Calendar event, identified by calendar and event ID, preserving the current attendee list. Use to invite people to an event that already exists rather than recreating it. Not idempotent: re-running appends the same emails again, producing duplicate attendee entries.",idempotent:!1},props:{calendar_id:ae.calendarDropdown("writer"),eventId:F.ShortText({displayName:"Event ID",required:!0}),attendees:F.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!0})},outputSchema:Ze,async run(t){let{calendar_id:e,eventId:r}=t.propsValue,n=t.propsValue.attendees,i=await _t(t.auth),s=(0,Ix.calendar)({version:"v3",auth:i}),c=await s.events.get({calendarId:e,eventId:r}),d=c.data.attendees??[],p=[];return p.push(...d),p.push(...n.map(y=>({email:y}))),(await s.events.update({calendarId:e,eventId:r,requestBody:{...c.data,attendees:p}})).data}});var Km=qe(Sn());var Jm={calendar_ids:F.MultiSelectDropdown({auth:ne,displayName:"Calendars",description:"Select the calendars to check for busy periods.",required:!0,refreshers:[],options:o(async({auth:t})=>t?{disabled:!1,options:(await kt(t)).map(n=>({label:n.summary,value:n.id}))}:{disabled:!0,placeholder:"Connect your account first",options:[]},"options")}),start_date:F.DateTime({displayName:"Start Time",description:"The start of the time range to check.",required:!0}),end_date:F.DateTime({displayName:"End Time",description:"The end of the time range to check.",required:!0})};async function Ym(t){let{calendar_ids:e,start_date:r,end_date:n}=t.propsValue,i=await Ie(t.auth),s={timeMin:(0,Km.default)(r).toISOString(),timeMax:(0,Km.default)(n).toISOString(),items:e.map(p=>({id:p}))},c={method:"POST",url:`${ae.baseUrl}/freeBusy`,body:s,authentication:{type:"BEARER_TOKEN",token:i}};return(await Ue.sendRequest(c)).body}o(Ym,"runFindFreeBusy");var Cx=ve({auth:ne,name:"google_calendar_find_busy_free_periods",displayName:"Find Busy/Free Periods in Calendar",description:"Finds free/busy calendar details from Google Calendar.",audience:"human",aiMetadata:{description:"Queries one or more calendars for their busy time blocks within a given start/end window, without exposing event details. Use to check availability or find open slots before scheduling a meeting. Requires the calendars to check and a time range. Read-only and idempotent.",idempotent:!0},props:Jm,outputSchema:Wc,run:Ym});var Xm={calendar_id:ae.calendarDropdown(),event_id:F.ShortText({displayName:"Event ID",description:'The unique ID of the event (e.g., "abc123def456"). You can find this in the event URL or from other calendar actions.',required:!0}),max_attendees:F.Number({displayName:"Max Attendees",description:"Maximum number of attendees to include in the response. If there are more attendees, only the participant is returned.",required:!1}),time_zone:F.ShortText({displayName:"Time Zone",description:`Time zone for the response (e.g., "America/New_York", "Europe/London"). Defaults to the calendar's time zone if not specified.`,required:!1})};async function Qm(t){let{calendar_id:e,event_id:r,max_attendees:n,time_zone:i}=t.propsValue,s=await Ie(t.auth);if(!e||typeof e!="string"||e.trim().length===0)throw new Error("Calendar ID is required");if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Event ID cannot be empty");if(r.length<5||r.length>1024)throw new Error("Event ID must be between 5 and 1024 characters");let c={};n!==void 0&&n>0&&(c.maxAttendees=n.toString()),i&&typeof i=="string"&&i.trim().length>0&&(c.timeZone=i.trim());let d=`${ae.baseUrl}/calendars/${encodeURIComponent(e.trim())}/events/${encodeURIComponent(r.trim())}`,p={method:"GET",url:d,queryParams:c,authentication:{type:"BEARER_TOKEN",token:s}};try{return(await Ue.sendRequest(p)).body}catch(m){throw m.response?.status===404?new Error(`Event with ID "${r}" not found in calendar "${e}". Please verify the event ID and calendar selection.`):m.response?.status===403?new Error(`Access denied to event "${r}" in calendar "${e}". Please check your permissions.`):m.response?.status===400?new Error("Invalid request parameters. Please check the event ID format and other parameters."):m.response?.status===401?new Error("Authentication failed. Please reconnect your Google Calendar account."):new Error(`Failed to fetch event: ${m.message||"Unknown error occurred"}`)}}o(Qm,"runGetEventById");var Ox=ve({auth:ne,name:"google_calendar_get_event_by_id",displayName:"Get Event by ID",description:"Fetch event details by its unique ID from Google Calendar.",audience:"human",aiMetadata:{description:"Fetches the full details of a single Google Calendar event by its unique event ID within a given calendar. Use when you already have an event ID (e.g. from a trigger or a list action) and need its details; use Get all Events to search when you do not. Requires a valid event ID. Read-only and idempotent.",idempotent:!0},props:Xm,outputSchema:Ze,run:Qm});var eh=qe(Sn()),kx=ve({auth:ne,name:"google_calendar_search_events_all_calendars",displayName:"Search Events Across Calendars",description:"Searches every calendar the account can access for events matching a keyword within a required time window.",audience:"ai",aiMetadata:{description:"Search all of the user's calendars at once for events matching a text query within a required time window, returning each match tagged with its owning calendarId so you can then get/update/delete it. Use this instead of Get all Events when you know a keyword and time range but do NOT know which calendar the event lives in (Get all Events searches a single calendar). A start and end time are mandatory to bound the cross-calendar scan; matching uses Google's native q= filter, not semantic search. Read-only and idempotent.",idempotent:!0},props:{query:F.ShortText({displayName:"Search Term",description:`Free-text query matched against event fields (summary, description, location, attendee names/emails) using Google's native search. Example: "budget review".`,required:!0}),start_date:F.DateTime({displayName:"Start Time",description:`Lower bound (inclusive) for an event's end time, as an ISO 8601 timestamp (e.g. "2026-06-01T00:00:00Z"). Required to bound the cross-calendar scan.`,required:!0}),end_date:F.DateTime({displayName:"End Time",description:`Upper bound (exclusive) for an event's start time, as an ISO 8601 timestamp (e.g. "2026-06-30T23:59:59Z"). Required to bound the cross-calendar scan.`,required:!0}),single_events:F.Checkbox({displayName:"Expand Recurring Events?",description:"When enabled, recurring events are expanded into their individual instances instead of returning the underlying recurring event.",required:!1,defaultValue:!0})},outputSchema:yx,async run(t){let{query:e,start_date:r,end_date:n,single_events:i}=t.propsValue,s=await Ie(t.auth),c=(0,eh.default)(r).toISOString(),d=(0,eh.default)(n).toISOString(),p=await kt(t.auth),m=[],y=[];for(let h of p){let f="";do{let l={q:e,timeMin:c,timeMax:d,singleEvents:i?"true":"false",showDeleted:"false",maxResults:"250"};f&&(l.pageToken=f);let g={method:"GET",url:`${ae.baseUrl}/calendars/${encodeURIComponent(h.id)}/events`,queryParams:l,authentication:{type:"BEARER_TOKEN",token:s}};try{let v=await Ue.sendRequest(g),E=v.body.items??[];for(let b of E)m.push({...b,calendarId:h.id});f=v.body.nextPageToken}catch(v){let E=v.response?.status;if(E===403||E===404){y.push({calendarId:h.id,status:E}),f="";continue}throw E===429?new Error("Google Calendar rate limit reached while searching calendars. Please retry shortly."):v}}while(f)}return{events:m,count:m.length,calendars_searched:p.length-y.length,...y.length>0?{skipped_calendars:y,warning:"Some calendars could not be searched (access denied or not found); a missing match may live in a skipped calendar. See skipped_calendars."}:{}}}});var Sr=qe(Sn()),Dx=qe($x());Sr.default.extend(Dx.default);function mL(t){if(t.length===0)return[];let e=[...t].sort((n,i)=>n.start-i.start),r=[{...e[0]}];for(let n=1;n<e.length;n++){let i=r[r.length-1],s=e[n];s.start<=i.end?i.end=Math.max(i.end,s.end):r.push({...s})}return r}o(mL,"mergeIntervals");function hL(t,e,r){let n=[],i=e;for(let s of t)if(s.start>i&&n.push({start:i,end:Math.min(s.start,r)}),i=Math.max(i,s.end),i>=r)break;return i<r&&n.push({start:i,end:r}),n.filter(s=>s.end>s.start)}o(hL,"complement");function gL(t,e,r){let n=[];for(let i of t){let s=Sr.default.utc(i.start).startOf("day"),c=Sr.default.utc(i.end);for(;s.valueOf()<i.end;){let d=s.add(e,"hour"),p=s.add(r,"hour"),m=Math.max(i.start,d.valueOf()),y=Math.min(i.end,p.valueOf());if(y>m&&n.push({start:m,end:y}),s=s.add(1,"day"),s.valueOf()>c.valueOf())break}}return n}o(gL,"clipToWorkingHours");var Nx=ve({auth:ne,name:"google_calendar_find_free_slots",displayName:"Find Free Time Slots",description:"Computes open time slots shared across one or more calendars within a window, by inverting their busy blocks.",audience:"ai",aiMetadata:{description:'Return the OPEN time slots common to the selected calendars within a window \u2014 the inverse of their combined busy blocks, optionally filtered to a minimum duration and to working hours. Use this instead of Find Busy/Free Periods (which returns only busy blocks and forces you to invert and reconcile them yourself) when you need the actual free intervals to answer "when can everyone meet". Idempotent because it performs no writes, but the result depends entirely on the window: pass absolute start/end times, since a window relative to "now" yields a shifting set of slots.',idempotent:!0},props:{calendar_ids:F.MultiSelectDropdown({auth:ne,displayName:"Calendars",description:"The calendars whose schedules must all be free. A slot is returned only when it is open on every selected calendar.",required:!0,refreshers:[],options:o(async({auth:t})=>t?{disabled:!1,options:(await kt(t)).map(n=>({label:n.summary,value:n.id}))}:{disabled:!0,placeholder:"Connect your account first",options:[]},"options")}),start_date:F.DateTime({displayName:"Window Start",description:'Start of the search window, as an absolute ISO 8601 timestamp (e.g. "2026-06-01T09:00:00Z"). Prefer absolute times over relative ones.',required:!0}),end_date:F.DateTime({displayName:"Window End",description:'End of the search window, as an absolute ISO 8601 timestamp (e.g. "2026-06-05T18:00:00Z").',required:!0}),min_duration_minutes:F.Number({displayName:"Minimum Slot Duration (minutes)",description:"Discard any open slot shorter than this many minutes. Leave empty to return every open slot regardless of length.",required:!1}),working_hours_start:F.Number({displayName:"Working Hours Start (hour 0-23)",description:"If set together with Working Hours End, each day's open slots are clipped to this hour range, interpreted in UTC (not the calendar's local time zone). Example: 9 for 09:00 UTC. Leave both unset to return slots across the full window.",required:!1}),working_hours_end:F.Number({displayName:"Working Hours End (hour 0-23)",description:"Upper bound of the daily working-hours window. Example: 17 for 5 PM. Ignored unless Working Hours Start is also set.",required:!1})},outputSchema:mx,async run(t){let{calendar_ids:e,start_date:r,end_date:n,min_duration_minutes:i,working_hours_start:s,working_hours_end:c}=t.propsValue,d=await Ie(t.auth),p=(0,Sr.default)(r).valueOf(),m=(0,Sr.default)(n).valueOf();if(m<=p)throw new Error("Window End must be after Window Start.");let y={method:"POST",url:`${ae.baseUrl}/freeBusy`,body:{timeMin:(0,Sr.default)(r).toISOString(),timeMax:(0,Sr.default)(n).toISOString(),items:e.map(b=>({id:b}))},authentication:{type:"BEARER_TOKEN",token:d}},h=await Ue.sendRequest(y),f=[],l=[];for(let b of Object.keys(h.body.calendars)){let C=h.body.calendars[b];if(C.errors?.length){l.push({calendarId:b,errors:C.errors});continue}let U=C.busy??[];for(let J of U)f.push({start:(0,Sr.default)(J.start).valueOf(),end:(0,Sr.default)(J.end).valueOf()})}if(l.length>0)throw new Error(`Could not read availability for calendar(s): ${l.map(b=>`${b.calendarId} (${b.errors.map(C=>C.reason).join(", ")})`).join("; ")}. A slot can only be marked free if every selected calendar is free, so free slots cannot be computed while any of them are unreadable. Verify the calendar IDs with List Calendars.`);let g=mL(f),v=hL(g,p,m);if(s!==void 0&&c!==void 0&&c>s&&(v=gL(v,s,c)),i!==void 0&&i>0){let b=i*60*1e3;v=v.filter(C=>C.end-C.start>=b)}let E=v.map(b=>({start:(0,Sr.default)(b.start).toISOString(),end:(0,Sr.default)(b.end).toISOString(),duration_minutes:Math.round((b.end-b.start)/6e4)}));return{free_slots:E,count:E.length}}});var zx=qe(xn());var nh=qe(Sn()),Ux=ve({auth:ne,name:"google_calendar_list_recurring_event_instances",displayName:"List Recurring Event Instances",description:"Lists the individual occurrences of one recurring event series, each with its own instance event ID.",audience:"ai",aiMetadata:{description:"List the individual occurrences of a single recurring event series, identified by its recurring-event ID, each returned with its own distinct instance event ID. Use this when you need to inspect, reschedule, or cancel ONE occurrence of a series rather than the whole series; Get all Events expands recurring events only across a whole-calendar window and cannot target one series by ID. Requires the recurring series' event ID; optionally bound by a time range. Read-only and idempotent.",idempotent:!0},props:{calendar_id:ae.calendarDropdown(),event_id:F.ShortText({displayName:"Recurring Event ID",description:'The event ID of the recurring SERIES (the parent), e.g. "abc123def456". Obtain it from Search Events Across Calendars or Get all Events. Individual instance IDs will not work here.',required:!0}),time_min:F.DateTime({displayName:"Start Time",description:`Optional lower bound (inclusive) for an instance's end time, as an ISO 8601 timestamp with offset (e.g. "2026-06-01T00:00:00Z").`,required:!1}),time_max:F.DateTime({displayName:"End Time",description:`Optional upper bound (exclusive) for an instance's start time, as an ISO 8601 timestamp with offset (e.g. "2026-06-30T23:59:59Z").`,required:!1}),show_deleted:F.Checkbox({displayName:"Include Cancelled Instances",description:"Whether to include cancelled (deleted) instances of the series in the result. Defaults to false.",required:!1,defaultValue:!1}),max_results:F.Number({displayName:"Max Results",description:"Maximum number of instances to return per page (1-2500). Defaults to the API default of 250.",required:!1})},outputSchema:hx,async run(t){let{calendar_id:e,event_id:r,time_min:n,time_max:i,show_deleted:s,max_results:c}=t.propsValue,d=await _t(t.auth),p=(0,zx.calendar)({version:"v3",auth:d});try{let m=await p.events.instances({calendarId:e,eventId:r,timeMin:n?(0,nh.default)(n).toISOString():void 0,timeMax:i?(0,nh.default)(i).toISOString():void 0,showDeleted:s??!1,maxResults:c}),y=m.data.items??[];return{instances:y,count:y.length,nextPageToken:m.data.nextPageToken??null}}catch(m){let y=m.response?.status??m.code;throw y===404?new Error(`Recurring event "${r}" not found in calendar "${e}". Verify the ID belongs to a recurring series.`):y===400?new Error(`Invalid request: "${r}" may not be a recurring event. The instances endpoint only works on recurring series.`):y===403?new Error(`Access denied to event "${r}" in calendar "${e}". Check your permissions.`):m}}});var Mx=qe(xn());var Lx=ve({auth:ne,name:"google_calendar_move_event",displayName:"Move Event to Another Calendar",description:"Moves an existing event from one calendar to another, preserving its event ID and metadata.",audience:"ai",aiMetadata:{description:"Move an existing event from a source calendar to a destination calendar in place, preserving the event ID, conferencing, and attendee state. Use this instead of deleting and recreating the event (which loses the ID and metadata) when you need to transfer an event between calendars. Idempotent: moving an event to the calendar it already lives on is treated as a no-op. The source and destination must be writable calendars.",idempotent:!0},props:{calendar_id:ae.calendarDropdown("writer"),event_id:F.ShortText({displayName:"Event ID",description:'The ID of the event to move, e.g. "abc123def456". Obtain it from Search Events Across Calendars or Get all Events.',required:!0}),destination_calendar_id:F.Dropdown({auth:ne,displayName:"Destination Calendar",description:"The calendar to move the event to.",refreshers:[],required:!0,options:o(async({auth:t})=>t?{disabled:!1,options:(await kt(t,"writer")).map(r=>({label:r.summary,value:r.id}))}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),send_updates:F.StaticDropdown({displayName:"Send Notifications",description:"Who should receive notifications about the change of the event's organizer.",required:!1,defaultValue:"none",options:{options:[{label:"To everyone",value:"all"},{label:"To external guests only",value:"externalOnly"},{label:"To no one",value:"none"}]}})},outputSchema:gx,async run(t){let{calendar_id:e,event_id:r,destination_calendar_id:n,send_updates:i}=t.propsValue,s=await _t(t.auth),c=(0,Mx.calendar)({version:"v3",auth:s});if(e===n)return{moved:!1,already_in_destination:!0,event:(await c.events.get({calendarId:n,eventId:r})).data};try{return await c.events.move({calendarId:e,eventId:r,destination:n,sendUpdates:i??"none"}),{moved:!0,already_in_destination:!1,event:(await c.events.get({calendarId:n,eventId:r})).data}}catch(d){let p=d.response?.status??d.code;throw p===404?new Error(`Event "${r}" not found in source calendar "${e}". Verify the event ID and source calendar.`):p===403?new Error(`Access denied while moving event "${r}". Both the source and destination calendars must be writable.`):p===400?new Error(`Invalid move request for event "${r}". The destination must differ from the source and both must be valid calendars.`):d}}});var jx=ve({auth:ne,name:"google_calendar_create_event",displayName:"Create Event",description:"Create a new event on a Google Calendar with structured fields (title, start/end, location, description, attendees, color) and an optional Google Meet link.",audience:"ai",aiMetadata:{description:'Create a new event on a calendar from explicit structured fields (title, start/end times, location, description, attendees, color, guest permissions) with an optional Google Meet link. Use this when you already have the event details; for a single natural-language phrase use the quick-add path instead. Resolve calendarId via google_calendar_list_calendars (default "primary"). Requires a title and start time; end defaults to 30 minutes after start. Not idempotent: each call creates a new event.',idempotent:!1},props:Fm,outputSchema:Ze,run:qm});var{eventId:fre,calendar_id:mre,guests_can_modify:hre,guests_can_invite_others:gre,guests_can_see_other_guests:yre,...yL}=Kc;function oh(t){return F.StaticDropdown({displayName:t,description:"Leave unset to keep the event's current value.",required:!1,options:{options:[{label:"True",value:"true"},{label:"False",value:"false"}]}})}o(oh,"guestPermissionProp");function ih(t){return t===void 0?void 0:t==="true"}o(ih,"toOptionalBoolean");var vL={calendar_id:Kc.calendar_id,event_id:F.ShortText({displayName:"Event ID",description:"The ID of the event to update. Resolve it via List Events or Search Events Across Calendars.",required:!0}),...yL,guests_can_modify:oh("Guests can modify"),guests_can_invite_others:oh("Guests can invite others"),guests_can_see_other_guests:oh("Guests can see other guests")},Fx=ve({auth:ne,name:"google_calendar_update_event",displayName:"Update Event",description:"Update fields of an existing Google Calendar event by ID using a safe get-then-merge; fields you leave unset keep their current values.",audience:"ai",aiMetadata:{description:"Update fields of an existing event (title, times, location, description, color, attendees, guest permissions) identified by calendar and event ID. It fetches the event first and merges, so unset fields keep their current values (it never blanks out attendees/recurrence/conferencing). Use this to edit or reschedule an existing event rather than recreating it. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Idempotent: applying the same field values repeatedly leaves the event in the same state.",idempotent:!0},props:vL,outputSchema:Ze,run:o(t=>Zm({...t,propsValue:{...t.propsValue,eventId:t.propsValue.event_id,guests_can_modify:ih(t.propsValue.guests_can_modify),guests_can_invite_others:ih(t.propsValue.guests_can_invite_others),guests_can_see_other_guests:ih(t.propsValue.guests_can_see_other_guests)}}),"run")});var _L={calendar_id:ae.calendarDropdown("writer"),event_id:F.ShortText({displayName:"Event ID",description:"The ID of the event to delete. Resolve it via List Events or Search Events Across Calendars.",required:!0})},qx=ve({auth:ne,name:"google_calendar_delete_event",displayName:"Delete Event",description:"Permanently delete an event from a Google Calendar by its event ID.",audience:"ai",aiMetadata:{description:"Permanently delete an event from a calendar, identified by calendar and event ID. Use to cancel or remove an existing event; this cannot be undone, so confirm the event ID first. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Idempotent: once deleted, re-running leaves the event absent (a repeat call may report it as already gone).",idempotent:!0},props:_L,run:o(t=>Bm({...t,propsValue:{calendar_id:t.propsValue.calendar_id,eventId:t.propsValue.event_id}}),"run")});var Bx=ve({auth:ne,name:"google_calendar_get_event",displayName:"Get Event",description:"Fetch the full details of a single Google Calendar event by its event ID.",audience:"ai",aiMetadata:{description:"Fetch the full details of one event by its unique event ID within a calendar. Use this when you already have an event ID (from a trigger or a list action) and need its current details; to find an event when you do not have its ID, use google_calendar_list_events or google_calendar_search_events_all_calendars instead. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Read-only and idempotent.",idempotent:!0},props:Xm,outputSchema:Ze,run:Qm});var Vx=ve({auth:ne,name:"google_calendar_list_events",displayName:"List Events",description:"List events from one Google Calendar, optionally filtered by date range, free-text search, and event types.",audience:"ai",aiMetadata:{description:`List events from one calendar, optionally narrowed by a date range, a free-text search term (matched with Google's native q= filter), and event types, optionally expanding recurring events into individual instances. Use this to browse or find events in a known calendar, including text search within that calendar; to search across every calendar when you do not know which one holds the event, use google_calendar_search_events_all_calendars instead. Resolve calendarId via google_calendar_list_calendars (default "primary"). Read-only and idempotent.`,idempotent:!0},props:Gm,outputSchema:Hc,run:Hm});var Gx=ve({auth:ne,name:"google_calendar_find_busy_periods",displayName:"Find Busy Periods",description:"Return the raw busy time blocks of one or more calendars within a window, via the freebusy query.",audience:"ai",aiMetadata:{description:"Query one or more calendars for their raw busy time blocks within a start/end window, without exposing event details (the low-level freebusy primitive). Use this when you need the busy intervals themselves (e.g. across several shared calendars); to get the inverse open slots directly, use google_calendar_find_free_slots instead. Resolve calendarId values via google_calendar_list_calendars. Requires the calendars to check and a time range. Read-only and idempotent.",idempotent:!0},props:Jm,outputSchema:Wc,run:Ym});var Hx=qe(xn());var Wx=ve({auth:ne,name:"google_calendar_remove_attendee",displayName:"Remove Attendee",description:"Remove one attendee (by email) from an existing Google Calendar event, preserving the rest of the guest list.",audience:"ai",aiMetadata:{description:"Remove a single attendee, matched by email, from an existing event by fetching the current attendee list, dropping that one guest, and patching the event. Use this to uninvite one person without disturbing the other guests; to add guests use the add-attendees action instead. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Not idempotent (notifications may fire), though re-removing an already-absent attendee is a no-op on state. It uses optimistic concurrency (If-Match on the event revision), so a simultaneous edit by someone else fails with a retry-able conflict instead of silently clobbering their change.",idempotent:!1},props:{calendar_id:ae.calendarDropdown("writer"),event_id:F.ShortText({displayName:"Event ID",description:"The ID of the event to remove the attendee from. Resolve it via List Events or Search Events Across Calendars.",required:!0}),attendee_email:F.ShortText({displayName:"Attendee Email",description:"Email address of the attendee to remove from the event.",required:!0}),send_updates:F.StaticDropdown({displayName:"Send Notifications",description:"Who should be notified about the attendee change.",required:!1,defaultValue:"none",options:{options:[{label:"To everyone",value:"all"},{label:"To external guests only",value:"externalOnly"},{label:"To no one",value:"none"}]}})},outputSchema:fx,async run(t){let{calendar_id:e,event_id:r,attendee_email:n,send_updates:i}=t.propsValue,s=await _t(t.auth),c=(0,Hx.calendar)({version:"v3",auth:s}),d=n.trim().toLowerCase();try{let p=await c.events.get({calendarId:e,eventId:r}),m=p.data.attendees??[],y=m.filter(l=>(l.email??"").trim().toLowerCase()!==d);if(y.length===m.length)return{removed:!1,attendee_email:n,message:`Attendee "${n}" was not on event "${r}"; nothing to remove.`,event:p.data};let h=p.data.etag??void 0,f=await c.events.patch({calendarId:e,eventId:r,sendUpdates:i??"none",requestBody:{attendees:y}},h?{headers:{"If-Match":h}}:{});return{removed:!0,attendee_email:n,event:f.data}}catch(p){let m=p.response?.status??p.code;throw m===412?new Error(`Event "${r}" changed since it was read (a concurrent edit). Re-run Remove Attendee to retry against the latest version.`):m===404?new Error(`Event "${r}" not found in calendar "${e}". Verify the event ID and calendar.`):m===403?new Error(`Access denied while editing event "${r}". The calendar must be writable.`):p}}});var Zx=qe(xn());var ah=qe(Sn()),Kx=ve({auth:ne,name:"google_calendar_import_event",displayName:"Import Event",description:"Import an existing event (by iCalUID) into a Google Calendar as a private copy, using events.import.",audience:"ai",aiMetadata:{description:'Import an existing event into a calendar as a private copy, keyed by its iCalUID with a start and end time (the events.import primitive, distinct from creating a brand-new event or moving one). Use this to copy or de-duplicate an event across calendars; re-importing the same iCalUID updates the existing copy rather than duplicating it. Resolve calendarId via google_calendar_list_calendars (default "primary"). Only default (non-special) events can be imported. Not idempotent: each import can create or mutate the destination copy.',idempotent:!1},props:{calendar_id:ae.calendarDropdown("writer"),ical_uid:F.ShortText({displayName:"iCal UID",description:`The event's iCalUID (its globally unique identifier, e.g. "abc123@google.com"). This is the dedup key: re-importing the same UID updates the existing copy.`,required:!0}),summary:F.ShortText({displayName:"Title",description:"Title (summary) of the imported event.",required:!0}),start_date_time:F.DateTime({displayName:"Start Time",description:'Event start as an ISO 8601 timestamp (e.g. "2026-06-01T09:00:00Z").',required:!0}),end_date_time:F.DateTime({displayName:"End Time",description:'Event end as an ISO 8601 timestamp (e.g. "2026-06-01T10:00:00Z").',required:!0}),location:F.ShortText({displayName:"Location",required:!1}),description:F.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1})},outputSchema:Ze,async run(t){let{calendar_id:e,ical_uid:r,summary:n,start_date_time:i,end_date_time:s,location:c,description:d}=t.propsValue,p=await _t(t.auth),m=(0,Zx.calendar)({version:"v3",auth:p});try{return(await m.events.import({calendarId:e,requestBody:{iCalUID:r,summary:n,location:c??void 0,description:d??void 0,start:{dateTime:(0,ah.default)(i).toISOString()},end:{dateTime:(0,ah.default)(s).toISOString()}}})).data}catch(y){let h=y.response?.status??y.code;throw h===403?new Error(`Access denied while importing into calendar "${e}". The calendar must be writable.`):h===400?new Error(`Invalid import request. Ensure iCalUID, start, and end are provided and that the event is a default (non-special) event. (${y.message})`):y}}});var Jx=ve({auth:ne,name:"google_calendar_list_calendars",displayName:"List Calendars",description:"List every calendar in the user's calendar list, returning each calendar's id, summary, access role, time zone, and whether it is primary.",audience:"ai",aiMetadata:{description:`List all calendars on the user's calendar list, returning each one's calendarId, summary, accessRole, timeZone, and whether it is the primary calendar. This is the calendarId resolver: call it first to discover which calendars exist and obtain the calendarId that every event/freebusy atomic needs (default "primary"). Read-only and idempotent.`,idempotent:!0},props:{},outputSchema:dx,async run(t){await Ie(t.auth);let e=await kt(t.auth);return{calendars:e.map(r=>({id:r.id,summary:r.summary,description:r.description,location:r.location,timeZone:r.timeZone,accessRole:r.accessRole,primary:r.primary??!1,selected:r.selected??!1,backgroundColor:r.backgroundColor,foregroundColor:r.foregroundColor})),count:e.length}}});var Yx=ve({auth:ne,name:"google_calendar_get_calendar",displayName:"Get Calendar",description:"Fetch one calendar's metadata (summary, time zone, description, location) by its calendar ID.",audience:"ai",aiMetadata:{description:`Fetch one calendar's metadata \u2014 summary, timeZone, description, and location \u2014 by its calendar ID. Use this to read a calendar's time zone, which is load-bearing when constructing correct event start/end windows. Resolve calendarId via google_calendar_list_calendars (default "primary"). Read-only and idempotent.`,idempotent:!0},props:{calendar_id:ae.calendarDropdown()},outputSchema:cx,async run(t){let{calendar_id:e}=t.propsValue,r=await Ie(t.auth),n={method:"GET",url:`${ae.baseUrl}/calendars/${encodeURIComponent(e)}`,authentication:{type:"BEARER_TOKEN",token:r}};try{return(await Ue.sendRequest(n)).body}catch(i){let s=i.response?.status;throw s===404?new Error(`Calendar "${e}" not found. Verify the calendar ID via List Calendars.`):s===403?new Error(`Access denied to calendar "${e}". Check your permissions.`):i}}});var Xx=ve({auth:ne,name:"google_calendar_get_colors",displayName:"Get Colors",description:"Fetch the Google Calendar color palette mapping colorId values to their hex background/foreground colors.",audience:"ai",aiMetadata:{description:"Fetch the global color palette: the mapping from each colorId to its background/foreground hex color, for both events and calendars. Use this to resolve a colorId before setting the color on google_calendar_create_event or google_calendar_update_event. Read-only and idempotent.",idempotent:!0},props:{},outputSchema:lx,async run(t){return await lu(t.auth)}});var Qx=ve({auth:ne,name:"google_calendar_list_settings",displayName:"List Settings",description:"List the user's Google Calendar account settings (time zone, week start, date/time format, and more).",audience:"ai",aiMetadata:{description:`List all of the user's Google Calendar account settings as id/value pairs \u2014 including the account "timezone", "weekStart", and "format24HourTime". Use this to read the account time zone to anchor relative-date reasoning before building event windows, or to read a single setting (just pick its id from the returned list). Read-only and idempotent.`,idempotent:!0},props:{},outputSchema:px,async run(t){let e=await Ie(t.auth),r={method:"GET",url:`${ae.baseUrl}/users/me/settings`,authentication:{type:"BEARER_TOKEN",token:e}},i=(await Ue.sendRequest(r)).body.items??[],s={};for(let c of i)s[c.id]=c.value;return{settings:s,items:i,count:i.length}}});var Yc="google_calendar_watch",Ci="google_calendar_sync_token",sh="google_calendar_seen_event_ids",bL=500;function eA(t,{event_types:e,search_filter:r,exclude_all_day:n}){if(e&&e.length>0){let i=t.eventType||"default";if(!e.includes(i))return!1}if(r&&r.trim()){let i=r.toLowerCase().trim(),s=(t.summary||"").toLowerCase(),c=(t.description||"").toLowerCase(),d=(t.location||"").toLowerCase();if(!(s.includes(i)||c.includes(i)||d.includes(i)))return!1}return!(n&&t.start?.date&&!t.start?.dateTime)}o(eA,"matchesFilters");var tA=jt({auth:ne,name:"new_event",displayName:"New Event",description:"Fires when a new event is created in a calendar.",aiMetadata:{description:"Fires when a brand-new event is created in the selected calendar (not on edits or cancellations), via Google push notifications. Each fired item is the new event; can be narrowed by event type, a text search across title/description/location, and an option to skip all-day events."},props:{calendar_id:ae.calendarDropdown("writer"),event_types:F.StaticMultiSelectDropdown({displayName:"Event Types to Monitor",description:"Filter by specific event types (leave empty to monitor all event types)",required:!1,options:{options:[{label:"Default Events",value:"default"},{label:"Birthday Events",value:"birthday"},{label:"Focus Time",value:"focusTime"},{label:"Out of Office",value:"outOfOffice"},{label:"Working Location",value:"workingLocation"},{label:"From Gmail",value:"fromGmail"}]}}),search_filter:F.ShortText({displayName:"Search Filter",description:"Only trigger for events containing this text in title, description, or location (optional)",required:!1}),exclude_all_day:F.Checkbox({displayName:"Exclude All-Day Events",description:"Skip triggering for all-day events",required:!1,defaultValue:!1})},outputSchema:Ze,type:"WEBHOOK",renewConfiguration:{strategy:"CRON",cronExpression:"0 */12 * * *"},sampleData:{kind:"calendar#event",etag:'"3419997894982000"',id:"sample_event_id_12345",status:"confirmed",htmlLink:"https://www.google.com/calendar/event?eid=c2FtcGxlX2V2ZW50X2lkXzEyMzQ1",created:"2025-08-15T11:02:27.000Z",updated:"2025-08-15T11:02:27.491Z",summary:"Team Sync",creator:{email:"creator@example.com"},organizer:{email:"creator@example.com",self:!0},start:{dateTime:"2025-08-18T10:00:00-07:00",timeZone:"America/Los_Angeles"},end:{dateTime:"2025-08-18T11:00:00-07:00",timeZone:"America/Los_Angeles"},iCalUID:"sample_event_id_12345@google.com",sequence:0,reminders:{useDefault:!0},eventType:"default"},async onEnable(t){let e=t.propsValue.calendar_id,r=t.auth,n=await zd(e,t.webhookUrl,r);await t.store.put(Yc,n);let i=await cu({calendarId:e,authProp:r});it(i)||await t.store.put(Ci,i)},async onDisable(t){let e=t.auth,r=await t.store.get(Yc);r&&await Nd(r,e),await t.store.delete(Ci),await t.store.delete(sh)},async onRenew(t){let e=t.propsValue.calendar_id,r=t.auth,n=await t.store.get(Yc);n&&await Nd(n,r);let i=await zd(e,t.webhookUrl,r);await t.store.put(Yc,i)},async run(t){let n=t.payload.headers["x-goog-resource-state"],i={event_types:t.propsValue.event_types,search_filter:t.propsValue.search_filter,exclude_all_day:t.propsValue.exclude_all_day};if(n==="sync")return[];if(n!=="exists")return[];let s=t.propsValue.calendar_id,c=t.auth,d=await t.store.get(Ci);if(it(d)){let g=await cu({calendarId:s,authProp:c});return it(g)||await t.store.put(Ci,g),[]}let{items:p,nextSyncToken:m,syncTokenInvalid:y}=await Mb({calendarId:s,syncToken:d,authProp:c});if(y){let g=await cu({calendarId:s,authProp:c});return it(g)||await t.store.put(Ci,g),[]}it(m)||await t.store.put(Ci,m);let h=await t.store.get(sh),f=new Set(h??[]),l=[];for(let g of p)!g.id||g.status==="cancelled"||f.has(g.id)||(f.add(g.id),eA(g,i)&&l.push(g));if(f.size!==(h?.length??0)){let g=Array.from(f).slice(-bL);await t.store.put(sh,g)}return l},async test(t){let e=t.auth,r={event_types:t.propsValue.event_types,search_filter:t.propsValue.search_filter,exclude_all_day:t.propsValue.exclude_all_day},n=await Lb(t.propsValue.calendar_id,e);return eA(n,r)?[n]:[]}});var Xc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{if(r===0)return[];let{calendar_id:n,specific_event:i,event_id:s}=e;if(!n)return[];if(i&&!s)return[];let c=[];if(i&&s){let m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events/${s}`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};try{let h=(await Ue.sendRequest(m)).body,f=h.end?.dateTime??h.end?.date;f&&new Date(f).getTime()>r&&(c=[h])}catch(y){return console.error("Error fetching specific event:",y),[]}}else{let m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)},queryParams:{singleEvents:"true",orderBy:"startTime",timeMin:new Date(r).toISOString()}};c=(await Ue.sendRequest(m)).body.items}let d=[],p=Date.now();for(let m of c){let y=m.end?.dateTime??m.end?.date;if(!y)continue;let h=new Date(y).getTime();h>r&&h<=p&&d.push({epochMilliSeconds:h,data:m})}return d},"items")},rA=jt({auth:ne,name:"event_ends",displayName:"Event Ends",description:"Fires when an event ends.",aiMetadata:{description:"Fires once an event in the selected calendar reaches its end time, detected by polling. Each fired item is the event that just ended. Can watch all events in the calendar or be scoped to a single specific event."},props:{calendar_id:ae.calendarDropdown("writer"),specific_event:F.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:ae.eventDropdown(!1)},outputSchema:Ze,type:"POLLING",sampleData:{kind:"calendar#event",etag:'"3419997894982000"',id:"sample_event_id_67890",status:"confirmed",htmlLink:"https://www.google.com/calendar/event?eid=c2FtcGxlX2V2ZW50X2lkXzY3ODkw",created:"2025-08-14T09:00:00.000Z",updated:"2025-08-14T09:00:00.000Z",summary:"Project Deadline",creator:{email:"manager@example.com"},organizer:{email:"manager@example.com",self:!0},start:{dateTime:"2025-08-14T14:30:00+05:30",timeZone:"Asia/Kolkata"},end:{dateTime:"2025-08-14T15:30:00+05:30",timeZone:"Asia/Kolkata"},iCalUID:"sample_event_id_67890@google.com",sequence:0,reminders:{useDefault:!0},eventType:"default"},async onEnable(t){await Je.onEnable(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var Qc={strategy:0,items:o(async({auth:t,propsValue:e})=>{let{calendar_id:r,specific_event:n,event_id:i,time_value:s,time_unit:c}=e;if(!r||!s||!c)return[];if(n&&!i)return[];let d=s*60*1e3;c==="hours"?d=s*60*60*1e3:c==="days"&&(d=s*24*60*60*1e3);let p=Date.now(),m=300*1e3,y=new Date(p+d).toISOString(),h=new Date(p+d+m).toISOString(),f=[];if(n&&i){let l={method:"GET",url:`${ae.baseUrl}/calendars/${r}/events/${i}`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};try{let v=(await Ue.sendRequest(l)).body,b=new Date(v.start?.dateTime??v.start?.date??0).getTime()-d;b>=p&&b<=p+m&&(f=[v])}catch(g){return console.error("Error fetching specific event:",g),[]}}else{let l={method:"GET",url:`${ae.baseUrl}/calendars/${r}/events`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)},queryParams:{singleEvents:"true",orderBy:"startTime",timeMin:y,timeMax:h}};f=(await Ue.sendRequest(l)).body.items}return f.map(l=>({epochMilliSeconds:new Date(l.start?.dateTime??l.start?.date??0).getTime()-d,data:l}))},"items")},nA=jt({auth:ne,name:"event_starts_in",displayName:"Event Start (Time Before)",description:"Fires at a specified amount of time before an event starts (e.g., a reminder).",aiMetadata:{description:"Fires a configurable lead time (in minutes, hours, or days) before an event in the selected calendar begins, acting as a pre-event reminder. Each fired item is the upcoming event. Can watch all events or a single specific event."},props:{calendar_id:ae.calendarDropdown("writer"),specific_event:F.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:ae.eventDropdown(!1),time_value:F.Number({displayName:"Time Before",description:"The amount of time before the event starts.",required:!0,defaultValue:15}),time_unit:F.StaticDropdown({displayName:"Time Unit",required:!0,options:{options:[{label:"Minutes",value:"minutes"},{label:"Hours",value:"hours"},{label:"Days",value:"days"}]},defaultValue:"minutes"})},outputSchema:Ze,type:"POLLING",sampleData:{},async onEnable(t){await Je.onEnable(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var el={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{calendar_id:n,search_term:i,event_types:s,search_fields:c}=e;if(!n||!i)return[];let d;r===0?(d=new Date,d.setDate(d.getDate()-1)):d=new Date(r);let p={singleEvents:"true",orderBy:"updated",updatedMin:d.toISOString(),q:i};s&&s.length>0&&s.forEach(l=>{p.eventTypes?p.eventTypes+="&eventTypes="+l:p.eventTypes=l});let m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)},queryParams:p};return(await Ue.sendRequest(m)).body.items.filter(l=>{let g=new Date(l.created??0).getTime();if(!(new Date(l.updated??0).getTime()-g<5e3))return!1;if(c&&c.length>0){let b=i.toLowerCase();return c.some(C=>{switch(C){case"summary":return l.summary?.toLowerCase().includes(b)||!1;case"description":return l.description?.toLowerCase().includes(b)||!1;case"location":return l.location?.toLowerCase().includes(b)||!1;case"attendees":return l.attendees?.some(U=>U.email?.toLowerCase().includes(b)||U.displayName?.toLowerCase().includes(b))||!1;default:return!1}})}return!0}).map(l=>({epochMilliSeconds:new Date(l.updated).getTime(),data:l}))},"items")},oA=jt({auth:ne,name:"new_event_matching_search",displayName:"New Event Matching Search",description:"Fires when a new event is created that matches a specified search term.",aiMetadata:{description:"Fires when a newly created event in the selected calendar matches a required search term (matched across title, description, location, and attendees by default, or restricted to chosen fields). Each fired item is the matching new event; can also be filtered by event type."},props:{calendar_id:ae.calendarDropdown("writer"),search_term:F.ShortText({displayName:"Search Term",description:"The keyword(s) to search for in new events (searches across title, description, location, and attendees by default).",required:!0}),event_types:F.StaticMultiSelectDropdown({displayName:"Event Types",description:"Filter by specific event types (optional)",required:!1,options:{options:[{label:"Default Events",value:"default"},{label:"Birthday Events",value:"birthday"},{label:"Focus Time",value:"focusTime"},{label:"Out of Office",value:"outOfOffice"},{label:"Working Location",value:"workingLocation"},{label:"From Gmail",value:"fromGmail"}]}}),search_fields:F.StaticMultiSelectDropdown({displayName:"Search In Fields",description:"Specify which fields to search in (leave empty to use Google's default search across all fields)",required:!1,options:{options:[{label:"Event Title/Summary",value:"summary"},{label:"Event Description",value:"description"},{label:"Event Location",value:"location"},{label:"Attendee Names/Emails",value:"attendees"}]}})},outputSchema:Ze,type:"POLLING",sampleData:{id:"abc123def456",summary:"Final Project Review",description:"Review of the Q3 final project deliverables.",status:"confirmed",created:"2025-08-14T09:05:00.000Z",updated:"2025-08-14T09:05:01.000Z",start:{dateTime:"2025-09-01T10:00:00-07:00"},end:{dateTime:"2025-09-01T11:30:00-07:00"},organizer:{email:"project.manager@example.com"}},async onEnable(t){await Je.onEnable(el,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(el,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(el,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(el,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var tl={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{calendar_id:n,specific_event:i,event_id:s,cancellation_reason:c}=e;if(!n)return[];if(i&&!s)return[];let d;r===0?(d=new Date,d.setDate(d.getDate()-1)):d=new Date(r);let p=[];if(i&&s){let m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events/${s}`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};try{let h=(await Ue.sendRequest(m)).body;new Date(h.updated??0).getTime()>r&&h.status==="cancelled"&&(p=[h])}catch(y){return console.error("Error fetching specific event:",y),[]}}else p=(await da(n,!0,t,d)).filter(y=>y.status==="cancelled");return c&&c.length>0&&(p=p.filter(m=>c.some(y=>{switch(y){case"deleted":return!m.summary||m.summary.includes("Deleted");case"declined":return m.attendees?.some(h=>h.responseStatus==="declined")||!1;case"rescheduled":return m.summary?.toLowerCase().includes("rescheduled")||m.description?.toLowerCase().includes("rescheduled")||!1;case"other":return!0;default:return!0}}))),p.map(m=>({epochMilliSeconds:new Date(m.updated).getTime(),data:m}))},"items")},iA=jt({auth:ne,name:"event_cancelled",displayName:"Event Cancelled",description:"Fires when an event is canceled or deleted.",aiMetadata:{description:"Fires when an event in the selected calendar transitions to a cancelled (or deleted) state, detected by polling. Each fired item is the cancelled event; can optionally be filtered by cancellation reason (deleted, attendee declined, rescheduled, other) and scoped to a single specific event."},props:{calendar_id:ae.calendarDropdown("writer"),specific_event:F.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:ae.eventDropdown(!1),cancellation_reason:F.StaticMultiSelectDropdown({displayName:"Cancellation Reasons",description:"Filter by specific types of cancellations (optional)",required:!1,options:{options:[{label:"Event Deleted",value:"deleted"},{label:"Attendee Declined",value:"declined"},{label:"Event Rescheduled",value:"rescheduled"},{label:"Other Cancellations",value:"other"}]}})},outputSchema:Ze,type:"POLLING",sampleData:{id:"abc123def456_cancelled",summary:"Cancelled: Q3 Planning Session",status:"cancelled",created:"2025-07-20T10:00:00.000Z",updated:"2025-08-14T09:30:00.000Z",organizer:{email:"project.manager@example.com"},start:{dateTime:"2025-08-25T10:00:00-07:00"},end:{dateTime:"2025-08-25T11:30:00-07:00"}},async onEnable(t){await Je.onEnable(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var uh={strategy:1,items:o(async({auth:t,store:e,propsValue:r})=>{let{access_role_filter:n,calendar_name_filter:i,exclude_shared:s}=r,d=await kt(t);if(n&&n.length>0&&(d=d.filter(f=>n.includes(f.accessRole))),i&&i.trim()){let f=i.toLowerCase().trim();d=d.filter(l=>l.summary?.toLowerCase().includes(f)||l.description?.toLowerCase().includes(f))}s&&(d=d.filter(f=>f.accessRole==="owner"||f.primary));let p=d.map(f=>f.id),m=await e.get("calendars")||[],y=new Set(m),h=d.filter(f=>!y.has(f.id));return await e.put("calendars",p),h.map(f=>({id:f.id,data:{...f,isOwned:f.accessRole==="owner"||f.primary,isShared:f.accessRole!=="owner"&&!f.primary,calendarType:f.primary?"primary":f.accessRole==="owner"?"owned":"shared"}}))},"items")},aA=jt({auth:ne,name:"new_calendar",displayName:"New Calendar",description:"Fires when a new calendar is created or becomes accessible.",aiMetadata:{description:"Fires when a calendar newly appears in the connected account's calendar list, whether created or shared in, detected by polling. Each fired item is the new calendar. Can be filtered by access role, a name/description text match, and an option to exclude shared calendars."},props:{access_role_filter:F.StaticMultiSelectDropdown({displayName:"Access Role Filter",description:"Only trigger for calendars with specific access roles (optional)",required:!1,options:{options:[{label:"Owner",value:"owner"},{label:"Writer",value:"writer"},{label:"Reader",value:"reader"},{label:"Free/Busy Reader",value:"freeBusyReader"}]}}),calendar_name_filter:F.ShortText({displayName:"Calendar Name Filter",description:"Only trigger for calendars containing this text in name or description (optional)",required:!1}),exclude_shared:F.Checkbox({displayName:"Exclude Shared Calendars",description:"Only trigger for calendars you own, not shared calendars",required:!1,defaultValue:!1})},outputSchema:sx,type:"POLLING",sampleData:{id:"sample_calendar_id@group.calendar.google.com",summary:"New Project Team Calendar",description:"A shared calendar for the new project team.",timeZone:"Asia/Kolkata",backgroundColor:"#9fe1e7",foregroundColor:"#000000",accessRole:"owner",isOwned:!0,isShared:!1,calendarType:"owned",primary:!1},async onEnable(t){let e=await kt(t.auth),{access_role_filter:r,calendar_name_filter:n,exclude_shared:i}=t.propsValue,s=e;if(r&&r.length>0&&(s=s.filter(c=>r.includes(c.accessRole))),n&&n.trim()){let c=n.toLowerCase().trim();s=s.filter(d=>d.summary?.toLowerCase().includes(c)||d.description?.toLowerCase().includes(c))}i&&(s=s.filter(c=>c.accessRole==="owner"||c.primary)),await t.store.put("calendars",s.map(c=>c.id)),await Je.onEnable(uh,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(uh,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(uh,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return(await kt(t.auth)).slice(-1).map(n=>({id:n.id,data:{...n,isOwned:n.accessRole==="owner"||n.primary,isShared:n.accessRole!=="owner"&&!n.primary,calendarType:n.primary?"primary":n.accessRole==="owner"?"owned":"shared"}}))}});var EL=Sv({minimumSupportedRelease:"0.86.4",logoUrl:"https://cdn.activepieces.com/pieces/google-calendar.png",categories:["PRODUCTIVITY"],displayName:"Google Calendar",description:"Get organized and stay on schedule",authors:["OsamaHaikal","bibhuty-did-this","Vitalini","pfernandez98","kishanprmr","MoShizzle","khaledmashaly","abuaboud","ikus060","Cloudieunnie","sanket-a11y","geekyme"],auth:ne,actions:[Rx,Ex,bx,Tx,xx,wx,Cx,Ox,kx,Nx,Ux,Lx,jx,Fx,qx,Bx,Vx,Gx,Wx,Kx,Jx,Yx,Xx,Qx,zb({auth:ne,baseUrl(){return ae.baseUrl},authMapping:o(async t=>({Authorization:`Bearer ${await Ie(t)}`}),"authMapping")})],triggers:[Ax,tA,rA,nA,oA,iA,aA]});0&&(module.exports={createGoogleClient,getAccessToken,googleCalendar,googleCalendarAuth});
|
|
68
|
+
`)}E+=v,e.data=E}if(o(y,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let l=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||c,body:n.body}];(0,Dm.isBrowser)()?y(l):m(l)}else r.uploadType="media",Object.assign(d,{"content-type":n.mimeType||c}),e.data=n.body;else e.data=i||void 0;if(e.headers=km.Gaxios.mergeHeaders(e.headers||{},d),e.params=r,!(0,Dm.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:YP.version,comment:"gzip"});let l=e.userAgentDirectives.map(g=>{let v=`${g.product}/${g.version}`;return g.comment&&(v+=` (${g.comment})`),v}).join(" ");e.headers.set("User-Agent",l)}if(e.validateStatus||(e.validateStatus=l=>l>=200&&l<300||l===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 h=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,f=e.universeDomain??e.universe_domain??h??"googleapis.com";if(f!=="googleapis.com"&&e.url){let l=new URL(e.url);l.hostname.endsWith(".googleapis.com")&&(l.hostname=l.hostname.replace(/googleapis\.com$/,f),e.url=l.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let l=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(l&&f!==l)throw new Error(`The configured universe domain (${f}) does not match the universe domain found in the credentials (${l}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let g=await s.getRequestHeaders(e.url),v=Object.assign({},e);return v.headers=km.Gaxios.mergeHeaders(v.headers,g),W1.request(v)}else{let g=await s.request(e);return(0,$m.marshallGaxiosResponse)(g)}}else return new km.Gaxios().request(e).then(l=>(0,$m.marshallGaxiosResponse)(l))}o(KP,"createAPIRequestAsync");var Nm=class extends JP.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 Y1(t,e){(0,Dm.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${YP.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(Y1,"populateAPIHeader")});var XP=D(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.AuthPlus=void 0;var Tn=Ba(),Um=class extends Tn.GoogleAuth{static{o(this,"AuthPlus")}JWT=Tn.JWT;Compute=Tn.Compute;OAuth2=Tn.OAuth2Client;GoogleAuth=Tn.GoogleAuth;AwsClient=Tn.AwsClient;IdentityPoolClient=Tn.IdentityPoolClient;ExternalAccountClient=Tn.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new Tn.GoogleAuth(e),this._cachedAuth.getClient()}getProjectId(e){return e?this._cachedAuth?this._cachedAuth.getProjectId(e):super.getProjectId(e):this._cachedAuth?this._cachedAuth.getProjectId():super.getProjectId()}};Fc.AuthPlus=Um});var Lm=D(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.Endpoint=void 0;var QP=jc(),Mm=class{static{o(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,i){if(this.applyMethodsFromSchema(e,r,n,i),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let c=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,c,i)}}}applyMethodsFromSchema(e,r,n,i){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let c=n.methods[s];e[s]=this.makeMethod(r,c,i)}}}makeMethod(e,r,n){return(i,s)=>{let c=typeof i=="function"?{}:i;s=typeof i=="function"?i:s;let d=ex(e.rootUrl+e.servicePath+r.path),p={options:{url:d.substring(1,d.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:c,requiredParams:r.parameterOrder||[],pathParams:this.getPathParams(r.parameters),context:n};if(r.mediaUpload&&r.mediaUpload.protocols&&r.mediaUpload.protocols.simple&&r.mediaUpload.protocols.simple.path){let m=ex(e.rootUrl+r.mediaUpload.protocols.simple.path);p.mediaUrl=m.substring(1,m.length-1)}if(!s)return(0,QP.createAPIRequest)(p);(0,QP.createAPIRequest)(p,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}};qc.Endpoint=Mm;function ex(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(ex,"buildurl")});var rx=D(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.Discovery=void 0;var X1=require("fs"),Q1=ht(),eL=require("url"),tx=require("util"),tL=jc(),rL=Lm(),nL=tx.promisify(X1.readFile),jm=class{static{o(this,"Discovery")}transporter=new Q1.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new rL.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 p=>{let m=await this.discoverAPI(p.discoveryRestUrl);return{api:p,endpointCreator:m}})),c={},d={};for(let p of s)d[p.api.name]||(c[p.api.name]={},d[p.api.name]=m=>{let y=typeof m,h;if(y==="string")h=m,m={};else if(y==="object")h=m.version,delete m.version;else throw new Error("Argument error: Accepts only string or object");try{let f=p.endpointCreator(m,this);return Object.freeze(f)}catch(f){throw new Error(tx.format('Unable to load endpoint %s("%s"): %s',p.api.name,h,f.message))}}),c[p.api.name][p.api.version]=p.endpointCreator;return d}async discoverAPI(e){if(typeof e=="string"){let r=eL.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await nL(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,tL.createAPIRequest)(i);return this.makeEndpoint(s.data)}}};Bc.Discovery=jm});var Vc=D(Re=>{"use strict";var oL=Re&&Re.__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]})),iL=Re&&Re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oL(e,t,r)};Object.defineProperty(Re,"__esModule",{value:!0});Re.Endpoint=Re.Discovery=Re.AuthPlus=Re.createAPIRequest=Re.getAPI=Re.GaxiosError=Re.Gaxios=Re.AwsClient=Re.IdentityPoolClient=Re.BaseExternalAccountClient=Re.ExternalAccountClient=Re.GoogleAuth=Re.UserRefreshClient=Re.Compute=Re.JWT=Re.OAuth2Client=Re.gaxios=Re.googleAuthLibrary=void 0;Re.googleAuthLibrary=Ba();Re.gaxios=ht();var Pn=Ba();Object.defineProperty(Re,"OAuth2Client",{enumerable:!0,get:o(function(){return Pn.OAuth2Client},"get")});Object.defineProperty(Re,"JWT",{enumerable:!0,get:o(function(){return Pn.JWT},"get")});Object.defineProperty(Re,"Compute",{enumerable:!0,get:o(function(){return Pn.Compute},"get")});Object.defineProperty(Re,"UserRefreshClient",{enumerable:!0,get:o(function(){return Pn.UserRefreshClient},"get")});Object.defineProperty(Re,"GoogleAuth",{enumerable:!0,get:o(function(){return Pn.GoogleAuth},"get")});Object.defineProperty(Re,"ExternalAccountClient",{enumerable:!0,get:o(function(){return Pn.ExternalAccountClient},"get")});Object.defineProperty(Re,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return Pn.BaseExternalAccountClient},"get")});Object.defineProperty(Re,"IdentityPoolClient",{enumerable:!0,get:o(function(){return Pn.IdentityPoolClient},"get")});Object.defineProperty(Re,"AwsClient",{enumerable:!0,get:o(function(){return Pn.AwsClient},"get")});var nx=ht();Object.defineProperty(Re,"Gaxios",{enumerable:!0,get:o(function(){return nx.Gaxios},"get")});Object.defineProperty(Re,"GaxiosError",{enumerable:!0,get:o(function(){return nx.GaxiosError},"get")});var aL=WT();Object.defineProperty(Re,"getAPI",{enumerable:!0,get:o(function(){return aL.getAPI},"get")});var sL=jc();Object.defineProperty(Re,"createAPIRequest",{enumerable:!0,get:o(function(){return sL.createAPIRequest},"get")});var uL=XP();Object.defineProperty(Re,"AuthPlus",{enumerable:!0,get:o(function(){return uL.AuthPlus},"get")});var cL=rx();Object.defineProperty(Re,"Discovery",{enumerable:!0,get:o(function(){return cL.Discovery},"get")});var lL=Lm();Object.defineProperty(Re,"Endpoint",{enumerable:!0,get:o(function(){return lL.Endpoint},"get")});iL(Lc(),Re)});var ix=D(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.calendar_v3=void 0;var oe=Vc(),ox;(function(t){class e{static{o(this,"Calendar")}context;acl;calendarList;calendars;channels;colors;events;freebusy;settings;constructor(h,f){this.context={_options:h||{},google:f},this.acl=new r(this.context),this.calendarList=new n(this.context),this.calendars=new i(this.context),this.channels=new s(this.context),this.colors=new c(this.context),this.events=new d(this.context),this.freebusy=new p(this.context),this.settings=new m(this.context)}}t.Calendar=e;class r{static{o(this,"Resource$Acl")}context;constructor(h){this.context=h}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl/{ruleId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId","ruleId"],pathParams:["calendarId","ruleId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/acl/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Acl=r;class n{static{o(this,"Resource$Calendarlist")}context;constructor(h){this.context=h}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/calendarList/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Calendarlist=n;class i{static{o(this,"Resource$Calendars")}context;constructor(h){this.context=h}clear(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/clear").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Calendars=i;class s{static{o(this,"Resource$Channels")}context;constructor(h){this.context=h}stop(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/channels/stop").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Channels=s;class c{static{o(this,"Resource$Colors")}context;constructor(h){this.context=h}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/colors").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Colors=c;class d{static{o(this,"Resource$Events")}context;constructor(h){this.context=h}delete(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}import(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/import").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}insert(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}instances(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}/instances").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}move(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}/move").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId","destination"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}patch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}quickAdd(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/quickAdd").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId","text"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}update(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/{eventId}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},v),params:g,requiredParams:["calendarId","eventId"],pathParams:["calendarId","eventId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/calendars/{calendarId}/events/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:["calendarId"],pathParams:["calendarId"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Events=d;class p{static{o(this,"Resource$Freebusy")}context;constructor(h){this.context=h}query(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/freeBusy").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Freebusy=p;class m{static{o(this,"Resource$Settings")}context;constructor(h){this.context=h}get(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/settings/{setting}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:["setting"],pathParams:["setting"],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}list(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/settings").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}watch(h,f,l){let g=h||{},v=f||{};typeof h=="function"&&(l=h,g={},v={}),typeof f=="function"&&(l=f,v={});let E=v.rootUrl||"https://www.googleapis.com/",b={options:Object.assign({url:(E+"/calendar/v3/users/me/settings/watch").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},v),params:g,requiredParams:[],pathParams:[],context:this.context};if(l)(0,oe.createAPIRequest)(b,l);else return(0,oe.createAPIRequest)(b)}}t.Resource$Settings=m})(ox||(Gc.calendar_v3=ox={}))});var xn=D(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.AuthPlus=Er.calendar_v3=Er.auth=Er.VERSIONS=void 0;Er.calendar=dL;var ax=Vc(),sx=ix();Object.defineProperty(Er,"calendar_v3",{enumerable:!0,get:o(function(){return sx.calendar_v3},"get")});Er.VERSIONS={v3:sx.calendar_v3.Calendar};function dL(t){return(0,ax.getAPI)("calendar",t,Er.VERSIONS,this)}o(dL,"calendar");var pL=new ax.AuthPlus;Er.auth=pL;var fL=Vc();Object.defineProperty(Er,"AuthPlus",{enumerable:!0,get:o(function(){return fL.AuthPlus},"get")})});var Dx=D((th,rh)=>{(function(t,e){typeof th=="object"&&typeof rh<"u"?rh.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_utc=e()})(th,(function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,s){var c=i.prototype;s.utc=function(l){var g={date:l,utc:!0,args:arguments};return new i(g)},c.utc=function(l){var g=s(this.toDate(),{locale:this.$L,utc:!0});return l?g.add(this.utcOffset(),t):g},c.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var d=c.parse;c.parse=function(l){l.utc&&(this.$u=!0),this.$utils().u(l.$offset)||(this.$offset=l.$offset),d.call(this,l)};var p=c.init;c.init=function(){if(this.$u){var l=this.$d;this.$y=l.getUTCFullYear(),this.$M=l.getUTCMonth(),this.$D=l.getUTCDate(),this.$W=l.getUTCDay(),this.$H=l.getUTCHours(),this.$m=l.getUTCMinutes(),this.$s=l.getUTCSeconds(),this.$ms=l.getUTCMilliseconds()}else p.call(this)};var m=c.utcOffset;c.utcOffset=function(l,g){var v=this.$utils().u;if(v(l))return this.$u?0:v(this.$offset)?m.call(this):this.$offset;if(typeof l=="string"&&(l=(function(U){U===void 0&&(U="");var J=U.match(e);if(!J)return null;var Z=(""+J[0]).match(r)||["-",0,0],H=Z[0],K=60*+Z[1]+ +Z[2];return K===0?0:H==="+"?K:-K})(l),l===null))return this;var E=Math.abs(l)<=16?60*l:l,b=this;if(g)return b.$offset=E,b.$u=l===0,b;if(l!==0){var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(b=this.local().add(E+C,t)).$offset=E,b.$x.$localOffset=C}else b=this.utc();return b};var y=c.format;c.format=function(l){var g=l||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,g)},c.valueOf=function(){var l=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*l},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var h=c.toDate;c.toDate=function(l){return l==="s"&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var f=c.diff;c.diff=function(l,g,v){if(l&&this.$u===l.$u)return f.call(this,l,g,v);var E=this.local(),b=s(l).local();return f.call(E,b,g,v)}}}))});var TL={};Is(TL,{createGoogleClient:()=>_t,getAccessToken:()=>Ie,googleCalendar:()=>wL,googleCalendarAuth:()=>ne});module.exports=ZI(TL);var KI=Object.freeze({status:"aborted"});function le(t,e,r){function n(d,p){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:p,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(t))return;d._zod.traits.add(t),e(d,p);let m=c.prototype,y=Object.keys(m);for(let h=0;h<y.length;h++){let f=y[h];f in d||(d[f]=m[f].bind(d))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(d){var p;let m=r?.Parent?new s:this;n(m,d),(p=m._zod).deferred??(p.deferred=[]);for(let y of m._zod.deferred)y();return m}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}o(le,"$constructor");var Mr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Rs=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Rl={};function ln(t){return t&&Object.assign(Rl,t),Rl}o(ln,"config");function Ol(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(Ol,"getEnumValues");function fg(t,e){return typeof e=="bigint"?e.toString():e}o(fg,"jsonStringifyReplacer");function Os(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Os,"cached");function mg(t){return t==null}o(mg,"nullish");function ks(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(ks,"cleanRegex");var pg=Symbol("evaluating");function gt(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==pg)return n===void 0&&(n=pg,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(gt,"defineLazy");var kl="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ji(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(ji,"isObject");var JI=Os(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function hg(t){if(ji(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(ji(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(hg,"isPlainObject");var gg=new Set(["string","number","symbol"]);function qo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(qo,"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 st(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(st,"normalizeParams");function yg(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(yg,"optionalKeys");var vg={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 Bo(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(Bo,"aborted");function Nn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(Nn,"prefixIssues");function Cs(t){return typeof t=="string"?t:t?.message}o(Cs,"unwrapMessage");function zn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=Cs(t.inst?._zod.def?.error?.(t))??Cs(e?.error?.(t))??Cs(r.customError?.(t))??Cs(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(zn,"finalizeIssue");function _g(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(_g,"getLengthableOrigin");function $l(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o($l,"issue");var bg=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,fg,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),Eg=le("$ZodError",bg),Fi=le("$ZodError",bg,{Parent:Error});var XI=o(t=>(e,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new Mr;if(c.issues.length){let d=new(i?.Err??t)(c.issues.map(p=>zn(p,s,ln())));throw kl(d,i?.callee),d}return c.value},"_parse"),Ds=XI(Fi),QI=o(t=>async(e,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??t)(c.issues.map(p=>zn(p,s,ln())));throw kl(d,i?.callee),d}return c.value},"_parseAsync"),Ns=QI(Fi),eR=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 Mr;return s.issues.length?{success:!1,error:new(t??Eg)(s.issues.map(c=>zn(c,i,ln())))}:{success:!0,data:s.value}},"_safeParse"),qi=eR(Fi),tR=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>zn(c,i,ln())))}:{success:!0,data:s.value}},"_safeParseAsync"),Bi=tR(Fi);var rR="(?:(?:\\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])))",nR=new RegExp(`^${rR}$`);var Sg=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),wg=/^-?\d+n?$/,Tg=/^-?\d+$/,Dl=/^-?\d+(?:\.\d+)?$/,Pg=/^(?:true|false)$/i;var Un=le("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),oR={number:"number",bigint:"bigint",object:"date"};var xg=le("$ZodCheckGreaterThan",(t,e)=>{Un.init(t,e);let r=oR[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 Ag=le("$ZodCheckNumberFormat",(t,e)=>{Un.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,s]=vg[e.format];t._zod.onattach.push(c=>{let d=c._zod.bag;d.format=e.format,d.minimum=i,d.maximum=s,r&&(d.pattern=Tg)}),t._zod.check=c=>{let d=c.value;if(r){if(!Number.isInteger(d)){c.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:d,inst:t});return}if(!Number.isSafeInteger(d)){d>0?c.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):c.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}d<i&&c.issues.push({origin:"number",input:d,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),d>s&&c.issues.push({origin:"number",input:d,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var Ig=le("$ZodCheckMinLength",(t,e)=>{var r;Un.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!mg(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let c=_g(i);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var Nl=le("$ZodCheckStringFormat",(t,e)=>{var r,n;Un.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=()=>{})}),Rg=le("$ZodCheckRegex",(t,e)=>{Nl.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 Og={major:4,minor:3,patch:6};var dt=le("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Og;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let s of i._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=o((c,d,p)=>{let m=Bo(c),y;for(let h of d){if(h._zod.def.when){if(!h._zod.def.when(c))continue}else if(m)continue;let f=c.issues.length,l=h._zod.check(c);if(l instanceof Promise&&p?.async===!1)throw new Mr;if(y||l instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await l,c.issues.length!==f&&(m||(m=Bo(c,f)))});else{if(c.issues.length===f)continue;m||(m=Bo(c,f))}}return y?y.then(()=>c):c},"runChecks"),s=o((c,d,p)=>{if(Bo(c))return c.aborted=!0,c;let m=i(d,n,p);if(m instanceof Promise){if(p.async===!1)throw new Mr;return m.then(y=>t._zod.parse(y,p))}return t._zod.parse(m,p)},"handleCanaryResult");t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){let m=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(y=>s(y,c,d)):s(m,c,d)}let p=t._zod.parse(c,d);if(p instanceof Promise){if(d.async===!1)throw new Mr;return p.then(m=>i(m,n,d))}return i(p,n,d)}}gt(t,"~standard",()=>({validate:o(i=>{try{let s=qi(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Bi(t,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ms=le("$ZodString",(t,e)=>{dt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Sg(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}}),zl=le("$ZodStringFormat",(t,e)=>{Nl.init(t,e),Ms.init(t,e)});var zg=le("$ZodURL",(t,e)=>{zl.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 Ul=le("$ZodNumber",(t,e)=>{dt.init(t,e),t._zod.pattern=t._zod.bag.pattern??Dl,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}}),Ug=le("$ZodNumberFormat",(t,e)=>{Ag.init(t,e),Ul.init(t,e)}),Ml=le("$ZodBoolean",(t,e)=>{dt.init(t,e),t._zod.pattern=Pg,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}}),Mg=le("$ZodBigInt",(t,e)=>{dt.init(t,e),t._zod.pattern=wg,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 Lg=le("$ZodAny",(t,e)=>{dt.init(t,e),t._zod.parse=r=>r}),jg=le("$ZodUnknown",(t,e)=>{dt.init(t,e),t._zod.parse=r=>r});var Fg=le("$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}}),qg=le("$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 kg(t,e,r){t.issues.length&&e.issues.push(...Nn(r,t.issues)),e.value[r]=t.value}o(kg,"handleArrayResult");var Bg=le("$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 c=0;c<i.length;c++){let d=i[c],p=e.element._zod.run({value:d,issues:[]},n);p instanceof Promise?s.push(p.then(m=>kg(m,r,c))):kg(p,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Us(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...Nn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(Us,"handlePropertyResult");function iR(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=yg(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(iR,"normalizeDef");function aR(t,e,r,n,i,s){let c=[],d=i.keySet,p=i.catchall._zod,m=p.def.type,y=p.optout==="optional";for(let h in e){if(d.has(h))continue;if(m==="never"){c.push(h);continue}let f=p.run({value:e[h],issues:[]},n);f instanceof Promise?t.push(f.then(l=>Us(l,r,h,e,y))):Us(f,r,h,e,y)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}o(aR,"handleCatchall");var Vg=le("$ZodObject",(t,e)=>{if(dt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let d=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let p={...d};return Object.defineProperty(e,"shape",{value:p}),p},"get")})}let n=Os(()=>iR(e));gt(t._zod,"propValues",()=>{let d=e.shape,p={};for(let m in d){let y=d[m]._zod;if(y.values){p[m]??(p[m]=new Set);for(let h of y.values)p[m].add(h)}}return p});let i=ji,s=e.catchall,c;t._zod.parse=(d,p)=>{c??(c=n.value);let m=d.value;if(!i(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),d;d.value={};let y=[],h=c.shape;for(let f of c.keys){let l=h[f],g=l._zod.optout==="optional",v=l._zod.run({value:m[f],issues:[]},p);v instanceof Promise?y.push(v.then(E=>Us(E,d,f,m,g))):Us(v,d,f,m,g)}return s?aR(y,m,d,p,n.value,t):y.length?Promise.all(y).then(()=>d):d}});function $g(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=>!Bo(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>zn(c,n,ln())))}),e)}o($g,"handleUnionResults");var Ll=le("$ZodUnion",(t,e)=>{dt.init(t,e),gt(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),gt(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),gt(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),gt(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=>ks(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,d=[];for(let p of e.options){let m=p._zod.run({value:i.value,issues:[]},s);if(m instanceof Promise)d.push(m),c=!0;else{if(m.issues.length===0)return m;d.push(m)}}return c?Promise.all(d).then(p=>$g(p,i,t,s)):$g(d,i,t,s)}});var Gg=le("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Ll.init(t,e);let r=t._zod.parse;gt(t._zod,"propValues",()=>{let i={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[d,p]of Object.entries(c)){i[d]||(i[d]=new Set);for(let m of p)i[d].add(m)}}return i});let n=Os(()=>{let i=e.options,s=new Map;for(let c of i){let d=c._zod.propValues?.[e.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let p of d){if(s.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);s.set(p,c)}}return s});t._zod.parse=(i,s)=>{let c=i.value;if(!ji(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),i;let d=n.value.get(c?.[e.discriminator]);return d?d._zod.run(i,s):e.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:c,path:[e.discriminator],inst:t}),i)}});var Hg=le("$ZodRecord",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!hg(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let s=[],c=e.keyType._zod.values;if(c){r.value={};let d=new Set;for(let m of c)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){d.add(typeof m=="number"?m.toString():m);let y=e.valueType._zod.run({value:i[m],issues:[]},n);y instanceof Promise?s.push(y.then(h=>{h.issues.length&&r.issues.push(...Nn(m,h.issues)),r.value[m]=h.value})):(y.issues.length&&r.issues.push(...Nn(m,y.issues)),r.value[m]=y.value)}let p;for(let m in i)d.has(m)||(p=p??[],p.push(m));p&&p.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:p})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let p=e.keyType._zod.run({value:d,issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&Dl.test(d)&&p.issues.length){let h=e.keyType._zod.run({value:Number(d),issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(p=h)}if(p.issues.length){e.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(h=>zn(h,n,ln())),input:d,path:[d],inst:t});continue}let y=e.valueType._zod.run({value:i[d],issues:[]},n);y instanceof Promise?s.push(y.then(h=>{h.issues.length&&r.issues.push(...Nn(d,h.issues)),r.value[p.value]=h.value})):(y.issues.length&&r.issues.push(...Nn(d,y.issues)),r.value[p.value]=y.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Wg=le("$ZodEnum",(t,e)=>{dt.init(t,e);let r=Ol(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>gg.has(typeof i)).map(i=>typeof i=="string"?qo(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:t}),i}}),Zg=le("$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"?qo(n):n?qo(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 Kg=le("$ZodTransform",(t,e)=>{dt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Rs(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new Mr;return r.value=i,r}});function Dg(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(Dg,"handleOptionalResult");var Jg=le("$ZodOptional",(t,e)=>{dt.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(`^(${ks(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=>Dg(s,r.value)):Dg(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var Yg=le("$ZodNullable",(t,e)=>{dt.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(`^(${ks(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 Xg=le("$ZodPipe",(t,e)=>{dt.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(c=>zs(c,e.in,n)):zs(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>zs(s,e.out,n)):zs(i,e.out,n)}});function zs(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(zs,"handlePipeResult");var Qg=le("$ZodCustom",(t,e)=>{Un.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=>Ng(s,r,n,t));Ng(i,r,n,t)}});function Ng(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($l(i))}}o(Ng,"handleRefineResult");var ty;var jl=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 ry(){return new jl}o(ry,"registry");(ty=globalThis).__zod_globalRegistry??(ty.__zod_globalRegistry=ry());var Fl=globalThis.__zod_globalRegistry;function ny(t,e){return new t({type:"string",...st(e)})}o(ny,"_string");function oy(t,e){return new t({type:"string",coerce:!0,...st(e)})}o(oy,"_coercedString");function iy(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...st(e)})}o(iy,"_url");function ay(t,e){return new t({type:"number",checks:[],...st(e)})}o(ay,"_number");function sy(t,e){return new t({type:"number",coerce:!0,checks:[],...st(e)})}o(sy,"_coercedNumber");function uy(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...st(e)})}o(uy,"_int");function cy(t,e){return new t({type:"boolean",...st(e)})}o(cy,"_boolean");function ly(t,e){return new t({type:"boolean",coerce:!0,...st(e)})}o(ly,"_coercedBoolean");function dy(t,e){return new t({type:"bigint",coerce:!0,...st(e)})}o(dy,"_coercedBigint");function py(t){return new t({type:"any"})}o(py,"_any");function fy(t){return new t({type:"unknown"})}o(fy,"_unknown");function my(t,e){return new t({type:"void",...st(e)})}o(my,"_void");function hy(t,e){return new t({type:"date",coerce:!0,...st(e)})}o(hy,"_coercedDate");function Ls(t,e){return new xg({check:"greater_than",...st(e),value:t,inclusive:!0})}o(Ls,"_gte");function xr(t,e){return new Ig({check:"min_length",...st(e),minimum:t})}o(xr,"_minLength");function Mn(t,e){return new Rg({check:"string_format",format:"regex",...st(e),pattern:t})}o(Mn,"_regex");function gy(t,e,r){let n=st(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(gy,"_custom");var yt=le("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)=>Ds(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>qi(t,r,n),t.parseAsync=async(r,n)=>Ns(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Bi(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=le("ZodMiniString",(t,e)=>{Ms.init(t,e),yt.init(t,e)});function w(t){return ny(Fs,t)}o(w,"string");var yy=le("ZodMiniStringFormat",(t,e)=>{zl.init(t,e),Fs.init(t,e)});var _R=le("ZodMiniURL",(t,e)=>{zg.init(t,e),yy.init(t,e)});function vy(t){return iy(_R,t)}o(vy,"url");var qs=le("ZodMiniNumber",(t,e)=>{Ul.init(t,e),yt.init(t,e)});function Nt(t){return ay(qs,t)}o(Nt,"number");var bR=le("ZodMiniNumberFormat",(t,e)=>{Ug.init(t,e),qs.init(t,e)});function _y(t){return uy(bR,t)}o(_y,"int");var ql=le("ZodMiniBoolean",(t,e)=>{Ml.init(t,e),yt.init(t,e)});function Ve(t){return cy(ql,t)}o(Ve,"boolean");var by=le("ZodMiniBigInt",(t,e)=>{Mg.init(t,e),yt.init(t,e)});var ER=le("ZodMiniAny",(t,e)=>{Lg.init(t,e),yt.init(t,e)});function Gi(){return py(ER)}o(Gi,"any");var SR=le("ZodMiniUnknown",(t,e)=>{jg.init(t,e),yt.init(t,e)});function we(){return fy(SR)}o(we,"unknown");var wR=le("ZodMiniVoid",(t,e)=>{Fg.init(t,e),yt.init(t,e)});function Ey(t){return my(wR,t)}o(Ey,"_void");var Sy=le("ZodMiniDate",(t,e)=>{qg.init(t,e),yt.init(t,e)});var TR=le("ZodMiniArray",(t,e)=>{Bg.init(t,e),yt.init(t,e)});function Oe(t,e){return new TR({type:"array",element:t,...st(e)})}o(Oe,"array");var PR=le("ZodMiniObject",(t,e)=>{Vg.init(t,e),yt.init(t,e),gt(t,"shape",()=>e.shape)});function k(t,e){let r={type:"object",shape:t??{},...st(e)};return new PR(r)}o(k,"object");var xR=le("ZodMiniUnion",(t,e)=>{Ll.init(t,e),yt.init(t,e)});function ke(t,e){return new xR({type:"union",options:t,...st(e)})}o(ke,"union");var AR=le("ZodMiniDiscriminatedUnion",(t,e)=>{Gg.init(t,e),yt.init(t,e)});function Ln(t,e,r){return new AR({type:"union",options:e,discriminator:t,...st(r)})}o(Ln,"discriminatedUnion");var IR=le("ZodMiniRecord",(t,e)=>{Hg.init(t,e),yt.init(t,e)});function Te(t,e,r){return new IR({type:"record",keyType:t,valueType:e,...st(r)})}o(Te,"record");var RR=le("ZodMiniEnum",(t,e)=>{Wg.init(t,e),yt.init(t,e),t.options=Object.values(e.entries)});function ze(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new RR({type:"enum",entries:r,...st(e)})}o(ze,"_enum");var CR=le("ZodMiniLiteral",(t,e)=>{Zg.init(t,e),yt.init(t,e)});function ge(t,e){return new CR({type:"literal",values:Array.isArray(t)?t:[t],...st(e)})}o(ge,"literal");var OR=le("ZodMiniTransform",(t,e)=>{Kg.init(t,e),yt.init(t,e)});function jn(t){return new OR({type:"transform",transform:t})}o(jn,"transform");var kR=le("ZodMiniOptional",(t,e)=>{Jg.init(t,e),yt.init(t,e)});function W(t){return new kR({type:"optional",innerType:t})}o(W,"optional");var $R=le("ZodMiniNullable",(t,e)=>{Yg.init(t,e),yt.init(t,e)});function Hi(t){return new $R({type:"nullable",innerType:t})}o(Hi,"nullable");var DR=le("ZodMiniPipe",(t,e)=>{Xg.init(t,e),yt.init(t,e)});function Fn(t,e){return new DR({type:"pipe",in:t,out:e})}o(Fn,"pipe");var NR=le("ZodMiniCustom",(t,e)=>{Qg.init(t,e),yt.init(t,e)});function Bs(t,e){return gy(NR,t??(()=>!0),e)}o(Bs,"custom");var Wi={};Is(Wi,{bigint:()=>FR,boolean:()=>jR,date:()=>qR,number:()=>LR,string:()=>MR});function MR(t){return oy(Fs,t)}o(MR,"string");function LR(t){return sy(qs,t)}o(LR,"number");function jR(t){return ly(ql,t)}o(jR,"boolean");function FR(t){return dy(by,t)}o(FR,"bigint");function qR(t){return hy(Sy,t)}o(qR,"date");var Vl=k({retryOnFailure:k({defaultValue:W(Ve()),hide:W(Ve())}),continueOnFailure:k({defaultValue:W(Ve()),hide:W(Ve())})}),Bl=class{constructor(e,r,n,i,s,c,d,p,m,y,h){this.name=e;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=d;this.errorHandlingOptions=p;this.outputSchema=m;this.audience=y;this.aiMetadata=h}static{o(this,"IAction")}},ve=o(t=>new Bl(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 Ge=k({displayName:w(),description:W(w())}),$e=o((t,e)=>k({type:ge(e),required:Ve(),defaultValue:W(Gi())}),"TPropertyValue");var Kt=k({...Ge.shape,...$e(w(),"SHORT_TEXT").shape}),dn=k({...Ge.shape,...$e(w(),"LONG_TEXT").shape});var Ty=k({label:w(),value:we()}),Vs=k({disabled:W(Ve()),placeholder:W(w()),options:Oe(Ty)});var Jt=k({...Ge.shape,options:Vs,...$e(we(),"STATIC_DROPDOWN").shape}),pn=k({...Ge.shape,options:Vs,...$e(Oe(we()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Gl=k({...Ge.shape,...$e(we(),"DROPDOWN").shape,refreshers:Oe(w())}),Zi=k({...Ge.shape,...$e(Oe(we()),"MULTI_SELECT_DROPDOWN").shape,refreshers:Oe(w())});var fn=k({...Ge.shape,...$e(Ve(),"CHECKBOX").shape});var mn=k({...Ge.shape,...$e(Nt(),"NUMBER").shape});var Ki=k({...Ge.shape,streaming:W(Ve()),...$e(we(),"FILE").shape});var Ji=k({...Ge.shape,...$e(w(),"DATE_TIME").shape});var Py=Te(w(),ke([Kt,dn,Jt,Zi,pn,fn,mn,Ki,Ji])),Yi=k({...Ge.shape,properties:Py,...$e(Oe(we()),"ARRAY").shape});var Xi=k({...Ge.shape,...$e(ke([Te(w(),we())]),"JSON").shape});var xy=ke([Kt,Jt,Xi,Yi,pn]),VR=Te(w(),xy),Hl=k({refreshers:Oe(w()),...Ge.shape,...$e(we(),"DYNAMIC").shape});var Gs=k({...Ge.shape,...$e(Ey(),"MARKDOWN").shape});var Qi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Qi||{}),Vo=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Vo||{}),Go=(b=>(b.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",b.COMMUNICATION="COMMUNICATION",b.COMMERCE="COMMERCE",b.CORE="CORE",b.UNIVERSAL_AI="UNIVERSAL_AI",b.FLOW_CONTROL="FLOW_CONTROL",b.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",b.ACCOUNTING="ACCOUNTING",b.PRODUCTIVITY="PRODUCTIVITY",b.CONTENT_AND_FILES="CONTENT_AND_FILES",b.DEVELOPER_TOOLS="DEVELOPER_TOOLS",b.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",b.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",b.HUMAN_RESOURCES="HUMAN_RESOURCES",b.PAYMENT_PROCESSING="PAYMENT_PROCESSING",b.MARKETING="MARKETING",b.SALES_AND_CRM="SALES_AND_CRM",b))(Go||{});var ea=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ea||{}),Wl="both_client_credentials_and_authorization_code";var Lt=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Lt||{}),ta=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(ta||{}),GR=k({strategy:ze(ta),paramName:W(w())}),ra=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ra||{});var Hs=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Hs||{}),Ay=k({status:W(Nt()),body:W(we()),headers:W(Te(w(),w()))}),Iy=k({type:ge("DELAY"),resumeDateTime:w(),requestIdToReply:W(w()),handlerId:W(w()),streamStepProgress:W(ze(Hs))}),Ry=k({type:ge("WEBHOOK"),requestId:w(),requestIdToReply:W(w()),response:Ay,handlerId:W(w()),streamStepProgress:W(ze(Hs))}),HR=ke([Iy,Ry]);var WR=k({body:we(),rawBody:W(we()),headers:Te(w(),w()),queryParams:Te(w(),w())});function rt(t){return t==null}o(rt,"isNil");function na(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(na,"isEmpty");function Ws(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(Ws,"assertNotNullOrUndefined");var Zl=qe(require("crypto"),1);var ZR=128,co,Ho,KR=o(t=>{!co||co.length<t?(co=Buffer.allocUnsafe(t*ZR),Zl.default.randomFillSync(co),Ho=0):Ho+t>co.length&&(Zl.default.randomFillSync(co),Ho=0),Ho+=t},"fillPool"),JR=o(t=>(KR(t|=0),co.subarray(Ho-t,Ho)),"random"),YR=o((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(s=e)=>{let c="";for(;;){let d=r(i),p=i;for(;p--;)if(c+=t[d[p]&n]||"",c.length===s)return c}}},"customRandom"),Oy=o((t,e=21)=>YR(t,e,JR),"customAlphabet");var XR="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ky=21,oH=w().check(Mn(new RegExp(`^[0-9a-zA-Z]{${ky}}$`))),QR=Oy(XR,ky);var qn=Fn(jn(t=>t instanceof Date?t.toISOString():t),w()),dr={id:w(),created:qn,updated:qn},ut=o(t=>W(Hi(t)),"Nullable");function Kl(t){return W(Hi(ze(t)))}o(Kl,"NullableEnum");var sH=Fn(jn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),W(Ve())),Zs=o(t=>Fn(jn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),W(Oe(t))),"OptionalArrayFromQuery");var lH=Te(w(),we());var oa=(y=>(y.OPENAI="openai",y.OPENROUTER="openrouter",y.ANTHROPIC="anthropic",y.AZURE="azure",y.GOOGLE="google",y.ACTIVEPIECES="activepieces",y.CLOUDFLARE_GATEWAY="cloudflare-gateway",y.CUSTOM="custom",y.BEDROCK="bedrock",y.MISTRAL="mistral",y))(oa||{});var SH=w().check(Mn(/^#[0-9A-Fa-f]{6}$/));var TH=k({filename:w(),data:we(),type:ge("file"),mimetype:W(w())});var eC=qe(Dy());var OH=k({...dr,name:w(),permissions:Oe(w()),platformId:ut(w()),type:w(),userCount:W(Nt())});var Ny=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ny||{}),Jl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Jl||{}),Yl=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Yl||{});var Xl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Xl||{});var Ql=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ql||{});var tC=k({mode:ze(Ny),value:we()}),rC=k({auth:W(w()),fields:Te(w(),tC)}),nC=k({pieceName:w(),pieceVersion:w(),actionName:w(),predefinedInput:W(rC)}),oC=k({type:ge("PIECE"),toolName:w().check(xr(1)),pieceMetadata:nC}),iC=k({type:ge("none")}),aC=k({type:ge("access_token"),accessToken:w()}),sC=k({type:ge("api_key"),apiKey:w(),apiKeyHeader:w()}),uC=k({type:ge("headers"),headers:Te(w(),w())}),cC=Ln("type",[iC,aC,sC,uC]),zy=k({type:ge("FLOW"),toolName:w().check(xr(1)),externalFlowId:w(),flowDisplayName:W(w())}),Uy=k({type:ge("MCP"),toolName:w().check(xr(1)),serverUrl:vy(),protocol:ze(Yl),auth:cC}),My=k({type:ge("KNOWLEDGE_BASE"),toolName:w().check(xr(1)),sourceType:ze(Jl),sourceId:w(),sourceName:w()}),lC=Ln("type",[oC,zy,Uy,My]),dC=k({displayName:w(),description:W(w()),type:ze(Xl)}),Ly=k({type:ge("MARKDOWN"),markdown:w()}),Wo={type:ge("TOOL_CALL"),input:ut(Te(w(),we())),output:W(we()),toolName:w(),status:ze(Ql),toolCallId:w(),startTime:w(),endTime:W(w())},uW=k(Wo),jy=Ln("toolCallType",[k({...Wo,toolCallType:ge("PIECE"),pieceName:w(),pieceVersion:w(),actionName:w()}),k({...Wo,toolCallType:ge("FLOW"),displayName:w(),externalFlowId:w()}),k({...Wo,toolCallType:ge("MCP"),displayName:w(),serverUrl:w()}),k({...Wo,toolCallType:ge("KNOWLEDGE_BASE"),displayName:w(),sourceType:w()}),k({...Wo,toolCallType:ge("UNKNOWN"),displayName:w()})]),pC=ke([Ly,jy]);var ed=(r=>(r.IMAGE="image",r.TEXT="text",r))(ed||{}),hn=k({apiKey:w()}),fC=hn,mC=k({apiKey:w(),apiKeyHash:w()}),hC=hn,gC=hn,yC=hn,vC=hn,_C=hn,bC=hn,EC=hn,Gy=k({accessKeyId:w().check(xr(1)),secretAccessKey:w().check(xr(1))}),SC=k({}),wC=k({}),TC=k({}),PC=k({}),xC=k({}),AC=k({}),Hy=k({modelId:w(),modelName:w(),modelType:ze(ed)}),Wy=k({apiKeyHeader:w(),baseUrl:w(),models:Oe(Hy),defaultHeaders:W(Te(w(),w()))}),Zy=k({accountId:w(),gatewayId:w(),models:Oe(Hy),vertexProject:W(w()),vertexRegion:W(w())}),Ky=k({resourceName:w(),apiVersion:Fn(jn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),W(w()))}),Jy=k({region:w().check(xr(1))}),IC=ke([fC,yC,vC,_C,bC,gC,hC,mC,Gy,EC]),Yy=ke([Wy,Zy,Ky,Jy,SC,TC,PC,xC,wC,AC]),RC=k({id:w(),name:w(),type:ze(ed)}),CC=k({id:w(),name:w(),provider:ze(oa),config:Yy,enabledForChat:Ve()}),OC=k({provider:ze(oa),config:Yy,auth:IC,platformId:w()});var pW={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Fy=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],kC=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],$C=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],qy=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],DC=["grok-4.20","grok-4.1-fast"],NC={openai:Fy,anthropic:kC,google:qy,activepieces:[...$C.map(t=>`anthropic/${t}`),...Fy.map(t=>`openai/${t}`),...qy.map(t=>`google/${t}`),...DC.map(t=>`x-ai/${t}`)]};var By=128e3,zC={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function UC({provider:t}){return t?zC[t]??By:By}o(UC,"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"},MC={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},LC=new Set(["anthropic","mistral"]);function Lr(t){return{chatModels:NC[t],maxContextTokens:UC({provider:t}),defaultEmbeddingModel:Vy[t],supportsEmbedding:Vy[t]!==void 0,supportsImageGeneration:!LC.has(t),webSearch:MC[t]}}o(Lr,"buildProviderCapabilities");var jC={openai:Lr("openai"),anthropic:Lr("anthropic"),openrouter:Lr("openrouter"),azure:Lr("azure"),google:Lr("google"),"cloudflare-gateway":Lr("cloudflare-gateway"),custom:Lr("custom"),bedrock:Lr("bedrock"),mistral:Lr("mistral"),activepieces:Lr("activepieces")};var FC=k({base64Url:w(),fileName:w(),extension:W(w())}),qC=k({mimeType:w(),url:w(),fileName:W(w())}),td=ke([FC,qC]);var BC=ke([k({type:ge("file"),value:td}),k({type:ge("markdown"),value:w(),files:W(Oe(td))})]),VC=k({sessionId:w(),message:w(),files:W(Oe(w()))});var Qy=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Qy||{}),ev=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ev||{}),rd=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(rd||{});var GC=ke([k({...dr,name:w(),externalId:w(),type:ge("STATIC_DROPDOWN"),tableId:w(),projectId:w(),data:k({options:Oe(k({value:w()}))})}),k({...dr,name:w(),externalId:w(),type:ke([ge("TEXT"),ge("NUMBER"),ge("DATE")]),tableId:w(),projectId:w()})]),HC=k({...dr,name:w(),folderId:ut(w()),projectId:w(),externalId:w(),status:Kl(ev),trigger:Kl(Qy)}),WC=k({...dr,tableId:w(),projectId:w(),cells:Te(w(),k({updated:w(),created:w(),value:we(),fieldName:w()}))}),ZC=k({events:Oe(ze(rd)),webhookUrl:w(),flowId:w()}),KC=k({fields:Oe(k({id:w(),name:w()})),rows:Oe(Te(w(),w())),name:w()}),JC=k({projectId:w(),limit:W(Wi.number()),cursor:W(w()),name:W(w()),externalIds:Zs(w()),folderId:W(w()),folderIds:Zs(w())}),YC=k({records:Oe(Oe(k({fieldId:w(),value:rv()}))),tableId:w()}),XC=k({cells:W(Oe(k({fieldId:w(),value:rv()}))),tableId:w(),agentUpdate:W(Ve())}),tv=Ln("operator",[lo("eq"),lo("neq"),lo("gt"),lo("gte"),lo("lt"),lo("lte"),lo("co"),Xy("exists"),Xy("not_exists")]),QC=k({tableId:w(),limit:W(Wi.number()),cursor:W(w()),filters:Zs(tv)});function rv(){return Fn(jn(t=>t==null?t:String(t)),Hi(w()))}o(rv,"coerceToString");function lo(t){return k({fieldId:w(),operator:ge(t),value:w()})}o(lo,"valueFilter");function Xy(t){return k({fieldId:w(),operator:ge(t)})}o(Xy,"existenceFilter");var e0=k({status:W(Nt()),body:W(we()),headers:W(Te(w(),w()))}),t0=k({...dr,deleted:ut(qn),ownerId:w(),displayName:w(),platformId:w(),externalId:ut(w())});var nv=k({name:w(),description:W(w()),type:w(),required:Ve()}),r0=k({pieceName:w(),triggerName:w(),input:k({toolName:w(),toolDescription:w(),inputSchema:Oe(nv),returnsResponse:Ve()})});var ov="^[0-9]+\\.[0-9]+\\.[0-9]+$",OW=new RegExp(ov),o0="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",kW=w().check(Mn(new RegExp(ov))),$W=w().check(Mn(new RegExp(o0))),i0=k({packageType:ge("ARCHIVE"),pieceType:ze(Vo),pieceName:w(),pieceVersion:w(),archiveId:w(),platformId:w()}),iv=k({packageType:ge("REGISTRY"),pieceType:ge("OFFICIAL"),pieceName:w(),pieceVersion:w()}),av=k({packageType:ge("REGISTRY"),pieceType:ge("CUSTOM"),pieceName:w(),pieceVersion:w(),platformId:w()}),DW=ke([iv,av]),NW=ke([i0,iv,av]);var a0=Ln("type",[k({type:ge("CRON_EXPRESSION"),cronExpression:w(),timezone:w()}),k({type:ge("INTERVAL"),intervalMs:_y().check(Ls(6e4))})]),zW=k({...dr,type:ze(Lt),projectId:w(),flowId:w(),triggerName:w(),schedule:ut(a0),flowVersionId:w(),pieceName:w(),pieceVersion:w(),deleted:ut(w()),simulate:Ve()}),sv=(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))(sv||{}),uv=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(uv||{}),cv=(r=>(r.S3="S3",r.DB="DB",r))(cv||{}),UW=k({...dr,projectId:ut(w()),platformId:ut(w()),type:ze(sv),compression:ze(uv),data:W(we()),location:ze(cv),size:ut(Nt()),fileName:ut(w()),s3Key:ut(w()),metadata:ut(Te(w(),w()))}),lv=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(lv||{}),dv=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(dv||{}),MW=k({id:w(),email:w(),firstName:w(),status:ze(dv),externalId:ut(w()),platformId:ut(w()),platformRole:ze(lv),lastName:w(),created:qn,updated:qn,lastActiveDate:ut(qn),imageUrl:ut(w())});var od=k({...Ge.shape,...$e(Te(w(),we()),"OBJECT").shape});var mv=k({...Ge.shape,...$e(w(),"COLOR").shape});var id=ke([Kt,dn,Gs,fn,Jt,pn,Gl,Zi,Hl,mn,Yi,od,Xi,Ji,Ki,mv]),F={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 jr=k({displayName:w(),description:W(w()),hasConnectionIdentifier:W(Ve())});var hv=k({username:w(),password:w()}),ad=k({...jr.shape,username:k({displayName:w(),description:W(w())}),password:k({displayName:w(),description:W(w())}),...$e(hv,"BASIC_AUTH").shape});var l0=Te(w(),ke([Kt,dn,mn,fn,Jt])),sd=k({...jr.shape,props:l0,...$e(we(),"CUSTOM_AUTH").shape});var po=k({...jr.shape,...$e(k({auth:w()}),"SECRET_TEXT").shape});var d0=Te(w(),ke([Kt,dn,po,mn,fn,Jt,pn,Gs])),gv=k({...jr.shape,props:d0,...$e(we(),"OIDC").shape});var ud=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(ud||{}),yv=ke([Kt,po,Jt]),vv=Te(w(),yv),p0=k({props:W(Te(w(),yv)),authUrl:w(),tokenUrl:w(),scope:Oe(w()),prompt:W(ke([ge("none"),ge("consent"),ge("login"),ge("omit")])),pkce:W(Ve()),pkceMethod:W(ke([ge("plain"),ge("S256")])),authorizationMethod:W(ze(ud)),grantType:W(ke([ze(ea),ge(Wl)])),extra:W(Te(w(),w()))}),_v=k({access_token:w(),props:W(vv),data:Te(w(),Gi())}),cd=k({...jr.shape,...p0.shape,...$e(_v,"OAUTH2").shape});var Zo=ke([ad,sd,gv,cd,po]),ia="Connection",Js={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||ia}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||ia,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||ia}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||ia}},None(){}};var g3={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 f0=k({...Ge.shape,...$e(we(),"CUSTOM").shape,code:w()});var m0=ke([id,Zo]),ld=Te(w(),m0),z3=Te(w(),id);var bv=ke([k({strategy:ge("CRON"),cronExpression:w()}),k({strategy:ge("NONE")})]),Ko=class{constructor(e,r,n,i,s,c,d,p,m,y,h,f,l,g,v,E,b,C,U){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=d;this.onHandshake=p;this.renewConfiguration=m;this.onRenew=y;this.onEnable=h;this.onDisable=f;this.onStart=l;this.run=g;this.test=v;this.sampleData=E;this.testStrategy=b;this.outputSchema=C;this.aiMetadata=U}static{o(this,"ITrigger")}},jt=o(t=>{switch(t.type){case"WEBHOOK":return new Ko(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 Ko(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 Ko(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 Ko(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,rt(t.sampleData)&&rt(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var Ev="2",Ys="0.82.0";var dd=class{constructor(e,r,n,i,s,c,d,p,m=Ys,y,h="",f){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=p;this.minimumSupportedRelease=m;this.maximumSupportedRelease=y;this.description=h;this.deprecated=f;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ev}),"getContextInfo");(!g0(m)||y0(m,Ys))&&(this.minimumSupportedRelease=Ys),s.forEach(l=>this._actions[l.name]=l),c.forEach(l=>this._triggers[l.name]=l)}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:h0(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}},wv=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 dd(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 h0(t){if(t!==void 0)return Array.isArray(t)?t.map(Sv):Sv(t)}o(h0,"withConnectionIdentifierFlag");function Sv(t){return{...t,hasConnectionIdentifier:t.getConnectionIdentifier!==void 0}}o(Sv,"flagConnectionIdentifier");function g0(t){return/^\d+\.\d+\.\d+$/.test(t)}o(g0,"isValidSimpleSemver");function y0(t,e){let[r,n,i]=t.split(".").map(Number),[s,c,d]=e.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<d}o(y0,"isSemverLessThan");var v0=W(Te(w(),Te(w(),w()))),Tv=k({id:W(w()),name:w(),displayName:w(),logoUrl:w(),description:w(),authors:Oe(w()),platformId:W(w()),directoryPath:W(w()),auth:W(ke([Zo,Oe(Zo)])),version:w(),categories:W(Oe(ze(Go))),minimumSupportedRelease:W(w()),maximumSupportedRelease:W(w()),deprecated:W(Ve()),i18n:v0}),_0=ze(["human","ai","both"]),Pv=k({description:W(w()),idempotent:W(Ve())}),xv=k({name:w(),displayName:w(),description:w(),props:ld,requireAuth:Ve(),errorHandlingOptions:W(Vl),outputSchema:W(Bs()),audience:W(_0),aiMetadata:W(Pv)}),Av=k({name:w(),displayName:w(),description:w(),props:ld,errorHandlingOptions:W(Vl),type:ze(Lt),sampleData:we(),handshakeConfiguration:W(Bs()),renewConfiguration:W(bv),testStrategy:ze(ra),outputSchema:W(Bs()),aiMetadata:W(Pv)}),b0=k({...Tv.shape,actions:Te(w(),xv),triggers:Te(w(),Av)}),E0=k({...Tv.shape,actions:Nt(),triggers:Nt(),suggestedActions:W(Oe(xv)),suggestedTriggers:W(Oe(Av))}),Iv=k({projectUsage:Nt(),pieceType:ze(Vo),packageType:ze(Qi),platformId:W(w()),archiveId:W(w())}),zK=k({...b0.shape,...Iv.shape}),UK=k({...E0.shape,...Iv.shape}),MK=k({name:w(),version:w()});var S0=qe(require("path")),w0=qe(require("fs/promises"));var kv=require("node:stream");var Xs=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};return e.authentication&&this.populateAuthentication(e.authentication,r),e.body&&(e.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var Qs=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new pd,r=new fd){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},pd=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},fd=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 aa=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 Rv({error:t,requestBody:e}){return t instanceof aa?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}o(Rv,"toFailsafeOutput");var Ot=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Ot||{});var eu=class extends Xs{static{o(this,"FetchHttpClient")}constructor(e="",r=new Qs){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),s=this.getHeaders(e),c=e.queryParams??{};for(let[U,J]of Object.entries(c))i.append(U,J);let d=i.toString(),p=d?`${n}?${d}`:n,m=e.responseType??"json",y=e.followRedirects??!0,h=e.retries??0,{body:f,extraHeaders:l,isStream:g}=T0(e.method)?P0(e.body,s):{body:void 0,extraHeaders:{},isStream:!1},v=A0({...s,...l}),E=await x0(async()=>{let U=new AbortController,J=e.timeout&&e.timeout>0?setTimeout(()=>U.abort(),e.timeout):void 0;try{let Z={method:e.method.toString(),headers:v,body:f,redirect:y?"follow":"manual",signal:U.signal};return g&&(Z.duplex="half"),r?.dispatcher!==void 0&&(Z.dispatcher=r.dispatcher),await fetch(p,Z)}finally{J!==void 0&&clearTimeout(J)}},h),b=y?300:400;if(E.status<200||E.status>=b){let U=await Cv(E,m),J=new aa(e.body,{status:E.status,responseBody:U});throw console.error("[HttpClient#(sanitized error message)] Request failed:",J),J}let C=await Cv(E,m);return{status:E.status,headers:I0(E.headers),body:C}}};function T0(t){return t!=="GET"&&t!=="HEAD"}o(T0,"acceptsRequestBody");function P0(t,e){if(C0(t))return{body:void 0,extraHeaders:{},isStream:!1};if(R0(t)){let n=new kv.PassThrough;return t.on("error",i=>n.destroy(i)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return typeof t=="string"||Buffer.isBuffer(t)||t instanceof URLSearchParams||t instanceof ArrayBuffer||typeof FormData<"u"&&t instanceof FormData||typeof Blob<"u"&&t instanceof Blob?{body:t,extraHeaders:{},isStream:!1}:(e["Content-Type"]??e["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(t).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(t),extraHeaders:{},isStream:!1}}o(P0,"serializeBody");async function Cv(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"blob":return await t.blob();case"text":return await t.text();default:{let r=await t.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Cv,"parseResponseBody");async function x0(t,e){let r;for(let n=0;n<=e;n++)try{let i=await t();if(i.status>=500&&n<e){await Ov(n);continue}return i}catch(i){if(r=i,n<e){await Ov(n);continue}throw i}throw r}o(x0,"sendWithRetries");function Ov(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(Ov,"backoff");function A0(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(A0,"normalizeHeaders");function I0(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(I0,"toHttpHeaders");function R0(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}o(R0,"isNodeFormData");function C0(t){return t==null}o(C0,"isNil");var Ue=new eu;var yk=qe(require("fs")),zb=qe(Nb());var vk={"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 _k(t){let e=t.split(";")[0].trim().toLowerCase();return vk[e]??""}o(_k,"contentTypeToExtension");var bk=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Ek=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 Ub({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:d,authLocation:p="headers"}){return ve({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:F.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:m})=>({url:F.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
69
|
+
i.e ${Ek(e,m)}/resource or /resource`,required:!0,defaultValue:m?e(m):"",...c?.url??{}})}),"props")}),method:F.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Ot).map(m=>({label:m,value:m}))},...c?.method??{}}),headers:F.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:F.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:F.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:F.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:m})=>{if(!m)return{};let y=m,h={};switch(y){case"none":break;case"json":h.data=F.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":h.data=F.LongText({displayName:"Raw Body",required:!0});break;case"form_data":h.data=F.Array({displayName:"Form Data",required:!0,properties:{fieldName:F.ShortText({displayName:"Field Name",required:!0}),fieldType:F.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:F.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:F.File({displayName:"File Field Value",required:!1})}});break}return h},"props")}),response_is_binary:F.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:F.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:F.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:F.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async m=>{let{method:y,url:h,headers:f,queryParams:l,body:g,body_type:v,failsafe:E,timeout:b,response_is_binary:C,followRedirects:U}=m.propsValue;Ws(y,"Method"),Ws(h,"URL");let J=rt(r)?{}:await r(m.auth,m.propsValue),Z=h.url,H=Z.startsWith("http://")||Z.startsWith("https://")?Z:bk({baseUrl:e(m.auth),relativePath:Z}),K={method:y,url:H,headers:{...f??{},...p==="headers"||!rt(p)?J:{}},queryParams:{...p==="queryParams"?J:{},...l??{}},timeout:b?b*1e3:0,followRedirects:U};if(C&&(K.responseType="arraybuffer"),g)if(v&&v!=="none"){let te=g.data;if(v==="form_data"){let Q=te,xe=new zb.default;for(let{fieldName:re,fieldType:V,textFieldValue:B,fileFieldValue:X}of Q)V==="text"&&!na(B)?xe.append(re,B):V==="file"&&!na(X)&&xe.append(re,X.data,{filename:X?.filename});K.body=xe,K.headers={...K.headers,...xe.getHeaders()}}else K.body=te}else v||(K.body=g);try{let te=await Ue.sendRequest(K);return await Sk(m.files,te.body,te.status,te.headers,C)}catch(te){if(E)return Rv({error:te,requestBody:K.body});throw te}},"run")})}o(Ub,"createCustomApiCallAction");var Sk=o(async(t,e,r,n,i)=>{let s;if(i&&wk(e)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=_k(c??"")||"txt",p;e instanceof ArrayBuffer?p=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?p=e:p=Buffer.from(e),s=await t.write({fileName:`output.${d}`,data:p})}else s=e;return{status:r,headers:n,body:s}},"handleBinaryResponse"),wk=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var Je={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(t.strategy){case 0:{let d=await e.get("lastPoll");if(rt(d))throw new Error("lastPoll doesn't exist in the store.");let p=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:d,server:c}),m=p.reduce((y,h)=>Math.max(y,h.epochMilliSeconds),d);return await e.put("lastPoll",m),p.filter(y=>y.epochMilliSeconds>d).map(y=>y.data)}case 1:{let d=await e.get("lastItem"),p=await t.items({store:e,auth:r,propsValue:n,lastItemId:d,files:s,server:c}),m=p.findIndex(f=>f.id===d),y=[];rt(d)||m==-1?y=p??[]:y=p?.slice(0,m)??[],rt(i)||(y=y.slice(-i));let h=y?.[0]?.id;return rt(h)||await e.put("lastItem",h),y.map(f=>f.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i,isRepublish:s}){switch(t.strategy){case 0:{if(s&&!rt(await e.get("lastPoll")))break;await e.put("lastPoll",Date.now());break}case 1:{if(s&&!rt(await e.get("lastItem")))break;let d=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;rt(d)?await e.delete("lastItem"):await e.put("lastItem",d);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:s}){let c=[];switch(t.strategy){case 0:{c=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:s});break}}return Tk(c.map(d=>d.data))}};function Tk(t){return t.length<=5?t:t.slice(0,5)}o(Tk,"getFirstFiveOrAll");var Mb=require("crypto");async function Nd(t,e){let r={method:"POST",url:`${ae.baseUrl}/channels/stop`,body:{id:t?.id,resourceId:t?.resourceId},authentication:{type:"BEARER_TOKEN",token:await Ie(e)}};await Ue.sendRequest(r)}o(Nd,"stopWatchEvent");async function zd(t,e,r){let n=Date.now()+5184e5,i={method:"POST",url:`${ae.baseUrl}/calendars/${t}/events/watch`,body:{id:(0,Mb.randomUUID)(),type:"web_hook",address:e,expiration:n.toString()},authentication:{type:"BEARER_TOKEN",token:await Ie(r)}},{body:s}=await Ue.sendRequest(i);return s}o(zd,"watchEvent");async function cu({calendarId:t,authProp:e}){let r=await Ie(e),n={singleEvents:"true",showDeleted:"true",maxResults:"2500"},i="",s;do{i&&(n.pageToken=i);let c={method:"GET",url:`${ae.baseUrl}/calendars/${t}/events`,queryParams:n,authentication:{type:"BEARER_TOKEN",token:r}},{body:d}=await Ue.sendRequest(c);i=d.nextPageToken,s=d.nextSyncToken}while(i);return s}o(cu,"getInitialSyncToken");async function Lb({calendarId:t,syncToken:e,authProp:r}){let n=await Ie(r),i={syncToken:e,maxResults:"2500"},s="",c,d=[];do{s&&(i.pageToken=s);let p={method:"GET",url:`${ae.baseUrl}/calendars/${t}/events`,queryParams:i,authentication:{type:"BEARER_TOKEN",token:n}};try{let{body:m}=await Ue.sendRequest(p);m.items?.length>0&&(d=[...d,...m.items]),s=m.nextPageToken,c=m.nextSyncToken}catch(m){if(m?.response?.status===410)return{items:[],nextSyncToken:void 0,syncTokenInvalid:!0};throw m}}while(s);return{items:d,nextSyncToken:c,syncTokenInvalid:!1}}o(Lb,"listEventsWithSyncToken");async function kt(t,e){let r={showDeleted:"false"};e&&(r.minAccessRole=e);let n={method:"GET",url:`${ae.baseUrl}/users/me/calendarList`,queryParams:r,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};return(await Ue.sendRequest(n)).body.items}o(kt,"getCalendars");async function lu(t){let e={method:"GET",url:`${ae.baseUrl}/colors`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};return(await Ue.sendRequest(e)).body}o(lu,"getColors");async function da(t,e,r,n){let i=new Date,s=new Date;s.setDate(i.getDate()-1);let c={updatedMin:n?.toISOString()??s.toISOString(),maxResults:"2500",orderBy:"updated",singleEvents:e?"true":"false",showDeleted:"true"},d=await Ie(r),p={method:"GET",url:`${ae.baseUrl}/calendars/${t}/events`,queryParams:c,authentication:{type:"BEARER_TOKEN",token:d}},m=[],y="";do{c.pageToken=y;let{body:h}=await Ue.sendRequest(p);h.items.length>0&&(m=[...m,...h.items]),y=h.nextPageToken}while(y);return m}o(da,"getEvents");async function jb(t,e){return(await da(t,!1,e)).pop()}o(jb,"getLatestEvent");async function Fb(t,e,r=50){if(!e)return[];try{let n=new Date,i=new Date;i.setDate(n.getDate()+30);let s={singleEvents:"true",orderBy:"startTime",timeMin:n.toISOString(),timeMax:i.toISOString(),maxResults:r.toString(),showDeleted:"false"},c={method:"GET",url:`${ae.baseUrl}/calendars/${encodeURIComponent(e)}/events`,queryParams:s,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}},d=await Ue.sendRequest(c);return!d.body.items||d.body.items.length===0?[]:d.body.items.map(p=>{let m=p.start?.dateTime||p.start?.date||"",y=m?new Date(m).toLocaleDateString():"",h=m?new Date(m).toLocaleTimeString():"",f=p.summary||"Untitled Event";return y&&(f+=` (${y}`,p.start?.dateTime&&(f+=` at ${h}`),f+=")"),{label:f,value:p.id||""}}).filter(p=>p.value!=="")}catch(n){return console.error("Error fetching events for dropdown:",n),[]}}o(Fb,"getEventsForDropdown");var Ac=qe(Ba());var rm=["https://www.googleapis.com/auth/calendar.events","https://www.googleapis.com/auth/calendar.readonly","email"],ne=[Js.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,pkce:!0,scope:rm}),Js.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 calendars without adding the service account to each one. <br> <br> **Note:** Without a user email, the service account only has access to calendars you explicitly share with it.",required:!0,props:{serviceAccount:F.ShortText({displayName:"Service Account JSON Key",required:!0}),userEmail:F.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 Ie({type:"CUSTOM_AUTH",props:{...t}})}catch(e){return{valid:!1,error:e.message}}return{valid:!0}},"validate")})];async function _t(t){if(t.type==="CUSTOM_AUTH"){let r=JSON.parse(t.props.serviceAccount);return new Ac.JWT({email:r.client_email,key:r.private_key,scopes:rm,subject:t.props.userEmail})}let e=new Ac.OAuth2Client;return e.setCredentials(t),e}o(_t,"createGoogleClient");var Ie=o(async t=>{if(t.type==="CUSTOM_AUTH"){let r=await(await _t(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 ae={baseUrl:"https://www.googleapis.com/calendar/v3",calendarDropdown:o(t=>F.Dropdown({auth:ne,displayName:"Calendar",refreshers:[],required:!0,options:o(async({auth:e})=>e?{disabled:!1,options:(await kt(e,t)).map(i=>({label:i.summary,value:i.id}))}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),"calendarDropdown"),eventDropdown:o((t=!1)=>F.Dropdown({displayName:"Event",refreshers:["calendar_id"],required:t,auth:ne,options:o(async({auth:e,calendar_id:r})=>e?r?{disabled:!1,options:await Fb(e,r)}:{disabled:!0,placeholder:"Please select a calendar first",options:[]}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),"eventDropdown"),colorId:F.Dropdown({auth:ne,displayName:"Color",refreshers:[],required:!1,options:o(async({auth:t})=>{if(!t)return{disabled:!0,placeholder:"Please connect your account first",options:[]};let e=await lu(t);return{disabled:!1,options:Object.entries(e.event).map(([r,n])=>({label:n.background,value:r}))}},"options")})};var Zc=qe(Sn()),_x=qe(xn()),bx=require("crypto");var Ze={fields:[{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"id",label:"Event ID"},{key:"eventType",label:"Event Type"},{key:"start",label:"Start",children:[{key:"dateTime",label:"Start Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"end",label:"End",children:[{key:"dateTime",label:"End Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"creator",label:"Creator",children:[{key:"email",label:"Email",format:"email"}]},{key:"organizer",label:"Organizer",children:[{key:"email",label:"Email",format:"email"}]},{key:"created",label:"Created",format:"datetime"},{key:"updated",label:"Updated",format:"datetime"},{key:"iCalUID",label:"iCal UID"}]},ux={fields:[{key:"summary",label:"Name"},{key:"description",label:"Description"},{key:"id",label:"Calendar ID"},{key:"timeZone",label:"Time Zone"},{key:"accessRole",label:"Access Role"},{key:"primary",label:"Primary",format:"boolean"},{key:"isOwned",label:"Is Owned",format:"boolean"},{key:"selected",label:"Selected",format:"boolean"},{key:"isShared",label:"Is Shared",format:"boolean"},{key:"calendarType",label:"Calendar Type"},{key:"backgroundColor",label:"Background Color"},{key:"foregroundColor",label:"Foreground Color"},{key:"colorId",label:"Color ID"}]},Hc={fields:[{key:"status",label:"Status Code"},{key:"summary",label:"Calendar Summary",value:"body.summary"},{key:"timeZone",label:"Time Zone",value:"body.timeZone"},{key:"accessRole",label:"Access Role",value:"body.accessRole"},{key:"updated",label:"Updated",value:"body.updated",format:"datetime"},{key:"items",label:"Events",value:"body.items",labelKey:"summary",listItems:[{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"id",label:"Event ID"},{key:"eventType",label:"Event Type"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"startDateTime",label:"Start",value:"start.dateTime",format:"datetime"},{key:"endDateTime",label:"End",value:"end.dateTime",format:"datetime"},{key:"creatorEmail",label:"Creator Email",value:"creator.email",format:"email"},{key:"organizerEmail",label:"Organizer Email",value:"organizer.email",format:"email"},{key:"created",label:"Created",format:"datetime"},{key:"updated",label:"Updated",format:"datetime"},{key:"iCalUID",label:"iCal UID"}]}]},cx={fields:[{key:"summary",label:"Summary",value:"body.summary"},{key:"status",label:"Status",value:"body.status"},{key:"id",label:"Event ID",value:"body.id"},{key:"htmlLink",label:"Event Link",value:"body.htmlLink",format:"url"},{key:"created",label:"Created",value:"body.created",format:"datetime"},{key:"updated",label:"Updated",value:"body.updated",format:"datetime"},{key:"start",label:"Start",value:"body.start",children:[{key:"dateTime",label:"Start Date/Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"end",label:"End",value:"body.end",children:[{key:"dateTime",label:"End Date/Time",format:"datetime"},{key:"timeZone",label:"Time Zone"}]},{key:"creator",label:"Creator",value:"body.creator",children:[{key:"email",label:"Email",format:"email"}]},{key:"organizer",label:"Organizer",value:"body.organizer",children:[{key:"email",label:"Email",format:"email"}]},{key:"eventType",label:"Event Type",value:"body.eventType"},{key:"iCalUID",label:"iCal UID",value:"body.iCalUID"}]},lx={fields:[{key:"summary",label:"Name"},{key:"id",label:"Calendar ID"},{key:"description",label:"Description"},{key:"location",label:"Location"},{key:"timeZone",label:"Time Zone"}]};var dx={fields:[{key:"calendar",label:"Calendar Colors",dynamicKey:!0,children:[{key:"background",label:"Background Color"},{key:"foreground",label:"Foreground Color"}]},{key:"event",label:"Event Colors",dynamicKey:!0,children:[{key:"background",label:"Background Color"},{key:"foreground",label:"Foreground Color"}]}]},px={fields:[{key:"calendars",label:"Calendars",labelKey:"summary",listItems:[{key:"id",label:"Calendar ID"},{key:"summary",label:"Name"},{key:"description",label:"Description"},{key:"location",label:"Location"},{key:"timeZone",label:"Time Zone"},{key:"accessRole",label:"Access Role"},{key:"primary",label:"Primary",format:"boolean"},{key:"selected",label:"Selected",format:"boolean"},{key:"backgroundColor",label:"Background Color"},{key:"foregroundColor",label:"Foreground Color"}]},{key:"count",label:"Count",format:"number"}]},fx={fields:[{key:"items",label:"Settings",labelKey:"id",listItems:[{key:"id",label:"Setting ID"},{key:"value",label:"Value"}]},{key:"count",label:"Count",format:"number"}]},mx={fields:[{key:"removed",label:"Removed",format:"boolean"},{key:"attendee_email",label:"Attendee Email",format:"email"},{key:"message",label:"Message"},{key:"event",label:"Event",children:Ze.fields}]},hx={fields:[{key:"free_slots",label:"Free Slots",labelKey:"start",listItems:[{key:"start",label:"Start",format:"datetime"},{key:"end",label:"End",format:"datetime"},{key:"duration_minutes",label:"Duration (Minutes)",format:"number"}]},{key:"count",label:"Count",format:"number"}]},mL=[{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"id",label:"Instance Event ID"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"startDateTime",label:"Start",value:"start.dateTime",format:"datetime"},{key:"endDateTime",label:"End",value:"end.dateTime",format:"datetime"},{key:"originalStartDateTime",label:"Original Start",value:"originalStartTime.dateTime",format:"datetime"}],gx={fields:[{key:"instances",label:"Instances",labelKey:"summary",listItems:mL},{key:"count",label:"Count",format:"number"},{key:"nextPageToken",label:"Next Page Token"}]},yx={fields:[{key:"moved",label:"Moved",format:"boolean"},{key:"already_in_destination",label:"Already in Destination",format:"boolean"},{key:"event",label:"Event",children:Ze.fields}]},vx={fields:[{key:"events",label:"Events",labelKey:"summary",listItems:[{key:"calendarId",label:"Calendar ID"},{key:"summary",label:"Title"},{key:"status",label:"Status"},{key:"id",label:"Event ID"},{key:"htmlLink",label:"Event Link",format:"url"},{key:"startDateTime",label:"Start",value:"start.dateTime",format:"datetime"},{key:"endDateTime",label:"End",value:"end.dateTime",format:"datetime"}]},{key:"count",label:"Count",format:"number"},{key:"calendars_searched",label:"Calendars Searched",format:"number"},{key:"warning",label:"Warning"}]},Wc={fields:[{key:"timeMin",label:"Time Min",format:"datetime"},{key:"timeMax",label:"Time Max",format:"datetime"},{key:"calendars",label:"Calendars",dynamicKey:!0,children:[{key:"busy",label:"Busy Periods",labelKey:"start",listItems:[{key:"start",label:"Start",format:"datetime"},{key:"end",label:"End",format:"datetime"}]}]}]};var Fm={calendar_id:ae.calendarDropdown("writer"),title:F.ShortText({displayName:"Title of the event",required:!0}),start_date_time:F.DateTime({displayName:"Start date time of the event",required:!0}),end_date_time:F.DateTime({displayName:"End date time of the event",description:"By default it'll be 30 min post start time",required:!1}),location:F.ShortText({displayName:"Location",required:!1}),description:F.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1}),colorId:ae.colorId,attendees:F.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!1}),guests_can_modify:F.Checkbox({displayName:"Guests can modify",defaultValue:!1,required:!1}),guests_can_invite_others:F.Checkbox({displayName:"Guests can invite others",defaultValue:!1,required:!1}),guests_can_see_other_guests:F.Checkbox({displayName:"Guests can see other guests",defaultValue:!1,required:!1}),send_notifications:F.StaticDropdown({displayName:"Send Notifications",defaultValue:"all",options:{options:[{label:"Yes, to everyone",value:"all"},{label:"To non-Google Calendar guests only",value:"externalOnly"},{label:"To no one",value:"none"}]},required:!0}),create_meet_link:F.Checkbox({displayName:"Create Google Meet Link",description:"Automatically create a Google Meet video conference link for this event",defaultValue:!1,required:!1})};async function qm(t){let{calendar_id:e,title:r,start_date_time:n,end_date_time:i,location:s,description:c,colorId:d,guests_can_modify:p,guests_can_invite_others:m,guests_can_see_other_guests:y,create_meet_link:h}=t.propsValue,f={dateTime:(0,Zc.default)(n).format("YYYY-MM-DDTHH:mm:ss.sssZ")},l=i||(0,Zc.default)(n).add(30,"m"),g={dateTime:(0,Zc.default)(l).format("YYYY-MM-DDTHH:mm:ss.sssZ")},v=t.propsValue.attendees,E=t.propsValue.send_notifications,b=[];if(v)for(let H of v)b.push({email:H});let C=await _t(t.auth),U=(0,_x.calendar)({version:"v3",auth:C}),J={summary:r,start:f,end:g,colorId:d,location:s??"",description:c??"",attendees:b,guestsCanInviteOthers:m,guestsCanModify:p,guestsCanSeeOtherGuests:y};return h&&(J.conferenceData={createRequest:{conferenceSolutionKey:{type:"hangoutsMeet"},requestId:(0,bx.randomUUID)()}}),(await U.events.insert({calendarId:e,sendUpdates:E,conferenceDataVersion:h?1:0,requestBody:J})).data}o(qm,"runCreateEvent");var Ex=ve({auth:ne,name:"create_google_calendar_event",description:"Add Event",audience:"human",aiMetadata:{description:"Creates a Google Calendar event with structured fields (title, start/end times, location, description, attendees, color, guest permissions) and can optionally attach a Google Meet link. Use this when you have explicit event details; choose Create Quick Event instead when working from a single natural-language phrase. Requires a title and start time (end defaults to 30 minutes after start). Not idempotent: each call creates a new event.",idempotent:!1},displayName:"Create Event",props:Fm,outputSchema:Ze,run:qm});var Sx=ve({auth:ne,name:"create_quick_event",description:"Add Quick Calendar Event",audience:"both",aiMetadata:{description:`Creates a calendar event from a single natural-language phrase (e.g. "Lunch with Sam tomorrow at 1pm") via Google's quickAdd parsing, letting Google infer the time, title, and date. Use when you have free-form text rather than structured fields; prefer Create Event when you have explicit start/end times or attendees. Not idempotent: each call creates a new event.`,idempotent:!1},displayName:"Create Quick Event",props:{calendar_id:ae.calendarDropdown("writer"),text:F.LongText({displayName:"Summary",description:"The text describing the event to be created",required:!0}),send_updates:F.StaticDropdown({displayName:"Send Updates",description:"Guests who should receive notifications about the creation of the new event.",required:!1,options:{disabled:!1,options:[{label:"All",value:"all"},{label:"External Only",value:"externalOnly"},{label:"none",value:"none"}]}})},outputSchema:cx,async run(t){let e=t.propsValue.calendar_id,r=`${ae.baseUrl}/calendars/${e}/events/quickAdd`,n={text:t.propsValue.text,sendUpdates:t.propsValue.send_updates||"none"},i={method:"POST",url:r,body:{},authentication:{type:"BEARER_TOKEN",token:await Ie(t.auth)},queryParams:n};return await Ue.sendRequest(i)}});var wx=qe(xn());var hL={calendar_id:ae.calendarDropdown("writer"),eventId:F.ShortText({displayName:"Event ID",required:!0})};async function Bm(t){let e=await _t(t.auth),r=t.propsValue.calendar_id,n=t.propsValue.eventId;return(await(0,wx.calendar)({version:"v3",auth:e}).events.delete({calendarId:r,eventId:n})).data}o(Bm,"runDeleteEvent");var Tx=ve({displayName:"Delete Event",auth:ne,name:"delete_event",description:"Deletes an event from Google Calendar.",audience:"human",aiMetadata:{description:"Permanently removes an event from a Google Calendar, identified by calendar and event ID. Use to cancel or delete an existing event. Requires the event ID and cannot be undone. Idempotent: once the event is deleted, repeating the call leaves it absent (a second call may report it as already gone).",idempotent:!0},props:hL,run:Bm});var Vm=qe(Sn());var Gm={calendar_id:ae.calendarDropdown("writer"),event_types:F.StaticMultiSelectDropdown({displayName:"Event types",description:"Select event types",required:!0,defaultValue:["default","focusTime","outOfOffice"],options:{options:[{label:"Default",value:"default"},{label:"Out Of Office",value:"outOfOffice"},{label:"Focus Time",value:"focusTime"},{label:"Working Location",value:"workingLocation"}]}}),search:F.ShortText({displayName:"Search Term",required:!1}),start_date:F.DateTime({displayName:"Date from",required:!1}),end_date:F.DateTime({displayName:"Date to",required:!1}),singleEvents:F.Checkbox({displayName:"Expand Recurring Event?",description:"Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves.",required:!0,defaultValue:!1})};async function Hm(t){let{calendar_id:e,start_date:r,end_date:n,search:i,event_types:s,singleEvents:c}=t.propsValue,d=await Ie(t.auth),p={showDeleted:"false"},m=`${ae.baseUrl}/calendars/${e}/events`;c!==null&&(p.singleEvents=c?"true":"false"),i&&(p.q=`"${i}"`),r&&(p.timeMin=(0,Vm.default)(r).format("YYYY-MM-DDTHH:mm:ss.sssZ")),r&&n&&(p.timeMax=(0,Vm.default)(n).format("YYYY-MM-DDTHH:mm:ss.sssZ")),s.length>0&&(m+=`?${s.map(h=>`eventTypes=${h}`).join("&")}`);let y={method:"GET",url:m,queryParams:p,authentication:{type:"BEARER_TOKEN",token:d}};return await Ue.sendRequest(y)}o(Hm,"runGetEvents");var Px=ve({auth:ne,name:"google_calendar_get_events",description:"Get Events",audience:"human",aiMetadata:{description:"Lists events from a Google Calendar, optionally filtered by a date range, search term, and event types, and can expand recurring events into individual instances. Use to look up or browse multiple events when you do not already have a specific event ID; use Get Event by ID for a single known event. Read-only and idempotent.",idempotent:!0},displayName:"Get all Events",props:Gm,outputSchema:Hc,run:Hm});var xx=qe(xn());var Wm=qe(Sn());var Kc={calendar_id:ae.calendarDropdown("writer"),eventId:F.ShortText({displayName:"Event ID",required:!0}),title:F.ShortText({displayName:"Title of the event",required:!1}),start_date_time:F.DateTime({displayName:"Start date time of the event",required:!1}),end_date_time:F.DateTime({displayName:"End date time of the event",required:!1}),location:F.ShortText({displayName:"Location",required:!1}),description:F.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1}),colorId:ae.colorId,attendees:F.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!1}),guests_can_modify:F.Checkbox({displayName:"Guests can modify",defaultValue:!1,required:!1}),guests_can_invite_others:F.Checkbox({displayName:"Guests can invite others",defaultValue:!1,required:!1}),guests_can_see_other_guests:F.Checkbox({displayName:"Guests can see other guests",defaultValue:!1,required:!1})};async function Zm(t){let{calendar_id:e,eventId:r,title:n,start_date_time:i,end_date_time:s,location:c,description:d,colorId:p,guests_can_invite_others:m,guests_can_modify:y,guests_can_see_other_guests:h}=t.propsValue,f=t.propsValue.attendees,l=await _t(t.auth),g=(0,xx.calendar)({version:"v3",auth:l}),v=await g.events.get({calendarId:e,eventId:r}),E=[];return Array.isArray(f)&&f.length>0?E=f.map(C=>({email:C})):v.data.attendees&&Array.isArray(v.data.attendees)&&(E=v.data.attendees),(await g.events.update({calendarId:e,eventId:r,requestBody:{summary:n??v.data.summary,attendees:E,description:d??v.data.description,colorId:p,location:c??v.data.location,start:i?{dateTime:(0,Wm.default)(i).format("YYYY-MM-DDTHH:mm:ss.sssZ")}:v.data.start,end:s?{dateTime:(0,Wm.default)(s).format("YYYY-MM-DDTHH:mm:ss.sssZ")}:v.data.end,guestsCanInviteOthers:m??v.data.guestsCanInviteOthers,guestsCanModify:y??v.data.guestsCanModify,guestsCanSeeOtherGuests:h??v.data.guestsCanSeeOtherGuests}})).data}o(Zm,"runUpdateEvent");var Ax=ve({displayName:"Update Event",auth:ne,name:"update_event",description:"Updates an event in Google Calendar.",audience:"human",aiMetadata:{description:"Updates the fields of an existing Google Calendar event identified by calendar and event ID (title, times, location, description, color, attendees, guest permissions); unset fields retain their current values. Use to modify or reschedule an event that already exists rather than creating a new one. Requires the event ID. Idempotent: applying the same field values repeatedly leaves the event in the same state.",idempotent:!0},props:Kc,outputSchema:Ze,run:Zm});var Jc={strategy:0,items:o(async({auth:t,propsValue:{calendarId:e,expandRecurringEvent:r},lastFetchEpochMS:n})=>{let i=new Date(n);if(n===0){let d=new Date,p=new Date;p.setDate(d.getDate()-7),i=p}return(await da(e,r,t,i)??[]).map(d=>({epochMilliSeconds:new Date(d.updated).getTime(),data:d}))},"items")},Ix=jt({auth:ne,name:"new_or_updated_event",displayName:"New or Updated Event",description:"Triggers when an event is added or updated",aiMetadata:{description:"Fires when any event in the selected calendar is created or modified, polling by last-updated time. Each fired item is the affected event; can optionally expand recurring events so every occurrence fires separately."},props:{calendar_id:ae.calendarDropdown(),expandRecurringEvent:F.Checkbox({displayName:"Expand Recurring Event?",description:"If true, the trigger will activate for every occurrence of a recurring event.",required:!0,defaultValue:!1})},sampleData:{kind:"calendar#event",etag:"3350849506974000",id:"0nsfi5ttd2b17ac76ma2f37oi9",htmlLink:"https://www.google.com/calendar/event?eid=kgjb90uioj4klrgfmdsnjsjvlgkm",summary:"ap-event-test",created:"2023-02-03T11:36:36.000Z",updated:"2023-02-03T11:45:53.487Z",description:"Sample description",status:"canceled",creator:{email:"test@test.com",self:!0},organizer:{email:"test@test.com",self:!0},start:{dateTime:"2023-02-02T22:30:00+03:00",timeZone:"Asia/Amman"},end:{dateTime:"2023-02-02T23:30:00+03:00",timeZone:"Asia/Amman"},transparency:"transparent",iCalUID:"0nsfi5ttd2b17ac76ma2f37oi9@google.com",sequence:1,attendees:[{email:"attende@test.com",responseStatus:"needsAction"},{email:"test@test.com",organizer:!0,self:!0,responseStatus:"accepted"}],reminders:{useDefault:!0},eventType:"default"},outputSchema:Ze,type:"POLLING",async test({store:t,auth:e,propsValue:r,files:n}){return await Je.test(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent},files:n})},async onEnable({store:t,auth:e,propsValue:r}){await Je.onEnable(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent}})},async onDisable({store:t,auth:e,propsValue:r}){await Je.onDisable(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent}})},async run({store:t,auth:e,propsValue:r,files:n}){return await Je.poll(Jc,{store:t,auth:e,propsValue:{calendarId:r.calendar_id,expandRecurringEvent:r.expandRecurringEvent},files:n})}});var Rx=qe(xn());var Cx=ve({auth:ne,name:"google-calendar-add-attendees",displayName:"Add Attendees to Event",description:"Add one or more person to existing event.",audience:"both",aiMetadata:{description:"Adds one or more guests (by email) to an existing Google Calendar event, identified by calendar and event ID, preserving the current attendee list. Use to invite people to an event that already exists rather than recreating it. Not idempotent: re-running appends the same emails again, producing duplicate attendee entries.",idempotent:!1},props:{calendar_id:ae.calendarDropdown("writer"),eventId:F.ShortText({displayName:"Event ID",required:!0}),attendees:F.Array({displayName:"Attendees",description:"Emails of the attendees (guests)",required:!0})},outputSchema:Ze,async run(t){let{calendar_id:e,eventId:r}=t.propsValue,n=t.propsValue.attendees,i=await _t(t.auth),s=(0,Rx.calendar)({version:"v3",auth:i}),c=await s.events.get({calendarId:e,eventId:r}),d=c.data.attendees??[],p=[];return p.push(...d),p.push(...n.map(y=>({email:y}))),(await s.events.update({calendarId:e,eventId:r,requestBody:{...c.data,attendees:p}})).data}});var Km=qe(Sn());var Jm={calendar_ids:F.MultiSelectDropdown({auth:ne,displayName:"Calendars",description:"Select the calendars to check for busy periods.",required:!0,refreshers:[],options:o(async({auth:t})=>t?{disabled:!1,options:(await kt(t)).map(n=>({label:n.summary,value:n.id}))}:{disabled:!0,placeholder:"Connect your account first",options:[]},"options")}),start_date:F.DateTime({displayName:"Start Time",description:"The start of the time range to check.",required:!0}),end_date:F.DateTime({displayName:"End Time",description:"The end of the time range to check.",required:!0})};async function Ym(t){let{calendar_ids:e,start_date:r,end_date:n}=t.propsValue,i=await Ie(t.auth),s={timeMin:(0,Km.default)(r).toISOString(),timeMax:(0,Km.default)(n).toISOString(),items:e.map(p=>({id:p}))},c={method:"POST",url:`${ae.baseUrl}/freeBusy`,body:s,authentication:{type:"BEARER_TOKEN",token:i}};return(await Ue.sendRequest(c)).body}o(Ym,"runFindFreeBusy");var Ox=ve({auth:ne,name:"google_calendar_find_busy_free_periods",displayName:"Find Busy/Free Periods in Calendar",description:"Finds free/busy calendar details from Google Calendar.",audience:"human",aiMetadata:{description:"Queries one or more calendars for their busy time blocks within a given start/end window, without exposing event details. Use to check availability or find open slots before scheduling a meeting. Requires the calendars to check and a time range. Read-only and idempotent.",idempotent:!0},props:Jm,outputSchema:Wc,run:Ym});var Xm={calendar_id:ae.calendarDropdown(),event_id:F.ShortText({displayName:"Event ID",description:'The unique ID of the event (e.g., "abc123def456"). You can find this in the event URL or from other calendar actions.',required:!0}),max_attendees:F.Number({displayName:"Max Attendees",description:"Maximum number of attendees to include in the response. If there are more attendees, only the participant is returned.",required:!1}),time_zone:F.ShortText({displayName:"Time Zone",description:`Time zone for the response (e.g., "America/New_York", "Europe/London"). Defaults to the calendar's time zone if not specified.`,required:!1})};async function Qm(t){let{calendar_id:e,event_id:r,max_attendees:n,time_zone:i}=t.propsValue,s=await Ie(t.auth);if(!e||typeof e!="string"||e.trim().length===0)throw new Error("Calendar ID is required");if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Event ID cannot be empty");if(r.length<5||r.length>1024)throw new Error("Event ID must be between 5 and 1024 characters");let c={};n!==void 0&&n>0&&(c.maxAttendees=n.toString()),i&&typeof i=="string"&&i.trim().length>0&&(c.timeZone=i.trim());let d=`${ae.baseUrl}/calendars/${encodeURIComponent(e.trim())}/events/${encodeURIComponent(r.trim())}`,p={method:"GET",url:d,queryParams:c,authentication:{type:"BEARER_TOKEN",token:s}};try{return(await Ue.sendRequest(p)).body}catch(m){throw m.response?.status===404?new Error(`Event with ID "${r}" not found in calendar "${e}". Please verify the event ID and calendar selection.`):m.response?.status===403?new Error(`Access denied to event "${r}" in calendar "${e}". Please check your permissions.`):m.response?.status===400?new Error("Invalid request parameters. Please check the event ID format and other parameters."):m.response?.status===401?new Error("Authentication failed. Please reconnect your Google Calendar account."):new Error(`Failed to fetch event: ${m.message||"Unknown error occurred"}`)}}o(Qm,"runGetEventById");var kx=ve({auth:ne,name:"google_calendar_get_event_by_id",displayName:"Get Event by ID",description:"Fetch event details by its unique ID from Google Calendar.",audience:"human",aiMetadata:{description:"Fetches the full details of a single Google Calendar event by its unique event ID within a given calendar. Use when you already have an event ID (e.g. from a trigger or a list action) and need its details; use Get all Events to search when you do not. Requires a valid event ID. Read-only and idempotent.",idempotent:!0},props:Xm,outputSchema:Ze,run:Qm});var eh=qe(Sn()),$x=ve({auth:ne,name:"google_calendar_search_events_all_calendars",displayName:"Search Events Across Calendars",description:"Searches every calendar the account can access for events matching a keyword within a required time window.",audience:"ai",aiMetadata:{description:"Search all of the user's calendars at once for events matching a text query within a required time window, returning each match tagged with its owning calendarId so you can then get/update/delete it. Use this instead of Get all Events when you know a keyword and time range but do NOT know which calendar the event lives in (Get all Events searches a single calendar). A start and end time are mandatory to bound the cross-calendar scan; matching uses Google's native q= filter, not semantic search. Read-only and idempotent.",idempotent:!0},props:{query:F.ShortText({displayName:"Search Term",description:`Free-text query matched against event fields (summary, description, location, attendee names/emails) using Google's native search. Example: "budget review".`,required:!0}),start_date:F.DateTime({displayName:"Start Time",description:`Lower bound (inclusive) for an event's end time, as an ISO 8601 timestamp (e.g. "2026-06-01T00:00:00Z"). Required to bound the cross-calendar scan.`,required:!0}),end_date:F.DateTime({displayName:"End Time",description:`Upper bound (exclusive) for an event's start time, as an ISO 8601 timestamp (e.g. "2026-06-30T23:59:59Z"). Required to bound the cross-calendar scan.`,required:!0}),single_events:F.Checkbox({displayName:"Expand Recurring Events?",description:"When enabled, recurring events are expanded into their individual instances instead of returning the underlying recurring event.",required:!1,defaultValue:!0})},outputSchema:vx,async run(t){let{query:e,start_date:r,end_date:n,single_events:i}=t.propsValue,s=await Ie(t.auth),c=(0,eh.default)(r).toISOString(),d=(0,eh.default)(n).toISOString(),p=await kt(t.auth),m=[],y=[];for(let h of p){let f="";do{let l={q:e,timeMin:c,timeMax:d,singleEvents:i?"true":"false",showDeleted:"false",maxResults:"250"};f&&(l.pageToken=f);let g={method:"GET",url:`${ae.baseUrl}/calendars/${encodeURIComponent(h.id)}/events`,queryParams:l,authentication:{type:"BEARER_TOKEN",token:s}};try{let v=await Ue.sendRequest(g),E=v.body.items??[];for(let b of E)m.push({...b,calendarId:h.id});f=v.body.nextPageToken}catch(v){let E=v.response?.status;if(E===403||E===404){y.push({calendarId:h.id,status:E}),f="";continue}throw E===429?new Error("Google Calendar rate limit reached while searching calendars. Please retry shortly."):v}}while(f)}return{events:m,count:m.length,calendars_searched:p.length-y.length,...y.length>0?{skipped_calendars:y,warning:"Some calendars could not be searched (access denied or not found); a missing match may live in a skipped calendar. See skipped_calendars."}:{}}}});var Sr=qe(Sn()),Nx=qe(Dx());Sr.default.extend(Nx.default);function gL(t){if(t.length===0)return[];let e=[...t].sort((n,i)=>n.start-i.start),r=[{...e[0]}];for(let n=1;n<e.length;n++){let i=r[r.length-1],s=e[n];s.start<=i.end?i.end=Math.max(i.end,s.end):r.push({...s})}return r}o(gL,"mergeIntervals");function yL(t,e,r){let n=[],i=e;for(let s of t)if(s.start>i&&n.push({start:i,end:Math.min(s.start,r)}),i=Math.max(i,s.end),i>=r)break;return i<r&&n.push({start:i,end:r}),n.filter(s=>s.end>s.start)}o(yL,"complement");function vL(t,e,r){let n=[];for(let i of t){let s=Sr.default.utc(i.start).startOf("day"),c=Sr.default.utc(i.end);for(;s.valueOf()<i.end;){let d=s.add(e,"hour"),p=s.add(r,"hour"),m=Math.max(i.start,d.valueOf()),y=Math.min(i.end,p.valueOf());if(y>m&&n.push({start:m,end:y}),s=s.add(1,"day"),s.valueOf()>c.valueOf())break}}return n}o(vL,"clipToWorkingHours");var zx=ve({auth:ne,name:"google_calendar_find_free_slots",displayName:"Find Free Time Slots",description:"Computes open time slots shared across one or more calendars within a window, by inverting their busy blocks.",audience:"ai",aiMetadata:{description:'Return the OPEN time slots common to the selected calendars within a window \u2014 the inverse of their combined busy blocks, optionally filtered to a minimum duration and to working hours. Use this instead of Find Busy/Free Periods (which returns only busy blocks and forces you to invert and reconcile them yourself) when you need the actual free intervals to answer "when can everyone meet". Idempotent because it performs no writes, but the result depends entirely on the window: pass absolute start/end times, since a window relative to "now" yields a shifting set of slots.',idempotent:!0},props:{calendar_ids:F.MultiSelectDropdown({auth:ne,displayName:"Calendars",description:"The calendars whose schedules must all be free. A slot is returned only when it is open on every selected calendar.",required:!0,refreshers:[],options:o(async({auth:t})=>t?{disabled:!1,options:(await kt(t)).map(n=>({label:n.summary,value:n.id}))}:{disabled:!0,placeholder:"Connect your account first",options:[]},"options")}),start_date:F.DateTime({displayName:"Window Start",description:'Start of the search window, as an absolute ISO 8601 timestamp (e.g. "2026-06-01T09:00:00Z"). Prefer absolute times over relative ones.',required:!0}),end_date:F.DateTime({displayName:"Window End",description:'End of the search window, as an absolute ISO 8601 timestamp (e.g. "2026-06-05T18:00:00Z").',required:!0}),min_duration_minutes:F.Number({displayName:"Minimum Slot Duration (minutes)",description:"Discard any open slot shorter than this many minutes. Leave empty to return every open slot regardless of length.",required:!1}),working_hours_start:F.Number({displayName:"Working Hours Start (hour 0-23)",description:"If set together with Working Hours End, each day's open slots are clipped to this hour range, interpreted in UTC (not the calendar's local time zone). Example: 9 for 09:00 UTC. Leave both unset to return slots across the full window.",required:!1}),working_hours_end:F.Number({displayName:"Working Hours End (hour 0-23)",description:"Upper bound of the daily working-hours window. Example: 17 for 5 PM. Ignored unless Working Hours Start is also set.",required:!1})},outputSchema:hx,async run(t){let{calendar_ids:e,start_date:r,end_date:n,min_duration_minutes:i,working_hours_start:s,working_hours_end:c}=t.propsValue,d=await Ie(t.auth),p=(0,Sr.default)(r).valueOf(),m=(0,Sr.default)(n).valueOf();if(m<=p)throw new Error("Window End must be after Window Start.");let y={method:"POST",url:`${ae.baseUrl}/freeBusy`,body:{timeMin:(0,Sr.default)(r).toISOString(),timeMax:(0,Sr.default)(n).toISOString(),items:e.map(b=>({id:b}))},authentication:{type:"BEARER_TOKEN",token:d}},h=await Ue.sendRequest(y),f=[],l=[];for(let b of Object.keys(h.body.calendars)){let C=h.body.calendars[b];if(C.errors?.length){l.push({calendarId:b,errors:C.errors});continue}let U=C.busy??[];for(let J of U)f.push({start:(0,Sr.default)(J.start).valueOf(),end:(0,Sr.default)(J.end).valueOf()})}if(l.length>0)throw new Error(`Could not read availability for calendar(s): ${l.map(b=>`${b.calendarId} (${b.errors.map(C=>C.reason).join(", ")})`).join("; ")}. A slot can only be marked free if every selected calendar is free, so free slots cannot be computed while any of them are unreadable. Verify the calendar IDs with List Calendars.`);let g=gL(f),v=yL(g,p,m);if(s!==void 0&&c!==void 0&&c>s&&(v=vL(v,s,c)),i!==void 0&&i>0){let b=i*60*1e3;v=v.filter(C=>C.end-C.start>=b)}let E=v.map(b=>({start:(0,Sr.default)(b.start).toISOString(),end:(0,Sr.default)(b.end).toISOString(),duration_minutes:Math.round((b.end-b.start)/6e4)}));return{free_slots:E,count:E.length}}});var Ux=qe(xn());var nh=qe(Sn()),Mx=ve({auth:ne,name:"google_calendar_list_recurring_event_instances",displayName:"List Recurring Event Instances",description:"Lists the individual occurrences of one recurring event series, each with its own instance event ID.",audience:"ai",aiMetadata:{description:"List the individual occurrences of a single recurring event series, identified by its recurring-event ID, each returned with its own distinct instance event ID. Use this when you need to inspect, reschedule, or cancel ONE occurrence of a series rather than the whole series; Get all Events expands recurring events only across a whole-calendar window and cannot target one series by ID. Requires the recurring series' event ID; optionally bound by a time range. Read-only and idempotent.",idempotent:!0},props:{calendar_id:ae.calendarDropdown(),event_id:F.ShortText({displayName:"Recurring Event ID",description:'The event ID of the recurring SERIES (the parent), e.g. "abc123def456". Obtain it from Search Events Across Calendars or Get all Events. Individual instance IDs will not work here.',required:!0}),time_min:F.DateTime({displayName:"Start Time",description:`Optional lower bound (inclusive) for an instance's end time, as an ISO 8601 timestamp with offset (e.g. "2026-06-01T00:00:00Z").`,required:!1}),time_max:F.DateTime({displayName:"End Time",description:`Optional upper bound (exclusive) for an instance's start time, as an ISO 8601 timestamp with offset (e.g. "2026-06-30T23:59:59Z").`,required:!1}),show_deleted:F.Checkbox({displayName:"Include Cancelled Instances",description:"Whether to include cancelled (deleted) instances of the series in the result. Defaults to false.",required:!1,defaultValue:!1}),max_results:F.Number({displayName:"Max Results",description:"Maximum number of instances to return per page (1-2500). Defaults to the API default of 250.",required:!1})},outputSchema:gx,async run(t){let{calendar_id:e,event_id:r,time_min:n,time_max:i,show_deleted:s,max_results:c}=t.propsValue,d=await _t(t.auth),p=(0,Ux.calendar)({version:"v3",auth:d});try{let m=await p.events.instances({calendarId:e,eventId:r,timeMin:n?(0,nh.default)(n).toISOString():void 0,timeMax:i?(0,nh.default)(i).toISOString():void 0,showDeleted:s??!1,maxResults:c}),y=m.data.items??[];return{instances:y,count:y.length,nextPageToken:m.data.nextPageToken??null}}catch(m){let y=m.response?.status??m.code;throw y===404?new Error(`Recurring event "${r}" not found in calendar "${e}". Verify the ID belongs to a recurring series.`):y===400?new Error(`Invalid request: "${r}" may not be a recurring event. The instances endpoint only works on recurring series.`):y===403?new Error(`Access denied to event "${r}" in calendar "${e}". Check your permissions.`):m}}});var Lx=qe(xn());var jx=ve({auth:ne,name:"google_calendar_move_event",displayName:"Move Event to Another Calendar",description:"Moves an existing event from one calendar to another, preserving its event ID and metadata.",audience:"ai",aiMetadata:{description:"Move an existing event from a source calendar to a destination calendar in place, preserving the event ID, conferencing, and attendee state. Use this instead of deleting and recreating the event (which loses the ID and metadata) when you need to transfer an event between calendars. Idempotent: moving an event to the calendar it already lives on is treated as a no-op. The source and destination must be writable calendars.",idempotent:!0},props:{calendar_id:ae.calendarDropdown("writer"),event_id:F.ShortText({displayName:"Event ID",description:'The ID of the event to move, e.g. "abc123def456". Obtain it from Search Events Across Calendars or Get all Events.',required:!0}),destination_calendar_id:F.Dropdown({auth:ne,displayName:"Destination Calendar",description:"The calendar to move the event to.",refreshers:[],required:!0,options:o(async({auth:t})=>t?{disabled:!1,options:(await kt(t,"writer")).map(r=>({label:r.summary,value:r.id}))}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),send_updates:F.StaticDropdown({displayName:"Send Notifications",description:"Who should receive notifications about the change of the event's organizer.",required:!1,defaultValue:"none",options:{options:[{label:"To everyone",value:"all"},{label:"To external guests only",value:"externalOnly"},{label:"To no one",value:"none"}]}})},outputSchema:yx,async run(t){let{calendar_id:e,event_id:r,destination_calendar_id:n,send_updates:i}=t.propsValue,s=await _t(t.auth),c=(0,Lx.calendar)({version:"v3",auth:s});if(e===n)return{moved:!1,already_in_destination:!0,event:(await c.events.get({calendarId:n,eventId:r})).data};try{return await c.events.move({calendarId:e,eventId:r,destination:n,sendUpdates:i??"none"}),{moved:!0,already_in_destination:!1,event:(await c.events.get({calendarId:n,eventId:r})).data}}catch(d){let p=d.response?.status??d.code;throw p===404?new Error(`Event "${r}" not found in source calendar "${e}". Verify the event ID and source calendar.`):p===403?new Error(`Access denied while moving event "${r}". Both the source and destination calendars must be writable.`):p===400?new Error(`Invalid move request for event "${r}". The destination must differ from the source and both must be valid calendars.`):d}}});var Fx=ve({auth:ne,name:"google_calendar_create_event",displayName:"Create Event",description:"Create a new event on a Google Calendar with structured fields (title, start/end, location, description, attendees, color) and an optional Google Meet link.",audience:"ai",aiMetadata:{description:'Create a new event on a calendar from explicit structured fields (title, start/end times, location, description, attendees, color, guest permissions) with an optional Google Meet link. Use this when you already have the event details; for a single natural-language phrase use the quick-add path instead. Resolve calendarId via google_calendar_list_calendars (default "primary"). Requires a title and start time; end defaults to 30 minutes after start. Not idempotent: each call creates a new event.',idempotent:!1},props:Fm,outputSchema:Ze,run:qm});var{eventId:yre,calendar_id:vre,guests_can_modify:_re,guests_can_invite_others:bre,guests_can_see_other_guests:Ere,..._L}=Kc;function oh(t){return F.StaticDropdown({displayName:t,description:"Leave unset to keep the event's current value.",required:!1,options:{options:[{label:"True",value:"true"},{label:"False",value:"false"}]}})}o(oh,"guestPermissionProp");function ih(t){return t===void 0?void 0:t==="true"}o(ih,"toOptionalBoolean");var bL={calendar_id:Kc.calendar_id,event_id:F.ShortText({displayName:"Event ID",description:"The ID of the event to update. Resolve it via List Events or Search Events Across Calendars.",required:!0}),..._L,guests_can_modify:oh("Guests can modify"),guests_can_invite_others:oh("Guests can invite others"),guests_can_see_other_guests:oh("Guests can see other guests")},qx=ve({auth:ne,name:"google_calendar_update_event",displayName:"Update Event",description:"Update fields of an existing Google Calendar event by ID using a safe get-then-merge; fields you leave unset keep their current values.",audience:"ai",aiMetadata:{description:"Update fields of an existing event (title, times, location, description, color, attendees, guest permissions) identified by calendar and event ID. It fetches the event first and merges, so unset fields keep their current values (it never blanks out attendees/recurrence/conferencing). Use this to edit or reschedule an existing event rather than recreating it. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Idempotent: applying the same field values repeatedly leaves the event in the same state.",idempotent:!0},props:bL,outputSchema:Ze,run:o(t=>Zm({...t,propsValue:{...t.propsValue,eventId:t.propsValue.event_id,guests_can_modify:ih(t.propsValue.guests_can_modify),guests_can_invite_others:ih(t.propsValue.guests_can_invite_others),guests_can_see_other_guests:ih(t.propsValue.guests_can_see_other_guests)}}),"run")});var EL={calendar_id:ae.calendarDropdown("writer"),event_id:F.ShortText({displayName:"Event ID",description:"The ID of the event to delete. Resolve it via List Events or Search Events Across Calendars.",required:!0})},Bx=ve({auth:ne,name:"google_calendar_delete_event",displayName:"Delete Event",description:"Permanently delete an event from a Google Calendar by its event ID.",audience:"ai",aiMetadata:{description:"Permanently delete an event from a calendar, identified by calendar and event ID. Use to cancel or remove an existing event; this cannot be undone, so confirm the event ID first. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Idempotent: once deleted, re-running leaves the event absent (a repeat call may report it as already gone).",idempotent:!0},props:EL,run:o(t=>Bm({...t,propsValue:{calendar_id:t.propsValue.calendar_id,eventId:t.propsValue.event_id}}),"run")});var Vx=ve({auth:ne,name:"google_calendar_get_event",displayName:"Get Event",description:"Fetch the full details of a single Google Calendar event by its event ID.",audience:"ai",aiMetadata:{description:"Fetch the full details of one event by its unique event ID within a calendar. Use this when you already have an event ID (from a trigger or a list action) and need its current details; to find an event when you do not have its ID, use google_calendar_list_events or google_calendar_search_events_all_calendars instead. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Read-only and idempotent.",idempotent:!0},props:Xm,outputSchema:Ze,run:Qm});var Gx=ve({auth:ne,name:"google_calendar_list_events",displayName:"List Events",description:"List events from one Google Calendar, optionally filtered by date range, free-text search, and event types.",audience:"ai",aiMetadata:{description:`List events from one calendar, optionally narrowed by a date range, a free-text search term (matched with Google's native q= filter), and event types, optionally expanding recurring events into individual instances. Use this to browse or find events in a known calendar, including text search within that calendar; to search across every calendar when you do not know which one holds the event, use google_calendar_search_events_all_calendars instead. Resolve calendarId via google_calendar_list_calendars (default "primary"). Read-only and idempotent.`,idempotent:!0},props:Gm,outputSchema:Hc,run:Hm});var Hx=ve({auth:ne,name:"google_calendar_find_busy_periods",displayName:"Find Busy Periods",description:"Return the raw busy time blocks of one or more calendars within a window, via the freebusy query.",audience:"ai",aiMetadata:{description:"Query one or more calendars for their raw busy time blocks within a start/end window, without exposing event details (the low-level freebusy primitive). Use this when you need the busy intervals themselves (e.g. across several shared calendars); to get the inverse open slots directly, use google_calendar_find_free_slots instead. Resolve calendarId values via google_calendar_list_calendars. Requires the calendars to check and a time range. Read-only and idempotent.",idempotent:!0},props:Jm,outputSchema:Wc,run:Ym});var Wx=qe(xn());var Zx=ve({auth:ne,name:"google_calendar_remove_attendee",displayName:"Remove Attendee",description:"Remove one attendee (by email) from an existing Google Calendar event, preserving the rest of the guest list.",audience:"ai",aiMetadata:{description:"Remove a single attendee, matched by email, from an existing event by fetching the current attendee list, dropping that one guest, and patching the event. Use this to uninvite one person without disturbing the other guests; to add guests use the add-attendees action instead. Resolve calendarId via google_calendar_list_calendars and eventId via google_calendar_list_events / google_calendar_search_events_all_calendars. Not idempotent (notifications may fire), though re-removing an already-absent attendee is a no-op on state. It uses optimistic concurrency (If-Match on the event revision), so a simultaneous edit by someone else fails with a retry-able conflict instead of silently clobbering their change.",idempotent:!1},props:{calendar_id:ae.calendarDropdown("writer"),event_id:F.ShortText({displayName:"Event ID",description:"The ID of the event to remove the attendee from. Resolve it via List Events or Search Events Across Calendars.",required:!0}),attendee_email:F.ShortText({displayName:"Attendee Email",description:"Email address of the attendee to remove from the event.",required:!0}),send_updates:F.StaticDropdown({displayName:"Send Notifications",description:"Who should be notified about the attendee change.",required:!1,defaultValue:"none",options:{options:[{label:"To everyone",value:"all"},{label:"To external guests only",value:"externalOnly"},{label:"To no one",value:"none"}]}})},outputSchema:mx,async run(t){let{calendar_id:e,event_id:r,attendee_email:n,send_updates:i}=t.propsValue,s=await _t(t.auth),c=(0,Wx.calendar)({version:"v3",auth:s}),d=n.trim().toLowerCase();try{let p=await c.events.get({calendarId:e,eventId:r}),m=p.data.attendees??[],y=m.filter(l=>(l.email??"").trim().toLowerCase()!==d);if(y.length===m.length)return{removed:!1,attendee_email:n,message:`Attendee "${n}" was not on event "${r}"; nothing to remove.`,event:p.data};let h=p.data.etag??void 0,f=await c.events.patch({calendarId:e,eventId:r,sendUpdates:i??"none",requestBody:{attendees:y}},h?{headers:{"If-Match":h}}:{});return{removed:!0,attendee_email:n,event:f.data}}catch(p){let m=p.response?.status??p.code;throw m===412?new Error(`Event "${r}" changed since it was read (a concurrent edit). Re-run Remove Attendee to retry against the latest version.`):m===404?new Error(`Event "${r}" not found in calendar "${e}". Verify the event ID and calendar.`):m===403?new Error(`Access denied while editing event "${r}". The calendar must be writable.`):p}}});var Kx=qe(xn());var ah=qe(Sn()),Jx=ve({auth:ne,name:"google_calendar_import_event",displayName:"Import Event",description:"Import an existing event (by iCalUID) into a Google Calendar as a private copy, using events.import.",audience:"ai",aiMetadata:{description:'Import an existing event into a calendar as a private copy, keyed by its iCalUID with a start and end time (the events.import primitive, distinct from creating a brand-new event or moving one). Use this to copy or de-duplicate an event across calendars; re-importing the same iCalUID updates the existing copy rather than duplicating it. Resolve calendarId via google_calendar_list_calendars (default "primary"). Only default (non-special) events can be imported. Not idempotent: each import can create or mutate the destination copy.',idempotent:!1},props:{calendar_id:ae.calendarDropdown("writer"),ical_uid:F.ShortText({displayName:"iCal UID",description:`The event's iCalUID (its globally unique identifier, e.g. "abc123@google.com"). This is the dedup key: re-importing the same UID updates the existing copy.`,required:!0}),summary:F.ShortText({displayName:"Title",description:"Title (summary) of the imported event.",required:!0}),start_date_time:F.DateTime({displayName:"Start Time",description:'Event start as an ISO 8601 timestamp (e.g. "2026-06-01T09:00:00Z").',required:!0}),end_date_time:F.DateTime({displayName:"End Time",description:'Event end as an ISO 8601 timestamp (e.g. "2026-06-01T10:00:00Z").',required:!0}),location:F.ShortText({displayName:"Location",required:!1}),description:F.LongText({displayName:"Description",description:"Description of the event. You can use HTML tags here.",required:!1})},outputSchema:Ze,async run(t){let{calendar_id:e,ical_uid:r,summary:n,start_date_time:i,end_date_time:s,location:c,description:d}=t.propsValue,p=await _t(t.auth),m=(0,Kx.calendar)({version:"v3",auth:p});try{return(await m.events.import({calendarId:e,requestBody:{iCalUID:r,summary:n,location:c??void 0,description:d??void 0,start:{dateTime:(0,ah.default)(i).toISOString()},end:{dateTime:(0,ah.default)(s).toISOString()}}})).data}catch(y){let h=y.response?.status??y.code;throw h===403?new Error(`Access denied while importing into calendar "${e}". The calendar must be writable.`):h===400?new Error(`Invalid import request. Ensure iCalUID, start, and end are provided and that the event is a default (non-special) event. (${y.message})`):y}}});var Yx=ve({auth:ne,name:"google_calendar_list_calendars",displayName:"List Calendars",description:"List every calendar in the user's calendar list, returning each calendar's id, summary, access role, time zone, and whether it is primary.",audience:"ai",aiMetadata:{description:`List all calendars on the user's calendar list, returning each one's calendarId, summary, accessRole, timeZone, and whether it is the primary calendar. This is the calendarId resolver: call it first to discover which calendars exist and obtain the calendarId that every event/freebusy atomic needs (default "primary"). Read-only and idempotent.`,idempotent:!0},props:{},outputSchema:px,async run(t){await Ie(t.auth);let e=await kt(t.auth);return{calendars:e.map(r=>({id:r.id,summary:r.summary,description:r.description,location:r.location,timeZone:r.timeZone,accessRole:r.accessRole,primary:r.primary??!1,selected:r.selected??!1,backgroundColor:r.backgroundColor,foregroundColor:r.foregroundColor})),count:e.length}}});var Xx=ve({auth:ne,name:"google_calendar_get_calendar",displayName:"Get Calendar",description:"Fetch one calendar's metadata (summary, time zone, description, location) by its calendar ID.",audience:"ai",aiMetadata:{description:`Fetch one calendar's metadata \u2014 summary, timeZone, description, and location \u2014 by its calendar ID. Use this to read a calendar's time zone, which is load-bearing when constructing correct event start/end windows. Resolve calendarId via google_calendar_list_calendars (default "primary"). Read-only and idempotent.`,idempotent:!0},props:{calendar_id:ae.calendarDropdown()},outputSchema:lx,async run(t){let{calendar_id:e}=t.propsValue,r=await Ie(t.auth),n={method:"GET",url:`${ae.baseUrl}/calendars/${encodeURIComponent(e)}`,authentication:{type:"BEARER_TOKEN",token:r}};try{return(await Ue.sendRequest(n)).body}catch(i){let s=i.response?.status;throw s===404?new Error(`Calendar "${e}" not found. Verify the calendar ID via List Calendars.`):s===403?new Error(`Access denied to calendar "${e}". Check your permissions.`):i}}});var Qx=ve({auth:ne,name:"google_calendar_get_colors",displayName:"Get Colors",description:"Fetch the Google Calendar color palette mapping colorId values to their hex background/foreground colors.",audience:"ai",aiMetadata:{description:"Fetch the global color palette: the mapping from each colorId to its background/foreground hex color, for both events and calendars. Use this to resolve a colorId before setting the color on google_calendar_create_event or google_calendar_update_event. Read-only and idempotent.",idempotent:!0},props:{},outputSchema:dx,async run(t){return await lu(t.auth)}});var eA=ve({auth:ne,name:"google_calendar_list_settings",displayName:"List Settings",description:"List the user's Google Calendar account settings (time zone, week start, date/time format, and more).",audience:"ai",aiMetadata:{description:`List all of the user's Google Calendar account settings as id/value pairs \u2014 including the account "timezone", "weekStart", and "format24HourTime". Use this to read the account time zone to anchor relative-date reasoning before building event windows, or to read a single setting (just pick its id from the returned list). Read-only and idempotent.`,idempotent:!0},props:{},outputSchema:fx,async run(t){let e=await Ie(t.auth),r={method:"GET",url:`${ae.baseUrl}/users/me/settings`,authentication:{type:"BEARER_TOKEN",token:e}},i=(await Ue.sendRequest(r)).body.items??[],s={};for(let c of i)s[c.id]=c.value;return{settings:s,items:i,count:i.length}}});var Yc="google_calendar_watch",Ci="google_calendar_sync_token",sh="google_calendar_seen_event_ids",SL=500;function tA(t,{event_types:e,search_filter:r,exclude_all_day:n}){if(e&&e.length>0){let i=t.eventType||"default";if(!e.includes(i))return!1}if(r&&r.trim()){let i=r.toLowerCase().trim(),s=(t.summary||"").toLowerCase(),c=(t.description||"").toLowerCase(),d=(t.location||"").toLowerCase();if(!(s.includes(i)||c.includes(i)||d.includes(i)))return!1}return!(n&&t.start?.date&&!t.start?.dateTime)}o(tA,"matchesFilters");var rA=jt({auth:ne,name:"new_event",displayName:"New Event",description:"Fires when a new event is created in a calendar.",aiMetadata:{description:"Fires when a brand-new event is created in the selected calendar (not on edits or cancellations), via Google push notifications. Each fired item is the new event; can be narrowed by event type, a text search across title/description/location, and an option to skip all-day events."},props:{calendar_id:ae.calendarDropdown("writer"),event_types:F.StaticMultiSelectDropdown({displayName:"Event Types to Monitor",description:"Filter by specific event types (leave empty to monitor all event types)",required:!1,options:{options:[{label:"Default Events",value:"default"},{label:"Birthday Events",value:"birthday"},{label:"Focus Time",value:"focusTime"},{label:"Out of Office",value:"outOfOffice"},{label:"Working Location",value:"workingLocation"},{label:"From Gmail",value:"fromGmail"}]}}),search_filter:F.ShortText({displayName:"Search Filter",description:"Only trigger for events containing this text in title, description, or location (optional)",required:!1}),exclude_all_day:F.Checkbox({displayName:"Exclude All-Day Events",description:"Skip triggering for all-day events",required:!1,defaultValue:!1})},outputSchema:Ze,type:"WEBHOOK",renewConfiguration:{strategy:"CRON",cronExpression:"0 */12 * * *"},sampleData:{kind:"calendar#event",etag:'"3419997894982000"',id:"sample_event_id_12345",status:"confirmed",htmlLink:"https://www.google.com/calendar/event?eid=c2FtcGxlX2V2ZW50X2lkXzEyMzQ1",created:"2025-08-15T11:02:27.000Z",updated:"2025-08-15T11:02:27.491Z",summary:"Team Sync",creator:{email:"creator@example.com"},organizer:{email:"creator@example.com",self:!0},start:{dateTime:"2025-08-18T10:00:00-07:00",timeZone:"America/Los_Angeles"},end:{dateTime:"2025-08-18T11:00:00-07:00",timeZone:"America/Los_Angeles"},iCalUID:"sample_event_id_12345@google.com",sequence:0,reminders:{useDefault:!0},eventType:"default"},async onEnable(t){let e=t.propsValue.calendar_id,r=t.auth,n=await zd(e,t.webhookUrl,r);await t.store.put(Yc,n);let i=await cu({calendarId:e,authProp:r});rt(i)||await t.store.put(Ci,i)},async onDisable(t){let e=t.auth,r=await t.store.get(Yc);r&&await Nd(r,e),await t.store.delete(Ci),await t.store.delete(sh)},async onRenew(t){let e=t.propsValue.calendar_id,r=t.auth,n=await t.store.get(Yc);n&&await Nd(n,r);let i=await zd(e,t.webhookUrl,r);await t.store.put(Yc,i)},async run(t){let n=t.payload.headers["x-goog-resource-state"],i={event_types:t.propsValue.event_types,search_filter:t.propsValue.search_filter,exclude_all_day:t.propsValue.exclude_all_day};if(n==="sync")return[];if(n!=="exists")return[];let s=t.propsValue.calendar_id,c=t.auth,d=await t.store.get(Ci);if(rt(d)){let g=await cu({calendarId:s,authProp:c});return rt(g)||await t.store.put(Ci,g),[]}let{items:p,nextSyncToken:m,syncTokenInvalid:y}=await Lb({calendarId:s,syncToken:d,authProp:c});if(y){let g=await cu({calendarId:s,authProp:c});return rt(g)||await t.store.put(Ci,g),[]}rt(m)||await t.store.put(Ci,m);let h=await t.store.get(sh),f=new Set(h??[]),l=[];for(let g of p)!g.id||g.status==="cancelled"||f.has(g.id)||(f.add(g.id),tA(g,i)&&l.push(g));if(f.size!==(h?.length??0)){let g=Array.from(f).slice(-SL);await t.store.put(sh,g)}return l},async test(t){let e=t.auth,r={event_types:t.propsValue.event_types,search_filter:t.propsValue.search_filter,exclude_all_day:t.propsValue.exclude_all_day},n=await jb(t.propsValue.calendar_id,e);return tA(n,r)?[n]:[]}});var Xc={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{if(r===0)return[];let{calendar_id:n,specific_event:i,event_id:s}=e;if(!n)return[];if(i&&!s)return[];let c=[];if(i&&s){let m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events/${s}`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};try{let h=(await Ue.sendRequest(m)).body,f=h.end?.dateTime??h.end?.date;f&&new Date(f).getTime()>r&&(c=[h])}catch(y){return console.error("Error fetching specific event:",y),[]}}else{let m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)},queryParams:{singleEvents:"true",orderBy:"startTime",timeMin:new Date(r).toISOString()}};c=(await Ue.sendRequest(m)).body.items}let d=[],p=Date.now();for(let m of c){let y=m.end?.dateTime??m.end?.date;if(!y)continue;let h=new Date(y).getTime();h>r&&h<=p&&d.push({epochMilliSeconds:h,data:m})}return d},"items")},nA=jt({auth:ne,name:"event_ends",displayName:"Event Ends",description:"Fires when an event ends.",aiMetadata:{description:"Fires once an event in the selected calendar reaches its end time, detected by polling. Each fired item is the event that just ended. Can watch all events in the calendar or be scoped to a single specific event."},props:{calendar_id:ae.calendarDropdown("writer"),specific_event:F.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:ae.eventDropdown(!1)},outputSchema:Ze,type:"POLLING",sampleData:{kind:"calendar#event",etag:'"3419997894982000"',id:"sample_event_id_67890",status:"confirmed",htmlLink:"https://www.google.com/calendar/event?eid=c2FtcGxlX2V2ZW50X2lkXzY3ODkw",created:"2025-08-14T09:00:00.000Z",updated:"2025-08-14T09:00:00.000Z",summary:"Project Deadline",creator:{email:"manager@example.com"},organizer:{email:"manager@example.com",self:!0},start:{dateTime:"2025-08-14T14:30:00+05:30",timeZone:"Asia/Kolkata"},end:{dateTime:"2025-08-14T15:30:00+05:30",timeZone:"Asia/Kolkata"},iCalUID:"sample_event_id_67890@google.com",sequence:0,reminders:{useDefault:!0},eventType:"default"},async onEnable(t){await Je.onEnable(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(Xc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var Qc={strategy:0,items:o(async({auth:t,propsValue:e})=>{let{calendar_id:r,specific_event:n,event_id:i,time_value:s,time_unit:c}=e;if(!r||!s||!c)return[];if(n&&!i)return[];let d=s*60*1e3;c==="hours"?d=s*60*60*1e3:c==="days"&&(d=s*24*60*60*1e3);let p=Date.now(),m=300*1e3,y=new Date(p+d).toISOString(),h=new Date(p+d+m).toISOString(),f=[];if(n&&i){let l={method:"GET",url:`${ae.baseUrl}/calendars/${r}/events/${i}`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};try{let v=(await Ue.sendRequest(l)).body,b=new Date(v.start?.dateTime??v.start?.date??0).getTime()-d;b>=p&&b<=p+m&&(f=[v])}catch(g){return console.error("Error fetching specific event:",g),[]}}else{let l={method:"GET",url:`${ae.baseUrl}/calendars/${r}/events`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)},queryParams:{singleEvents:"true",orderBy:"startTime",timeMin:y,timeMax:h}};f=(await Ue.sendRequest(l)).body.items}return f.map(l=>({epochMilliSeconds:new Date(l.start?.dateTime??l.start?.date??0).getTime()-d,data:l}))},"items")},oA=jt({auth:ne,name:"event_starts_in",displayName:"Event Start (Time Before)",description:"Fires at a specified amount of time before an event starts (e.g., a reminder).",aiMetadata:{description:"Fires a configurable lead time (in minutes, hours, or days) before an event in the selected calendar begins, acting as a pre-event reminder. Each fired item is the upcoming event. Can watch all events or a single specific event."},props:{calendar_id:ae.calendarDropdown("writer"),specific_event:F.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:ae.eventDropdown(!1),time_value:F.Number({displayName:"Time Before",description:"The amount of time before the event starts.",required:!0,defaultValue:15}),time_unit:F.StaticDropdown({displayName:"Time Unit",required:!0,options:{options:[{label:"Minutes",value:"minutes"},{label:"Hours",value:"hours"},{label:"Days",value:"days"}]},defaultValue:"minutes"})},outputSchema:Ze,type:"POLLING",sampleData:{},async onEnable(t){await Je.onEnable(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(Qc,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var el={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{calendar_id:n,search_term:i,event_types:s,search_fields:c}=e;if(!n||!i)return[];let d;r===0?(d=new Date,d.setDate(d.getDate()-1)):d=new Date(r);let p={singleEvents:"true",orderBy:"updated",updatedMin:d.toISOString(),q:i};s&&s.length>0&&s.forEach(l=>{p.eventTypes?p.eventTypes+="&eventTypes="+l:p.eventTypes=l});let m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)},queryParams:p};return(await Ue.sendRequest(m)).body.items.filter(l=>{let g=new Date(l.created??0).getTime();if(!(new Date(l.updated??0).getTime()-g<5e3))return!1;if(c&&c.length>0){let b=i.toLowerCase();return c.some(C=>{switch(C){case"summary":return l.summary?.toLowerCase().includes(b)||!1;case"description":return l.description?.toLowerCase().includes(b)||!1;case"location":return l.location?.toLowerCase().includes(b)||!1;case"attendees":return l.attendees?.some(U=>U.email?.toLowerCase().includes(b)||U.displayName?.toLowerCase().includes(b))||!1;default:return!1}})}return!0}).map(l=>({epochMilliSeconds:new Date(l.updated).getTime(),data:l}))},"items")},iA=jt({auth:ne,name:"new_event_matching_search",displayName:"New Event Matching Search",description:"Fires when a new event is created that matches a specified search term.",aiMetadata:{description:"Fires when a newly created event in the selected calendar matches a required search term (matched across title, description, location, and attendees by default, or restricted to chosen fields). Each fired item is the matching new event; can also be filtered by event type."},props:{calendar_id:ae.calendarDropdown("writer"),search_term:F.ShortText({displayName:"Search Term",description:"The keyword(s) to search for in new events (searches across title, description, location, and attendees by default).",required:!0}),event_types:F.StaticMultiSelectDropdown({displayName:"Event Types",description:"Filter by specific event types (optional)",required:!1,options:{options:[{label:"Default Events",value:"default"},{label:"Birthday Events",value:"birthday"},{label:"Focus Time",value:"focusTime"},{label:"Out of Office",value:"outOfOffice"},{label:"Working Location",value:"workingLocation"},{label:"From Gmail",value:"fromGmail"}]}}),search_fields:F.StaticMultiSelectDropdown({displayName:"Search In Fields",description:"Specify which fields to search in (leave empty to use Google's default search across all fields)",required:!1,options:{options:[{label:"Event Title/Summary",value:"summary"},{label:"Event Description",value:"description"},{label:"Event Location",value:"location"},{label:"Attendee Names/Emails",value:"attendees"}]}})},outputSchema:Ze,type:"POLLING",sampleData:{id:"abc123def456",summary:"Final Project Review",description:"Review of the Q3 final project deliverables.",status:"confirmed",created:"2025-08-14T09:05:00.000Z",updated:"2025-08-14T09:05:01.000Z",start:{dateTime:"2025-09-01T10:00:00-07:00"},end:{dateTime:"2025-09-01T11:30:00-07:00"},organizer:{email:"project.manager@example.com"}},async onEnable(t){await Je.onEnable(el,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(el,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(el,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(el,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var tl={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{calendar_id:n,specific_event:i,event_id:s,cancellation_reason:c}=e;if(!n)return[];if(i&&!s)return[];let d;r===0?(d=new Date,d.setDate(d.getDate()-1)):d=new Date(r);let p=[];if(i&&s){let m={method:"GET",url:`${ae.baseUrl}/calendars/${n}/events/${s}`,authentication:{type:"BEARER_TOKEN",token:await Ie(t)}};try{let h=(await Ue.sendRequest(m)).body;new Date(h.updated??0).getTime()>r&&h.status==="cancelled"&&(p=[h])}catch(y){return console.error("Error fetching specific event:",y),[]}}else p=(await da(n,!0,t,d)).filter(y=>y.status==="cancelled");return c&&c.length>0&&(p=p.filter(m=>c.some(y=>{switch(y){case"deleted":return!m.summary||m.summary.includes("Deleted");case"declined":return m.attendees?.some(h=>h.responseStatus==="declined")||!1;case"rescheduled":return m.summary?.toLowerCase().includes("rescheduled")||m.description?.toLowerCase().includes("rescheduled")||!1;case"other":return!0;default:return!0}}))),p.map(m=>({epochMilliSeconds:new Date(m.updated).getTime(),data:m}))},"items")},aA=jt({auth:ne,name:"event_cancelled",displayName:"Event Cancelled",description:"Fires when an event is canceled or deleted.",aiMetadata:{description:"Fires when an event in the selected calendar transitions to a cancelled (or deleted) state, detected by polling. Each fired item is the cancelled event; can optionally be filtered by cancellation reason (deleted, attendee declined, rescheduled, other) and scoped to a single specific event."},props:{calendar_id:ae.calendarDropdown("writer"),specific_event:F.Checkbox({displayName:"Target Specific Event",description:"Enable to monitor a specific event instead of all events in the calendar.",required:!1,defaultValue:!1}),event_id:ae.eventDropdown(!1),cancellation_reason:F.StaticMultiSelectDropdown({displayName:"Cancellation Reasons",description:"Filter by specific types of cancellations (optional)",required:!1,options:{options:[{label:"Event Deleted",value:"deleted"},{label:"Attendee Declined",value:"declined"},{label:"Event Rescheduled",value:"rescheduled"},{label:"Other Cancellations",value:"other"}]}})},outputSchema:Ze,type:"POLLING",sampleData:{id:"abc123def456_cancelled",summary:"Cancelled: Q3 Planning Session",status:"cancelled",created:"2025-07-20T10:00:00.000Z",updated:"2025-08-14T09:30:00.000Z",organizer:{email:"project.manager@example.com"},start:{dateTime:"2025-08-25T10:00:00-07:00"},end:{dateTime:"2025-08-25T11:30:00-07:00"}},async onEnable(t){await Je.onEnable(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return await Je.test(tl,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})}});var uh={strategy:1,items:o(async({auth:t,store:e,propsValue:r})=>{let{access_role_filter:n,calendar_name_filter:i,exclude_shared:s}=r,d=await kt(t);if(n&&n.length>0&&(d=d.filter(f=>n.includes(f.accessRole))),i&&i.trim()){let f=i.toLowerCase().trim();d=d.filter(l=>l.summary?.toLowerCase().includes(f)||l.description?.toLowerCase().includes(f))}s&&(d=d.filter(f=>f.accessRole==="owner"||f.primary));let p=d.map(f=>f.id),m=await e.get("calendars")||[],y=new Set(m),h=d.filter(f=>!y.has(f.id));return await e.put("calendars",p),h.map(f=>({id:f.id,data:{...f,isOwned:f.accessRole==="owner"||f.primary,isShared:f.accessRole!=="owner"&&!f.primary,calendarType:f.primary?"primary":f.accessRole==="owner"?"owned":"shared"}}))},"items")},sA=jt({auth:ne,name:"new_calendar",displayName:"New Calendar",description:"Fires when a new calendar is created or becomes accessible.",aiMetadata:{description:"Fires when a calendar newly appears in the connected account's calendar list, whether created or shared in, detected by polling. Each fired item is the new calendar. Can be filtered by access role, a name/description text match, and an option to exclude shared calendars."},props:{access_role_filter:F.StaticMultiSelectDropdown({displayName:"Access Role Filter",description:"Only trigger for calendars with specific access roles (optional)",required:!1,options:{options:[{label:"Owner",value:"owner"},{label:"Writer",value:"writer"},{label:"Reader",value:"reader"},{label:"Free/Busy Reader",value:"freeBusyReader"}]}}),calendar_name_filter:F.ShortText({displayName:"Calendar Name Filter",description:"Only trigger for calendars containing this text in name or description (optional)",required:!1}),exclude_shared:F.Checkbox({displayName:"Exclude Shared Calendars",description:"Only trigger for calendars you own, not shared calendars",required:!1,defaultValue:!1})},outputSchema:ux,type:"POLLING",sampleData:{id:"sample_calendar_id@group.calendar.google.com",summary:"New Project Team Calendar",description:"A shared calendar for the new project team.",timeZone:"Asia/Kolkata",backgroundColor:"#9fe1e7",foregroundColor:"#000000",accessRole:"owner",isOwned:!0,isShared:!1,calendarType:"owned",primary:!1},async onEnable(t){let e=await kt(t.auth),{access_role_filter:r,calendar_name_filter:n,exclude_shared:i}=t.propsValue,s=e;if(r&&r.length>0&&(s=s.filter(c=>r.includes(c.accessRole))),n&&n.trim()){let c=n.toLowerCase().trim();s=s.filter(d=>d.summary?.toLowerCase().includes(c)||d.description?.toLowerCase().includes(c))}i&&(s=s.filter(c=>c.accessRole==="owner"||c.primary)),await t.store.put("calendars",s.map(c=>c.id)),await Je.onEnable(uh,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async onDisable(t){await Je.onDisable(uh,{auth:t.auth,store:t.store,propsValue:t.propsValue})},async run(t){return await Je.poll(uh,{auth:t.auth,store:t.store,propsValue:t.propsValue,files:t.files})},async test(t){return(await kt(t.auth)).slice(-1).map(n=>({id:n.id,data:{...n,isOwned:n.accessRole==="owner"||n.primary,isShared:n.accessRole!=="owner"&&!n.primary,calendarType:n.primary?"primary":n.accessRole==="owner"?"owned":"shared"}}))}});var wL=wv({minimumSupportedRelease:"0.86.4",logoUrl:"https://cdn.activepieces.com/pieces/google-calendar.png",categories:["PRODUCTIVITY"],displayName:"Google Calendar",description:"Get organized and stay on schedule",authors:["OsamaHaikal","bibhuty-did-this","Vitalini","pfernandez98","kishanprmr","MoShizzle","khaledmashaly","abuaboud","ikus060","Cloudieunnie","sanket-a11y","geekyme"],auth:ne,actions:[Cx,Sx,Ex,Px,Ax,Tx,Ox,kx,$x,zx,Mx,jx,Fx,qx,Bx,Vx,Gx,Hx,Zx,Jx,Yx,Xx,Qx,eA,Ub({auth:ne,baseUrl(){return ae.baseUrl},authMapping:o(async t=>({Authorization:`Bearer ${await Ie(t)}`}),"authMapping")})],triggers:[Ix,rA,nA,oA,iA,aA,sA]});0&&(module.exports={createGoogleClient,getAccessToken,googleCalendar,googleCalendarAuth});
|
|
70
70
|
/*! Bundled license information:
|
|
71
71
|
|
|
72
72
|
mime-types/index.js:
|