@activepieces/piece-katana 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -22
- package/src/index.js +20 -37
- package/README.md +0 -7
- package/src/index.d.ts +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/create-customer.d.ts +0 -14
- package/src/lib/actions/create-customer.js +0 -196
- package/src/lib/actions/create-customer.js.map +0 -1
- package/src/lib/actions/create-sales-order.d.ts +0 -23
- package/src/lib/actions/create-sales-order.js +0 -275
- package/src/lib/actions/create-sales-order.js.map +0 -1
- package/src/lib/actions/find-customer.d.ts +0 -14
- package/src/lib/actions/find-customer.js +0 -117
- package/src/lib/actions/find-customer.js.map +0 -1
- package/src/lib/actions/index.d.ts +0 -3
- package/src/lib/actions/index.js +0 -7
- package/src/lib/actions/index.js.map +0 -1
- package/src/lib/common/auth.d.ts +0 -1
- package/src/lib/common/auth.js +0 -41
- package/src/lib/common/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -2
- package/src/lib/common/client.js +0 -22
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/constants.d.ts +0 -1
- package/src/lib/common/constants.js +0 -5
- package/src/lib/common/constants.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -4
- package/src/lib/common/index.js +0 -8
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -5
- package/src/lib/common/props.js +0 -212
- package/src/lib/common/props.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-katana",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"deepmerge-ts": "7.1.0",
|
|
13
|
-
"form-data": "4.0.4",
|
|
14
|
-
"mime-types": "2.1.35",
|
|
15
|
-
"nanoid": "3.3.8",
|
|
16
|
-
"semver": "7.6.0",
|
|
17
|
-
"socket.io-client": "4.8.1",
|
|
18
|
-
"tslib": "^2.3.0",
|
|
19
|
-
"zod": "4.1.13",
|
|
20
|
-
"@activepieces/pieces-common": "0.11.6",
|
|
21
|
-
"@activepieces/pieces-framework": "0.25.4",
|
|
22
|
-
"@activepieces/shared": "0.37.0"
|
|
23
|
-
},
|
|
24
|
-
"resolutions": {
|
|
25
|
-
"rollup": "npm:@rollup/wasm-node"
|
|
26
|
-
}
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"files": [
|
|
8
|
+
"src/index.js",
|
|
9
|
+
"package.json",
|
|
10
|
+
"src/i18n"
|
|
11
|
+
]
|
|
27
12
|
}
|
package/src/index.js
CHANGED
|
@@ -1,37 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const create_customer_1 = require("./lib/actions/create-customer");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
actions: [
|
|
22
|
-
create_customer_1.createCustomer,
|
|
23
|
-
create_sales_order_1.createSalesOrder,
|
|
24
|
-
find_customer_1.findCustomer,
|
|
25
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
26
|
-
auth: auth_1.katanaAuth,
|
|
27
|
-
baseUrl: () => constants_1.BASE_URL,
|
|
28
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
-
return ({
|
|
30
|
-
Authorization: `Bearer ${auth.secret_text}`,
|
|
31
|
-
});
|
|
32
|
-
}),
|
|
33
|
-
}),
|
|
34
|
-
],
|
|
35
|
-
triggers: [],
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var js=Object.create;var Qe=Object.defineProperty;var Ls=Object.getOwnPropertyDescriptor;var Fs=Object.getOwnPropertyNames;var Bs=Object.getPrototypeOf,Zs=Object.prototype.hasOwnProperty;var o=(e,t)=>Qe(e,"name",{value:t,configurable:!0});var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),dn=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})},mn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fs(t))!Zs.call(e,i)&&i!==r&&Qe(e,i,{get:()=>t[i],enumerable:!(n=Ls(t,i))||n.enumerable});return e};var Me=(e,t,r)=>(r=e!=null?js(Bs(e)):{},mn(t||!e||!e.__esModule?Qe(r,"default",{value:e,enumerable:!0}):r,e)),Vs=e=>mn(Qe({},"__esModule",{value:!0}),e);var ko=$((Oo,Ft)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function g(s,p){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let f=0,m=-1,v=(s.match(d.zoneIndex)||[])[0],b,M;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)f++;if(s.substr(0,2)==="::"&&f--,s.substr(-2,2)==="::"&&f--,f>p)return null;for(M=p-f,b=":";M--;)b+="0:";return s=s.replace("::",b),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),p=function(){let ee=s.split(":"),ie=[];for(let le=0;le<ee.length;le++)ie.push(parseInt(ee[le],16));return ie}(),{parts:p,zoneId:v}}o(g,"expandIPv6");function y(s,p,f,m){if(s.length!==p.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,b;for(;m>0;){if(b=f-m,b<0&&(b=0),s[v]>>b!==p[v]>>b)return!1;m-=f,v+=1}return!0}o(y,"matchCIDR");function P(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(P,"parseIntAuto");function T(s,p){for(;s.length<p;)s=`0${s}`;return s}o(T,"padPart");let x={};x.IPv4=function(){function s(p){if(p.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let f,m;for(f=0;f<p.length;f++)if(m=p[f],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=p}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(p,f){let m;if(f===void 0&&(m=p,p=m[0],f=m[1]),p.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,p.octets,8,f)},s.prototype.prefixLengthFromSubnetMask=function(){let p=0,f=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,b,M;for(v=3;v>=0;v-=1)if(b=this.octets[v],b in m){if(M=m[b],f&&M!==0)return null;M!==8&&(f=!0),p+=M}else return null;return 32-p},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let p=this.parseCIDR(s),f=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],b=0;for(;b<4;)v.push(parseInt(f[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let p=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!p?!1:x.IPv4.isValidFourPartDecimal(p[1])},x.IPv4.networkAddressFromCIDR=function(s){let p,f,m,v,b;try{for(p=this.parseCIDR(s),m=p[0].toByteArray(),b=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],f=0;f<4;)v.push(parseInt(m[f],10)&parseInt(b[f],10)),f++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let p=this.parser(s);if(p===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(p)},x.IPv4.parseCIDR=function(s){let p;if(p=s.match(/^(.+)\/(\d+)$/)){let f=parseInt(p[2]);if(f>=0&&f<=32){let m=[this.parse(p[1]),f];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let p,f,m;if(p=s.match(r.fourOctet))return function(){let v=p.slice(1,6),b=[];for(let M=0;M<v.length;M++)f=v[M],b.push(P(f));return b}();if(p=s.match(r.longValue)){if(m=P(p[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],b;for(b=0;b<=24;b+=8)v.push(m>>b&255);return v}().reverse()}else return(p=s.match(r.twoOctet))?function(){let v=p.slice(1,4),b=[];if(m=P(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(v[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b}():(p=s.match(r.threeOctet))?function(){let v=p.slice(1,5),b=[];if(m=P(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(v[0])),b.push(P(v[1])),b.push(m>>8&255),b.push(m&255),b}():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let p=[0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)p[f]=255,f++;return m<4&&(p[m]=Math.pow(2,s%8)-1<<8-s%8),new this(p)},x.IPv6=function(){function s(p,f){let m,v;if(p.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(p[m]<<8|p[m+1]);else if(p.length===8)this.parts=p;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");f&&(this.zoneId=f)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(p,f){let m;if(f===void 0&&(m=p,p=m[0],f=m[1]),p.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,p.parts,16,f)},s.prototype.prefixLengthFromSubnetMask=function(){let p=0,f=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,b;for(let M=7;M>=0;M-=1)if(v=this.parts[M],v in m){if(b=m[v],f&&b!==0)return null;b!==16&&(f=!0),p+=b}else return null;return 128-p},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let p,f=[],m=this.parts;for(let v=0;v<m.length;v++)p=m[v],f.push(p>>8),f.push(p&255);return f},s.prototype.toFixedLengthString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(T(this.parts[v].toString(16),4));return m}.call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),p+f},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let p=this.parts.slice(-2),f=p[0],m=p[1];return new x.IPv4([f>>8,f&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),p+f},s.prototype.toRFC5952String=function(){let p=/((^|:)(0(:|$)){2,})/g,f=this.toNormalizedString(),m=0,v=-1,b;for(;b=p.exec(f);)b[0].length>v&&(m=b.index,v=b[0].length);return v<0?f:`${f.substring(0,m)}::${f.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let p=this.parseCIDR(s),f=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],b=0;for(;b<16;)v.push(parseInt(f[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch(p){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${p})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let p=this.parser(s);return new this(p.parts,p.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let p,f,m,v,b;try{for(p=this.parseCIDR(s),m=p[0].toByteArray(),b=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],f=0;f<16;)v.push(parseInt(m[f],10)&parseInt(b[f],10)),f++;return new this(v)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},x.IPv6.parse=function(s){let p=this.parser(s);if(p.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(p.parts,p.zoneId)},x.IPv6.parseCIDR=function(s){let p,f,m;if((f=s.match(/^(.+)\/(\d+)$/))&&(p=parseInt(f[2]),p>=0&&p<=128))return m=[this.parse(f[1]),p],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let p,f,m,v,b,M;if(m=s.match(d.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(d.native.test(s))return g(s,8);if((m=s.match(d.transitional))&&(M=m[6]||"",p=m[1],m[1].endsWith("::")||(p=p.slice(0,-1)),p=g(p+M,6),p.parts)){for(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],f=0;f<b.length;f++)if(v=b[f],!(0<=v&&v<=255))return null;return p.parts.push(b[0]<<8|b[1]),p.parts.push(b[2]<<8|b[3]),{parts:p.parts,zoneId:p.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)p[f]=255,f++;return m<16&&(p[m]=Math.pow(2,s%8)-1<<8-s%8),new this(p)},x.fromByteArray=function(s){let p=s.length;if(p===4)return new x.IPv4(s);if(p===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let p=this.parse(s);return p.kind()==="ipv6"&&p.isIPv4MappedAddress()?p.toIPv4Address():p},x.subnetMatch=function(s,p,f){let m,v,b,M;f==null&&(f="unicast");for(v in p)if(Object.prototype.hasOwnProperty.call(p,v)){for(b=p[v],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(M=b[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return v}return f},typeof Ft<"u"&&Ft.exports?Ft.exports=x:e.ipaddr=x})(Oo)});var Si=$((VS,$i)=>{var Ei=require("stream").Stream,xl=require("util");$i.exports=de;function de(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(de,"DelayedStream");xl.inherits(de,Ei);de.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(de.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});de.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};de.prototype.resume=function(){this._released||this.release(),this.source.resume()};de.prototype.pause=function(){this.source.pause()};de.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};de.prototype.pipe=function(){var e=Ei.prototype.pipe.apply(this,arguments);return this.resume(),e};de.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};de.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var ki=$((qS,Oi)=>{var _l=require("util"),zi=require("stream").Stream,Ai=Si();Oi.exports=J;function J(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(J,"CombinedStream");_l.inherits(J,zi);J.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};J.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};J.prototype.append=function(e){var t=J.isStreamLike(e);if(t){if(!(e instanceof Ai)){var r=Ai.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};J.prototype.pipe=function(e,t){return zi.prototype.pipe.call(this,e,t),this.resume(),e};J.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};J.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=J.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};J.prototype._pipeNext=function(e){this._currentStream=e;var t=J.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};J.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};J.prototype.write=function(e){this.emit("data",e)};J.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};J.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};J.prototype.end=function(){this._reset(),this.emit("end")};J.prototype.destroy=function(){this._reset(),this.emit("close")};J.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};J.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};J.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};J.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ri=$((GS,wi)=>{"use strict";wi.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var Ci=$(ae=>{"use strict";var Wt=Ri(),Pl=require("path").extname,Ni=/^\s*([^;\s]*)(?:;|\s|$)/,bl=/^text\//i;ae.charset=Di;ae.charsets={lookup:Di};ae.contentType=Tl;ae.extension=Il;ae.extensions=Object.create(null);ae.lookup=El;ae.types=Object.create(null);$l(ae.extensions,ae.types);function Di(e){if(!e||typeof e!="string")return!1;var t=Ni.exec(e),r=t&&Wt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&bl.test(t[1])?"UTF-8":!1}o(Di,"charset");function Tl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?ae.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=ae.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Tl,"contentType");function Il(e){if(!e||typeof e!="string")return!1;var t=Ni.exec(e),r=t&&ae.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Il,"extension");function El(e){if(!e||typeof e!="string")return!1;var t=Pl("x."+e).toLowerCase().substr(1);return t&&ae.types[t]||!1}o(El,"lookup");function $l(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Wt).forEach(o(function(i){var u=Wt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var d=0;d<c.length;d++){var g=c[d];if(t[g]){var y=r.indexOf(Wt[t[g]].source),P=r.indexOf(u.source);if(t[g]!=="application/octet-stream"&&(y>P||y===P&&t[g].substr(0,12)==="application/"))continue}t[g]=i}}},"forEachMimeType"))}o($l,"populateMaps")});var Mi=$((XS,Ui)=>{Ui.exports=Sl;function Sl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Sl,"defer")});var Zr=$((QS,Li)=>{var ji=Mi();Li.exports=Al;function Al(e){var t=!1;return ji(function(){t=!0}),o(function(n,i){t?e(n,i):ji(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Al,"async")});var Vr=$((tA,Fi)=>{Fi.exports=zl;function zl(e){Object.keys(e.jobs).forEach(Ol.bind(e)),e.jobs={}}o(zl,"abort");function Ol(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Ol,"clean")});var Hr=$((nA,Zi)=>{var Bi=Zr(),kl=Vr();Zi.exports=wl;function wl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Rl(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?kl(r):r.results[i]=c,n(u,r.results))})}o(wl,"iterate");function Rl(e,t,r,n){var i;return e.length==2?i=e(r,Bi(n)):i=e(r,t,Bi(n)),i}o(Rl,"runJob")});var qr=$((iA,Vi)=>{Vi.exports=Nl;function Nl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(Nl,"state")});var Wr=$((sA,Hi)=>{var Dl=Vr(),Cl=Zr();Hi.exports=Ul;function Ul(e){Object.keys(this.jobs).length&&(this.index=this.size,Dl(this),Cl(e)(null,this.results))}o(Ul,"terminator")});var Wi=$((cA,qi)=>{var Ml=Hr(),jl=qr(),Ll=Wr();qi.exports=Fl;function Fl(e,t,r){for(var n=jl(e);n.index<(n.keyedList||e).length;)Ml(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Ll.bind(n,r)}o(Fl,"parallel")});var Gr=$((pA,Gt)=>{var Gi=Hr(),Bl=qr(),Zl=Wr();Gt.exports=Vl;Gt.exports.ascending=Ki;Gt.exports.descending=Hl;function Vl(e,t,r,n){var i=Bl(e,r);return Gi(e,t,i,o(function u(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||e).length){Gi(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Zl.bind(i,n)}o(Vl,"serialOrdered");function Ki(e,t){return e<t?-1:e>t?1:0}o(Ki,"ascending");function Hl(e,t){return-1*Ki(e,t)}o(Hl,"descending")});var Xi=$((mA,Ji)=>{var ql=Gr();Ji.exports=Wl;function Wl(e,t,r){return ql(e,t,null,r)}o(Wl,"serial")});var Qi=$((gA,Yi)=>{Yi.exports={parallel:Wi(),serial:Xi(),serialOrdered:Gr()}});var Kr=$((yA,ea)=>{"use strict";ea.exports=Object});var ra=$((hA,ta)=>{"use strict";ta.exports=Error});var oa=$((vA,na)=>{"use strict";na.exports=EvalError});var aa=$((xA,ia)=>{"use strict";ia.exports=RangeError});var ua=$((_A,sa)=>{"use strict";sa.exports=ReferenceError});var la=$((PA,ca)=>{"use strict";ca.exports=SyntaxError});var Kt=$((bA,pa)=>{"use strict";pa.exports=TypeError});var ma=$((TA,da)=>{"use strict";da.exports=URIError});var ga=$((IA,fa)=>{"use strict";fa.exports=Math.abs});var ha=$((EA,ya)=>{"use strict";ya.exports=Math.floor});var xa=$(($A,va)=>{"use strict";va.exports=Math.max});var Pa=$((SA,_a)=>{"use strict";_a.exports=Math.min});var Ta=$((AA,ba)=>{"use strict";ba.exports=Math.pow});var Ea=$((zA,Ia)=>{"use strict";Ia.exports=Math.round});var Sa=$((OA,$a)=>{"use strict";$a.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var za=$((wA,Aa)=>{"use strict";var Gl=Sa();Aa.exports=o(function(t){return Gl(t)||t===0?t:t<0?-1:1},"sign")});var ka=$((NA,Oa)=>{"use strict";Oa.exports=Object.getOwnPropertyDescriptor});var Jr=$((DA,wa)=>{"use strict";var Jt=ka();if(Jt)try{Jt([],"length")}catch{Jt=null}wa.exports=Jt});var Na=$((CA,Ra)=>{"use strict";var Xt=Object.defineProperty||!1;if(Xt)try{Xt({},"a",{value:1})}catch{Xt=!1}Ra.exports=Xt});var Xr=$((UA,Da)=>{"use strict";Da.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(t,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ma=$((jA,Ua)=>{"use strict";var Ca=typeof Symbol<"u"&&Symbol,Kl=Xr();Ua.exports=o(function(){return typeof Ca!="function"||typeof Symbol!="function"||typeof Ca("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Kl()},"hasNativeSymbols")});var Yr=$((FA,ja)=>{"use strict";ja.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Qr=$((BA,La)=>{"use strict";var Jl=Kr();La.exports=Jl.getPrototypeOf||null});var Za=$((ZA,Ba)=>{"use strict";var Xl="Function.prototype.bind called on incompatible ",Yl=Object.prototype.toString,Ql=Math.max,ep="[object Function]",Fa=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),tp=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),rp=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Ba.exports=o(function(t){var r=this;if(typeof r!="function"||Yl.apply(r)!==ep)throw new TypeError(Xl+r);for(var n=tp(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,Fa(n,arguments));return Object(P)===P?P:this}return r.apply(t,Fa(n,arguments))},"binder"),c=Ql(0,r.length-n.length),d=[],g=0;g<c;g++)d[g]="$"+g;if(i=Function("binder","return function ("+rp(d,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var y=o(function(){},"Empty");y.prototype=r.prototype,i.prototype=new y,y.prototype=null}return i},"bind")});var Ge=$((HA,Va)=>{"use strict";var np=Za();Va.exports=Function.prototype.bind||np});var Yt=$((qA,Ha)=>{"use strict";Ha.exports=Function.prototype.call});var en=$((WA,qa)=>{"use strict";qa.exports=Function.prototype.apply});var Ga=$((GA,Wa)=>{"use strict";Wa.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ja=$((KA,Ka)=>{"use strict";var op=Ge(),ip=en(),ap=Yt(),sp=Ga();Ka.exports=sp||op.call(ap,ip)});var Ya=$((JA,Xa)=>{"use strict";var up=Ge(),cp=Kt(),lp=Yt(),pp=Ja();Xa.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new cp("a function is required");return pp(up,lp,t)},"callBindBasic")});var os=$((YA,ns)=>{"use strict";var dp=Ya(),Qa=Jr(),ts;try{ts=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var tn=!!ts&&Qa&&Qa(Object.prototype,"__proto__"),rs=Object,es=rs.getPrototypeOf;ns.exports=tn&&typeof tn.get=="function"?dp([tn.get]):typeof es=="function"?o(function(t){return es(t==null?t:rs(t))},"getDunder"):!1});var cs=$((ez,us)=>{"use strict";var is=Yr(),as=Qr(),ss=os();us.exports=is?o(function(t){return is(t)},"getProto"):as?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return as(t)},"getProto"):ss?o(function(t){return ss(t)},"getProto"):null});var rn=$((rz,ls)=>{"use strict";var mp=Function.prototype.call,fp=Object.prototype.hasOwnProperty,gp=Ge();ls.exports=gp.call(mp,fp)});var hs=$((nz,ys)=>{"use strict";var j,yp=Kr(),hp=ra(),vp=oa(),xp=aa(),_p=ua(),Ye=la(),Xe=Kt(),Pp=ma(),bp=ga(),Tp=ha(),Ip=xa(),Ep=Pa(),$p=Ta(),Sp=Ea(),Ap=za(),fs=Function,nn=o(function(e){try{return fs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),_t=Jr(),zp=Na(),on=o(function(){throw new Xe},"throwTypeError"),Op=_t?function(){try{return arguments.callee,on}catch{try{return _t(arguments,"callee").get}catch{return on}}}():on,Ke=Ma()(),Q=cs(),kp=Qr(),wp=Yr(),gs=en(),Pt=Yt(),Je={},Rp=typeof Uint8Array>"u"||!Q?j:Q(Uint8Array),Ue={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?j:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?j:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&Q?Q([][Symbol.iterator]()):j,"%AsyncFromSyncIteratorPrototype%":j,"%AsyncFunction%":Je,"%AsyncGenerator%":Je,"%AsyncGeneratorFunction%":Je,"%AsyncIteratorPrototype%":Je,"%Atomics%":typeof Atomics>"u"?j:Atomics,"%BigInt%":typeof BigInt>"u"?j:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?j:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?j:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?j:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":hp,"%eval%":eval,"%EvalError%":vp,"%Float16Array%":typeof Float16Array>"u"?j:Float16Array,"%Float32Array%":typeof Float32Array>"u"?j:Float32Array,"%Float64Array%":typeof Float64Array>"u"?j:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?j:FinalizationRegistry,"%Function%":fs,"%GeneratorFunction%":Je,"%Int8Array%":typeof Int8Array>"u"?j:Int8Array,"%Int16Array%":typeof Int16Array>"u"?j:Int16Array,"%Int32Array%":typeof Int32Array>"u"?j:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&Q?Q(Q([][Symbol.iterator]())):j,"%JSON%":typeof JSON=="object"?JSON:j,"%Map%":typeof Map>"u"?j:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!Q?j:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":yp,"%Object.getOwnPropertyDescriptor%":_t,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?j:Promise,"%Proxy%":typeof Proxy>"u"?j:Proxy,"%RangeError%":xp,"%ReferenceError%":_p,"%Reflect%":typeof Reflect>"u"?j:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?j:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!Q?j:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?j:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&Q?Q(""[Symbol.iterator]()):j,"%Symbol%":Ke?Symbol:j,"%SyntaxError%":Ye,"%ThrowTypeError%":Op,"%TypedArray%":Rp,"%TypeError%":Xe,"%Uint8Array%":typeof Uint8Array>"u"?j:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?j:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?j:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?j:Uint32Array,"%URIError%":Pp,"%WeakMap%":typeof WeakMap>"u"?j:WeakMap,"%WeakRef%":typeof WeakRef>"u"?j:WeakRef,"%WeakSet%":typeof WeakSet>"u"?j:WeakSet,"%Function.prototype.call%":Pt,"%Function.prototype.apply%":gs,"%Object.defineProperty%":zp,"%Object.getPrototypeOf%":kp,"%Math.abs%":bp,"%Math.floor%":Tp,"%Math.max%":Ip,"%Math.min%":Ep,"%Math.pow%":$p,"%Math.round%":Sp,"%Math.sign%":Ap,"%Reflect.getPrototypeOf%":wp};if(Q)try{null.error}catch(e){ps=Q(Q(e)),Ue["%Error.prototype%"]=ps}var ps,Np=o(function e(t){var r;if(t==="%AsyncFunction%")r=nn("async function () {}");else if(t==="%GeneratorFunction%")r=nn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=nn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Q&&(r=Q(i.prototype))}return Ue[t]=r,r},"doEval"),ds={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bt=Ge(),Qt=rn(),Dp=bt.call(Pt,Array.prototype.concat),Cp=bt.call(gs,Array.prototype.splice),ms=bt.call(Pt,String.prototype.replace),er=bt.call(Pt,String.prototype.slice),Up=bt.call(Pt,RegExp.prototype.exec),Mp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,jp=/\\(\\)?/g,Lp=o(function(t){var r=er(t,0,1),n=er(t,-1);if(r==="%"&&n!=="%")throw new Ye("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ye("invalid intrinsic syntax, expected opening `%`");var i=[];return ms(t,Mp,function(u,c,d,g){i[i.length]=d?ms(g,jp,"$1"):c||u}),i},"stringToPath"),Fp=o(function(t,r){var n=t,i;if(Qt(ds,n)&&(i=ds[n],n="%"+i[0]+"%"),Qt(Ue,n)){var u=Ue[n];if(u===Je&&(u=Np(n)),typeof u>"u"&&!r)throw new Xe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ye("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");ys.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xe('"allowMissing" argument must be a boolean');if(Up(/^%?[^%]*%?$/,t)===null)throw new Ye("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Lp(t),i=n.length>0?n[0]:"",u=Fp("%"+i+"%",r),c=u.name,d=u.value,g=!1,y=u.alias;y&&(i=y[0],Cp(n,Dp([0,1],y)));for(var P=1,T=!0;P<n.length;P+=1){var x=n[P],s=er(x,0,1),p=er(x,-1);if((s==='"'||s==="'"||s==="`"||p==='"'||p==="'"||p==="`")&&s!==p)throw new Ye("property names with quotes must have matching quotes");if((x==="constructor"||!T)&&(g=!0),i+="."+x,c="%"+i+"%",Qt(Ue,c))d=Ue[c];else if(d!=null){if(!(x in d)){if(!r)throw new Xe("base intrinsic for "+t+" exists, but the property is not available.");return}if(_t&&P+1>=n.length){var f=_t(d,x);T=!!f,T&&"get"in f&&!("originalValue"in f.get)?d=f.get:d=d[x]}else T=Qt(d,x),d=d[x];T&&!g&&(Ue[c]=d)}}return d},"GetIntrinsic")});var xs=$((iz,vs)=>{"use strict";var Bp=Xr();vs.exports=o(function(){return Bp()&&!!Symbol.toStringTag},"hasToStringTagShams")});var bs=$((sz,Ps)=>{"use strict";var Zp=hs(),_s=Zp("%Object.defineProperty%",!0),Vp=xs()(),Hp=rn(),qp=Kt(),tr=Vp?Symbol.toStringTag:null;Ps.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new qp("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");tr&&(n||!Hp(t,tr))&&(_s?_s(t,tr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[tr]=r)},"setToStringTag")});var Is=$((cz,Ts)=>{"use strict";var Wp=Function.prototype.call,Gp=Object.prototype.hasOwnProperty,Kp=Ge();Ts.exports=Kp.call(Wp,Gp)});var $s=$((lz,Es)=>{"use strict";Es.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var zs=$((pz,As)=>{"use strict";var cn=ki(),Jp=require("util"),an=require("path"),Xp=require("http"),Yp=require("https"),Qp=require("url").parse,ed=require("fs"),td=require("stream").Stream,rd=require("crypto"),sn=Ci(),nd=Qi(),od=bs(),we=Is(),un=$s();function Ss(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Ss,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");Jp.inherits(L,cn);L.LINE_BREAK=`\r
|
|
2
|
+
`;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=cn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof td))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){we(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):ed.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):we(e,"httpVersion")?t(null,Number(e.headers["content-length"])):we(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Ss(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&un(c,r.header);var d;for(var g in c)if(we(c,g)){if(d=c[g],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(u+=g+": "+d.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=an.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=an.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=an.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ss(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=sn.lookup(e.name)),!r&&e&&e.path&&(r=sn.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=sn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)we(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+rd.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}nd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Qp(e),n=un({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=un(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Yp.request(n):r=Xp.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var d,g=o(function(y,P){return r.removeListener("error",g),r.removeListener("response",d),t.call(this,y,P)},"callback");d=g.bind(this,null),r.on("error",g),r.on("response",d)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};od(L.prototype,"FormData");As.exports=L});var md={};dn(md,{katana:()=>dd});module.exports=Vs(md);var Hs=Object.freeze({status:"aborted"});function I(e,t,r){function n(d,g){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:g,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,g);let y=c.prototype,P=Object.keys(y);for(let T=0;T<P.length;T++){let x=P[T];x in d||(d[x]=y[x].bind(d))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(d){var g;let y=r?.Parent?new u:this;n(y,d),(g=y._zod).deferred??(g.deferred=[]);for(let P of y._zod.deferred)P();return y}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(I,"$constructor");var qs=Symbol("zod_brand"),fe=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Tt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},or={};function ye(e){return e&&Object.assign(or,e),or}o(ye,"config");function ar(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(ar,"getEnumValues");function gn(e,t){return typeof t=="bigint"?t.toString():t}o(gn,"jsonStringifyReplacer");function Et(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Et,"cached");function yn(e){return e==null}o(yn,"nullish");function $t(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o($t,"cleanRegex");var fn=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==fn)return n===void 0&&(n=fn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(X,"defineLazy");var sr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(et,"isObject");var Ws=Et(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function hn(e){if(et(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(et(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(hn,"isPlainObject");var vn=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(je,"escapeRegex");function St(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(St,"clone");function W(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(W,"normalizeParams");function xn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(xn,"optionalKeys");var Gs={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Le(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(Le,"aborted");function Ie(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ie,"prefixIssues");function It(e){return typeof e=="string"?e:e?.message}o(It,"unwrapMessage");function Ee(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(r.customError?.(e))??It(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ee,"finalizeIssue");function _n(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(_n,"getLengthableOrigin");function ur(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(ur,"issue");var Pn=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,gn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),bn=I("$ZodError",Pn),tt=I("$ZodError",Pn,{Parent:Error});var Js=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new fe;if(c.issues.length){let d=new(i?.Err??e)(c.issues.map(g=>Ee(g,u,ye())));throw sr(d,i?.callee),d}return c.value},"_parse"),At=Js(tt),Xs=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??e)(c.issues.map(g=>Ee(g,u,ye())));throw sr(d,i?.callee),d}return c.value},"_parseAsync"),zt=Xs(tt),Ys=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new fe;return u.issues.length?{success:!1,error:new(e??bn)(u.issues.map(c=>Ee(c,i,ye())))}:{success:!0,data:u.value}},"_safeParse"),rt=Ys(tt),Qs=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Ee(c,i,ye())))}:{success:!0,data:u.value}},"_safeParseAsync"),nt=Qs(tt);var eu="(?:(?:\\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])))",tu=new RegExp(`^${eu}$`);var Tn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),In=/^-?\d+n?$/;var cr=/^-?\d+(?:\.\d+)?$/,En=/^(?:true|false)$/i;var Fe=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var $n=I("$ZodCheckMinLength",(e,t)=>{var r;Fe.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!yn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=_n(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var lr=I("$ZodCheckStringFormat",(e,t)=>{var r,n;Fe.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Sn=I("$ZodCheckRegex",(e,t)=>{lr.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 zn={major:4,minor:3,patch:6};var G=I("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,d,g)=>{let y=Le(c),P;for(let T of d){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(y)continue;let x=c.issues.length,s=T._zod.check(c);if(s instanceof Promise&&g?.async===!1)throw new fe;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(y||(y=Le(c,x)))});else{if(c.issues.length===x)continue;y||(y=Le(c,x))}}return P?P.then(()=>c):c},"runChecks"),u=o((c,d,g)=>{if(Le(c))return c.aborted=!0,c;let y=i(d,n,g);if(y instanceof Promise){if(g.async===!1)throw new fe;return y.then(P=>e._zod.parse(P,g))}return e._zod.parse(y,g)},"handleCanaryResult");e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){let y=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return y instanceof Promise?y.then(P=>u(P,c,d)):u(y,c,d)}let g=e._zod.parse(c,d);if(g instanceof Promise){if(d.async===!1)throw new fe;return g.then(y=>i(y,n,d))}return i(g,n,d)}}X(e,"~standard",()=>({validate:o(i=>{try{let u=rt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return nt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),wt=I("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Tn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),pr=I("$ZodStringFormat",(e,t)=>{lr.init(e,t),wt.init(e,t)});var Nn=I("$ZodURL",(e,t)=>{pr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Dn=I("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??cr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}});var dr=I("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=En,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Cn=I("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=In,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Un=I("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),Mn=I("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r});var jn=I("$ZodVoid",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Ln=I("$ZodDate",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function On(e,t,r){e.issues.length&&t.issues.push(...Ie(r,e.issues)),t.value[r]=e.value}o(On,"handleArrayResult");var Fn=I("$ZodArray",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let d=i[c],g=t.element._zod.run({value:d,issues:[]},n);g instanceof Promise?u.push(g.then(y=>On(y,r,c))):On(g,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function kt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ie(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(kt,"handlePropertyResult");function ru(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=xn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(ru,"normalizeDef");function nu(e,t,r,n,i,u){let c=[],d=i.keySet,g=i.catchall._zod,y=g.def.type,P=g.optout==="optional";for(let T in t){if(d.has(T))continue;if(y==="never"){c.push(T);continue}let x=g.run({value:t[T],issues:[]},n);x instanceof Promise?e.push(x.then(s=>kt(s,r,T,t,P))):kt(x,r,T,t,P)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(nu,"handleCatchall");var Bn=I("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let d=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let g={...d};return Object.defineProperty(t,"shape",{value:g}),g},"get")})}let n=Et(()=>ru(t));X(e._zod,"propValues",()=>{let d=t.shape,g={};for(let y in d){let P=d[y]._zod;if(P.values){g[y]??(g[y]=new Set);for(let T of P.values)g[y].add(T)}}return g});let i=et,u=t.catchall,c;e._zod.parse=(d,g)=>{c??(c=n.value);let y=d.value;if(!i(y))return d.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),d;d.value={};let P=[],T=c.shape;for(let x of c.keys){let s=T[x],p=s._zod.optout==="optional",f=s._zod.run({value:y[x],issues:[]},g);f instanceof Promise?P.push(f.then(m=>kt(m,d,x,y,p))):kt(f,d,x,y,p)}return u?nu(P,y,d,g,n.value,e):P.length?Promise.all(P).then(()=>d):d}});function kn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Le(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Ee(c,n,ye())))}),t)}o(kn,"handleUnionResults");var mr=I("$ZodUnion",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),X(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>$t(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,d=[];for(let g of t.options){let y=g._zod.run({value:i.value,issues:[]},u);if(y instanceof Promise)d.push(y),c=!0;else{if(y.issues.length===0)return y;d.push(y)}}return c?Promise.all(d).then(g=>kn(g,i,e,u)):kn(d,i,e,u)}});var Zn=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,mr.init(e,t);let r=e._zod.parse;X(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[d,g]of Object.entries(c)){i[d]||(i[d]=new Set);for(let y of g)i[d].add(y)}}return i});let n=Et(()=>{let i=t.options,u=new Map;for(let c of i){let d=c._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let g of d){if(u.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);u.set(g,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!et(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let d=n.value.get(c?.[t.discriminator]);return d?d._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var Vn=I("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!hn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let d=new Set;for(let y of c)if(typeof y=="string"||typeof y=="number"||typeof y=="symbol"){d.add(typeof y=="number"?y.toString():y);let P=t.valueType._zod.run({value:i[y],issues:[]},n);P instanceof Promise?u.push(P.then(T=>{T.issues.length&&r.issues.push(...Ie(y,T.issues)),r.value[y]=T.value})):(P.issues.length&&r.issues.push(...Ie(y,P.issues)),r.value[y]=P.value)}let g;for(let y in i)d.has(y)||(g=g??[],g.push(y));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:g})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let g=t.keyType._zod.run({value:d,issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&cr.test(d)&&g.issues.length){let T=t.keyType._zod.run({value:Number(d),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(g=T)}if(g.issues.length){t.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(T=>Ee(T,n,ye())),input:d,path:[d],inst:e});continue}let P=t.valueType._zod.run({value:i[d],issues:[]},n);P instanceof Promise?u.push(P.then(T=>{T.issues.length&&r.issues.push(...Ie(d,T.issues)),r.value[g.value]=T.value})):(P.issues.length&&r.issues.push(...Ie(d,P.issues)),r.value[g.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Hn=I("$ZodEnum",(e,t)=>{G.init(e,t);let r=ar(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>vn.has(typeof i)).map(i=>typeof i=="string"?je(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),qn=I("$ZodLiteral",(e,t)=>{if(G.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?je(n):n?je(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Wn=I("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Tt(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new fe;return r.value=i,r}});function wn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(wn,"handleOptionalResult");var Gn=I("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>wn(u,r.value)):wn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Kn=I("$ZodNullable",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.innerType._zod.optin),X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)}|null)$`):void 0}),X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Jn=I("$ZodPipe",(e,t)=>{G.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Ot(c,t.in,n)):Ot(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Ot(u,t.out,n)):Ot(i,t.out,n)}});function Ot(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Ot,"handlePipeResult");var Xn=I("$ZodCustom",(e,t)=>{Fe.init(e,t),G.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Rn(u,r,n,e));Rn(i,r,n,e)}});function Rn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(ur(i))}}o(Rn,"handleRefineResult");var Qn,su=Symbol("ZodOutput"),uu=Symbol("ZodInput"),fr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function eo(){return new fr}o(eo,"registry");(Qn=globalThis).__zod_globalRegistry??(Qn.__zod_globalRegistry=eo());var gr=globalThis.__zod_globalRegistry;function to(e,t){return new e({type:"string",...W(t)})}o(to,"_string");function ro(e,t){return new e({type:"string",coerce:!0,...W(t)})}o(ro,"_coercedString");function no(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...W(t)})}o(no,"_url");function oo(e,t){return new e({type:"number",checks:[],...W(t)})}o(oo,"_number");function io(e,t){return new e({type:"number",coerce:!0,checks:[],...W(t)})}o(io,"_coercedNumber");function ao(e,t){return new e({type:"boolean",...W(t)})}o(ao,"_boolean");function so(e,t){return new e({type:"boolean",coerce:!0,...W(t)})}o(so,"_coercedBoolean");function uo(e,t){return new e({type:"bigint",coerce:!0,...W(t)})}o(uo,"_coercedBigint");function co(e){return new e({type:"any"})}o(co,"_any");function lo(e){return new e({type:"unknown"})}o(lo,"_unknown");function po(e,t){return new e({type:"void",...W(t)})}o(po,"_void");function mo(e,t){return new e({type:"date",coerce:!0,...W(t)})}o(mo,"_coercedDate");function pe(e,t){return new $n({check:"min_length",...W(t),minimum:e})}o(pe,"_minLength");function $e(e,t){return new Sn({check:"string_format",format:"regex",...W(t),pattern:e})}o($e,"_regex");function fo(e,t,r){let n=W(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(fo,"_custom");var Y=I("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");G.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>At(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>rt(e,r,n),e.parseAsync=async(r,n)=>zt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>nt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>St(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Nt=I("ZodMiniString",(e,t)=>{wt.init(e,t),Y.init(e,t)});function a(e){return to(Nt,e)}o(a,"string");var go=I("ZodMiniStringFormat",(e,t)=>{pr.init(e,t),Nt.init(e,t)});var vu=I("ZodMiniURL",(e,t)=>{Nn.init(e,t),go.init(e,t)});function yo(e){return no(vu,e)}o(yo,"url");var yr=I("ZodMiniNumber",(e,t)=>{Dn.init(e,t),Y.init(e,t)});function ne(e){return oo(yr,e)}o(ne,"number");var hr=I("ZodMiniBoolean",(e,t)=>{dr.init(e,t),Y.init(e,t)});function Z(e){return ao(hr,e)}o(Z,"boolean");var ho=I("ZodMiniBigInt",(e,t)=>{Cn.init(e,t),Y.init(e,t)});var xu=I("ZodMiniAny",(e,t)=>{Un.init(e,t),Y.init(e,t)});function it(){return co(xu)}o(it,"any");var _u=I("ZodMiniUnknown",(e,t)=>{Mn.init(e,t),Y.init(e,t)});function k(){return lo(_u)}o(k,"unknown");var Pu=I("ZodMiniVoid",(e,t)=>{jn.init(e,t),Y.init(e,t)});function vo(e){return po(Pu,e)}o(vo,"_void");var xo=I("ZodMiniDate",(e,t)=>{Ln.init(e,t),Y.init(e,t)});var bu=I("ZodMiniArray",(e,t)=>{Fn.init(e,t),Y.init(e,t)});function N(e,t){return new bu({type:"array",element:e,...W(t)})}o(N,"array");var Tu=I("ZodMiniObject",(e,t)=>{Bn.init(e,t),Y.init(e,t),X(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...W(t)};return new Tu(r)}o(l,"object");var Iu=I("ZodMiniUnion",(e,t)=>{mr.init(e,t),Y.init(e,t)});function D(e,t){return new Iu({type:"union",options:e,...W(t)})}o(D,"union");var Eu=I("ZodMiniDiscriminatedUnion",(e,t)=>{Zn.init(e,t),Y.init(e,t)});function Be(e,t,r){return new Eu({type:"union",options:t,discriminator:e,...W(r)})}o(Be,"discriminatedUnion");var $u=I("ZodMiniRecord",(e,t)=>{Vn.init(e,t),Y.init(e,t)});function w(e,t,r){return new $u({type:"record",keyType:e,valueType:t,...W(r)})}o(w,"record");var Su=I("ZodMiniEnum",(e,t)=>{Hn.init(e,t),Y.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Su({type:"enum",entries:r,...W(t)})}o(U,"_enum");var Au=I("ZodMiniLiteral",(e,t)=>{qn.init(e,t),Y.init(e,t)});function S(e,t){return new Au({type:"literal",values:Array.isArray(e)?e:[e],...W(t)})}o(S,"literal");var zu=I("ZodMiniTransform",(e,t)=>{Wn.init(e,t),Y.init(e,t)});function Se(e){return new zu({type:"transform",transform:e})}o(Se,"transform");var Ou=I("ZodMiniOptional",(e,t)=>{Gn.init(e,t),Y.init(e,t)});function h(e){return new Ou({type:"optional",innerType:e})}o(h,"optional");var ku=I("ZodMiniNullable",(e,t)=>{Kn.init(e,t),Y.init(e,t)});function at(e){return new ku({type:"nullable",innerType:e})}o(at,"nullable");var wu=I("ZodMiniPipe",(e,t)=>{Jn.init(e,t),Y.init(e,t)});function Ae(e,t){return new wu({type:"pipe",in:e,out:t})}o(Ae,"pipe");var Ru=I("ZodMiniCustom",(e,t)=>{Xn.init(e,t),Y.init(e,t)});function Dt(e,t){return fo(Ru,e??(()=>!0),t)}o(Dt,"custom");var st={};dn(st,{bigint:()=>Lu,boolean:()=>ju,date:()=>Fu,number:()=>Mu,string:()=>Uu});function Uu(e){return ro(Nt,e)}o(Uu,"string");function Mu(e){return io(yr,e)}o(Mu,"number");function ju(e){return so(hr,e)}o(ju,"boolean");function Lu(e){return uo(ho,e)}o(Lu,"bigint");function Fu(e){return mo(xo,e)}o(Fu,"date");var xr=l({retryOnFailure:l({defaultValue:h(Z()),hide:h(Z())}),continueOnFailure:l({defaultValue:h(Z()),hide:h(Z())})}),vr=class{constructor(t,r,n,i,u,c,d,g,y,P,T){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=d;this.errorHandlingOptions=g;this.outputSchema=y;this.audience=P;this.aiMetadata=T}static{o(this,"IAction")}},ze=o(e=>new vr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=l({displayName:a(),description:h(a())}),C=o((e,t)=>l({type:S(t),required:Z(),defaultValue:h(it())}),"TPropertyValue");var se=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),he=l({...F.shape,...C(a(),"LONG_TEXT").shape});var Po=l({label:a(),value:k()}),Ct=l({disabled:h(Z()),placeholder:h(a()),options:N(Po)});var ue=l({...F.shape,options:Ct,...C(k(),"STATIC_DROPDOWN").shape}),ve=l({...F.shape,options:Ct,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var _r=l({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),ut=l({...F.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var xe=l({...F.shape,...C(Z(),"CHECKBOX").shape});var _e=l({...F.shape,...C(ne(),"NUMBER").shape});var ct=l({...F.shape,...C(k(),"FILE").shape});var lt=l({...F.shape,...C(a(),"DATE_TIME").shape});var bo=w(a(),D([se,he,ue,ut,ve,xe,_e,ct,lt])),pt=l({...F.shape,properties:bo,...C(N(k()),"ARRAY").shape});var dt=l({...F.shape,...C(D([w(a(),k())]),"JSON").shape});var To=D([se,ue,dt,pt,ve]),Zu=w(a(),To),Pr=l({refreshers:N(a()),...F.shape,...C(k(),"DYNAMIC").shape});var Ut=l({...F.shape,...C(vo(),"MARKDOWN").shape});var mt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(mt||{}),Ze=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ze||{}),Ve=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Ve||{});var ft=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ft||{}),br="both_client_credentials_and_authorization_code";var Re=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Re||{}),gt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(gt||{}),Vu=l({strategy:U(gt),paramName:h(a())}),yt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(yt||{});var Mt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Mt||{}),Io=l({status:h(ne()),body:h(k()),headers:h(w(a(),a()))}),Eo=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(U(Mt))}),$o=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Io,handlerId:h(a()),streamStepProgress:h(U(Mt))}),Hu=D([Eo,$o]);var qu=l({body:k(),rawBody:h(k()),headers:w(a(),a()),queryParams:w(a(),a())});function Pe(e){return e==null}o(Pe,"isNil");function ht(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ht,"isEmpty");function jt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(jt,"assertNotNullOrUndefined");var Tr=Me(require("crypto"),1);var Wu=128,Ne,He,Gu=o(e=>{!Ne||Ne.length<e?(Ne=Buffer.allocUnsafe(e*Wu),Tr.default.randomFillSync(Ne),He=0):He+e>Ne.length&&(Tr.default.randomFillSync(Ne),He=0),He+=e},"fillPool"),Ku=o(e=>(Gu(e|=0),Ne.subarray(He-e,He)),"random"),Ju=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let d=r(i),g=i;for(;g--;)if(c+=e[d[g]&n]||"",c.length===u)return c}}},"customRandom"),Ao=o((e,t=21)=>Ju(e,t,Ku),"customAlphabet");var Xu="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",zo=21,JP=a().check($e(new RegExp(`^[0-9a-zA-Z]{${zo}}$`))),Yu=Ao(Xu,zo);var Oe=Ae(Se(e=>e instanceof Date?e.toISOString():e),a()),ce={id:a(),created:Oe,updated:Oe},q=o(e=>h(at(e)),"Nullable");function Ir(e){return h(at(U(e)))}o(Ir,"NullableEnum");var QP=Ae(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(Z())),Lt=o(e=>Ae(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(N(e))),"OptionalArrayFromQuery");var rb=w(a(),k());var vt=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(vt||{});var fb=a().check($e(/^#[0-9A-Fa-f]{6}$/));var yb=l({filename:a(),data:k(),type:S("file"),mimetype:h(a())});var Qu=Me(ko());var Tb=l({...ce,name:a(),permissions:N(a()),platformId:q(a()),type:a(),userCount:h(ne())});var wo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(wo||{}),Er=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Er||{}),$r=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))($r||{});var Sr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Sr||{});var Ar=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ar||{});var ec=l({mode:U(wo),value:k()}),tc=l({auth:h(a()),fields:w(a(),ec)}),rc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(tc)}),nc=l({type:S("PIECE"),toolName:a().check(pe(1)),pieceMetadata:rc}),oc=l({type:S("none")}),ic=l({type:S("access_token"),accessToken:a()}),ac=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),sc=l({type:S("headers"),headers:w(a(),a())}),uc=Be("type",[oc,ic,ac,sc]),Ro=l({type:S("FLOW"),toolName:a().check(pe(1)),externalFlowId:a(),flowDisplayName:h(a())}),No=l({type:S("MCP"),toolName:a().check(pe(1)),serverUrl:yo(),protocol:U($r),auth:uc}),Do=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(pe(1)),sourceType:U(Er),sourceId:a(),sourceName:a()}),cc=Be("type",[nc,Ro,No,Do]),lc=l({displayName:a(),description:h(a()),type:U(Sr)}),Co=l({type:S("MARKDOWN"),markdown:a()}),qe={type:S("TOOL_CALL"),input:q(w(a(),k())),output:h(k()),toolName:a(),status:U(Ar),toolCallId:a(),startTime:a(),endTime:h(a())},Jb=l(qe),Uo=Be("toolCallType",[l({...qe,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...qe,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...qe,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...qe,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...qe,toolCallType:S("UNKNOWN"),displayName:a()})]),pc=D([Co,Uo]);var zr=(r=>(r.IMAGE="image",r.TEXT="text",r))(zr||{}),be=l({apiKey:a()}),dc=be,mc=l({apiKey:a(),apiKeyHash:a()}),fc=be,gc=be,yc=be,hc=be,vc=be,xc=be,_c=be,Mo=l({accessKeyId:a().check(pe(1)),secretAccessKey:a().check(pe(1))}),Pc=l({}),bc=l({}),Tc=l({}),Ic=l({}),Ec=l({}),$c=l({}),jo=l({modelId:a(),modelName:a(),modelType:U(zr)}),Lo=l({apiKeyHeader:a(),baseUrl:a(),models:N(jo),defaultHeaders:h(w(a(),a()))}),Fo=l({accountId:a(),gatewayId:a(),models:N(jo),vertexProject:h(a()),vertexRegion:h(a())}),Bo=l({resourceName:a(),apiVersion:Ae(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),Zo=l({region:a().check(pe(1))}),Sc=D([dc,yc,hc,vc,xc,gc,fc,mc,Mo,_c]),Vo=D([Lo,Fo,Bo,Zo,Pc,Tc,Ic,Ec,bc,$c]),Ac=l({id:a(),name:a(),type:U(zr)}),zc=l({id:a(),name:a(),provider:U(vt),config:Vo,enabledForChat:Z()}),Oc=l({provider:U(vt),config:Vo,auth:Sc,platformId:a()});var eT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var kc=l({base64Url:a(),fileName:a(),extension:h(a())}),wc=l({mimeType:a(),url:a(),fileName:h(a())}),Or=D([kc,wc]);var Rc=D([l({type:S("file"),value:Or}),l({type:S("markdown"),value:a(),files:h(N(Or))})]),Nc=l({sessionId:a(),message:a(),files:h(N(a()))});var qo=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(qo||{}),Wo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Wo||{}),kr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(kr||{});var Dc=D([l({...ce,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...ce,name:a(),externalId:a(),type:D([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),Cc=l({...ce,name:a(),folderId:q(a()),projectId:a(),externalId:a(),status:Ir(Wo),trigger:Ir(qo)}),Uc=l({...ce,tableId:a(),projectId:a(),cells:w(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),Mc=l({events:N(U(kr)),webhookUrl:a(),flowId:a()}),jc=l({fields:N(l({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),Lc=l({projectId:a(),limit:h(st.number()),cursor:h(a()),name:h(a()),externalIds:Lt(a()),folderId:h(a()),folderIds:Lt(a())}),Fc=l({records:N(N(l({fieldId:a(),value:Ko()}))),tableId:a()}),Bc=l({cells:h(N(l({fieldId:a(),value:Ko()}))),tableId:a(),agentUpdate:h(Z())}),Go=Be("operator",[De("eq"),De("neq"),De("gt"),De("gte"),De("lt"),De("lte"),De("co"),Ho("exists"),Ho("not_exists")]),Zc=l({tableId:a(),limit:h(st.number()),cursor:h(a()),filters:Lt(Go)});function Ko(){return Ae(Se(e=>e==null?e:String(e)),at(a()))}o(Ko,"coerceToString");function De(e){return l({fieldId:a(),operator:S(e),value:a()})}o(De,"valueFilter");function Ho(e){return l({fieldId:a(),operator:S(e)})}o(Ho,"existenceFilter");var Vc=l({status:h(ne()),body:h(k()),headers:h(w(a(),a()))}),Hc=l({...ce,deleted:q(Oe),ownerId:a(),displayName:a(),platformId:a(),externalId:q(a())});var Jo=l({name:a(),description:h(a()),type:a(),required:Z()}),qc=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(Jo),returnsResponse:Z()})});var Xo="^[0-9]+\\.[0-9]+\\.[0-9]+$",xT=new RegExp(Xo),Gc="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",_T=a().check($e(new RegExp(Xo))),PT=a().check($e(new RegExp(Gc))),Kc=l({packageType:S("ARCHIVE"),pieceType:U(Ze),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Yo=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),Qo=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),bT=D([Yo,Qo]),TT=D([Kc,Yo,Qo]),ei=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ei||{}),Jc=l({type:U(ei),cronExpression:a(),timezone:a()}),IT=l({...ce,type:U(Re),projectId:a(),flowId:a(),triggerName:a(),schedule:q(Jc),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:q(a()),simulate:Z()}),ti=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(ti||{}),ri=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ri||{}),ni=(r=>(r.S3="S3",r.DB="DB",r))(ni||{}),ET=l({...ce,projectId:q(a()),platformId:q(a()),type:U(ti),compression:U(ri),data:h(k()),location:U(ni),size:q(ne()),fileName:q(a()),s3Key:q(a()),metadata:q(w(a(),a()))}),oi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(oi||{}),ii=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ii||{}),$T=l({id:a(),email:a(),firstName:a(),status:U(ii),externalId:q(a()),platformId:q(a()),platformRole:U(oi),lastName:a(),created:Oe,updated:Oe,lastActiveDate:q(Oe),imageUrl:q(a())});var wr=l({...F.shape,...C(w(a(),k()),"OBJECT").shape});var ci=l({...F.shape,...C(a(),"COLOR").shape});var Rr=D([se,he,Ut,xe,ue,ve,_r,ut,Pr,_e,pt,wr,dt,lt,ct,ci]),_={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 ge=l({displayName:a(),description:h(a())});var li=l({username:a(),password:a()}),Nr=l({...ge.shape,username:l({displayName:a(),description:h(a())}),password:l({displayName:a(),description:h(a())}),...C(li,"BASIC_AUTH").shape});var el=w(a(),D([se,he,_e,xe,ue])),Dr=l({...ge.shape,props:el,...C(k(),"CUSTOM_AUTH").shape});var Ce=l({...ge.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var tl=w(a(),D([se,he,Ce,_e,xe,ue,ve,Ut])),pi=l({...ge.shape,props:tl,...C(k(),"OIDC").shape});var Cr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Cr||{}),di=D([se,Ce,ue]),mi=w(a(),di),rl=l({props:h(w(a(),di)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:h(D([S("none"),S("consent"),S("login"),S("omit")])),pkce:h(Z()),pkceMethod:h(D([S("plain"),S("S256")])),authorizationMethod:h(U(Cr)),grantType:h(D([U(ft),S(br)])),extra:h(w(a(),a()))}),fi=l({access_token:a(),props:h(mi),data:w(a(),it())}),Ur=l({...ge.shape,...rl.shape,...C(fi,"OAUTH2").shape});var We=D([Nr,Dr,pi,Ur,Ce]),xt="Connection",Mr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||xt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||xt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||xt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||xt}},None(){}};var oE={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var nl=l({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var ol=D([Rr,We]),jr=w(a(),ol),IE=w(a(),Rr);var gi=D([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]);var yi="2",Bt="0.82.0";var Lr=class{constructor(t,r,n,i,u,c,d,g,y=Bt,P,T=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=g;this.minimumSupportedRelease=y;this.maximumSupportedRelease=P;this.description=T;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:yi}),"getContextInfo");(!il(y)||al(y,Bt))&&(this.minimumSupportedRelease=Bt),u.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},hi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Lr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function il(e){return/^\d+\.\d+\.\d+$/.test(e)}o(il,"isValidSimpleSemver");function al(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,d]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<d}o(al,"isSemverLessThan");var sl=h(w(a(),w(a(),a()))),vi=l({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:h(a()),directoryPath:h(a()),auth:h(D([We,N(We)])),version:a(),categories:h(N(U(Ve))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),i18n:sl}),ul=U(["human","ai","both"]),xi=l({description:h(a()),idempotent:h(Z())}),_i=l({name:a(),displayName:a(),description:a(),props:jr,requireAuth:Z(),errorHandlingOptions:h(xr),outputSchema:h(Dt()),audience:h(ul),aiMetadata:h(xi)}),Pi=l({name:a(),displayName:a(),description:a(),props:jr,errorHandlingOptions:h(xr),type:U(Re),sampleData:k(),handshakeConfiguration:h(Dt()),renewConfiguration:h(gi),testStrategy:U(yt),outputSchema:h(Dt()),aiMetadata:h(xi)}),cl=l({...vi.shape,actions:w(a(),_i),triggers:w(a(),Pi)}),ll=l({...vi.shape,actions:ne(),triggers:ne(),suggestedActions:h(N(Pi)),suggestedTriggers:h(N(_i))}),bi=l({projectUsage:ne(),tags:h(N(a())),pieceType:U(Ze),packageType:U(mt),platformId:h(a()),archiveId:h(a())}),I$=l({...cl.shape,...bi.shape}),E$=l({...ll.shape,...bi.shape}),$$=l({name:a(),version:a()});var pl=Me(require("path")),dl=Me(require("fs/promises"));var Zt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Vt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Fr,r=new Br){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Fr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Br=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Ht=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var qt=class extends Zt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Vt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[M,ee]of Object.entries(c))i.append(M,ee);let d=i.toString(),g=d?`${n}?${d}`:n,y=t.responseType??"json",P=t.followRedirects??!0,T=t.retries??0,{body:x,extraHeaders:s,isStream:p}=ml(t.body,u),f=gl({...u,...s}),m=await fl(async()=>{let M=new AbortController,ee=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let ie={method:t.method.toString(),headers:f,body:x,redirect:P?"follow":"manual",signal:M.signal};return p&&(ie.duplex="half"),r?.dispatcher!==void 0&&(ie.dispatcher=r.dispatcher),await fetch(g,ie)}finally{ee!==void 0&&clearTimeout(ee)}},T),v=P?300:400;if(m.status<200||m.status>=v){let M=await Ti(m,y),ee=new Ht(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ee),ee}let b=await Ti(m,y);return{status:m.status,headers:yl(m.headers),body:b}}};function ml(e,t){return vl(e)?{body:void 0,extraHeaders:{},isStream:!1}:hl(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(ml,"serializeBody");async function Ti(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Ti,"parseResponseBody");async function fl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ii(n);continue}return i}catch(i){if(r=i,n<t){await Ii(n);continue}throw i}throw r}o(fl,"sendWithRetries");function Ii(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ii,"backoff");function gl(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(gl,"normalizeHeaders");function yl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(yl,"toHttpHeaders");function hl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(hl,"isNodeFormData");function vl(e){return e==null}o(vl,"isNil");var te=new qt;var ke=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(ke||{});var id=Me(require("fs")),Os=Me(zs());var ad={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function sd(e){let t=e.split(";")[0].trim().toLowerCase();return ad[t]??""}o(sd,"contentTypeToExtension");var ud=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),cd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function ks({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:d,authLocation:g="headers"}){return ze({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:_.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:y})=>({url:_.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${cd(t,y)}/resource or /resource`,required:!0,defaultValue:y?t(y):"",...c?.url??{}})}),"props")}),method:_.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(ke).map(y=>({label:y,value:y}))},...c?.method??{}}),headers:_.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:_.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:_.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:_.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:y})=>{if(!y)return{};let P=y,T={};switch(P){case"none":break;case"json":T.data=_.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":T.data=_.LongText({displayName:"Raw Body",required:!0});break;case"form_data":T.data=_.Array({displayName:"Form Data",required:!0,properties:{fieldName:_.ShortText({displayName:"Field Name",required:!0}),fieldType:_.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:_.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:_.File({displayName:"File Field Value",required:!1})}});break}return T},"props")}),response_is_binary:_.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:_.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:_.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:_.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async y=>{let{method:P,url:T,headers:x,queryParams:s,body:p,body_type:f,failsafe:m,timeout:v,response_is_binary:b,followRedirects:M}=y.propsValue;jt(P,"Method"),jt(T,"URL");let ee=Pe(r)?{}:await r(y.auth,y.propsValue),ie=T.url,le=ie.startsWith("http://")||ie.startsWith("https://")?ie:ud({baseUrl:t(y.auth),relativePath:ie}),me={method:P,url:le,headers:{...x??{},...g==="headers"||!Pe(g)?ee:{}},queryParams:{...g==="queryParams"?ee:{},...s??{}},timeout:v?v*1e3:0,followRedirects:M};if(b&&(me.responseType="arraybuffer"),p)if(f&&f!=="none"){let H=p.data;if(f==="form_data"){let ln=H,B=new Os.default;for(let{fieldName:V,fieldType:Te,textFieldValue:pn,fileFieldValue:nr}of ln)Te==="text"&&!ht(pn)?B.append(V,pn):Te==="file"&&!ht(nr)&&B.append(V,nr.data,{filename:nr?.filename});me.body=B,me.headers={...me.headers,...B.getHeaders()}}else me.body=H}else f||(me.body=p);try{let H=await te.sendRequest(me);return await ld(y.files,H.body,H.status,H.headers,b)}catch(H){if(m)return H.errorMessage();throw H}},"run")})}o(ks,"createCustomApiCallAction");var ld=o(async(e,t,r,n,i)=>{let u;if(i&&pd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=sd(c??"")||"txt",g;t instanceof ArrayBuffer?g=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?g=t:g=Buffer.from(t),u=await e.write({fileName:`output.${d}`,data:g})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),pd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var re="https://api.katanamrp.com/v1";var oe=Mr.SecretText({displayName:"API Key",required:!0,description:`
|
|
4
|
+
To generate your API key:
|
|
5
|
+
|
|
6
|
+
1. Log in to your Katana account
|
|
7
|
+
2. Go to **Settings > API**
|
|
8
|
+
3. Select **Add new API key**
|
|
9
|
+
4. Copy and paste the key here
|
|
10
|
+
`,validate:o(async({auth:e})=>{try{return await te.sendRequest({method:"GET",url:`${re}/products`,authentication:{type:"BEARER_TOKEN",token:e}}),{valid:!0}}catch{return{valid:!1,error:"Invalid API Key"}}},"validate")});var ws=ze({auth:oe,name:"create_customer",displayName:"Create Customer",description:"Creates a new customer in Katana.",audience:"both",aiMetadata:{description:"Creates a new customer record in the Katana manufacturing ERP, optionally with billing/shipping addresses. Use when registering a new customer; only the display name is required. Not idempotent \u2014 each call creates a separate customer, so look the customer up first if you need to avoid duplicates.",idempotent:!1},props:{name:_.ShortText({displayName:"Name",description:"Customer display name.",required:!0}),first_name:_.ShortText({displayName:"First Name",required:!1}),last_name:_.ShortText({displayName:"Last Name",required:!1}),company:_.ShortText({displayName:"Company",required:!1}),email:_.ShortText({displayName:"Email",required:!1}),phone:_.ShortText({displayName:"Phone",required:!1}),currency:_.ShortText({displayName:"Currency",description:"Currency code (ISO 4217), e.g. USD, EUR, GBP.",required:!1}),reference_id:_.ShortText({displayName:"Reference ID",description:"External reference ID (max 100 characters).",required:!1}),category:_.ShortText({displayName:"Category",description:"Customer category (max 100 characters).",required:!1}),comment:_.LongText({displayName:"Comment",description:"Additional notes about the customer.",required:!1}),discount_rate:_.Number({displayName:"Discount Rate",description:"Default discount rate for this customer.",required:!1}),addresses:_.Array({displayName:"Addresses",required:!1,properties:{entity_type:_.StaticDropdown({displayName:"Address Type",required:!0,options:{options:[{label:"Billing",value:"billing"},{label:"Shipping",value:"shipping"}]}}),default:_.Checkbox({displayName:"Set as Default",required:!1}),first_name:_.ShortText({displayName:"First Name",required:!1}),last_name:_.ShortText({displayName:"Last Name",required:!1}),company:_.ShortText({displayName:"Company",required:!1}),phone:_.ShortText({displayName:"Phone",required:!1}),line_1:_.ShortText({displayName:"Address Line 1",required:!1}),line_2:_.ShortText({displayName:"Address Line 2",required:!1}),city:_.ShortText({displayName:"City",required:!1}),state:_.ShortText({displayName:"State",required:!1}),zip:_.ShortText({displayName:"Zip/Postal Code",required:!1}),country:_.ShortText({displayName:"Country",required:!1})}})},async run(e){let{name:t,first_name:r,last_name:n,company:i,email:u,phone:c,currency:d,reference_id:g,category:y,comment:P,discount_rate:T,addresses:x}=e.propsValue,s={name:t};return r&&(s.first_name=r),n&&(s.last_name=n),i&&(s.company=i),u&&(s.email=u),c&&(s.phone=c),d&&(s.currency=d),g&&(s.reference_id=g),y&&(s.category=y),P&&(s.comment=P),T!=null&&(s.discount_rate=T),x&&x.length>0&&(s.addresses=x.map(f=>{let m={entity_type:f.entity_type};return f.default!==void 0&&(m.default=f.default),f.first_name&&(m.first_name=f.first_name),f.last_name&&(m.last_name=f.last_name),f.company&&(m.company=f.company),f.phone&&(m.phone=f.phone),f.line_1&&(m.line_1=f.line_1),f.line_2&&(m.line_2=f.line_2),f.city&&(m.city=f.city),f.state&&(m.state=f.state),f.zip&&(m.zip=f.zip),f.country&&(m.country=f.country),m})),(await te.sendRequest({method:"POST",url:`${re}/customers`,authentication:{type:"BEARER_TOKEN",token:e.auth},body:s})).body}});var Rs=_.Dropdown({displayName:"Customer",description:"Select the customer.",required:!0,refreshers:[],auth:oe,options:o(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};try{let t=await te.sendRequest({method:"GET",url:`${re}/customers`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}});return{disabled:!1,options:(Array.isArray(t.body)?t.body:[]).map(n=>({label:n.name,value:n.id}))}}catch{return{disabled:!0,placeholder:"Failed to load customers",options:[]}}},"options")}),Ns=_.Dropdown({displayName:"Product Variant",description:"Select the product variant.",required:!0,refreshers:[],auth:oe,options:o(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};try{let t=await te.sendRequest({method:"GET",url:`${re}/variants`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}});return{disabled:!1,options:(Array.isArray(t.body)?t.body:[]).map(n=>({label:n.sku||n.name||`Variant ${n.id}`,value:n.id}))}}catch{return{disabled:!0,placeholder:"Failed to load variants",options:[]}}},"options")}),Ds=_.Dropdown({displayName:"Tax Rate",required:!1,refreshers:[],auth:oe,options:o(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};try{let t=await te.sendRequest({method:"GET",url:`${re}/tax_rates`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}});return{disabled:!1,options:(Array.isArray(t.body)?t.body:[]).map(n=>({label:`${n.name} (${n.percentage}%)`,value:n.id}))}}catch{return{disabled:!1,placeholder:"No tax rates available",options:[]}}},"options")}),Cs=_.Dropdown({displayName:"Location",required:!1,refreshers:[],auth:oe,options:o(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};try{let t=await te.sendRequest({method:"GET",url:`${re}/locations`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}});return{disabled:!1,options:(Array.isArray(t.body)?t.body:[]).map(n=>({label:n.name,value:n.id}))}}catch{return{disabled:!1,placeholder:"No locations available",options:[]}}},"options")}),qz=_.Dropdown({displayName:"Default Location",description:"Default location for the order.",required:!0,refreshers:[],auth:oe,options:o(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};try{let t=await te.sendRequest({method:"GET",url:`${re}/locations`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}});return{disabled:!1,options:(Array.isArray(t.body)?t.body:[]).map(n=>({label:n.name,value:n.id}))}}catch{return{disabled:!1,placeholder:"No locations available",options:[]}}},"options")});var Us=ze({auth:oe,name:"create_sales_order",displayName:"Create Sales Order",description:"Creates a new sales order in Katana.",audience:"both",aiMetadata:{description:"Creates a sales order (or quote, when status is PENDING) in the Katana manufacturing ERP for an existing customer. Use when placing an order; it requires an order number, a customer ID, and at least one line item (the primary product variant plus quantity), with extra line items optionally passed as a JSON array. Not idempotent \u2014 each call creates a new order, so a repeated call yields a duplicate unless the order number is rejected as already used.",idempotent:!1},props:{order_no:_.ShortText({displayName:"Order Number",description:"Unique order number.",required:!0}),customer_id:Rs,variant_id:Ns,quantity:_.Number({displayName:"Quantity",description:"Quantity for the product variant.",required:!0}),price_per_unit:_.Number({displayName:"Price Per Unit",description:"Override price per unit.",required:!1}),total_discount:_.Number({displayName:"Total Discount",description:"Discount amount for this line.",required:!1}),tax_rate_id:Ds,additional_order_rows:_.Json({displayName:"Additional Order Lines (JSON)",description:"Add more line items as JSON array. Each object needs: variant_id, quantity. Optional: price_per_unit, total_discount, tax_rate_id, location_id.",required:!1}),status:_.StaticDropdown({displayName:"Status",description:"Order status. Use PENDING for quotes.",required:!1,options:{options:[{label:"Not Shipped",value:"NOT_SHIPPED"},{label:"Pending (Quote)",value:"PENDING"}]}}),location_id:Cs,currency:_.ShortText({displayName:"Currency",description:"Currency code (ISO 4217), e.g. USD, EUR.",required:!1}),order_created_date:_.DateTime({displayName:"Order Created Date",required:!1}),delivery_date:_.DateTime({displayName:"Delivery Date",required:!1}),customer_ref:_.ShortText({displayName:"Customer Reference",description:"Customer reference number (max 255 characters).",required:!1}),additional_info:_.LongText({displayName:"Additional Info",description:"Additional notes for this order.",required:!1}),tracking_number:_.ShortText({displayName:"Tracking Number",description:"Shipping tracking number (max 256 characters).",required:!1}),tracking_number_url:_.ShortText({displayName:"Tracking URL",description:"URL to track the shipment.",required:!1}),addresses:_.Array({displayName:"Addresses",required:!1,properties:{entity_type:_.StaticDropdown({displayName:"Address Type",required:!0,options:{options:[{label:"Billing",value:"billing"},{label:"Shipping",value:"shipping"}]}}),first_name:_.ShortText({displayName:"First Name",required:!1}),last_name:_.ShortText({displayName:"Last Name",required:!1}),company:_.ShortText({displayName:"Company",required:!1}),phone:_.ShortText({displayName:"Phone",required:!1}),line_1:_.ShortText({displayName:"Address Line 1",required:!1}),line_2:_.ShortText({displayName:"Address Line 2",required:!1}),city:_.ShortText({displayName:"City",required:!1}),state:_.ShortText({displayName:"State",required:!1}),zip:_.ShortText({displayName:"Zip/Postal Code",required:!1}),country:_.ShortText({displayName:"Country",required:!1})}}),ecommerce_order_type:_.ShortText({displayName:"E-commerce Order Type",description:"Source platform (e.g. shopify).",required:!1}),ecommerce_store_name:_.ShortText({displayName:"E-commerce Store Name",description:"Store identifier.",required:!1}),ecommerce_order_id:_.ShortText({displayName:"E-commerce Order ID",description:"External order ID from the e-commerce platform.",required:!1})},async run(e){let{order_no:t,customer_id:r,variant_id:n,quantity:i,price_per_unit:u,total_discount:c,tax_rate_id:d,additional_order_rows:g,status:y,location_id:P,currency:T,order_created_date:x,delivery_date:s,customer_ref:p,additional_info:f,tracking_number:m,tracking_number_url:v,addresses:b,ecommerce_order_type:M,ecommerce_store_name:ee,ecommerce_order_id:ie}=e.propsValue,le={variant_id:n,quantity:i};u!=null&&(le.price_per_unit=u),c!=null&&(le.total_discount=c),d&&(le.tax_rate_id=d),P&&(le.location_id=P);let me=[le];if(g){let B=Array.isArray(g)?g:[];for(let V of B){let Te={variant_id:V.variant_id,quantity:V.quantity};V.price_per_unit!==void 0&&(Te.price_per_unit=V.price_per_unit),V.total_discount!==void 0&&(Te.total_discount=V.total_discount),V.tax_rate_id&&(Te.tax_rate_id=V.tax_rate_id),V.location_id&&(Te.location_id=V.location_id),me.push(Te)}}let H={order_no:t,customer_id:r,sales_order_rows:me};return y&&(H.status=y),P&&(H.location_id=P),T&&(H.currency=T),x&&(H.order_created_date=x),s&&(H.delivery_date=s),p&&(H.customer_ref=p),f&&(H.additional_info=f),m&&(H.tracking_number=m),v&&(H.tracking_number_url=v),M&&(H.ecommerce_order_type=M),ee&&(H.ecommerce_store_name=ee),ie&&(H.ecommerce_order_id=ie),b&&b.length>0&&(H.addresses=b.map(B=>{let V={entity_type:B.entity_type};return B.first_name&&(V.first_name=B.first_name),B.last_name&&(V.last_name=B.last_name),B.company&&(V.company=B.company),B.phone&&(V.phone=B.phone),B.line_1&&(V.line_1=B.line_1),B.line_2&&(V.line_2=B.line_2),B.city&&(V.city=B.city),B.state&&(V.state=B.state),B.zip&&(V.zip=B.zip),B.country&&(V.country=B.country),V})),(await te.sendRequest({method:"POST",url:`${re}/sales_orders`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},body:H})).body}});var Ms=ze({auth:oe,name:"find_customer",displayName:"Find Customer",description:"Find a customer by name, email, or phone number.",audience:"both",aiMetadata:{description:"Searches customers in the Katana manufacturing ERP, filtering by any combination of name, first/last name, company, email, phone, currency, reference ID, or category; with no filters set it lists all customers (paginated). Use to look up a customer ID before creating an order, to check whether a customer already exists, or to browse the customer list. Read-only and idempotent.",idempotent:!0},props:{name:_.ShortText({displayName:"Name",description:"Filters customers by name.",required:!1}),first_name:_.ShortText({displayName:"First Name",description:"Filters customers by first name.",required:!1}),last_name:_.ShortText({displayName:"Last Name",description:"Filters customers by last name.",required:!1}),company:_.ShortText({displayName:"Company",description:"Filters customers by company.",required:!1}),email:_.ShortText({displayName:"Email",description:"Filters customers by email.",required:!1}),phone:_.ShortText({displayName:"Phone",description:"Filters customers by phone number.",required:!1}),currency:_.ShortText({displayName:"Currency",description:"Filters customers by currency.",required:!1}),reference_id:_.ShortText({displayName:"Reference ID",description:"Filters customers by reference ID.",required:!1}),category:_.ShortText({displayName:"Category",description:"Filters customers by category.",required:!1}),include_deleted:_.Checkbox({displayName:"Include Deleted",description:"Include soft-deleted customers in results.",required:!1}),limit:_.Number({displayName:"Limit",description:"Maximum number of results to return (default is 50).",required:!1}),page:_.Number({displayName:"Page",description:"Page number for pagination (default is 1).",required:!1})},async run(e){let{name:t,first_name:r,last_name:n,company:i,email:u,phone:c,currency:d,reference_id:g,category:y,include_deleted:P,limit:T,page:x}=e.propsValue,s={};return t&&(s.name=t),r&&(s.first_name=r),n&&(s.last_name=n),i&&(s.company=i),u&&(s.email=u),c&&(s.phone=c),d&&(s.currency=d),g&&(s.reference_id=g),y&&(s.category=y),P!==void 0&&(s.include_deleted=P.toString()),T!==void 0&&(s.limit=T.toString()),x!==void 0&&(s.page=x.toString()),(await te.sendRequest({method:"GET",url:`${re}/customers`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:s})).body}});var dd=hi({displayName:"Katana",auth:oe,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/katana.png",description:"Katana is a cloud-based manufacturing ERP software for inventory, production, and order management.",categories:["PRODUCTIVITY"],authors:["onyedikachi-david"],actions:[ws,Us,Ms,ks({auth:oe,baseUrl:o(()=>re,"baseUrl"),authMapping:o(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],triggers:[]});0&&(module.exports={katana});
|
|
11
|
+
/*! Bundled license information:
|
|
12
|
+
|
|
13
|
+
mime-types/index.js:
|
|
14
|
+
(*!
|
|
15
|
+
* mime-types
|
|
16
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
17
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
18
|
+
* MIT Licensed
|
|
19
|
+
*)
|
|
20
|
+
*/
|
package/README.md
DELETED
package/src/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const katana: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/katana/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,iDAAqD;AACrD,+DAAwE;AACxE,4CAA+C;AAC/C,sDAAkD;AAClD,mEAA+D;AAC/D,yEAAoE;AACpE,+DAA2D;AAE9C,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,IAAI,EAAE,iBAAU;IAChB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gDAAgD;IACzD,WAAW,EACT,qGAAqG;IACvG,UAAU,EAAE,CAAC,sBAAa,CAAC,YAAY,CAAC;IACxC,OAAO,EAAE,CAAC,mBAAmB,CAAC;IAC9B,OAAO,EAAE;QACP,gCAAc;QACd,qCAAgB;QAChB,4BAAY;QACZ,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,iBAAU;YAChB,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAQ;YACvB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;iBAC5C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const createCustomer: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
first_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
last_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
|
-
phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
currency: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
-
reference_id: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
-
category: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
11
|
-
comment: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
12
|
-
discount_rate: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
13
|
-
addresses: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
14
|
-
}>;
|