@activepieces/piece-savvycal 0.1.5 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/piece-savvycal",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "main": "./src/index.js",
5
5
  "dependencies": {},
6
6
  "files": [
package/src/index.js CHANGED
@@ -1,13 +1,13 @@
1
- "use strict";var pu=Object.create;var ot=Object.defineProperty;var du=Object.getOwnPropertyDescriptor;var mu=Object.getOwnPropertyNames;var fu=Object.getPrototypeOf,gu=Object.prototype.hasOwnProperty;var o=(e,t)=>ot(e,"name",{value:t,configurable:!0});var A=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bn=(e,t)=>{for(var r in t)ot(e,r,{get:t[r],enumerable:!0})},Tn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of mu(t))!gu.call(e,i)&&i!==r&&ot(e,i,{get:()=>t[i],enumerable:!(n=du(t,i))||n.enumerable});return e};var Ne=(e,t,r)=>(r=e!=null?pu(fu(e)):{},Tn(t||!e||!e.__esModule?ot(r,"default",{value:e,enumerable:!0}):r,e)),yu=e=>Tn(ot({},"__esModule",{value:!0}),e);var Fo=A((jo,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]+::?)+",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 f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],P,j;for(v&&(v=v.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(j=d-g,P=":";j--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=function(){let ie=s.split(":"),le=[];for(let nt=0;nt<ie.length;nt++)le.push(parseInt(ie[nt],16));return le}(),{parts:d,zoneId:v}}o(f,"expandIPv6");function y(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=g-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=g,v+=1}return!0}o(y,"matchCIDR");function x(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(x,"parseIntAuto");function T(s,d){for(;s.length<d;)s=`0${s}`;return s}o(T,"padPart");let _={};_.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 y(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},v,P,j;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(j=m[P],g&&j!==0)return null;j!==8&&(g=!0),d+=j}else return null;return 32-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),_.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(g[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")}},_.IPv4.isIPv4=function(s){return this.parser(s)!==null},_.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(s){return!!(_.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(s)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.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)},_.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")},_.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return function(){let v=d.slice(1,6),P=[];for(let j=0;j<v.length;j++)g=v[j],P.push(x(g));return P}();if(d=s.match(r.longValue)){if(m=x(d[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(d=s.match(r.twoOctet))?function(){let v=d.slice(1,4),P=[];if(m=x(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P}():(d=s.match(r.threeOctet))?function(){let v=d.slice(1,5),P=[];if(m=x(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(x(v[1])),P.push(m>>8&255),P.push(m&255),P}():null},_.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)},_.IPv6=function(){function s(d,g){let m,v;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(v=this.parts[m],!(0<=v&&v<=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 y(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},v,P;for(let j=7;j>=0;j-=1)if(v=this.parts[j],v in m){if(P=m[v],g&&P!==0)return null;P!==16&&(g=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(T(this.parts[v].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 _.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].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,v=-1,P;for(;P=d.exec(g);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),_.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(s){return this.parser(s)!==null},_.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}},_.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},_.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)},_.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")},_.IPv6.parser=function(s){let d,g,m,v,P,j;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return f(s,8);if((m=s.match(l.transitional))&&(j=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+j,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<P.length;g++)if(v=P[g],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.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)},_.fromByteArray=function(s){let d=s.length;if(d===4)return new _.IPv4(s);if(d===16)return new _.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(s){return _.IPv6.isValid(s)||_.IPv4.isValid(s)},_.isValidCIDR=function(s){return _.IPv6.isValidCIDR(s)||_.IPv4.isValidCIDR(s)},_.parse=function(s){if(_.IPv6.isValid(s))return _.IPv6.parse(s);if(_.IPv4.isValid(s))return _.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(s){try{return _.IPv6.parseCIDR(s)}catch{try{return _.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(s,d,g){let m,v,P,j;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(j=P[m],s.kind()===j[0].kind()&&s.match.apply(s,j))return v}return g},typeof Jt<"u"&&Jt.exports?Jt.exports=_:e.ipaddr=_})(jo)});var Ci=A((SA,Di)=>{var Ni=require("stream").Stream,Hl=require("util");Di.exports=me;function me(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(me,"DelayedStream");Hl.inherits(me,Ni);me.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(me.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});me.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};me.prototype.resume=function(){this._released||this.release(),this.source.resume()};me.prototype.pause=function(){this.source.pause()};me.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};me.prototype.pipe=function(){var e=Ni.prototype.pipe.apply(this,arguments);return this.resume(),e};me.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)};me.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 ji=A((AA,Li)=>{var Wl=require("util"),Mi=require("stream").Stream,Ui=Ci();Li.exports=X;function X(){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(X,"CombinedStream");Wl.inherits(X,Mi);X.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};X.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};X.prototype.append=function(e){var t=X.isStreamLike(e);if(t){if(!(e instanceof Ui)){var r=Ui.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};X.prototype.pipe=function(e,t){return Mi.prototype.pipe.call(this,e,t),this.resume(),e};X.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}};X.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=X.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};X.prototype._pipeNext=function(e){this._currentStream=e;var t=X.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()};X.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};X.prototype.write=function(e){this.emit("data",e)};X.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};X.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")};X.prototype.end=function(){this._reset(),this.emit("end")};X.prototype.destroy=function(){this._reset(),this.emit("close")};X.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};X.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};X.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)};X.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Bi=A((kA,Fi)=>{"use strict";Fi.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 Hi=A(oe=>{"use strict";var rr=Bi(),ql=require("path").extname,Zi=/^\s*([^;\s]*)(?:;|\s|$)/,Gl=/^text\//i;oe.charset=Vi;oe.charsets={lookup:Vi};oe.contentType=Kl;oe.extension=Jl;oe.extensions=Object.create(null);oe.lookup=Xl;oe.types=Object.create(null);Yl(oe.extensions,oe.types);function Vi(e){if(!e||typeof e!="string")return!1;var t=Zi.exec(e),r=t&&rr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Gl.test(t[1])?"UTF-8":!1}o(Vi,"charset");function Kl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?oe.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=oe.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Kl,"contentType");function Jl(e){if(!e||typeof e!="string")return!1;var t=Zi.exec(e),r=t&&oe.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Jl,"extension");function Xl(e){if(!e||typeof e!="string")return!1;var t=ql("x."+e).toLowerCase().substr(1);return t&&oe.types[t]||!1}o(Xl,"lookup");function Yl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(rr).forEach(o(function(i){var u=rr[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var y=r.indexOf(rr[t[f]].source),x=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(y>x||y===x&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Yl,"populateMaps")});var qi=A((RA,Wi)=>{Wi.exports=Ql;function Ql(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Ql,"defer")});var Yr=A((DA,Ki)=>{var Gi=qi();Ki.exports=ep;function ep(e){var t=!1;return Gi(function(){t=!0}),o(function(n,i){t?e(n,i):Gi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(ep,"async")});var Qr=A((UA,Ji)=>{Ji.exports=tp;function tp(e){Object.keys(e.jobs).forEach(rp.bind(e)),e.jobs={}}o(tp,"abort");function rp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(rp,"clean")});var en=A((LA,Yi)=>{var Xi=Yr(),np=Qr();Yi.exports=op;function op(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=ip(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?np(r):r.results[i]=c,n(u,r.results))})}o(op,"iterate");function ip(e,t,r,n){var i;return e.length==2?i=e(r,Xi(n)):i=e(r,t,Xi(n)),i}o(ip,"runJob")});var tn=A((FA,Qi)=>{Qi.exports=ap;function ap(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(ap,"state")});var rn=A((ZA,ea)=>{var sp=Qr(),up=Yr();ea.exports=cp;function cp(e){Object.keys(this.jobs).length&&(this.index=this.size,sp(this),up(e)(null,this.results))}o(cp,"terminator")});var ra=A((HA,ta)=>{var lp=en(),pp=tn(),dp=rn();ta.exports=mp;function mp(e,t,r){for(var n=pp(e);n.index<(n.keyedList||e).length;)lp(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 dp.bind(n,r)}o(mp,"parallel")});var nn=A((qA,nr)=>{var na=en(),fp=tn(),gp=rn();nr.exports=yp;nr.exports.ascending=oa;nr.exports.descending=hp;function yp(e,t,r,n){var i=fp(e,r);return na(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){na(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),gp.bind(i,n)}o(yp,"serialOrdered");function oa(e,t){return e<t?-1:e>t?1:0}o(oa,"ascending");function hp(e,t){return-1*oa(e,t)}o(hp,"descending")});var aa=A((KA,ia)=>{var vp=nn();ia.exports=_p;function _p(e,t,r){return vp(e,t,null,r)}o(_p,"serial")});var ua=A((XA,sa)=>{sa.exports={parallel:ra(),serial:aa(),serialOrdered:nn()}});var on=A((YA,ca)=>{"use strict";ca.exports=Object});var pa=A((QA,la)=>{"use strict";la.exports=Error});var ma=A((ez,da)=>{"use strict";da.exports=EvalError});var ga=A((tz,fa)=>{"use strict";fa.exports=RangeError});var ha=A((rz,ya)=>{"use strict";ya.exports=ReferenceError});var _a=A((nz,va)=>{"use strict";va.exports=SyntaxError});var or=A((oz,xa)=>{"use strict";xa.exports=TypeError});var ba=A((iz,Pa)=>{"use strict";Pa.exports=URIError});var Ea=A((az,Ta)=>{"use strict";Ta.exports=Math.abs});var Sa=A((sz,Ia)=>{"use strict";Ia.exports=Math.floor});var Aa=A((uz,$a)=>{"use strict";$a.exports=Math.max});var ka=A((cz,za)=>{"use strict";za.exports=Math.min});var Oa=A((lz,wa)=>{"use strict";wa.exports=Math.pow});var Na=A((pz,Ra)=>{"use strict";Ra.exports=Math.round});var Ca=A((dz,Da)=>{"use strict";Da.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ma=A((fz,Ua)=>{"use strict";var xp=Ca();Ua.exports=o(function(t){return xp(t)||t===0?t:t<0?-1:1},"sign")});var ja=A((yz,La)=>{"use strict";La.exports=Object.getOwnPropertyDescriptor});var an=A((hz,Fa)=>{"use strict";var ir=ja();if(ir)try{ir([],"length")}catch{ir=null}Fa.exports=ir});var Za=A((vz,Ba)=>{"use strict";var ar=Object.defineProperty||!1;if(ar)try{ar({},"a",{value:1})}catch{ar=!1}Ba.exports=ar});var sn=A((_z,Va)=>{"use strict";Va.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 qa=A((Pz,Wa)=>{"use strict";var Ha=typeof Symbol<"u"&&Symbol,Pp=sn();Wa.exports=o(function(){return typeof Ha!="function"||typeof Symbol!="function"||typeof Ha("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Pp()},"hasNativeSymbols")});var un=A((Tz,Ga)=>{"use strict";Ga.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var cn=A((Ez,Ka)=>{"use strict";var bp=on();Ka.exports=bp.getPrototypeOf||null});var Ya=A((Iz,Xa)=>{"use strict";var Tp="Function.prototype.bind called on incompatible ",Ep=Object.prototype.toString,Ip=Math.max,Sp="[object Function]",Ja=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"),$p=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"),Ap=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");Xa.exports=o(function(t){var r=this;if(typeof r!="function"||Ep.apply(r)!==Sp)throw new TypeError(Tp+r);for(var n=$p(arguments,1),i,u=o(function(){if(this instanceof i){var x=r.apply(this,Ja(n,arguments));return Object(x)===x?x:this}return r.apply(t,Ja(n,arguments))},"binder"),c=Ip(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+Ap(l,",")+"){ 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 Xe=A(($z,Qa)=>{"use strict";var zp=Ya();Qa.exports=Function.prototype.bind||zp});var sr=A((Az,es)=>{"use strict";es.exports=Function.prototype.call});var ln=A((zz,ts)=>{"use strict";ts.exports=Function.prototype.apply});var ns=A((kz,rs)=>{"use strict";rs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var is=A((wz,os)=>{"use strict";var kp=Xe(),wp=ln(),Op=sr(),Rp=ns();os.exports=Rp||kp.call(Op,wp)});var ss=A((Oz,as)=>{"use strict";var Np=Xe(),Dp=or(),Cp=sr(),Up=is();as.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Dp("a function is required");return Up(Np,Cp,t)},"callBindBasic")});var ms=A((Nz,ds)=>{"use strict";var Mp=ss(),us=an(),ls;try{ls=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var pn=!!ls&&us&&us(Object.prototype,"__proto__"),ps=Object,cs=ps.getPrototypeOf;ds.exports=pn&&typeof pn.get=="function"?Mp([pn.get]):typeof cs=="function"?o(function(t){return cs(t==null?t:ps(t))},"getDunder"):!1});var vs=A((Cz,hs)=>{"use strict";var fs=un(),gs=cn(),ys=ms();hs.exports=fs?o(function(t){return fs(t)},"getProto"):gs?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return gs(t)},"getProto"):ys?o(function(t){return ys(t)},"getProto"):null});var dn=A((Mz,_s)=>{"use strict";var Lp=Function.prototype.call,jp=Object.prototype.hasOwnProperty,Fp=Xe();_s.exports=Fp.call(Lp,jp)});var Ss=A((Lz,Is)=>{"use strict";var F,Bp=on(),Zp=pa(),Vp=ma(),Hp=ga(),Wp=ha(),tt=_a(),et=or(),qp=ba(),Gp=Ea(),Kp=Sa(),Jp=Aa(),Xp=ka(),Yp=Oa(),Qp=Na(),ed=Ma(),Ts=Function,mn=o(function(e){try{return Ts('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),$t=an(),td=Za(),fn=o(function(){throw new et},"throwTypeError"),rd=$t?function(){try{return arguments.callee,fn}catch{try{return $t(arguments,"callee").get}catch{return fn}}}():fn,Ye=qa()(),ee=vs(),nd=cn(),od=un(),Es=ln(),At=sr(),Qe={},id=typeof Uint8Array>"u"||!ee?F:ee(Uint8Array),Me={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?F:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?F:ArrayBuffer,"%ArrayIteratorPrototype%":Ye&&ee?ee([][Symbol.iterator]()):F,"%AsyncFromSyncIteratorPrototype%":F,"%AsyncFunction%":Qe,"%AsyncGenerator%":Qe,"%AsyncGeneratorFunction%":Qe,"%AsyncIteratorPrototype%":Qe,"%Atomics%":typeof Atomics>"u"?F:Atomics,"%BigInt%":typeof BigInt>"u"?F:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?F:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?F:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?F:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Zp,"%eval%":eval,"%EvalError%":Vp,"%Float16Array%":typeof Float16Array>"u"?F:Float16Array,"%Float32Array%":typeof Float32Array>"u"?F:Float32Array,"%Float64Array%":typeof Float64Array>"u"?F:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?F:FinalizationRegistry,"%Function%":Ts,"%GeneratorFunction%":Qe,"%Int8Array%":typeof Int8Array>"u"?F:Int8Array,"%Int16Array%":typeof Int16Array>"u"?F:Int16Array,"%Int32Array%":typeof Int32Array>"u"?F:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ye&&ee?ee(ee([][Symbol.iterator]())):F,"%JSON%":typeof JSON=="object"?JSON:F,"%Map%":typeof Map>"u"?F:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ye||!ee?F:ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Bp,"%Object.getOwnPropertyDescriptor%":$t,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?F:Promise,"%Proxy%":typeof Proxy>"u"?F:Proxy,"%RangeError%":Hp,"%ReferenceError%":Wp,"%Reflect%":typeof Reflect>"u"?F:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?F:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ye||!ee?F:ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?F:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ye&&ee?ee(""[Symbol.iterator]()):F,"%Symbol%":Ye?Symbol:F,"%SyntaxError%":tt,"%ThrowTypeError%":rd,"%TypedArray%":id,"%TypeError%":et,"%Uint8Array%":typeof Uint8Array>"u"?F:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?F:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?F:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?F:Uint32Array,"%URIError%":qp,"%WeakMap%":typeof WeakMap>"u"?F:WeakMap,"%WeakRef%":typeof WeakRef>"u"?F:WeakRef,"%WeakSet%":typeof WeakSet>"u"?F:WeakSet,"%Function.prototype.call%":At,"%Function.prototype.apply%":Es,"%Object.defineProperty%":td,"%Object.getPrototypeOf%":nd,"%Math.abs%":Gp,"%Math.floor%":Kp,"%Math.max%":Jp,"%Math.min%":Xp,"%Math.pow%":Yp,"%Math.round%":Qp,"%Math.sign%":ed,"%Reflect.getPrototypeOf%":od};if(ee)try{null.error}catch(e){xs=ee(ee(e)),Me["%Error.prototype%"]=xs}var xs,ad=o(function e(t){var r;if(t==="%AsyncFunction%")r=mn("async function () {}");else if(t==="%GeneratorFunction%")r=mn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=mn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&ee&&(r=ee(i.prototype))}return Me[t]=r,r},"doEval"),Ps={__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"]},zt=Xe(),ur=dn(),sd=zt.call(At,Array.prototype.concat),ud=zt.call(Es,Array.prototype.splice),bs=zt.call(At,String.prototype.replace),cr=zt.call(At,String.prototype.slice),cd=zt.call(At,RegExp.prototype.exec),ld=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,pd=/\\(\\)?/g,dd=o(function(t){var r=cr(t,0,1),n=cr(t,-1);if(r==="%"&&n!=="%")throw new tt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new tt("invalid intrinsic syntax, expected opening `%`");var i=[];return bs(t,ld,function(u,c,l,f){i[i.length]=l?bs(f,pd,"$1"):c||u}),i},"stringToPath"),md=o(function(t,r){var n=t,i;if(ur(Ps,n)&&(i=Ps[n],n="%"+i[0]+"%"),ur(Me,n)){var u=Me[n];if(u===Qe&&(u=ad(n)),typeof u>"u"&&!r)throw new et("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new tt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Is.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new et("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new et('"allowMissing" argument must be a boolean');if(cd(/^%?[^%]*%?$/,t)===null)throw new tt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=dd(t),i=n.length>0?n[0]:"",u=md("%"+i+"%",r),c=u.name,l=u.value,f=!1,y=u.alias;y&&(i=y[0],ud(n,sd([0,1],y)));for(var x=1,T=!0;x<n.length;x+=1){var _=n[x],s=cr(_,0,1),d=cr(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new tt("property names with quotes must have matching quotes");if((_==="constructor"||!T)&&(f=!0),i+="."+_,c="%"+i+"%",ur(Me,c))l=Me[c];else if(l!=null){if(!(_ in l)){if(!r)throw new et("base intrinsic for "+t+" exists, but the property is not available.");return}if($t&&x+1>=n.length){var g=$t(l,_);T=!!g,T&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[_]}else T=ur(l,_),l=l[_];T&&!f&&(Me[c]=l)}}return l},"GetIntrinsic")});var As=A((Fz,$s)=>{"use strict";var fd=sn();$s.exports=o(function(){return fd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var ws=A((Zz,ks)=>{"use strict";var gd=Ss(),zs=gd("%Object.defineProperty%",!0),yd=As()(),hd=dn(),vd=or(),lr=yd?Symbol.toStringTag:null;ks.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 vd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");lr&&(n||!hd(t,lr))&&(zs?zs(t,lr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[lr]=r)},"setToStringTag")});var Rs=A((Hz,Os)=>{"use strict";var _d=Function.prototype.call,xd=Object.prototype.hasOwnProperty,Pd=Xe();Os.exports=Pd.call(_d,xd)});var Ds=A((Wz,Ns)=>{"use strict";Ns.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Ms=A((qz,Us)=>{"use strict";var vn=ji(),bd=require("util"),gn=require("path"),Td=require("http"),Ed=require("https"),Id=require("url").parse,Sd=require("fs"),$d=require("stream").Stream,Ad=require("crypto"),yn=Hi(),zd=ua(),kd=ws(),we=Rs(),hn=Ds();function Cs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Cs,"escapeHeaderParam");function Z(e){if(!(this instanceof Z))return new Z(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],vn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(Z,"FormData");bd.inherits(Z,vn);Z.LINE_BREAK=`\r
2
- `;Z.DEFAULT_CONTENT_TYPE="application/octet-stream";Z.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=vn.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)};Z.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)+Z.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof $d))&&(r.knownLength||this._valuesToMeasure.push(t))};Z.prototype._lengthRetriever=function(e,t){we(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Sd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):we(e,"httpVersion")?t(null,Number(e.headers["content-length"])):we(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};Z.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="'+Cs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&hn(c,r.header);var l;for(var f in c)if(we(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+Z.LINE_BREAK)}return"--"+this.getBoundary()+Z.LINE_BREAK+u+Z.LINE_BREAK};Z.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=gn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=gn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=gn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Cs(r)+'"'};Z.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=yn.lookup(e.name)),!r&&e&&e.path&&(r=yn.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=yn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=Z.DEFAULT_CONTENT_TYPE),r};Z.prototype._multiPartFooter=function(){return function(e){var t=Z.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};Z.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Z.LINE_BREAK};Z.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)we(e,t)&&(r[t.toLowerCase()]=e[t]);return r};Z.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};Z.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Z.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(Z.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Z.prototype._generateBoundary=function(){this._boundary="--------------------------"+Ad.randomBytes(12).toString("hex")};Z.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};Z.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};Z.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}zd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};Z.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Id(e),n=hn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=hn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Ed.request(n):r=Td.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,f=o(function(y,x){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,y,x)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};Z.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};Z.prototype.toString=function(){return"[object FormData]"};kd(Z.prototype,"FormData");Us.exports=Z});var Kd={};bn(Kd,{savvyCal:()=>Gd});module.exports=yu(Kd);var hu=Object.freeze({status:"aborted"});function I(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let y=c.prototype,x=Object.keys(y);for(let T=0;T<x.length;T++){let _=x[T];_ in l||(l[_]=y[_].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 f;let y=r?.Parent?new u:this;n(y,l),(f=y._zod).deferred??(f.deferred=[]);for(let x of y._zod.deferred)x();return y}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(I,"$constructor");var vu=Symbol("zod_brand"),ge=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ot=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},mr={};function _e(e){return e&&Object.assign(mr,e),mr}o(_e,"config");function gr(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(gr,"getEnumValues");function In(e,t){return typeof t=="bigint"?t.toString():t}o(In,"jsonStringifyReplacer");function Nt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Nt,"cached");function Sn(e){return e==null}o(Sn,"nullish");function Dt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Dt,"cleanRegex");var En=Symbol("evaluating");function Y(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==En)return n===void 0&&(n=En,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(Y,"defineLazy");var yr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function it(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(it,"isObject");var _u=Nt(()=>{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(it(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(it(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o($n,"isPlainObject");var An=new Set(["string","number","symbol"]);function Le(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Le,"escapeRegex");function Ct(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Ct,"clone");function G(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(G,"normalizeParams");function zn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(zn,"optionalKeys");var xu={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 Rt(e){return typeof e=="string"?e:e?.message}o(Rt,"unwrapMessage");function Se(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Rt(e.inst?._zod.def?.error?.(e))??Rt(t?.error?.(e))??Rt(r.customError?.(e))??Rt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Se,"finalizeIssue");function kn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(kn,"getLengthableOrigin");function hr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(hr,"issue");var wn=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,In,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),On=I("$ZodError",wn),at=I("$ZodError",wn,{Parent:Error});var bu=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 ge;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Se(f,u,_e())));throw yr(l,i?.callee),l}return c.value},"_parse"),Ut=bu(at),Tu=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(f=>Se(f,u,_e())));throw yr(l,i?.callee),l}return c.value},"_parseAsync"),Mt=Tu(at),Eu=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 ge;return u.issues.length?{success:!1,error:new(e??On)(u.issues.map(c=>Se(c,i,_e())))}:{success:!0,data:u.value}},"_safeParse"),st=Eu(at),Iu=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=>Se(c,i,_e())))}:{success:!0,data:u.value}},"_safeParseAsync"),ut=Iu(at);var Su="(?:(?:\\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(`^${Su}$`);var Rn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Nn=/^-?\d+n?$/;var vr=/^-?\d+(?:\.\d+)?$/,Dn=/^(?:true|false)$/i;var Fe=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Cn=I("$ZodCheckMinLength",(e,t)=>{var r;Fe.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Sn(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=kn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var _r=I("$ZodCheckStringFormat",(e,t)=>{var r,n;Fe.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=()=>{})}),Un=I("$ZodCheckRegex",(e,t)=>{_r.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 Ln={major:4,minor:3,patch:6};var K=I("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ln;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,f)=>{let y=je(c),x;for(let T of l){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(y)continue;let _=c.issues.length,s=T._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new ge;if(x||s instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(y||(y=je(c,_)))});else{if(c.issues.length===_)continue;y||(y=je(c,_))}}return x?x.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(je(c))return c.aborted=!0,c;let y=i(l,n,f);if(y instanceof Promise){if(f.async===!1)throw new ge;return y.then(x=>e._zod.parse(x,f))}return e._zod.parse(y,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let y=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return y instanceof Promise?y.then(x=>u(x,c,l)):u(y,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new ge;return f.then(y=>i(y,n,l))}return i(f,n,l)}}Y(e,"~standard",()=>({validate:o(i=>{try{let u=st(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return ut(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ft=I("$ZodString",(e,t)=>{K.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Rn(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}}),xr=I("$ZodStringFormat",(e,t)=>{_r.init(e,t),Ft.init(e,t)});var Vn=I("$ZodURL",(e,t)=>{xr.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 Hn=I("$ZodNumber",(e,t)=>{K.init(e,t),e._zod.pattern=e._zod.bag.pattern??vr,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 Pr=I("$ZodBoolean",(e,t)=>{K.init(e,t),e._zod.pattern=Dn,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}}),Wn=I("$ZodBigInt",(e,t)=>{K.init(e,t),e._zod.pattern=Nn,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 qn=I("$ZodAny",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),Gn=I("$ZodUnknown",(e,t)=>{K.init(e,t),e._zod.parse=r=>r});var Kn=I("$ZodVoid",(e,t)=>{K.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}}),Jn=I("$ZodDate",(e,t)=>{K.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 jn(e,t,r){e.issues.length&&t.issues.push(...Ie(r,e.issues)),t.value[r]=e.value}o(jn,"handleArrayResult");var Xn=I("$ZodArray",(e,t)=>{K.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],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(y=>jn(y,r,c))):jn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function jt(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(jt,"handlePropertyResult");function Au(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=zn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Au,"normalizeDef");function zu(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,y=f.def.type,x=f.optout==="optional";for(let T in t){if(l.has(T))continue;if(y==="never"){c.push(T);continue}let _=f.run({value:t[T],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>jt(s,r,T,t,x))):jt(_,r,T,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(zu,"handleCatchall");var Yn=I("$ZodObject",(e,t)=>{if(K.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Nt(()=>Au(t));Y(e._zod,"propValues",()=>{let l=t.shape,f={};for(let y in l){let x=l[y]._zod;if(x.values){f[y]??(f[y]=new Set);for(let T of x.values)f[y].add(T)}}return f});let i=it,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let y=l.value;if(!i(y))return l.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),l;l.value={};let x=[],T=c.shape;for(let _ of c.keys){let s=T[_],d=s._zod.optout==="optional",g=s._zod.run({value:y[_],issues:[]},f);g instanceof Promise?x.push(g.then(m=>jt(m,l,_,y,d))):jt(g,l,_,y,d)}return u?zu(x,y,l,f,n.value,e):x.length?Promise.all(x).then(()=>l):l}});function Fn(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=>Se(c,n,_e())))}),t)}o(Fn,"handleUnionResults");var br=I("$ZodUnion",(e,t)=>{K.init(e,t),Y(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Y(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Y(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Y(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=>Dt(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 f of t.options){let y=f._zod.run({value:i.value,issues:[]},u);if(y instanceof Promise)l.push(y),c=!0;else{if(y.issues.length===0)return y;l.push(y)}}return c?Promise.all(l).then(f=>Fn(f,i,e,u)):Fn(l,i,e,u)}});var Qn=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,br.init(e,t);let r=e._zod.parse;Y(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,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let y of f)i[l].add(y)}}return i});let n=Nt(()=>{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 f of l){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!it(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 eo=I("$ZodRecord",(e,t)=>{K.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 y of c)if(typeof y=="string"||typeof y=="number"||typeof y=="symbol"){l.add(typeof y=="number"?y.toString():y);let x=t.valueType._zod.run({value:i[y],issues:[]},n);x instanceof Promise?u.push(x.then(T=>{T.issues.length&&r.issues.push(...Ie(y,T.issues)),r.value[y]=T.value})):(x.issues.length&&r.issues.push(...Ie(y,x.issues)),r.value[y]=x.value)}let f;for(let y in i)l.has(y)||(f=f??[],f.push(y));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&vr.test(l)&&f.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&&(f=T)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(T=>Se(T,n,_e())),input:l,path:[l],inst:e});continue}let x=t.valueType._zod.run({value:i[l],issues:[]},n);x instanceof Promise?u.push(x.then(T=>{T.issues.length&&r.issues.push(...Ie(l,T.issues)),r.value[f.value]=T.value})):(x.issues.length&&r.issues.push(...Ie(l,x.issues)),r.value[f.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var to=I("$ZodEnum",(e,t)=>{K.init(e,t);let r=gr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>An.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}}),ro=I("$ZodLiteral",(e,t)=>{if(K.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 no=I("$ZodTransform",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ot(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 ge;return r.value=i,r}});function Bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Bn,"handleOptionalResult");var oo=I("$ZodOptional",(e,t)=>{K.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Dt(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=>Bn(u,r.value)):Bn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var io=I("$ZodNullable",(e,t)=>{K.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Dt(r.source)}|null)$`):void 0}),Y(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 ao=I("$ZodPipe",(e,t)=>{K.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(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=>Lt(c,t.in,n)):Lt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Lt(u,t.out,n)):Lt(i,t.out,n)}});function Lt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Lt,"handlePipeResult");var so=I("$ZodCustom",(e,t)=>{Fe.init(e,t),K.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=>Zn(u,r,n,e));Zn(i,r,n,e)}});function Zn(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(hr(i))}}o(Zn,"handleRefineResult");var co,Ru=Symbol("ZodOutput"),Nu=Symbol("ZodInput"),Tr=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 lo(){return new Tr}o(lo,"registry");(co=globalThis).__zod_globalRegistry??(co.__zod_globalRegistry=lo());var Er=globalThis.__zod_globalRegistry;function po(e,t){return new e({type:"string",...G(t)})}o(po,"_string");function mo(e,t){return new e({type:"string",coerce:!0,...G(t)})}o(mo,"_coercedString");function fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...G(t)})}o(fo,"_url");function go(e,t){return new e({type:"number",checks:[],...G(t)})}o(go,"_number");function yo(e,t){return new e({type:"number",coerce:!0,checks:[],...G(t)})}o(yo,"_coercedNumber");function ho(e,t){return new e({type:"boolean",...G(t)})}o(ho,"_boolean");function vo(e,t){return new e({type:"boolean",coerce:!0,...G(t)})}o(vo,"_coercedBoolean");function _o(e,t){return new e({type:"bigint",coerce:!0,...G(t)})}o(_o,"_coercedBigint");function xo(e){return new e({type:"any"})}o(xo,"_any");function Po(e){return new e({type:"unknown"})}o(Po,"_unknown");function bo(e,t){return new e({type:"void",...G(t)})}o(bo,"_void");function To(e,t){return new e({type:"date",coerce:!0,...G(t)})}o(To,"_coercedDate");function pe(e,t){return new Cn({check:"min_length",...G(t),minimum:e})}o(pe,"_minLength");function $e(e,t){return new Un({check:"string_format",format:"regex",...G(t),pattern:e})}o($e,"_regex");function Eo(e,t,r){let n=G(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Eo,"_custom");var Q=I("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");K.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Ut(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>st(e,r,n),e.parseAsync=async(r,n)=>Mt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ut(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)=>Ct(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Zt=I("ZodMiniString",(e,t)=>{Ft.init(e,t),Q.init(e,t)});function a(e){return po(Zt,e)}o(a,"string");var Io=I("ZodMiniStringFormat",(e,t)=>{xr.init(e,t),Zt.init(e,t)});var Vu=I("ZodMiniURL",(e,t)=>{Vn.init(e,t),Io.init(e,t)});function So(e){return fo(Vu,e)}o(So,"url");var Ir=I("ZodMiniNumber",(e,t)=>{Hn.init(e,t),Q.init(e,t)});function ne(e){return go(Ir,e)}o(ne,"number");var Sr=I("ZodMiniBoolean",(e,t)=>{Pr.init(e,t),Q.init(e,t)});function W(e){return ho(Sr,e)}o(W,"boolean");var $o=I("ZodMiniBigInt",(e,t)=>{Wn.init(e,t),Q.init(e,t)});var Hu=I("ZodMiniAny",(e,t)=>{qn.init(e,t),Q.init(e,t)});function lt(){return xo(Hu)}o(lt,"any");var Wu=I("ZodMiniUnknown",(e,t)=>{Gn.init(e,t),Q.init(e,t)});function R(){return Po(Wu)}o(R,"unknown");var qu=I("ZodMiniVoid",(e,t)=>{Kn.init(e,t),Q.init(e,t)});function Ao(e){return bo(qu,e)}o(Ao,"_void");var zo=I("ZodMiniDate",(e,t)=>{Jn.init(e,t),Q.init(e,t)});var Gu=I("ZodMiniArray",(e,t)=>{Xn.init(e,t),Q.init(e,t)});function C(e,t){return new Gu({type:"array",element:e,...G(t)})}o(C,"array");var Ku=I("ZodMiniObject",(e,t)=>{Yn.init(e,t),Q.init(e,t),Y(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...G(t)};return new Ku(r)}o(p,"object");var Ju=I("ZodMiniUnion",(e,t)=>{br.init(e,t),Q.init(e,t)});function U(e,t){return new Ju({type:"union",options:e,...G(t)})}o(U,"union");var Xu=I("ZodMiniDiscriminatedUnion",(e,t)=>{Qn.init(e,t),Q.init(e,t)});function Be(e,t,r){return new Xu({type:"union",options:t,discriminator:e,...G(r)})}o(Be,"discriminatedUnion");var Yu=I("ZodMiniRecord",(e,t)=>{eo.init(e,t),Q.init(e,t)});function N(e,t,r){return new Yu({type:"record",keyType:e,valueType:t,...G(r)})}o(N,"record");var Qu=I("ZodMiniEnum",(e,t)=>{to.init(e,t),Q.init(e,t),e.options=Object.values(t.entries)});function L(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Qu({type:"enum",entries:r,...G(t)})}o(L,"_enum");var ec=I("ZodMiniLiteral",(e,t)=>{ro.init(e,t),Q.init(e,t)});function z(e,t){return new ec({type:"literal",values:Array.isArray(e)?e:[e],...G(t)})}o(z,"literal");var tc=I("ZodMiniTransform",(e,t)=>{no.init(e,t),Q.init(e,t)});function Ae(e){return new tc({type:"transform",transform:e})}o(Ae,"transform");var rc=I("ZodMiniOptional",(e,t)=>{oo.init(e,t),Q.init(e,t)});function h(e){return new rc({type:"optional",innerType:e})}o(h,"optional");var nc=I("ZodMiniNullable",(e,t)=>{io.init(e,t),Q.init(e,t)});function pt(e){return new nc({type:"nullable",innerType:e})}o(pt,"nullable");var oc=I("ZodMiniPipe",(e,t)=>{ao.init(e,t),Q.init(e,t)});function ze(e,t){return new oc({type:"pipe",in:e,out:t})}o(ze,"pipe");var ic=I("ZodMiniCustom",(e,t)=>{so.init(e,t),Q.init(e,t)});function Vt(e,t){return Eo(ic,e??(()=>!0),t)}o(Vt,"custom");var dt={};bn(dt,{bigint:()=>dc,boolean:()=>pc,date:()=>mc,number:()=>lc,string:()=>cc});function cc(e){return mo(Zt,e)}o(cc,"string");function lc(e){return yo(Ir,e)}o(lc,"number");function pc(e){return vo(Sr,e)}o(pc,"boolean");function dc(e){return _o($o,e)}o(dc,"bigint");function mc(e){return To(zo,e)}o(mc,"date");var Ar=p({retryOnFailure:p({defaultValue:h(W()),hide:h(W())}),continueOnFailure:p({defaultValue:h(W()),hide:h(W())})}),$r=class{constructor(t,r,n,i,u,c,l,f,y,x,T){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=y;this.audience=x;this.aiMetadata=T}static{o(this,"IAction")}},H=o(e=>new $r(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 V=p({displayName:a(),description:h(a())}),M=o((e,t)=>p({type:z(t),required:W(),defaultValue:h(lt())}),"TPropertyValue");var ae=p({...V.shape,...M(a(),"SHORT_TEXT").shape}),xe=p({...V.shape,...M(a(),"LONG_TEXT").shape});var wo=p({label:a(),value:R()}),Ht=p({disabled:h(W()),placeholder:h(a()),options:C(wo)});var se=p({...V.shape,options:Ht,...M(R(),"STATIC_DROPDOWN").shape}),Pe=p({...V.shape,options:Ht,...M(C(R()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var zr=p({...V.shape,...M(R(),"DROPDOWN").shape,refreshers:C(a())}),mt=p({...V.shape,...M(C(R()),"MULTI_SELECT_DROPDOWN").shape,refreshers:C(a())});var be=p({...V.shape,...M(W(),"CHECKBOX").shape});var Te=p({...V.shape,...M(ne(),"NUMBER").shape});var ft=p({...V.shape,...M(R(),"FILE").shape});var gt=p({...V.shape,...M(a(),"DATE_TIME").shape});var Oo=N(a(),U([ae,xe,se,mt,Pe,be,Te,ft,gt])),yt=p({...V.shape,properties:Oo,...M(C(R()),"ARRAY").shape});var ht=p({...V.shape,...M(U([N(a(),R())]),"JSON").shape});var Ro=U([ae,se,ht,yt,Pe]),gc=N(a(),Ro),kr=p({refreshers:C(a()),...V.shape,...M(R(),"DYNAMIC").shape});var Wt=p({...V.shape,...M(Ao(),"MARKDOWN").shape});var vt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(vt||{}),Ze=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ze||{}),Ve=(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))(Ve||{});var _t=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(_t||{}),wr="both_client_credentials_and_authorization_code";var ye=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ye||{}),xt=(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))(xt||{}),yc=p({strategy:L(xt),paramName:h(a())}),Pt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Pt||{});var qt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(qt||{}),No=p({status:h(ne()),body:h(R()),headers:h(N(a(),a()))}),Do=p({type:z("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(L(qt))}),Co=p({type:z("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:No,handlerId:h(a()),streamStepProgress:h(L(qt))}),hc=U([Do,Co]);var vc=p({body:R(),rawBody:h(R()),headers:N(a(),a()),queryParams:N(a(),a())});function de(e){return e==null}o(de,"isNil");function bt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(bt,"isEmpty");function Gt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Gt,"assertNotNullOrUndefined");var Or=Ne(require("crypto"),1);var _c=128,De,He,xc=o(e=>{!De||De.length<e?(De=Buffer.allocUnsafe(e*_c),Or.default.randomFillSync(De),He=0):He+e>De.length&&(Or.default.randomFillSync(De),He=0),He+=e},"fillPool"),Pc=o(e=>(xc(e|=0),De.subarray(He-e,He)),"random"),bc=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 l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===u)return c}}},"customRandom"),Mo=o((e,t=21)=>bc(e,t,Pc),"customAlphabet");var Tc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Lo=21,Ob=a().check($e(new RegExp(`^[0-9a-zA-Z]{${Lo}}$`))),Ec=Mo(Tc,Lo);var ke=ze(Ae(e=>e instanceof Date?e.toISOString():e),a()),ce={id:a(),created:ke,updated:ke},q=o(e=>h(pt(e)),"Nullable");function Rr(e){return h(pt(L(e)))}o(Rr,"NullableEnum");var Db=ze(Ae(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(W())),Kt=o(e=>ze(Ae(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(C(e))),"OptionalArrayFromQuery");var Mb=N(a(),R());var Tt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(Tt||{});var Jb=a().check($e(/^#[0-9A-Fa-f]{6}$/));var Yb=p({filename:a(),data:R(),type:z("file"),mimetype:h(a())});var Ic=Ne(Fo());var iT=p({...ce,name:a(),permissions:C(a()),platformId:q(a()),type:a(),userCount:h(ne())});var Bo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Bo||{}),Nr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Nr||{}),Dr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Dr||{});var Cr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Cr||{});var Ur=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ur||{});var Sc=p({mode:L(Bo),value:R()}),$c=p({auth:h(a()),fields:N(a(),Sc)}),Ac=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h($c)}),zc=p({type:z("PIECE"),toolName:a().check(pe(1)),pieceMetadata:Ac}),kc=p({type:z("none")}),wc=p({type:z("access_token"),accessToken:a()}),Oc=p({type:z("api_key"),apiKey:a(),apiKeyHeader:a()}),Rc=p({type:z("headers"),headers:N(a(),a())}),Nc=Be("type",[kc,wc,Oc,Rc]),Zo=p({type:z("FLOW"),toolName:a().check(pe(1)),externalFlowId:a(),flowDisplayName:h(a())}),Vo=p({type:z("MCP"),toolName:a().check(pe(1)),serverUrl:So(),protocol:L(Dr),auth:Nc}),Ho=p({type:z("KNOWLEDGE_BASE"),toolName:a().check(pe(1)),sourceType:L(Nr),sourceId:a(),sourceName:a()}),Dc=Be("type",[zc,Zo,Vo,Ho]),Cc=p({displayName:a(),description:h(a()),type:L(Cr)}),Wo=p({type:z("MARKDOWN"),markdown:a()}),We={type:z("TOOL_CALL"),input:q(N(a(),R())),output:h(R()),toolName:a(),status:L(Ur),toolCallId:a(),startTime:a(),endTime:h(a())},OT=p(We),qo=Be("toolCallType",[p({...We,toolCallType:z("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...We,toolCallType:z("FLOW"),displayName:a(),externalFlowId:a()}),p({...We,toolCallType:z("MCP"),displayName:a(),serverUrl:a()}),p({...We,toolCallType:z("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...We,toolCallType:z("UNKNOWN"),displayName:a()})]),Uc=U([Wo,qo]);var Mr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Mr||{}),Ee=p({apiKey:a()}),Mc=Ee,Lc=p({apiKey:a(),apiKeyHash:a()}),jc=Ee,Fc=Ee,Bc=Ee,Zc=Ee,Vc=Ee,Hc=Ee,Wc=Ee,Go=p({accessKeyId:a().check(pe(1)),secretAccessKey:a().check(pe(1))}),qc=p({}),Gc=p({}),Kc=p({}),Jc=p({}),Xc=p({}),Yc=p({}),Ko=p({modelId:a(),modelName:a(),modelType:L(Mr)}),Jo=p({apiKeyHeader:a(),baseUrl:a(),models:C(Ko),defaultHeaders:h(N(a(),a()))}),Xo=p({accountId:a(),gatewayId:a(),models:C(Ko),vertexProject:h(a()),vertexRegion:h(a())}),Yo=p({resourceName:a(),apiVersion:ze(Ae(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),Qo=p({region:a().check(pe(1))}),Qc=U([Mc,Bc,Zc,Vc,Hc,Fc,jc,Lc,Go,Wc]),ei=U([Jo,Xo,Yo,Qo,qc,Kc,Jc,Xc,Gc,Yc]),el=p({id:a(),name:a(),type:L(Mr)}),tl=p({id:a(),name:a(),provider:L(Tt),config:ei,enabledForChat:W()}),rl=p({provider:L(Tt),config:ei,auth:Qc,platformId:a()});var CT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var nl=p({base64Url:a(),fileName:a(),extension:h(a())}),ol=p({mimeType:a(),url:a(),fileName:h(a())}),Lr=U([nl,ol]);var il=U([p({type:z("file"),value:Lr}),p({type:z("markdown"),value:a(),files:h(C(Lr))})]),al=p({sessionId:a(),message:a(),files:h(C(a()))});var ri=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ri||{}),ni=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ni||{}),jr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(jr||{});var sl=U([p({...ce,name:a(),externalId:a(),type:z("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:C(p({value:a()}))})}),p({...ce,name:a(),externalId:a(),type:U([z("TEXT"),z("NUMBER"),z("DATE")]),tableId:a(),projectId:a()})]),ul=p({...ce,name:a(),folderId:q(a()),projectId:a(),externalId:a(),status:Rr(ni),trigger:Rr(ri)}),cl=p({...ce,tableId:a(),projectId:a(),cells:N(a(),p({updated:a(),created:a(),value:R(),fieldName:a()}))}),ll=p({events:C(L(jr)),webhookUrl:a(),flowId:a()}),pl=p({fields:C(p({id:a(),name:a()})),rows:C(N(a(),a())),name:a()}),dl=p({projectId:a(),limit:h(dt.number()),cursor:h(a()),name:h(a()),externalIds:Kt(a()),folderId:h(a()),folderIds:Kt(a())}),ml=p({records:C(C(p({fieldId:a(),value:ii()}))),tableId:a()}),fl=p({cells:h(C(p({fieldId:a(),value:ii()}))),tableId:a(),agentUpdate:h(W())}),oi=Be("operator",[Ce("eq"),Ce("neq"),Ce("gt"),Ce("gte"),Ce("lt"),Ce("lte"),Ce("co"),ti("exists"),ti("not_exists")]),gl=p({tableId:a(),limit:h(dt.number()),cursor:h(a()),filters:Kt(oi)});function ii(){return ze(Ae(e=>e==null?e:String(e)),pt(a()))}o(ii,"coerceToString");function Ce(e){return p({fieldId:a(),operator:z(e),value:a()})}o(Ce,"valueFilter");function ti(e){return p({fieldId:a(),operator:z(e)})}o(ti,"existenceFilter");var yl=p({status:h(ne()),body:h(R()),headers:h(N(a(),a()))}),hl=p({...ce,deleted:q(ke),ownerId:a(),displayName:a(),platformId:a(),externalId:q(a())});var ai=p({name:a(),description:h(a()),type:a(),required:W()}),vl=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:C(ai),returnsResponse:W()})});var si="^[0-9]+\\.[0-9]+\\.[0-9]+$",tE=new RegExp(si),xl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",rE=a().check($e(new RegExp(si))),nE=a().check($e(new RegExp(xl))),Pl=p({packageType:z("ARCHIVE"),pieceType:L(Ze),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ui=p({packageType:z("REGISTRY"),pieceType:z("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ci=p({packageType:z("REGISTRY"),pieceType:z("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),oE=U([ui,ci]),iE=U([Pl,ui,ci]),li=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(li||{}),bl=p({type:L(li),cronExpression:a(),timezone:a()}),aE=p({...ce,type:L(ye),projectId:a(),flowId:a(),triggerName:a(),schedule:q(bl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:q(a()),simulate:W()}),pi=(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))(pi||{}),di=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(di||{}),mi=(r=>(r.S3="S3",r.DB="DB",r))(mi||{}),sE=p({...ce,projectId:q(a()),platformId:q(a()),type:L(pi),compression:L(di),data:h(R()),location:L(mi),size:q(ne()),fileName:q(a()),s3Key:q(a()),metadata:q(N(a(),a()))}),fi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(fi||{}),gi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(gi||{}),uE=p({id:a(),email:a(),firstName:a(),status:L(gi),externalId:q(a()),platformId:q(a()),platformRole:L(fi),lastName:a(),created:ke,updated:ke,lastActiveDate:q(ke),imageUrl:q(a())});var Br=p({...V.shape,...M(N(a(),R()),"OBJECT").shape});var vi=p({...V.shape,...M(a(),"COLOR").shape});var Zr=U([ae,xe,Wt,be,se,Pe,zr,mt,kr,Te,yt,Br,ht,gt,ft,vi]),b={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 he=p({displayName:a(),description:h(a())});var _i=p({username:a(),password:a()}),Vr=p({...he.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...M(_i,"BASIC_AUTH").shape});var Sl=N(a(),U([ae,xe,Te,be,se])),Hr=p({...he.shape,props:Sl,...M(R(),"CUSTOM_AUTH").shape});var Ue=p({...he.shape,...M(p({auth:a()}),"SECRET_TEXT").shape});var $l=N(a(),U([ae,xe,Ue,Te,be,se,Pe,Wt])),xi=p({...he.shape,props:$l,...M(R(),"OIDC").shape});var Wr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Wr||{}),Pi=U([ae,Ue,se]),bi=N(a(),Pi),Al=p({props:h(N(a(),Pi)),authUrl:a(),tokenUrl:a(),scope:C(a()),prompt:h(U([z("none"),z("consent"),z("login"),z("omit")])),pkce:h(W()),pkceMethod:h(U([z("plain"),z("S256")])),authorizationMethod:h(L(Wr)),grantType:h(U([L(_t),z(wr)])),extra:h(N(a(),a()))}),Ti=p({access_token:a(),props:h(bi),data:N(a(),lt())}),qr=p({...he.shape,...Al.shape,...M(Ti,"OAUTH2").shape});var qe=U([Vr,Hr,xi,qr,Ue]),Et="Connection",It={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Et}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Et,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Et}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Et}},None(){}};var jI={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 zl=p({...V.shape,...M(R(),"CUSTOM").shape,code:a()});var kl=U([Zr,qe]),Gr=N(a(),kl),aS=N(a(),Zr);var Ei=U([p({strategy:z("CRON"),cronExpression:a()}),p({strategy:z("NONE")})]),Ge=class{constructor(t,r,n,i,u,c,l,f,y,x,T,_,s,d,g,m,v,P,j){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=l;this.onHandshake=f;this.renewConfiguration=y;this.onRenew=x;this.onEnable=T;this.onDisable=_;this.onStart=s;this.run=d;this.test=g;this.sampleData=m;this.testStrategy=v;this.outputSchema=P;this.aiMetadata=j}static{o(this,"ITrigger")}},Ke=o(e=>{switch(e.type){case"WEBHOOK":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,de(e.sampleData)&&de(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Ii="2",Xt="0.82.0";var Kr=class{constructor(t,r,n,i,u,c,l,f,y=Xt,x,T=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=y;this.maximumSupportedRelease=x;this.description=T;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ii}),"getContextInfo");(!wl(y)||Ol(y,Xt))&&(this.minimumSupportedRelease=Xt),u.forEach(_=>this._actions[_.name]=_),c.forEach(_=>this._triggers[_.name]=_)}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}},Si=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 Kr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function wl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(wl,"isValidSimpleSemver");function Ol(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(Ol,"isSemverLessThan");var Rl=h(N(a(),N(a(),a()))),$i=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:C(a()),platformId:h(a()),directoryPath:h(a()),auth:h(U([qe,C(qe)])),version:a(),categories:h(C(L(Ve))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),i18n:Rl}),Nl=L(["human","ai","both"]),Ai=p({description:h(a()),idempotent:h(W())}),zi=p({name:a(),displayName:a(),description:a(),props:Gr,requireAuth:W(),errorHandlingOptions:h(Ar),outputSchema:h(Vt()),audience:h(Nl),aiMetadata:h(Ai)}),ki=p({name:a(),displayName:a(),description:a(),props:Gr,errorHandlingOptions:h(Ar),type:L(ye),sampleData:R(),handshakeConfiguration:h(Vt()),renewConfiguration:h(Ei),testStrategy:L(Pt),outputSchema:h(Vt()),aiMetadata:h(Ai)}),Dl=p({...$i.shape,actions:N(a(),zi),triggers:N(a(),ki)}),Cl=p({...$i.shape,actions:ne(),triggers:ne(),suggestedActions:h(C(ki)),suggestedTriggers:h(C(zi))}),wi=p({projectUsage:ne(),tags:h(C(a())),pieceType:L(Ze),packageType:L(vt),platformId:h(a()),archiveId:h(a())}),a$=p({...Dl.shape,...wi.shape}),s$=p({...Cl.shape,...wi.shape}),u$=p({name:a(),version:a()});var Ul=Ne(require("path")),Ml=Ne(require("fs/promises"));var Yt=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 Qt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Jr,r=new Xr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Jr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Xr=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 er=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 tr=class extends Yt{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[j,ie]of Object.entries(c))i.append(j,ie);let l=i.toString(),f=l?`${n}?${l}`:n,y=t.responseType??"json",x=t.followRedirects??!0,T=t.retries??0,{body:_,extraHeaders:s,isStream:d}=Ll(t.body,u),g=Fl({...u,...s}),m=await jl(async()=>{let j=new AbortController,ie=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let le={method:t.method.toString(),headers:g,body:_,redirect:x?"follow":"manual",signal:j.signal};return d&&(le.duplex="half"),r?.dispatcher!==void 0&&(le.dispatcher=r.dispatcher),await fetch(f,le)}finally{ie!==void 0&&clearTimeout(ie)}},T),v=x?300:400;if(m.status<200||m.status>=v){let j=await Oi(m,y),ie=new er(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ie),ie}let P=await Oi(m,y);return{status:m.status,headers:Bl(m.headers),body:P}}};function Ll(e,t){return Vl(e)?{body:void 0,extraHeaders:{},isStream:!1}:Zl(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(Ll,"serializeBody");async function Oi(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(Oi,"parseResponseBody");async function jl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ri(n);continue}return i}catch(i){if(r=i,n<t){await Ri(n);continue}throw i}throw r}o(jl,"sendWithRetries");function Ri(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ri,"backoff");function Fl(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(Fl,"normalizeHeaders");function Bl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Bl,"toHttpHeaders");function Zl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(Zl,"isNodeFormData");function Vl(e){return e==null}o(Vl,"isNil");var Je=new tr;var St=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(St||{});var wd=Ne(require("fs")),Ls=Ne(Ms());var Od={"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 Rd(e){let t=e.split(";")[0].trim().toLowerCase();return Od[t]??""}o(Rd,"contentTypeToExtension");var Nd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Dd=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 js({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return H({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:b.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:y})=>({url:b.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
- i.e ${Dd(t,y)}/resource or /resource`,required:!0,defaultValue:y?t(y):"",...c?.url??{}})}),"props")}),method:b.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(St).map(y=>({label:y,value:y}))},...c?.method??{}}),headers:b.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:b.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:b.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:b.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:y})=>{if(!y)return{};let x=y,T={};switch(x){case"none":break;case"json":T.data=b.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":T.data=b.LongText({displayName:"Raw Body",required:!0});break;case"form_data":T.data=b.Array({displayName:"Form Data",required:!0,properties:{fieldName:b.ShortText({displayName:"Field Name",required:!0}),fieldType:b.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:b.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:b.File({displayName:"File Field Value",required:!1})}});break}return T},"props")}),response_is_binary:b.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:b.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:b.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:b.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async y=>{let{method:x,url:T,headers:_,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:P,followRedirects:j}=y.propsValue;Gt(x,"Method"),Gt(T,"URL");let ie=de(r)?{}:await r(y.auth,y.propsValue),le=T.url,nt=le.startsWith("http://")||le.startsWith("https://")?le:Nd({baseUrl:t(y.auth),relativePath:le}),Re={method:x,url:nt,headers:{..._??{},...f==="headers"||!de(f)?ie:{}},queryParams:{...f==="queryParams"?ie:{},...s??{}},timeout:v?v*1e3:0,followRedirects:j};if(P&&(Re.responseType="arraybuffer"),d)if(g&&g!=="none"){let ve=d.data;if(g==="form_data"){let lu=ve,wt=new Ls.default;for(let{fieldName:_n,fieldType:xn,textFieldValue:Pn,fileFieldValue:dr}of lu)xn==="text"&&!bt(Pn)?wt.append(_n,Pn):xn==="file"&&!bt(dr)&&wt.append(_n,dr.data,{filename:dr?.filename});Re.body=wt,Re.headers={...Re.headers,...wt.getHeaders()}}else Re.body=ve}else g||(Re.body=d);try{let ve=await Je.sendRequest(Re);return await Cd(y.files,ve.body,ve.status,ve.headers,P)}catch(ve){if(m)return ve.errorMessage();throw ve}},"run")})}o(js,"createCustomApiCallAction");var Cd=o(async(e,t,r,n,i)=>{let u;if(i&&Ud(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Rd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Ud=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var pr=Ne(require("crypto"));var kt="https://api.savvycal.com/v1";function rt(e,t,r){let n=typeof r=="string"?r:Buffer.isBuffer(r)?r.toString("utf8"):JSON.stringify(r),i="sha256="+pr.createHmac("sha256",e).update(n).digest("hex");try{return pr.timingSafeEqual(Buffer.from(i),Buffer.from(t.toLowerCase()))}catch{return!1}}o(rt,"verifyWebhookSignature");async function B({token:e,method:t,path:r,body:n,queryParams:i}){return Je.sendRequest({method:t,url:`${kt}${r}`,authentication:{type:"BEARER_TOKEN",token:e},queryParams:i,body:n})}o(B,"savvyCalApiCall");async function fe({token:e,path:t,queryParams:r}){let n=[],i=null;do{let u={limit:"100",...r};i&&(u.after=i);let c=await B({token:e,method:"GET",path:t,queryParams:u});n.push(...c.body.entries),i=c.body.metadata.after}while(i);return n}o(fe,"savvyCalPaginatedCall");async function te(e){let t=await fe({token:e,path:"/links"}),r=new Set,n=[{label:"Personal",value:"personal"}];for(let i of t)i.scope&&!r.has(i.scope.id)&&(r.add(i.scope.id),n.push({label:i.scope.name,value:i.scope.id}));return n}o(te,"buildTeamOptions");async function Fs(e){return(await fe({token:e,path:"/workflows"})).map(r=>({label:r.name,value:r.id}))}o(Fs,"buildWorkflowOptions");async function re(e,t){let r=await fe({token:e,path:"/links"});return(t?t==="personal"?r.filter(i=>i.scope===null):r.filter(i=>i.scope?.id===t):r).map(i=>({label:`${i.name} (${i.slug})`,value:i.id}))}o(re,"buildLinkOptions");function Oe(e){return{id:e.id,name:e.name,slug:e.slug,url:e.url??null,active:e.active??null,duration_minutes:e.duration??null,team_id:e.scope?.id??null,team_name:e.scope?.name??null,created_at:e.created_at,updated_at:e.updated_at}}o(Oe,"flattenLink");function ue(e){let t=e.attendees?.find(n=>!n.is_organizer)??null,r=e.attendees?.find(n=>n.is_organizer)??null;return{id:e.id,uuid:e.uuid??null,summary:e.summary??null,description:e.description??null,state:e.state,start_at:e.start_at,end_at:e.end_at,duration_minutes:e.duration??null,url:e.url??null,location:e.location??null,is_group_session:e.is_group_session??null,created_at:e.created_at,canceled_at:e.canceled_at??null,cancel_reason:e.cancel_reason??null,rescheduled_at:e.rescheduled_at??null,reschedule_reason:e.reschedule_reason??null,original_start_at:e.original_start_at??null,original_end_at:e.original_end_at??null,scheduling_link_id:e.link?.id??null,scheduling_link_name:e.link?.name??null,scheduling_link_slug:e.link?.slug??null,attendee_display_name:t?.display_name??null,attendee_first_name:t?.first_name??null,attendee_last_name:t?.last_name??null,attendee_email:t?.email??null,attendee_phone:t?.phone_number??null,attendee_time_zone:t?.time_zone??null,organizer_display_name:r?.display_name??null,organizer_first_name:r?.first_name??null,organizer_last_name:r?.last_name??null,organizer_email:r?.email??null,conferencing_type:e.conferencing?.type??null,conferencing_join_url:e.conferencing?.join_url??null,conferencing_meeting_id:e.conferencing?.meeting_id??null,payment_state:e.payment?.state??null,payment_amount_total_cents:e.payment?.amount_total??null}}o(ue,"flattenEvent");var $=[It.OAuth2({description:"Connect your SavvyCal account using OAuth2.",authUrl:"https://savvycal.com/oauth/authorize",tokenUrl:"https://savvycal.com/oauth/token",required:!0,scope:[]}),It.CustomAuth({displayName:"Personal Access Token",description:`To get your SavvyCal API token:
1
+ "use strict";var Iu=Object.create;var it=Object.defineProperty;var Su=Object.getOwnPropertyDescriptor;var Au=Object.getOwnPropertyNames;var $u=Object.getPrototypeOf,zu=Object.prototype.hasOwnProperty;var o=(e,t)=>it(e,"name",{value:t,configurable:!0});var $=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},In=(e,t)=>{for(var r in t)it(e,r,{get:t[r],enumerable:!0})},Sn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Au(t))!zu.call(e,i)&&i!==r&&it(e,i,{get:()=>t[i],enumerable:!(n=Su(t,i))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?Iu($u(e)):{},Sn(t||!e||!e.__esModule?it(r,"default",{value:e,enumerable:!0}):r,e)),ku=e=>Sn(it({},"__esModule",{value:!0}),e);var Jo=$((Ko,er)=>{(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 f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],P,j;for(v&&(v=v.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(j=d-g,P=":";j--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let ie=s.split(":"),pe=[];for(let ot=0;ot<ie.length;ot++)pe.push(parseInt(ie[ot],16));return pe})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function y(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=g-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=g,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 T(s,d){for(;s.length<d;)s=`0${s}`;return s}o(T,"padPart");let x={};x.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 y(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},v,P,j;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(j=m[P],g&&j!==0)return null;j!==8&&(g=!0),d+=j}else return null;return 32-d},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 d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(g[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 d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.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)},x.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")},x.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),P=[];for(let j=0;j<v.length;j++)g=v[j],P.push(_(g));return P})();if(d=s.match(r.longValue)){if(m=_(d[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(d=s.match(r.twoOctet))?(function(){let v=d.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})():(d=s.match(r.threeOctet))?(function(){let v=d.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 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)},x.IPv6=(function(){function s(d,g){let m,v;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(v=this.parts[m],!(0<=v&&v<=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 y(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},v,P;for(let j=7;j>=0;j-=1)if(v=this.parts[j],v in m){if(P=m[v],g&&P!==0)return null;P!==16&&(g=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(T(this.parts[v].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 x.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].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,v=-1,P;for(;P=d.exec(g);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},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 d=this.parser(s);return new this(d.parts,d.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 d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},x.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)},x.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")},x.IPv6.parser=function(s){let d,g,m,v,P,j;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return f(s,8);if((m=s.match(l.transitional))&&(j=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+j,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<P.length;g++)if(v=P[g],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.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 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)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===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 d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,g){let m,v,P,j;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(j=P[m],s.kind()===j[0].kind()&&s.match.apply(s,j))return v}return g},typeof er<"u"&&er.exports?er.exports=x:e.ipaddr=x})(Ko)});var Ji=$((X$,Ki)=>{var qi=require("stream").Stream,dp=require("util");Ki.exports=me;function me(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(me,"DelayedStream");dp.inherits(me,qi);me.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(me.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});me.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};me.prototype.resume=function(){this._released||this.release(),this.source.resume()};me.prototype.pause=function(){this.source.pause()};me.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};me.prototype.pipe=function(){var e=qi.prototype.pipe.apply(this,arguments);return this.resume(),e};me.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)};me.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 ea=$((Q$,Qi)=>{var mp=require("util"),Yi=require("stream").Stream,Xi=Ji();Qi.exports=X;function X(){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(X,"CombinedStream");mp.inherits(X,Yi);X.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};X.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};X.prototype.append=function(e){var t=X.isStreamLike(e);if(t){if(!(e instanceof Xi)){var r=Xi.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};X.prototype.pipe=function(e,t){return Yi.prototype.pipe.call(this,e,t),this.resume(),e};X.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}};X.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=X.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};X.prototype._pipeNext=function(e){this._currentStream=e;var t=X.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()};X.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};X.prototype.write=function(e){this.emit("data",e)};X.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};X.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")};X.prototype.end=function(){this._reset(),this.emit("end")};X.prototype.destroy=function(){this._reset(),this.emit("close")};X.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};X.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};X.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)};X.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ra=$((tz,ta)=>{"use strict";ta.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 ia=$(oe=>{"use strict";var ir=ra(),fp=require("path").extname,na=/^\s*([^;\s]*)(?:;|\s|$)/,gp=/^text\//i;oe.charset=oa;oe.charsets={lookup:oa};oe.contentType=yp;oe.extension=hp;oe.extensions=Object.create(null);oe.lookup=vp;oe.types=Object.create(null);_p(oe.extensions,oe.types);function oa(e){if(!e||typeof e!="string")return!1;var t=na.exec(e),r=t&&ir[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&gp.test(t[1])?"UTF-8":!1}o(oa,"charset");function yp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?oe.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=oe.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(yp,"contentType");function hp(e){if(!e||typeof e!="string")return!1;var t=na.exec(e),r=t&&oe.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(hp,"extension");function vp(e){if(!e||typeof e!="string")return!1;var t=fp("x."+e).toLowerCase().substr(1);return t&&oe.types[t]||!1}o(vp,"lookup");function _p(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(ir).forEach(o(function(i){var u=ir[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var y=r.indexOf(ir[t[f]].source),_=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(y>_||y===_&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(_p,"populateMaps")});var sa=$((oz,aa)=>{aa.exports=xp;function xp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(xp,"defer")});var tn=$((az,ca)=>{var ua=sa();ca.exports=Pp;function Pp(e){var t=!1;return ua(function(){t=!0}),o(function(n,i){t?e(n,i):ua(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Pp,"async")});var rn=$((uz,la)=>{la.exports=bp;function bp(e){Object.keys(e.jobs).forEach(Tp.bind(e)),e.jobs={}}o(bp,"abort");function Tp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Tp,"clean")});var nn=$((lz,da)=>{var pa=tn(),Ep=rn();da.exports=Ip;function Ip(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Sp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Ep(r):r.results[i]=c,n(u,r.results))})}o(Ip,"iterate");function Sp(e,t,r,n){var i;return e.length==2?i=e(r,pa(n)):i=e(r,t,pa(n)),i}o(Sp,"runJob")});var on=$((dz,ma)=>{ma.exports=Ap;function Ap(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(Ap,"state")});var an=$((fz,fa)=>{var $p=rn(),zp=tn();fa.exports=kp;function kp(e){Object.keys(this.jobs).length&&(this.index=this.size,$p(this),zp(e)(null,this.results))}o(kp,"terminator")});var ya=$((yz,ga)=>{var wp=nn(),Op=on(),Rp=an();ga.exports=Np;function Np(e,t,r){for(var n=Op(e);n.index<(n.keyedList||e).length;)wp(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 Rp.bind(n,r)}o(Np,"parallel")});var sn=$((vz,ar)=>{var ha=nn(),Cp=on(),Dp=an();ar.exports=Up;ar.exports.ascending=va;ar.exports.descending=Mp;function Up(e,t,r,n){var i=Cp(e,r);return ha(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){ha(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Dp.bind(i,n)}o(Up,"serialOrdered");function va(e,t){return e<t?-1:e>t?1:0}o(va,"ascending");function Mp(e,t){return-1*va(e,t)}o(Mp,"descending")});var xa=$((xz,_a)=>{var Lp=sn();_a.exports=jp;function jp(e,t,r){return Lp(e,t,null,r)}o(jp,"serial")});var ba=$((bz,Pa)=>{Pa.exports={parallel:ya(),serial:xa(),serialOrdered:sn()}});var un=$((Tz,Ta)=>{"use strict";Ta.exports=Object});var Ia=$((Ez,Ea)=>{"use strict";Ea.exports=Error});var Aa=$((Iz,Sa)=>{"use strict";Sa.exports=EvalError});var za=$((Sz,$a)=>{"use strict";$a.exports=RangeError});var wa=$((Az,ka)=>{"use strict";ka.exports=ReferenceError});var Ra=$(($z,Oa)=>{"use strict";Oa.exports=SyntaxError});var sr=$((zz,Na)=>{"use strict";Na.exports=TypeError});var Da=$((kz,Ca)=>{"use strict";Ca.exports=URIError});var Ma=$((wz,Ua)=>{"use strict";Ua.exports=Math.abs});var ja=$((Oz,La)=>{"use strict";La.exports=Math.floor});var Ba=$((Rz,Fa)=>{"use strict";Fa.exports=Math.max});var Za=$((Nz,Va)=>{"use strict";Va.exports=Math.min});var Ga=$((Cz,Ha)=>{"use strict";Ha.exports=Math.pow});var qa=$((Dz,Wa)=>{"use strict";Wa.exports=Math.round});var Ja=$((Uz,Ka)=>{"use strict";Ka.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ya=$((Lz,Xa)=>{"use strict";var Fp=Ja();Xa.exports=o(function(t){return Fp(t)||t===0?t:t<0?-1:1},"sign")});var es=$((Fz,Qa)=>{"use strict";Qa.exports=Object.getOwnPropertyDescriptor});var cn=$((Bz,ts)=>{"use strict";var ur=es();if(ur)try{ur([],"length")}catch{ur=null}ts.exports=ur});var ns=$((Vz,rs)=>{"use strict";var cr=Object.defineProperty||!1;if(cr)try{cr({},"a",{value:1})}catch{cr=!1}rs.exports=cr});var ln=$((Zz,os)=>{"use strict";os.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 ss=$((Gz,as)=>{"use strict";var is=typeof Symbol<"u"&&Symbol,Bp=ln();as.exports=o(function(){return typeof is!="function"||typeof Symbol!="function"||typeof is("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Bp()},"hasNativeSymbols")});var pn=$((qz,us)=>{"use strict";us.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var dn=$((Kz,cs)=>{"use strict";var Vp=un();cs.exports=Vp.getPrototypeOf||null});var ds=$((Jz,ps)=>{"use strict";var Zp="Function.prototype.bind called on incompatible ",Hp=Object.prototype.toString,Gp=Math.max,Wp="[object Function]",ls=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"),qp=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"),Kp=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");ps.exports=o(function(t){var r=this;if(typeof r!="function"||Hp.apply(r)!==Wp)throw new TypeError(Zp+r);for(var n=qp(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,ls(n,arguments));return Object(_)===_?_:this}return r.apply(t,ls(n,arguments))},"binder"),c=Gp(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+Kp(l,",")+"){ 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 Ye=$((Yz,ms)=>{"use strict";var Jp=ds();ms.exports=Function.prototype.bind||Jp});var lr=$((Qz,fs)=>{"use strict";fs.exports=Function.prototype.call});var mn=$((ek,gs)=>{"use strict";gs.exports=Function.prototype.apply});var hs=$((tk,ys)=>{"use strict";ys.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var _s=$((rk,vs)=>{"use strict";var Xp=Ye(),Yp=mn(),Qp=lr(),ed=hs();vs.exports=ed||Xp.call(Qp,Yp)});var Ps=$((nk,xs)=>{"use strict";var td=Ye(),rd=sr(),nd=lr(),od=_s();xs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new rd("a function is required");return od(td,nd,t)},"callBindBasic")});var As=$((ik,Ss)=>{"use strict";var id=Ps(),bs=cn(),Es;try{Es=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var fn=!!Es&&bs&&bs(Object.prototype,"__proto__"),Is=Object,Ts=Is.getPrototypeOf;Ss.exports=fn&&typeof fn.get=="function"?id([fn.get]):typeof Ts=="function"?o(function(t){return Ts(t==null?t:Is(t))},"getDunder"):!1});var Os=$((sk,ws)=>{"use strict";var $s=pn(),zs=dn(),ks=As();ws.exports=$s?o(function(t){return $s(t)},"getProto"):zs?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return zs(t)},"getProto"):ks?o(function(t){return ks(t)},"getProto"):null});var gn=$((ck,Rs)=>{"use strict";var ad=Function.prototype.call,sd=Object.prototype.hasOwnProperty,ud=Ye();Rs.exports=ud.call(ad,sd)});var js=$((lk,Ls)=>{"use strict";var F,cd=un(),ld=Ia(),pd=Aa(),dd=za(),md=wa(),rt=Ra(),tt=sr(),fd=Da(),gd=Ma(),yd=ja(),hd=Ba(),vd=Za(),_d=Ga(),xd=qa(),Pd=Ya(),Us=Function,yn=o(function(e){try{return Us('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),zt=cn(),bd=ns(),hn=o(function(){throw new tt},"throwTypeError"),Td=zt?(function(){try{return arguments.callee,hn}catch{try{return zt(arguments,"callee").get}catch{return hn}}})():hn,Qe=ss()(),ee=Os(),Ed=dn(),Id=pn(),Ms=mn(),kt=lr(),et={},Sd=typeof Uint8Array>"u"||!ee?F:ee(Uint8Array),Fe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?F:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?F:ArrayBuffer,"%ArrayIteratorPrototype%":Qe&&ee?ee([][Symbol.iterator]()):F,"%AsyncFromSyncIteratorPrototype%":F,"%AsyncFunction%":et,"%AsyncGenerator%":et,"%AsyncGeneratorFunction%":et,"%AsyncIteratorPrototype%":et,"%Atomics%":typeof Atomics>"u"?F:Atomics,"%BigInt%":typeof BigInt>"u"?F:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?F:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?F:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?F:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ld,"%eval%":eval,"%EvalError%":pd,"%Float16Array%":typeof Float16Array>"u"?F:Float16Array,"%Float32Array%":typeof Float32Array>"u"?F:Float32Array,"%Float64Array%":typeof Float64Array>"u"?F:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?F:FinalizationRegistry,"%Function%":Us,"%GeneratorFunction%":et,"%Int8Array%":typeof Int8Array>"u"?F:Int8Array,"%Int16Array%":typeof Int16Array>"u"?F:Int16Array,"%Int32Array%":typeof Int32Array>"u"?F:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Qe&&ee?ee(ee([][Symbol.iterator]())):F,"%JSON%":typeof JSON=="object"?JSON:F,"%Map%":typeof Map>"u"?F:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Qe||!ee?F:ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":cd,"%Object.getOwnPropertyDescriptor%":zt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?F:Promise,"%Proxy%":typeof Proxy>"u"?F:Proxy,"%RangeError%":dd,"%ReferenceError%":md,"%Reflect%":typeof Reflect>"u"?F:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?F:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Qe||!ee?F:ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?F:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Qe&&ee?ee(""[Symbol.iterator]()):F,"%Symbol%":Qe?Symbol:F,"%SyntaxError%":rt,"%ThrowTypeError%":Td,"%TypedArray%":Sd,"%TypeError%":tt,"%Uint8Array%":typeof Uint8Array>"u"?F:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?F:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?F:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?F:Uint32Array,"%URIError%":fd,"%WeakMap%":typeof WeakMap>"u"?F:WeakMap,"%WeakRef%":typeof WeakRef>"u"?F:WeakRef,"%WeakSet%":typeof WeakSet>"u"?F:WeakSet,"%Function.prototype.call%":kt,"%Function.prototype.apply%":Ms,"%Object.defineProperty%":bd,"%Object.getPrototypeOf%":Ed,"%Math.abs%":gd,"%Math.floor%":yd,"%Math.max%":hd,"%Math.min%":vd,"%Math.pow%":_d,"%Math.round%":xd,"%Math.sign%":Pd,"%Reflect.getPrototypeOf%":Id};if(ee)try{null.error}catch(e){Ns=ee(ee(e)),Fe["%Error.prototype%"]=Ns}var Ns,Ad=o(function e(t){var r;if(t==="%AsyncFunction%")r=yn("async function () {}");else if(t==="%GeneratorFunction%")r=yn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=yn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&ee&&(r=ee(i.prototype))}return Fe[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"]},wt=Ye(),pr=gn(),$d=wt.call(kt,Array.prototype.concat),zd=wt.call(Ms,Array.prototype.splice),Ds=wt.call(kt,String.prototype.replace),dr=wt.call(kt,String.prototype.slice),kd=wt.call(kt,RegExp.prototype.exec),wd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Od=/\\(\\)?/g,Rd=o(function(t){var r=dr(t,0,1),n=dr(t,-1);if(r==="%"&&n!=="%")throw new rt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new rt("invalid intrinsic syntax, expected opening `%`");var i=[];return Ds(t,wd,function(u,c,l,f){i[i.length]=l?Ds(f,Od,"$1"):c||u}),i},"stringToPath"),Nd=o(function(t,r){var n=t,i;if(pr(Cs,n)&&(i=Cs[n],n="%"+i[0]+"%"),pr(Fe,n)){var u=Fe[n];if(u===et&&(u=Ad(n)),typeof u>"u"&&!r)throw new tt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new rt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ls.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new tt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new tt('"allowMissing" argument must be a boolean');if(kd(/^%?[^%]*%?$/,t)===null)throw new rt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Rd(t),i=n.length>0?n[0]:"",u=Nd("%"+i+"%",r),c=u.name,l=u.value,f=!1,y=u.alias;y&&(i=y[0],zd(n,$d([0,1],y)));for(var _=1,T=!0;_<n.length;_+=1){var x=n[_],s=dr(x,0,1),d=dr(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new rt("property names with quotes must have matching quotes");if((x==="constructor"||!T)&&(f=!0),i+="."+x,c="%"+i+"%",pr(Fe,c))l=Fe[c];else if(l!=null){if(!(x in l)){if(!r)throw new tt("base intrinsic for "+t+" exists, but the property is not available.");return}if(zt&&_+1>=n.length){var g=zt(l,x);T=!!g,T&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[x]}else T=pr(l,x),l=l[x];T&&!f&&(Fe[c]=l)}}return l},"GetIntrinsic")});var Bs=$((dk,Fs)=>{"use strict";var Cd=ln();Fs.exports=o(function(){return Cd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Hs=$((fk,Zs)=>{"use strict";var Dd=js(),Vs=Dd("%Object.defineProperty%",!0),Ud=Bs()(),Md=gn(),Ld=sr(),mr=Ud?Symbol.toStringTag:null;Zs.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 Ld("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");mr&&(n||!Md(t,mr))&&(Vs?Vs(t,mr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[mr]=r)},"setToStringTag")});var Ws=$((yk,Gs)=>{"use strict";var jd=Function.prototype.call,Fd=Object.prototype.hasOwnProperty,Bd=Ye();Gs.exports=Bd.call(jd,Fd)});var Ks=$((hk,qs)=>{"use strict";qs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Ys=$((vk,Xs)=>{"use strict";var Pn=ea(),Vd=require("util"),vn=require("path"),Zd=require("http"),Hd=require("https"),Gd=require("url").parse,Wd=require("fs"),qd=require("stream").Stream,Kd=require("crypto"),_n=ia(),Jd=ba(),Xd=Hs(),Ce=Ws(),xn=Ks();function Js(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Js,"escapeHeaderParam");function V(e){if(!(this instanceof V))return new V(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Pn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(V,"FormData");Vd.inherits(V,Pn);V.LINE_BREAK=`\r
2
+ `;V.DEFAULT_CONTENT_TYPE="application/octet-stream";V.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Pn.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)};V.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)+V.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ce(t,"httpVersion"))&&!(t instanceof qd))&&(r.knownLength||this._valuesToMeasure.push(t))};V.prototype._lengthRetriever=function(e,t){Ce(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Wd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Ce(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ce(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};V.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="'+Js(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&xn(c,r.header);var l;for(var f in c)if(Ce(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+V.LINE_BREAK)}return"--"+this.getBoundary()+V.LINE_BREAK+u+V.LINE_BREAK};V.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=vn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=vn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ce(e,"httpVersion")&&(r=vn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Js(r)+'"'};V.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=_n.lookup(e.name)),!r&&e&&e.path&&(r=_n.lookup(e.path)),!r&&e&&e.readable&&Ce(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=_n.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=V.DEFAULT_CONTENT_TYPE),r};V.prototype._multiPartFooter=function(){return function(e){var t=V.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};V.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+V.LINE_BREAK};V.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ce(e,t)&&(r[t.toLowerCase()]=e[t]);return r};V.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};V.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};V.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(V.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};V.prototype._generateBoundary=function(){this._boundary="--------------------------"+Kd.randomBytes(12).toString("hex")};V.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};V.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};V.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}Jd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};V.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Gd(e),n=xn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=xn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Hd.request(n):r=Zd.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,f=o(function(y,_){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,y,_)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};V.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};V.prototype.toString=function(){return"[object FormData]"};Xd(V.prototype,"FormData");Xs.exports=V});var ym={};In(ym,{savvyCal:()=>gm});module.exports=ku(ym);var wu=Object.freeze({status:"aborted"});function E(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let y=c.prototype,_=Object.keys(y);for(let T=0;T<_.length;T++){let x=_[T];x in l||(l[x]=y[x].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 f;let y=r?.Parent?new u:this;n(y,l),(f=y._zod).deferred??(f.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(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(E,"$constructor");var ge=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Nt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},yr={};function xe(e){return e&&Object.assign(yr,e),yr}o(xe,"config");function vr(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(vr,"getEnumValues");function $n(e,t){return typeof t=="bigint"?t.toString():t}o($n,"jsonStringifyReplacer");function Dt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Dt,"cached");function zn(e){return e==null}o(zn,"nullish");function Ut(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Ut,"cleanRegex");var An=Symbol("evaluating");function Y(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==An)return n===void 0&&(n=An,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(Y,"defineLazy");var _r="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function at(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(at,"isObject");var Ou=Dt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function kn(e){if(at(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(at(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(kn,"isPlainObject");var wn=new Set(["string","number","symbol"]);function Be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Be,"escapeRegex");function Mt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Mt,"clone");function W(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(W,"normalizeParams");function On(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(On,"optionalKeys");var Rn={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 Ve(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(Ve,"aborted");function Ae(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ae,"prefixIssues");function Ct(e){return typeof e=="string"?e:e?.message}o(Ct,"unwrapMessage");function $e(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Ct(e.inst?._zod.def?.error?.(e))??Ct(t?.error?.(e))??Ct(r.customError?.(e))??Ct(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o($e,"finalizeIssue");function Nn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Nn,"getLengthableOrigin");function xr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(xr,"issue");var Cn=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,$n,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Dn=E("$ZodError",Cn),st=E("$ZodError",Cn,{Parent:Error});var Nu=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 ge;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>$e(f,u,xe())));throw _r(l,i?.callee),l}return c.value},"_parse"),Lt=Nu(st),Cu=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(f=>$e(f,u,xe())));throw _r(l,i?.callee),l}return c.value},"_parseAsync"),jt=Cu(st),Du=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 ge;return u.issues.length?{success:!1,error:new(e??Dn)(u.issues.map(c=>$e(c,i,xe())))}:{success:!0,data:u.value}},"_safeParse"),ut=Du(st),Uu=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=>$e(c,i,xe())))}:{success:!0,data:u.value}},"_safeParseAsync"),ct=Uu(st);var Mu="(?:(?:\\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])))",Lu=new RegExp(`^${Mu}$`);var Un=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Mn=/^-?\d+n?$/,Ln=/^-?\d+$/,Pr=/^-?\d+(?:\.\d+)?$/,jn=/^(?:true|false)$/i;var ze=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ju={number:"number",bigint:"bigint",object:"date"};var Fn=E("$ZodCheckGreaterThan",(e,t)=>{ze.init(e,t);let r=ju[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 Bn=E("$ZodCheckNumberFormat",(e,t)=>{ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Rn[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=Ln)}),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 Vn=E("$ZodCheckMinLength",(e,t)=>{var r;ze.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!zn(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=Nn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var br=E("$ZodCheckStringFormat",(e,t)=>{var r,n;ze.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=()=>{})}),Zn=E("$ZodCheckRegex",(e,t)=>{br.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 Gn={major:4,minor:3,patch:6};var K=E("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Gn;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,f)=>{let y=Ve(c),_;for(let T of l){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(y)continue;let x=c.issues.length,s=T._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new ge;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(y||(y=Ve(c,x)))});else{if(c.issues.length===x)continue;y||(y=Ve(c,x))}}return _?_.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(Ve(c))return c.aborted=!0,c;let y=i(l,n,f);if(y instanceof Promise){if(f.async===!1)throw new ge;return y.then(_=>e._zod.parse(_,f))}return e._zod.parse(y,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let y=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return y instanceof Promise?y.then(_=>u(_,c,l)):u(y,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new ge;return f.then(y=>i(y,n,l))}return i(f,n,l)}}Y(e,"~standard",()=>({validate:o(i=>{try{let u=ut(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return ct(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Vt=E("$ZodString",(e,t)=>{K.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Un(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}}),Tr=E("$ZodStringFormat",(e,t)=>{br.init(e,t),Vt.init(e,t)});var Xn=E("$ZodURL",(e,t)=>{Tr.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 Er=E("$ZodNumber",(e,t)=>{K.init(e,t),e._zod.pattern=e._zod.bag.pattern??Pr,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}}),Yn=E("$ZodNumberFormat",(e,t)=>{Bn.init(e,t),Er.init(e,t)}),Ir=E("$ZodBoolean",(e,t)=>{K.init(e,t),e._zod.pattern=jn,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}}),Qn=E("$ZodBigInt",(e,t)=>{K.init(e,t),e._zod.pattern=Mn,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 eo=E("$ZodAny",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),to=E("$ZodUnknown",(e,t)=>{K.init(e,t),e._zod.parse=r=>r});var ro=E("$ZodVoid",(e,t)=>{K.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}}),no=E("$ZodDate",(e,t)=>{K.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 Wn(e,t,r){e.issues.length&&t.issues.push(...Ae(r,e.issues)),t.value[r]=e.value}o(Wn,"handleArrayResult");var oo=E("$ZodArray",(e,t)=>{K.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],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(y=>Wn(y,r,c))):Wn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Bt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ae(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Bt,"handlePropertyResult");function Fu(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=On(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Fu,"normalizeDef");function Bu(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,y=f.def.type,_=f.optout==="optional";for(let T in t){if(l.has(T))continue;if(y==="never"){c.push(T);continue}let x=f.run({value:t[T],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Bt(s,r,T,t,_))):Bt(x,r,T,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(Bu,"handleCatchall");var io=E("$ZodObject",(e,t)=>{if(K.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Dt(()=>Fu(t));Y(e._zod,"propValues",()=>{let l=t.shape,f={};for(let y in l){let _=l[y]._zod;if(_.values){f[y]??(f[y]=new Set);for(let T of _.values)f[y].add(T)}}return f});let i=at,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let y=l.value;if(!i(y))return l.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),l;l.value={};let _=[],T=c.shape;for(let x of c.keys){let s=T[x],d=s._zod.optout==="optional",g=s._zod.run({value:y[x],issues:[]},f);g instanceof Promise?_.push(g.then(m=>Bt(m,l,x,y,d))):Bt(g,l,x,y,d)}return u?Bu(_,y,l,f,n.value,e):_.length?Promise.all(_).then(()=>l):l}});function qn(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=>!Ve(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=>$e(c,n,xe())))}),t)}o(qn,"handleUnionResults");var Sr=E("$ZodUnion",(e,t)=>{K.init(e,t),Y(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Y(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Y(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Y(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=>Ut(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 f of t.options){let y=f._zod.run({value:i.value,issues:[]},u);if(y instanceof Promise)l.push(y),c=!0;else{if(y.issues.length===0)return y;l.push(y)}}return c?Promise.all(l).then(f=>qn(f,i,e,u)):qn(l,i,e,u)}});var ao=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Sr.init(e,t);let r=e._zod.parse;Y(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,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let y of f)i[l].add(y)}}return i});let n=Dt(()=>{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 f of l){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!at(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 so=E("$ZodRecord",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!kn(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 y of c)if(typeof y=="string"||typeof y=="number"||typeof y=="symbol"){l.add(typeof y=="number"?y.toString():y);let _=t.valueType._zod.run({value:i[y],issues:[]},n);_ instanceof Promise?u.push(_.then(T=>{T.issues.length&&r.issues.push(...Ae(y,T.issues)),r.value[y]=T.value})):(_.issues.length&&r.issues.push(...Ae(y,_.issues)),r.value[y]=_.value)}let f;for(let y in i)l.has(y)||(f=f??[],f.push(y));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Pr.test(l)&&f.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&&(f=T)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(T=>$e(T,n,xe())),input:l,path:[l],inst:e});continue}let _=t.valueType._zod.run({value:i[l],issues:[]},n);_ instanceof Promise?u.push(_.then(T=>{T.issues.length&&r.issues.push(...Ae(l,T.issues)),r.value[f.value]=T.value})):(_.issues.length&&r.issues.push(...Ae(l,_.issues)),r.value[f.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var uo=E("$ZodEnum",(e,t)=>{K.init(e,t);let r=vr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>wn.has(typeof i)).map(i=>typeof i=="string"?Be(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}}),co=E("$ZodLiteral",(e,t)=>{if(K.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"?Be(n):n?Be(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 lo=E("$ZodTransform",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Nt(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 ge;return r.value=i,r}});function Kn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Kn,"handleOptionalResult");var po=E("$ZodOptional",(e,t)=>{K.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ut(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=>Kn(u,r.value)):Kn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var mo=E("$ZodNullable",(e,t)=>{K.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ut(r.source)}|null)$`):void 0}),Y(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 fo=E("$ZodPipe",(e,t)=>{K.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(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=>Ft(c,t.in,n)):Ft(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Ft(u,t.out,n)):Ft(i,t.out,n)}});function Ft(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Ft,"handlePipeResult");var go=E("$ZodCustom",(e,t)=>{ze.init(e,t),K.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=>Jn(u,r,n,e));Jn(i,r,n,e)}});function Jn(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(xr(i))}}o(Jn,"handleRefineResult");var ho;var Ar=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 vo(){return new Ar}o(vo,"registry");(ho=globalThis).__zod_globalRegistry??(ho.__zod_globalRegistry=vo());var $r=globalThis.__zod_globalRegistry;function _o(e,t){return new e({type:"string",...W(t)})}o(_o,"_string");function xo(e,t){return new e({type:"string",coerce:!0,...W(t)})}o(xo,"_coercedString");function Po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...W(t)})}o(Po,"_url");function bo(e,t){return new e({type:"number",checks:[],...W(t)})}o(bo,"_number");function To(e,t){return new e({type:"number",coerce:!0,checks:[],...W(t)})}o(To,"_coercedNumber");function Eo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...W(t)})}o(Eo,"_int");function Io(e,t){return new e({type:"boolean",...W(t)})}o(Io,"_boolean");function So(e,t){return new e({type:"boolean",coerce:!0,...W(t)})}o(So,"_coercedBoolean");function Ao(e,t){return new e({type:"bigint",coerce:!0,...W(t)})}o(Ao,"_coercedBigint");function $o(e){return new e({type:"any"})}o($o,"_any");function zo(e){return new e({type:"unknown"})}o(zo,"_unknown");function ko(e,t){return new e({type:"void",...W(t)})}o(ko,"_void");function wo(e,t){return new e({type:"date",coerce:!0,...W(t)})}o(wo,"_coercedDate");function Zt(e,t){return new Fn({check:"greater_than",...W(t),value:e,inclusive:!0})}o(Zt,"_gte");function de(e,t){return new Vn({check:"min_length",...W(t),minimum:e})}o(de,"_minLength");function ke(e,t){return new Zn({check:"string_format",format:"regex",...W(t),pattern:e})}o(ke,"_regex");function Oo(e,t,r){let n=W(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Oo,"_custom");var Q=E("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");K.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Lt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>ut(e,r,n),e.parseAsync=async(r,n)=>jt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ct(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)=>Mt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Gt=E("ZodMiniString",(e,t)=>{Vt.init(e,t),Q.init(e,t)});function a(e){return _o(Gt,e)}o(a,"string");var Ro=E("ZodMiniStringFormat",(e,t)=>{Tr.init(e,t),Gt.init(e,t)});var tc=E("ZodMiniURL",(e,t)=>{Xn.init(e,t),Ro.init(e,t)});function No(e){return Po(tc,e)}o(No,"url");var Wt=E("ZodMiniNumber",(e,t)=>{Er.init(e,t),Q.init(e,t)});function ne(e){return bo(Wt,e)}o(ne,"number");var rc=E("ZodMiniNumberFormat",(e,t)=>{Yn.init(e,t),Wt.init(e,t)});function Co(e){return Eo(rc,e)}o(Co,"int");var zr=E("ZodMiniBoolean",(e,t)=>{Ir.init(e,t),Q.init(e,t)});function H(e){return Io(zr,e)}o(H,"boolean");var Do=E("ZodMiniBigInt",(e,t)=>{Qn.init(e,t),Q.init(e,t)});var nc=E("ZodMiniAny",(e,t)=>{eo.init(e,t),Q.init(e,t)});function pt(){return $o(nc)}o(pt,"any");var oc=E("ZodMiniUnknown",(e,t)=>{to.init(e,t),Q.init(e,t)});function R(){return zo(oc)}o(R,"unknown");var ic=E("ZodMiniVoid",(e,t)=>{ro.init(e,t),Q.init(e,t)});function Uo(e){return ko(ic,e)}o(Uo,"_void");var Mo=E("ZodMiniDate",(e,t)=>{no.init(e,t),Q.init(e,t)});var ac=E("ZodMiniArray",(e,t)=>{oo.init(e,t),Q.init(e,t)});function D(e,t){return new ac({type:"array",element:e,...W(t)})}o(D,"array");var sc=E("ZodMiniObject",(e,t)=>{io.init(e,t),Q.init(e,t),Y(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...W(t)};return new sc(r)}o(p,"object");var uc=E("ZodMiniUnion",(e,t)=>{Sr.init(e,t),Q.init(e,t)});function U(e,t){return new uc({type:"union",options:e,...W(t)})}o(U,"union");var cc=E("ZodMiniDiscriminatedUnion",(e,t)=>{ao.init(e,t),Q.init(e,t)});function we(e,t,r){return new cc({type:"union",options:t,discriminator:e,...W(r)})}o(we,"discriminatedUnion");var lc=E("ZodMiniRecord",(e,t)=>{so.init(e,t),Q.init(e,t)});function N(e,t,r){return new lc({type:"record",keyType:e,valueType:t,...W(r)})}o(N,"record");var pc=E("ZodMiniEnum",(e,t)=>{uo.init(e,t),Q.init(e,t),e.options=Object.values(t.entries)});function L(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new pc({type:"enum",entries:r,...W(t)})}o(L,"_enum");var dc=E("ZodMiniLiteral",(e,t)=>{co.init(e,t),Q.init(e,t)});function z(e,t){return new dc({type:"literal",values:Array.isArray(e)?e:[e],...W(t)})}o(z,"literal");var mc=E("ZodMiniTransform",(e,t)=>{lo.init(e,t),Q.init(e,t)});function Oe(e){return new mc({type:"transform",transform:e})}o(Oe,"transform");var fc=E("ZodMiniOptional",(e,t)=>{po.init(e,t),Q.init(e,t)});function h(e){return new fc({type:"optional",innerType:e})}o(h,"optional");var gc=E("ZodMiniNullable",(e,t)=>{mo.init(e,t),Q.init(e,t)});function dt(e){return new gc({type:"nullable",innerType:e})}o(dt,"nullable");var yc=E("ZodMiniPipe",(e,t)=>{fo.init(e,t),Q.init(e,t)});function Re(e,t){return new yc({type:"pipe",in:e,out:t})}o(Re,"pipe");var hc=E("ZodMiniCustom",(e,t)=>{go.init(e,t),Q.init(e,t)});function qt(e,t){return Oo(hc,e??(()=>!0),t)}o(qt,"custom");var mt={};In(mt,{bigint:()=>Tc,boolean:()=>bc,date:()=>Ec,number:()=>Pc,string:()=>xc});function xc(e){return xo(Gt,e)}o(xc,"string");function Pc(e){return To(Wt,e)}o(Pc,"number");function bc(e){return So(zr,e)}o(bc,"boolean");function Tc(e){return Ao(Do,e)}o(Tc,"bigint");function Ec(e){return wo(Mo,e)}o(Ec,"date");var wr=p({retryOnFailure:p({defaultValue:h(H()),hide:h(H())}),continueOnFailure:p({defaultValue:h(H()),hide:h(H())})}),kr=class{constructor(t,r,n,i,u,c,l,f,y,_,T){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=y;this.audience=_;this.aiMetadata=T}static{o(this,"IAction")}},G=o(e=>new kr(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 Z=p({displayName:a(),description:h(a())}),M=o((e,t)=>p({type:z(t),required:H(),defaultValue:h(pt())}),"TPropertyValue");var ae=p({...Z.shape,...M(a(),"SHORT_TEXT").shape}),Pe=p({...Z.shape,...M(a(),"LONG_TEXT").shape});var jo=p({label:a(),value:R()}),Kt=p({disabled:h(H()),placeholder:h(a()),options:D(jo)});var se=p({...Z.shape,options:Kt,...M(R(),"STATIC_DROPDOWN").shape}),be=p({...Z.shape,options:Kt,...M(D(R()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Or=p({...Z.shape,...M(R(),"DROPDOWN").shape,refreshers:D(a())}),ft=p({...Z.shape,...M(D(R()),"MULTI_SELECT_DROPDOWN").shape,refreshers:D(a())});var Te=p({...Z.shape,...M(H(),"CHECKBOX").shape});var Ee=p({...Z.shape,...M(ne(),"NUMBER").shape});var gt=p({...Z.shape,streaming:h(H()),...M(R(),"FILE").shape});var yt=p({...Z.shape,...M(a(),"DATE_TIME").shape});var Fo=N(a(),U([ae,Pe,se,ft,be,Te,Ee,gt,yt])),ht=p({...Z.shape,properties:Fo,...M(D(R()),"ARRAY").shape});var vt=p({...Z.shape,...M(U([N(a(),R())]),"JSON").shape});var Bo=U([ae,se,vt,ht,be]),Sc=N(a(),Bo),Rr=p({refreshers:D(a()),...Z.shape,...M(R(),"DYNAMIC").shape});var Jt=p({...Z.shape,...M(Uo(),"MARKDOWN").shape});var _t=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(_t||{}),Ze=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ze||{}),He=(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))(He||{});var xt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(xt||{}),Nr="both_client_credentials_and_authorization_code";var ye=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ye||{}),Pt=(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))(Pt||{}),Ac=p({strategy:L(Pt),paramName:h(a())}),bt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(bt||{});var Xt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Xt||{}),Vo=p({status:h(ne()),body:h(R()),headers:h(N(a(),a()))}),Zo=p({type:z("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(L(Xt))}),Ho=p({type:z("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Vo,handlerId:h(a()),streamStepProgress:h(L(Xt))}),$c=U([Zo,Ho]);var zc=p({body:R(),rawBody:h(R()),headers:N(a(),a()),queryParams:N(a(),a())});function ue(e){return e==null}o(ue,"isNil");function Tt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(Tt,"isEmpty");function Yt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Yt,"assertNotNullOrUndefined");var Cr=Ue(require("crypto"),1);var kc=128,Me,Ge,wc=o(e=>{!Me||Me.length<e?(Me=Buffer.allocUnsafe(e*kc),Cr.default.randomFillSync(Me),Ge=0):Ge+e>Me.length&&(Cr.default.randomFillSync(Me),Ge=0),Ge+=e},"fillPool"),Oc=o(e=>(wc(e|=0),Me.subarray(Ge-e,Ge)),"random"),Rc=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 l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===u)return c}}},"customRandom"),Wo=o((e,t=21)=>Rc(e,t,Oc),"customAlphabet");var Nc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",qo=21,Xb=a().check(ke(new RegExp(`^[0-9a-zA-Z]{${qo}}$`))),Cc=Wo(Nc,qo);var Ne=Re(Oe(e=>e instanceof Date?e.toISOString():e),a()),le={id:a(),created:Ne,updated:Ne},q=o(e=>h(dt(e)),"Nullable");function Dr(e){return h(dt(L(e)))}o(Dr,"NullableEnum");var eT=Re(Oe(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(H())),Qt=o(e=>Re(Oe(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(D(e))),"OptionalArrayFromQuery");var nT=N(a(),R());var Et=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(Et||{});var gT=a().check(ke(/^#[0-9A-Fa-f]{6}$/));var hT=p({filename:a(),data:R(),type:z("file"),mimetype:h(a())});var Dc=Ue(Jo());var ET=p({...le,name:a(),permissions:D(a()),platformId:q(a()),type:a(),userCount:h(ne())});var Xo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Xo||{}),Ur=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ur||{}),Mr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Mr||{});var Lr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Lr||{});var jr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(jr||{});var Uc=p({mode:L(Xo),value:R()}),Mc=p({auth:h(a()),fields:N(a(),Uc)}),Lc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(Mc)}),jc=p({type:z("PIECE"),toolName:a().check(de(1)),pieceMetadata:Lc}),Fc=p({type:z("none")}),Bc=p({type:z("access_token"),accessToken:a()}),Vc=p({type:z("api_key"),apiKey:a(),apiKeyHeader:a()}),Zc=p({type:z("headers"),headers:N(a(),a())}),Hc=we("type",[Fc,Bc,Vc,Zc]),Yo=p({type:z("FLOW"),toolName:a().check(de(1)),externalFlowId:a(),flowDisplayName:h(a())}),Qo=p({type:z("MCP"),toolName:a().check(de(1)),serverUrl:No(),protocol:L(Mr),auth:Hc}),ei=p({type:z("KNOWLEDGE_BASE"),toolName:a().check(de(1)),sourceType:L(Ur),sourceId:a(),sourceName:a()}),Gc=we("type",[jc,Yo,Qo,ei]),Wc=p({displayName:a(),description:h(a()),type:L(Lr)}),ti=p({type:z("MARKDOWN"),markdown:a()}),We={type:z("TOOL_CALL"),input:q(N(a(),R())),output:h(R()),toolName:a(),status:L(jr),toolCallId:a(),startTime:a(),endTime:h(a())},tE=p(We),ri=we("toolCallType",[p({...We,toolCallType:z("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...We,toolCallType:z("FLOW"),displayName:a(),externalFlowId:a()}),p({...We,toolCallType:z("MCP"),displayName:a(),serverUrl:a()}),p({...We,toolCallType:z("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...We,toolCallType:z("UNKNOWN"),displayName:a()})]),qc=U([ti,ri]);var Fr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Fr||{}),Ie=p({apiKey:a()}),Kc=Ie,Jc=p({apiKey:a(),apiKeyHash:a()}),Xc=Ie,Yc=Ie,Qc=Ie,el=Ie,tl=Ie,rl=Ie,nl=Ie,si=p({accessKeyId:a().check(de(1)),secretAccessKey:a().check(de(1))}),ol=p({}),il=p({}),al=p({}),sl=p({}),ul=p({}),cl=p({}),ui=p({modelId:a(),modelName:a(),modelType:L(Fr)}),ci=p({apiKeyHeader:a(),baseUrl:a(),models:D(ui),defaultHeaders:h(N(a(),a()))}),li=p({accountId:a(),gatewayId:a(),models:D(ui),vertexProject:h(a()),vertexRegion:h(a())}),pi=p({resourceName:a(),apiVersion:Re(Oe(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),di=p({region:a().check(de(1))}),ll=U([Kc,Qc,el,tl,rl,Yc,Xc,Jc,si,nl]),mi=U([ci,li,pi,di,ol,al,sl,ul,il,cl]),pl=p({id:a(),name:a(),type:L(Fr)}),dl=p({id:a(),name:a(),provider:L(Et),config:mi,enabledForChat:H()}),ml=p({provider:L(Et),config:mi,auth:ll,platformId:a()});var iE={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ni=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],fl=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],gl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],oi=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],yl=["grok-4.20","grok-4.1-fast"],hl={openai:ni,anthropic:fl,google:oi,activepieces:[...gl.map(e=>`anthropic/${e}`),...ni.map(e=>`openai/${e}`),...oi.map(e=>`google/${e}`),...yl.map(e=>`x-ai/${e}`)]};var ii=128e3,vl={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function _l({provider:e}){return e?vl[e]??ii:ii}o(_l,"getMaxContextTokens");var ai={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"},xl={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Pl=new Set(["anthropic","mistral"]);function he(e){return{chatModels:hl[e],maxContextTokens:_l({provider:e}),defaultEmbeddingModel:ai[e],supportsEmbedding:ai[e]!==void 0,supportsImageGeneration:!Pl.has(e),webSearch:xl[e]}}o(he,"buildProviderCapabilities");var bl={openai:he("openai"),anthropic:he("anthropic"),openrouter:he("openrouter"),azure:he("azure"),google:he("google"),"cloudflare-gateway":he("cloudflare-gateway"),custom:he("custom"),bedrock:he("bedrock"),mistral:he("mistral"),activepieces:he("activepieces")};var Tl=p({base64Url:a(),fileName:a(),extension:h(a())}),El=p({mimeType:a(),url:a(),fileName:h(a())}),Br=U([Tl,El]);var Il=U([p({type:z("file"),value:Br}),p({type:z("markdown"),value:a(),files:h(D(Br))})]),Sl=p({sessionId:a(),message:a(),files:h(D(a()))});var gi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(gi||{}),yi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(yi||{}),Vr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Vr||{});var Al=U([p({...le,name:a(),externalId:a(),type:z("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:D(p({value:a()}))})}),p({...le,name:a(),externalId:a(),type:U([z("TEXT"),z("NUMBER"),z("DATE")]),tableId:a(),projectId:a()})]),$l=p({...le,name:a(),folderId:q(a()),projectId:a(),externalId:a(),status:Dr(yi),trigger:Dr(gi)}),zl=p({...le,tableId:a(),projectId:a(),cells:N(a(),p({updated:a(),created:a(),value:R(),fieldName:a()}))}),kl=p({events:D(L(Vr)),webhookUrl:a(),flowId:a()}),wl=p({fields:D(p({id:a(),name:a()})),rows:D(N(a(),a())),name:a()}),Ol=p({projectId:a(),limit:h(mt.number()),cursor:h(a()),name:h(a()),externalIds:Qt(a()),folderId:h(a()),folderIds:Qt(a())}),Rl=p({records:D(D(p({fieldId:a(),value:vi()}))),tableId:a()}),Nl=p({cells:h(D(p({fieldId:a(),value:vi()}))),tableId:a(),agentUpdate:h(H())}),hi=we("operator",[Le("eq"),Le("neq"),Le("gt"),Le("gte"),Le("lt"),Le("lte"),Le("co"),fi("exists"),fi("not_exists")]),Cl=p({tableId:a(),limit:h(mt.number()),cursor:h(a()),filters:Qt(hi)});function vi(){return Re(Oe(e=>e==null?e:String(e)),dt(a()))}o(vi,"coerceToString");function Le(e){return p({fieldId:a(),operator:z(e),value:a()})}o(Le,"valueFilter");function fi(e){return p({fieldId:a(),operator:z(e)})}o(fi,"existenceFilter");var Dl=p({status:h(ne()),body:h(R()),headers:h(N(a(),a()))}),Ul=p({...le,deleted:q(Ne),ownerId:a(),displayName:a(),platformId:a(),externalId:q(a())});var _i=p({name:a(),description:h(a()),type:a(),required:H()}),Ml=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:D(_i),returnsResponse:H()})});var xi="^[0-9]+\\.[0-9]+\\.[0-9]+$",EE=new RegExp(xi),jl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",IE=a().check(ke(new RegExp(xi))),SE=a().check(ke(new RegExp(jl))),Fl=p({packageType:z("ARCHIVE"),pieceType:L(Ze),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Pi=p({packageType:z("REGISTRY"),pieceType:z("OFFICIAL"),pieceName:a(),pieceVersion:a()}),bi=p({packageType:z("REGISTRY"),pieceType:z("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),AE=U([Pi,bi]),$E=U([Fl,Pi,bi]);var Bl=we("type",[p({type:z("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:z("INTERVAL"),intervalMs:Co().check(Zt(6e4))})]),zE=p({...le,type:L(ye),projectId:a(),flowId:a(),triggerName:a(),schedule:q(Bl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:q(a()),simulate:H()}),Ti=(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))(Ti||{}),Ei=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Ei||{}),Ii=(r=>(r.S3="S3",r.DB="DB",r))(Ii||{}),kE=p({...le,projectId:q(a()),platformId:q(a()),type:L(Ti),compression:L(Ei),data:h(R()),location:L(Ii),size:q(ne()),fileName:q(a()),s3Key:q(a()),metadata:q(N(a(),a()))}),Si=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Si||{}),Ai=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ai||{}),wE=p({id:a(),email:a(),firstName:a(),status:L(Ai),externalId:q(a()),platformId:q(a()),platformRole:L(Si),lastName:a(),created:Ne,updated:Ne,lastActiveDate:q(Ne),imageUrl:q(a())});var Hr=p({...Z.shape,...M(N(a(),R()),"OBJECT").shape});var ki=p({...Z.shape,...M(a(),"COLOR").shape});var Gr=U([ae,Pe,Jt,Te,se,be,Or,ft,Rr,Ee,ht,Hr,vt,yt,gt,ki]),b={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 ve=p({displayName:a(),description:h(a())});var wi=p({username:a(),password:a()}),Wr=p({...ve.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...M(wi,"BASIC_AUTH").shape});var Gl=N(a(),U([ae,Pe,Ee,Te,se])),qr=p({...ve.shape,props:Gl,...M(R(),"CUSTOM_AUTH").shape});var je=p({...ve.shape,...M(p({auth:a()}),"SECRET_TEXT").shape});var Wl=N(a(),U([ae,Pe,je,Ee,Te,se,be,Jt])),Oi=p({...ve.shape,props:Wl,...M(R(),"OIDC").shape});var Kr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Kr||{}),Ri=U([ae,je,se]),Ni=N(a(),Ri),ql=p({props:h(N(a(),Ri)),authUrl:a(),tokenUrl:a(),scope:D(a()),prompt:h(U([z("none"),z("consent"),z("login"),z("omit")])),pkce:h(H()),pkceMethod:h(U([z("plain"),z("S256")])),authorizationMethod:h(L(Kr)),grantType:h(U([L(xt),z(Nr)])),extra:h(N(a(),a()))}),Ci=p({access_token:a(),props:h(Ni),data:N(a(),pt())}),Jr=p({...ve.shape,...ql.shape,...M(Ci,"OAUTH2").shape});var qe=U([Wr,qr,Oi,Jr,je]),It="Connection",St={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||It}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||It,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||It}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||It}},None(){}};var cS={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 Kl=p({...Z.shape,...M(R(),"CUSTOM").shape,code:a()});var Jl=U([Gr,qe]),Xr=N(a(),Jl),zS=N(a(),Gr);var Di=U([p({strategy:z("CRON"),cronExpression:a()}),p({strategy:z("NONE")})]),Ke=class{constructor(t,r,n,i,u,c,l,f,y,_,T,x,s,d,g,m,v,P,j){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=l;this.onHandshake=f;this.renewConfiguration=y;this.onRenew=_;this.onEnable=T;this.onDisable=x;this.onStart=s;this.run=d;this.test=g;this.sampleData=m;this.testStrategy=v;this.outputSchema=P;this.aiMetadata=j}static{o(this,"ITrigger")}},Je=o(e=>{switch(e.type){case"WEBHOOK":return new Ke(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Ke(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Ke(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Ke(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,ue(e.sampleData)&&ue(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Ui="2",tr="0.82.0";var Yr=class{constructor(t,r,n,i,u,c,l,f,y=tr,_,T="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=y;this.maximumSupportedRelease=_;this.description=T;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ui}),"getContextInfo");(!Xl(y)||Yl(y,tr))&&(this.minimumSupportedRelease=tr),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: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}},Mi=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 Yr(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 Xl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Xl,"isValidSimpleSemver");function Yl(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(Yl,"isSemverLessThan");var Ql=h(N(a(),N(a(),a()))),Li=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:D(a()),platformId:h(a()),directoryPath:h(a()),auth:h(U([qe,D(qe)])),version:a(),categories:h(D(L(He))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),deprecated:h(H()),i18n:Ql}),ep=L(["human","ai","both"]),ji=p({description:h(a()),idempotent:h(H())}),Fi=p({name:a(),displayName:a(),description:a(),props:Xr,requireAuth:H(),errorHandlingOptions:h(wr),outputSchema:h(qt()),audience:h(ep),aiMetadata:h(ji)}),Bi=p({name:a(),displayName:a(),description:a(),props:Xr,errorHandlingOptions:h(wr),type:L(ye),sampleData:R(),handshakeConfiguration:h(qt()),renewConfiguration:h(Di),testStrategy:L(bt),outputSchema:h(qt()),aiMetadata:h(ji)}),tp=p({...Li.shape,actions:N(a(),Fi),triggers:N(a(),Bi)}),rp=p({...Li.shape,actions:ne(),triggers:ne(),suggestedActions:h(D(Fi)),suggestedTriggers:h(D(Bi))}),Vi=p({projectUsage:ne(),pieceType:L(Ze),packageType:L(_t),platformId:h(a()),archiveId:h(a())}),zA=p({...tp.shape,...Vi.shape}),kA=p({...rp.shape,...Vi.shape}),wA=p({name:a(),version:a()});var np=Ue(require("path")),op=Ue(require("fs/promises"));var Wi=require("node:stream");var rr=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 nr=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Qr,r=new en){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Qr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},en=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 At=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 Zi({error:e,requestBody:t}){return e instanceof At?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Zi,"toFailsafeOutput");var $t=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))($t||{});var or=class extends rr{static{o(this,"FetchHttpClient")}constructor(t="",r=new nr){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[j,ie]of Object.entries(c))i.append(j,ie);let l=i.toString(),f=l?`${n}?${l}`:n,y=t.responseType??"json",_=t.followRedirects??!0,T=t.retries??0,{body:x,extraHeaders:s,isStream:d}=ip(t.method)?ap(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},g=up({...u,...s}),m=await sp(async()=>{let j=new AbortController,ie=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let pe={method:t.method.toString(),headers:g,body:x,redirect:_?"follow":"manual",signal:j.signal};return d&&(pe.duplex="half"),r?.dispatcher!==void 0&&(pe.dispatcher=r.dispatcher),await fetch(f,pe)}finally{ie!==void 0&&clearTimeout(ie)}},T),v=_?300:400;if(m.status<200||m.status>=v){let j=await Hi(m,y),ie=new At(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ie),ie}let P=await Hi(m,y);return{status:m.status,headers:cp(m.headers),body:P}}};function ip(e){return e!=="GET"&&e!=="HEAD"}o(ip,"acceptsRequestBody");function ap(e,t){if(pp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(lp(e)){let n=new Wi.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return 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(ap,"serializeBody");async function Hi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());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(Hi,"parseResponseBody");async function sp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Gi(n);continue}return i}catch(i){if(r=i,n<t){await Gi(n);continue}throw i}throw r}o(sp,"sendWithRetries");function Gi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Gi,"backoff");function up(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(up,"normalizeHeaders");function cp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(cp,"toHttpHeaders");function lp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(lp,"isNodeFormData");function pp(e){return e==null}o(pp,"isNil");var Xe=new or;var Yd=Ue(require("fs")),Qs=Ue(Ys());var Qd={"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 em(e){let t=e.split(";")[0].trim().toLowerCase();return Qd[t]??""}o(em,"contentTypeToExtension");var tm=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),rm=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 eu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return G({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:b.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:y})=>({url:b.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${rm(t,y)}/resource or /resource`,required:!0,defaultValue:y?t(y):"",...c?.url??{}})}),"props")}),method:b.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values($t).map(y=>({label:y,value:y}))},...c?.method??{}}),headers:b.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:b.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:b.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:b.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:y})=>{if(!y)return{};let _=y,T={};switch(_){case"none":break;case"json":T.data=b.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":T.data=b.LongText({displayName:"Raw Body",required:!0});break;case"form_data":T.data=b.Array({displayName:"Form Data",required:!0,properties:{fieldName:b.ShortText({displayName:"Field Name",required:!0}),fieldType:b.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:b.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:b.File({displayName:"File Field Value",required:!1})}});break}return T},"props")}),response_is_binary:b.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:b.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:b.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:b.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async y=>{let{method:_,url:T,headers:x,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:P,followRedirects:j}=y.propsValue;Yt(_,"Method"),Yt(T,"URL");let ie=ue(r)?{}:await r(y.auth,y.propsValue),pe=T.url,ot=pe.startsWith("http://")||pe.startsWith("https://")?pe:tm({baseUrl:t(y.auth),relativePath:pe}),Se={method:_,url:ot,headers:{...x??{},...f==="headers"||!ue(f)?ie:{}},queryParams:{...f==="queryParams"?ie:{},...s??{}},timeout:v?v*1e3:0,followRedirects:j};if(P&&(Se.responseType="arraybuffer"),d)if(g&&g!=="none"){let _e=d.data;if(g==="form_data"){let Eu=_e,Rt=new Qs.default;for(let{fieldName:bn,fieldType:Tn,textFieldValue:En,fileFieldValue:gr}of Eu)Tn==="text"&&!Tt(En)?Rt.append(bn,En):Tn==="file"&&!Tt(gr)&&Rt.append(bn,gr.data,{filename:gr?.filename});Se.body=Rt,Se.headers={...Se.headers,...Rt.getHeaders()}}else Se.body=_e}else g||(Se.body=d);try{let _e=await Xe.sendRequest(Se);return await nm(y.files,_e.body,_e.status,_e.headers,P)}catch(_e){if(m)return Zi({error:_e,requestBody:Se.body});throw _e}},"run")})}o(eu,"createCustomApiCallAction");var nm=o(async(e,t,r,n,i)=>{let u;if(i&&om(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=em(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),om=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var fr=Ue(require("crypto"));var Ot="https://api.savvycal.com/v1";function nt(e,t,r){let n=typeof r=="string"?r:Buffer.isBuffer(r)?r.toString("utf8"):JSON.stringify(r),i="sha256="+fr.createHmac("sha256",e).update(n).digest("hex");try{return fr.timingSafeEqual(Buffer.from(i),Buffer.from(t.toLowerCase()))}catch{return!1}}o(nt,"verifyWebhookSignature");async function B({token:e,method:t,path:r,body:n,queryParams:i}){return Xe.sendRequest({method:t,url:`${Ot}${r}`,authentication:{type:"BEARER_TOKEN",token:e},queryParams:i,body:n})}o(B,"savvyCalApiCall");async function fe({token:e,path:t,queryParams:r}){let n=[],i=null;do{let u={limit:"100",...r};i&&(u.after=i);let c=await B({token:e,method:"GET",path:t,queryParams:u});n.push(...c.body.entries),i=c.body.metadata.after}while(i);return n}o(fe,"savvyCalPaginatedCall");async function te(e){let t=await fe({token:e,path:"/links"}),r=new Set,n=[{label:"Personal",value:"personal"}];for(let i of t)i.scope&&!r.has(i.scope.id)&&(r.add(i.scope.id),n.push({label:i.scope.name,value:i.scope.id}));return n}o(te,"buildTeamOptions");async function tu(e){return(await fe({token:e,path:"/workflows"})).map(r=>({label:r.name,value:r.id}))}o(tu,"buildWorkflowOptions");async function re(e,t){let r=await fe({token:e,path:"/links"});return(t?t==="personal"?r.filter(i=>i.scope===null):r.filter(i=>i.scope?.id===t):r).map(i=>({label:`${i.name} (${i.slug})`,value:i.id}))}o(re,"buildLinkOptions");function De(e){return{id:e.id,name:e.name,slug:e.slug,url:e.url??null,active:e.active??null,duration_minutes:e.duration??null,team_id:e.scope?.id??null,team_name:e.scope?.name??null,created_at:e.created_at,updated_at:e.updated_at}}o(De,"flattenLink");function ce(e){let t=e.attendees?.find(n=>!n.is_organizer)??null,r=e.attendees?.find(n=>n.is_organizer)??null;return{id:e.id,uuid:e.uuid??null,summary:e.summary??null,description:e.description??null,state:e.state,start_at:e.start_at,end_at:e.end_at,duration_minutes:e.duration??null,url:e.url??null,location:e.location??null,is_group_session:e.is_group_session??null,created_at:e.created_at,canceled_at:e.canceled_at??null,cancel_reason:e.cancel_reason??null,rescheduled_at:e.rescheduled_at??null,reschedule_reason:e.reschedule_reason??null,original_start_at:e.original_start_at??null,original_end_at:e.original_end_at??null,scheduling_link_id:e.link?.id??null,scheduling_link_name:e.link?.name??null,scheduling_link_slug:e.link?.slug??null,attendee_display_name:t?.display_name??null,attendee_first_name:t?.first_name??null,attendee_last_name:t?.last_name??null,attendee_email:t?.email??null,attendee_phone:t?.phone_number??null,attendee_time_zone:t?.time_zone??null,organizer_display_name:r?.display_name??null,organizer_first_name:r?.first_name??null,organizer_last_name:r?.last_name??null,organizer_email:r?.email??null,conferencing_type:e.conferencing?.type??null,conferencing_join_url:e.conferencing?.join_url??null,conferencing_meeting_id:e.conferencing?.meeting_id??null,payment_state:e.payment?.state??null,payment_amount_total_cents:e.payment?.amount_total??null}}o(ce,"flattenEvent");var A=[St.OAuth2({description:"Connect your SavvyCal account using OAuth2.",authUrl:"https://savvycal.com/oauth/authorize",tokenUrl:"https://savvycal.com/oauth/token",required:!0,scope:[]}),St.CustomAuth({displayName:"Personal Access Token",description:`To get your SavvyCal API token:
4
4
  1. Log in to your SavvyCal account at https://savvycal.com
5
5
  2. Go to **Settings > Developers**
6
6
  3. Under **Personal Tokens**, click **Create a token**
7
7
  4. Give it a name, then click the **...** menu next to it to view the token
8
8
  5. Copy the **Private Key** (starts with \`pt_secret_\`) \u2014 not the Public Key
9
9
 
10
- **Note:** Keep this token secret \u2014 it gives full access to your SavvyCal account.`,required:!0,props:{token:It.SecretText({displayName:"Personal Access Token",description:"Your SavvyCal Personal Access Token (Private Key).",required:!0})},validate:o(async({auth:e})=>{try{return await Je.sendRequest({method:"GET",url:`${kt}/me`,authentication:{type:"BEARER_TOKEN",token:e.token}}),{valid:!0}}catch{return{valid:!1,error:"Invalid token. Please check your Personal Access Token and try again."}}},"validate")})];function E(e){return e.type==="CUSTOM_AUTH"?e.props.token:e.access_token}o(E,"getToken");var Bs=H({auth:$,name:"get_current_user",displayName:"Get Current User",description:"Retrieves the profile of the currently authenticated SavvyCal user.",audience:"both",aiMetadata:{description:"Returns the profile of the SavvyCal account the connection is authenticated as (id, name, email, slug, time zone). Use to identify the current user or fetch their default time zone. Read-only and idempotent.",idempotent:!0},props:{},async run(e){let r=(await B({token:E(e.auth),method:"GET",path:"/me"})).body;return{id:r.id,name:r.name,email:r.email,slug:r.slug??null,time_zone:r.time_zone??null,created_at:r.created_at,updated_at:r.updated_at??null}}});var Zs=H({auth:$,name:"list_events",displayName:"List Events",description:"Returns a list of scheduled meetings from your SavvyCal account.",audience:"both",aiMetadata:{description:"Lists SavvyCal events across the account, optionally filtered by state(s), start date window, team, or specific scheduling links. Use to browse or find bookings when you do not have an event id; leave all filters empty to return every event. Read-only and idempotent.",idempotent:!0},props:{states:b.StaticMultiSelectDropdown({displayName:"State",description:"Filter events by their current status. Leave empty to return all statuses.",required:!1,options:{options:[{label:"Confirmed",value:"confirmed"},{label:"Canceled",value:"canceled"},{label:"Awaiting Reschedule",value:"awaiting_reschedule"},{label:"Awaiting Checkout",value:"awaiting_checkout"},{label:"Checkout Expired",value:"checkout_expired"},{label:"Awaiting Approval",value:"awaiting_approval"},{label:"Declined",value:"declined"},{label:"Tentative",value:"tentative"}]}}),start_after:b.DateTime({displayName:"Start After",description:"Only return events that start after this date and time.",required:!1}),start_before:b.DateTime({displayName:"Start Before",description:"Only return events that start before this date and time.",required:!1}),team_id:b.Dropdown({auth:$,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(E(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_ids:b.MultiSelectDropdown({auth:$,displayName:"Scheduling Links",description:"Only return events booked through the selected scheduling links. Leave empty for all links.",refreshers:["team_id"],required:!1,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(E(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")}),limit:b.Number({displayName:"Maximum Results",description:"Maximum number of events to return. Leave empty to return all matching events.",required:!1})},async run(e){let t=E(e.auth),{states:r,start_after:n,start_before:i,link_ids:u,limit:c}=e.propsValue,l=r,f=u,y=f&&f.length>0,x=y&&f.length>1||l&&l.length>1,T={};if(n&&(T.start_after=n),i&&(T.start_before=i),l&&l.length===1&&(T.state=l[0]),y&&f.length===1&&(T.link_id=f[0]),c&&x){let s=null,d=[];do{let g={limit:"100",...T};s&&(g.after=s);let m=await B({token:t,method:"GET",path:"/events",queryParams:g});for(let v of m.body.entries){let P=!l||l.length===0||l.includes(v.state),j=!y||f.includes(v.link?.id??"");P&&j&&d.push(v)}s=d.length>=c?null:m.body.metadata.after}while(s);return d.slice(0,c).map(ue)}return c?(T.limit=String(c),(await B({token:t,method:"GET",path:"/events",queryParams:T})).body.entries.map(ue)):(await fe({token:t,path:"/events",queryParams:T})).filter(s=>!l||l.length===0||l.includes(s.state)).filter(s=>!y||f.includes(s.link?.id??"")).map(ue)}});var Vs=H({auth:$,name:"get_event",displayName:"Get Event",description:"Retrieves the details of a specific scheduled meeting by its ID.",audience:"both",aiMetadata:{description:"Fetches the full details of a single SavvyCal event by its event id. Use to look up a known booking (attendee, times, state, link); obtain the id from a trigger, List Events, or the event URL. Read-only and idempotent.",idempotent:!0},props:{event_id:b.ShortText({displayName:"Event ID",description:"The unique ID of the event. You can find this in the event URL in SavvyCal, or from the output of a trigger or List Events action.",required:!0})},async run(e){let t=await B({token:E(e.auth),method:"GET",path:`/events/${e.propsValue.event_id}`});return ue(t.body)}});var Hs=H({auth:$,name:"cancel_event",displayName:"Cancel Event",description:"Cancels a scheduled meeting in SavvyCal.",audience:"both",aiMetadata:{description:"Cancels a scheduled SavvyCal meeting identified by its event id. Use when a booking needs to be called off; obtain the event id from a trigger, List Events, or Get Event. Cancelling an already-cancelled event has no further effect, but this mutates state and is not a read.",idempotent:!1},props:{event_id:b.ShortText({displayName:"Event ID",description:"The unique ID of the event to cancel. You can find this from the output of a trigger or the List Events / Get Event actions.",required:!0})},async run(e){return await B({token:E(e.auth),method:"POST",path:`/events/${e.propsValue.event_id}/cancel`}),{success:!0,event_id:e.propsValue.event_id,message:"Event cancelled successfully."}}});var qs=H({auth:$,name:"create_event",displayName:"Create Event",description:"Books a meeting on a scheduling link at a specific time slot.",audience:"both",aiMetadata:{description:"Books a new SavvyCal meeting on a given scheduling link for an attendee at a specific start/end time. Use to schedule a booking on the attendee's behalf; the chosen time must match an available slot on the link (call Get Available Slots first if unsure). Requires the link id, attendee name/email, and time zone in Olson format. Not idempotent \u2014 each call creates a separate booking.",idempotent:!1},props:{team_id:b.Dropdown({auth:$,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(E(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:$,displayName:"Scheduling Link",description:"Select the scheduling link to book a meeting on.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(E(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links. Check your connection."}}},"options")}),start_at:b.DateTime({displayName:"Start Time",description:"The start date and time of the meeting. Must match an available slot on the scheduling link.",required:!0}),end_at:b.DateTime({displayName:"End Time",description:"The End date and time of the meeting",required:!0}),attendee_name:b.ShortText({displayName:"Attendee Name",description:"Full name of the person booking the meeting.",required:!0}),attendee_email:b.ShortText({displayName:"Attendee Email",description:"Email address of the person booking the meeting.",required:!0}),time_zone:b.ShortText({displayName:"Time Zone",description:"Attendee's local time zone in Olson format (e.g. America/New_York, Europe/London, Africa/Lagos).",required:!0}),phone_number:b.ShortText({displayName:"Phone Number",description:"Attendee's phone number in international format (e.g. +15555555555). Required only if the scheduling link asks for it.",required:!1}),custom_fields:b.DynamicProperties({auth:$,displayName:"Custom Fields",description:"Additional questions configured on the scheduling link (e.g. Company, Why are we meeting?). Filled in dynamically based on the selected link.",required:!1,refreshers:["link_id"],props:o(async({auth:e,link_id:t})=>{if(!e||!t)return{};try{let r=await Ws(E(e),t);return Ld(r)}catch{return{}}},"props")}),metadata:b.Object({displayName:"Metadata",description:"Custom key/value pairs to attach to the event. Useful for tracking the source flow or correlating with external systems.",required:!1})},async run(e){let t=E(e.auth),{link_id:r,start_at:n,end_at:i,attendee_name:u,attendee_email:c,time_zone:l,phone_number:f,custom_fields:y,metadata:x}=e.propsValue,T=await Ws(t,r),_=jd({linkFields:T,customFields:y}),s={start_at:n,end_at:i,display_name:u,email:c,time_zone:l};f&&(s.phone_number=f),_.length>0&&(s.fields=_),x&&Object.keys(x).length>0&&(s.metadata=x);let d=await B({token:t,method:"POST",path:`/links/${r}/events`,body:s});return ue(d.body)}});async function Ws(e,t){return(await B({token:e,method:"GET",path:`/links/${t}`})).body.fields??[]}o(Ws,"fetchLinkFields");function Ld(e){let t={};for(let r of e){if(Hd(r.type))continue;let n={displayName:r.label,required:r.is_required??!1},i=Fd(r);Bd(r.type)?t[r.id]=b.StaticMultiSelectDropdown({...n,options:{options:i}}):Zd(r.type)?t[r.id]=b.StaticDropdown({...n,options:{options:i}}):Vd(r.type)?t[r.id]=b.LongText(n):t[r.id]=b.ShortText(n)}return t}o(Ld,"buildCustomFieldProps");function jd({linkFields:e,customFields:t}){if(!t)return[];let r=[];for(let n of e){let i=t[n.id];if(i==null||i==="")continue;let u=Array.isArray(i)?i.join(Wd):String(i);r.push({id:n.id,label:n.label,type:n.type,value:u})}return r}o(jd,"serializeCustomFields");function Fd(e){return(e.options??e.choices??[]).map(r=>typeof r=="string"?{label:r,value:r}:{label:r.label??r.name??r.value??r.id??"",value:r.value??r.id??r.name??r.label??""})}o(Fd,"normalizeFieldOptions");function Bd(e){let t=e.toLowerCase();return t==="checkboxes"||t==="multi_select"||t==="checkbox_group"}o(Bd,"isMultiSelectFieldType");function Zd(e){let t=e.toLowerCase();return t==="select"||t==="select_menu"||t==="dropdown"||t==="radio"||t==="radio_buttons"||t==="single_select"}o(Zd,"isSingleSelectFieldType");function Vd(e){let t=e.toLowerCase();return t==="long_text"||t==="textarea"||t==="paragraph"}o(Vd,"isLongTextFieldType");function Hd(e){return e.toLowerCase()==="hidden"}o(Hd,"isHiddenFieldType");var Wd=", ";var Gs=H({auth:$,name:"find_events_by_email",displayName:"Find Events by Attendee Email",description:"Returns all events where the attendee's email matches the given address.",audience:"both",aiMetadata:{description:"Finds all SavvyCal events that have a given email among their attendees. Use to look up a specific person's bookings when you only know their email; optionally narrow with a start-date window to limit the scan. Match is case-insensitive on the attendee email. Read-only and idempotent.",idempotent:!0},props:{attendee_email:b.ShortText({displayName:"Attendee Email",description:"The email address of the attendee to search for.",required:!0}),start_after:b.DateTime({displayName:"Start After",description:"Only search events starting after this date. Use this to limit the search scope and improve performance.",required:!1}),start_before:b.DateTime({displayName:"Start Before",description:"Only search events starting before this date.",required:!1})},async run(e){let t=E(e.auth),{attendee_email:r,start_after:n,start_before:i}=e.propsValue,u={};n&&(u.start_after=n),i&&(u.start_before=i);let c=await fe({token:t,path:"/events",queryParams:u}),l=r.toLowerCase().trim();return c.filter(f=>f.attendees?.some(y=>y.email?.toLowerCase()===l)).map(ue)}});var Ks=H({auth:$,name:"list_scheduling_links",displayName:"List Scheduling Links",description:"Returns all scheduling links configured in your SavvyCal account.",audience:"both",aiMetadata:{description:"Lists the scheduling links in the account, optionally filtered to a single team (or to personal links). Use to discover available links and their ids before booking, querying slots, or managing a link. Read-only and idempotent.",idempotent:!0},props:{team_id:b.Dropdown({auth:$,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(E(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")})},async run(e){let t=await fe({token:E(e.auth),path:"/links"}),{team_id:r}=e.propsValue;return(r?r==="personal"?t.filter(i=>i.scope===null):t.filter(i=>i.scope?.id===r):t).map(Oe)}});var Js=H({auth:$,name:"get_scheduling_link",displayName:"Get Scheduling Link",description:"Retrieves the details of a specific scheduling link by its ID.",audience:"both",aiMetadata:{description:"Fetches the full configuration of a single SavvyCal scheduling link by its id, including its custom fields. Use to inspect a known link before booking or to read its settings; get the id from List Scheduling Links. Read-only and idempotent.",idempotent:!0},props:{team_id:b.Dropdown({auth:$,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(E(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:$,displayName:"Scheduling Link",description:"Select the scheduling link to retrieve.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(E(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},async run(e){let t=await B({token:E(e.auth),method:"GET",path:`/links/${e.propsValue.link_id}`});return Oe(t.body)}});var Xs=H({auth:$,name:"delete_scheduling_link",displayName:"Delete Scheduling Link",description:"Permanently deletes a scheduling link from your SavvyCal account.",audience:"both",aiMetadata:{description:"Permanently deletes a scheduling link by its id; this cannot be undone. Use only when a link should be fully removed. The first call deletes the link and subsequent calls for the same id will fail, so treat it as a destructive, non-idempotent mutation.",idempotent:!1},props:{team_id:b.Dropdown({auth:$,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(E(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:$,displayName:"Scheduling Link",description:"Select the scheduling link to delete. This action cannot be undone.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(E(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},async run(e){return await B({token:E(e.auth),method:"DELETE",path:`/links/${e.propsValue.link_id}`}),{success:!0,link_id:e.propsValue.link_id,message:"Scheduling link deleted successfully."}}});var Ys=H({auth:$,name:"duplicate_scheduling_link",displayName:"Duplicate Scheduling Link",description:"Creates a copy of an existing scheduling link.",audience:"both",aiMetadata:{description:"Creates a new scheduling link as a copy of an existing one, identified by the source link id. Use to clone a link's configuration as a starting point. Not idempotent \u2014 each call produces another distinct copy.",idempotent:!1},props:{team_id:b.Dropdown({auth:$,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(E(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:$,displayName:"Scheduling Link",description:"Select the scheduling link to duplicate.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(E(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},async run(e){let t=await B({token:E(e.auth),method:"POST",path:`/links/${e.propsValue.link_id}/duplicate`});return Oe(t.body)}});var Qs=H({auth:$,name:"toggle_scheduling_link",displayName:"Toggle Scheduling Link",description:"Switches a scheduling link between active and disabled states.",audience:"both",aiMetadata:{description:"Flips a scheduling link between active and disabled, identified by its link id. Use to enable or pause a link; note it toggles relative to the link's current state, so repeating the call alternates the state rather than converging \u2014 not idempotent.",idempotent:!1},props:{team_id:b.Dropdown({auth:$,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(E(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:$,displayName:"Scheduling Link",description:"Select the scheduling link to toggle.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(E(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},async run(e){let t=await B({token:E(e.auth),method:"POST",path:`/links/${e.propsValue.link_id}/toggle`});return Oe(t.body)}});var eu=H({auth:$,name:"get_link_slots",displayName:"Get Available Slots",description:"Returns available time slots for booking on a scheduling link. Useful for displaying availability or for picking a slot before calling Create Event.",audience:"both",aiMetadata:{description:"Returns the currently bookable time slots for a given scheduling link. Use to check availability or to pick a valid start/end time before calling Create Event. Requires the link id. Read-only and idempotent, though results reflect live availability and change over time.",idempotent:!0},props:{team_id:b.Dropdown({auth:$,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(E(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:$,displayName:"Scheduling Link",description:"Select the scheduling link to query slots for.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(E(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},async run(e){let t=await B({token:E(e.auth),method:"GET",path:`/links/${e.propsValue.link_id}/slots`});return(Array.isArray(t.body)?t.body:t.body.entries??[]).map(n=>({start_at:n.start_at,end_at:n.end_at,duration_minutes:n.duration,rank:n.rank}))}});var tu=H({auth:$,name:"list_workflows",displayName:"List Workflows",description:"Returns all workflows configured in your SavvyCal account.",audience:"both",aiMetadata:{description:"Lists all SavvyCal automation workflows in the account with their ids and names. Use to discover available workflows, typically to obtain a workflow id for Get Workflow Rules. Read-only and idempotent.",idempotent:!0},props:{},async run(e){return(await fe({token:E(e.auth),path:"/workflows"})).map(r=>({id:r.id,name:r.name,active:r.active??null,team_id:r.scope?.id??null,team_name:r.scope?.name??null,created_at:r.created_at??null,updated_at:r.updated_at??null}))}});var ru=H({auth:$,name:"get_workflow_rules",displayName:"Get Workflow Rules",description:"Returns the rules configured for a specific workflow.",audience:"both",aiMetadata:{description:"Returns the trigger/action rules configured on a specific SavvyCal workflow, identified by its workflow id. Use to inspect how a workflow is set up; get the id from List Workflows. Read-only and idempotent.",idempotent:!0},props:{workflow_id:b.Dropdown({auth:$,displayName:"Workflow",description:"Select the workflow whose rules you want to retrieve.",refreshers:[],required:!0,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await Fs(E(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load workflows."}}},"options")})},async run(e){let t=await B({token:E(e.auth),method:"GET",path:`/workflows/${e.propsValue.workflow_id}/rules`}),r=Array.isArray(t.body)?t.body:t.body.entries??[];return{workflow_id:e.propsValue.workflow_id,rules:r}}});var nu=[{label:"Event Created",value:"event.created"},{label:"Event Requested",value:"event.requested"},{label:"Event Approved",value:"event.approved"},{label:"Event Declined",value:"event.declined"},{label:"Event Rescheduled",value:"event.rescheduled"},{label:"Event Changed",value:"event.changed"},{label:"Event Canceled",value:"event.canceled"},{label:"Checkout Pending",value:"event.checkout.pending"},{label:"Checkout Expired",value:"event.checkout.expired"},{label:"Checkout Completed",value:"event.checkout.completed"},{label:"Attendee Added",value:"event.attendee.added"},{label:"Attendee Canceled",value:"event.attendee.canceled"},{label:"Attendee Rescheduled",value:"event.attendee.rescheduled"}],qd=nu.map(e=>e.value),ou=Ke({auth:$,name:"new_event",displayName:"New Event",description:"Triggers when a SavvyCal event occurs. Select one or more event types, or leave empty to trigger on all types.",aiMetadata:{description:"Fires when a SavvyCal booking-level event occurs via webhook \u2014 covering created, requested, approved, declined, rescheduled, changed, canceled, checkout state changes, and attendee add/cancel/reschedule. Can be scoped to specific event types and/or scheduling links, or left open to fire on every booking event. Each firing represents one such event with the affected booking's details."},props:{event_types:b.StaticMultiSelectDropdown({displayName:"Event Types",description:"Select which event types to trigger on. Leave empty to trigger on all event types.",required:!1,options:{options:nu}}),team_id:b.Dropdown({auth:$,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(E(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_ids:b.MultiSelectDropdown({auth:$,displayName:"Scheduling Links",description:"Only trigger for events on the selected scheduling links. Leave empty to trigger for all links.",refreshers:["team_id"],required:!1,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(E(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},sampleData:{event_type:"event.created",id:"evt_abc123",uuid:"550e8400-e29b-41d4-a716-446655440000",summary:"30 Minute Meeting with Jane Doe",description:null,state:"confirmed",start_at:"2024-06-01T10:00:00Z",end_at:"2024-06-01T10:30:00Z",duration_minutes:30,url:"https://savvycal.com/events/evt_abc123",location:null,is_group_session:!1,created_at:"2024-05-20T08:00:00Z",canceled_at:null,cancel_reason:null,rescheduled_at:null,reschedule_reason:null,original_start_at:null,original_end_at:null,scheduling_link_id:"lnk_xyz789",scheduling_link_name:"30-Minute Meeting",scheduling_link_slug:"30min",attendee_display_name:"Jane Doe",attendee_first_name:"Jane",attendee_last_name:"Doe",attendee_email:"jane@example.com",attendee_phone:null,attendee_time_zone:"America/Chicago",organizer_display_name:"John Smith",organizer_first_name:"John",organizer_last_name:"Smith",organizer_email:"john@company.com",conferencing_type:"zoom",conferencing_join_url:"https://zoom.us/j/123456789",conferencing_meeting_id:"123456789",payment_state:null,payment_amount_total_cents:null},type:"WEBHOOK",async onEnable(e){let t=await B({token:E(e.auth),method:"POST",path:"/webhooks",body:{url:e.webhookUrl}});await e.store.put("webhookId",t.body.id),await e.store.put("webhookSecret",t.body.secret)},async onDisable(e){let t=await e.store.get("webhookId");t&&await B({token:E(e.auth),method:"DELETE",path:`/webhooks/${t}`})},async run(e){let t=await e.store.get("webhookSecret"),r=e.payload.headers["x-savvycal-signature"];if(t&&(!r||!rt(t,r,e.payload.rawBody)))return[];let n=e.payload.body;if(!n?.payload)return[];if(!qd.includes(n.type))return[];let i=e.propsValue.event_types;if(i&&i.length>0&&!i.includes(n.type))return[];let u=e.propsValue.link_ids,c=n.payload?.link?.id;if(u&&u.length>0&&c!=null&&!u.includes(c))return[];let l=ue(n.payload);return[{event_type:n.type,...l}]},async test(e){let t=e.propsValue.event_types,r=e.propsValue.link_ids,n={limit:"10"};r&&r.length===1&&(n.link_id=r[0]);let i=await B({token:E(e.auth),method:"GET",path:"/events",queryParams:n}),u=r&&r.length>1?i.body.entries.filter(l=>r.includes(l.link?.id??"")):i.body.entries,c=t?.[0]??"event.created";return u.slice(0,5).map(l=>({event_type:c,...ue(l)}))}});var iu=[{label:"Poll Response Created",value:"poll.response.created"},{label:"Poll Response Updated",value:"poll.response.updated"}],au={event_type:"poll.response.created",id:"pr_abc123",respondent_email:"jane@example.com"},su=Ke({auth:$,name:"new_poll_response",displayName:"New Poll Response",description:"Triggers when a poll response is created or updated in SavvyCal.",aiMetadata:{description:"Fires via webhook when a respondent submits or updates a response to a SavvyCal scheduling poll. Can be scoped to created-only, updated-only, or both response types. Each firing represents one poll response event."},props:{event_types:b.StaticMultiSelectDropdown({displayName:"Poll Response Types",description:"Select which poll response types to trigger on. Leave empty to trigger on all poll response types.",required:!1,options:{options:iu}})},sampleData:au,type:"WEBHOOK",async onEnable(e){let t=await B({token:E(e.auth),method:"POST",path:"/webhooks",body:{url:e.webhookUrl}});await e.store.put("webhookId",t.body.id),await e.store.put("webhookSecret",t.body.secret)},async onDisable(e){let t=await e.store.get("webhookId");t&&await B({token:E(e.auth),method:"DELETE",path:`/webhooks/${t}`})},async run(e){let t=await e.store.get("webhookSecret"),r=e.payload.headers["x-savvycal-signature"];if(t&&(!r||!rt(t,r,e.payload.rawBody)))return[];let n=e.payload.body;if(!n?.payload)return[];if(!iu.some(u=>u.value===n.type))return[];let i=e.propsValue.event_types;return i&&i.length>0&&!i.includes(n.type)?[]:[{event_type:n.type,...n.payload}]},async test(e){return[au]}});var uu={event_type:"workflow.action.triggered",id:"wf_abc123",action:"send_email"},cu=Ke({auth:$,name:"workflow_action_triggered",displayName:"Workflow Action Triggered",description:"Triggers when a workflow action is triggered in SavvyCal.",aiMetadata:{description:"Fires via webhook when a SavvyCal automation workflow runs one of its configured actions. Each firing represents a single workflow action execution with its associated payload."},props:{},sampleData:uu,type:"WEBHOOK",async onEnable(e){let t=await B({token:E(e.auth),method:"POST",path:"/webhooks",body:{url:e.webhookUrl}});await e.store.put("webhookId",t.body.id),await e.store.put("webhookSecret",t.body.secret)},async onDisable(e){let t=await e.store.get("webhookId");t&&await B({token:E(e.auth),method:"DELETE",path:`/webhooks/${t}`})},async run(e){let t=await e.store.get("webhookSecret"),r=e.payload.headers["x-savvycal-signature"];if(t&&(!r||!rt(t,r,e.payload.rawBody)))return[];let n=e.payload.body;return!n?.payload||n.type!=="workflow.action.triggered"?[]:[{event_type:n.type,...n.payload}]},async test(e){return[uu]}});var Gd=Si({displayName:"SavvyCal",description:"Scheduling tool that lets invitees overlay their calendar when picking a time.",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/savvycal.png",categories:["PRODUCTIVITY"],auth:$,authors:["bst1n","sanket-a11y","onyedikachi-david"],actions:[qs,Hs,Vs,Zs,Gs,Ks,Js,eu,Qs,Ys,Xs,tu,ru,Bs,js({baseUrl:o(()=>kt,"baseUrl"),auth:$,authMapping:o(async e=>({Authorization:`Bearer ${E(e)}`}),"authMapping")})],triggers:[ou,su,cu]});0&&(module.exports={savvyCal});
10
+ **Note:** Keep this token secret \u2014 it gives full access to your SavvyCal account.`,required:!0,props:{token:St.SecretText({displayName:"Personal Access Token",description:"Your SavvyCal Personal Access Token (Private Key).",required:!0})},validate:o(async({auth:e})=>{try{return await Xe.sendRequest({method:"GET",url:`${Ot}/me`,authentication:{type:"BEARER_TOKEN",token:e.token}}),{valid:!0}}catch{return{valid:!1,error:"Invalid token. Please check your Personal Access Token and try again."}}},"validate")})];function I(e){return e.type==="CUSTOM_AUTH"?e.props.token:e.access_token}o(I,"getToken");var ru=G({auth:A,name:"get_current_user",displayName:"Get Current User",description:"Retrieves the profile of the currently authenticated SavvyCal user.",audience:"both",aiMetadata:{description:"Returns the profile of the SavvyCal account the connection is authenticated as (id, name, email, slug, time zone). Use to identify the current user or fetch their default time zone. Read-only and idempotent.",idempotent:!0},props:{},async run(e){let r=(await B({token:I(e.auth),method:"GET",path:"/me"})).body;return{id:r.id,name:r.name,email:r.email,slug:r.slug??null,time_zone:r.time_zone??null,created_at:r.created_at,updated_at:r.updated_at??null}}});var nu=G({auth:A,name:"list_events",displayName:"List Events",description:"Returns a list of scheduled meetings from your SavvyCal account.",audience:"both",aiMetadata:{description:"Lists SavvyCal events across the account, optionally filtered by state(s), start date window, team, or specific scheduling links. Use to browse or find bookings when you do not have an event id; leave all filters empty to return every event. Read-only and idempotent.",idempotent:!0},props:{states:b.StaticMultiSelectDropdown({displayName:"State",description:"Filter events by their current status. Leave empty to return all statuses.",required:!1,options:{options:[{label:"Confirmed",value:"confirmed"},{label:"Canceled",value:"canceled"},{label:"Awaiting Reschedule",value:"awaiting_reschedule"},{label:"Awaiting Checkout",value:"awaiting_checkout"},{label:"Checkout Expired",value:"checkout_expired"},{label:"Awaiting Approval",value:"awaiting_approval"},{label:"Declined",value:"declined"},{label:"Tentative",value:"tentative"}]}}),start_after:b.DateTime({displayName:"Start After",description:"Only return events that start after this date and time.",required:!1}),start_before:b.DateTime({displayName:"Start Before",description:"Only return events that start before this date and time.",required:!1}),team_id:b.Dropdown({auth:A,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(I(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_ids:b.MultiSelectDropdown({auth:A,displayName:"Scheduling Links",description:"Only return events booked through the selected scheduling links. Leave empty for all links.",refreshers:["team_id"],required:!1,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(I(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")}),limit:b.Number({displayName:"Maximum Results",description:"Maximum number of events to return. Leave empty to return all matching events.",required:!1})},async run(e){let t=I(e.auth),{states:r,start_after:n,start_before:i,link_ids:u,limit:c}=e.propsValue,l=r,f=u,y=f&&f.length>0,_=y&&f.length>1||l&&l.length>1,T={};if(n&&(T.start_after=n),i&&(T.start_before=i),l&&l.length===1&&(T.state=l[0]),y&&f.length===1&&(T.link_id=f[0]),c&&_){let s=null,d=[];do{let g={limit:"100",...T};s&&(g.after=s);let m=await B({token:t,method:"GET",path:"/events",queryParams:g});for(let v of m.body.entries){let P=!l||l.length===0||l.includes(v.state),j=!y||f.includes(v.link?.id??"");P&&j&&d.push(v)}s=d.length>=c?null:m.body.metadata.after}while(s);return d.slice(0,c).map(ce)}return c?(T.limit=String(c),(await B({token:t,method:"GET",path:"/events",queryParams:T})).body.entries.map(ce)):(await fe({token:t,path:"/events",queryParams:T})).filter(s=>!l||l.length===0||l.includes(s.state)).filter(s=>!y||f.includes(s.link?.id??"")).map(ce)}});var ou=G({auth:A,name:"get_event",displayName:"Get Event",description:"Retrieves the details of a specific scheduled meeting by its ID.",audience:"both",aiMetadata:{description:"Fetches the full details of a single SavvyCal event by its event id. Use to look up a known booking (attendee, times, state, link); obtain the id from a trigger, List Events, or the event URL. Read-only and idempotent.",idempotent:!0},props:{event_id:b.ShortText({displayName:"Event ID",description:"The unique ID of the event. You can find this in the event URL in SavvyCal, or from the output of a trigger or List Events action.",required:!0})},async run(e){let t=await B({token:I(e.auth),method:"GET",path:`/events/${e.propsValue.event_id}`});return ce(t.body)}});var iu=G({auth:A,name:"cancel_event",displayName:"Cancel Event",description:"Cancels a scheduled meeting in SavvyCal.",audience:"both",aiMetadata:{description:"Cancels a scheduled SavvyCal meeting identified by its event id. Use when a booking needs to be called off; obtain the event id from a trigger, List Events, or Get Event. Cancelling an already-cancelled event has no further effect, but this mutates state and is not a read.",idempotent:!1},props:{event_id:b.ShortText({displayName:"Event ID",description:"The unique ID of the event to cancel. You can find this from the output of a trigger or the List Events / Get Event actions.",required:!0})},async run(e){return await B({token:I(e.auth),method:"POST",path:`/events/${e.propsValue.event_id}/cancel`}),{success:!0,event_id:e.propsValue.event_id,message:"Event cancelled successfully."}}});var su=G({auth:A,name:"create_event",displayName:"Create Event",description:"Books a meeting on a scheduling link at a specific time slot.",audience:"both",aiMetadata:{description:"Books a new SavvyCal meeting on a given scheduling link for an attendee at a specific start/end time. Use to schedule a booking on the attendee's behalf; the chosen time must match an available slot on the link (call Get Available Slots first if unsure). Requires the link id, attendee name/email, and time zone in Olson format. Not idempotent \u2014 each call creates a separate booking.",idempotent:!1},props:{team_id:b.Dropdown({auth:A,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(I(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:A,displayName:"Scheduling Link",description:"Select the scheduling link to book a meeting on.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(I(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links. Check your connection."}}},"options")}),start_at:b.DateTime({displayName:"Start Time",description:"The start date and time of the meeting. Must match an available slot on the scheduling link.",required:!0}),end_at:b.DateTime({displayName:"End Time",description:"The End date and time of the meeting",required:!0}),attendee_name:b.ShortText({displayName:"Attendee Name",description:"Full name of the person booking the meeting.",required:!0}),attendee_email:b.ShortText({displayName:"Attendee Email",description:"Email address of the person booking the meeting.",required:!0}),time_zone:b.ShortText({displayName:"Time Zone",description:"Attendee's local time zone in Olson format (e.g. America/New_York, Europe/London, Africa/Lagos).",required:!0}),phone_number:b.ShortText({displayName:"Phone Number",description:"Attendee's phone number in international format (e.g. +15555555555). Required only if the scheduling link asks for it.",required:!1}),custom_fields:b.DynamicProperties({auth:A,displayName:"Custom Fields",description:"Additional questions configured on the scheduling link (e.g. Company, Why are we meeting?). Filled in dynamically based on the selected link.",required:!1,refreshers:["link_id"],props:o(async({auth:e,link_id:t})=>{if(!e||!t)return{};try{let r=await au(I(e),t);return am(r)}catch{return{}}},"props")}),metadata:b.Object({displayName:"Metadata",description:"Custom key/value pairs to attach to the event. Useful for tracking the source flow or correlating with external systems.",required:!1})},async run(e){let t=I(e.auth),{link_id:r,start_at:n,end_at:i,attendee_name:u,attendee_email:c,time_zone:l,phone_number:f,custom_fields:y,metadata:_}=e.propsValue,T=await au(t,r),x=sm({linkFields:T,customFields:y}),s={start_at:n,end_at:i,display_name:u,email:c,time_zone:l};f&&(s.phone_number=f),x.length>0&&(s.fields=x),_&&Object.keys(_).length>0&&(s.metadata=_);let d=await B({token:t,method:"POST",path:`/links/${r}/events`,body:s});return ce(d.body)}});async function au(e,t){return(await B({token:e,method:"GET",path:`/links/${t}`})).body.fields??[]}o(au,"fetchLinkFields");function am(e){let t={};for(let r of e){if(dm(r.type))continue;let n={displayName:r.label,required:r.is_required??!1},i=um(r);cm(r.type)?t[r.id]=b.StaticMultiSelectDropdown({...n,options:{options:i}}):lm(r.type)?t[r.id]=b.StaticDropdown({...n,options:{options:i}}):pm(r.type)?t[r.id]=b.LongText(n):t[r.id]=b.ShortText(n)}return t}o(am,"buildCustomFieldProps");function sm({linkFields:e,customFields:t}){if(!t)return[];let r=[];for(let n of e){let i=t[n.id];if(i==null||i==="")continue;let u=Array.isArray(i)?i.join(mm):String(i);r.push({id:n.id,label:n.label,type:n.type,value:u})}return r}o(sm,"serializeCustomFields");function um(e){return(e.options??e.choices??[]).map(r=>typeof r=="string"?{label:r,value:r}:{label:r.label??r.name??r.value??r.id??"",value:r.value??r.id??r.name??r.label??""})}o(um,"normalizeFieldOptions");function cm(e){let t=e.toLowerCase();return t==="checkboxes"||t==="multi_select"||t==="checkbox_group"}o(cm,"isMultiSelectFieldType");function lm(e){let t=e.toLowerCase();return t==="select"||t==="select_menu"||t==="dropdown"||t==="radio"||t==="radio_buttons"||t==="single_select"}o(lm,"isSingleSelectFieldType");function pm(e){let t=e.toLowerCase();return t==="long_text"||t==="textarea"||t==="paragraph"}o(pm,"isLongTextFieldType");function dm(e){return e.toLowerCase()==="hidden"}o(dm,"isHiddenFieldType");var mm=", ";var uu=G({auth:A,name:"find_events_by_email",displayName:"Find Events by Attendee Email",description:"Returns all events where the attendee's email matches the given address.",audience:"both",aiMetadata:{description:"Finds all SavvyCal events that have a given email among their attendees. Use to look up a specific person's bookings when you only know their email; optionally narrow with a start-date window to limit the scan. Match is case-insensitive on the attendee email. Read-only and idempotent.",idempotent:!0},props:{attendee_email:b.ShortText({displayName:"Attendee Email",description:"The email address of the attendee to search for.",required:!0}),start_after:b.DateTime({displayName:"Start After",description:"Only search events starting after this date. Use this to limit the search scope and improve performance.",required:!1}),start_before:b.DateTime({displayName:"Start Before",description:"Only search events starting before this date.",required:!1})},async run(e){let t=I(e.auth),{attendee_email:r,start_after:n,start_before:i}=e.propsValue,u={};n&&(u.start_after=n),i&&(u.start_before=i);let c=await fe({token:t,path:"/events",queryParams:u}),l=r.toLowerCase().trim();return c.filter(f=>f.attendees?.some(y=>y.email?.toLowerCase()===l)).map(ce)}});var cu=G({auth:A,name:"list_scheduling_links",displayName:"List Scheduling Links",description:"Returns all scheduling links configured in your SavvyCal account.",audience:"both",aiMetadata:{description:"Lists the scheduling links in the account, optionally filtered to a single team (or to personal links). Use to discover available links and their ids before booking, querying slots, or managing a link. Read-only and idempotent.",idempotent:!0},props:{team_id:b.Dropdown({auth:A,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(I(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")})},async run(e){let t=await fe({token:I(e.auth),path:"/links"}),{team_id:r}=e.propsValue;return(r?r==="personal"?t.filter(i=>i.scope===null):t.filter(i=>i.scope?.id===r):t).map(De)}});var lu=G({auth:A,name:"get_scheduling_link",displayName:"Get Scheduling Link",description:"Retrieves the details of a specific scheduling link by its ID.",audience:"both",aiMetadata:{description:"Fetches the full configuration of a single SavvyCal scheduling link by its id, including its custom fields. Use to inspect a known link before booking or to read its settings; get the id from List Scheduling Links. Read-only and idempotent.",idempotent:!0},props:{team_id:b.Dropdown({auth:A,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(I(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:A,displayName:"Scheduling Link",description:"Select the scheduling link to retrieve.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(I(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},async run(e){let t=await B({token:I(e.auth),method:"GET",path:`/links/${e.propsValue.link_id}`});return De(t.body)}});var pu=G({auth:A,name:"delete_scheduling_link",displayName:"Delete Scheduling Link",description:"Permanently deletes a scheduling link from your SavvyCal account.",audience:"both",aiMetadata:{description:"Permanently deletes a scheduling link by its id; this cannot be undone. Use only when a link should be fully removed. The first call deletes the link and subsequent calls for the same id will fail, so treat it as a destructive, non-idempotent mutation.",idempotent:!1},props:{team_id:b.Dropdown({auth:A,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(I(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:A,displayName:"Scheduling Link",description:"Select the scheduling link to delete. This action cannot be undone.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(I(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},async run(e){return await B({token:I(e.auth),method:"DELETE",path:`/links/${e.propsValue.link_id}`}),{success:!0,link_id:e.propsValue.link_id,message:"Scheduling link deleted successfully."}}});var du=G({auth:A,name:"duplicate_scheduling_link",displayName:"Duplicate Scheduling Link",description:"Creates a copy of an existing scheduling link.",audience:"both",aiMetadata:{description:"Creates a new scheduling link as a copy of an existing one, identified by the source link id. Use to clone a link's configuration as a starting point. Not idempotent \u2014 each call produces another distinct copy.",idempotent:!1},props:{team_id:b.Dropdown({auth:A,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(I(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:A,displayName:"Scheduling Link",description:"Select the scheduling link to duplicate.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(I(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},async run(e){let t=await B({token:I(e.auth),method:"POST",path:`/links/${e.propsValue.link_id}/duplicate`});return De(t.body)}});var mu=G({auth:A,name:"toggle_scheduling_link",displayName:"Toggle Scheduling Link",description:"Switches a scheduling link between active and disabled states.",audience:"both",aiMetadata:{description:"Flips a scheduling link between active and disabled, identified by its link id. Use to enable or pause a link; note it toggles relative to the link's current state, so repeating the call alternates the state rather than converging \u2014 not idempotent.",idempotent:!1},props:{team_id:b.Dropdown({auth:A,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(I(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:A,displayName:"Scheduling Link",description:"Select the scheduling link to toggle.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(I(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},async run(e){let t=await B({token:I(e.auth),method:"POST",path:`/links/${e.propsValue.link_id}/toggle`});return De(t.body)}});var fu=G({auth:A,name:"get_link_slots",displayName:"Get Available Slots",description:"Returns available time slots for booking on a scheduling link. Useful for displaying availability or for picking a slot before calling Create Event.",audience:"both",aiMetadata:{description:"Returns the currently bookable time slots for a given scheduling link. Use to check availability or to pick a valid start/end time before calling Create Event. Requires the link id. Read-only and idempotent, though results reflect live availability and change over time.",idempotent:!0},props:{team_id:b.Dropdown({auth:A,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(I(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_id:b.Dropdown({auth:A,displayName:"Scheduling Link",description:"Select the scheduling link to query slots for.",refreshers:["team_id"],required:!0,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(I(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},async run(e){let t=await B({token:I(e.auth),method:"GET",path:`/links/${e.propsValue.link_id}/slots`});return(Array.isArray(t.body)?t.body:t.body.entries??[]).map(n=>({start_at:n.start_at,end_at:n.end_at,duration_minutes:n.duration,rank:n.rank}))}});var gu=G({auth:A,name:"list_workflows",displayName:"List Workflows",description:"Returns all workflows configured in your SavvyCal account.",audience:"both",aiMetadata:{description:"Lists all SavvyCal automation workflows in the account with their ids and names. Use to discover available workflows, typically to obtain a workflow id for Get Workflow Rules. Read-only and idempotent.",idempotent:!0},props:{},async run(e){return(await fe({token:I(e.auth),path:"/workflows"})).map(r=>({id:r.id,name:r.name,active:r.active??null,team_id:r.scope?.id??null,team_name:r.scope?.name??null,created_at:r.created_at??null,updated_at:r.updated_at??null}))}});var yu=G({auth:A,name:"get_workflow_rules",displayName:"Get Workflow Rules",description:"Returns the rules configured for a specific workflow.",audience:"both",aiMetadata:{description:"Returns the trigger/action rules configured on a specific SavvyCal workflow, identified by its workflow id. Use to inspect how a workflow is set up; get the id from List Workflows. Read-only and idempotent.",idempotent:!0},props:{workflow_id:b.Dropdown({auth:A,displayName:"Workflow",description:"Select the workflow whose rules you want to retrieve.",refreshers:[],required:!0,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await tu(I(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load workflows."}}},"options")})},async run(e){let t=await B({token:I(e.auth),method:"GET",path:`/workflows/${e.propsValue.workflow_id}/rules`}),r=Array.isArray(t.body)?t.body:t.body.entries??[];return{workflow_id:e.propsValue.workflow_id,rules:r}}});var hu=[{label:"Event Created",value:"event.created"},{label:"Event Requested",value:"event.requested"},{label:"Event Approved",value:"event.approved"},{label:"Event Declined",value:"event.declined"},{label:"Event Rescheduled",value:"event.rescheduled"},{label:"Event Changed",value:"event.changed"},{label:"Event Canceled",value:"event.canceled"},{label:"Checkout Pending",value:"event.checkout.pending"},{label:"Checkout Expired",value:"event.checkout.expired"},{label:"Checkout Completed",value:"event.checkout.completed"},{label:"Attendee Added",value:"event.attendee.added"},{label:"Attendee Canceled",value:"event.attendee.canceled"},{label:"Attendee Rescheduled",value:"event.attendee.rescheduled"}],fm=hu.map(e=>e.value),vu=Je({auth:A,name:"new_event",displayName:"New Event",description:"Triggers when a SavvyCal event occurs. Select one or more event types, or leave empty to trigger on all types.",aiMetadata:{description:"Fires when a SavvyCal booking-level event occurs via webhook \u2014 covering created, requested, approved, declined, rescheduled, changed, canceled, checkout state changes, and attendee add/cancel/reschedule. Can be scoped to specific event types and/or scheduling links, or left open to fire on every booking event. Each firing represents one such event with the affected booking's details."},props:{event_types:b.StaticMultiSelectDropdown({displayName:"Event Types",description:"Select which event types to trigger on. Leave empty to trigger on all event types.",required:!1,options:{options:hu}}),team_id:b.Dropdown({auth:A,displayName:"Team",description:"Filter scheduling links by team. Leave empty to show all teams.",refreshers:[],required:!1,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await te(I(e))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load teams."}}},"options")}),link_ids:b.MultiSelectDropdown({auth:A,displayName:"Scheduling Links",description:"Only trigger for events on the selected scheduling links. Leave empty to trigger for all links.",refreshers:["team_id"],required:!1,options:o(async({auth:e,team_id:t})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:await re(I(e),t)}}catch{return{disabled:!0,options:[],placeholder:"Failed to load scheduling links."}}},"options")})},sampleData:{event_type:"event.created",id:"evt_abc123",uuid:"550e8400-e29b-41d4-a716-446655440000",summary:"30 Minute Meeting with Jane Doe",description:null,state:"confirmed",start_at:"2024-06-01T10:00:00Z",end_at:"2024-06-01T10:30:00Z",duration_minutes:30,url:"https://savvycal.com/events/evt_abc123",location:null,is_group_session:!1,created_at:"2024-05-20T08:00:00Z",canceled_at:null,cancel_reason:null,rescheduled_at:null,reschedule_reason:null,original_start_at:null,original_end_at:null,scheduling_link_id:"lnk_xyz789",scheduling_link_name:"30-Minute Meeting",scheduling_link_slug:"30min",attendee_display_name:"Jane Doe",attendee_first_name:"Jane",attendee_last_name:"Doe",attendee_email:"jane@example.com",attendee_phone:null,attendee_time_zone:"America/Chicago",organizer_display_name:"John Smith",organizer_first_name:"John",organizer_last_name:"Smith",organizer_email:"john@company.com",conferencing_type:"zoom",conferencing_join_url:"https://zoom.us/j/123456789",conferencing_meeting_id:"123456789",payment_state:null,payment_amount_total_cents:null},type:"WEBHOOK",async onEnable(e){let t=await B({token:I(e.auth),method:"POST",path:"/webhooks",body:{url:e.webhookUrl}});await e.store.put("webhookId",t.body.id),await e.store.put("webhookSecret",t.body.secret)},async onDisable(e){let t=await e.store.get("webhookId");t&&await B({token:I(e.auth),method:"DELETE",path:`/webhooks/${t}`})},async run(e){let t=await e.store.get("webhookSecret"),r=e.payload.headers["x-savvycal-signature"];if(t&&(!r||!nt(t,r,e.payload.rawBody)))return[];let n=e.payload.body;if(!n?.payload)return[];if(!fm.includes(n.type))return[];let i=e.propsValue.event_types;if(i&&i.length>0&&!i.includes(n.type))return[];let u=e.propsValue.link_ids,c=n.payload?.link?.id;if(u&&u.length>0&&c!=null&&!u.includes(c))return[];let l=ce(n.payload);return[{event_type:n.type,...l}]},async test(e){let t=e.propsValue.event_types,r=e.propsValue.link_ids,n={limit:"10"};r&&r.length===1&&(n.link_id=r[0]);let i=await B({token:I(e.auth),method:"GET",path:"/events",queryParams:n}),u=r&&r.length>1?i.body.entries.filter(l=>r.includes(l.link?.id??"")):i.body.entries,c=t?.[0]??"event.created";return u.slice(0,5).map(l=>({event_type:c,...ce(l)}))}});var _u=[{label:"Poll Response Created",value:"poll.response.created"},{label:"Poll Response Updated",value:"poll.response.updated"}],xu={event_type:"poll.response.created",id:"pr_abc123",respondent_email:"jane@example.com"},Pu=Je({auth:A,name:"new_poll_response",displayName:"New Poll Response",description:"Triggers when a poll response is created or updated in SavvyCal.",aiMetadata:{description:"Fires via webhook when a respondent submits or updates a response to a SavvyCal scheduling poll. Can be scoped to created-only, updated-only, or both response types. Each firing represents one poll response event."},props:{event_types:b.StaticMultiSelectDropdown({displayName:"Poll Response Types",description:"Select which poll response types to trigger on. Leave empty to trigger on all poll response types.",required:!1,options:{options:_u}})},sampleData:xu,type:"WEBHOOK",async onEnable(e){let t=await B({token:I(e.auth),method:"POST",path:"/webhooks",body:{url:e.webhookUrl}});await e.store.put("webhookId",t.body.id),await e.store.put("webhookSecret",t.body.secret)},async onDisable(e){let t=await e.store.get("webhookId");t&&await B({token:I(e.auth),method:"DELETE",path:`/webhooks/${t}`})},async run(e){let t=await e.store.get("webhookSecret"),r=e.payload.headers["x-savvycal-signature"];if(t&&(!r||!nt(t,r,e.payload.rawBody)))return[];let n=e.payload.body;if(!n?.payload)return[];if(!_u.some(u=>u.value===n.type))return[];let i=e.propsValue.event_types;return i&&i.length>0&&!i.includes(n.type)?[]:[{event_type:n.type,...n.payload}]},async test(e){return[xu]}});var bu={event_type:"workflow.action.triggered",id:"wf_abc123",action:"send_email"},Tu=Je({auth:A,name:"workflow_action_triggered",displayName:"Workflow Action Triggered",description:"Triggers when a workflow action is triggered in SavvyCal.",aiMetadata:{description:"Fires via webhook when a SavvyCal automation workflow runs one of its configured actions. Each firing represents a single workflow action execution with its associated payload."},props:{},sampleData:bu,type:"WEBHOOK",async onEnable(e){let t=await B({token:I(e.auth),method:"POST",path:"/webhooks",body:{url:e.webhookUrl}});await e.store.put("webhookId",t.body.id),await e.store.put("webhookSecret",t.body.secret)},async onDisable(e){let t=await e.store.get("webhookId");t&&await B({token:I(e.auth),method:"DELETE",path:`/webhooks/${t}`})},async run(e){let t=await e.store.get("webhookSecret"),r=e.payload.headers["x-savvycal-signature"];if(t&&(!r||!nt(t,r,e.payload.rawBody)))return[];let n=e.payload.body;return!n?.payload||n.type!=="workflow.action.triggered"?[]:[{event_type:n.type,...n.payload}]},async test(e){return[bu]}});var gm=Mi({displayName:"SavvyCal",description:"Scheduling tool that lets invitees overlay their calendar when picking a time.",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/savvycal.png",categories:["PRODUCTIVITY"],auth:A,authors:["bst1n","sanket-a11y","onyedikachi-david"],actions:[su,iu,ou,nu,uu,cu,lu,fu,mu,du,pu,gu,yu,ru,eu({baseUrl:o(()=>Ot,"baseUrl"),auth:A,authMapping:o(async e=>({Authorization:`Bearer ${I(e)}`}),"authMapping")})],triggers:[vu,Pu,Tu]});0&&(module.exports={savvyCal});
11
11
  /*! Bundled license information:
12
12
 
13
13
  mime-types/index.js: