@activepieces/piece-bokio 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/package.json +7 -13
  2. package/src/index.js +13 -52
  3. package/src/index.d.ts +0 -5
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/add-line-item-to-invoice.d.ts +0 -15
  7. package/src/lib/actions/add-line-item-to-invoice.d.ts.map +0 -1
  8. package/src/lib/actions/add-line-item-to-invoice.js +0 -65
  9. package/src/lib/actions/add-line-item-to-invoice.js.map +0 -1
  10. package/src/lib/actions/create-a-journal-entry.d.ts +0 -9
  11. package/src/lib/actions/create-a-journal-entry.d.ts.map +0 -1
  12. package/src/lib/actions/create-a-journal-entry.js +0 -68
  13. package/src/lib/actions/create-a-journal-entry.js.map +0 -1
  14. package/src/lib/actions/create-an-item.d.ts +0 -11
  15. package/src/lib/actions/create-an-item.d.ts.map +0 -1
  16. package/src/lib/actions/create-an-item.js +0 -58
  17. package/src/lib/actions/create-an-item.js.map +0 -1
  18. package/src/lib/actions/create-customer.d.ts +0 -19
  19. package/src/lib/actions/create-customer.d.ts.map +0 -1
  20. package/src/lib/actions/create-customer.js +0 -143
  21. package/src/lib/actions/create-customer.js.map +0 -1
  22. package/src/lib/actions/create-invoice.d.ts +0 -18
  23. package/src/lib/actions/create-invoice.d.ts.map +0 -1
  24. package/src/lib/actions/create-invoice.js +0 -123
  25. package/src/lib/actions/create-invoice.js.map +0 -1
  26. package/src/lib/actions/find-customer.d.ts +0 -10
  27. package/src/lib/actions/find-customer.d.ts.map +0 -1
  28. package/src/lib/actions/find-customer.js +0 -76
  29. package/src/lib/actions/find-customer.js.map +0 -1
  30. package/src/lib/actions/get-a-journal-entry.d.ts +0 -7
  31. package/src/lib/actions/get-a-journal-entry.d.ts.map +0 -1
  32. package/src/lib/actions/get-a-journal-entry.js +0 -32
  33. package/src/lib/actions/get-a-journal-entry.js.map +0 -1
  34. package/src/lib/actions/get-an-invoice.d.ts +0 -7
  35. package/src/lib/actions/get-an-invoice.d.ts.map +0 -1
  36. package/src/lib/actions/get-an-invoice.js +0 -32
  37. package/src/lib/actions/get-an-invoice.js.map +0 -1
  38. package/src/lib/actions/get-draft-invoice-by-customer-name.d.ts +0 -9
  39. package/src/lib/actions/get-draft-invoice-by-customer-name.d.ts.map +0 -1
  40. package/src/lib/actions/get-draft-invoice-by-customer-name.js +0 -73
  41. package/src/lib/actions/get-draft-invoice-by-customer-name.js.map +0 -1
  42. package/src/lib/actions/update-an-invoice.d.ts +0 -18
  43. package/src/lib/actions/update-an-invoice.d.ts.map +0 -1
  44. package/src/lib/actions/update-an-invoice.js +0 -107
  45. package/src/lib/actions/update-an-invoice.js.map +0 -1
  46. package/src/lib/common/auth.d.ts +0 -5
  47. package/src/lib/common/auth.d.ts.map +0 -1
  48. package/src/lib/common/auth.js +0 -45
  49. package/src/lib/common/auth.js.map +0 -1
  50. package/src/lib/common/client.d.ts +0 -4
  51. package/src/lib/common/client.d.ts.map +0 -1
  52. package/src/lib/common/client.js +0 -27
  53. package/src/lib/common/client.js.map +0 -1
  54. package/src/lib/common/props.d.ts +0 -10
  55. package/src/lib/common/props.d.ts.map +0 -1
  56. package/src/lib/common/props.js +0 -126
  57. package/src/lib/common/props.js.map +0 -1
package/package.json CHANGED
@@ -1,18 +1,12 @@
1
1
  {
2
2
  "name": "@activepieces/piece-bokio",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
- "types": "./src/index.d.ts",
7
- "dependencies": {
8
- "@activepieces/pieces-common": "0.12.3",
9
- "@activepieces/pieces-framework": "0.30.0",
10
- "@activepieces/shared": "0.87.1",
11
- "i18next": "23.13.0",
12
- "tslib": "2.3.0"
13
- },
14
- "scripts": {
15
- "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
16
- "lint": "eslint 'src/**/*.ts'"
17
- }
6
+ "dependencies": {},
7
+ "files": [
8
+ "src/index.js",
9
+ "package.json",
10
+ "src/i18n"
11
+ ]
18
12
  }
