@activepieces/piece-quickbooks 0.1.6 → 0.1.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.
- package/package.json +1 -1
- package/src/i18n/translation.json +59 -0
- package/src/index.js +3 -3
package/package.json
CHANGED
|
@@ -6,12 +6,22 @@
|
|
|
6
6
|
"Find Payment": "Find Payment",
|
|
7
7
|
"Create Invoice": "Create Invoice",
|
|
8
8
|
"Create Expense": "Create Expense",
|
|
9
|
+
"Create Bill": "Create Bill",
|
|
10
|
+
"Find Vendor": "Find Vendor",
|
|
11
|
+
"Find Account": "Find Account",
|
|
12
|
+
"Record Payment": "Record Payment",
|
|
13
|
+
"Read AR/AP Aging": "Read AR/AP Aging",
|
|
9
14
|
"Custom API Call": "Custom API Call",
|
|
10
15
|
"Search for an invoice by its number in QuickBooks.": "Search for an invoice by its number in QuickBooks.",
|
|
11
16
|
"Search for a customer by display name in QuickBooks.": "Search for a customer by display name in QuickBooks.",
|
|
12
17
|
"Finds an existing payment in QuickBooks.": "Finds an existing payment in QuickBooks.",
|
|
13
18
|
"Creates an invoice in QuickBooks.": "Creates an invoice in QuickBooks.",
|
|
14
19
|
"Creates an expense transaction (purchase) in QuickBooks.": "Creates an expense transaction (purchase) in QuickBooks.",
|
|
20
|
+
"Creates a bill (accounts payable) in QuickBooks.": "Creates a bill (accounts payable) in QuickBooks.",
|
|
21
|
+
"Search for a vendor by display name in QuickBooks.": "Search for a vendor by display name in QuickBooks.",
|
|
22
|
+
"List or search the chart of accounts to get an account Id (e.g. an expense account for a bill).": "List or search the chart of accounts to get an account Id (e.g. an expense account for a bill).",
|
|
23
|
+
"Records a customer payment in QuickBooks, optionally applying it to invoices.": "Records a customer payment in QuickBooks, optionally applying it to invoices.",
|
|
24
|
+
"Reads an accounts receivable or accounts payable aging report from QuickBooks.": "Reads an accounts receivable or accounts payable aging report from QuickBooks.",
|
|
15
25
|
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
|
16
26
|
"Invoice Number": "Invoice Number",
|
|
17
27
|
"Customer Name": "Customer Name",
|
|
@@ -29,6 +39,20 @@
|
|
|
29
39
|
"Payee (Vendor)": "Payee (Vendor)",
|
|
30
40
|
"Payment Date": "Payment Date",
|
|
31
41
|
"Memo (Private Note)": "Memo (Private Note)",
|
|
42
|
+
"Vendor": "Vendor",
|
|
43
|
+
"Bill Date": "Bill Date",
|
|
44
|
+
"Bill Number": "Bill Number",
|
|
45
|
+
"Vendor Name": "Vendor Name",
|
|
46
|
+
"Account Name Contains": "Account Name Contains",
|
|
47
|
+
"Account Type": "Account Type",
|
|
48
|
+
"Total Amount": "Total Amount",
|
|
49
|
+
"Apply to Invoices": "Apply to Invoices",
|
|
50
|
+
"Deposit To Account ID": "Deposit To Account ID",
|
|
51
|
+
"Reference Number": "Reference Number",
|
|
52
|
+
"Report": "Report",
|
|
53
|
+
"As Of Date": "As Of Date",
|
|
54
|
+
"Days Per Period": "Days Per Period",
|
|
55
|
+
"Number of Periods": "Number of Periods",
|
|
32
56
|
"Method": "Method",
|
|
33
57
|
"Headers": "Headers",
|
|
34
58
|
"Query Parameters": "Query Parameters",
|
|
@@ -54,6 +78,23 @@
|
|
|
54
78
|
"The date the expense occurred.": "The date the expense occurred.",
|
|
55
79
|
"Details of the expense (e.g., categories or items purchased). At least one line is required.": "Details of the expense (e.g., categories or items purchased). At least one line is required.",
|
|
56
80
|
"Internal note about the expense.": "Internal note about the expense.",
|
|
81
|
+
"Details of the bill (expense categories). At least one line is required.": "Details of the bill (expense categories). At least one line is required.",
|
|
82
|
+
"The date of the bill. Defaults to today if empty.": "The date of the bill. Defaults to today if empty.",
|
|
83
|
+
"The date the payment is due. If empty, the vendor/company term is used.": "The date the payment is due. If empty, the vendor/company term is used.",
|
|
84
|
+
"Reference number for the bill.": "Reference number for the bill.",
|
|
85
|
+
"Internal note about the bill.": "Internal note about the bill.",
|
|
86
|
+
"The display name of the vendor to search for.": "The display name of the vendor to search for.",
|
|
87
|
+
"Optional. Filter accounts whose name contains this text.": "Optional. Filter accounts whose name contains this text.",
|
|
88
|
+
"Optional. Filter by account type.": "Optional. Filter by account type.",
|
|
89
|
+
"The total amount of the payment received.": "The total amount of the payment received.",
|
|
90
|
+
"Optional. Apply this payment to specific invoices. Leave empty to keep the amount unapplied.": "Optional. Apply this payment to specific invoices. Leave empty to keep the amount unapplied.",
|
|
91
|
+
"Optional. The account to deposit the payment into. Defaults to Undeposited Funds if empty.": "Optional. The account to deposit the payment into. Defaults to Undeposited Funds if empty.",
|
|
92
|
+
"The date the payment was received. Defaults to today if empty.": "The date the payment was received. Defaults to today if empty.",
|
|
93
|
+
"Optional reference number for the payment (e.g. check number).": "Optional reference number for the payment (e.g. check number).",
|
|
94
|
+
"Internal note about the payment.": "Internal note about the payment.",
|
|
95
|
+
"The date to age balances against. Defaults to today if empty.": "The date to age balances against. Defaults to today if empty.",
|
|
96
|
+
"Number of days in each aging bucket (e.g. 30).": "Number of days in each aging bucket (e.g. 30).",
|
|
97
|
+
"How many aging buckets to include.": "How many aging buckets to include.",
|
|
57
98
|
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
|
58
99
|
"Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
|
|
59
100
|
"Not Set (Default - No Email)": "Not Set (Default - No Email)",
|
|
@@ -61,6 +102,24 @@
|
|
|
61
102
|
"Cash": "Cash",
|
|
62
103
|
"Check": "Check",
|
|
63
104
|
"Credit Card": "Credit Card",
|
|
105
|
+
"Bank": "Bank",
|
|
106
|
+
"Accounts Receivable": "Accounts Receivable",
|
|
107
|
+
"Other Current Asset": "Other Current Asset",
|
|
108
|
+
"Fixed Asset": "Fixed Asset",
|
|
109
|
+
"Other Asset": "Other Asset",
|
|
110
|
+
"Accounts Payable": "Accounts Payable",
|
|
111
|
+
"Other Current Liability": "Other Current Liability",
|
|
112
|
+
"Long Term Liability": "Long Term Liability",
|
|
113
|
+
"Equity": "Equity",
|
|
114
|
+
"Income": "Income",
|
|
115
|
+
"Cost of Goods Sold": "Cost of Goods Sold",
|
|
116
|
+
"Expense": "Expense",
|
|
117
|
+
"Other Income": "Other Income",
|
|
118
|
+
"Other Expense": "Other Expense",
|
|
119
|
+
"A/R Aging Summary": "A/R Aging Summary",
|
|
120
|
+
"A/R Aging Detail": "A/R Aging Detail",
|
|
121
|
+
"A/P Aging Summary": "A/P Aging Summary",
|
|
122
|
+
"A/P Aging Detail": "A/P Aging Detail",
|
|
64
123
|
"GET": "GET",
|
|
65
124
|
"POST": "POST",
|
|
66
125
|
"PATCH": "PATCH",
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var Pu=Object.create;var Pt=Object.defineProperty;var _u=Object.getOwnPropertyDescriptor;var bu=Object.getOwnPropertyNames;var Tu=Object.getPrototypeOf,Iu=Object.prototype.hasOwnProperty;var i=(e,t)=>Pt(e,"name",{value:t,configurable:!0});var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zn=(e,t)=>{for(var r in t)Pt(e,r,{get:t[r],enumerable:!0})},qn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of bu(t))!Iu.call(e,o)&&o!==r&&Pt(e,o,{get:()=>t[o],enumerable:!(n=_u(t,o))||n.enumerable});return e};var Se=(e,t,r)=>(r=e!=null?Pu(Tu(e)):{},qn(t||!e||!e.__esModule?Pt(r,"default",{value:e,enumerable:!0}):r,e)),Eu=e=>qn(Pt({},"__esModule",{value:!0}),e);var ci=z((ui,pr)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function l(u,m){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let y=0,f=-1,v=(u.match(p.zoneIndex)||[])[0],_,B;for(v&&(v=v.substring(1),u=u.replace(/%.+$/,""));(f=u.indexOf(":",f+1))>=0;)y++;if(u.substr(0,2)==="::"&&y--,u.substr(-2,2)==="::"&&y--,y>m)return null;for(B=m-y,_=":";B--;)_+="0:";return u=u.replace("::",_),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),m=function(){let ue=u.split(":"),ye=[];for(let ke=0;ke<ue.length;ke++)ye.push(parseInt(ue[ke],16));return ye}(),{parts:m,zoneId:v}}i(l,"expandIPv6");function g(u,m,y,f){if(u.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,_;for(;f>0;){if(_=y-f,_<0&&(_=0),u[v]>>_!==m[v]>>_)return!1;f-=y,v+=1}return!0}i(g,"matchCIDR");function x(u){if(o.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}i(x,"parseIntAuto");function I(u,m){for(;u.length<m;)u=`0${u}`;return u}i(I,"padPart");let P={};P.IPv4=function(){function u(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<m.length;y++)if(f=m[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return i(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(m,y){let f;if(y===void 0&&(f=m,m=f[0],y=f[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,m.octets,8,y)},u.prototype.prefixLengthFromSubnetMask=function(){let m=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,_,B;for(v=3;v>=0;v-=1)if(_=this.octets[v],_ in f){if(B=f[_],y&&B!==0)return null;B!==8&&(y=!0),m+=B}else return null;return 32-m},u.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return P.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u}(),P.IPv4.broadcastAddressFromCIDR=function(u){try{let m=this.parseCIDR(u),y=m[0].toByteArray(),f=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],_=0;for(;_<4;)v.push(parseInt(y[_],10)|parseInt(f[_],10)^255),_++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.isIPv4=function(u){return this.parser(u)!==null},P.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},P.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},P.IPv4.isValidFourPartDecimal=function(u){return!!(P.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},P.IPv4.isValidCIDRFourPartDecimal=function(u){let m=u.match(/^(.+)\/(\d+)$/);return!P.IPv4.isValidCIDR(u)||!m?!1:P.IPv4.isValidFourPartDecimal(m[1])},P.IPv4.networkAddressFromCIDR=function(u){let m,y,f,v,_;try{for(m=this.parseCIDR(u),f=m[0].toByteArray(),_=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(f[y],10)&parseInt(_[y],10)),y++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.parse=function(u){let m=this.parser(u);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},P.IPv4.parseCIDR=function(u){let m;if(m=u.match(/^(.+)\/(\d+)$/)){let y=parseInt(m[2]);if(y>=0&&y<=32){let f=[this.parse(m[1]),y];return Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},P.IPv4.parser=function(u){let m,y,f;if(m=u.match(r.fourOctet))return function(){let v=m.slice(1,6),_=[];for(let B=0;B<v.length;B++)y=v[B],_.push(x(y));return _}();if(m=u.match(r.longValue)){if(f=x(m[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],_;for(_=0;_<=24;_+=8)v.push(f>>_&255);return v}().reverse()}else return(m=u.match(r.twoOctet))?function(){let v=m.slice(1,4),_=[];if(f=x(v[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return _.push(x(v[0])),_.push(f>>16&255),_.push(f>>8&255),_.push(f&255),_}():(m=u.match(r.threeOctet))?function(){let v=m.slice(1,5),_=[];if(f=x(v[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return _.push(x(v[0])),_.push(x(v[1])),_.push(f>>8&255),_.push(f&255),_}():null},P.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let m=[0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)m[y]=255,y++;return f<4&&(m[f]=Math.pow(2,u%8)-1<<8-u%8),new this(m)},P.IPv6=function(){function u(m,y){let f,v;if(m.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(m[f]<<8|m[f+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(v=this.parts[f],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return i(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(m,y){let f;if(y===void 0&&(f=m,m=f[0],y=f[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,m.parts,16,y)},u.prototype.prefixLengthFromSubnetMask=function(){let m=0,y=!1,f={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,_;for(let B=7;B>=0;B-=1)if(v=this.parts[B],v in f){if(_=f[v],y&&_!==0)return null;_!==16&&(y=!0),m+=_}else return null;return 128-m},u.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let m,y=[],f=this.parts;for(let v=0;v<f.length;v++)m=f[v],y.push(m>>8),y.push(m&255);return y},u.prototype.toFixedLengthString=function(){let m=function(){let f=[];for(let v=0;v<this.parts.length;v++)f.push(I(this.parts[v].toString(16),4));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),m+y},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let m=this.parts.slice(-2),y=m[0],f=m[1];return new P.IPv4([y>>8,y&255,f>>8,f&255])},u.prototype.toNormalizedString=function(){let m=function(){let f=[];for(let v=0;v<this.parts.length;v++)f.push(this.parts[v].toString(16));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),m+y},u.prototype.toRFC5952String=function(){let m=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,v=-1,_;for(;_=m.exec(y);)_[0].length>v&&(f=_.index,v=_[0].length);return v<0?y:`${y.substring(0,f)}::${y.substring(f+v)}`},u.prototype.toString=function(){return this.toRFC5952String()},u}(),P.IPv6.broadcastAddressFromCIDR=function(u){try{let m=this.parseCIDR(u),y=m[0].toByteArray(),f=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],_=0;for(;_<16;)v.push(parseInt(y[_],10)|parseInt(f[_],10)^255),_++;return new this(v)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},P.IPv6.isIPv6=function(u){return this.parser(u)!==null},P.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let m=this.parser(u);return new this(m.parts,m.zoneId),!0}catch{return!1}},P.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},P.IPv6.networkAddressFromCIDR=function(u){let m,y,f,v,_;try{for(m=this.parseCIDR(u),f=m[0].toByteArray(),_=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(f[y],10)&parseInt(_[y],10)),y++;return new this(v)}catch(B){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${B})`)}},P.IPv6.parse=function(u){let m=this.parser(u);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},P.IPv6.parseCIDR=function(u){let m,y,f;if((y=u.match(/^(.+)\/(\d+)$/))&&(m=parseInt(y[2]),m>=0&&m<=128))return f=[this.parse(y[1]),m],Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},P.IPv6.parser=function(u){let m,y,f,v,_,B;if(f=u.match(p.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(p.native.test(u))return l(u,8);if((f=u.match(p.transitional))&&(B=f[6]||"",m=f[1],f[1].endsWith("::")||(m=m.slice(0,-1)),m=l(m+B,6),m.parts)){for(_=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<_.length;y++)if(v=_[y],!(0<=v&&v<=255))return null;return m.parts.push(_[0]<<8|_[1]),m.parts.push(_[2]<<8|_[3]),{parts:m.parts,zoneId:m.zoneId}}return null},P.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");let m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)m[y]=255,y++;return f<16&&(m[f]=Math.pow(2,u%8)-1<<8-u%8),new this(m)},P.fromByteArray=function(u){let m=u.length;if(m===4)return new P.IPv4(u);if(m===16)return new P.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},P.isValid=function(u){return P.IPv6.isValid(u)||P.IPv4.isValid(u)},P.isValidCIDR=function(u){return P.IPv6.isValidCIDR(u)||P.IPv4.isValidCIDR(u)},P.parse=function(u){if(P.IPv6.isValid(u))return P.IPv6.parse(u);if(P.IPv4.isValid(u))return P.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},P.parseCIDR=function(u){try{return P.IPv6.parseCIDR(u)}catch{try{return P.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},P.process=function(u){let m=this.parse(u);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},P.subnetMatch=function(u,m,y){let f,v,_,B;y==null&&(y="unicast");for(v in m)if(Object.prototype.hasOwnProperty.call(m,v)){for(_=m[v],_[0]&&!(_[0]instanceof Array)&&(_=[_]),f=0;f<_.length;f++)if(B=_[f],u.kind()===B[0].kind()&&u.match.apply(u,B))return v}return y},typeof pr<"u"&&pr.exports?pr.exports=P:e.ipaddr=P})(ui)});var ia=z((AA,oa)=>{var na=require("stream").Stream,el=require("util");oa.exports=ze;function ze(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(ze,"DelayedStream");el.inherits(ze,na);ze.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ze.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});ze.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ze.prototype.resume=function(){this._released||this.release(),this.source.resume()};ze.prototype.pause=function(){this.source.pause()};ze.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ze.prototype.pipe=function(){var e=na.prototype.pipe.apply(this,arguments);return this.resume(),e};ze.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)};ze.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 ca=z((kA,ua)=>{var tl=require("util"),sa=require("stream").Stream,aa=ia();ua.exports=se;function se(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}i(se,"CombinedStream");tl.inherits(se,sa);se.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};se.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};se.prototype.append=function(e){var t=se.isStreamLike(e);if(t){if(!(e instanceof aa)){var r=aa.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};se.prototype.pipe=function(e,t){return sa.prototype.pipe.call(this,e,t),this.resume(),e};se.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}};se.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=se.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};se.prototype._pipeNext=function(e){this._currentStream=e;var t=se.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()};se.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};se.prototype.write=function(e){this.emit("data",e)};se.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};se.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")};se.prototype.end=function(){this._reset(),this.emit("end")};se.prototype.destroy=function(){this._reset(),this.emit("close")};se.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};se.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};se.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)};se.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var la=z((wA,pa)=>{"use strict";pa.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 fa=z(xe=>{"use strict";var yr=la(),rl=require("path").extname,da=/^\s*([^;\s]*)(?:;|\s|$)/,nl=/^text\//i;xe.charset=ma;xe.charsets={lookup:ma};xe.contentType=ol;xe.extension=il;xe.extensions=Object.create(null);xe.lookup=al;xe.types=Object.create(null);sl(xe.extensions,xe.types);function ma(e){if(!e||typeof e!="string")return!1;var t=da.exec(e),r=t&&yr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&nl.test(t[1])?"UTF-8":!1}i(ma,"charset");function ol(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?xe.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=xe.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(ol,"contentType");function il(e){if(!e||typeof e!="string")return!1;var t=da.exec(e),r=t&&xe.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(il,"extension");function al(e){if(!e||typeof e!="string")return!1;var t=rl("x."+e).toLowerCase().substr(1);return t&&xe.types[t]||!1}i(al,"lookup");function sl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(yr).forEach(i(function(o){var s=yr[o],c=s.extensions;if(!(!c||!c.length)){e[o]=c;for(var p=0;p<c.length;p++){var l=c[p];if(t[l]){var g=r.indexOf(yr[t[l]].source),x=r.indexOf(s.source);if(t[l]!=="application/octet-stream"&&(g>x||g===x&&t[l].substr(0,12)==="application/"))continue}t[l]=o}}},"forEachMimeType"))}i(sl,"populateMaps")});var ya=z((NA,ga)=>{ga.exports=ul;function ul(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(ul,"defer")});var hn=z((UA,va)=>{var ha=ya();va.exports=cl;function cl(e){var t=!1;return ha(function(){t=!0}),i(function(n,o){t?e(n,o):ha(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(cl,"async")});var vn=z((LA,xa)=>{xa.exports=pl;function pl(e){Object.keys(e.jobs).forEach(ll.bind(e)),e.jobs={}}i(pl,"abort");function ll(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(ll,"clean")});var xn=z((BA,_a)=>{var Pa=hn(),dl=vn();_a.exports=ml;function ml(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=fl(t,o,e[o],function(s,c){o in r.jobs&&(delete r.jobs[o],s?dl(r):r.results[o]=c,n(s,r.results))})}i(ml,"iterate");function fl(e,t,r,n){var o;return e.length==2?o=e(r,Pa(n)):o=e(r,t,Pa(n)),o}i(fl,"runJob")});var Pn=z((VA,ba)=>{ba.exports=gl;function gl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,s){return t(e[o],e[s])}),n}i(gl,"state")});var _n=z((qA,Ta)=>{var yl=vn(),hl=hn();Ta.exports=vl;function vl(e){Object.keys(this.jobs).length&&(this.index=this.size,yl(this),hl(e)(null,this.results))}i(vl,"terminator")});var Ea=z((WA,Ia)=>{var xl=xn(),Pl=Pn(),_l=_n();Ia.exports=bl;function bl(e,t,r){for(var n=Pl(e);n.index<(n.keyedList||e).length;)xl(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return _l.bind(n,r)}i(bl,"parallel")});var bn=z((KA,hr)=>{var $a=xn(),Tl=Pn(),Il=_n();hr.exports=El;hr.exports.ascending=Sa;hr.exports.descending=$l;function El(e,t,r,n){var o=Tl(e,r);return $a(e,t,o,i(function s(c,p){if(c){n(c,p);return}if(o.index++,o.index<(o.keyedList||e).length){$a(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),Il.bind(o,n)}i(El,"serialOrdered");function Sa(e,t){return e<t?-1:e>t?1:0}i(Sa,"ascending");function $l(e,t){return-1*Sa(e,t)}i($l,"descending")});var za=z((XA,Aa)=>{var Sl=bn();Aa.exports=Al;function Al(e,t,r){return Sl(e,t,null,r)}i(Al,"serial")});var Oa=z((YA,ka)=>{ka.exports={parallel:Ea(),serial:za(),serialOrdered:bn()}});var Tn=z((ez,wa)=>{"use strict";wa.exports=Object});var Da=z((tz,Ra)=>{"use strict";Ra.exports=Error});var Ca=z((rz,Na)=>{"use strict";Na.exports=EvalError});var Ma=z((nz,Ua)=>{"use strict";Ua.exports=RangeError});var ja=z((oz,La)=>{"use strict";La.exports=ReferenceError});var Fa=z((iz,Ba)=>{"use strict";Ba.exports=SyntaxError});var vr=z((az,Va)=>{"use strict";Va.exports=TypeError});var qa=z((sz,Za)=>{"use strict";Za.exports=URIError});var Wa=z((uz,Ha)=>{"use strict";Ha.exports=Math.abs});var Ka=z((cz,Ga)=>{"use strict";Ga.exports=Math.floor});var Xa=z((pz,Ja)=>{"use strict";Ja.exports=Math.max});var Ya=z((lz,Qa)=>{"use strict";Qa.exports=Math.min});var ts=z((dz,es)=>{"use strict";es.exports=Math.pow});var ns=z((mz,rs)=>{"use strict";rs.exports=Math.round});var is=z((fz,os)=>{"use strict";os.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var ss=z((yz,as)=>{"use strict";var zl=is();as.exports=i(function(t){return zl(t)||t===0?t:t<0?-1:1},"sign")});var cs=z((vz,us)=>{"use strict";us.exports=Object.getOwnPropertyDescriptor});var In=z((xz,ps)=>{"use strict";var xr=cs();if(xr)try{xr([],"length")}catch{xr=null}ps.exports=xr});var ds=z((Pz,ls)=>{"use strict";var Pr=Object.defineProperty||!1;if(Pr)try{Pr({},"a",{value:1})}catch{Pr=!1}ls.exports=Pr});var En=z((_z,ms)=>{"use strict";ms.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==o||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var ys=z((Tz,gs)=>{"use strict";var fs=typeof Symbol<"u"&&Symbol,kl=En();gs.exports=i(function(){return typeof fs!="function"||typeof Symbol!="function"||typeof fs("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:kl()},"hasNativeSymbols")});var $n=z((Ez,hs)=>{"use strict";hs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Sn=z(($z,vs)=>{"use strict";var Ol=Tn();vs.exports=Ol.getPrototypeOf||null});var _s=z((Sz,Ps)=>{"use strict";var wl="Function.prototype.bind called on incompatible ",Rl=Object.prototype.toString,Dl=Math.max,Nl="[object Function]",xs=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),Cl=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),Ul=i(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Ps.exports=i(function(t){var r=this;if(typeof r!="function"||Rl.apply(r)!==Nl)throw new TypeError(wl+r);for(var n=Cl(arguments,1),o,s=i(function(){if(this instanceof o){var x=r.apply(this,xs(n,arguments));return Object(x)===x?x:this}return r.apply(t,xs(n,arguments))},"binder"),c=Dl(0,r.length-n.length),p=[],l=0;l<c;l++)p[l]="$"+l;if(o=Function("binder","return function ("+Ul(p,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=i(function(){},"Empty");g.prototype=r.prototype,o.prototype=new g,g.prototype=null}return o},"bind")});var dt=z((zz,bs)=>{"use strict";var Ml=_s();bs.exports=Function.prototype.bind||Ml});var _r=z((kz,Ts)=>{"use strict";Ts.exports=Function.prototype.call});var An=z((Oz,Is)=>{"use strict";Is.exports=Function.prototype.apply});var $s=z((wz,Es)=>{"use strict";Es.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var As=z((Rz,Ss)=>{"use strict";var Ll=dt(),jl=An(),Bl=_r(),Fl=$s();Ss.exports=Fl||Ll.call(Bl,jl)});var ks=z((Dz,zs)=>{"use strict";var Vl=dt(),Zl=vr(),ql=_r(),Hl=As();zs.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new Zl("a function is required");return Hl(Vl,ql,t)},"callBindBasic")});var Cs=z((Cz,Ns)=>{"use strict";var Wl=ks(),Os=In(),Rs;try{Rs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var zn=!!Rs&&Os&&Os(Object.prototype,"__proto__"),Ds=Object,ws=Ds.getPrototypeOf;Ns.exports=zn&&typeof zn.get=="function"?Wl([zn.get]):typeof ws=="function"?i(function(t){return ws(t==null?t:Ds(t))},"getDunder"):!1});var Bs=z((Mz,js)=>{"use strict";var Us=$n(),Ms=Sn(),Ls=Cs();js.exports=Us?i(function(t){return Us(t)},"getProto"):Ms?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ms(t)},"getProto"):Ls?i(function(t){return Ls(t)},"getProto"):null});var kn=z((jz,Fs)=>{"use strict";var Gl=Function.prototype.call,Kl=Object.prototype.hasOwnProperty,Jl=dt();Fs.exports=Jl.call(Gl,Kl)});var Ks=z((Bz,Gs)=>{"use strict";var W,Xl=Tn(),Ql=Da(),Yl=Ca(),ed=Ma(),td=ja(),yt=Fa(),gt=vr(),rd=qa(),nd=Wa(),od=Ka(),id=Xa(),ad=Ya(),sd=ts(),ud=ns(),cd=ss(),Hs=Function,On=i(function(e){try{return Hs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Ft=In(),pd=ds(),wn=i(function(){throw new gt},"throwTypeError"),ld=Ft?function(){try{return arguments.callee,wn}catch{try{return Ft(arguments,"callee").get}catch{return wn}}}():wn,mt=ys()(),me=Bs(),dd=Sn(),md=$n(),Ws=An(),Vt=_r(),ft={},fd=typeof Uint8Array>"u"||!me?W:me(Uint8Array),et={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?W:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?W:ArrayBuffer,"%ArrayIteratorPrototype%":mt&&me?me([][Symbol.iterator]()):W,"%AsyncFromSyncIteratorPrototype%":W,"%AsyncFunction%":ft,"%AsyncGenerator%":ft,"%AsyncGeneratorFunction%":ft,"%AsyncIteratorPrototype%":ft,"%Atomics%":typeof Atomics>"u"?W:Atomics,"%BigInt%":typeof BigInt>"u"?W:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?W:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?W:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?W:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ql,"%eval%":eval,"%EvalError%":Yl,"%Float16Array%":typeof Float16Array>"u"?W:Float16Array,"%Float32Array%":typeof Float32Array>"u"?W:Float32Array,"%Float64Array%":typeof Float64Array>"u"?W:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?W:FinalizationRegistry,"%Function%":Hs,"%GeneratorFunction%":ft,"%Int8Array%":typeof Int8Array>"u"?W:Int8Array,"%Int16Array%":typeof Int16Array>"u"?W:Int16Array,"%Int32Array%":typeof Int32Array>"u"?W:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":mt&&me?me(me([][Symbol.iterator]())):W,"%JSON%":typeof JSON=="object"?JSON:W,"%Map%":typeof Map>"u"?W:Map,"%MapIteratorPrototype%":typeof Map>"u"||!mt||!me?W:me(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Xl,"%Object.getOwnPropertyDescriptor%":Ft,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?W:Promise,"%Proxy%":typeof Proxy>"u"?W:Proxy,"%RangeError%":ed,"%ReferenceError%":td,"%Reflect%":typeof Reflect>"u"?W:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?W:Set,"%SetIteratorPrototype%":typeof Set>"u"||!mt||!me?W:me(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?W:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":mt&&me?me(""[Symbol.iterator]()):W,"%Symbol%":mt?Symbol:W,"%SyntaxError%":yt,"%ThrowTypeError%":ld,"%TypedArray%":fd,"%TypeError%":gt,"%Uint8Array%":typeof Uint8Array>"u"?W:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?W:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?W:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?W:Uint32Array,"%URIError%":rd,"%WeakMap%":typeof WeakMap>"u"?W:WeakMap,"%WeakRef%":typeof WeakRef>"u"?W:WeakRef,"%WeakSet%":typeof WeakSet>"u"?W:WeakSet,"%Function.prototype.call%":Vt,"%Function.prototype.apply%":Ws,"%Object.defineProperty%":pd,"%Object.getPrototypeOf%":dd,"%Math.abs%":nd,"%Math.floor%":od,"%Math.max%":id,"%Math.min%":ad,"%Math.pow%":sd,"%Math.round%":ud,"%Math.sign%":cd,"%Reflect.getPrototypeOf%":md};if(me)try{null.error}catch(e){Vs=me(me(e)),et["%Error.prototype%"]=Vs}var Vs,gd=i(function e(t){var r;if(t==="%AsyncFunction%")r=On("async function () {}");else if(t==="%GeneratorFunction%")r=On("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=On("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&me&&(r=me(o.prototype))}return et[t]=r,r},"doEval"),Zs={__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"]},Zt=dt(),br=kn(),yd=Zt.call(Vt,Array.prototype.concat),hd=Zt.call(Ws,Array.prototype.splice),qs=Zt.call(Vt,String.prototype.replace),Tr=Zt.call(Vt,String.prototype.slice),vd=Zt.call(Vt,RegExp.prototype.exec),xd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Pd=/\\(\\)?/g,_d=i(function(t){var r=Tr(t,0,1),n=Tr(t,-1);if(r==="%"&&n!=="%")throw new yt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new yt("invalid intrinsic syntax, expected opening `%`");var o=[];return qs(t,xd,function(s,c,p,l){o[o.length]=p?qs(l,Pd,"$1"):c||s}),o},"stringToPath"),bd=i(function(t,r){var n=t,o;if(br(Zs,n)&&(o=Zs[n],n="%"+o[0]+"%"),br(et,n)){var s=et[n];if(s===ft&&(s=gd(n)),typeof s>"u"&&!r)throw new gt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new yt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Gs.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new gt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new gt('"allowMissing" argument must be a boolean');if(vd(/^%?[^%]*%?$/,t)===null)throw new yt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_d(t),o=n.length>0?n[0]:"",s=bd("%"+o+"%",r),c=s.name,p=s.value,l=!1,g=s.alias;g&&(o=g[0],hd(n,yd([0,1],g)));for(var x=1,I=!0;x<n.length;x+=1){var P=n[x],u=Tr(P,0,1),m=Tr(P,-1);if((u==='"'||u==="'"||u==="`"||m==='"'||m==="'"||m==="`")&&u!==m)throw new yt("property names with quotes must have matching quotes");if((P==="constructor"||!I)&&(l=!0),o+="."+P,c="%"+o+"%",br(et,c))p=et[c];else if(p!=null){if(!(P in p)){if(!r)throw new gt("base intrinsic for "+t+" exists, but the property is not available.");return}if(Ft&&x+1>=n.length){var y=Ft(p,P);I=!!y,I&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[P]}else I=br(p,P),p=p[P];I&&!l&&(et[c]=p)}}return p},"GetIntrinsic")});var Xs=z((Vz,Js)=>{"use strict";var Td=En();Js.exports=i(function(){return Td()&&!!Symbol.toStringTag},"hasToStringTagShams")});var eu=z((qz,Ys)=>{"use strict";var Id=Ks(),Qs=Id("%Object.defineProperty%",!0),Ed=Xs()(),$d=kn(),Sd=vr(),Ir=Ed?Symbol.toStringTag:null;Ys.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new Sd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Ir&&(n||!$d(t,Ir))&&(Qs?Qs(t,Ir,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[Ir]=r)},"setToStringTag")});var ru=z((Wz,tu)=>{"use strict";var Ad=Function.prototype.call,zd=Object.prototype.hasOwnProperty,kd=dt();tu.exports=kd.call(Ad,zd)});var ou=z((Gz,nu)=>{"use strict";nu.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var su=z((Kz,au)=>{"use strict";var Cn=ca(),Od=require("util"),Rn=require("path"),wd=require("http"),Rd=require("https"),Dd=require("url").parse,Nd=require("fs"),Cd=require("stream").Stream,Ud=require("crypto"),Dn=fa(),Md=Oa(),Ld=eu(),We=ru(),Nn=ou();function iu(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(iu,"escapeHeaderParam");function G(e){if(!(this instanceof G))return new G(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Cn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(G,"FormData");Od.inherits(G,Cn);G.LINE_BREAK=`\r
|
|
2
|
-
`;G.DEFAULT_CONTENT_TYPE="application/octet-stream";G.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Cn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,t,r)};G.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)+G.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&We(t,"httpVersion"))&&!(t instanceof Cd))&&(r.knownLength||this._valuesToMeasure.push(t))};G.prototype._lengthRetriever=function(e,t){We(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Nd.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):We(e,"httpVersion")?t(null,Number(e.headers["content-length"])):We(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};G.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+iu(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&Nn(c,r.header);var p;for(var l in c)if(We(c,l)){if(p=c[l],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(s+=l+": "+p.join("; ")+G.LINE_BREAK)}return"--"+this.getBoundary()+G.LINE_BREAK+s+G.LINE_BREAK};G.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=Rn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Rn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&We(e,"httpVersion")&&(r=Rn.basename(e.client._httpMessage.path||"")),r)return'filename="'+iu(r)+'"'};G.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=Dn.lookup(e.name)),!r&&e&&e.path&&(r=Dn.lookup(e.path)),!r&&e&&e.readable&&We(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=Dn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=G.DEFAULT_CONTENT_TYPE),r};G.prototype._multiPartFooter=function(){return function(e){var t=G.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};G.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+G.LINE_BREAK};G.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)We(e,t)&&(r[t.toLowerCase()]=e[t]);return r};G.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};G.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};G.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(G.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};G.prototype._generateBoundary=function(){this._boundary="--------------------------"+Ud.randomBytes(12).toString("hex")};G.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};G.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};G.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}Md.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};G.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=Dd(e),n=Nn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=Nn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Rd.request(n):r=wd.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,l=i(function(g,x){return r.removeListener("error",l),r.removeListener("response",p),t.call(this,g,x)},"callback");p=l.bind(this,null),r.on("error",l),r.on("response",p)}}.bind(this)),r};G.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};G.prototype.toString=function(){return"[object FormData]"};Ld(G.prototype,"FormData");au.exports=G});var ht=z((Un,Mn)=>{(function(e,t){typeof Un=="object"&&typeof Mn<"u"?Mn.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Un,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",s="minute",c="hour",p="day",l="week",g="month",x="quarter",I="year",P="date",u="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:i(function(M){var T=["th","st","nd","rd"],b=M%100;return"["+M+(T[(b-20)%10]||T[b]||T[0])+"]"},"ordinal")},v=i(function(M,T,b){var $=String(M);return!$||$.length>=T?M:""+Array(T+1-$.length).join(b)+M},"m"),_={s:v,z:i(function(M){var T=-M.utcOffset(),b=Math.abs(T),$=Math.floor(b/60),E=b%60;return(T<=0?"+":"-")+v($,2,"0")+":"+v(E,2,"0")},"z"),m:i(function M(T,b){if(T.date()<b.date())return-M(b,T);var $=12*(b.year()-T.year())+(b.month()-T.month()),E=T.clone().add($,g),F=b-E<0,V=T.clone().add($+(F?-1:1),g);return+(-($+(b-E)/(F?E-V:V-E))||0)},"t"),a:i(function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},"a"),p:i(function(M){return{M:g,y:I,w:l,d:p,D:P,h:c,m:s,s:o,ms:n,Q:x}[M]||String(M||"").toLowerCase().replace(/s$/,"")},"p"),u:i(function(M){return M===void 0},"u")},B="en",ue={};ue[B]=f;var ye=i(function(M){return M instanceof tt},"p"),ke=i(function M(T,b,$){var E;if(!T)return B;if(typeof T=="string"){var F=T.toLowerCase();ue[F]&&(E=F),b&&(ue[F]=b,E=F);var V=T.split("-");if(!E&&V.length>1)return M(V[0])}else{var Q=T.name;ue[Q]=T,E=Q}return!$&&E&&(B=E),E||!$&&B},"t"),X=i(function(M,T){if(ye(M))return M.clone();var b=typeof T=="object"?T:{};return b.date=M,b.args=arguments,new tt(b)},"w"),H=_;H.l=ke,H.i=ye,H.w=function(M,T){return X(M,{locale:T.$L,utc:T.$u,x:T.$x,$offset:T.$offset})};var tt=function(){function M(b){this.$L=ke(b.locale,null,!0),this.parse(b)}i(M,"M");var T=M.prototype;return T.parse=function(b){this.$d=function($){var E=$.date,F=$.utc;if(E===null)return new Date(NaN);if(H.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var V=E.match(m);if(V){var Q=V[2]-1||0,ce=(V[7]||"0").substring(0,3);return F?new Date(Date.UTC(V[1],Q,V[3]||1,V[4]||0,V[5]||0,V[6]||0,ce)):new Date(V[1],Q,V[3]||1,V[4]||0,V[5]||0,V[6]||0,ce)}}return new Date(E)}(b),this.$x=b.x||{},this.init()},T.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},T.$utils=function(){return H},T.isValid=function(){return this.$d.toString()!==u},T.isSame=function(b,$){var E=X(b);return this.startOf($)<=E&&E<=this.endOf($)},T.isAfter=function(b,$){return X(b)<this.startOf($)},T.isBefore=function(b,$){return this.endOf($)<X(b)},T.$g=function(b,$,E){return H.u(b)?this[$]:this.set(E,b)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function(b,$){var E=this,F=!!H.u($)||$,V=H.p(b),Q=i(function(Je,ve){var je=H.w(E.$u?Date.UTC(E.$y,ve,Je):new Date(E.$y,ve,Je),E);return F?je:je.endOf(p)},"l"),ce=i(function(Je,ve){return H.w(E.toDate()[Je].apply(E.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(ve)),E)},"$"),de=this.$W,ge=this.$M,Te=this.$D,rt="set"+(this.$u?"UTC":"");switch(V){case I:return F?Q(1,0):Q(31,11);case g:return F?Q(1,ge):Q(0,ge+1);case l:var Ke=this.$locale().weekStart||0,vt=(de<Ke?de+7:de)-Ke;return Q(F?Te-vt:Te+(6-vt),ge);case p:case P:return ce(rt+"Hours",0);case c:return ce(rt+"Minutes",1);case s:return ce(rt+"Seconds",2);case o:return ce(rt+"Milliseconds",3);default:return this.clone()}},T.endOf=function(b){return this.startOf(b,!1)},T.$set=function(b,$){var E,F=H.p(b),V="set"+(this.$u?"UTC":""),Q=(E={},E[p]=V+"Date",E[P]=V+"Date",E[g]=V+"Month",E[I]=V+"FullYear",E[c]=V+"Hours",E[s]=V+"Minutes",E[o]=V+"Seconds",E[n]=V+"Milliseconds",E)[F],ce=F===p?this.$D+($-this.$W):$;if(F===g||F===I){var de=this.clone().set(P,1);de.$d[Q](ce),de.init(),this.$d=de.set(P,Math.min(this.$D,de.daysInMonth())).$d}else Q&&this.$d[Q](ce);return this.init(),this},T.set=function(b,$){return this.clone().$set(b,$)},T.get=function(b){return this[H.p(b)]()},T.add=function(b,$){var E,F=this;b=Number(b);var V=H.p($),Q=i(function(ge){var Te=X(F);return H.w(Te.date(Te.date()+Math.round(ge*b)),F)},"y");if(V===g)return this.set(g,this.$M+b);if(V===I)return this.set(I,this.$y+b);if(V===p)return Q(1);if(V===l)return Q(7);var ce=(E={},E[s]=t,E[c]=r,E[o]=e,E)[V]||1,de=this.$d.getTime()+b*ce;return H.w(de,this)},T.subtract=function(b,$){return this.add(-1*b,$)},T.format=function(b){var $=this,E=this.$locale();if(!this.isValid())return E.invalidDate||u;var F=b||"YYYY-MM-DDTHH:mm:ssZ",V=H.z(this),Q=this.$H,ce=this.$m,de=this.$M,ge=E.weekdays,Te=E.months,rt=E.meridiem,Ke=i(function(ve,je,xt,qt){return ve&&(ve[je]||ve($,F))||xt[je].slice(0,qt)},"h"),vt=i(function(ve){return H.s(Q%12||12,ve,"0")},"d"),Je=rt||function(ve,je,xt){var qt=ve<12?"AM":"PM";return xt?qt.toLowerCase():qt};return F.replace(y,function(ve,je){return je||function(xt){switch(xt){case"YY":return String($.$y).slice(-2);case"YYYY":return H.s($.$y,4,"0");case"M":return de+1;case"MM":return H.s(de+1,2,"0");case"MMM":return Ke(E.monthsShort,de,Te,3);case"MMMM":return Ke(Te,de);case"D":return $.$D;case"DD":return H.s($.$D,2,"0");case"d":return String($.$W);case"dd":return Ke(E.weekdaysMin,$.$W,ge,2);case"ddd":return Ke(E.weekdaysShort,$.$W,ge,3);case"dddd":return ge[$.$W];case"H":return String(Q);case"HH":return H.s(Q,2,"0");case"h":return vt(1);case"hh":return vt(2);case"a":return Je(Q,ce,!0);case"A":return Je(Q,ce,!1);case"m":return String(ce);case"mm":return H.s(ce,2,"0");case"s":return String($.$s);case"ss":return H.s($.$s,2,"0");case"SSS":return H.s($.$ms,3,"0");case"Z":return V}return null}(ve)||V.replace(":","")})},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function(b,$,E){var F,V=this,Q=H.p($),ce=X(b),de=(ce.utcOffset()-this.utcOffset())*t,ge=this-ce,Te=i(function(){return H.m(V,ce)},"D");switch(Q){case I:F=Te()/12;break;case g:F=Te();break;case x:F=Te()/3;break;case l:F=(ge-de)/6048e5;break;case p:F=(ge-de)/864e5;break;case c:F=ge/r;break;case s:F=ge/t;break;case o:F=ge/e;break;default:F=ge}return E?F:H.a(F)},T.daysInMonth=function(){return this.endOf(g).$D},T.$locale=function(){return ue[this.$L]},T.locale=function(b,$){if(!b)return this.$L;var E=this.clone(),F=ke(b,$,!0);return F&&(E.$L=F),E},T.clone=function(){return H.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},M}(),Ge=tt.prototype;return X.prototype=Ge,[["$ms",n],["$s",o],["$m",s],["$H",c],["$W",p],["$M",g],["$y",I],["$D",P]].forEach(function(M){Ge[M[1]]=function(T){return this.$g(T,M[0],M[1])}}),X.extend=function(M,T){return M.$i||(M(T,tt,X),M.$i=!0),X},X.locale=ke,X.isDayjs=ye,X.unix=function(M){return X(1e3*M)},X.en=ue[B],X.Ls=ue,X.p={},X})});var Xd={};Zn(Xd,{quickbooks:()=>Jd});module.exports=Eu(Xd);var $u=Object.freeze({status:"aborted"});function S(e,t,r){function n(p,l){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:l,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,l);let g=c.prototype,x=Object.keys(g);for(let I=0;I<x.length;I++){let P=x[I];P in p||(p[P]=g[P].bind(p))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(p){var l;let g=r?.Parent?new s:this;n(g,p),(l=g._zod).deferred??(l.deferred=[]);for(let x of g._zod.deferred)x();return g}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(S,"$constructor");var Su=Symbol("zod_brand"),Oe=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ht=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Or={};function De(e){return e&&Object.assign(Or,e),Or}i(De,"config");function Rr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(Rr,"getEnumValues");function Wn(e,t){return typeof t=="bigint"?t.toString():t}i(Wn,"jsonStringifyReplacer");function Gt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Gt,"cached");function Gn(e){return e==null}i(Gn,"nullish");function Kt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(Kt,"cleanRegex");var Hn=Symbol("evaluating");function pe(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Hn)return n===void 0&&(n=Hn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(pe,"defineLazy");var Dr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(_t,"isObject");var Au=Gt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Kn(e){if(_t(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(_t(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(Kn,"isPlainObject");var Jn=new Set(["string","number","symbol"]);function nt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(nt,"escapeRegex");function Jt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(Jt,"clone");function oe(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:i(()=>t.error,"error")}:t}i(oe,"normalizeParams");function Xn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(Xn,"optionalKeys");var zu={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 ot(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}i(ot,"aborted");function Be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Be,"prefixIssues");function Wt(e){return typeof e=="string"?e:e?.message}i(Wt,"unwrapMessage");function Fe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Wt(e.inst?._zod.def?.error?.(e))??Wt(t?.error?.(e))??Wt(r.customError?.(e))??Wt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Fe,"finalizeIssue");function Qn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(Qn,"getLengthableOrigin");function Nr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(Nr,"issue");var Yn=i((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Wn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),eo=S("$ZodError",Yn),bt=S("$ZodError",Yn,{Parent:Error});var Ou=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new Oe;if(c.issues.length){let p=new(o?.Err??e)(c.issues.map(l=>Fe(l,s,De())));throw Dr(p,o?.callee),p}return c.value},"_parse"),Xt=Ou(bt),wu=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(o?.Err??e)(c.issues.map(l=>Fe(l,s,De())));throw Dr(p,o?.callee),p}return c.value},"_parseAsync"),Qt=wu(bt),Ru=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Oe;return s.issues.length?{success:!1,error:new(e??eo)(s.issues.map(c=>Fe(c,o,De())))}:{success:!0,data:s.value}},"_safeParse"),Tt=Ru(bt),Du=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Fe(c,o,De())))}:{success:!0,data:s.value}},"_safeParseAsync"),It=Du(bt);var Nu="(?:(?:\\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])))",Cu=new RegExp(`^${Nu}$`);var to=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),ro=/^-?\d+n?$/;var Cr=/^-?\d+(?:\.\d+)?$/,no=/^(?:true|false)$/i;var it=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var oo=S("$ZodCheckMinLength",(e,t)=>{var r;it.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Gn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let c=Qn(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var Ur=S("$ZodCheckStringFormat",(e,t)=>{var r,n;it.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),io=S("$ZodCheckRegex",(e,t)=>{Ur.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 so={major:4,minor:3,patch:6};var ie=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=so;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((c,p,l)=>{let g=ot(c),x;for(let I of p){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(g)continue;let P=c.issues.length,u=I._zod.check(c);if(u instanceof Promise&&l?.async===!1)throw new Oe;if(x||u instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await u,c.issues.length!==P&&(g||(g=ot(c,P)))});else{if(c.issues.length===P)continue;g||(g=ot(c,P))}}return x?x.then(()=>c):c},"runChecks"),s=i((c,p,l)=>{if(ot(c))return c.aborted=!0,c;let g=o(p,n,l);if(g instanceof Promise){if(l.async===!1)throw new Oe;return g.then(x=>e._zod.parse(x,l))}return e._zod.parse(g,l)},"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(x=>s(x,c,p)):s(g,c,p)}let l=e._zod.parse(c,p);if(l instanceof Promise){if(p.async===!1)throw new Oe;return l.then(g=>o(g,n,p))}return o(l,n,p)}}pe(e,"~standard",()=>({validate:i(o=>{try{let s=Tt(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return It(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),tr=S("$ZodString",(e,t)=>{ie.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??to(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}}),Mr=S("$ZodStringFormat",(e,t)=>{Ur.init(e,t),tr.init(e,t)});var mo=S("$ZodURL",(e,t)=>{Mr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var fo=S("$ZodNumber",(e,t)=>{ie.init(e,t),e._zod.pattern=e._zod.bag.pattern??Cr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}});var Lr=S("$ZodBoolean",(e,t)=>{ie.init(e,t),e._zod.pattern=no,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),go=S("$ZodBigInt",(e,t)=>{ie.init(e,t),e._zod.pattern=ro,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 yo=S("$ZodAny",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r}),ho=S("$ZodUnknown",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r});var vo=S("$ZodVoid",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),xo=S("$ZodDate",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function uo(e,t,r){e.issues.length&&t.issues.push(...Be(r,e.issues)),t.value[r]=e.value}i(uo,"handleArrayResult");var Po=S("$ZodArray",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let c=0;c<o.length;c++){let p=o[c],l=t.element._zod.run({value:p,issues:[]},n);l instanceof Promise?s.push(l.then(g=>uo(g,r,c))):uo(l,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function er(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(er,"handlePropertyResult");function Uu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Xn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(Uu,"normalizeDef");function Mu(e,t,r,n,o,s){let c=[],p=o.keySet,l=o.catchall._zod,g=l.def.type,x=l.optout==="optional";for(let I in t){if(p.has(I))continue;if(g==="never"){c.push(I);continue}let P=l.run({value:t[I],issues:[]},n);P instanceof Promise?e.push(P.then(u=>er(u,r,I,t,x))):er(P,r,I,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(Mu,"handleCatchall");var _o=S("$ZodObject",(e,t)=>{if(ie.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let l={...p};return Object.defineProperty(t,"shape",{value:l}),l},"get")})}let n=Gt(()=>Uu(t));pe(e._zod,"propValues",()=>{let p=t.shape,l={};for(let g in p){let x=p[g]._zod;if(x.values){l[g]??(l[g]=new Set);for(let I of x.values)l[g].add(I)}}return l});let o=_t,s=t.catchall,c;e._zod.parse=(p,l)=>{c??(c=n.value);let g=p.value;if(!o(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let x=[],I=c.shape;for(let P of c.keys){let u=I[P],m=u._zod.optout==="optional",y=u._zod.run({value:g[P],issues:[]},l);y instanceof Promise?x.push(y.then(f=>er(f,p,P,g,m))):er(y,p,P,g,m)}return s?Mu(x,g,p,l,n.value,e):x.length?Promise.all(x).then(()=>p):p}});function co(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!ot(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>Fe(c,n,De())))}),t)}i(co,"handleUnionResults");var jr=S("$ZodUnion",(e,t)=>{ie.init(e,t),pe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),pe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),pe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),pe(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Kt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let c=!1,p=[];for(let l of t.options){let g=l._zod.run({value:o.value,issues:[]},s);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(l=>co(l,o,e,s)):co(p,o,e,s)}});var bo=S("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,jr.init(e,t);let r=e._zod.parse;pe(e._zod,"propValues",()=>{let o={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[p,l]of Object.entries(c)){o[p]||(o[p]=new Set);for(let g of l)o[p].add(g)}}return o});let n=Gt(()=>{let o=t.options,s=new Map;for(let c of o){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let l of p){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,c)}}return s});e._zod.parse=(o,s)=>{let c=o.value;if(!_t(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var To=S("$ZodRecord",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Kn(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let x=t.valueType._zod.run({value:o[g],issues:[]},n);x instanceof Promise?s.push(x.then(I=>{I.issues.length&&r.issues.push(...Be(g,I.issues)),r.value[g]=I.value})):(x.issues.length&&r.issues.push(...Be(g,x.issues)),r.value[g]=x.value)}let l;for(let g in o)p.has(g)||(l=l??[],l.push(g));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{r.value={};for(let p of Reflect.ownKeys(o)){if(p==="__proto__")continue;let l=t.keyType._zod.run({value:p,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&Cr.test(p)&&l.issues.length){let I=t.keyType._zod.run({value:Number(p),issues:[]},n);if(I instanceof Promise)throw new Error("Async schemas not supported in object keys currently");I.issues.length===0&&(l=I)}if(l.issues.length){t.mode==="loose"?r.value[p]=o[p]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(I=>Fe(I,n,De())),input:p,path:[p],inst:e});continue}let x=t.valueType._zod.run({value:o[p],issues:[]},n);x instanceof Promise?s.push(x.then(I=>{I.issues.length&&r.issues.push(...Be(p,I.issues)),r.value[l.value]=I.value})):(x.issues.length&&r.issues.push(...Be(p,x.issues)),r.value[l.value]=x.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Io=S("$ZodEnum",(e,t)=>{ie.init(e,t);let r=Rr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Jn.has(typeof o)).map(o=>typeof o=="string"?nt(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),Eo=S("$ZodLiteral",(e,t)=>{if(ie.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"?nt(n):n?nt(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var $o=S("$ZodTransform",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ht(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new Oe;return r.value=o,r}});function po(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(po,"handleOptionalResult");var So=S("$ZodOptional",(e,t)=>{ie.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Kt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>po(s,r.value)):po(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Ao=S("$ZodNullable",(e,t)=>{ie.init(e,t),pe(e._zod,"optin",()=>t.innerType._zod.optin),pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Kt(r.source)}|null)$`):void 0}),pe(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 zo=S("$ZodPipe",(e,t)=>{ie.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Yt(c,t.in,n)):Yt(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Yt(s,t.out,n)):Yt(o,t.out,n)}});function Yt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(Yt,"handlePipeResult");var ko=S("$ZodCustom",(e,t)=>{it.init(e,t),ie.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>lo(s,r,n,e));lo(o,r,n,e)}});function lo(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Nr(o))}}i(lo,"handleRefineResult");var wo,Fu=Symbol("ZodOutput"),Vu=Symbol("ZodInput"),Br=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Ro(){return new Br}i(Ro,"registry");(wo=globalThis).__zod_globalRegistry??(wo.__zod_globalRegistry=Ro());var Fr=globalThis.__zod_globalRegistry;function Do(e,t){return new e({type:"string",...oe(t)})}i(Do,"_string");function No(e,t){return new e({type:"string",coerce:!0,...oe(t)})}i(No,"_coercedString");function Co(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...oe(t)})}i(Co,"_url");function Uo(e,t){return new e({type:"number",checks:[],...oe(t)})}i(Uo,"_number");function Mo(e,t){return new e({type:"number",coerce:!0,checks:[],...oe(t)})}i(Mo,"_coercedNumber");function Lo(e,t){return new e({type:"boolean",...oe(t)})}i(Lo,"_boolean");function jo(e,t){return new e({type:"boolean",coerce:!0,...oe(t)})}i(jo,"_coercedBoolean");function Bo(e,t){return new e({type:"bigint",coerce:!0,...oe(t)})}i(Bo,"_coercedBigint");function Fo(e){return new e({type:"any"})}i(Fo,"_any");function Vo(e){return new e({type:"unknown"})}i(Vo,"_unknown");function Zo(e,t){return new e({type:"void",...oe(t)})}i(Zo,"_void");function qo(e,t){return new e({type:"date",coerce:!0,...oe(t)})}i(qo,"_coercedDate");function Ae(e,t){return new oo({check:"min_length",...oe(t),minimum:e})}i(Ae,"_minLength");function Ve(e,t){return new io({check:"string_format",format:"regex",...oe(t),pattern:e})}i(Ve,"_regex");function Ho(e,t,r){let n=oe(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(Ho,"_custom");var le=S("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");ie.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Xt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Tt(e,r,n),e.parseAsync=async(r,n)=>Qt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>It(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>Jt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),nr=S("ZodMiniString",(e,t)=>{tr.init(e,t),le.init(e,t)});function a(e){return Do(nr,e)}i(a,"string");var Wo=S("ZodMiniStringFormat",(e,t)=>{Mr.init(e,t),nr.init(e,t)});var Yu=S("ZodMiniURL",(e,t)=>{mo.init(e,t),Wo.init(e,t)});function Go(e){return Co(Yu,e)}i(Go,"url");var Vr=S("ZodMiniNumber",(e,t)=>{fo.init(e,t),le.init(e,t)});function he(e){return Uo(Vr,e)}i(he,"number");var Zr=S("ZodMiniBoolean",(e,t)=>{Lr.init(e,t),le.init(e,t)});function J(e){return Lo(Zr,e)}i(J,"boolean");var Ko=S("ZodMiniBigInt",(e,t)=>{go.init(e,t),le.init(e,t)});var ec=S("ZodMiniAny",(e,t)=>{yo.init(e,t),le.init(e,t)});function $t(){return Fo(ec)}i($t,"any");var tc=S("ZodMiniUnknown",(e,t)=>{ho.init(e,t),le.init(e,t)});function N(){return Vo(tc)}i(N,"unknown");var rc=S("ZodMiniVoid",(e,t)=>{vo.init(e,t),le.init(e,t)});function Jo(e){return Zo(rc,e)}i(Jo,"_void");var Xo=S("ZodMiniDate",(e,t)=>{xo.init(e,t),le.init(e,t)});var nc=S("ZodMiniArray",(e,t)=>{Po.init(e,t),le.init(e,t)});function L(e,t){return new nc({type:"array",element:e,...oe(t)})}i(L,"array");var oc=S("ZodMiniObject",(e,t)=>{_o.init(e,t),le.init(e,t),pe(e,"shape",()=>t.shape)});function d(e,t){let r={type:"object",shape:e??{},...oe(t)};return new oc(r)}i(d,"object");var ic=S("ZodMiniUnion",(e,t)=>{jr.init(e,t),le.init(e,t)});function j(e,t){return new ic({type:"union",options:e,...oe(t)})}i(j,"union");var ac=S("ZodMiniDiscriminatedUnion",(e,t)=>{bo.init(e,t),le.init(e,t)});function at(e,t,r){return new ac({type:"union",options:t,discriminator:e,...oe(r)})}i(at,"discriminatedUnion");var sc=S("ZodMiniRecord",(e,t)=>{To.init(e,t),le.init(e,t)});function C(e,t,r){return new sc({type:"record",keyType:e,valueType:t,...oe(r)})}i(C,"record");var uc=S("ZodMiniEnum",(e,t)=>{Io.init(e,t),le.init(e,t),e.options=Object.values(t.entries)});function q(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new uc({type:"enum",entries:r,...oe(t)})}i(q,"_enum");var cc=S("ZodMiniLiteral",(e,t)=>{Eo.init(e,t),le.init(e,t)});function O(e,t){return new cc({type:"literal",values:Array.isArray(e)?e:[e],...oe(t)})}i(O,"literal");var pc=S("ZodMiniTransform",(e,t)=>{$o.init(e,t),le.init(e,t)});function Ze(e){return new pc({type:"transform",transform:e})}i(Ze,"transform");var lc=S("ZodMiniOptional",(e,t)=>{So.init(e,t),le.init(e,t)});function h(e){return new lc({type:"optional",innerType:e})}i(h,"optional");var dc=S("ZodMiniNullable",(e,t)=>{Ao.init(e,t),le.init(e,t)});function St(e){return new dc({type:"nullable",innerType:e})}i(St,"nullable");var mc=S("ZodMiniPipe",(e,t)=>{zo.init(e,t),le.init(e,t)});function qe(e,t){return new mc({type:"pipe",in:e,out:t})}i(qe,"pipe");var fc=S("ZodMiniCustom",(e,t)=>{ko.init(e,t),le.init(e,t)});function or(e,t){return Ho(fc,e??(()=>!0),t)}i(or,"custom");var At={};Zn(At,{bigint:()=>_c,boolean:()=>Pc,date:()=>bc,number:()=>xc,string:()=>vc});function vc(e){return No(nr,e)}i(vc,"string");function xc(e){return Mo(Vr,e)}i(xc,"number");function Pc(e){return jo(Zr,e)}i(Pc,"boolean");function _c(e){return Bo(Ko,e)}i(_c,"bigint");function bc(e){return qo(Xo,e)}i(bc,"date");var Hr=d({retryOnFailure:d({defaultValue:h(J()),hide:h(J())}),continueOnFailure:d({defaultValue:h(J()),hide:h(J())})}),qr=class{constructor(t,r,n,o,s,c,p,l,g,x,I){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=c;this.requireAuth=p;this.errorHandlingOptions=l;this.outputSchema=g;this.audience=x;this.aiMetadata=I}static{i(this,"IAction")}},Ie=i(e=>new qr(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 K=d({displayName:a(),description:h(a())}),Z=i((e,t)=>d({type:O(t),required:J(),defaultValue:h($t())}),"TPropertyValue");var Pe=d({...K.shape,...Z(a(),"SHORT_TEXT").shape}),Ne=d({...K.shape,...Z(a(),"LONG_TEXT").shape});var Yo=d({label:a(),value:N()}),ir=d({disabled:h(J()),placeholder:h(a()),options:L(Yo)});var _e=d({...K.shape,options:ir,...Z(N(),"STATIC_DROPDOWN").shape}),Ce=d({...K.shape,options:ir,...Z(L(N()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Wr=d({...K.shape,...Z(N(),"DROPDOWN").shape,refreshers:L(a())}),zt=d({...K.shape,...Z(L(N()),"MULTI_SELECT_DROPDOWN").shape,refreshers:L(a())});var Ue=d({...K.shape,...Z(J(),"CHECKBOX").shape});var Me=d({...K.shape,...Z(he(),"NUMBER").shape});var kt=d({...K.shape,...Z(N(),"FILE").shape});var Ot=d({...K.shape,...Z(a(),"DATE_TIME").shape});var ei=C(a(),j([Pe,Ne,_e,zt,Ce,Ue,Me,kt,Ot])),wt=d({...K.shape,properties:ei,...Z(L(N()),"ARRAY").shape});var Rt=d({...K.shape,...Z(j([C(a(),N())]),"JSON").shape});var ti=j([Pe,_e,Rt,wt,Ce]),Ic=C(a(),ti),Gr=d({refreshers:L(a()),...K.shape,...Z(N(),"DYNAMIC").shape});var ar=d({...K.shape,...Z(Jo(),"MARKDOWN").shape});var Dt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Dt||{}),st=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(st||{}),Nt=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Nt||{});var Ct=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Ct||{}),Kr="both_client_credentials_and_authorization_code";var Ee=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ee||{}),Ut=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(Ut||{}),Ec=d({strategy:q(Ut),paramName:h(a())}),Mt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Mt||{});var sr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(sr||{}),ri=d({status:h(he()),body:h(N()),headers:h(C(a(),a()))}),ni=d({type:O("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(q(sr))}),oi=d({type:O("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:ri,handlerId:h(a()),streamStepProgress:h(q(sr))}),$c=j([ni,oi]);var Sc=d({body:N(),rawBody:h(N()),headers:C(a(),a()),queryParams:C(a(),a())});function fe(e){return e==null}i(fe,"isNil");function Lt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(Lt,"isEmpty");function ur(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(ur,"assertNotNullOrUndefined");var Jr=Se(require("crypto"),1);var Ac=128,Xe,ut,zc=i(e=>{!Xe||Xe.length<e?(Xe=Buffer.allocUnsafe(e*Ac),Jr.default.randomFillSync(Xe),ut=0):ut+e>Xe.length&&(Jr.default.randomFillSync(Xe),ut=0),ut+=e},"fillPool"),kc=i(e=>(zc(e|=0),Xe.subarray(ut-e,ut)),"random"),Oc=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let c="";for(;;){let p=r(o),l=o;for(;l--;)if(c+=e[p[l]&n]||"",c.length===s)return c}}},"customRandom"),ai=i((e,t=21)=>Oc(e,t,kc),"customAlphabet");var wc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",si=21,Db=a().check(Ve(new RegExp(`^[0-9a-zA-Z]{${si}}$`))),Rc=ai(wc,si);var He=qe(Ze(e=>e instanceof Date?e.toISOString():e),a()),$e={id:a(),created:He,updated:He},ne=i(e=>h(St(e)),"Nullable");function Xr(e){return h(St(q(e)))}i(Xr,"NullableEnum");var Ub=qe(Ze(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(J())),cr=i(e=>qe(Ze(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(L(e))),"OptionalArrayFromQuery");var jb=C(a(),N());var jt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(jt||{});var Qb=a().check(Ve(/^#[0-9A-Fa-f]{6}$/));var eT=d({filename:a(),data:N(),type:O("file"),mimetype:h(a())});var Dc=Se(ci());var sT=d({...$e,name:a(),permissions:L(a()),platformId:ne(a()),type:a(),userCount:h(he())});var pi=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(pi||{}),Qr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Qr||{}),Yr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Yr||{});var en=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(en||{});var tn=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(tn||{});var Nc=d({mode:q(pi),value:N()}),Cc=d({auth:h(a()),fields:C(a(),Nc)}),Uc=d({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(Cc)}),Mc=d({type:O("PIECE"),toolName:a().check(Ae(1)),pieceMetadata:Uc}),Lc=d({type:O("none")}),jc=d({type:O("access_token"),accessToken:a()}),Bc=d({type:O("api_key"),apiKey:a(),apiKeyHeader:a()}),Fc=d({type:O("headers"),headers:C(a(),a())}),Vc=at("type",[Lc,jc,Bc,Fc]),li=d({type:O("FLOW"),toolName:a().check(Ae(1)),externalFlowId:a(),flowDisplayName:h(a())}),di=d({type:O("MCP"),toolName:a().check(Ae(1)),serverUrl:Go(),protocol:q(Yr),auth:Vc}),mi=d({type:O("KNOWLEDGE_BASE"),toolName:a().check(Ae(1)),sourceType:q(Qr),sourceId:a(),sourceName:a()}),Zc=at("type",[Mc,li,di,mi]),qc=d({displayName:a(),description:h(a()),type:q(en)}),fi=d({type:O("MARKDOWN"),markdown:a()}),ct={type:O("TOOL_CALL"),input:ne(C(a(),N())),output:h(N()),toolName:a(),status:q(tn),toolCallId:a(),startTime:a(),endTime:h(a())},DT=d(ct),gi=at("toolCallType",[d({...ct,toolCallType:O("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),d({...ct,toolCallType:O("FLOW"),displayName:a(),externalFlowId:a()}),d({...ct,toolCallType:O("MCP"),displayName:a(),serverUrl:a()}),d({...ct,toolCallType:O("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),d({...ct,toolCallType:O("UNKNOWN"),displayName:a()})]),Hc=j([fi,gi]);var rn=(r=>(r.IMAGE="image",r.TEXT="text",r))(rn||{}),Le=d({apiKey:a()}),Wc=Le,Gc=d({apiKey:a(),apiKeyHash:a()}),Kc=Le,Jc=Le,Xc=Le,Qc=Le,Yc=Le,ep=Le,tp=Le,yi=d({accessKeyId:a().check(Ae(1)),secretAccessKey:a().check(Ae(1))}),rp=d({}),np=d({}),op=d({}),ip=d({}),ap=d({}),sp=d({}),hi=d({modelId:a(),modelName:a(),modelType:q(rn)}),vi=d({apiKeyHeader:a(),baseUrl:a(),models:L(hi),defaultHeaders:h(C(a(),a()))}),xi=d({accountId:a(),gatewayId:a(),models:L(hi),vertexProject:h(a()),vertexRegion:h(a())}),Pi=d({resourceName:a(),apiVersion:qe(Ze(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),_i=d({region:a().check(Ae(1))}),up=j([Wc,Xc,Qc,Yc,ep,Jc,Kc,Gc,yi,tp]),bi=j([vi,xi,Pi,_i,rp,op,ip,ap,np,sp]),cp=d({id:a(),name:a(),type:q(rn)}),pp=d({id:a(),name:a(),provider:q(jt),config:bi,enabledForChat:J()}),lp=d({provider:q(jt),config:bi,auth:up,platformId:a()});var MT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var dp=d({base64Url:a(),fileName:a(),extension:h(a())}),mp=d({mimeType:a(),url:a(),fileName:h(a())}),nn=j([dp,mp]);var fp=j([d({type:O("file"),value:nn}),d({type:O("markdown"),value:a(),files:h(L(nn))})]),gp=d({sessionId:a(),message:a(),files:h(L(a()))});var Ii=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ii||{}),Ei=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ei||{}),on=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(on||{});var yp=j([d({...$e,name:a(),externalId:a(),type:O("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:d({options:L(d({value:a()}))})}),d({...$e,name:a(),externalId:a(),type:j([O("TEXT"),O("NUMBER"),O("DATE")]),tableId:a(),projectId:a()})]),hp=d({...$e,name:a(),folderId:ne(a()),projectId:a(),externalId:a(),status:Xr(Ei),trigger:Xr(Ii)}),vp=d({...$e,tableId:a(),projectId:a(),cells:C(a(),d({updated:a(),created:a(),value:N(),fieldName:a()}))}),xp=d({events:L(q(on)),webhookUrl:a(),flowId:a()}),Pp=d({fields:L(d({id:a(),name:a()})),rows:L(C(a(),a())),name:a()}),_p=d({projectId:a(),limit:h(At.number()),cursor:h(a()),name:h(a()),externalIds:cr(a()),folderId:h(a()),folderIds:cr(a())}),bp=d({records:L(L(d({fieldId:a(),value:Si()}))),tableId:a()}),Tp=d({cells:h(L(d({fieldId:a(),value:Si()}))),tableId:a(),agentUpdate:h(J())}),$i=at("operator",[Qe("eq"),Qe("neq"),Qe("gt"),Qe("gte"),Qe("lt"),Qe("lte"),Qe("co"),Ti("exists"),Ti("not_exists")]),Ip=d({tableId:a(),limit:h(At.number()),cursor:h(a()),filters:cr($i)});function Si(){return qe(Ze(e=>e==null?e:String(e)),St(a()))}i(Si,"coerceToString");function Qe(e){return d({fieldId:a(),operator:O(e),value:a()})}i(Qe,"valueFilter");function Ti(e){return d({fieldId:a(),operator:O(e)})}i(Ti,"existenceFilter");var Ep=d({status:h(he()),body:h(N()),headers:h(C(a(),a()))}),$p=d({...$e,deleted:ne(He),ownerId:a(),displayName:a(),platformId:a(),externalId:ne(a())});var Ai=d({name:a(),description:h(a()),type:a(),required:J()}),Sp=d({pieceName:a(),triggerName:a(),input:d({toolName:a(),toolDescription:a(),inputSchema:L(Ai),returnsResponse:J()})});var zi="^[0-9]+\\.[0-9]+\\.[0-9]+$",nI=new RegExp(zi),zp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",oI=a().check(Ve(new RegExp(zi))),iI=a().check(Ve(new RegExp(zp))),kp=d({packageType:O("ARCHIVE"),pieceType:q(st),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ki=d({packageType:O("REGISTRY"),pieceType:O("OFFICIAL"),pieceName:a(),pieceVersion:a()}),Oi=d({packageType:O("REGISTRY"),pieceType:O("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),aI=j([ki,Oi]),sI=j([kp,ki,Oi]),wi=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(wi||{}),Op=d({type:q(wi),cronExpression:a(),timezone:a()}),uI=d({...$e,type:q(Ee),projectId:a(),flowId:a(),triggerName:a(),schedule:ne(Op),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:ne(a()),simulate:J()}),Ri=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(Ri||{}),Di=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Di||{}),Ni=(r=>(r.S3="S3",r.DB="DB",r))(Ni||{}),cI=d({...$e,projectId:ne(a()),platformId:ne(a()),type:q(Ri),compression:q(Di),data:h(N()),location:q(Ni),size:ne(he()),fileName:ne(a()),s3Key:ne(a()),metadata:ne(C(a(),a()))}),Ci=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ci||{}),Ui=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ui||{}),pI=d({id:a(),email:a(),firstName:a(),status:q(Ui),externalId:ne(a()),platformId:ne(a()),platformRole:q(Ci),lastName:a(),created:He,updated:He,lastActiveDate:ne(He),imageUrl:ne(a())});var an=d({...K.shape,...Z(C(a(),N()),"OBJECT").shape});var Bi=d({...K.shape,...Z(a(),"COLOR").shape});var sn=j([Pe,Ne,ar,Ue,_e,Ce,Wr,zt,Gr,Me,wt,an,Rt,Ot,kt,Bi]),k={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 we=d({displayName:a(),description:h(a())});var Fi=d({username:a(),password:a()}),un=d({...we.shape,username:d({displayName:a(),description:h(a())}),password:d({displayName:a(),description:h(a())}),...Z(Fi,"BASIC_AUTH").shape});var Np=C(a(),j([Pe,Ne,Me,Ue,_e])),cn=d({...we.shape,props:Np,...Z(N(),"CUSTOM_AUTH").shape});var Ye=d({...we.shape,...Z(d({auth:a()}),"SECRET_TEXT").shape});var Cp=C(a(),j([Pe,Ne,Ye,Me,Ue,_e,Ce,ar])),Vi=d({...we.shape,props:Cp,...Z(N(),"OIDC").shape});var pn=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(pn||{}),Zi=j([Pe,Ye,_e]),qi=C(a(),Zi),Up=d({props:h(C(a(),Zi)),authUrl:a(),tokenUrl:a(),scope:L(a()),prompt:h(j([O("none"),O("consent"),O("login"),O("omit")])),pkce:h(J()),pkceMethod:h(j([O("plain"),O("S256")])),authorizationMethod:h(q(pn)),grantType:h(j([q(Ct),O(Kr)])),extra:h(C(a(),a()))}),Hi=d({access_token:a(),props:h(qi),data:C(a(),$t())}),ln=d({...we.shape,...Up.shape,...Z(Hi,"OAUTH2").shape});var pt=j([un,cn,Vi,ln,Ye]),Bt="Connection",dn={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Bt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Bt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Bt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Bt}},None(){}};var FE={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 Mp=d({...K.shape,...Z(N(),"CUSTOM").shape,code:a()});var Lp=j([sn,pt]),mn=C(a(),Lp),u$=C(a(),sn);var Wi=j([d({strategy:O("CRON"),cronExpression:a()}),d({strategy:O("NONE")})]),lt=class{constructor(t,r,n,o,s,c,p,l,g,x,I,P,u,m,y,f,v,_,B){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=c;this.handshakeConfiguration=p;this.onHandshake=l;this.renewConfiguration=g;this.onRenew=x;this.onEnable=I;this.onDisable=P;this.onStart=u;this.run=m;this.test=y;this.sampleData=f;this.testStrategy=v;this.outputSchema=_;this.aiMetadata=B}static{i(this,"ITrigger")}},Re=i(e=>{switch(e.type){case"WEBHOOK":return new lt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new lt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new lt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new lt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,fe(e.sampleData)&&fe(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Gi="2",lr="0.82.0";var fn=class{constructor(t,r,n,o,s,c,p,l,g=lr,x,I=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=p;this.auth=l;this.minimumSupportedRelease=g;this.maximumSupportedRelease=x;this.description=I;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Gi}),"getContextInfo");(!jp(g)||Bp(g,lr))&&(this.minimumSupportedRelease=lr),s.forEach(P=>this._actions[P.name]=P),c.forEach(P=>this._triggers[P.name]=P)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Ki=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new fn(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function jp(e){return/^\d+\.\d+\.\d+$/.test(e)}i(jp,"isValidSimpleSemver");function Bp(e,t){let[r,n,o]=e.split(".").map(Number),[s,c,p]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:o<p}i(Bp,"isSemverLessThan");var Fp=h(C(a(),C(a(),a()))),Ji=d({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:L(a()),platformId:h(a()),directoryPath:h(a()),auth:h(j([pt,L(pt)])),version:a(),categories:h(L(q(Nt))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),i18n:Fp}),Vp=q(["human","ai","both"]),Xi=d({description:h(a()),idempotent:h(J())}),Qi=d({name:a(),displayName:a(),description:a(),props:mn,requireAuth:J(),errorHandlingOptions:h(Hr),outputSchema:h(or()),audience:h(Vp),aiMetadata:h(Xi)}),Yi=d({name:a(),displayName:a(),description:a(),props:mn,errorHandlingOptions:h(Hr),type:q(Ee),sampleData:N(),handshakeConfiguration:h(or()),renewConfiguration:h(Wi),testStrategy:q(Mt),outputSchema:h(or()),aiMetadata:h(Xi)}),Zp=d({...Ji.shape,actions:C(a(),Qi),triggers:C(a(),Yi)}),qp=d({...Ji.shape,actions:he(),triggers:he(),suggestedActions:h(L(Yi)),suggestedTriggers:h(L(Qi))}),ea=d({projectUsage:he(),tags:h(L(a())),pieceType:q(st),packageType:q(Dt),platformId:h(a()),archiveId:h(a())}),uS=d({...Zp.shape,...ea.shape}),cS=d({...qp.shape,...ea.shape}),pS=d({name:a(),version:a()});var Hp=Se(require("path")),Wp=Se(require("fs/promises"));var dr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,c)=>{o.append(c,s)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var mr=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new gn,r=new yn){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},gn=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},yn=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var fr=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var gr=class extends dr{static{i(this,"FetchHttpClient")}constructor(t="",r=new mr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[B,ue]of Object.entries(c))o.append(B,ue);let p=o.toString(),l=p?`${n}?${p}`:n,g=t.responseType??"json",x=t.followRedirects??!0,I=t.retries??0,{body:P,extraHeaders:u,isStream:m}=Gp(t.body,s),y=Jp({...s,...u}),f=await Kp(async()=>{let B=new AbortController,ue=t.timeout&&t.timeout>0?setTimeout(()=>B.abort(),t.timeout):void 0;try{let ye={method:t.method.toString(),headers:y,body:P,redirect:x?"follow":"manual",signal:B.signal};return m&&(ye.duplex="half"),r?.dispatcher!==void 0&&(ye.dispatcher=r.dispatcher),await fetch(l,ye)}finally{ue!==void 0&&clearTimeout(ue)}},I),v=x?300:400;if(f.status<200||f.status>=v){let B=await ta(f,g),ue=new fr(t.body,{status:f.status,responseBody:B});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ue),ue}let _=await ta(f,g);return{status:f.status,headers:Xp(f.headers),body:_}}};function Gp(e,t){return Yp(e)?{body:void 0,extraHeaders:{},isStream:!1}:Qp(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(Gp,"serializeBody");async function ta(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(ta,"parseResponseBody");async function Kp(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await ra(n);continue}return o}catch(o){if(r=o,n<t){await ra(n);continue}throw o}throw r}i(Kp,"sendWithRetries");function ra(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(ra,"backoff");function Jp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}i(Jp,"normalizeHeaders");function Xp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Xp,"toHttpHeaders");function Qp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}i(Qp,"isNodeFormData");function Yp(e){return e==null}i(Yp,"isNil");var ee=new gr;var be=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(be||{});var jd=Se(require("fs")),uu=Se(su());var Bd={"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 Fd(e){let t=e.split(";")[0].trim().toLowerCase();return Bd[t]??""}i(Fd,"contentTypeToExtension");var Vd=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Zd=i((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function cu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:s,props:c,extraProps:p,authLocation:l="headers"}){return Ie({audience:"human",name:s||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:k.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:g})=>({url:k.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
-
i.e ${Zd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:k.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(be).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:k.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:k.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:k.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:k.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:g})=>{if(!g)return{};let x=g,I={};switch(x){case"none":break;case"json":I.data=k.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=k.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.data=k.Array({displayName:"Form Data",required:!0,properties:{fieldName:k.ShortText({displayName:"Field Name",required:!0}),fieldType:k.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:k.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:k.File({displayName:"File Field Value",required:!1})}});break}return I},"props")}),response_is_binary:k.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:k.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:k.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:k.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:i(async g=>{let{method:x,url:I,headers:P,queryParams:u,body:m,body_type:y,failsafe:f,timeout:v,response_is_binary:_,followRedirects:B}=g.propsValue;ur(x,"Method"),ur(I,"URL");let ue=fe(r)?{}:await r(g.auth,g.propsValue),ye=I.url,ke=ye.startsWith("http://")||ye.startsWith("https://")?ye:Vd({baseUrl:t(g.auth),relativePath:ye}),X={method:x,url:ke,headers:{...P??{},...l==="headers"||!fe(l)?ue:{}},queryParams:{...l==="queryParams"?ue:{},...u??{}},timeout:v?v*1e3:0,followRedirects:B};if(_&&(X.responseType="arraybuffer"),m)if(y&&y!=="none"){let H=m.data;if(y==="form_data"){let tt=H,Ge=new uu.default;for(let{fieldName:M,fieldType:T,textFieldValue:b,fileFieldValue:$}of tt)T==="text"&&!Lt(b)?Ge.append(M,b):T==="file"&&!Lt($)&&Ge.append(M,$.data,{filename:$?.filename});X.body=Ge,X.headers={...X.headers,...Ge.getHeaders()}}else X.body=H}else y||(X.body=m);try{let H=await ee.sendRequest(X);return await qd(g.files,H.body,H.status,H.headers,_)}catch(H){if(f)return H.errorMessage();throw H}},"run")})}i(cu,"createCustomApiCallAction");var qd=i(async(e,t,r,n,o)=>{let s;if(o&&Hd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Fd(c??"")||"txt",l;t instanceof ArrayBuffer?l=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?l=t:l=Buffer.from(t),s=await e.write({fileName:`output.${p}`,data:l})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),Hd=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var te={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:s,server:c}){switch(e.strategy){case 0:{let p=await t.get("lastPoll");if(fe(p))throw new Error("lastPoll doesn't exist in the store.");let l=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:p,server:c}),g=l.reduce((x,I)=>Math.max(x,I.epochMilliSeconds),p);return await t.put("lastPoll",g),l.filter(x=>x.epochMilliSeconds>p).map(x=>x.data)}case 1:{let p=await t.get("lastItem"),l=await e.items({store:t,auth:r,propsValue:n,lastItemId:p,files:s,server:c}),g=l.findIndex(P=>P.id===p),x=[];fe(p)||g==-1?x=l??[]:x=l?.slice(0,g)??[],fe(o)||(x=x.slice(-o));let I=x?.[0]?.id;return fe(I)||await t.put("lastItem",I),x.map(P=>P.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;fe(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:s}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:s});break}}return Wd(c.map(p=>p.data))}};function Wd(e){return e.length<=5?e:e.slice(0,5)}i(Wd,"getFirstFiveOrAll");var Y=dn.OAuth2({description:"You can find Company ID under **settings->Additional Info**.",required:!0,props:{companyId:k.ShortText({displayName:"Company ID",required:!0})},authUrl:"https://appcenter.intuit.com/connect/oauth2",tokenUrl:"https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer",scope:["com.intuit.quickbooks.accounting"]});var Gd="https://quickbooks.api.intuit.com/v3/company",re={getApiUrl:i(e=>`${Gd}/${e}`,"getApiUrl")};var pu=Ie({auth:Y,name:"find_invoice",displayName:"Find Invoice",description:"Search for an invoice by its number in QuickBooks.",audience:"both",aiMetadata:{description:"Look up a single QuickBooks invoice by its document number (DocNumber), returning the first match. Use to resolve an invoice reference to its full record before reading or acting on it; the document number is required. Read-only and idempotent.",idempotent:!0},props:{invoice_number:k.ShortText({displayName:"Invoice Number",description:"The document number (DocNumber) of the invoice to search for.",required:!0})},async run(e){let{invoice_number:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let n=re.getApiUrl(r),o=`SELECT * FROM Invoice WHERE DocNumber = '${t.replace(/'/g,"\\'")}' MAXRESULTS 1`,s=await ee.sendRequest({method:"GET",url:`${n}/query`,queryParams:{query:o,minorversion:"70"},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}});return s.body?.QueryResponse?.Invoice&&s.body.QueryResponse.Invoice.length>0?{found:!0,result:s.body.QueryResponse.Invoice[0]}:{found:!1,result:{}}}});var lu=Ie({auth:Y,name:"find_customer",displayName:"Find Customer",description:"Search for a customer by display name in QuickBooks.",audience:"both",aiMetadata:{description:"Look up a single QuickBooks customer by exact display name, returning the first match. Use to resolve a customer name to its full record (including its Id) before referencing it elsewhere; the match is exact, not fuzzy. Read-only and idempotent.",idempotent:!0},props:{search_term:k.ShortText({displayName:"Customer Name",description:"The display name of the customer to search for.",required:!0})},async run(e){let{search_term:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let n=re.getApiUrl(r),o=`SELECT * FROM Customer WHERE DisplayName = '${t.replace(/'/g,"\\'")}' MAXRESULTS 1`,s=await ee.sendRequest({method:"GET",url:`${n}/query`,queryParams:{query:o,minorversion:"70"},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}});return s.body?.QueryResponse?.Customer&&s.body.QueryResponse.Customer.length>0?{found:!0,result:s.body.QueryResponse.Customer[0]}:{found:!1,result:{}}}});var du=Ie({auth:Y,name:"find_payment",displayName:"Find Payment",description:"Finds an existing payment in QuickBooks.",audience:"both",aiMetadata:{description:"List all QuickBooks payments belonging to a given customer, identified by the customer Id (not name). Use to retrieve a customer's payment history or to check whether they have any payments on record. Read-only and idempotent.",idempotent:!0},props:{customerId:k.ShortText({displayName:"Customer ID",description:"The ID of the customer to find payments for.",required:!0})},async run(e){let{customerId:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect.");let n=re.getApiUrl(r),o=`SELECT * FROM Payment WHERE CustomerRef = '${t}'`,s=await ee.sendRequest({method:"GET",url:`${n}/query?query=${encodeURIComponent(o)}&minorversion=70`,headers:{Authorization:`Bearer ${e.auth.access_token}`,Accept:"application/json"}});return s.body.QueryResponse?.Payment&&s.body.QueryResponse?.Payment.length>0?{found:!0,result:s.body.QueryResponse?.Payment}:{found:!1,result:[]}}});var mu=Ie({auth:Y,name:"create_invoice",displayName:"Create Invoice",description:"Creates an invoice in QuickBooks.",audience:"both",aiMetadata:{description:'Create a new QuickBooks invoice for a customer with one or more line items (each line needs an amount and an Item/product Id). Optionally set due date, transaction date, invoice number, memos, and email status; setting email status to "Needs To Be Sent" requires a billing email. Not idempotent: each call creates a new invoice, so guard against duplicates.',idempotent:!1},props:{customerRef:k.Dropdown({auth:Y,displayName:"Customer",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=re.getApiUrl(n),c=await ee.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, DisplayName FROM Customer STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(c.body.Fault)throw new Error(`QuickBooks API Error: ${c.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(c.body.QueryResponse?.Customer??[]).map(l=>({label:l.DisplayName,value:l.Id}))}},"options")}),lineItems:k.Array({displayName:"Line Items",description:"Line items for the invoice",required:!0,properties:{description:k.ShortText({displayName:"Description",required:!1}),amount:k.Number({displayName:"Amount",description:"Total amount for this line (Exclusive of tax). Required.",required:!0}),detailType:k.StaticDropdown({displayName:"Detail Type",required:!0,options:{options:[{label:"Sales Item Line Detail",value:"SalesItemLineDetail"}]},defaultValue:"SalesItemLineDetail"}),itemId:k.ShortText({displayName:"Item ID (Product/Service)",description:"Enter the ID of the Item (Product/Service). Required for SalesItemLineDetail.",required:!0}),quantity:k.Number({displayName:"Quantity",required:!1}),unitPrice:k.Number({displayName:"Unit Price",description:"If specified, Amount will be Qty * UnitPrice. If Amount is also specified, Amount overrides calculation.",required:!1})}}),emailStatus:k.StaticDropdown({displayName:"Email Status",description:"Specify whether the invoice should be emailed after creation.",required:!1,options:{options:[{label:"Not Set (Default - No Email)",value:"NotSet"},{label:"Needs To Be Sent",value:"NeedToSend"}]},defaultValue:"NotSet"}),billEmail:k.ShortText({displayName:"Billing Email Address",description:'Email address to send the invoice to. Required if Email Status is "Needs To Be Sent". Overrides customer default.',required:!1}),dueDate:k.DateTime({displayName:"Due Date",description:"The date when the payment for the invoice is due. If not provided, default term from customer or company is used.",required:!1}),docNumber:k.ShortText({displayName:"Invoice Number",description:"Optional reference number for the invoice. If not provided, QuickBooks assigns the next sequential number.",required:!1}),txnDate:k.DateTime({displayName:"Transaction Date",description:"The date entered on the transaction. Defaults to the current date if not specified.",required:!1}),privateNote:k.LongText({displayName:"Private Note (Memo)",description:"Note to self. Does not appear on the invoice sent to the customer.",required:!1}),customerMemo:k.LongText({displayName:"Customer Memo (Statement Memo)",description:"Memo to be displayed on the invoice sent to the customer (appears on statement).",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=re.getApiUrl(r),o=e.propsValue;if(o.emailStatus==="NeedToSend"&&!o.billEmail)throw new Error('Billing Email Address is required when Email Status is "Needs To Be Sent".');let s=o.lineItems.map(l=>{if(l.detailType==="SalesItemLineDetail"){if(!l.itemId)throw new Error("Item ID is required for Sales Item Line Detail.");return{Amount:l.amount,DetailType:l.detailType,Description:l.description,SalesItemLineDetail:{ItemRef:{value:l.itemId},...l.quantity!=null&&{Qty:l.quantity},...l.unitPrice!=null&&{UnitPrice:l.unitPrice}}}}else return{Amount:l.amount,DetailType:l.detailType,Description:l.description}});if(s.length===0)throw new Error("At least one line item is required to create an invoice.");let c={Line:s,CustomerRef:{value:o.customerRef},...o.emailStatus&&{EmailStatus:o.emailStatus},...o.billEmail&&{BillEmail:{Address:o.billEmail}},...o.dueDate&&{DueDate:o.dueDate.split("T")[0]},...o.docNumber&&{DocNumber:o.docNumber},...o.txnDate&&{TxnDate:o.txnDate.split("T")[0]},...o.privateNote&&{PrivateNote:o.privateNote},...o.customerMemo&&{CustomerMemo:{value:o.customerMemo}}},p=await ee.sendRequest({method:"POST",url:`${n}/invoice`,queryParams:{minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},body:c});if(p.body.Fault)throw new Error(`QuickBooks API Error: ${p.body.Fault.Error.map(l=>l.Message).join(", ")} - ${p.body.Fault.Error.map(l=>l.Detail).join(", ")}`);return p.body.Invoice}});var fu=Ie({auth:Y,name:"create_expense",displayName:"Create Expense",description:"Creates an expense transaction (purchase) in QuickBooks.",audience:"both",aiMetadata:{description:"Record a new expense (purchase) paid from a chosen bank or credit-card account, with one or more account-based line items (each needs an amount and an expense account Id) and a payment type of cash, check, or credit card. Optionally attach a payee/vendor, payment date, and memo. Not idempotent: each call creates a new purchase, so guard against duplicates.",idempotent:!1},props:{accountRef:k.Dropdown({auth:Y,displayName:"Bank/Credit Card Account",description:"The account from which the expense was paid.",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect account",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=re.getApiUrl(n),c=await ee.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, Name, AccountType FROM Account STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(c.body.Fault)throw new Error(`QuickBooks API Error fetching accounts: ${c.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(c.body.QueryResponse?.Account??[]).map(l=>({label:`${l.Name} (${l.AccountType})`,value:l.Id}))}},"options")}),paymentType:k.StaticDropdown({displayName:"Payment Type",required:!0,options:{options:[{label:"Cash",value:"Cash"},{label:"Check",value:"Check"},{label:"Credit Card",value:"CreditCard"}]},defaultValue:"Cash"}),entityRef:k.Dropdown({auth:Y,displayName:"Payee (Vendor)",description:"Optional - The vendor the expense was paid to.",required:!1,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect account",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=re.getApiUrl(n),c=await ee.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, DisplayName FROM Vendor STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(c.body.Fault)throw new Error(`QuickBooks API Error fetching vendors: ${c.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(c.body.QueryResponse?.Vendor??[]).map(l=>({label:l.DisplayName,value:l.Id}))}},"options")}),txnDate:k.DateTime({displayName:"Payment Date",description:"The date the expense occurred.",required:!1}),lineItems:k.Array({displayName:"Line Items",description:"Details of the expense (e.g., categories or items purchased). At least one line is required.",required:!0,properties:{amount:k.Number({displayName:"Amount",required:!0}),description:k.ShortText({displayName:"Description",required:!1}),detailType:k.StaticDropdown({displayName:"Detail Type",required:!0,options:{options:[{label:"Account Based Expense Line Detail",value:"AccountBasedExpenseLineDetail"}]},defaultValue:"AccountBasedExpenseLineDetail"}),expenseAccountId:k.ShortText({displayName:"Expense Category/Account ID",description:"Enter the ID of the Expense Account. Required for AccountBasedExpenseLineDetail.",required:!0})}}),privateNote:k.LongText({displayName:"Memo (Private Note)",description:"Internal note about the expense.",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=re.getApiUrl(r),o=e.propsValue,s=o.lineItems.map(g=>{let x={Amount:g.amount,Description:g.description,DetailType:g.detailType};if(g.detailType==="AccountBasedExpenseLineDetail"){if(!g.expenseAccountId)throw new Error("Expense Category/Account ID is required for Account Based Expense Line Detail.");x.AccountBasedExpenseLineDetail={AccountRef:{value:g.expenseAccountId}}}return x});if(s.length===0)throw new Error("At least one line item is required.");let c={AccountRef:{value:o.accountRef},PaymentType:o.paymentType,Line:s,...o.entityRef&&{EntityRef:{value:o.entityRef}},...o.txnDate&&{TxnDate:o.txnDate.split("T")[0]},...o.privateNote&&{PrivateNote:o.privateNote}},l=await ee.sendRequest({method:"POST",url:`${n}/purchase`,queryParams:{minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},body:c});if(l.body.Fault)throw new Error(`QuickBooks API Error creating expense: ${l.body.Fault.Error.map(g=>g.Message).join(", ")} - Detail: ${l.body.Fault.Error.map(g=>g.Detail).join(", ")}`);return l.body.Purchase}});var Ln=Se(ht()),Er={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=re.getApiUrl(n),s=t===0?"SELECT * FROM Invoice ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Invoice WHERE Metadata.CreateTime >= '${(0,Ln.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await ee.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Invoice??[]).map(l=>({epochMilliSeconds:(0,Ln.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},gu=Re({auth:Y,name:"new_invoice",displayName:"New Invoice",description:"Triggers when an invoice is created .",aiMetadata:{description:"Fires when a new invoice is created in the connected QuickBooks company, emitting the newly created invoice record. Use to react to billing being issued to a customer."},props:{},type:"POLLING",async onEnable(e){await te.onEnable(Er,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await te.onDisable(Er,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await te.test(Er,e)},async run(e){return await te.poll(Er,e)},sampleData:void 0});var jn=Se(ht()),Sr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=re.getApiUrl(n),s=t===0?"SELECT * FROM Purchase ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Purchase WHERE Metadata.CreateTime >= '${(0,jn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await ee.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Purchase??[]).map(l=>({epochMilliSeconds:(0,jn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},yu=Re({auth:Y,name:"new_expense",displayName:"New Expense (Purchase)",description:"Triggers when an Expense (Purchase) is created.",aiMetadata:{description:"Fires when a new expense (purchase transaction) is created in the connected QuickBooks company, emitting the newly created purchase record. Use to react to money being spent or a bill being recorded."},props:{},type:"POLLING",async onEnable(e){await te.onEnable(Sr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await te.onDisable(Sr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await te.test(Sr,e)},async run(e){return await te.poll(Sr,e)},sampleData:void 0});var Bn=Se(ht()),Ar={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=re.getApiUrl(n),s=t===0?"SELECT * FROM Customer ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Customer WHERE Metadata.CreateTime >= '${(0,Bn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await ee.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Customer??[]).map(l=>({epochMilliSeconds:(0,Bn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},hu=Re({auth:Y,name:"new_customer",displayName:"New Customer",description:"Triggers when a new customer is created.",aiMetadata:{description:"Fires when a new customer is created in the connected QuickBooks company, emitting the newly created customer record. Use to react to a new customer being added to the books."},props:{},type:"POLLING",async onEnable(e){await te.onEnable(Ar,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await te.onDisable(Ar,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await te.test(Ar,e)},async run(e){return await te.poll(Ar,e)},sampleData:void 0});var Fn=Se(ht()),zr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=re.getApiUrl(n),s=t===0?"SELECT * FROM Deposit ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Deposit WHERE Metadata.CreateTime >= '${(0,Fn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await ee.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Deposit??[]).map(l=>({epochMilliSeconds:(0,Fn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},vu=Re({auth:Y,name:"new_deposit",displayName:"New Deposit",description:"Triggers when a Deposit is created.",aiMetadata:{description:"Fires when a new deposit is created in the connected QuickBooks company, emitting the newly created deposit record. Use to react to funds being deposited into an account."},props:{},type:"POLLING",async onEnable(e){await te.onEnable(zr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await te.onDisable(zr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await te.test(zr,e)},async run(e){return await te.poll(zr,e)},sampleData:void 0});var Vn=Se(ht());var kr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=re.getApiUrl(n),s=t===0?"SELECT * FROM Transfer ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Transfer WHERE Metadata.CreateTime >= '${(0,Vn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await ee.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Transfer??[]).map(l=>({epochMilliSeconds:(0,Vn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},xu=Re({auth:Y,name:"new_transfer",displayName:"New Transfer",description:"Triggers when a Transfer is created.",aiMetadata:{description:"Fires when a new transfer is created in the connected QuickBooks company, emitting the newly created transfer record. Use to react to funds being moved between two accounts."},props:{},type:"POLLING",async onEnable(e){await te.onEnable(kr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await te.onDisable(kr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await te.test(kr,e)},async run(e){return await te.poll(kr,e)},sampleData:void 0});var Jd=Ki({displayName:"Quickbooks Online",auth:Y,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/quickbooks.png",authors:["onyedikachi-david"],actions:[pu,lu,du,mu,fu,cu({auth:Y,baseUrl:i(e=>{let r=e.props?.companyId;return re.getApiUrl(r)},"baseUrl"),authMapping:i(async e=>({Authorization:`Bearer ${e.access_token}`}),"authMapping")})],triggers:[gu,yu,hu,vu,xu]});0&&(module.exports={quickbooks});
|
|
1
|
+
"use strict";var ju=Object.create;var _t=Object.defineProperty;var Bu=Object.getOwnPropertyDescriptor;var Fu=Object.getOwnPropertyNames;var Vu=Object.getPrototypeOf,Zu=Object.prototype.hasOwnProperty;var i=(e,t)=>_t(e,"name",{value:t,configurable:!0});var z=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Wn=(e,t)=>{for(var r in t)_t(e,r,{get:t[r],enumerable:!0})},Kn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fu(t))!Zu.call(e,o)&&o!==r&&_t(e,o,{get:()=>t[o],enumerable:!(n=Bu(t,o))||n.enumerable});return e};var Se=(e,t,r)=>(r=e!=null?ju(Vu(e)):{},Kn(t||!e||!e.__esModule?_t(r,"default",{value:e,enumerable:!0}):r,e)),qu=e=>Kn(_t({},"__esModule",{value:!0}),e);var xi=z((vi,fr)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function l(c,m){if(c.indexOf("::")!==c.lastIndexOf("::"))return null;let y=0,f=-1,v=(c.match(p.zoneIndex)||[])[0],b,B;for(v&&(v=v.substring(1),c=c.replace(/%.+$/,""));(f=c.indexOf(":",f+1))>=0;)y++;if(c.substr(0,2)==="::"&&y--,c.substr(-2,2)==="::"&&y--,y>m)return null;for(B=m-y,b=":";B--;)b+="0:";return c=c.replace("::",b),c[0]===":"&&(c=c.slice(1)),c[c.length-1]===":"&&(c=c.slice(0,-1)),m=(function(){let ce=c.split(":"),ve=[];for(let ze=0;ze<ce.length;ze++)ve.push(parseInt(ce[ze],16));return ve})(),{parts:m,zoneId:v}}i(l,"expandIPv6");function g(c,m,y,f){if(c.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,b;for(;f>0;){if(b=y-f,b<0&&(b=0),c[v]>>b!==m[v]>>b)return!1;f-=y,v+=1}return!0}i(g,"matchCIDR");function x(c){if(o.test(c))return parseInt(c,16);if(c[0]==="0"&&!isNaN(parseInt(c[1],10))){if(n.test(c))return parseInt(c,8);throw new Error(`ipaddr: cannot parse ${c} as octal`)}return parseInt(c,10)}i(x,"parseIntAuto");function E(c,m){for(;c.length<m;)c=`0${c}`;return c}i(E,"padPart");let P={};P.IPv4=(function(){function c(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<m.length;y++)if(f=m[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return i(c,"IPv4"),c.prototype.SpecialRanges={unspecified:[[new c([0,0,0,0]),8]],broadcast:[[new c([255,255,255,255]),32]],multicast:[[new c([224,0,0,0]),4]],linkLocal:[[new c([169,254,0,0]),16]],loopback:[[new c([127,0,0,0]),8]],carrierGradeNat:[[new c([100,64,0,0]),10]],private:[[new c([10,0,0,0]),8],[new c([172,16,0,0]),12],[new c([192,168,0,0]),16]],reserved:[[new c([192,0,0,0]),24],[new c([192,0,2,0]),24],[new c([192,88,99,0]),24],[new c([198,18,0,0]),15],[new c([198,51,100,0]),24],[new c([203,0,113,0]),24],[new c([240,0,0,0]),4]],as112:[[new c([192,175,48,0]),24],[new c([192,31,196,0]),24]],amt:[[new c([192,52,193,0]),24]]},c.prototype.kind=function(){return"ipv4"},c.prototype.match=function(m,y){let f;if(y===void 0&&(f=m,m=f[0],y=f[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,m.octets,8,y)},c.prototype.prefixLengthFromSubnetMask=function(){let m=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,b,B;for(v=3;v>=0;v-=1)if(b=this.octets[v],b in f){if(B=f[b],y&&B!==0)return null;B!==8&&(y=!0),m+=B}else return null;return 32-m},c.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){return this.octets.slice(0)},c.prototype.toIPv4MappedAddress=function(){return P.IPv6.parse(`::ffff:${this.toString()}`)},c.prototype.toNormalizedString=function(){return this.toString()},c.prototype.toString=function(){return this.octets.join(".")},c})(),P.IPv4.broadcastAddressFromCIDR=function(c){try{let m=this.parseCIDR(c),y=m[0].toByteArray(),f=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],b=0;for(;b<4;)v.push(parseInt(y[b],10)|parseInt(f[b],10)^255),b++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.isIPv4=function(c){return this.parser(c)!==null},P.IPv4.isValid=function(c){try{return new this(this.parser(c)),!0}catch{return!1}},P.IPv4.isValidCIDR=function(c){try{return this.parseCIDR(c),!0}catch{return!1}},P.IPv4.isValidFourPartDecimal=function(c){return!!(P.IPv4.isValid(c)&&c.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},P.IPv4.isValidCIDRFourPartDecimal=function(c){let m=c.match(/^(.+)\/(\d+)$/);return!P.IPv4.isValidCIDR(c)||!m?!1:P.IPv4.isValidFourPartDecimal(m[1])},P.IPv4.networkAddressFromCIDR=function(c){let m,y,f,v,b;try{for(m=this.parseCIDR(c),f=m[0].toByteArray(),b=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(f[y],10)&parseInt(b[y],10)),y++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.parse=function(c){let m=this.parser(c);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},P.IPv4.parseCIDR=function(c){let m;if(m=c.match(/^(.+)\/(\d+)$/)){let y=parseInt(m[2]);if(y>=0&&y<=32){let f=[this.parse(m[1]),y];return Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},P.IPv4.parser=function(c){let m,y,f;if(m=c.match(r.fourOctet))return(function(){let v=m.slice(1,6),b=[];for(let B=0;B<v.length;B++)y=v[B],b.push(x(y));return b})();if(m=c.match(r.longValue)){if(f=x(m[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],b;for(b=0;b<=24;b+=8)v.push(f>>b&255);return v})().reverse()}else return(m=c.match(r.twoOctet))?(function(){let v=m.slice(1,4),b=[];if(f=x(v[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return b.push(x(v[0])),b.push(f>>16&255),b.push(f>>8&255),b.push(f&255),b})():(m=c.match(r.threeOctet))?(function(){let v=m.slice(1,5),b=[];if(f=x(v[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return b.push(x(v[0])),b.push(x(v[1])),b.push(f>>8&255),b.push(f&255),b})():null},P.IPv4.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>32)throw new Error("ipaddr: invalid IPv4 prefix length");let m=[0,0,0,0],y=0,f=Math.floor(c/8);for(;y<f;)m[y]=255,y++;return f<4&&(m[f]=Math.pow(2,c%8)-1<<8-c%8),new this(m)},P.IPv6=(function(){function c(m,y){let f,v;if(m.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(m[f]<<8|m[f+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(v=this.parts[f],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return i(c,"IPv6"),c.prototype.SpecialRanges={unspecified:[new c([0,0,0,0,0,0,0,0]),128],linkLocal:[new c([65152,0,0,0,0,0,0,0]),10],multicast:[new c([65280,0,0,0,0,0,0,0]),8],loopback:[new c([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new c([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new c([0,0,0,0,0,65535,0,0]),96],discard:[new c([256,0,0,0,0,0,0,0]),64],rfc6145:[new c([0,0,0,0,65535,0,0,0]),96],rfc6052:[new c([100,65435,0,0,0,0,0,0]),96],"6to4":[new c([8194,0,0,0,0,0,0,0]),16],teredo:[new c([8193,0,0,0,0,0,0,0]),32],benchmarking:[new c([8193,2,0,0,0,0,0,0]),48],amt:[new c([8193,3,0,0,0,0,0,0]),32],as112v6:[[new c([8193,4,274,0,0,0,0,0]),48],[new c([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new c([8193,16,0,0,0,0,0,0]),28],orchid2:[new c([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new c([8193,48,0,0,0,0,0,0]),28],reserved:[[new c([8193,0,0,0,0,0,0,0]),23],[new c([8193,3512,0,0,0,0,0,0]),32]]},c.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},c.prototype.kind=function(){return"ipv6"},c.prototype.match=function(m,y){let f;if(y===void 0&&(f=m,m=f[0],y=f[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,m.parts,16,y)},c.prototype.prefixLengthFromSubnetMask=function(){let m=0,y=!1,f={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,b;for(let B=7;B>=0;B-=1)if(v=this.parts[B],v in f){if(b=f[v],y&&b!==0)return null;b!==16&&(y=!0),m+=b}else return null;return 128-m},c.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){let m,y=[],f=this.parts;for(let v=0;v<f.length;v++)m=f[v],y.push(m>>8),y.push(m&255);return y},c.prototype.toFixedLengthString=function(){let m=(function(){let f=[];for(let v=0;v<this.parts.length;v++)f.push(E(this.parts[v].toString(16),4));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),m+y},c.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let m=this.parts.slice(-2),y=m[0],f=m[1];return new P.IPv4([y>>8,y&255,f>>8,f&255])},c.prototype.toNormalizedString=function(){let m=(function(){let f=[];for(let v=0;v<this.parts.length;v++)f.push(this.parts[v].toString(16));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),m+y},c.prototype.toRFC5952String=function(){let m=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,v=-1,b;for(;b=m.exec(y);)b[0].length>v&&(f=b.index,v=b[0].length);return v<0?y:`${y.substring(0,f)}::${y.substring(f+v)}`},c.prototype.toString=function(){return this.toRFC5952String()},c})(),P.IPv6.broadcastAddressFromCIDR=function(c){try{let m=this.parseCIDR(c),y=m[0].toByteArray(),f=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],b=0;for(;b<16;)v.push(parseInt(y[b],10)|parseInt(f[b],10)^255),b++;return new this(v)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},P.IPv6.isIPv6=function(c){return this.parser(c)!==null},P.IPv6.isValid=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{let m=this.parser(c);return new this(m.parts,m.zoneId),!0}catch{return!1}},P.IPv6.isValidCIDR=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{return this.parseCIDR(c),!0}catch{return!1}},P.IPv6.networkAddressFromCIDR=function(c){let m,y,f,v,b;try{for(m=this.parseCIDR(c),f=m[0].toByteArray(),b=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(f[y],10)&parseInt(b[y],10)),y++;return new this(v)}catch(B){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${B})`)}},P.IPv6.parse=function(c){let m=this.parser(c);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},P.IPv6.parseCIDR=function(c){let m,y,f;if((y=c.match(/^(.+)\/(\d+)$/))&&(m=parseInt(y[2]),m>=0&&m<=128))return f=[this.parse(y[1]),m],Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},P.IPv6.parser=function(c){let m,y,f,v,b,B;if(f=c.match(p.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(p.native.test(c))return l(c,8);if((f=c.match(p.transitional))&&(B=f[6]||"",m=f[1],f[1].endsWith("::")||(m=m.slice(0,-1)),m=l(m+B,6),m.parts)){for(b=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<b.length;y++)if(v=b[y],!(0<=v&&v<=255))return null;return m.parts.push(b[0]<<8|b[1]),m.parts.push(b[2]<<8|b[3]),{parts:m.parts,zoneId:m.zoneId}}return null},P.IPv6.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>128)throw new Error("ipaddr: invalid IPv6 prefix length");let m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,f=Math.floor(c/8);for(;y<f;)m[y]=255,y++;return f<16&&(m[f]=Math.pow(2,c%8)-1<<8-c%8),new this(m)},P.fromByteArray=function(c){let m=c.length;if(m===4)return new P.IPv4(c);if(m===16)return new P.IPv6(c);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},P.isValid=function(c){return P.IPv6.isValid(c)||P.IPv4.isValid(c)},P.isValidCIDR=function(c){return P.IPv6.isValidCIDR(c)||P.IPv4.isValidCIDR(c)},P.parse=function(c){if(P.IPv6.isValid(c))return P.IPv6.parse(c);if(P.IPv4.isValid(c))return P.IPv4.parse(c);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},P.parseCIDR=function(c){try{return P.IPv6.parseCIDR(c)}catch{try{return P.IPv4.parseCIDR(c)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},P.process=function(c){let m=this.parse(c);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},P.subnetMatch=function(c,m,y){let f,v,b,B;y==null&&(y="unicast");for(v in m)if(Object.prototype.hasOwnProperty.call(m,v)){for(b=m[v],b[0]&&!(b[0]instanceof Array)&&(b=[b]),f=0;f<b.length;f++)if(B=b[f],c.kind()===B[0].kind()&&c.match.apply(c,B))return v}return y},typeof fr<"u"&&fr.exports?fr.exports=P:e.ipaddr=P})(vi)});var Pa=z((ok,xa)=>{var va=require("stream").Stream,Sl=require("util");xa.exports=ke;function ke(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(ke,"DelayedStream");Sl.inherits(ke,va);ke.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ke.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});ke.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ke.prototype.resume=function(){this._released||this.release(),this.source.resume()};ke.prototype.pause=function(){this.source.pause()};ke.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ke.prototype.pipe=function(){var e=va.prototype.pipe.apply(this,arguments);return this.resume(),e};ke.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)};ke.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 Ia=z((ak,Ta)=>{var $l=require("util"),ba=require("stream").Stream,_a=Pa();Ta.exports=ue;function ue(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}i(ue,"CombinedStream");$l.inherits(ue,ba);ue.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};ue.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};ue.prototype.append=function(e){var t=ue.isStreamLike(e);if(t){if(!(e instanceof _a)){var r=_a.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};ue.prototype.pipe=function(e,t){return ba.prototype.pipe.call(this,e,t),this.resume(),e};ue.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}};ue.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=ue.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ue.prototype._pipeNext=function(e){this._currentStream=e;var t=ue.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()};ue.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};ue.prototype.write=function(e){this.emit("data",e)};ue.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ue.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")};ue.prototype.end=function(){this._reset(),this.emit("end")};ue.prototype.destroy=function(){this._reset(),this.emit("close")};ue.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ue.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};ue.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)};ue.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Aa=z((uk,Ea)=>{"use strict";Ea.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 ka=z(_e=>{"use strict";var xr=Aa(),kl=require("path").extname,Sa=/^\s*([^;\s]*)(?:;|\s|$)/,zl=/^text\//i;_e.charset=$a;_e.charsets={lookup:$a};_e.contentType=Ol;_e.extension=Rl;_e.extensions=Object.create(null);_e.lookup=wl;_e.types=Object.create(null);Dl(_e.extensions,_e.types);function $a(e){if(!e||typeof e!="string")return!1;var t=Sa.exec(e),r=t&&xr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&zl.test(t[1])?"UTF-8":!1}i($a,"charset");function Ol(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?_e.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=_e.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(Ol,"contentType");function Rl(e){if(!e||typeof e!="string")return!1;var t=Sa.exec(e),r=t&&_e.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(Rl,"extension");function wl(e){if(!e||typeof e!="string")return!1;var t=kl("x."+e).toLowerCase().substr(1);return t&&_e.types[t]||!1}i(wl,"lookup");function Dl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(xr).forEach(i(function(o){var s=xr[o],u=s.extensions;if(!(!u||!u.length)){e[o]=u;for(var p=0;p<u.length;p++){var l=u[p];if(t[l]){var g=r.indexOf(xr[t[l]].source),x=r.indexOf(s.source);if(t[l]!=="application/octet-stream"&&(g>x||g===x&&t[l].substr(0,12)==="application/"))continue}t[l]=o}}},"forEachMimeType"))}i(Dl,"populateMaps")});var Oa=z((lk,za)=>{za.exports=Nl;function Nl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(Nl,"defer")});var _n=z((mk,wa)=>{var Ra=Oa();wa.exports=Cl;function Cl(e){var t=!1;return Ra(function(){t=!0}),i(function(n,o){t?e(n,o):Ra(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(Cl,"async")});var bn=z((gk,Da)=>{Da.exports=Ul;function Ul(e){Object.keys(e.jobs).forEach(Ml.bind(e)),e.jobs={}}i(Ul,"abort");function Ml(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(Ml,"clean")});var Tn=z((hk,Ca)=>{var Na=_n(),Ll=bn();Ca.exports=jl;function jl(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Bl(t,o,e[o],function(s,u){o in r.jobs&&(delete r.jobs[o],s?Ll(r):r.results[o]=u,n(s,r.results))})}i(jl,"iterate");function Bl(e,t,r,n){var o;return e.length==2?o=e(r,Na(n)):o=e(r,t,Na(n)),o}i(Bl,"runJob")});var In=z((xk,Ua)=>{Ua.exports=Fl;function Fl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,s){return t(e[o],e[s])}),n}i(Fl,"state")});var En=z((_k,Ma)=>{var Vl=bn(),Zl=_n();Ma.exports=ql;function ql(e){Object.keys(this.jobs).length&&(this.index=this.size,Vl(this),Zl(e)(null,this.results))}i(ql,"terminator")});var ja=z((Tk,La)=>{var Hl=Tn(),Gl=In(),Wl=En();La.exports=Kl;function Kl(e,t,r){for(var n=Gl(e);n.index<(n.keyedList||e).length;)Hl(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Wl.bind(n,r)}i(Kl,"parallel")});var An=z((Ek,Pr)=>{var Ba=Tn(),Jl=In(),Ql=En();Pr.exports=Xl;Pr.exports.ascending=Fa;Pr.exports.descending=Yl;function Xl(e,t,r,n){var o=Jl(e,r);return Ba(e,t,o,i(function s(u,p){if(u){n(u,p);return}if(o.index++,o.index<(o.keyedList||e).length){Ba(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),Ql.bind(o,n)}i(Xl,"serialOrdered");function Fa(e,t){return e<t?-1:e>t?1:0}i(Fa,"ascending");function Yl(e,t){return-1*Fa(e,t)}i(Yl,"descending")});var Za=z((Sk,Va)=>{var ed=An();Va.exports=td;function td(e,t,r){return ed(e,t,null,r)}i(td,"serial")});var Ha=z((kk,qa)=>{qa.exports={parallel:ja(),serial:Za(),serialOrdered:An()}});var Sn=z((zk,Ga)=>{"use strict";Ga.exports=Object});var Ka=z((Ok,Wa)=>{"use strict";Wa.exports=Error});var Qa=z((Rk,Ja)=>{"use strict";Ja.exports=EvalError});var Ya=z((wk,Xa)=>{"use strict";Xa.exports=RangeError});var ts=z((Dk,es)=>{"use strict";es.exports=ReferenceError});var ns=z((Nk,rs)=>{"use strict";rs.exports=SyntaxError});var _r=z((Ck,os)=>{"use strict";os.exports=TypeError});var as=z((Uk,is)=>{"use strict";is.exports=URIError});var us=z((Mk,ss)=>{"use strict";ss.exports=Math.abs});var ps=z((Lk,cs)=>{"use strict";cs.exports=Math.floor});var ds=z((jk,ls)=>{"use strict";ls.exports=Math.max});var fs=z((Bk,ms)=>{"use strict";ms.exports=Math.min});var ys=z((Fk,gs)=>{"use strict";gs.exports=Math.pow});var vs=z((Vk,hs)=>{"use strict";hs.exports=Math.round});var Ps=z((Zk,xs)=>{"use strict";xs.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var bs=z((Hk,_s)=>{"use strict";var rd=Ps();_s.exports=i(function(t){return rd(t)||t===0?t:t<0?-1:1},"sign")});var Is=z((Wk,Ts)=>{"use strict";Ts.exports=Object.getOwnPropertyDescriptor});var $n=z((Kk,Es)=>{"use strict";var br=Is();if(br)try{br([],"length")}catch{br=null}Es.exports=br});var Ss=z((Jk,As)=>{"use strict";var Tr=Object.defineProperty||!1;if(Tr)try{Tr({},"a",{value:1})}catch{Tr=!1}As.exports=Tr});var kn=z((Qk,$s)=>{"use strict";$s.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==o||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var Os=z((Yk,zs)=>{"use strict";var ks=typeof Symbol<"u"&&Symbol,nd=kn();zs.exports=i(function(){return typeof ks!="function"||typeof Symbol!="function"||typeof ks("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:nd()},"hasNativeSymbols")});var zn=z((tz,Rs)=>{"use strict";Rs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var On=z((rz,ws)=>{"use strict";var od=Sn();ws.exports=od.getPrototypeOf||null});var Cs=z((nz,Ns)=>{"use strict";var id="Function.prototype.bind called on incompatible ",ad=Object.prototype.toString,sd=Math.max,ud="[object Function]",Ds=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),cd=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),pd=i(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Ns.exports=i(function(t){var r=this;if(typeof r!="function"||ad.apply(r)!==ud)throw new TypeError(id+r);for(var n=cd(arguments,1),o,s=i(function(){if(this instanceof o){var x=r.apply(this,Ds(n,arguments));return Object(x)===x?x:this}return r.apply(t,Ds(n,arguments))},"binder"),u=sd(0,r.length-n.length),p=[],l=0;l<u;l++)p[l]="$"+l;if(o=Function("binder","return function ("+pd(p,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=i(function(){},"Empty");g.prototype=r.prototype,o.prototype=new g,g.prototype=null}return o},"bind")});var mt=z((iz,Us)=>{"use strict";var ld=Cs();Us.exports=Function.prototype.bind||ld});var Ir=z((az,Ms)=>{"use strict";Ms.exports=Function.prototype.call});var Rn=z((sz,Ls)=>{"use strict";Ls.exports=Function.prototype.apply});var Bs=z((uz,js)=>{"use strict";js.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Vs=z((cz,Fs)=>{"use strict";var dd=mt(),md=Rn(),fd=Ir(),gd=Bs();Fs.exports=gd||dd.call(fd,md)});var qs=z((pz,Zs)=>{"use strict";var yd=mt(),hd=_r(),vd=Ir(),xd=Vs();Zs.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new hd("a function is required");return xd(yd,vd,t)},"callBindBasic")});var Qs=z((dz,Js)=>{"use strict";var Pd=qs(),Hs=$n(),Ws;try{Ws=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var wn=!!Ws&&Hs&&Hs(Object.prototype,"__proto__"),Ks=Object,Gs=Ks.getPrototypeOf;Js.exports=wn&&typeof wn.get=="function"?Pd([wn.get]):typeof Gs=="function"?i(function(t){return Gs(t==null?t:Ks(t))},"getDunder"):!1});var ru=z((fz,tu)=>{"use strict";var Xs=zn(),Ys=On(),eu=Qs();tu.exports=Xs?i(function(t){return Xs(t)},"getProto"):Ys?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ys(t)},"getProto"):eu?i(function(t){return eu(t)},"getProto"):null});var Dn=z((yz,nu)=>{"use strict";var _d=Function.prototype.call,bd=Object.prototype.hasOwnProperty,Td=mt();nu.exports=Td.call(_d,bd)});var pu=z((hz,cu)=>{"use strict";var K,Id=Sn(),Ed=Ka(),Ad=Qa(),Sd=Ya(),$d=ts(),ht=ns(),yt=_r(),kd=as(),zd=us(),Od=ps(),Rd=ds(),wd=fs(),Dd=ys(),Nd=vs(),Cd=bs(),su=Function,Nn=i(function(e){try{return su('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Zt=$n(),Ud=Ss(),Cn=i(function(){throw new yt},"throwTypeError"),Md=Zt?(function(){try{return arguments.callee,Cn}catch{try{return Zt(arguments,"callee").get}catch{return Cn}}})():Cn,ft=Os()(),ye=ru(),Ld=On(),jd=zn(),uu=Rn(),qt=Ir(),gt={},Bd=typeof Uint8Array>"u"||!ye?K:ye(Uint8Array),nt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?K:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?K:ArrayBuffer,"%ArrayIteratorPrototype%":ft&&ye?ye([][Symbol.iterator]()):K,"%AsyncFromSyncIteratorPrototype%":K,"%AsyncFunction%":gt,"%AsyncGenerator%":gt,"%AsyncGeneratorFunction%":gt,"%AsyncIteratorPrototype%":gt,"%Atomics%":typeof Atomics>"u"?K:Atomics,"%BigInt%":typeof BigInt>"u"?K:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?K:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?K:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?K:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ed,"%eval%":eval,"%EvalError%":Ad,"%Float16Array%":typeof Float16Array>"u"?K:Float16Array,"%Float32Array%":typeof Float32Array>"u"?K:Float32Array,"%Float64Array%":typeof Float64Array>"u"?K:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?K:FinalizationRegistry,"%Function%":su,"%GeneratorFunction%":gt,"%Int8Array%":typeof Int8Array>"u"?K:Int8Array,"%Int16Array%":typeof Int16Array>"u"?K:Int16Array,"%Int32Array%":typeof Int32Array>"u"?K:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ft&&ye?ye(ye([][Symbol.iterator]())):K,"%JSON%":typeof JSON=="object"?JSON:K,"%Map%":typeof Map>"u"?K:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ft||!ye?K:ye(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Id,"%Object.getOwnPropertyDescriptor%":Zt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?K:Promise,"%Proxy%":typeof Proxy>"u"?K:Proxy,"%RangeError%":Sd,"%ReferenceError%":$d,"%Reflect%":typeof Reflect>"u"?K:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?K:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ft||!ye?K:ye(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?K:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ft&&ye?ye(""[Symbol.iterator]()):K,"%Symbol%":ft?Symbol:K,"%SyntaxError%":ht,"%ThrowTypeError%":Md,"%TypedArray%":Bd,"%TypeError%":yt,"%Uint8Array%":typeof Uint8Array>"u"?K:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?K:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?K:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?K:Uint32Array,"%URIError%":kd,"%WeakMap%":typeof WeakMap>"u"?K:WeakMap,"%WeakRef%":typeof WeakRef>"u"?K:WeakRef,"%WeakSet%":typeof WeakSet>"u"?K:WeakSet,"%Function.prototype.call%":qt,"%Function.prototype.apply%":uu,"%Object.defineProperty%":Ud,"%Object.getPrototypeOf%":Ld,"%Math.abs%":zd,"%Math.floor%":Od,"%Math.max%":Rd,"%Math.min%":wd,"%Math.pow%":Dd,"%Math.round%":Nd,"%Math.sign%":Cd,"%Reflect.getPrototypeOf%":jd};if(ye)try{null.error}catch(e){ou=ye(ye(e)),nt["%Error.prototype%"]=ou}var ou,Fd=i(function e(t){var r;if(t==="%AsyncFunction%")r=Nn("async function () {}");else if(t==="%GeneratorFunction%")r=Nn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Nn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&ye&&(r=ye(o.prototype))}return nt[t]=r,r},"doEval"),iu={__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"]},Ht=mt(),Er=Dn(),Vd=Ht.call(qt,Array.prototype.concat),Zd=Ht.call(uu,Array.prototype.splice),au=Ht.call(qt,String.prototype.replace),Ar=Ht.call(qt,String.prototype.slice),qd=Ht.call(qt,RegExp.prototype.exec),Hd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Gd=/\\(\\)?/g,Wd=i(function(t){var r=Ar(t,0,1),n=Ar(t,-1);if(r==="%"&&n!=="%")throw new ht("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new ht("invalid intrinsic syntax, expected opening `%`");var o=[];return au(t,Hd,function(s,u,p,l){o[o.length]=p?au(l,Gd,"$1"):u||s}),o},"stringToPath"),Kd=i(function(t,r){var n=t,o;if(Er(iu,n)&&(o=iu[n],n="%"+o[0]+"%"),Er(nt,n)){var s=nt[n];if(s===gt&&(s=Fd(n)),typeof s>"u"&&!r)throw new yt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new ht("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");cu.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new yt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new yt('"allowMissing" argument must be a boolean');if(qd(/^%?[^%]*%?$/,t)===null)throw new ht("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Wd(t),o=n.length>0?n[0]:"",s=Kd("%"+o+"%",r),u=s.name,p=s.value,l=!1,g=s.alias;g&&(o=g[0],Zd(n,Vd([0,1],g)));for(var x=1,E=!0;x<n.length;x+=1){var P=n[x],c=Ar(P,0,1),m=Ar(P,-1);if((c==='"'||c==="'"||c==="`"||m==='"'||m==="'"||m==="`")&&c!==m)throw new ht("property names with quotes must have matching quotes");if((P==="constructor"||!E)&&(l=!0),o+="."+P,u="%"+o+"%",Er(nt,u))p=nt[u];else if(p!=null){if(!(P in p)){if(!r)throw new yt("base intrinsic for "+t+" exists, but the property is not available.");return}if(Zt&&x+1>=n.length){var y=Zt(p,P);E=!!y,E&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[P]}else E=Er(p,P),p=p[P];E&&!l&&(nt[u]=p)}}return p},"GetIntrinsic")});var du=z((xz,lu)=>{"use strict";var Jd=kn();lu.exports=i(function(){return Jd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var gu=z((_z,fu)=>{"use strict";var Qd=pu(),mu=Qd("%Object.defineProperty%",!0),Xd=du()(),Yd=Dn(),em=_r(),Sr=Xd?Symbol.toStringTag:null;fu.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new em("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Sr&&(n||!Yd(t,Sr))&&(mu?mu(t,Sr,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[Sr]=r)},"setToStringTag")});var hu=z((Tz,yu)=>{"use strict";var tm=Function.prototype.call,rm=Object.prototype.hasOwnProperty,nm=mt();yu.exports=nm.call(tm,rm)});var xu=z((Iz,vu)=>{"use strict";vu.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var bu=z((Ez,_u)=>{"use strict";var jn=Ia(),om=require("util"),Un=require("path"),im=require("http"),am=require("https"),sm=require("url").parse,um=require("fs"),cm=require("stream").Stream,pm=require("crypto"),Mn=ka(),lm=Ha(),dm=gu(),Je=hu(),Ln=xu();function Pu(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Pu,"escapeHeaderParam");function Q(e){if(!(this instanceof Q))return new Q(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],jn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(Q,"FormData");om.inherits(Q,jn);Q.LINE_BREAK=`\r
|
|
2
|
+
`;Q.DEFAULT_CONTENT_TYPE="application/octet-stream";Q.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=jn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,t,r)};Q.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)+Q.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Je(t,"httpVersion"))&&!(t instanceof cm))&&(r.knownLength||this._valuesToMeasure.push(t))};Q.prototype._lengthRetriever=function(e,t){Je(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):um.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):Je(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Je(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};Q.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),s="",u={"Content-Disposition":["form-data",'name="'+Pu(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&Ln(u,r.header);var p;for(var l in u)if(Je(u,l)){if(p=u[l],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(s+=l+": "+p.join("; ")+Q.LINE_BREAK)}return"--"+this.getBoundary()+Q.LINE_BREAK+s+Q.LINE_BREAK};Q.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&&Je(e,"httpVersion")&&(r=Un.basename(e.client._httpMessage.path||"")),r)return'filename="'+Pu(r)+'"'};Q.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=Mn.lookup(e.name)),!r&&e&&e.path&&(r=Mn.lookup(e.path)),!r&&e&&e.readable&&Je(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=Mn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=Q.DEFAULT_CONTENT_TYPE),r};Q.prototype._multiPartFooter=function(){return function(e){var t=Q.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};Q.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Q.LINE_BREAK};Q.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Je(e,t)&&(r[t.toLowerCase()]=e[t]);return r};Q.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};Q.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Q.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(Q.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Q.prototype._generateBoundary=function(){this._boundary="--------------------------"+pm.randomBytes(12).toString("hex")};Q.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};Q.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};Q.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}lm.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};Q.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=sm(e),n=Ln({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=Ln(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=am.request(n):r=im.request(n),this.getLength(function(s,u){if(s&&s!=="Unknown stream"){this._error(s);return}if(u&&r.setHeader("Content-Length",u),this.pipe(r),t){var p,l=i(function(g,x){return r.removeListener("error",l),r.removeListener("response",p),t.call(this,g,x)},"callback");p=l.bind(this,null),r.on("error",l),r.on("response",p)}}.bind(this)),r};Q.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};Q.prototype.toString=function(){return"[object FormData]"};dm(Q.prototype,"FormData");_u.exports=Q});var vt=z((Bn,Fn)=>{(function(e,t){typeof Bn=="object"&&typeof Fn<"u"?Fn.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Bn,(function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",s="minute",u="hour",p="day",l="week",g="month",x="quarter",E="year",P="date",c="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:i(function(M){var I=["th","st","nd","rd"],T=M%100;return"["+M+(I[(T-20)%10]||I[T]||I[0])+"]"},"ordinal")},v=i(function(M,I,T){var $=String(M);return!$||$.length>=I?M:""+Array(I+1-$.length).join(T)+M},"m"),b={s:v,z:i(function(M){var I=-M.utcOffset(),T=Math.abs(I),$=Math.floor(T/60),A=T%60;return(I<=0?"+":"-")+v($,2,"0")+":"+v(A,2,"0")},"z"),m:i(function M(I,T){if(I.date()<T.date())return-M(T,I);var $=12*(T.year()-I.year())+(T.month()-I.month()),A=I.clone().add($,g),F=T-A<0,V=I.clone().add($+(F?-1:1),g);return+(-($+(T-A)/(F?A-V:V-A))||0)},"t"),a:i(function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},"a"),p:i(function(M){return{M:g,y:E,w:l,d:p,D:P,h:u,m:s,s:o,ms:n,Q:x}[M]||String(M||"").toLowerCase().replace(/s$/,"")},"p"),u:i(function(M){return M===void 0},"u")},B="en",ce={};ce[B]=f;var ve=i(function(M){return M instanceof ot},"p"),ze=i(function M(I,T,$){var A;if(!I)return B;if(typeof I=="string"){var F=I.toLowerCase();ce[F]&&(A=F),T&&(ce[F]=T,A=F);var V=I.split("-");if(!A&&V.length>1)return M(V[0])}else{var te=I.name;ce[te]=I,A=te}return!$&&A&&(B=A),A||!$&&B},"t"),ee=i(function(M,I){if(ve(M))return M.clone();var T=typeof I=="object"?I:{};return T.date=M,T.args=arguments,new ot(T)},"w"),q=b;q.l=ze,q.i=ve,q.w=function(M,I){return ee(M,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var ot=(function(){function M(T){this.$L=ze(T.locale,null,!0),this.parse(T)}i(M,"M");var I=M.prototype;return I.parse=function(T){this.$d=(function($){var A=$.date,F=$.utc;if(A===null)return new Date(NaN);if(q.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var V=A.match(m);if(V){var te=V[2]-1||0,pe=(V[7]||"0").substring(0,3);return F?new Date(Date.UTC(V[1],te,V[3]||1,V[4]||0,V[5]||0,V[6]||0,pe)):new Date(V[1],te,V[3]||1,V[4]||0,V[5]||0,V[6]||0,pe)}}return new Date(A)})(T),this.$x=T.x||{},this.init()},I.init=function(){var T=this.$d;this.$y=T.getFullYear(),this.$M=T.getMonth(),this.$D=T.getDate(),this.$W=T.getDay(),this.$H=T.getHours(),this.$m=T.getMinutes(),this.$s=T.getSeconds(),this.$ms=T.getMilliseconds()},I.$utils=function(){return q},I.isValid=function(){return this.$d.toString()!==c},I.isSame=function(T,$){var A=ee(T);return this.startOf($)<=A&&A<=this.endOf($)},I.isAfter=function(T,$){return ee(T)<this.startOf($)},I.isBefore=function(T,$){return this.endOf($)<ee(T)},I.$g=function(T,$,A){return q.u(T)?this[$]:this.set(A,T)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(T,$){var A=this,F=!!q.u($)||$,V=q.p(T),te=i(function(Ye,Pe){var Be=q.w(A.$u?Date.UTC(A.$y,Pe,Ye):new Date(A.$y,Pe,Ye),A);return F?Be:Be.endOf(p)},"l"),pe=i(function(Ye,Pe){return q.w(A.toDate()[Ye].apply(A.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(Pe)),A)},"$"),fe=this.$W,he=this.$M,Ie=this.$D,it="set"+(this.$u?"UTC":"");switch(V){case E:return F?te(1,0):te(31,11);case g:return F?te(1,he):te(0,he+1);case l:var Xe=this.$locale().weekStart||0,xt=(fe<Xe?fe+7:fe)-Xe;return te(F?Ie-xt:Ie+(6-xt),he);case p:case P:return pe(it+"Hours",0);case u:return pe(it+"Minutes",1);case s:return pe(it+"Seconds",2);case o:return pe(it+"Milliseconds",3);default:return this.clone()}},I.endOf=function(T){return this.startOf(T,!1)},I.$set=function(T,$){var A,F=q.p(T),V="set"+(this.$u?"UTC":""),te=(A={},A[p]=V+"Date",A[P]=V+"Date",A[g]=V+"Month",A[E]=V+"FullYear",A[u]=V+"Hours",A[s]=V+"Minutes",A[o]=V+"Seconds",A[n]=V+"Milliseconds",A)[F],pe=F===p?this.$D+($-this.$W):$;if(F===g||F===E){var fe=this.clone().set(P,1);fe.$d[te](pe),fe.init(),this.$d=fe.set(P,Math.min(this.$D,fe.daysInMonth())).$d}else te&&this.$d[te](pe);return this.init(),this},I.set=function(T,$){return this.clone().$set(T,$)},I.get=function(T){return this[q.p(T)]()},I.add=function(T,$){var A,F=this;T=Number(T);var V=q.p($),te=i(function(he){var Ie=ee(F);return q.w(Ie.date(Ie.date()+Math.round(he*T)),F)},"y");if(V===g)return this.set(g,this.$M+T);if(V===E)return this.set(E,this.$y+T);if(V===p)return te(1);if(V===l)return te(7);var pe=(A={},A[s]=t,A[u]=r,A[o]=e,A)[V]||1,fe=this.$d.getTime()+T*pe;return q.w(fe,this)},I.subtract=function(T,$){return this.add(-1*T,$)},I.format=function(T){var $=this,A=this.$locale();if(!this.isValid())return A.invalidDate||c;var F=T||"YYYY-MM-DDTHH:mm:ssZ",V=q.z(this),te=this.$H,pe=this.$m,fe=this.$M,he=A.weekdays,Ie=A.months,it=A.meridiem,Xe=i(function(Pe,Be,Pt,Gt){return Pe&&(Pe[Be]||Pe($,F))||Pt[Be].slice(0,Gt)},"h"),xt=i(function(Pe){return q.s(te%12||12,Pe,"0")},"d"),Ye=it||function(Pe,Be,Pt){var Gt=Pe<12?"AM":"PM";return Pt?Gt.toLowerCase():Gt};return F.replace(y,(function(Pe,Be){return Be||(function(Pt){switch(Pt){case"YY":return String($.$y).slice(-2);case"YYYY":return q.s($.$y,4,"0");case"M":return fe+1;case"MM":return q.s(fe+1,2,"0");case"MMM":return Xe(A.monthsShort,fe,Ie,3);case"MMMM":return Xe(Ie,fe);case"D":return $.$D;case"DD":return q.s($.$D,2,"0");case"d":return String($.$W);case"dd":return Xe(A.weekdaysMin,$.$W,he,2);case"ddd":return Xe(A.weekdaysShort,$.$W,he,3);case"dddd":return he[$.$W];case"H":return String(te);case"HH":return q.s(te,2,"0");case"h":return xt(1);case"hh":return xt(2);case"a":return Ye(te,pe,!0);case"A":return Ye(te,pe,!1);case"m":return String(pe);case"mm":return q.s(pe,2,"0");case"s":return String($.$s);case"ss":return q.s($.$s,2,"0");case"SSS":return q.s($.$ms,3,"0");case"Z":return V}return null})(Pe)||V.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(T,$,A){var F,V=this,te=q.p($),pe=ee(T),fe=(pe.utcOffset()-this.utcOffset())*t,he=this-pe,Ie=i(function(){return q.m(V,pe)},"D");switch(te){case E:F=Ie()/12;break;case g:F=Ie();break;case x:F=Ie()/3;break;case l:F=(he-fe)/6048e5;break;case p:F=(he-fe)/864e5;break;case u:F=he/r;break;case s:F=he/t;break;case o:F=he/e;break;default:F=he}return A?F:q.a(F)},I.daysInMonth=function(){return this.endOf(g).$D},I.$locale=function(){return ce[this.$L]},I.locale=function(T,$){if(!T)return this.$L;var A=this.clone(),F=ze(T,$,!0);return F&&(A.$L=F),A},I.clone=function(){return q.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},M})(),Qe=ot.prototype;return ee.prototype=Qe,[["$ms",n],["$s",o],["$m",s],["$H",u],["$W",p],["$M",g],["$y",E],["$D",P]].forEach((function(M){Qe[M[1]]=function(I){return this.$g(I,M[0],M[1])}})),ee.extend=function(M,I){return M.$i||(M(I,ot,ee),M.$i=!0),ee},ee.locale=ze,ee.isDayjs=ve,ee.unix=function(M){return ee(1e3*M)},ee.en=ce[B],ee.Ls=ce,ee.p={},ee}))});var Tm={};Wn(Tm,{quickbooks:()=>bm});module.exports=qu(Tm);var Hu=Object.freeze({status:"aborted"});function S(e,t,r){function n(p,l){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:l,constr:u,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,l);let g=u.prototype,x=Object.keys(g);for(let E=0;E<x.length;E++){let P=x[E];P in p||(p[P]=g[P].bind(p))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function u(p){var l;let g=r?.Parent?new s:this;n(g,p),(l=g._zod).deferred??(l.deferred=[]);for(let x of g._zod.deferred)x();return g}return i(u,"_"),Object.defineProperty(u,"init",{value:n}),Object.defineProperty(u,Symbol.hasInstance,{value:i(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(u,"name",{value:e}),u}i(S,"$constructor");var Oe=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Wt=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Nr={};function Ne(e){return e&&Object.assign(Nr,e),Nr}i(Ne,"config");function Ur(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(Ur,"getEnumValues");function Qn(e,t){return typeof t=="bigint"?t.toString():t}i(Qn,"jsonStringifyReplacer");function Jt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Jt,"cached");function Xn(e){return e==null}i(Xn,"nullish");function Qt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(Qt,"cleanRegex");var Jn=Symbol("evaluating");function le(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Jn)return n===void 0&&(n=Jn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(le,"defineLazy");var Mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function bt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(bt,"isObject");var Gu=Jt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Yn(e){if(bt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(bt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(Yn,"isPlainObject");var eo=new Set(["string","number","symbol"]);function at(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(at,"escapeRegex");function Xt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(Xt,"clone");function ne(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:i(()=>t.error,"error")}:t}i(ne,"normalizeParams");function to(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(to,"optionalKeys");var ro={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 st(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}i(st,"aborted");function Fe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Fe,"prefixIssues");function Kt(e){return typeof e=="string"?e:e?.message}i(Kt,"unwrapMessage");function Ve(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Kt(e.inst?._zod.def?.error?.(e))??Kt(t?.error?.(e))??Kt(r.customError?.(e))??Kt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Ve,"finalizeIssue");function no(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(no,"getLengthableOrigin");function Lr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(Lr,"issue");var oo=i((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Qn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),io=S("$ZodError",oo),Tt=S("$ZodError",oo,{Parent:Error});var Ku=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},u=t._zod.run({value:r,issues:[]},s);if(u instanceof Promise)throw new Oe;if(u.issues.length){let p=new(o?.Err??e)(u.issues.map(l=>Ve(l,s,Ne())));throw Mr(p,o?.callee),p}return u.value},"_parse"),Yt=Ku(Tt),Ju=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},s);if(u instanceof Promise&&(u=await u),u.issues.length){let p=new(o?.Err??e)(u.issues.map(l=>Ve(l,s,Ne())));throw Mr(p,o?.callee),p}return u.value},"_parseAsync"),er=Ju(Tt),Qu=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Oe;return s.issues.length?{success:!1,error:new(e??io)(s.issues.map(u=>Ve(u,o,Ne())))}:{success:!0,data:s.value}},"_safeParse"),It=Qu(Tt),Xu=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(u=>Ve(u,o,Ne())))}:{success:!0,data:s.value}},"_safeParseAsync"),Et=Xu(Tt);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])))",ec=new RegExp(`^${Yu}$`);var ao=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),so=/^-?\d+n?$/,uo=/^-?\d+$/,jr=/^-?\d+(?:\.\d+)?$/,co=/^(?:true|false)$/i;var Ze=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tc={number:"number",bigint:"bigint",object:"date"};var po=S("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let r=tc[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var lo=S("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=ro[t.format];e._zod.onattach.push(u=>{let p=u._zod.bag;p.format=t.format,p.minimum=o,p.maximum=s,r&&(p.pattern=uo)}),e._zod.check=u=>{let p=u.value;if(r){if(!Number.isInteger(p)){u.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?u.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}):u.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}p<o&&u.issues.push({origin:"number",input:p,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),p>s&&u.issues.push({origin:"number",input:p,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var mo=S("$ZodCheckMinLength",(e,t)=>{var r;Ze.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Xn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let u=no(o);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var Br=S("$ZodCheckStringFormat",(e,t)=>{var r,n;Ze.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),fo=S("$ZodCheckRegex",(e,t)=>{Br.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 yo={major:4,minor:3,patch:6};var ie=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yo;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((u,p,l)=>{let g=st(u),x;for(let E of p){if(E._zod.def.when){if(!E._zod.def.when(u))continue}else if(g)continue;let P=u.issues.length,c=E._zod.check(u);if(c instanceof Promise&&l?.async===!1)throw new Oe;if(x||c instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await c,u.issues.length!==P&&(g||(g=st(u,P)))});else{if(u.issues.length===P)continue;g||(g=st(u,P))}}return x?x.then(()=>u):u},"runChecks"),s=i((u,p,l)=>{if(st(u))return u.aborted=!0,u;let g=o(p,n,l);if(g instanceof Promise){if(l.async===!1)throw new Oe;return g.then(x=>e._zod.parse(x,l))}return e._zod.parse(g,l)},"handleCanaryResult");e._zod.run=(u,p)=>{if(p.skipChecks)return e._zod.parse(u,p);if(p.direction==="backward"){let g=e._zod.parse({value:u.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(x=>s(x,u,p)):s(g,u,p)}let l=e._zod.parse(u,p);if(l instanceof Promise){if(p.async===!1)throw new Oe;return l.then(g=>o(g,n,p))}return o(l,n,p)}}le(e,"~standard",()=>({validate:i(o=>{try{let s=It(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Et(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},"validate"),vendor:"zod",version:1}))}),nr=S("$ZodString",(e,t)=>{ie.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ao(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}}),Fr=S("$ZodStringFormat",(e,t)=>{Br.init(e,t),nr.init(e,t)});var _o=S("$ZodURL",(e,t)=>{Fr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Vr=S("$ZodNumber",(e,t)=>{ie.init(e,t),e._zod.pattern=e._zod.bag.pattern??jr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),bo=S("$ZodNumberFormat",(e,t)=>{lo.init(e,t),Vr.init(e,t)}),Zr=S("$ZodBoolean",(e,t)=>{ie.init(e,t),e._zod.pattern=co,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),To=S("$ZodBigInt",(e,t)=>{ie.init(e,t),e._zod.pattern=so,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 Io=S("$ZodAny",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r}),Eo=S("$ZodUnknown",(e,t)=>{ie.init(e,t),e._zod.parse=r=>r});var Ao=S("$ZodVoid",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),So=S("$ZodDate",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function ho(e,t,r){e.issues.length&&t.issues.push(...Fe(r,e.issues)),t.value[r]=e.value}i(ho,"handleArrayResult");var $o=S("$ZodArray",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let u=0;u<o.length;u++){let p=o[u],l=t.element._zod.run({value:p,issues:[]},n);l instanceof Promise?s.push(l.then(g=>ho(g,r,u))):ho(l,r,u)}return s.length?Promise.all(s).then(()=>r):r}});function rr(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Fe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(rr,"handlePropertyResult");function rc(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=to(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(rc,"normalizeDef");function nc(e,t,r,n,o,s){let u=[],p=o.keySet,l=o.catchall._zod,g=l.def.type,x=l.optout==="optional";for(let E in t){if(p.has(E))continue;if(g==="never"){u.push(E);continue}let P=l.run({value:t[E],issues:[]},n);P instanceof Promise?e.push(P.then(c=>rr(c,r,E,t,x))):rr(P,r,E,t,x)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(nc,"handleCatchall");var ko=S("$ZodObject",(e,t)=>{if(ie.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let l={...p};return Object.defineProperty(t,"shape",{value:l}),l},"get")})}let n=Jt(()=>rc(t));le(e._zod,"propValues",()=>{let p=t.shape,l={};for(let g in p){let x=p[g]._zod;if(x.values){l[g]??(l[g]=new Set);for(let E of x.values)l[g].add(E)}}return l});let o=bt,s=t.catchall,u;e._zod.parse=(p,l)=>{u??(u=n.value);let g=p.value;if(!o(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let x=[],E=u.shape;for(let P of u.keys){let c=E[P],m=c._zod.optout==="optional",y=c._zod.run({value:g[P],issues:[]},l);y instanceof Promise?x.push(y.then(f=>rr(f,p,P,g,m))):rr(y,p,P,g,m)}return s?nc(x,g,p,l,n.value,e):x.length?Promise.all(x).then(()=>p):p}});function vo(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!st(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(u=>Ve(u,n,Ne())))}),t)}i(vo,"handleUnionResults");var qr=S("$ZodUnion",(e,t)=>{ie.init(e,t),le(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),le(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),le(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),le(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Qt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let u=!1,p=[];for(let l of t.options){let g=l._zod.run({value:o.value,issues:[]},s);if(g instanceof Promise)p.push(g),u=!0;else{if(g.issues.length===0)return g;p.push(g)}}return u?Promise.all(p).then(l=>vo(l,o,e,s)):vo(p,o,e,s)}});var zo=S("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,qr.init(e,t);let r=e._zod.parse;le(e._zod,"propValues",()=>{let o={};for(let s of t.options){let u=s._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[p,l]of Object.entries(u)){o[p]||(o[p]=new Set);for(let g of l)o[p].add(g)}}return o});let n=Jt(()=>{let o=t.options,s=new Map;for(let u of o){let p=u._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let l of p){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,u)}}return s});e._zod.parse=(o,s)=>{let u=o.value;if(!bt(u))return o.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),o;let p=n.value.get(u?.[t.discriminator]);return p?p._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),o)}});var Oo=S("$ZodRecord",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Yn(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],u=t.keyType._zod.values;if(u){r.value={};let p=new Set;for(let g of u)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let x=t.valueType._zod.run({value:o[g],issues:[]},n);x instanceof Promise?s.push(x.then(E=>{E.issues.length&&r.issues.push(...Fe(g,E.issues)),r.value[g]=E.value})):(x.issues.length&&r.issues.push(...Fe(g,x.issues)),r.value[g]=x.value)}let l;for(let g in o)p.has(g)||(l=l??[],l.push(g));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{r.value={};for(let p of Reflect.ownKeys(o)){if(p==="__proto__")continue;let l=t.keyType._zod.run({value:p,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&jr.test(p)&&l.issues.length){let E=t.keyType._zod.run({value:Number(p),issues:[]},n);if(E instanceof Promise)throw new Error("Async schemas not supported in object keys currently");E.issues.length===0&&(l=E)}if(l.issues.length){t.mode==="loose"?r.value[p]=o[p]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(E=>Ve(E,n,Ne())),input:p,path:[p],inst:e});continue}let x=t.valueType._zod.run({value:o[p],issues:[]},n);x instanceof Promise?s.push(x.then(E=>{E.issues.length&&r.issues.push(...Fe(p,E.issues)),r.value[l.value]=E.value})):(x.issues.length&&r.issues.push(...Fe(p,x.issues)),r.value[l.value]=x.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Ro=S("$ZodEnum",(e,t)=>{ie.init(e,t);let r=Ur(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>eo.has(typeof o)).map(o=>typeof o=="string"?at(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let u=o.value;return n.has(u)||o.issues.push({code:"invalid_value",values:r,input:u,inst:e}),o}}),wo=S("$ZodLiteral",(e,t)=>{if(ie.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"?at(n):n?at(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var Do=S("$ZodTransform",(e,t)=>{ie.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Wt(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(u=>(r.value=u,r));if(o instanceof Promise)throw new Oe;return r.value=o,r}});function xo(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(xo,"handleOptionalResult");var No=S("$ZodOptional",(e,t)=>{ie.init(e,t),e._zod.optin="optional",e._zod.optout="optional",le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),le(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Qt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>xo(s,r.value)):xo(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Co=S("$ZodNullable",(e,t)=>{ie.init(e,t),le(e._zod,"optin",()=>t.innerType._zod.optin),le(e._zod,"optout",()=>t.innerType._zod.optout),le(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Qt(r.source)}|null)$`):void 0}),le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Uo=S("$ZodPipe",(e,t)=>{ie.init(e,t),le(e._zod,"values",()=>t.in._zod.values),le(e._zod,"optin",()=>t.in._zod.optin),le(e._zod,"optout",()=>t.out._zod.optout),le(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(u=>tr(u,t.in,n)):tr(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>tr(s,t.out,n)):tr(o,t.out,n)}});function tr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(tr,"handlePipeResult");var Mo=S("$ZodCustom",(e,t)=>{Ze.init(e,t),ie.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Po(s,r,n,e));Po(o,r,n,e)}});function Po(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Lr(o))}}i(Po,"handleRefineResult");var jo;var Hr=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Bo(){return new Hr}i(Bo,"registry");(jo=globalThis).__zod_globalRegistry??(jo.__zod_globalRegistry=Bo());var Gr=globalThis.__zod_globalRegistry;function Fo(e,t){return new e({type:"string",...ne(t)})}i(Fo,"_string");function Vo(e,t){return new e({type:"string",coerce:!0,...ne(t)})}i(Vo,"_coercedString");function Zo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ne(t)})}i(Zo,"_url");function qo(e,t){return new e({type:"number",checks:[],...ne(t)})}i(qo,"_number");function Ho(e,t){return new e({type:"number",coerce:!0,checks:[],...ne(t)})}i(Ho,"_coercedNumber");function Go(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(t)})}i(Go,"_int");function Wo(e,t){return new e({type:"boolean",...ne(t)})}i(Wo,"_boolean");function Ko(e,t){return new e({type:"boolean",coerce:!0,...ne(t)})}i(Ko,"_coercedBoolean");function Jo(e,t){return new e({type:"bigint",coerce:!0,...ne(t)})}i(Jo,"_coercedBigint");function Qo(e){return new e({type:"any"})}i(Qo,"_any");function Xo(e){return new e({type:"unknown"})}i(Xo,"_unknown");function Yo(e,t){return new e({type:"void",...ne(t)})}i(Yo,"_void");function ei(e,t){return new e({type:"date",coerce:!0,...ne(t)})}i(ei,"_coercedDate");function or(e,t){return new po({check:"greater_than",...ne(t),value:e,inclusive:!0})}i(or,"_gte");function $e(e,t){return new mo({check:"min_length",...ne(t),minimum:e})}i($e,"_minLength");function qe(e,t){return new fo({check:"string_format",format:"regex",...ne(t),pattern:e})}i(qe,"_regex");function ti(e,t,r){let n=ne(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(ti,"_custom");var de=S("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");ie.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Yt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>It(e,r,n),e.parseAsync=async(r,n)=>er(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)=>Xt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),ar=S("ZodMiniString",(e,t)=>{nr.init(e,t),de.init(e,t)});function a(e){return Fo(ar,e)}i(a,"string");var ri=S("ZodMiniStringFormat",(e,t)=>{Fr.init(e,t),ar.init(e,t)});var yc=S("ZodMiniURL",(e,t)=>{_o.init(e,t),ri.init(e,t)});function ni(e){return Zo(yc,e)}i(ni,"url");var sr=S("ZodMiniNumber",(e,t)=>{Vr.init(e,t),de.init(e,t)});function xe(e){return qo(sr,e)}i(xe,"number");var hc=S("ZodMiniNumberFormat",(e,t)=>{bo.init(e,t),sr.init(e,t)});function oi(e){return Go(hc,e)}i(oi,"int");var Wr=S("ZodMiniBoolean",(e,t)=>{Zr.init(e,t),de.init(e,t)});function Y(e){return Wo(Wr,e)}i(Y,"boolean");var ii=S("ZodMiniBigInt",(e,t)=>{To.init(e,t),de.init(e,t)});var vc=S("ZodMiniAny",(e,t)=>{Io.init(e,t),de.init(e,t)});function St(){return Qo(vc)}i(St,"any");var xc=S("ZodMiniUnknown",(e,t)=>{Eo.init(e,t),de.init(e,t)});function N(){return Xo(xc)}i(N,"unknown");var Pc=S("ZodMiniVoid",(e,t)=>{Ao.init(e,t),de.init(e,t)});function ai(e){return Yo(Pc,e)}i(ai,"_void");var si=S("ZodMiniDate",(e,t)=>{So.init(e,t),de.init(e,t)});var _c=S("ZodMiniArray",(e,t)=>{$o.init(e,t),de.init(e,t)});function L(e,t){return new _c({type:"array",element:e,...ne(t)})}i(L,"array");var bc=S("ZodMiniObject",(e,t)=>{ko.init(e,t),de.init(e,t),le(e,"shape",()=>t.shape)});function d(e,t){let r={type:"object",shape:e??{},...ne(t)};return new bc(r)}i(d,"object");var Tc=S("ZodMiniUnion",(e,t)=>{qr.init(e,t),de.init(e,t)});function j(e,t){return new Tc({type:"union",options:e,...ne(t)})}i(j,"union");var Ic=S("ZodMiniDiscriminatedUnion",(e,t)=>{zo.init(e,t),de.init(e,t)});function He(e,t,r){return new Ic({type:"union",options:t,discriminator:e,...ne(r)})}i(He,"discriminatedUnion");var Ec=S("ZodMiniRecord",(e,t)=>{Oo.init(e,t),de.init(e,t)});function C(e,t,r){return new Ec({type:"record",keyType:e,valueType:t,...ne(r)})}i(C,"record");var Ac=S("ZodMiniEnum",(e,t)=>{Ro.init(e,t),de.init(e,t),e.options=Object.values(t.entries)});function H(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ac({type:"enum",entries:r,...ne(t)})}i(H,"_enum");var Sc=S("ZodMiniLiteral",(e,t)=>{wo.init(e,t),de.init(e,t)});function O(e,t){return new Sc({type:"literal",values:Array.isArray(e)?e:[e],...ne(t)})}i(O,"literal");var $c=S("ZodMiniTransform",(e,t)=>{Do.init(e,t),de.init(e,t)});function Ge(e){return new $c({type:"transform",transform:e})}i(Ge,"transform");var kc=S("ZodMiniOptional",(e,t)=>{No.init(e,t),de.init(e,t)});function h(e){return new kc({type:"optional",innerType:e})}i(h,"optional");var zc=S("ZodMiniNullable",(e,t)=>{Co.init(e,t),de.init(e,t)});function $t(e){return new zc({type:"nullable",innerType:e})}i($t,"nullable");var Oc=S("ZodMiniPipe",(e,t)=>{Uo.init(e,t),de.init(e,t)});function We(e,t){return new Oc({type:"pipe",in:e,out:t})}i(We,"pipe");var Rc=S("ZodMiniCustom",(e,t)=>{Mo.init(e,t),de.init(e,t)});function ur(e,t){return ti(Rc,e??(()=>!0),t)}i(ur,"custom");var kt={};Wn(kt,{bigint:()=>Mc,boolean:()=>Uc,date:()=>Lc,number:()=>Cc,string:()=>Nc});function Nc(e){return Vo(ar,e)}i(Nc,"string");function Cc(e){return Ho(sr,e)}i(Cc,"number");function Uc(e){return Ko(Wr,e)}i(Uc,"boolean");function Mc(e){return Jo(ii,e)}i(Mc,"bigint");function Lc(e){return ei(si,e)}i(Lc,"date");var Jr=d({retryOnFailure:d({defaultValue:h(Y()),hide:h(Y())}),continueOnFailure:d({defaultValue:h(Y()),hide:h(Y())})}),Kr=class{constructor(t,r,n,o,s,u,p,l,g,x,E){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=u;this.requireAuth=p;this.errorHandlingOptions=l;this.outputSchema=g;this.audience=x;this.aiMetadata=E}static{i(this,"IAction")}},ae=i(e=>new Kr(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 X=d({displayName:a(),description:h(a())}),Z=i((e,t)=>d({type:O(t),required:Y(),defaultValue:h(St())}),"TPropertyValue");var be=d({...X.shape,...Z(a(),"SHORT_TEXT").shape}),Ce=d({...X.shape,...Z(a(),"LONG_TEXT").shape});var ci=d({label:a(),value:N()}),cr=d({disabled:h(Y()),placeholder:h(a()),options:L(ci)});var Te=d({...X.shape,options:cr,...Z(N(),"STATIC_DROPDOWN").shape}),Ue=d({...X.shape,options:cr,...Z(L(N()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Qr=d({...X.shape,...Z(N(),"DROPDOWN").shape,refreshers:L(a())}),zt=d({...X.shape,...Z(L(N()),"MULTI_SELECT_DROPDOWN").shape,refreshers:L(a())});var Me=d({...X.shape,...Z(Y(),"CHECKBOX").shape});var Le=d({...X.shape,...Z(xe(),"NUMBER").shape});var Ot=d({...X.shape,streaming:h(Y()),...Z(N(),"FILE").shape});var Rt=d({...X.shape,...Z(a(),"DATE_TIME").shape});var pi=C(a(),j([be,Ce,Te,zt,Ue,Me,Le,Ot,Rt])),wt=d({...X.shape,properties:pi,...Z(L(N()),"ARRAY").shape});var Dt=d({...X.shape,...Z(j([C(a(),N())]),"JSON").shape});var li=j([be,Te,Dt,wt,Ue]),Bc=C(a(),li),Xr=d({refreshers:L(a()),...X.shape,...Z(N(),"DYNAMIC").shape});var pr=d({...X.shape,...Z(ai(),"MARKDOWN").shape});var Nt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Nt||{}),ut=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(ut||{}),Ct=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Ct||{});var Ut=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Ut||{}),Yr="both_client_credentials_and_authorization_code";var Ee=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ee||{}),Mt=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(Mt||{}),Fc=d({strategy:H(Mt),paramName:h(a())}),Lt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Lt||{});var lr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(lr||{}),di=d({status:h(xe()),body:h(N()),headers:h(C(a(),a()))}),mi=d({type:O("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(H(lr))}),fi=d({type:O("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:di,handlerId:h(a()),streamStepProgress:h(H(lr))}),Vc=j([mi,fi]);var Zc=d({body:N(),rawBody:h(N()),headers:C(a(),a()),queryParams:C(a(),a())});function me(e){return e==null}i(me,"isNil");function jt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(jt,"isEmpty");function dr(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(dr,"assertNotNullOrUndefined");var en=Se(require("crypto"),1);var qc=128,et,ct,Hc=i(e=>{!et||et.length<e?(et=Buffer.allocUnsafe(e*qc),en.default.randomFillSync(et),ct=0):ct+e>et.length&&(en.default.randomFillSync(et),ct=0),ct+=e},"fillPool"),Gc=i(e=>(Hc(e|=0),et.subarray(ct-e,ct)),"random"),Wc=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let u="";for(;;){let p=r(o),l=o;for(;l--;)if(u+=e[p[l]&n]||"",u.length===s)return u}}},"customRandom"),yi=i((e,t=21)=>Wc(e,t,Gc),"customAlphabet");var Kc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",hi=21,oT=a().check(qe(new RegExp(`^[0-9a-zA-Z]{${hi}}$`))),Jc=yi(Kc,hi);var Ke=We(Ge(e=>e instanceof Date?e.toISOString():e),a()),Ae={id:a(),created:Ke,updated:Ke},oe=i(e=>h($t(e)),"Nullable");function tn(e){return h($t(H(e)))}i(tn,"NullableEnum");var sT=We(Ge(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(Y())),mr=i(e=>We(Ge(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(L(e))),"OptionalArrayFromQuery");var pT=C(a(),N());var Bt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(Bt||{});var bT=a().check(qe(/^#[0-9A-Fa-f]{6}$/));var IT=d({filename:a(),data:N(),type:O("file"),mimetype:h(a())});var Qc=Se(xi());var OT=d({...Ae,name:a(),permissions:L(a()),platformId:oe(a()),type:a(),userCount:h(xe())});var Pi=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Pi||{}),rn=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(rn||{}),nn=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(nn||{});var on=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(on||{});var an=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(an||{});var Xc=d({mode:H(Pi),value:N()}),Yc=d({auth:h(a()),fields:C(a(),Xc)}),ep=d({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(Yc)}),tp=d({type:O("PIECE"),toolName:a().check($e(1)),pieceMetadata:ep}),rp=d({type:O("none")}),np=d({type:O("access_token"),accessToken:a()}),op=d({type:O("api_key"),apiKey:a(),apiKeyHeader:a()}),ip=d({type:O("headers"),headers:C(a(),a())}),ap=He("type",[rp,np,op,ip]),_i=d({type:O("FLOW"),toolName:a().check($e(1)),externalFlowId:a(),flowDisplayName:h(a())}),bi=d({type:O("MCP"),toolName:a().check($e(1)),serverUrl:ni(),protocol:H(nn),auth:ap}),Ti=d({type:O("KNOWLEDGE_BASE"),toolName:a().check($e(1)),sourceType:H(rn),sourceId:a(),sourceName:a()}),sp=He("type",[tp,_i,bi,Ti]),up=d({displayName:a(),description:h(a()),type:H(on)}),Ii=d({type:O("MARKDOWN"),markdown:a()}),pt={type:O("TOOL_CALL"),input:oe(C(a(),N())),output:h(N()),toolName:a(),status:H(an),toolCallId:a(),startTime:a(),endTime:h(a())},uI=d(pt),Ei=He("toolCallType",[d({...pt,toolCallType:O("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),d({...pt,toolCallType:O("FLOW"),displayName:a(),externalFlowId:a()}),d({...pt,toolCallType:O("MCP"),displayName:a(),serverUrl:a()}),d({...pt,toolCallType:O("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),d({...pt,toolCallType:O("UNKNOWN"),displayName:a()})]),cp=j([Ii,Ei]);var sn=(r=>(r.IMAGE="image",r.TEXT="text",r))(sn||{}),je=d({apiKey:a()}),pp=je,lp=d({apiKey:a(),apiKeyHash:a()}),dp=je,mp=je,fp=je,gp=je,yp=je,hp=je,vp=je,zi=d({accessKeyId:a().check($e(1)),secretAccessKey:a().check($e(1))}),xp=d({}),Pp=d({}),_p=d({}),bp=d({}),Tp=d({}),Ip=d({}),Oi=d({modelId:a(),modelName:a(),modelType:H(sn)}),Ri=d({apiKeyHeader:a(),baseUrl:a(),models:L(Oi),defaultHeaders:h(C(a(),a()))}),wi=d({accountId:a(),gatewayId:a(),models:L(Oi),vertexProject:h(a()),vertexRegion:h(a())}),Di=d({resourceName:a(),apiVersion:We(Ge(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),Ni=d({region:a().check($e(1))}),Ep=j([pp,fp,gp,yp,hp,mp,dp,lp,zi,vp]),Ci=j([Ri,wi,Di,Ni,xp,_p,bp,Tp,Pp,Ip]),Ap=d({id:a(),name:a(),type:H(sn)}),Sp=d({id:a(),name:a(),provider:H(Bt),config:Ci,enabledForChat:Y()}),$p=d({provider:H(Bt),config:Ci,auth:Ep,platformId:a()});var dI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Ai=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],kp=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],zp=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Si=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Op=["grok-4.20","grok-4.1-fast"],Rp={openai:Ai,anthropic:kp,google:Si,activepieces:[...zp.map(e=>`anthropic/${e}`),...Ai.map(e=>`openai/${e}`),...Si.map(e=>`google/${e}`),...Op.map(e=>`x-ai/${e}`)]};var $i=128e3,wp={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Dp({provider:e}){return e?wp[e]??$i:$i}i(Dp,"getMaxContextTokens");var ki={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"},Np={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Cp=new Set(["anthropic","mistral"]);function Re(e){return{chatModels:Rp[e],maxContextTokens:Dp({provider:e}),defaultEmbeddingModel:ki[e],supportsEmbedding:ki[e]!==void 0,supportsImageGeneration:!Cp.has(e),webSearch:Np[e]}}i(Re,"buildProviderCapabilities");var Up={openai:Re("openai"),anthropic:Re("anthropic"),openrouter:Re("openrouter"),azure:Re("azure"),google:Re("google"),"cloudflare-gateway":Re("cloudflare-gateway"),custom:Re("custom"),bedrock:Re("bedrock"),mistral:Re("mistral"),activepieces:Re("activepieces")};var Mp=d({base64Url:a(),fileName:a(),extension:h(a())}),Lp=d({mimeType:a(),url:a(),fileName:h(a())}),un=j([Mp,Lp]);var jp=j([d({type:O("file"),value:un}),d({type:O("markdown"),value:a(),files:h(L(un))})]),Bp=d({sessionId:a(),message:a(),files:h(L(a()))});var Mi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Mi||{}),Li=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Li||{}),cn=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(cn||{});var Fp=j([d({...Ae,name:a(),externalId:a(),type:O("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:d({options:L(d({value:a()}))})}),d({...Ae,name:a(),externalId:a(),type:j([O("TEXT"),O("NUMBER"),O("DATE")]),tableId:a(),projectId:a()})]),Vp=d({...Ae,name:a(),folderId:oe(a()),projectId:a(),externalId:a(),status:tn(Li),trigger:tn(Mi)}),Zp=d({...Ae,tableId:a(),projectId:a(),cells:C(a(),d({updated:a(),created:a(),value:N(),fieldName:a()}))}),qp=d({events:L(H(cn)),webhookUrl:a(),flowId:a()}),Hp=d({fields:L(d({id:a(),name:a()})),rows:L(C(a(),a())),name:a()}),Gp=d({projectId:a(),limit:h(kt.number()),cursor:h(a()),name:h(a()),externalIds:mr(a()),folderId:h(a()),folderIds:mr(a())}),Wp=d({records:L(L(d({fieldId:a(),value:Bi()}))),tableId:a()}),Kp=d({cells:h(L(d({fieldId:a(),value:Bi()}))),tableId:a(),agentUpdate:h(Y())}),ji=He("operator",[tt("eq"),tt("neq"),tt("gt"),tt("gte"),tt("lt"),tt("lte"),tt("co"),Ui("exists"),Ui("not_exists")]),Jp=d({tableId:a(),limit:h(kt.number()),cursor:h(a()),filters:mr(ji)});function Bi(){return We(Ge(e=>e==null?e:String(e)),$t(a()))}i(Bi,"coerceToString");function tt(e){return d({fieldId:a(),operator:O(e),value:a()})}i(tt,"valueFilter");function Ui(e){return d({fieldId:a(),operator:O(e)})}i(Ui,"existenceFilter");var Qp=d({status:h(xe()),body:h(N()),headers:h(C(a(),a()))}),Xp=d({...Ae,deleted:oe(Ke),ownerId:a(),displayName:a(),platformId:a(),externalId:oe(a())});var Fi=d({name:a(),description:h(a()),type:a(),required:Y()}),Yp=d({pieceName:a(),triggerName:a(),input:d({toolName:a(),toolDescription:a(),inputSchema:L(Fi),returnsResponse:Y()})});var Vi="^[0-9]+\\.[0-9]+\\.[0-9]+$",OI=new RegExp(Vi),tl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",RI=a().check(qe(new RegExp(Vi))),wI=a().check(qe(new RegExp(tl))),rl=d({packageType:O("ARCHIVE"),pieceType:H(ut),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Zi=d({packageType:O("REGISTRY"),pieceType:O("OFFICIAL"),pieceName:a(),pieceVersion:a()}),qi=d({packageType:O("REGISTRY"),pieceType:O("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),DI=j([Zi,qi]),NI=j([rl,Zi,qi]);var nl=He("type",[d({type:O("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),d({type:O("INTERVAL"),intervalMs:oi().check(or(6e4))})]),CI=d({...Ae,type:H(Ee),projectId:a(),flowId:a(),triggerName:a(),schedule:oe(nl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:oe(a()),simulate:Y()}),Hi=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(Hi||{}),Gi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Gi||{}),Wi=(r=>(r.S3="S3",r.DB="DB",r))(Wi||{}),UI=d({...Ae,projectId:oe(a()),platformId:oe(a()),type:H(Hi),compression:H(Gi),data:h(N()),location:H(Wi),size:oe(xe()),fileName:oe(a()),s3Key:oe(a()),metadata:oe(C(a(),a()))}),Ki=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ki||{}),Ji=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ji||{}),MI=d({id:a(),email:a(),firstName:a(),status:H(Ji),externalId:oe(a()),platformId:oe(a()),platformRole:H(Ki),lastName:a(),created:Ke,updated:Ke,lastActiveDate:oe(Ke),imageUrl:oe(a())});var pn=d({...X.shape,...Z(C(a(),N()),"OBJECT").shape});var ea=d({...X.shape,...Z(a(),"COLOR").shape});var ln=j([be,Ce,pr,Me,Te,Ue,Qr,zt,Xr,Le,wt,pn,Dt,Rt,Ot,ea]),_={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 we=d({displayName:a(),description:h(a())});var ta=d({username:a(),password:a()}),dn=d({...we.shape,username:d({displayName:a(),description:h(a())}),password:d({displayName:a(),description:h(a())}),...Z(ta,"BASIC_AUTH").shape});var sl=C(a(),j([be,Ce,Le,Me,Te])),mn=d({...we.shape,props:sl,...Z(N(),"CUSTOM_AUTH").shape});var rt=d({...we.shape,...Z(d({auth:a()}),"SECRET_TEXT").shape});var ul=C(a(),j([be,Ce,rt,Le,Me,Te,Ue,pr])),ra=d({...we.shape,props:ul,...Z(N(),"OIDC").shape});var fn=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(fn||{}),na=j([be,rt,Te]),oa=C(a(),na),cl=d({props:h(C(a(),na)),authUrl:a(),tokenUrl:a(),scope:L(a()),prompt:h(j([O("none"),O("consent"),O("login"),O("omit")])),pkce:h(Y()),pkceMethod:h(j([O("plain"),O("S256")])),authorizationMethod:h(H(fn)),grantType:h(j([H(Ut),O(Yr)])),extra:h(C(a(),a()))}),ia=d({access_token:a(),props:h(oa),data:C(a(),St())}),gn=d({...we.shape,...cl.shape,...Z(ia,"OAUTH2").shape});var lt=j([dn,mn,ra,gn,rt]),Ft="Connection",yn={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Ft}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Ft,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Ft}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Ft}},None(){}};var yA={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 pl=d({...X.shape,...Z(N(),"CUSTOM").shape,code:a()});var ll=j([ln,lt]),hn=C(a(),ll),CA=C(a(),ln);var aa=j([d({strategy:O("CRON"),cronExpression:a()}),d({strategy:O("NONE")})]),dt=class{constructor(t,r,n,o,s,u,p,l,g,x,E,P,c,m,y,f,v,b,B){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=u;this.handshakeConfiguration=p;this.onHandshake=l;this.renewConfiguration=g;this.onRenew=x;this.onEnable=E;this.onDisable=P;this.onStart=c;this.run=m;this.test=y;this.sampleData=f;this.testStrategy=v;this.outputSchema=b;this.aiMetadata=B}static{i(this,"ITrigger")}},De=i(e=>{switch(e.type){case"WEBHOOK":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new dt(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,me(e.sampleData)&&me(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var sa="2",gr="0.82.0";var vn=class{constructor(t,r,n,o,s,u,p,l,g=gr,x,E="",P){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=p;this.auth=l;this.minimumSupportedRelease=g;this.maximumSupportedRelease=x;this.description=E;this.deprecated=P;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:sa}),"getContextInfo");(!dl(g)||ml(g,gr))&&(this.minimumSupportedRelease=gr),s.forEach(c=>this._actions[c.name]=c),u.forEach(c=>this._triggers[c.name]=c)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,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}},ua=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new vn(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 dl(e){return/^\d+\.\d+\.\d+$/.test(e)}i(dl,"isValidSimpleSemver");function ml(e,t){let[r,n,o]=e.split(".").map(Number),[s,u,p]=t.split(".").map(Number);return r!==s?r<s:n!==u?n<u:o<p}i(ml,"isSemverLessThan");var fl=h(C(a(),C(a(),a()))),ca=d({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:L(a()),platformId:h(a()),directoryPath:h(a()),auth:h(j([lt,L(lt)])),version:a(),categories:h(L(H(Ct))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),deprecated:h(Y()),i18n:fl}),gl=H(["human","ai","both"]),pa=d({description:h(a()),idempotent:h(Y())}),la=d({name:a(),displayName:a(),description:a(),props:hn,requireAuth:Y(),errorHandlingOptions:h(Jr),outputSchema:h(ur()),audience:h(gl),aiMetadata:h(pa)}),da=d({name:a(),displayName:a(),description:a(),props:hn,errorHandlingOptions:h(Jr),type:H(Ee),sampleData:N(),handshakeConfiguration:h(ur()),renewConfiguration:h(aa),testStrategy:H(Lt),outputSchema:h(ur()),aiMetadata:h(pa)}),yl=d({...ca.shape,actions:C(a(),la),triggers:C(a(),da)}),hl=d({...ca.shape,actions:xe(),triggers:xe(),suggestedActions:h(L(la)),suggestedTriggers:h(L(da))}),ma=d({projectUsage:xe(),pieceType:H(ut),packageType:H(Nt),platformId:h(a()),archiveId:h(a())}),CS=d({...yl.shape,...ma.shape}),US=d({...hl.shape,...ma.shape}),MS=d({name:a(),version:a()});var vl=Se(require("path")),xl=Se(require("fs/promises"));var ha=require("node:stream");var yr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,u)=>{o.append(u,s)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var hr=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new xn,r=new Pn){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},xn=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Pn=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var Vt=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function fa({error:e,requestBody:t}){return e instanceof Vt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}i(fa,"toFailsafeOutput");var ge=(u=>(u.GET="GET",u.POST="POST",u.PATCH="PATCH",u.PUT="PUT",u.DELETE="DELETE",u.HEAD="HEAD",u))(ge||{});var vr=class extends yr{static{i(this,"FetchHttpClient")}constructor(t="",r=new hr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),u=t.queryParams??{};for(let[B,ce]of Object.entries(u))o.append(B,ce);let p=o.toString(),l=p?`${n}?${p}`:n,g=t.responseType??"json",x=t.followRedirects??!0,E=t.retries??0,{body:P,extraHeaders:c,isStream:m}=Pl(t.method)?_l(t.body,s):{body:void 0,extraHeaders:{},isStream:!1},y=Tl({...s,...c}),f=await bl(async()=>{let B=new AbortController,ce=t.timeout&&t.timeout>0?setTimeout(()=>B.abort(),t.timeout):void 0;try{let ve={method:t.method.toString(),headers:y,body:P,redirect:x?"follow":"manual",signal:B.signal};return m&&(ve.duplex="half"),r?.dispatcher!==void 0&&(ve.dispatcher=r.dispatcher),await fetch(l,ve)}finally{ce!==void 0&&clearTimeout(ce)}},E),v=x?300:400;if(f.status<200||f.status>=v){let B=await ga(f,g),ce=new Vt(t.body,{status:f.status,responseBody:B});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ce),ce}let b=await ga(f,g);return{status:f.status,headers:Il(f.headers),body:b}}};function Pl(e){return e!=="GET"&&e!=="HEAD"}i(Pl,"acceptsRequestBody");function _l(e,t){if(Al(e))return{body:void 0,extraHeaders:{},isStream:!1};if(El(e)){let n=new ha.PassThrough;return e.on("error",o=>n.destroy(o)),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}}i(_l,"serializeBody");async function ga(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}}}}i(ga,"parseResponseBody");async function bl(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await ya(n);continue}return o}catch(o){if(r=o,n<t){await ya(n);continue}throw o}throw r}i(bl,"sendWithRetries");function ya(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(ya,"backoff");function Tl(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}i(Tl,"normalizeHeaders");function Il(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Il,"toHttpHeaders");function El(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}i(El,"isNodeFormData");function Al(e){return e==null}i(Al,"isNil");var W=new vr;var mm=Se(require("fs")),Tu=Se(bu());var fm={"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 gm(e){let t=e.split(";")[0].trim().toLowerCase();return fm[t]??""}i(gm,"contentTypeToExtension");var ym=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),hm=i((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Iu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:s,props:u,extraProps:p,authLocation:l="headers"}){return ae({audience:"human",name:s||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:_.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(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 ${hm(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...u?.url??{}})}),"props")}),method:_.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(ge).map(g=>({label:g,value:g}))},...u?.method??{}}),headers:_.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...u?.headers??{}}),queryParams:_.Object({displayName:"Query Parameters",required:!0,...u?.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:i(async({body_type:g})=>{if(!g)return{};let x=g,E={};switch(x){case"none":break;case"json":E.data=_.Json({displayName:"JSON Body",required:!0,...u?.body??{}});break;case"raw":E.data=_.LongText({displayName:"Raw Body",required:!0});break;case"form_data":E.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 E},"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,...u?.failsafe??{}}),timeout:_.Number({displayName:"Timeout (in seconds)",required:!1,...u?.timeout??{}}),followRedirects:_.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:i(async g=>{let{method:x,url:E,headers:P,queryParams:c,body:m,body_type:y,failsafe:f,timeout:v,response_is_binary:b,followRedirects:B}=g.propsValue;dr(x,"Method"),dr(E,"URL");let ce=me(r)?{}:await r(g.auth,g.propsValue),ve=E.url,ze=ve.startsWith("http://")||ve.startsWith("https://")?ve:ym({baseUrl:t(g.auth),relativePath:ve}),ee={method:x,url:ze,headers:{...P??{},...l==="headers"||!me(l)?ce:{}},queryParams:{...l==="queryParams"?ce:{},...c??{}},timeout:v?v*1e3:0,followRedirects:B};if(b&&(ee.responseType="arraybuffer"),m)if(y&&y!=="none"){let q=m.data;if(y==="form_data"){let ot=q,Qe=new Tu.default;for(let{fieldName:M,fieldType:I,textFieldValue:T,fileFieldValue:$}of ot)I==="text"&&!jt(T)?Qe.append(M,T):I==="file"&&!jt($)&&Qe.append(M,$.data,{filename:$?.filename});ee.body=Qe,ee.headers={...ee.headers,...Qe.getHeaders()}}else ee.body=q}else y||(ee.body=m);try{let q=await W.sendRequest(ee);return await vm(g.files,q.body,q.status,q.headers,b)}catch(q){if(f)return fa({error:q,requestBody:ee.body});throw q}},"run")})}i(Iu,"createCustomApiCallAction");var vm=i(async(e,t,r,n,o)=>{let s;if(o&&xm(t)){let u=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=gm(u??"")||"txt",l;t instanceof ArrayBuffer?l=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?l=t:l=Buffer.from(t),s=await e.write({fileName:`output.${p}`,data:l})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),xm=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var re={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:s,server:u}){switch(e.strategy){case 0:{let p=await t.get("lastPoll");if(me(p))throw new Error("lastPoll doesn't exist in the store.");let l=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:p,server:u}),g=l.reduce((x,E)=>Math.max(x,E.epochMilliSeconds),p);return await t.put("lastPoll",g),l.filter(x=>x.epochMilliSeconds>p).map(x=>x.data)}case 1:{let p=await t.get("lastItem"),l=await e.items({store:t,auth:r,propsValue:n,lastItemId:p,files:s,server:u}),g=l.findIndex(P=>P.id===p),x=[];me(p)||g==-1?x=l??[]:x=l?.slice(0,g)??[],me(o)||(x=x.slice(-o));let E=x?.[0]?.id;return me(E)||await t.put("lastItem",E),x.map(P=>P.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let u=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;me(u)?await t.delete("lastItem"):await t.put("lastItem",u);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:s}){let u=[];switch(e.strategy){case 0:{u=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{u=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:s});break}}return Pm(u.map(p=>p.data))}};function Pm(e){return e.length<=5?e:e.slice(0,5)}i(Pm,"getFirstFiveOrAll");var G=yn.OAuth2({description:"You can find Company ID under **settings->Additional Info**.",required:!0,props:{companyId:_.ShortText({displayName:"Company ID",required:!0})},authUrl:"https://appcenter.intuit.com/connect/oauth2",tokenUrl:"https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer",scope:["com.intuit.quickbooks.accounting"]});var _m="https://quickbooks.api.intuit.com/v3/company",J={getApiUrl:i(e=>`${_m}/${e}`,"getApiUrl")};var Eu=ae({auth:G,name:"find_invoice",displayName:"Find Invoice",description:"Search for an invoice by its number in QuickBooks.",audience:"both",aiMetadata:{description:"Look up a single QuickBooks invoice by its document number (DocNumber), returning the first match. Use to resolve an invoice reference to its full record before reading or acting on it; the document number is required. Read-only and idempotent.",idempotent:!0},props:{invoice_number:_.ShortText({displayName:"Invoice Number",description:"The document number (DocNumber) of the invoice to search for.",required:!0})},async run(e){let{invoice_number:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let n=J.getApiUrl(r),o=`SELECT * FROM Invoice WHERE DocNumber = '${t.replace(/'/g,"\\'")}' MAXRESULTS 1`,s=await W.sendRequest({method:"GET",url:`${n}/query`,queryParams:{query:o,minorversion:"70"},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}});return s.body?.QueryResponse?.Invoice&&s.body.QueryResponse.Invoice.length>0?{found:!0,result:s.body.QueryResponse.Invoice[0]}:{found:!1,result:{}}}});var Au=ae({auth:G,name:"find_customer",displayName:"Find Customer",description:"Search for a customer by display name in QuickBooks.",audience:"both",aiMetadata:{description:"Look up a single QuickBooks customer by exact display name, returning the first match. Use to resolve a customer name to its full record (including its Id) before referencing it elsewhere; the match is exact, not fuzzy. Read-only and idempotent.",idempotent:!0},props:{search_term:_.ShortText({displayName:"Customer Name",description:"The display name of the customer to search for.",required:!0})},async run(e){let{search_term:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let n=J.getApiUrl(r),o=`SELECT * FROM Customer WHERE DisplayName = '${t.replace(/'/g,"\\'")}' MAXRESULTS 1`,s=await W.sendRequest({method:"GET",url:`${n}/query`,queryParams:{query:o,minorversion:"70"},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}});return s.body?.QueryResponse?.Customer&&s.body.QueryResponse.Customer.length>0?{found:!0,result:s.body.QueryResponse.Customer[0]}:{found:!1,result:{}}}});var Su=ae({auth:G,name:"find_payment",displayName:"Find Payment",description:"Finds an existing payment in QuickBooks.",audience:"both",aiMetadata:{description:"List all QuickBooks payments belonging to a given customer, identified by the customer Id (not name). Use to retrieve a customer's payment history or to check whether they have any payments on record. Read-only and idempotent.",idempotent:!0},props:{customerId:_.ShortText({displayName:"Customer ID",description:"The ID of the customer to find payments for.",required:!0})},async run(e){let{customerId:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect.");let n=J.getApiUrl(r),o=`SELECT * FROM Payment WHERE CustomerRef = '${t}'`,s=await W.sendRequest({method:"GET",url:`${n}/query?query=${encodeURIComponent(o)}&minorversion=70`,headers:{Authorization:`Bearer ${e.auth.access_token}`,Accept:"application/json"}});return s.body.QueryResponse?.Payment&&s.body.QueryResponse?.Payment.length>0?{found:!0,result:s.body.QueryResponse?.Payment}:{found:!1,result:[]}}});var $u=ae({auth:G,name:"create_invoice",displayName:"Create Invoice",description:"Creates an invoice in QuickBooks.",audience:"both",aiMetadata:{description:'Create a new QuickBooks invoice for a customer with one or more line items (each line needs an amount and an Item/product Id). Optionally set due date, transaction date, invoice number, memos, and email status; setting email status to "Needs To Be Sent" requires a billing email. Not idempotent: each call creates a new invoice, so guard against duplicates.',idempotent:!1},props:{customerRef:_.Dropdown({auth:G,displayName:"Customer",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=J.getApiUrl(n),u=await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, DisplayName FROM Customer STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(u.body.Fault)throw new Error(`QuickBooks API Error: ${u.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(u.body.QueryResponse?.Customer??[]).map(l=>({label:l.DisplayName,value:l.Id}))}},"options")}),lineItems:_.Array({displayName:"Line Items",description:"Line items for the invoice",required:!0,properties:{description:_.ShortText({displayName:"Description",required:!1}),amount:_.Number({displayName:"Amount",description:"Total amount for this line (Exclusive of tax). Required.",required:!0}),detailType:_.StaticDropdown({displayName:"Detail Type",required:!0,options:{options:[{label:"Sales Item Line Detail",value:"SalesItemLineDetail"}]},defaultValue:"SalesItemLineDetail"}),itemId:_.ShortText({displayName:"Item ID (Product/Service)",description:"Enter the ID of the Item (Product/Service). Required for SalesItemLineDetail.",required:!0}),quantity:_.Number({displayName:"Quantity",required:!1}),unitPrice:_.Number({displayName:"Unit Price",description:"If specified, Amount will be Qty * UnitPrice. If Amount is also specified, Amount overrides calculation.",required:!1})}}),emailStatus:_.StaticDropdown({displayName:"Email Status",description:"Specify whether the invoice should be emailed after creation.",required:!1,options:{options:[{label:"Not Set (Default - No Email)",value:"NotSet"},{label:"Needs To Be Sent",value:"NeedToSend"}]},defaultValue:"NotSet"}),billEmail:_.ShortText({displayName:"Billing Email Address",description:'Email address to send the invoice to. Required if Email Status is "Needs To Be Sent". Overrides customer default.',required:!1}),dueDate:_.DateTime({displayName:"Due Date",description:"The date when the payment for the invoice is due. If not provided, default term from customer or company is used.",required:!1}),docNumber:_.ShortText({displayName:"Invoice Number",description:"Optional reference number for the invoice. If not provided, QuickBooks assigns the next sequential number.",required:!1}),txnDate:_.DateTime({displayName:"Transaction Date",description:"The date entered on the transaction. Defaults to the current date if not specified.",required:!1}),privateNote:_.LongText({displayName:"Private Note (Memo)",description:"Note to self. Does not appear on the invoice sent to the customer.",required:!1}),customerMemo:_.LongText({displayName:"Customer Memo (Statement Memo)",description:"Memo to be displayed on the invoice sent to the customer (appears on statement).",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=J.getApiUrl(r),o=e.propsValue;if(o.emailStatus==="NeedToSend"&&!o.billEmail)throw new Error('Billing Email Address is required when Email Status is "Needs To Be Sent".');let s=o.lineItems.map(l=>{if(l.detailType==="SalesItemLineDetail"){if(!l.itemId)throw new Error("Item ID is required for Sales Item Line Detail.");return{Amount:l.amount,DetailType:l.detailType,Description:l.description,SalesItemLineDetail:{ItemRef:{value:l.itemId},...l.quantity!=null&&{Qty:l.quantity},...l.unitPrice!=null&&{UnitPrice:l.unitPrice}}}}else return{Amount:l.amount,DetailType:l.detailType,Description:l.description}});if(s.length===0)throw new Error("At least one line item is required to create an invoice.");let u={Line:s,CustomerRef:{value:o.customerRef},...o.emailStatus&&{EmailStatus:o.emailStatus},...o.billEmail&&{BillEmail:{Address:o.billEmail}},...o.dueDate&&{DueDate:o.dueDate.split("T")[0]},...o.docNumber&&{DocNumber:o.docNumber},...o.txnDate&&{TxnDate:o.txnDate.split("T")[0]},...o.privateNote&&{PrivateNote:o.privateNote},...o.customerMemo&&{CustomerMemo:{value:o.customerMemo}}},p=await W.sendRequest({method:"POST",url:`${n}/invoice`,queryParams:{minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},body:u});if(p.body.Fault)throw new Error(`QuickBooks API Error: ${p.body.Fault.Error.map(l=>l.Message).join(", ")} - ${p.body.Fault.Error.map(l=>l.Detail).join(", ")}`);return p.body.Invoice}});var ku=ae({auth:G,name:"create_expense",displayName:"Create Expense",description:"Creates an expense transaction (purchase) in QuickBooks.",audience:"both",aiMetadata:{description:"Record a new expense (purchase) paid from a chosen bank or credit-card account, with one or more account-based line items (each needs an amount and an expense account Id) and a payment type of cash, check, or credit card. Optionally attach a payee/vendor, payment date, and memo. Not idempotent: each call creates a new purchase, so guard against duplicates.",idempotent:!1},props:{accountRef:_.Dropdown({auth:G,displayName:"Bank/Credit Card Account",description:"The account from which the expense was paid.",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect account",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=J.getApiUrl(n),u=await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, Name, AccountType FROM Account STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(u.body.Fault)throw new Error(`QuickBooks API Error fetching accounts: ${u.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(u.body.QueryResponse?.Account??[]).map(l=>({label:`${l.Name} (${l.AccountType})`,value:l.Id}))}},"options")}),paymentType:_.StaticDropdown({displayName:"Payment Type",required:!0,options:{options:[{label:"Cash",value:"Cash"},{label:"Check",value:"Check"},{label:"Credit Card",value:"CreditCard"}]},defaultValue:"Cash"}),entityRef:_.Dropdown({auth:G,displayName:"Payee (Vendor)",description:"Optional - The vendor the expense was paid to.",required:!1,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect account",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=J.getApiUrl(n),u=await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, DisplayName FROM Vendor STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(u.body.Fault)throw new Error(`QuickBooks API Error fetching vendors: ${u.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(u.body.QueryResponse?.Vendor??[]).map(l=>({label:l.DisplayName,value:l.Id}))}},"options")}),txnDate:_.DateTime({displayName:"Payment Date",description:"The date the expense occurred.",required:!1}),lineItems:_.Array({displayName:"Line Items",description:"Details of the expense (e.g., categories or items purchased). At least one line is required.",required:!0,properties:{amount:_.Number({displayName:"Amount",required:!0}),description:_.ShortText({displayName:"Description",required:!1}),detailType:_.StaticDropdown({displayName:"Detail Type",required:!0,options:{options:[{label:"Account Based Expense Line Detail",value:"AccountBasedExpenseLineDetail"}]},defaultValue:"AccountBasedExpenseLineDetail"}),expenseAccountId:_.ShortText({displayName:"Expense Category/Account ID",description:'The Id of the expense account. Use the "Find Account" action (filter by type Expense) to look this up.',required:!0})}}),privateNote:_.LongText({displayName:"Memo (Private Note)",description:"Internal note about the expense.",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=J.getApiUrl(r),o=e.propsValue,s=o.lineItems.map(g=>{let x={Amount:g.amount,Description:g.description,DetailType:g.detailType};if(g.detailType==="AccountBasedExpenseLineDetail"){if(!g.expenseAccountId)throw new Error("Expense Category/Account ID is required for Account Based Expense Line Detail.");x.AccountBasedExpenseLineDetail={AccountRef:{value:g.expenseAccountId}}}return x});if(s.length===0)throw new Error("At least one line item is required.");let u={AccountRef:{value:o.accountRef},PaymentType:o.paymentType,Line:s,...o.entityRef&&{EntityRef:{value:o.entityRef}},...o.txnDate&&{TxnDate:o.txnDate.split("T")[0]},...o.privateNote&&{PrivateNote:o.privateNote}},l=await W.sendRequest({method:"POST",url:`${n}/purchase`,queryParams:{minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},body:u});if(l.body.Fault)throw new Error(`QuickBooks API Error creating expense: ${l.body.Fault.Error.map(g=>g.Message).join(", ")} - Detail: ${l.body.Fault.Error.map(g=>g.Detail).join(", ")}`);return l.body.Purchase}});var zu=ae({auth:G,name:"create_bill",displayName:"Create Bill",description:"Creates a bill (accounts payable) in QuickBooks.",audience:"both",aiMetadata:{description:"Record a new bill owed to a vendor, with one or more account-based line items (each needs an amount and an expense account Id). Optionally set the bill date, due date, bill number, and memo. Not idempotent: each call creates a new bill, so guard against duplicates.",idempotent:!1},props:{vendorRef:_.Dropdown({auth:G,displayName:"Vendor",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=J.getApiUrl(n),u=await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, DisplayName FROM Vendor STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(u.body.Fault)throw new Error(`QuickBooks API Error fetching vendors: ${u.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(u.body.QueryResponse?.Vendor??[]).map(l=>({label:l.DisplayName,value:l.Id}))}},"options")}),lineItems:_.Array({displayName:"Line Items",description:"Details of the bill (expense categories). At least one line is required.",required:!0,properties:{amount:_.Number({displayName:"Amount",required:!0}),description:_.ShortText({displayName:"Description",required:!1}),detailType:_.StaticDropdown({displayName:"Detail Type",required:!0,options:{options:[{label:"Account Based Expense Line Detail",value:"AccountBasedExpenseLineDetail"}]},defaultValue:"AccountBasedExpenseLineDetail"}),expenseAccountId:_.ShortText({displayName:"Expense Category/Account ID",description:'The Id of the expense account. Use the "Find Account" action (filter by type Expense) to look this up.',required:!0})}}),txnDate:_.DateTime({displayName:"Bill Date",description:"The date of the bill. Defaults to today if empty.",required:!1}),dueDate:_.DateTime({displayName:"Due Date",description:"The date the payment is due. If empty, the vendor/company term is used.",required:!1}),docNumber:_.ShortText({displayName:"Bill Number",description:"Reference number for the bill.",required:!1}),privateNote:_.LongText({displayName:"Memo (Private Note)",description:"Internal note about the bill.",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=J.getApiUrl(r),o=e.propsValue,s=o.lineItems.map(l=>{if(!l.expenseAccountId)throw new Error("Expense Category/Account ID is required for each line.");return{Amount:l.amount,Description:l.description,DetailType:l.detailType,AccountBasedExpenseLineDetail:{AccountRef:{value:l.expenseAccountId}}}});if(s.length===0)throw new Error("At least one line item is required.");let u={VendorRef:{value:o.vendorRef},Line:s,...o.txnDate&&{TxnDate:o.txnDate.split("T")[0]},...o.dueDate&&{DueDate:o.dueDate.split("T")[0]},...o.docNumber&&{DocNumber:o.docNumber},...o.privateNote&&{PrivateNote:o.privateNote}},p=await W.sendRequest({method:"POST",url:`${n}/bill`,queryParams:{minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},body:u});if(p.body.Fault)throw new Error(`QuickBooks API Error creating bill: ${p.body.Fault.Error.map(l=>l.Message).join(", ")} - Detail: ${p.body.Fault.Error.map(l=>l.Detail).join(", ")}`);return p.body.Bill}});var Ou=ae({auth:G,name:"find_vendor",displayName:"Find Vendor",description:"Search for a vendor by display name in QuickBooks.",audience:"both",aiMetadata:{description:"Look up a single QuickBooks vendor by exact display name, returning the first match. Use to resolve a vendor name to its full record (including its Id) before referencing it elsewhere; the match is exact, not fuzzy. Read-only and idempotent.",idempotent:!0},props:{search_term:_.ShortText({displayName:"Vendor Name",description:"The display name of the vendor to search for.",required:!0})},async run(e){let{search_term:t}=e.propsValue,r=e.auth.props?.companyId;if(!r)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let n=J.getApiUrl(r),o=`SELECT * FROM Vendor WHERE DisplayName = '${t.replace(/'/g,"\\'")}' MAXRESULTS 1`,s=await W.sendRequest({method:"GET",url:`${n}/query`,queryParams:{query:o,minorversion:"70"},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}});return s.body?.QueryResponse?.Vendor&&s.body.QueryResponse.Vendor.length>0?{found:!0,result:s.body.QueryResponse.Vendor[0]}:{found:!1,result:{}}}});var Ru=ae({auth:G,name:"find_account",displayName:"Find Account",description:"List or search the chart of accounts to get an account Id (e.g. an expense account for a bill).",audience:"both",aiMetadata:{description:"List QuickBooks chart-of-accounts entries to resolve an account name to its Id. Optionally filter by a name substring and/or account type (e.g. Expense, Bank, Accounts Payable). Use this to find the expense-account Id required by Create Bill / Create Expense line items. Read-only and idempotent.",idempotent:!0},props:{search_term:_.ShortText({displayName:"Account Name Contains",description:"Optional. Filter accounts whose name contains this text.",required:!1}),accountType:_.StaticDropdown({displayName:"Account Type",description:"Optional. Filter by account type.",required:!1,options:{options:[{label:"Bank",value:"Bank"},{label:"Accounts Receivable",value:"Accounts Receivable"},{label:"Other Current Asset",value:"Other Current Asset"},{label:"Fixed Asset",value:"Fixed Asset"},{label:"Other Asset",value:"Other Asset"},{label:"Accounts Payable",value:"Accounts Payable"},{label:"Credit Card",value:"Credit Card"},{label:"Other Current Liability",value:"Other Current Liability"},{label:"Long Term Liability",value:"Long Term Liability"},{label:"Equity",value:"Equity"},{label:"Income",value:"Income"},{label:"Cost of Goods Sold",value:"Cost of Goods Sold"},{label:"Expense",value:"Expense"},{label:"Other Income",value:"Other Income"},{label:"Other Expense",value:"Other Expense"}]}})},async run(e){let{search_term:t,accountType:r}=e.propsValue,n=e.auth.props?.companyId;if(!n)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let o=J.getApiUrl(n),s=["Active = true"];t&&s.push(`Name LIKE '%${t.replace(/'/g,"\\'")}%'`),r&&s.push(`AccountType = '${r}'`);let u=`SELECT * FROM Account WHERE ${s.join(" AND ")} MAXRESULTS 1000`,l=(await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:u,minorversion:"70"},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}})).body?.QueryResponse?.Account??[];return{found:l.length>0,result:l}}});var wu=ae({auth:G,name:"record_payment",displayName:"Record Payment",description:"Records a customer payment in QuickBooks, optionally applying it to invoices.",audience:"both",aiMetadata:{description:"Record a payment received from a customer for a given total amount. Optionally apply the payment to one or more specific invoices by their transaction Id, set the deposit-to account, payment date, and reference number. If no invoices are specified, QuickBooks leaves the amount unapplied. Not idempotent: each call creates a new payment, so guard against duplicates.",idempotent:!1},props:{customerRef:_.Dropdown({auth:G,displayName:"Customer",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your account first",options:[]};let{access_token:t,props:r}=e,n=r?.companyId,o=J.getApiUrl(n),u=await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:"SELECT Id, DisplayName FROM Customer STARTPOSITION 1 MAXRESULTS 1000",minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(u.body.Fault)throw new Error(`QuickBooks API Error: ${u.body.Fault.Error.map(l=>l.Message).join(", ")}`);return{disabled:!1,options:(u.body.QueryResponse?.Customer??[]).map(l=>({label:l.DisplayName,value:l.Id}))}},"options")}),totalAmount:_.Number({displayName:"Total Amount",description:"The total amount of the payment received.",required:!0}),lineItems:_.Array({displayName:"Apply to Invoices",description:"Optional. Apply this payment to specific invoices. Leave empty to keep the amount unapplied.",required:!1,properties:{invoiceId:_.ShortText({displayName:"Invoice ID",description:"The transaction Id of the invoice to apply the payment to.",required:!0}),amount:_.Number({displayName:"Amount Applied",description:"The amount of this payment to apply to the invoice.",required:!0})}}),depositToAccountId:_.ShortText({displayName:"Deposit To Account ID",description:"Optional. The account to deposit the payment into. Defaults to Undeposited Funds if empty.",required:!1}),txnDate:_.DateTime({displayName:"Payment Date",description:"The date the payment was received. Defaults to today if empty.",required:!1}),paymentRefNum:_.ShortText({displayName:"Reference Number",description:"Optional reference number for the payment (e.g. check number).",required:!1}),privateNote:_.LongText({displayName:"Memo (Private Note)",description:"Internal note about the payment.",required:!1})},async run(e){let{access_token:t}=e.auth,r=e.auth.props?.companyId,n=J.getApiUrl(r),o=e.propsValue,s=(o.lineItems??[]).map(l=>({Amount:l.amount,LinkedTxn:[{TxnId:l.invoiceId,TxnType:"Invoice"}]})),u={CustomerRef:{value:o.customerRef},TotalAmt:o.totalAmount,...s.length>0&&{Line:s},...o.depositToAccountId&&{DepositToAccountRef:{value:o.depositToAccountId}},...o.txnDate&&{TxnDate:o.txnDate.split("T")[0]},...o.paymentRefNum&&{PaymentRefNum:o.paymentRefNum},...o.privateNote&&{PrivateNote:o.privateNote}},p=await W.sendRequest({method:"POST",url:`${n}/payment`,queryParams:{minorversion:"70"},headers:{Authorization:`Bearer ${t}`,Accept:"application/json","Content-Type":"application/json"},body:u});if(p.body.Fault)throw new Error(`QuickBooks API Error recording payment: ${p.body.Fault.Error.map(l=>l.Message).join(", ")} - Detail: ${p.body.Fault.Error.map(l=>l.Detail).join(", ")}`);return p.body.Payment}});var Du=ae({auth:G,name:"read_aging_report",displayName:"Read AR/AP Aging",description:"Reads an accounts receivable or accounts payable aging report from QuickBooks.",audience:"both",aiMetadata:{description:"Fetch an aging report showing outstanding receivables (money owed to the company) or payables (money the company owes), bucketed by how overdue they are. Choose the report type, optionally set the as-of date, the number of days per aging bucket, and the number of buckets. Read-only and idempotent.",idempotent:!0},props:{reportType:_.StaticDropdown({displayName:"Report",required:!0,options:{options:[{label:"A/R Aging Summary",value:"AgedReceivables"},{label:"A/R Aging Detail",value:"AgedReceivableDetail"},{label:"A/P Aging Summary",value:"AgedPayables"},{label:"A/P Aging Detail",value:"AgedPayableDetail"}]},defaultValue:"AgedReceivables"}),reportDate:_.DateTime({displayName:"As Of Date",description:"The date to age balances against. Defaults to today if empty.",required:!1}),agingPeriod:_.Number({displayName:"Days Per Period",description:"Number of days in each aging bucket (e.g. 30).",required:!1}),numPeriods:_.Number({displayName:"Number of Periods",description:"How many aging buckets to include.",required:!1})},async run(e){let{reportType:t,reportDate:r,agingPeriod:n,numPeriods:o}=e.propsValue,s=e.auth.props?.companyId;if(!s)throw new Error("Realm ID not found in authentication data. Please reconnect your account.");let u=J.getApiUrl(s),p=await W.sendRequest({method:"GET",url:`${u}/reports/${t}`,queryParams:{minorversion:"70",...r&&{report_date:r.split("T")[0]},...n!=null&&{aging_period:String(n)},...o!=null&&{num_periods:String(o)}},authentication:{type:"BEARER_TOKEN",token:e.auth.access_token},headers:{Accept:"application/json"}});if(p.body.Fault)throw new Error(`QuickBooks API Error fetching report: ${p.body.Fault.Error.map(l=>l.Message).join(", ")}`);return p.body}});var Vn=Se(vt()),kr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=J.getApiUrl(n),s=t===0?"SELECT * FROM Invoice ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Invoice WHERE Metadata.CreateTime >= '${(0,Vn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Invoice??[]).map(l=>({epochMilliSeconds:(0,Vn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},Nu=De({auth:G,name:"new_invoice",displayName:"New Invoice",description:"Triggers when an invoice is created .",aiMetadata:{description:"Fires when a new invoice is created in the connected QuickBooks company, emitting the newly created invoice record. Use to react to billing being issued to a customer."},props:{},type:"POLLING",async onEnable(e){await re.onEnable(kr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await re.onDisable(kr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await re.test(kr,e)},async run(e){return await re.poll(kr,e)},sampleData:void 0});var Zn=Se(vt()),Or={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=J.getApiUrl(n),s=t===0?"SELECT * FROM Purchase ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Purchase WHERE Metadata.CreateTime >= '${(0,Zn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Purchase??[]).map(l=>({epochMilliSeconds:(0,Zn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},Cu=De({auth:G,name:"new_expense",displayName:"New Expense (Purchase)",description:"Triggers when an Expense (Purchase) is created.",aiMetadata:{description:"Fires when a new expense (purchase transaction) is created in the connected QuickBooks company, emitting the newly created purchase record. Use to react to money being spent or a bill being recorded."},props:{},type:"POLLING",async onEnable(e){await re.onEnable(Or,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await re.onDisable(Or,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await re.test(Or,e)},async run(e){return await re.poll(Or,e)},sampleData:void 0});var qn=Se(vt()),Rr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=J.getApiUrl(n),s=t===0?"SELECT * FROM Customer ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Customer WHERE Metadata.CreateTime >= '${(0,qn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Customer??[]).map(l=>({epochMilliSeconds:(0,qn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},Uu=De({auth:G,name:"new_customer",displayName:"New Customer",description:"Triggers when a new customer is created.",aiMetadata:{description:"Fires when a new customer is created in the connected QuickBooks company, emitting the newly created customer record. Use to react to a new customer being added to the books."},props:{},type:"POLLING",async onEnable(e){await re.onEnable(Rr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await re.onDisable(Rr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await re.test(Rr,e)},async run(e){return await re.poll(Rr,e)},sampleData:void 0});var Hn=Se(vt()),wr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=J.getApiUrl(n),s=t===0?"SELECT * FROM Deposit ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Deposit WHERE Metadata.CreateTime >= '${(0,Hn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Deposit??[]).map(l=>({epochMilliSeconds:(0,Hn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},Mu=De({auth:G,name:"new_deposit",displayName:"New Deposit",description:"Triggers when a Deposit is created.",aiMetadata:{description:"Fires when a new deposit is created in the connected QuickBooks company, emitting the newly created deposit record. Use to react to funds being deposited into an account."},props:{},type:"POLLING",async onEnable(e){await re.onEnable(wr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await re.onDisable(wr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await re.test(wr,e)},async run(e){return await re.poll(wr,e)},sampleData:void 0});var Gn=Se(vt());var Dr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let{access_token:r}=e,n=e.props?.companyId,o=J.getApiUrl(n),s=t===0?"SELECT * FROM Transfer ORDERBY Metadata.CreateTime DESC MAXRESULTS 10":`SELECT * FROM Transfer WHERE Metadata.CreateTime >= '${(0,Gn.default)(t).toISOString()}' ORDERBY Metadata.CreateTime DESC`;return((await W.sendRequest({method:"GET",url:`${o}/query`,queryParams:{query:s,minorversion:"70"},headers:{Authorization:`Bearer ${r}`,Accept:"application/json"}})).body.QueryResponse?.Transfer??[]).map(l=>({epochMilliSeconds:(0,Gn.default)(l.MetaData?.CreateTime).valueOf(),data:l}))}},Lu=De({auth:G,name:"new_transfer",displayName:"New Transfer",description:"Triggers when a Transfer is created.",aiMetadata:{description:"Fires when a new transfer is created in the connected QuickBooks company, emitting the newly created transfer record. Use to react to funds being moved between two accounts."},props:{},type:"POLLING",async onEnable(e){await re.onEnable(Dr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await re.onDisable(Dr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await re.test(Dr,e)},async run(e){return await re.poll(Dr,e)},sampleData:void 0});var bm=ua({displayName:"Quickbooks Online",auth:G,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/quickbooks.png",authors:["onyedikachi-david","sanket-a11y"],actions:[Eu,Au,Su,$u,ku,zu,Ou,Ru,wu,Du,Iu({auth:G,baseUrl:i(e=>{let r=e.props?.companyId;return J.getApiUrl(r)},"baseUrl"),authMapping:i(async e=>({Authorization:`Bearer ${e.access_token}`}),"authMapping")})],triggers:[Nu,Cu,Uu,Mu,Lu]});0&&(module.exports={quickbooks});
|
|
4
4
|
/*! Bundled license information:
|
|
5
5
|
|
|
6
6
|
mime-types/index.js:
|