@activepieces/piece-connections 0.5.8 → 0.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/piece-connections",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "main": "./src/index.js",
5
5
  "dependencies": {},
6
6
  "files": [
package/src/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var To=Object.create;var Ee=Object.defineProperty;var $o=Object.getOwnPropertyDescriptor;var Eo=Object.getOwnPropertyNames;var bo=Object.getPrototypeOf,zo=Object.prototype.hasOwnProperty;var o=(e,t)=>Ee(e,"name",{value:t,configurable:!0});var So=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},er=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},tr=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Eo(t))!zo.call(e,s)&&s!==r&&Ee(e,s,{get:()=>t[s],enumerable:!(i=$o(t,s))||i.enumerable});return e};var Ge=(e,t,r)=>(r=e!=null?To(bo(e)):{},tr(t||!e||!e.__esModule?Ee(r,"default",{value:e,enumerable:!0}):r,e)),Ao=e=>tr(Ee({},"__esModule",{value:!0}),e);var bn=So((En,pt)=>{(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")},i=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),p="%[0-9a-z]{1,}",d="(?:[0-9a-f]+::?)+",m={zoneIndex:new RegExp(p,"i"),native:new RegExp(`^(::)?(${d})?([0-9a-f]+)?(::)?(${p})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${p})?)$`,"i"),transitional:new RegExp(`^((?:${d})|(?:::)(?:${d})?)${t}\\.${t}\\.${t}\\.${t}(${p})?$`,"i")};function v(a,c){if(a.indexOf("::")!==a.lastIndexOf("::"))return null;let g=0,l=-1,y=(a.match(m.zoneIndex)||[])[0],h,M;for(y&&(y=y.substring(1),a=a.replace(/%.+$/,""));(l=a.indexOf(":",l+1))>=0;)g++;if(a.substr(0,2)==="::"&&g--,a.substr(-2,2)==="::"&&g--,g>c)return null;for(M=c-g,h=":";M--;)h+="0:";return a=a.replace("::",h),a[0]===":"&&(a=a.slice(1)),a[a.length-1]===":"&&(a=a.slice(0,-1)),c=(function(){let Yt=a.split(":"),Qt=[];for(let ft=0;ft<Yt.length;ft++)Qt.push(parseInt(Yt[ft],16));return Qt})(),{parts:c,zoneId:y}}o(v,"expandIPv6");function x(a,c,g,l){if(a.length!==c.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let y=0,h;for(;l>0;){if(h=g-l,h<0&&(h=0),a[y]>>h!==c[y]>>h)return!1;l-=g,y+=1}return!0}o(x,"matchCIDR");function I(a){if(s.test(a))return parseInt(a,16);if(a[0]==="0"&&!isNaN(parseInt(a[1],10))){if(i.test(a))return parseInt(a,8);throw new Error(`ipaddr: cannot parse ${a} as octal`)}return parseInt(a,10)}o(I,"parseIntAuto");function N(a,c){for(;a.length<c;)a=`0${a}`;return a}o(N,"padPart");let _={};_.IPv4=(function(){function a(c){if(c.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,l;for(g=0;g<c.length;g++)if(l=c[g],!(0<=l&&l<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=c}return o(a,"IPv4"),a.prototype.SpecialRanges={unspecified:[[new a([0,0,0,0]),8]],broadcast:[[new a([255,255,255,255]),32]],multicast:[[new a([224,0,0,0]),4]],linkLocal:[[new a([169,254,0,0]),16]],loopback:[[new a([127,0,0,0]),8]],carrierGradeNat:[[new a([100,64,0,0]),10]],private:[[new a([10,0,0,0]),8],[new a([172,16,0,0]),12],[new a([192,168,0,0]),16]],reserved:[[new a([192,0,0,0]),24],[new a([192,0,2,0]),24],[new a([192,88,99,0]),24],[new a([198,18,0,0]),15],[new a([198,51,100,0]),24],[new a([203,0,113,0]),24],[new a([240,0,0,0]),4]],as112:[[new a([192,175,48,0]),24],[new a([192,31,196,0]),24]],amt:[[new a([192,52,193,0]),24]]},a.prototype.kind=function(){return"ipv4"},a.prototype.match=function(c,g){let l;if(g===void 0&&(l=c,c=l[0],g=l[1]),c.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return x(this.octets,c.octets,8,g)},a.prototype.prefixLengthFromSubnetMask=function(){let c=0,g=!1,l={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},y,h,M;for(y=3;y>=0;y-=1)if(h=this.octets[y],h in l){if(M=l[h],g&&M!==0)return null;M!==8&&(g=!0),c+=M}else return null;return 32-c},a.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},a.prototype.toByteArray=function(){return this.octets.slice(0)},a.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},a.prototype.toNormalizedString=function(){return this.toString()},a.prototype.toString=function(){return this.octets.join(".")},a})(),_.IPv4.broadcastAddressFromCIDR=function(a){try{let c=this.parseCIDR(a),g=c[0].toByteArray(),l=this.subnetMaskFromPrefixLength(c[1]).toByteArray(),y=[],h=0;for(;h<4;)y.push(parseInt(g[h],10)|parseInt(l[h],10)^255),h++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(a){return this.parser(a)!==null},_.IPv4.isValid=function(a){try{return new this(this.parser(a)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(a){try{return this.parseCIDR(a),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(a){return!!(_.IPv4.isValid(a)&&a.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(a){let c=a.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(a)||!c?!1:_.IPv4.isValidFourPartDecimal(c[1])},_.IPv4.networkAddressFromCIDR=function(a){let c,g,l,y,h;try{for(c=this.parseCIDR(a),l=c[0].toByteArray(),h=this.subnetMaskFromPrefixLength(c[1]).toByteArray(),y=[],g=0;g<4;)y.push(parseInt(l[g],10)&parseInt(h[g],10)),g++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(a){let c=this.parser(a);if(c===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(c)},_.IPv4.parseCIDR=function(a){let c;if(c=a.match(/^(.+)\/(\d+)$/)){let g=parseInt(c[2]);if(g>=0&&g<=32){let l=[this.parse(c[1]),g];return Object.defineProperty(l,"toString",{value:o(function(){return this.join("/")},"value")}),l}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(a){let c,g,l;if(c=a.match(r.fourOctet))return(function(){let y=c.slice(1,6),h=[];for(let M=0;M<y.length;M++)g=y[M],h.push(I(g));return h})();if(c=a.match(r.longValue)){if(l=I(c[1]),l>4294967295||l<0)throw new Error("ipaddr: address outside defined range");return(function(){let y=[],h;for(h=0;h<=24;h+=8)y.push(l>>h&255);return y})().reverse()}else return(c=a.match(r.twoOctet))?(function(){let y=c.slice(1,4),h=[];if(l=I(y[1]),l>16777215||l<0)throw new Error("ipaddr: address outside defined range");return h.push(I(y[0])),h.push(l>>16&255),h.push(l>>8&255),h.push(l&255),h})():(c=a.match(r.threeOctet))?(function(){let y=c.slice(1,5),h=[];if(l=I(y[2]),l>65535||l<0)throw new Error("ipaddr: address outside defined range");return h.push(I(y[0])),h.push(I(y[1])),h.push(l>>8&255),h.push(l&255),h})():null},_.IPv4.subnetMaskFromPrefixLength=function(a){if(a=parseInt(a),a<0||a>32)throw new Error("ipaddr: invalid IPv4 prefix length");let c=[0,0,0,0],g=0,l=Math.floor(a/8);for(;g<l;)c[g]=255,g++;return l<4&&(c[l]=Math.pow(2,a%8)-1<<8-a%8),new this(c)},_.IPv6=(function(){function a(c,g){let l,y;if(c.length===16)for(this.parts=[],l=0;l<=14;l+=2)this.parts.push(c[l]<<8|c[l+1]);else if(c.length===8)this.parts=c;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(l=0;l<this.parts.length;l++)if(y=this.parts[l],!(0<=y&&y<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(a,"IPv6"),a.prototype.SpecialRanges={unspecified:[new a([0,0,0,0,0,0,0,0]),128],linkLocal:[new a([65152,0,0,0,0,0,0,0]),10],multicast:[new a([65280,0,0,0,0,0,0,0]),8],loopback:[new a([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new a([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new a([0,0,0,0,0,65535,0,0]),96],discard:[new a([256,0,0,0,0,0,0,0]),64],rfc6145:[new a([0,0,0,0,65535,0,0,0]),96],rfc6052:[new a([100,65435,0,0,0,0,0,0]),96],"6to4":[new a([8194,0,0,0,0,0,0,0]),16],teredo:[new a([8193,0,0,0,0,0,0,0]),32],benchmarking:[new a([8193,2,0,0,0,0,0,0]),48],amt:[new a([8193,3,0,0,0,0,0,0]),32],as112v6:[[new a([8193,4,274,0,0,0,0,0]),48],[new a([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new a([8193,16,0,0,0,0,0,0]),28],orchid2:[new a([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new a([8193,48,0,0,0,0,0,0]),28],reserved:[[new a([8193,0,0,0,0,0,0,0]),23],[new a([8193,3512,0,0,0,0,0,0]),32]]},a.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},a.prototype.kind=function(){return"ipv6"},a.prototype.match=function(c,g){let l;if(g===void 0&&(l=c,c=l[0],g=l[1]),c.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return x(this.parts,c.parts,16,g)},a.prototype.prefixLengthFromSubnetMask=function(){let c=0,g=!1,l={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},y,h;for(let M=7;M>=0;M-=1)if(y=this.parts[M],y in l){if(h=l[y],g&&h!==0)return null;h!==16&&(g=!0),c+=h}else return null;return 128-c},a.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},a.prototype.toByteArray=function(){let c,g=[],l=this.parts;for(let y=0;y<l.length;y++)c=l[y],g.push(c>>8),g.push(c&255);return g},a.prototype.toFixedLengthString=function(){let c=(function(){let l=[];for(let y=0;y<this.parts.length;y++)l.push(N(this.parts[y].toString(16),4));return l}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),c+g},a.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let c=this.parts.slice(-2),g=c[0],l=c[1];return new _.IPv4([g>>8,g&255,l>>8,l&255])},a.prototype.toNormalizedString=function(){let c=(function(){let l=[];for(let y=0;y<this.parts.length;y++)l.push(this.parts[y].toString(16));return l}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),c+g},a.prototype.toRFC5952String=function(){let c=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),l=0,y=-1,h;for(;h=c.exec(g);)h[0].length>y&&(l=h.index,y=h[0].length);return y<0?g:`${g.substring(0,l)}::${g.substring(l+y)}`},a.prototype.toString=function(){return this.toRFC5952String()},a})(),_.IPv6.broadcastAddressFromCIDR=function(a){try{let c=this.parseCIDR(a),g=c[0].toByteArray(),l=this.subnetMaskFromPrefixLength(c[1]).toByteArray(),y=[],h=0;for(;h<16;)y.push(parseInt(g[h],10)|parseInt(l[h],10)^255),h++;return new this(y)}catch(c){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${c})`)}},_.IPv6.isIPv6=function(a){return this.parser(a)!==null},_.IPv6.isValid=function(a){if(typeof a=="string"&&a.indexOf(":")===-1)return!1;try{let c=this.parser(a);return new this(c.parts,c.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(a){if(typeof a=="string"&&a.indexOf(":")===-1)return!1;try{return this.parseCIDR(a),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(a){let c,g,l,y,h;try{for(c=this.parseCIDR(a),l=c[0].toByteArray(),h=this.subnetMaskFromPrefixLength(c[1]).toByteArray(),y=[],g=0;g<16;)y.push(parseInt(l[g],10)&parseInt(h[g],10)),g++;return new this(y)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},_.IPv6.parse=function(a){let c=this.parser(a);if(c.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(c.parts,c.zoneId)},_.IPv6.parseCIDR=function(a){let c,g,l;if((g=a.match(/^(.+)\/(\d+)$/))&&(c=parseInt(g[2]),c>=0&&c<=128))return l=[this.parse(g[1]),c],Object.defineProperty(l,"toString",{value:o(function(){return this.join("/")},"value")}),l;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(a){let c,g,l,y,h,M;if(l=a.match(m.deprecatedTransitional))return this.parser(`::ffff:${l[1]}`);if(m.native.test(a))return v(a,8);if((l=a.match(m.transitional))&&(M=l[6]||"",c=l[1],l[1].endsWith("::")||(c=c.slice(0,-1)),c=v(c+M,6),c.parts)){for(h=[parseInt(l[2]),parseInt(l[3]),parseInt(l[4]),parseInt(l[5])],g=0;g<h.length;g++)if(y=h[g],!(0<=y&&y<=255))return null;return c.parts.push(h[0]<<8|h[1]),c.parts.push(h[2]<<8|h[3]),{parts:c.parts,zoneId:c.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(a){if(a=parseInt(a),a<0||a>128)throw new Error("ipaddr: invalid IPv6 prefix length");let c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,l=Math.floor(a/8);for(;g<l;)c[g]=255,g++;return l<16&&(c[l]=Math.pow(2,a%8)-1<<8-a%8),new this(c)},_.fromByteArray=function(a){let c=a.length;if(c===4)return new _.IPv4(a);if(c===16)return new _.IPv6(a);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(a){return _.IPv6.isValid(a)||_.IPv4.isValid(a)},_.isValidCIDR=function(a){return _.IPv6.isValidCIDR(a)||_.IPv4.isValidCIDR(a)},_.parse=function(a){if(_.IPv6.isValid(a))return _.IPv6.parse(a);if(_.IPv4.isValid(a))return _.IPv4.parse(a);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(a){try{return _.IPv6.parseCIDR(a)}catch{try{return _.IPv4.parseCIDR(a)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(a){let c=this.parse(a);return c.kind()==="ipv6"&&c.isIPv4MappedAddress()?c.toIPv4Address():c},_.subnetMatch=function(a,c,g){let l,y,h,M;g==null&&(g="unicast");for(y in c)if(Object.prototype.hasOwnProperty.call(c,y)){for(h=c[y],h[0]&&!(h[0]instanceof Array)&&(h=[h]),l=0;l<h.length;l++)if(M=h[l],a.kind()===M[0].kind()&&a.match.apply(a,M))return y}return g},typeof pt<"u"&&pt.exports?pt.exports=_:e.ipaddr=_})(En)});var ss={};er(ss,{connections:()=>as});module.exports=Ao(ss);var Oo=Object.freeze({status:"aborted"});function P(e,t,r){function i(m,v){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:v,constr:d,traits:new Set},enumerable:!1}),m._zod.traits.has(e))return;m._zod.traits.add(e),t(m,v);let x=d.prototype,I=Object.keys(x);for(let N=0;N<I.length;N++){let _=I[N];_ in m||(m[_]=x[_].bind(m))}}o(i,"init");let s=r?.Parent??Object;class p extends s{static{o(this,"Definition")}}Object.defineProperty(p,"name",{value:e});function d(m){var v;let x=r?.Parent?new p:this;i(x,m),(v=x._zod).deferred??(v.deferred=[]);for(let I of x._zod.deferred)I();return x}return o(d,"_"),Object.defineProperty(d,"init",{value:i}),Object.defineProperty(d,Symbol.hasInstance,{value:o(m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(e),"value")}),Object.defineProperty(d,"name",{value:e}),d}o(P,"$constructor");var X=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},We=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},gt={};function ee(e){return e&&Object.assign(gt,e),gt}o(ee,"config");function ht(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,s])=>t.indexOf(+i)===-1).map(([i,s])=>s)}o(ht,"getEnumValues");function nr(e,t){return typeof t=="bigint"?t.toString():t}o(nr,"jsonStringifyReplacer");function Ke(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Ke,"cached");function or(e){return e==null}o(or,"nullish");function Je(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Je,"cleanRegex");var rr=Symbol("evaluating");function V(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==rr)return i===void 0&&(i=rr,i=r()),i},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}o(V,"defineLazy");var vt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function be(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(be,"isObject");var ko=Ke(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function ir(e){if(be(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(be(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(ir,"isPlainObject");var ar=new Set(["string","number","symbol"]);function ve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(ve,"escapeRegex");function Xe(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}o(Xe,"clone");function L(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(L,"normalizeParams");function sr(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(sr,"optionalKeys");var ur={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 xe(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(xe,"aborted");function ae(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}o(ae,"prefixIssues");function He(e){return typeof e=="string"?e:e?.message}o(He,"unwrapMessage");function se(e,t,r){let i={...e,path:e.path??[]};if(!e.message){let s=He(e.inst?._zod.def?.error?.(e))??He(t?.error?.(e))??He(r.customError?.(e))??He(r.localeError?.(e))??"Invalid input";i.message=s}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}o(se,"finalizeIssue");function cr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(cr,"getLengthableOrigin");function xt(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}o(xt,"issue");var lr=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,nr,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),pr=P("$ZodError",lr),ze=P("$ZodError",lr,{Parent:Error});var wo=o(e=>(t,r,i,s)=>{let p=i?Object.assign(i,{async:!1}):{async:!1},d=t._zod.run({value:r,issues:[]},p);if(d instanceof Promise)throw new X;if(d.issues.length){let m=new(s?.Err??e)(d.issues.map(v=>se(v,p,ee())));throw vt(m,s?.callee),m}return d.value},"_parse"),qe=wo(ze),Do=o(e=>async(t,r,i,s)=>{let p=i?Object.assign(i,{async:!0}):{async:!0},d=t._zod.run({value:r,issues:[]},p);if(d instanceof Promise&&(d=await d),d.issues.length){let m=new(s?.Err??e)(d.issues.map(v=>se(v,p,ee())));throw vt(m,s?.callee),m}return d.value},"_parseAsync"),Ye=Do(ze),No=o(e=>(t,r,i)=>{let s=i?{...i,async:!1}:{async:!1},p=t._zod.run({value:r,issues:[]},s);if(p instanceof Promise)throw new X;return p.issues.length?{success:!1,error:new(e??pr)(p.issues.map(d=>se(d,s,ee())))}:{success:!0,data:p.value}},"_safeParse"),Se=No(ze),Co=o(e=>async(t,r,i)=>{let s=i?Object.assign(i,{async:!0}):{async:!0},p=t._zod.run({value:r,issues:[]},s);return p instanceof Promise&&(p=await p),p.issues.length?{success:!1,error:new e(p.issues.map(d=>se(d,s,ee())))}:{success:!0,data:p.value}},"_safeParseAsync"),Ae=Co(ze);var Uo="(?:(?:\\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])))",Mo=new RegExp(`^${Uo}$`);var dr=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),mr=/^-?\d+n?$/,fr=/^-?\d+$/,_t=/^-?\d+(?:\.\d+)?$/,gr=/^(?:true|false)$/i;var ue=P("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Lo={number:"number",bigint:"bigint",object:"date"};var yr=P("$ZodCheckGreaterThan",(e,t)=>{ue.init(e,t);let r=Lo[typeof t.value];e._zod.onattach.push(i=>{let s=i._zod.bag,p=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>p&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var hr=P("$ZodCheckNumberFormat",(e,t)=>{ue.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[s,p]=ur[t.format];e._zod.onattach.push(d=>{let m=d._zod.bag;m.format=t.format,m.minimum=s,m.maximum=p,r&&(m.pattern=fr)}),e._zod.check=d=>{let m=d.value;if(r){if(!Number.isInteger(m)){d.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?d.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):d.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}m<s&&d.issues.push({origin:"number",input:m,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),m>p&&d.issues.push({origin:"number",input:m,code:"too_big",maximum:p,inclusive:!0,inst:e,continue:!t.abort})}});var vr=P("$ZodCheckMinLength",(e,t)=>{var r;ue.init(e,t),(r=e._zod.def).when??(r.when=i=>{let s=i.value;return!or(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{let s=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let s=i.value;if(s.length>=t.minimum)return;let d=cr(s);i.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}});var Pt=P("$ZodCheckStringFormat",(e,t)=>{var r,i;ue.init(e,t),e._zod.onattach.push(s=>{let p=s._zod.bag;p.format=t.format,t.pattern&&(p.patterns??(p.patterns=new Set),p.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),xr=P("$ZodCheckRegex",(e,t)=>{Pt.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 Pr={major:4,minor:3,patch:6};var Z=P("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Pr;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let s of i)for(let p of s._zod.onattach)p(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=o((d,m,v)=>{let x=xe(d),I;for(let N of m){if(N._zod.def.when){if(!N._zod.def.when(d))continue}else if(x)continue;let _=d.issues.length,a=N._zod.check(d);if(a instanceof Promise&&v?.async===!1)throw new X;if(I||a instanceof Promise)I=(I??Promise.resolve()).then(async()=>{await a,d.issues.length!==_&&(x||(x=xe(d,_)))});else{if(d.issues.length===_)continue;x||(x=xe(d,_))}}return I?I.then(()=>d):d},"runChecks"),p=o((d,m,v)=>{if(xe(d))return d.aborted=!0,d;let x=s(m,i,v);if(x instanceof Promise){if(v.async===!1)throw new X;return x.then(I=>e._zod.parse(I,v))}return e._zod.parse(x,v)},"handleCanaryResult");e._zod.run=(d,m)=>{if(m.skipChecks)return e._zod.parse(d,m);if(m.direction==="backward"){let x=e._zod.parse({value:d.value,issues:[]},{...m,skipChecks:!0});return x instanceof Promise?x.then(I=>p(I,d,m)):p(x,d,m)}let v=e._zod.parse(d,m);if(v instanceof Promise){if(m.async===!1)throw new X;return v.then(x=>s(x,i,m))}return s(v,i,m)}}V(e,"~standard",()=>({validate:o(s=>{try{let p=Se(e,s);return p.success?{value:p.data}:{issues:p.error?.issues}}catch{return Ae(e,s).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},"validate"),vendor:"zod",version:1}))}),tt=P("$ZodString",(e,t)=>{Z.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??dr(e._zod.bag),e._zod.parse=(r,i)=>{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}}),It=P("$ZodStringFormat",(e,t)=>{Pt.init(e,t),tt.init(e,t)});var br=P("$ZodURL",(e,t)=>{It.init(e,t),e._zod.check=r=>{try{let i=r.value.trim(),s=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.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(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.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=s.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Tt=P("$ZodNumber",(e,t)=>{Z.init(e,t),e._zod.pattern=e._zod.bag.pattern??_t,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let s=r.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return r;let p=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...p?{received:p}:{}}),r}}),zr=P("$ZodNumberFormat",(e,t)=>{hr.init(e,t),Tt.init(e,t)}),$t=P("$ZodBoolean",(e,t)=>{Z.init(e,t),e._zod.pattern=gr,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let s=r.value;return typeof s=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),Sr=P("$ZodBigInt",(e,t)=>{Z.init(e,t),e._zod.pattern=mr,e._zod.parse=(r,i)=>{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 Ar=P("$ZodAny",(e,t)=>{Z.init(e,t),e._zod.parse=r=>r}),Or=P("$ZodUnknown",(e,t)=>{Z.init(e,t),e._zod.parse=r=>r});var kr=P("$ZodVoid",(e,t)=>{Z.init(e,t),e._zod.parse=(r,i)=>{let s=r.value;return typeof s>"u"||r.issues.push({expected:"void",code:"invalid_type",input:s,inst:e}),r}}),Rr=P("$ZodDate",(e,t)=>{Z.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let s=r.value,p=s instanceof Date;return p&&!Number.isNaN(s.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:s,...p?{received:"Invalid Date"}:{},inst:e}),r}});function Ir(e,t,r){e.issues.length&&t.issues.push(...ae(r,e.issues)),t.value[r]=e.value}o(Ir,"handleArrayResult");var wr=P("$ZodArray",(e,t)=>{Z.init(e,t),e._zod.parse=(r,i)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);let p=[];for(let d=0;d<s.length;d++){let m=s[d],v=t.element._zod.run({value:m,issues:[]},i);v instanceof Promise?p.push(v.then(x=>Ir(x,r,d))):Ir(v,r,d)}return p.length?Promise.all(p).then(()=>r):r}});function et(e,t,r,i,s){if(e.issues.length){if(s&&!(r in i))return;t.issues.push(...ae(r,e.issues))}e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}o(et,"handlePropertyResult");function jo(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=sr(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(jo,"normalizeDef");function Zo(e,t,r,i,s,p){let d=[],m=s.keySet,v=s.catchall._zod,x=v.def.type,I=v.optout==="optional";for(let N in t){if(m.has(N))continue;if(x==="never"){d.push(N);continue}let _=v.run({value:t[N],issues:[]},i);_ instanceof Promise?e.push(_.then(a=>et(a,r,N,t,I))):et(_,r,N,t,I)}return d.length&&r.issues.push({code:"unrecognized_keys",keys:d,input:t,inst:p}),e.length?Promise.all(e).then(()=>r):r}o(Zo,"handleCatchall");var Dr=P("$ZodObject",(e,t)=>{if(Z.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let m=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let v={...m};return Object.defineProperty(t,"shape",{value:v}),v},"get")})}let i=Ke(()=>jo(t));V(e._zod,"propValues",()=>{let m=t.shape,v={};for(let x in m){let I=m[x]._zod;if(I.values){v[x]??(v[x]=new Set);for(let N of I.values)v[x].add(N)}}return v});let s=be,p=t.catchall,d;e._zod.parse=(m,v)=>{d??(d=i.value);let x=m.value;if(!s(x))return m.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),m;m.value={};let I=[],N=d.shape;for(let _ of d.keys){let a=N[_],c=a._zod.optout==="optional",g=a._zod.run({value:x[_],issues:[]},v);g instanceof Promise?I.push(g.then(l=>et(l,m,_,x,c))):et(g,m,_,x,c)}return p?Zo(I,x,m,v,i.value,e):I.length?Promise.all(I).then(()=>m):m}});function Tr(e,t,r,i){for(let p of e)if(p.issues.length===0)return t.value=p.value,t;let s=e.filter(p=>!xe(p));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(p=>p.issues.map(d=>se(d,i,ee())))}),t)}o(Tr,"handleUnionResults");var Et=P("$ZodUnion",(e,t)=>{Z.init(e,t),V(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){let s=t.options.map(p=>p._zod.pattern);return new RegExp(`^(${s.map(p=>Je(p.source)).join("|")})$`)}});let r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(s,p)=>{if(r)return i(s,p);let d=!1,m=[];for(let v of t.options){let x=v._zod.run({value:s.value,issues:[]},p);if(x instanceof Promise)m.push(x),d=!0;else{if(x.issues.length===0)return x;m.push(x)}}return d?Promise.all(m).then(v=>Tr(v,s,e,p)):Tr(m,s,e,p)}});var Nr=P("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Et.init(e,t);let r=e._zod.parse;V(e._zod,"propValues",()=>{let s={};for(let p of t.options){let d=p._zod.propValues;if(!d||Object.keys(d).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(p)}"`);for(let[m,v]of Object.entries(d)){s[m]||(s[m]=new Set);for(let x of v)s[m].add(x)}}return s});let i=Ke(()=>{let s=t.options,p=new Map;for(let d of s){let m=d._zod.propValues?.[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(d)}"`);for(let v of m){if(p.has(v))throw new Error(`Duplicate discriminator value "${String(v)}"`);p.set(v,d)}}return p});e._zod.parse=(s,p)=>{let d=s.value;if(!be(d))return s.issues.push({code:"invalid_type",expected:"object",input:d,inst:e}),s;let m=i.value.get(d?.[t.discriminator]);return m?m._zod.run(s,p):t.unionFallback?r(s,p):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:d,path:[t.discriminator],inst:e}),s)}});var Cr=P("$ZodRecord",(e,t)=>{Z.init(e,t),e._zod.parse=(r,i)=>{let s=r.value;if(!ir(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;let p=[],d=t.keyType._zod.values;if(d){r.value={};let m=new Set;for(let x of d)if(typeof x=="string"||typeof x=="number"||typeof x=="symbol"){m.add(typeof x=="number"?x.toString():x);let I=t.valueType._zod.run({value:s[x],issues:[]},i);I instanceof Promise?p.push(I.then(N=>{N.issues.length&&r.issues.push(...ae(x,N.issues)),r.value[x]=N.value})):(I.issues.length&&r.issues.push(...ae(x,I.issues)),r.value[x]=I.value)}let v;for(let x in s)m.has(x)||(v=v??[],v.push(x));v&&v.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:v})}else{r.value={};for(let m of Reflect.ownKeys(s)){if(m==="__proto__")continue;let v=t.keyType._zod.run({value:m,issues:[]},i);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&_t.test(m)&&v.issues.length){let N=t.keyType._zod.run({value:Number(m),issues:[]},i);if(N instanceof Promise)throw new Error("Async schemas not supported in object keys currently");N.issues.length===0&&(v=N)}if(v.issues.length){t.mode==="loose"?r.value[m]=s[m]:r.issues.push({code:"invalid_key",origin:"record",issues:v.issues.map(N=>se(N,i,ee())),input:m,path:[m],inst:e});continue}let I=t.valueType._zod.run({value:s[m],issues:[]},i);I instanceof Promise?p.push(I.then(N=>{N.issues.length&&r.issues.push(...ae(m,N.issues)),r.value[v.value]=N.value})):(I.issues.length&&r.issues.push(...ae(m,I.issues)),r.value[v.value]=I.value)}}return p.length?Promise.all(p).then(()=>r):r}});var Ur=P("$ZodEnum",(e,t)=>{Z.init(e,t);let r=ht(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(s=>ar.has(typeof s)).map(s=>typeof s=="string"?ve(s):s.toString()).join("|")})$`),e._zod.parse=(s,p)=>{let d=s.value;return i.has(d)||s.issues.push({code:"invalid_value",values:r,input:d,inst:e}),s}}),Mr=P("$ZodLiteral",(e,t)=>{if(Z.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(i=>typeof i=="string"?ve(i):i?ve(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,s)=>{let p=i.value;return r.has(p)||i.issues.push({code:"invalid_value",values:t.values,input:p,inst:e}),i}});var Lr=P("$ZodTransform",(e,t)=>{Z.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new We(e.constructor.name);let s=t.transform(r.value,r);if(i.async)return(s instanceof Promise?s:Promise.resolve(s)).then(d=>(r.value=d,r));if(s instanceof Promise)throw new X;return r.value=s,r}});function $r(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o($r,"handleOptionalResult");var jr=P("$ZodOptional",(e,t)=>{Z.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Je(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let s=t.innerType._zod.run(r,i);return s instanceof Promise?s.then(p=>$r(p,r.value)):$r(s,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,i)}});var Zr=P("$ZodNullable",(e,t)=>{Z.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Je(r.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)});var Fr=P("$ZodPipe",(e,t)=>{Z.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let p=t.out._zod.run(r,i);return p instanceof Promise?p.then(d=>Qe(d,t.in,i)):Qe(p,t.in,i)}let s=t.in._zod.run(r,i);return s instanceof Promise?s.then(p=>Qe(p,t.out,i)):Qe(s,t.out,i)}});function Qe(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Qe,"handlePipeResult");var Vr=P("$ZodCustom",(e,t)=>{ue.init(e,t),Z.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,s=t.fn(i);if(s instanceof Promise)return s.then(p=>Er(p,r,i,e));Er(s,r,i,e)}});function Er(e,t,r,i){if(!e){let s={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(s.params=i._zod.def.params),t.issues.push(xt(s))}}o(Er,"handleRefineResult");var Gr;var bt=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.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 i={...this.get(r)??{}};delete i.id;let s={...i,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Wr(){return new bt}o(Wr,"registry");(Gr=globalThis).__zod_globalRegistry??(Gr.__zod_globalRegistry=Wr());var zt=globalThis.__zod_globalRegistry;function Hr(e,t){return new e({type:"string",...L(t)})}o(Hr,"_string");function Kr(e,t){return new e({type:"string",coerce:!0,...L(t)})}o(Kr,"_coercedString");function Jr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...L(t)})}o(Jr,"_url");function Xr(e,t){return new e({type:"number",checks:[],...L(t)})}o(Xr,"_number");function qr(e,t){return new e({type:"number",coerce:!0,checks:[],...L(t)})}o(qr,"_coercedNumber");function Yr(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...L(t)})}o(Yr,"_int");function Qr(e,t){return new e({type:"boolean",...L(t)})}o(Qr,"_boolean");function en(e,t){return new e({type:"boolean",coerce:!0,...L(t)})}o(en,"_coercedBoolean");function tn(e,t){return new e({type:"bigint",coerce:!0,...L(t)})}o(tn,"_coercedBigint");function rn(e){return new e({type:"any"})}o(rn,"_any");function nn(e){return new e({type:"unknown"})}o(nn,"_unknown");function on(e,t){return new e({type:"void",...L(t)})}o(on,"_void");function an(e,t){return new e({type:"date",coerce:!0,...L(t)})}o(an,"_coercedDate");function rt(e,t){return new yr({check:"greater_than",...L(t),value:e,inclusive:!0})}o(rt,"_gte");function J(e,t){return new vr({check:"min_length",...L(t),minimum:e})}o(J,"_minLength");function ce(e,t){return new xr({check:"string_format",format:"regex",...L(t),pattern:e})}o(ce,"_regex");function sn(e,t,r){let i=L(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}o(sn,"_custom");var B=P("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");Z.init(e,t),e.def=t,e.type=t.type,e.parse=(r,i)=>qe(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Se(e,r,i),e.parseAsync=async(r,i)=>Ye(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Ae(e,r,i),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),e.with=e.check,e.clone=(r,i)=>Xe(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.apply=r=>r(e)}),ot=P("ZodMiniString",(e,t)=>{tt.init(e,t),B.init(e,t)});function n(e){return Hr(ot,e)}o(n,"string");var un=P("ZodMiniStringFormat",(e,t)=>{It.init(e,t),ot.init(e,t)});var ei=P("ZodMiniURL",(e,t)=>{br.init(e,t),un.init(e,t)});function cn(e){return Jr(ei,e)}o(cn,"url");var it=P("ZodMiniNumber",(e,t)=>{Tt.init(e,t),B.init(e,t)});function G(e){return Xr(it,e)}o(G,"number");var ti=P("ZodMiniNumberFormat",(e,t)=>{zr.init(e,t),it.init(e,t)});function ln(e){return Yr(ti,e)}o(ln,"int");var St=P("ZodMiniBoolean",(e,t)=>{$t.init(e,t),B.init(e,t)});function U(e){return Qr(St,e)}o(U,"boolean");var pn=P("ZodMiniBigInt",(e,t)=>{Sr.init(e,t),B.init(e,t)});var ri=P("ZodMiniAny",(e,t)=>{Ar.init(e,t),B.init(e,t)});function ke(){return rn(ri)}o(ke,"any");var ni=P("ZodMiniUnknown",(e,t)=>{Or.init(e,t),B.init(e,t)});function S(){return nn(ni)}o(S,"unknown");var oi=P("ZodMiniVoid",(e,t)=>{kr.init(e,t),B.init(e,t)});function dn(e){return on(oi,e)}o(dn,"_void");var mn=P("ZodMiniDate",(e,t)=>{Rr.init(e,t),B.init(e,t)});var ii=P("ZodMiniArray",(e,t)=>{wr.init(e,t),B.init(e,t)});function k(e,t){return new ii({type:"array",element:e,...L(t)})}o(k,"array");var ai=P("ZodMiniObject",(e,t)=>{Dr.init(e,t),B.init(e,t),V(e,"shape",()=>t.shape)});function u(e,t){let r={type:"object",shape:e??{},...L(t)};return new ai(r)}o(u,"object");var si=P("ZodMiniUnion",(e,t)=>{Et.init(e,t),B.init(e,t)});function R(e,t){return new si({type:"union",options:e,...L(t)})}o(R,"union");var ui=P("ZodMiniDiscriminatedUnion",(e,t)=>{Nr.init(e,t),B.init(e,t)});function le(e,t,r){return new ui({type:"union",options:t,discriminator:e,...L(r)})}o(le,"discriminatedUnion");var ci=P("ZodMiniRecord",(e,t)=>{Cr.init(e,t),B.init(e,t)});function A(e,t,r){return new ci({type:"record",keyType:e,valueType:t,...L(r)})}o(A,"record");var li=P("ZodMiniEnum",(e,t)=>{Ur.init(e,t),B.init(e,t),e.options=Object.values(t.entries)});function D(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new li({type:"enum",entries:r,...L(t)})}o(D,"_enum");var pi=P("ZodMiniLiteral",(e,t)=>{Mr.init(e,t),B.init(e,t)});function $(e,t){return new pi({type:"literal",values:Array.isArray(e)?e:[e],...L(t)})}o($,"literal");var di=P("ZodMiniTransform",(e,t)=>{Lr.init(e,t),B.init(e,t)});function pe(e){return new di({type:"transform",transform:e})}o(pe,"transform");var mi=P("ZodMiniOptional",(e,t)=>{jr.init(e,t),B.init(e,t)});function f(e){return new mi({type:"optional",innerType:e})}o(f,"optional");var fi=P("ZodMiniNullable",(e,t)=>{Zr.init(e,t),B.init(e,t)});function Re(e){return new fi({type:"nullable",innerType:e})}o(Re,"nullable");var gi=P("ZodMiniPipe",(e,t)=>{Fr.init(e,t),B.init(e,t)});function de(e,t){return new gi({type:"pipe",in:e,out:t})}o(de,"pipe");var yi=P("ZodMiniCustom",(e,t)=>{Vr.init(e,t),B.init(e,t)});function at(e,t){return sn(yi,e??(()=>!0),t)}o(at,"custom");var we={};er(we,{bigint:()=>Ii,boolean:()=>Pi,date:()=>Ti,number:()=>_i,string:()=>xi});function xi(e){return Kr(ot,e)}o(xi,"string");function _i(e){return qr(it,e)}o(_i,"number");function Pi(e){return en(St,e)}o(Pi,"boolean");function Ii(e){return tn(pn,e)}o(Ii,"bigint");function Ti(e){return an(mn,e)}o(Ti,"date");var Ot=u({retryOnFailure:u({defaultValue:f(U()),hide:f(U())}),continueOnFailure:u({defaultValue:f(U()),hide:f(U())})}),At=class{constructor(t,r,i,s,p,d,m,v,x,I,N){this.name=t;this.displayName=r;this.description=i;this.props=s;this.run=p;this.test=d;this.requireAuth=m;this.errorHandlingOptions=v;this.outputSchema=x;this.audience=I;this.aiMetadata=N}static{o(this,"IAction")}},gn=o(e=>new At(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var C=u({displayName:n(),description:f(n())}),w=o((e,t)=>u({type:$(t),required:U(),defaultValue:f(ke())}),"TPropertyValue");var W=u({...C.shape,...w(n(),"SHORT_TEXT").shape}),te=u({...C.shape,...w(n(),"LONG_TEXT").shape});var yn=u({label:n(),value:S()}),st=u({disabled:f(U()),placeholder:f(n()),options:k(yn)});var H=u({...C.shape,options:st,...w(S(),"STATIC_DROPDOWN").shape}),re=u({...C.shape,options:st,...w(k(S()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var kt=u({...C.shape,...w(S(),"DROPDOWN").shape,refreshers:k(n())}),De=u({...C.shape,...w(k(S()),"MULTI_SELECT_DROPDOWN").shape,refreshers:k(n())});var ne=u({...C.shape,...w(U(),"CHECKBOX").shape});var oe=u({...C.shape,...w(G(),"NUMBER").shape});var Ne=u({...C.shape,streaming:f(U()),...w(S(),"FILE").shape});var Ce=u({...C.shape,...w(n(),"DATE_TIME").shape});var hn=A(n(),R([W,te,H,De,re,ne,oe,Ne,Ce])),Ue=u({...C.shape,properties:hn,...w(k(S()),"ARRAY").shape});var Me=u({...C.shape,...w(R([A(n(),S())]),"JSON").shape});var vn=R([W,H,Me,Ue,re]),Ei=A(n(),vn),Rt=u({refreshers:k(n()),...C.shape,...w(S(),"DYNAMIC").shape});var ut=u({...C.shape,...w(dn(),"MARKDOWN").shape});var Le=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Le||{}),_e=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(_e||{}),Pe=(y=>(y.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",y.COMMUNICATION="COMMUNICATION",y.COMMERCE="COMMERCE",y.CORE="CORE",y.UNIVERSAL_AI="UNIVERSAL_AI",y.FLOW_CONTROL="FLOW_CONTROL",y.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",y.ACCOUNTING="ACCOUNTING",y.PRODUCTIVITY="PRODUCTIVITY",y.CONTENT_AND_FILES="CONTENT_AND_FILES",y.DEVELOPER_TOOLS="DEVELOPER_TOOLS",y.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",y.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",y.HUMAN_RESOURCES="HUMAN_RESOURCES",y.PAYMENT_PROCESSING="PAYMENT_PROCESSING",y.MARKETING="MARKETING",y.SALES_AND_CRM="SALES_AND_CRM",y))(Pe||{});var je=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(je||{}),wt="both_client_credentials_and_authorization_code";var fe=(s=>(s.POLLING="POLLING",s.WEBHOOK="WEBHOOK",s.APP_WEBHOOK="APP_WEBHOOK",s.MANUAL="MANUAL",s))(fe||{}),Ze=(p=>(p.NONE="NONE",p.HEADER_PRESENT="HEADER_PRESENT",p.QUERY_PRESENT="QUERY_PRESENT",p.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",p.HEAD_REQUEST="HEAD_REQUEST",p))(Ze||{}),bi=u({strategy:D(Ze),paramName:f(n())}),Fe=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Fe||{});var ct=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(ct||{}),xn=u({status:f(G()),body:f(S()),headers:f(A(n(),n()))}),_n=u({type:$("DELAY"),resumeDateTime:n(),requestIdToReply:f(n()),handlerId:f(n()),streamStepProgress:f(D(ct))}),Pn=u({type:$("WEBHOOK"),requestId:n(),requestIdToReply:f(n()),response:xn,handlerId:f(n()),streamStepProgress:f(D(ct))}),zi=R([_n,Pn]);var Si=u({body:S(),rawBody:f(S()),headers:A(n(),n()),queryParams:A(n(),n())});function q(e){return e==null}o(q,"isNil");var Dt=Ge(require("crypto"),1);var Ai=128,ge,Ie,Oi=o(e=>{!ge||ge.length<e?(ge=Buffer.allocUnsafe(e*Ai),Dt.default.randomFillSync(ge),Ie=0):Ie+e>ge.length&&(Dt.default.randomFillSync(ge),Ie=0),Ie+=e},"fillPool"),ki=o(e=>(Oi(e|=0),ge.subarray(Ie-e,Ie)),"random"),Ri=o((e,t,r)=>{let i=(2<<31-Math.clz32(e.length-1|1))-1,s=Math.ceil(1.6*i*t/e.length);return(p=t)=>{let d="";for(;;){let m=r(s),v=s;for(;v--;)if(d+=e[m[v]&i]||"",d.length===p)return d}}},"customRandom"),Tn=o((e,t=21)=>Ri(e,t,ki),"customAlphabet");var wi="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",$n=21,Fy=n().check(ce(new RegExp(`^[0-9a-zA-Z]{${$n}}$`))),Di=Tn(wi,$n);var me=de(pe(e=>e instanceof Date?e.toISOString():e),n()),K={id:n(),created:me,updated:me},j=o(e=>f(Re(e)),"Nullable");function Nt(e){return f(Re(D(e)))}o(Nt,"NullableEnum");var Gy=de(pe(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),f(U())),lt=o(e=>de(pe(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),f(k(e))),"OptionalArrayFromQuery");var Ky=A(n(),S());var Ve=(I=>(I.OPENAI="openai",I.OPENROUTER="openrouter",I.ANTHROPIC="anthropic",I.AZURE="azure",I.GOOGLE="google",I.ACTIVEPIECES="activepieces",I.CLOUDFLARE_GATEWAY="cloudflare-gateway",I.CUSTOM="custom",I.BEDROCK="bedrock",I.MISTRAL="mistral",I))(Ve||{});var ah=n().check(ce(/^#[0-9A-Fa-f]{6}$/));var uh=u({filename:n(),data:S(),type:$("file"),mimetype:f(n())});var Ni=Ge(bn());var gh=u({...K,name:n(),permissions:k(n()),platformId:j(n()),type:n(),userCount:f(G())});var zn=(i=>(i.AGENT_DECIDE="agent-decide",i.CHOOSE_YOURSELF="choose-yourself",i.LEAVE_EMPTY="leave-empty",i))(zn||{}),Ct=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ct||{}),Ut=(i=>(i.SSE="sse",i.STREAMABLE_HTTP="streamable-http",i.SIMPLE_HTTP="http",i))(Ut||{});var Mt=(i=>(i.TEXT="text",i.NUMBER="number",i.BOOLEAN="boolean",i))(Mt||{});var Lt=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Lt||{});var Ci=u({mode:D(zn),value:S()}),Ui=u({auth:f(n()),fields:A(n(),Ci)}),Mi=u({pieceName:n(),pieceVersion:n(),actionName:n(),predefinedInput:f(Ui)}),Li=u({type:$("PIECE"),toolName:n().check(J(1)),pieceMetadata:Mi}),ji=u({type:$("none")}),Zi=u({type:$("access_token"),accessToken:n()}),Fi=u({type:$("api_key"),apiKey:n(),apiKeyHeader:n()}),Vi=u({type:$("headers"),headers:A(n(),n())}),Bi=le("type",[ji,Zi,Fi,Vi]),Sn=u({type:$("FLOW"),toolName:n().check(J(1)),externalFlowId:n(),flowDisplayName:f(n())}),An=u({type:$("MCP"),toolName:n().check(J(1)),serverUrl:cn(),protocol:D(Ut),auth:Bi}),On=u({type:$("KNOWLEDGE_BASE"),toolName:n().check(J(1)),sourceType:D(Ct),sourceId:n(),sourceName:n()}),Gi=le("type",[Li,Sn,An,On]),Wi=u({displayName:n(),description:f(n()),type:D(Mt)}),kn=u({type:$("MARKDOWN"),markdown:n()}),Te={type:$("TOOL_CALL"),input:j(A(n(),S())),output:f(S()),toolName:n(),status:D(Lt),toolCallId:n(),startTime:n(),endTime:f(n())},Wh=u(Te),Rn=le("toolCallType",[u({...Te,toolCallType:$("PIECE"),pieceName:n(),pieceVersion:n(),actionName:n()}),u({...Te,toolCallType:$("FLOW"),displayName:n(),externalFlowId:n()}),u({...Te,toolCallType:$("MCP"),displayName:n(),serverUrl:n()}),u({...Te,toolCallType:$("KNOWLEDGE_BASE"),displayName:n(),sourceType:n()}),u({...Te,toolCallType:$("UNKNOWN"),displayName:n()})]),Hi=R([kn,Rn]);var jt=(r=>(r.IMAGE="image",r.TEXT="text",r))(jt||{}),ie=u({apiKey:n()}),Ki=ie,Ji=u({apiKey:n(),apiKeyHash:n()}),Xi=ie,qi=ie,Yi=ie,Qi=ie,ea=ie,ta=ie,ra=ie,Un=u({accessKeyId:n().check(J(1)),secretAccessKey:n().check(J(1))}),na=u({}),oa=u({}),ia=u({}),aa=u({}),sa=u({}),ua=u({}),Mn=u({modelId:n(),modelName:n(),modelType:D(jt)}),Ln=u({apiKeyHeader:n(),baseUrl:n(),models:k(Mn),defaultHeaders:f(A(n(),n()))}),jn=u({accountId:n(),gatewayId:n(),models:k(Mn),vertexProject:f(n()),vertexRegion:f(n())}),Zn=u({resourceName:n(),apiVersion:de(pe(e=>typeof e=="string"&&e.trim().length===0?void 0:e),f(n()))}),Fn=u({region:n().check(J(1))}),ca=R([Ki,Yi,Qi,ea,ta,qi,Xi,Ji,Un,ra]),Vn=R([Ln,jn,Zn,Fn,na,ia,aa,sa,oa,ua]),la=u({id:n(),name:n(),type:D(jt)}),pa=u({id:n(),name:n(),provider:D(Ve),config:Vn,enabledForChat:U()}),da=u({provider:D(Ve),config:Vn,auth:ca,platformId:n()});var Xh={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},wn=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],ma=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],fa=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Dn=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],ga=["grok-4.20","grok-4.1-fast"],ya={openai:wn,anthropic:ma,google:Dn,activepieces:[...fa.map(e=>`anthropic/${e}`),...wn.map(e=>`openai/${e}`),...Dn.map(e=>`google/${e}`),...ga.map(e=>`x-ai/${e}`)]};var Nn=128e3,ha={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function va({provider:e}){return e?ha[e]??Nn:Nn}o(va,"getMaxContextTokens");var Cn={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"},xa={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},_a=new Set(["anthropic","mistral"]);function Y(e){return{chatModels:ya[e],maxContextTokens:va({provider:e}),defaultEmbeddingModel:Cn[e],supportsEmbedding:Cn[e]!==void 0,supportsImageGeneration:!_a.has(e),webSearch:xa[e]}}o(Y,"buildProviderCapabilities");var Pa={openai:Y("openai"),anthropic:Y("anthropic"),openrouter:Y("openrouter"),azure:Y("azure"),google:Y("google"),"cloudflare-gateway":Y("cloudflare-gateway"),custom:Y("custom"),bedrock:Y("bedrock"),mistral:Y("mistral"),activepieces:Y("activepieces")};var Ia=u({base64Url:n(),fileName:n(),extension:f(n())}),Ta=u({mimeType:n(),url:n(),fileName:f(n())}),Zt=R([Ia,Ta]);var $a=R([u({type:$("file"),value:Zt}),u({type:$("markdown"),value:n(),files:f(k(Zt))})]),Ea=u({sessionId:n(),message:n(),files:f(k(n()))});var Gn=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Gn||{}),Wn=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Wn||{}),Ft=(i=>(i.RECORD_CREATED="RECORD_CREATED",i.RECORD_UPDATED="RECORD_UPDATED",i.RECORD_DELETED="RECORD_DELETED",i))(Ft||{});var ba=R([u({...K,name:n(),externalId:n(),type:$("STATIC_DROPDOWN"),tableId:n(),projectId:n(),data:u({options:k(u({value:n()}))})}),u({...K,name:n(),externalId:n(),type:R([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:n(),projectId:n()})]),za=u({...K,name:n(),folderId:j(n()),projectId:n(),externalId:n(),status:Nt(Wn),trigger:Nt(Gn)}),Sa=u({...K,tableId:n(),projectId:n(),cells:A(n(),u({updated:n(),created:n(),value:S(),fieldName:n()}))}),Aa=u({events:k(D(Ft)),webhookUrl:n(),flowId:n()}),Oa=u({fields:k(u({id:n(),name:n()})),rows:k(A(n(),n())),name:n()}),ka=u({projectId:n(),limit:f(we.number()),cursor:f(n()),name:f(n()),externalIds:lt(n()),folderId:f(n()),folderIds:lt(n())}),Ra=u({records:k(k(u({fieldId:n(),value:Kn()}))),tableId:n()}),wa=u({cells:f(k(u({fieldId:n(),value:Kn()}))),tableId:n(),agentUpdate:f(U())}),Hn=le("operator",[ye("eq"),ye("neq"),ye("gt"),ye("gte"),ye("lt"),ye("lte"),ye("co"),Bn("exists"),Bn("not_exists")]),Da=u({tableId:n(),limit:f(we.number()),cursor:f(n()),filters:lt(Hn)});function Kn(){return de(pe(e=>e==null?e:String(e)),Re(n()))}o(Kn,"coerceToString");function ye(e){return u({fieldId:n(),operator:$(e),value:n()})}o(ye,"valueFilter");function Bn(e){return u({fieldId:n(),operator:$(e)})}o(Bn,"existenceFilter");var Na=u({status:f(G()),body:f(S()),headers:f(A(n(),n()))}),Ca=u({...K,deleted:j(me),ownerId:n(),displayName:n(),platformId:n(),externalId:j(n())});var Jn=u({name:n(),description:f(n()),type:n(),required:U()}),Ua=u({pieceName:n(),triggerName:n(),input:u({toolName:n(),toolDescription:n(),inputSchema:k(Jn),returnsResponse:U()})});var Xn="^[0-9]+\\.[0-9]+\\.[0-9]+$",gv=new RegExp(Xn),La="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",yv=n().check(ce(new RegExp(Xn))),hv=n().check(ce(new RegExp(La))),ja=u({packageType:$("ARCHIVE"),pieceType:D(_e),pieceName:n(),pieceVersion:n(),archiveId:n(),platformId:n()}),qn=u({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:n(),pieceVersion:n()}),Yn=u({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:n(),pieceVersion:n(),platformId:n()}),vv=R([qn,Yn]),xv=R([ja,qn,Yn]);var Za=le("type",[u({type:$("CRON_EXPRESSION"),cronExpression:n(),timezone:n()}),u({type:$("INTERVAL"),intervalMs:ln().check(rt(6e4))})]),_v=u({...K,type:D(fe),projectId:n(),flowId:n(),triggerName:n(),schedule:j(Za),flowVersionId:n(),pieceName:n(),pieceVersion:n(),deleted:j(n()),simulate:U()}),Qn=(l=>(l.UNKNOWN="UNKNOWN",l.FLOW_RUN_LOG="FLOW_RUN_LOG",l.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",l.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",l.FLOW_STEP_FILE="FLOW_STEP_FILE",l.SAMPLE_DATA="SAMPLE_DATA",l.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",l.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",l.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",l.PROJECT_RELEASE="PROJECT_RELEASE",l.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",l.PLATFORM_ASSET="PLATFORM_ASSET",l.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",l.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",l.KNOWLEDGE_BASE="KNOWLEDGE_BASE",l.FLOW_BUNDLE="FLOW_BUNDLE",l))(Qn||{}),eo=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(eo||{}),to=(r=>(r.S3="S3",r.DB="DB",r))(to||{}),Pv=u({...K,projectId:j(n()),platformId:j(n()),type:D(Qn),compression:D(eo),data:f(S()),location:D(to),size:j(G()),fileName:j(n()),s3Key:j(n()),metadata:j(A(n(),n()))}),ro=(i=>(i.ADMIN="ADMIN",i.MEMBER="MEMBER",i.OPERATOR="OPERATOR",i))(ro||{}),no=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(no||{}),Iv=u({id:n(),email:n(),firstName:n(),status:D(no),externalId:j(n()),platformId:j(n()),platformRole:D(ro),lastName:n(),created:me,updated:me,lastActiveDate:j(me),imageUrl:j(n())});var Vt=u({...C.shape,...w(A(n(),S()),"OBJECT").shape});var so=u({...C.shape,...w(n(),"COLOR").shape});var Bt=R([W,te,ut,ne,H,re,kt,De,Rt,oe,Ue,Vt,Me,Ce,Ne,so]),dt={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var Q=u({displayName:n(),description:f(n())});var uo=u({username:n(),password:n()}),Gt=u({...Q.shape,username:u({displayName:n(),description:f(n())}),password:u({displayName:n(),description:f(n())}),...w(uo,"BASIC_AUTH").shape});var Ga=A(n(),R([W,te,oe,ne,H])),Wt=u({...Q.shape,props:Ga,...w(S(),"CUSTOM_AUTH").shape});var he=u({...Q.shape,...w(u({auth:n()}),"SECRET_TEXT").shape});var Wa=A(n(),R([W,te,he,oe,ne,H,re,ut])),co=u({...Q.shape,props:Wa,...w(S(),"OIDC").shape});var Ht=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Ht||{}),lo=R([W,he,H]),po=A(n(),lo),Ha=u({props:f(A(n(),lo)),authUrl:n(),tokenUrl:n(),scope:k(n()),prompt:f(R([$("none"),$("consent"),$("login"),$("omit")])),pkce:f(U()),pkceMethod:f(R([$("plain"),$("S256")])),authorizationMethod:f(D(Ht)),grantType:f(R([D(je),$(wt)])),extra:f(A(n(),n()))}),mo=u({access_token:n(),props:f(po),data:A(n(),ke())}),Kt=u({...Q.shape,...Ha.shape,...w(mo,"OAUTH2").shape});var $e=R([Gt,Wt,co,Kt,he]),Be="Connection",Jt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Be}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Be,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Be}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Be}},None(){}};var e_={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 Ka=u({...C.shape,...w(S(),"CUSTOM").shape,code:n()});var Xa=R([Bt,$e]),Xt=A(n(),Xa),__=A(n(),Bt);var fo=R([u({strategy:$("CRON"),cronExpression:n()}),u({strategy:$("NONE")})]);var go="2",mt="0.82.0";var qt=class{constructor(t,r,i,s,p,d,m,v,x=mt,I,N="",_){this.displayName=t;this.logoUrl=r;this.authors=i;this.events=s;this.categories=m;this.auth=v;this.minimumSupportedRelease=x;this.maximumSupportedRelease=I;this.description=N;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:go}),"getContextInfo");(!qa(x)||Ya(x,mt))&&(this.minimumSupportedRelease=mt),p.forEach(a=>this._actions[a.name]=a),d.forEach(a=>this._triggers[a.name]=a)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},yo=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,i,s)=>i===s.findIndex(p=>p.type===r.type)))throw new Error("Auth properties must be unique by type");return new qt(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 qa(e){return/^\d+\.\d+\.\d+$/.test(e)}o(qa,"isValidSimpleSemver");function Ya(e,t){let[r,i,s]=e.split(".").map(Number),[p,d,m]=t.split(".").map(Number);return r!==p?r<p:i!==d?i<d:s<m}o(Ya,"isSemverLessThan");var Qa=f(A(n(),A(n(),n()))),ho=u({id:f(n()),name:n(),displayName:n(),logoUrl:n(),description:n(),authors:k(n()),platformId:f(n()),directoryPath:f(n()),auth:f(R([$e,k($e)])),version:n(),categories:f(k(D(Pe))),minimumSupportedRelease:f(n()),maximumSupportedRelease:f(n()),deprecated:f(U()),i18n:Qa}),es=D(["human","ai","both"]),vo=u({description:f(n()),idempotent:f(U())}),xo=u({name:n(),displayName:n(),description:n(),props:Xt,requireAuth:U(),errorHandlingOptions:f(Ot),outputSchema:f(at()),audience:f(es),aiMetadata:f(vo)}),_o=u({name:n(),displayName:n(),description:n(),props:Xt,errorHandlingOptions:f(Ot),type:D(fe),sampleData:S(),handshakeConfiguration:f(at()),renewConfiguration:f(fo),testStrategy:D(Fe),outputSchema:f(at()),aiMetadata:f(vo)}),ts=u({...ho.shape,actions:A(n(),xo),triggers:A(n(),_o)}),rs=u({...ho.shape,actions:G(),triggers:G(),suggestedActions:f(k(xo)),suggestedTriggers:f(k(_o))}),Po=u({projectUsage:G(),pieceType:D(_e),packageType:D(Le),platformId:f(n()),archiveId:f(n())}),_P=u({...ts.shape,...Po.shape}),PP=u({...rs.shape,...Po.shape}),IP=u({name:n(),version:n()});var ns=Ge(require("path")),os=Ge(require("fs/promises"));var is=`
1
+ "use strict";var Oo=Object.create;var be=Object.defineProperty;var ko=Object.getOwnPropertyDescriptor;var Ro=Object.getOwnPropertyNames;var Do=Object.getPrototypeOf,wo=Object.prototype.hasOwnProperty;var o=(e,t)=>be(e,"name",{value:t,configurable:!0});var No=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},rr=(e,t)=>{for(var r in t)be(e,r,{get:t[r],enumerable:!0})},nr=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ro(t))!wo.call(e,s)&&s!==r&&be(e,s,{get:()=>t[s],enumerable:!(i=ko(t,s))||i.enumerable});return e};var Ge=(e,t,r)=>(r=e!=null?Oo(Do(e)):{},nr(t||!e||!e.__esModule?be(r,"default",{value:e,enumerable:!0}):r,e)),Co=e=>nr(be({},"__esModule",{value:!0}),e);var On=No((An,pt)=>{(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")},i=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),d="%[0-9a-z]{1,}",m="(?:[0-9a-f]+::?)+",f={zoneIndex:new RegExp(d,"i"),native:new RegExp(`^(::)?(${m})?([0-9a-f]+)?(::)?(${d})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${d})?)$`,"i"),transitional:new RegExp(`^((?:${m})|(?:::)(?:${m})?)${t}\\.${t}\\.${t}\\.${t}(${d})?$`,"i")};function v(a,l){if(a.indexOf("::")!==a.lastIndexOf("::"))return null;let g=0,p=-1,y=(a.match(f.zoneIndex)||[])[0],h,M;for(y&&(y=y.substring(1),a=a.replace(/%.+$/,""));(p=a.indexOf(":",p+1))>=0;)g++;if(a.substr(0,2)==="::"&&g--,a.substr(-2,2)==="::"&&g--,g>l)return null;for(M=l-g,h=":";M--;)h+="0:";return a=a.replace("::",h),a[0]===":"&&(a=a.slice(1)),a[a.length-1]===":"&&(a=a.slice(0,-1)),l=(function(){let er=a.split(":"),tr=[];for(let ft=0;ft<er.length;ft++)tr.push(parseInt(er[ft],16));return tr})(),{parts:l,zoneId:y}}o(v,"expandIPv6");function x(a,l,g,p){if(a.length!==l.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let y=0,h;for(;p>0;){if(h=g-p,h<0&&(h=0),a[y]>>h!==l[y]>>h)return!1;p-=g,y+=1}return!0}o(x,"matchCIDR");function I(a){if(s.test(a))return parseInt(a,16);if(a[0]==="0"&&!isNaN(parseInt(a[1],10))){if(i.test(a))return parseInt(a,8);throw new Error(`ipaddr: cannot parse ${a} as octal`)}return parseInt(a,10)}o(I,"parseIntAuto");function C(a,l){for(;a.length<l;)a=`0${a}`;return a}o(C,"padPart");let _={};_.IPv4=(function(){function a(l){if(l.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,p;for(g=0;g<l.length;g++)if(p=l[g],!(0<=p&&p<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=l}return o(a,"IPv4"),a.prototype.SpecialRanges={unspecified:[[new a([0,0,0,0]),8]],broadcast:[[new a([255,255,255,255]),32]],multicast:[[new a([224,0,0,0]),4]],linkLocal:[[new a([169,254,0,0]),16]],loopback:[[new a([127,0,0,0]),8]],carrierGradeNat:[[new a([100,64,0,0]),10]],private:[[new a([10,0,0,0]),8],[new a([172,16,0,0]),12],[new a([192,168,0,0]),16]],reserved:[[new a([192,0,0,0]),24],[new a([192,0,2,0]),24],[new a([192,88,99,0]),24],[new a([198,18,0,0]),15],[new a([198,51,100,0]),24],[new a([203,0,113,0]),24],[new a([240,0,0,0]),4]],as112:[[new a([192,175,48,0]),24],[new a([192,31,196,0]),24]],amt:[[new a([192,52,193,0]),24]]},a.prototype.kind=function(){return"ipv4"},a.prototype.match=function(l,g){let p;if(g===void 0&&(p=l,l=p[0],g=p[1]),l.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return x(this.octets,l.octets,8,g)},a.prototype.prefixLengthFromSubnetMask=function(){let l=0,g=!1,p={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},y,h,M;for(y=3;y>=0;y-=1)if(h=this.octets[y],h in p){if(M=p[h],g&&M!==0)return null;M!==8&&(g=!0),l+=M}else return null;return 32-l},a.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},a.prototype.toByteArray=function(){return this.octets.slice(0)},a.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},a.prototype.toNormalizedString=function(){return this.toString()},a.prototype.toString=function(){return this.octets.join(".")},a})(),_.IPv4.broadcastAddressFromCIDR=function(a){try{let l=this.parseCIDR(a),g=l[0].toByteArray(),p=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),y=[],h=0;for(;h<4;)y.push(parseInt(g[h],10)|parseInt(p[h],10)^255),h++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(a){return this.parser(a)!==null},_.IPv4.isValid=function(a){try{return new this(this.parser(a)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(a){try{return this.parseCIDR(a),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(a){return!!(_.IPv4.isValid(a)&&a.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(a){let l=a.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(a)||!l?!1:_.IPv4.isValidFourPartDecimal(l[1])},_.IPv4.networkAddressFromCIDR=function(a){let l,g,p,y,h;try{for(l=this.parseCIDR(a),p=l[0].toByteArray(),h=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),y=[],g=0;g<4;)y.push(parseInt(p[g],10)&parseInt(h[g],10)),g++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(a){let l=this.parser(a);if(l===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(l)},_.IPv4.parseCIDR=function(a){let l;if(l=a.match(/^(.+)\/(\d+)$/)){let g=parseInt(l[2]);if(g>=0&&g<=32){let p=[this.parse(l[1]),g];return Object.defineProperty(p,"toString",{value:o(function(){return this.join("/")},"value")}),p}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(a){let l,g,p;if(l=a.match(r.fourOctet))return(function(){let y=l.slice(1,6),h=[];for(let M=0;M<y.length;M++)g=y[M],h.push(I(g));return h})();if(l=a.match(r.longValue)){if(p=I(l[1]),p>4294967295||p<0)throw new Error("ipaddr: address outside defined range");return(function(){let y=[],h;for(h=0;h<=24;h+=8)y.push(p>>h&255);return y})().reverse()}else return(l=a.match(r.twoOctet))?(function(){let y=l.slice(1,4),h=[];if(p=I(y[1]),p>16777215||p<0)throw new Error("ipaddr: address outside defined range");return h.push(I(y[0])),h.push(p>>16&255),h.push(p>>8&255),h.push(p&255),h})():(l=a.match(r.threeOctet))?(function(){let y=l.slice(1,5),h=[];if(p=I(y[2]),p>65535||p<0)throw new Error("ipaddr: address outside defined range");return h.push(I(y[0])),h.push(I(y[1])),h.push(p>>8&255),h.push(p&255),h})():null},_.IPv4.subnetMaskFromPrefixLength=function(a){if(a=parseInt(a),a<0||a>32)throw new Error("ipaddr: invalid IPv4 prefix length");let l=[0,0,0,0],g=0,p=Math.floor(a/8);for(;g<p;)l[g]=255,g++;return p<4&&(l[p]=Math.pow(2,a%8)-1<<8-a%8),new this(l)},_.IPv6=(function(){function a(l,g){let p,y;if(l.length===16)for(this.parts=[],p=0;p<=14;p+=2)this.parts.push(l[p]<<8|l[p+1]);else if(l.length===8)this.parts=l;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(p=0;p<this.parts.length;p++)if(y=this.parts[p],!(0<=y&&y<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(a,"IPv6"),a.prototype.SpecialRanges={unspecified:[new a([0,0,0,0,0,0,0,0]),128],linkLocal:[new a([65152,0,0,0,0,0,0,0]),10],multicast:[new a([65280,0,0,0,0,0,0,0]),8],loopback:[new a([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new a([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new a([0,0,0,0,0,65535,0,0]),96],discard:[new a([256,0,0,0,0,0,0,0]),64],rfc6145:[new a([0,0,0,0,65535,0,0,0]),96],rfc6052:[new a([100,65435,0,0,0,0,0,0]),96],"6to4":[new a([8194,0,0,0,0,0,0,0]),16],teredo:[new a([8193,0,0,0,0,0,0,0]),32],benchmarking:[new a([8193,2,0,0,0,0,0,0]),48],amt:[new a([8193,3,0,0,0,0,0,0]),32],as112v6:[[new a([8193,4,274,0,0,0,0,0]),48],[new a([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new a([8193,16,0,0,0,0,0,0]),28],orchid2:[new a([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new a([8193,48,0,0,0,0,0,0]),28],reserved:[[new a([8193,0,0,0,0,0,0,0]),23],[new a([8193,3512,0,0,0,0,0,0]),32]]},a.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},a.prototype.kind=function(){return"ipv6"},a.prototype.match=function(l,g){let p;if(g===void 0&&(p=l,l=p[0],g=p[1]),l.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return x(this.parts,l.parts,16,g)},a.prototype.prefixLengthFromSubnetMask=function(){let l=0,g=!1,p={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},y,h;for(let M=7;M>=0;M-=1)if(y=this.parts[M],y in p){if(h=p[y],g&&h!==0)return null;h!==16&&(g=!0),l+=h}else return null;return 128-l},a.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},a.prototype.toByteArray=function(){let l,g=[],p=this.parts;for(let y=0;y<p.length;y++)l=p[y],g.push(l>>8),g.push(l&255);return g},a.prototype.toFixedLengthString=function(){let l=(function(){let p=[];for(let y=0;y<this.parts.length;y++)p.push(C(this.parts[y].toString(16),4));return p}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),l+g},a.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let l=this.parts.slice(-2),g=l[0],p=l[1];return new _.IPv4([g>>8,g&255,p>>8,p&255])},a.prototype.toNormalizedString=function(){let l=(function(){let p=[];for(let y=0;y<this.parts.length;y++)p.push(this.parts[y].toString(16));return p}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),l+g},a.prototype.toRFC5952String=function(){let l=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),p=0,y=-1,h;for(;h=l.exec(g);)h[0].length>y&&(p=h.index,y=h[0].length);return y<0?g:`${g.substring(0,p)}::${g.substring(p+y)}`},a.prototype.toString=function(){return this.toRFC5952String()},a})(),_.IPv6.broadcastAddressFromCIDR=function(a){try{let l=this.parseCIDR(a),g=l[0].toByteArray(),p=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),y=[],h=0;for(;h<16;)y.push(parseInt(g[h],10)|parseInt(p[h],10)^255),h++;return new this(y)}catch(l){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${l})`)}},_.IPv6.isIPv6=function(a){return this.parser(a)!==null},_.IPv6.isValid=function(a){if(typeof a=="string"&&a.indexOf(":")===-1)return!1;try{let l=this.parser(a);return new this(l.parts,l.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(a){if(typeof a=="string"&&a.indexOf(":")===-1)return!1;try{return this.parseCIDR(a),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(a){let l,g,p,y,h;try{for(l=this.parseCIDR(a),p=l[0].toByteArray(),h=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),y=[],g=0;g<16;)y.push(parseInt(p[g],10)&parseInt(h[g],10)),g++;return new this(y)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},_.IPv6.parse=function(a){let l=this.parser(a);if(l.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(l.parts,l.zoneId)},_.IPv6.parseCIDR=function(a){let l,g,p;if((g=a.match(/^(.+)\/(\d+)$/))&&(l=parseInt(g[2]),l>=0&&l<=128))return p=[this.parse(g[1]),l],Object.defineProperty(p,"toString",{value:o(function(){return this.join("/")},"value")}),p;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(a){let l,g,p,y,h,M;if(p=a.match(f.deprecatedTransitional))return this.parser(`::ffff:${p[1]}`);if(f.native.test(a))return v(a,8);if((p=a.match(f.transitional))&&(M=p[6]||"",l=p[1],p[1].endsWith("::")||(l=l.slice(0,-1)),l=v(l+M,6),l.parts)){for(h=[parseInt(p[2]),parseInt(p[3]),parseInt(p[4]),parseInt(p[5])],g=0;g<h.length;g++)if(y=h[g],!(0<=y&&y<=255))return null;return l.parts.push(h[0]<<8|h[1]),l.parts.push(h[2]<<8|h[3]),{parts:l.parts,zoneId:l.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(a){if(a=parseInt(a),a<0||a>128)throw new Error("ipaddr: invalid IPv6 prefix length");let l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,p=Math.floor(a/8);for(;g<p;)l[g]=255,g++;return p<16&&(l[p]=Math.pow(2,a%8)-1<<8-a%8),new this(l)},_.fromByteArray=function(a){let l=a.length;if(l===4)return new _.IPv4(a);if(l===16)return new _.IPv6(a);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(a){return _.IPv6.isValid(a)||_.IPv4.isValid(a)},_.isValidCIDR=function(a){return _.IPv6.isValidCIDR(a)||_.IPv4.isValidCIDR(a)},_.parse=function(a){if(_.IPv6.isValid(a))return _.IPv6.parse(a);if(_.IPv4.isValid(a))return _.IPv4.parse(a);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(a){try{return _.IPv6.parseCIDR(a)}catch{try{return _.IPv4.parseCIDR(a)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(a){let l=this.parse(a);return l.kind()==="ipv6"&&l.isIPv4MappedAddress()?l.toIPv4Address():l},_.subnetMatch=function(a,l,g){let p,y,h,M;g==null&&(g="unicast");for(y in l)if(Object.prototype.hasOwnProperty.call(l,y)){for(h=l[y],h[0]&&!(h[0]instanceof Array)&&(h=[h]),p=0;p<h.length;p++)if(M=h[p],a.kind()===M[0].kind()&&a.match.apply(a,M))return y}return g},typeof pt<"u"&&pt.exports?pt.exports=_:e.ipaddr=_})(An)});var hs={};rr(hs,{connections:()=>ys});module.exports=Co(hs);var Uo=Object.freeze({status:"aborted"});function P(e,t,r){function i(f,v){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:v,constr:m,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,v);let x=m.prototype,I=Object.keys(x);for(let C=0;C<I.length;C++){let _=I[C];_ in f||(f[_]=x[_].bind(f))}}o(i,"init");let s=r?.Parent??Object;class d extends s{static{o(this,"Definition")}}Object.defineProperty(d,"name",{value:e});function m(f){var v;let x=r?.Parent?new d:this;i(x,f),(v=x._zod).deferred??(v.deferred=[]);for(let I of x._zod.deferred)I();return x}return o(m,"_"),Object.defineProperty(m,"init",{value:i}),Object.defineProperty(m,Symbol.hasInstance,{value:o(f=>r?.Parent&&f instanceof r.Parent?!0:f?._zod?.traits?.has(e),"value")}),Object.defineProperty(m,"name",{value:e}),m}o(P,"$constructor");var X=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},We=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},gt={};function ee(e){return e&&Object.assign(gt,e),gt}o(ee,"config");function ht(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,s])=>t.indexOf(+i)===-1).map(([i,s])=>s)}o(ht,"getEnumValues");function ir(e,t){return typeof t=="bigint"?t.toString():t}o(ir,"jsonStringifyReplacer");function Ke(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Ke,"cached");function ar(e){return e==null}o(ar,"nullish");function Je(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Je,"cleanRegex");var or=Symbol("evaluating");function V(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==or)return i===void 0&&(i=or,i=r()),i},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}o(V,"defineLazy");var vt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function $e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o($e,"isObject");var Mo=Ke(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function sr(e){if($e(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!($e(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(sr,"isPlainObject");var ur=new Set(["string","number","symbol"]);function ve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(ve,"escapeRegex");function Xe(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}o(Xe,"clone");function L(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(L,"normalizeParams");function cr(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(cr,"optionalKeys");var lr={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 xe(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(xe,"aborted");function ae(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}o(ae,"prefixIssues");function He(e){return typeof e=="string"?e:e?.message}o(He,"unwrapMessage");function se(e,t,r){let i={...e,path:e.path??[]};if(!e.message){let s=He(e.inst?._zod.def?.error?.(e))??He(t?.error?.(e))??He(r.customError?.(e))??He(r.localeError?.(e))??"Invalid input";i.message=s}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}o(se,"finalizeIssue");function pr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(pr,"getLengthableOrigin");function xt(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}o(xt,"issue");var dr=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,ir,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),mr=P("$ZodError",dr),ze=P("$ZodError",dr,{Parent:Error});var jo=o(e=>(t,r,i,s)=>{let d=i?Object.assign(i,{async:!1}):{async:!1},m=t._zod.run({value:r,issues:[]},d);if(m instanceof Promise)throw new X;if(m.issues.length){let f=new(s?.Err??e)(m.issues.map(v=>se(v,d,ee())));throw vt(f,s?.callee),f}return m.value},"_parse"),qe=jo(ze),Zo=o(e=>async(t,r,i,s)=>{let d=i?Object.assign(i,{async:!0}):{async:!0},m=t._zod.run({value:r,issues:[]},d);if(m instanceof Promise&&(m=await m),m.issues.length){let f=new(s?.Err??e)(m.issues.map(v=>se(v,d,ee())));throw vt(f,s?.callee),f}return m.value},"_parseAsync"),Ye=Zo(ze),Fo=o(e=>(t,r,i)=>{let s=i?{...i,async:!1}:{async:!1},d=t._zod.run({value:r,issues:[]},s);if(d instanceof Promise)throw new X;return d.issues.length?{success:!1,error:new(e??mr)(d.issues.map(m=>se(m,s,ee())))}:{success:!0,data:d.value}},"_safeParse"),Se=Fo(ze),Vo=o(e=>async(t,r,i)=>{let s=i?Object.assign(i,{async:!0}):{async:!0},d=t._zod.run({value:r,issues:[]},s);return d instanceof Promise&&(d=await d),d.issues.length?{success:!1,error:new e(d.issues.map(m=>se(m,s,ee())))}:{success:!0,data:d.value}},"_safeParseAsync"),Ae=Vo(ze);var Bo="(?:(?:\\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])))",Go=new RegExp(`^${Bo}$`);var fr=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),gr=/^-?\d+n?$/,yr=/^-?\d+$/,_t=/^-?\d+(?:\.\d+)?$/,hr=/^(?:true|false)$/i;var ue=P("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Wo={number:"number",bigint:"bigint",object:"date"};var vr=P("$ZodCheckGreaterThan",(e,t)=>{ue.init(e,t);let r=Wo[typeof t.value];e._zod.onattach.push(i=>{let s=i._zod.bag,d=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>d&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var xr=P("$ZodCheckNumberFormat",(e,t)=>{ue.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[s,d]=lr[t.format];e._zod.onattach.push(m=>{let f=m._zod.bag;f.format=t.format,f.minimum=s,f.maximum=d,r&&(f.pattern=yr)}),e._zod.check=m=>{let f=m.value;if(r){if(!Number.isInteger(f)){m.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?m.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):m.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}f<s&&m.issues.push({origin:"number",input:f,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),f>d&&m.issues.push({origin:"number",input:f,code:"too_big",maximum:d,inclusive:!0,inst:e,continue:!t.abort})}});var _r=P("$ZodCheckMinLength",(e,t)=>{var r;ue.init(e,t),(r=e._zod.def).when??(r.when=i=>{let s=i.value;return!ar(s)&&s.length!==void 0}),e._zod.onattach.push(i=>{let s=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let s=i.value;if(s.length>=t.minimum)return;let m=pr(s);i.issues.push({origin:m,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}});var Pt=P("$ZodCheckStringFormat",(e,t)=>{var r,i;ue.init(e,t),e._zod.onattach.push(s=>{let d=s._zod.bag;d.format=t.format,t.pattern&&(d.patterns??(d.patterns=new Set),d.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Pr=P("$ZodCheckRegex",(e,t)=>{Pt.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 Tr={major:4,minor:3,patch:6};var F=P("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Tr;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let s of i)for(let d of s._zod.onattach)d(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=o((m,f,v)=>{let x=xe(m),I;for(let C of f){if(C._zod.def.when){if(!C._zod.def.when(m))continue}else if(x)continue;let _=m.issues.length,a=C._zod.check(m);if(a instanceof Promise&&v?.async===!1)throw new X;if(I||a instanceof Promise)I=(I??Promise.resolve()).then(async()=>{await a,m.issues.length!==_&&(x||(x=xe(m,_)))});else{if(m.issues.length===_)continue;x||(x=xe(m,_))}}return I?I.then(()=>m):m},"runChecks"),d=o((m,f,v)=>{if(xe(m))return m.aborted=!0,m;let x=s(f,i,v);if(x instanceof Promise){if(v.async===!1)throw new X;return x.then(I=>e._zod.parse(I,v))}return e._zod.parse(x,v)},"handleCanaryResult");e._zod.run=(m,f)=>{if(f.skipChecks)return e._zod.parse(m,f);if(f.direction==="backward"){let x=e._zod.parse({value:m.value,issues:[]},{...f,skipChecks:!0});return x instanceof Promise?x.then(I=>d(I,m,f)):d(x,m,f)}let v=e._zod.parse(m,f);if(v instanceof Promise){if(f.async===!1)throw new X;return v.then(x=>s(x,i,f))}return s(v,i,f)}}V(e,"~standard",()=>({validate:o(s=>{try{let d=Se(e,s);return d.success?{value:d.data}:{issues:d.error?.issues}}catch{return Ae(e,s).then(m=>m.success?{value:m.data}:{issues:m.error?.issues})}},"validate"),vendor:"zod",version:1}))}),tt=P("$ZodString",(e,t)=>{F.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??fr(e._zod.bag),e._zod.parse=(r,i)=>{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}}),It=P("$ZodStringFormat",(e,t)=>{Pt.init(e,t),tt.init(e,t)});var Sr=P("$ZodURL",(e,t)=>{It.init(e,t),e._zod.check=r=>{try{let i=r.value.trim(),s=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.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(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.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=s.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Tt=P("$ZodNumber",(e,t)=>{F.init(e,t),e._zod.pattern=e._zod.bag.pattern??_t,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let s=r.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return r;let d=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...d?{received:d}:{}}),r}}),Ar=P("$ZodNumberFormat",(e,t)=>{xr.init(e,t),Tt.init(e,t)}),Et=P("$ZodBoolean",(e,t)=>{F.init(e,t),e._zod.pattern=hr,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let s=r.value;return typeof s=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),Or=P("$ZodBigInt",(e,t)=>{F.init(e,t),e._zod.pattern=gr,e._zod.parse=(r,i)=>{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 kr=P("$ZodAny",(e,t)=>{F.init(e,t),e._zod.parse=r=>r}),Rr=P("$ZodUnknown",(e,t)=>{F.init(e,t),e._zod.parse=r=>r});var Dr=P("$ZodVoid",(e,t)=>{F.init(e,t),e._zod.parse=(r,i)=>{let s=r.value;return typeof s>"u"||r.issues.push({expected:"void",code:"invalid_type",input:s,inst:e}),r}}),wr=P("$ZodDate",(e,t)=>{F.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let s=r.value,d=s instanceof Date;return d&&!Number.isNaN(s.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:s,...d?{received:"Invalid Date"}:{},inst:e}),r}});function Er(e,t,r){e.issues.length&&t.issues.push(...ae(r,e.issues)),t.value[r]=e.value}o(Er,"handleArrayResult");var Nr=P("$ZodArray",(e,t)=>{F.init(e,t),e._zod.parse=(r,i)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);let d=[];for(let m=0;m<s.length;m++){let f=s[m],v=t.element._zod.run({value:f,issues:[]},i);v instanceof Promise?d.push(v.then(x=>Er(x,r,m))):Er(v,r,m)}return d.length?Promise.all(d).then(()=>r):r}});function et(e,t,r,i,s){if(e.issues.length){if(s&&!(r in i))return;t.issues.push(...ae(r,e.issues))}e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}o(et,"handlePropertyResult");function Ho(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=cr(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Ho,"normalizeDef");function Ko(e,t,r,i,s,d){let m=[],f=s.keySet,v=s.catchall._zod,x=v.def.type,I=v.optout==="optional";for(let C in t){if(f.has(C))continue;if(x==="never"){m.push(C);continue}let _=v.run({value:t[C],issues:[]},i);_ instanceof Promise?e.push(_.then(a=>et(a,r,C,t,I))):et(_,r,C,t,I)}return m.length&&r.issues.push({code:"unrecognized_keys",keys:m,input:t,inst:d}),e.length?Promise.all(e).then(()=>r):r}o(Ko,"handleCatchall");var Cr=P("$ZodObject",(e,t)=>{if(F.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let f=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let v={...f};return Object.defineProperty(t,"shape",{value:v}),v},"get")})}let i=Ke(()=>Ho(t));V(e._zod,"propValues",()=>{let f=t.shape,v={};for(let x in f){let I=f[x]._zod;if(I.values){v[x]??(v[x]=new Set);for(let C of I.values)v[x].add(C)}}return v});let s=$e,d=t.catchall,m;e._zod.parse=(f,v)=>{m??(m=i.value);let x=f.value;if(!s(x))return f.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),f;f.value={};let I=[],C=m.shape;for(let _ of m.keys){let a=C[_],l=a._zod.optout==="optional",g=a._zod.run({value:x[_],issues:[]},v);g instanceof Promise?I.push(g.then(p=>et(p,f,_,x,l))):et(g,f,_,x,l)}return d?Ko(I,x,f,v,i.value,e):I.length?Promise.all(I).then(()=>f):f}});function br(e,t,r,i){for(let d of e)if(d.issues.length===0)return t.value=d.value,t;let s=e.filter(d=>!xe(d));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(d=>d.issues.map(m=>se(m,i,ee())))}),t)}o(br,"handleUnionResults");var bt=P("$ZodUnion",(e,t)=>{F.init(e,t),V(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){let s=t.options.map(d=>d._zod.pattern);return new RegExp(`^(${s.map(d=>Je(d.source)).join("|")})$`)}});let r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(s,d)=>{if(r)return i(s,d);let m=!1,f=[];for(let v of t.options){let x=v._zod.run({value:s.value,issues:[]},d);if(x instanceof Promise)f.push(x),m=!0;else{if(x.issues.length===0)return x;f.push(x)}}return m?Promise.all(f).then(v=>br(v,s,e,d)):br(f,s,e,d)}});var Ur=P("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,bt.init(e,t);let r=e._zod.parse;V(e._zod,"propValues",()=>{let s={};for(let d of t.options){let m=d._zod.propValues;if(!m||Object.keys(m).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(d)}"`);for(let[f,v]of Object.entries(m)){s[f]||(s[f]=new Set);for(let x of v)s[f].add(x)}}return s});let i=Ke(()=>{let s=t.options,d=new Map;for(let m of s){let f=m._zod.propValues?.[t.discriminator];if(!f||f.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(m)}"`);for(let v of f){if(d.has(v))throw new Error(`Duplicate discriminator value "${String(v)}"`);d.set(v,m)}}return d});e._zod.parse=(s,d)=>{let m=s.value;if(!$e(m))return s.issues.push({code:"invalid_type",expected:"object",input:m,inst:e}),s;let f=i.value.get(m?.[t.discriminator]);return f?f._zod.run(s,d):t.unionFallback?r(s,d):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:m,path:[t.discriminator],inst:e}),s)}});var Mr=P("$ZodRecord",(e,t)=>{F.init(e,t),e._zod.parse=(r,i)=>{let s=r.value;if(!sr(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;let d=[],m=t.keyType._zod.values;if(m){r.value={};let f=new Set;for(let x of m)if(typeof x=="string"||typeof x=="number"||typeof x=="symbol"){f.add(typeof x=="number"?x.toString():x);let I=t.valueType._zod.run({value:s[x],issues:[]},i);I instanceof Promise?d.push(I.then(C=>{C.issues.length&&r.issues.push(...ae(x,C.issues)),r.value[x]=C.value})):(I.issues.length&&r.issues.push(...ae(x,I.issues)),r.value[x]=I.value)}let v;for(let x in s)f.has(x)||(v=v??[],v.push(x));v&&v.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:v})}else{r.value={};for(let f of Reflect.ownKeys(s)){if(f==="__proto__")continue;let v=t.keyType._zod.run({value:f,issues:[]},i);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&_t.test(f)&&v.issues.length){let C=t.keyType._zod.run({value:Number(f),issues:[]},i);if(C instanceof Promise)throw new Error("Async schemas not supported in object keys currently");C.issues.length===0&&(v=C)}if(v.issues.length){t.mode==="loose"?r.value[f]=s[f]:r.issues.push({code:"invalid_key",origin:"record",issues:v.issues.map(C=>se(C,i,ee())),input:f,path:[f],inst:e});continue}let I=t.valueType._zod.run({value:s[f],issues:[]},i);I instanceof Promise?d.push(I.then(C=>{C.issues.length&&r.issues.push(...ae(f,C.issues)),r.value[v.value]=C.value})):(I.issues.length&&r.issues.push(...ae(f,I.issues)),r.value[v.value]=I.value)}}return d.length?Promise.all(d).then(()=>r):r}});var Lr=P("$ZodEnum",(e,t)=>{F.init(e,t);let r=ht(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(s=>ur.has(typeof s)).map(s=>typeof s=="string"?ve(s):s.toString()).join("|")})$`),e._zod.parse=(s,d)=>{let m=s.value;return i.has(m)||s.issues.push({code:"invalid_value",values:r,input:m,inst:e}),s}}),jr=P("$ZodLiteral",(e,t)=>{if(F.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(i=>typeof i=="string"?ve(i):i?ve(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,s)=>{let d=i.value;return r.has(d)||i.issues.push({code:"invalid_value",values:t.values,input:d,inst:e}),i}});var Zr=P("$ZodTransform",(e,t)=>{F.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new We(e.constructor.name);let s=t.transform(r.value,r);if(i.async)return(s instanceof Promise?s:Promise.resolve(s)).then(m=>(r.value=m,r));if(s instanceof Promise)throw new X;return r.value=s,r}});function $r(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o($r,"handleOptionalResult");var Fr=P("$ZodOptional",(e,t)=>{F.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Je(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let s=t.innerType._zod.run(r,i);return s instanceof Promise?s.then(d=>$r(d,r.value)):$r(s,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,i)}});var Vr=P("$ZodNullable",(e,t)=>{F.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Je(r.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)});var Br=P("$ZodPipe",(e,t)=>{F.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let d=t.out._zod.run(r,i);return d instanceof Promise?d.then(m=>Qe(m,t.in,i)):Qe(d,t.in,i)}let s=t.in._zod.run(r,i);return s instanceof Promise?s.then(d=>Qe(d,t.out,i)):Qe(s,t.out,i)}});function Qe(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Qe,"handlePipeResult");var Gr=P("$ZodCustom",(e,t)=>{ue.init(e,t),F.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,s=t.fn(i);if(s instanceof Promise)return s.then(d=>zr(d,r,i,e));zr(s,r,i,e)}});function zr(e,t,r,i){if(!e){let s={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(s.params=i._zod.def.params),t.issues.push(xt(s))}}o(zr,"handleRefineResult");var Hr;var $t=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.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 i={...this.get(r)??{}};delete i.id;let s={...i,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Kr(){return new $t}o(Kr,"registry");(Hr=globalThis).__zod_globalRegistry??(Hr.__zod_globalRegistry=Kr());var zt=globalThis.__zod_globalRegistry;function Jr(e,t){return new e({type:"string",...L(t)})}o(Jr,"_string");function Xr(e,t){return new e({type:"string",coerce:!0,...L(t)})}o(Xr,"_coercedString");function qr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...L(t)})}o(qr,"_url");function Yr(e,t){return new e({type:"number",checks:[],...L(t)})}o(Yr,"_number");function Qr(e,t){return new e({type:"number",coerce:!0,checks:[],...L(t)})}o(Qr,"_coercedNumber");function en(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...L(t)})}o(en,"_int");function tn(e,t){return new e({type:"boolean",...L(t)})}o(tn,"_boolean");function rn(e,t){return new e({type:"boolean",coerce:!0,...L(t)})}o(rn,"_coercedBoolean");function nn(e,t){return new e({type:"bigint",coerce:!0,...L(t)})}o(nn,"_coercedBigint");function on(e){return new e({type:"any"})}o(on,"_any");function an(e){return new e({type:"unknown"})}o(an,"_unknown");function sn(e,t){return new e({type:"void",...L(t)})}o(sn,"_void");function un(e,t){return new e({type:"date",coerce:!0,...L(t)})}o(un,"_coercedDate");function rt(e,t){return new vr({check:"greater_than",...L(t),value:e,inclusive:!0})}o(rt,"_gte");function J(e,t){return new _r({check:"min_length",...L(t),minimum:e})}o(J,"_minLength");function ce(e,t){return new Pr({check:"string_format",format:"regex",...L(t),pattern:e})}o(ce,"_regex");function cn(e,t,r){let i=L(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}o(cn,"_custom");var B=P("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");F.init(e,t),e.def=t,e.type=t.type,e.parse=(r,i)=>qe(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Se(e,r,i),e.parseAsync=async(r,i)=>Ye(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Ae(e,r,i),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),e.with=e.check,e.clone=(r,i)=>Xe(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.apply=r=>r(e)}),ot=P("ZodMiniString",(e,t)=>{tt.init(e,t),B.init(e,t)});function n(e){return Jr(ot,e)}o(n,"string");var ln=P("ZodMiniStringFormat",(e,t)=>{It.init(e,t),ot.init(e,t)});var si=P("ZodMiniURL",(e,t)=>{Sr.init(e,t),ln.init(e,t)});function pn(e){return qr(si,e)}o(pn,"url");var it=P("ZodMiniNumber",(e,t)=>{Tt.init(e,t),B.init(e,t)});function G(e){return Yr(it,e)}o(G,"number");var ui=P("ZodMiniNumberFormat",(e,t)=>{Ar.init(e,t),it.init(e,t)});function dn(e){return en(ui,e)}o(dn,"int");var St=P("ZodMiniBoolean",(e,t)=>{Et.init(e,t),B.init(e,t)});function U(e){return tn(St,e)}o(U,"boolean");var mn=P("ZodMiniBigInt",(e,t)=>{Or.init(e,t),B.init(e,t)});var ci=P("ZodMiniAny",(e,t)=>{kr.init(e,t),B.init(e,t)});function ke(){return on(ci)}o(ke,"any");var li=P("ZodMiniUnknown",(e,t)=>{Rr.init(e,t),B.init(e,t)});function k(){return an(li)}o(k,"unknown");var pi=P("ZodMiniVoid",(e,t)=>{Dr.init(e,t),B.init(e,t)});function fn(e){return sn(pi,e)}o(fn,"_void");var gn=P("ZodMiniDate",(e,t)=>{wr.init(e,t),B.init(e,t)});var di=P("ZodMiniArray",(e,t)=>{Nr.init(e,t),B.init(e,t)});function z(e,t){return new di({type:"array",element:e,...L(t)})}o(z,"array");var mi=P("ZodMiniObject",(e,t)=>{Cr.init(e,t),B.init(e,t),V(e,"shape",()=>t.shape)});function u(e,t){let r={type:"object",shape:e??{},...L(t)};return new mi(r)}o(u,"object");var fi=P("ZodMiniUnion",(e,t)=>{bt.init(e,t),B.init(e,t)});function w(e,t){return new fi({type:"union",options:e,...L(t)})}o(w,"union");var gi=P("ZodMiniDiscriminatedUnion",(e,t)=>{Ur.init(e,t),B.init(e,t)});function le(e,t,r){return new gi({type:"union",options:t,discriminator:e,...L(r)})}o(le,"discriminatedUnion");var yi=P("ZodMiniRecord",(e,t)=>{Mr.init(e,t),B.init(e,t)});function R(e,t,r){return new yi({type:"record",keyType:e,valueType:t,...L(r)})}o(R,"record");var hi=P("ZodMiniEnum",(e,t)=>{Lr.init(e,t),B.init(e,t),e.options=Object.values(t.entries)});function b(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new hi({type:"enum",entries:r,...L(t)})}o(b,"_enum");var vi=P("ZodMiniLiteral",(e,t)=>{jr.init(e,t),B.init(e,t)});function E(e,t){return new vi({type:"literal",values:Array.isArray(e)?e:[e],...L(t)})}o(E,"literal");var xi=P("ZodMiniTransform",(e,t)=>{Zr.init(e,t),B.init(e,t)});function pe(e){return new xi({type:"transform",transform:e})}o(pe,"transform");var _i=P("ZodMiniOptional",(e,t)=>{Fr.init(e,t),B.init(e,t)});function c(e){return new _i({type:"optional",innerType:e})}o(c,"optional");var Pi=P("ZodMiniNullable",(e,t)=>{Vr.init(e,t),B.init(e,t)});function Re(e){return new Pi({type:"nullable",innerType:e})}o(Re,"nullable");var Ii=P("ZodMiniPipe",(e,t)=>{Br.init(e,t),B.init(e,t)});function de(e,t){return new Ii({type:"pipe",in:e,out:t})}o(de,"pipe");var Ti=P("ZodMiniCustom",(e,t)=>{Gr.init(e,t),B.init(e,t)});function at(e,t){return cn(Ti,e??(()=>!0),t)}o(at,"custom");var De={};rr(De,{bigint:()=>Ai,boolean:()=>Si,date:()=>Oi,number:()=>zi,string:()=>$i});function $i(e){return Xr(ot,e)}o($i,"string");function zi(e){return Qr(it,e)}o(zi,"number");function Si(e){return rn(St,e)}o(Si,"boolean");function Ai(e){return nn(mn,e)}o(Ai,"bigint");function Oi(e){return un(gn,e)}o(Oi,"date");var Ot=u({retryOnFailure:u({defaultValue:c(U()),hide:c(U())}),continueOnFailure:u({defaultValue:c(U()),hide:c(U())})}),At=class{constructor(t,r,i,s,d,m,f,v,x,I,C,_,a){this.name=t;this.displayName=r;this.description=i;this.props=s;this.propertyGroups=d;this.run=m;this.test=f;this.requireAuth=v;this.errorHandlingOptions=x;this.outputSchema=I;this.audience=C;this.aiMetadata=_;this.classification=a}static{o(this,"IAction")}},hn=o(e=>new At(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 N=u({displayName:n(),description:c(n()),advanced:c(U()),width:c(b(["half","full"])),icon:c(n()),placeholder:c(n())}),D=o((e,t)=>u({type:E(t),required:U(),defaultValue:c(ke())}),"TPropertyValue");var W=u({...N.shape,...D(n(),"SHORT_TEXT").shape}),te=u({...N.shape,...D(n(),"LONG_TEXT").shape});var vn=u({label:n(),value:k(),description:c(n()),icon:c(n())}),st=u({disabled:c(U()),placeholder:c(n()),options:z(vn)});var Ri=b(["cards"]),H=u({...N.shape,options:st,display:c(Ri),...D(k(),"STATIC_DROPDOWN").shape}),re=u({...N.shape,options:st,...D(z(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var kt=u({...N.shape,...D(k(),"DROPDOWN").shape,refreshers:z(n())}),we=u({...N.shape,...D(z(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:z(n())});var ne=u({...N.shape,reveals:c(z(n())),...D(U(),"CHECKBOX").shape});var oe=u({...N.shape,display:c(b(["stepper"])),min:c(G()),max:c(G()),step:c(G()),...D(G(),"NUMBER").shape});var Ne=u({...N.shape,streaming:c(U()),...D(k(),"FILE").shape});var Ce=u({...N.shape,...D(n(),"DATE_TIME").shape});var xn=R(n(),w([W,te,H,we,re,ne,oe,Ne,Ce])),Ue=u({...N.shape,properties:xn,...D(z(k()),"ARRAY").shape});var _n=b(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Pn=u({preset:c(_n),after:c(n()),before:c(n())}),Rt=u({...N.shape,display:c(b(["dropdown"])),...D(Pn,"DATE_RANGE").shape});var Me=u({...N.shape,...D(w([R(n(),k())]),"JSON").shape});var In=w([W,H,Me,Ue,re]),Di=R(n(),In),Dt=u({refreshers:z(n()),...N.shape,...D(k(),"DYNAMIC").shape});var ut=u({...N.shape,...D(fn(),"MARKDOWN").shape});var Le=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Le||{}),_e=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(_e||{}),Pe=(y=>(y.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",y.COMMUNICATION="COMMUNICATION",y.COMMERCE="COMMERCE",y.CORE="CORE",y.UNIVERSAL_AI="UNIVERSAL_AI",y.FLOW_CONTROL="FLOW_CONTROL",y.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",y.ACCOUNTING="ACCOUNTING",y.PRODUCTIVITY="PRODUCTIVITY",y.CONTENT_AND_FILES="CONTENT_AND_FILES",y.DEVELOPER_TOOLS="DEVELOPER_TOOLS",y.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",y.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",y.HUMAN_RESOURCES="HUMAN_RESOURCES",y.PAYMENT_PROCESSING="PAYMENT_PROCESSING",y.MARKETING="MARKETING",y.SALES_AND_CRM="SALES_AND_CRM",y))(Pe||{});var je=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(je||{}),wt="both_client_credentials_and_authorization_code";var ge=(s=>(s.POLLING="POLLING",s.WEBHOOK="WEBHOOK",s.APP_WEBHOOK="APP_WEBHOOK",s.MANUAL="MANUAL",s))(ge||{}),Ze=(d=>(d.NONE="NONE",d.HEADER_PRESENT="HEADER_PRESENT",d.QUERY_PRESENT="QUERY_PRESENT",d.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",d.HEAD_REQUEST="HEAD_REQUEST",d))(Ze||{}),wi=u({strategy:b(Ze),paramName:c(n())}),Fe=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Fe||{});var ct=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(ct||{}),Tn=u({status:c(G()),body:c(k()),headers:c(R(n(),n()))}),En=u({type:E("DELAY"),resumeDateTime:n(),requestIdToReply:c(n()),handlerId:c(n()),streamStepProgress:c(b(ct))}),bn=u({type:E("WEBHOOK"),requestId:n(),requestIdToReply:c(n()),response:Tn,handlerId:c(n()),streamStepProgress:c(b(ct))}),Ni=w([En,bn]);var Ci=u({body:k(),rawBody:c(k()),headers:R(n(),n()),queryParams:R(n(),n())});function q(e){return e==null}o(q,"isNil");var Nt=Ge(require("crypto"),1);var Ui=128,me,Ie,Mi=o(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!me||me.length<e?(me=Buffer.allocUnsafe(e*Ui),Nt.default.randomFillSync(me),Ie=0):Ie+e>me.length&&(Nt.default.randomFillSync(me),Ie=0)}catch(t){throw me=void 0,t}Ie+=e},"fillPool"),Li=o(e=>(Mi(e|=0),me.subarray(Ie-e,Ie)),"random"),ji=o((e,t,r)=>{let i=(2<<31-Math.clz32(e.length-1|1))-1,s=Math.ceil(1.6*i*t/e.length);return(d=t)=>{if(d<=0)return"";let m="";for(;;){let f=r(s),v=s;for(;v--;)if(m+=e[f[v]&i]||"",m.length===d)return m}}},"customRandom"),zn=o((e,t=21)=>ji(e,t,Li),"customAlphabet");var Zi="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Sn=21,rh=n().check(ce(new RegExp(`^[0-9a-zA-Z]{${Sn}}$`))),Fi=zn(Zi,Sn);var fe=de(pe(e=>e instanceof Date?e.toISOString():e),n()),K={id:n(),created:fe,updated:fe},Z=o(e=>c(Re(e)),"Nullable");function Ct(e){return c(Re(b(e)))}o(Ct,"NullableEnum");var ih=de(pe(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),c(U())),lt=o(e=>de(pe(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),c(z(e))),"OptionalArrayFromQuery");var uh=R(n(),k());var Ve=(I=>(I.OPENAI="openai",I.OPENROUTER="openrouter",I.ANTHROPIC="anthropic",I.AZURE="azure",I.GOOGLE="google",I.ACTIVEPIECES="activepieces",I.CLOUDFLARE_GATEWAY="cloudflare-gateway",I.CUSTOM="custom",I.BEDROCK="bedrock",I.MISTRAL="mistral",I))(Ve||{});var _h=n().check(ce(/^#[0-9A-Fa-f]{6}$/));var Ih=u({filename:n(),data:k(),type:E("file"),mimetype:c(n())});var Vi=Ge(On());var Ah=u({...K,name:n(),permissions:z(n()),platformId:Z(n()),type:n(),userCount:c(G())});var kn=(i=>(i.AGENT_DECIDE="agent-decide",i.CHOOSE_YOURSELF="choose-yourself",i.LEAVE_EMPTY="leave-empty",i))(kn||{}),Ut=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ut||{}),Mt=(i=>(i.SSE="sse",i.STREAMABLE_HTTP="streamable-http",i.SIMPLE_HTTP="http",i))(Mt||{});var Lt=(i=>(i.TEXT="text",i.NUMBER="number",i.BOOLEAN="boolean",i))(Lt||{});var jt=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(jt||{});var Bi=u({mode:b(kn),value:k()}),Gi=u({auth:c(n()),fields:R(n(),Bi)}),Wi=u({pieceName:n(),pieceVersion:n(),actionName:n(),predefinedInput:c(Gi)}),Hi=u({type:E("PIECE"),toolName:n().check(J(1)),pieceMetadata:Wi}),Ki=u({type:E("none")}),Ji=u({type:E("access_token"),accessToken:n()}),Xi=u({type:E("api_key"),apiKey:n(),apiKeyHeader:n()}),qi=u({type:E("headers"),headers:R(n(),n())}),Yi=le("type",[Ki,Ji,Xi,qi]),Rn=u({type:E("FLOW"),toolName:n().check(J(1)),externalFlowId:n(),flowDisplayName:c(n())}),Dn=u({type:E("MCP"),toolName:n().check(J(1)),serverUrl:pn(),protocol:b(Mt),auth:Yi}),wn=u({type:E("KNOWLEDGE_BASE"),toolName:n().check(J(1)),sourceType:b(Ut),sourceId:n(),sourceName:n()}),Qi=le("type",[Hi,Rn,Dn,wn]),ea=u({displayName:n(),description:c(n()),type:b(Lt)}),Nn=u({type:E("MARKDOWN"),markdown:n()}),Te={type:E("TOOL_CALL"),input:Z(R(n(),k())),output:c(k()),toolName:n(),status:b(jt),toolCallId:n(),startTime:n(),endTime:c(n())},av=u(Te),Cn=le("toolCallType",[u({...Te,toolCallType:E("PIECE"),pieceName:n(),pieceVersion:n(),actionName:n()}),u({...Te,toolCallType:E("FLOW"),displayName:n(),externalFlowId:n()}),u({...Te,toolCallType:E("MCP"),displayName:n(),serverUrl:n()}),u({...Te,toolCallType:E("KNOWLEDGE_BASE"),displayName:n(),sourceType:n()}),u({...Te,toolCallType:E("UNKNOWN"),displayName:n()})]),ta=w([Nn,Cn]);var Zt=(r=>(r.IMAGE="image",r.TEXT="text",r))(Zt||{}),ie=u({apiKey:n()}),ra=ie,na=u({apiKey:n(),apiKeyHash:n()}),oa=ie,ia=ie,aa=ie,sa=ie,ua=ie,ca=ie,la=ie,Zn=u({accessKeyId:n().check(J(1)),secretAccessKey:n().check(J(1))}),pa=u({}),da=u({}),ma=u({}),fa=u({}),ga=u({}),ya=u({}),Fn=u({modelId:n(),modelName:n(),modelType:b(Zt)}),Vn=u({apiKeyHeader:n(),baseUrl:n(),models:z(Fn),defaultHeaders:c(R(n(),n()))}),Bn=u({accountId:n(),gatewayId:n(),models:z(Fn),vertexProject:c(n()),vertexRegion:c(n())}),Gn=u({resourceName:n(),apiVersion:de(pe(e=>typeof e=="string"&&e.trim().length===0?void 0:e),c(n()))}),Wn=u({region:n().check(J(1))}),ha=w([ra,aa,sa,ua,ca,ia,oa,na,Zn,la]),Hn=w([Vn,Bn,Gn,Wn,pa,ma,fa,ga,da,ya]),va=u({id:n(),name:n(),type:b(Zt)}),xa=u({id:n(),name:n(),provider:b(Ve),config:Hn,enabledForChat:U()}),_a=u({provider:b(Ve),config:Hn,auth:ha,platformId:n()});var lv={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Un=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Pa=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Ia=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Mn=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Ta=["grok-4.20","grok-4.1-fast"],Ea={openai:Un,anthropic:Pa,google:Mn,activepieces:[...Ia.map(e=>`anthropic/${e}`),...Un.map(e=>`openai/${e}`),...Mn.map(e=>`google/${e}`),...Ta.map(e=>`x-ai/${e}`)]};var Ln=128e3,ba={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function $a({provider:e}){return e?ba[e]??Ln:Ln}o($a,"getMaxContextTokens");var jn={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"},za={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Sa=new Set(["anthropic","mistral"]);function Y(e){return{chatModels:Ea[e],maxContextTokens:$a({provider:e}),defaultEmbeddingModel:jn[e],supportsEmbedding:jn[e]!==void 0,supportsImageGeneration:!Sa.has(e),webSearch:za[e]}}o(Y,"buildProviderCapabilities");var Aa={openai:Y("openai"),anthropic:Y("anthropic"),openrouter:Y("openrouter"),azure:Y("azure"),google:Y("google"),"cloudflare-gateway":Y("cloudflare-gateway"),custom:Y("custom"),bedrock:Y("bedrock"),mistral:Y("mistral"),activepieces:Y("activepieces")};var Oa=u({base64Url:n(),fileName:n(),extension:c(n())}),ka=u({mimeType:n(),url:n(),fileName:c(n())}),Ft=w([Oa,ka]);var Ra=w([u({type:E("file"),value:Ft}),u({type:E("markdown"),value:n(),files:c(z(Ft))})]),Da=u({sessionId:n(),message:n(),files:c(z(n()))});var Jn=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Jn||{}),Xn=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Xn||{}),Vt=(i=>(i.RECORD_CREATED="RECORD_CREATED",i.RECORD_UPDATED="RECORD_UPDATED",i.RECORD_DELETED="RECORD_DELETED",i))(Vt||{});var wa=w([u({...K,name:n(),externalId:n(),type:E("STATIC_DROPDOWN"),tableId:n(),projectId:n(),data:u({options:z(u({value:n()}))})}),u({...K,name:n(),externalId:n(),type:w([E("TEXT"),E("NUMBER"),E("DATE"),E("DATETIME")]),tableId:n(),projectId:n()})]),Na=u({...K,name:n(),folderId:Z(n()),projectId:n(),externalId:n(),status:Ct(Xn),trigger:Ct(Jn)}),Ca=u({...K,tableId:n(),projectId:n(),cells:R(n(),u({updated:n(),created:n(),value:k(),fieldName:n()}))}),Ua=u({events:z(b(Vt)),webhookUrl:n(),flowId:n()}),Ma=u({fields:z(u({id:n(),name:n()})),rows:z(R(n(),n())),name:n()}),La=u({projectId:n(),limit:c(De.number()),cursor:c(n()),name:c(n()),externalIds:lt(n()),folderId:c(n()),folderIds:lt(n())}),ja=u({records:z(z(u({fieldId:n(),value:Yn()}))),tableId:n()}),Za=u({cells:c(z(u({fieldId:n(),value:Yn()}))),tableId:n(),agentUpdate:c(U())}),qn=le("operator",[ye("eq"),ye("neq"),ye("gt"),ye("gte"),ye("lt"),ye("lte"),ye("co"),Kn("exists"),Kn("not_exists")]),Fa=u({tableId:n(),limit:c(De.number()),cursor:c(n()),filters:lt(qn)});function Yn(){return de(pe(e=>e==null?e:String(e)),Re(n()))}o(Yn,"coerceToString");function ye(e){return u({fieldId:n(),operator:E(e),value:n()})}o(ye,"valueFilter");function Kn(e){return u({fieldId:n(),operator:E(e)})}o(Kn,"existenceFilter");var Va=u({status:c(G()),body:c(k()),headers:c(R(n(),n()))}),Ba=u({...K,deleted:Z(fe),ownerId:n(),displayName:n(),platformId:n(),externalId:Z(n())});var Qn=u({name:n(),description:c(n()),type:n(),required:U()}),Ga=u({pieceName:n(),triggerName:n(),input:u({toolName:n(),toolDescription:n(),inputSchema:z(Qn),returnsResponse:U()})});var eo="^[0-9]+\\.[0-9]+\\.[0-9]+$",Av=new RegExp(eo),Ha="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",Ov=n().check(ce(new RegExp(eo))),kv=n().check(ce(new RegExp(Ha))),Ka=u({packageType:E("ARCHIVE"),pieceType:b(_e),pieceName:n(),pieceVersion:n(),archiveId:n(),platformId:n()}),to=u({packageType:E("REGISTRY"),pieceType:E("OFFICIAL"),pieceName:n(),pieceVersion:n()}),ro=u({packageType:E("REGISTRY"),pieceType:E("CUSTOM"),pieceName:n(),pieceVersion:n(),platformId:n()}),Rv=w([to,ro]),Dv=w([Ka,to,ro]);var Ja=le("type",[u({type:E("CRON_EXPRESSION"),cronExpression:n(),timezone:n()}),u({type:E("INTERVAL"),intervalMs:dn().check(rt(6e4))})]),wv=u({...K,type:b(ge),projectId:n(),flowId:n(),triggerName:n(),schedule:Z(Ja),flowVersionId:n(),pieceName:n(),pieceVersion:n(),deleted:Z(n()),simulate:U()}),no=(p=>(p.UNKNOWN="UNKNOWN",p.FLOW_RUN_LOG="FLOW_RUN_LOG",p.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",p.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",p.FLOW_STEP_FILE="FLOW_STEP_FILE",p.SAMPLE_DATA="SAMPLE_DATA",p.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",p.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",p.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",p.PROJECT_RELEASE="PROJECT_RELEASE",p.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",p.PLATFORM_ASSET="PLATFORM_ASSET",p.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",p.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",p.KNOWLEDGE_BASE="KNOWLEDGE_BASE",p.FLOW_BUNDLE="FLOW_BUNDLE",p))(no||{}),oo=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(oo||{}),io=(r=>(r.S3="S3",r.DB="DB",r))(io||{}),Nv=u({...K,projectId:Z(n()),platformId:Z(n()),type:b(no),compression:b(oo),data:c(k()),location:b(io),size:Z(G()),fileName:Z(n()),s3Key:Z(n()),metadata:Z(R(n(),n()))}),ao=(i=>(i.ADMIN="ADMIN",i.MEMBER="MEMBER",i.OPERATOR="OPERATOR",i))(ao||{}),so=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(so||{}),Cv=u({id:n(),email:n(),firstName:n(),status:b(so),externalId:Z(n()),platformId:Z(n()),platformRole:b(ao),lastName:n(),created:fe,updated:fe,lastActiveDate:Z(fe),imageUrl:Z(n())});var Bt=u({...N.shape,...D(R(n(),k()),"OBJECT").shape});var Gt=u({...N.shape,formatProperty:c(n()),...D(n(),"RICH_TEXT").shape});var po=u({...N.shape,...D(n(),"COLOR").shape});var Wt=w([W,te,Gt,ut,ne,H,re,kt,we,Dt,oe,Ue,Bt,Me,Ce,Rt,Ne,po]),dt={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 Q=u({displayName:n(),description:c(n()),hasConnectionIdentifier:c(U())});var mo=u({username:n(),password:n()}),Ht=u({...Q.shape,username:u({displayName:n(),description:c(n())}),password:u({displayName:n(),description:c(n())}),...D(mo,"BASIC_AUTH").shape});var Qa=R(n(),w([W,te,oe,ne,H])),Kt=u({...Q.shape,props:Qa,...D(k(),"CUSTOM_AUTH").shape});var he=u({...Q.shape,...D(u({auth:n()}),"SECRET_TEXT").shape});var es=R(n(),w([W,te,he,oe,ne,H,re,ut])),fo=u({...Q.shape,props:es,...D(k(),"OIDC").shape});var Jt=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Jt||{}),go=w([W,he,H]),yo=R(n(),go),ts=u({props:c(R(n(),go)),authUrl:n(),tokenUrl:n(),scope:z(n()),prompt:c(w([E("none"),E("consent"),E("login"),E("omit")])),pkce:c(U()),pkceMethod:c(w([E("plain"),E("S256")])),authorizationMethod:c(b(Jt)),grantType:c(w([b(je),E(wt)])),extra:c(R(n(),n()))}),ho=u({access_token:n(),props:c(yo),data:R(n(),ke())}),Xt=u({...Q.shape,...ts.shape,...D(ho,"OAUTH2").shape});var Ee=w([Ht,Kt,fo,Xt,he]),Be="Connection",qt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Be}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Be,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Be}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Be}},None(){}};var x_={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 rs=u({...N.shape,...D(k(),"CUSTOM").shape,code:n()});var os=w([Wt,Ee]),Yt=R(n(),os),j_=R(n(),Wt);var vo=w([u({strategy:E("CRON"),cronExpression:n()}),u({strategy:E("NONE")})]);var xo="2",mt="0.82.0";var Qt=class{constructor(t,r,i,s,d,m,f,v,x=mt,I,C="",_){this.displayName=t;this.logoUrl=r;this.authors=i;this.events=s;this.categories=f;this.auth=v;this.minimumSupportedRelease=x;this.maximumSupportedRelease=I;this.description=C;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:xo}),"getContextInfo");(!as(x)||ss(x,mt))&&(this.minimumSupportedRelease=mt),d.forEach(a=>this._actions[a.name]=a),m.forEach(a=>this._triggers[a.name]=a)}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:is(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}},Po=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,i,s)=>i===s.findIndex(d=>d.type===r.type)))throw new Error("Auth properties must be unique by type");return new Qt(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 is(e){if(e!==void 0)return Array.isArray(e)?e.map(_o):_o(e)}o(is,"withConnectionIdentifierFlag");function _o(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}o(_o,"flagConnectionIdentifier");function as(e){return/^\d+\.\d+\.\d+$/.test(e)}o(as,"isValidSimpleSemver");function ss(e,t){let[r,i,s]=e.split(".").map(Number),[d,m,f]=t.split(".").map(Number);return r!==d?r<d:i!==m?i<m:s<f}o(ss,"isSemverLessThan");var us=c(R(n(),R(n(),n()))),Io=u({id:c(n()),name:n(),displayName:n(),logoUrl:n(),description:n(),authors:z(n()),platformId:c(n()),directoryPath:c(n()),auth:c(w([Ee,z(Ee)])),version:n(),categories:c(z(b(Pe))),minimumSupportedRelease:c(n()),maximumSupportedRelease:c(n()),deprecated:c(U()),i18n:us}),cs=b(["human","ai","both"]),To=u({description:c(n()),idempotent:c(U())}),Eo=b(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var ls=b(["tabs","section","summary","builder","footer"]),bo=u({key:n(),display:ls,label:c(n()),description:c(n()),icon:c(n()),props:z(n())}),$o=u({name:n(),displayName:n(),description:n(),props:Yt,propertyGroups:c(z(bo)),requireAuth:U(),errorHandlingOptions:c(Ot),outputSchema:c(at()),audience:c(cs),aiMetadata:c(To),classification:c(Eo)}),zo=u({name:n(),displayName:n(),description:n(),props:Yt,propertyGroups:c(z(bo)),errorHandlingOptions:c(Ot),type:b(ge),sampleData:k(),handshakeConfiguration:c(at()),renewConfiguration:c(vo),testStrategy:b(Fe),outputSchema:c(at()),aiMetadata:c(To),classification:c(Eo)}),ps=u({...Io.shape,actions:R(n(),$o),triggers:R(n(),zo)}),ds=u({...Io.shape,actions:G(),triggers:G(),suggestedActions:c(z($o)),suggestedTriggers:c(z(zo))}),So=u({projectUsage:G(),pieceType:b(_e),packageType:b(Le),platformId:c(n()),archiveId:c(n())}),FP=u({...ps.shape,...So.shape}),VP=u({...ds.shape,...So.shape}),BP=u({name:n(),version:n()});var ms=Ge(require("path")),fs=Ge(require("fs/promises"));var gs=`
2
2
  **Advanced Piece**
3
3
  <br>
4
4
  Use this piece if you are unsure which connection to use beforehand, such as when the connection external ID is sent through a webhook message.
@@ -7,4 +7,4 @@ Use this piece if you are unsure which connection to use beforehand, such as whe
7
7
  - You can retrieve the external ID from the connection settings page by hovering over the connection name.
8
8
  - Use this action to retrieve connection values by their external IDs from this project.
9
9
  - After testing the step, you can use the dynamic value in the piece by clicking (X) and referring to this step.
10
- `,Io=gn({audience:"both",name:"read_connection",displayName:"Read Connection",description:"Fetch connection by name",props:{info:dt.MarkDown({value:is}),connection_name:dt.ShortText({displayName:"Connection External ID",description:void 0,required:!0})},async run(e){let t=await e.connections.get(e.propsValue.connection_name);if(q(t))throw new Error(JSON.stringify({message:"Connection not found",connectionName:e.propsValue.connection_name}));return t}});var as=yo({displayName:"Connections",description:"Read connections dynamically",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/new-core/connections.svg",categories:["CORE"],auth:Jt.None(),authors:["kishanprmr","AbdulTheActivePiecer","khaledmashaly","abuaboud"],actions:[Io],triggers:[]});0&&(module.exports={connections});
10
+ `,Ao=hn({audience:"both",name:"read_connection",classification:"READ",displayName:"Read Connection",description:"Fetch connection by name",aiMetadata:{description:"Looks up a stored app connection in the current project by its external ID, so a flow can resolve credentials at runtime instead of binding one fixed connection at build time (for example when the external ID arrives in a webhook payload). When the connection is known up front, configure the target piece action with its own auth instead. Requires the exact external ID and throws if no connection matches; read-only and idempotent.",idempotent:!0},props:{info:dt.MarkDown({value:gs}),connection_name:dt.ShortText({displayName:"Connection External ID",description:void 0,required:!0})},async run(e){let t=await e.connections.get(e.propsValue.connection_name);if(q(t))throw new Error(JSON.stringify({message:"Connection not found",connectionName:e.propsValue.connection_name}));return t}});var ys=Po({displayName:"Connections",description:"Read connections dynamically",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/new-core/connections.svg",categories:["CORE"],auth:qt.None(),authors:["kishanprmr","AbdulTheActivePiecer","khaledmashaly","abuaboud"],actions:[Ao],triggers:[]});0&&(module.exports={connections});