package/src/index.js CHANGED
@@ -1,52 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bokio = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("./lib/common/auth");
7
- const create_customer_1 = require("./lib/actions/create-customer");
8
- const create_invoice_1 = require("./lib/actions/create-invoice");
9
- const add_line_item_to_invoice_1 = require("./lib/actions/add-line-item-to-invoice");
10
- const create_an_item_1 = require("./lib/actions/create-an-item");
11
- const create_a_journal_entry_1 = require("./lib/actions/create-a-journal-entry");
12
- const update_an_invoice_1 = require("./lib/actions/update-an-invoice");
13
- const find_customer_1 = require("./lib/actions/find-customer");
14
- const get_draft_invoice_by_customer_name_1 = require("./lib/actions/get-draft-invoice-by-customer-name");
15
- const get_an_invoice_1 = require("./lib/actions/get-an-invoice");
16
- const get_a_journal_entry_1 = require("./lib/actions/get-a-journal-entry");
17
- const pieces_common_1 = require("@activepieces/pieces-common");
18
- const shared_1 = require("@activepieces/shared");
19
- exports.bokio = (0, pieces_framework_1.createPiece)({
20
- displayName: 'Bokio',
21
- auth: auth_1.bokioAuth,
22
- minimumSupportedRelease: '0.36.1',
23
- logoUrl: 'https://cdn.activepieces.com/pieces/bokio.png',
24
- authors: ['sanket-a11y'],
25
- categories: [shared_1.PieceCategory.ACCOUNTING],
26
- description: 'Bokio is an accounting software platform which offers digital bookkeeping, invoicing, and financial management tools to help simplify accounting processes.',
27
- actions: [
28
- create_customer_1.createCustomer,
29
- create_invoice_1.createInvoice,
30
- add_line_item_to_invoice_1.addLineItemToInvoice,
31
- create_an_item_1.createAnItem,
32
- create_a_journal_entry_1.createAJournalEntry,
33
- update_an_invoice_1.updateAnInvoice,
34
- find_customer_1.findCustomer,
35
- get_draft_invoice_by_customer_name_1.getDraftInvoiceByCustomerName,
36
- get_an_invoice_1.getAnInvoice,
37
- get_a_journal_entry_1.getAJournalEntry,
38
- (0, pieces_common_1.createCustomApiCallAction)({
39
- auth: auth_1.bokioAuth,
40
- baseUrl: (auth) => {
41
- return `https://api.bokio.se/v1/companies/${auth === null || auth === void 0 ? void 0 : auth.props.companyId}`;
42
- },
43
- authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
44
- return {
45
- Authorization: `Bearer ${auth === null || auth === void 0 ? void 0 : auth.props.api_key}`,
46
- };
47
- }),
48
- }),
49
- ],
50
- triggers: [],
51
- });
52
- //# sourceMappingURL=index.js.map
1
+ "use strict";var nu=Object.create;var Je=Object.defineProperty;var ou=Object.getOwnPropertyDescriptor;var iu=Object.getOwnPropertyNames;var au=Object.getPrototypeOf,su=Object.prototype.hasOwnProperty;var o=(e,t)=>Je(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},gn=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of iu(t))!su.call(e,i)&&i!==r&&Je(e,i,{get:()=>t[i],enumerable:!(n=ou(t,i))||n.enumerable});return e};var De=(e,t,r)=>(r=e!=null?nu(au(e)):{},yn(t||!e||!e.__esModule?Je(r,"default",{value:e,enumerable:!0}):r,e)),uu=e=>yn(Je({},"__esModule",{value:!0}),e);var jo=S((Lo,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]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,x=(s.match(p.zoneIndex)||[])[0],b,L;for(x&&(x=x.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)y++;if(s.substr(0,2)==="::"&&y--,s.substr(-2,2)==="::"&&y--,y>d)return null;for(L=d-y,b=":";L--;)b+="0:";return s=s.replace("::",b),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let re=s.split(":"),ae=[];for(let Ke=0;Ke<re.length;Ke++)ae.push(parseInt(re[Ke],16));return ae})(),{parts:d,zoneId:x}}o(f,"expandIPv6");function g(s,d,y,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,b;for(;m>0;){if(b=y-m,b<0&&(b=0),s[x]>>b!==d[x]>>b)return!1;m-=y,x+=1}return!0}o(g,"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,d){for(;s.length<d;)s=`0${s}`;return s}o(T,"padPart");let v={};v.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,b,L;for(x=3;x>=0;x-=1)if(b=this.octets[x],b in m){if(L=m[b],y&&L!==0)return null;L!==8&&(y=!0),d+=L}else return null;return 32-d},s.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return v.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),v.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],b=0;for(;b<4;)x.push(parseInt(y[b],10)|parseInt(m[b],10)^255),b++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.isIPv4=function(s){return this.parser(s)!==null},v.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},v.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},v.IPv4.isValidFourPartDecimal=function(s){return!!(v.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},v.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!v.IPv4.isValidCIDR(s)||!d?!1:v.IPv4.isValidFourPartDecimal(d[1])},v.IPv4.networkAddressFromCIDR=function(s){let d,y,m,x,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<4;)x.push(parseInt(m[y],10)&parseInt(b[y],10)),y++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},v.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[1]),y];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},v.IPv4.parser=function(s){let d,y,m;if(d=s.match(r.fourOctet))return(function(){let x=d.slice(1,6),b=[];for(let L=0;L<x.length;L++)y=x[L],b.push(P(y));return b})();if(d=s.match(r.longValue)){if(m=P(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],b;for(b=0;b<=24;b+=8)x.push(m>>b&255);return x})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let x=d.slice(1,4),b=[];if(m=P(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(x[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b})():(d=s.match(r.threeOctet))?(function(){let x=d.slice(1,5),b=[];if(m=P(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(x[0])),b.push(P(x[1])),b.push(m>>8&255),b.push(m&255),b})():null},v.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},v.IPv6=(function(){function s(d,y){let m,x;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(x=this.parts[m],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,b;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in m){if(b=m[x],y&&b!==0)return null;b!==16&&(y=!0),d+=b}else return null;return 128-d},s.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let x=0;x<m.length;x++)d=m[x],y.push(d>>8),y.push(d&255);return y},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(T(this.parts[x].toString(16),4));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],m=d[1];return new v.IPv4([y>>8,y&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,x=-1,b;for(;b=d.exec(y);)b[0].length>x&&(m=b.index,x=b[0].length);return x<0?y:`${y.substring(0,m)}::${y.substring(m+x)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),v.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],b=0;for(;b<16;)x.push(parseInt(y[b],10)|parseInt(m[b],10)^255),b++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},v.IPv6.isIPv6=function(s){return this.parser(s)!==null},v.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},v.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},v.IPv6.networkAddressFromCIDR=function(s){let d,y,m,x,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<16;)x.push(parseInt(m[y],10)&parseInt(b[y],10)),y++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},v.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},v.IPv6.parseCIDR=function(s){let d,y,m;if((y=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},v.IPv6.parser=function(s){let d,y,m,x,b,L;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return f(s,8);if((m=s.match(p.transitional))&&(L=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+L,6),d.parts)){for(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<b.length;y++)if(x=b[y],!(0<=x&&x<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[3]),{parts:d.parts,zoneId:d.zoneId}}return null},v.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},v.fromByteArray=function(s){let d=s.length;if(d===4)return new v.IPv4(s);if(d===16)return new v.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},v.isValid=function(s){return v.IPv6.isValid(s)||v.IPv4.isValid(s)},v.isValidCIDR=function(s){return v.IPv6.isValidCIDR(s)||v.IPv4.isValidCIDR(s)},v.parse=function(s){if(v.IPv6.isValid(s))return v.IPv6.parse(s);if(v.IPv4.isValid(s))return v.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},v.parseCIDR=function(s){try{return v.IPv6.parseCIDR(s)}catch{try{return v.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},v.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},v.subnetMatch=function(s,d,y){let m,x,b,L;y==null&&(y="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(b=d[x],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(L=b[m],s.kind()===L[0].kind()&&s.match.apply(s,L))return x}return y},typeof Ft<"u"&&Ft.exports?Ft.exports=v:e.ipaddr=v})(Lo)});var Bi=S((_A,ji)=>{var Li=require("stream").Stream,Vp=require("util");ji.exports=ce;function ce(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ce,"DelayedStream");Vp.inherits(ce,Li);ce.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(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ce.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ce.prototype.resume=function(){this._released||this.release(),this.source.resume()};ce.prototype.pause=function(){this.source.pause()};ce.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ce.prototype.pipe=function(){var e=Li.prototype.pipe.apply(this,arguments);return this.resume(),e};ce.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)};ce.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 Hi=S((IA,Vi)=>{var Hp=require("util"),Zi=require("stream").Stream,Fi=Bi();Vi.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");Hp.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 Fi)){var r=Fi.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 Gi=S((EA,qi)=>{"use strict";qi.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 Ji=S(te=>{"use strict";var Wt=Gi(),qp=require("path").extname,Wi=/^\s*([^;\s]*)(?:;|\s|$)/,Gp=/^text\//i;te.charset=Ki;te.charsets={lookup:Ki};te.contentType=Wp;te.extension=Kp;te.extensions=Object.create(null);te.lookup=Jp;te.types=Object.create(null);Xp(te.extensions,te.types);function Ki(e){if(!e||typeof e!="string")return!1;var t=Wi.exec(e),r=t&&Wt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Gp.test(t[1])?"UTF-8":!1}o(Ki,"charset");function Wp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Wp,"contentType");function Kp(e){if(!e||typeof e!="string")return!1;var t=Wi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Kp,"extension");function Jp(e){if(!e||typeof e!="string")return!1;var t=qp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(Jp,"lookup");function Xp(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 p=0;p<c.length;p++){var f=c[p];if(t[f]){var g=r.indexOf(Wt[t[f]].source),P=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(g>P||g===P&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Xp,"populateMaps")});var Yi=S((AA,Xi)=>{Xi.exports=Yp;function Yp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Yp,"defer")});var Hr=S((OA,ea)=>{var Qi=Yi();ea.exports=Qp;function Qp(e){var t=!1;return Qi(function(){t=!0}),o(function(n,i){t?e(n,i):Qi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Qp,"async")});var qr=S((wA,ta)=>{ta.exports=el;function el(e){Object.keys(e.jobs).forEach(tl.bind(e)),e.jobs={}}o(el,"abort");function tl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(tl,"clean")});var Gr=S((NA,na)=>{var ra=Hr(),rl=qr();na.exports=nl;function nl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=ol(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?rl(r):r.results[i]=c,n(u,r.results))})}o(nl,"iterate");function ol(e,t,r,n){var i;return e.length==2?i=e(r,ra(n)):i=e(r,t,ra(n)),i}o(ol,"runJob")});var Wr=S((CA,oa)=>{oa.exports=il;function il(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(il,"state")});var Kr=S((MA,ia)=>{var al=qr(),sl=Hr();ia.exports=ul;function ul(e){Object.keys(this.jobs).length&&(this.index=this.size,al(this),sl(e)(null,this.results))}o(ul,"terminator")});var sa=S((jA,aa)=>{var cl=Gr(),pl=Wr(),ll=Kr();aa.exports=dl;function dl(e,t,r){for(var n=pl(e);n.index<(n.keyedList||e).length;)cl(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(dl,"parallel")});var Jr=S((FA,Kt)=>{var ua=Gr(),ml=Wr(),fl=Kr();Kt.exports=gl;Kt.exports.ascending=ca;Kt.exports.descending=yl;function gl(e,t,r,n){var i=ml(e,r);return ua(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){ua(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),fl.bind(i,n)}o(gl,"serialOrdered");function ca(e,t){return e<t?-1:e>t?1:0}o(ca,"ascending");function yl(e,t){return-1*ca(e,t)}o(yl,"descending")});var la=S((VA,pa)=>{var hl=Jr();pa.exports=vl;function vl(e,t,r){return hl(e,t,null,r)}o(vl,"serial")});var ma=S((qA,da)=>{da.exports={parallel:sa(),serial:la(),serialOrdered:Jr()}});var Xr=S((GA,fa)=>{"use strict";fa.exports=Object});var ya=S((WA,ga)=>{"use strict";ga.exports=Error});var va=S((KA,ha)=>{"use strict";ha.exports=EvalError});var Pa=S((JA,xa)=>{"use strict";xa.exports=RangeError});var ba=S((XA,_a)=>{"use strict";_a.exports=ReferenceError});var Ta=S((YA,Ia)=>{"use strict";Ia.exports=SyntaxError});var Jt=S((QA,Ea)=>{"use strict";Ea.exports=TypeError});var $a=S((ez,Sa)=>{"use strict";Sa.exports=URIError});var za=S((tz,Aa)=>{"use strict";Aa.exports=Math.abs});var ka=S((rz,Oa)=>{"use strict";Oa.exports=Math.floor});var Ra=S((nz,wa)=>{"use strict";wa.exports=Math.max});var Da=S((oz,Na)=>{"use strict";Na.exports=Math.min});var Ua=S((iz,Ca)=>{"use strict";Ca.exports=Math.pow});var La=S((az,Ma)=>{"use strict";Ma.exports=Math.round});var Ba=S((sz,ja)=>{"use strict";ja.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Za=S((cz,Fa)=>{"use strict";var xl=Ba();Fa.exports=o(function(t){return xl(t)||t===0?t:t<0?-1:1},"sign")});var Ha=S((lz,Va)=>{"use strict";Va.exports=Object.getOwnPropertyDescriptor});var Yr=S((dz,qa)=>{"use strict";var Xt=Ha();if(Xt)try{Xt([],"length")}catch{Xt=null}qa.exports=Xt});var Wa=S((mz,Ga)=>{"use strict";var Yt=Object.defineProperty||!1;if(Yt)try{Yt({},"a",{value:1})}catch{Yt=!1}Ga.exports=Yt});var Qr=S((fz,Ka)=>{"use strict";Ka.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 p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ya=S((yz,Xa)=>{"use strict";var Ja=typeof Symbol<"u"&&Symbol,Pl=Qr();Xa.exports=o(function(){return typeof Ja!="function"||typeof Symbol!="function"||typeof Ja("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Pl()},"hasNativeSymbols")});var en=S((vz,Qa)=>{"use strict";Qa.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var tn=S((xz,es)=>{"use strict";var _l=Xr();es.exports=_l.getPrototypeOf||null});var ns=S((Pz,rs)=>{"use strict";var bl="Function.prototype.bind called on incompatible ",Il=Object.prototype.toString,Tl=Math.max,El="[object Function]",ts=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"),Sl=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"),$l=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");rs.exports=o(function(t){var r=this;if(typeof r!="function"||Il.apply(r)!==El)throw new TypeError(bl+r);for(var n=Sl(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,ts(n,arguments));return Object(P)===P?P:this}return r.apply(t,ts(n,arguments))},"binder"),c=Tl(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+$l(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var Ze=S((bz,os)=>{"use strict";var Al=ns();os.exports=Function.prototype.bind||Al});var Qt=S((Iz,is)=>{"use strict";is.exports=Function.prototype.call});var rn=S((Tz,as)=>{"use strict";as.exports=Function.prototype.apply});var us=S((Ez,ss)=>{"use strict";ss.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ps=S((Sz,cs)=>{"use strict";var zl=Ze(),Ol=rn(),kl=Qt(),wl=us();cs.exports=wl||zl.call(kl,Ol)});var ds=S(($z,ls)=>{"use strict";var Rl=Ze(),Nl=Jt(),Dl=Qt(),Cl=ps();ls.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Nl("a function is required");return Cl(Rl,Dl,t)},"callBindBasic")});var vs=S((zz,hs)=>{"use strict";var Ul=ds(),ms=Yr(),gs;try{gs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var nn=!!gs&&ms&&ms(Object.prototype,"__proto__"),ys=Object,fs=ys.getPrototypeOf;hs.exports=nn&&typeof nn.get=="function"?Ul([nn.get]):typeof fs=="function"?o(function(t){return fs(t==null?t:ys(t))},"getDunder"):!1});var Is=S((kz,bs)=>{"use strict";var xs=en(),Ps=tn(),_s=vs();bs.exports=xs?o(function(t){return xs(t)},"getProto"):Ps?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ps(t)},"getProto"):_s?o(function(t){return _s(t)},"getProto"):null});var on=S((Rz,Ts)=>{"use strict";var Ml=Function.prototype.call,Ll=Object.prototype.hasOwnProperty,jl=Ze();Ts.exports=jl.call(Ml,Ll)});var ks=S((Nz,Os)=>{"use strict";var M,Bl=Xr(),Fl=ya(),Zl=va(),Vl=Pa(),Hl=ba(),Ge=Ta(),qe=Jt(),ql=$a(),Gl=za(),Wl=ka(),Kl=Ra(),Jl=Da(),Xl=Ua(),Yl=La(),Ql=Za(),As=Function,an=o(function(e){try{return As('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),vt=Yr(),ed=Wa(),sn=o(function(){throw new qe},"throwTypeError"),td=vt?(function(){try{return arguments.callee,sn}catch{try{return vt(arguments,"callee").get}catch{return sn}}})():sn,Ve=Ya()(),Q=Is(),rd=tn(),nd=en(),zs=rn(),xt=Qt(),He={},od=typeof Uint8Array>"u"||!Q?M:Q(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ve&&Q?Q([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":He,"%AsyncGenerator%":He,"%AsyncGeneratorFunction%":He,"%AsyncIteratorPrototype%":He,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Fl,"%eval%":eval,"%EvalError%":Zl,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":As,"%GeneratorFunction%":He,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ve&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ve||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Bl,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":Vl,"%ReferenceError%":Hl,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ve||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ve&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":Ve?Symbol:M,"%SyntaxError%":Ge,"%ThrowTypeError%":td,"%TypedArray%":od,"%TypeError%":qe,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":ql,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":xt,"%Function.prototype.apply%":zs,"%Object.defineProperty%":ed,"%Object.getPrototypeOf%":rd,"%Math.abs%":Gl,"%Math.floor%":Wl,"%Math.max%":Kl,"%Math.min%":Jl,"%Math.pow%":Xl,"%Math.round%":Yl,"%Math.sign%":Ql,"%Reflect.getPrototypeOf%":nd};if(Q)try{null.error}catch(e){Es=Q(Q(e)),Ne["%Error.prototype%"]=Es}var Es,id=o(function e(t){var r;if(t==="%AsyncFunction%")r=an("async function () {}");else if(t==="%GeneratorFunction%")r=an("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=an("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 Ne[t]=r,r},"doEval"),Ss={__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"]},Pt=Ze(),er=on(),ad=Pt.call(xt,Array.prototype.concat),sd=Pt.call(zs,Array.prototype.splice),$s=Pt.call(xt,String.prototype.replace),tr=Pt.call(xt,String.prototype.slice),ud=Pt.call(xt,RegExp.prototype.exec),cd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,pd=/\\(\\)?/g,ld=o(function(t){var r=tr(t,0,1),n=tr(t,-1);if(r==="%"&&n!=="%")throw new Ge("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ge("invalid intrinsic syntax, expected opening `%`");var i=[];return $s(t,cd,function(u,c,p,f){i[i.length]=p?$s(f,pd,"$1"):c||u}),i},"stringToPath"),dd=o(function(t,r){var n=t,i;if(er(Ss,n)&&(i=Ss[n],n="%"+i[0]+"%"),er(Ne,n)){var u=Ne[n];if(u===He&&(u=id(n)),typeof u>"u"&&!r)throw new qe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ge("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Os.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new qe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qe('"allowMissing" argument must be a boolean');if(ud(/^%?[^%]*%?$/,t)===null)throw new Ge("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ld(t),i=n.length>0?n[0]:"",u=dd("%"+i+"%",r),c=u.name,p=u.value,f=!1,g=u.alias;g&&(i=g[0],sd(n,ad([0,1],g)));for(var P=1,T=!0;P<n.length;P+=1){var v=n[P],s=tr(v,0,1),d=tr(v,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ge("property names with quotes must have matching quotes");if((v==="constructor"||!T)&&(f=!0),i+="."+v,c="%"+i+"%",er(Ne,c))p=Ne[c];else if(p!=null){if(!(v in p)){if(!r)throw new qe("base intrinsic for "+t+" exists, but the property is not available.");return}if(vt&&P+1>=n.length){var y=vt(p,v);T=!!y,T&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[v]}else T=er(p,v),p=p[v];T&&!f&&(Ne[c]=p)}}return p},"GetIntrinsic")});var Rs=S((Cz,ws)=>{"use strict";var md=Qr();ws.exports=o(function(){return md()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Cs=S((Mz,Ds)=>{"use strict";var fd=ks(),Ns=fd("%Object.defineProperty%",!0),gd=Rs()(),yd=on(),hd=Jt(),rr=gd?Symbol.toStringTag:null;Ds.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 hd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");rr&&(n||!yd(t,rr))&&(Ns?Ns(t,rr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[rr]=r)},"setToStringTag")});var Ms=S((jz,Us)=>{"use strict";var vd=Function.prototype.call,xd=Object.prototype.hasOwnProperty,Pd=Ze();Us.exports=Pd.call(vd,xd)});var js=S((Bz,Ls)=>{"use strict";Ls.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Zs=S((Fz,Fs)=>{"use strict";var ln=Hi(),_d=require("util"),un=require("path"),bd=require("http"),Id=require("https"),Td=require("url").parse,Ed=require("fs"),Sd=require("stream").Stream,$d=require("crypto"),cn=Ji(),Ad=ma(),zd=Cs(),ze=Ms(),pn=js();function Bs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Bs,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],ln.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");_d.inherits(j,ln);j.LINE_BREAK=`\r
2
+ `;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=ln.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)};j.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)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ze(t,"httpVersion"))&&!(t instanceof Sd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){ze(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)}):ze(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ze(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.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="'+Bs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&pn(c,r.header);var p;for(var f in c)if(ze(c,f)){if(p=c[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=f+": "+p.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=un.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=un.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ze(e,"httpVersion")&&(r=un.basename(e.client._httpMessage.path||"")),r)return'filename="'+Bs(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=cn.lookup(e.name)),!r&&e&&e.path&&(r=cn.lookup(e.path)),!r&&e&&e.readable&&ze(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=cn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ze(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.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(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+$d.randomBytes(12).toString("hex")};j.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};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.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}Ad.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Td(e),n=pn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=pn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Id.request(n):r=bd.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 p,f=o(function(g,P){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,g,P)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};zd(j.prototype,"FormData");Fs.exports=j});var jd={};gn(jd,{bokio:()=>Ld});module.exports=uu(jd);var cu=Object.freeze({status:"aborted"});function I(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let g=c.prototype,P=Object.keys(g);for(let T=0;T<P.length;T++){let v=P[T];v in p||(p[v]=g[v].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var f;let g=r?.Parent?new u:this;n(g,p),(f=g._zod).deferred??(f.deferred=[]);for(let P of g._zod.deferred)P();return g}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(I,"$constructor");var pe=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},bt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ir={};function fe(e){return e&&Object.assign(ir,e),ir}o(fe,"config");function sr(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(sr,"getEnumValues");function vn(e,t){return typeof t=="bigint"?t.toString():t}o(vn,"jsonStringifyReplacer");function Tt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Tt,"cached");function xn(e){return e==null}o(xn,"nullish");function Et(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Et,"cleanRegex");var hn=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==hn)return n===void 0&&(n=hn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(X,"defineLazy");var ur="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Xe,"isObject");var pu=Tt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Pn(e){if(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Pn,"isPlainObject");var _n=new Set(["string","number","symbol"]);function Ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ce,"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 H(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(H,"normalizeParams");function bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(bn,"optionalKeys");var In={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 Ue(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(Ue,"aborted");function _e(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(_e,"prefixIssues");function It(e){return typeof e=="string"?e:e?.message}o(It,"unwrapMessage");function be(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(be,"finalizeIssue");function Tn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Tn,"getLengthableOrigin");function cr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(cr,"issue");var En=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,vn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Sn=I("$ZodError",En),Ye=I("$ZodError",En,{Parent:Error});var du=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 pe;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>be(f,u,fe())));throw ur(p,i?.callee),p}return c.value},"_parse"),$t=du(Ye),mu=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 p=new(i?.Err??e)(c.issues.map(f=>be(f,u,fe())));throw ur(p,i?.callee),p}return c.value},"_parseAsync"),At=mu(Ye),fu=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 pe;return u.issues.length?{success:!1,error:new(e??Sn)(u.issues.map(c=>be(c,i,fe())))}:{success:!0,data:u.value}},"_safeParse"),Qe=fu(Ye),gu=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=>be(c,i,fe())))}:{success:!0,data:u.value}},"_safeParseAsync"),et=gu(Ye);var yu="(?:(?:\\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])))",hu=new RegExp(`^${yu}$`);var $n=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),An=/^-?\d+n?$/,zn=/^-?\d+$/,pr=/^-?\d+(?:\.\d+)?$/,On=/^(?:true|false)$/i;var Ie=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),vu={number:"number",bigint:"bigint",object:"date"};var kn=I("$ZodCheckGreaterThan",(e,t)=>{Ie.init(e,t);let r=vu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var wn=I("$ZodCheckNumberFormat",(e,t)=>{Ie.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=In[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=i,p.maximum=u,r&&(p.pattern=zn)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}p<i&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>u&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Rn=I("$ZodCheckMinLength",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!xn(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=Tn(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;Ie.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=()=>{})}),Nn=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 Cn={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=Cn;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,p,f)=>{let g=Ue(c),P;for(let T of p){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(g)continue;let v=c.issues.length,s=T._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new pe;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,c.issues.length!==v&&(g||(g=Ue(c,v)))});else{if(c.issues.length===v)continue;g||(g=Ue(c,v))}}return P?P.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(Ue(c))return c.aborted=!0,c;let g=i(p,n,f);if(g instanceof Promise){if(f.async===!1)throw new pe;return g.then(P=>e._zod.parse(P,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(P=>u(P,c,p)):u(g,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new pe;return f.then(g=>i(g,n,p))}return i(f,n,p)}}X(e,"~standard",()=>({validate:o(i=>{try{let u=Qe(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return et(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),kt=I("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$n(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}}),dr=I("$ZodStringFormat",(e,t)=>{lr.init(e,t),kt.init(e,t)});var Bn=I("$ZodURL",(e,t)=>{dr.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 mr=I("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??pr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),Fn=I("$ZodNumberFormat",(e,t)=>{wn.init(e,t),mr.init(e,t)}),fr=I("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=On,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}}),Zn=I("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=An,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 Vn=I("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),Hn=I("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r});var qn=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}}),Gn=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 Un(e,t,r){e.issues.length&&t.issues.push(..._e(r,e.issues)),t.value[r]=e.value}o(Un,"handleArrayResult");var Wn=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 p=i[c],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(g=>Un(g,r,c))):Un(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Ot(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(..._e(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Ot,"handlePropertyResult");function xu(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=bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(xu,"normalizeDef");function Pu(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,g=f.def.type,P=f.optout==="optional";for(let T in t){if(p.has(T))continue;if(g==="never"){c.push(T);continue}let v=f.run({value:t[T],issues:[]},n);v instanceof Promise?e.push(v.then(s=>Ot(s,r,T,t,P))):Ot(v,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(Pu,"handleCatchall");var Kn=I("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Tt(()=>xu(t));X(e._zod,"propValues",()=>{let p=t.shape,f={};for(let g in p){let P=p[g]._zod;if(P.values){f[g]??(f[g]=new Set);for(let T of P.values)f[g].add(T)}}return f});let i=Xe,u=t.catchall,c;e._zod.parse=(p,f)=>{c??(c=n.value);let g=p.value;if(!i(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let P=[],T=c.shape;for(let v of c.keys){let s=T[v],d=s._zod.optout==="optional",y=s._zod.run({value:g[v],issues:[]},f);y instanceof Promise?P.push(y.then(m=>Ot(m,p,v,g,d))):Ot(y,p,v,g,d)}return u?Pu(P,g,p,f,n.value,e):P.length?Promise.all(P).then(()=>p):p}});function Mn(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=>!Ue(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=>be(c,n,fe())))}),t)}o(Mn,"handleUnionResults");var gr=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=>Et(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,p=[];for(let f of t.options){let g=f._zod.run({value:i.value,issues:[]},u);if(g instanceof Promise)p.push(g),c=!0;else{if(g.issues.length===0)return g;p.push(g)}}return c?Promise.all(p).then(f=>Mn(f,i,e,u)):Mn(p,i,e,u)}});var Jn=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gr.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[p,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let g of f)i[p].add(g)}}return i});let n=Tt(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of p){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Xe(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._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 Xn=I("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Pn(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 p=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let P=t.valueType._zod.run({value:i[g],issues:[]},n);P instanceof Promise?u.push(P.then(T=>{T.issues.length&&r.issues.push(..._e(g,T.issues)),r.value[g]=T.value})):(P.issues.length&&r.issues.push(..._e(g,P.issues)),r.value[g]=P.value)}let f;for(let g in i)p.has(g)||(f=f??[],f.push(g));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&pr.test(p)&&f.issues.length){let T=t.keyType._zod.run({value:Number(p),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(f=T)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(T=>be(T,n,fe())),input:p,path:[p],inst:e});continue}let P=t.valueType._zod.run({value:i[p],issues:[]},n);P instanceof Promise?u.push(P.then(T=>{T.issues.length&&r.issues.push(..._e(p,T.issues)),r.value[f.value]=T.value})):(P.issues.length&&r.issues.push(..._e(p,P.issues)),r.value[f.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Yn=I("$ZodEnum",(e,t)=>{G.init(e,t);let r=sr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>_n.has(typeof i)).map(i=>typeof i=="string"?Ce(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"?Ce(n):n?Ce(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 eo=I("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new bt(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 pe;return r.value=i,r}});function Ln(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Ln,"handleOptionalResult");var to=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(`^(${Et(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=>Ln(u,r.value)):Ln(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var ro=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(`^(${Et(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 no=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=>zt(c,t.in,n)):zt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>zt(u,t.out,n)):zt(i,t.out,n)}});function zt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(zt,"handlePipeResult");var oo=I("$ZodCustom",(e,t)=>{Ie.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=>jn(u,r,n,e));jn(i,r,n,e)}});function jn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(cr(i))}}o(jn,"handleRefineResult");var ao;var yr=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 so(){return new yr}o(so,"registry");(ao=globalThis).__zod_globalRegistry??(ao.__zod_globalRegistry=so());var hr=globalThis.__zod_globalRegistry;function uo(e,t){return new e({type:"string",...H(t)})}o(uo,"_string");function co(e,t){return new e({type:"string",coerce:!0,...H(t)})}o(co,"_coercedString");function po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}o(po,"_url");function lo(e,t){return new e({type:"number",checks:[],...H(t)})}o(lo,"_number");function mo(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}o(mo,"_coercedNumber");function fo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...H(t)})}o(fo,"_int");function go(e,t){return new e({type:"boolean",...H(t)})}o(go,"_boolean");function yo(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}o(yo,"_coercedBoolean");function ho(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}o(ho,"_coercedBigint");function vo(e){return new e({type:"any"})}o(vo,"_any");function xo(e){return new e({type:"unknown"})}o(xo,"_unknown");function Po(e,t){return new e({type:"void",...H(t)})}o(Po,"_void");function _o(e,t){return new e({type:"date",coerce:!0,...H(t)})}o(_o,"_coercedDate");function wt(e,t){return new kn({check:"greater_than",...H(t),value:e,inclusive:!0})}o(wt,"_gte");function se(e,t){return new Rn({check:"min_length",...H(t),minimum:e})}o(se,"_minLength");function Te(e,t){return new Nn({check:"string_format",format:"regex",...H(t),pattern:e})}o(Te,"_regex");function bo(e,t,r){let n=H(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(bo,"_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)=>$t(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Qe(e,r,n),e.parseAsync=async(r,n)=>At(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>et(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)=>{kt.init(e,t),Y.init(e,t)});function a(e){return uo(Nt,e)}o(a,"string");var Io=I("ZodMiniStringFormat",(e,t)=>{dr.init(e,t),Nt.init(e,t)});var Ru=I("ZodMiniURL",(e,t)=>{Bn.init(e,t),Io.init(e,t)});function To(e){return po(Ru,e)}o(To,"url");var Dt=I("ZodMiniNumber",(e,t)=>{mr.init(e,t),Y.init(e,t)});function ee(e){return lo(Dt,e)}o(ee,"number");var Nu=I("ZodMiniNumberFormat",(e,t)=>{Fn.init(e,t),Dt.init(e,t)});function Eo(e){return fo(Nu,e)}o(Eo,"int");var vr=I("ZodMiniBoolean",(e,t)=>{fr.init(e,t),Y.init(e,t)});function F(e){return go(vr,e)}o(F,"boolean");var So=I("ZodMiniBigInt",(e,t)=>{Zn.init(e,t),Y.init(e,t)});var Du=I("ZodMiniAny",(e,t)=>{Vn.init(e,t),Y.init(e,t)});function rt(){return vo(Du)}o(rt,"any");var Cu=I("ZodMiniUnknown",(e,t)=>{Hn.init(e,t),Y.init(e,t)});function k(){return xo(Cu)}o(k,"unknown");var Uu=I("ZodMiniVoid",(e,t)=>{qn.init(e,t),Y.init(e,t)});function $o(e){return Po(Uu,e)}o($o,"_void");var Ao=I("ZodMiniDate",(e,t)=>{Gn.init(e,t),Y.init(e,t)});var Mu=I("ZodMiniArray",(e,t)=>{Wn.init(e,t),Y.init(e,t)});function N(e,t){return new Mu({type:"array",element:e,...H(t)})}o(N,"array");var Lu=I("ZodMiniObject",(e,t)=>{Kn.init(e,t),Y.init(e,t),X(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...H(t)};return new Lu(r)}o(l,"object");var ju=I("ZodMiniUnion",(e,t)=>{gr.init(e,t),Y.init(e,t)});function D(e,t){return new ju({type:"union",options:e,...H(t)})}o(D,"union");var Bu=I("ZodMiniDiscriminatedUnion",(e,t)=>{Jn.init(e,t),Y.init(e,t)});function Ee(e,t,r){return new Bu({type:"union",options:t,discriminator:e,...H(r)})}o(Ee,"discriminatedUnion");var Fu=I("ZodMiniRecord",(e,t)=>{Xn.init(e,t),Y.init(e,t)});function w(e,t,r){return new Fu({type:"record",keyType:e,valueType:t,...H(r)})}o(w,"record");var Zu=I("ZodMiniEnum",(e,t)=>{Yn.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 Zu({type:"enum",entries:r,...H(t)})}o(U,"_enum");var Vu=I("ZodMiniLiteral",(e,t)=>{Qn.init(e,t),Y.init(e,t)});function $(e,t){return new Vu({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}o($,"literal");var Hu=I("ZodMiniTransform",(e,t)=>{eo.init(e,t),Y.init(e,t)});function Se(e){return new Hu({type:"transform",transform:e})}o(Se,"transform");var qu=I("ZodMiniOptional",(e,t)=>{to.init(e,t),Y.init(e,t)});function h(e){return new qu({type:"optional",innerType:e})}o(h,"optional");var Gu=I("ZodMiniNullable",(e,t)=>{ro.init(e,t),Y.init(e,t)});function nt(e){return new Gu({type:"nullable",innerType:e})}o(nt,"nullable");var Wu=I("ZodMiniPipe",(e,t)=>{no.init(e,t),Y.init(e,t)});function $e(e,t){return new Wu({type:"pipe",in:e,out:t})}o($e,"pipe");var Ku=I("ZodMiniCustom",(e,t)=>{oo.init(e,t),Y.init(e,t)});function Ct(e,t){return bo(Ku,e??(()=>!0),t)}o(Ct,"custom");var ot={};gn(ot,{bigint:()=>tc,boolean:()=>ec,date:()=>rc,number:()=>Qu,string:()=>Yu});function Yu(e){return co(Nt,e)}o(Yu,"string");function Qu(e){return mo(Dt,e)}o(Qu,"number");function ec(e){return yo(vr,e)}o(ec,"boolean");function tc(e){return ho(So,e)}o(tc,"bigint");function rc(e){return _o(Ao,e)}o(rc,"date");var Pr=l({retryOnFailure:l({defaultValue:h(F()),hide:h(F())}),continueOnFailure:l({defaultValue:h(F()),hide:h(F())})}),xr=class{constructor(t,r,n,i,u,c,p,f,g,P,T){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=P;this.aiMetadata=T}static{o(this,"IAction")}},W=o(e=>new xr(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 B=l({displayName:a(),description:h(a())}),C=o((e,t)=>l({type:$(t),required:F(),defaultValue:h(rt())}),"TPropertyValue");var ne=l({...B.shape,...C(a(),"SHORT_TEXT").shape}),ge=l({...B.shape,...C(a(),"LONG_TEXT").shape});var Oo=l({label:a(),value:k()}),Ut=l({disabled:h(F()),placeholder:h(a()),options:N(Oo)});var oe=l({...B.shape,options:Ut,...C(k(),"STATIC_DROPDOWN").shape}),ye=l({...B.shape,options:Ut,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var _r=l({...B.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),it=l({...B.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var he=l({...B.shape,...C(F(),"CHECKBOX").shape});var ve=l({...B.shape,...C(ee(),"NUMBER").shape});var at=l({...B.shape,streaming:h(F()),...C(k(),"FILE").shape});var st=l({...B.shape,...C(a(),"DATE_TIME").shape});var ko=w(a(),D([ne,ge,oe,it,ye,he,ve,at,st])),ut=l({...B.shape,properties:ko,...C(N(k()),"ARRAY").shape});var ct=l({...B.shape,...C(D([w(a(),k())]),"JSON").shape});var wo=D([ne,oe,ct,ut,ye]),oc=w(a(),wo),br=l({refreshers:N(a()),...B.shape,...C(k(),"DYNAMIC").shape});var Mt=l({...B.shape,...C($o(),"MARKDOWN").shape});var pt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(pt||{}),Me=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Me||{}),Le=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(Le||{});var lt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(lt||{}),Ir="both_client_credentials_and_authorization_code";var Oe=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Oe||{}),dt=(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))(dt||{}),ic=l({strategy:U(dt),paramName:h(a())}),mt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(mt||{});var Lt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Lt||{}),Ro=l({status:h(ee()),body:h(k()),headers:h(w(a(),a()))}),No=l({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(U(Lt))}),Do=l({type:$("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Ro,handlerId:h(a()),streamStepProgress:h(U(Lt))}),ac=D([No,Do]);var sc=l({body:k(),rawBody:h(k()),headers:w(a(),a()),queryParams:w(a(),a())});function ue(e){return e==null}o(ue,"isNil");function ft(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ft,"isEmpty");function jt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(jt,"assertNotNullOrUndefined");var Tr=De(require("crypto"),1);var uc=128,ke,je,cc=o(e=>{!ke||ke.length<e?(ke=Buffer.allocUnsafe(e*uc),Tr.default.randomFillSync(ke),je=0):je+e>ke.length&&(Tr.default.randomFillSync(ke),je=0),je+=e},"fillPool"),pc=o(e=>(cc(e|=0),ke.subarray(je-e,je)),"random"),lc=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 p=r(i),f=i;for(;f--;)if(c+=e[p[f]&n]||"",c.length===u)return c}}},"customRandom"),Uo=o((e,t=21)=>lc(e,t,pc),"customAlphabet");var dc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Mo=21,_b=a().check(Te(new RegExp(`^[0-9a-zA-Z]{${Mo}}$`))),mc=Uo(dc,Mo);var Ae=$e(Se(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:Ae,updated:Ae},q=o(e=>h(nt(e)),"Nullable");function Er(e){return h(nt(U(e)))}o(Er,"NullableEnum");var Tb=$e(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(F())),Bt=o(e=>$e(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(N(e))),"OptionalArrayFromQuery");var $b=w(a(),k());var gt=(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))(gt||{});var Lb=a().check(Te(/^#[0-9A-Fa-f]{6}$/));var Bb=l({filename:a(),data:k(),type:$("file"),mimetype:h(a())});var fc=De(jo());var Wb=l({...ie,name:a(),permissions:N(a()),platformId:q(a()),type:a(),userCount:h(ee())});var Bo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Bo||{}),Sr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Sr||{}),$r=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))($r||{});var Ar=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Ar||{});var zr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(zr||{});var gc=l({mode:U(Bo),value:k()}),yc=l({auth:h(a()),fields:w(a(),gc)}),hc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(yc)}),vc=l({type:$("PIECE"),toolName:a().check(se(1)),pieceMetadata:hc}),xc=l({type:$("none")}),Pc=l({type:$("access_token"),accessToken:a()}),_c=l({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),bc=l({type:$("headers"),headers:w(a(),a())}),Ic=Ee("type",[xc,Pc,_c,bc]),Fo=l({type:$("FLOW"),toolName:a().check(se(1)),externalFlowId:a(),flowDisplayName:h(a())}),Zo=l({type:$("MCP"),toolName:a().check(se(1)),serverUrl:To(),protocol:U($r),auth:Ic}),Vo=l({type:$("KNOWLEDGE_BASE"),toolName:a().check(se(1)),sourceType:U(Sr),sourceId:a(),sourceName:a()}),Tc=Ee("type",[vc,Fo,Zo,Vo]),Ec=l({displayName:a(),description:h(a()),type:U(Ar)}),Ho=l({type:$("MARKDOWN"),markdown:a()}),Be={type:$("TOOL_CALL"),input:q(w(a(),k())),output:h(k()),toolName:a(),status:U(zr),toolCallId:a(),startTime:a(),endTime:h(a())},EI=l(Be),qo=Ee("toolCallType",[l({...Be,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Be,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),l({...Be,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),l({...Be,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Be,toolCallType:$("UNKNOWN"),displayName:a()})]),Sc=D([Ho,qo]);var Or=(r=>(r.IMAGE="image",r.TEXT="text",r))(Or||{}),xe=l({apiKey:a()}),$c=xe,Ac=l({apiKey:a(),apiKeyHash:a()}),zc=xe,Oc=xe,kc=xe,wc=xe,Rc=xe,Nc=xe,Dc=xe,Xo=l({accessKeyId:a().check(se(1)),secretAccessKey:a().check(se(1))}),Cc=l({}),Uc=l({}),Mc=l({}),Lc=l({}),jc=l({}),Bc=l({}),Yo=l({modelId:a(),modelName:a(),modelType:U(Or)}),Qo=l({apiKeyHeader:a(),baseUrl:a(),models:N(Yo),defaultHeaders:h(w(a(),a()))}),ei=l({accountId:a(),gatewayId:a(),models:N(Yo),vertexProject:h(a()),vertexRegion:h(a())}),ti=l({resourceName:a(),apiVersion:$e(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),ri=l({region:a().check(se(1))}),Fc=D([$c,kc,wc,Rc,Nc,Oc,zc,Ac,Xo,Dc]),ni=D([Qo,ei,ti,ri,Cc,Mc,Lc,jc,Uc,Bc]),Zc=l({id:a(),name:a(),type:U(Or)}),Vc=l({id:a(),name:a(),provider:U(gt),config:ni,enabledForChat:F()}),Hc=l({provider:U(gt),config:ni,auth:Fc,platformId:a()});var zI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Go=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],qc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Gc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Wo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Wc=["grok-4.20","grok-4.1-fast"],Kc={openai:Go,anthropic:qc,google:Wo,activepieces:[...Gc.map(e=>`anthropic/${e}`),...Go.map(e=>`openai/${e}`),...Wo.map(e=>`google/${e}`),...Wc.map(e=>`x-ai/${e}`)]};var Ko=128e3,Jc={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Xc({provider:e}){return e?Jc[e]??Ko:Ko}o(Xc,"getMaxContextTokens");var Jo={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},Yc={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Qc=new Set(["anthropic","mistral"]);function le(e){return{chatModels:Kc[e],maxContextTokens:Xc({provider:e}),defaultEmbeddingModel:Jo[e],supportsEmbedding:Jo[e]!==void 0,supportsImageGeneration:!Qc.has(e),webSearch:Yc[e]}}o(le,"buildProviderCapabilities");var ep={openai:le("openai"),anthropic:le("anthropic"),openrouter:le("openrouter"),azure:le("azure"),google:le("google"),"cloudflare-gateway":le("cloudflare-gateway"),custom:le("custom"),bedrock:le("bedrock"),mistral:le("mistral"),activepieces:le("activepieces")};var tp=l({base64Url:a(),fileName:a(),extension:h(a())}),rp=l({mimeType:a(),url:a(),fileName:h(a())}),kr=D([tp,rp]);var np=D([l({type:$("file"),value:kr}),l({type:$("markdown"),value:a(),files:h(N(kr))})]),op=l({sessionId:a(),message:a(),files:h(N(a()))});var ii=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ii||{}),ai=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ai||{}),wr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(wr||{});var ip=D([l({...ie,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...ie,name:a(),externalId:a(),type:D([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),ap=l({...ie,name:a(),folderId:q(a()),projectId:a(),externalId:a(),status:Er(ai),trigger:Er(ii)}),sp=l({...ie,tableId:a(),projectId:a(),cells:w(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),up=l({events:N(U(wr)),webhookUrl:a(),flowId:a()}),cp=l({fields:N(l({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),pp=l({projectId:a(),limit:h(ot.number()),cursor:h(a()),name:h(a()),externalIds:Bt(a()),folderId:h(a()),folderIds:Bt(a())}),lp=l({records:N(N(l({fieldId:a(),value:ui()}))),tableId:a()}),dp=l({cells:h(N(l({fieldId:a(),value:ui()}))),tableId:a(),agentUpdate:h(F())}),si=Ee("operator",[we("eq"),we("neq"),we("gt"),we("gte"),we("lt"),we("lte"),we("co"),oi("exists"),oi("not_exists")]),mp=l({tableId:a(),limit:h(ot.number()),cursor:h(a()),filters:Bt(si)});function ui(){return $e(Se(e=>e==null?e:String(e)),nt(a()))}o(ui,"coerceToString");function we(e){return l({fieldId:a(),operator:$(e),value:a()})}o(we,"valueFilter");function oi(e){return l({fieldId:a(),operator:$(e)})}o(oi,"existenceFilter");var fp=l({status:h(ee()),body:h(k()),headers:h(w(a(),a()))}),gp=l({...ie,deleted:q(Ae),ownerId:a(),displayName:a(),platformId:a(),externalId:q(a())});var ci=l({name:a(),description:h(a()),type:a(),required:F()}),yp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(ci),returnsResponse:F()})});var pi="^[0-9]+\\.[0-9]+\\.[0-9]+$",WI=new RegExp(pi),vp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",KI=a().check(Te(new RegExp(pi))),JI=a().check(Te(new RegExp(vp))),xp=l({packageType:$("ARCHIVE"),pieceType:U(Me),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),li=l({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),di=l({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),XI=D([li,di]),YI=D([xp,li,di]);var Pp=Ee("type",[l({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:$("INTERVAL"),intervalMs:Eo().check(wt(6e4))})]),QI=l({...ie,type:U(Oe),projectId:a(),flowId:a(),triggerName:a(),schedule:q(Pp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:q(a()),simulate:F()}),mi=(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))(mi||{}),fi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(fi||{}),gi=(r=>(r.S3="S3",r.DB="DB",r))(gi||{}),eT=l({...ie,projectId:q(a()),platformId:q(a()),type:U(mi),compression:U(fi),data:h(k()),location:U(gi),size:q(ee()),fileName:q(a()),s3Key:q(a()),metadata:q(w(a(),a()))}),yi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(yi||{}),hi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(hi||{}),tT=l({id:a(),email:a(),firstName:a(),status:U(hi),externalId:q(a()),platformId:q(a()),platformRole:U(yi),lastName:a(),created:Ae,updated:Ae,lastActiveDate:q(Ae),imageUrl:q(a())});var Rr=l({...B.shape,...C(w(a(),k()),"OBJECT").shape});var _i=l({...B.shape,...C(a(),"COLOR").shape});var Nr=D([ne,ge,Mt,he,oe,ye,_r,it,br,ve,ut,Rr,ct,st,at,_i]),_={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 de=l({displayName:a(),description:h(a())});var bi=l({username:a(),password:a()}),Dr=l({...de.shape,username:l({displayName:a(),description:h(a())}),password:l({displayName:a(),description:h(a())}),...C(bi,"BASIC_AUTH").shape});var Tp=w(a(),D([ne,ge,ve,he,oe])),Cr=l({...de.shape,props:Tp,...C(k(),"CUSTOM_AUTH").shape});var Re=l({...de.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var Ep=w(a(),D([ne,ge,Re,ve,he,oe,ye,Mt])),Ii=l({...de.shape,props:Ep,...C(k(),"OIDC").shape});var Ur=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Ur||{}),Ti=D([ne,Re,oe]),Ei=w(a(),Ti),Sp=l({props:h(w(a(),Ti)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:h(D([$("none"),$("consent"),$("login"),$("omit")])),pkce:h(F()),pkceMethod:h(D([$("plain"),$("S256")])),authorizationMethod:h(U(Ur)),grantType:h(D([U(lt),$(Ir)])),extra:h(w(a(),a()))}),Si=l({access_token:a(),props:h(Ei),data:w(a(),rt())}),Mr=l({...de.shape,...Sp.shape,...C(Si,"OAUTH2").shape});var Fe=D([Dr,Cr,Ii,Mr,Re]),yt="Connection",Lr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||yt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||yt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||yt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||yt}},None(){}};var RE={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 $p=l({...B.shape,...C(k(),"CUSTOM").shape,code:a()});var Ap=D([Nr,Fe]),jr=w(a(),Ap),QE=w(a(),Nr);var $i=D([l({strategy:$("CRON"),cronExpression:a()}),l({strategy:$("NONE")})]);var Ai="2",Zt="0.82.0";var Br=class{constructor(t,r,n,i,u,c,p,f,g=Zt,P,T="",v){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=P;this.description=T;this.deprecated=v;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ai}),"getContextInfo");(!zp(g)||Op(g,Zt))&&(this.minimumSupportedRelease=Zt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},zi=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 Br(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function zp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(zp,"isValidSimpleSemver");function Op(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(Op,"isSemverLessThan");var kp=h(w(a(),w(a(),a()))),Oi=l({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:h(a()),directoryPath:h(a()),auth:h(D([Fe,N(Fe)])),version:a(),categories:h(N(U(Le))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),deprecated:h(F()),i18n:kp}),wp=U(["human","ai","both"]),ki=l({description:h(a()),idempotent:h(F())}),wi=l({name:a(),displayName:a(),description:a(),props:jr,requireAuth:F(),errorHandlingOptions:h(Pr),outputSchema:h(Ct()),audience:h(wp),aiMetadata:h(ki)}),Ri=l({name:a(),displayName:a(),description:a(),props:jr,errorHandlingOptions:h(Pr),type:U(Oe),sampleData:k(),handshakeConfiguration:h(Ct()),renewConfiguration:h($i),testStrategy:U(mt),outputSchema:h(Ct()),aiMetadata:h(ki)}),Rp=l({...Oi.shape,actions:w(a(),wi),triggers:w(a(),Ri)}),Np=l({...Oi.shape,actions:ee(),triggers:ee(),suggestedActions:h(N(wi)),suggestedTriggers:h(N(Ri))}),Ni=l({projectUsage:ee(),pieceType:U(Me),packageType:U(pt),platformId:h(a()),archiveId:h(a())}),QS=l({...Rp.shape,...Ni.shape}),e$=l({...Np.shape,...Ni.shape}),t$=l({name:a(),version:a()});var Dp=De(require("path")),Cp=De(require("fs/promises"));var Mi=require("node:stream");var Vt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Ht=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Fr,r=new Zr){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}},Zr=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}}};function Di({error:e,requestBody:t}){return e instanceof ht?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Di,"toFailsafeOutput");var Vr=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Vr||{});var qt=class extends Vt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Ht){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[L,re]of Object.entries(c))i.append(L,re);let p=i.toString(),f=p?`${n}?${p}`:n,g=t.responseType??"json",P=t.followRedirects??!0,T=t.retries??0,{body:v,extraHeaders:s,isStream:d}=Up(t.method)?Mp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},y=jp({...u,...s}),m=await Lp(async()=>{let L=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let ae={method:t.method.toString(),headers:y,body:v,redirect:P?"follow":"manual",signal:L.signal};return d&&(ae.duplex="half"),r?.dispatcher!==void 0&&(ae.dispatcher=r.dispatcher),await fetch(f,ae)}finally{re!==void 0&&clearTimeout(re)}},T),x=P?300:400;if(m.status<200||m.status>=x){let L=await Ci(m,g),re=new ht(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let b=await Ci(m,g);return{status:m.status,headers:Bp(m.headers),body:b}}};function Up(e){return e!=="GET"&&e!=="HEAD"}o(Up,"acceptsRequestBody");function Mp(e,t){if(Zp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Fp(e)){let n=new Mi.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Mp,"serializeBody");async function Ci(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Ci,"parseResponseBody");async function Lp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ui(n);continue}return i}catch(i){if(r=i,n<t){await Ui(n);continue}throw i}throw r}o(Lp,"sendWithRetries");function Ui(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ui,"backoff");function jp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(jp,"normalizeHeaders");function Bp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Bp,"toHttpHeaders");function Fp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Fp,"isNodeFormData");function Zp(e){return e==null}o(Zp,"isNil");var Gt=new qt;var Od=De(require("fs")),Vs=De(Zs());var kd={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function wd(e){let t=e.split(";")[0].trim().toLowerCase();return kd[t]??""}o(wd,"contentTypeToExtension");var Rd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Nd=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 Hs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return W({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:g})=>({url:_.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${Nd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:_.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Vr).map(g=>({label:g,value:g}))},...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:g})=>{if(!g)return{};let P=g,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}),...p},run:o(async g=>{let{method:P,url:T,headers:v,queryParams:s,body:d,body_type:y,failsafe:m,timeout:x,response_is_binary:b,followRedirects:L}=g.propsValue;jt(P,"Method"),jt(T,"URL");let re=ue(r)?{}:await r(g.auth,g.propsValue),ae=T.url,Ke=ae.startsWith("http://")||ae.startsWith("https://")?ae:Rd({baseUrl:t(g.auth),relativePath:ae}),Pe={method:P,url:Ke,headers:{...v??{},...f==="headers"||!ue(f)?re:{}},queryParams:{...f==="queryParams"?re:{},...s??{}},timeout:x?x*1e3:0,followRedirects:L};if(b&&(Pe.responseType="arraybuffer"),d)if(y&&y!=="none"){let me=d.data;if(y==="form_data"){let ru=me,_t=new Vs.default;for(let{fieldName:dn,fieldType:mn,textFieldValue:fn,fileFieldValue:or}of ru)mn==="text"&&!ft(fn)?_t.append(dn,fn):mn==="file"&&!ft(or)&&_t.append(dn,or.data,{filename:or?.filename});Pe.body=_t,Pe.headers={...Pe.headers,..._t.getHeaders()}}else Pe.body=me}else y||(Pe.body=d);try{let me=await Gt.sendRequest(Pe);return await Dd(g.files,me.body,me.status,me.headers,b)}catch(me){if(m)return Di({error:me,requestBody:Pe.body});throw me}},"run")})}o(Hs,"createCustomApiCallAction");var Dd=o(async(e,t,r,n,i)=>{let u;if(i&&Cd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=wd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Cd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Ud="https://api.bokio.se/v1";async function V(e,t,r,n){try{return(await Gt.sendRequest({method:t,url:`${Ud}${r}`,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:n})).body}catch(i){throw new Error(`Unexpected error: ${i.message||String(i)}`)}}o(V,"makeRequest");var Z=Lr.CustomAuth({displayName:"Bokio API Key",description:"Bokio API Key is required to authenticate requests to Bokio",required:!0,props:{companyId:_.ShortText({displayName:"Company ID",description:"Enter your Bokio Company ID ",required:!0}),api_key:_.ShortText({displayName:"API Key",description:"Enter your Bokio API Key",required:!0})},validate:o(async({auth:e})=>{if(e)try{return await V(e.api_key,"GET",`/companies/${e.companyId}/journal-entries`),{valid:!0}}catch{return{valid:!1,error:"Invalid Api Key"}}return{valid:!1,error:"Invalid Api Key"}},"validate")});var qs=W({auth:Z,name:"createCustomer",displayName:"Create Customer",description:"Creates a new customer in Bokio",audience:"both",aiMetadata:{description:"Creates a new customer record in a Bokio accounting company. Use to register a person or company before invoicing them; only customer name and type (individual/company) are required, with optional VAT/org number, contact, and address details. Not idempotent \u2014 each call creates a separate customer.",idempotent:!1},props:{customerName:_.ShortText({displayName:"Customer Name",description:"Name of the customer",required:!0}),type:_.StaticDropdown({displayName:"Customer Type",description:"Type of the customer",required:!0,options:{options:[{label:"Individual",value:"private"},{label:"Company",value:"company"}]}}),vatNumber:_.ShortText({displayName:"VAT Number",description:"Customer VAT number",required:!1}),orgNumber:_.ShortText({displayName:"Organization Number",description:"Customer organization number",required:!1}),paymentTerms:_.ShortText({displayName:"Payment Terms",description:"Payment terms for the customer. Payment terms for the invoices. Payment terms can both take free text or days, in digits, until the payment is due.",required:!1}),customerNumber:_.ShortText({displayName:"Customer Number",description:"Customer number (optional)",required:!1}),email:_.ShortText({displayName:"Email",description:"Customer email address",required:!1}),phone:_.ShortText({displayName:"Phone",description:"Customer phone number",required:!1}),lin1:_.ShortText({displayName:"Address line 1",description:"Customer address line 1",required:!1}),line2:_.ShortText({displayName:"Address line 2",description:"Customer address line 2",required:!1}),zipCode:_.ShortText({displayName:"Zip Code",description:"Customer zip code",required:!1}),city:_.ShortText({displayName:"City",description:"Customer city",required:!1}),country:_.ShortText({displayName:"Country",description:"Customer country (ISO 3166-1 alpha-2 country code)",required:!1})},async run(e){let{customerName:t,type:r,vatNumber:n,orgNumber:i,paymentTerms:u,customerNumber:c,email:p,phone:f,lin1:g,line2:P,zipCode:T,city:v,country:s}=e.propsValue,{api_key:d,companyId:y}=e.auth.props,m={name:t,type:r};n&&(m.vat_number=n),i&&(m.org_number=i),c&&(m.customer_number=c),u&&(m.payment_terms=u);let x={};p&&(x.email=p),f&&(x.phone=f),Object.keys(x).length>0&&(m.contactsDetails=x);let b={};return g&&(b.line_1=g),P&&(b.line_2=P),T&&(b.zip_code=T),v&&(b.city=v),s&&(b.country=s),Object.keys(b).length>0&&(m.address=b),await V(d,"POST",`/companies/${y}/customers`,m)}});var nr=_.Dropdown({auth:Z,displayName:"Invoice",description:"Select the invoice",required:!0,refreshers:[],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[]};try{return{disabled:!1,options:(await V(e.props.api_key,"GET",`/companies/${e.props.companyId}/invoices?limit=100`)).items.map(n=>({label:`#${n.invoiceNumber} - ${n.customerRef.customerName}`,value:n.id}))}}catch{return{disabled:!0,options:[]}}},"options")}),Md=_.StaticDropdown({displayName:"Unit Type",description:"Unit type for the item",required:!1,options:{options:[{label:"Unspecified",value:"unspecified"},{label:"Piece",value:"piece"},{label:"Hour",value:"hour"},{label:"Day",value:"day"},{label:"Month",value:"month"},{label:"Kilogram",value:"kilogram"},{label:"Gram",value:"gram"},{label:"Liter",value:"liter"},{label:"Meter",value:"meter"},{label:"Centimeter",value:"centimeter"},{label:"Millimeter",value:"millimeter"},{label:"Meter Squared",value:"meterSquared"},{label:"Meter Cubic",value:"meterCubic"},{label:"Mile",value:"mile"},{label:"Kilometer",value:"kilometer"},{label:"Gigabyte",value:"gigabyte"},{label:"Hectar",value:"hectar"},{label:"Words",value:"words"},{label:"Year",value:"year"},{label:"Week",value:"week"},{label:"Minute",value:"minute"},{label:"Megabyte",value:"megabyte"},{label:"Ton",value:"ton"}]}}),We=_.DynamicProperties({auth:Z,displayName:"Item Details",description:"Configure item details based on item type",required:!1,refreshers:["itemType"],props:o(async({itemType:e})=>{let t={description:_.ShortText({displayName:"Description",description:"Description of the line item",required:!0})};return e==="salesItem"&&(t.itemRefId=_.ShortText({displayName:"Item Reference ID",description:"UUID of the item reference",required:!1}),t.productType=_.StaticDropdown({displayName:"Product Type",description:"Type of product",required:!0,options:{options:[{label:"Goods",value:"goods"},{label:"Service",value:"service"}]}}),t.unitType=Md,t.quantity=_.Number({displayName:"Quantity",description:"Quantity of the item",required:!0,defaultValue:1}),t.unitPrice=_.Number({displayName:"Unit Price",description:"Price per unit",required:!0}),t.taxRate=_.Number({displayName:"Tax Rate",description:"Tax rate in percentage (e.g., 25 for 25%)",required:!1})),t},"props")});var Gs=W({auth:Z,name:"createInvoice",displayName:"Create Invoice",description:"Creates a new draft invoice in Bokio",audience:"both",aiMetadata:{description:"Creates a new draft invoice in a Bokio company with a single line item. Use to start a new customer invoice; invoice date, due date, and item type are required, and the customer is linked by passing the customer UUID. Not idempotent \u2014 each call creates a separate draft invoice.",idempotent:!1},props:{invoiceType:_.StaticDropdown({displayName:"Invoice Type",description:"Type of invoice",required:!1,options:{options:[{label:"Invoice",value:"invoice"},{label:"Cash Invoice",value:"cashInvoice"}]}}),customerRef:_.ShortText({displayName:"Customer ID",description:"UUID of the customer",required:!1}),invoiceDate:_.ShortText({displayName:"Invoice Date",description:"Invoice date (YYYY-MM-DD)",required:!0}),dueDate:_.ShortText({displayName:"Due Date",description:"Due date (YYYY-MM-DD)",required:!0}),orderNumberReference:_.ShortText({displayName:"Order Number Reference",description:"The order number associated with the invoice",required:!1}),currency:_.ShortText({displayName:"Currency",description:"ISO 4217 currency code (e.g., SEK, EUR, USD)",required:!1}),currencyRate:_.Number({displayName:"Currency Rate",description:"Currency rate (defaults to 1)",required:!1}),itemType:_.StaticDropdown({displayName:"Item Type",description:"Type of the line item",required:!0,options:{options:[{label:"Sales Item",value:"salesItem"},{label:"Description Only Item",value:"descriptionOnlyItem"}]}}),dynamicProps:We},async run(e){let{invoiceType:t,customerRef:r,invoiceDate:n,dueDate:i,orderNumberReference:u,currency:c,currencyRate:p,itemType:f,dynamicProps:g}=e.propsValue,{api_key:P,companyId:T}=e.auth.props,v={type:t||"invoice",invoiceDate:n,dueDate:i};r&&(v.customerRef={id:r}),u&&(v.orderNumberReference=u),c&&(v.currency=c),p!=null&&(v.currencyRate=p);let s={};return f==="salesItem"&&g&&(s.itemType=f,v.description=g?.description,s.quantity=g.quantity,s.unitPrice=g.unitPrice,g.itemRefId&&(s.itemRef={id:g.itemRefId}),g.productType&&(s.productType=g.productType),g.unitType&&(s.unitType=g.unitType),g.taxRate!==void 0&&g.taxRate!==null&&(s.taxRate=g.taxRate)),v.lineItems=[s],await V(P,"POST",`/companies/${T}/invoices`,v)}});var Ws=W({auth:Z,name:"addLineItemToInvoice",displayName:"Add line item to invoice",description:"Adds a line item to an existing draft invoice",audience:"both",aiMetadata:{description:"Appends a single line item to an existing draft invoice in Bokio, identified by invoice ID. Use to add a product, service, or description-only row to an invoice that already exists; pricing fields apply only when item type is a sales item. Not idempotent \u2014 each call appends another line item.",idempotent:!1},props:{invoiceId:nr,itemType:_.StaticDropdown({displayName:"Item Type",description:"Type of the item",required:!0,options:{options:[{label:"Sales Item",value:"salesItem"},{label:"Description Only Item",value:"descriptionOnlyItem"}]}}),dynamicProps:We},async run(e){let{invoiceId:t,itemType:r,dynamicProps:n}=e.propsValue,{api_key:i,companyId:u}=e.auth.props,c={itemType:r,description:n?.description};return r==="salesItem"&&n&&(c.quantity=n.quantity,c.unitPrice=n.unitPrice,n.itemRefId&&(c.itemRef={id:n.itemRefId}),n.productType&&(c.productType=n.productType),n.unitType&&(c.unitType=n.unitType),n.taxRate!==void 0&&n.taxRate!==null&&(c.taxRate=n.taxRate)),await V(i,"POST",`/companies/${u}/invoices/${t}/line-items`,c)}});var Ks=W({auth:Z,name:"createAnItem",displayName:"Create an item",description:"Creates a new item in Bokio",audience:"both",aiMetadata:{description:"Creates a new reusable item (a sales item with pricing, or a text item) in a Bokio company catalog. Use to define a product or service that can later be referenced on invoices; item type is required. Not idempotent \u2014 each call creates a separate item.",idempotent:!1},props:{itemType:_.StaticDropdown({displayName:"Item Type",description:"Type of the item",required:!0,options:{options:[{label:"Sales Item",value:"salesItem"},{label:"Text",value:"text"}]}}),dynamicProps:We},async run(e){let{itemType:t,dynamicProps:r}=e.propsValue,{api_key:n,companyId:i}=e.auth.props,u={itemType:t,description:r?.description};return r?.productType&&(u.productType=r.productType),r?.unitType&&(u.unitType=r.unitType),r?.unitPrice!==void 0&&r?.unitPrice!==null&&(u.unitPrice=r.unitPrice),r?.taxRate!==void 0&&r?.taxRate!==null&&(u.taxRate=r.taxRate),await V(n,"POST",`/companies/${i}/items`,u)}});var Js=W({auth:Z,name:"createAJournalEntry",displayName:"Create a journal entry",description:"Creates a new journal entry in Bokio",audience:"both",aiMetadata:{description:"Records a new bookkeeping journal entry in a Bokio company, posting debit/credit amounts against account numbers. Use for manual double-entry transactions; the entry date is required and items carry the per-account debit/credit lines. Not idempotent \u2014 each call posts a separate journal entry.",idempotent:!1},props:{title:_.ShortText({displayName:"Title",description:"Title of the journal entry",required:!1}),date:_.ShortText({displayName:"Date",description:"Journal entry date (YYYY-MM-DD)",required:!0}),items:_.Array({displayName:"Items (JSON)",description:"Journal entry items as JSON array. Each item should have: account (account number), debit (optional), credit (optional)",required:!1,properties:{account:_.Number({displayName:"Account Number",description:"Account number for the journal entry item",required:!1}),debit:_.Number({displayName:"Debit Amount",description:"Debit amount for the journal entry item",required:!1}),credit:_.Number({displayName:"Credit Amount",description:"Credit amount for the journal entry item",required:!1})}})},async run(e){let{title:t,date:r,items:n}=e.propsValue,{api_key:i,companyId:u}=e.auth.props,c={date:r};return t&&(c.title=t),n&&(c.items=n),await V(i,"POST",`/companies/${u}/journal-entries`,c)}});var Xs=W({auth:Z,name:"updateAnInvoice",displayName:"Update an invoice",description:"Updates an existing draft invoice in Bokio",audience:"both",aiMetadata:{description:"Updates an existing draft invoice in Bokio, identified by invoice ID, replacing fields such as type, customer, dates, currency, and the full line-items list (passed as a JSON array). Use to modify an invoice that already exists rather than create one. Idempotent \u2014 repeating the same update yields the same invoice state.",idempotent:!0},props:{invoiceId:nr,invoiceType:_.StaticDropdown({displayName:"Invoice Type",description:"Type of invoice",required:!1,options:{options:[{label:"Invoice",value:"invoice"},{label:"Cash Invoice",value:"cashInvoice"}]}}),customerRef:_.ShortText({displayName:"Customer ID",description:"UUID of the customer",required:!1}),invoiceDate:_.ShortText({displayName:"Invoice Date",description:"Invoice date (YYYY-MM-DD)",required:!0}),dueDate:_.ShortText({displayName:"Due Date",description:"Due date (YYYY-MM-DD)",required:!0}),orderNumberReference:_.ShortText({displayName:"Order Number Reference",description:"The order number associated with the invoice",required:!1}),currency:_.ShortText({displayName:"Currency",description:"ISO 4217 currency code (e.g., SEK, EUR, USD)",required:!1}),currencyRate:_.Number({displayName:"Currency Rate",description:"Currency rate",required:!1}),lineItemsJson:_.LongText({displayName:"Line Items (JSON)",description:"Line items as JSON array. Each item should have: itemRef (object with id), description, quantity, unitPrice, unit, itemType (PRODUCT or SERVICE), vat",required:!1})},async run(e){let{invoiceId:t,invoiceType:r,customerRef:n,invoiceDate:i,dueDate:u,orderNumberReference:c,currency:p,currencyRate:f,lineItemsJson:g}=e.propsValue,{api_key:P,companyId:T}=e.auth.props,v={};if(r&&(v.type=r),n&&(v.customerRef={id:n}),i&&(v.invoiceDate=i),u&&(v.dueDate=u),c&&(v.orderNumberReference=c),p&&(v.currency=p),f!=null&&(v.currencyRate=f),g)try{v.lineItems=JSON.parse(g)}catch{throw new Error("Invalid JSON format for line items")}return await V(P,"PUT",`/companies/${T}/invoices/${t}`,v)}});var Ys=W({auth:Z,name:"findCustomer",displayName:"Find Customer",description:"Find customers in Bokio by filtering and pagination",audience:"both",aiMetadata:{description:"Lists customers in a Bokio company with pagination, optionally filtered by name, type, VAT number, or organization number. Leaving the filter empty returns all customers; supplying a filter type and value narrows to matching records. Use to look up a customer or their ID. Idempotent read-only lookup.",idempotent:!0},props:{filterType:_.StaticDropdown({displayName:"Filter Type",description:"Type of filter to use",required:!1,options:{options:[{label:"Name",value:"name"},{label:"Type",value:"type"},{label:"VAT Number",value:"vatNumber"},{label:"Organization Number",value:"orgNumber"}]}}),filterValue:_.ShortText({displayName:"Filter Value",description:"Value to filter by",required:!1}),page:_.Number({displayName:"Page",description:"Page number (defaults to 1)",required:!1}),pageSize:_.Number({displayName:"Page Size",description:"Number of items per page (max 100, defaults to 25)",required:!1})},async run(e){let{filterType:t,filterValue:r,page:n,pageSize:i}=e.propsValue,{api_key:u,companyId:c}=e.auth.props,p="";t&&r&&(p=`${t}=='${r}'`);let f=new URLSearchParams;n!=null?f.append("page",String(n)):f.append("page","1"),i!=null?f.append("pageSize",String(i)):f.append("pageSize","25"),p&&f.append("query",p);let g=`/companies/${c}/customers?${f.toString()}`;return await V(u,"GET",g)}});var Qs=W({auth:Z,name:"getDraftInvoiceByCustomerName",displayName:"Get Draft Invoice by Customer Name",description:"Get all draft invoices for a customer by customer name",audience:"both",aiMetadata:{description:"Looks up a Bokio customer by exact name and returns their draft invoices with pagination. Use when you have a customer name (not an ID) and want their pending draft invoices; returns an empty result if no customer matches. Idempotent read-only lookup.",idempotent:!0},props:{customerName:_.ShortText({displayName:"Customer Name",description:"Name of the customer to find draft invoices for",required:!0}),page:_.Number({displayName:"Page",description:"Page number (defaults to 1)",required:!1}),pageSize:_.Number({displayName:"Page Size",description:"Number of items per page (max 100, defaults to 25)",required:!1})},async run(e){let{customerName:t,page:r,pageSize:n}=e.propsValue,{api_key:i,companyId:u}=e.auth.props,c=new URLSearchParams;c.append("page","1"),c.append("pageSize","100"),c.append("query",`name=='${t}'`);let p=`/companies/${u}/customers?${c.toString()}`,f=await V(i,"GET",p);if(!f.items||f.items.length===0)return{message:`No customer found with name: ${t}`,items:[]};let g=f.items[0].id,P=new URLSearchParams;r!=null?P.append("page",String(r)):P.append("page","1"),n!=null?P.append("pageSize",String(n)):P.append("pageSize","25"),P.append("query",`status==draft&&customerRef==${g}`);let T=`/companies/${u}/invoices?${P.toString()}`,v=await V(i,"GET",T);return{customerName:f.items[0].name,customerId:g,...v}}});var eu=W({auth:Z,name:"getAnInvoice",displayName:"Get an invoice",description:"Retrieve a specific invoice by its ID",audience:"both",aiMetadata:{description:"Retrieves a single invoice from a Bokio company by its invoice ID. Use when you already have the invoice ID and need its full details. Idempotent read-only lookup.",idempotent:!0},props:{invoiceId:_.ShortText({displayName:"Invoice ID",description:"The ID of the invoice to retrieve",required:!0})},async run(e){let{invoiceId:t}=e.propsValue,{api_key:r,companyId:n}=e.auth.props;return await V(r,"GET",`/companies/${n}/invoices/${t}`)}});var tu=W({auth:Z,name:"getAJournalEntry",displayName:"Get a journal entry",description:"Retrieve a specific journal entry by its ID",audience:"both",aiMetadata:{description:"Retrieves a single journal entry from a Bokio company by its UUID. Use when you already have the journal entry ID and need its full bookkeeping details. Idempotent read-only lookup.",idempotent:!0},props:{journalEntryId:_.ShortText({displayName:"Journal Entry ID",description:"UUID of the journal entry",required:!0})},async run(e){let{journalEntryId:t}=e.propsValue,{api_key:r,companyId:n}=e.auth.props;return await V(r,"GET",`/companies/${n}/journal-entries/${t}`)}});var Ld=zi({displayName:"Bokio",auth:Z,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/bokio.png",authors:["sanket-a11y"],categories:["ACCOUNTING"],description:"Bokio is an accounting software platform which offers digital bookkeeping, invoicing, and financial management tools to help simplify accounting processes.",actions:[qs,Gs,Ws,Ks,Js,Xs,Ys,Qs,eu,tu,Hs({auth:Z,baseUrl:o(e=>`https://api.bokio.se/v1/companies/${e?.props.companyId}`,"baseUrl"),authMapping:o(async e=>({Authorization:`Bearer ${e?.props.api_key}`}),"authMapping")})],triggers:[]});0&&(module.exports={bokio});
4
+ /*! Bundled license information:
5
+
6
+ mime-types/index.js:
7
+ (*!
8
+ * mime-types
9
+ * Copyright(c) 2014 Jonathan Ong
10
+ * Copyright(c) 2015 Douglas Christopher Wilson
11
+ * MIT Licensed
12
+ *)
13
+ */
package/src/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export declare const bokio: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- }>>;
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,KAAK;;;GAiChB,CAAC"}
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,4CAA8C;AAC9C,mEAA+D;AAC/D,iEAA6D;AAC7D,qFAA8E;AAC9E,iEAA4D;AAC5D,iFAA2E;AAC3E,uEAAkE;AAClE,+DAA2D;AAC3D,yGAAiG;AACjG,iEAA4D;AAC5D,2EAAqE;AACrE,+DAAwE;AACxE,iDAAqD;AAExC,QAAA,KAAK,GAAG,IAAA,8BAAW,EAAC;IAC/B,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,gBAAS;IACf,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,+CAA+C;IACxD,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,UAAU,EAAE,CAAC,sBAAa,CAAC,UAAU,CAAC;IACtC,WAAW,EACT,6JAA6J;IAC/J,OAAO,EAAE;QACP,gCAAc;QACd,8BAAa;QACb,+CAAoB;QACpB,6BAAY;QACZ,4CAAmB;QACnB,mCAAe;QACf,4BAAY;QACZ,kEAA6B;QAC7B,6BAAY;QACZ,sCAAgB;QAChB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,gBAAS;YACf,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChB,OAAO,qCAAqC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,SAAS,EAAE,CAAC;YACtE,CAAC;YACD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,UAAU,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,OAAO,EAAE;iBAC/C,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- export declare const addLineItemToInvoice: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- }>, {
5
- invoiceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- }>>;
9
- itemType: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
10
- dynamicProps: import("@activepieces/pieces-framework").DynamicProperties<false, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
12
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
- }>>;
14
- }>;
15
- //# sourceMappingURL=add-line-item-to-invoice.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-line-item-to-invoice.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-line-item-to-invoice.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;EAmE/B,CAAC"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addLineItemToInvoice = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../common/auth");
7
- const client_1 = require("../common/client");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- const props_1 = require("../common/props");
10
- exports.addLineItemToInvoice = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.bokioAuth,
12
- name: 'addLineItemToInvoice',
13
- displayName: 'Add line item to invoice',
14
- description: 'Adds a line item to an existing draft invoice',
15
- audience: 'both',
16
- aiMetadata: { description: 'Appends a single line item to an existing draft invoice in Bokio, identified by invoice ID. Use to add a product, service, or description-only row to an invoice that already exists; pricing fields apply only when item type is a sales item. Not idempotent — each call appends another line item.', idempotent: false },
17
- props: {
18
- invoiceId: props_1.invoiceIdDropdown,
19
- itemType: pieces_framework_1.Property.StaticDropdown({
20
- displayName: 'Item Type',
21
- description: 'Type of the item',
22
- required: true,
23
- options: {
24
- options: [
25
- { label: 'Sales Item', value: 'salesItem' },
26
- { label: 'Description Only Item', value: 'descriptionOnlyItem' },
27
- ],
28
- },
29
- }),
30
- dynamicProps: props_1.lineItemsProps,
31
- },
32
- run(context) {
33
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
34
- const { invoiceId, itemType, dynamicProps } = context.propsValue;
35
- const { api_key, companyId } = context.auth.props;
36
- const body = {
37
- itemType,
38
- description: dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps['description'],
39
- };
40
- // Only add pricing fields for sales items
41
- if (itemType === 'salesItem' && dynamicProps) {
42
- body.quantity = dynamicProps['quantity'];
43
- body.unitPrice = dynamicProps['unitPrice'];
44
- if (dynamicProps['itemRefId']) {
45
- body.itemRef = {
46
- id: dynamicProps['itemRefId'],
47
- };
48
- }
49
- if (dynamicProps['productType']) {
50
- body.productType = dynamicProps['productType'];
51
- }
52
- if (dynamicProps['unitType']) {
53
- body.unitType = dynamicProps['unitType'];
54
- }
55
- if (dynamicProps['taxRate'] !== undefined &&
56
- dynamicProps['taxRate'] !== null) {
57
- body.taxRate = dynamicProps['taxRate'];
58
- }
59
- }
60
- const response = yield (0, client_1.makeRequest)(api_key, pieces_common_1.HttpMethod.POST, `/companies/${companyId}/invoices/${invoiceId}/line-items`, body);
61
- return response;
62
- });
63
- },
64
- });
65
- //# sourceMappingURL=add-line-item-to-invoice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-line-item-to-invoice.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-line-item-to-invoice.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA2C;AAC3C,6CAA+C;AAC/C,+DAAyD;AACzD,2CAAsF;AAEzE,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,+CAA+C;IAC5D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,uSAAuS,EAAE,UAAU,EAAE,KAAK,EAAE;IACvV,KAAK,EAAE;QACL,SAAS,EAAE,yBAAiB;QAC5B,QAAQ,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAChC,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,kBAAkB;YAC/B,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE;oBAC3C,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,qBAAqB,EAAE;iBACjE;aACF;SACF,CAAC;QACF,YAAY,EAAE,sBAAc;KAC7B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACjE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAElD,MAAM,IAAI,GAAQ;gBAChB,QAAQ;gBACR,WAAW,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAG,aAAa,CAAC;aAC3C,CAAC;YAEF,0CAA0C;YAC1C,IAAI,QAAQ,KAAK,WAAW,IAAI,YAAY,EAAE,CAAC;gBAC7C,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;gBACzC,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;gBAE3C,IAAI,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;oBAC9B,IAAI,CAAC,OAAO,GAAG;wBACb,EAAE,EAAE,YAAY,CAAC,WAAW,CAAC;qBAC9B,CAAC;gBACJ,CAAC;gBAED,IAAI,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC;oBAChC,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;gBACjD,CAAC;gBAED,IAAI,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;oBAC7B,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;gBAC3C,CAAC;gBAED,IACE,YAAY,CAAC,SAAS,CAAC,KAAK,SAAS;oBACrC,YAAY,CAAC,SAAS,CAAC,KAAK,IAAI,EAChC,CAAC;oBACD,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;gBACzC,CAAC;YACH,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,EACP,0BAAU,CAAC,IAAI,EACf,cAAc,SAAS,aAAa,SAAS,aAAa,EAC1D,IAAI,CACL,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- export declare const createAJournalEntry: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- companyId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- api_key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- }>, {
5
- title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- date: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
- items: import("@activepieces/pieces-framework").ArrayProperty<false>;
8
- }>;
9
- //# sourceMappingURL=create-a-journal-entry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-a-journal-entry.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-a-journal-entry.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB;;;;;;;EAkE9B,CAAC"}