@activepieces/piece-resend 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +4 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var Xu=Object.create;var tt=Object.defineProperty;var Yu=Object.getOwnPropertyDescriptor;var Qu=Object.getOwnPropertyNames;var ec=Object.getPrototypeOf,tc=Object.prototype.hasOwnProperty;var o=(e,t)=>tt(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Pn=(e,t)=>{for(var r in t)tt(e,r,{get:t[r],enumerable:!0})},bn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qu(t))!tc.call(e,i)&&i!==r&&tt(e,i,{get:()=>t[i],enumerable:!(n=Yu(t,i))||n.enumerable});return e};var Ne=(e,t,r)=>(r=e!=null?Xu(ec(e)):{},bn(t||!e||!e.__esModule?tt(r,"default",{value:e,enumerable:!0}):r,e)),rc=e=>bn(tt({},"__esModule",{value:!0}),e);var Wo=S((qo,Gt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function g(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,f=-1,v=(s.match(l.zoneIndex)||[])[0],P,Z;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(f=s.indexOf(":",f+1))>=0;)y++;if(s.substr(0,2)==="::"&&y--,s.substr(-2,2)==="::"&&y--,y>d)return null;for(Z=d-y,P=":";Z--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let oe=s.split(":"),ce=[];for(let et=0;et<oe.length;et++)ce.push(parseInt(oe[et],16));return ce})(),{parts:d,zoneId:v}}o(g,"expandIPv6");function h(s,d,y,f){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;f>0;){if(P=y-f,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;f-=y,v+=1}return!0}o(h,"matchCIDR");function x(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(x,"parseIntAuto");function I(s,d){for(;s.length<d;)s=`0${s}`;return s}o(I,"padPart");let _={};_.IPv4=(function(){function s(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 o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,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 h(this.octets,d.octets,8,y)},s.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},v,P,Z;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in f){if(Z=f[P],y&&Z!==0)return null;Z!==8&&(y=!0),d+=Z}else return null;return 32-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),_.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(s){return this.parser(s)!==null},_.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(s){return!!(_.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(s)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(s){let d,y,f,v,P;try{for(d=this.parseCIDR(s),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let f=[this.parse(d[1]),y];return Object.defineProperty(f,"toString",{value:o(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(s){let d,y,f;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),P=[];for(let Z=0;Z<v.length;Z++)y=v[Z],P.push(x(y));return P})();if(d=s.match(r.longValue)){if(f=x(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(f>>P&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),P=[];if(f=x(v[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),P=[];if(f=x(v[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(x(v[1])),P.push(f>>8&255),P.push(f&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,f=Math.floor(s/8);for(;y<f;)d[y]=255,y++;return f<4&&(d[f]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.IPv6=(function(){function s(d,y){let f,v;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(v=this.parts[f],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,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 h(this.parts,d.parts,16,y)},s.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},v,P;for(let Z=7;Z>=0;Z-=1)if(v=this.parts[Z],v in f){if(P=f[v],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,y=[],f=this.parts;for(let v=0;v<f.length;v++)d=f[v],y.push(d>>8),y.push(d&255);return y},s.prototype.toFixedLengthString=function(){let d=(function(){let f=[];for(let v=0;v<this.parts.length;v++)f.push(I(this.parts[v].toString(16),4));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],f=d[1];return new _.IPv4([y>>8,y&255,f>>8,f&255])},s.prototype.toNormalizedString=function(){let d=(function(){let f=[];for(let v=0;v<this.parts.length;v++)f.push(this.parts[v].toString(16));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,v=-1,P;for(;P=d.exec(y);)P[0].length>v&&(f=P.index,v=P[0].length);return v<0?y:`${y.substring(0,f)}::${y.substring(f+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),_.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(s){return this.parser(s)!==null},_.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(s){let d,y,f,v,P;try{for(d=this.parseCIDR(s),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(v)}catch(Z){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${Z})`)}},_.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(s){let d,y,f;if((y=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return f=[this.parse(y[1]),d],Object.defineProperty(f,"toString",{value:o(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(s){let d,y,f,v,P,Z;if(f=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(l.native.test(s))return g(s,8);if((f=s.match(l.transitional))&&(Z=f[6]||"",d=f[1],f[1].endsWith("::")||(d=d.slice(0,-1)),d=g(d+Z,6),d.parts)){for(P=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<P.length;y++)if(v=P[y],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,f=Math.floor(s/8);for(;y<f;)d[y]=255,y++;return f<16&&(d[f]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.fromByteArray=function(s){let d=s.length;if(d===4)return new _.IPv4(s);if(d===16)return new _.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(s){return _.IPv6.isValid(s)||_.IPv4.isValid(s)},_.isValidCIDR=function(s){return _.IPv6.isValidCIDR(s)||_.IPv4.isValidCIDR(s)},_.parse=function(s){if(_.IPv6.isValid(s))return _.IPv6.parse(s);if(_.IPv4.isValid(s))return _.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(s){try{return _.IPv6.parseCIDR(s)}catch{try{return _.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(s,d,y){let f,v,P,Z;y==null&&(y="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(Z=P[f],s.kind()===Z[0].kind()&&s.match.apply(s,Z))return v}return y},typeof Gt<"u"&&Gt.exports?Gt.exports=_:e.ipaddr=_})(qo)});var Qi=S((Bz,Yi)=>{var Xi=require("stream").Stream,jp=require("util");Yi.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=[]}o(de,"DelayedStream");jp.inherits(de,Xi);de.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(de.prototype,"readable",{configurable:!0,enumerable:!0,get:o(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=Xi.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 na=S((Zz,ra)=>{var Bp=require("util"),ta=require("stream").Stream,ea=Qi();ra.exports=Y;function Y(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(Y,"CombinedStream");Bp.inherits(Y,ta);Y.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};Y.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};Y.prototype.append=function(e){var t=Y.isStreamLike(e);if(t){if(!(e instanceof ea)){var r=ea.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};Y.prototype.pipe=function(e,t){return ta.prototype.pipe.call(this,e,t),this.resume(),e};Y.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}};Y.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=Y.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};Y.prototype._pipeNext=function(e){this._currentStream=e;var t=Y.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()};Y.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};Y.prototype.write=function(e){this.emit("data",e)};Y.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};Y.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")};Y.prototype.end=function(){this._reset(),this.emit("end")};Y.prototype.destroy=function(){this._reset(),this.emit("close")};Y.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Y.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};Y.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)};Y.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ia=S((Hz,oa)=>{"use strict";oa.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 ua=S(ie=>{"use strict";var Xt=ia(),Fp=require("path").extname,aa=/^\s*([^;\s]*)(?:;|\s|$)/,Zp=/^text\//i;ie.charset=sa;ie.charsets={lookup:sa};ie.contentType=Vp;ie.extension=Hp;ie.extensions=Object.create(null);ie.lookup=Gp;ie.types=Object.create(null);qp(ie.extensions,ie.types);function sa(e){if(!e||typeof e!="string")return!1;var t=aa.exec(e),r=t&&Xt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Zp.test(t[1])?"UTF-8":!1}o(sa,"charset");function Vp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?ie.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=ie.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Vp,"contentType");function Hp(e){if(!e||typeof e!="string")return!1;var t=aa.exec(e),r=t&&ie.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Hp,"extension");function Gp(e){if(!e||typeof e!="string")return!1;var t=Fp("x."+e).toLowerCase().substr(1);return t&&ie.types[t]||!1}o(Gp,"lookup");function qp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Xt).forEach(o(function(i){var u=Xt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var g=c[l];if(t[g]){var h=r.indexOf(Xt[t[g]].source),x=r.indexOf(u.source);if(t[g]!=="application/octet-stream"&&(h>x||h===x&&t[g].substr(0,12)==="application/"))continue}t[g]=i}}},"forEachMimeType"))}o(qp,"populateMaps")});var la=S((Wz,ca)=>{ca.exports=Wp;function Wp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Wp,"defer")});var Kr=S((Jz,da)=>{var pa=la();da.exports=Kp;function Kp(e){var t=!1;return pa(function(){t=!0}),o(function(n,i){t?e(n,i):pa(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Kp,"async")});var Jr=S((Yz,ma)=>{ma.exports=Jp;function Jp(e){Object.keys(e.jobs).forEach(Xp.bind(e)),e.jobs={}}o(Jp,"abort");function Xp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Xp,"clean")});var Xr=S((eO,ga)=>{var fa=Kr(),Yp=Jr();ga.exports=Qp;function Qp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=ed(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Yp(r):r.results[i]=c,n(u,r.results))})}o(Qp,"iterate");function ed(e,t,r,n){var i;return e.length==2?i=e(r,fa(n)):i=e(r,t,fa(n)),i}o(ed,"runJob")});var Yr=S((rO,ya)=>{ya.exports=td;function td(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(td,"state")});var Qr=S((oO,ha)=>{var rd=Jr(),nd=Kr();ha.exports=od;function od(e){Object.keys(this.jobs).length&&(this.index=this.size,rd(this),nd(e)(null,this.results))}o(od,"terminator")});var xa=S((aO,va)=>{var id=Xr(),ad=Yr(),sd=Qr();va.exports=ud;function ud(e,t,r){for(var n=ad(e);n.index<(n.keyedList||e).length;)id(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return sd.bind(n,r)}o(ud,"parallel")});var en=S((uO,Yt)=>{var _a=Xr(),cd=Yr(),ld=Qr();Yt.exports=pd;Yt.exports.ascending=Pa;Yt.exports.descending=dd;function pd(e,t,r,n){var i=cd(e,r);return _a(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){_a(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),ld.bind(i,n)}o(pd,"serialOrdered");function Pa(e,t){return e<t?-1:e>t?1:0}o(Pa,"ascending");function dd(e,t){return-1*Pa(e,t)}o(dd,"descending")});var Ta=S((lO,ba)=>{var md=en();ba.exports=fd;function fd(e,t,r){return md(e,t,null,r)}o(fd,"serial")});var Ia=S((dO,Ea)=>{Ea.exports={parallel:xa(),serial:Ta(),serialOrdered:en()}});var tn=S((mO,Sa)=>{"use strict";Sa.exports=Object});var $a=S((fO,Aa)=>{"use strict";Aa.exports=Error});var Oa=S((gO,za)=>{"use strict";za.exports=EvalError});var Ra=S((yO,ka)=>{"use strict";ka.exports=RangeError});var Da=S((hO,wa)=>{"use strict";wa.exports=ReferenceError});var Ca=S((vO,Na)=>{"use strict";Na.exports=SyntaxError});var Qt=S((xO,Ua)=>{"use strict";Ua.exports=TypeError});var La=S((_O,Ma)=>{"use strict";Ma.exports=URIError});var Ba=S((PO,ja)=>{"use strict";ja.exports=Math.abs});var Za=S((bO,Fa)=>{"use strict";Fa.exports=Math.floor});var Ha=S((TO,Va)=>{"use strict";Va.exports=Math.max});var qa=S((EO,Ga)=>{"use strict";Ga.exports=Math.min});var Ka=S((IO,Wa)=>{"use strict";Wa.exports=Math.pow});var Xa=S((SO,Ja)=>{"use strict";Ja.exports=Math.round});var Qa=S((AO,Ya)=>{"use strict";Ya.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ts=S((zO,es)=>{"use strict";var gd=Qa();es.exports=o(function(t){return gd(t)||t===0?t:t<0?-1:1},"sign")});var ns=S((kO,rs)=>{"use strict";rs.exports=Object.getOwnPropertyDescriptor});var rn=S((RO,os)=>{"use strict";var er=ns();if(er)try{er([],"length")}catch{er=null}os.exports=er});var as=S((wO,is)=>{"use strict";var tr=Object.defineProperty||!1;if(tr)try{tr({},"a",{value:1})}catch{tr=!1}is.exports=tr});var nn=S((DO,ss)=>{"use strict";ss.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var ls=S((CO,cs)=>{"use strict";var us=typeof Symbol<"u"&&Symbol,yd=nn();cs.exports=o(function(){return typeof us!="function"||typeof Symbol!="function"||typeof us("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:yd()},"hasNativeSymbols")});var on=S((MO,ps)=>{"use strict";ps.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var an=S((LO,ds)=>{"use strict";var hd=tn();ds.exports=hd.getPrototypeOf||null});var gs=S((jO,fs)=>{"use strict";var vd="Function.prototype.bind called on incompatible ",xd=Object.prototype.toString,_d=Math.max,Pd="[object Function]",ms=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),bd=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Td=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");fs.exports=o(function(t){var r=this;if(typeof r!="function"||xd.apply(r)!==Pd)throw new TypeError(vd+r);for(var n=bd(arguments,1),i,u=o(function(){if(this instanceof i){var x=r.apply(this,ms(n,arguments));return Object(x)===x?x:this}return r.apply(t,ms(n,arguments))},"binder"),c=_d(0,r.length-n.length),l=[],g=0;g<c;g++)l[g]="$"+g;if(i=Function("binder","return function ("+Td(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Ke=S((FO,ys)=>{"use strict";var Ed=gs();ys.exports=Function.prototype.bind||Ed});var rr=S((ZO,hs)=>{"use strict";hs.exports=Function.prototype.call});var sn=S((VO,vs)=>{"use strict";vs.exports=Function.prototype.apply});var _s=S((HO,xs)=>{"use strict";xs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var bs=S((GO,Ps)=>{"use strict";var Id=Ke(),Sd=sn(),Ad=rr(),$d=_s();Ps.exports=$d||Id.call(Ad,Sd)});var Es=S((qO,Ts)=>{"use strict";var zd=Ke(),Od=Qt(),kd=rr(),Rd=bs();Ts.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Od("a function is required");return Rd(zd,kd,t)},"callBindBasic")});var Os=S((KO,zs)=>{"use strict";var wd=Es(),Is=rn(),As;try{As=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var un=!!As&&Is&&Is(Object.prototype,"__proto__"),$s=Object,Ss=$s.getPrototypeOf;zs.exports=un&&typeof un.get=="function"?wd([un.get]):typeof Ss=="function"?o(function(t){return Ss(t==null?t:$s(t))},"getDunder"):!1});var Ns=S((XO,Ds)=>{"use strict";var ks=on(),Rs=an(),ws=Os();Ds.exports=ks?o(function(t){return ks(t)},"getProto"):Rs?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Rs(t)},"getProto"):ws?o(function(t){return ws(t)},"getProto"):null});var cn=S((QO,Cs)=>{"use strict";var Dd=Function.prototype.call,Nd=Object.prototype.hasOwnProperty,Cd=Ke();Cs.exports=Cd.call(Dd,Nd)});var Zs=S((ek,Fs)=>{"use strict";var B,Ud=tn(),Md=$a(),Ld=Oa(),jd=Ra(),Bd=Da(),Qe=Ca(),Ye=Qt(),Fd=La(),Zd=Ba(),Vd=Za(),Hd=Ha(),Gd=qa(),qd=Ka(),Wd=Xa(),Kd=ts(),js=Function,ln=o(function(e){try{return js('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),bt=rn(),Jd=as(),pn=o(function(){throw new Ye},"throwTypeError"),Xd=bt?(function(){try{return arguments.callee,pn}catch{try{return bt(arguments,"callee").get}catch{return pn}}})():pn,Je=ls()(),ne=Ns(),Yd=an(),Qd=on(),Bs=sn(),Tt=rr(),Xe={},em=typeof Uint8Array>"u"||!ne?B:ne(Uint8Array),Le={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?B:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?B:ArrayBuffer,"%ArrayIteratorPrototype%":Je&&ne?ne([][Symbol.iterator]()):B,"%AsyncFromSyncIteratorPrototype%":B,"%AsyncFunction%":Xe,"%AsyncGenerator%":Xe,"%AsyncGeneratorFunction%":Xe,"%AsyncIteratorPrototype%":Xe,"%Atomics%":typeof Atomics>"u"?B:Atomics,"%BigInt%":typeof BigInt>"u"?B:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?B:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?B:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?B:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Md,"%eval%":eval,"%EvalError%":Ld,"%Float16Array%":typeof Float16Array>"u"?B:Float16Array,"%Float32Array%":typeof Float32Array>"u"?B:Float32Array,"%Float64Array%":typeof Float64Array>"u"?B:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?B:FinalizationRegistry,"%Function%":js,"%GeneratorFunction%":Xe,"%Int8Array%":typeof Int8Array>"u"?B:Int8Array,"%Int16Array%":typeof Int16Array>"u"?B:Int16Array,"%Int32Array%":typeof Int32Array>"u"?B:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Je&&ne?ne(ne([][Symbol.iterator]())):B,"%JSON%":typeof JSON=="object"?JSON:B,"%Map%":typeof Map>"u"?B:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Je||!ne?B:ne(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ud,"%Object.getOwnPropertyDescriptor%":bt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?B:Promise,"%Proxy%":typeof Proxy>"u"?B:Proxy,"%RangeError%":jd,"%ReferenceError%":Bd,"%Reflect%":typeof Reflect>"u"?B:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?B:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Je||!ne?B:ne(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?B:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Je&&ne?ne(""[Symbol.iterator]()):B,"%Symbol%":Je?Symbol:B,"%SyntaxError%":Qe,"%ThrowTypeError%":Xd,"%TypedArray%":em,"%TypeError%":Ye,"%Uint8Array%":typeof Uint8Array>"u"?B:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?B:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?B:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?B:Uint32Array,"%URIError%":Fd,"%WeakMap%":typeof WeakMap>"u"?B:WeakMap,"%WeakRef%":typeof WeakRef>"u"?B:WeakRef,"%WeakSet%":typeof WeakSet>"u"?B:WeakSet,"%Function.prototype.call%":Tt,"%Function.prototype.apply%":Bs,"%Object.defineProperty%":Jd,"%Object.getPrototypeOf%":Yd,"%Math.abs%":Zd,"%Math.floor%":Vd,"%Math.max%":Hd,"%Math.min%":Gd,"%Math.pow%":qd,"%Math.round%":Wd,"%Math.sign%":Kd,"%Reflect.getPrototypeOf%":Qd};if(ne)try{null.error}catch(e){Us=ne(ne(e)),Le["%Error.prototype%"]=Us}var Us,tm=o(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 i=e("%AsyncGenerator%");i&&ne&&(r=ne(i.prototype))}return Le[t]=r,r},"doEval"),Ms={__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"]},Et=Ke(),nr=cn(),rm=Et.call(Tt,Array.prototype.concat),nm=Et.call(Bs,Array.prototype.splice),Ls=Et.call(Tt,String.prototype.replace),or=Et.call(Tt,String.prototype.slice),om=Et.call(Tt,RegExp.prototype.exec),im=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,am=/\\(\\)?/g,sm=o(function(t){var r=or(t,0,1),n=or(t,-1);if(r==="%"&&n!=="%")throw new Qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Qe("invalid intrinsic syntax, expected opening `%`");var i=[];return Ls(t,im,function(u,c,l,g){i[i.length]=l?Ls(g,am,"$1"):c||u}),i},"stringToPath"),um=o(function(t,r){var n=t,i;if(nr(Ms,n)&&(i=Ms[n],n="%"+i[0]+"%"),nr(Le,n)){var u=Le[n];if(u===Xe&&(u=tm(n)),typeof u>"u"&&!r)throw new Ye("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Fs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ye("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ye('"allowMissing" argument must be a boolean');if(om(/^%?[^%]*%?$/,t)===null)throw new Qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=sm(t),i=n.length>0?n[0]:"",u=um("%"+i+"%",r),c=u.name,l=u.value,g=!1,h=u.alias;h&&(i=h[0],nm(n,rm([0,1],h)));for(var x=1,I=!0;x<n.length;x+=1){var _=n[x],s=or(_,0,1),d=or(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Qe("property names with quotes must have matching quotes");if((_==="constructor"||!I)&&(g=!0),i+="."+_,c="%"+i+"%",nr(Le,c))l=Le[c];else if(l!=null){if(!(_ in l)){if(!r)throw new Ye("base intrinsic for "+t+" exists, but the property is not available.");return}if(bt&&x+1>=n.length){var y=bt(l,_);I=!!y,I&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[_]}else I=nr(l,_),l=l[_];I&&!g&&(Le[c]=l)}}return l},"GetIntrinsic")});var Hs=S((rk,Vs)=>{"use strict";var cm=nn();Vs.exports=o(function(){return cm()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ws=S((ok,qs)=>{"use strict";var lm=Zs(),Gs=lm("%Object.defineProperty%",!0),pm=Hs()(),dm=cn(),mm=Qt(),ir=pm?Symbol.toStringTag:null;qs.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new mm("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ir&&(n||!dm(t,ir))&&(Gs?Gs(t,ir,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ir]=r)},"setToStringTag")});var Js=S((ak,Ks)=>{"use strict";var fm=Function.prototype.call,gm=Object.prototype.hasOwnProperty,ym=Ke();Ks.exports=ym.call(fm,gm)});var Ys=S((sk,Xs)=>{"use strict";Xs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var tu=S((uk,eu)=>{"use strict";var gn=na(),hm=require("util"),dn=require("path"),vm=require("http"),xm=require("https"),_m=require("url").parse,Pm=require("fs"),bm=require("stream").Stream,Tm=require("crypto"),mn=ua(),Em=Ia(),Im=Ws(),De=Js(),fn=Ys();function Qs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Qs,"escapeHeaderParam");function H(e){if(!(this instanceof H))return new H(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],gn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(H,"FormData");hm.inherits(H,gn);H.LINE_BREAK=`\r
|
|
2
|
-
`;H.DEFAULT_CONTENT_TYPE="application/octet-stream";H.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 i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};H.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)+H.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&De(t,"httpVersion"))&&!(t instanceof bm))&&(r.knownLength||this._valuesToMeasure.push(t))};H.prototype._lengthRetriever=function(e,t){De(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Pm.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):De(e,"httpVersion")?t(null,Number(e.headers["content-length"])):De(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};H.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Qs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&fn(c,r.header);var l;for(var g in c)if(De(c,g)){if(l=c[g],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=g+": "+l.join("; ")+H.LINE_BREAK)}return"--"+this.getBoundary()+H.LINE_BREAK+u+H.LINE_BREAK};H.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&&De(e,"httpVersion")&&(r=dn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Qs(r)+'"'};H.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&&De(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=H.DEFAULT_CONTENT_TYPE),r};H.prototype._multiPartFooter=function(){return function(e){var t=H.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};H.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+H.LINE_BREAK};H.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)De(e,t)&&(r[t.toLowerCase()]=e[t]);return r};H.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};H.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};H.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(H.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};H.prototype._generateBoundary=function(){this._boundary="--------------------------"+Tm.randomBytes(12).toString("hex")};H.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};H.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};H.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}Em.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};H.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=_m(e),n=fn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=fn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=xm.request(n):r=vm.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,g=o(function(h,x){return r.removeListener("error",g),r.removeListener("response",l),t.call(this,h,x)},"callback");l=g.bind(this,null),r.on("error",g),r.on("response",l)}}.bind(this)),r};H.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};H.prototype.toString=function(){return"[object FormData]"};Im(H.prototype,"FormData");eu.exports=H});var Gm={};Pn(Gm,{resend:()=>Hm,resendAuth:()=>z});module.exports=rc(Gm);var nc=Object.freeze({status:"aborted"});function T(e,t,r){function n(l,g){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:g,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,g);let h=c.prototype,x=Object.keys(h);for(let I=0;I<x.length;I++){let _=x[I];_ in l||(l[_]=h[_].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var g;let h=r?.Parent?new u:this;n(h,l),(g=h._zod).deferred??(g.deferred=[]);for(let x of h._zod.deferred)x();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var me=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},St=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ur={};function he(e){return e&&Object.assign(ur,e),ur}o(he,"config");function lr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(lr,"getEnumValues");function En(e,t){return typeof t=="bigint"?t.toString():t}o(En,"jsonStringifyReplacer");function $t(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o($t,"cached");function In(e){return e==null}o(In,"nullish");function zt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(zt,"cleanRegex");var Tn=Symbol("evaluating");function ee(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Tn)return n===void 0&&(n=Tn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(ee,"defineLazy");var pr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(rt,"isObject");var oc=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Sn(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)}o(Sn,"isPlainObject");var An=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(je,"escapeRegex");function Ot(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Ot,"clone");function q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(q,"normalizeParams");function $n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o($n,"optionalKeys");var zn={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 Be(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Be,"aborted");function Ee(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ee,"prefixIssues");function At(e){return typeof e=="string"?e:e?.message}o(At,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=At(e.inst?._zod.def?.error?.(e))??At(t?.error?.(e))??At(r.customError?.(e))??At(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ie,"finalizeIssue");function On(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(On,"getLengthableOrigin");function dr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(dr,"issue");var kn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,En,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Rn=T("$ZodError",kn),nt=T("$ZodError",kn,{Parent:Error});var ac=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new me;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(g=>Ie(g,u,he())));throw pr(l,i?.callee),l}return c.value},"_parse"),kt=ac(nt),sc=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(g=>Ie(g,u,he())));throw pr(l,i?.callee),l}return c.value},"_parseAsync"),Rt=sc(nt),uc=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new me;return u.issues.length?{success:!1,error:new(e??Rn)(u.issues.map(c=>Ie(c,i,he())))}:{success:!0,data:u.value}},"_safeParse"),ot=uc(nt),cc=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Ie(c,i,he())))}:{success:!0,data:u.value}},"_safeParseAsync"),it=cc(nt);var lc="(?:(?:\\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])))",pc=new RegExp(`^${lc}$`);var wn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Dn=/^-?\d+n?$/,Nn=/^-?\d+$/,mr=/^-?\d+(?:\.\d+)?$/,Cn=/^(?:true|false)$/i;var Se=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),dc={number:"number",bigint:"bigint",object:"date"};var Un=T("$ZodCheckGreaterThan",(e,t)=>{Se.init(e,t);let r=dc[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Mn=T("$ZodCheckNumberFormat",(e,t)=>{Se.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=zn[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=i,l.maximum=u,r&&(l.pattern=Nn)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>u&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Ln=T("$ZodCheckMinLength",(e,t)=>{var r;Se.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!In(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=On(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var fr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Se.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),jn=T("$ZodCheckRegex",(e,t)=>{fr.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 Fn={major:4,minor:3,patch:6};var X=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,g)=>{let h=Be(c),x;for(let I of l){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(h)continue;let _=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&g?.async===!1)throw new me;if(x||s instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(h||(h=Be(c,_)))});else{if(c.issues.length===_)continue;h||(h=Be(c,_))}}return x?x.then(()=>c):c},"runChecks"),u=o((c,l,g)=>{if(Be(c))return c.aborted=!0,c;let h=i(l,n,g);if(h instanceof Promise){if(g.async===!1)throw new me;return h.then(x=>e._zod.parse(x,g))}return e._zod.parse(h,g)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(x=>u(x,c,l)):u(h,c,l)}let g=e._zod.parse(c,l);if(g instanceof Promise){if(l.async===!1)throw new me;return g.then(h=>i(h,n,l))}return i(g,n,l)}}ee(e,"~standard",()=>({validate:o(i=>{try{let u=ot(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return it(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=T("$ZodString",(e,t)=>{X.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wn(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}}),gr=T("$ZodStringFormat",(e,t)=>{fr.init(e,t),Nt.init(e,t)});var qn=T("$ZodURL",(e,t)=>{gr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var yr=T("$ZodNumber",(e,t)=>{X.init(e,t),e._zod.pattern=e._zod.bag.pattern??mr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),Wn=T("$ZodNumberFormat",(e,t)=>{Mn.init(e,t),yr.init(e,t)}),hr=T("$ZodBoolean",(e,t)=>{X.init(e,t),e._zod.pattern=Cn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Kn=T("$ZodBigInt",(e,t)=>{X.init(e,t),e._zod.pattern=Dn,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 Jn=T("$ZodAny",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),Xn=T("$ZodUnknown",(e,t)=>{X.init(e,t),e._zod.parse=r=>r});var Yn=T("$ZodVoid",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Qn=T("$ZodDate",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Zn(e,t,r){e.issues.length&&t.issues.push(...Ee(r,e.issues)),t.value[r]=e.value}o(Zn,"handleArrayResult");var eo=T("$ZodArray",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],g=t.element._zod.run({value:l,issues:[]},n);g instanceof Promise?u.push(g.then(h=>Zn(h,r,c))):Zn(g,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Dt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ee(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Dt,"handlePropertyResult");function mc(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=$n(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(mc,"normalizeDef");function fc(e,t,r,n,i,u){let c=[],l=i.keySet,g=i.catchall._zod,h=g.def.type,x=g.optout==="optional";for(let I in t){if(l.has(I))continue;if(h==="never"){c.push(I);continue}let _=g.run({value:t[I],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>Dt(s,r,I,t,x))):Dt(_,r,I,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(fc,"handleCatchall");var to=T("$ZodObject",(e,t)=>{if(X.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let g={...l};return Object.defineProperty(t,"shape",{value:g}),g},"get")})}let n=$t(()=>mc(t));ee(e._zod,"propValues",()=>{let l=t.shape,g={};for(let h in l){let x=l[h]._zod;if(x.values){g[h]??(g[h]=new Set);for(let I of x.values)g[h].add(I)}}return g});let i=rt,u=t.catchall,c;e._zod.parse=(l,g)=>{c??(c=n.value);let h=l.value;if(!i(h))return l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l;l.value={};let x=[],I=c.shape;for(let _ of c.keys){let s=I[_],d=s._zod.optout==="optional",y=s._zod.run({value:h[_],issues:[]},g);y instanceof Promise?x.push(y.then(f=>Dt(f,l,_,h,d))):Dt(y,l,_,h,d)}return u?fc(x,h,l,g,n.value,e):x.length?Promise.all(x).then(()=>l):l}});function Vn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Be(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Ie(c,n,he())))}),t)}o(Vn,"handleUnionResults");var vr=T("$ZodUnion",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ee(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>zt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let g of t.options){let h=g._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)l.push(h),c=!0;else{if(h.issues.length===0)return h;l.push(h)}}return c?Promise.all(l).then(g=>Vn(g,i,e,u)):Vn(l,i,e,u)}});var ro=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,vr.init(e,t);let r=e._zod.parse;ee(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,g]of Object.entries(c)){i[l]||(i[l]=new Set);for(let h of g)i[l].add(h)}}return i});let n=$t(()=>{let i=t.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let g of l){if(u.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);u.set(g,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!rt(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var no=T("$ZodRecord",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Sn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){l.add(typeof h=="number"?h.toString():h);let x=t.valueType._zod.run({value:i[h],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...Ee(h,I.issues)),r.value[h]=I.value})):(x.issues.length&&r.issues.push(...Ee(h,x.issues)),r.value[h]=x.value)}let g;for(let h in i)l.has(h)||(g=g??[],g.push(h));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:g})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let g=t.keyType._zod.run({value:l,issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&mr.test(l)&&g.issues.length){let I=t.keyType._zod.run({value:Number(l),issues:[]},n);if(I instanceof Promise)throw new Error("Async schemas not supported in object keys currently");I.issues.length===0&&(g=I)}if(g.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(I=>Ie(I,n,he())),input:l,path:[l],inst:e});continue}let x=t.valueType._zod.run({value:i[l],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...Ee(l,I.issues)),r.value[g.value]=I.value})):(x.issues.length&&r.issues.push(...Ee(l,x.issues)),r.value[g.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var oo=T("$ZodEnum",(e,t)=>{X.init(e,t);let r=lr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>An.has(typeof i)).map(i=>typeof i=="string"?je(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),io=T("$ZodLiteral",(e,t)=>{if(X.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"?je(n):n?je(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var ao=T("$ZodTransform",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new St(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new me;return r.value=i,r}});function Hn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Hn,"handleOptionalResult");var so=T("$ZodOptional",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(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 i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Hn(u,r.value)):Hn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var uo=T("$ZodNullable",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)}|null)$`):void 0}),ee(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 co=T("$ZodPipe",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>wt(c,t.in,n)):wt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>wt(u,t.out,n)):wt(i,t.out,n)}});function wt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(wt,"handlePipeResult");var lo=T("$ZodCustom",(e,t)=>{Se.init(e,t),X.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Gn(u,r,n,e));Gn(i,r,n,e)}});function Gn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(dr(i))}}o(Gn,"handleRefineResult");var mo;var xr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function fo(){return new xr}o(fo,"registry");(mo=globalThis).__zod_globalRegistry??(mo.__zod_globalRegistry=fo());var _r=globalThis.__zod_globalRegistry;function go(e,t){return new e({type:"string",...q(t)})}o(go,"_string");function yo(e,t){return new e({type:"string",coerce:!0,...q(t)})}o(yo,"_coercedString");function ho(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...q(t)})}o(ho,"_url");function vo(e,t){return new e({type:"number",checks:[],...q(t)})}o(vo,"_number");function xo(e,t){return new e({type:"number",coerce:!0,checks:[],...q(t)})}o(xo,"_coercedNumber");function _o(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...q(t)})}o(_o,"_int");function Po(e,t){return new e({type:"boolean",...q(t)})}o(Po,"_boolean");function bo(e,t){return new e({type:"boolean",coerce:!0,...q(t)})}o(bo,"_coercedBoolean");function To(e,t){return new e({type:"bigint",coerce:!0,...q(t)})}o(To,"_coercedBigint");function Eo(e){return new e({type:"any"})}o(Eo,"_any");function Io(e){return new e({type:"unknown"})}o(Io,"_unknown");function So(e,t){return new e({type:"void",...q(t)})}o(So,"_void");function Ao(e,t){return new e({type:"date",coerce:!0,...q(t)})}o(Ao,"_coercedDate");function Ct(e,t){return new Un({check:"greater_than",...q(t),value:e,inclusive:!0})}o(Ct,"_gte");function pe(e,t){return new Ln({check:"min_length",...q(t),minimum:e})}o(pe,"_minLength");function Ae(e,t){return new jn({check:"string_format",format:"regex",...q(t),pattern:e})}o(Ae,"_regex");function $o(e,t,r){let n=q(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o($o,"_custom");var te=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");X.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)=>Rt(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)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Mt=T("ZodMiniString",(e,t)=>{Nt.init(e,t),te.init(e,t)});function a(e){return go(Mt,e)}o(a,"string");var zo=T("ZodMiniStringFormat",(e,t)=>{gr.init(e,t),Mt.init(e,t)});var Ac=T("ZodMiniURL",(e,t)=>{qn.init(e,t),zo.init(e,t)});function Oo(e){return ho(Ac,e)}o(Oo,"url");var Lt=T("ZodMiniNumber",(e,t)=>{yr.init(e,t),te.init(e,t)});function re(e){return vo(Lt,e)}o(re,"number");var $c=T("ZodMiniNumberFormat",(e,t)=>{Wn.init(e,t),Lt.init(e,t)});function ko(e){return _o($c,e)}o(ko,"int");var Pr=T("ZodMiniBoolean",(e,t)=>{hr.init(e,t),te.init(e,t)});function V(e){return Po(Pr,e)}o(V,"boolean");var Ro=T("ZodMiniBigInt",(e,t)=>{Kn.init(e,t),te.init(e,t)});var zc=T("ZodMiniAny",(e,t)=>{Jn.init(e,t),te.init(e,t)});function st(){return Eo(zc)}o(st,"any");var Oc=T("ZodMiniUnknown",(e,t)=>{Xn.init(e,t),te.init(e,t)});function C(){return Io(Oc)}o(C,"unknown");var kc=T("ZodMiniVoid",(e,t)=>{Yn.init(e,t),te.init(e,t)});function wo(e){return So(kc,e)}o(wo,"_void");var Do=T("ZodMiniDate",(e,t)=>{Qn.init(e,t),te.init(e,t)});var Rc=T("ZodMiniArray",(e,t)=>{eo.init(e,t),te.init(e,t)});function R(e,t){return new Rc({type:"array",element:e,...q(t)})}o(R,"array");var wc=T("ZodMiniObject",(e,t)=>{to.init(e,t),te.init(e,t),ee(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...q(t)};return new wc(r)}o(p,"object");var Dc=T("ZodMiniUnion",(e,t)=>{vr.init(e,t),te.init(e,t)});function j(e,t){return new Dc({type:"union",options:e,...q(t)})}o(j,"union");var Nc=T("ZodMiniDiscriminatedUnion",(e,t)=>{ro.init(e,t),te.init(e,t)});function $e(e,t,r){return new Nc({type:"union",options:t,discriminator:e,...q(r)})}o($e,"discriminatedUnion");var Cc=T("ZodMiniRecord",(e,t)=>{no.init(e,t),te.init(e,t)});function U(e,t,r){return new Cc({type:"record",keyType:e,valueType:t,...q(r)})}o(U,"record");var Uc=T("ZodMiniEnum",(e,t)=>{oo.init(e,t),te.init(e,t),e.options=Object.values(t.entries)});function O(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Uc({type:"enum",entries:r,...q(t)})}o(O,"_enum");var Mc=T("ZodMiniLiteral",(e,t)=>{io.init(e,t),te.init(e,t)});function $(e,t){return new Mc({type:"literal",values:Array.isArray(e)?e:[e],...q(t)})}o($,"literal");var Lc=T("ZodMiniTransform",(e,t)=>{ao.init(e,t),te.init(e,t)});function ze(e){return new Lc({type:"transform",transform:e})}o(ze,"transform");var jc=T("ZodMiniOptional",(e,t)=>{so.init(e,t),te.init(e,t)});function m(e){return new jc({type:"optional",innerType:e})}o(m,"optional");var Bc=T("ZodMiniNullable",(e,t)=>{uo.init(e,t),te.init(e,t)});function ut(e){return new Bc({type:"nullable",innerType:e})}o(ut,"nullable");var Fc=T("ZodMiniPipe",(e,t)=>{co.init(e,t),te.init(e,t)});function Oe(e,t){return new Fc({type:"pipe",in:e,out:t})}o(Oe,"pipe");var Zc=T("ZodMiniCustom",(e,t)=>{lo.init(e,t),te.init(e,t)});function jt(e,t){return $o(Zc,e??(()=>!0),t)}o(jt,"custom");var ct={};Pn(ct,{bigint:()=>Kc,boolean:()=>Wc,date:()=>Jc,number:()=>qc,string:()=>Gc});function Gc(e){return yo(Mt,e)}o(Gc,"string");function qc(e){return xo(Lt,e)}o(qc,"number");function Wc(e){return bo(Pr,e)}o(Wc,"boolean");function Kc(e){return To(Ro,e)}o(Kc,"bigint");function Jc(e){return Ao(Do,e)}o(Jc,"date");var Tr=p({retryOnFailure:p({defaultValue:m(V()),hide:m(V())}),continueOnFailure:p({defaultValue:m(V()),hide:m(V())})}),br=class{constructor(t,r,n,i,u,c,l,g,h,x,I,_,s){this.name=t;this.displayName=r;this.description=n;this.props=i;this.propertyGroups=u;this.run=c;this.test=l;this.requireAuth=g;this.errorHandlingOptions=h;this.outputSchema=x;this.audience=I;this.aiMetadata=_;this.classification=s}static{o(this,"IAction")}},L=o(e=>new br(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 F=p({displayName:a(),description:m(a()),advanced:m(V()),width:m(O(["half","full"])),icon:m(a()),placeholder:m(a())}),M=o((e,t)=>p({type:$(t),required:V(),defaultValue:m(st())}),"TPropertyValue");var ae=p({...F.shape,...M(a(),"SHORT_TEXT").shape}),ve=p({...F.shape,...M(a(),"LONG_TEXT").shape});var Co=p({label:a(),value:C(),description:m(a()),icon:m(a())}),Bt=p({disabled:m(V()),placeholder:m(a()),options:R(Co)});var Yc=O(["cards"]),se=p({...F.shape,options:Bt,display:m(Yc),...M(C(),"STATIC_DROPDOWN").shape}),xe=p({...F.shape,options:Bt,...M(R(C()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Er=p({...F.shape,...M(C(),"DROPDOWN").shape,refreshers:R(a())}),lt=p({...F.shape,...M(R(C()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var _e=p({...F.shape,reveals:m(R(a())),...M(V(),"CHECKBOX").shape});var Pe=p({...F.shape,display:m(O(["stepper"])),min:m(re()),max:m(re()),step:m(re()),...M(re(),"NUMBER").shape});var pt=p({...F.shape,streaming:m(V()),...M(C(),"FILE").shape});var dt=p({...F.shape,...M(a(),"DATE_TIME").shape});var Uo=U(a(),j([ae,ve,se,lt,xe,_e,Pe,pt,dt])),mt=p({...F.shape,properties:Uo,...M(R(C()),"ARRAY").shape});var Mo=O(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Lo=p({preset:m(Mo),after:m(a()),before:m(a())}),Ir=p({...F.shape,display:m(O(["dropdown"])),...M(Lo,"DATE_RANGE").shape});var ft=p({...F.shape,...M(j([U(a(),C())]),"JSON").shape});var jo=j([ae,se,ft,mt,xe]),Qc=U(a(),jo),Sr=p({refreshers:R(a()),...F.shape,...M(C(),"DYNAMIC").shape});var Ft=p({...F.shape,...M(wo(),"MARKDOWN").shape});var gt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(gt||{}),Fe=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Fe||{}),Ze=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Ze||{});var yt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(yt||{}),Ar="both_client_credentials_and_authorization_code";var ke=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ke||{}),ht=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(ht||{}),el=p({strategy:O(ht),paramName:m(a())}),vt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(vt||{});var Zt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Zt||{}),Bo=p({status:m(re()),body:m(C()),headers:m(U(a(),a()))}),Fo=p({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:m(a()),handlerId:m(a()),streamStepProgress:m(O(Zt))}),Zo=p({type:$("WEBHOOK"),requestId:a(),requestIdToReply:m(a()),response:Bo,handlerId:m(a()),streamStepProgress:m(O(Zt))}),tl=j([Fo,Zo]);var rl=p({body:C(),rawBody:m(C()),headers:U(a(),a()),queryParams:U(a(),a())});function ue(e){return e==null}o(ue,"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}o(xt,"isEmpty");function Vt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Vt,"assertNotNullOrUndefined");var $r=Ne(require("crypto"),1);var nl=128,Re,Ve,ol=o(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!Re||Re.length<e?(Re=Buffer.allocUnsafe(e*nl),$r.default.randomFillSync(Re),Ve=0):Ve+e>Re.length&&($r.default.randomFillSync(Re),Ve=0)}catch(t){throw Re=void 0,t}Ve+=e},"fillPool"),il=o(e=>(ol(e|=0),Re.subarray(Ve-e,Ve)),"random"),al=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{if(u<=0)return"";let c="";for(;;){let l=r(i),g=i;for(;g--;)if(c+=e[l[g]&n]||"",c.length===u)return c}}},"customRandom"),Ho=o((e,t=21)=>al(e,t,il),"customAlphabet");var sl="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Go=21,kT=a().check(Ae(new RegExp(`^[0-9a-zA-Z]{${Go}}$`))),ul=Ho(sl,Go);var we=Oe(ze(e=>e instanceof Date?e.toISOString():e),a()),le={id:a(),created:we,updated:we},K=o(e=>m(ut(e)),"Nullable");function zr(e){return m(ut(O(e)))}o(zr,"NullableEnum");var DT=Oe(ze(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),m(V())),Ht=o(e=>Oe(ze(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),m(R(e))),"OptionalArrayFromQuery");var UT=U(a(),C());var _t=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(_t||{});var KT=a().check(Ae(/^#[0-9A-Fa-f]{6}$/));var XT=p({filename:a(),data:C(),type:$("file"),mimetype:m(a())});var cl=Ne(Wo());var oE=p({...le,name:a(),permissions:R(a()),platformId:K(a()),type:a(),userCount:m(re())});var Ko=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ko||{}),Or=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Or||{}),kr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(kr||{});var Rr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Rr||{});var wr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(wr||{});var ll=p({mode:O(Ko),value:C()}),pl=p({auth:m(a()),fields:U(a(),ll)}),dl=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:m(pl)}),ml=p({type:$("PIECE"),toolName:a().check(pe(1)),pieceMetadata:dl}),fl=p({type:$("none")}),gl=p({type:$("access_token"),accessToken:a()}),yl=p({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),hl=p({type:$("headers"),headers:U(a(),a())}),vl=$e("type",[fl,gl,yl,hl]),Jo=p({type:$("FLOW"),toolName:a().check(pe(1)),externalFlowId:a(),flowDisplayName:m(a())}),Xo=p({type:$("MCP"),toolName:a().check(pe(1)),serverUrl:Oo(),protocol:O(kr),auth:vl}),Yo=p({type:$("KNOWLEDGE_BASE"),toolName:a().check(pe(1)),sourceType:O(Or),sourceId:a(),sourceName:a()}),xl=$e("type",[ml,Jo,Xo,Yo]),_l=p({displayName:a(),description:m(a()),type:O(Rr)}),Qo=p({type:$("MARKDOWN"),markdown:a()}),He={type:$("TOOL_CALL"),input:K(U(a(),C())),output:m(C()),toolName:a(),status:O(wr),toolCallId:a(),startTime:a(),endTime:m(a())},NE=p(He),ei=$e("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()})]),Pl=j([Qo,ei]);var Dr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Dr||{}),be=p({apiKey:a()}),bl=be,Tl=p({apiKey:a(),apiKeyHash:a()}),El=be,Il=be,Sl=be,Al=be,$l=be,zl=be,Ol=be,ii=p({accessKeyId:a().check(pe(1)),secretAccessKey:a().check(pe(1))}),kl=p({}),Rl=p({}),wl=p({}),Dl=p({}),Nl=p({}),Cl=p({}),ai=p({modelId:a(),modelName:a(),modelType:O(Dr)}),si=p({apiKeyHeader:a(),baseUrl:a(),models:R(ai),defaultHeaders:m(U(a(),a()))}),ui=p({accountId:a(),gatewayId:a(),models:R(ai),vertexProject:m(a()),vertexRegion:m(a())}),ci=p({resourceName:a(),apiVersion:Oe(ze(e=>typeof e=="string"&&e.trim().length===0?void 0:e),m(a()))}),li=p({region:a().check(pe(1))}),Ul=j([bl,Sl,Al,$l,zl,Il,El,Tl,ii,Ol]),pi=j([si,ui,ci,li,kl,wl,Dl,Nl,Rl,Cl]),Ml=p({id:a(),name:a(),type:O(Dr)}),Ll=p({id:a(),name:a(),provider:O(_t),config:pi,enabledForChat:V()}),jl=p({provider:O(_t),config:pi,auth:Ul,platformId:a()});var LE={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ti=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Bl=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Fl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],ri=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Zl=["grok-4.20","grok-4.1-fast"],Vl={openai:ti,anthropic:Bl,google:ri,activepieces:[...Fl.map(e=>`anthropic/${e}`),...ti.map(e=>`openai/${e}`),...ri.map(e=>`google/${e}`),...Zl.map(e=>`x-ai/${e}`)]};var ni=128e3,Hl={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Gl({provider:e}){return e?Hl[e]??ni:ni}o(Gl,"getMaxContextTokens");var oi={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"},ql={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Wl=new Set(["anthropic","mistral"]);function fe(e){return{chatModels:Vl[e],maxContextTokens:Gl({provider:e}),defaultEmbeddingModel:oi[e],supportsEmbedding:oi[e]!==void 0,supportsImageGeneration:!Wl.has(e),webSearch:ql[e]}}o(fe,"buildProviderCapabilities");var Kl={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 Jl=p({base64Url:a(),fileName:a(),extension:m(a())}),Xl=p({mimeType:a(),url:a(),fileName:m(a())}),Nr=j([Jl,Xl]);var Yl=j([p({type:$("file"),value:Nr}),p({type:$("markdown"),value:a(),files:m(R(Nr))})]),Ql=p({sessionId:a(),message:a(),files:m(R(a()))});var mi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(mi||{}),fi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(fi||{}),Cr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Cr||{});var ep=j([p({...le,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:R(p({value:a()}))})}),p({...le,name:a(),externalId:a(),type:j([$("TEXT"),$("NUMBER"),$("DATE"),$("DATETIME")]),tableId:a(),projectId:a()})]),tp=p({...le,name:a(),folderId:K(a()),projectId:a(),externalId:a(),status:zr(fi),trigger:zr(mi)}),rp=p({...le,tableId:a(),projectId:a(),cells:U(a(),p({updated:a(),created:a(),value:C(),fieldName:a()}))}),np=p({events:R(O(Cr)),webhookUrl:a(),flowId:a()}),op=p({fields:R(p({id:a(),name:a()})),rows:R(U(a(),a())),name:a()}),ip=p({projectId:a(),limit:m(ct.number()),cursor:m(a()),name:m(a()),externalIds:Ht(a()),folderId:m(a()),folderIds:Ht(a())}),ap=p({records:R(R(p({fieldId:a(),value:yi()}))),tableId:a()}),sp=p({cells:m(R(p({fieldId:a(),value:yi()}))),tableId:a(),agentUpdate:m(V())}),gi=$e("operator",[Ce("eq"),Ce("neq"),Ce("gt"),Ce("gte"),Ce("lt"),Ce("lte"),Ce("co"),di("exists"),di("not_exists")]),up=p({tableId:a(),limit:m(ct.number()),cursor:m(a()),filters:Ht(gi)});function yi(){return Oe(ze(e=>e==null?e:String(e)),ut(a()))}o(yi,"coerceToString");function Ce(e){return p({fieldId:a(),operator:$(e),value:a()})}o(Ce,"valueFilter");function di(e){return p({fieldId:a(),operator:$(e)})}o(di,"existenceFilter");var cp=p({status:m(re()),body:m(C()),headers:m(U(a(),a()))}),lp=p({...le,deleted:K(we),ownerId:a(),displayName:a(),platformId:a(),externalId:K(a())});var hi=p({name:a(),description:m(a()),type:a(),required:V()}),pp=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:R(hi),returnsResponse:V()})});var vi="^[0-9]+\\.[0-9]+\\.[0-9]+$",oI=new RegExp(vi),mp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",iI=a().check(Ae(new RegExp(vi))),aI=a().check(Ae(new RegExp(mp))),fp=p({packageType:$("ARCHIVE"),pieceType:O(Fe),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),xi=p({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),_i=p({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),sI=j([xi,_i]),uI=j([fp,xi,_i]);var gp=$e("type",[p({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:$("INTERVAL"),intervalMs:ko().check(Ct(6e4))})]),cI=p({...le,type:O(ke),projectId:a(),flowId:a(),triggerName:a(),schedule:K(gp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:K(a()),simulate:V()}),Pi=(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))(Pi||{}),bi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(bi||{}),Ti=(r=>(r.S3="S3",r.DB="DB",r))(Ti||{}),lI=p({...le,projectId:K(a()),platformId:K(a()),type:O(Pi),compression:O(bi),data:m(C()),location:O(Ti),size:K(re()),fileName:K(a()),s3Key:K(a()),metadata:K(U(a(),a()))}),Ei=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ei||{}),Ii=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ii||{}),pI=p({id:a(),email:a(),firstName:a(),status:O(Ii),externalId:K(a()),platformId:K(a()),platformRole:O(Ei),lastName:a(),created:we,updated:we,lastActiveDate:K(we),imageUrl:K(a())});var Ur=p({...F.shape,...M(U(a(),C()),"OBJECT").shape});var Mr=p({...F.shape,formatProperty:m(a()),...M(a(),"RICH_TEXT").shape});var zi=p({...F.shape,...M(a(),"COLOR").shape});var Lr=j([ae,ve,Mr,Ft,_e,se,xe,Er,lt,Sr,Pe,mt,Ur,ft,dt,Ir,pt,zi]),b={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},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=p({displayName:a(),description:m(a()),hasConnectionIdentifier:m(V())});var Oi=p({username:a(),password:a()}),jr=p({...ge.shape,username:p({displayName:a(),description:m(a())}),password:p({displayName:a(),description:m(a())}),...M(Oi,"BASIC_AUTH").shape});var xp=U(a(),j([ae,ve,Pe,_e,se])),Br=p({...ge.shape,props:xp,...M(C(),"CUSTOM_AUTH").shape});var Ue=p({...ge.shape,...M(p({auth:a()}),"SECRET_TEXT").shape});var _p=U(a(),j([ae,ve,Ue,Pe,_e,se,xe,Ft])),ki=p({...ge.shape,props:_p,...M(C(),"OIDC").shape});var Fr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Fr||{}),Ri=j([ae,Ue,se]),wi=U(a(),Ri),Pp=p({props:m(U(a(),Ri)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:m(j([$("none"),$("consent"),$("login"),$("omit")])),pkce:m(V()),pkceMethod:m(j([$("plain"),$("S256")])),authorizationMethod:m(O(Fr)),grantType:m(j([O(yt),$(Ar)])),extra:m(U(a(),a()))}),Di=p({access_token:a(),props:m(wi),data:U(a(),st())}),Zr=p({...ge.shape,...Pp.shape,...M(Di,"OAUTH2").shape});var Ge=j([jr,Br,ki,Zr,Ue]),Pt="Connection",Vr={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 WS={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 bp=p({...F.shape,...M(C(),"CUSTOM").shape,code:a()});var Tp=j([Lr,Ge]),Hr=U(a(),Tp),gA=U(a(),Lr);var Ni=j([p({strategy:$("CRON"),cronExpression:a()}),p({strategy:$("NONE")})]),qe=class{constructor(t,r,n,i,u,c,l,g,h,x,I,_,s,d,y,f,v,P,Z,oe,ce){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=l;this.onHandshake=g;this.renewConfiguration=h;this.onRenew=x;this.onEnable=I;this.onDisable=_;this.onStart=s;this.run=d;this.test=y;this.sampleData=f;this.testStrategy=v;this.outputSchema=P;this.aiMetadata=Z;this.classification=oe;this.propertyGroups=ce}static{o(this,"ITrigger")}},Ci=o(e=>{switch(e.type){case"WEBHOOK":return new qe(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 qe(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 qe(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 qe(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,ue(e.sampleData)&&ue(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var Ui="2",qt="0.82.0";var Gr=class{constructor(t,r,n,i,u,c,l,g,h=qt,x,I="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=g;this.minimumSupportedRelease=h;this.maximumSupportedRelease=x;this.description=I;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ui}),"getContextInfo");(!Ip(h)||Sp(h,qt))&&(this.minimumSupportedRelease=qt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:Ep(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}},Li=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Gr(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 Ep(e){if(e!==void 0)return Array.isArray(e)?e.map(Mi):Mi(e)}o(Ep,"withConnectionIdentifierFlag");function Mi(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}o(Mi,"flagConnectionIdentifier");function Ip(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Ip,"isValidSimpleSemver");function Sp(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(Sp,"isSemverLessThan");var Ap=m(U(a(),U(a(),a()))),ji=p({id:m(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:m(a()),directoryPath:m(a()),auth:m(j([Ge,R(Ge)])),version:a(),categories:m(R(O(Ze))),minimumSupportedRelease:m(a()),maximumSupportedRelease:m(a()),deprecated:m(V()),i18n:Ap}),$p=O(["human","ai","both"]),Bi=p({description:m(a()),idempotent:m(V())}),Fi=O(["READ","WRITE"]),zp=O(["tabs","section","summary","builder","footer"]),Zi=p({key:a(),display:zp,label:m(a()),description:m(a()),icon:m(a()),props:R(a())}),Vi=p({name:a(),displayName:a(),description:a(),props:Hr,propertyGroups:m(R(Zi)),requireAuth:V(),errorHandlingOptions:m(Tr),outputSchema:m(jt()),audience:m($p),aiMetadata:m(Bi),classification:m(Fi)}),Hi=p({name:a(),displayName:a(),description:a(),props:Hr,propertyGroups:m(R(Zi)),errorHandlingOptions:m(Tr),type:O(ke),sampleData:C(),handshakeConfiguration:m(jt()),renewConfiguration:m(Ni),testStrategy:O(vt),outputSchema:m(jt()),aiMetadata:m(Bi),classification:m(Fi)}),Op=p({...ji.shape,actions:U(a(),Vi),triggers:U(a(),Hi)}),kp=p({...ji.shape,actions:re(),triggers:re(),suggestedActions:m(R(Vi)),suggestedTriggers:m(R(Hi))}),Gi=p({projectUsage:re(),pieceType:O(Fe),packageType:O(gt),platformId:m(a()),archiveId:m(a())}),h$=p({...Op.shape,...Gi.shape}),v$=p({...kp.shape,...Gi.shape}),x$=p({name:a(),version:a()});var Rp=Ne(require("path")),wp=Ne(require("fs/promises"));var We=require("node:stream");var Wt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Kt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new qr,r=new Wr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},qr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Wr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Me=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function qi({error:e,requestBody:t}){return e instanceof Me?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(qi,"toFailsafeOutput");var G=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(G||{});var Jt=class extends Wt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Kt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[Z,oe]of Object.entries(c))i.append(Z,oe);let l=i.toString(),g=l?`${n}?${l}`:n,h=t.responseType??"json",x=t.followRedirects??!0,I=t.retries??0,{body:_,extraHeaders:s,isStream:d}=Dp(t.method)?Np(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},y=Up({...u,...s}),f=await Cp(async()=>{let Z=new AbortController,oe=t.timeout&&t.timeout>0?setTimeout(()=>Z.abort(),t.timeout):void 0;try{let ce={method:t.method.toString(),headers:y,body:_,redirect:x?"follow":"manual",signal:Z.signal};return d&&(ce.duplex="half"),r?.dispatcher!==void 0&&(ce.dispatcher=r.dispatcher),await fetch(g,ce)}finally{oe!==void 0&&clearTimeout(oe)}},d?0:I),v=x?300:400;if(f.status<200||f.status>=v){let Z=await Wi(f,h==="stream"?"text":h),oe=new Me(t.body,{status:f.status,responseBody:Z});throw console.error("[HttpClient#(sanitized error message)] Request failed:",oe),oe}let P=await Wi(f,h);return{status:f.status,headers:Mp(f.headers),body:P}}};function Dp(e){return e!=="GET"&&e!=="HEAD"}o(Dp,"acceptsRequestBody");function Np(e,t){if(Ji(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Lp(e)){let n=new We.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof We.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Np,"serializeBody");async function Wi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Ji(e.body)?We.Readable.from([]):We.Readable.fromWeb(e.body);case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Wi,"parseResponseBody");async function Cp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ki(n);continue}return i}catch(i){if(r=i,n<t){await Ki(n);continue}throw i}throw r}o(Cp,"sendWithRetries");function Ki(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ki,"backoff");function Up(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(Up,"normalizeHeaders");function Mp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Mp,"toHttpHeaders");function Lp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Lp,"isNodeFormData");function Ji(e){return e==null}o(Ji,"isNil");var A=new Jt;var Sm=Ne(require("fs")),ru=Ne(tu());var Am={"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 $m(e){let t=e.split(";")[0].trim().toLowerCase();return Am[t]??""}o($m,"contentTypeToExtension");var zm=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Om=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function nu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:g="headers"}){return L({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:b.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:b.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
-
i.e ${Om(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:b.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(G).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:b.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:b.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:b.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:b.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let x=h,I={};switch(x){case"none":break;case"json":I.data=b.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=b.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.data=b.Array({displayName:"Form Data",required:!0,properties:{fieldName:b.ShortText({displayName:"Field Name",required:!0}),fieldType:b.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:b.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:b.File({displayName:"File Field Value",required:!1})}});break}return I},"props")}),response_is_binary:b.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:b.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:b.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:b.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async h=>{let{method:x,url:I,headers:_,queryParams:s,body:d,body_type:y,failsafe:f,timeout:v,response_is_binary:P,followRedirects:Z}=h.propsValue;Vt(x,"Method"),Vt(I,"URL");let oe=ue(r)?{}:await r(h.auth,h.propsValue),ce=I.url,et=ce.startsWith("http://")||ce.startsWith("https://")?ce:zm({baseUrl:t(h.auth),relativePath:ce}),Te={method:x,url:et,headers:{..._??{},...g==="headers"||!ue(g)?oe:{}},queryParams:{...g==="queryParams"?oe:{},...s??{}},timeout:v?v*1e3:0,followRedirects:Z};if(P&&(Te.responseType="arraybuffer"),d)if(y&&y!=="none"){let ye=d.data;if(y==="form_data"){let Ju=ye,It=new ru.default;for(let{fieldName:vn,fieldType:xn,textFieldValue:_n,fileFieldValue:sr}of Ju)xn==="text"&&!xt(_n)?It.append(vn,_n):xn==="file"&&!xt(sr)&&It.append(vn,sr.data,{filename:sr?.filename});Te.body=It,Te.headers={...Te.headers,...It.getHeaders()}}else Te.body=ye}else y||(Te.body=d);try{let ye=await A.sendRequest(Te);return await km(h.files,ye.body,ye.status,ye.headers,P)}catch(ye){if(f)return qi({error:ye,requestBody:Te.body});throw ye}},"run")})}o(nu,"createCustomApiCallAction");var km=o(async(e,t,r,n,i)=>{let u;if(i&&Rm(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=$m(c??"")||"txt",g;t instanceof ArrayBuffer?g=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?g=t:g=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:g})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Rm=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var wm=[{key:"id",label:"Contact ID"},{key:"email",label:"Email",format:"email"},{key:"first_name",label:"First Name"},{key:"last_name",label:"Last Name"},{key:"unsubscribed",label:"Unsubscribed",format:"boolean"},{key:"created_at",label:"Created At",format:"datetime"}],ou=[{key:"id",label:"Domain ID"},{key:"name",label:"Domain Name"},{key:"status",label:"Status"},{key:"region",label:"Region"},{key:"created_at",label:"Created At",format:"datetime"},{key:"sending",label:"Sending Capability"},{key:"receiving",label:"Receiving Capability"}],Dm=[{key:"id",label:"Audience ID"},{key:"name",label:"Name"},{key:"created_at",label:"Created At",format:"datetime"}],Nm=[{key:"id",label:"Email ID"},{key:"from",label:"From"},{key:"to",label:"To",description:"Recipients, comma-separated."},{key:"subject",label:"Subject"},{key:"last_event",label:"Last Event",description:"Latest delivery state, e.g. delivered, bounced, scheduled."},{key:"created_at",label:"Created At",format:"datetime"},{key:"scheduled_at",label:"Scheduled At",description:"Send time for a scheduled email, empty otherwise."},{key:"cc",label:"CC",description:"CC recipients, comma-separated."},{key:"bcc",label:"BCC",description:"BCC recipients, comma-separated."},{key:"reply_to",label:"Reply To",description:"Reply-to addresses, comma-separated."}],iu={fields:[{key:"id",label:"Email ID",value:"body.id"}]},au={itemLabel:"Email {id}",fields:[{key:"emails",label:"Sent Emails",value:"",labelKey:"id",listItems:[{key:"id",label:"Email ID"}]}]},su={fields:[{key:"id",label:"Email ID"},{key:"subject",label:"Subject"},{key:"from",label:"From"},{key:"to",label:"To",description:"Recipient addresses, as a list of strings."},{key:"cc",label:"CC",description:"CC addresses as a list of strings, or empty when none were set."},{key:"bcc",label:"BCC",description:"BCC addresses as a list of strings, or empty when none were set."},{key:"reply_to",label:"Reply To",description:"Reply-to addresses, as a list of strings."},{key:"last_event",label:"Last Event",description:"Latest delivery state, e.g. delivered, bounced, scheduled."},{key:"created_at",label:"Created At",format:"datetime"},{key:"scheduled_at",label:"Scheduled At",format:"datetime",description:"Send time for a scheduled email, null otherwise."},{key:"message_id",label:"Message ID",description:"RFC 5322 Message-ID assigned by the sending infrastructure."},{key:"text",label:"Text Body"},{key:"html",label:"HTML Body",format:"html"}]},uu={itemLabel:"{subject}",fields:[{key:"emails",label:"Emails",value:"",labelKey:"subject",listItems:Nm}]},cu={fields:[{key:"id",label:"Email ID"}]},lu={fields:[{key:"id",label:"Email ID"}]},pu={fields:[{key:"id",label:"Audience ID"},{key:"name",label:"Name"}]},du={itemLabel:"{name}",fields:[{key:"audiences",label:"Audiences",value:"",labelKey:"name",listItems:Dm}]},mu={fields:[{key:"id",label:"Audience ID"},{key:"deleted",label:"Deleted",format:"boolean"}]},fu={fields:[{key:"id",label:"Contact ID"}]},gu={fields:[{key:"id",label:"Contact ID"}]},yu={fields:[{key:"contact",label:"Contact ID"},{key:"deleted",label:"Deleted",format:"boolean"}]},hu={itemLabel:"{email}",fields:[{key:"contacts",label:"Contacts",value:"",labelKey:"email",listItems:wm}]},vu={fields:[...ou,{key:"dns_records",label:"DNS Records",labelKey:"name",description:"Records to add at your DNS provider before the domain will verify.",listItems:[{key:"record",label:"Record Purpose",description:"DKIM or SPF."},{key:"name",label:"Host"},{key:"type",label:"DNS Type",description:"TXT or MX."},{key:"value",label:"Value"},{key:"ttl",label:"TTL"},{key:"status",label:"Status"},{key:"priority",label:"Priority",format:"number",description:"Set on MX records only."}]}]},xu={fields:[{key:"id",label:"Domain ID"}]},_u={fields:[{key:"id",label:"Domain ID"},{key:"deleted",label:"Deleted",format:"boolean"}]},Pu={itemLabel:"{name}",fields:[{key:"domains",label:"Domains",value:"",labelKey:"name",listItems:ou}]},Cm=[{key:"id",label:"Broadcast ID"},{key:"name",label:"Name"},{key:"audience_id",label:"Audience ID"},{key:"status",label:"Status"},{key:"reply_to",label:"Reply To"},{key:"preview_text",label:"Preview Text"},{key:"created_at",label:"Created At",format:"datetime"},{key:"scheduled_at",label:"Scheduled At",format:"datetime"},{key:"sent_at",label:"Sent At",format:"datetime"}],bu={fields:[{key:"id",label:"Broadcast ID"}]},Tu={fields:[{key:"id",label:"Broadcast ID"}]},Eu={fields:[{key:"id",label:"Broadcast ID"},{key:"deleted",label:"Deleted",format:"boolean"}]},Iu={itemLabel:"{name}",fields:[{key:"broadcasts",label:"Broadcasts",value:"",labelKey:"name",listItems:Cm}]};var Su=L({auth:z,name:"send_email",displayName:"Send Email",outputSchema:iu,description:"Send a text or HTML email",audience:"both",aiMetadata:{description:"Sends a single transactional email (plain text or HTML) to one or more recipients via Resend. Use this for one-off messages; the sender address must be on a domain you have verified in Resend. Not idempotent \u2014 each call sends a new email.",idempotent:!1},props:{to:b.Array({displayName:"To",description:"Emails of the recipients",required:!0}),from_name:b.ShortText({displayName:"Sender Name",description:"Sender name",required:!0}),from:b.ShortText({displayName:"Sender Email (From)",description:"Sender email",required:!0}),bcc:b.Array({displayName:"BCC",description:"List of emails in bcc",required:!1}),cc:b.Array({displayName:"CC",description:"List of emails in cc",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email to receive replies on (defaults to sender)",required:!1}),subject:b.ShortText({displayName:"Subject",description:void 0,required:!0}),content_type:b.Dropdown({auth:z,displayName:"Content Type",refreshers:[],required:!0,defaultValue:"html",options:o(async()=>({disabled:!1,options:[{label:"Plain Text",value:"text"},{label:"HTML",value:"html"}]}),"options")}),content:b.ShortText({displayName:"Content",description:"HTML is only allowed if you selected HTML as type",required:!0})},async run(e){let{to:t,from:r,from_name:n,reply_to:i,subject:u,content_type:c,content:l,cc:g,bcc:h}=e.propsValue,x={to:t,from:n?`${n} <${r}>`:r,reply_to:i??r,cc:g,bcc:h,subject:u};return c==="text"?x.text=l:c==="html"&&(x.html=l),await A.sendRequest({method:"POST",url:"https://api.resend.com/emails",body:x,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:{}})}});var Um="https://api.resend.com",Au=L({name:"send_batch_emails",auth:z,displayName:"Send Batch Emails",outputSchema:au,description:"Send up to 100 emails in a single API call",audience:"both",aiMetadata:{description:"Sends up to 100 distinct emails in one Resend API call, each with its own recipient, subject, and body. Use this instead of Send Email when delivering many independent messages at once. Senders must be on verified domains; pass an idempotency key to guard against duplicate batch sends, otherwise each call sends new emails.",idempotent:!1},props:{emails:b.Array({displayName:"Emails",description:"List of emails to send (max 100). Each email is sent independently with its own recipient, subject, and body.",required:!0,properties:{from:b.ShortText({displayName:"From",description:'Sender address. Use "Name <email@domain.com>" for a friendly name.',required:!0}),to:b.ShortText({displayName:"To",description:"Recipient email address.",required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0}),reply_to:b.ShortText({displayName:"Reply To",required:!1}),cc:b.ShortText({displayName:"CC",required:!1}),bcc:b.ShortText({displayName:"BCC",required:!1})}}),idempotency_key:b.ShortText({displayName:"Idempotency Key",description:"Optional unique key to prevent duplicate sends. Must be unique per request, expires after 24 hours, max 256 characters.",required:!1})},async run({auth:e,propsValue:t}){let r=(t.emails??[]).map(u=>{let c=u,l={from:c.from,to:c.to,subject:c.subject};return c.content_type==="html"?l.html=c.content:l.text=c.content,c.reply_to&&(l.reply_to=c.reply_to),c.cc&&(l.cc=c.cc),c.bcc&&(l.bcc=c.bcc),l}),n={};return t.idempotency_key&&(n["Idempotency-Key"]=t.idempotency_key),(await A.sendRequest({method:"POST",url:`${Um}/emails/batch`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},headers:n,body:r})).body.data}});var ar="https://api.resend.com",Mm=b.Dropdown({displayName:"Audience",required:!0,auth:z,refreshers:[],options:o(async({auth:e})=>e?{options:(await A.sendRequest({method:"GET",url:`${ar}/audiences`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),Lm=b.Dropdown({displayName:"Domain",required:!0,auth:z,refreshers:[],options:o(async({auth:e})=>e?{options:(await A.sendRequest({method:"GET",url:`${ar}/domains`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),jm=b.Dropdown({displayName:"Broadcast",required:!0,auth:z,refreshers:[],options:o(async({auth:e})=>e?{options:(await A.sendRequest({method:"GET",url:`${ar}/broadcasts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name?`${r.name} \u2014 ${r.subject}`:r.subject,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),Bm=b.Dropdown({displayName:"Contact",required:!0,auth:z,refreshers:["audience_id"],options:o(async({auth:e,audience_id:t})=>!e||!t?{disabled:!0,placeholder:"Select an audience first",options:[]}:{options:(await A.sendRequest({method:"GET",url:`${ar}/audiences/${String(t)}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(n=>{let i=[n.first_name,n.last_name].filter(Boolean).join(" ");return{label:i?`${i} <${n.email}>`:n.email,value:n.id}})},"options")}),Q={audienceId:Mm,domainId:Lm,broadcastId:jm,contactId:Bm};var $u=L({name:"create_contact",auth:z,displayName:"Create Contact",outputSchema:fu,description:"Add a contact to a Resend audience",audience:"both",aiMetadata:{description:"Adds a new contact (email plus optional name and subscription status) to a specific Resend audience. Use this to grow a mailing list; requires the target audience ID (use List Audiences to find it). Not idempotent \u2014 each call creates a new contact, so guard against re-adding the same email.",idempotent:!1},props:{audience_id:Q.audienceId,email:b.ShortText({displayName:"Email",required:!0}),first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.Checkbox({displayName:"Unsubscribed",description:"If true, the contact will be unsubscribed from all broadcasts",required:!1,defaultValue:!1})},async run({auth:e,propsValue:t}){let r={email:t.email};return t.first_name&&(r.first_name=t.first_name),t.last_name&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&(r.unsubscribed=t.unsubscribed),(await A.sendRequest({method:"POST",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var zu=L({name:"update_contact",auth:z,displayName:"Update Contact",outputSchema:gu,description:"Update the name or subscription status of a contact in an audience",audience:"both",aiMetadata:{description:"Updates an existing contact's first name, last name, or subscribed/unsubscribed status within an audience, identified by audience ID and contact ID. Use this to change details or toggle subscription for a known contact. Idempotent \u2014 repeating with the same values leaves the contact in the same state.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId,first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.StaticDropdown({displayName:"Subscription Status",required:!1,options:{options:[{label:"Subscribed",value:!1},{label:"Unsubscribed",value:!0}]}})},async run({auth:e,propsValue:t}){let r={};return t.first_name!==void 0&&t.first_name!==""&&(r.first_name=t.first_name),t.last_name!==void 0&&t.last_name!==""&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&t.unsubscribed!==null&&(r.unsubscribed=t.unsubscribed),(await A.sendRequest({method:"PATCH",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var Ou=L({name:"delete_contact",auth:z,displayName:"Delete Contact",outputSchema:yu,description:"Remove a contact from an audience",audience:"both",aiMetadata:{description:"Permanently removes a contact from a Resend audience, identified by audience ID and contact ID. Use this to delete a subscriber from a list. Effectively idempotent \u2014 once removed, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId},async run({auth:e,propsValue:t}){return(await A.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var ku=L({name:"list_contacts",auth:z,displayName:"List Contacts",outputSchema:hu,description:"Retrieve all contacts in an audience",audience:"both",aiMetadata:{description:"Retrieves all contacts in a specific Resend audience, including each contact's ID, email, name, and subscription status. Use this to discover contact IDs (e.g. to feed Update Contact or Delete Contact) or to inspect a mailing list; requires the audience ID. Read-only and idempotent.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await A.sendRequest({method:"GET",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var Ru=L({name:"get_email_status",auth:z,displayName:"Get Email Status",outputSchema:su,description:"Retrieve the delivery status of a sent email",audience:"both",aiMetadata:{description:"Looks up the current delivery status and details of a single previously sent email by its Resend email ID. Use this to check whether a specific email was delivered, bounced, or is still scheduled. Read-only and idempotent; requires the email ID returned when the email was sent.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:"The ID returned when you sent the email",required:!0})},async run({auth:e,propsValue:t}){return(await A.sendRequest({method:"GET",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var wu=L({name:"list_emails",auth:z,displayName:"List Sent Emails",outputSchema:uu,description:"Retrieve a list of emails sent from your Resend account",audience:"both",aiMetadata:{description:"Retrieves the list of emails sent from the connected Resend account, including their IDs, recipients, subjects, and latest delivery event. Use this to discover email IDs (e.g. to feed Get Email Status, Cancel Scheduled Email, or Reschedule Email) or to audit recent sends. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await A.sendRequest({method:"GET",url:"https://api.resend.com/emails",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,from:r.from,to:(r.to??[]).join(", "),subject:r.subject,last_event:r.last_event,created_at:r.created_at,scheduled_at:r.scheduled_at??"",cc:(r.cc??[]).join(", "),bcc:(r.bcc??[]).join(", "),reply_to:(r.reply_to??[]).join(", ")}))}});var Du=L({name:"cancel_scheduled_email",auth:z,displayName:"Cancel Scheduled Email",outputSchema:cu,description:"Cancel a scheduled email before it is sent",audience:"both",aiMetadata:{description:"Cancels a previously scheduled email so it will not be delivered, identified by its Resend email ID. Use this to stop a future send before its scheduled time. Effectively idempotent \u2014 once an email is cancelled, repeating the call has no further effect; only works while the email is still pending.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to cancel. Use "List Sent Emails" to find it.',required:!0})},async run({auth:e,propsValue:t}){return(await A.sendRequest({method:"POST",url:`https://api.resend.com/emails/${t.email_id}/cancel`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Nu=L({name:"reschedule_email",auth:z,displayName:"Reschedule Email",outputSchema:lu,description:"Update the send time of a scheduled email",audience:"both",aiMetadata:{description:"Changes the future send time of an already scheduled email, identified by its Resend email ID. Use this to move a pending send to a new time without cancelling and recreating it. Idempotent when called with the same target time; requires an ISO 8601 date-time and only works while the email is still scheduled.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to reschedule. Use "List Sent Emails" to find it.',required:!0}),scheduled_at:b.ShortText({displayName:"New Send Time",description:"ISO 8601 date-time for when to send the email, e.g. 2024-12-01T10:00:00Z",required:!0})},async run({auth:e,propsValue:t}){return(await A.sendRequest({method:"PATCH",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{scheduled_at:t.scheduled_at}})).body}});var Cu=L({name:"list_domains",auth:z,displayName:"List Domains",outputSchema:Pu,description:"Retrieve all domains added to your Resend account",audience:"both",aiMetadata:{description:"Retrieves all sending domains configured on the connected Resend account, including each domain's ID, name, verification status, and region. Use this to find a domain ID (e.g. for Verify Domain or Delete Domain) or to check which domains are verified before sending. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await A.sendRequest({method:"GET",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name,status:r.status,region:r.region,created_at:r.created_at,sending:r.capabilities?.sending??"",receiving:r.capabilities?.receiving??""}))}});var Uu=L({name:"create_domain",auth:z,displayName:"Create Domain",outputSchema:vu,description:"Add a sending domain to your Resend account and get the DNS records to verify it",audience:"both",aiMetadata:{description:"Registers a new sending domain on the Resend account and returns the DNS records that must be added to verify it. Use this as the first step in setting up a custom sending domain before triggering verification. Not idempotent \u2014 each call attempts to create a new domain entry.",idempotent:!1},props:{name:b.ShortText({displayName:"Domain Name",description:"The domain you want to send from, e.g. mail.yourdomain.com",required:!0}),region:b.StaticDropdown({displayName:"Region",description:"AWS region for email delivery. Defaults to US East.",required:!1,options:{options:[{label:"US East (N. Virginia)",value:"us-east-1"},{label:"EU West (Ireland)",value:"eu-west-1"},{label:"Asia Pacific (Tokyo)",value:"ap-northeast-1"},{label:"South America (S\xE3o Paulo)",value:"sa-east-1"}]}})},async run({auth:e,propsValue:t}){let r={name:t.name};t.region&&(r.region=t.region);let i=(await A.sendRequest({method:"POST",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body;return{id:i.id,name:i.name,status:i.status,region:i.region,created_at:i.created_at,sending:i.capabilities?.sending??"",receiving:i.capabilities?.receiving??"",dns_records:i.records}}});var Mu=L({name:"delete_domain",auth:z,displayName:"Delete Domain",outputSchema:_u,description:"Remove a domain from your Resend account",audience:"both",aiMetadata:{description:"Permanently removes a sending domain from the Resend account, identified by its domain ID. Use this to decommission a domain you no longer send from. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await A.sendRequest({method:"DELETE",url:`https://api.resend.com/domains/${t.domain_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Lu=L({name:"verify_domain",auth:z,displayName:"Verify Domain",outputSchema:xu,description:"Trigger a DNS verification check for a domain",audience:"both",aiMetadata:{description:"Triggers Resend to re-check the DNS records of a domain and update its verification status, identified by domain ID. Use this after adding the required DNS records (from Create Domain) to confirm the domain is ready to send. Safe to call repeatedly \u2014 it only re-runs the check.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await A.sendRequest({method:"POST",url:`https://api.resend.com/domains/${t.domain_id}/verify`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var ju=L({name:"list_audiences",auth:z,displayName:"List Audiences",outputSchema:du,description:"Retrieve all contact audiences in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all contact audiences (mailing lists) in the connected Resend account, including each audience's ID and name. Use this to discover an audience ID needed by contact and broadcast actions (e.g. Create Contact, List Contacts, Create Broadcast). Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await A.sendRequest({method:"GET",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var Bu=L({name:"create_audience",auth:z,displayName:"Create Audience",outputSchema:pu,description:"Create a new contact audience in Resend",audience:"both",aiMetadata:{description:"Creates a new contact audience (mailing list) in Resend with the given name and returns its ID. Use this before adding contacts or sending broadcasts when no suitable audience exists yet. Not idempotent \u2014 each call creates a new audience even if the name matches an existing one.",idempotent:!1},props:{name:b.ShortText({displayName:"Audience Name",description:'A label for this audience, e.g. "Newsletter Subscribers"',required:!0})},async run({auth:e,propsValue:t}){return(await A.sendRequest({method:"POST",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{name:t.name}})).body}});var Fu=L({name:"delete_audience",auth:z,displayName:"Delete Audience",outputSchema:mu,description:"Permanently delete an audience and all its contacts",audience:"both",aiMetadata:{description:"Permanently deletes an entire audience and all of its contacts from Resend, identified by audience ID. Use this to remove a whole mailing list; this is destructive and cannot be undone. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await A.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Zu=L({name:"list_broadcasts",auth:z,displayName:"List Broadcasts",outputSchema:Iu,description:"Retrieve all broadcasts in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all broadcast campaigns in the connected Resend account, including each broadcast's ID, name, audience, subject, and status (draft, scheduled, sent). Use this to find a broadcast ID (e.g. for Send Broadcast or Delete Broadcast) or to check campaign status. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await A.sendRequest({method:"GET",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name??"",audience_id:r.audience_id,from:r.from,subject:r.subject,reply_to:Array.isArray(r.reply_to)?r.reply_to.join(", "):r.reply_to??"",preview_text:r.preview_text??"",status:r.status,created_at:r.created_at,scheduled_at:r.scheduled_at??"",sent_at:r.sent_at??""}))}});var Vu=L({name:"create_broadcast",auth:z,displayName:"Create Broadcast",outputSchema:bu,description:"Create a new broadcast email to send to an audience",audience:"both",aiMetadata:{description:"Creates a draft broadcast email (subject and body) targeting a Resend audience and returns its ID. Use this to prepare a campaign; it only creates the draft and does not deliver anything \u2014 pair it with Send Broadcast to actually send. Requires the audience ID and a sender on a verified domain. Not idempotent \u2014 each call creates a new broadcast.",idempotent:!1},props:{audience_id:Q.audienceId,from:b.ShortText({displayName:"From",description:'Sender address. Must be from a verified domain. Use "Name <email@yourdomain.com>" for a friendly name.',required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),name:b.ShortText({displayName:"Broadcast Name",description:"Internal label for this broadcast. Not visible to recipients.",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email address recipients will reply to.",required:!1}),preview_text:b.ShortText({displayName:"Preview Text",description:"Short summary shown in email clients below the subject line.",required:!1}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0})},async run({auth:e,propsValue:t}){let r={audience_id:t.audience_id,from:t.from,subject:t.subject};return t.content_type==="html"?r.html=t.content:r.text=t.content,t.name&&(r.name=t.name),t.reply_to&&(r.reply_to=t.reply_to),t.preview_text&&(r.preview_text=t.preview_text),(await A.sendRequest({method:"POST",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var Hu=L({name:"send_broadcast",auth:z,displayName:"Send Broadcast",outputSchema:Tu,description:"Send or schedule a broadcast email to its audience",audience:"both",aiMetadata:{description:"Sends an existing draft broadcast to its entire audience immediately, or schedules it for a future time, identified by broadcast ID. Use this after Create Broadcast to deliver the campaign. Not idempotent \u2014 repeating the call can dispatch the broadcast again; optionally pass an ISO 8601 time to schedule rather than send now.",idempotent:!1},props:{broadcast_id:Q.broadcastId,scheduled_at:b.ShortText({displayName:"Schedule For",description:"ISO 8601 date-time to schedule the send, e.g. 2024-12-01T10:00:00Z. Leave blank to send immediately.",required:!1})},async run({auth:e,propsValue:t}){let r={};return t.scheduled_at&&(r.scheduled_at=t.scheduled_at),(await A.sendRequest({method:"POST",url:`https://api.resend.com/broadcasts/${t.broadcast_id}/send`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var Gu=L({name:"delete_broadcast",auth:z,displayName:"Delete Broadcast",outputSchema:Eu,description:"Permanently delete a broadcast from your Resend account",audience:"both",aiMetadata:{description:"Permanently deletes a broadcast from the Resend account, identified by broadcast ID. Use this to remove a draft or unwanted campaign; only broadcasts that have not been sent can be deleted. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{broadcast_id:Q.broadcastId},async run({auth:e,propsValue:t}){return(await A.sendRequest({method:"DELETE",url:`https://api.resend.com/broadcasts/${t.broadcast_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var hn=Ne(require("crypto"));var qu="https://api.resend.com",yn="webhookData",Fm=300,Zm=[{label:"Email Sent",value:"email.sent"},{label:"Email Delivered",value:"email.delivered"},{label:"Email Delivery Delayed",value:"email.delivery_delayed"},{label:"Email Complained",value:"email.complained"},{label:"Email Bounced",value:"email.bounced"},{label:"Email Opened",value:"email.opened"},{label:"Email Clicked",value:"email.clicked"},{label:"Email Failed",value:"email.failed"},{label:"Email Received",value:"email.received"},{label:"Email Scheduled",value:"email.scheduled"},{label:"Email Suppressed",value:"email.suppressed"},{label:"Domain Created",value:"domain.created"},{label:"Domain Updated",value:"domain.updated"},{label:"Domain Deleted",value:"domain.deleted"},{label:"Contact Created",value:"contact.created"},{label:"Contact Updated",value:"contact.updated"},{label:"Contact Deleted",value:"contact.deleted"}];function Vm({rawBody:e,headers:t,signingSecret:r}){let n=t["svix-id"],i=t["svix-timestamp"],u=t["svix-signature"];if(!n||!i||!u)return!1;let c=Math.floor(Date.now()/1e3);if(Math.abs(c-parseInt(i,10))>Fm)return!1;let l=Buffer.isBuffer(e)?e.toString("utf8"):String(e),g=Buffer.from(r.replace("whsec_",""),"base64"),h=`${n}.${i}.${l}`,x=hn.default.createHmac("sha256",g).update(h).digest("base64");return u.split(" ").some(I=>{let[_,s]=I.split(",");if(_!=="v1"||!s)return!1;try{return hn.default.timingSafeEqual(Buffer.from(s,"base64"),Buffer.from(x,"base64"))}catch{return!1}})}o(Vm,"verifyResendWebhook");var Wu=Ci({name:"email_bounced",auth:z,displayName:"Email Event",description:"Triggers when a selected email or contact event occurs in Resend",aiMetadata:{description:"Fires when one of the subscribed Resend events occurs, such as an email being sent, delivered, bounced, opened, clicked, complained about, or failing, as well as domain and contact lifecycle events. The payload carries the event type and the affected email, domain, or contact. Subscribe to the specific event types you care about."},type:"WEBHOOK",props:{events:b.StaticMultiSelectDropdown({displayName:"Events",description:"Select one or more event types to subscribe to",required:!0,options:{options:Zm}})},async onEnable(e){let t=await A.sendRequest({method:"POST",url:`${qu}/webhooks`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},body:{endpoint:e.webhookUrl,events:e.propsValue.events}});await e.store.put(yn,{id:t.body.id,signingSecret:t.body.signing_secret})},async onDisable(e){let t=await e.store.get(yn);t?.id&&await A.sendRequest({method:"DELETE",url:`${qu}/webhooks/${t.id}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})},async run(e){let t=await e.store.get(yn);return Vm({rawBody:e.payload.rawBody,headers:e.payload.headers,signingSecret:t?.signingSecret??""})?[e.payload.body]:[]},sampleData:{type:"email.bounced",created_at:"2024-03-08T09:37:40.912Z",data:{created_at:"2024-03-08T09:37:40.911Z",email_id:"562e3f00-6bad-4910-b1e3-38c2fca1e2ff",from:"onboarding@resend.dev",to:["john@example.com"],subject:"Re: Follow up"}}});var Ku="https://api.resend.com",z=Vr.SecretText({displayName:"API Key",description:`To get your API key:
|
|
1
|
+
"use strict";var Yc=Object.create;var tt=Object.defineProperty;var Qc=Object.getOwnPropertyDescriptor;var eu=Object.getOwnPropertyNames;var tu=Object.getPrototypeOf,ru=Object.prototype.hasOwnProperty;var o=(e,t)=>tt(e,"name",{value:t,configurable:!0});var I=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Pn=(e,t)=>{for(var r in t)tt(e,r,{get:t[r],enumerable:!0})},bn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of eu(t))!ru.call(e,i)&&i!==r&&tt(e,i,{get:()=>t[i],enumerable:!(n=Qc(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?Yc(tu(e)):{},bn(t||!e||!e.__esModule?tt(r,"default",{value:e,enumerable:!0}):r,e)),nu=e=>bn(tt({},"__esModule",{value:!0}),e);var Wo=I((qo,Gt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),c="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(c,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${c})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${c})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${c})?$`,"i")};function g(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],P,F;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)y++;if(s.substr(0,2)==="::"&&y--,s.substr(-2,2)==="::"&&y--,y>d)return null;for(F=d-y,P=":";F--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let ie=s.split(":"),de=[];for(let Ee=0;Ee<ie.length;Ee++)de.push(parseInt(ie[Ee],16));return de})(),{parts:d,zoneId:v}}o(g,"expandIPv6");function x(s,d,y,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=y-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=y,v+=1}return!0}o(x,"matchCIDR");function h(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(h,"parseIntAuto");function z(s,d){for(;s.length<d;)s=`0${s}`;return s}o(z,"padPart");let _={};_.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return x(this.octets,d.octets,8,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,F;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(F=m[P],y&&F!==0)return null;F!==8&&(y=!0),d+=F}else return null;return 32-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),_.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(s){return this.parser(s)!==null},_.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(s){return!!(_.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(s)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(s){let d,y,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[1]),y];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(s){let d,y,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),P=[];for(let F=0;F<v.length;F++)y=v[F],P.push(h(y));return P})();if(d=s.match(r.longValue)){if(m=h(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),P=[];if(m=h(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(h(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),P=[];if(m=h(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(h(v[0])),P.push(h(v[1])),P.push(m>>8&255),P.push(m&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.IPv6=(function(){function s(d,y){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return x(this.parts,d.parts,16,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,P;for(let F=7;F>=0;F-=1)if(v=this.parts[F],v in m){if(P=m[v],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],y.push(d>>8),y.push(d&255);return y},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(z(this.parts[v].toString(16),4));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],m=d[1];return new _.IPv4([y>>8,y&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,v=-1,P;for(;P=d.exec(y);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?y:`${y.substring(0,m)}::${y.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),_.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(s){return this.parser(s)!==null},_.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(s){let d,y,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(v)}catch(F){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${F})`)}},_.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(s){let d,y,m;if((y=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(s){let d,y,m,v,P,F;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return g(s,8);if((m=s.match(l.transitional))&&(F=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=g(d+F,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<P.length;y++)if(v=P[y],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.fromByteArray=function(s){let d=s.length;if(d===4)return new _.IPv4(s);if(d===16)return new _.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(s){return _.IPv6.isValid(s)||_.IPv4.isValid(s)},_.isValidCIDR=function(s){return _.IPv6.isValidCIDR(s)||_.IPv4.isValidCIDR(s)},_.parse=function(s){if(_.IPv6.isValid(s))return _.IPv6.parse(s);if(_.IPv4.isValid(s))return _.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(s){try{return _.IPv6.parseCIDR(s)}catch{try{return _.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(s,d,y){let m,v,P,F;y==null&&(y="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(F=P[m],s.kind()===F[0].kind()&&s.match.apply(s,F))return v}return y},typeof Gt<"u"&&Gt.exports?Gt.exports=_:e.ipaddr=_})(qo)});var Qi=I((Zz,Yi)=>{var Xi=require("stream").Stream,Bp=require("util");Yi.exports=pe;function pe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(pe,"DelayedStream");Bp.inherits(pe,Xi);pe.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(pe.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});pe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};pe.prototype.resume=function(){this._released||this.release(),this.source.resume()};pe.prototype.pause=function(){this.source.pause()};pe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};pe.prototype.pipe=function(){var e=Xi.prototype.pipe.apply(this,arguments);return this.resume(),e};pe.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};pe.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var na=I((Hz,ra)=>{var Fp=require("util"),ta=require("stream").Stream,ea=Qi();ra.exports=Y;function Y(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(Y,"CombinedStream");Fp.inherits(Y,ta);Y.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};Y.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};Y.prototype.append=function(e){var t=Y.isStreamLike(e);if(t){if(!(e instanceof ea)){var r=ea.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};Y.prototype.pipe=function(e,t){return ta.prototype.pipe.call(this,e,t),this.resume(),e};Y.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}};Y.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=Y.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};Y.prototype._pipeNext=function(e){this._currentStream=e;var t=Y.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()};Y.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};Y.prototype.write=function(e){this.emit("data",e)};Y.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};Y.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")};Y.prototype.end=function(){this._reset(),this.emit("end")};Y.prototype.destroy=function(){this._reset(),this.emit("close")};Y.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Y.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};Y.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)};Y.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ia=I((qz,oa)=>{"use strict";oa.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 ca=I(oe=>{"use strict";var Xt=ia(),Zp=require("path").extname,aa=/^\s*([^;\s]*)(?:;|\s|$)/,Vp=/^text\//i;oe.charset=sa;oe.charsets={lookup:sa};oe.contentType=Hp;oe.extension=Gp;oe.extensions=Object.create(null);oe.lookup=qp;oe.types=Object.create(null);Wp(oe.extensions,oe.types);function sa(e){if(!e||typeof e!="string")return!1;var t=aa.exec(e),r=t&&Xt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Vp.test(t[1])?"UTF-8":!1}o(sa,"charset");function Hp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?oe.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=oe.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Hp,"contentType");function Gp(e){if(!e||typeof e!="string")return!1;var t=aa.exec(e),r=t&&oe.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Gp,"extension");function qp(e){if(!e||typeof e!="string")return!1;var t=Zp("x."+e).toLowerCase().substr(1);return t&&oe.types[t]||!1}o(qp,"lookup");function Wp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Xt).forEach(o(function(i){var c=Xt[i],u=c.extensions;if(!(!u||!u.length)){e[i]=u;for(var l=0;l<u.length;l++){var g=u[l];if(t[g]){var x=r.indexOf(Xt[t[g]].source),h=r.indexOf(c.source);if(t[g]!=="application/octet-stream"&&(x>h||x===h&&t[g].substr(0,12)==="application/"))continue}t[g]=i}}},"forEachMimeType"))}o(Wp,"populateMaps")});var la=I((Jz,ua)=>{ua.exports=Kp;function Kp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Kp,"defer")});var Kr=I((Yz,da)=>{var pa=la();da.exports=Jp;function Jp(e){var t=!1;return pa(function(){t=!0}),o(function(n,i){t?e(n,i):pa(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Jp,"async")});var Jr=I((eO,ma)=>{ma.exports=Xp;function Xp(e){Object.keys(e.jobs).forEach(Yp.bind(e)),e.jobs={}}o(Xp,"abort");function Yp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Yp,"clean")});var Xr=I((rO,ga)=>{var fa=Kr(),Qp=Jr();ga.exports=ed;function ed(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=td(t,i,e[i],function(c,u){i in r.jobs&&(delete r.jobs[i],c?Qp(r):r.results[i]=u,n(c,r.results))})}o(ed,"iterate");function td(e,t,r,n){var i;return e.length==2?i=e(r,fa(n)):i=e(r,t,fa(n)),i}o(td,"runJob")});var Yr=I((oO,ya)=>{ya.exports=rd;function rd(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,c){return t(e[i],e[c])}),n}o(rd,"state")});var Qr=I((aO,ha)=>{var nd=Jr(),od=Kr();ha.exports=id;function id(e){Object.keys(this.jobs).length&&(this.index=this.size,nd(this),od(e)(null,this.results))}o(id,"terminator")});var xa=I((cO,va)=>{var ad=Xr(),sd=Yr(),cd=Qr();va.exports=ud;function ud(e,t,r){for(var n=sd(e);n.index<(n.keyedList||e).length;)ad(e,t,n,function(i,c){if(i){r(i,c);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return cd.bind(n,r)}o(ud,"parallel")});var en=I((lO,Yt)=>{var _a=Xr(),ld=Yr(),pd=Qr();Yt.exports=dd;Yt.exports.ascending=Pa;Yt.exports.descending=md;function dd(e,t,r,n){var i=ld(e,r);return _a(e,t,i,o(function c(u,l){if(u){n(u,l);return}if(i.index++,i.index<(i.keyedList||e).length){_a(e,t,i,c);return}n(null,i.results)},"iteratorHandler")),pd.bind(i,n)}o(dd,"serialOrdered");function Pa(e,t){return e<t?-1:e>t?1:0}o(Pa,"ascending");function md(e,t){return-1*Pa(e,t)}o(md,"descending")});var Ea=I((dO,ba)=>{var fd=en();ba.exports=gd;function gd(e,t,r){return fd(e,t,null,r)}o(gd,"serial")});var Ia=I((fO,Ta)=>{Ta.exports={parallel:xa(),serial:Ea(),serialOrdered:en()}});var tn=I((gO,Sa)=>{"use strict";Sa.exports=Object});var $a=I((yO,Aa)=>{"use strict";Aa.exports=Error});var Oa=I((hO,za)=>{"use strict";za.exports=EvalError});var ka=I((vO,Ra)=>{"use strict";Ra.exports=RangeError});var Da=I((xO,wa)=>{"use strict";wa.exports=ReferenceError});var Ca=I((_O,Na)=>{"use strict";Na.exports=SyntaxError});var Qt=I((PO,Ua)=>{"use strict";Ua.exports=TypeError});var La=I((bO,Ma)=>{"use strict";Ma.exports=URIError});var Ba=I((EO,ja)=>{"use strict";ja.exports=Math.abs});var Za=I((TO,Fa)=>{"use strict";Fa.exports=Math.floor});var Ha=I((IO,Va)=>{"use strict";Va.exports=Math.max});var qa=I((SO,Ga)=>{"use strict";Ga.exports=Math.min});var Ka=I((AO,Wa)=>{"use strict";Wa.exports=Math.pow});var Xa=I(($O,Ja)=>{"use strict";Ja.exports=Math.round});var Qa=I((zO,Ya)=>{"use strict";Ya.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ts=I((RO,es)=>{"use strict";var yd=Qa();es.exports=o(function(t){return yd(t)||t===0?t:t<0?-1:1},"sign")});var ns=I((wO,rs)=>{"use strict";rs.exports=Object.getOwnPropertyDescriptor});var rn=I((DO,os)=>{"use strict";var er=ns();if(er)try{er([],"length")}catch{er=null}os.exports=er});var as=I((NO,is)=>{"use strict";var tr=Object.defineProperty||!1;if(tr)try{tr({},"a",{value:1})}catch{tr=!1}is.exports=tr});var nn=I((CO,ss)=>{"use strict";ss.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var c 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 u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var ls=I((MO,us)=>{"use strict";var cs=typeof Symbol<"u"&&Symbol,hd=nn();us.exports=o(function(){return typeof cs!="function"||typeof Symbol!="function"||typeof cs("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hd()},"hasNativeSymbols")});var on=I((jO,ps)=>{"use strict";ps.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var an=I((BO,ds)=>{"use strict";var vd=tn();ds.exports=vd.getPrototypeOf||null});var gs=I((FO,fs)=>{"use strict";var xd="Function.prototype.bind called on incompatible ",_d=Object.prototype.toString,Pd=Math.max,bd="[object Function]",ms=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var c=0;c<r.length;c+=1)n[c+t.length]=r[c];return n},"concatty"),Ed=o(function(t,r){for(var n=[],i=r||0,c=0;i<t.length;i+=1,c+=1)n[c]=t[i];return n},"slicy"),Td=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");fs.exports=o(function(t){var r=this;if(typeof r!="function"||_d.apply(r)!==bd)throw new TypeError(xd+r);for(var n=Ed(arguments,1),i,c=o(function(){if(this instanceof i){var h=r.apply(this,ms(n,arguments));return Object(h)===h?h:this}return r.apply(t,ms(n,arguments))},"binder"),u=Pd(0,r.length-n.length),l=[],g=0;g<u;g++)l[g]="$"+g;if(i=Function("binder","return function ("+Td(l,",")+"){ return binder.apply(this,arguments); }")(c),r.prototype){var x=o(function(){},"Empty");x.prototype=r.prototype,i.prototype=new x,x.prototype=null}return i},"bind")});var Je=I((VO,ys)=>{"use strict";var Id=gs();ys.exports=Function.prototype.bind||Id});var rr=I((HO,hs)=>{"use strict";hs.exports=Function.prototype.call});var sn=I((GO,vs)=>{"use strict";vs.exports=Function.prototype.apply});var _s=I((qO,xs)=>{"use strict";xs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var bs=I((WO,Ps)=>{"use strict";var Sd=Je(),Ad=sn(),$d=rr(),zd=_s();Ps.exports=zd||Sd.call($d,Ad)});var Ts=I((KO,Es)=>{"use strict";var Od=Je(),Rd=Qt(),kd=rr(),wd=bs();Es.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Rd("a function is required");return wd(Od,kd,t)},"callBindBasic")});var Os=I((XO,zs)=>{"use strict";var Dd=Ts(),Is=rn(),As;try{As=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var cn=!!As&&Is&&Is(Object.prototype,"__proto__"),$s=Object,Ss=$s.getPrototypeOf;zs.exports=cn&&typeof cn.get=="function"?Dd([cn.get]):typeof Ss=="function"?o(function(t){return Ss(t==null?t:$s(t))},"getDunder"):!1});var Ns=I((QO,Ds)=>{"use strict";var Rs=on(),ks=an(),ws=Os();Ds.exports=Rs?o(function(t){return Rs(t)},"getProto"):ks?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ks(t)},"getProto"):ws?o(function(t){return ws(t)},"getProto"):null});var un=I((tR,Cs)=>{"use strict";var Nd=Function.prototype.call,Cd=Object.prototype.hasOwnProperty,Ud=Je();Cs.exports=Ud.call(Nd,Cd)});var Zs=I((rR,Fs)=>{"use strict";var B,Md=tn(),Ld=$a(),jd=Oa(),Bd=ka(),Fd=Da(),et=Ca(),Qe=Qt(),Zd=La(),Vd=Ba(),Hd=Za(),Gd=Ha(),qd=qa(),Wd=Ka(),Kd=Xa(),Jd=ts(),js=Function,ln=o(function(e){try{return js('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),bt=rn(),Xd=as(),pn=o(function(){throw new Qe},"throwTypeError"),Yd=bt?(function(){try{return arguments.callee,pn}catch{try{return bt(arguments,"callee").get}catch{return pn}}})():pn,Xe=ls()(),ne=Ns(),Qd=an(),em=on(),Bs=sn(),Et=rr(),Ye={},tm=typeof Uint8Array>"u"||!ne?B:ne(Uint8Array),je={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?B:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?B:ArrayBuffer,"%ArrayIteratorPrototype%":Xe&&ne?ne([][Symbol.iterator]()):B,"%AsyncFromSyncIteratorPrototype%":B,"%AsyncFunction%":Ye,"%AsyncGenerator%":Ye,"%AsyncGeneratorFunction%":Ye,"%AsyncIteratorPrototype%":Ye,"%Atomics%":typeof Atomics>"u"?B:Atomics,"%BigInt%":typeof BigInt>"u"?B:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?B:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?B:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?B:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ld,"%eval%":eval,"%EvalError%":jd,"%Float16Array%":typeof Float16Array>"u"?B:Float16Array,"%Float32Array%":typeof Float32Array>"u"?B:Float32Array,"%Float64Array%":typeof Float64Array>"u"?B:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?B:FinalizationRegistry,"%Function%":js,"%GeneratorFunction%":Ye,"%Int8Array%":typeof Int8Array>"u"?B:Int8Array,"%Int16Array%":typeof Int16Array>"u"?B:Int16Array,"%Int32Array%":typeof Int32Array>"u"?B:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Xe&&ne?ne(ne([][Symbol.iterator]())):B,"%JSON%":typeof JSON=="object"?JSON:B,"%Map%":typeof Map>"u"?B:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Xe||!ne?B:ne(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Md,"%Object.getOwnPropertyDescriptor%":bt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?B:Promise,"%Proxy%":typeof Proxy>"u"?B:Proxy,"%RangeError%":Bd,"%ReferenceError%":Fd,"%Reflect%":typeof Reflect>"u"?B:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?B:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Xe||!ne?B:ne(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?B:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Xe&&ne?ne(""[Symbol.iterator]()):B,"%Symbol%":Xe?Symbol:B,"%SyntaxError%":et,"%ThrowTypeError%":Yd,"%TypedArray%":tm,"%TypeError%":Qe,"%Uint8Array%":typeof Uint8Array>"u"?B:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?B:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?B:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?B:Uint32Array,"%URIError%":Zd,"%WeakMap%":typeof WeakMap>"u"?B:WeakMap,"%WeakRef%":typeof WeakRef>"u"?B:WeakRef,"%WeakSet%":typeof WeakSet>"u"?B:WeakSet,"%Function.prototype.call%":Et,"%Function.prototype.apply%":Bs,"%Object.defineProperty%":Xd,"%Object.getPrototypeOf%":Qd,"%Math.abs%":Vd,"%Math.floor%":Hd,"%Math.max%":Gd,"%Math.min%":qd,"%Math.pow%":Wd,"%Math.round%":Kd,"%Math.sign%":Jd,"%Reflect.getPrototypeOf%":em};if(ne)try{null.error}catch(e){Us=ne(ne(e)),je["%Error.prototype%"]=Us}var Us,rm=o(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 i=e("%AsyncGenerator%");i&&ne&&(r=ne(i.prototype))}return je[t]=r,r},"doEval"),Ms={__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"]},Tt=Je(),nr=un(),nm=Tt.call(Et,Array.prototype.concat),om=Tt.call(Bs,Array.prototype.splice),Ls=Tt.call(Et,String.prototype.replace),or=Tt.call(Et,String.prototype.slice),im=Tt.call(Et,RegExp.prototype.exec),am=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,sm=/\\(\\)?/g,cm=o(function(t){var r=or(t,0,1),n=or(t,-1);if(r==="%"&&n!=="%")throw new et("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new et("invalid intrinsic syntax, expected opening `%`");var i=[];return Ls(t,am,function(c,u,l,g){i[i.length]=l?Ls(g,sm,"$1"):u||c}),i},"stringToPath"),um=o(function(t,r){var n=t,i;if(nr(Ms,n)&&(i=Ms[n],n="%"+i[0]+"%"),nr(je,n)){var c=je[n];if(c===Ye&&(c=rm(n)),typeof c>"u"&&!r)throw new Qe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:c}}throw new et("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Fs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Qe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Qe('"allowMissing" argument must be a boolean');if(im(/^%?[^%]*%?$/,t)===null)throw new et("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=cm(t),i=n.length>0?n[0]:"",c=um("%"+i+"%",r),u=c.name,l=c.value,g=!1,x=c.alias;x&&(i=x[0],om(n,nm([0,1],x)));for(var h=1,z=!0;h<n.length;h+=1){var _=n[h],s=or(_,0,1),d=or(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new et("property names with quotes must have matching quotes");if((_==="constructor"||!z)&&(g=!0),i+="."+_,u="%"+i+"%",nr(je,u))l=je[u];else if(l!=null){if(!(_ in l)){if(!r)throw new Qe("base intrinsic for "+t+" exists, but the property is not available.");return}if(bt&&h+1>=n.length){var y=bt(l,_);z=!!y,z&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[_]}else z=nr(l,_),l=l[_];z&&!g&&(je[u]=l)}}return l},"GetIntrinsic")});var Hs=I((oR,Vs)=>{"use strict";var lm=nn();Vs.exports=o(function(){return lm()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ws=I((aR,qs)=>{"use strict";var pm=Zs(),Gs=pm("%Object.defineProperty%",!0),dm=Hs()(),mm=un(),fm=Qt(),ir=dm?Symbol.toStringTag:null;qs.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new fm("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ir&&(n||!mm(t,ir))&&(Gs?Gs(t,ir,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ir]=r)},"setToStringTag")});var Js=I((cR,Ks)=>{"use strict";var gm=Function.prototype.call,ym=Object.prototype.hasOwnProperty,hm=Je();Ks.exports=hm.call(gm,ym)});var Ys=I((uR,Xs)=>{"use strict";Xs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var tc=I((lR,ec)=>{"use strict";var gn=na(),vm=require("util"),dn=require("path"),xm=require("http"),_m=require("https"),Pm=require("url").parse,bm=require("fs"),Em=require("stream").Stream,Tm=require("crypto"),mn=ca(),Im=Ia(),Sm=Ws(),Ne=Js(),fn=Ys();function Qs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Qs,"escapeHeaderParam");function H(e){if(!(this instanceof H))return new H(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],gn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(H,"FormData");vm.inherits(H,gn);H.LINE_BREAK=`\r
|
|
2
|
+
`;H.DEFAULT_CONTENT_TYPE="application/octet-stream";H.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 i=this._multiPartHeader(e,t,r),c=this._multiPartFooter();n(i),n(t),n(c),this._trackLength(i,t,r)};H.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)+H.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ne(t,"httpVersion"))&&!(t instanceof Em))&&(r.knownLength||this._valuesToMeasure.push(t))};H.prototype._lengthRetriever=function(e,t){Ne(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):bm.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Ne(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ne(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};H.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),c="",u={"Content-Disposition":["form-data",'name="'+Qs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&fn(u,r.header);var l;for(var g in u)if(Ne(u,g)){if(l=u[g],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(c+=g+": "+l.join("; ")+H.LINE_BREAK)}return"--"+this.getBoundary()+H.LINE_BREAK+c+H.LINE_BREAK};H.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&&Ne(e,"httpVersion")&&(r=dn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Qs(r)+'"'};H.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&&Ne(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=H.DEFAULT_CONTENT_TYPE),r};H.prototype._multiPartFooter=function(){return function(e){var t=H.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};H.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+H.LINE_BREAK};H.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ne(e,t)&&(r[t.toLowerCase()]=e[t]);return r};H.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};H.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};H.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(H.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};H.prototype._generateBoundary=function(){this._boundary="--------------------------"+Tm.randomBytes(12).toString("hex")};H.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};H.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};H.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}Im.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};H.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Pm(e),n=fn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=fn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=_m.request(n):r=xm.request(n),this.getLength(function(c,u){if(c&&c!=="Unknown stream"){this._error(c);return}if(u&&r.setHeader("Content-Length",u),this.pipe(r),t){var l,g=o(function(x,h){return r.removeListener("error",g),r.removeListener("response",l),t.call(this,x,h)},"callback");l=g.bind(this,null),r.on("error",g),r.on("response",l)}}.bind(this)),r};H.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};H.prototype.toString=function(){return"[object FormData]"};Sm(H.prototype,"FormData");ec.exports=H});var qm={};Pn(qm,{resend:()=>Gm,resendAuth:()=>$});module.exports=nu(qm);var ou=Object.freeze({status:"aborted"});function E(e,t,r){function n(l,g){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:g,constr:u,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,g);let x=u.prototype,h=Object.keys(x);for(let z=0;z<h.length;z++){let _=h[z];_ in l||(l[_]=x[_].bind(l))}}o(n,"init");let i=r?.Parent??Object;class c extends i{static{o(this,"Definition")}}Object.defineProperty(c,"name",{value:e});function u(l){var g;let x=r?.Parent?new c:this;n(x,l),(g=x._zod).deferred??(g.deferred=[]);for(let h of x._zod.deferred)h();return x}return o(u,"_"),Object.defineProperty(u,"init",{value:n}),Object.defineProperty(u,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(u,"name",{value:e}),u}o(E,"$constructor");var me=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},St=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},cr={};function he(e){return e&&Object.assign(cr,e),cr}o(he,"config");function lr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(lr,"getEnumValues");function Tn(e,t){return typeof t=="bigint"?t.toString():t}o(Tn,"jsonStringifyReplacer");function $t(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o($t,"cached");function In(e){return e==null}o(In,"nullish");function zt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(zt,"cleanRegex");var En=Symbol("evaluating");function ee(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==En)return n===void 0&&(n=En,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(ee,"defineLazy");var pr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(rt,"isObject");var iu=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Sn(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)}o(Sn,"isPlainObject");var An=new Set(["string","number","symbol"]);function Be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Be,"escapeRegex");function Ot(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Ot,"clone");function q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(q,"normalizeParams");function $n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o($n,"optionalKeys");var zn={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 Fe(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Fe,"aborted");function Ie(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ie,"prefixIssues");function At(e){return typeof e=="string"?e:e?.message}o(At,"unwrapMessage");function Se(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=At(e.inst?._zod.def?.error?.(e))??At(t?.error?.(e))??At(r.customError?.(e))??At(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Se,"finalizeIssue");function On(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(On,"getLengthableOrigin");function dr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(dr,"issue");var Rn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Tn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),kn=E("$ZodError",Rn),nt=E("$ZodError",Rn,{Parent:Error});var su=o(e=>(t,r,n,i)=>{let c=n?Object.assign(n,{async:!1}):{async:!1},u=t._zod.run({value:r,issues:[]},c);if(u instanceof Promise)throw new me;if(u.issues.length){let l=new(i?.Err??e)(u.issues.map(g=>Se(g,c,he())));throw pr(l,i?.callee),l}return u.value},"_parse"),Rt=su(nt),cu=o(e=>async(t,r,n,i)=>{let c=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},c);if(u instanceof Promise&&(u=await u),u.issues.length){let l=new(i?.Err??e)(u.issues.map(g=>Se(g,c,he())));throw pr(l,i?.callee),l}return u.value},"_parseAsync"),kt=cu(nt),uu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},c=t._zod.run({value:r,issues:[]},i);if(c instanceof Promise)throw new me;return c.issues.length?{success:!1,error:new(e??kn)(c.issues.map(u=>Se(u,i,he())))}:{success:!0,data:c.value}},"_safeParse"),ot=uu(nt),lu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},i);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(u=>Se(u,i,he())))}:{success:!0,data:c.value}},"_safeParseAsync"),it=lu(nt);var pu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",du=new RegExp(`^${pu}$`);var wn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Dn=/^-?\d+n?$/,Nn=/^-?\d+$/,mr=/^-?\d+(?:\.\d+)?$/,Cn=/^(?:true|false)$/i;var Ae=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),mu={number:"number",bigint:"bigint",object:"date"};var Un=E("$ZodCheckGreaterThan",(e,t)=>{Ae.init(e,t);let r=mu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,c=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Mn=E("$ZodCheckNumberFormat",(e,t)=>{Ae.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,c]=zn[t.format];e._zod.onattach.push(u=>{let l=u._zod.bag;l.format=t.format,l.minimum=i,l.maximum=c,r&&(l.pattern=Nn)}),e._zod.check=u=>{let l=u.value;if(r){if(!Number.isInteger(l)){u.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?u.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):u.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&u.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>c&&u.issues.push({origin:"number",input:l,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}});var Ln=E("$ZodCheckMinLength",(e,t)=>{var r;Ae.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!In(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let u=On(i);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var fr=E("$ZodCheckStringFormat",(e,t)=>{var r,n;Ae.init(e,t),e._zod.onattach.push(i=>{let c=i._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),jn=E("$ZodCheckRegex",(e,t)=>{fr.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 Fn={major:4,minor:3,patch:6};var X=E("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let c of i._zod.onattach)c(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((u,l,g)=>{let x=Fe(u),h;for(let z of l){if(z._zod.def.when){if(!z._zod.def.when(u))continue}else if(x)continue;let _=u.issues.length,s=z._zod.check(u);if(s instanceof Promise&&g?.async===!1)throw new me;if(h||s instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await s,u.issues.length!==_&&(x||(x=Fe(u,_)))});else{if(u.issues.length===_)continue;x||(x=Fe(u,_))}}return h?h.then(()=>u):u},"runChecks"),c=o((u,l,g)=>{if(Fe(u))return u.aborted=!0,u;let x=i(l,n,g);if(x instanceof Promise){if(g.async===!1)throw new me;return x.then(h=>e._zod.parse(h,g))}return e._zod.parse(x,g)},"handleCanaryResult");e._zod.run=(u,l)=>{if(l.skipChecks)return e._zod.parse(u,l);if(l.direction==="backward"){let x=e._zod.parse({value:u.value,issues:[]},{...l,skipChecks:!0});return x instanceof Promise?x.then(h=>c(h,u,l)):c(x,u,l)}let g=e._zod.parse(u,l);if(g instanceof Promise){if(l.async===!1)throw new me;return g.then(x=>i(x,n,l))}return i(g,n,l)}}ee(e,"~standard",()=>({validate:o(i=>{try{let c=ot(e,i);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return it(e,i).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=E("$ZodString",(e,t)=>{X.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wn(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}}),gr=E("$ZodStringFormat",(e,t)=>{fr.init(e,t),Nt.init(e,t)});var qn=E("$ZodURL",(e,t)=>{gr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var yr=E("$ZodNumber",(e,t)=>{X.init(e,t),e._zod.pattern=e._zod.bag.pattern??mr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let c=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...c?{received:c}:{}}),r}}),Wn=E("$ZodNumberFormat",(e,t)=>{Mn.init(e,t),yr.init(e,t)}),hr=E("$ZodBoolean",(e,t)=>{X.init(e,t),e._zod.pattern=Cn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Kn=E("$ZodBigInt",(e,t)=>{X.init(e,t),e._zod.pattern=Dn,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 Jn=E("$ZodAny",(e,t)=>{X.init(e,t),e._zod.parse=r=>r}),Xn=E("$ZodUnknown",(e,t)=>{X.init(e,t),e._zod.parse=r=>r});var Yn=E("$ZodVoid",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Qn=E("$ZodDate",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,c=i instanceof Date;return c&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...c?{received:"Invalid Date"}:{},inst:e}),r}});function Zn(e,t,r){e.issues.length&&t.issues.push(...Ie(r,e.issues)),t.value[r]=e.value}o(Zn,"handleArrayResult");var eo=E("$ZodArray",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let c=[];for(let u=0;u<i.length;u++){let l=i[u],g=t.element._zod.run({value:l,issues:[]},n);g instanceof Promise?c.push(g.then(x=>Zn(x,r,u))):Zn(g,r,u)}return c.length?Promise.all(c).then(()=>r):r}});function Dt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ie(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Dt,"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=$n(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(fu,"normalizeDef");function gu(e,t,r,n,i,c){let u=[],l=i.keySet,g=i.catchall._zod,x=g.def.type,h=g.optout==="optional";for(let z in t){if(l.has(z))continue;if(x==="never"){u.push(z);continue}let _=g.run({value:t[z],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>Dt(s,r,z,t,h))):Dt(_,r,z,t,h)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:c}),e.length?Promise.all(e).then(()=>r):r}o(gu,"handleCatchall");var to=E("$ZodObject",(e,t)=>{if(X.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let g={...l};return Object.defineProperty(t,"shape",{value:g}),g},"get")})}let n=$t(()=>fu(t));ee(e._zod,"propValues",()=>{let l=t.shape,g={};for(let x in l){let h=l[x]._zod;if(h.values){g[x]??(g[x]=new Set);for(let z of h.values)g[x].add(z)}}return g});let i=rt,c=t.catchall,u;e._zod.parse=(l,g)=>{u??(u=n.value);let x=l.value;if(!i(x))return l.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),l;l.value={};let h=[],z=u.shape;for(let _ of u.keys){let s=z[_],d=s._zod.optout==="optional",y=s._zod.run({value:x[_],issues:[]},g);y instanceof Promise?h.push(y.then(m=>Dt(m,l,_,x,d))):Dt(y,l,_,x,d)}return c?gu(h,x,l,g,n.value,e):h.length?Promise.all(h).then(()=>l):l}});function Vn(e,t,r,n){for(let c of e)if(c.issues.length===0)return t.value=c.value,t;let i=e.filter(c=>!Fe(c));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(c=>c.issues.map(u=>Se(u,n,he())))}),t)}o(Vn,"handleUnionResults");var vr=E("$ZodUnion",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ee(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${i.map(c=>zt(c.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,c)=>{if(r)return n(i,c);let u=!1,l=[];for(let g of t.options){let x=g._zod.run({value:i.value,issues:[]},c);if(x instanceof Promise)l.push(x),u=!0;else{if(x.issues.length===0)return x;l.push(x)}}return u?Promise.all(l).then(g=>Vn(g,i,e,c)):Vn(l,i,e,c)}});var ro=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,vr.init(e,t);let r=e._zod.parse;ee(e._zod,"propValues",()=>{let i={};for(let c of t.options){let u=c._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let[l,g]of Object.entries(u)){i[l]||(i[l]=new Set);for(let x of g)i[l].add(x)}}return i});let n=$t(()=>{let i=t.options,c=new Map;for(let u of i){let l=u._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let g of l){if(c.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);c.set(g,u)}}return c});e._zod.parse=(i,c)=>{let u=i.value;if(!rt(u))return i.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),i;let l=n.value.get(u?.[t.discriminator]);return l?l._zod.run(i,c):t.unionFallback?r(i,c):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),i)}});var no=E("$ZodRecord",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Sn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let c=[],u=t.keyType._zod.values;if(u){r.value={};let l=new Set;for(let x of u)if(typeof x=="string"||typeof x=="number"||typeof x=="symbol"){l.add(typeof x=="number"?x.toString():x);let h=t.valueType._zod.run({value:i[x],issues:[]},n);h instanceof Promise?c.push(h.then(z=>{z.issues.length&&r.issues.push(...Ie(x,z.issues)),r.value[x]=z.value})):(h.issues.length&&r.issues.push(...Ie(x,h.issues)),r.value[x]=h.value)}let g;for(let x in i)l.has(x)||(g=g??[],g.push(x));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:g})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let g=t.keyType._zod.run({value:l,issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&mr.test(l)&&g.issues.length){let z=t.keyType._zod.run({value:Number(l),issues:[]},n);if(z instanceof Promise)throw new Error("Async schemas not supported in object keys currently");z.issues.length===0&&(g=z)}if(g.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(z=>Se(z,n,he())),input:l,path:[l],inst:e});continue}let h=t.valueType._zod.run({value:i[l],issues:[]},n);h instanceof Promise?c.push(h.then(z=>{z.issues.length&&r.issues.push(...Ie(l,z.issues)),r.value[g.value]=z.value})):(h.issues.length&&r.issues.push(...Ie(l,h.issues)),r.value[g.value]=h.value)}}return c.length?Promise.all(c).then(()=>r):r}});var oo=E("$ZodEnum",(e,t)=>{X.init(e,t);let r=lr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>An.has(typeof i)).map(i=>typeof i=="string"?Be(i):i.toString()).join("|")})$`),e._zod.parse=(i,c)=>{let u=i.value;return n.has(u)||i.issues.push({code:"invalid_value",values:r,input:u,inst:e}),i}}),io=E("$ZodLiteral",(e,t)=>{if(X.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Be(n):n?Be(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let c=n.value;return r.has(c)||n.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),n}});var ao=E("$ZodTransform",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new St(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(u=>(r.value=u,r));if(i instanceof Promise)throw new me;return r.value=i,r}});function Hn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Hn,"handleOptionalResult");var so=E("$ZodOptional",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(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 i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(c=>Hn(c,r.value)):Hn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var co=E("$ZodNullable",(e,t)=>{X.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)}|null)$`):void 0}),ee(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 uo=E("$ZodPipe",(e,t)=>{X.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let c=t.out._zod.run(r,n);return c instanceof Promise?c.then(u=>wt(u,t.in,n)):wt(c,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(c=>wt(c,t.out,n)):wt(i,t.out,n)}});function wt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(wt,"handlePipeResult");var lo=E("$ZodCustom",(e,t)=>{Ae.init(e,t),X.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(c=>Gn(c,r,n,e));Gn(i,r,n,e)}});function Gn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(dr(i))}}o(Gn,"handleRefineResult");var mo;var xr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function fo(){return new xr}o(fo,"registry");(mo=globalThis).__zod_globalRegistry??(mo.__zod_globalRegistry=fo());var _r=globalThis.__zod_globalRegistry;function go(e,t){return new e({type:"string",...q(t)})}o(go,"_string");function yo(e,t){return new e({type:"string",coerce:!0,...q(t)})}o(yo,"_coercedString");function ho(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...q(t)})}o(ho,"_url");function vo(e,t){return new e({type:"number",checks:[],...q(t)})}o(vo,"_number");function xo(e,t){return new e({type:"number",coerce:!0,checks:[],...q(t)})}o(xo,"_coercedNumber");function _o(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...q(t)})}o(_o,"_int");function Po(e,t){return new e({type:"boolean",...q(t)})}o(Po,"_boolean");function bo(e,t){return new e({type:"boolean",coerce:!0,...q(t)})}o(bo,"_coercedBoolean");function Eo(e,t){return new e({type:"bigint",coerce:!0,...q(t)})}o(Eo,"_coercedBigint");function To(e){return new e({type:"any"})}o(To,"_any");function Io(e){return new e({type:"unknown"})}o(Io,"_unknown");function So(e,t){return new e({type:"void",...q(t)})}o(So,"_void");function Ao(e,t){return new e({type:"date",coerce:!0,...q(t)})}o(Ao,"_coercedDate");function Ct(e,t){return new Un({check:"greater_than",...q(t),value:e,inclusive:!0})}o(Ct,"_gte");function le(e,t){return new Ln({check:"min_length",...q(t),minimum:e})}o(le,"_minLength");function $e(e,t){return new jn({check:"string_format",format:"regex",...q(t),pattern:e})}o($e,"_regex");function $o(e,t,r){let n=q(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o($o,"_custom");var te=E("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");X.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Rt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>ot(e,r,n),e.parseAsync=async(r,n)=>kt(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)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Mt=E("ZodMiniString",(e,t)=>{Nt.init(e,t),te.init(e,t)});function a(e){return go(Mt,e)}o(a,"string");var zo=E("ZodMiniStringFormat",(e,t)=>{gr.init(e,t),Mt.init(e,t)});var $u=E("ZodMiniURL",(e,t)=>{qn.init(e,t),zo.init(e,t)});function Oo(e){return ho($u,e)}o(Oo,"url");var Lt=E("ZodMiniNumber",(e,t)=>{yr.init(e,t),te.init(e,t)});function re(e){return vo(Lt,e)}o(re,"number");var zu=E("ZodMiniNumberFormat",(e,t)=>{Wn.init(e,t),Lt.init(e,t)});function Ro(e){return _o(zu,e)}o(Ro,"int");var Pr=E("ZodMiniBoolean",(e,t)=>{hr.init(e,t),te.init(e,t)});function V(e){return Po(Pr,e)}o(V,"boolean");var ko=E("ZodMiniBigInt",(e,t)=>{Kn.init(e,t),te.init(e,t)});var Ou=E("ZodMiniAny",(e,t)=>{Jn.init(e,t),te.init(e,t)});function st(){return To(Ou)}o(st,"any");var Ru=E("ZodMiniUnknown",(e,t)=>{Xn.init(e,t),te.init(e,t)});function C(){return Io(Ru)}o(C,"unknown");var ku=E("ZodMiniVoid",(e,t)=>{Yn.init(e,t),te.init(e,t)});function wo(e){return So(ku,e)}o(wo,"_void");var Do=E("ZodMiniDate",(e,t)=>{Qn.init(e,t),te.init(e,t)});var wu=E("ZodMiniArray",(e,t)=>{eo.init(e,t),te.init(e,t)});function k(e,t){return new wu({type:"array",element:e,...q(t)})}o(k,"array");var Du=E("ZodMiniObject",(e,t)=>{to.init(e,t),te.init(e,t),ee(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...q(t)};return new Du(r)}o(p,"object");var Nu=E("ZodMiniUnion",(e,t)=>{vr.init(e,t),te.init(e,t)});function j(e,t){return new Nu({type:"union",options:e,...q(t)})}o(j,"union");var Cu=E("ZodMiniDiscriminatedUnion",(e,t)=>{ro.init(e,t),te.init(e,t)});function ze(e,t,r){return new Cu({type:"union",options:t,discriminator:e,...q(r)})}o(ze,"discriminatedUnion");var Uu=E("ZodMiniRecord",(e,t)=>{no.init(e,t),te.init(e,t)});function U(e,t,r){return new Uu({type:"record",keyType:e,valueType:t,...q(r)})}o(U,"record");var Mu=E("ZodMiniEnum",(e,t)=>{oo.init(e,t),te.init(e,t),e.options=Object.values(t.entries)});function O(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Mu({type:"enum",entries:r,...q(t)})}o(O,"_enum");var Lu=E("ZodMiniLiteral",(e,t)=>{io.init(e,t),te.init(e,t)});function A(e,t){return new Lu({type:"literal",values:Array.isArray(e)?e:[e],...q(t)})}o(A,"literal");var ju=E("ZodMiniTransform",(e,t)=>{ao.init(e,t),te.init(e,t)});function Oe(e){return new ju({type:"transform",transform:e})}o(Oe,"transform");var Bu=E("ZodMiniOptional",(e,t)=>{so.init(e,t),te.init(e,t)});function f(e){return new Bu({type:"optional",innerType:e})}o(f,"optional");var Fu=E("ZodMiniNullable",(e,t)=>{co.init(e,t),te.init(e,t)});function ct(e){return new Fu({type:"nullable",innerType:e})}o(ct,"nullable");var Zu=E("ZodMiniPipe",(e,t)=>{uo.init(e,t),te.init(e,t)});function Re(e,t){return new Zu({type:"pipe",in:e,out:t})}o(Re,"pipe");var Vu=E("ZodMiniCustom",(e,t)=>{lo.init(e,t),te.init(e,t)});function jt(e,t){return $o(Vu,e??(()=>!0),t)}o(jt,"custom");var ut={};Pn(ut,{bigint:()=>Ju,boolean:()=>Ku,date:()=>Xu,number:()=>Wu,string:()=>qu});function qu(e){return yo(Mt,e)}o(qu,"string");function Wu(e){return xo(Lt,e)}o(Wu,"number");function Ku(e){return bo(Pr,e)}o(Ku,"boolean");function Ju(e){return Eo(ko,e)}o(Ju,"bigint");function Xu(e){return Ao(Do,e)}o(Xu,"date");var Er=p({retryOnFailure:p({defaultValue:f(V()),hide:f(V())}),continueOnFailure:p({defaultValue:f(V()),hide:f(V())})}),br=class{constructor(t,r,n,i,c,u,l,g,x,h,z,_,s){this.name=t;this.displayName=r;this.description=n;this.props=i;this.propertyGroups=c;this.run=u;this.test=l;this.requireAuth=g;this.errorHandlingOptions=x;this.outputSchema=h;this.audience=z;this.aiMetadata=_;this.classification=s}static{o(this,"IAction")}},L=o(e=>new br(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 Z=p({displayName:a(),description:f(a()),advanced:f(V()),width:f(O(["half","full"])),icon:f(a()),placeholder:f(a())}),M=o((e,t)=>p({type:A(t),required:V(),defaultValue:f(st())}),"TPropertyValue");var ae=p({...Z.shape,...M(a(),"SHORT_TEXT").shape}),ve=p({...Z.shape,...M(a(),"LONG_TEXT").shape});var Co=p({label:a(),value:C(),description:f(a()),icon:f(a())}),Bt=p({disabled:f(V()),placeholder:f(a()),options:k(Co)});var Qu=O(["cards"]),se=p({...Z.shape,options:Bt,display:f(Qu),...M(C(),"STATIC_DROPDOWN").shape}),xe=p({...Z.shape,options:Bt,...M(k(C()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Tr=p({...Z.shape,...M(C(),"DROPDOWN").shape,refreshers:k(a())}),lt=p({...Z.shape,...M(k(C()),"MULTI_SELECT_DROPDOWN").shape,refreshers:k(a())});var _e=p({...Z.shape,reveals:f(k(a())),...M(V(),"CHECKBOX").shape});var Pe=p({...Z.shape,display:f(O(["stepper"])),min:f(re()),max:f(re()),step:f(re()),...M(re(),"NUMBER").shape});var pt=p({...Z.shape,streaming:f(V()),...M(C(),"FILE").shape});var dt=p({...Z.shape,...M(a(),"DATE_TIME").shape});var Uo=U(a(),j([ae,ve,se,lt,xe,_e,Pe,pt,dt])),mt=p({...Z.shape,properties:Uo,...M(k(C()),"ARRAY").shape});var Mo=O(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Lo=p({preset:f(Mo),after:f(a()),before:f(a())}),Ir=p({...Z.shape,display:f(O(["dropdown"])),...M(Lo,"DATE_RANGE").shape});var ft=p({...Z.shape,...M(j([U(a(),C())]),"JSON").shape});var jo=j([ae,se,ft,mt,xe]),el=U(a(),jo),Sr=p({refreshers:k(a()),...Z.shape,...M(C(),"DYNAMIC").shape});var Ft=p({...Z.shape,...M(wo(),"MARKDOWN").shape});var gt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(gt||{}),Ze=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ze||{}),Ve=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Ve||{});var yt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(yt||{}),Ar="both_client_credentials_and_authorization_code";var ke=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ke||{}),ht=(c=>(c.NONE="NONE",c.HEADER_PRESENT="HEADER_PRESENT",c.QUERY_PRESENT="QUERY_PRESENT",c.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",c.HEAD_REQUEST="HEAD_REQUEST",c))(ht||{}),tl=p({strategy:O(ht),paramName:f(a())}),vt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(vt||{});var Zt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Zt||{}),Bo=p({status:f(re()),body:f(C()),headers:f(U(a(),a()))}),Fo=p({type:A("DELAY"),resumeDateTime:a(),requestIdToReply:f(a()),handlerId:f(a()),streamStepProgress:f(O(Zt))}),Zo=p({type:A("WEBHOOK"),requestId:a(),requestIdToReply:f(a()),response:Bo,handlerId:f(a()),streamStepProgress:f(O(Zt))}),rl=j([Fo,Zo]);var nl=p({body:C(),rawBody:f(C()),headers:U(a(),a()),queryParams:U(a(),a())});function ce(e){return e==null}o(ce,"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}o(xt,"isEmpty");function Vt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Vt,"assertNotNullOrUndefined");var $r=Ce(require("crypto"),1);var ol=128,we,He,il=o(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!we||we.length<e?(we=Buffer.allocUnsafe(e*ol),$r.default.randomFillSync(we),He=0):He+e>we.length&&($r.default.randomFillSync(we),He=0)}catch(t){throw we=void 0,t}He+=e},"fillPool"),al=o(e=>(il(e|=0),we.subarray(He-e,He)),"random"),sl=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(c=t)=>{if(c<=0)return"";let u="";for(;;){let l=r(i),g=i;for(;g--;)if(u+=e[l[g]&n]||"",u.length===c)return u}}},"customRandom"),Ho=o((e,t=21)=>sl(e,t,al),"customAlphabet");var cl="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Go=21,kE=a().check($e(new RegExp(`^[0-9a-zA-Z]{${Go}}$`))),ul=Ho(cl,Go);var De=Re(Oe(e=>e instanceof Date?e.toISOString():e),a()),ue={id:a(),created:De,updated:De},K=o(e=>f(ct(e)),"Nullable");function zr(e){return f(ct(O(e)))}o(zr,"NullableEnum");var NE=Re(Oe(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),f(V())),Ht=o(e=>Re(Oe(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),f(k(e))),"OptionalArrayFromQuery");var ME=U(a(),C());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 JE=a().check($e(/^#[0-9A-Fa-f]{6}$/));var YE=p({filename:a(),data:C(),type:A("file"),mimetype:f(a())});var ll=Ce(Wo());var iT=p({...ue,name:a(),permissions:k(a()),platformId:K(a()),type:a(),userCount:f(re())});var Ko=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ko||{}),Or=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Or||{}),Rr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Rr||{});var kr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(kr||{});var wr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(wr||{});var pl=p({mode:O(Ko),value:C()}),dl=p({auth:f(a()),fields:U(a(),pl)}),ml=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:f(dl)}),fl=p({type:A("PIECE"),toolName:a().check(le(1)),pieceMetadata:ml}),gl=p({type:A("none")}),yl=p({type:A("access_token"),accessToken:a()}),hl=p({type:A("api_key"),apiKey:a(),apiKeyHeader:a()}),vl=p({type:A("headers"),headers:U(a(),a())}),xl=ze("type",[gl,yl,hl,vl]),Jo=p({type:A("FLOW"),toolName:a().check(le(1)),externalFlowId:a(),flowDisplayName:f(a())}),Xo=p({type:A("MCP"),toolName:a().check(le(1)),serverUrl:Oo(),protocol:O(Rr),auth:xl}),Yo=p({type:A("KNOWLEDGE_BASE"),toolName:a().check(le(1)),sourceType:O(Or),sourceId:a(),sourceName:a()}),_l=ze("type",[fl,Jo,Xo,Yo]),Pl=p({displayName:a(),description:f(a()),type:O(kr)}),Qo=p({type:A("MARKDOWN"),markdown:a()}),Ge={type:A("TOOL_CALL"),input:K(U(a(),C())),output:f(C()),toolName:a(),status:O(wr),toolCallId:a(),startTime:a(),endTime:f(a())},CT=p(Ge),ei=ze("toolCallType",[p({...Ge,toolCallType:A("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Ge,toolCallType:A("FLOW"),displayName:a(),externalFlowId:a()}),p({...Ge,toolCallType:A("MCP"),displayName:a(),serverUrl:a()}),p({...Ge,toolCallType:A("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Ge,toolCallType:A("UNKNOWN"),displayName:a()})]),bl=j([Qo,ei]);var Dr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Dr||{}),be=p({apiKey:a()}),El=be,Tl=p({apiKey:a(),apiKeyHash:a()}),Il=be,Sl=be,Al=be,$l=be,zl=be,Ol=be,Rl=be,ii=p({accessKeyId:a().check(le(1)),secretAccessKey:a().check(le(1))}),kl=p({}),wl=p({}),Dl=p({}),Nl=p({}),Cl=p({}),Ul=p({}),ai=p({modelId:a(),modelName:a(),modelType:O(Dr)}),si=p({apiKeyHeader:a(),baseUrl:a(),models:k(ai),defaultHeaders:f(U(a(),a()))}),ci=p({accountId:a(),gatewayId:a(),models:k(ai),vertexProject:f(a()),vertexRegion:f(a())}),ui=p({resourceName:a(),apiVersion:Re(Oe(e=>typeof e=="string"&&e.trim().length===0?void 0:e),f(a()))}),li=p({region:a().check(le(1))}),Ml=j([El,Al,$l,zl,Ol,Sl,Il,Tl,ii,Rl]),pi=j([si,ci,ui,li,kl,Dl,Nl,Cl,wl,Ul]),Ll=p({id:a(),name:a(),type:O(Dr)}),jl=p({id:a(),name:a(),provider:O(_t),config:pi,enabledForChat:V()}),Bl=p({provider:O(_t),config:pi,auth:Ml,platformId:a()});var jT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ti=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Fl=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Zl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],ri=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Vl=["grok-4.20","grok-4.1-fast"],Hl={openai:ti,anthropic:Fl,google:ri,activepieces:[...Zl.map(e=>`anthropic/${e}`),...ti.map(e=>`openai/${e}`),...ri.map(e=>`google/${e}`),...Vl.map(e=>`x-ai/${e}`)]};var ni=128e3,Gl={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function ql({provider:e}){return e?Gl[e]??ni:ni}o(ql,"getMaxContextTokens");var oi={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"},Wl={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Kl=new Set(["anthropic","mistral"]);function fe(e){return{chatModels:Hl[e],maxContextTokens:ql({provider:e}),defaultEmbeddingModel:oi[e],supportsEmbedding:oi[e]!==void 0,supportsImageGeneration:!Kl.has(e),webSearch:Wl[e]}}o(fe,"buildProviderCapabilities");var Jl={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 Xl=p({base64Url:a(),fileName:a(),extension:f(a())}),Yl=p({mimeType:a(),url:a(),fileName:f(a())}),Nr=j([Xl,Yl]);var Ql=j([p({type:A("file"),value:Nr}),p({type:A("markdown"),value:a(),files:f(k(Nr))})]),ep=p({sessionId:a(),message:a(),files:f(k(a()))});var mi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(mi||{}),fi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(fi||{}),Cr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Cr||{});var tp=j([p({...ue,name:a(),externalId:a(),type:A("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:k(p({value:a()}))})}),p({...ue,name:a(),externalId:a(),type:j([A("TEXT"),A("NUMBER"),A("DATE"),A("DATETIME")]),tableId:a(),projectId:a()})]),rp=p({...ue,name:a(),folderId:K(a()),projectId:a(),externalId:a(),status:zr(fi),trigger:zr(mi)}),np=p({...ue,tableId:a(),projectId:a(),cells:U(a(),p({updated:a(),created:a(),value:C(),fieldName:a()}))}),op=p({events:k(O(Cr)),webhookUrl:a(),flowId:a()}),ip=p({fields:k(p({id:a(),name:a()})),rows:k(U(a(),a())),name:a()}),ap=p({projectId:a(),limit:f(ut.number()),cursor:f(a()),name:f(a()),externalIds:Ht(a()),folderId:f(a()),folderIds:Ht(a())}),sp=p({records:k(k(p({fieldId:a(),value:yi()}))),tableId:a()}),cp=p({cells:f(k(p({fieldId:a(),value:yi()}))),tableId:a(),agentUpdate:f(V())}),gi=ze("operator",[Ue("eq"),Ue("neq"),Ue("gt"),Ue("gte"),Ue("lt"),Ue("lte"),Ue("co"),di("exists"),di("not_exists")]),up=p({tableId:a(),limit:f(ut.number()),cursor:f(a()),filters:Ht(gi)});function yi(){return Re(Oe(e=>e==null?e:String(e)),ct(a()))}o(yi,"coerceToString");function Ue(e){return p({fieldId:a(),operator:A(e),value:a()})}o(Ue,"valueFilter");function di(e){return p({fieldId:a(),operator:A(e)})}o(di,"existenceFilter");var lp=p({status:f(re()),body:f(C()),headers:f(U(a(),a()))}),pp=p({...ue,deleted:K(De),ownerId:a(),displayName:a(),platformId:a(),externalId:K(a())});var hi=p({name:a(),description:f(a()),type:a(),required:V()}),dp=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:k(hi),returnsResponse:V()})});var vi="^[0-9]+\\.[0-9]+\\.[0-9]+$",iI=new RegExp(vi),fp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",aI=a().check($e(new RegExp(vi))),sI=a().check($e(new RegExp(fp))),gp=p({packageType:A("ARCHIVE"),pieceType:O(Ze),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),xi=p({packageType:A("REGISTRY"),pieceType:A("OFFICIAL"),pieceName:a(),pieceVersion:a()}),_i=p({packageType:A("REGISTRY"),pieceType:A("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),cI=j([xi,_i]),uI=j([gp,xi,_i]);var yp=ze("type",[p({type:A("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:A("INTERVAL"),intervalMs:Ro().check(Ct(6e4))})]),lI=p({...ue,type:O(ke),projectId:a(),flowId:a(),triggerName:a(),schedule:K(yp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:K(a()),simulate:V()}),Pi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(Pi||{}),bi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(bi||{}),Ei=(r=>(r.S3="S3",r.DB="DB",r))(Ei||{}),pI=p({...ue,projectId:K(a()),platformId:K(a()),type:O(Pi),compression:O(bi),data:f(C()),location:O(Ei),size:K(re()),fileName:K(a()),s3Key:K(a()),metadata:K(U(a(),a()))}),Ti=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ti||{}),Ii=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ii||{}),dI=p({id:a(),email:a(),firstName:a(),status:O(Ii),externalId:K(a()),platformId:K(a()),platformRole:O(Ti),lastName:a(),created:De,updated:De,lastActiveDate:K(De),imageUrl:K(a())});var Ur=p({...Z.shape,...M(U(a(),C()),"OBJECT").shape});var Mr=p({...Z.shape,formatProperty:f(a()),...M(a(),"RICH_TEXT").shape});var zi=p({...Z.shape,...M(a(),"COLOR").shape});var Lr=j([ae,ve,Mr,Ft,_e,se,xe,Tr,lt,Sr,Pe,mt,Ur,ft,dt,Ir,pt,zi]),b={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},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=p({displayName:a(),description:f(a()),hasConnectionIdentifier:f(V())});var Oi=p({username:a(),password:a()}),jr=p({...ge.shape,username:p({displayName:a(),description:f(a())}),password:p({displayName:a(),description:f(a())}),...M(Oi,"BASIC_AUTH").shape});var _p=U(a(),j([ae,ve,Pe,_e,se])),Br=p({...ge.shape,props:_p,...M(C(),"CUSTOM_AUTH").shape});var Me=p({...ge.shape,...M(p({auth:a()}),"SECRET_TEXT").shape});var Pp=U(a(),j([ae,ve,Me,Pe,_e,se,xe,Ft])),Ri=p({...ge.shape,props:Pp,...M(C(),"OIDC").shape});var Fr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Fr||{}),ki=j([ae,Me,se]),wi=U(a(),ki),bp=p({props:f(U(a(),ki)),authUrl:a(),tokenUrl:a(),scope:k(a()),prompt:f(j([A("none"),A("consent"),A("login"),A("omit")])),pkce:f(V()),pkceMethod:f(j([A("plain"),A("S256")])),authorizationMethod:f(O(Fr)),grantType:f(j([O(yt),A(Ar)])),extra:f(U(a(),a()))}),Di=p({access_token:a(),props:f(wi),data:U(a(),st())}),Zr=p({...ge.shape,...bp.shape,...M(Di,"OAUTH2").shape});var qe=j([jr,Br,Ri,Zr,Me]),Pt="Connection",Vr={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 KS={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 Ep=p({...Z.shape,...M(C(),"CUSTOM").shape,code:a()});var Tp=j([Lr,qe]),Hr=U(a(),Tp),yA=U(a(),Lr);var Ni=j([p({strategy:A("CRON"),cronExpression:a()}),p({strategy:A("NONE")})]),We=class{constructor(t,r,n,i,c,u,l,g,x,h,z,_,s,d,y,m,v,P,F,ie,de){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=c;this.type=u;this.handshakeConfiguration=l;this.onHandshake=g;this.renewConfiguration=x;this.onRenew=h;this.onEnable=z;this.onDisable=_;this.onStart=s;this.run=d;this.test=y;this.sampleData=m;this.testStrategy=v;this.outputSchema=P;this.aiMetadata=F;this.classification=ie;this.propertyGroups=de}static{o(this,"ITrigger")}},Ci=o(e=>{switch(e.type){case"WEBHOOK":return new We(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 We(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 We(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 We(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,ce(e.sampleData)&&ce(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var Ui="2",qt="0.82.0";var Gr=class{constructor(t,r,n,i,c,u,l,g,x=qt,h,z="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=g;this.minimumSupportedRelease=x;this.maximumSupportedRelease=h;this.description=z;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ui}),"getContextInfo");(!Sp(x)||Ap(x,qt))&&(this.minimumSupportedRelease=qt),c.forEach(s=>this._actions[s.name]=s),u.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:Ip(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}},Li=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(c=>c.type===r.type)))throw new Error("Auth properties must be unique by type");return new Gr(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 Ip(e){if(e!==void 0)return Array.isArray(e)?e.map(Mi):Mi(e)}o(Ip,"withConnectionIdentifierFlag");function Mi(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}o(Mi,"flagConnectionIdentifier");function Sp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Sp,"isValidSimpleSemver");function Ap(e,t){let[r,n,i]=e.split(".").map(Number),[c,u,l]=t.split(".").map(Number);return r!==c?r<c:n!==u?n<u:i<l}o(Ap,"isSemverLessThan");var $p=f(U(a(),U(a(),a()))),ji=p({id:f(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:k(a()),platformId:f(a()),directoryPath:f(a()),auth:f(j([qe,k(qe)])),version:a(),categories:f(k(O(Ve))),minimumSupportedRelease:f(a()),maximumSupportedRelease:f(a()),deprecated:f(V()),i18n:$p}),zp=O(["human","ai","both"]),Bi=p({description:f(a()),idempotent:f(V())}),Fi=O(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var Op=O(["tabs","section","summary","builder","footer"]),Zi=p({key:a(),display:Op,label:f(a()),description:f(a()),icon:f(a()),props:k(a())}),Vi=p({name:a(),displayName:a(),description:a(),props:Hr,propertyGroups:f(k(Zi)),requireAuth:V(),errorHandlingOptions:f(Er),outputSchema:f(jt()),audience:f(zp),aiMetadata:f(Bi),classification:f(Fi)}),Hi=p({name:a(),displayName:a(),description:a(),props:Hr,propertyGroups:f(k(Zi)),errorHandlingOptions:f(Er),type:O(ke),sampleData:C(),handshakeConfiguration:f(jt()),renewConfiguration:f(Ni),testStrategy:O(vt),outputSchema:f(jt()),aiMetadata:f(Bi),classification:f(Fi)}),Rp=p({...ji.shape,actions:U(a(),Vi),triggers:U(a(),Hi)}),kp=p({...ji.shape,actions:re(),triggers:re(),suggestedActions:f(k(Vi)),suggestedTriggers:f(k(Hi))}),Gi=p({projectUsage:re(),pieceType:O(Ze),packageType:O(gt),platformId:f(a()),archiveId:f(a())}),v$=p({...Rp.shape,...Gi.shape}),x$=p({...kp.shape,...Gi.shape}),_$=p({name:a(),version:a()});var wp=Ce(require("path")),Dp=Ce(require("fs/promises"));var Ke=require("node:stream");var Wt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((c,u)=>{i.append(u,c)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Kt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new qr,r=new Wr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},qr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Wr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Le=class extends Error{constructor(r,n){let i=n.status||500,c=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:c},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=c}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function qi({error:e,requestBody:t}){return e instanceof Le?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(qi,"toFailsafeOutput");var G=(u=>(u.GET="GET",u.POST="POST",u.PATCH="PATCH",u.PUT="PUT",u.DELETE="DELETE",u.HEAD="HEAD",u))(G||{});var Jt=class extends Wt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Kt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),c=this.getHeaders(t),u=t.queryParams??{};for(let[F,ie]of Object.entries(u))i.append(F,ie);let l=i.toString(),g=l?`${n}?${l}`:n,x=t.responseType??"json",h=t.followRedirects??!0,z=t.retries??0,{body:_,extraHeaders:s,isStream:d}=Np(t.method)?Cp(t.body,c):{body:void 0,extraHeaders:{},isStream:!1},y=Mp({...c,...s}),m=await Up(async()=>{let F=new AbortController,ie=t.timeout&&t.timeout>0?setTimeout(()=>F.abort(),t.timeout):void 0;try{let de={method:t.method.toString(),headers:y,body:_,redirect:h?"follow":"manual",signal:F.signal};return d&&(de.duplex="half"),r?.dispatcher!==void 0&&(de.dispatcher=r.dispatcher),await fetch(g,de)}finally{ie!==void 0&&clearTimeout(ie)}},d?0:z),v=h?300:400;if(m.status<200||m.status>=v){let F=await Wi(m,x==="stream"?"text":x),ie=new Le(t.body,{status:m.status,responseBody:F});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ie),ie}let P=await Wi(m,x);return{status:m.status,headers:Lp(m.headers),body:P}}};function Np(e){return e!=="GET"&&e!=="HEAD"}o(Np,"acceptsRequestBody");function Cp(e,t){if(Ji(e))return{body:void 0,extraHeaders:{},isStream:!1};if(jp(e)){let n=new Ke.PassThrough;return e.on("error",i=>n.destroy(i)),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}}o(Cp,"serializeBody");async function Wi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Ji(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}}}}o(Wi,"parseResponseBody");async function Up(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ki(n);continue}return i}catch(i){if(r=i,n<t){await Ki(n);continue}throw i}throw r}o(Up,"sendWithRetries");function Ki(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ki,"backoff");function Mp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(Mp,"normalizeHeaders");function Lp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Lp,"toHttpHeaders");function jp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(jp,"isNodeFormData");function Ji(e){return e==null}o(Ji,"isNil");var S=new Jt;var Am=Ce(require("fs")),rc=Ce(tc());var $m={"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 zm(e){let t=e.split(";")[0].trim().toLowerCase();return $m[t]??""}o(zm,"contentTypeToExtension");var Om=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Rm=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function nc({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:c,props:u,extraProps:l,authLocation:g="headers",classification:x="WRITE"}){return L({audience:"human",name:c||"custom_api_call",classification:x,displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:b.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:b.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Rm(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...u?.url??{}})}),"props")}),method:b.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(G).map(h=>({label:h,value:h}))},...u?.method??{}}),headers:b.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...u?.headers??{}}),queryParams:b.Object({displayName:"Query Parameters",required:!0,...u?.queryParams??{}}),body_type:b.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:b.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let z=h,_={};switch(z){case"none":break;case"json":_.data=b.Json({displayName:"JSON Body",required:!0,...u?.body??{}});break;case"raw":_.data=b.LongText({displayName:"Raw Body",required:!0});break;case"form_data":_.data=b.Array({displayName:"Form Data",required:!0,properties:{fieldName:b.ShortText({displayName:"Field Name",required:!0}),fieldType:b.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:b.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:b.File({displayName:"File Field Value",required:!1})}});break}return _},"props")}),response_is_binary:b.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:b.Checkbox({displayName:"No Error on Failure",required:!1,...u?.failsafe??{}}),timeout:b.Number({displayName:"Timeout (in seconds)",required:!1,...u?.timeout??{}}),followRedirects:b.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async h=>{let{method:z,url:_,headers:s,queryParams:d,body:y,body_type:m,failsafe:v,timeout:P,response_is_binary:F,followRedirects:ie}=h.propsValue;Vt(z,"Method"),Vt(_,"URL");let de=ce(r)?{}:await r(h.auth,h.propsValue),Ee=_.url,Jc=Ee.startsWith("http://")||Ee.startsWith("https://")?Ee:Om({baseUrl:t(h.auth),relativePath:Ee}),Te={method:z,url:Jc,headers:{...s??{},...g==="headers"||!ce(g)?de:{}},queryParams:{...g==="queryParams"?de:{},...d??{}},timeout:P?P*1e3:0,followRedirects:ie};if(F&&(Te.responseType="arraybuffer"),y)if(m&&m!=="none"){let ye=y.data;if(m==="form_data"){let Xc=ye,It=new rc.default;for(let{fieldName:vn,fieldType:xn,textFieldValue:_n,fileFieldValue:sr}of Xc)xn==="text"&&!xt(_n)?It.append(vn,_n):xn==="file"&&!xt(sr)&&It.append(vn,sr.data,{filename:sr?.filename});Te.body=It,Te.headers={...Te.headers,...It.getHeaders()}}else Te.body=ye}else m||(Te.body=y);try{let ye=await S.sendRequest(Te);return await km(h.files,ye.body,ye.status,ye.headers,F)}catch(ye){if(v)return qi({error:ye,requestBody:Te.body});throw ye}},"run")})}o(nc,"createCustomApiCallAction");var km=o(async(e,t,r,n,i)=>{let c;if(i&&wm(t)){let u=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=zm(u??"")||"txt",g;t instanceof ArrayBuffer?g=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?g=t:g=Buffer.from(t),c=await e.write({fileName:`output.${l}`,data:g})}else c=t;return{status:r,headers:n,body:c}},"handleBinaryResponse"),wm=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Dm=[{key:"id",label:"Contact ID"},{key:"email",label:"Email",format:"email"},{key:"first_name",label:"First Name"},{key:"last_name",label:"Last Name"},{key:"unsubscribed",label:"Unsubscribed",format:"boolean"},{key:"created_at",label:"Created At",format:"datetime"}],oc=[{key:"id",label:"Domain ID"},{key:"name",label:"Domain Name"},{key:"status",label:"Status"},{key:"region",label:"Region"},{key:"created_at",label:"Created At",format:"datetime"},{key:"sending",label:"Sending Capability"},{key:"receiving",label:"Receiving Capability"}],Nm=[{key:"id",label:"Audience ID"},{key:"name",label:"Name"},{key:"created_at",label:"Created At",format:"datetime"}],Cm=[{key:"id",label:"Email ID"},{key:"from",label:"From"},{key:"to",label:"To",description:"Recipients, comma-separated."},{key:"subject",label:"Subject"},{key:"last_event",label:"Last Event",description:"Latest delivery state, e.g. delivered, bounced, scheduled."},{key:"created_at",label:"Created At",format:"datetime"},{key:"scheduled_at",label:"Scheduled At",description:"Send time for a scheduled email, empty otherwise."},{key:"cc",label:"CC",description:"CC recipients, comma-separated."},{key:"bcc",label:"BCC",description:"BCC recipients, comma-separated."},{key:"reply_to",label:"Reply To",description:"Reply-to addresses, comma-separated."}],ic={fields:[{key:"id",label:"Email ID",value:"body.id"}]},ac={itemLabel:"Email {id}",fields:[{key:"emails",label:"Sent Emails",value:"",labelKey:"id",listItems:[{key:"id",label:"Email ID"}]}]},sc={fields:[{key:"id",label:"Email ID"},{key:"subject",label:"Subject"},{key:"from",label:"From"},{key:"to",label:"To",description:"Recipient addresses, as a list of strings."},{key:"cc",label:"CC",description:"CC addresses as a list of strings, or empty when none were set."},{key:"bcc",label:"BCC",description:"BCC addresses as a list of strings, or empty when none were set."},{key:"reply_to",label:"Reply To",description:"Reply-to addresses, as a list of strings."},{key:"last_event",label:"Last Event",description:"Latest delivery state, e.g. delivered, bounced, scheduled."},{key:"created_at",label:"Created At",format:"datetime"},{key:"scheduled_at",label:"Scheduled At",format:"datetime",description:"Send time for a scheduled email, null otherwise."},{key:"message_id",label:"Message ID",description:"RFC 5322 Message-ID assigned by the sending infrastructure."},{key:"text",label:"Text Body"},{key:"html",label:"HTML Body",format:"html"}]},cc={itemLabel:"{subject}",fields:[{key:"emails",label:"Emails",value:"",labelKey:"subject",listItems:Cm}]},uc={fields:[{key:"id",label:"Email ID"}]},lc={fields:[{key:"id",label:"Email ID"}]},pc={fields:[{key:"id",label:"Audience ID"},{key:"name",label:"Name"}]},dc={itemLabel:"{name}",fields:[{key:"audiences",label:"Audiences",value:"",labelKey:"name",listItems:Nm}]},mc={fields:[{key:"id",label:"Audience ID"},{key:"deleted",label:"Deleted",format:"boolean"}]},fc={fields:[{key:"id",label:"Contact ID"}]},gc={fields:[{key:"id",label:"Contact ID"}]},yc={fields:[{key:"contact",label:"Contact ID"},{key:"deleted",label:"Deleted",format:"boolean"}]},hc={itemLabel:"{email}",fields:[{key:"contacts",label:"Contacts",value:"",labelKey:"email",listItems:Dm}]},vc={fields:[...oc,{key:"dns_records",label:"DNS Records",labelKey:"name",description:"Records to add at your DNS provider before the domain will verify.",listItems:[{key:"record",label:"Record Purpose",description:"DKIM or SPF."},{key:"name",label:"Host"},{key:"type",label:"DNS Type",description:"TXT or MX."},{key:"value",label:"Value"},{key:"ttl",label:"TTL"},{key:"status",label:"Status"},{key:"priority",label:"Priority",format:"number",description:"Set on MX records only."}]}]},xc={fields:[{key:"id",label:"Domain ID"}]},_c={fields:[{key:"id",label:"Domain ID"},{key:"deleted",label:"Deleted",format:"boolean"}]},Pc={itemLabel:"{name}",fields:[{key:"domains",label:"Domains",value:"",labelKey:"name",listItems:oc}]},Um=[{key:"id",label:"Broadcast ID"},{key:"name",label:"Name"},{key:"audience_id",label:"Audience ID"},{key:"status",label:"Status"},{key:"reply_to",label:"Reply To"},{key:"preview_text",label:"Preview Text"},{key:"created_at",label:"Created At",format:"datetime"},{key:"scheduled_at",label:"Scheduled At",format:"datetime"},{key:"sent_at",label:"Sent At",format:"datetime"}],bc={fields:[{key:"id",label:"Broadcast ID"}]},Ec={fields:[{key:"id",label:"Broadcast ID"}]},Tc={fields:[{key:"id",label:"Broadcast ID"},{key:"deleted",label:"Deleted",format:"boolean"}]},Ic={itemLabel:"{name}",fields:[{key:"broadcasts",label:"Broadcasts",value:"",labelKey:"name",listItems:Um}]};var Sc=L({auth:$,name:"send_email",classification:"WRITE",displayName:"Send Email",outputSchema:ic,description:"Send a text or HTML email",audience:"both",aiMetadata:{description:"Sends a single transactional email (plain text or HTML) to one or more recipients via Resend. Use this for one-off messages; the sender address must be on a domain you have verified in Resend. Not idempotent \u2014 each call sends a new email.",idempotent:!1},props:{to:b.Array({displayName:"To",description:"Emails of the recipients",required:!0}),from_name:b.ShortText({displayName:"Sender Name",description:"Sender name",required:!0}),from:b.ShortText({displayName:"Sender Email (From)",description:"Sender email",required:!0}),bcc:b.Array({displayName:"BCC",description:"List of emails in bcc",required:!1}),cc:b.Array({displayName:"CC",description:"List of emails in cc",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email to receive replies on (defaults to sender)",required:!1}),subject:b.ShortText({displayName:"Subject",description:void 0,required:!0}),content_type:b.Dropdown({auth:$,displayName:"Content Type",refreshers:[],required:!0,defaultValue:"html",options:o(async()=>({disabled:!1,options:[{label:"Plain Text",value:"text"},{label:"HTML",value:"html"}]}),"options")}),content:b.ShortText({displayName:"Content",description:"HTML is only allowed if you selected HTML as type",required:!0})},async run(e){let{to:t,from:r,from_name:n,reply_to:i,subject:c,content_type:u,content:l,cc:g,bcc:x}=e.propsValue,h={to:t,from:n?`${n} <${r}>`:r,reply_to:i??r,cc:g,bcc:x,subject:c};return u==="text"?h.text=l:u==="html"&&(h.html=l),await S.sendRequest({method:"POST",url:"https://api.resend.com/emails",body:h,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:{}})}});var Mm="https://api.resend.com",Ac=L({name:"send_batch_emails",classification:"WRITE",auth:$,displayName:"Send Batch Emails",outputSchema:ac,description:"Send up to 100 emails in a single API call",audience:"both",aiMetadata:{description:"Sends up to 100 distinct emails in one Resend API call, each with its own recipient, subject, and body. Use this instead of Send Email when delivering many independent messages at once. Senders must be on verified domains; pass an idempotency key to guard against duplicate batch sends, otherwise each call sends new emails.",idempotent:!1},props:{emails:b.Array({displayName:"Emails",description:"List of emails to send (max 100). Each email is sent independently with its own recipient, subject, and body.",required:!0,properties:{from:b.ShortText({displayName:"From",description:'Sender address. Use "Name <email@domain.com>" for a friendly name.',required:!0}),to:b.ShortText({displayName:"To",description:"Recipient email address.",required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0}),reply_to:b.ShortText({displayName:"Reply To",required:!1}),cc:b.ShortText({displayName:"CC",required:!1}),bcc:b.ShortText({displayName:"BCC",required:!1})}}),idempotency_key:b.ShortText({displayName:"Idempotency Key",description:"Optional unique key to prevent duplicate sends. Must be unique per request, expires after 24 hours, max 256 characters.",required:!1})},async run({auth:e,propsValue:t}){let r=(t.emails??[]).map(c=>{let u=c,l={from:u.from,to:u.to,subject:u.subject};return u.content_type==="html"?l.html=u.content:l.text=u.content,u.reply_to&&(l.reply_to=u.reply_to),u.cc&&(l.cc=u.cc),u.bcc&&(l.bcc=u.bcc),l}),n={};return t.idempotency_key&&(n["Idempotency-Key"]=t.idempotency_key),(await S.sendRequest({method:"POST",url:`${Mm}/emails/batch`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},headers:n,body:r})).body.data}});var ar="https://api.resend.com",Lm=b.Dropdown({displayName:"Audience",required:!0,auth:$,refreshers:[],options:o(async({auth:e})=>e?{options:(await S.sendRequest({method:"GET",url:`${ar}/audiences`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),jm=b.Dropdown({displayName:"Domain",required:!0,auth:$,refreshers:[],options:o(async({auth:e})=>e?{options:(await S.sendRequest({method:"GET",url:`${ar}/domains`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),Bm=b.Dropdown({displayName:"Broadcast",required:!0,auth:$,refreshers:[],options:o(async({auth:e})=>e?{options:(await S.sendRequest({method:"GET",url:`${ar}/broadcasts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name?`${r.name} \u2014 ${r.subject}`:r.subject,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),Fm=b.Dropdown({displayName:"Contact",required:!0,auth:$,refreshers:["audience_id"],options:o(async({auth:e,audience_id:t})=>!e||!t?{disabled:!0,placeholder:"Select an audience first",options:[]}:{options:(await S.sendRequest({method:"GET",url:`${ar}/audiences/${String(t)}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(n=>{let i=[n.first_name,n.last_name].filter(Boolean).join(" ");return{label:i?`${i} <${n.email}>`:n.email,value:n.id}})},"options")}),Q={audienceId:Lm,domainId:jm,broadcastId:Bm,contactId:Fm};var $c=L({name:"create_contact",classification:"WRITE",auth:$,displayName:"Create Contact",outputSchema:fc,description:"Add a contact to a Resend audience",audience:"both",aiMetadata:{description:"Adds a new contact (email plus optional name and subscription status) to a specific Resend audience. Use this to grow a mailing list; requires the target audience ID (use List Audiences to find it). Not idempotent \u2014 each call creates a new contact, so guard against re-adding the same email.",idempotent:!1},props:{audience_id:Q.audienceId,email:b.ShortText({displayName:"Email",required:!0}),first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.Checkbox({displayName:"Unsubscribed",description:"If true, the contact will be unsubscribed from all broadcasts",required:!1,defaultValue:!1})},async run({auth:e,propsValue:t}){let r={email:t.email};return t.first_name&&(r.first_name=t.first_name),t.last_name&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&(r.unsubscribed=t.unsubscribed),(await S.sendRequest({method:"POST",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var zc=L({name:"update_contact",classification:"WRITE",auth:$,displayName:"Update Contact",outputSchema:gc,description:"Update the name or subscription status of a contact in an audience",audience:"both",aiMetadata:{description:"Updates an existing contact's first name, last name, or subscribed/unsubscribed status within an audience, identified by audience ID and contact ID. Use this to change details or toggle subscription for a known contact. Idempotent \u2014 repeating with the same values leaves the contact in the same state.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId,first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.StaticDropdown({displayName:"Subscription Status",required:!1,options:{options:[{label:"Subscribed",value:!1},{label:"Unsubscribed",value:!0}]}})},async run({auth:e,propsValue:t}){let r={};return t.first_name!==void 0&&t.first_name!==""&&(r.first_name=t.first_name),t.last_name!==void 0&&t.last_name!==""&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&t.unsubscribed!==null&&(r.unsubscribed=t.unsubscribed),(await S.sendRequest({method:"PATCH",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var Oc=L({name:"delete_contact",classification:"DESTRUCTIVE",auth:$,displayName:"Delete Contact",outputSchema:yc,description:"Remove a contact from an audience",audience:"both",aiMetadata:{description:"Permanently removes a contact from a Resend audience, identified by audience ID and contact ID. Use this to delete a subscriber from a list. Effectively idempotent \u2014 once removed, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Rc=L({name:"list_contacts",classification:"SEARCH",auth:$,displayName:"List Contacts",outputSchema:hc,description:"Retrieve all contacts in an audience",audience:"both",aiMetadata:{description:"Retrieves all contacts in a specific Resend audience, including each contact's ID, email, name, and subscription status. Use this to discover contact IDs (e.g. to feed Update Contact or Delete Contact) or to inspect a mailing list; requires the audience ID. Read-only and idempotent.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"GET",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var kc=L({name:"get_email_status",classification:"READ",auth:$,displayName:"Get Email Status",outputSchema:sc,description:"Retrieve the delivery status of a sent email",audience:"both",aiMetadata:{description:"Looks up the current delivery status and details of a single previously sent email by its Resend email ID. Use this to check whether a specific email was delivered, bounced, or is still scheduled. Read-only and idempotent; requires the email ID returned when the email was sent.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:"The ID returned when you sent the email",required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"GET",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var wc=L({name:"list_emails",classification:"SEARCH",auth:$,displayName:"List Sent Emails",outputSchema:cc,description:"Retrieve a list of emails sent from your Resend account",audience:"both",aiMetadata:{description:"Retrieves the list of emails sent from the connected Resend account, including their IDs, recipients, subjects, and latest delivery event. Use this to discover email IDs (e.g. to feed Get Email Status, Cancel Scheduled Email, or Reschedule Email) or to audit recent sends. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/emails",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,from:r.from,to:(r.to??[]).join(", "),subject:r.subject,last_event:r.last_event,created_at:r.created_at,scheduled_at:r.scheduled_at??"",cc:(r.cc??[]).join(", "),bcc:(r.bcc??[]).join(", "),reply_to:(r.reply_to??[]).join(", ")}))}});var Dc=L({name:"cancel_scheduled_email",classification:"DESTRUCTIVE",auth:$,displayName:"Cancel Scheduled Email",outputSchema:uc,description:"Cancel a scheduled email before it is sent",audience:"both",aiMetadata:{description:"Cancels a previously scheduled email so it will not be delivered, identified by its Resend email ID. Use this to stop a future send before its scheduled time. Effectively idempotent \u2014 once an email is cancelled, repeating the call has no further effect; only works while the email is still pending.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to cancel. Use "List Sent Emails" to find it.',required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"POST",url:`https://api.resend.com/emails/${t.email_id}/cancel`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Nc=L({name:"reschedule_email",classification:"WRITE",auth:$,displayName:"Reschedule Email",outputSchema:lc,description:"Update the send time of a scheduled email",audience:"both",aiMetadata:{description:"Changes the future send time of an already scheduled email, identified by its Resend email ID. Use this to move a pending send to a new time without cancelling and recreating it. Idempotent when called with the same target time; requires an ISO 8601 date-time and only works while the email is still scheduled.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to reschedule. Use "List Sent Emails" to find it.',required:!0}),scheduled_at:b.ShortText({displayName:"New Send Time",description:"ISO 8601 date-time for when to send the email, e.g. 2024-12-01T10:00:00Z",required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"PATCH",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{scheduled_at:t.scheduled_at}})).body}});var Cc=L({name:"list_domains",classification:"SEARCH",auth:$,displayName:"List Domains",outputSchema:Pc,description:"Retrieve all domains added to your Resend account",audience:"both",aiMetadata:{description:"Retrieves all sending domains configured on the connected Resend account, including each domain's ID, name, verification status, and region. Use this to find a domain ID (e.g. for Verify Domain or Delete Domain) or to check which domains are verified before sending. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name,status:r.status,region:r.region,created_at:r.created_at,sending:r.capabilities?.sending??"",receiving:r.capabilities?.receiving??""}))}});var Uc=L({name:"create_domain",classification:"WRITE",auth:$,displayName:"Create Domain",outputSchema:vc,description:"Add a sending domain to your Resend account and get the DNS records to verify it",audience:"both",aiMetadata:{description:"Registers a new sending domain on the Resend account and returns the DNS records that must be added to verify it. Use this as the first step in setting up a custom sending domain before triggering verification. Not idempotent \u2014 each call attempts to create a new domain entry.",idempotent:!1},props:{name:b.ShortText({displayName:"Domain Name",description:"The domain you want to send from, e.g. mail.yourdomain.com",required:!0}),region:b.StaticDropdown({displayName:"Region",description:"AWS region for email delivery. Defaults to US East.",required:!1,options:{options:[{label:"US East (N. Virginia)",value:"us-east-1"},{label:"EU West (Ireland)",value:"eu-west-1"},{label:"Asia Pacific (Tokyo)",value:"ap-northeast-1"},{label:"South America (S\xE3o Paulo)",value:"sa-east-1"}]}})},async run({auth:e,propsValue:t}){let r={name:t.name};t.region&&(r.region=t.region);let i=(await S.sendRequest({method:"POST",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body;return{id:i.id,name:i.name,status:i.status,region:i.region,created_at:i.created_at,sending:i.capabilities?.sending??"",receiving:i.capabilities?.receiving??"",dns_records:i.records}}});var Mc=L({name:"delete_domain",classification:"DESTRUCTIVE",auth:$,displayName:"Delete Domain",outputSchema:_c,description:"Remove a domain from your Resend account",audience:"both",aiMetadata:{description:"Permanently removes a sending domain from the Resend account, identified by its domain ID. Use this to decommission a domain you no longer send from. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/domains/${t.domain_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Lc=L({name:"verify_domain",classification:"WRITE",auth:$,displayName:"Verify Domain",outputSchema:xc,description:"Trigger a DNS verification check for a domain",audience:"both",aiMetadata:{description:"Triggers Resend to re-check the DNS records of a domain and update its verification status, identified by domain ID. Use this after adding the required DNS records (from Create Domain) to confirm the domain is ready to send. Safe to call repeatedly \u2014 it only re-runs the check.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"POST",url:`https://api.resend.com/domains/${t.domain_id}/verify`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var jc=L({name:"list_audiences",classification:"SEARCH",auth:$,displayName:"List Audiences",outputSchema:dc,description:"Retrieve all contact audiences in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all contact audiences (mailing lists) in the connected Resend account, including each audience's ID and name. Use this to discover an audience ID needed by contact and broadcast actions (e.g. Create Contact, List Contacts, Create Broadcast). Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var Bc=L({name:"create_audience",classification:"WRITE",auth:$,displayName:"Create Audience",outputSchema:pc,description:"Create a new contact audience in Resend",audience:"both",aiMetadata:{description:"Creates a new contact audience (mailing list) in Resend with the given name and returns its ID. Use this before adding contacts or sending broadcasts when no suitable audience exists yet. Not idempotent \u2014 each call creates a new audience even if the name matches an existing one.",idempotent:!1},props:{name:b.ShortText({displayName:"Audience Name",description:'A label for this audience, e.g. "Newsletter Subscribers"',required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"POST",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{name:t.name}})).body}});var Fc=L({name:"delete_audience",classification:"DESTRUCTIVE",auth:$,displayName:"Delete Audience",outputSchema:mc,description:"Permanently delete an audience and all its contacts",audience:"both",aiMetadata:{description:"Permanently deletes an entire audience and all of its contacts from Resend, identified by audience ID. Use this to remove a whole mailing list; this is destructive and cannot be undone. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Zc=L({name:"list_broadcasts",classification:"SEARCH",auth:$,displayName:"List Broadcasts",outputSchema:Ic,description:"Retrieve all broadcasts in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all broadcast campaigns in the connected Resend account, including each broadcast's ID, name, audience, subject, and status (draft, scheduled, sent). Use this to find a broadcast ID (e.g. for Send Broadcast or Delete Broadcast) or to check campaign status. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name??"",audience_id:r.audience_id,from:r.from,subject:r.subject,reply_to:Array.isArray(r.reply_to)?r.reply_to.join(", "):r.reply_to??"",preview_text:r.preview_text??"",status:r.status,created_at:r.created_at,scheduled_at:r.scheduled_at??"",sent_at:r.sent_at??""}))}});var Vc=L({name:"create_broadcast",classification:"WRITE",auth:$,displayName:"Create Broadcast",outputSchema:bc,description:"Create a new broadcast email to send to an audience",audience:"both",aiMetadata:{description:"Creates a draft broadcast email (subject and body) targeting a Resend audience and returns its ID. Use this to prepare a campaign; it only creates the draft and does not deliver anything \u2014 pair it with Send Broadcast to actually send. Requires the audience ID and a sender on a verified domain. Not idempotent \u2014 each call creates a new broadcast.",idempotent:!1},props:{audience_id:Q.audienceId,from:b.ShortText({displayName:"From",description:'Sender address. Must be from a verified domain. Use "Name <email@yourdomain.com>" for a friendly name.',required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),name:b.ShortText({displayName:"Broadcast Name",description:"Internal label for this broadcast. Not visible to recipients.",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email address recipients will reply to.",required:!1}),preview_text:b.ShortText({displayName:"Preview Text",description:"Short summary shown in email clients below the subject line.",required:!1}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0})},async run({auth:e,propsValue:t}){let r={audience_id:t.audience_id,from:t.from,subject:t.subject};return t.content_type==="html"?r.html=t.content:r.text=t.content,t.name&&(r.name=t.name),t.reply_to&&(r.reply_to=t.reply_to),t.preview_text&&(r.preview_text=t.preview_text),(await S.sendRequest({method:"POST",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var Hc=L({name:"send_broadcast",classification:"WRITE",auth:$,displayName:"Send Broadcast",outputSchema:Ec,description:"Send or schedule a broadcast email to its audience",audience:"both",aiMetadata:{description:"Sends an existing draft broadcast to its entire audience immediately, or schedules it for a future time, identified by broadcast ID. Use this after Create Broadcast to deliver the campaign. Not idempotent \u2014 repeating the call can dispatch the broadcast again; optionally pass an ISO 8601 time to schedule rather than send now.",idempotent:!1},props:{broadcast_id:Q.broadcastId,scheduled_at:b.ShortText({displayName:"Schedule For",description:"ISO 8601 date-time to schedule the send, e.g. 2024-12-01T10:00:00Z. Leave blank to send immediately.",required:!1})},async run({auth:e,propsValue:t}){let r={};return t.scheduled_at&&(r.scheduled_at=t.scheduled_at),(await S.sendRequest({method:"POST",url:`https://api.resend.com/broadcasts/${t.broadcast_id}/send`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var Gc=L({name:"delete_broadcast",classification:"DESTRUCTIVE",auth:$,displayName:"Delete Broadcast",outputSchema:Tc,description:"Permanently delete a broadcast from your Resend account",audience:"both",aiMetadata:{description:"Permanently deletes a broadcast from the Resend account, identified by broadcast ID. Use this to remove a draft or unwanted campaign; only broadcasts that have not been sent can be deleted. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{broadcast_id:Q.broadcastId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/broadcasts/${t.broadcast_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var hn=Ce(require("crypto"));var qc="https://api.resend.com",yn="webhookData",Zm=300,Vm=[{label:"Email Sent",value:"email.sent"},{label:"Email Delivered",value:"email.delivered"},{label:"Email Delivery Delayed",value:"email.delivery_delayed"},{label:"Email Complained",value:"email.complained"},{label:"Email Bounced",value:"email.bounced"},{label:"Email Opened",value:"email.opened"},{label:"Email Clicked",value:"email.clicked"},{label:"Email Failed",value:"email.failed"},{label:"Email Received",value:"email.received"},{label:"Email Scheduled",value:"email.scheduled"},{label:"Email Suppressed",value:"email.suppressed"},{label:"Domain Created",value:"domain.created"},{label:"Domain Updated",value:"domain.updated"},{label:"Domain Deleted",value:"domain.deleted"},{label:"Contact Created",value:"contact.created"},{label:"Contact Updated",value:"contact.updated"},{label:"Contact Deleted",value:"contact.deleted"}];function Hm({rawBody:e,headers:t,signingSecret:r}){let n=t["svix-id"],i=t["svix-timestamp"],c=t["svix-signature"];if(!n||!i||!c)return!1;let u=Math.floor(Date.now()/1e3);if(Math.abs(u-parseInt(i,10))>Zm)return!1;let l=Buffer.isBuffer(e)?e.toString("utf8"):String(e),g=Buffer.from(r.replace("whsec_",""),"base64"),x=`${n}.${i}.${l}`,h=hn.default.createHmac("sha256",g).update(x).digest("base64");return c.split(" ").some(z=>{let[_,s]=z.split(",");if(_!=="v1"||!s)return!1;try{return hn.default.timingSafeEqual(Buffer.from(s,"base64"),Buffer.from(h,"base64"))}catch{return!1}})}o(Hm,"verifyResendWebhook");var Wc=Ci({name:"email_bounced",classification:"READ",auth:$,displayName:"Email Event",description:"Triggers when a selected email or contact event occurs in Resend",aiMetadata:{description:"Fires when one of the subscribed Resend events occurs, such as an email being sent, delivered, bounced, opened, clicked, complained about, or failing, as well as domain and contact lifecycle events. The payload carries the event type and the affected email, domain, or contact. Subscribe to the specific event types you care about."},type:"WEBHOOK",props:{events:b.StaticMultiSelectDropdown({displayName:"Events",description:"Select one or more event types to subscribe to",required:!0,options:{options:Vm}})},async onEnable(e){let t=await S.sendRequest({method:"POST",url:`${qc}/webhooks`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},body:{endpoint:e.webhookUrl,events:e.propsValue.events}});await e.store.put(yn,{id:t.body.id,signingSecret:t.body.signing_secret})},async onDisable(e){let t=await e.store.get(yn);t?.id&&await S.sendRequest({method:"DELETE",url:`${qc}/webhooks/${t.id}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})},async run(e){let t=await e.store.get(yn);return Hm({rawBody:e.payload.rawBody,headers:e.payload.headers,signingSecret:t?.signingSecret??""})?[e.payload.body]:[]},sampleData:{type:"email.bounced",created_at:"2024-03-08T09:37:40.912Z",data:{created_at:"2024-03-08T09:37:40.911Z",email_id:"562e3f00-6bad-4910-b1e3-38c2fca1e2ff",from:"onboarding@resend.dev",to:["john@example.com"],subject:"Re: Follow up"}}});var Kc="https://api.resend.com",$=Vr.SecretText({displayName:"API Key",description:`To get your API key:
|
|
4
4
|
1. Log in to your [Resend dashboard](https://resend.com/overview)
|
|
5
5
|
2. Go to **API Keys** in the left sidebar
|
|
6
|
-
3. Click **Create API Key**, give it a name, and copy the key`,required:!0,validate:o(async({auth:e})=>{try{return await
|
|
6
|
+
3. Click **Create API Key**, give it a name, and copy the key`,required:!0,validate:o(async({auth:e})=>{try{return await S.sendRequest({method:"GET",url:`${Kc}/api-keys`,authentication:{type:"BEARER_TOKEN",token:e}}),{valid:!0}}catch(t){if(t instanceof Le){let r=t.response.body;if(typeof r=="object"&&r!==null&&"name"in r&&r.name==="restricted_api_key")return{valid:!0}}return{valid:!1,error:"Invalid API key. Please check your Resend API key."}}},"validate")}),Gm=Li({displayName:"Resend",description:"The email API for developers",auth:$,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/resend.png",categories:["COMMUNICATION"],authors:["Tosh94"],actions:[Sc,Ac,kc,wc,Dc,Nc,$c,zc,Oc,Rc,Cc,Uc,Mc,Lc,jc,Bc,Fc,Zc,Vc,Hc,Gc,nc({baseUrl:o(()=>Kc,"baseUrl"),auth:$,authMapping:o(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],triggers:[Wc]});0&&(module.exports={resend,resendAuth});
|
|
7
7
|
/*! Bundled license information:
|
|
8
8
|
|
|
9
9
|
mime-types/index.js:
|