@activepieces/piece-alai 0.1.4 → 0.1.6
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 +4 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";var Ms=Object.create;var Je=Object.defineProperty;var js=Object.getOwnPropertyDescriptor;var Ls=Object.getOwnPropertyNames;var Fs=Object.getPrototypeOf,Bs=Object.prototype.hasOwnProperty;var o=(e,t)=>Je(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),cn=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:!0})},pn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ls(t))!Bs.call(e,i)&&i!==r&&Je(e,i,{get:()=>t[i],enumerable:!(n=js(t,i))||n.enumerable});return e};var Ne=(e,t,r)=>(r=e!=null?Ms(Fs(e)):{},pn(t||!e||!e.__esModule?Je(r,"default",{value:e,enumerable:!0}):r,e)),Zs=e=>pn(Je({},"__esModule",{value:!0}),e);var Ao=E((So,jt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function g(s,l){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let f=0,m=-1,v=(s.match(d.zoneIndex)||[])[0],P,M;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)f++;if(s.substr(0,2)==="::"&&f--,s.substr(-2,2)==="::"&&f--,f>l)return null;for(M=l-f,P=":";M--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),l=function(){let Y=s.split(":"),re=[];for(let Ae=0;Ae<Y.length;Ae++)re.push(parseInt(Y[Ae],16));return re}(),{parts:l,zoneId:v}}o(g,"expandIPv6");function y(s,l,f,m){if(s.length!==l.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=f-m,P<0&&(P=0),s[v]>>P!==l[v]>>P)return!1;m-=f,v+=1}return!0}o(y,"matchCIDR");function _(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(_,"parseIntAuto");function b(s,l){for(;s.length<l;)s=`0${s}`;return s}o(b,"padPart");let x={};x.IPv4=function(){function s(l){if(l.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let f,m;for(f=0;f<l.length;f++)if(m=l[f],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=l}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(l,f){let m;if(f===void 0&&(m=l,l=m[0],f=m[1]),l.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,l.octets,8,f)},s.prototype.prefixLengthFromSubnetMask=function(){let l=0,f=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,M;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(M=m[P],f&&M!==0)return null;M!==8&&(f=!0),l+=M}else return null;return 32-l},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let l=this.parseCIDR(s),f=l[0].toByteArray(),m=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(f[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let l=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!l?!1:x.IPv4.isValidFourPartDecimal(l[1])},x.IPv4.networkAddressFromCIDR=function(s){let l,f,m,v,P;try{for(l=this.parseCIDR(s),m=l[0].toByteArray(),P=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],f=0;f<4;)v.push(parseInt(m[f],10)&parseInt(P[f],10)),f++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let l=this.parser(s);if(l===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(l)},x.IPv4.parseCIDR=function(s){let l;if(l=s.match(/^(.+)\/(\d+)$/)){let f=parseInt(l[2]);if(f>=0&&f<=32){let m=[this.parse(l[1]),f];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let l,f,m;if(l=s.match(r.fourOctet))return function(){let v=l.slice(1,6),P=[];for(let M=0;M<v.length;M++)f=v[M],P.push(_(f));return P}();if(l=s.match(r.longValue)){if(m=_(l[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v}().reverse()}else return(l=s.match(r.twoOctet))?function(){let v=l.slice(1,4),P=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P}():(l=s.match(r.threeOctet))?function(){let v=l.slice(1,5),P=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(_(v[1])),P.push(m>>8&255),P.push(m&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let l=[0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)l[f]=255,f++;return m<4&&(l[m]=Math.pow(2,s%8)-1<<8-s%8),new this(l)},x.IPv6=function(){function s(l,f){let m,v;if(l.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(l[m]<<8|l[m+1]);else if(l.length===8)this.parts=l;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");f&&(this.zoneId=f)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(l,f){let m;if(f===void 0&&(m=l,l=m[0],f=m[1]),l.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,l.parts,16,f)},s.prototype.prefixLengthFromSubnetMask=function(){let l=0,f=!1,m={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},v,P;for(let M=7;M>=0;M-=1)if(v=this.parts[M],v in m){if(P=m[v],f&&P!==0)return null;P!==16&&(f=!0),l+=P}else return null;return 128-l},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let l,f=[],m=this.parts;for(let v=0;v<m.length;v++)l=m[v],f.push(l>>8),f.push(l&255);return f},s.prototype.toFixedLengthString=function(){let l=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(b(this.parts[v].toString(16),4));return m}.call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),l+f},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let l=this.parts.slice(-2),f=l[0],m=l[1];return new x.IPv4([f>>8,f&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let l=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),l+f},s.prototype.toRFC5952String=function(){let l=/((^|:)(0(:|$)){2,})/g,f=this.toNormalizedString(),m=0,v=-1,P;for(;P=l.exec(f);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?f:`${f.substring(0,m)}::${f.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let l=this.parseCIDR(s),f=l[0].toByteArray(),m=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(f[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(l){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${l})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let l=this.parser(s);return new this(l.parts,l.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let l,f,m,v,P;try{for(l=this.parseCIDR(s),m=l[0].toByteArray(),P=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],f=0;f<16;)v.push(parseInt(m[f],10)&parseInt(P[f],10)),f++;return new this(v)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},x.IPv6.parse=function(s){let l=this.parser(s);if(l.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(l.parts,l.zoneId)},x.IPv6.parseCIDR=function(s){let l,f,m;if((f=s.match(/^(.+)\/(\d+)$/))&&(l=parseInt(f[2]),l>=0&&l<=128))return m=[this.parse(f[1]),l],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let l,f,m,v,P,M;if(m=s.match(d.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(d.native.test(s))return g(s,8);if((m=s.match(d.transitional))&&(M=m[6]||"",l=m[1],m[1].endsWith("::")||(l=l.slice(0,-1)),l=g(l+M,6),l.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],f=0;f<P.length;f++)if(v=P[f],!(0<=v&&v<=255))return null;return l.parts.push(P[0]<<8|P[1]),l.parts.push(P[2]<<8|P[3]),{parts:l.parts,zoneId:l.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)l[f]=255,f++;return m<16&&(l[m]=Math.pow(2,s%8)-1<<8-s%8),new this(l)},x.fromByteArray=function(s){let l=s.length;if(l===4)return new x.IPv4(s);if(l===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let l=this.parse(s);return l.kind()==="ipv6"&&l.isIPv4MappedAddress()?l.toIPv4Address():l},x.subnetMatch=function(s,l,f){let m,v,P,M;f==null&&(f="unicast");for(v in l)if(Object.prototype.hasOwnProperty.call(l,v)){for(P=l[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(M=P[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return v}return f},typeof jt<"u"&&jt.exports?jt.exports=x:e.ipaddr=x})(So)});var Ti=E((VS,Ii)=>{var bi=require("stream").Stream,vp=require("util");Ii.exports=pe;function pe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(pe,"DelayedStream");vp.inherits(pe,bi);pe.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(pe.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});pe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};pe.prototype.resume=function(){this._released||this.release(),this.source.resume()};pe.prototype.pause=function(){this.source.pause()};pe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};pe.prototype.pipe=function(){var e=bi.prototype.pipe.apply(this,arguments);return this.resume(),e};pe.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};pe.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Ai=E((WS,Si)=>{var xp=require("util"),$i=require("stream").Stream,Ei=Ti();Si.exports=G;function G(){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(G,"CombinedStream");xp.inherits(G,$i);G.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};G.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};G.prototype.append=function(e){var t=G.isStreamLike(e);if(t){if(!(e instanceof Ei)){var r=Ei.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};G.prototype.pipe=function(e,t){return $i.prototype.pipe.call(this,e,t),this.resume(),e};G.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}};G.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=G.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};G.prototype._pipeNext=function(e){this._currentStream=e;var t=G.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};G.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};G.prototype.write=function(e){this.emit("data",e)};G.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};G.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")};G.prototype.end=function(){this._reset(),this.emit("end")};G.prototype.destroy=function(){this._reset(),this.emit("close")};G.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};G.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};G.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};G.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ki=E((qS,zi)=>{"use strict";zi.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 Ri=E(te=>{"use strict";var Ht=ki(),_p=require("path").extname,Oi=/^\s*([^;\s]*)(?:;|\s|$)/,Pp=/^text\//i;te.charset=wi;te.charsets={lookup:wi};te.contentType=bp;te.extension=Ip;te.extensions=Object.create(null);te.lookup=Tp;te.types=Object.create(null);Ep(te.extensions,te.types);function wi(e){if(!e||typeof e!="string")return!1;var t=Oi.exec(e),r=t&&Ht[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Pp.test(t[1])?"UTF-8":!1}o(wi,"charset");function bp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(bp,"contentType");function Ip(e){if(!e||typeof e!="string")return!1;var t=Oi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Ip,"extension");function Tp(e){if(!e||typeof e!="string")return!1;var t=_p("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(Tp,"lookup");function Ep(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Ht).forEach(o(function(i){var u=Ht[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var d=0;d<c.length;d++){var g=c[d];if(t[g]){var y=r.indexOf(Ht[t[g]].source),_=r.indexOf(u.source);if(t[g]!=="application/octet-stream"&&(y>_||y===_&&t[g].substr(0,12)==="application/"))continue}t[g]=i}}},"forEachMimeType"))}o(Ep,"populateMaps")});var Di=E((XS,Ni)=>{Ni.exports=$p;function $p(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o($p,"defer")});var jr=E((QS,Ui)=>{var Ci=Di();Ui.exports=Sp;function Sp(e){var t=!1;return Ci(function(){t=!0}),o(function(n,i){t?e(n,i):Ci(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Sp,"async")});var Lr=E((tA,Mi)=>{Mi.exports=Ap;function Ap(e){Object.keys(e.jobs).forEach(zp.bind(e)),e.jobs={}}o(Ap,"abort");function zp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(zp,"clean")});var Fr=E((nA,Li)=>{var ji=jr(),kp=Lr();Li.exports=Op;function Op(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=wp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?kp(r):r.results[i]=c,n(u,r.results))})}o(Op,"iterate");function wp(e,t,r,n){var i;return e.length==2?i=e(r,ji(n)):i=e(r,t,ji(n)),i}o(wp,"runJob")});var Br=E((iA,Fi)=>{Fi.exports=Rp;function Rp(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(Rp,"state")});var Zr=E((sA,Bi)=>{var Np=Lr(),Dp=jr();Bi.exports=Cp;function Cp(e){Object.keys(this.jobs).length&&(this.index=this.size,Np(this),Dp(e)(null,this.results))}o(Cp,"terminator")});var Vi=E((cA,Zi)=>{var Up=Fr(),Mp=Br(),jp=Zr();Zi.exports=Lp;function Lp(e,t,r){for(var n=Mp(e);n.index<(n.keyedList||e).length;)Up(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return jp.bind(n,r)}o(Lp,"parallel")});var Vr=E((lA,Wt)=>{var Hi=Fr(),Fp=Br(),Bp=Zr();Wt.exports=Zp;Wt.exports.ascending=Wi;Wt.exports.descending=Vp;function Zp(e,t,r,n){var i=Fp(e,r);return Hi(e,t,i,o(function u(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||e).length){Hi(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Bp.bind(i,n)}o(Zp,"serialOrdered");function Wi(e,t){return e<t?-1:e>t?1:0}o(Wi,"ascending");function Vp(e,t){return-1*Wi(e,t)}o(Vp,"descending")});var qi=E((mA,Gi)=>{var Hp=Vr();Gi.exports=Wp;function Wp(e,t,r){return Hp(e,t,null,r)}o(Wp,"serial")});var Ji=E((gA,Ki)=>{Ki.exports={parallel:Vi(),serial:qi(),serialOrdered:Vr()}});var Hr=E((yA,Xi)=>{"use strict";Xi.exports=Object});var Qi=E((hA,Yi)=>{"use strict";Yi.exports=Error});var ta=E((vA,ea)=>{"use strict";ea.exports=EvalError});var na=E((xA,ra)=>{"use strict";ra.exports=RangeError});var ia=E((_A,oa)=>{"use strict";oa.exports=ReferenceError});var sa=E((PA,aa)=>{"use strict";aa.exports=SyntaxError});var Gt=E((bA,ua)=>{"use strict";ua.exports=TypeError});var pa=E((IA,ca)=>{"use strict";ca.exports=URIError});var da=E((TA,la)=>{"use strict";la.exports=Math.abs});var fa=E((EA,ma)=>{"use strict";ma.exports=Math.floor});var ya=E(($A,ga)=>{"use strict";ga.exports=Math.max});var va=E((SA,ha)=>{"use strict";ha.exports=Math.min});var _a=E((AA,xa)=>{"use strict";xa.exports=Math.pow});var ba=E((zA,Pa)=>{"use strict";Pa.exports=Math.round});var Ta=E((kA,Ia)=>{"use strict";Ia.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var $a=E((wA,Ea)=>{"use strict";var Gp=Ta();Ea.exports=o(function(t){return Gp(t)||t===0?t:t<0?-1:1},"sign")});var Aa=E((NA,Sa)=>{"use strict";Sa.exports=Object.getOwnPropertyDescriptor});var Wr=E((DA,za)=>{"use strict";var qt=Aa();if(qt)try{qt([],"length")}catch{qt=null}za.exports=qt});var Oa=E((CA,ka)=>{"use strict";var Kt=Object.defineProperty||!1;if(Kt)try{Kt({},"a",{value:1})}catch{Kt=!1}ka.exports=Kt});var Gr=E((UA,wa)=>{"use strict";wa.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},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;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(t,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var Da=E((jA,Na)=>{"use strict";var Ra=typeof Symbol<"u"&&Symbol,qp=Gr();Na.exports=o(function(){return typeof Ra!="function"||typeof Symbol!="function"||typeof Ra("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:qp()},"hasNativeSymbols")});var qr=E((FA,Ca)=>{"use strict";Ca.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Kr=E((BA,Ua)=>{"use strict";var Kp=Hr();Ua.exports=Kp.getPrototypeOf||null});var La=E((ZA,ja)=>{"use strict";var Jp="Function.prototype.bind called on incompatible ",Xp=Object.prototype.toString,Yp=Math.max,Qp="[object Function]",Ma=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),el=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),tl=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");ja.exports=o(function(t){var r=this;if(typeof r!="function"||Xp.apply(r)!==Qp)throw new TypeError(Jp+r);for(var n=el(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,Ma(n,arguments));return Object(_)===_?_:this}return r.apply(t,Ma(n,arguments))},"binder"),c=Yp(0,r.length-n.length),d=[],g=0;g<c;g++)d[g]="$"+g;if(i=Function("binder","return function ("+tl(d,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var y=o(function(){},"Empty");y.prototype=r.prototype,i.prototype=new y,y.prototype=null}return i},"bind")});var He=E((HA,Fa)=>{"use strict";var rl=La();Fa.exports=Function.prototype.bind||rl});var Jt=E((WA,Ba)=>{"use strict";Ba.exports=Function.prototype.call});var Jr=E((GA,Za)=>{"use strict";Za.exports=Function.prototype.apply});var Ha=E((qA,Va)=>{"use strict";Va.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ga=E((KA,Wa)=>{"use strict";var nl=He(),ol=Jr(),il=Jt(),al=Ha();Wa.exports=al||nl.call(il,ol)});var Ka=E((JA,qa)=>{"use strict";var sl=He(),ul=Gt(),cl=Jt(),pl=Ga();qa.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new ul("a function is required");return pl(sl,cl,t)},"callBindBasic")});var ts=E((YA,es)=>{"use strict";var ll=Ka(),Ja=Wr(),Ya;try{Ya=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Xr=!!Ya&&Ja&&Ja(Object.prototype,"__proto__"),Qa=Object,Xa=Qa.getPrototypeOf;es.exports=Xr&&typeof Xr.get=="function"?ll([Xr.get]):typeof Xa=="function"?o(function(t){return Xa(t==null?t:Qa(t))},"getDunder"):!1});var as=E((ez,is)=>{"use strict";var rs=qr(),ns=Kr(),os=ts();is.exports=rs?o(function(t){return rs(t)},"getProto"):ns?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ns(t)},"getProto"):os?o(function(t){return os(t)},"getProto"):null});var Yr=E((rz,ss)=>{"use strict";var dl=Function.prototype.call,ml=Object.prototype.hasOwnProperty,fl=He();ss.exports=fl.call(dl,ml)});var fs=E((nz,ms)=>{"use strict";var j,gl=Hr(),yl=Qi(),hl=ta(),vl=na(),xl=ia(),Ke=sa(),qe=Gt(),_l=pa(),Pl=da(),bl=fa(),Il=ya(),Tl=va(),El=_a(),$l=ba(),Sl=$a(),ls=Function,Qr=o(function(e){try{return ls('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),ht=Wr(),Al=Oa(),en=o(function(){throw new qe},"throwTypeError"),zl=ht?function(){try{return arguments.callee,en}catch{try{return ht(arguments,"callee").get}catch{return en}}}():en,We=Da()(),X=as(),kl=Kr(),Ol=qr(),ds=Jr(),vt=Jt(),Ge={},wl=typeof Uint8Array>"u"||!X?j:X(Uint8Array),Re={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?j:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?j:ArrayBuffer,"%ArrayIteratorPrototype%":We&&X?X([][Symbol.iterator]()):j,"%AsyncFromSyncIteratorPrototype%":j,"%AsyncFunction%":Ge,"%AsyncGenerator%":Ge,"%AsyncGeneratorFunction%":Ge,"%AsyncIteratorPrototype%":Ge,"%Atomics%":typeof Atomics>"u"?j:Atomics,"%BigInt%":typeof BigInt>"u"?j:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?j:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?j:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?j:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":yl,"%eval%":eval,"%EvalError%":hl,"%Float16Array%":typeof Float16Array>"u"?j:Float16Array,"%Float32Array%":typeof Float32Array>"u"?j:Float32Array,"%Float64Array%":typeof Float64Array>"u"?j:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?j:FinalizationRegistry,"%Function%":ls,"%GeneratorFunction%":Ge,"%Int8Array%":typeof Int8Array>"u"?j:Int8Array,"%Int16Array%":typeof Int16Array>"u"?j:Int16Array,"%Int32Array%":typeof Int32Array>"u"?j:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":We&&X?X(X([][Symbol.iterator]())):j,"%JSON%":typeof JSON=="object"?JSON:j,"%Map%":typeof Map>"u"?j:Map,"%MapIteratorPrototype%":typeof Map>"u"||!We||!X?j:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":gl,"%Object.getOwnPropertyDescriptor%":ht,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?j:Promise,"%Proxy%":typeof Proxy>"u"?j:Proxy,"%RangeError%":vl,"%ReferenceError%":xl,"%Reflect%":typeof Reflect>"u"?j:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?j:Set,"%SetIteratorPrototype%":typeof Set>"u"||!We||!X?j:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?j:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":We&&X?X(""[Symbol.iterator]()):j,"%Symbol%":We?Symbol:j,"%SyntaxError%":Ke,"%ThrowTypeError%":zl,"%TypedArray%":wl,"%TypeError%":qe,"%Uint8Array%":typeof Uint8Array>"u"?j:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?j:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?j:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?j:Uint32Array,"%URIError%":_l,"%WeakMap%":typeof WeakMap>"u"?j:WeakMap,"%WeakRef%":typeof WeakRef>"u"?j:WeakRef,"%WeakSet%":typeof WeakSet>"u"?j:WeakSet,"%Function.prototype.call%":vt,"%Function.prototype.apply%":ds,"%Object.defineProperty%":Al,"%Object.getPrototypeOf%":kl,"%Math.abs%":Pl,"%Math.floor%":bl,"%Math.max%":Il,"%Math.min%":Tl,"%Math.pow%":El,"%Math.round%":$l,"%Math.sign%":Sl,"%Reflect.getPrototypeOf%":Ol};if(X)try{null.error}catch(e){us=X(X(e)),Re["%Error.prototype%"]=us}var us,Rl=o(function e(t){var r;if(t==="%AsyncFunction%")r=Qr("async function () {}");else if(t==="%GeneratorFunction%")r=Qr("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Qr("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&X&&(r=X(i.prototype))}return Re[t]=r,r},"doEval"),cs={__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"]},xt=He(),Xt=Yr(),Nl=xt.call(vt,Array.prototype.concat),Dl=xt.call(ds,Array.prototype.splice),ps=xt.call(vt,String.prototype.replace),Yt=xt.call(vt,String.prototype.slice),Cl=xt.call(vt,RegExp.prototype.exec),Ul=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ml=/\\(\\)?/g,jl=o(function(t){var r=Yt(t,0,1),n=Yt(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var i=[];return ps(t,Ul,function(u,c,d,g){i[i.length]=d?ps(g,Ml,"$1"):c||u}),i},"stringToPath"),Ll=o(function(t,r){var n=t,i;if(Xt(cs,n)&&(i=cs[n],n="%"+i[0]+"%"),Xt(Re,n)){var u=Re[n];if(u===Ge&&(u=Rl(n)),typeof u>"u"&&!r)throw new qe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");ms.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new qe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qe('"allowMissing" argument must be a boolean');if(Cl(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=jl(t),i=n.length>0?n[0]:"",u=Ll("%"+i+"%",r),c=u.name,d=u.value,g=!1,y=u.alias;y&&(i=y[0],Dl(n,Nl([0,1],y)));for(var _=1,b=!0;_<n.length;_+=1){var x=n[_],s=Yt(x,0,1),l=Yt(x,-1);if((s==='"'||s==="'"||s==="`"||l==='"'||l==="'"||l==="`")&&s!==l)throw new Ke("property names with quotes must have matching quotes");if((x==="constructor"||!b)&&(g=!0),i+="."+x,c="%"+i+"%",Xt(Re,c))d=Re[c];else if(d!=null){if(!(x in d)){if(!r)throw new qe("base intrinsic for "+t+" exists, but the property is not available.");return}if(ht&&_+1>=n.length){var f=ht(d,x);b=!!f,b&&"get"in f&&!("originalValue"in f.get)?d=f.get:d=d[x]}else b=Xt(d,x),d=d[x];b&&!g&&(Re[c]=d)}}return d},"GetIntrinsic")});var ys=E((iz,gs)=>{"use strict";var Fl=Gr();gs.exports=o(function(){return Fl()&&!!Symbol.toStringTag},"hasToStringTagShams")});var xs=E((sz,vs)=>{"use strict";var Bl=fs(),hs=Bl("%Object.defineProperty%",!0),Zl=ys()(),Vl=Yr(),Hl=Gt(),Qt=Zl?Symbol.toStringTag:null;vs.exports=o(function(t,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 Hl("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Qt&&(n||!Vl(t,Qt))&&(hs?hs(t,Qt,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[Qt]=r)},"setToStringTag")});var Ps=E((cz,_s)=>{"use strict";var Wl=Function.prototype.call,Gl=Object.prototype.hasOwnProperty,ql=He();_s.exports=ql.call(Wl,Gl)});var Is=E((pz,bs)=>{"use strict";bs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var $s=E((lz,Es)=>{"use strict";var on=Ai(),Kl=require("util"),tn=require("path"),Jl=require("http"),Xl=require("https"),Yl=require("url").parse,Ql=require("fs"),ed=require("stream").Stream,td=require("crypto"),rn=Ri(),rd=Ji(),nd=xs(),Se=Ps(),nn=Is();function Ts(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Ts,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],on.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");Kl.inherits(L,on);L.LINE_BREAK=`\r
|
|
2
|
-
`;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=on.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Se(t,"httpVersion"))&&!(t instanceof ed))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){Se(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Ql.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Se(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Se(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Ts(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&nn(c,r.header);var d;for(var g in c)if(Se(c,g)){if(d=c[g],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(u+=g+": "+d.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=tn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=tn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Se(e,"httpVersion")&&(r=tn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ts(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=rn.lookup(e.name)),!r&&e&&e.path&&(r=rn.lookup(e.path)),!r&&e&&e.readable&&Se(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=rn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Se(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+td.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}rd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Yl(e),n=nn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=nn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Xl.request(n):r=Jl.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var d,g=o(function(y,_){return r.removeListener("error",g),r.removeListener("response",d),t.call(this,y,_)},"callback");d=g.bind(this,null),r.on("error",g),r.on("response",d)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};nd(L.prototype,"FormData");Es.exports=L});var md={};cn(md,{alai:()=>dd});module.exports=Zs(md);var Vs=Object.freeze({status:"aborted"});function I(e,t,r){function n(d,g){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:g,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,g);let y=c.prototype,_=Object.keys(y);for(let b=0;b<_.length;b++){let x=_[b];x in d||(d[x]=y[x].bind(d))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(d){var g;let y=r?.Parent?new u:this;n(y,d),(g=y._zod).deferred??(g.deferred=[]);for(let _ of y._zod.deferred)_();return y}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(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(I,"$constructor");var Hs=Symbol("zod_brand"),le=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Pt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},tr={};function fe(e){return e&&Object.assign(tr,e),tr}o(fe,"config");function nr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(nr,"getEnumValues");function dn(e,t){return typeof t=="bigint"?t.toString():t}o(dn,"jsonStringifyReplacer");function It(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(It,"cached");function mn(e){return e==null}o(mn,"nullish");function Tt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Tt,"cleanRegex");var ln=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==ln)return n===void 0&&(n=ln,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var or="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Xe,"isObject");var Ws=It(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function fn(e){if(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(fn,"isPlainObject");var gn=new Set(["string","number","symbol"]);function De(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(De,"escapeRegex");function Et(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Et,"clone");function V(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(V,"normalizeParams");function yn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(yn,"optionalKeys");var Gs={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 Ce(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Ce,"aborted");function Pe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Pe,"prefixIssues");function bt(e){return typeof e=="string"?e:e?.message}o(bt,"unwrapMessage");function be(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=bt(e.inst?._zod.def?.error?.(e))??bt(t?.error?.(e))??bt(r.customError?.(e))??bt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(be,"finalizeIssue");function hn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(hn,"getLengthableOrigin");function ir(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(ir,"issue");var vn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,dn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),xn=I("$ZodError",vn),Ye=I("$ZodError",vn,{Parent:Error});var Ks=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new le;if(c.issues.length){let d=new(i?.Err??e)(c.issues.map(g=>be(g,u,fe())));throw or(d,i?.callee),d}return c.value},"_parse"),$t=Ks(Ye),Js=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??e)(c.issues.map(g=>be(g,u,fe())));throw or(d,i?.callee),d}return c.value},"_parseAsync"),St=Js(Ye),Xs=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new le;return u.issues.length?{success:!1,error:new(e??xn)(u.issues.map(c=>be(c,i,fe())))}:{success:!0,data:u.value}},"_safeParse"),Qe=Xs(Ye),Ys=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>be(c,i,fe())))}:{success:!0,data:u.value}},"_safeParseAsync"),et=Ys(Ye);var Qs="(?:(?:\\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])))",eu=new RegExp(`^${Qs}$`);var _n=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Pn=/^-?\d+n?$/;var ar=/^-?\d+(?:\.\d+)?$/,bn=/^(?:true|false)$/i;var Ue=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var In=I("$ZodCheckMinLength",(e,t)=>{var r;Ue.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!mn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=hn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var sr=I("$ZodCheckStringFormat",(e,t)=>{var r,n;Ue.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Tn=I("$ZodCheckRegex",(e,t)=>{sr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var $n={major:4,minor:3,patch:6};var H=I("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=$n;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,d,g)=>{let y=Ce(c),_;for(let b of d){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(y)continue;let x=c.issues.length,s=b._zod.check(c);if(s instanceof Promise&&g?.async===!1)throw new le;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(y||(y=Ce(c,x)))});else{if(c.issues.length===x)continue;y||(y=Ce(c,x))}}return _?_.then(()=>c):c},"runChecks"),u=o((c,d,g)=>{if(Ce(c))return c.aborted=!0,c;let y=i(d,n,g);if(y instanceof Promise){if(g.async===!1)throw new le;return y.then(_=>e._zod.parse(_,g))}return e._zod.parse(y,g)},"handleCanaryResult");e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){let y=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return y instanceof Promise?y.then(_=>u(_,c,d)):u(y,c,d)}let g=e._zod.parse(c,d);if(g instanceof Promise){if(d.async===!1)throw new le;return g.then(y=>i(y,n,d))}return i(g,n,d)}}q(e,"~standard",()=>({validate:o(i=>{try{let u=Qe(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return et(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),kt=I("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_n(e._zod.bag),e._zod.parse=(r,n)=>{if(t.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:e}),r}}),ur=I("$ZodStringFormat",(e,t)=>{sr.init(e,t),kt.init(e,t)});var On=I("$ZodURL",(e,t)=>{ur.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var wn=I("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??ar,e._zod.parse=(r,n)=>{if(t.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 u=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:e,...u?{received:u}:{}}),r}});var cr=I("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=bn,e._zod.parse=(r,n)=>{if(t.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:e}),r}}),Rn=I("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=Pn,e._zod.parse=(r,n)=>{if(t.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:e}),r}});var Nn=I("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Dn=I("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Cn=I("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Un=I("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Sn(e,t,r){e.issues.length&&t.issues.push(...Pe(r,e.issues)),t.value[r]=e.value}o(Sn,"handleArrayResult");var Mn=I("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let d=i[c],g=t.element._zod.run({value:d,issues:[]},n);g instanceof Promise?u.push(g.then(y=>Sn(y,r,c))):Sn(g,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function zt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Pe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(zt,"handlePropertyResult");function tu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=yn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(tu,"normalizeDef");function ru(e,t,r,n,i,u){let c=[],d=i.keySet,g=i.catchall._zod,y=g.def.type,_=g.optout==="optional";for(let b in t){if(d.has(b))continue;if(y==="never"){c.push(b);continue}let x=g.run({value:t[b],issues:[]},n);x instanceof Promise?e.push(x.then(s=>zt(s,r,b,t,_))):zt(x,r,b,t,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(ru,"handleCatchall");var jn=I("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let d=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let g={...d};return Object.defineProperty(t,"shape",{value:g}),g},"get")})}let n=It(()=>tu(t));q(e._zod,"propValues",()=>{let d=t.shape,g={};for(let y in d){let _=d[y]._zod;if(_.values){g[y]??(g[y]=new Set);for(let b of _.values)g[y].add(b)}}return g});let i=Xe,u=t.catchall,c;e._zod.parse=(d,g)=>{c??(c=n.value);let y=d.value;if(!i(y))return d.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),d;d.value={};let _=[],b=c.shape;for(let x of c.keys){let s=b[x],l=s._zod.optout==="optional",f=s._zod.run({value:y[x],issues:[]},g);f instanceof Promise?_.push(f.then(m=>zt(m,d,x,y,l))):zt(f,d,x,y,l)}return u?ru(_,y,d,g,n.value,e):_.length?Promise.all(_).then(()=>d):d}});function An(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Ce(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>be(c,n,fe())))}),t)}o(An,"handleUnionResults");var pr=I("$ZodUnion",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),q(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Tt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,d=[];for(let g of t.options){let y=g._zod.run({value:i.value,issues:[]},u);if(y instanceof Promise)d.push(y),c=!0;else{if(y.issues.length===0)return y;d.push(y)}}return c?Promise.all(d).then(g=>An(g,i,e,u)):An(d,i,e,u)}});var Ln=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,pr.init(e,t);let r=e._zod.parse;q(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[d,g]of Object.entries(c)){i[d]||(i[d]=new Set);for(let y of g)i[d].add(y)}}return i});let n=It(()=>{let i=t.options,u=new Map;for(let c of i){let d=c._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let g of d){if(u.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);u.set(g,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Xe(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let d=n.value.get(c?.[t.discriminator]);return d?d._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var Fn=I("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!fn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let d=new Set;for(let y of c)if(typeof y=="string"||typeof y=="number"||typeof y=="symbol"){d.add(typeof y=="number"?y.toString():y);let _=t.valueType._zod.run({value:i[y],issues:[]},n);_ instanceof Promise?u.push(_.then(b=>{b.issues.length&&r.issues.push(...Pe(y,b.issues)),r.value[y]=b.value})):(_.issues.length&&r.issues.push(...Pe(y,_.issues)),r.value[y]=_.value)}let g;for(let y in i)d.has(y)||(g=g??[],g.push(y));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:g})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let g=t.keyType._zod.run({value:d,issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&ar.test(d)&&g.issues.length){let b=t.keyType._zod.run({value:Number(d),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(g=b)}if(g.issues.length){t.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(b=>be(b,n,fe())),input:d,path:[d],inst:e});continue}let _=t.valueType._zod.run({value:i[d],issues:[]},n);_ instanceof Promise?u.push(_.then(b=>{b.issues.length&&r.issues.push(...Pe(d,b.issues)),r.value[g.value]=b.value})):(_.issues.length&&r.issues.push(...Pe(d,_.issues)),r.value[g.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Bn=I("$ZodEnum",(e,t)=>{H.init(e,t);let r=nr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>gn.has(typeof i)).map(i=>typeof i=="string"?De(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),Zn=I("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?De(n):n?De(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Vn=I("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Pt(e.constructor.name);let i=t.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 le;return r.value=i,r}});function zn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(zn,"handleOptionalResult");var Hn=I("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Tt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>zn(u,r.value)):zn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Wn=I("$ZodNullable",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Tt(r.source)}|null)$`):void 0}),q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Gn=I("$ZodPipe",(e,t)=>{H.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>At(c,t.in,n)):At(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>At(u,t.out,n)):At(i,t.out,n)}});function At(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(At,"handlePipeResult");var qn=I("$ZodCustom",(e,t)=>{Ue.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>kn(u,r,n,e));kn(i,r,n,e)}});function kn(e,t,r,n){if(!e){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),t.issues.push(ir(i))}}o(kn,"handleRefineResult");var Jn,au=Symbol("ZodOutput"),su=Symbol("ZodInput"),lr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Xn(){return new lr}o(Xn,"registry");(Jn=globalThis).__zod_globalRegistry??(Jn.__zod_globalRegistry=Xn());var dr=globalThis.__zod_globalRegistry;function Yn(e,t){return new e({type:"string",...V(t)})}o(Yn,"_string");function Qn(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(Qn,"_coercedString");function eo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(eo,"_url");function to(e,t){return new e({type:"number",checks:[],...V(t)})}o(to,"_number");function ro(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(ro,"_coercedNumber");function no(e,t){return new e({type:"boolean",...V(t)})}o(no,"_boolean");function oo(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(oo,"_coercedBoolean");function io(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(io,"_coercedBigint");function ao(e){return new e({type:"any"})}o(ao,"_any");function so(e){return new e({type:"unknown"})}o(so,"_unknown");function uo(e,t){return new e({type:"void",...V(t)})}o(uo,"_void");function co(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(co,"_coercedDate");function ce(e,t){return new In({check:"min_length",...V(t),minimum:e})}o(ce,"_minLength");function Ie(e,t){return new Tn({check:"string_format",format:"regex",...V(t),pattern:e})}o(Ie,"_regex");function po(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(po,"_custom");var K=I("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>$t(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Qe(e,r,n),e.parseAsync=async(r,n)=>St(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>et(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>Et(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),wt=I("ZodMiniString",(e,t)=>{kt.init(e,t),K.init(e,t)});function a(e){return Yn(wt,e)}o(a,"string");var lo=I("ZodMiniStringFormat",(e,t)=>{ur.init(e,t),wt.init(e,t)});var hu=I("ZodMiniURL",(e,t)=>{On.init(e,t),lo.init(e,t)});function mo(e){return eo(hu,e)}o(mo,"url");var mr=I("ZodMiniNumber",(e,t)=>{wn.init(e,t),K.init(e,t)});function Q(e){return to(mr,e)}o(Q,"number");var fr=I("ZodMiniBoolean",(e,t)=>{cr.init(e,t),K.init(e,t)});function B(e){return no(fr,e)}o(B,"boolean");var fo=I("ZodMiniBigInt",(e,t)=>{Rn.init(e,t),K.init(e,t)});var vu=I("ZodMiniAny",(e,t)=>{Nn.init(e,t),K.init(e,t)});function rt(){return ao(vu)}o(rt,"any");var xu=I("ZodMiniUnknown",(e,t)=>{Dn.init(e,t),K.init(e,t)});function O(){return so(xu)}o(O,"unknown");var _u=I("ZodMiniVoid",(e,t)=>{Cn.init(e,t),K.init(e,t)});function go(e){return uo(_u,e)}o(go,"_void");var yo=I("ZodMiniDate",(e,t)=>{Un.init(e,t),K.init(e,t)});var Pu=I("ZodMiniArray",(e,t)=>{Mn.init(e,t),K.init(e,t)});function N(e,t){return new Pu({type:"array",element:e,...V(t)})}o(N,"array");var bu=I("ZodMiniObject",(e,t)=>{jn.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...V(t)};return new bu(r)}o(p,"object");var Iu=I("ZodMiniUnion",(e,t)=>{pr.init(e,t),K.init(e,t)});function D(e,t){return new Iu({type:"union",options:e,...V(t)})}o(D,"union");var Tu=I("ZodMiniDiscriminatedUnion",(e,t)=>{Ln.init(e,t),K.init(e,t)});function Me(e,t,r){return new Tu({type:"union",options:t,discriminator:e,...V(r)})}o(Me,"discriminatedUnion");var Eu=I("ZodMiniRecord",(e,t)=>{Fn.init(e,t),K.init(e,t)});function w(e,t,r){return new Eu({type:"record",keyType:e,valueType:t,...V(r)})}o(w,"record");var $u=I("ZodMiniEnum",(e,t)=>{Bn.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new $u({type:"enum",entries:r,...V(t)})}o(U,"_enum");var Su=I("ZodMiniLiteral",(e,t)=>{Zn.init(e,t),K.init(e,t)});function S(e,t){return new Su({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o(S,"literal");var Au=I("ZodMiniTransform",(e,t)=>{Vn.init(e,t),K.init(e,t)});function Te(e){return new Au({type:"transform",transform:e})}o(Te,"transform");var zu=I("ZodMiniOptional",(e,t)=>{Hn.init(e,t),K.init(e,t)});function h(e){return new zu({type:"optional",innerType:e})}o(h,"optional");var ku=I("ZodMiniNullable",(e,t)=>{Wn.init(e,t),K.init(e,t)});function nt(e){return new ku({type:"nullable",innerType:e})}o(nt,"nullable");var Ou=I("ZodMiniPipe",(e,t)=>{Gn.init(e,t),K.init(e,t)});function Ee(e,t){return new Ou({type:"pipe",in:e,out:t})}o(Ee,"pipe");var wu=I("ZodMiniCustom",(e,t)=>{qn.init(e,t),K.init(e,t)});function Rt(e,t){return po(wu,e??(()=>!0),t)}o(Rt,"custom");var ot={};cn(ot,{bigint:()=>ju,boolean:()=>Mu,date:()=>Lu,number:()=>Uu,string:()=>Cu});function Cu(e){return Qn(wt,e)}o(Cu,"string");function Uu(e){return ro(mr,e)}o(Uu,"number");function Mu(e){return oo(fr,e)}o(Mu,"boolean");function ju(e){return io(fo,e)}o(ju,"bigint");function Lu(e){return co(yo,e)}o(Lu,"date");var yr=p({retryOnFailure:p({defaultValue:h(B()),hide:h(B())}),continueOnFailure:p({defaultValue:h(B()),hide:h(B())})}),gr=class{constructor(t,r,n,i,u,c,d,g,y,_,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=d;this.errorHandlingOptions=g;this.outputSchema=y;this.audience=_;this.aiMetadata=b}static{o(this,"IAction")}},ae=o(e=>new gr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=p({displayName:a(),description:h(a())}),C=o((e,t)=>p({type:S(t),required:B(),defaultValue:h(rt())}),"TPropertyValue");var ne=p({...F.shape,...C(a(),"SHORT_TEXT").shape}),ge=p({...F.shape,...C(a(),"LONG_TEXT").shape});var vo=p({label:a(),value:O()}),Nt=p({disabled:h(B()),placeholder:h(a()),options:N(vo)});var oe=p({...F.shape,options:Nt,...C(O(),"STATIC_DROPDOWN").shape}),ye=p({...F.shape,options:Nt,...C(N(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var hr=p({...F.shape,...C(O(),"DROPDOWN").shape,refreshers:N(a())}),it=p({...F.shape,...C(N(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var he=p({...F.shape,...C(B(),"CHECKBOX").shape});var ve=p({...F.shape,...C(Q(),"NUMBER").shape});var at=p({...F.shape,...C(O(),"FILE").shape});var st=p({...F.shape,...C(a(),"DATE_TIME").shape});var xo=w(a(),D([ne,ge,oe,it,ye,he,ve,at,st])),ut=p({...F.shape,properties:xo,...C(N(O()),"ARRAY").shape});var ct=p({...F.shape,...C(D([w(a(),O())]),"JSON").shape});var _o=D([ne,oe,ct,ut,ye]),Bu=w(a(),_o),vr=p({refreshers:N(a()),...F.shape,...C(O(),"DYNAMIC").shape});var Dt=p({...F.shape,...C(go(),"MARKDOWN").shape});var pt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(pt||{}),je=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(je||{}),Le=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Le||{});var lt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(lt||{}),xr="both_client_credentials_and_authorization_code";var ze=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ze||{}),dt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(dt||{}),Zu=p({strategy:U(dt),paramName:h(a())}),mt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(mt||{});var Ct=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ct||{}),Po=p({status:h(Q()),body:h(O()),headers:h(w(a(),a()))}),bo=p({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(U(Ct))}),Io=p({type:S("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Po,handlerId:h(a()),streamStepProgress:h(U(Ct))}),Vu=D([bo,Io]);var Hu=p({body:O(),rawBody:h(O()),headers:w(a(),a()),queryParams:w(a(),a())});function xe(e){return e==null}o(xe,"isNil");function ft(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ft,"isEmpty");function Ut(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Ut,"assertNotNullOrUndefined");var _r=Ne(require("crypto"),1);var Wu=128,ke,Fe,Gu=o(e=>{!ke||ke.length<e?(ke=Buffer.allocUnsafe(e*Wu),_r.default.randomFillSync(ke),Fe=0):Fe+e>ke.length&&(_r.default.randomFillSync(ke),Fe=0),Fe+=e},"fillPool"),qu=o(e=>(Gu(e|=0),ke.subarray(Fe-e,Fe)),"random"),Ku=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let d=r(i),g=i;for(;g--;)if(c+=e[d[g]&n]||"",c.length===u)return c}}},"customRandom"),Eo=o((e,t=21)=>Ku(e,t,qu),"customAlphabet");var Ju="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",$o=21,JP=a().check(Ie(new RegExp(`^[0-9a-zA-Z]{${$o}}$`))),Xu=Eo(Ju,$o);var $e=Ee(Te(e=>e instanceof Date?e.toISOString():e),a()),se={id:a(),created:$e,updated:$e},Z=o(e=>h(nt(e)),"Nullable");function Pr(e){return h(nt(U(e)))}o(Pr,"NullableEnum");var QP=Ee(Te(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(B())),Mt=o(e=>Ee(Te(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(N(e))),"OptionalArrayFromQuery");var rb=w(a(),O());var gt=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(gt||{});var fb=a().check(Ie(/^#[0-9A-Fa-f]{6}$/));var yb=p({filename:a(),data:O(),type:S("file"),mimetype:h(a())});var Yu=Ne(Ao());var Ib=p({...se,name:a(),permissions:N(a()),platformId:Z(a()),type:a(),userCount:h(Q())});var zo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(zo||{}),br=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(br||{}),Ir=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Ir||{});var Tr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Tr||{});var Er=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Er||{});var Qu=p({mode:U(zo),value:O()}),ec=p({auth:h(a()),fields:w(a(),Qu)}),tc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(ec)}),rc=p({type:S("PIECE"),toolName:a().check(ce(1)),pieceMetadata:tc}),nc=p({type:S("none")}),oc=p({type:S("access_token"),accessToken:a()}),ic=p({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),ac=p({type:S("headers"),headers:w(a(),a())}),sc=Me("type",[nc,oc,ic,ac]),ko=p({type:S("FLOW"),toolName:a().check(ce(1)),externalFlowId:a(),flowDisplayName:h(a())}),Oo=p({type:S("MCP"),toolName:a().check(ce(1)),serverUrl:mo(),protocol:U(Ir),auth:sc}),wo=p({type:S("KNOWLEDGE_BASE"),toolName:a().check(ce(1)),sourceType:U(br),sourceId:a(),sourceName:a()}),uc=Me("type",[rc,ko,Oo,wo]),cc=p({displayName:a(),description:h(a()),type:U(Tr)}),Ro=p({type:S("MARKDOWN"),markdown:a()}),Be={type:S("TOOL_CALL"),input:Z(w(a(),O())),output:h(O()),toolName:a(),status:U(Er),toolCallId:a(),startTime:a(),endTime:h(a())},Jb=p(Be),No=Me("toolCallType",[p({...Be,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Be,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),p({...Be,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),p({...Be,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Be,toolCallType:S("UNKNOWN"),displayName:a()})]),pc=D([Ro,No]);var $r=(r=>(r.IMAGE="image",r.TEXT="text",r))($r||{}),_e=p({apiKey:a()}),lc=_e,dc=p({apiKey:a(),apiKeyHash:a()}),mc=_e,fc=_e,gc=_e,yc=_e,hc=_e,vc=_e,xc=_e,Do=p({accessKeyId:a().check(ce(1)),secretAccessKey:a().check(ce(1))}),_c=p({}),Pc=p({}),bc=p({}),Ic=p({}),Tc=p({}),Ec=p({}),Co=p({modelId:a(),modelName:a(),modelType:U($r)}),Uo=p({apiKeyHeader:a(),baseUrl:a(),models:N(Co),defaultHeaders:h(w(a(),a()))}),Mo=p({accountId:a(),gatewayId:a(),models:N(Co),vertexProject:h(a()),vertexRegion:h(a())}),jo=p({resourceName:a(),apiVersion:Ee(Te(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),Lo=p({region:a().check(ce(1))}),$c=D([lc,gc,yc,hc,vc,fc,mc,dc,Do,xc]),Fo=D([Uo,Mo,jo,Lo,_c,bc,Ic,Tc,Pc,Ec]),Sc=p({id:a(),name:a(),type:U($r)}),Ac=p({id:a(),name:a(),provider:U(gt),config:Fo,enabledForChat:B()}),zc=p({provider:U(gt),config:Fo,auth:$c,platformId:a()});var eI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var kc=p({base64Url:a(),fileName:a(),extension:h(a())}),Oc=p({mimeType:a(),url:a(),fileName:h(a())}),Sr=D([kc,Oc]);var wc=D([p({type:S("file"),value:Sr}),p({type:S("markdown"),value:a(),files:h(N(Sr))})]),Rc=p({sessionId:a(),message:a(),files:h(N(a()))});var Zo=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Zo||{}),Vo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Vo||{}),Ar=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Ar||{});var Nc=D([p({...se,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...se,name:a(),externalId:a(),type:D([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),Dc=p({...se,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:Pr(Vo),trigger:Pr(Zo)}),Cc=p({...se,tableId:a(),projectId:a(),cells:w(a(),p({updated:a(),created:a(),value:O(),fieldName:a()}))}),Uc=p({events:N(U(Ar)),webhookUrl:a(),flowId:a()}),Mc=p({fields:N(p({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),jc=p({projectId:a(),limit:h(ot.number()),cursor:h(a()),name:h(a()),externalIds:Mt(a()),folderId:h(a()),folderIds:Mt(a())}),Lc=p({records:N(N(p({fieldId:a(),value:Wo()}))),tableId:a()}),Fc=p({cells:h(N(p({fieldId:a(),value:Wo()}))),tableId:a(),agentUpdate:h(B())}),Ho=Me("operator",[Oe("eq"),Oe("neq"),Oe("gt"),Oe("gte"),Oe("lt"),Oe("lte"),Oe("co"),Bo("exists"),Bo("not_exists")]),Bc=p({tableId:a(),limit:h(ot.number()),cursor:h(a()),filters:Mt(Ho)});function Wo(){return Ee(Te(e=>e==null?e:String(e)),nt(a()))}o(Wo,"coerceToString");function Oe(e){return p({fieldId:a(),operator:S(e),value:a()})}o(Oe,"valueFilter");function Bo(e){return p({fieldId:a(),operator:S(e)})}o(Bo,"existenceFilter");var Zc=p({status:h(Q()),body:h(O()),headers:h(w(a(),a()))}),Vc=p({...se,deleted:Z($e),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var Go=p({name:a(),description:h(a()),type:a(),required:B()}),Hc=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(Go),returnsResponse:B()})});var qo="^[0-9]+\\.[0-9]+\\.[0-9]+$",xI=new RegExp(qo),Gc="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",_I=a().check(Ie(new RegExp(qo))),PI=a().check(Ie(new RegExp(Gc))),qc=p({packageType:S("ARCHIVE"),pieceType:U(je),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Ko=p({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),Jo=p({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),bI=D([Ko,Jo]),II=D([qc,Ko,Jo]),Xo=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(Xo||{}),Kc=p({type:U(Xo),cronExpression:a(),timezone:a()}),TI=p({...se,type:U(ze),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(Kc),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),Yo=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(Yo||{}),Qo=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Qo||{}),ei=(r=>(r.S3="S3",r.DB="DB",r))(ei||{}),EI=p({...se,projectId:Z(a()),platformId:Z(a()),type:U(Yo),compression:U(Qo),data:h(O()),location:U(ei),size:Z(Q()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(w(a(),a()))}),ti=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(ti||{}),ri=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ri||{}),$I=p({id:a(),email:a(),firstName:a(),status:U(ri),externalId:Z(a()),platformId:Z(a()),platformRole:U(ti),lastName:a(),created:$e,updated:$e,lastActiveDate:Z($e),imageUrl:Z(a())});var zr=p({...F.shape,...C(w(a(),O()),"OBJECT").shape});var ai=p({...F.shape,...C(a(),"COLOR").shape});var kr=D([ne,ge,Dt,he,oe,ye,hr,it,vr,ve,ut,zr,ct,st,at,ai]),$={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var de=p({displayName:a(),description:h(a())});var si=p({username:a(),password:a()}),Or=p({...de.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...C(si,"BASIC_AUTH").shape});var Qc=w(a(),D([ne,ge,ve,he,oe])),wr=p({...de.shape,props:Qc,...C(O(),"CUSTOM_AUTH").shape});var we=p({...de.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var ep=w(a(),D([ne,ge,we,ve,he,oe,ye,Dt])),ui=p({...de.shape,props:ep,...C(O(),"OIDC").shape});var Rr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Rr||{}),ci=D([ne,we,oe]),pi=w(a(),ci),tp=p({props:h(w(a(),ci)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:h(D([S("none"),S("consent"),S("login"),S("omit")])),pkce:h(B()),pkceMethod:h(D([S("plain"),S("S256")])),authorizationMethod:h(U(Rr)),grantType:h(D([U(lt),S(xr)])),extra:h(w(a(),a()))}),li=p({access_token:a(),props:h(pi),data:w(a(),rt())}),Nr=p({...de.shape,...tp.shape,...C(li,"OAUTH2").shape});var Ze=D([Or,wr,ui,Nr,we]),yt="Connection",Lt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||yt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||yt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||yt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||yt}},None(){}};var oE={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 rp=p({...F.shape,...C(O(),"CUSTOM").shape,code:a()});var np=D([kr,Ze]),Dr=w(a(),np),TE=w(a(),kr);var di=D([p({strategy:S("CRON"),cronExpression:a()}),p({strategy:S("NONE")})]);var mi="2",Ft="0.82.0";var Cr=class{constructor(t,r,n,i,u,c,d,g,y=Ft,_,b=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=g;this.minimumSupportedRelease=y;this.maximumSupportedRelease=_;this.description=b;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:mi}),"getContextInfo");(!op(y)||ip(y,Ft))&&(this.minimumSupportedRelease=Ft),u.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}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,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},fi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Cr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function op(e){return/^\d+\.\d+\.\d+$/.test(e)}o(op,"isValidSimpleSemver");function ip(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,d]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<d}o(ip,"isSemverLessThan");var ap=h(w(a(),w(a(),a()))),gi=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:h(a()),directoryPath:h(a()),auth:h(D([Ze,N(Ze)])),version:a(),categories:h(N(U(Le))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),i18n:ap}),sp=U(["human","ai","both"]),yi=p({description:h(a()),idempotent:h(B())}),hi=p({name:a(),displayName:a(),description:a(),props:Dr,requireAuth:B(),errorHandlingOptions:h(yr),outputSchema:h(Rt()),audience:h(sp),aiMetadata:h(yi)}),vi=p({name:a(),displayName:a(),description:a(),props:Dr,errorHandlingOptions:h(yr),type:U(ze),sampleData:O(),handshakeConfiguration:h(Rt()),renewConfiguration:h(di),testStrategy:U(mt),outputSchema:h(Rt()),aiMetadata:h(yi)}),up=p({...gi.shape,actions:w(a(),hi),triggers:w(a(),vi)}),cp=p({...gi.shape,actions:Q(),triggers:Q(),suggestedActions:h(N(vi)),suggestedTriggers:h(N(hi))}),xi=p({projectUsage:Q(),tags:h(N(a())),pieceType:U(je),packageType:U(pt),platformId:h(a()),archiveId:h(a())}),T$=p({...up.shape,...xi.shape}),E$=p({...cp.shape,...xi.shape}),$$=p({name:a(),version:a()});var pp=Ne(require("path")),lp=Ne(require("fs/promises"));var Bt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Zt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Ur,r=new Mr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Ur=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Mr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Ve=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}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}}};var Vt=class extends Bt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Zt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[M,Y]of Object.entries(c))i.append(M,Y);let d=i.toString(),g=d?`${n}?${d}`:n,y=t.responseType??"json",_=t.followRedirects??!0,b=t.retries??0,{body:x,extraHeaders:s,isStream:l}=dp(t.body,u),f=fp({...u,...s}),m=await mp(async()=>{let M=new AbortController,Y=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let re={method:t.method.toString(),headers:f,body:x,redirect:_?"follow":"manual",signal:M.signal};return l&&(re.duplex="half"),r?.dispatcher!==void 0&&(re.dispatcher=r.dispatcher),await fetch(g,re)}finally{Y!==void 0&&clearTimeout(Y)}},b),v=_?300:400;if(m.status<200||m.status>=v){let M=await _i(m,y),Y=new Ve(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Y),Y}let P=await _i(m,y);return{status:m.status,headers:gp(m.headers),body:P}}};function dp(e,t){return hp(e)?{body:void 0,extraHeaders:{},isStream:!1}:yp(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(dp,"serializeBody");async function _i(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(_i,"parseResponseBody");async function mp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Pi(n);continue}return i}catch(i){if(r=i,n<t){await Pi(n);continue}throw i}throw r}o(mp,"sendWithRetries");function Pi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Pi,"backoff");function fp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(fp,"normalizeHeaders");function gp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(gp,"toHttpHeaders");function yp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(yp,"isNodeFormData");function hp(e){return e==null}o(hp,"isNil");var J=new Vt;var me=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(me||{});var od=Ne(require("fs")),Ss=Ne($s());var id={"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 ad(e){let t=e.split(";")[0].trim().toLowerCase();return id[t]??""}o(ad,"contentTypeToExtension");var sd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),ud=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function As({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:d,authLocation:g="headers"}){return ae({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:$.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:y})=>({url:$.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
-
i.e ${
|
|
1
|
+
"use strict";var su=Object.create;var Qe=Object.defineProperty;var uu=Object.getOwnPropertyDescriptor;var cu=Object.getOwnPropertyNames;var pu=Object.getPrototypeOf,lu=Object.prototype.hasOwnProperty;var o=(e,t)=>Qe(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},yn=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})},hn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cu(t))!lu.call(e,i)&&i!==r&&Qe(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e};var Me=(e,t,r)=>(r=e!=null?su(pu(e)):{},hn(t||!e||!e.__esModule?Qe(r,"default",{value:e,enumerable:!0}):r,e)),du=e=>hn(Qe({},"__esModule",{value:!0}),e);var Vo=E((Bo,Zt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function y(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,h=(s.match(l.zoneIndex)||[])[0],_,M;for(h&&(h=h.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(M=d-g,_=":";M--;)_+="0:";return s=s.replace("::",_),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let ee=s.split(":"),ae=[];for(let le=0;le<ee.length;le++)ae.push(parseInt(ee[le],16));return ae})(),{parts:d,zoneId:h}}o(y,"expandIPv6");function x(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let h=0,_;for(;m>0;){if(_=g-m,_<0&&(_=0),s[h]>>_!==d[h]>>_)return!1;m-=g,h+=1}return!0}o(x,"matchCIDR");function v(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(v,"parseIntAuto");function T(s,d){for(;s.length<d;)s=`0${s}`;return s}o(T,"padPart");let P={};P.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return x(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},h,_,M;for(h=3;h>=0;h-=1)if(_=this.octets[h],_ in m){if(M=m[_],g&&M!==0)return null;M!==8&&(g=!0),d+=M}else return null;return 32-d},s.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return P.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),P.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),h=[],_=0;for(;_<4;)h.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(h)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.isIPv4=function(s){return this.parser(s)!==null},P.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},P.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},P.IPv4.isValidFourPartDecimal=function(s){return!!(P.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},P.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!P.IPv4.isValidCIDR(s)||!d?!1:P.IPv4.isValidFourPartDecimal(d[1])},P.IPv4.networkAddressFromCIDR=function(s){let d,g,m,h,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),h=[],g=0;g<4;)h.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(h)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},P.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},P.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let h=d.slice(1,6),_=[];for(let M=0;M<h.length;M++)g=h[M],_.push(v(g));return _})();if(d=s.match(r.longValue)){if(m=v(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let h=[],_;for(_=0;_<=24;_+=8)h.push(m>>_&255);return h})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let h=d.slice(1,4),_=[];if(m=v(h[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return _.push(v(h[0])),_.push(m>>16&255),_.push(m>>8&255),_.push(m&255),_})():(d=s.match(r.threeOctet))?(function(){let h=d.slice(1,5),_=[];if(m=v(h[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return _.push(v(h[0])),_.push(v(h[1])),_.push(m>>8&255),_.push(m&255),_})():null},P.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},P.IPv6=(function(){function s(d,g){let m,h;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(h=this.parts[m],!(0<=h&&h<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return x(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={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},h,_;for(let M=7;M>=0;M-=1)if(h=this.parts[M],h in m){if(_=m[h],g&&_!==0)return null;_!==16&&(g=!0),d+=_}else return null;return 128-d},s.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let h=0;h<m.length;h++)d=m[h],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let h=0;h<this.parts.length;h++)m.push(T(this.parts[h].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new P.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let h=0;h<this.parts.length;h++)m.push(this.parts[h].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,h=-1,_;for(;_=d.exec(g);)_[0].length>h&&(m=_.index,h=_[0].length);return h<0?g:`${g.substring(0,m)}::${g.substring(m+h)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),P.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),h=[],_=0;for(;_<16;)h.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(h)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},P.IPv6.isIPv6=function(s){return this.parser(s)!==null},P.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},P.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},P.IPv6.networkAddressFromCIDR=function(s){let d,g,m,h,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),h=[],g=0;g<16;)h.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(h)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},P.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},P.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},P.IPv6.parser=function(s){let d,g,m,h,_,M;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return y(s,8);if((m=s.match(l.transitional))&&(M=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=y(d+M,6),d.parts)){for(_=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<_.length;g++)if(h=_[g],!(0<=h&&h<=255))return null;return d.parts.push(_[0]<<8|_[1]),d.parts.push(_[2]<<8|_[3]),{parts:d.parts,zoneId:d.zoneId}}return null},P.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},P.fromByteArray=function(s){let d=s.length;if(d===4)return new P.IPv4(s);if(d===16)return new P.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},P.isValid=function(s){return P.IPv6.isValid(s)||P.IPv4.isValid(s)},P.isValidCIDR=function(s){return P.IPv6.isValidCIDR(s)||P.IPv4.isValidCIDR(s)},P.parse=function(s){if(P.IPv6.isValid(s))return P.IPv6.parse(s);if(P.IPv4.isValid(s))return P.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},P.parseCIDR=function(s){try{return P.IPv6.parseCIDR(s)}catch{try{return P.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},P.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},P.subnetMatch=function(s,d,g){let m,h,_,M;g==null&&(g="unicast");for(h in d)if(Object.prototype.hasOwnProperty.call(d,h)){for(_=d[h],_[0]&&!(_[0]instanceof Array)&&(_=[_]),m=0;m<_.length;m++)if(M=_[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return h}return g},typeof Zt<"u"&&Zt.exports?Zt.exports=P:e.ipaddr=P})(Bo)});var Wi=E((F$,Gi)=>{var Hi=require("stream").Stream,Jp=require("util");Gi.exports=pe;function pe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(pe,"DelayedStream");Jp.inherits(pe,Hi);pe.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(pe.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});pe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};pe.prototype.resume=function(){this._released||this.release(),this.source.resume()};pe.prototype.pause=function(){this.source.pause()};pe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};pe.prototype.pipe=function(){var e=Hi.prototype.pipe.apply(this,arguments);return this.resume(),e};pe.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};pe.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Xi=E((V$,Ji)=>{var Xp=require("util"),Ki=require("stream").Stream,qi=Wi();Ji.exports=W;function W(){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(W,"CombinedStream");Xp.inherits(W,Ki);W.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};W.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};W.prototype.append=function(e){var t=W.isStreamLike(e);if(t){if(!(e instanceof qi)){var r=qi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};W.prototype.pipe=function(e,t){return Ki.prototype.pipe.call(this,e,t),this.resume(),e};W.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}};W.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=W.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};W.prototype._pipeNext=function(e){this._currentStream=e;var t=W.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};W.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};W.prototype.write=function(e){this.emit("data",e)};W.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};W.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")};W.prototype.end=function(){this._reset(),this.emit("end")};W.prototype.destroy=function(){this._reset(),this.emit("close")};W.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};W.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};W.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};W.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Qi=E((H$,Yi)=>{"use strict";Yi.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 ra=E(te=>{"use strict";var Jt=Qi(),Yp=require("path").extname,ea=/^\s*([^;\s]*)(?:;|\s|$)/,Qp=/^text\//i;te.charset=ta;te.charsets={lookup:ta};te.contentType=el;te.extension=tl;te.extensions=Object.create(null);te.lookup=rl;te.types=Object.create(null);nl(te.extensions,te.types);function ta(e){if(!e||typeof e!="string")return!1;var t=ea.exec(e),r=t&&Jt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Qp.test(t[1])?"UTF-8":!1}o(ta,"charset");function el(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(el,"contentType");function tl(e){if(!e||typeof e!="string")return!1;var t=ea.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(tl,"extension");function rl(e){if(!e||typeof e!="string")return!1;var t=Yp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(rl,"lookup");function nl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Jt).forEach(o(function(i){var u=Jt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var y=c[l];if(t[y]){var x=r.indexOf(Jt[t[y]].source),v=r.indexOf(u.source);if(t[y]!=="application/octet-stream"&&(x>v||x===v&&t[y].substr(0,12)==="application/"))continue}t[y]=i}}},"forEachMimeType"))}o(nl,"populateMaps")});var oa=E((q$,na)=>{na.exports=ol;function ol(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(ol,"defer")});var Gr=E((J$,aa)=>{var ia=oa();aa.exports=il;function il(e){var t=!1;return ia(function(){t=!0}),o(function(n,i){t?e(n,i):ia(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(il,"async")});var Wr=E((Y$,sa)=>{sa.exports=al;function al(e){Object.keys(e.jobs).forEach(sl.bind(e)),e.jobs={}}o(al,"abort");function sl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(sl,"clean")});var qr=E((ez,ca)=>{var ua=Gr(),ul=Wr();ca.exports=cl;function cl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=pl(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?ul(r):r.results[i]=c,n(u,r.results))})}o(cl,"iterate");function pl(e,t,r,n){var i;return e.length==2?i=e(r,ua(n)):i=e(r,t,ua(n)),i}o(pl,"runJob")});var Kr=E((rz,pa)=>{pa.exports=ll;function ll(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(ll,"state")});var Jr=E((oz,la)=>{var dl=Wr(),ml=Gr();la.exports=fl;function fl(e){Object.keys(this.jobs).length&&(this.index=this.size,dl(this),ml(e)(null,this.results))}o(fl,"terminator")});var ma=E((az,da)=>{var gl=qr(),yl=Kr(),hl=Jr();da.exports=vl;function vl(e,t,r){for(var n=yl(e);n.index<(n.keyedList||e).length;)gl(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return hl.bind(n,r)}o(vl,"parallel")});var Xr=E((uz,Xt)=>{var fa=qr(),xl=Kr(),Pl=Jr();Xt.exports=_l;Xt.exports.ascending=ga;Xt.exports.descending=bl;function _l(e,t,r,n){var i=xl(e,r);return fa(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){fa(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Pl.bind(i,n)}o(_l,"serialOrdered");function ga(e,t){return e<t?-1:e>t?1:0}o(ga,"ascending");function bl(e,t){return-1*ga(e,t)}o(bl,"descending")});var ha=E((pz,ya)=>{var Il=Xr();ya.exports=Tl;function Tl(e,t,r){return Il(e,t,null,r)}o(Tl,"serial")});var xa=E((dz,va)=>{va.exports={parallel:ma(),serial:ha(),serialOrdered:Xr()}});var Yr=E((mz,Pa)=>{"use strict";Pa.exports=Object});var ba=E((fz,_a)=>{"use strict";_a.exports=Error});var Ta=E((gz,Ia)=>{"use strict";Ia.exports=EvalError});var Aa=E((yz,Ea)=>{"use strict";Ea.exports=RangeError});var $a=E((hz,Sa)=>{"use strict";Sa.exports=ReferenceError});var Oa=E((vz,za)=>{"use strict";za.exports=SyntaxError});var Yt=E((xz,ka)=>{"use strict";ka.exports=TypeError});var wa=E((Pz,Ra)=>{"use strict";Ra.exports=URIError});var Da=E((_z,Na)=>{"use strict";Na.exports=Math.abs});var Ua=E((bz,Ca)=>{"use strict";Ca.exports=Math.floor});var La=E((Iz,Ma)=>{"use strict";Ma.exports=Math.max});var Fa=E((Tz,ja)=>{"use strict";ja.exports=Math.min});var Va=E((Ez,Ba)=>{"use strict";Ba.exports=Math.pow});var Ha=E((Az,Za)=>{"use strict";Za.exports=Math.round});var Wa=E((Sz,Ga)=>{"use strict";Ga.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ka=E((zz,qa)=>{"use strict";var El=Wa();qa.exports=o(function(t){return El(t)||t===0?t:t<0?-1:1},"sign")});var Xa=E((kz,Ja)=>{"use strict";Ja.exports=Object.getOwnPropertyDescriptor});var Qr=E((Rz,Ya)=>{"use strict";var Qt=Xa();if(Qt)try{Qt([],"length")}catch{Qt=null}Ya.exports=Qt});var es=E((wz,Qa)=>{"use strict";var er=Object.defineProperty||!1;if(er)try{er({},"a",{value:1})}catch{er=!1}Qa.exports=er});var en=E((Nz,ts)=>{"use strict";ts.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},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;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var os=E((Cz,ns)=>{"use strict";var rs=typeof Symbol<"u"&&Symbol,Al=en();ns.exports=o(function(){return typeof rs!="function"||typeof Symbol!="function"||typeof rs("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Al()},"hasNativeSymbols")});var tn=E((Mz,is)=>{"use strict";is.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var rn=E((Lz,as)=>{"use strict";var Sl=Yr();as.exports=Sl.getPrototypeOf||null});var cs=E((jz,us)=>{"use strict";var $l="Function.prototype.bind called on incompatible ",zl=Object.prototype.toString,Ol=Math.max,kl="[object Function]",ss=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Rl=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),wl=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");us.exports=o(function(t){var r=this;if(typeof r!="function"||zl.apply(r)!==kl)throw new TypeError($l+r);for(var n=Rl(arguments,1),i,u=o(function(){if(this instanceof i){var v=r.apply(this,ss(n,arguments));return Object(v)===v?v:this}return r.apply(t,ss(n,arguments))},"binder"),c=Ol(0,r.length-n.length),l=[],y=0;y<c;y++)l[y]="$"+y;if(i=Function("binder","return function ("+wl(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var x=o(function(){},"Empty");x.prototype=r.prototype,i.prototype=new x,x.prototype=null}return i},"bind")});var We=E((Bz,ps)=>{"use strict";var Nl=cs();ps.exports=Function.prototype.bind||Nl});var tr=E((Vz,ls)=>{"use strict";ls.exports=Function.prototype.call});var nn=E((Zz,ds)=>{"use strict";ds.exports=Function.prototype.apply});var fs=E((Hz,ms)=>{"use strict";ms.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ys=E((Gz,gs)=>{"use strict";var Dl=We(),Cl=nn(),Ul=tr(),Ml=fs();gs.exports=Ml||Dl.call(Ul,Cl)});var vs=E((Wz,hs)=>{"use strict";var Ll=We(),jl=Yt(),Fl=tr(),Bl=ys();hs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new jl("a function is required");return Bl(Ll,Fl,t)},"callBindBasic")});var Ts=E((Kz,Is)=>{"use strict";var Vl=vs(),xs=Qr(),_s;try{_s=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var on=!!_s&&xs&&xs(Object.prototype,"__proto__"),bs=Object,Ps=bs.getPrototypeOf;Is.exports=on&&typeof on.get=="function"?Vl([on.get]):typeof Ps=="function"?o(function(t){return Ps(t==null?t:bs(t))},"getDunder"):!1});var zs=E((Xz,$s)=>{"use strict";var Es=tn(),As=rn(),Ss=Ts();$s.exports=Es?o(function(t){return Es(t)},"getProto"):As?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return As(t)},"getProto"):Ss?o(function(t){return Ss(t)},"getProto"):null});var an=E((Qz,Os)=>{"use strict";var Zl=Function.prototype.call,Hl=Object.prototype.hasOwnProperty,Gl=We();Os.exports=Gl.call(Zl,Hl)});var Us=E((eO,Cs)=>{"use strict";var L,Wl=Yr(),ql=ba(),Kl=Ta(),Jl=Aa(),Xl=$a(),Xe=Oa(),Je=Yt(),Yl=wa(),Ql=Da(),ed=Ua(),td=La(),rd=Fa(),nd=Va(),od=Ha(),id=Ka(),Ns=Function,sn=o(function(e){try{return Ns('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Pt=Qr(),ad=es(),un=o(function(){throw new Je},"throwTypeError"),sd=Pt?(function(){try{return arguments.callee,un}catch{try{return Pt(arguments,"callee").get}catch{return un}}})():un,qe=os()(),Y=zs(),ud=rn(),cd=tn(),Ds=nn(),_t=tr(),Ke={},pd=typeof Uint8Array>"u"||!Y?L:Y(Uint8Array),Ue={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&Y?Y([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ql,"%eval%":eval,"%EvalError%":Kl,"%Float16Array%":typeof Float16Array>"u"?L:Float16Array,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":Ns,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&Y?Y(Y([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!Y?L:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Wl,"%Object.getOwnPropertyDescriptor%":Pt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":Jl,"%ReferenceError%":Xl,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!Y?L:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&Y?Y(""[Symbol.iterator]()):L,"%Symbol%":qe?Symbol:L,"%SyntaxError%":Xe,"%ThrowTypeError%":sd,"%TypedArray%":pd,"%TypeError%":Je,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":Yl,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":Ds,"%Object.defineProperty%":ad,"%Object.getPrototypeOf%":ud,"%Math.abs%":Ql,"%Math.floor%":ed,"%Math.max%":td,"%Math.min%":rd,"%Math.pow%":nd,"%Math.round%":od,"%Math.sign%":id,"%Reflect.getPrototypeOf%":cd};if(Y)try{null.error}catch(e){ks=Y(Y(e)),Ue["%Error.prototype%"]=ks}var ks,ld=o(function e(t){var r;if(t==="%AsyncFunction%")r=sn("async function () {}");else if(t==="%GeneratorFunction%")r=sn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=sn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Y&&(r=Y(i.prototype))}return Ue[t]=r,r},"doEval"),Rs={__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"]},bt=We(),rr=an(),dd=bt.call(_t,Array.prototype.concat),md=bt.call(Ds,Array.prototype.splice),ws=bt.call(_t,String.prototype.replace),nr=bt.call(_t,String.prototype.slice),fd=bt.call(_t,RegExp.prototype.exec),gd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,yd=/\\(\\)?/g,hd=o(function(t){var r=nr(t,0,1),n=nr(t,-1);if(r==="%"&&n!=="%")throw new Xe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Xe("invalid intrinsic syntax, expected opening `%`");var i=[];return ws(t,gd,function(u,c,l,y){i[i.length]=l?ws(y,yd,"$1"):c||u}),i},"stringToPath"),vd=o(function(t,r){var n=t,i;if(rr(Rs,n)&&(i=Rs[n],n="%"+i[0]+"%"),rr(Ue,n)){var u=Ue[n];if(u===Ke&&(u=ld(n)),typeof u>"u"&&!r)throw new Je("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Xe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Cs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Je('"allowMissing" argument must be a boolean');if(fd(/^%?[^%]*%?$/,t)===null)throw new Xe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=hd(t),i=n.length>0?n[0]:"",u=vd("%"+i+"%",r),c=u.name,l=u.value,y=!1,x=u.alias;x&&(i=x[0],md(n,dd([0,1],x)));for(var v=1,T=!0;v<n.length;v+=1){var P=n[v],s=nr(P,0,1),d=nr(P,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Xe("property names with quotes must have matching quotes");if((P==="constructor"||!T)&&(y=!0),i+="."+P,c="%"+i+"%",rr(Ue,c))l=Ue[c];else if(l!=null){if(!(P in l)){if(!r)throw new Je("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pt&&v+1>=n.length){var g=Pt(l,P);T=!!g,T&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[P]}else T=rr(l,P),l=l[P];T&&!y&&(Ue[c]=l)}}return l},"GetIntrinsic")});var Ls=E((rO,Ms)=>{"use strict";var xd=en();Ms.exports=o(function(){return xd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Bs=E((oO,Fs)=>{"use strict";var Pd=Us(),js=Pd("%Object.defineProperty%",!0),_d=Ls()(),bd=an(),Id=Yt(),or=_d?Symbol.toStringTag:null;Fs.exports=o(function(t,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 Id("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");or&&(n||!bd(t,or))&&(js?js(t,or,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[or]=r)},"setToStringTag")});var Zs=E((aO,Vs)=>{"use strict";var Td=Function.prototype.call,Ed=Object.prototype.hasOwnProperty,Ad=We();Vs.exports=Ad.call(Td,Ed)});var Gs=E((sO,Hs)=>{"use strict";Hs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Ks=E((uO,qs)=>{"use strict";var dn=Xi(),Sd=require("util"),cn=require("path"),$d=require("http"),zd=require("https"),Od=require("url").parse,kd=require("fs"),Rd=require("stream").Stream,wd=require("crypto"),pn=ra(),Nd=xa(),Dd=Bs(),Re=Zs(),ln=Gs();function Ws(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Ws,"escapeHeaderParam");function B(e){if(!(this instanceof B))return new B(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],dn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(B,"FormData");Sd.inherits(B,dn);B.LINE_BREAK=`\r
|
|
2
|
+
`;B.DEFAULT_CONTENT_TYPE="application/octet-stream";B.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=dn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};B.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+B.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Re(t,"httpVersion"))&&!(t instanceof Rd))&&(r.knownLength||this._valuesToMeasure.push(t))};B.prototype._lengthRetriever=function(e,t){Re(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):kd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Re(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Re(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};B.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Ws(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&ln(c,r.header);var l;for(var y in c)if(Re(c,y)){if(l=c[y],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=y+": "+l.join("; ")+B.LINE_BREAK)}return"--"+this.getBoundary()+B.LINE_BREAK+u+B.LINE_BREAK};B.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=cn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=cn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Re(e,"httpVersion")&&(r=cn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ws(r)+'"'};B.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=pn.lookup(e.name)),!r&&e&&e.path&&(r=pn.lookup(e.path)),!r&&e&&e.readable&&Re(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=pn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=B.DEFAULT_CONTENT_TYPE),r};B.prototype._multiPartFooter=function(){return function(e){var t=B.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};B.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+B.LINE_BREAK};B.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Re(e,t)&&(r[t.toLowerCase()]=e[t]);return r};B.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};B.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};B.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(B.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};B.prototype._generateBoundary=function(){this._boundary="--------------------------"+wd.randomBytes(12).toString("hex")};B.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};B.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};B.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Nd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};B.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Od(e),n=ln({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=ln(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=zd.request(n):r=$d.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,y=o(function(x,v){return r.removeListener("error",y),r.removeListener("response",l),t.call(this,x,v)},"callback");l=y.bind(this,null),r.on("error",y),r.on("response",l)}}.bind(this)),r};B.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};B.prototype.toString=function(){return"[object FormData]"};Dd(B.prototype,"FormData");qs.exports=B});var Hd={};yn(Hd,{alai:()=>Zd});module.exports=du(Hd);var mu=Object.freeze({status:"aborted"});function b(e,t,r){function n(l,y){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:y,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,y);let x=c.prototype,v=Object.keys(x);for(let T=0;T<v.length;T++){let P=v[T];P in l||(l[P]=x[P].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var y;let x=r?.Parent?new u:this;n(x,l),(y=x._zod).deferred??(y.deferred=[]);for(let v of x._zod.deferred)v();return x}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(b,"$constructor");var de=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Tt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ar={};function he(e){return e&&Object.assign(ar,e),ar}o(he,"config");function ur(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(ur,"getEnumValues");function xn(e,t){return typeof t=="bigint"?t.toString():t}o(xn,"jsonStringifyReplacer");function At(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(At,"cached");function Pn(e){return e==null}o(Pn,"nullish");function St(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(St,"cleanRegex");var vn=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==vn)return n===void 0&&(n=vn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var cr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(et,"isObject");var fu=At(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _n(e){if(et(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(et(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(_n,"isPlainObject");var bn=new Set(["string","number","symbol"]);function Le(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Le,"escapeRegex");function $t(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o($t,"clone");function V(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(V,"normalizeParams");function In(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(In,"optionalKeys");var Tn={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 je(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(je,"aborted");function Ie(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ie,"prefixIssues");function Et(e){return typeof e=="string"?e:e?.message}o(Et,"unwrapMessage");function Te(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Et(e.inst?._zod.def?.error?.(e))??Et(t?.error?.(e))??Et(r.customError?.(e))??Et(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Te,"finalizeIssue");function En(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(En,"getLengthableOrigin");function pr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(pr,"issue");var An=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,xn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Sn=b("$ZodError",An),tt=b("$ZodError",An,{Parent:Error});var yu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new de;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(y=>Te(y,u,he())));throw cr(l,i?.callee),l}return c.value},"_parse"),zt=yu(tt),hu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(y=>Te(y,u,he())));throw cr(l,i?.callee),l}return c.value},"_parseAsync"),Ot=hu(tt),vu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new de;return u.issues.length?{success:!1,error:new(e??Sn)(u.issues.map(c=>Te(c,i,he())))}:{success:!0,data:u.value}},"_safeParse"),rt=vu(tt),xu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Te(c,i,he())))}:{success:!0,data:u.value}},"_safeParseAsync"),nt=xu(tt);var Pu="(?:(?:\\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])))",_u=new RegExp(`^${Pu}$`);var $n=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),zn=/^-?\d+n?$/,On=/^-?\d+$/,lr=/^-?\d+(?:\.\d+)?$/,kn=/^(?:true|false)$/i;var Ee=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),bu={number:"number",bigint:"bigint",object:"date"};var Rn=b("$ZodCheckGreaterThan",(e,t)=>{Ee.init(e,t);let r=bu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var wn=b("$ZodCheckNumberFormat",(e,t)=>{Ee.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Tn[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=i,l.maximum=u,r&&(l.pattern=On)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>u&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Nn=b("$ZodCheckMinLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Pn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=En(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var dr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Ee.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Dn=b("$ZodCheckRegex",(e,t)=>{dr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Un={major:4,minor:3,patch:6};var G=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Un;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,y)=>{let x=je(c),v;for(let T of l){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(x)continue;let P=c.issues.length,s=T._zod.check(c);if(s instanceof Promise&&y?.async===!1)throw new de;if(v||s instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await s,c.issues.length!==P&&(x||(x=je(c,P)))});else{if(c.issues.length===P)continue;x||(x=je(c,P))}}return v?v.then(()=>c):c},"runChecks"),u=o((c,l,y)=>{if(je(c))return c.aborted=!0,c;let x=i(l,n,y);if(x instanceof Promise){if(y.async===!1)throw new de;return x.then(v=>e._zod.parse(v,y))}return e._zod.parse(x,y)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let x=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return x instanceof Promise?x.then(v=>u(v,c,l)):u(x,c,l)}let y=e._zod.parse(c,l);if(y instanceof Promise){if(l.async===!1)throw new de;return y.then(x=>i(x,n,l))}return i(y,n,l)}}q(e,"~standard",()=>({validate:o(i=>{try{let u=rt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return nt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),wt=b("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$n(e._zod.bag),e._zod.parse=(r,n)=>{if(t.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:e}),r}}),mr=b("$ZodStringFormat",(e,t)=>{dr.init(e,t),wt.init(e,t)});var Bn=b("$ZodURL",(e,t)=>{mr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var fr=b("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??lr,e._zod.parse=(r,n)=>{if(t.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 u=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:e,...u?{received:u}:{}}),r}}),Vn=b("$ZodNumberFormat",(e,t)=>{wn.init(e,t),fr.init(e,t)}),gr=b("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=kn,e._zod.parse=(r,n)=>{if(t.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:e}),r}}),Zn=b("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=zn,e._zod.parse=(r,n)=>{if(t.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:e}),r}});var Hn=b("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),Gn=b("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r});var Wn=b("$ZodVoid",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),qn=b("$ZodDate",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Mn(e,t,r){e.issues.length&&t.issues.push(...Ie(r,e.issues)),t.value[r]=e.value}o(Mn,"handleArrayResult");var Kn=b("$ZodArray",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],y=t.element._zod.run({value:l,issues:[]},n);y instanceof Promise?u.push(y.then(x=>Mn(x,r,c))):Mn(y,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Rt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ie(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Rt,"handlePropertyResult");function Iu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=In(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Iu,"normalizeDef");function Tu(e,t,r,n,i,u){let c=[],l=i.keySet,y=i.catchall._zod,x=y.def.type,v=y.optout==="optional";for(let T in t){if(l.has(T))continue;if(x==="never"){c.push(T);continue}let P=y.run({value:t[T],issues:[]},n);P instanceof Promise?e.push(P.then(s=>Rt(s,r,T,t,v))):Rt(P,r,T,t,v)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Tu,"handleCatchall");var Jn=b("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let y={...l};return Object.defineProperty(t,"shape",{value:y}),y},"get")})}let n=At(()=>Iu(t));q(e._zod,"propValues",()=>{let l=t.shape,y={};for(let x in l){let v=l[x]._zod;if(v.values){y[x]??(y[x]=new Set);for(let T of v.values)y[x].add(T)}}return y});let i=et,u=t.catchall,c;e._zod.parse=(l,y)=>{c??(c=n.value);let x=l.value;if(!i(x))return l.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),l;l.value={};let v=[],T=c.shape;for(let P of c.keys){let s=T[P],d=s._zod.optout==="optional",g=s._zod.run({value:x[P],issues:[]},y);g instanceof Promise?v.push(g.then(m=>Rt(m,l,P,x,d))):Rt(g,l,P,x,d)}return u?Tu(v,x,l,y,n.value,e):v.length?Promise.all(v).then(()=>l):l}});function Ln(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!je(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Te(c,n,he())))}),t)}o(Ln,"handleUnionResults");var yr=b("$ZodUnion",(e,t)=>{G.init(e,t),q(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),q(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>St(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let y of t.options){let x=y._zod.run({value:i.value,issues:[]},u);if(x instanceof Promise)l.push(x),c=!0;else{if(x.issues.length===0)return x;l.push(x)}}return c?Promise.all(l).then(y=>Ln(y,i,e,u)):Ln(l,i,e,u)}});var Xn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,yr.init(e,t);let r=e._zod.parse;q(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,y]of Object.entries(c)){i[l]||(i[l]=new Set);for(let x of y)i[l].add(x)}}return i});let n=At(()=>{let i=t.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let y of l){if(u.has(y))throw new Error(`Duplicate discriminator value "${String(y)}"`);u.set(y,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!et(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var Yn=b("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!_n(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let x of c)if(typeof x=="string"||typeof x=="number"||typeof x=="symbol"){l.add(typeof x=="number"?x.toString():x);let v=t.valueType._zod.run({value:i[x],issues:[]},n);v instanceof Promise?u.push(v.then(T=>{T.issues.length&&r.issues.push(...Ie(x,T.issues)),r.value[x]=T.value})):(v.issues.length&&r.issues.push(...Ie(x,v.issues)),r.value[x]=v.value)}let y;for(let x in i)l.has(x)||(y=y??[],y.push(x));y&&y.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:y})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let y=t.keyType._zod.run({value:l,issues:[]},n);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&lr.test(l)&&y.issues.length){let T=t.keyType._zod.run({value:Number(l),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(y=T)}if(y.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map(T=>Te(T,n,he())),input:l,path:[l],inst:e});continue}let v=t.valueType._zod.run({value:i[l],issues:[]},n);v instanceof Promise?u.push(v.then(T=>{T.issues.length&&r.issues.push(...Ie(l,T.issues)),r.value[y.value]=T.value})):(v.issues.length&&r.issues.push(...Ie(l,v.issues)),r.value[y.value]=v.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Qn=b("$ZodEnum",(e,t)=>{G.init(e,t);let r=ur(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>bn.has(typeof i)).map(i=>typeof i=="string"?Le(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),eo=b("$ZodLiteral",(e,t)=>{if(G.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Le(n):n?Le(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var to=b("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Tt(e.constructor.name);let i=t.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 de;return r.value=i,r}});function jn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(jn,"handleOptionalResult");var ro=b("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>jn(u,r.value)):jn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var no=b("$ZodNullable",(e,t)=>{G.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)}|null)$`):void 0}),q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var oo=b("$ZodPipe",(e,t)=>{G.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>kt(c,t.in,n)):kt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>kt(u,t.out,n)):kt(i,t.out,n)}});function kt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(kt,"handlePipeResult");var io=b("$ZodCustom",(e,t)=>{Ee.init(e,t),G.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Fn(u,r,n,e));Fn(i,r,n,e)}});function Fn(e,t,r,n){if(!e){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),t.issues.push(pr(i))}}o(Fn,"handleRefineResult");var so;var hr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function uo(){return new hr}o(uo,"registry");(so=globalThis).__zod_globalRegistry??(so.__zod_globalRegistry=uo());var vr=globalThis.__zod_globalRegistry;function co(e,t){return new e({type:"string",...V(t)})}o(co,"_string");function po(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(po,"_coercedString");function lo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(lo,"_url");function mo(e,t){return new e({type:"number",checks:[],...V(t)})}o(mo,"_number");function fo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(fo,"_coercedNumber");function go(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...V(t)})}o(go,"_int");function yo(e,t){return new e({type:"boolean",...V(t)})}o(yo,"_boolean");function ho(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(ho,"_coercedBoolean");function vo(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(vo,"_coercedBigint");function xo(e){return new e({type:"any"})}o(xo,"_any");function Po(e){return new e({type:"unknown"})}o(Po,"_unknown");function _o(e,t){return new e({type:"void",...V(t)})}o(_o,"_void");function bo(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(bo,"_coercedDate");function Nt(e,t){return new Rn({check:"greater_than",...V(t),value:e,inclusive:!0})}o(Nt,"_gte");function ue(e,t){return new Nn({check:"min_length",...V(t),minimum:e})}o(ue,"_minLength");function Ae(e,t){return new Dn({check:"string_format",format:"regex",...V(t),pattern:e})}o(Ae,"_regex");function Io(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Io,"_custom");var K=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");G.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>zt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>rt(e,r,n),e.parseAsync=async(r,n)=>Ot(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>nt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>$t(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Ct=b("ZodMiniString",(e,t)=>{wt.init(e,t),K.init(e,t)});function a(e){return co(Ct,e)}o(a,"string");var To=b("ZodMiniStringFormat",(e,t)=>{mr.init(e,t),Ct.init(e,t)});var Uu=b("ZodMiniURL",(e,t)=>{Bn.init(e,t),To.init(e,t)});function Eo(e){return lo(Uu,e)}o(Eo,"url");var Ut=b("ZodMiniNumber",(e,t)=>{fr.init(e,t),K.init(e,t)});function J(e){return mo(Ut,e)}o(J,"number");var Mu=b("ZodMiniNumberFormat",(e,t)=>{Vn.init(e,t),Ut.init(e,t)});function Ao(e){return go(Mu,e)}o(Ao,"int");var xr=b("ZodMiniBoolean",(e,t)=>{gr.init(e,t),K.init(e,t)});function F(e){return yo(xr,e)}o(F,"boolean");var So=b("ZodMiniBigInt",(e,t)=>{Zn.init(e,t),K.init(e,t)});var Lu=b("ZodMiniAny",(e,t)=>{Hn.init(e,t),K.init(e,t)});function it(){return xo(Lu)}o(it,"any");var ju=b("ZodMiniUnknown",(e,t)=>{Gn.init(e,t),K.init(e,t)});function N(){return Po(ju)}o(N,"unknown");var Fu=b("ZodMiniVoid",(e,t)=>{Wn.init(e,t),K.init(e,t)});function $o(e){return _o(Fu,e)}o($o,"_void");var zo=b("ZodMiniDate",(e,t)=>{qn.init(e,t),K.init(e,t)});var Bu=b("ZodMiniArray",(e,t)=>{Kn.init(e,t),K.init(e,t)});function O(e,t){return new Bu({type:"array",element:e,...V(t)})}o(O,"array");var Vu=b("ZodMiniObject",(e,t)=>{Jn.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...V(t)};return new Vu(r)}o(p,"object");var Zu=b("ZodMiniUnion",(e,t)=>{yr.init(e,t),K.init(e,t)});function U(e,t){return new Zu({type:"union",options:e,...V(t)})}o(U,"union");var Hu=b("ZodMiniDiscriminatedUnion",(e,t)=>{Xn.init(e,t),K.init(e,t)});function Se(e,t,r){return new Hu({type:"union",options:t,discriminator:e,...V(r)})}o(Se,"discriminatedUnion");var Gu=b("ZodMiniRecord",(e,t)=>{Yn.init(e,t),K.init(e,t)});function D(e,t,r){return new Gu({type:"record",keyType:e,valueType:t,...V(r)})}o(D,"record");var Wu=b("ZodMiniEnum",(e,t)=>{Qn.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function $(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Wu({type:"enum",entries:r,...V(t)})}o($,"_enum");var qu=b("ZodMiniLiteral",(e,t)=>{eo.init(e,t),K.init(e,t)});function A(e,t){return new qu({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o(A,"literal");var Ku=b("ZodMiniTransform",(e,t)=>{to.init(e,t),K.init(e,t)});function $e(e){return new Ku({type:"transform",transform:e})}o($e,"transform");var Ju=b("ZodMiniOptional",(e,t)=>{ro.init(e,t),K.init(e,t)});function f(e){return new Ju({type:"optional",innerType:e})}o(f,"optional");var Xu=b("ZodMiniNullable",(e,t)=>{no.init(e,t),K.init(e,t)});function at(e){return new Xu({type:"nullable",innerType:e})}o(at,"nullable");var Yu=b("ZodMiniPipe",(e,t)=>{oo.init(e,t),K.init(e,t)});function ze(e,t){return new Yu({type:"pipe",in:e,out:t})}o(ze,"pipe");var Qu=b("ZodMiniCustom",(e,t)=>{io.init(e,t),K.init(e,t)});function Mt(e,t){return Io(Qu,e??(()=>!0),t)}o(Mt,"custom");var st={};yn(st,{bigint:()=>ic,boolean:()=>oc,date:()=>ac,number:()=>nc,string:()=>rc});function rc(e){return po(Ct,e)}o(rc,"string");function nc(e){return fo(Ut,e)}o(nc,"number");function oc(e){return ho(xr,e)}o(oc,"boolean");function ic(e){return vo(So,e)}o(ic,"bigint");function ac(e){return bo(zo,e)}o(ac,"date");var _r=p({retryOnFailure:p({defaultValue:f(F()),hide:f(F())}),continueOnFailure:p({defaultValue:f(F()),hide:f(F())})}),Pr=class{constructor(t,r,n,i,u,c,l,y,x,v,T,P,s){this.name=t;this.displayName=r;this.description=n;this.props=i;this.propertyGroups=u;this.run=c;this.test=l;this.requireAuth=y;this.errorHandlingOptions=x;this.outputSchema=v;this.audience=T;this.aiMetadata=P;this.classification=s}static{o(this,"IAction")}},oe=o(e=>new Pr(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var j=p({displayName:a(),description:f(a()),advanced:f(F()),width:f($(["half","full"])),icon:f(a()),placeholder:f(a())}),C=o((e,t)=>p({type:A(t),required:F(),defaultValue:f(it())}),"TPropertyValue");var re=p({...j.shape,...C(a(),"SHORT_TEXT").shape}),ve=p({...j.shape,...C(a(),"LONG_TEXT").shape});var ko=p({label:a(),value:N(),description:f(a()),icon:f(a())}),Lt=p({disabled:f(F()),placeholder:f(a()),options:O(ko)});var uc=$(["cards"]),ne=p({...j.shape,options:Lt,display:f(uc),...C(N(),"STATIC_DROPDOWN").shape}),xe=p({...j.shape,options:Lt,...C(O(N()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var br=p({...j.shape,...C(N(),"DROPDOWN").shape,refreshers:O(a())}),ut=p({...j.shape,...C(O(N()),"MULTI_SELECT_DROPDOWN").shape,refreshers:O(a())});var Pe=p({...j.shape,reveals:f(O(a())),...C(F(),"CHECKBOX").shape});var _e=p({...j.shape,display:f($(["stepper"])),min:f(J()),max:f(J()),step:f(J()),...C(J(),"NUMBER").shape});var ct=p({...j.shape,streaming:f(F()),...C(N(),"FILE").shape});var pt=p({...j.shape,...C(a(),"DATE_TIME").shape});var Ro=D(a(),U([re,ve,ne,ut,xe,Pe,_e,ct,pt])),lt=p({...j.shape,properties:Ro,...C(O(N()),"ARRAY").shape});var wo=$(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),No=p({preset:f(wo),after:f(a()),before:f(a())}),Ir=p({...j.shape,display:f($(["dropdown"])),...C(No,"DATE_RANGE").shape});var dt=p({...j.shape,...C(U([D(a(),N())]),"JSON").shape});var Do=U([re,ne,dt,lt,xe]),cc=D(a(),Do),Tr=p({refreshers:O(a()),...j.shape,...C(N(),"DYNAMIC").shape});var jt=p({...j.shape,...C($o(),"MARKDOWN").shape});var mt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(mt||{}),Fe=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Fe||{}),Be=(h=>(h.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",h.COMMUNICATION="COMMUNICATION",h.COMMERCE="COMMERCE",h.CORE="CORE",h.UNIVERSAL_AI="UNIVERSAL_AI",h.FLOW_CONTROL="FLOW_CONTROL",h.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",h.ACCOUNTING="ACCOUNTING",h.PRODUCTIVITY="PRODUCTIVITY",h.CONTENT_AND_FILES="CONTENT_AND_FILES",h.DEVELOPER_TOOLS="DEVELOPER_TOOLS",h.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",h.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",h.HUMAN_RESOURCES="HUMAN_RESOURCES",h.PAYMENT_PROCESSING="PAYMENT_PROCESSING",h.MARKETING="MARKETING",h.SALES_AND_CRM="SALES_AND_CRM",h))(Be||{});var ft=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ft||{}),Er="both_client_credentials_and_authorization_code";var we=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(we||{}),gt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(gt||{}),pc=p({strategy:$(gt),paramName:f(a())}),yt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(yt||{});var Ft=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ft||{}),Co=p({status:f(J()),body:f(N()),headers:f(D(a(),a()))}),Uo=p({type:A("DELAY"),resumeDateTime:a(),requestIdToReply:f(a()),handlerId:f(a()),streamStepProgress:f($(Ft))}),Mo=p({type:A("WEBHOOK"),requestId:a(),requestIdToReply:f(a()),response:Co,handlerId:f(a()),streamStepProgress:f($(Ft))}),lc=U([Uo,Mo]);var dc=p({body:N(),rawBody:f(N()),headers:D(a(),a()),queryParams:D(a(),a())});function ce(e){return e==null}o(ce,"isNil");function ht(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ht,"isEmpty");function Bt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Bt,"assertNotNullOrUndefined");var Ar=Me(require("crypto"),1);var mc=128,Oe,Ve,fc=o(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*mc),Ar.default.randomFillSync(Oe),Ve=0):Ve+e>Oe.length&&(Ar.default.randomFillSync(Oe),Ve=0)}catch(t){throw Oe=void 0,t}Ve+=e},"fillPool"),gc=o(e=>(fc(e|=0),Oe.subarray(Ve-e,Ve)),"random"),yc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{if(u<=0)return"";let c="";for(;;){let l=r(i),y=i;for(;y--;)if(c+=e[l[y]&n]||"",c.length===u)return c}}},"customRandom"),jo=o((e,t=21)=>yc(e,t,gc),"customAlphabet");var hc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Fo=21,Ob=a().check(Ae(new RegExp(`^[0-9a-zA-Z]{${Fo}}$`))),vc=jo(hc,Fo);var ke=ze($e(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:ke,updated:ke},H=o(e=>f(at(e)),"Nullable");function Sr(e){return f(at($(e)))}o(Sr,"NullableEnum");var wb=ze($e(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),f(F())),Vt=o(e=>ze($e(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),f(O(e))),"OptionalArrayFromQuery");var Cb=D(a(),N());var vt=(v=>(v.OPENAI="openai",v.OPENROUTER="openrouter",v.ANTHROPIC="anthropic",v.AZURE="azure",v.GOOGLE="google",v.ACTIVEPIECES="activepieces",v.CLOUDFLARE_GATEWAY="cloudflare-gateway",v.CUSTOM="custom",v.BEDROCK="bedrock",v.MISTRAL="mistral",v))(vt||{});var qb=a().check(Ae(/^#[0-9A-Fa-f]{6}$/));var Jb=p({filename:a(),data:N(),type:A("file"),mimetype:f(a())});var xc=Me(Vo());var nI=p({...ie,name:a(),permissions:O(a()),platformId:H(a()),type:a(),userCount:f(J())});var Zo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Zo||{}),$r=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))($r||{}),zr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(zr||{});var Or=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Or||{});var kr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(kr||{});var Pc=p({mode:$(Zo),value:N()}),_c=p({auth:f(a()),fields:D(a(),Pc)}),bc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:f(_c)}),Ic=p({type:A("PIECE"),toolName:a().check(ue(1)),pieceMetadata:bc}),Tc=p({type:A("none")}),Ec=p({type:A("access_token"),accessToken:a()}),Ac=p({type:A("api_key"),apiKey:a(),apiKeyHeader:a()}),Sc=p({type:A("headers"),headers:D(a(),a())}),$c=Se("type",[Tc,Ec,Ac,Sc]),Ho=p({type:A("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:f(a())}),Go=p({type:A("MCP"),toolName:a().check(ue(1)),serverUrl:Eo(),protocol:$(zr),auth:$c}),Wo=p({type:A("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:$($r),sourceId:a(),sourceName:a()}),zc=Se("type",[Ic,Ho,Go,Wo]),Oc=p({displayName:a(),description:f(a()),type:$(Or)}),qo=p({type:A("MARKDOWN"),markdown:a()}),Ze={type:A("TOOL_CALL"),input:H(D(a(),N())),output:f(N()),toolName:a(),status:$(kr),toolCallId:a(),startTime:a(),endTime:f(a())},NI=p(Ze),Ko=Se("toolCallType",[p({...Ze,toolCallType:A("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Ze,toolCallType:A("FLOW"),displayName:a(),externalFlowId:a()}),p({...Ze,toolCallType:A("MCP"),displayName:a(),serverUrl:a()}),p({...Ze,toolCallType:A("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Ze,toolCallType:A("UNKNOWN"),displayName:a()})]),kc=U([qo,Ko]);var Rr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Rr||{}),be=p({apiKey:a()}),Rc=be,wc=p({apiKey:a(),apiKeyHash:a()}),Nc=be,Dc=be,Cc=be,Uc=be,Mc=be,Lc=be,jc=be,ei=p({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),Fc=p({}),Bc=p({}),Vc=p({}),Zc=p({}),Hc=p({}),Gc=p({}),ti=p({modelId:a(),modelName:a(),modelType:$(Rr)}),ri=p({apiKeyHeader:a(),baseUrl:a(),models:O(ti),defaultHeaders:f(D(a(),a()))}),ni=p({accountId:a(),gatewayId:a(),models:O(ti),vertexProject:f(a()),vertexRegion:f(a())}),oi=p({resourceName:a(),apiVersion:ze($e(e=>typeof e=="string"&&e.trim().length===0?void 0:e),f(a()))}),ii=p({region:a().check(ue(1))}),Wc=U([Rc,Cc,Uc,Mc,Lc,Dc,Nc,wc,ei,jc]),ai=U([ri,ni,oi,ii,Fc,Vc,Zc,Hc,Bc,Gc]),qc=p({id:a(),name:a(),type:$(Rr)}),Kc=p({id:a(),name:a(),provider:$(vt),config:ai,enabledForChat:F()}),Jc=p({provider:$(vt),config:ai,auth:Wc,platformId:a()});var MI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Jo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Xc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Yc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Xo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Qc=["grok-4.20","grok-4.1-fast"],ep={openai:Jo,anthropic:Xc,google:Xo,activepieces:[...Yc.map(e=>`anthropic/${e}`),...Jo.map(e=>`openai/${e}`),...Xo.map(e=>`google/${e}`),...Qc.map(e=>`x-ai/${e}`)]};var Yo=128e3,tp={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function rp({provider:e}){return e?tp[e]??Yo:Yo}o(rp,"getMaxContextTokens");var Qo={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"},np={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},op=new Set(["anthropic","mistral"]);function me(e){return{chatModels:ep[e],maxContextTokens:rp({provider:e}),defaultEmbeddingModel:Qo[e],supportsEmbedding:Qo[e]!==void 0,supportsImageGeneration:!op.has(e),webSearch:np[e]}}o(me,"buildProviderCapabilities");var ip={openai:me("openai"),anthropic:me("anthropic"),openrouter:me("openrouter"),azure:me("azure"),google:me("google"),"cloudflare-gateway":me("cloudflare-gateway"),custom:me("custom"),bedrock:me("bedrock"),mistral:me("mistral"),activepieces:me("activepieces")};var ap=p({base64Url:a(),fileName:a(),extension:f(a())}),sp=p({mimeType:a(),url:a(),fileName:f(a())}),wr=U([ap,sp]);var up=U([p({type:A("file"),value:wr}),p({type:A("markdown"),value:a(),files:f(O(wr))})]),cp=p({sessionId:a(),message:a(),files:f(O(a()))});var ui=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ui||{}),ci=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ci||{}),Nr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Nr||{});var pp=U([p({...ie,name:a(),externalId:a(),type:A("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:O(p({value:a()}))})}),p({...ie,name:a(),externalId:a(),type:U([A("TEXT"),A("NUMBER"),A("DATE"),A("DATETIME")]),tableId:a(),projectId:a()})]),lp=p({...ie,name:a(),folderId:H(a()),projectId:a(),externalId:a(),status:Sr(ci),trigger:Sr(ui)}),dp=p({...ie,tableId:a(),projectId:a(),cells:D(a(),p({updated:a(),created:a(),value:N(),fieldName:a()}))}),mp=p({events:O($(Nr)),webhookUrl:a(),flowId:a()}),fp=p({fields:O(p({id:a(),name:a()})),rows:O(D(a(),a())),name:a()}),gp=p({projectId:a(),limit:f(st.number()),cursor:f(a()),name:f(a()),externalIds:Vt(a()),folderId:f(a()),folderIds:Vt(a())}),yp=p({records:O(O(p({fieldId:a(),value:li()}))),tableId:a()}),hp=p({cells:f(O(p({fieldId:a(),value:li()}))),tableId:a(),agentUpdate:f(F())}),pi=Se("operator",[Ne("eq"),Ne("neq"),Ne("gt"),Ne("gte"),Ne("lt"),Ne("lte"),Ne("co"),si("exists"),si("not_exists")]),vp=p({tableId:a(),limit:f(st.number()),cursor:f(a()),filters:Vt(pi)});function li(){return ze($e(e=>e==null?e:String(e)),at(a()))}o(li,"coerceToString");function Ne(e){return p({fieldId:a(),operator:A(e),value:a()})}o(Ne,"valueFilter");function si(e){return p({fieldId:a(),operator:A(e)})}o(si,"existenceFilter");var xp=p({status:f(J()),body:f(N()),headers:f(D(a(),a()))}),Pp=p({...ie,deleted:H(ke),ownerId:a(),displayName:a(),platformId:a(),externalId:H(a())});var di=p({name:a(),description:f(a()),type:a(),required:F()}),_p=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:O(di),returnsResponse:F()})});var mi="^[0-9]+\\.[0-9]+\\.[0-9]+$",nT=new RegExp(mi),Ip="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",oT=a().check(Ae(new RegExp(mi))),iT=a().check(Ae(new RegExp(Ip))),Tp=p({packageType:A("ARCHIVE"),pieceType:$(Fe),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),fi=p({packageType:A("REGISTRY"),pieceType:A("OFFICIAL"),pieceName:a(),pieceVersion:a()}),gi=p({packageType:A("REGISTRY"),pieceType:A("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),aT=U([fi,gi]),sT=U([Tp,fi,gi]);var Ep=Se("type",[p({type:A("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:A("INTERVAL"),intervalMs:Ao().check(Nt(6e4))})]),uT=p({...ie,type:$(we),projectId:a(),flowId:a(),triggerName:a(),schedule:H(Ep),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:H(a()),simulate:F()}),yi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(yi||{}),hi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(hi||{}),vi=(r=>(r.S3="S3",r.DB="DB",r))(vi||{}),cT=p({...ie,projectId:H(a()),platformId:H(a()),type:$(yi),compression:$(hi),data:f(N()),location:$(vi),size:H(J()),fileName:H(a()),s3Key:H(a()),metadata:H(D(a(),a()))}),xi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(xi||{}),Pi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Pi||{}),pT=p({id:a(),email:a(),firstName:a(),status:$(Pi),externalId:H(a()),platformId:H(a()),platformRole:$(xi),lastName:a(),created:ke,updated:ke,lastActiveDate:H(ke),imageUrl:H(a())});var Dr=p({...j.shape,...C(D(a(),N()),"OBJECT").shape});var Cr=p({...j.shape,formatProperty:f(a()),...C(a(),"RICH_TEXT").shape});var Ti=p({...j.shape,...C(a(),"COLOR").shape});var Ur=U([re,ve,Cr,jt,Pe,ne,xe,br,ut,Tr,_e,lt,Dr,dt,pt,Ir,ct,Ti]),S={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var fe=p({displayName:a(),description:f(a()),hasConnectionIdentifier:f(F())});var Ei=p({username:a(),password:a()}),Mr=p({...fe.shape,username:p({displayName:a(),description:f(a())}),password:p({displayName:a(),description:f(a())}),...C(Ei,"BASIC_AUTH").shape});var zp=D(a(),U([re,ve,_e,Pe,ne])),Lr=p({...fe.shape,props:zp,...C(N(),"CUSTOM_AUTH").shape});var De=p({...fe.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var Op=D(a(),U([re,ve,De,_e,Pe,ne,xe,jt])),Ai=p({...fe.shape,props:Op,...C(N(),"OIDC").shape});var jr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(jr||{}),Si=U([re,De,ne]),$i=D(a(),Si),kp=p({props:f(D(a(),Si)),authUrl:a(),tokenUrl:a(),scope:O(a()),prompt:f(U([A("none"),A("consent"),A("login"),A("omit")])),pkce:f(F()),pkceMethod:f(U([A("plain"),A("S256")])),authorizationMethod:f($(jr)),grantType:f(U([$(ft),A(Er)])),extra:f(D(a(),a()))}),zi=p({access_token:a(),props:f($i),data:D(a(),it())}),Fr=p({...fe.shape,...kp.shape,...C(zi,"OAUTH2").shape});var He=U([Mr,Lr,Ai,Fr,De]),xt="Connection",Ht={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||xt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||xt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||xt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||xt}},None(){}};var WE={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 Rp=p({...j.shape,...C(N(),"CUSTOM").shape,code:a()});var wp=U([Ur,He]),Br=D(a(),wp),fA=D(a(),Ur);var Oi=U([p({strategy:A("CRON"),cronExpression:a()}),p({strategy:A("NONE")})]);var ki="2",Gt="0.82.0";var Vr=class{constructor(t,r,n,i,u,c,l,y,x=Gt,v,T="",P){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=y;this.minimumSupportedRelease=x;this.maximumSupportedRelease=v;this.description=T;this.deprecated=P;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:ki}),"getContextInfo");(!Dp(x)||Cp(x,Gt))&&(this.minimumSupportedRelease=Gt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}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:Np(this.auth),minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},wi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Vr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function Np(e){if(e!==void 0)return Array.isArray(e)?e.map(Ri):Ri(e)}o(Np,"withConnectionIdentifierFlag");function Ri(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}o(Ri,"flagConnectionIdentifier");function Dp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Dp,"isValidSimpleSemver");function Cp(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(Cp,"isSemverLessThan");var Up=f(D(a(),D(a(),a()))),Ni=p({id:f(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:O(a()),platformId:f(a()),directoryPath:f(a()),auth:f(U([He,O(He)])),version:a(),categories:f(O($(Be))),minimumSupportedRelease:f(a()),maximumSupportedRelease:f(a()),deprecated:f(F()),i18n:Up}),Mp=$(["human","ai","both"]),Di=p({description:f(a()),idempotent:f(F())}),Ci=$(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var Lp=$(["tabs","section","summary","builder","footer"]),Ui=p({key:a(),display:Lp,label:f(a()),description:f(a()),icon:f(a()),props:O(a())}),Mi=p({name:a(),displayName:a(),description:a(),props:Br,propertyGroups:f(O(Ui)),requireAuth:F(),errorHandlingOptions:f(_r),outputSchema:f(Mt()),audience:f(Mp),aiMetadata:f(Di),classification:f(Ci)}),Li=p({name:a(),displayName:a(),description:a(),props:Br,propertyGroups:f(O(Ui)),errorHandlingOptions:f(_r),type:$(we),sampleData:N(),handshakeConfiguration:f(Mt()),renewConfiguration:f(Oi),testStrategy:$(yt),outputSchema:f(Mt()),aiMetadata:f(Di),classification:f(Ci)}),jp=p({...Ni.shape,actions:D(a(),Mi),triggers:D(a(),Li)}),Fp=p({...Ni.shape,actions:J(),triggers:J(),suggestedActions:f(O(Mi)),suggestedTriggers:f(O(Li))}),ji=p({projectUsage:J(),pieceType:$(Fe),packageType:$(mt),platformId:f(a()),archiveId:f(a())}),yS=p({...jp.shape,...ji.shape}),hS=p({...Fp.shape,...ji.shape}),vS=p({name:a(),version:a()});var Bp=Me(require("path")),Vp=Me(require("fs/promises"));var Ge=require("node:stream");var Wt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var qt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Zr,r=new Hr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Zr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Hr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Ce=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}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 Fi({error:e,requestBody:t}){return e instanceof Ce?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Fi,"toFailsafeOutput");var ge=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(ge||{});var Kt=class extends Wt{static{o(this,"FetchHttpClient")}constructor(t="",r=new qt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[M,ee]of Object.entries(c))i.append(M,ee);let l=i.toString(),y=l?`${n}?${l}`:n,x=t.responseType??"json",v=t.followRedirects??!0,T=t.retries??0,{body:P,extraHeaders:s,isStream:d}=Zp(t.method)?Hp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},g=Wp({...u,...s}),m=await Gp(async()=>{let M=new AbortController,ee=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let ae={method:t.method.toString(),headers:g,body:P,redirect:v?"follow":"manual",signal:M.signal};return d&&(ae.duplex="half"),r?.dispatcher!==void 0&&(ae.dispatcher=r.dispatcher),await fetch(y,ae)}finally{ee!==void 0&&clearTimeout(ee)}},d?0:T),h=v?300:400;if(m.status<200||m.status>=h){let M=await Bi(m,x==="stream"?"text":x),ee=new Ce(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ee),ee}let _=await Bi(m,x);return{status:m.status,headers:qp(m.headers),body:_}}};function Zp(e){return e!=="GET"&&e!=="HEAD"}o(Zp,"acceptsRequestBody");function Hp(e,t){if(Zi(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Kp(e)){let n=new Ge.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof Ge.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Hp,"serializeBody");async function Bi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Zi(e.body)?Ge.Readable.from([]):Ge.Readable.fromWeb(e.body);case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Bi,"parseResponseBody");async function Gp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Vi(n);continue}return i}catch(i){if(r=i,n<t){await Vi(n);continue}throw i}throw r}o(Gp,"sendWithRetries");function Vi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Vi,"backoff");function Wp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(Wp,"normalizeHeaders");function qp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(qp,"toHttpHeaders");function Kp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Kp,"isNodeFormData");function Zi(e){return e==null}o(Zi,"isNil");var X=new Kt;var Cd=Me(require("fs")),Js=Me(Ks());var Ud={"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 Md(e){let t=e.split(";")[0].trim().toLowerCase();return Ud[t]??""}o(Md,"contentTypeToExtension");var Ld=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),jd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Xs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:y="headers",classification:x="WRITE"}){return oe({audience:"human",name:u||"custom_api_call",classification:x,displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:S.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:v})=>({url:S.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${jd(t,v)}/resource or /resource`,required:!0,defaultValue:v?t(v):"",...c?.url??{}})}),"props")}),method:S.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(ge).map(v=>({label:v,value:v}))},...c?.method??{}}),headers:S.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:S.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:S.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:S.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:v})=>{if(!v)return{};let T=v,P={};switch(T){case"none":break;case"json":P.data=S.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":P.data=S.LongText({displayName:"Raw Body",required:!0});break;case"form_data":P.data=S.Array({displayName:"Form Data",required:!0,properties:{fieldName:S.ShortText({displayName:"Field Name",required:!0}),fieldType:S.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:S.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:S.File({displayName:"File Field Value",required:!1})}});break}return P},"props")}),response_is_binary:S.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:S.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:S.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:S.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async v=>{let{method:T,url:P,headers:s,queryParams:d,body:g,body_type:m,failsafe:h,timeout:_,response_is_binary:M,followRedirects:ee}=v.propsValue;Bt(T,"Method"),Bt(P,"URL");let ae=ce(r)?{}:await r(v.auth,v.propsValue),le=P.url,Ye=le.startsWith("http://")||le.startsWith("https://")?le:Ld({baseUrl:t(v.auth),relativePath:le}),se={method:T,url:Ye,headers:{...s??{},...y==="headers"||!ce(y)?ae:{}},queryParams:{...y==="queryParams"?ae:{},...d??{}},timeout:_?_*1e3:0,followRedirects:ee};if(M&&(se.responseType="arraybuffer"),g)if(m&&m!=="none"){let ye=g.data;if(m==="form_data"){let au=ye,It=new Js.default;for(let{fieldName:mn,fieldType:fn,textFieldValue:gn,fileFieldValue:ir}of au)fn==="text"&&!ht(gn)?It.append(mn,gn):fn==="file"&&!ht(ir)&&It.append(mn,ir.data,{filename:ir?.filename});se.body=It,se.headers={...se.headers,...It.getHeaders()}}else se.body=ye}else m||(se.body=g);try{let ye=await X.sendRequest(se);return await Fd(v.files,ye.body,ye.status,ye.headers,M)}catch(ye){if(h)return Fi({error:ye,requestBody:se.body});throw ye}},"run")})}o(Xs,"createCustomApiCallAction");var Fd=o(async(e,t,r,n,i)=>{let u;if(i&&Bd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Md(c??"")||"txt",y;t instanceof ArrayBuffer?y=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?y=t:y=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:y})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Bd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Vd=`
|
|
4
4
|
Follow these steps to get your Alai API Key:
|
|
5
5
|
|
|
6
6
|
1. Go to [**https://getalai.com/api**](https://getalai.com/api) and sign up or log in.
|
|
7
7
|
2. Navigate to the **API Keys** section.
|
|
8
8
|
3. Click **Create API Key** and give it a name (e.g., "Activepieces").
|
|
9
9
|
4. Copy the key and paste it below.
|
|
10
|
-
`,ee=Lt.CustomAuth({description:ld,required:!0,props:{apiKey:Lt.SecretText({displayName:"API Key",description:"Paste your API key here.",required:!0})},async validate(e){let t=e.auth.apiKey;try{return await J.sendRequest({method:"GET",url:"https://slides-api.getalai.com/api/v1/ping",headers:{Authorization:`Bearer ${t}`}}),{valid:!0}}catch(r){return r instanceof Ve&&r.response.status===401?{valid:!1,error:"Invalid API Key"}:{valid:!1,error:"Failed to connect to Alai API"}}}});var zs=o(e=>new Promise(t=>setTimeout(t,e)),"sleep"),ks=ae({auth:ee,name:"generatePresentation",displayName:"Generate Presentation",description:"Create a new AI-generated presentation from text.",audience:"both",aiMetadata:{description:"Generate a brand-new presentation from input text via the Alai AI API, with optional controls for tone, slide count, text density, theme, and AI images. Use this to turn raw text into slides. By default it returns immediately with a generation_id (poll Get Generation for status); set Wait for Completion to block until the deck finishes (up to Max Wait Time). Not idempotent: each call starts a new generation.",idempotent:!1},props:{inputText:$.LongText({displayName:"Input Text",description:"The text content to generate a presentation from.",required:!0}),additionalInstructions:$.LongText({displayName:"Additional Instructions",description:"Extra instructions for how the presentation should be generated.",required:!1}),exportFormats:$.StaticMultiSelectDropdown({displayName:"Export Formats",description:"Formats to export the presentation in after generation.",required:!1,options:{options:[{label:"Link",value:"link"},{label:"PDF",value:"pdf"},{label:"PowerPoint (PPTX)",value:"ppt"}]}}),title:$.ShortText({displayName:"Title",description:"A title for the presentation. If not provided, one will be generated.",required:!1}),themeId:$.ShortText({displayName:"Theme ID",description:"The ID of the presentation theme to use. If not provided, a default theme will be applied.",required:!1}),slideRange:$.ShortText({displayName:"Slide Range",description:"Target slide count: auto, 1, 2-5, 6-10, 11-15, 16-20, 21-25, 26-50.",required:!1}),tone:$.StaticDropdown({displayName:"Tone",description:"The tone of voice for the presentation content.",required:!1,options:{options:[{label:"Default",value:"DEFAULT"},{label:"Professional",value:"PROFESSIONAL"},{label:"Casual",value:"CASUAL"},{label:"Technical",value:"TECHNICAL"},{label:"Educational",value:"EDUCATIONAL"},{label:"Inspirational",value:"INSPIRATIONAL"},{label:"Narrative",value:"NARRATIVE"},{label:"Persuasive",value:"PERSUASIVE"},{label:"Authoritative",value:"AUTHORITATIVE"},{label:"Empathetic",value:"EMPATHETIC"}]}}),contentMode:$.StaticDropdown({displayName:"Content Mode",description:"How the input text should be handled.",required:!1,options:{options:[{label:"Preserve",value:"PRESERVE"},{label:"Condense",value:"CONDENSE"},{label:"Enhance",value:"ENHANCE"},{label:"Custom",value:"CUSTOM"}]}}),amountMode:$.StaticDropdown({displayName:"Text Density",description:"The amount of text to include per slide.",required:!1,options:{options:[{label:"Minimal",value:"MINIMAL"},{label:"Essential",value:"ESSENTIAL"},{label:"Balanced",value:"BALANCED"},{label:"Detailed",value:"DETAILED"}]}}),includeAiImages:$.Checkbox({displayName:"Include AI Images",description:"Whether to include AI-generated images in the presentation.",required:!1,defaultValue:!0}),imageStyle:$.StaticDropdown({displayName:"Image Style",description:"The style for AI-generated images.",required:!1,options:{options:[{label:"Auto",value:"auto"},{label:"Realistic",value:"realistic"},{label:"Artistic",value:"artistic"},{label:"Cartoon",value:"cartoon"},{label:"3D",value:"three_d"}]}}),waitForCompletion:$.Checkbox({displayName:"Wait for Completion",description:"Wait for the presentation generation to complete before returning.",required:!1,defaultValue:!1}),maxWaitTime:$.Number({displayName:"Max Wait Time (seconds)",description:"Maximum time to wait for completion (default 300 seconds / 5 minutes).",required:!1,defaultValue:300})},async run(e){let{inputText:t,additionalInstructions:r,exportFormats:n,title:i,themeId:u,slideRange:c,tone:d,contentMode:g,amountMode:y,includeAiImages:_,imageStyle:b,waitForCompletion:x,maxWaitTime:s}=e.propsValue,l={input_text:t};r&&(l.additional_instructions=r),n&&n.length>0?l.export_formats=n:l.export_formats=["link"];let f={};i&&(f.title=i),u&&(f.theme_id=u),c&&(f.slide_range=c),Object.keys(f).length>0&&(l.presentation_options=f);let m={};d&&(m.tone=d),g&&(m.content_mode=g),y&&(m.amount_mode=y),Object.keys(m).length>0&&(l.text_options=m);let v={};_!=null&&(v.include_ai_images=_),b&&(v.style=b),Object.keys(v).length>0&&(l.image_options=v);let P=await J.sendRequest({method:"POST",url:"https://slides-api.getalai.com/api/v1/generations",headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,"Content-Type":"application/json"},body:l}),M=P.body?.generation_id;if(!M)throw new Error(`Failed to get generation_id from response: ${JSON.stringify(P.body)}`);if(!x)return P.body;await zs(1e3);let Y=(s||300)*1e3,re=Date.now(),Ae=5e3;for(;Date.now()-re<Y;){let ue=await J.sendRequest({method:"GET",url:`https://slides-api.getalai.com/api/v1/generations/${M}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`}}),ie=ue.body?.status;if(ie==="completed")return ue.body;if(ie==="failed")throw new Error(`Generation failed: ${ue.body?.error||"Unknown error"}`);await zs(Ae)}throw new Error(`Generation timed out after ${s||300} seconds`)}});var Os=ae({auth:ee,name:"getGeneration",displayName:"Get Generation",description:"Fetch the status and result of a generation job.",audience:"both",aiMetadata:{description:"Look up the current status and result of an Alai generation job by its generation_id (returned by Generate Presentation or Export Presentation). Use this to poll for completion or retrieve the finished output and export links. Read-only and idempotent. Requires a valid generation_id.",idempotent:!0},props:{generationId:$.ShortText({displayName:"Generation ID",description:'The ID of the generation job (from the "Generate Presentation" action).',required:!0})},async run(e){let{generationId:t}=e.propsValue;return(await J.sendRequest({method:"GET",url:`https://slides-api.getalai.com/api/v1/generations/${t}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,Accept:"application/json"}})).body}});var ws=o(e=>new Promise(t=>setTimeout(t,e)),"sleep"),Rs=ae({auth:ee,name:"exportPresentation",displayName:"Export Presentation",description:"Export a presentation in the specified formats.",audience:"both",aiMetadata:{description:"Export an existing Alai presentation into one or more formats (link, PDF, and/or PPTX) by its presentation ID. Use this to render a deck for download or sharing. By default it returns immediately with a generation_id (poll Get Generation for status); set Wait for Completion to block until the export finishes (up to Max Wait Time). Not idempotent: each call kicks off a new export job. Requires the presentation ID and at least one export format.",idempotent:!1},props:{presentationId:$.ShortText({displayName:"Presentation ID",description:"The ID of the presentation to export.",required:!0}),exportFormats:$.StaticMultiSelectDropdown({displayName:"Export Formats",description:"Formats to export the presentation in.",required:!0,options:{options:[{label:"Link",value:"link"},{label:"PDF",value:"pdf"},{label:"PowerPoint (PPTX)",value:"ppt"}]}}),waitForCompletion:$.Checkbox({displayName:"Wait for Completion",description:"Wait for the presentation generation to complete before returning.",required:!1,defaultValue:!1}),maxWaitTime:$.Number({displayName:"Max Wait Time (seconds)",description:"Maximum time to wait for completion (default 300 seconds / 5 minutes).",required:!1,defaultValue:300})},async run(e){let{presentationId:t,exportFormats:r,waitForCompletion:n,maxWaitTime:i}=e.propsValue,u=await J.sendRequest({method:"POST",url:`https://slides-api.getalai.com/api/v1/presentations/${t}/exports`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,"Content-Type":"application/json"},body:{export_formats:r}}),c=u.body?.generation_id;if(!c)throw new Error(`Failed to get generation_id from response: ${JSON.stringify(u.body)}`);if(!n)return u.body;await ws(1e3);let d=(i||300)*1e3,g=Date.now(),y=5e3;for(;Date.now()-g<d;){let _=await J.sendRequest({method:"GET",url:`https://slides-api.getalai.com/api/v1/generations/${c}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`}}),b=_.body?.status;if(b==="completed")return _.body;if(b==="failed")throw new Error(`Generation failed: ${_.body?.error||"Unknown error"}`);await ws(y)}throw new Error(`Generation timed out after ${i||300} seconds`)}});var Ns=$.Dropdown({auth:ee,displayName:"Presentation",description:"Select a presentation",required:!0,refreshers:[],options:o(async({auth:e})=>{if(!e)return{options:[]};let r=(await J.sendRequest({method:"GET",url:"https://slides-api.getalai.com/api/v1/presentations",headers:{Authorization:`Bearer ${e.props.apiKey}`,Accept:"application/json"}})).body?.presentations||[];return{disabled:r.length===0,options:r.map(n=>({label:n.title,value:n.presentation_id}))}},"options")});var Ds=ae({auth:ee,name:"addSlide",displayName:"Add Slide",description:"Add a new slide to an existing presentation.",audience:"both",aiMetadata:{description:'Generate and insert a new AI-authored slide into an existing Alai presentation, given the presentation ID and the slide content/topic; optional slide order controls where it lands (a numeric index, or "end" to append). Use this to extend a deck after it has been generated. Not idempotent: each call appends another slide.',idempotent:!1},props:{presentationId:Ns,slide_context:$.LongText({displayName:"Slide Context",description:"The content or topic for the slide to be generated.",required:!0}),additionalInstructions:$.LongText({displayName:"Additional Instructions",description:"Extra instructions for how the slide should be generated.",required:!1}),slide_order:$.ShortText({displayName:"Slide Order",description:'The position to insert the new slide (e.g., "0" for the first slide, "end" to add at the end).',required:!1}),includeAiImages:$.Checkbox({displayName:"Include AI Images",description:"Whether to include AI-generated images in the slide.",required:!1,defaultValue:!0}),imageStyle:$.ShortText({displayName:"Image Style",description:"The style for AI-generated images.",required:!1})},async run(e){let{presentationId:t,slide_context:r,additionalInstructions:n,slide_order:i,includeAiImages:u,imageStyle:c}=e.propsValue,d={};n&&(d.additional_instructions=n),i&&(d.slide_order=isNaN(Number(i))?i:Number(i)),u?d.num_image_variants=c?2:1:d.num_image_variants=0;let g={slide_context:r,options:d,export_formats:["link"]};return(await J.sendRequest({method:"POST",url:`https://slides-api.getalai.com/api/v1/presentations/${t}/slides`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,"Content-Type":"application/json"},body:g})).body}});var Cs=ae({auth:ee,name:"deletePresentation",displayName:"Delete Presentation",description:"Delete a presentation by its ID.",audience:"both",aiMetadata:{description:"Permanently delete an Alai presentation by its ID. Use this to remove a deck the user no longer needs. Destructive but idempotent: once deleted, repeating the call with the same ID leaves the same end state. Requires the presentation ID.",idempotent:!0},props:{presentationId:$.ShortText({displayName:"Presentation ID",description:"The ID of the presentation to delete.",required:!0})},async run(e){let{presentationId:t}=e.propsValue;return(await J.sendRequest({method:"DELETE",url:`https://slides-api.getalai.com/api/v1/presentations/${t}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`}})).body}});var dd=fi({displayName:"Alai",auth:ee,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/alai.png",authors:["getalai","sanket-a11y"],description:"AI-powered presentation generation API. Create, export, and manage professional presentations from text.",categories:["CONTENT_AND_FILES","ARTIFICIAL_INTELLIGENCE"],actions:[ks,Os,Rs,Ds,Cs,As({auth:ee,baseUrl:o(()=>"https://slides-api.getalai.com/api/v1","baseUrl"),authMapping:o(async e=>({Authorization:`Bearer ${e.props.apiKey}`}),"authMapping")})],triggers:[]});0&&(module.exports={alai});
|
|
10
|
+
`,Q=Ht.CustomAuth({description:Vd,required:!0,props:{apiKey:Ht.SecretText({displayName:"API Key",description:"Paste your API key here.",required:!0})},async validate(e){let t=e.auth.apiKey;try{return await X.sendRequest({method:"GET",url:"https://slides-api.getalai.com/api/v1/ping",headers:{Authorization:`Bearer ${t}`}}),{valid:!0}}catch(r){return r instanceof Ce&&r.response.status===401?{valid:!1,error:"Invalid API Key"}:{valid:!1,error:"Failed to connect to Alai API"}}}});var Ys=o(e=>new Promise(t=>setTimeout(t,e)),"sleep"),Qs=oe({auth:Q,name:"generatePresentation",classification:"WRITE",displayName:"Generate Presentation",description:"Create a new AI-generated presentation from text.",audience:"both",aiMetadata:{description:"Generate a brand-new presentation from input text via the Alai AI API, with optional controls for tone, slide count, text density, theme, and AI images. Use this to turn raw text into slides. By default it returns immediately with a generation_id (poll Get Generation for status); set Wait for Completion to block until the deck finishes (up to Max Wait Time). Not idempotent: each call starts a new generation.",idempotent:!1},props:{inputText:S.LongText({displayName:"Input Text",description:"The text content to generate a presentation from.",required:!0}),additionalInstructions:S.LongText({displayName:"Additional Instructions",description:"Extra instructions for how the presentation should be generated.",required:!1}),exportFormats:S.StaticMultiSelectDropdown({displayName:"Export Formats",description:"Formats to export the presentation in after generation.",required:!1,options:{options:[{label:"Link",value:"link"},{label:"PDF",value:"pdf"},{label:"PowerPoint (PPTX)",value:"ppt"}]}}),title:S.ShortText({displayName:"Title",description:"A title for the presentation. If not provided, one will be generated.",required:!1}),themeId:S.ShortText({displayName:"Theme ID",description:"The ID of the presentation theme to use. If not provided, a default theme will be applied.",required:!1}),slideRange:S.ShortText({displayName:"Slide Range",description:"Target slide count: auto, 1, 2-5, 6-10, 11-15, 16-20, 21-25, 26-50.",required:!1}),tone:S.StaticDropdown({displayName:"Tone",description:"The tone of voice for the presentation content.",required:!1,options:{options:[{label:"Default",value:"DEFAULT"},{label:"Professional",value:"PROFESSIONAL"},{label:"Casual",value:"CASUAL"},{label:"Technical",value:"TECHNICAL"},{label:"Educational",value:"EDUCATIONAL"},{label:"Inspirational",value:"INSPIRATIONAL"},{label:"Narrative",value:"NARRATIVE"},{label:"Persuasive",value:"PERSUASIVE"},{label:"Authoritative",value:"AUTHORITATIVE"},{label:"Empathetic",value:"EMPATHETIC"}]}}),contentMode:S.StaticDropdown({displayName:"Content Mode",description:"How the input text should be handled.",required:!1,options:{options:[{label:"Preserve",value:"PRESERVE"},{label:"Condense",value:"CONDENSE"},{label:"Enhance",value:"ENHANCE"},{label:"Custom",value:"CUSTOM"}]}}),amountMode:S.StaticDropdown({displayName:"Text Density",description:"The amount of text to include per slide.",required:!1,options:{options:[{label:"Minimal",value:"MINIMAL"},{label:"Essential",value:"ESSENTIAL"},{label:"Balanced",value:"BALANCED"},{label:"Detailed",value:"DETAILED"}]}}),includeAiImages:S.Checkbox({displayName:"Include AI Images",description:"Whether to include AI-generated images in the presentation.",required:!1,defaultValue:!0}),imageStyle:S.StaticDropdown({displayName:"Image Style",description:"The style for AI-generated images.",required:!1,options:{options:[{label:"Auto",value:"auto"},{label:"Realistic",value:"realistic"},{label:"Artistic",value:"artistic"},{label:"Cartoon",value:"cartoon"},{label:"3D",value:"three_d"}]}}),waitForCompletion:S.Checkbox({displayName:"Wait for Completion",description:"Wait for the presentation generation to complete before returning.",required:!1,defaultValue:!1}),maxWaitTime:S.Number({displayName:"Max Wait Time (seconds)",description:"Maximum time to wait for completion (default 300 seconds / 5 minutes).",required:!1,defaultValue:300})},async run(e){let{inputText:t,additionalInstructions:r,exportFormats:n,title:i,themeId:u,slideRange:c,tone:l,contentMode:y,amountMode:x,includeAiImages:v,imageStyle:T,waitForCompletion:P,maxWaitTime:s}=e.propsValue,d={input_text:t};r&&(d.additional_instructions=r),n&&n.length>0?d.export_formats=n:d.export_formats=["link"];let g={};i&&(g.title=i),u&&(g.theme_id=u),c&&(g.slide_range=c),Object.keys(g).length>0&&(d.presentation_options=g);let m={};l&&(m.tone=l),y&&(m.content_mode=y),x&&(m.amount_mode=x),Object.keys(m).length>0&&(d.text_options=m);let h={};v!=null&&(h.include_ai_images=v),T&&(h.style=T),Object.keys(h).length>0&&(d.image_options=h);let _=await X.sendRequest({method:"POST",url:"https://slides-api.getalai.com/api/v1/generations",headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,"Content-Type":"application/json"},body:d}),M=_.body?.generation_id;if(!M)throw new Error(`Failed to get generation_id from response: ${JSON.stringify(_.body)}`);if(!P)return _.body;await Ys(1e3);let ee=(s||300)*1e3,ae=Date.now(),le=5e3;for(;Date.now()-ae<ee;){let Ye=await X.sendRequest({method:"GET",url:`https://slides-api.getalai.com/api/v1/generations/${M}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`}}),se=Ye.body?.status;if(se==="completed")return Ye.body;if(se==="failed")throw new Error(`Generation failed: ${Ye.body?.error||"Unknown error"}`);await Ys(le)}throw new Error(`Generation timed out after ${s||300} seconds`)}});var eu=oe({auth:Q,name:"getGeneration",classification:"READ",displayName:"Get Generation",description:"Fetch the status and result of a generation job.",audience:"both",aiMetadata:{description:"Look up the current status and result of an Alai generation job by its generation_id (returned by Generate Presentation or Export Presentation). Use this to poll for completion or retrieve the finished output and export links. Read-only and idempotent. Requires a valid generation_id.",idempotent:!0},props:{generationId:S.ShortText({displayName:"Generation ID",description:'The ID of the generation job (from the "Generate Presentation" action).',required:!0})},async run(e){let{generationId:t}=e.propsValue;return(await X.sendRequest({method:"GET",url:`https://slides-api.getalai.com/api/v1/generations/${t}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,Accept:"application/json"}})).body}});var tu=o(e=>new Promise(t=>setTimeout(t,e)),"sleep"),ru=oe({auth:Q,name:"exportPresentation",classification:"WRITE",displayName:"Export Presentation",description:"Export a presentation in the specified formats.",audience:"both",aiMetadata:{description:"Export an existing Alai presentation into one or more formats (link, PDF, and/or PPTX) by its presentation ID. Use this to render a deck for download or sharing. By default it returns immediately with a generation_id (poll Get Generation for status); set Wait for Completion to block until the export finishes (up to Max Wait Time). Not idempotent: each call kicks off a new export job. Requires the presentation ID and at least one export format.",idempotent:!1},props:{presentationId:S.ShortText({displayName:"Presentation ID",description:"The ID of the presentation to export.",required:!0}),exportFormats:S.StaticMultiSelectDropdown({displayName:"Export Formats",description:"Formats to export the presentation in.",required:!0,options:{options:[{label:"Link",value:"link"},{label:"PDF",value:"pdf"},{label:"PowerPoint (PPTX)",value:"ppt"}]}}),waitForCompletion:S.Checkbox({displayName:"Wait for Completion",description:"Wait for the presentation generation to complete before returning.",required:!1,defaultValue:!1}),maxWaitTime:S.Number({displayName:"Max Wait Time (seconds)",description:"Maximum time to wait for completion (default 300 seconds / 5 minutes).",required:!1,defaultValue:300})},async run(e){let{presentationId:t,exportFormats:r,waitForCompletion:n,maxWaitTime:i}=e.propsValue,u=await X.sendRequest({method:"POST",url:`https://slides-api.getalai.com/api/v1/presentations/${t}/exports`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,"Content-Type":"application/json"},body:{export_formats:r}}),c=u.body?.generation_id;if(!c)throw new Error(`Failed to get generation_id from response: ${JSON.stringify(u.body)}`);if(!n)return u.body;await tu(1e3);let l=(i||300)*1e3,y=Date.now(),x=5e3;for(;Date.now()-y<l;){let v=await X.sendRequest({method:"GET",url:`https://slides-api.getalai.com/api/v1/generations/${c}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`}}),T=v.body?.status;if(T==="completed")return v.body;if(T==="failed")throw new Error(`Generation failed: ${v.body?.error||"Unknown error"}`);await tu(x)}throw new Error(`Generation timed out after ${i||300} seconds`)}});var nu=S.Dropdown({auth:Q,displayName:"Presentation",description:"Select a presentation",required:!0,refreshers:[],options:o(async({auth:e})=>{if(!e)return{options:[]};let r=(await X.sendRequest({method:"GET",url:"https://slides-api.getalai.com/api/v1/presentations",headers:{Authorization:`Bearer ${e.props.apiKey}`,Accept:"application/json"}})).body?.presentations||[];return{disabled:r.length===0,options:r.map(n=>({label:n.title,value:n.presentation_id}))}},"options")});var ou=oe({auth:Q,name:"addSlide",classification:"WRITE",displayName:"Add Slide",description:"Add a new slide to an existing presentation.",audience:"both",aiMetadata:{description:'Generate and insert a new AI-authored slide into an existing Alai presentation, given the presentation ID and the slide content/topic; optional slide order controls where it lands (a numeric index, or "end" to append). Use this to extend a deck after it has been generated. Not idempotent: each call appends another slide.',idempotent:!1},props:{presentationId:nu,slide_context:S.LongText({displayName:"Slide Context",description:"The content or topic for the slide to be generated.",required:!0}),additionalInstructions:S.LongText({displayName:"Additional Instructions",description:"Extra instructions for how the slide should be generated.",required:!1}),slide_order:S.ShortText({displayName:"Slide Order",description:'The position to insert the new slide (e.g., "0" for the first slide, "end" to add at the end).',required:!1}),includeAiImages:S.Checkbox({displayName:"Include AI Images",description:"Whether to include AI-generated images in the slide.",required:!1,defaultValue:!0}),imageStyle:S.ShortText({displayName:"Image Style",description:"The style for AI-generated images.",required:!1})},async run(e){let{presentationId:t,slide_context:r,additionalInstructions:n,slide_order:i,includeAiImages:u,imageStyle:c}=e.propsValue,l={};n&&(l.additional_instructions=n),i&&(l.slide_order=isNaN(Number(i))?i:Number(i)),u?l.num_image_variants=c?2:1:l.num_image_variants=0;let y={slide_context:r,options:l,export_formats:["link"]};return(await X.sendRequest({method:"POST",url:`https://slides-api.getalai.com/api/v1/presentations/${t}/slides`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,"Content-Type":"application/json"},body:y})).body}});var iu=oe({auth:Q,name:"deletePresentation",classification:"DESTRUCTIVE",displayName:"Delete Presentation",description:"Delete a presentation by its ID.",audience:"both",aiMetadata:{description:"Permanently delete an Alai presentation by its ID. Use this to remove a deck the user no longer needs. Destructive but idempotent: once deleted, repeating the call with the same ID leaves the same end state. Requires the presentation ID.",idempotent:!0},props:{presentationId:S.ShortText({displayName:"Presentation ID",description:"The ID of the presentation to delete.",required:!0})},async run(e){let{presentationId:t}=e.propsValue;return(await X.sendRequest({method:"DELETE",url:`https://slides-api.getalai.com/api/v1/presentations/${t}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`}})).body}});var Zd=wi({displayName:"Alai",auth:Q,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/alai.png",authors:["getalai","sanket-a11y"],description:"AI-powered presentation generation API. Create, export, and manage professional presentations from text.",categories:["CONTENT_AND_FILES","ARTIFICIAL_INTELLIGENCE"],actions:[Qs,eu,ru,ou,iu,Xs({auth:Q,baseUrl:o(()=>"https://slides-api.getalai.com/api/v1","baseUrl"),authMapping:o(async e=>({Authorization:`Bearer ${e.props.apiKey}`}),"authMapping")})],triggers:[]});0&&(module.exports={alai});
|
|
11
11
|
/*! Bundled license information:
|
|
12
12
|
|
|
13
13
|
mime-types/index.js:
|