@activepieces/piece-twilio 0.4.7 → 0.4.9

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 +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/piece-twilio",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "main": "./src/index.js",
5
5
  "dependencies": {},
6
6
  "files": [
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";var Js=Object.create;var tt=Object.defineProperty;var Ys=Object.getOwnPropertyDescriptor;var Qs=Object.getOwnPropertyNames;var eu=Object.getPrototypeOf,tu=Object.prototype.hasOwnProperty;var i=(e,t)=>tt(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_n=(e,t)=>{for(var r in t)tt(e,r,{get:t[r],enumerable:!0})},Pn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qs(t))!tu.call(e,o)&&o!==r&&tt(e,o,{get:()=>t[o],enumerable:!(n=Ys(t,o))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?Js(eu(e)):{},Pn(t||!e||!e.__esModule?tt(r,"default",{value:e,enumerable:!0}):r,e)),ru=e=>Pn(tt({},"__esModule",{value:!0}),e);var jo=E((Mo,Zt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function m(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let y=0,f=-1,_=(u.match(l.zoneIndex)||[])[0],P,j;for(_&&(_=_.substring(1),u=u.replace(/%.+$/,""));(f=u.indexOf(":",f+1))>=0;)y++;if(u.substr(0,2)==="::"&&y--,u.substr(-2,2)==="::"&&y--,y>d)return null;for(j=d-y,P=":";j--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=function(){let ne=u.split(":"),ce=[];for(let et=0;et<ne.length;et++)ce.push(parseInt(ne[et],16));return ce}(),{parts:d,zoneId:_}}i(m,"expandIPv6");function g(u,d,y,f){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let _=0,P;for(;f>0;){if(P=y-f,P<0&&(P=0),u[_]>>P!==d[_]>>P)return!1;f-=y,_+=1}return!0}i(g,"matchCIDR");function h(u){if(o.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}i(h,"parseIntAuto");function b(u,d){for(;u.length<d;)u=`0${u}`;return u}i(b,"padPart");let x={};x.IPv4=function(){function u(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<d.length;y++)if(f=d[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return i(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},_,P,j;for(_=3;_>=0;_-=1)if(P=this.octets[_],P in f){if(j=f[P],y&&j!==0)return null;j!==8&&(y=!0),d+=j}else return null;return 32-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u}(),x.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<4;)_.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(u){return this.parser(u)!==null},x.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(u){return!!(x.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(u)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(u){let d,y,f,_,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],y=0;y<4;)_.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(u){let d=this.parser(u);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(u){let d;if(d=u.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let f=[this.parse(d[1]),y];return Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(u){let d,y,f;if(d=u.match(r.fourOctet))return function(){let _=d.slice(1,6),P=[];for(let j=0;j<_.length;j++)y=_[j],P.push(h(y));return P}();if(d=u.match(r.longValue)){if(f=h(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return function(){let _=[],P;for(P=0;P<=24;P+=8)_.push(f>>P&255);return _}().reverse()}else return(d=u.match(r.twoOctet))?function(){let _=d.slice(1,4),P=[];if(f=h(_[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(_[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P}():(d=u.match(r.threeOctet))?function(){let _=d.slice(1,5),P=[];if(f=h(_[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(_[0])),P.push(h(_[1])),P.push(f>>8&255),P.push(f&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<4&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.IPv6=function(){function u(d,y){let f,_;if(d.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(d[f]<<8|d[f+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(_=this.parts[f],!(0<=_&&_<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return i(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={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},_,P;for(let j=7;j>=0;j-=1)if(_=this.parts[j],_ in f){if(P=f[_],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,y=[],f=this.parts;for(let _=0;_<f.length;_++)d=f[_],y.push(d>>8),y.push(d&255);return y},u.prototype.toFixedLengthString=function(){let d=function(){let f=[];for(let _=0;_<this.parts.length;_++)f.push(b(this.parts[_].toString(16),4));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.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),y=d[0],f=d[1];return new x.IPv4([y>>8,y&255,f>>8,f&255])},u.prototype.toNormalizedString=function(){let d=function(){let f=[];for(let _=0;_<this.parts.length;_++)f.push(this.parts[_].toString(16));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,_=-1,P;for(;P=d.exec(y);)P[0].length>_&&(f=P.index,_=P[0].length);return _<0?y:`${y.substring(0,f)}::${y.substring(f+_)}`},u.prototype.toString=function(){return this.toRFC5952String()},u}(),x.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<16;)_.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(_)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(u){return this.parser(u)!==null},x.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let d=this.parser(u);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(u){let d,y,f,_,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],y=0;y<16;)_.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(_)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},x.IPv6.parse=function(u){let d=this.parser(u);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(u){let d,y,f;if((y=u.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return f=[this.parse(y[1]),d],Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(u){let d,y,f,_,P,j;if(f=u.match(l.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(l.native.test(u))return m(u,8);if((f=u.match(l.transitional))&&(j=f[6]||"",d=f[1],f[1].endsWith("::")||(d=d.slice(0,-1)),d=m(d+j,6),d.parts)){for(P=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<P.length;y++)if(_=P[y],!(0<=_&&_<=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(u){if(u=parseInt(u),u<0||u>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],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<16&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.fromByteArray=function(u){let d=u.length;if(d===4)return new x.IPv4(u);if(d===16)return new x.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(u){return x.IPv6.isValid(u)||x.IPv4.isValid(u)},x.isValidCIDR=function(u){return x.IPv6.isValidCIDR(u)||x.IPv4.isValidCIDR(u)},x.parse=function(u){if(x.IPv6.isValid(u))return x.IPv6.parse(u);if(x.IPv4.isValid(u))return x.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(u){try{return x.IPv6.parseCIDR(u)}catch{try{return x.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(u,d,y){let f,_,P,j;y==null&&(y="unicast");for(_ in d)if(Object.prototype.hasOwnProperty.call(d,_)){for(P=d[_],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(j=P[f],u.kind()===j[0].kind()&&u.match.apply(u,j))return _}return y},typeof Zt<"u"&&Zt.exports?Zt.exports=x:e.ipaddr=x})(Mo)});var Di=E((nA,Ni)=>{var Ri=require("stream").Stream,kl=require("util");Ni.exports=de;function de(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(de,"DelayedStream");kl.inherits(de,Ri);de.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(de.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});de.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};de.prototype.resume=function(){this._released||this.release(),this.source.resume()};de.prototype.pause=function(){this.source.pause()};de.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};de.prototype.pipe=function(){var e=Ri.prototype.pipe.apply(this,arguments);return this.resume(),e};de.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)};de.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=E((iA,Mi)=>{var Ol=require("util"),Ui=require("stream").Stream,Ci=Di();Mi.exports=q;function q(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}i(q,"CombinedStream");Ol.inherits(q,Ui);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof Ci)){var r=Ci.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};q.prototype.pipe=function(e,t){return Ui.prototype.pipe.call(this,e,t),this.resume(),e};q.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}};q.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=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.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()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.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")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.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)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Fi=E((sA,Li)=>{"use strict";Li.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 Zi=E(re=>{"use strict";var Kt=Fi(),Rl=require("path").extname,Bi=/^\s*([^;\s]*)(?:;|\s|$)/,Nl=/^text\//i;re.charset=Vi;re.charsets={lookup:Vi};re.contentType=Dl;re.extension=Cl;re.extensions=Object.create(null);re.lookup=Ul;re.types=Object.create(null);Ml(re.extensions,re.types);function Vi(e){if(!e||typeof e!="string")return!1;var t=Bi.exec(e),r=t&&Kt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Nl.test(t[1])?"UTF-8":!1}i(Vi,"charset");function Dl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?re.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=re.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(Dl,"contentType");function Cl(e){if(!e||typeof e!="string")return!1;var t=Bi.exec(e),r=t&&re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(Cl,"extension");function Ul(e){if(!e||typeof e!="string")return!1;var t=Rl("x."+e).toLowerCase().substr(1);return t&&re.types[t]||!1}i(Ul,"lookup");function Ml(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Kt).forEach(i(function(o){var s=Kt[o],c=s.extensions;if(!(!c||!c.length)){e[o]=c;for(var l=0;l<c.length;l++){var m=c[l];if(t[m]){var g=r.indexOf(Kt[t[m]].source),h=r.indexOf(s.source);if(t[m]!=="application/octet-stream"&&(g>h||g===h&&t[m].substr(0,12)==="application/"))continue}t[m]=o}}},"forEachMimeType"))}i(Ml,"populateMaps")});var Wi=E((lA,Hi)=>{Hi.exports=jl;function jl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(jl,"defer")});var Xr=E((dA,qi)=>{var Gi=Wi();qi.exports=Ll;function Ll(e){var t=!1;return Gi(function(){t=!0}),i(function(n,o){t?e(n,o):Gi(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(Ll,"async")});var Kr=E((fA,Xi)=>{Xi.exports=Fl;function Fl(e){Object.keys(e.jobs).forEach(Bl.bind(e)),e.jobs={}}i(Fl,"abort");function Bl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(Bl,"clean")});var Jr=E((yA,Ji)=>{var Ki=Xr(),Vl=Kr();Ji.exports=Zl;function Zl(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Hl(t,o,e[o],function(s,c){o in r.jobs&&(delete r.jobs[o],s?Vl(r):r.results[o]=c,n(s,r.results))})}i(Zl,"iterate");function Hl(e,t,r,n){var o;return e.length==2?o=e(r,Ki(n)):o=e(r,t,Ki(n)),o}i(Hl,"runJob")});var Yr=E((vA,Yi)=>{Yi.exports=Wl;function Wl(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(o,s){return t(e[o],e[s])}),n}i(Wl,"state")});var Qr=E((_A,Qi)=>{var Gl=Kr(),ql=Xr();Qi.exports=Xl;function Xl(e){Object.keys(this.jobs).length&&(this.index=this.size,Gl(this),ql(e)(null,this.results))}i(Xl,"terminator")});var ta=E((bA,ea)=>{var Kl=Jr(),Jl=Yr(),Yl=Qr();ea.exports=Ql;function Ql(e,t,r){for(var n=Jl(e);n.index<(n.keyedList||e).length;)Kl(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Yl.bind(n,r)}i(Ql,"parallel")});var en=E((IA,Jt)=>{var ra=Jr(),ep=Yr(),tp=Qr();Jt.exports=rp;Jt.exports.ascending=na;Jt.exports.descending=np;function rp(e,t,r,n){var o=ep(e,r);return ra(e,t,o,i(function s(c,l){if(c){n(c,l);return}if(o.index++,o.index<(o.keyedList||e).length){ra(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),tp.bind(o,n)}i(rp,"serialOrdered");function na(e,t){return e<t?-1:e>t?1:0}i(na,"ascending");function np(e,t){return-1*na(e,t)}i(np,"descending")});var ia=E(($A,oa)=>{var op=en();oa.exports=ip;function ip(e,t,r){return op(e,t,null,r)}i(ip,"serial")});var sa=E((AA,aa)=>{aa.exports={parallel:ta(),serial:ia(),serialOrdered:en()}});var tn=E((zA,ua)=>{"use strict";ua.exports=Object});var la=E((wA,ca)=>{"use strict";ca.exports=Error});var da=E((kA,pa)=>{"use strict";pa.exports=EvalError});var fa=E((OA,ma)=>{"use strict";ma.exports=RangeError});var ya=E((RA,ga)=>{"use strict";ga.exports=ReferenceError});var va=E((NA,ha)=>{"use strict";ha.exports=SyntaxError});var Yt=E((DA,xa)=>{"use strict";xa.exports=TypeError});var Pa=E((CA,_a)=>{"use strict";_a.exports=URIError});var Ta=E((UA,ba)=>{"use strict";ba.exports=Math.abs});var Ea=E((MA,Ia)=>{"use strict";Ia.exports=Math.floor});var Sa=E((jA,$a)=>{"use strict";$a.exports=Math.max});var za=E((LA,Aa)=>{"use strict";Aa.exports=Math.min});var ka=E((FA,wa)=>{"use strict";wa.exports=Math.pow});var Ra=E((BA,Oa)=>{"use strict";Oa.exports=Math.round});var Da=E((VA,Na)=>{"use strict";Na.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var Ua=E((HA,Ca)=>{"use strict";var ap=Da();Ca.exports=i(function(t){return ap(t)||t===0?t:t<0?-1:1},"sign")});var ja=E((GA,Ma)=>{"use strict";Ma.exports=Object.getOwnPropertyDescriptor});var rn=E((qA,La)=>{"use strict";var Qt=ja();if(Qt)try{Qt([],"length")}catch{Qt=null}La.exports=Qt});var Ba=E((XA,Fa)=>{"use strict";var er=Object.defineProperty||!1;if(er)try{er({},"a",{value:1})}catch{er=!1}Fa.exports=er});var nn=E((KA,Va)=>{"use strict";Va.exports=i(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 o=42;t[r]=o;for(var s 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!==o||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Wa=E((YA,Ha)=>{"use strict";var Za=typeof Symbol<"u"&&Symbol,sp=nn();Ha.exports=i(function(){return typeof Za!="function"||typeof Symbol!="function"||typeof Za("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:sp()},"hasNativeSymbols")});var on=E((ez,Ga)=>{"use strict";Ga.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var an=E((tz,qa)=>{"use strict";var up=tn();qa.exports=up.getPrototypeOf||null});var Ja=E((rz,Ka)=>{"use strict";var cp="Function.prototype.bind called on incompatible ",lp=Object.prototype.toString,pp=Math.max,dp="[object Function]",Xa=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),mp=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),fp=i(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");Ka.exports=i(function(t){var r=this;if(typeof r!="function"||lp.apply(r)!==dp)throw new TypeError(cp+r);for(var n=mp(arguments,1),o,s=i(function(){if(this instanceof o){var h=r.apply(this,Xa(n,arguments));return Object(h)===h?h:this}return r.apply(t,Xa(n,arguments))},"binder"),c=pp(0,r.length-n.length),l=[],m=0;m<c;m++)l[m]="$"+m;if(o=Function("binder","return function ("+fp(l,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=i(function(){},"Empty");g.prototype=r.prototype,o.prototype=new g,g.prototype=null}return o},"bind")});var qe=E((oz,Ya)=>{"use strict";var gp=Ja();Ya.exports=Function.prototype.bind||gp});var tr=E((iz,Qa)=>{"use strict";Qa.exports=Function.prototype.call});var sn=E((az,es)=>{"use strict";es.exports=Function.prototype.apply});var rs=E((sz,ts)=>{"use strict";ts.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var os=E((uz,ns)=>{"use strict";var yp=qe(),hp=sn(),vp=tr(),xp=rs();ns.exports=xp||yp.call(vp,hp)});var as=E((cz,is)=>{"use strict";var _p=qe(),Pp=Yt(),bp=tr(),Tp=os();is.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new Pp("a function is required");return Tp(_p,bp,t)},"callBindBasic")});var ds=E((pz,ps)=>{"use strict";var Ip=as(),ss=rn(),cs;try{cs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var un=!!cs&&ss&&ss(Object.prototype,"__proto__"),ls=Object,us=ls.getPrototypeOf;ps.exports=un&&typeof un.get=="function"?Ip([un.get]):typeof us=="function"?i(function(t){return us(t==null?t:ls(t))},"getDunder"):!1});var hs=E((mz,ys)=>{"use strict";var ms=on(),fs=an(),gs=ds();ys.exports=ms?i(function(t){return ms(t)},"getProto"):fs?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return fs(t)},"getProto"):gs?i(function(t){return gs(t)},"getProto"):null});var cn=E((gz,vs)=>{"use strict";var Ep=Function.prototype.call,$p=Object.prototype.hasOwnProperty,Sp=qe();vs.exports=Sp.call(Ep,$p)});var Es=E((yz,Is)=>{"use strict";var M,Ap=tn(),zp=la(),wp=da(),kp=fa(),Op=ya(),Ye=va(),Je=Yt(),Rp=Pa(),Np=Ta(),Dp=Ea(),Cp=Sa(),Up=za(),Mp=ka(),jp=Ra(),Lp=Ua(),bs=Function,ln=i(function(e){try{return bs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),bt=rn(),Fp=Ba(),pn=i(function(){throw new Je},"throwTypeError"),Bp=bt?function(){try{return arguments.callee,pn}catch{try{return bt(arguments,"callee").get}catch{return pn}}}():pn,Xe=Wa()(),Q=hs(),Vp=an(),Zp=on(),Ts=sn(),Tt=tr(),Ke={},Hp=typeof Uint8Array>"u"||!Q?M:Q(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Xe&&Q?Q([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":zp,"%eval%":eval,"%EvalError%":wp,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":bs,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Xe&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Xe||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ap,"%Object.getOwnPropertyDescriptor%":bt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":kp,"%ReferenceError%":Op,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Xe||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Xe&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":Xe?Symbol:M,"%SyntaxError%":Ye,"%ThrowTypeError%":Bp,"%TypedArray%":Hp,"%TypeError%":Je,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":Rp,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Tt,"%Function.prototype.apply%":Ts,"%Object.defineProperty%":Fp,"%Object.getPrototypeOf%":Vp,"%Math.abs%":Np,"%Math.floor%":Dp,"%Math.max%":Cp,"%Math.min%":Up,"%Math.pow%":Mp,"%Math.round%":jp,"%Math.sign%":Lp,"%Reflect.getPrototypeOf%":Zp};if(Q)try{null.error}catch(e){xs=Q(Q(e)),De["%Error.prototype%"]=xs}var xs,Wp=i(function e(t){var r;if(t==="%AsyncFunction%")r=ln("async function () {}");else if(t==="%GeneratorFunction%")r=ln("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=ln("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Q&&(r=Q(o.prototype))}return De[t]=r,r},"doEval"),_s={__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"]},It=qe(),rr=cn(),Gp=It.call(Tt,Array.prototype.concat),qp=It.call(Ts,Array.prototype.splice),Ps=It.call(Tt,String.prototype.replace),nr=It.call(Tt,String.prototype.slice),Xp=It.call(Tt,RegExp.prototype.exec),Kp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Jp=/\\(\\)?/g,Yp=i(function(t){var r=nr(t,0,1),n=nr(t,-1);if(r==="%"&&n!=="%")throw new Ye("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ye("invalid intrinsic syntax, expected opening `%`");var o=[];return Ps(t,Kp,function(s,c,l,m){o[o.length]=l?Ps(m,Jp,"$1"):c||s}),o},"stringToPath"),Qp=i(function(t,r){var n=t,o;if(rr(_s,n)&&(o=_s[n],n="%"+o[0]+"%"),rr(De,n)){var s=De[n];if(s===Ke&&(s=Wp(n)),typeof s>"u"&&!r)throw new Je("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Ye("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Is.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new Je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Je('"allowMissing" argument must be a boolean');if(Xp(/^%?[^%]*%?$/,t)===null)throw new Ye("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Yp(t),o=n.length>0?n[0]:"",s=Qp("%"+o+"%",r),c=s.name,l=s.value,m=!1,g=s.alias;g&&(o=g[0],qp(n,Gp([0,1],g)));for(var h=1,b=!0;h<n.length;h+=1){var x=n[h],u=nr(x,0,1),d=nr(x,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new Ye("property names with quotes must have matching quotes");if((x==="constructor"||!b)&&(m=!0),o+="."+x,c="%"+o+"%",rr(De,c))l=De[c];else if(l!=null){if(!(x in l)){if(!r)throw new Je("base intrinsic for "+t+" exists, but the property is not available.");return}if(bt&&h+1>=n.length){var y=bt(l,x);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[x]}else b=rr(l,x),l=l[x];b&&!m&&(De[c]=l)}}return l},"GetIntrinsic")});var Ss=E((vz,$s)=>{"use strict";var ed=nn();$s.exports=i(function(){return ed()&&!!Symbol.toStringTag},"hasToStringTagShams")});var ws=E((_z,zs)=>{"use strict";var td=Es(),As=td("%Object.defineProperty%",!0),rd=Ss()(),nd=cn(),od=Yt(),or=rd?Symbol.toStringTag:null;zs.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new od("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");or&&(n||!nd(t,or))&&(As?As(t,or,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[or]=r)},"setToStringTag")});var Os=E((bz,ks)=>{"use strict";var id=Function.prototype.call,ad=Object.prototype.hasOwnProperty,sd=qe();ks.exports=sd.call(id,ad)});var Ns=E((Tz,Rs)=>{"use strict";Rs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Us=E((Iz,Cs)=>{"use strict";var gn=ji(),ud=require("util"),dn=require("path"),cd=require("http"),ld=require("https"),pd=require("url").parse,dd=require("fs"),md=require("stream").Stream,fd=require("crypto"),mn=Zi(),gd=sa(),yd=ws(),we=Os(),fn=Ns();function Ds(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Ds,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],gn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(L,"FormData");ud.inherits(L,gn);L.LINE_BREAK=`\r
2
- `;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=gn.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 o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof md))&&(r.knownLength||this._valuesToMeasure.push(t))};L.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)):dd.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):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")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+Ds(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&fn(c,r.header);var l;for(var m in c)if(we(c,m)){if(l=c[m],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(s+=m+": "+l.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+s+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=dn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=dn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=dn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ds(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=mn.lookup(e.name)),!r&&e&&e.path&&(r=mn.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=mn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)we(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+fd.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}gd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=pd(e),n=fn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=fn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=ld.request(n):r=cd.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,m=i(function(g,h){return r.removeListener("error",m),r.removeListener("response",l),t.call(this,g,h)},"callback");l=m.bind(this,null),r.on("error",m),r.on("response",l)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};yd(L.prototype,"FormData");Cs.exports=L});var $d={};_n($d,{twilio:()=>Ed,twilioAuth:()=>V});module.exports=ru($d);var nu=Object.freeze({status:"aborted"});function T(e,t,r){function n(l,m){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,m);let g=c.prototype,h=Object.keys(g);for(let b=0;b<h.length;b++){let x=h[b];x in l||(l[x]=g[x].bind(l))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(l){var m;let g=r?.Parent?new s:this;n(g,l),(m=g._zod).deferred??(m.deferred=[]);for(let h of g._zod.deferred)h();return g}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(T,"$constructor");var ou=Symbol("zod_brand"),me=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$t=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},lr={};function he(e){return e&&Object.assign(lr,e),lr}i(he,"config");function dr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(dr,"getEnumValues");function Tn(e,t){return typeof t=="bigint"?t.toString():t}i(Tn,"jsonStringifyReplacer");function At(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(At,"cached");function In(e){return e==null}i(In,"nullish");function zt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(zt,"cleanRegex");var bn=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==bn)return n===void 0&&(n=bn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(X,"defineLazy");var mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(rt,"isObject");var iu=At(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function En(e){if(rt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(rt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(En,"isPlainObject");var $n=new Set(["string","number","symbol"]);function Me(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Me,"escapeRegex");function wt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(wt,"clone");function H(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>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:i(()=>t.error,"error")}:t}i(H,"normalizeParams");function Sn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(Sn,"optionalKeys");var au={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}i(je,"aborted");function Ie(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Ie,"prefixIssues");function St(e){return typeof e=="string"?e:e?.message}i(St,"unwrapMessage");function Ee(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=St(e.inst?._zod.def?.error?.(e))??St(t?.error?.(e))??St(r.customError?.(e))??St(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Ee,"finalizeIssue");function An(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(An,"getLengthableOrigin");function fr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(fr,"issue");var zn=i((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,Tn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),wn=T("$ZodError",zn),nt=T("$ZodError",zn,{Parent:Error});var uu=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new me;if(c.issues.length){let l=new(o?.Err??e)(c.issues.map(m=>Ee(m,s,he())));throw mr(l,o?.callee),l}return c.value},"_parse"),kt=uu(nt),cu=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??e)(c.issues.map(m=>Ee(m,s,he())));throw mr(l,o?.callee),l}return c.value},"_parseAsync"),Ot=cu(nt),lu=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new me;return s.issues.length?{success:!1,error:new(e??wn)(s.issues.map(c=>Ee(c,o,he())))}:{success:!0,data:s.value}},"_safeParse"),ot=lu(nt),pu=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Ee(c,o,he())))}:{success:!0,data:s.value}},"_safeParseAsync"),it=pu(nt);var du="(?:(?:\\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])))",mu=new RegExp(`^${du}$`);var kn=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),On=/^-?\d+n?$/;var gr=/^-?\d+(?:\.\d+)?$/,Rn=/^(?:true|false)$/i;var Le=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Nn=T("$ZodCheckMinLength",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!In(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let c=An(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var yr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Le.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Dn=T("$ZodCheckRegex",(e,t)=>{yr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Un={major:4,minor:3,patch:6};var W=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Un;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((c,l,m)=>{let g=je(c),h;for(let b of l){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(g)continue;let x=c.issues.length,u=b._zod.check(c);if(u instanceof Promise&&m?.async===!1)throw new me;if(h||u instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await u,c.issues.length!==x&&(g||(g=je(c,x)))});else{if(c.issues.length===x)continue;g||(g=je(c,x))}}return h?h.then(()=>c):c},"runChecks"),s=i((c,l,m)=>{if(je(c))return c.aborted=!0,c;let g=o(l,n,m);if(g instanceof Promise){if(m.async===!1)throw new me;return g.then(h=>e._zod.parse(h,m))}return e._zod.parse(g,m)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return g instanceof Promise?g.then(h=>s(h,c,l)):s(g,c,l)}let m=e._zod.parse(c,l);if(m instanceof Promise){if(l.async===!1)throw new me;return m.then(g=>o(g,n,l))}return o(m,n,l)}}X(e,"~standard",()=>({validate:i(o=>{try{let s=ot(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return it(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Dt=T("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??kn(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}}),hr=T("$ZodStringFormat",(e,t)=>{yr.init(e,t),Dt.init(e,t)});var Bn=T("$ZodURL",(e,t)=>{hr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.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(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Vn=T("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??gr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}});var vr=T("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=Rn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Zn=T("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=On,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Hn=T("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),Wn=T("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r});var Gn=T("$ZodVoid",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),qn=T("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Mn(e,t,r){e.issues.length&&t.issues.push(...Ie(r,e.issues)),t.value[r]=e.value}i(Mn,"handleArrayResult");var Xn=T("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let c=0;c<o.length;c++){let l=o[c],m=t.element._zod.run({value:l,issues:[]},n);m instanceof Promise?s.push(m.then(g=>Mn(g,r,c))):Mn(m,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Nt(e,t,r,n,o){if(e.issues.length){if(o&&!(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}i(Nt,"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=Sn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(fu,"normalizeDef");function gu(e,t,r,n,o,s){let c=[],l=o.keySet,m=o.catchall._zod,g=m.def.type,h=m.optout==="optional";for(let b in t){if(l.has(b))continue;if(g==="never"){c.push(b);continue}let x=m.run({value:t[b],issues:[]},n);x instanceof Promise?e.push(x.then(u=>Nt(u,r,b,t,h))):Nt(x,r,b,t,h)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(gu,"handleCatchall");var Kn=T("$ZodObject",(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let m={...l};return Object.defineProperty(t,"shape",{value:m}),m},"get")})}let n=At(()=>fu(t));X(e._zod,"propValues",()=>{let l=t.shape,m={};for(let g in l){let h=l[g]._zod;if(h.values){m[g]??(m[g]=new Set);for(let b of h.values)m[g].add(b)}}return m});let o=rt,s=t.catchall,c;e._zod.parse=(l,m)=>{c??(c=n.value);let g=l.value;if(!o(g))return l.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),l;l.value={};let h=[],b=c.shape;for(let x of c.keys){let u=b[x],d=u._zod.optout==="optional",y=u._zod.run({value:g[x],issues:[]},m);y instanceof Promise?h.push(y.then(f=>Nt(f,l,x,g,d))):Nt(y,l,x,g,d)}return s?gu(h,g,l,m,n.value,e):h.length?Promise.all(h).then(()=>l):l}});function jn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!je(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>Ee(c,n,he())))}),t)}i(jn,"handleUnionResults");var xr=T("$ZodUnion",(e,t)=>{W.init(e,t),X(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),X(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>zt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let c=!1,l=[];for(let m of t.options){let g=m._zod.run({value:o.value,issues:[]},s);if(g instanceof Promise)l.push(g),c=!0;else{if(g.issues.length===0)return g;l.push(g)}}return c?Promise.all(l).then(m=>jn(m,o,e,s)):jn(l,o,e,s)}});var Jn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xr.init(e,t);let r=e._zod.parse;X(e._zod,"propValues",()=>{let o={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[l,m]of Object.entries(c)){o[l]||(o[l]=new Set);for(let g of m)o[l].add(g)}}return o});let n=At(()=>{let o=t.options,s=new Map;for(let c of o){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 m of l){if(s.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);s.set(m,c)}}return s});e._zod.parse=(o,s)=>{let c=o.value;if(!rt(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var Yn=T("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!En(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){l.add(typeof g=="number"?g.toString():g);let h=t.valueType._zod.run({value:o[g],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Ie(g,b.issues)),r.value[g]=b.value})):(h.issues.length&&r.issues.push(...Ie(g,h.issues)),r.value[g]=h.value)}let m;for(let g in o)l.has(g)||(m=m??[],m.push(g));m&&m.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:m})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let m=t.keyType._zod.run({value:l,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&gr.test(l)&&m.issues.length){let b=t.keyType._zod.run({value:Number(l),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(m=b)}if(m.issues.length){t.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(b=>Ee(b,n,he())),input:l,path:[l],inst:e});continue}let h=t.valueType._zod.run({value:o[l],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Ie(l,b.issues)),r.value[m.value]=b.value})):(h.issues.length&&r.issues.push(...Ie(l,h.issues)),r.value[m.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Qn=T("$ZodEnum",(e,t)=>{W.init(e,t);let r=dr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>$n.has(typeof o)).map(o=>typeof o=="string"?Me(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),eo=T("$ZodLiteral",(e,t)=>{if(W.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"?Me(n):n?Me(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var to=T("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $t(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new me;return r.value=o,r}});function Ln(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Ln,"handleOptionalResult");var ro=T("$ZodOptional",(e,t)=>{W.init(e,t),e._zod.optin="optional",e._zod.optout="optional",X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Ln(s,r.value)):Ln(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var no=T("$ZodNullable",(e,t)=>{W.init(e,t),X(e._zod,"optin",()=>t.innerType._zod.optin),X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)}|null)$`):void 0}),X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var oo=T("$ZodPipe",(e,t)=>{W.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Rt(c,t.in,n)):Rt(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Rt(s,t.out,n)):Rt(o,t.out,n)}});function Rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(Rt,"handlePipeResult");var io=T("$ZodCustom",(e,t)=>{Le.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Fn(s,r,n,e));Fn(o,r,n,e)}});function Fn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(fr(o))}}i(Fn,"handleRefineResult");var so,xu=Symbol("ZodOutput"),_u=Symbol("ZodInput"),_r=class{static{i(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 o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function uo(){return new _r}i(uo,"registry");(so=globalThis).__zod_globalRegistry??(so.__zod_globalRegistry=uo());var Pr=globalThis.__zod_globalRegistry;function co(e,t){return new e({type:"string",...H(t)})}i(co,"_string");function lo(e,t){return new e({type:"string",coerce:!0,...H(t)})}i(lo,"_coercedString");function po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}i(po,"_url");function mo(e,t){return new e({type:"number",checks:[],...H(t)})}i(mo,"_number");function fo(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}i(fo,"_coercedNumber");function go(e,t){return new e({type:"boolean",...H(t)})}i(go,"_boolean");function yo(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}i(yo,"_coercedBoolean");function ho(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}i(ho,"_coercedBigint");function vo(e){return new e({type:"any"})}i(vo,"_any");function xo(e){return new e({type:"unknown"})}i(xo,"_unknown");function _o(e,t){return new e({type:"void",...H(t)})}i(_o,"_void");function Po(e,t){return new e({type:"date",coerce:!0,...H(t)})}i(Po,"_coercedDate");function le(e,t){return new Nn({check:"min_length",...H(t),minimum:e})}i(le,"_minLength");function $e(e,t){return new Dn({check:"string_format",format:"regex",...H(t),pattern:e})}i($e,"_regex");function bo(e,t,r){let n=H(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(bo,"_custom");var K=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");W.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>kt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>ot(e,r,n),e.parseAsync=async(r,n)=>Ot(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>it(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)=>wt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Ut=T("ZodMiniString",(e,t)=>{Dt.init(e,t),K.init(e,t)});function a(e){return co(Ut,e)}i(a,"string");var To=T("ZodMiniStringFormat",(e,t)=>{hr.init(e,t),Ut.init(e,t)});var wu=T("ZodMiniURL",(e,t)=>{Bn.init(e,t),To.init(e,t)});function Io(e){return po(wu,e)}i(Io,"url");var br=T("ZodMiniNumber",(e,t)=>{Vn.init(e,t),K.init(e,t)});function te(e){return mo(br,e)}i(te,"number");var Tr=T("ZodMiniBoolean",(e,t)=>{vr.init(e,t),K.init(e,t)});function B(e){return go(Tr,e)}i(B,"boolean");var Eo=T("ZodMiniBigInt",(e,t)=>{Zn.init(e,t),K.init(e,t)});var ku=T("ZodMiniAny",(e,t)=>{Hn.init(e,t),K.init(e,t)});function st(){return vo(ku)}i(st,"any");var Ou=T("ZodMiniUnknown",(e,t)=>{Wn.init(e,t),K.init(e,t)});function w(){return xo(Ou)}i(w,"unknown");var Ru=T("ZodMiniVoid",(e,t)=>{Gn.init(e,t),K.init(e,t)});function $o(e){return _o(Ru,e)}i($o,"_void");var So=T("ZodMiniDate",(e,t)=>{qn.init(e,t),K.init(e,t)});var Nu=T("ZodMiniArray",(e,t)=>{Xn.init(e,t),K.init(e,t)});function R(e,t){return new Nu({type:"array",element:e,...H(t)})}i(R,"array");var Du=T("ZodMiniObject",(e,t)=>{Kn.init(e,t),K.init(e,t),X(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...H(t)};return new Du(r)}i(p,"object");var Cu=T("ZodMiniUnion",(e,t)=>{xr.init(e,t),K.init(e,t)});function N(e,t){return new Cu({type:"union",options:e,...H(t)})}i(N,"union");var Uu=T("ZodMiniDiscriminatedUnion",(e,t)=>{Jn.init(e,t),K.init(e,t)});function Fe(e,t,r){return new Uu({type:"union",options:t,discriminator:e,...H(r)})}i(Fe,"discriminatedUnion");var Mu=T("ZodMiniRecord",(e,t)=>{Yn.init(e,t),K.init(e,t)});function k(e,t,r){return new Mu({type:"record",keyType:e,valueType:t,...H(r)})}i(k,"record");var ju=T("ZodMiniEnum",(e,t)=>{Qn.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ju({type:"enum",entries:r,...H(t)})}i(U,"_enum");var Lu=T("ZodMiniLiteral",(e,t)=>{eo.init(e,t),K.init(e,t)});function $(e,t){return new Lu({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}i($,"literal");var Fu=T("ZodMiniTransform",(e,t)=>{to.init(e,t),K.init(e,t)});function Se(e){return new Fu({type:"transform",transform:e})}i(Se,"transform");var Bu=T("ZodMiniOptional",(e,t)=>{ro.init(e,t),K.init(e,t)});function v(e){return new Bu({type:"optional",innerType:e})}i(v,"optional");var Vu=T("ZodMiniNullable",(e,t)=>{no.init(e,t),K.init(e,t)});function ut(e){return new Vu({type:"nullable",innerType:e})}i(ut,"nullable");var Zu=T("ZodMiniPipe",(e,t)=>{oo.init(e,t),K.init(e,t)});function Ae(e,t){return new Zu({type:"pipe",in:e,out:t})}i(Ae,"pipe");var Hu=T("ZodMiniCustom",(e,t)=>{io.init(e,t),K.init(e,t)});function Mt(e,t){return bo(Hu,e??(()=>!0),t)}i(Mt,"custom");var ct={};_n(ct,{bigint:()=>Yu,boolean:()=>Ju,date:()=>Qu,number:()=>Ku,string:()=>Xu});function Xu(e){return lo(Ut,e)}i(Xu,"string");function Ku(e){return fo(br,e)}i(Ku,"number");function Ju(e){return yo(Tr,e)}i(Ju,"boolean");function Yu(e){return ho(Eo,e)}i(Yu,"bigint");function Qu(e){return Po(So,e)}i(Qu,"date");var Er=p({retryOnFailure:p({defaultValue:v(B()),hide:v(B())}),continueOnFailure:p({defaultValue:v(B()),hide:v(B())})}),Ir=class{constructor(t,r,n,o,s,c,l,m,g,h,b){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=c;this.requireAuth=l;this.errorHandlingOptions=m;this.outputSchema=g;this.audience=h;this.aiMetadata=b}static{i(this,"IAction")}},ae=i(e=>new Ir(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=p({displayName:a(),description:v(a())}),D=i((e,t)=>p({type:$(t),required:B(),defaultValue:v(st())}),"TPropertyValue");var oe=p({...F.shape,...D(a(),"SHORT_TEXT").shape}),ve=p({...F.shape,...D(a(),"LONG_TEXT").shape});var zo=p({label:a(),value:w()}),jt=p({disabled:v(B()),placeholder:v(a()),options:R(zo)});var ie=p({...F.shape,options:jt,...D(w(),"STATIC_DROPDOWN").shape}),xe=p({...F.shape,options:jt,...D(R(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var $r=p({...F.shape,...D(w(),"DROPDOWN").shape,refreshers:R(a())}),lt=p({...F.shape,...D(R(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var _e=p({...F.shape,...D(B(),"CHECKBOX").shape});var Pe=p({...F.shape,...D(te(),"NUMBER").shape});var pt=p({...F.shape,...D(w(),"FILE").shape});var dt=p({...F.shape,...D(a(),"DATE_TIME").shape});var wo=k(a(),N([oe,ve,ie,lt,xe,_e,Pe,pt,dt])),mt=p({...F.shape,properties:wo,...D(R(w()),"ARRAY").shape});var ft=p({...F.shape,...D(N([k(a(),w())]),"JSON").shape});var ko=N([oe,ie,ft,mt,xe]),tc=k(a(),ko),Sr=p({refreshers:R(a()),...F.shape,...D(w(),"DYNAMIC").shape});var Lt=p({...F.shape,...D($o(),"MARKDOWN").shape});var gt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(gt||{}),Be=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Be||{}),Ve=(_=>(_.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",_.COMMUNICATION="COMMUNICATION",_.COMMERCE="COMMERCE",_.CORE="CORE",_.UNIVERSAL_AI="UNIVERSAL_AI",_.FLOW_CONTROL="FLOW_CONTROL",_.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",_.ACCOUNTING="ACCOUNTING",_.PRODUCTIVITY="PRODUCTIVITY",_.CONTENT_AND_FILES="CONTENT_AND_FILES",_.DEVELOPER_TOOLS="DEVELOPER_TOOLS",_.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",_.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",_.HUMAN_RESOURCES="HUMAN_RESOURCES",_.PAYMENT_PROCESSING="PAYMENT_PROCESSING",_.MARKETING="MARKETING",_.SALES_AND_CRM="SALES_AND_CRM",_))(Ve||{});var yt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(yt||{}),Ar="both_client_credentials_and_authorization_code";var se=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(se||{}),ht=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(ht||{}),rc=p({strategy:U(ht),paramName:v(a())}),vt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(vt||{});var Ft=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ft||{}),Oo=p({status:v(te()),body:v(w()),headers:v(k(a(),a()))}),Ro=p({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:v(a()),handlerId:v(a()),streamStepProgress:v(U(Ft))}),No=p({type:$("WEBHOOK"),requestId:a(),requestIdToReply:v(a()),response:Oo,handlerId:v(a()),streamStepProgress:v(U(Ft))}),nc=N([Ro,No]);var oc=p({body:w(),rawBody:v(w()),headers:k(a(),a()),queryParams:k(a(),a())});function ee(e){return e==null}i(ee,"isNil");function xt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(xt,"isEmpty");function Bt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(Bt,"assertNotNullOrUndefined");var zr=Ue(require("crypto"),1);var ic=128,Oe,Ze,ac=i(e=>{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*ic),zr.default.randomFillSync(Oe),Ze=0):Ze+e>Oe.length&&(zr.default.randomFillSync(Oe),Ze=0),Ze+=e},"fillPool"),sc=i(e=>(ac(e|=0),Oe.subarray(Ze-e,Ze)),"random"),uc=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let c="";for(;;){let l=r(o),m=o;for(;m--;)if(c+=e[l[m]&n]||"",c.length===s)return c}}},"customRandom"),Co=i((e,t=21)=>uc(e,t,sc),"customAlphabet");var cc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Uo=21,cb=a().check($e(new RegExp(`^[0-9a-zA-Z]{${Uo}}$`))),lc=Co(cc,Uo);var ze=Ae(Se(e=>e instanceof Date?e.toISOString():e),a()),ue={id:a(),created:ze,updated:ze},Z=i(e=>v(ut(e)),"Nullable");function wr(e){return v(ut(U(e)))}i(wr,"NullableEnum");var db=Ae(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(B())),Vt=i(e=>Ae(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(R(e))),"OptionalArrayFromQuery");var gb=k(a(),w());var _t=(h=>(h.OPENAI="openai",h.OPENROUTER="openrouter",h.ANTHROPIC="anthropic",h.AZURE="azure",h.GOOGLE="google",h.ACTIVEPIECES="activepieces",h.CLOUDFLARE_GATEWAY="cloudflare-gateway",h.CUSTOM="custom",h.BEDROCK="bedrock",h.MISTRAL="mistral",h))(_t||{});var Sb=a().check($e(/^#[0-9A-Fa-f]{6}$/));var zb=p({filename:a(),data:w(),type:$("file"),mimetype:v(a())});var pc=Ue(jo());var Cb=p({...ue,name:a(),permissions:R(a()),platformId:Z(a()),type:a(),userCount:v(te())});var Lo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Lo||{}),kr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(kr||{}),Or=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Or||{});var Rr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Rr||{});var Nr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Nr||{});var dc=p({mode:U(Lo),value:w()}),mc=p({auth:v(a()),fields:k(a(),dc)}),fc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:v(mc)}),gc=p({type:$("PIECE"),toolName:a().check(le(1)),pieceMetadata:fc}),yc=p({type:$("none")}),hc=p({type:$("access_token"),accessToken:a()}),vc=p({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),xc=p({type:$("headers"),headers:k(a(),a())}),_c=Fe("type",[yc,hc,vc,xc]),Fo=p({type:$("FLOW"),toolName:a().check(le(1)),externalFlowId:a(),flowDisplayName:v(a())}),Bo=p({type:$("MCP"),toolName:a().check(le(1)),serverUrl:Io(),protocol:U(Or),auth:_c}),Vo=p({type:$("KNOWLEDGE_BASE"),toolName:a().check(le(1)),sourceType:U(kr),sourceId:a(),sourceName:a()}),Pc=Fe("type",[gc,Fo,Bo,Vo]),bc=p({displayName:a(),description:v(a()),type:U(Rr)}),Zo=p({type:$("MARKDOWN"),markdown:a()}),He={type:$("TOOL_CALL"),input:Z(k(a(),w())),output:v(w()),toolName:a(),status:U(Nr),toolCallId:a(),startTime:a(),endTime:v(a())},cT=p(He),Ho=Fe("toolCallType",[p({...He,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...He,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),p({...He,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),p({...He,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...He,toolCallType:$("UNKNOWN"),displayName:a()})]),Tc=N([Zo,Ho]);var Dr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Dr||{}),be=p({apiKey:a()}),Ic=be,Ec=p({apiKey:a(),apiKeyHash:a()}),$c=be,Sc=be,Ac=be,zc=be,wc=be,kc=be,Oc=be,Wo=p({accessKeyId:a().check(le(1)),secretAccessKey:a().check(le(1))}),Rc=p({}),Nc=p({}),Dc=p({}),Cc=p({}),Uc=p({}),Mc=p({}),Go=p({modelId:a(),modelName:a(),modelType:U(Dr)}),qo=p({apiKeyHeader:a(),baseUrl:a(),models:R(Go),defaultHeaders:v(k(a(),a()))}),Xo=p({accountId:a(),gatewayId:a(),models:R(Go),vertexProject:v(a()),vertexRegion:v(a())}),Ko=p({resourceName:a(),apiVersion:Ae(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(a()))}),Jo=p({region:a().check(le(1))}),jc=N([Ic,Ac,zc,wc,kc,Sc,$c,Ec,Wo,Oc]),Yo=N([qo,Xo,Ko,Jo,Rc,Dc,Cc,Uc,Nc,Mc]),Lc=p({id:a(),name:a(),type:U(Dr)}),Fc=p({id:a(),name:a(),provider:U(_t),config:Yo,enabledForChat:B()}),Bc=p({provider:U(_t),config:Yo,auth:jc,platformId:a()});var mT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Vc=p({base64Url:a(),fileName:a(),extension:v(a())}),Zc=p({mimeType:a(),url:a(),fileName:v(a())}),Cr=N([Vc,Zc]);var Hc=N([p({type:$("file"),value:Cr}),p({type:$("markdown"),value:a(),files:v(R(Cr))})]),Wc=p({sessionId:a(),message:a(),files:v(R(a()))});var ei=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ei||{}),ti=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ti||{}),Ur=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Ur||{});var Gc=N([p({...ue,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:R(p({value:a()}))})}),p({...ue,name:a(),externalId:a(),type:N([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),qc=p({...ue,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:wr(ti),trigger:wr(ei)}),Xc=p({...ue,tableId:a(),projectId:a(),cells:k(a(),p({updated:a(),created:a(),value:w(),fieldName:a()}))}),Kc=p({events:R(U(Ur)),webhookUrl:a(),flowId:a()}),Jc=p({fields:R(p({id:a(),name:a()})),rows:R(k(a(),a())),name:a()}),Yc=p({projectId:a(),limit:v(ct.number()),cursor:v(a()),name:v(a()),externalIds:Vt(a()),folderId:v(a()),folderIds:Vt(a())}),Qc=p({records:R(R(p({fieldId:a(),value:ni()}))),tableId:a()}),el=p({cells:v(R(p({fieldId:a(),value:ni()}))),tableId:a(),agentUpdate:v(B())}),ri=Fe("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),Qo("exists"),Qo("not_exists")]),tl=p({tableId:a(),limit:v(ct.number()),cursor:v(a()),filters:Vt(ri)});function ni(){return Ae(Se(e=>e==null?e:String(e)),ut(a()))}i(ni,"coerceToString");function Re(e){return p({fieldId:a(),operator:$(e),value:a()})}i(Re,"valueFilter");function Qo(e){return p({fieldId:a(),operator:$(e)})}i(Qo,"existenceFilter");var rl=p({status:v(te()),body:v(w()),headers:v(k(a(),a()))}),nl=p({...ue,deleted:Z(ze),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var oi=p({name:a(),description:v(a()),type:a(),required:B()}),ol=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:R(oi),returnsResponse:B()})});var ii="^[0-9]+\\.[0-9]+\\.[0-9]+$",OT=new RegExp(ii),al="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",RT=a().check($e(new RegExp(ii))),NT=a().check($e(new RegExp(al))),sl=p({packageType:$("ARCHIVE"),pieceType:U(Be),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ai=p({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),si=p({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),DT=N([ai,si]),CT=N([sl,ai,si]),ui=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ui||{}),ul=p({type:U(ui),cronExpression:a(),timezone:a()}),UT=p({...ue,type:U(se),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(ul),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),ci=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(ci||{}),li=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(li||{}),pi=(r=>(r.S3="S3",r.DB="DB",r))(pi||{}),MT=p({...ue,projectId:Z(a()),platformId:Z(a()),type:U(ci),compression:U(li),data:v(w()),location:U(pi),size:Z(te()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(k(a(),a()))}),di=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(di||{}),mi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(mi||{}),jT=p({id:a(),email:a(),firstName:a(),status:U(mi),externalId:Z(a()),platformId:Z(a()),platformRole:U(di),lastName:a(),created:ze,updated:ze,lastActiveDate:Z(ze),imageUrl:Z(a())});var Mr=p({...F.shape,...D(k(a(),w()),"OBJECT").shape});var hi=p({...F.shape,...D(a(),"COLOR").shape});var jr=N([oe,ve,Lt,_e,ie,xe,$r,lt,Sr,Pe,mt,Mr,ft,dt,pt,hi]),C={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 fe=p({displayName:a(),description:v(a())});var vi=p({username:a(),password:a()}),Lr=p({...fe.shape,username:p({displayName:a(),description:v(a())}),password:p({displayName:a(),description:v(a())}),...D(vi,"BASIC_AUTH").shape});var dl=k(a(),N([oe,ve,Pe,_e,ie])),Fr=p({...fe.shape,props:dl,...D(w(),"CUSTOM_AUTH").shape});var Ne=p({...fe.shape,...D(p({auth:a()}),"SECRET_TEXT").shape});var ml=k(a(),N([oe,ve,Ne,Pe,_e,ie,xe,Lt])),xi=p({...fe.shape,props:ml,...D(w(),"OIDC").shape});var Br=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Br||{}),_i=N([oe,Ne,ie]),Pi=k(a(),_i),fl=p({props:v(k(a(),_i)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:v(N([$("none"),$("consent"),$("login"),$("omit")])),pkce:v(B()),pkceMethod:v(N([$("plain"),$("S256")])),authorizationMethod:v(U(Br)),grantType:v(N([U(yt),$(Ar)])),extra:v(k(a(),a()))}),bi=p({access_token:a(),props:v(Pi),data:k(a(),st())}),Vr=p({...fe.shape,...fl.shape,...D(bi,"OAUTH2").shape});var We=N([Lr,Fr,xi,Vr,Ne]),Pt="Connection",Zr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Pt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Pt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Pt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Pt}},None(){}};var hE={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 gl=p({...F.shape,...D(w(),"CUSTOM").shape,code:a()});var yl=N([jr,We]),Hr=k(a(),yl),UE=k(a(),jr);var Ti=N([p({strategy:$("CRON"),cronExpression:a()}),p({strategy:$("NONE")})]),Ge=class{constructor(t,r,n,o,s,c,l,m,g,h,b,x,u,d,y,f,_,P,j){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=c;this.handshakeConfiguration=l;this.onHandshake=m;this.renewConfiguration=g;this.onRenew=h;this.onEnable=b;this.onDisable=x;this.onStart=u;this.run=d;this.test=y;this.sampleData=f;this.testStrategy=_;this.outputSchema=P;this.aiMetadata=j}static{i(this,"ITrigger")}},ge=i(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,ee(e.sampleData)&&ee(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Ii="2",Ht="0.82.0";var Wr=class{constructor(t,r,n,o,s,c,l,m,g=Ht,h,b=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=m;this.minimumSupportedRelease=g;this.maximumSupportedRelease=h;this.description=b;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Ii}),"getContextInfo");(!hl(g)||vl(g,Ht))&&(this.minimumSupportedRelease=Ht),s.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth: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}},Ei=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Wr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function hl(e){return/^\d+\.\d+\.\d+$/.test(e)}i(hl,"isValidSimpleSemver");function vl(e,t){let[r,n,o]=e.split(".").map(Number),[s,c,l]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:o<l}i(vl,"isSemverLessThan");var xl=v(k(a(),k(a(),a()))),$i=p({id:v(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:v(a()),directoryPath:v(a()),auth:v(N([We,R(We)])),version:a(),categories:v(R(U(Ve))),minimumSupportedRelease:v(a()),maximumSupportedRelease:v(a()),i18n:xl}),_l=U(["human","ai","both"]),Si=p({description:v(a()),idempotent:v(B())}),Ai=p({name:a(),displayName:a(),description:a(),props:Hr,requireAuth:B(),errorHandlingOptions:v(Er),outputSchema:v(Mt()),audience:v(_l),aiMetadata:v(Si)}),zi=p({name:a(),displayName:a(),description:a(),props:Hr,errorHandlingOptions:v(Er),type:U(se),sampleData:w(),handshakeConfiguration:v(Mt()),renewConfiguration:v(Ti),testStrategy:U(vt),outputSchema:v(Mt()),aiMetadata:v(Si)}),Pl=p({...$i.shape,actions:k(a(),Ai),triggers:k(a(),zi)}),bl=p({...$i.shape,actions:te(),triggers:te(),suggestedActions:v(R(zi)),suggestedTriggers:v(R(Ai))}),wi=p({projectUsage:te(),tags:v(R(a())),pieceType:U(Be),packageType:U(gt),platformId:v(a()),archiveId:v(a())}),U$=p({...Pl.shape,...wi.shape}),M$=p({...bl.shape,...wi.shape}),j$=p({name:a(),version:a()});var Tl=Ue(require("path")),Il=Ue(require("fs/promises"));var Wt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,c)=>{o.append(c,s)}),{urlWithoutQueryParams:n,queryParams:o}}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 Gt=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new Gr,r=new qr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Gr=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},qr=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var qt=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Xt=class extends Wt{static{i(this,"FetchHttpClient")}constructor(t="",r=new Gt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[j,ne]of Object.entries(c))o.append(j,ne);let l=o.toString(),m=l?`${n}?${l}`:n,g=t.responseType??"json",h=t.followRedirects??!0,b=t.retries??0,{body:x,extraHeaders:u,isStream:d}=El(t.body,s),y=Sl({...s,...u}),f=await $l(async()=>{let j=new AbortController,ne=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let ce={method:t.method.toString(),headers:y,body:x,redirect:h?"follow":"manual",signal:j.signal};return d&&(ce.duplex="half"),r?.dispatcher!==void 0&&(ce.dispatcher=r.dispatcher),await fetch(m,ce)}finally{ne!==void 0&&clearTimeout(ne)}},b),_=h?300:400;if(f.status<200||f.status>=_){let j=await ki(f,g),ne=new qt(t.body,{status:f.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ne),ne}let P=await ki(f,g);return{status:f.status,headers:Al(f.headers),body:P}}};function El(e,t){return wl(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}}i(El,"serializeBody");async function ki(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}}}}i(ki,"parseResponseBody");async function $l(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Oi(n);continue}return o}catch(o){if(r=o,n<t){await Oi(n);continue}throw o}throw r}i($l,"sendWithRetries");function Oi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Oi,"backoff");function Sl(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}i(Sl,"normalizeHeaders");function Al(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Al,"toHttpHeaders");function zl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}i(zl,"isNodeFormData");function wl(e){return e==null}i(wl,"isNil");var Y=new Xt;var pe=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(pe||{});var hd=Ue(require("fs")),Ms=Ue(Us());var vd={"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 xd(e){let t=e.split(";")[0].trim().toLowerCase();return vd[t]??""}i(xd,"contentTypeToExtension");var _d=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Pd=i((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:o,name:s,props:c,extraProps:l,authLocation:m="headers"}){return ae({audience:"human",name:s||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:C.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:g})=>({url:C.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
- i.e ${Pd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:C.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(pe).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:C.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:C.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:C.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:C.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:g})=>{if(!g)return{};let h=g,b={};switch(h){case"none":break;case"json":b.data=C.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":b.data=C.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=C.Array({displayName:"Form Data",required:!0,properties:{fieldName:C.ShortText({displayName:"Field Name",required:!0}),fieldType:C.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:C.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:C.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:C.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:C.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:C.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:C.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:i(async g=>{let{method:h,url:b,headers:x,queryParams:u,body:d,body_type:y,failsafe:f,timeout:_,response_is_binary:P,followRedirects:j}=g.propsValue;Bt(h,"Method"),Bt(b,"URL");let ne=ee(r)?{}:await r(g.auth,g.propsValue),ce=b.url,et=ce.startsWith("http://")||ce.startsWith("https://")?ce:_d({baseUrl:t(g.auth),relativePath:ce}),ke={method:h,url:et,headers:{...x??{},...m==="headers"||!ee(m)?ne:{}},queryParams:{...m==="queryParams"?ne:{},...u??{}},timeout:_?_*1e3:0,followRedirects:j};if(P&&(ke.responseType="arraybuffer"),d)if(y&&y!=="none"){let ye=d.data;if(y==="form_data"){let Ks=ye,Et=new Ms.default;for(let{fieldName:hn,fieldType:vn,textFieldValue:xn,fileFieldValue:cr}of Ks)vn==="text"&&!xt(xn)?Et.append(hn,xn):vn==="file"&&!xt(cr)&&Et.append(hn,cr.data,{filename:cr?.filename});ke.body=Et,ke.headers={...ke.headers,...Et.getHeaders()}}else ke.body=ye}else y||(ke.body=d);try{let ye=await Y.sendRequest(ke);return await bd(g.files,ye.body,ye.status,ye.headers,P)}catch(ye){if(f)return ye.errorMessage();throw ye}},"run")})}i(js,"createCustomApiCallAction");var bd=i(async(e,t,r,n,o)=>{let s;if(o&&Td(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=xd(c??"")||"txt",m;t instanceof ArrayBuffer?m=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?m=t:m=Buffer.from(t),s=await e.write({fileName:`output.${l}`,data:m})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),Td=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var J={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:s,server:c}){switch(e.strategy){case 0:{let l=await t.get("lastPoll");if(ee(l))throw new Error("lastPoll doesn't exist in the store.");let m=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:l,server:c}),g=m.reduce((h,b)=>Math.max(h,b.epochMilliSeconds),l);return await t.put("lastPoll",g),m.filter(h=>h.epochMilliSeconds>l).map(h=>h.data)}case 1:{let l=await t.get("lastItem"),m=await e.items({store:t,auth:r,propsValue:n,lastItemId:l,files:s,server:c}),g=m.findIndex(x=>x.id===l),h=[];ee(l)||g==-1?h=m??[]:h=m?.slice(0,g)??[],ee(o)||(h=h.slice(-o));let b=h?.[0]?.id;return ee(b)||await t.put("lastItem",b),h.map(x=>x.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;ee(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:s}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:s});break}}return Id(c.map(l=>l.data))}};function Id(e){return e.length<=5?e:e.slice(0,5)}i(Id,"getFirstFiveOrAll");var Qe={phone_number:C.Dropdown({auth:V,description:"The phone number to send the message from",displayName:"From",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"connect your account first",options:[]};let t=e;return{disabled:!1,options:(await Te("GET","IncomingPhoneNumbers.json",{account_sid:t.username,auth_token:t.password})).body.incoming_phone_numbers.map(n=>({value:n.phone_number,label:n.friendly_name}))}},"options")})},Te=i(async(e,t,r,n)=>await Y.sendRequest({method:e,url:`https://api.twilio.com/2010-04-01/Accounts/${r.account_sid}/${t}`,authentication:{type:"BASIC",username:r.account_sid,password:r.auth_token},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n}),"callTwilioApi");var Ls=ae({auth:V,name:"send_sms",description:"Send a new SMS message",audience:"both",aiMetadata:{description:"Sends an SMS text message from a Twilio phone number to a recipient. Use to notify or message a person by text. Requires the destination number, message body, and a Twilio-owned sender number; sending costs money and delivers a separate message on every call, so it is not idempotent.",idempotent:!1},displayName:"Send SMS",props:{from:Qe.phone_number,body:C.ShortText({description:"The body of the message to send",displayName:"Message Body",required:!0}),to:C.ShortText({description:"The phone number to send the message to",displayName:"To",required:!0})},async run(e){let{body:t,to:r,from:n}=e.propsValue,o=e.auth.username,s=e.auth.password;return await Te("POST","Messages.json",{account_sid:o,auth_token:s},{From:n,Body:t,To:r})}});var Fs=ge({auth:V,name:"new_incoming_sms",displayName:"New Incoming SMS",description:"Triggers when a new SMS message is received",aiMetadata:{description:"Fires when an inbound SMS message is received on the specified Twilio phone number. Each event represents one incoming text message with its sender, body, and metadata."},props:{phone_number:Qe.phone_number},sampleData:{body:"Hello",num_segments:"1",direction:"inbound",from:"+12184191735",date_updated:"Wed, 08 Feb 2023 01:40:51 +0000",price:null,error_message:null,uri:"/2010-04-01/Accounts/ACc0ea1238d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63.json",account_sid:"ACc0ea716d61fe90d78a123a3de71d45619",num_media:"0",to:"+12184191735",date_created:"Wed, 08 Feb 2023 01:40:50 +0000",status:"failed",sid:"SM8c3920d3f2ac481ba83e639a69dadd63",date_sent:"Wed, 08 Feb 2023 01:40:51 +0000",messaging_service_sid:"MG88e323e6a88ce67ba3bf12e1bcb7e0b8",error_code:21211,price_unit:"USD",api_version:"2010-04-01",subresource_uris:{media:"/2010-04-01/Accounts/ACc0ea716d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63/Media.json",feedback:"/2010-04-01/Accounts/ACc0ea716d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63/Feedback.json"}},type:"POLLING",async onEnable(e){let{phone_number:t}=e.propsValue,r=e.auth.username,n=e.auth.password,o=await Te("GET",`Messages.json?PageSize=20&To=${t}`,{account_sid:r,auth_token:n},{});await e.store.put("_new_incoming_sms_trigger",{lastMessageId:o.body.messages.length===0?null:o.body.messages[0].sid})},async onDisable(e){await e.store.put("_new_incoming_sms_trigger",null)},async run(e){let t=e.auth.username,r=e.auth.password,n=[],o=await e.store.get("_new_incoming_sms_trigger"),s=`2010-04-01/Accounts/${t}/Messages.json?PageSize=20&To=${e.propsValue.phone_number}`,c;for(;s!=null;){let l=await Y.sendRequest({method:"GET",url:`https://api.twilio.com/${s}`,authentication:{type:"BASIC",username:t,password:r}}),m=l.body.messages;!c&&m.length>0&&(c=m[0].sid),s=l.body.next_page_uri;for(let g=0;g<m.length;g++){let h=m[g];if(h.sid===o?.lastMessageId){s=null;break}h.direction==="inbound"&&n.push(h)}}return await e.store.put("_new_incoming_sms_trigger",{lastMessageId:c??o.lastMessageId}),n}});var Bs=ae({auth:V,name:"phone_number_lookup",description:"Lookup information about a phone number.",audience:"both",aiMetadata:{description:"Looks up carrier and line-type intelligence for a single phone number via the Twilio Lookup API. Use to validate or enrich a number (e.g. detect mobile vs landline, carrier) before messaging or calling it. Read-only and idempotent.",idempotent:!0},displayName:"Phone Number Lookup",props:{phone_number:C.ShortText({displayName:"Phone Number",required:!0})},async run(e){let{phone_number:t}=e.propsValue,r=e.auth.username,n=e.auth.password;return(await Y.sendRequest({method:"GET",url:`https://lookups.twilio.com/v2/PhoneNumbers/${encodeURIComponent(t)}`,authentication:{type:"BASIC",username:r,password:n},queryParams:{Fields:"line_type_intelligence"}})).body}});var Vs=ae({auth:V,name:"make_call",description:"Call a number and say a message.",audience:"both",aiMetadata:{description:"Places an outbound voice call from a Twilio number that reads a text-to-speech message to the recipient. Use to deliver a spoken notification or alert by phone. Requires both numbers in E.164 format and the message text; each call places a real, billable phone call, so it is not idempotent.",idempotent:!1},displayName:"Call Phone",props:{from:Qe.phone_number,to:C.ShortText({displayName:"To",description:"The phone number to call. Must be in E.164 format (e.g., +15558675310).",required:!0}),message:C.LongText({displayName:"Message to Say",description:"The text message to be converted to speech and spoken to the recipient.",required:!0}),voice:C.StaticDropdown({displayName:"Voice",description:"The voice to use for the text-to-speech message.",required:!1,options:{options:[{label:"Alice (Default)",value:"alice"},{label:"Man",value:"man"},{label:"Woman",value:"woman"}]}}),language:C.StaticDropdown({displayName:"Language",description:"The language to use for the text-to-speech message.",required:!1,options:{options:[{label:"English (US)",value:"en-US"},{label:"English (UK)",value:"en-GB"},{label:"Spanish",value:"es-ES"},{label:"French",value:"fr-FR"},{label:"German",value:"de-DE"}]}}),sendDigits:C.ShortText({displayName:"Send DTMF Tones",description:"A string of keys to dial after the call is connected. Use 'w' for a half-second pause.",required:!1}),timeout:C.Number({displayName:"Timeout (seconds)",description:"The number of seconds to let the phone ring before assuming no answer. Default is 60.",required:!1})},async run(e){let{from:t,to:r,message:n,voice:o,language:s,sendDigits:c,timeout:l}=e.propsValue,m=e.auth.username,g=e.auth.password,h=o?` voice="${o}"`:"",b=s?` language="${s}"`:"",x=n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"),u=`<Response><Say${h}${b}>${x}</Say></Response>`,d={From:t,To:r,Twiml:u};return c&&(d.SendDigits=c),l&&(d.Timeout=l),(await Te("POST","Calls.json",{account_sid:m,auth_token:g},d)).body}});var Zs=ae({auth:V,name:"get_message",description:"Retrieves the details of a specific message.",audience:"both",aiMetadata:{description:'Fetches the full details and status of a single Twilio message by its SID. Use to check delivery status or inspect a known message; requires the message SID (starting with "SM" or "MM"). Read-only and idempotent.',idempotent:!0},displayName:"Get Message",props:{message_sid:C.ShortText({displayName:"Message SID",description:'The unique identifier (SID) of the message to retrieve. It starts with "SM" or "MM".',required:!0})},async run(e){let{message_sid:t}=e.propsValue,r=e.auth.username,n=e.auth.password,o=`Messages/${t}.json`;return(await Te("GET",o,{account_sid:r,auth_token:n})).body}});var Hs=ae({auth:V,name:"download_recording_media",displayName:"Download Recording Media",description:"Download the media file for a specific recording.",audience:"both",aiMetadata:{description:'Downloads the audio file for a specific Twilio call recording by its SID, returning it as a file (MP3 or WAV). Use to retrieve recorded call audio for storage or further processing; requires the recording SID (starting with "RE"). Read-only and idempotent.',idempotent:!0},props:{recording_sid:C.ShortText({displayName:"Recording SID",description:'The unique identifier (SID) of the recording to download. It starts with "RE".',required:!0}),format:C.StaticDropdown({displayName:"Format",description:"The desired audio format for the download file.",required:!1,defaultValue:"mp3",options:{options:[{label:"MP3",value:"mp3"},{label:"WAV",value:"wav"}]}}),channels:C.StaticDropdown({displayName:"Channels",description:"Specify whether to download a mono or dual-channel file. Note: Dual-channel may not be available for all recordings.",required:!1,options:{options:[{label:"Mono",value:1},{label:"Dual",value:2}]}})},async run(e){let{recording_sid:t,format:r,channels:n}=e.propsValue,o=e.auth.username,s=e.auth.password,c=r??"mp3",l=`Recordings/${t}.${c}`,m={};n&&(m.RequestedChannels=n.toString());let g=await Y.sendRequest({method:"GET",url:`https://api.twilio.com/2010-04-01/Accounts/${o}/${l}`,queryParams:m,authentication:{type:"BASIC",username:o,password:s},responseType:"arraybuffer"}),h=Buffer.from(g.body);return await e.files.write({fileName:`${t}.${c}`,data:h})}});var ir={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/IncomingPhoneNumbers.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.incoming_phone_numbers??[];for(let b of h){let x=new Date(b.date_created).getTime();if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},Ws=ge({auth:V,name:"new_phone_number",displayName:"New Phone Number",description:"Triggers when you add a new phone number to your account.",aiMetadata:{description:"Fires when a new phone number is provisioned on the Twilio account. Each event represents one newly added incoming phone number with its capabilities and configuration."},props:{},sampleData:{sid:"PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",account_sid:"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",friendly_name:"(555) 123-4567",phone_number:"+15551234567",voice_url:"https://demo.twilio.com/welcome/voice/",voice_method:"POST",sms_url:"https://demo.twilio.com/welcome/sms/",sms_method:"POST",date_created:"2025-08-28T11:44:10+00:00",date_updated:"2025-08-28T11:44:10+00:00",capabilities:{voice:!0,sms:!0,mms:!0},uri:"/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"},type:"POLLING",async onEnable(e){await J.onEnable(ir,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(ir,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(ir,e)},async run(e){return await J.poll(ir,e)}});var ar={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Recordings.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.recordings??[];for(let b of h){let x=new Date(b.date_created).getTime();if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},Gs=ge({auth:V,name:"new_recording",displayName:"New Recording",description:"Triggers when a new call recording is completed and available.",aiMetadata:{description:"Fires when a new call recording becomes available on the Twilio account. Each event represents one completed recording, including its call SID, duration, and status."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",api_version:"2010-04-01",call_sid:"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",conference_sid:"CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",channels:1,date_created:"Fri, 14 Oct 2016 21:56:34 +0000",date_updated:"Fri, 14 Oct 2016 21:56:38 +0000",start_time:"Fri, 14 Oct 2016 21:56:34 +0000",price:"0.04",price_unit:"USD",duration:"4",sid:"REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",source:"StartConferenceRecordingAPI",status:"completed",error_code:null,uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",subresource_uris:{add_on_results:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json",transcriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json"},encryption_details:{encryption_public_key_sid:"CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",encryption_cek:"OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==",encryption_iv:"8I2hhNIYNTrwxfHk"},media_url:"http://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},type:"POLLING",async onEnable(e){await J.onEnable(ar,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(ar,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(ar,e)},async run(e){return await J.poll(ar,e)}});var sr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Transcriptions.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.transcriptions??[];for(let b of h){let x=new Date(b.date_created).getTime();if(b.status==="completed")if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},qs=ge({auth:V,name:"new_transcription",displayName:"New Transcription",description:"Triggers when a new call recording transcription is completed.",aiMetadata:{description:"Fires when a call recording transcription reaches completed status on the Twilio account. Each event represents one finished transcription tied to a recording, including its transcribed text."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",api_version:"2008-08-01",date_created:"Thu, 25 Aug 2011 20:59:45 +0000",date_updated:"Thu, 25 Aug 2011 20:59:45 +0000",duration:"10",price:"0.00000",price_unit:"USD",recording_sid:"REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",sid:"TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",status:"completed",transcription_text:null,type:"fast",uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"},type:"POLLING",async onEnable(e){await J.onEnable(sr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(sr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(sr,e)},async run(e){return await J.poll(sr,e)}});var ur={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Calls.json?PageSize=${r?1:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.calls??[];for(let b of h){let x=new Date(b.date_created).getTime();if(b.status==="completed")if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},Xs=ge({auth:V,name:"new_call",displayName:"New Call",description:"Triggers when a call completes (incoming or outgoing).",aiMetadata:{description:"Fires when a voice call reaches completed status on the Twilio account, for both inbound and outbound calls. Each event represents one finished call with its direction, participants, duration, and status."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",answered_by:"machine_start",api_version:"2010-04-01",caller_name:"callerid1",date_created:"Fri, 18 Oct 2019 17:00:00 +0000",date_updated:"Fri, 18 Oct 2019 17:01:00 +0000",direction:"outbound-api",duration:"4",end_time:"Fri, 18 Oct 2019 17:03:00 +0000",forwarded_from:"calledvia1",from:"+13051416799",from_formatted:"(305) 141-6799",group_sid:"GPdeadbeefdeadbeefdeadbeefdeadbeef",parent_call_sid:"CAdeadbeefdeadbeefdeadbeefdeadbeef",phone_number_sid:"PNdeadbeefdeadbeefdeadbeefdeadbeef",price:"-0.200",price_unit:"USD",sid:"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",start_time:"Fri, 18 Oct 2019 17:02:00 +0000",status:"completed",subresource_uris:{notifications:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",recordings:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",payments:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",events:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",siprec:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",streams:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",transcriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",user_defined_message_subscriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",user_defined_messages:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"},to:"+13051913581",to_formatted:"(305) 191-3581",trunk_sid:"TKdeadbeefdeadbeefdeadbeefdeadbeef",uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",queue_time:"1000"},type:"POLLING",async onEnable(e){await J.onEnable(ur,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(ur,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(ur,e)},async run(e){return await J.poll(ur,e)}});var V=Zr.BasicAuth({description:"The authentication to use to connect to Twilio",required:!0,username:{displayName:"Account SID",description:"The account SID to use to connect to Twilio"},password:{displayName:"Auth token",description:"The auth token to use to connect to Twilio"}}),Ed=Ei({displayName:"Twilio",description:"Cloud communications platform for building SMS, Voice & Messaging applications",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/twilio.png",auth:V,categories:["COMMUNICATION"],actions:[Ls,Bs,Vs,Zs,Hs,js({baseUrl:i(()=>"https://api.twilio.com/2010-04-01","baseUrl"),auth:V,authMapping:i(async e=>({Authorization:`Basic ${Buffer.from(`${e.username}:${e.password}`).toString("base64")}`}),"authMapping")})],authors:["kishanprmr","MoShizzle","khaledmashaly","abuaboud"],triggers:[Fs,Ws,Gs,qs,Xs]});0&&(module.exports={twilio,twilioAuth});
1
+ "use strict";var xu=Object.create;var nt=Object.defineProperty;var Pu=Object.getOwnPropertyDescriptor;var bu=Object.getOwnPropertyNames;var Tu=Object.getPrototypeOf,Iu=Object.prototype.hasOwnProperty;var i=(e,t)=>nt(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},An=(e,t)=>{for(var r in t)nt(e,r,{get:t[r],enumerable:!0})},Sn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of bu(t))!Iu.call(e,o)&&o!==r&&nt(e,o,{get:()=>t[o],enumerable:!(n=Pu(t,o))||n.enumerable});return e};var Fe=(e,t,r)=>(r=e!=null?xu(Tu(e)):{},Sn(t||!e||!e.__esModule?nt(r,"default",{value:e,enumerable:!0}):r,e)),Eu=e=>Sn(nt({},"__esModule",{value:!0}),e);var Qo=E((Yo,Xt)=>{(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"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function m(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let v=0,f=-1,x=(u.match(p.zoneIndex)||[])[0],P,L;for(x&&(x=x.substring(1),u=u.replace(/%.+$/,""));(f=u.indexOf(":",f+1))>=0;)v++;if(u.substr(0,2)==="::"&&v--,u.substr(-2,2)==="::"&&v--,v>d)return null;for(L=d-v,P=":";L--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=(function(){let ne=u.split(":"),de=[];for(let Ee=0;Ee<ne.length;Ee++)de.push(parseInt(ne[Ee],16));return de})(),{parts:d,zoneId:x}}i(m,"expandIPv6");function h(u,d,v,f){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,P;for(;f>0;){if(P=v-f,P<0&&(P=0),u[x]>>P!==d[x]>>P)return!1;f-=v,x+=1}return!0}i(h,"matchCIDR");function y(u){if(o.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}i(y,"parseIntAuto");function b(u,d){for(;u.length<d;)u=`0${u}`;return u}i(b,"padPart");let _={};_.IPv4=(function(){function u(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let v,f;for(v=0;v<d.length;v++)if(f=d[v],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return i(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(d,v){let f;if(v===void 0&&(f=d,d=f[0],v=f[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,v)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,v=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,P,L;for(x=3;x>=0;x-=1)if(P=this.octets[x],P in f){if(L=f[P],v&&L!==0)return null;L!==8&&(v=!0),d+=L}else return null;return 32-d},u.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u})(),_.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),v=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<4;)x.push(parseInt(v[P],10)|parseInt(f[P],10)^255),P++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(u){return this.parser(u)!==null},_.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(u){return!!(_.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(u)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(u){let d,v,f,x,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],v=0;v<4;)x.push(parseInt(f[v],10)&parseInt(P[v],10)),v++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(u){let d=this.parser(u);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(u){let d;if(d=u.match(/^(.+)\/(\d+)$/)){let v=parseInt(d[2]);if(v>=0&&v<=32){let f=[this.parse(d[1]),v];return Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(u){let d,v,f;if(d=u.match(r.fourOctet))return(function(){let x=d.slice(1,6),P=[];for(let L=0;L<x.length;L++)v=x[L],P.push(y(v));return P})();if(d=u.match(r.longValue)){if(f=y(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],P;for(P=0;P<=24;P+=8)x.push(f>>P&255);return x})().reverse()}else return(d=u.match(r.twoOctet))?(function(){let x=d.slice(1,4),P=[];if(f=y(x[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(y(x[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P})():(d=u.match(r.threeOctet))?(function(){let x=d.slice(1,5),P=[];if(f=y(x[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(y(x[0])),P.push(y(x[1])),P.push(f>>8&255),P.push(f&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],v=0,f=Math.floor(u/8);for(;v<f;)d[v]=255,v++;return f<4&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},_.IPv6=(function(){function u(d,v){let f,x;if(d.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(d[f]<<8|d[f+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(x=this.parts[f],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");v&&(this.zoneId=v)}return i(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(d,v){let f;if(v===void 0&&(f=d,d=f[0],v=f[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,v)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,v=!1,f={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},x,P;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in f){if(P=f[x],v&&P!==0)return null;P!==16&&(v=!0),d+=P}else return null;return 128-d},u.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,v=[],f=this.parts;for(let x=0;x<f.length;x++)d=f[x],v.push(d>>8),v.push(d&255);return v},u.prototype.toFixedLengthString=function(){let d=(function(){let f=[];for(let x=0;x<this.parts.length;x++)f.push(b(this.parts[x].toString(16),4));return f}).call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),d+v},u.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),v=d[0],f=d[1];return new _.IPv4([v>>8,v&255,f>>8,f&255])},u.prototype.toNormalizedString=function(){let d=(function(){let f=[];for(let x=0;x<this.parts.length;x++)f.push(this.parts[x].toString(16));return f}).call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),d+v},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,v=this.toNormalizedString(),f=0,x=-1,P;for(;P=d.exec(v);)P[0].length>x&&(f=P.index,x=P[0].length);return x<0?v:`${v.substring(0,f)}::${v.substring(f+x)}`},u.prototype.toString=function(){return this.toRFC5952String()},u})(),_.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),v=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<16;)x.push(parseInt(v[P],10)|parseInt(f[P],10)^255),P++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(u){return this.parser(u)!==null},_.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let d=this.parser(u);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(u){let d,v,f,x,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],v=0;v<16;)x.push(parseInt(f[v],10)&parseInt(P[v],10)),v++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},_.IPv6.parse=function(u){let d=this.parser(u);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(u){let d,v,f;if((v=u.match(/^(.+)\/(\d+)$/))&&(d=parseInt(v[2]),d>=0&&d<=128))return f=[this.parse(v[1]),d],Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(u){let d,v,f,x,P,L;if(f=u.match(p.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(p.native.test(u))return m(u,8);if((f=u.match(p.transitional))&&(L=f[6]||"",d=f[1],f[1].endsWith("::")||(d=d.slice(0,-1)),d=m(d+L,6),d.parts)){for(P=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],v=0;v<P.length;v++)if(x=P[v],!(0<=x&&x<=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(u){if(u=parseInt(u),u<0||u>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],v=0,f=Math.floor(u/8);for(;v<f;)d[v]=255,v++;return f<16&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},_.fromByteArray=function(u){let d=u.length;if(d===4)return new _.IPv4(u);if(d===16)return new _.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(u){return _.IPv6.isValid(u)||_.IPv4.isValid(u)},_.isValidCIDR=function(u){return _.IPv6.isValidCIDR(u)||_.IPv4.isValidCIDR(u)},_.parse=function(u){if(_.IPv6.isValid(u))return _.IPv6.parse(u);if(_.IPv4.isValid(u))return _.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(u){try{return _.IPv6.parseCIDR(u)}catch{try{return _.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(u,d,v){let f,x,P,L;v==null&&(v="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(P=d[x],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(L=P[f],u.kind()===L[0].kind()&&u.match.apply(u,L))return x}return v},typeof Xt<"u"&&Xt.exports?Xt.exports=_:e.ipaddr=_})(Yo)});var na=E((ez,ra)=>{var ta=require("stream").Stream,cl=require("util");ra.exports=le;function le(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(le,"DelayedStream");cl.inherits(le,ta);le.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(le.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});le.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};le.prototype.resume=function(){this._released||this.release(),this.source.resume()};le.prototype.pause=function(){this.source.pause()};le.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};le.prototype.pipe=function(){var e=ta.prototype.pipe.apply(this,arguments);return this.resume(),e};le.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)};le.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 sa=E((rz,aa)=>{var pl=require("util"),ia=require("stream").Stream,oa=na();aa.exports=q;function q(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}i(q,"CombinedStream");pl.inherits(q,ia);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof oa)){var r=oa.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};q.prototype.pipe=function(e,t){return ia.prototype.pipe.call(this,e,t),this.resume(),e};q.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}};q.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=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.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()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.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")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.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)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ca=E((oz,ua)=>{"use strict";ua.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 da=E(re=>{"use strict";var er=ca(),ll=require("path").extname,pa=/^\s*([^;\s]*)(?:;|\s|$)/,dl=/^text\//i;re.charset=la;re.charsets={lookup:la};re.contentType=ml;re.extension=fl;re.extensions=Object.create(null);re.lookup=gl;re.types=Object.create(null);yl(re.extensions,re.types);function la(e){if(!e||typeof e!="string")return!1;var t=pa.exec(e),r=t&&er[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&dl.test(t[1])?"UTF-8":!1}i(la,"charset");function ml(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?re.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=re.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(ml,"contentType");function fl(e){if(!e||typeof e!="string")return!1;var t=pa.exec(e),r=t&&re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(fl,"extension");function gl(e){if(!e||typeof e!="string")return!1;var t=ll("x."+e).toLowerCase().substr(1);return t&&re.types[t]||!1}i(gl,"lookup");function yl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(er).forEach(i(function(o){var s=er[o],c=s.extensions;if(!(!c||!c.length)){e[o]=c;for(var p=0;p<c.length;p++){var m=c[p];if(t[m]){var h=r.indexOf(er[t[m]].source),y=r.indexOf(s.source);if(t[m]!=="application/octet-stream"&&(h>y||h===y&&t[m].substr(0,12)==="application/"))continue}t[m]=o}}},"forEachMimeType"))}i(yl,"populateMaps")});var fa=E((sz,ma)=>{ma.exports=hl;function hl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(hl,"defer")});var tn=E((cz,ya)=>{var ga=fa();ya.exports=vl;function vl(e){var t=!1;return ga(function(){t=!0}),i(function(n,o){t?e(n,o):ga(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(vl,"async")});var rn=E((lz,ha)=>{ha.exports=_l;function _l(e){Object.keys(e.jobs).forEach(xl.bind(e)),e.jobs={}}i(_l,"abort");function xl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(xl,"clean")});var nn=E((mz,_a)=>{var va=tn(),Pl=rn();_a.exports=bl;function bl(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Tl(t,o,e[o],function(s,c){o in r.jobs&&(delete r.jobs[o],s?Pl(r):r.results[o]=c,n(s,r.results))})}i(bl,"iterate");function Tl(e,t,r,n){var o;return e.length==2?o=e(r,va(n)):o=e(r,t,va(n)),o}i(Tl,"runJob")});var on=E((gz,xa)=>{xa.exports=Il;function Il(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(o,s){return t(e[o],e[s])}),n}i(Il,"state")});var an=E((hz,Pa)=>{var El=rn(),Al=tn();Pa.exports=Sl;function Sl(e){Object.keys(this.jobs).length&&(this.index=this.size,El(this),Al(e)(null,this.results))}i(Sl,"terminator")});var Ta=E((_z,ba)=>{var $l=nn(),zl=on(),wl=an();ba.exports=Ol;function Ol(e,t,r){for(var n=zl(e);n.index<(n.keyedList||e).length;)$l(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return wl.bind(n,r)}i(Ol,"parallel")});var sn=E((Pz,tr)=>{var Ia=nn(),kl=on(),Rl=an();tr.exports=Dl;tr.exports.ascending=Ea;tr.exports.descending=Nl;function Dl(e,t,r,n){var o=kl(e,r);return Ia(e,t,o,i(function s(c,p){if(c){n(c,p);return}if(o.index++,o.index<(o.keyedList||e).length){Ia(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),Rl.bind(o,n)}i(Dl,"serialOrdered");function Ea(e,t){return e<t?-1:e>t?1:0}i(Ea,"ascending");function Nl(e,t){return-1*Ea(e,t)}i(Nl,"descending")});var Sa=E((Tz,Aa)=>{var Cl=sn();Aa.exports=Ul;function Ul(e,t,r){return Cl(e,t,null,r)}i(Ul,"serial")});var za=E((Ez,$a)=>{$a.exports={parallel:Ta(),serial:Sa(),serialOrdered:sn()}});var un=E((Az,wa)=>{"use strict";wa.exports=Object});var ka=E((Sz,Oa)=>{"use strict";Oa.exports=Error});var Da=E(($z,Ra)=>{"use strict";Ra.exports=EvalError});var Ca=E((zz,Na)=>{"use strict";Na.exports=RangeError});var Ma=E((wz,Ua)=>{"use strict";Ua.exports=ReferenceError});var ja=E((Oz,La)=>{"use strict";La.exports=SyntaxError});var rr=E((kz,Fa)=>{"use strict";Fa.exports=TypeError});var Va=E((Rz,Ba)=>{"use strict";Ba.exports=URIError});var Ha=E((Dz,Za)=>{"use strict";Za.exports=Math.abs});var Wa=E((Nz,Ga)=>{"use strict";Ga.exports=Math.floor});var Xa=E((Cz,qa)=>{"use strict";qa.exports=Math.max});var Ja=E((Uz,Ka)=>{"use strict";Ka.exports=Math.min});var Qa=E((Mz,Ya)=>{"use strict";Ya.exports=Math.pow});var ts=E((Lz,es)=>{"use strict";es.exports=Math.round});var ns=E((jz,rs)=>{"use strict";rs.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var is=E((Bz,os)=>{"use strict";var Ml=ns();os.exports=i(function(t){return Ml(t)||t===0?t:t<0?-1:1},"sign")});var ss=E((Zz,as)=>{"use strict";as.exports=Object.getOwnPropertyDescriptor});var cn=E((Hz,us)=>{"use strict";var nr=ss();if(nr)try{nr([],"length")}catch{nr=null}us.exports=nr});var ps=E((Gz,cs)=>{"use strict";var or=Object.defineProperty||!1;if(or)try{or({},"a",{value:1})}catch{or=!1}cs.exports=or});var pn=E((Wz,ls)=>{"use strict";ls.exports=i(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 o=42;t[r]=o;for(var s 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 p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==o||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var fs=E((Xz,ms)=>{"use strict";var ds=typeof Symbol<"u"&&Symbol,Ll=pn();ms.exports=i(function(){return typeof ds!="function"||typeof Symbol!="function"||typeof ds("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ll()},"hasNativeSymbols")});var ln=E((Jz,gs)=>{"use strict";gs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var dn=E((Yz,ys)=>{"use strict";var jl=un();ys.exports=jl.getPrototypeOf||null});var _s=E((Qz,vs)=>{"use strict";var Fl="Function.prototype.bind called on incompatible ",Bl=Object.prototype.toString,Vl=Math.max,Zl="[object Function]",hs=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),Hl=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),Gl=i(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");vs.exports=i(function(t){var r=this;if(typeof r!="function"||Bl.apply(r)!==Zl)throw new TypeError(Fl+r);for(var n=Hl(arguments,1),o,s=i(function(){if(this instanceof o){var y=r.apply(this,hs(n,arguments));return Object(y)===y?y:this}return r.apply(t,hs(n,arguments))},"binder"),c=Vl(0,r.length-n.length),p=[],m=0;m<c;m++)p[m]="$"+m;if(o=Function("binder","return function ("+Gl(p,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=i(function(){},"Empty");h.prototype=r.prototype,o.prototype=new h,h.prototype=null}return o},"bind")});var Je=E((tw,xs)=>{"use strict";var Wl=_s();xs.exports=Function.prototype.bind||Wl});var ir=E((rw,Ps)=>{"use strict";Ps.exports=Function.prototype.call});var mn=E((nw,bs)=>{"use strict";bs.exports=Function.prototype.apply});var Is=E((ow,Ts)=>{"use strict";Ts.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var As=E((iw,Es)=>{"use strict";var ql=Je(),Xl=mn(),Kl=ir(),Jl=Is();Es.exports=Jl||ql.call(Kl,Xl)});var $s=E((aw,Ss)=>{"use strict";var Yl=Je(),Ql=rr(),ed=ir(),td=As();Ss.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new Ql("a function is required");return td(Yl,ed,t)},"callBindBasic")});var Ds=E((uw,Rs)=>{"use strict";var rd=$s(),zs=cn(),Os;try{Os=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var fn=!!Os&&zs&&zs(Object.prototype,"__proto__"),ks=Object,ws=ks.getPrototypeOf;Rs.exports=fn&&typeof fn.get=="function"?rd([fn.get]):typeof ws=="function"?i(function(t){return ws(t==null?t:ks(t))},"getDunder"):!1});var Ls=E((pw,Ms)=>{"use strict";var Ns=ln(),Cs=dn(),Us=Ds();Ms.exports=Ns?i(function(t){return Ns(t)},"getProto"):Cs?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Cs(t)},"getProto"):Us?i(function(t){return Us(t)},"getProto"):null});var gn=E((dw,js)=>{"use strict";var nd=Function.prototype.call,od=Object.prototype.hasOwnProperty,id=Je();js.exports=id.call(nd,od)});var Ws=E((mw,Gs)=>{"use strict";var M,ad=un(),sd=ka(),ud=Da(),cd=Ca(),pd=Ma(),tt=ja(),et=rr(),ld=Va(),dd=Ha(),md=Wa(),fd=Xa(),gd=Ja(),yd=Qa(),hd=ts(),vd=is(),Zs=Function,yn=i(function(e){try{return Zs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Et=cn(),_d=ps(),hn=i(function(){throw new et},"throwTypeError"),xd=Et?(function(){try{return arguments.callee,hn}catch{try{return Et(arguments,"callee").get}catch{return hn}}})():hn,Ye=fs()(),te=Ls(),Pd=dn(),bd=ln(),Hs=mn(),At=ir(),Qe={},Td=typeof Uint8Array>"u"||!te?M:te(Uint8Array),Le={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ye&&te?te([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":Qe,"%AsyncGenerator%":Qe,"%AsyncGeneratorFunction%":Qe,"%AsyncIteratorPrototype%":Qe,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":sd,"%eval%":eval,"%EvalError%":ud,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":Zs,"%GeneratorFunction%":Qe,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ye&&te?te(te([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ye||!te?M:te(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":ad,"%Object.getOwnPropertyDescriptor%":Et,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":cd,"%ReferenceError%":pd,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ye||!te?M:te(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ye&&te?te(""[Symbol.iterator]()):M,"%Symbol%":Ye?Symbol:M,"%SyntaxError%":tt,"%ThrowTypeError%":xd,"%TypedArray%":Td,"%TypeError%":et,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":ld,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":At,"%Function.prototype.apply%":Hs,"%Object.defineProperty%":_d,"%Object.getPrototypeOf%":Pd,"%Math.abs%":dd,"%Math.floor%":md,"%Math.max%":fd,"%Math.min%":gd,"%Math.pow%":yd,"%Math.round%":hd,"%Math.sign%":vd,"%Reflect.getPrototypeOf%":bd};if(te)try{null.error}catch(e){Fs=te(te(e)),Le["%Error.prototype%"]=Fs}var Fs,Id=i(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 o=e("%AsyncGenerator%");o&&te&&(r=te(o.prototype))}return Le[t]=r,r},"doEval"),Bs={__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"]},St=Je(),ar=gn(),Ed=St.call(At,Array.prototype.concat),Ad=St.call(Hs,Array.prototype.splice),Vs=St.call(At,String.prototype.replace),sr=St.call(At,String.prototype.slice),Sd=St.call(At,RegExp.prototype.exec),$d=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,zd=/\\(\\)?/g,wd=i(function(t){var r=sr(t,0,1),n=sr(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 o=[];return Vs(t,$d,function(s,c,p,m){o[o.length]=p?Vs(m,zd,"$1"):c||s}),o},"stringToPath"),Od=i(function(t,r){var n=t,o;if(ar(Bs,n)&&(o=Bs[n],n="%"+o[0]+"%"),ar(Le,n)){var s=Le[n];if(s===Qe&&(s=Id(n)),typeof s>"u"&&!r)throw new et("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new tt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Gs.exports=i(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(Sd(/^%?[^%]*%?$/,t)===null)throw new tt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=wd(t),o=n.length>0?n[0]:"",s=Od("%"+o+"%",r),c=s.name,p=s.value,m=!1,h=s.alias;h&&(o=h[0],Ad(n,Ed([0,1],h)));for(var y=1,b=!0;y<n.length;y+=1){var _=n[y],u=sr(_,0,1),d=sr(_,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new tt("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(m=!0),o+="."+_,c="%"+o+"%",ar(Le,c))p=Le[c];else if(p!=null){if(!(_ in p)){if(!r)throw new et("base intrinsic for "+t+" exists, but the property is not available.");return}if(Et&&y+1>=n.length){var v=Et(p,_);b=!!v,b&&"get"in v&&!("originalValue"in v.get)?p=v.get:p=p[_]}else b=ar(p,_),p=p[_];b&&!m&&(Le[c]=p)}}return p},"GetIntrinsic")});var Xs=E((gw,qs)=>{"use strict";var kd=pn();qs.exports=i(function(){return kd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ys=E((hw,Js)=>{"use strict";var Rd=Ws(),Ks=Rd("%Object.defineProperty%",!0),Dd=Xs()(),Nd=gn(),Cd=rr(),ur=Dd?Symbol.toStringTag:null;Js.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new Cd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ur&&(n||!Nd(t,ur))&&(Ks?Ks(t,ur,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[ur]=r)},"setToStringTag")});var eu=E((_w,Qs)=>{"use strict";var Ud=Function.prototype.call,Md=Object.prototype.hasOwnProperty,Ld=Je();Qs.exports=Ld.call(Ud,Md)});var ru=E((xw,tu)=>{"use strict";tu.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var iu=E((Pw,ou)=>{"use strict";var Pn=sa(),jd=require("util"),vn=require("path"),Fd=require("http"),Bd=require("https"),Vd=require("url").parse,Zd=require("fs"),Hd=require("stream").Stream,Gd=require("crypto"),_n=da(),Wd=za(),qd=Ys(),Ce=eu(),xn=ru();function nu(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(nu,"escapeHeaderParam");function B(e){if(!(this instanceof B))return new B(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Pn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(B,"FormData");jd.inherits(B,Pn);B.LINE_BREAK=`\r
2
+ `;B.DEFAULT_CONTENT_TYPE="application/octet-stream";B.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=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 o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,t,r)};B.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+B.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ce(t,"httpVersion"))&&!(t instanceof Hd))&&(r.knownLength||this._valuesToMeasure.push(t))};B.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)):Zd.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):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")};B.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+nu(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&xn(c,r.header);var p;for(var m in c)if(Ce(c,m)){if(p=c[m],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(s+=m+": "+p.join("; ")+B.LINE_BREAK)}return"--"+this.getBoundary()+B.LINE_BREAK+s+B.LINE_BREAK};B.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="'+nu(r)+'"'};B.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=B.DEFAULT_CONTENT_TYPE),r};B.prototype._multiPartFooter=function(){return function(e){var t=B.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};B.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+B.LINE_BREAK};B.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ce(e,t)&&(r[t.toLowerCase()]=e[t]);return r};B.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};B.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};B.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(B.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};B.prototype._generateBoundary=function(){this._boundary="--------------------------"+Gd.randomBytes(12).toString("hex")};B.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};B.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};B.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Wd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};B.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=Vd(e),n=xn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=xn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Bd.request(n):r=Fd.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,m=i(function(h,y){return r.removeListener("error",m),r.removeListener("response",p),t.call(this,h,y)},"callback");p=m.bind(this,null),r.on("error",m),r.on("response",p)}}.bind(this)),r};B.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};B.prototype.toString=function(){return"[object FormData]"};qd(B.prototype,"FormData");ou.exports=B});var om={};An(om,{twilio:()=>nm,twilioAuth:()=>V});module.exports=Eu(om);var Au=Object.freeze({status:"aborted"});function T(e,t,r){function n(p,m){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,m);let h=c.prototype,y=Object.keys(h);for(let b=0;b<y.length;b++){let _=y[b];_ in p||(p[_]=h[_].bind(p))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(p){var m;let h=r?.Parent?new s:this;n(h,p),(m=h._zod).deferred??(m.deferred=[]);for(let y of h._zod.deferred)y();return h}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(T,"$constructor");var me=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},zt=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},fr={};function ve(e){return e&&Object.assign(fr,e),fr}i(ve,"config");function yr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(yr,"getEnumValues");function zn(e,t){return typeof t=="bigint"?t.toString():t}i(zn,"jsonStringifyReplacer");function Ot(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Ot,"cached");function wn(e){return e==null}i(wn,"nullish");function kt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(kt,"cleanRegex");var $n=Symbol("evaluating");function K(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==$n)return n===void 0&&(n=$n,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(K,"defineLazy");var hr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ot(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(ot,"isObject");var Su=Ot(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function On(e){if(ot(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ot(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(On,"isPlainObject");var kn=new Set(["string","number","symbol"]);function Be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Be,"escapeRegex");function Rt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(Rt,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>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:i(()=>t.error,"error")}:t}i(Z,"normalizeParams");function Rn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(Rn,"optionalKeys");var Dn={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}i(Ve,"aborted");function Se(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Se,"prefixIssues");function wt(e){return typeof e=="string"?e:e?.message}i(wt,"unwrapMessage");function $e(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=wt(e.inst?._zod.def?.error?.(e))??wt(t?.error?.(e))??wt(r.customError?.(e))??wt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i($e,"finalizeIssue");function Nn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(Nn,"getLengthableOrigin");function vr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(vr,"issue");var Cn=i((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,zn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),Un=T("$ZodError",Cn),it=T("$ZodError",Cn,{Parent:Error});var zu=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new me;if(c.issues.length){let p=new(o?.Err??e)(c.issues.map(m=>$e(m,s,ve())));throw hr(p,o?.callee),p}return c.value},"_parse"),Dt=zu(it),wu=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(o?.Err??e)(c.issues.map(m=>$e(m,s,ve())));throw hr(p,o?.callee),p}return c.value},"_parseAsync"),Nt=wu(it),Ou=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new me;return s.issues.length?{success:!1,error:new(e??Un)(s.issues.map(c=>$e(c,o,ve())))}:{success:!0,data:s.value}},"_safeParse"),at=Ou(it),ku=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>$e(c,o,ve())))}:{success:!0,data:s.value}},"_safeParseAsync"),st=ku(it);var Ru="(?:(?:\\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])))",Du=new RegExp(`^${Ru}$`);var Mn=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Ln=/^-?\d+n?$/,jn=/^-?\d+$/,_r=/^-?\d+(?:\.\d+)?$/,Fn=/^(?:true|false)$/i;var ze=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Nu={number:"number",bigint:"bigint",object:"date"};var Bn=T("$ZodCheckGreaterThan",(e,t)=>{ze.init(e,t);let r=Nu[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.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 Vn=T("$ZodCheckNumberFormat",(e,t)=>{ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=Dn[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=o,p.maximum=s,r&&(p.pattern=jn)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,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:p,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}}p<o&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),p>s&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Zn=T("$ZodCheckMinLength",(e,t)=>{var r;ze.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!wn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let c=Nn(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var xr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;ze.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Hn=T("$ZodCheckRegex",(e,t)=>{xr.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 Wn={major:4,minor:3,patch:6};var W=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Wn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((c,p,m)=>{let h=Ve(c),y;for(let b of p){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(h)continue;let _=c.issues.length,u=b._zod.check(c);if(u instanceof Promise&&m?.async===!1)throw new me;if(y||u instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await u,c.issues.length!==_&&(h||(h=Ve(c,_)))});else{if(c.issues.length===_)continue;h||(h=Ve(c,_))}}return y?y.then(()=>c):c},"runChecks"),s=i((c,p,m)=>{if(Ve(c))return c.aborted=!0,c;let h=o(p,n,m);if(h instanceof Promise){if(m.async===!1)throw new me;return h.then(y=>e._zod.parse(y,m))}return e._zod.parse(h,m)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return h instanceof Promise?h.then(y=>s(y,c,p)):s(h,c,p)}let m=e._zod.parse(c,p);if(m instanceof Promise){if(p.async===!1)throw new me;return m.then(h=>o(h,n,p))}return o(m,n,p)}}K(e,"~standard",()=>({validate:i(o=>{try{let s=at(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return st(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Mt=T("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Mn(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}}),Pr=T("$ZodStringFormat",(e,t)=>{xr.init(e,t),Mt.init(e,t)});var Yn=T("$ZodURL",(e,t)=>{Pr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.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(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var br=T("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??_r,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Qn=T("$ZodNumberFormat",(e,t)=>{Vn.init(e,t),br.init(e,t)}),Tr=T("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=Fn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),eo=T("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=Ln,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 to=T("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),ro=T("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r});var no=T("$ZodVoid",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),oo=T("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function qn(e,t,r){e.issues.length&&t.issues.push(...Se(r,e.issues)),t.value[r]=e.value}i(qn,"handleArrayResult");var io=T("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let c=0;c<o.length;c++){let p=o[c],m=t.element._zod.run({value:p,issues:[]},n);m instanceof Promise?s.push(m.then(h=>qn(h,r,c))):qn(m,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Ut(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Se(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(Ut,"handlePropertyResult");function Cu(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=Rn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(Cu,"normalizeDef");function Uu(e,t,r,n,o,s){let c=[],p=o.keySet,m=o.catchall._zod,h=m.def.type,y=m.optout==="optional";for(let b in t){if(p.has(b))continue;if(h==="never"){c.push(b);continue}let _=m.run({value:t[b],issues:[]},n);_ instanceof Promise?e.push(_.then(u=>Ut(u,r,b,t,y))):Ut(_,r,b,t,y)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(Uu,"handleCatchall");var ao=T("$ZodObject",(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let m={...p};return Object.defineProperty(t,"shape",{value:m}),m},"get")})}let n=Ot(()=>Cu(t));K(e._zod,"propValues",()=>{let p=t.shape,m={};for(let h in p){let y=p[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(let b of y.values)m[h].add(b)}}return m});let o=ot,s=t.catchall,c;e._zod.parse=(p,m)=>{c??(c=n.value);let h=p.value;if(!o(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;p.value={};let y=[],b=c.shape;for(let _ of c.keys){let u=b[_],d=u._zod.optout==="optional",v=u._zod.run({value:h[_],issues:[]},m);v instanceof Promise?y.push(v.then(f=>Ut(f,p,_,h,d))):Ut(v,p,_,h,d)}return s?Uu(y,h,p,m,n.value,e):y.length?Promise.all(y).then(()=>p):p}});function Xn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!Ve(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>$e(c,n,ve())))}),t)}i(Xn,"handleUnionResults");var Ir=T("$ZodUnion",(e,t)=>{W.init(e,t),K(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),K(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),K(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),K(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>kt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let c=!1,p=[];for(let m of t.options){let h=m._zod.run({value:o.value,issues:[]},s);if(h instanceof Promise)p.push(h),c=!0;else{if(h.issues.length===0)return h;p.push(h)}}return c?Promise.all(p).then(m=>Xn(m,o,e,s)):Xn(p,o,e,s)}});var so=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ir.init(e,t);let r=e._zod.parse;K(e._zod,"propValues",()=>{let o={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[p,m]of Object.entries(c)){o[p]||(o[p]=new Set);for(let h of m)o[p].add(h)}}return o});let n=Ot(()=>{let o=t.options,s=new Map;for(let c of o){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let m of p){if(s.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);s.set(m,c)}}return s});e._zod.parse=(o,s)=>{let c=o.value;if(!ot(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var uo=T("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!On(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){p.add(typeof h=="number"?h.toString():h);let y=t.valueType._zod.run({value:o[h],issues:[]},n);y instanceof Promise?s.push(y.then(b=>{b.issues.length&&r.issues.push(...Se(h,b.issues)),r.value[h]=b.value})):(y.issues.length&&r.issues.push(...Se(h,y.issues)),r.value[h]=y.value)}let m;for(let h in o)p.has(h)||(m=m??[],m.push(h));m&&m.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:m})}else{r.value={};for(let p of Reflect.ownKeys(o)){if(p==="__proto__")continue;let m=t.keyType._zod.run({value:p,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&_r.test(p)&&m.issues.length){let b=t.keyType._zod.run({value:Number(p),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(m=b)}if(m.issues.length){t.mode==="loose"?r.value[p]=o[p]:r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(b=>$e(b,n,ve())),input:p,path:[p],inst:e});continue}let y=t.valueType._zod.run({value:o[p],issues:[]},n);y instanceof Promise?s.push(y.then(b=>{b.issues.length&&r.issues.push(...Se(p,b.issues)),r.value[m.value]=b.value})):(y.issues.length&&r.issues.push(...Se(p,y.issues)),r.value[m.value]=y.value)}}return s.length?Promise.all(s).then(()=>r):r}});var co=T("$ZodEnum",(e,t)=>{W.init(e,t);let r=yr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>kn.has(typeof o)).map(o=>typeof o=="string"?Be(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),po=T("$ZodLiteral",(e,t)=>{if(W.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,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var lo=T("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new zt(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new me;return r.value=o,r}});function Kn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Kn,"handleOptionalResult");var mo=T("$ZodOptional",(e,t)=>{W.init(e,t),e._zod.optin="optional",e._zod.optout="optional",K(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),K(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${kt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Kn(s,r.value)):Kn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var fo=T("$ZodNullable",(e,t)=>{W.init(e,t),K(e._zod,"optin",()=>t.innerType._zod.optin),K(e._zod,"optout",()=>t.innerType._zod.optout),K(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${kt(r.source)}|null)$`):void 0}),K(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 go=T("$ZodPipe",(e,t)=>{W.init(e,t),K(e._zod,"values",()=>t.in._zod.values),K(e._zod,"optin",()=>t.in._zod.optin),K(e._zod,"optout",()=>t.out._zod.optout),K(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Ct(c,t.in,n)):Ct(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Ct(s,t.out,n)):Ct(o,t.out,n)}});function Ct(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(Ct,"handlePipeResult");var yo=T("$ZodCustom",(e,t)=>{ze.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Jn(s,r,n,e));Jn(o,r,n,e)}});function Jn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(vr(o))}}i(Jn,"handleRefineResult");var vo;var Er=class{static{i(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 o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function _o(){return new Er}i(_o,"registry");(vo=globalThis).__zod_globalRegistry??(vo.__zod_globalRegistry=_o());var Ar=globalThis.__zod_globalRegistry;function xo(e,t){return new e({type:"string",...Z(t)})}i(xo,"_string");function Po(e,t){return new e({type:"string",coerce:!0,...Z(t)})}i(Po,"_coercedString");function bo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}i(bo,"_url");function To(e,t){return new e({type:"number",checks:[],...Z(t)})}i(To,"_number");function Io(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}i(Io,"_coercedNumber");function Eo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}i(Eo,"_int");function Ao(e,t){return new e({type:"boolean",...Z(t)})}i(Ao,"_boolean");function So(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}i(So,"_coercedBoolean");function $o(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}i($o,"_coercedBigint");function zo(e){return new e({type:"any"})}i(zo,"_any");function wo(e){return new e({type:"unknown"})}i(wo,"_unknown");function Oo(e,t){return new e({type:"void",...Z(t)})}i(Oo,"_void");function ko(e,t){return new e({type:"date",coerce:!0,...Z(t)})}i(ko,"_coercedDate");function Lt(e,t){return new Bn({check:"greater_than",...Z(t),value:e,inclusive:!0})}i(Lt,"_gte");function ce(e,t){return new Zn({check:"min_length",...Z(t),minimum:e})}i(ce,"_minLength");function we(e,t){return new Hn({check:"string_format",format:"regex",...Z(t),pattern:e})}i(we,"_regex");function Ro(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(Ro,"_custom");var J=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");W.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Dt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>at(e,r,n),e.parseAsync=async(r,n)=>Nt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>st(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)=>Rt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Ft=T("ZodMiniString",(e,t)=>{Mt.init(e,t),J.init(e,t)});function a(e){return xo(Ft,e)}i(a,"string");var Do=T("ZodMiniStringFormat",(e,t)=>{Pr.init(e,t),Ft.init(e,t)});var Ku=T("ZodMiniURL",(e,t)=>{Yn.init(e,t),Do.init(e,t)});function No(e){return bo(Ku,e)}i(No,"url");var Bt=T("ZodMiniNumber",(e,t)=>{br.init(e,t),J.init(e,t)});function Q(e){return To(Bt,e)}i(Q,"number");var Ju=T("ZodMiniNumberFormat",(e,t)=>{Qn.init(e,t),Bt.init(e,t)});function Co(e){return Eo(Ju,e)}i(Co,"int");var Sr=T("ZodMiniBoolean",(e,t)=>{Tr.init(e,t),J.init(e,t)});function F(e){return Ao(Sr,e)}i(F,"boolean");var Uo=T("ZodMiniBigInt",(e,t)=>{eo.init(e,t),J.init(e,t)});var Yu=T("ZodMiniAny",(e,t)=>{to.init(e,t),J.init(e,t)});function ct(){return zo(Yu)}i(ct,"any");var Qu=T("ZodMiniUnknown",(e,t)=>{ro.init(e,t),J.init(e,t)});function R(){return wo(Qu)}i(R,"unknown");var ec=T("ZodMiniVoid",(e,t)=>{no.init(e,t),J.init(e,t)});function Mo(e){return Oo(ec,e)}i(Mo,"_void");var Lo=T("ZodMiniDate",(e,t)=>{oo.init(e,t),J.init(e,t)});var tc=T("ZodMiniArray",(e,t)=>{io.init(e,t),J.init(e,t)});function z(e,t){return new tc({type:"array",element:e,...Z(t)})}i(z,"array");var rc=T("ZodMiniObject",(e,t)=>{ao.init(e,t),J.init(e,t),K(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...Z(t)};return new rc(r)}i(l,"object");var nc=T("ZodMiniUnion",(e,t)=>{Ir.init(e,t),J.init(e,t)});function C(e,t){return new nc({type:"union",options:e,...Z(t)})}i(C,"union");var oc=T("ZodMiniDiscriminatedUnion",(e,t)=>{so.init(e,t),J.init(e,t)});function Oe(e,t,r){return new oc({type:"union",options:t,discriminator:e,...Z(r)})}i(Oe,"discriminatedUnion");var ic=T("ZodMiniRecord",(e,t)=>{uo.init(e,t),J.init(e,t)});function D(e,t,r){return new ic({type:"record",keyType:e,valueType:t,...Z(r)})}i(D,"record");var ac=T("ZodMiniEnum",(e,t)=>{co.init(e,t),J.init(e,t),e.options=Object.values(t.entries)});function S(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ac({type:"enum",entries:r,...Z(t)})}i(S,"_enum");var sc=T("ZodMiniLiteral",(e,t)=>{po.init(e,t),J.init(e,t)});function A(e,t){return new sc({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}i(A,"literal");var uc=T("ZodMiniTransform",(e,t)=>{lo.init(e,t),J.init(e,t)});function ke(e){return new uc({type:"transform",transform:e})}i(ke,"transform");var cc=T("ZodMiniOptional",(e,t)=>{mo.init(e,t),J.init(e,t)});function g(e){return new cc({type:"optional",innerType:e})}i(g,"optional");var pc=T("ZodMiniNullable",(e,t)=>{fo.init(e,t),J.init(e,t)});function pt(e){return new pc({type:"nullable",innerType:e})}i(pt,"nullable");var lc=T("ZodMiniPipe",(e,t)=>{go.init(e,t),J.init(e,t)});function Re(e,t){return new lc({type:"pipe",in:e,out:t})}i(Re,"pipe");var dc=T("ZodMiniCustom",(e,t)=>{yo.init(e,t),J.init(e,t)});function Vt(e,t){return Ro(dc,e??(()=>!0),t)}i(Vt,"custom");var lt={};An(lt,{bigint:()=>vc,boolean:()=>hc,date:()=>_c,number:()=>yc,string:()=>gc});function gc(e){return Po(Ft,e)}i(gc,"string");function yc(e){return Io(Bt,e)}i(yc,"number");function hc(e){return So(Sr,e)}i(hc,"boolean");function vc(e){return $o(Uo,e)}i(vc,"bigint");function _c(e){return ko(Lo,e)}i(_c,"date");var zr=l({retryOnFailure:l({defaultValue:g(F()),hide:g(F())}),continueOnFailure:l({defaultValue:g(F()),hide:g(F())})}),$r=class{constructor(t,r,n,o,s,c,p,m,h,y,b,_,u){this.name=t;this.displayName=r;this.description=n;this.props=o;this.propertyGroups=s;this.run=c;this.test=p;this.requireAuth=m;this.errorHandlingOptions=h;this.outputSchema=y;this.audience=b;this.aiMetadata=_;this.classification=u}static{i(this,"IAction")}},ae=i(e=>new $r(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var j=l({displayName:a(),description:g(a()),advanced:g(F()),width:g(S(["half","full"])),icon:g(a()),placeholder:g(a())}),N=i((e,t)=>l({type:A(t),required:F(),defaultValue:g(ct())}),"TPropertyValue");var oe=l({...j.shape,...N(a(),"SHORT_TEXT").shape}),_e=l({...j.shape,...N(a(),"LONG_TEXT").shape});var Fo=l({label:a(),value:R(),description:g(a()),icon:g(a())}),Zt=l({disabled:g(F()),placeholder:g(a()),options:z(Fo)});var Pc=S(["cards"]),ie=l({...j.shape,options:Zt,display:g(Pc),...N(R(),"STATIC_DROPDOWN").shape}),xe=l({...j.shape,options:Zt,...N(z(R()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var wr=l({...j.shape,...N(R(),"DROPDOWN").shape,refreshers:z(a())}),dt=l({...j.shape,...N(z(R()),"MULTI_SELECT_DROPDOWN").shape,refreshers:z(a())});var Pe=l({...j.shape,reveals:g(z(a())),...N(F(),"CHECKBOX").shape});var be=l({...j.shape,display:g(S(["stepper"])),min:g(Q()),max:g(Q()),step:g(Q()),...N(Q(),"NUMBER").shape});var mt=l({...j.shape,streaming:g(F()),...N(R(),"FILE").shape});var ft=l({...j.shape,...N(a(),"DATE_TIME").shape});var Bo=D(a(),C([oe,_e,ie,dt,xe,Pe,be,mt,ft])),gt=l({...j.shape,properties:Bo,...N(z(R()),"ARRAY").shape});var Vo=S(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Zo=l({preset:g(Vo),after:g(a()),before:g(a())}),Or=l({...j.shape,display:g(S(["dropdown"])),...N(Zo,"DATE_RANGE").shape});var yt=l({...j.shape,...N(C([D(a(),R())]),"JSON").shape});var Ho=C([oe,ie,yt,gt,xe]),bc=D(a(),Ho),kr=l({refreshers:z(a()),...j.shape,...N(R(),"DYNAMIC").shape});var Ht=l({...j.shape,...N(Mo(),"MARKDOWN").shape});var ht=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ht||{}),Ze=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ze||{}),He=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(He||{});var vt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(vt||{}),Rr="both_client_credentials_and_authorization_code";var se=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(se||{}),_t=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(_t||{}),Tc=l({strategy:S(_t),paramName:g(a())}),xt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(xt||{});var Gt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Gt||{}),Go=l({status:g(Q()),body:g(R()),headers:g(D(a(),a()))}),Wo=l({type:A("DELAY"),resumeDateTime:a(),requestIdToReply:g(a()),handlerId:g(a()),streamStepProgress:g(S(Gt))}),qo=l({type:A("WEBHOOK"),requestId:a(),requestIdToReply:g(a()),response:Go,handlerId:g(a()),streamStepProgress:g(S(Gt))}),Ic=C([Wo,qo]);var Ec=l({body:R(),rawBody:g(R()),headers:D(a(),a()),queryParams:D(a(),a())});function X(e){return e==null}i(X,"isNil");function Pt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(Pt,"isEmpty");function Wt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(Wt,"assertNotNullOrUndefined");var Dr=Fe(require("crypto"),1);var Ac=128,De,Ge,Sc=i(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!De||De.length<e?(De=Buffer.allocUnsafe(e*Ac),Dr.default.randomFillSync(De),Ge=0):Ge+e>De.length&&(Dr.default.randomFillSync(De),Ge=0)}catch(t){throw De=void 0,t}Ge+=e},"fillPool"),$c=i(e=>(Sc(e|=0),De.subarray(Ge-e,Ge)),"random"),zc=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(s=t)=>{if(s<=0)return"";let c="";for(;;){let p=r(o),m=o;for(;m--;)if(c+=e[p[m]&n]||"",c.length===s)return c}}},"customRandom"),Ko=i((e,t=21)=>zc(e,t,$c),"customAlphabet");var wc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Jo=21,Vb=a().check(we(new RegExp(`^[0-9a-zA-Z]{${Jo}}$`))),Oc=Ko(wc,Jo);var Ne=Re(ke(e=>e instanceof Date?e.toISOString():e),a()),ue={id:a(),created:Ne,updated:Ne},G=i(e=>g(pt(e)),"Nullable");function Nr(e){return g(pt(S(e)))}i(Nr,"NullableEnum");var Gb=Re(ke(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),g(F())),qt=i(e=>Re(ke(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),g(z(e))),"OptionalArrayFromQuery");var Xb=D(a(),R());var bt=(y=>(y.OPENAI="openai",y.OPENROUTER="openrouter",y.ANTHROPIC="anthropic",y.AZURE="azure",y.GOOGLE="google",y.ACTIVEPIECES="activepieces",y.CLOUDFLARE_GATEWAY="cloudflare-gateway",y.CUSTOM="custom",y.BEDROCK="bedrock",y.MISTRAL="mistral",y))(bt||{});var sT=a().check(we(/^#[0-9A-Fa-f]{6}$/));var cT=l({filename:a(),data:R(),type:A("file"),mimetype:g(a())});var kc=Fe(Qo());var yT=l({...ue,name:a(),permissions:z(a()),platformId:G(a()),type:a(),userCount:g(Q())});var ei=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ei||{}),Cr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Cr||{}),Ur=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Ur||{});var Mr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Mr||{});var Lr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Lr||{});var Rc=l({mode:S(ei),value:R()}),Dc=l({auth:g(a()),fields:D(a(),Rc)}),Nc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:g(Dc)}),Cc=l({type:A("PIECE"),toolName:a().check(ce(1)),pieceMetadata:Nc}),Uc=l({type:A("none")}),Mc=l({type:A("access_token"),accessToken:a()}),Lc=l({type:A("api_key"),apiKey:a(),apiKeyHeader:a()}),jc=l({type:A("headers"),headers:D(a(),a())}),Fc=Oe("type",[Uc,Mc,Lc,jc]),ti=l({type:A("FLOW"),toolName:a().check(ce(1)),externalFlowId:a(),flowDisplayName:g(a())}),ri=l({type:A("MCP"),toolName:a().check(ce(1)),serverUrl:No(),protocol:S(Ur),auth:Fc}),ni=l({type:A("KNOWLEDGE_BASE"),toolName:a().check(ce(1)),sourceType:S(Cr),sourceId:a(),sourceName:a()}),Bc=Oe("type",[Cc,ti,ri,ni]),Vc=l({displayName:a(),description:g(a()),type:S(Mr)}),oi=l({type:A("MARKDOWN"),markdown:a()}),We={type:A("TOOL_CALL"),input:G(D(a(),R())),output:g(R()),toolName:a(),status:S(Lr),toolCallId:a(),startTime:a(),endTime:g(a())},WT=l(We),ii=Oe("toolCallType",[l({...We,toolCallType:A("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...We,toolCallType:A("FLOW"),displayName:a(),externalFlowId:a()}),l({...We,toolCallType:A("MCP"),displayName:a(),serverUrl:a()}),l({...We,toolCallType:A("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...We,toolCallType:A("UNKNOWN"),displayName:a()})]),Zc=C([oi,ii]);var jr=(r=>(r.IMAGE="image",r.TEXT="text",r))(jr||{}),Te=l({apiKey:a()}),Hc=Te,Gc=l({apiKey:a(),apiKeyHash:a()}),Wc=Te,qc=Te,Xc=Te,Kc=Te,Jc=Te,Yc=Te,Qc=Te,pi=l({accessKeyId:a().check(ce(1)),secretAccessKey:a().check(ce(1))}),ep=l({}),tp=l({}),rp=l({}),np=l({}),op=l({}),ip=l({}),li=l({modelId:a(),modelName:a(),modelType:S(jr)}),di=l({apiKeyHeader:a(),baseUrl:a(),models:z(li),defaultHeaders:g(D(a(),a()))}),mi=l({accountId:a(),gatewayId:a(),models:z(li),vertexProject:g(a()),vertexRegion:g(a())}),fi=l({resourceName:a(),apiVersion:Re(ke(e=>typeof e=="string"&&e.trim().length===0?void 0:e),g(a()))}),gi=l({region:a().check(ce(1))}),ap=C([Hc,Xc,Kc,Jc,Yc,qc,Wc,Gc,pi,Qc]),yi=C([di,mi,fi,gi,ep,rp,np,op,tp,ip]),sp=l({id:a(),name:a(),type:S(jr)}),up=l({id:a(),name:a(),provider:S(bt),config:yi,enabledForChat:F()}),cp=l({provider:S(bt),config:yi,auth:ap,platformId:a()});var JT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ai=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],pp=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],lp=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],si=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],dp=["grok-4.20","grok-4.1-fast"],mp={openai:ai,anthropic:pp,google:si,activepieces:[...lp.map(e=>`anthropic/${e}`),...ai.map(e=>`openai/${e}`),...si.map(e=>`google/${e}`),...dp.map(e=>`x-ai/${e}`)]};var ui=128e3,fp={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function gp({provider:e}){return e?fp[e]??ui:ui}i(gp,"getMaxContextTokens");var ci={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"},yp={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},hp=new Set(["anthropic","mistral"]);function fe(e){return{chatModels:mp[e],maxContextTokens:gp({provider:e}),defaultEmbeddingModel:ci[e],supportsEmbedding:ci[e]!==void 0,supportsImageGeneration:!hp.has(e),webSearch:yp[e]}}i(fe,"buildProviderCapabilities");var vp={openai:fe("openai"),anthropic:fe("anthropic"),openrouter:fe("openrouter"),azure:fe("azure"),google:fe("google"),"cloudflare-gateway":fe("cloudflare-gateway"),custom:fe("custom"),bedrock:fe("bedrock"),mistral:fe("mistral"),activepieces:fe("activepieces")};var _p=l({base64Url:a(),fileName:a(),extension:g(a())}),xp=l({mimeType:a(),url:a(),fileName:g(a())}),Fr=C([_p,xp]);var Pp=C([l({type:A("file"),value:Fr}),l({type:A("markdown"),value:a(),files:g(z(Fr))})]),bp=l({sessionId:a(),message:a(),files:g(z(a()))});var vi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(vi||{}),_i=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(_i||{}),Br=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Br||{});var Tp=C([l({...ue,name:a(),externalId:a(),type:A("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:z(l({value:a()}))})}),l({...ue,name:a(),externalId:a(),type:C([A("TEXT"),A("NUMBER"),A("DATE"),A("DATETIME")]),tableId:a(),projectId:a()})]),Ip=l({...ue,name:a(),folderId:G(a()),projectId:a(),externalId:a(),status:Nr(_i),trigger:Nr(vi)}),Ep=l({...ue,tableId:a(),projectId:a(),cells:D(a(),l({updated:a(),created:a(),value:R(),fieldName:a()}))}),Ap=l({events:z(S(Br)),webhookUrl:a(),flowId:a()}),Sp=l({fields:z(l({id:a(),name:a()})),rows:z(D(a(),a())),name:a()}),$p=l({projectId:a(),limit:g(lt.number()),cursor:g(a()),name:g(a()),externalIds:qt(a()),folderId:g(a()),folderIds:qt(a())}),zp=l({records:z(z(l({fieldId:a(),value:Pi()}))),tableId:a()}),wp=l({cells:g(z(l({fieldId:a(),value:Pi()}))),tableId:a(),agentUpdate:g(F())}),xi=Oe("operator",[Ue("eq"),Ue("neq"),Ue("gt"),Ue("gte"),Ue("lt"),Ue("lte"),Ue("co"),hi("exists"),hi("not_exists")]),Op=l({tableId:a(),limit:g(lt.number()),cursor:g(a()),filters:qt(xi)});function Pi(){return Re(ke(e=>e==null?e:String(e)),pt(a()))}i(Pi,"coerceToString");function Ue(e){return l({fieldId:a(),operator:A(e),value:a()})}i(Ue,"valueFilter");function hi(e){return l({fieldId:a(),operator:A(e)})}i(hi,"existenceFilter");var kp=l({status:g(Q()),body:g(R()),headers:g(D(a(),a()))}),Rp=l({...ue,deleted:G(Ne),ownerId:a(),displayName:a(),platformId:a(),externalId:G(a())});var bi=l({name:a(),description:g(a()),type:a(),required:F()}),Dp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:z(bi),returnsResponse:F()})});var Ti="^[0-9]+\\.[0-9]+\\.[0-9]+$",yI=new RegExp(Ti),Cp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",hI=a().check(we(new RegExp(Ti))),vI=a().check(we(new RegExp(Cp))),Up=l({packageType:A("ARCHIVE"),pieceType:S(Ze),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Ii=l({packageType:A("REGISTRY"),pieceType:A("OFFICIAL"),pieceName:a(),pieceVersion:a()}),Ei=l({packageType:A("REGISTRY"),pieceType:A("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),_I=C([Ii,Ei]),xI=C([Up,Ii,Ei]);var Mp=Oe("type",[l({type:A("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:A("INTERVAL"),intervalMs:Co().check(Lt(6e4))})]),PI=l({...ue,type:S(se),projectId:a(),flowId:a(),triggerName:a(),schedule:G(Mp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:G(a()),simulate:F()}),Ai=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(Ai||{}),Si=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Si||{}),$i=(r=>(r.S3="S3",r.DB="DB",r))($i||{}),bI=l({...ue,projectId:G(a()),platformId:G(a()),type:S(Ai),compression:S(Si),data:g(R()),location:S($i),size:G(Q()),fileName:G(a()),s3Key:G(a()),metadata:G(D(a(),a()))}),zi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(zi||{}),wi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(wi||{}),TI=l({id:a(),email:a(),firstName:a(),status:S(wi),externalId:G(a()),platformId:G(a()),platformRole:S(zi),lastName:a(),created:Ne,updated:Ne,lastActiveDate:G(Ne),imageUrl:G(a())});var Vr=l({...j.shape,...N(D(a(),R()),"OBJECT").shape});var Zr=l({...j.shape,formatProperty:g(a()),...N(a(),"RICH_TEXT").shape});var Di=l({...j.shape,...N(a(),"COLOR").shape});var Hr=C([oe,_e,Zr,Ht,Pe,ie,xe,wr,dt,kr,be,gt,Vr,yt,ft,Or,mt,Di]),U={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var ge=l({displayName:a(),description:g(a()),hasConnectionIdentifier:g(F())});var Ni=l({username:a(),password:a()}),Gr=l({...ge.shape,username:l({displayName:a(),description:g(a())}),password:l({displayName:a(),description:g(a())}),...N(Ni,"BASIC_AUTH").shape});var Bp=D(a(),C([oe,_e,be,Pe,ie])),Wr=l({...ge.shape,props:Bp,...N(R(),"CUSTOM_AUTH").shape});var Me=l({...ge.shape,...N(l({auth:a()}),"SECRET_TEXT").shape});var Vp=D(a(),C([oe,_e,Me,be,Pe,ie,xe,Ht])),Ci=l({...ge.shape,props:Vp,...N(R(),"OIDC").shape});var qr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(qr||{}),Ui=C([oe,Me,ie]),Mi=D(a(),Ui),Zp=l({props:g(D(a(),Ui)),authUrl:a(),tokenUrl:a(),scope:z(a()),prompt:g(C([A("none"),A("consent"),A("login"),A("omit")])),pkce:g(F()),pkceMethod:g(C([A("plain"),A("S256")])),authorizationMethod:g(S(qr)),grantType:g(C([S(vt),A(Rr)])),extra:g(D(a(),a()))}),Li=l({access_token:a(),props:g(Mi),data:D(a(),ct())}),Xr=l({...ge.shape,...Zp.shape,...N(Li,"OAUTH2").shape});var qe=C([Gr,Wr,Ci,Xr,Me]),Tt="Connection",Kr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Tt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Tt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Tt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Tt}},None(){}};var aA={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 Hp=l({...j.shape,...N(R(),"CUSTOM").shape,code:a()});var Gp=C([Hr,qe]),Jr=D(a(),Gp),SA=D(a(),Hr);var ji=C([l({strategy:A("CRON"),cronExpression:a()}),l({strategy:A("NONE")})]),Xe=class{constructor(t,r,n,o,s,c,p,m,h,y,b,_,u,d,v,f,x,P,L,ne,de){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=c;this.handshakeConfiguration=p;this.onHandshake=m;this.renewConfiguration=h;this.onRenew=y;this.onEnable=b;this.onDisable=_;this.onStart=u;this.run=d;this.test=v;this.sampleData=f;this.testStrategy=x;this.outputSchema=P;this.aiMetadata=L;this.classification=ne;this.propertyGroups=de}static{i(this,"ITrigger")}},ye=i(e=>{switch(e.type){case"WEBHOOK":return new Xe(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,e.classification,e.propertyGroups);case"POLLING":return new Xe(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,e.classification,e.propertyGroups);case"MANUAL":return new Xe(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,e.classification,e.propertyGroups);case"APP_WEBHOOK":return new Xe(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,X(e.sampleData)&&X(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var Fi="2",Kt="0.82.0";var Yr=class{constructor(t,r,n,o,s,c,p,m,h=Kt,y,b="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=p;this.auth=m;this.minimumSupportedRelease=h;this.maximumSupportedRelease=y;this.description=b;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Fi}),"getContextInfo");(!qp(h)||Xp(h,Kt))&&(this.minimumSupportedRelease=Kt),s.forEach(u=>this._actions[u.name]=u),c.forEach(u=>this._triggers[u.name]=u)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:Wp(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}},Vi=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new 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 Wp(e){if(e!==void 0)return Array.isArray(e)?e.map(Bi):Bi(e)}i(Wp,"withConnectionIdentifierFlag");function Bi(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}i(Bi,"flagConnectionIdentifier");function qp(e){return/^\d+\.\d+\.\d+$/.test(e)}i(qp,"isValidSimpleSemver");function Xp(e,t){let[r,n,o]=e.split(".").map(Number),[s,c,p]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:o<p}i(Xp,"isSemverLessThan");var Kp=g(D(a(),D(a(),a()))),Zi=l({id:g(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:z(a()),platformId:g(a()),directoryPath:g(a()),auth:g(C([qe,z(qe)])),version:a(),categories:g(z(S(He))),minimumSupportedRelease:g(a()),maximumSupportedRelease:g(a()),deprecated:g(F()),i18n:Kp}),Jp=S(["human","ai","both"]),Hi=l({description:g(a()),idempotent:g(F())}),Gi=S(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var Yp=S(["tabs","section","summary","builder","footer"]),Wi=l({key:a(),display:Yp,label:g(a()),description:g(a()),icon:g(a()),props:z(a())}),qi=l({name:a(),displayName:a(),description:a(),props:Jr,propertyGroups:g(z(Wi)),requireAuth:F(),errorHandlingOptions:g(zr),outputSchema:g(Vt()),audience:g(Jp),aiMetadata:g(Hi),classification:g(Gi)}),Xi=l({name:a(),displayName:a(),description:a(),props:Jr,propertyGroups:g(z(Wi)),errorHandlingOptions:g(zr),type:S(se),sampleData:R(),handshakeConfiguration:g(Vt()),renewConfiguration:g(ji),testStrategy:S(xt),outputSchema:g(Vt()),aiMetadata:g(Hi),classification:g(Gi)}),Qp=l({...Zi.shape,actions:D(a(),qi),triggers:D(a(),Xi)}),el=l({...Zi.shape,actions:Q(),triggers:Q(),suggestedActions:g(z(qi)),suggestedTriggers:g(z(Xi))}),Ki=l({projectUsage:Q(),pieceType:S(Ze),packageType:S(ht),platformId:g(a()),archiveId:g(a())}),zS=l({...Qp.shape,...Ki.shape}),wS=l({...el.shape,...Ki.shape}),OS=l({name:a(),version:a()});var tl=Fe(require("path")),rl=Fe(require("fs/promises"));var Ke=require("node:stream");var Jt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,c)=>{o.append(c,s)}),{urlWithoutQueryParams:n,queryParams:o}}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 Yt=class{static{i(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{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},en=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var It=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Ji({error:e,requestBody:t}){return e instanceof It?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}i(Ji,"toFailsafeOutput");var pe=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(pe||{});var Qt=class extends Jt{static{i(this,"FetchHttpClient")}constructor(t="",r=new Yt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[L,ne]of Object.entries(c))o.append(L,ne);let p=o.toString(),m=p?`${n}?${p}`:n,h=t.responseType??"json",y=t.followRedirects??!0,b=t.retries??0,{body:_,extraHeaders:u,isStream:d}=nl(t.method)?ol(t.body,s):{body:void 0,extraHeaders:{},isStream:!1},v=al({...s,...u}),f=await il(async()=>{let L=new AbortController,ne=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let de={method:t.method.toString(),headers:v,body:_,redirect:y?"follow":"manual",signal:L.signal};return d&&(de.duplex="half"),r?.dispatcher!==void 0&&(de.dispatcher=r.dispatcher),await fetch(m,de)}finally{ne!==void 0&&clearTimeout(ne)}},d?0:b),x=y?300:400;if(f.status<200||f.status>=x){let L=await Yi(f,h==="stream"?"text":h),ne=new It(t.body,{status:f.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ne),ne}let P=await Yi(f,h);return{status:f.status,headers:sl(f.headers),body:P}}};function nl(e){return e!=="GET"&&e!=="HEAD"}i(nl,"acceptsRequestBody");function ol(e,t){if(ea(e))return{body:void 0,extraHeaders:{},isStream:!1};if(ul(e)){let n=new Ke.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof Ke.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(ol,"serializeBody");async function Yi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return ea(e.body)?Ke.Readable.from([]):Ke.Readable.fromWeb(e.body);case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(Yi,"parseResponseBody");async function il(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Qi(n);continue}return o}catch(o){if(r=o,n<t){await Qi(n);continue}throw o}throw r}i(il,"sendWithRetries");function Qi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Qi,"backoff");function al(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}i(al,"normalizeHeaders");function sl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(sl,"toHttpHeaders");function ul(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}i(ul,"isNodeFormData");function ea(e){return e==null}i(ea,"isNil");var ee=new Qt;var Xd=Fe(require("fs")),au=Fe(iu());var Kd={"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 Jd(e){let t=e.split(";")[0].trim().toLowerCase();return Kd[t]??""}i(Jd,"contentTypeToExtension");var Yd=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Qd=i((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 su({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:s,props:c,extraProps:p,authLocation:m="headers",classification:h="WRITE"}){return ae({audience:"human",name:s||"custom_api_call",classification:h,displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:U.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:y})=>({url:U.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${Qd(t,y)}/resource or /resource`,required:!0,defaultValue:y?t(y):"",...c?.url??{}})}),"props")}),method:U.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(pe).map(y=>({label:y,value:y}))},...c?.method??{}}),headers:U.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:U.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:U.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:U.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:y})=>{if(!y)return{};let b=y,_={};switch(b){case"none":break;case"json":_.data=U.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":_.data=U.LongText({displayName:"Raw Body",required:!0});break;case"form_data":_.data=U.Array({displayName:"Form Data",required:!0,properties:{fieldName:U.ShortText({displayName:"Field Name",required:!0}),fieldType:U.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:U.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:U.File({displayName:"File Field Value",required:!1})}});break}return _},"props")}),response_is_binary:U.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:U.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:U.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:U.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:i(async y=>{let{method:b,url:_,headers:u,queryParams:d,body:v,body_type:f,failsafe:x,timeout:P,response_is_binary:L,followRedirects:ne}=y.propsValue;Wt(b,"Method"),Wt(_,"URL");let de=X(r)?{}:await r(y.auth,y.propsValue),Ee=_.url,vu=Ee.startsWith("http://")||Ee.startsWith("https://")?Ee:Yd({baseUrl:t(y.auth),relativePath:Ee}),Ae={method:b,url:vu,headers:{...u??{},...m==="headers"||!X(m)?de:{}},queryParams:{...m==="queryParams"?de:{},...d??{}},timeout:P?P*1e3:0,followRedirects:ne};if(L&&(Ae.responseType="arraybuffer"),v)if(f&&f!=="none"){let he=v.data;if(f==="form_data"){let _u=he,$t=new au.default;for(let{fieldName:Tn,fieldType:In,textFieldValue:En,fileFieldValue:mr}of _u)In==="text"&&!Pt(En)?$t.append(Tn,En):In==="file"&&!Pt(mr)&&$t.append(Tn,mr.data,{filename:mr?.filename});Ae.body=$t,Ae.headers={...Ae.headers,...$t.getHeaders()}}else Ae.body=he}else f||(Ae.body=v);try{let he=await ee.sendRequest(Ae);return await em(y.files,he.body,he.status,he.headers,L)}catch(he){if(x)return Ji({error:he,requestBody:Ae.body});throw he}},"run")})}i(su,"createCustomApiCallAction");var em=i(async(e,t,r,n,o)=>{let s;if(o&&tm(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Jd(c??"")||"txt",m;t instanceof ArrayBuffer?m=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?m=t:m=Buffer.from(t),s=await e.write({fileName:`output.${p}`,data:m})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),tm=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Y={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:s,server:c}){switch(e.strategy){case 0:{let p=await t.get("lastPoll");if(X(p))throw new Error("lastPoll doesn't exist in the store.");let m=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:p,server:c}),h=m.reduce((y,b)=>Math.max(y,b.epochMilliSeconds),p);return await t.put("lastPoll",h),m.filter(y=>y.epochMilliSeconds>p).map(y=>y.data)}case 1:{let p=await t.get("lastItem"),m=await e.items({store:t,auth:r,propsValue:n,lastItemId:p,files:s,server:c}),h=m.findIndex(_=>_.id===p),y=[];X(p)||h==-1?y=m??[]:y=m?.slice(0,h)??[],X(o)||(y=y.slice(-o));let b=y?.[0]?.id;return X(b)||await t.put("lastItem",b),y.map(_=>_.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o,isRepublish:s}){switch(e.strategy){case 0:{if(s&&!X(await t.get("lastPoll")))break;await t.put("lastPoll",Date.now());break}case 1:{if(s&&!X(await t.get("lastItem")))break;let p=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;X(p)?await t.delete("lastItem"):await t.put("lastItem",p);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:s}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:s});break}}return rm(c.map(p=>p.data))}};function rm(e){return e.length<=5?e:e.slice(0,5)}i(rm,"getFirstFiveOrAll");var rt={phone_number:U.Dropdown({auth:V,description:"The phone number to send the message from",displayName:"From",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"connect your account first",options:[]};let t=e;return{disabled:!1,options:(await Ie("GET","IncomingPhoneNumbers.json",{account_sid:t.username,auth_token:t.password})).body.incoming_phone_numbers.map(n=>({value:n.phone_number,label:n.friendly_name}))}},"options")})},Ie=i(async(e,t,r,n)=>await ee.sendRequest({method:e,url:`https://api.twilio.com/2010-04-01/Accounts/${r.account_sid}/${t}`,authentication:{type:"BASIC",username:r.account_sid,password:r.auth_token},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n}),"callTwilioApi");var uu=ae({auth:V,name:"send_sms",classification:"WRITE",description:"Send a new SMS message",audience:"both",aiMetadata:{description:"Sends an SMS text message from a Twilio phone number to a recipient. Use to notify or message a person by text. Requires the destination number, message body, and a Twilio-owned sender number; sending costs money and delivers a separate message on every call, so it is not idempotent.",idempotent:!1},displayName:"Send SMS",props:{from:rt.phone_number,body:U.ShortText({description:"The body of the message to send",displayName:"Message Body",required:!0}),to:U.ShortText({description:"The phone number to send the message to",displayName:"To",required:!0})},async run(e){let{body:t,to:r,from:n}=e.propsValue,o=e.auth.username,s=e.auth.password;return await Ie("POST","Messages.json",{account_sid:o,auth_token:s},{From:n,Body:t,To:r})}});var cu=ye({auth:V,name:"new_incoming_sms",classification:"READ",displayName:"New Incoming SMS",description:"Triggers when a new SMS message is received",aiMetadata:{description:"Fires when an inbound SMS message is received on the specified Twilio phone number. Each event represents one incoming text message with its sender, body, and metadata."},props:{phone_number:rt.phone_number},sampleData:{body:"Hello",num_segments:"1",direction:"inbound",from:"+12184191735",date_updated:"Wed, 08 Feb 2023 01:40:51 +0000",price:null,error_message:null,uri:"/2010-04-01/Accounts/ACc0ea1238d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63.json",account_sid:"ACc0ea716d61fe90d78a123a3de71d45619",num_media:"0",to:"+12184191735",date_created:"Wed, 08 Feb 2023 01:40:50 +0000",status:"failed",sid:"SM8c3920d3f2ac481ba83e639a69dadd63",date_sent:"Wed, 08 Feb 2023 01:40:51 +0000",messaging_service_sid:"MG88e323e6a88ce67ba3bf12e1bcb7e0b8",error_code:21211,price_unit:"USD",api_version:"2010-04-01",subresource_uris:{media:"/2010-04-01/Accounts/ACc0ea716d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63/Media.json",feedback:"/2010-04-01/Accounts/ACc0ea716d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63/Feedback.json"}},type:"POLLING",async onEnable(e){let{phone_number:t}=e.propsValue,r=e.auth.username,n=e.auth.password,o=await Ie("GET",`Messages.json?PageSize=20&To=${t}`,{account_sid:r,auth_token:n},{});await e.store.put("_new_incoming_sms_trigger",{lastMessageId:o.body.messages.length===0?null:o.body.messages[0].sid})},async onDisable(e){await e.store.put("_new_incoming_sms_trigger",null)},async run(e){let t=e.auth.username,r=e.auth.password,n=[],o=await e.store.get("_new_incoming_sms_trigger"),s=`2010-04-01/Accounts/${t}/Messages.json?PageSize=20&To=${e.propsValue.phone_number}`,c;for(;s!=null;){let p=await ee.sendRequest({method:"GET",url:`https://api.twilio.com/${s}`,authentication:{type:"BASIC",username:t,password:r}}),m=p.body.messages;!c&&m.length>0&&(c=m[0].sid),s=p.body.next_page_uri;for(let h=0;h<m.length;h++){let y=m[h];if(y.sid===o?.lastMessageId){s=null;break}y.direction==="inbound"&&n.push(y)}}return await e.store.put("_new_incoming_sms_trigger",{lastMessageId:c??o.lastMessageId}),n}});var pu=ae({auth:V,name:"phone_number_lookup",classification:"READ",description:"Lookup information about a phone number.",audience:"both",aiMetadata:{description:"Looks up carrier and line-type intelligence for a single phone number via the Twilio Lookup API. Use to validate or enrich a number (e.g. detect mobile vs landline, carrier) before messaging or calling it. Read-only and idempotent.",idempotent:!0},displayName:"Phone Number Lookup",props:{phone_number:U.ShortText({displayName:"Phone Number",required:!0})},async run(e){let{phone_number:t}=e.propsValue,r=e.auth.username,n=e.auth.password;return(await ee.sendRequest({method:"GET",url:`https://lookups.twilio.com/v2/PhoneNumbers/${encodeURIComponent(t)}`,authentication:{type:"BASIC",username:r,password:n},queryParams:{Fields:"line_type_intelligence"}})).body}});var lu=ae({auth:V,name:"make_call",classification:"WRITE",description:"Call a number and say a message.",audience:"both",aiMetadata:{description:"Places an outbound voice call from a Twilio number that reads a text-to-speech message to the recipient. Use to deliver a spoken notification or alert by phone. Requires both numbers in E.164 format and the message text; each call places a real, billable phone call, so it is not idempotent.",idempotent:!1},displayName:"Call Phone",props:{from:rt.phone_number,to:U.ShortText({displayName:"To",description:"The phone number to call. Must be in E.164 format (e.g., +15558675310).",required:!0}),message:U.LongText({displayName:"Message to Say",description:"The text message to be converted to speech and spoken to the recipient.",required:!0}),voice:U.StaticDropdown({displayName:"Voice",description:"The voice to use for the text-to-speech message.",required:!1,options:{options:[{label:"Alice (Default)",value:"alice"},{label:"Man",value:"man"},{label:"Woman",value:"woman"}]}}),language:U.StaticDropdown({displayName:"Language",description:"The language to use for the text-to-speech message.",required:!1,options:{options:[{label:"English (US)",value:"en-US"},{label:"English (UK)",value:"en-GB"},{label:"Spanish",value:"es-ES"},{label:"French",value:"fr-FR"},{label:"German",value:"de-DE"}]}}),sendDigits:U.ShortText({displayName:"Send DTMF Tones",description:"A string of keys to dial after the call is connected. Use 'w' for a half-second pause.",required:!1}),timeout:U.Number({displayName:"Timeout (seconds)",description:"The number of seconds to let the phone ring before assuming no answer. Default is 60.",required:!1})},async run(e){let{from:t,to:r,message:n,voice:o,language:s,sendDigits:c,timeout:p}=e.propsValue,m=e.auth.username,h=e.auth.password,y=o?` voice="${o}"`:"",b=s?` language="${s}"`:"",_=n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"),u=`<Response><Say${y}${b}>${_}</Say></Response>`,d={From:t,To:r,Twiml:u};return c&&(d.SendDigits=c),p&&(d.Timeout=p),(await Ie("POST","Calls.json",{account_sid:m,auth_token:h},d)).body}});var du=ae({auth:V,name:"get_message",classification:"READ",description:"Retrieves the details of a specific message.",audience:"both",aiMetadata:{description:'Fetches the full details and status of a single Twilio message by its SID. Use to check delivery status or inspect a known message; requires the message SID (starting with "SM" or "MM"). Read-only and idempotent.',idempotent:!0},displayName:"Get Message",props:{message_sid:U.ShortText({displayName:"Message SID",description:'The unique identifier (SID) of the message to retrieve. It starts with "SM" or "MM".',required:!0})},async run(e){let{message_sid:t}=e.propsValue,r=e.auth.username,n=e.auth.password,o=`Messages/${t}.json`;return(await Ie("GET",o,{account_sid:r,auth_token:n})).body}});var mu=ae({auth:V,name:"download_recording_media",classification:"READ",displayName:"Download Recording Media",description:"Download the media file for a specific recording.",audience:"both",aiMetadata:{description:'Downloads the audio file for a specific Twilio call recording by its SID, returning it as a file (MP3 or WAV). Use to retrieve recorded call audio for storage or further processing; requires the recording SID (starting with "RE"). Read-only and idempotent.',idempotent:!0},props:{recording_sid:U.ShortText({displayName:"Recording SID",description:'The unique identifier (SID) of the recording to download. It starts with "RE".',required:!0}),format:U.StaticDropdown({displayName:"Format",description:"The desired audio format for the download file.",required:!1,defaultValue:"mp3",options:{options:[{label:"MP3",value:"mp3"},{label:"WAV",value:"wav"}]}}),channels:U.StaticDropdown({displayName:"Channels",description:"Specify whether to download a mono or dual-channel file. Note: Dual-channel may not be available for all recordings.",required:!1,options:{options:[{label:"Mono",value:1},{label:"Dual",value:2}]}})},async run(e){let{recording_sid:t,format:r,channels:n}=e.propsValue,o=e.auth.username,s=e.auth.password,c=r??"mp3",p=`Recordings/${t}.${c}`,m={};n&&(m.RequestedChannels=n.toString());let h=await ee.sendRequest({method:"GET",url:`https://api.twilio.com/2010-04-01/Accounts/${o}/${p}`,queryParams:m,authentication:{type:"BASIC",username:o,password:s},responseType:"arraybuffer"}),y=Buffer.from(h.body);return await e.files.write({fileName:`${t}.${c}`,data:y})}});var cr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/IncomingPhoneNumbers.json?PageSize=${r?10:1e3}`,c=[],p=!1;do{let h=(await ee.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,y=h.incoming_phone_numbers??[];for(let b of y){let _=new Date(b.date_created).getTime();if(r||_>t)c.push(b);else{p=!0;break}}if(r)break;s=h?.next_page_uri??null}while(s&&!p);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},fu=ye({auth:V,name:"new_phone_number",classification:"READ",displayName:"New Phone Number",description:"Triggers when you add a new phone number to your account.",aiMetadata:{description:"Fires when a new phone number is provisioned on the Twilio account. Each event represents one newly added incoming phone number with its capabilities and configuration."},props:{},sampleData:{sid:"PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",account_sid:"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",friendly_name:"(555) 123-4567",phone_number:"+15551234567",voice_url:"https://demo.twilio.com/welcome/voice/",voice_method:"POST",sms_url:"https://demo.twilio.com/welcome/sms/",sms_method:"POST",date_created:"2025-08-28T11:44:10+00:00",date_updated:"2025-08-28T11:44:10+00:00",capabilities:{voice:!0,sms:!0,mms:!0},uri:"/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"},type:"POLLING",async onEnable(e){await Y.onEnable(cr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Y.onDisable(cr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Y.test(cr,e)},async run(e){return await Y.poll(cr,e)}});var pr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Recordings.json?PageSize=${r?10:1e3}`,c=[],p=!1;do{let h=(await ee.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,y=h.recordings??[];for(let b of y){let _=new Date(b.date_created).getTime();if(r||_>t)c.push(b);else{p=!0;break}}if(r)break;s=h?.next_page_uri??null}while(s&&!p);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},gu=ye({auth:V,name:"new_recording",classification:"READ",displayName:"New Recording",description:"Triggers when a new call recording is completed and available.",aiMetadata:{description:"Fires when a new call recording becomes available on the Twilio account. Each event represents one completed recording, including its call SID, duration, and status."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",api_version:"2010-04-01",call_sid:"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",conference_sid:"CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",channels:1,date_created:"Fri, 14 Oct 2016 21:56:34 +0000",date_updated:"Fri, 14 Oct 2016 21:56:38 +0000",start_time:"Fri, 14 Oct 2016 21:56:34 +0000",price:"0.04",price_unit:"USD",duration:"4",sid:"REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",source:"StartConferenceRecordingAPI",status:"completed",error_code:null,uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",subresource_uris:{add_on_results:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json",transcriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json"},encryption_details:{encryption_public_key_sid:"CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",encryption_cek:"OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==",encryption_iv:"8I2hhNIYNTrwxfHk"},media_url:"http://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},type:"POLLING",async onEnable(e){await Y.onEnable(pr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Y.onDisable(pr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Y.test(pr,e)},async run(e){return await Y.poll(pr,e)}});var lr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Transcriptions.json?PageSize=${r?10:1e3}`,c=[],p=!1;do{let h=(await ee.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,y=h.transcriptions??[];for(let b of y){let _=new Date(b.date_created).getTime();if(b.status==="completed")if(r||_>t)c.push(b);else{p=!0;break}}if(r)break;s=h?.next_page_uri??null}while(s&&!p);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},yu=ye({auth:V,name:"new_transcription",classification:"READ",displayName:"New Transcription",description:"Triggers when a new call recording transcription is completed.",aiMetadata:{description:"Fires when a call recording transcription reaches completed status on the Twilio account. Each event represents one finished transcription tied to a recording, including its transcribed text."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",api_version:"2008-08-01",date_created:"Thu, 25 Aug 2011 20:59:45 +0000",date_updated:"Thu, 25 Aug 2011 20:59:45 +0000",duration:"10",price:"0.00000",price_unit:"USD",recording_sid:"REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",sid:"TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",status:"completed",transcription_text:null,type:"fast",uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"},type:"POLLING",async onEnable(e){await Y.onEnable(lr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Y.onDisable(lr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Y.test(lr,e)},async run(e){return await Y.poll(lr,e)}});var dr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Calls.json?PageSize=${r?1:1e3}`,c=[],p=!1;do{let h=(await ee.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,y=h.calls??[];for(let b of y){let _=new Date(b.date_created).getTime();if(b.status==="completed")if(r||_>t)c.push(b);else{p=!0;break}}if(r)break;s=h?.next_page_uri??null}while(s&&!p);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},hu=ye({auth:V,name:"new_call",classification:"READ",displayName:"New Call",description:"Triggers when a call completes (incoming or outgoing).",aiMetadata:{description:"Fires when a voice call reaches completed status on the Twilio account, for both inbound and outbound calls. Each event represents one finished call with its direction, participants, duration, and status."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",answered_by:"machine_start",api_version:"2010-04-01",caller_name:"callerid1",date_created:"Fri, 18 Oct 2019 17:00:00 +0000",date_updated:"Fri, 18 Oct 2019 17:01:00 +0000",direction:"outbound-api",duration:"4",end_time:"Fri, 18 Oct 2019 17:03:00 +0000",forwarded_from:"calledvia1",from:"+13051416799",from_formatted:"(305) 141-6799",group_sid:"GPdeadbeefdeadbeefdeadbeefdeadbeef",parent_call_sid:"CAdeadbeefdeadbeefdeadbeefdeadbeef",phone_number_sid:"PNdeadbeefdeadbeefdeadbeefdeadbeef",price:"-0.200",price_unit:"USD",sid:"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",start_time:"Fri, 18 Oct 2019 17:02:00 +0000",status:"completed",subresource_uris:{notifications:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",recordings:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",payments:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",events:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",siprec:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",streams:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",transcriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",user_defined_message_subscriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",user_defined_messages:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"},to:"+13051913581",to_formatted:"(305) 191-3581",trunk_sid:"TKdeadbeefdeadbeefdeadbeefdeadbeef",uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",queue_time:"1000"},type:"POLLING",async onEnable(e){await Y.onEnable(dr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Y.onDisable(dr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Y.test(dr,e)},async run(e){return await Y.poll(dr,e)}});var V=Kr.BasicAuth({description:"The authentication to use to connect to Twilio",required:!0,username:{displayName:"Account SID",description:"The account SID to use to connect to Twilio"},password:{displayName:"Auth token",description:"The auth token to use to connect to Twilio"}}),nm=Vi({displayName:"Twilio",description:"Cloud communications platform for building SMS, Voice & Messaging applications",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/twilio.png",auth:V,categories:["COMMUNICATION"],actions:[uu,pu,lu,du,mu,su({baseUrl:i(()=>"https://api.twilio.com/2010-04-01","baseUrl"),auth:V,authMapping:i(async e=>({Authorization:`Basic ${Buffer.from(`${e.username}:${e.password}`).toString("base64")}`}),"authMapping")})],authors:["kishanprmr","MoShizzle","khaledmashaly","abuaboud"],triggers:[cu,fu,gu,yu,hu]});0&&(module.exports={twilio,twilioAuth});
4
4
  /*! Bundled license information:
5
5
 
6
6
  mime-types/index.js: