@activepieces/piece-gorgias 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/package.json +7 -12
  2. package/src/index.js +13 -44
  3. package/src/index.d.ts +0 -6
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/create-message.d.ts +0 -18
  7. package/src/lib/actions/create-message.d.ts.map +0 -1
  8. package/src/lib/actions/create-message.js +0 -108
  9. package/src/lib/actions/create-message.js.map +0 -1
  10. package/src/lib/actions/create-ticket.d.ts +0 -13
  11. package/src/lib/actions/create-ticket.d.ts.map +0 -1
  12. package/src/lib/actions/create-ticket.js +0 -81
  13. package/src/lib/actions/create-ticket.js.map +0 -1
  14. package/src/lib/actions/get-customer.d.ts +0 -9
  15. package/src/lib/actions/get-customer.d.ts.map +0 -1
  16. package/src/lib/actions/get-customer.js +0 -47
  17. package/src/lib/actions/get-customer.js.map +0 -1
  18. package/src/lib/actions/get-ticket.d.ts +0 -8
  19. package/src/lib/actions/get-ticket.d.ts.map +0 -1
  20. package/src/lib/actions/get-ticket.js +0 -30
  21. package/src/lib/actions/get-ticket.js.map +0 -1
  22. package/src/lib/actions/list-tickets.d.ts +0 -11
  23. package/src/lib/actions/list-tickets.d.ts.map +0 -1
  24. package/src/lib/actions/list-tickets.js +0 -54
  25. package/src/lib/actions/list-tickets.js.map +0 -1
  26. package/src/lib/actions/update-ticket.d.ts +0 -17
  27. package/src/lib/actions/update-ticket.d.ts.map +0 -1
  28. package/src/lib/actions/update-ticket.js +0 -88
  29. package/src/lib/actions/update-ticket.js.map +0 -1
  30. package/src/lib/auth.d.ts +0 -10
  31. package/src/lib/auth.d.ts.map +0 -1
  32. package/src/lib/auth.js +0 -73
  33. package/src/lib/auth.js.map +0 -1
  34. package/src/lib/common/client.d.ts +0 -31
  35. package/src/lib/common/client.d.ts.map +0 -1
  36. package/src/lib/common/client.js +0 -59
  37. package/src/lib/common/client.js.map +0 -1
  38. package/src/lib/common/constants.d.ts +0 -19
  39. package/src/lib/common/constants.d.ts.map +0 -1
  40. package/src/lib/common/constants.js +0 -29
  41. package/src/lib/common/constants.js.map +0 -1
package/package.json CHANGED
@@ -1,16 +1,11 @@
1
1
  {
2
2
  "name": "@activepieces/piece-gorgias",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "main": "./src/index.js",
5
- "types": "./src/index.d.ts",
6
- "dependencies": {
7
- "@activepieces/pieces-common": "0.12.3",
8
- "@activepieces/pieces-framework": "0.29.0",
9
- "@activepieces/shared": "0.82.0",
10
- "tslib": "2.6.2"
11
- },
12
- "scripts": {
13
- "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
14
- "lint": "eslint 'src/**/*.ts'"
15
- }
5
+ "dependencies": {},
6
+ "files": [
7
+ "src/index.js",
8
+ "package.json",
9
+ "src/i18n"
10
+ ]
16
11
  }
package/src/index.js CHANGED
@@ -1,44 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gorgias = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const shared_1 = require("@activepieces/shared");
8
- const buffer_1 = require("buffer");
9
- const auth_1 = require("./lib/auth");
10
- const create_ticket_1 = require("./lib/actions/create-ticket");
11
- const get_ticket_1 = require("./lib/actions/get-ticket");
12
- const update_ticket_1 = require("./lib/actions/update-ticket");
13
- const list_tickets_1 = require("./lib/actions/list-tickets");
14
- const create_message_1 = require("./lib/actions/create-message");
15
- const get_customer_1 = require("./lib/actions/get-customer");
16
- exports.gorgias = (0, pieces_framework_1.createPiece)({
17
- displayName: 'Gorgias',
18
- description: 'Helpdesk platform for ecommerce teams to manage tickets, customers, and support conversations.',
19
- minimumSupportedRelease: '0.36.1',
20
- logoUrl: 'https://cdn.activepieces.com/pieces/gorgias.png',
21
- categories: [shared_1.PieceCategory.CUSTOMER_SUPPORT],
22
- auth: auth_1.gorgiasAuth,
23
- authors: ['Harmatta'],
24
- actions: [
25
- create_ticket_1.createTicketAction,
26
- get_ticket_1.getTicketAction,
27
- update_ticket_1.updateTicketAction,
28
- list_tickets_1.listTicketsAction,
29
- create_message_1.createMessageAction,
30
- get_customer_1.getCustomerAction,
31
- (0, pieces_common_1.createCustomApiCallAction)({
32
- baseUrl: (auth) => { var _a; return (0, auth_1.getGorgiasBaseUrl)((_a = auth === null || auth === void 0 ? void 0 : auth.props.domain) !== null && _a !== void 0 ? _a : ''); },
33
- auth: auth_1.gorgiasAuth,
34
- authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
35
- const credentials = `${auth.props.email}:${auth.props.api_key}`;
36
- return {
37
- Authorization: `Basic ${buffer_1.Buffer.from(credentials).toString('base64')}`,
38
- };
39
- }),
40
- }),
41
- ],
42
- triggers: [],
43
- });
44
- //# sourceMappingURL=index.js.map
1
+ "use strict";var Zs=Object.create;var Je=Object.defineProperty;var Vs=Object.getOwnPropertyDescriptor;var Hs=Object.getOwnPropertyNames;var Gs=Object.getPrototypeOf,qs=Object.prototype.hasOwnProperty;var o=(e,t)=>Je(e,"name",{value:t,configurable:!0});var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mn=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:!0})},fn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Hs(t))!qs.call(e,i)&&i!==r&&Je(e,i,{get:()=>t[i],enumerable:!(n=Vs(t,i))||n.enumerable});return e};var we=(e,t,r)=>(r=e!=null?Zs(Gs(e)):{},fn(t||!e||!e.__esModule?Je(r,"default",{value:e,enumerable:!0}):r,e)),Ws=e=>fn(Je({},"__esModule",{value:!0}),e);var wo=$((Oo,Ft)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],P,j;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)y++;if(s.substr(0,2)==="::"&&y--,s.substr(-2,2)==="::"&&y--,y>d)return null;for(j=d-y,P=":";j--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=function(){let te=s.split(":"),ae=[];for(let Ke=0;Ke<te.length;Ke++)ae.push(parseInt(te[Ke],16));return ae}(),{parts:d,zoneId:v}}o(f,"expandIPv6");function g(s,d,y,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=y-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=y,v+=1}return!0}o(g,"matchCIDR");function _(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(_,"parseIntAuto");function E(s,d){for(;s.length<d;)s=`0${s}`;return s}o(E,"padPart");let x={};x.IPv4=function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,j;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(j=m[P],y&&j!==0)return null;j!==8&&(y=!0),d+=j}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,y,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[1]),y];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let d,y,m;if(d=s.match(r.fourOctet))return function(){let v=d.slice(1,6),P=[];for(let j=0;j<v.length;j++)y=v[j],P.push(_(y));return P}();if(d=s.match(r.longValue)){if(m=_(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v}().reverse()}else return(d=s.match(r.twoOctet))?function(){let v=d.slice(1,4),P=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P}():(d=s.match(r.threeOctet))?function(){let v=d.slice(1,5),P=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(_(v[1])),P.push(m>>8&255),P.push(m&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=function(){function s(d,y){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,P;for(let j=7;j>=0;j-=1)if(v=this.parts[j],v in m){if(P=m[v],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],y.push(d>>8),y.push(d&255);return y},s.prototype.toFixedLengthString=function(){let d=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(E(this.parts[v].toString(16),4));return m}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],m=d[1];return new x.IPv4([y>>8,y&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,v=-1,P;for(;P=d.exec(y);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?y:`${y.substring(0,m)}::${y.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,y,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(v)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,y,m;if((y=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let d,y,m,v,P,j;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return f(s,8);if((m=s.match(l.transitional))&&(j=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+j,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<P.length;y++)if(v=P[y],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,y){let m,v,P,j;y==null&&(y="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(j=P[m],s.kind()===j[0].kind()&&s.match.apply(s,j))return v}return y},typeof Ft<"u"&&Ft.exports?Ft.exports=x:e.ipaddr=x})(Oo)});var Ai=$((JS,Si)=>{var Ei=require("stream").Stream,Ip=require("util");Si.exports=ue;function ue(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ue,"DelayedStream");Ip.inherits(ue,Ei);ue.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ue.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ue.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ue.prototype.resume=function(){this._released||this.release(),this.source.resume()};ue.prototype.pause=function(){this.source.pause()};ue.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ue.prototype.pipe=function(){var e=Ei.prototype.pipe.apply(this,arguments);return this.resume(),e};ue.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)};ue.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 wi=$((YS,Oi)=>{var Tp=require("util"),ki=require("stream").Stream,zi=Ai();Oi.exports=q;function q(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(q,"CombinedStream");Tp.inherits(q,ki);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof zi)){var r=zi.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};q.prototype.pipe=function(e,t){return ki.prototype.pipe.call(this,e,t),this.resume(),e};q.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}};q.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=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.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()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.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")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.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)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ni=$((eA,Ri)=>{"use strict";Ri.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 Ui=$(ee=>{"use strict";var Wt=Ni(),$p=require("path").extname,Di=/^\s*([^;\s]*)(?:;|\s|$)/,Ep=/^text\//i;ee.charset=Ci;ee.charsets={lookup:Ci};ee.contentType=Sp;ee.extension=Ap;ee.extensions=Object.create(null);ee.lookup=zp;ee.types=Object.create(null);kp(ee.extensions,ee.types);function Ci(e){if(!e||typeof e!="string")return!1;var t=Di.exec(e),r=t&&Wt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Ep.test(t[1])?"UTF-8":!1}o(Ci,"charset");function Sp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?ee.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=ee.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Sp,"contentType");function Ap(e){if(!e||typeof e!="string")return!1;var t=Di.exec(e),r=t&&ee.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Ap,"extension");function zp(e){if(!e||typeof e!="string")return!1;var t=$p("x."+e).toLowerCase().substr(1);return t&&ee.types[t]||!1}o(zp,"lookup");function kp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Wt).forEach(o(function(i){var u=Wt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var g=r.indexOf(Wt[t[f]].source),_=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(g>_||g===_&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(kp,"populateMaps")});var ji=$((nA,Mi)=>{Mi.exports=Op;function Op(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Op,"defer")});var Zr=$((iA,Fi)=>{var Li=ji();Fi.exports=wp;function wp(e){var t=!1;return Li(function(){t=!0}),o(function(n,i){t?e(n,i):Li(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(wp,"async")});var Vr=$((sA,Bi)=>{Bi.exports=Rp;function Rp(e){Object.keys(e.jobs).forEach(Np.bind(e)),e.jobs={}}o(Rp,"abort");function Np(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Np,"clean")});var Hr=$((cA,Vi)=>{var Zi=Zr(),Dp=Vr();Vi.exports=Cp;function Cp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Up(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Dp(r):r.results[i]=c,n(u,r.results))})}o(Cp,"iterate");function Up(e,t,r,n){var i;return e.length==2?i=e(r,Zi(n)):i=e(r,t,Zi(n)),i}o(Up,"runJob")});var Gr=$((lA,Hi)=>{Hi.exports=Mp;function Mp(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(Mp,"state")});var qr=$((mA,Gi)=>{var jp=Vr(),Lp=Zr();Gi.exports=Fp;function Fp(e){Object.keys(this.jobs).length&&(this.index=this.size,jp(this),Lp(e)(null,this.results))}o(Fp,"terminator")});var Wi=$((gA,qi)=>{var Bp=Hr(),Zp=Gr(),Vp=qr();qi.exports=Hp;function Hp(e,t,r){for(var n=Zp(e);n.index<(n.keyedList||e).length;)Bp(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Vp.bind(n,r)}o(Hp,"parallel")});var Wr=$((hA,Kt)=>{var Ki=Hr(),Gp=Gr(),qp=qr();Kt.exports=Wp;Kt.exports.ascending=Ji;Kt.exports.descending=Kp;function Wp(e,t,r,n){var i=Gp(e,r);return Ki(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){Ki(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),qp.bind(i,n)}o(Wp,"serialOrdered");function Ji(e,t){return e<t?-1:e>t?1:0}o(Ji,"ascending");function Kp(e,t){return-1*Ji(e,t)}o(Kp,"descending")});var Yi=$((xA,Xi)=>{var Jp=Wr();Xi.exports=Xp;function Xp(e,t,r){return Jp(e,t,null,r)}o(Xp,"serial")});var ea=$((PA,Qi)=>{Qi.exports={parallel:Wi(),serial:Yi(),serialOrdered:Wr()}});var Kr=$((bA,ta)=>{"use strict";ta.exports=Object});var na=$((IA,ra)=>{"use strict";ra.exports=Error});var ia=$((TA,oa)=>{"use strict";oa.exports=EvalError});var sa=$(($A,aa)=>{"use strict";aa.exports=RangeError});var ca=$((EA,ua)=>{"use strict";ua.exports=ReferenceError});var la=$((SA,pa)=>{"use strict";pa.exports=SyntaxError});var Jt=$((AA,da)=>{"use strict";da.exports=TypeError});var fa=$((zA,ma)=>{"use strict";ma.exports=URIError});var ya=$((kA,ga)=>{"use strict";ga.exports=Math.abs});var va=$((OA,ha)=>{"use strict";ha.exports=Math.floor});var _a=$((wA,xa)=>{"use strict";xa.exports=Math.max});var ba=$((RA,Pa)=>{"use strict";Pa.exports=Math.min});var Ta=$((NA,Ia)=>{"use strict";Ia.exports=Math.pow});var Ea=$((DA,$a)=>{"use strict";$a.exports=Math.round});var Aa=$((CA,Sa)=>{"use strict";Sa.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ka=$((MA,za)=>{"use strict";var Yp=Aa();za.exports=o(function(t){return Yp(t)||t===0?t:t<0?-1:1},"sign")});var wa=$((LA,Oa)=>{"use strict";Oa.exports=Object.getOwnPropertyDescriptor});var Jr=$((FA,Ra)=>{"use strict";var Xt=wa();if(Xt)try{Xt([],"length")}catch{Xt=null}Ra.exports=Xt});var Da=$((BA,Na)=>{"use strict";var Yt=Object.defineProperty||!1;if(Yt)try{Yt({},"a",{value:1})}catch{Yt=!1}Na.exports=Yt});var Xr=$((ZA,Ca)=>{"use strict";Ca.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var ja=$((HA,Ma)=>{"use strict";var Ua=typeof Symbol<"u"&&Symbol,Qp=Xr();Ma.exports=o(function(){return typeof Ua!="function"||typeof Symbol!="function"||typeof Ua("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Qp()},"hasNativeSymbols")});var Yr=$((qA,La)=>{"use strict";La.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Qr=$((WA,Fa)=>{"use strict";var el=Kr();Fa.exports=el.getPrototypeOf||null});var Va=$((KA,Za)=>{"use strict";var tl="Function.prototype.bind called on incompatible ",rl=Object.prototype.toString,nl=Math.max,ol="[object Function]",Ba=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),il=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),al=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Za.exports=o(function(t){var r=this;if(typeof r!="function"||rl.apply(r)!==ol)throw new TypeError(tl+r);for(var n=il(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,Ba(n,arguments));return Object(_)===_?_:this}return r.apply(t,Ba(n,arguments))},"binder"),c=nl(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+al(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var Ze=$((XA,Ha)=>{"use strict";var sl=Va();Ha.exports=Function.prototype.bind||sl});var Qt=$((YA,Ga)=>{"use strict";Ga.exports=Function.prototype.call});var en=$((QA,qa)=>{"use strict";qa.exports=Function.prototype.apply});var Ka=$((ez,Wa)=>{"use strict";Wa.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Xa=$((tz,Ja)=>{"use strict";var ul=Ze(),cl=en(),pl=Qt(),ll=Ka();Ja.exports=ll||ul.call(pl,cl)});var Qa=$((rz,Ya)=>{"use strict";var dl=Ze(),ml=Jt(),fl=Qt(),gl=Xa();Ya.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new ml("a function is required");return gl(dl,fl,t)},"callBindBasic")});var is=$((oz,os)=>{"use strict";var yl=Qa(),es=Jr(),rs;try{rs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var tn=!!rs&&es&&es(Object.prototype,"__proto__"),ns=Object,ts=ns.getPrototypeOf;os.exports=tn&&typeof tn.get=="function"?yl([tn.get]):typeof ts=="function"?o(function(t){return ts(t==null?t:ns(t))},"getDunder"):!1});var ps=$((az,cs)=>{"use strict";var as=Yr(),ss=Qr(),us=is();cs.exports=as?o(function(t){return as(t)},"getProto"):ss?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ss(t)},"getProto"):us?o(function(t){return us(t)},"getProto"):null});var rn=$((uz,ls)=>{"use strict";var hl=Function.prototype.call,vl=Object.prototype.hasOwnProperty,xl=Ze();ls.exports=xl.call(hl,vl)});var vs=$((cz,hs)=>{"use strict";var M,_l=Kr(),Pl=na(),bl=ia(),Il=sa(),Tl=ca(),qe=la(),Ge=Jt(),$l=fa(),El=ya(),Sl=va(),Al=_a(),zl=ba(),kl=Ta(),Ol=Ea(),wl=ka(),gs=Function,nn=o(function(e){try{return gs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),vt=Jr(),Rl=Da(),on=o(function(){throw new Ge},"throwTypeError"),Nl=vt?function(){try{return arguments.callee,on}catch{try{return vt(arguments,"callee").get}catch{return on}}}():on,Ve=ja()(),J=ps(),Dl=Qr(),Cl=Yr(),ys=en(),xt=Qt(),He={},Ul=typeof Uint8Array>"u"||!J?M:J(Uint8Array),Oe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ve&&J?J([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":He,"%AsyncGenerator%":He,"%AsyncGeneratorFunction%":He,"%AsyncIteratorPrototype%":He,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Pl,"%eval%":eval,"%EvalError%":bl,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":gs,"%GeneratorFunction%":He,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ve&&J?J(J([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ve||!J?M:J(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":_l,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":Il,"%ReferenceError%":Tl,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ve||!J?M:J(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ve&&J?J(""[Symbol.iterator]()):M,"%Symbol%":Ve?Symbol:M,"%SyntaxError%":qe,"%ThrowTypeError%":Nl,"%TypedArray%":Ul,"%TypeError%":Ge,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":$l,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":xt,"%Function.prototype.apply%":ys,"%Object.defineProperty%":Rl,"%Object.getPrototypeOf%":Dl,"%Math.abs%":El,"%Math.floor%":Sl,"%Math.max%":Al,"%Math.min%":zl,"%Math.pow%":kl,"%Math.round%":Ol,"%Math.sign%":wl,"%Reflect.getPrototypeOf%":Cl};if(J)try{null.error}catch(e){ds=J(J(e)),Oe["%Error.prototype%"]=ds}var ds,Ml=o(function e(t){var r;if(t==="%AsyncFunction%")r=nn("async function () {}");else if(t==="%GeneratorFunction%")r=nn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=nn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&J&&(r=J(i.prototype))}return Oe[t]=r,r},"doEval"),ms={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_t=Ze(),er=rn(),jl=_t.call(xt,Array.prototype.concat),Ll=_t.call(ys,Array.prototype.splice),fs=_t.call(xt,String.prototype.replace),tr=_t.call(xt,String.prototype.slice),Fl=_t.call(xt,RegExp.prototype.exec),Bl=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Zl=/\\(\\)?/g,Vl=o(function(t){var r=tr(t,0,1),n=tr(t,-1);if(r==="%"&&n!=="%")throw new qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new qe("invalid intrinsic syntax, expected opening `%`");var i=[];return fs(t,Bl,function(u,c,l,f){i[i.length]=l?fs(f,Zl,"$1"):c||u}),i},"stringToPath"),Hl=o(function(t,r){var n=t,i;if(er(ms,n)&&(i=ms[n],n="%"+i[0]+"%"),er(Oe,n)){var u=Oe[n];if(u===He&&(u=Ml(n)),typeof u>"u"&&!r)throw new Ge("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");hs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ge("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ge('"allowMissing" argument must be a boolean');if(Fl(/^%?[^%]*%?$/,t)===null)throw new qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Vl(t),i=n.length>0?n[0]:"",u=Hl("%"+i+"%",r),c=u.name,l=u.value,f=!1,g=u.alias;g&&(i=g[0],Ll(n,jl([0,1],g)));for(var _=1,E=!0;_<n.length;_+=1){var x=n[_],s=tr(x,0,1),d=tr(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new qe("property names with quotes must have matching quotes");if((x==="constructor"||!E)&&(f=!0),i+="."+x,c="%"+i+"%",er(Oe,c))l=Oe[c];else if(l!=null){if(!(x in l)){if(!r)throw new Ge("base intrinsic for "+t+" exists, but the property is not available.");return}if(vt&&_+1>=n.length){var y=vt(l,x);E=!!y,E&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[x]}else E=er(l,x),l=l[x];E&&!f&&(Oe[c]=l)}}return l},"GetIntrinsic")});var _s=$((lz,xs)=>{"use strict";var Gl=Xr();xs.exports=o(function(){return Gl()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Is=$((mz,bs)=>{"use strict";var ql=vs(),Ps=ql("%Object.defineProperty%",!0),Wl=_s()(),Kl=rn(),Jl=Jt(),rr=Wl?Symbol.toStringTag:null;bs.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new Jl("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");rr&&(n||!Kl(t,rr))&&(Ps?Ps(t,rr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[rr]=r)},"setToStringTag")});var $s=$((gz,Ts)=>{"use strict";var Xl=Function.prototype.call,Yl=Object.prototype.hasOwnProperty,Ql=Ze();Ts.exports=Ql.call(Xl,Yl)});var Ss=$((yz,Es)=>{"use strict";Es.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var ks=$((hz,zs)=>{"use strict";var cn=wi(),ed=require("util"),an=require("path"),td=require("http"),rd=require("https"),nd=require("url").parse,od=require("fs"),id=require("stream").Stream,ad=require("crypto"),sn=Ui(),sd=ea(),ud=Is(),$e=$s(),un=Ss();function As(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(As,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");ed.inherits(L,cn);L.LINE_BREAK=`\r
2
+ `;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=cn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&$e(t,"httpVersion"))&&!(t instanceof id))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){$e(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):od.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):$e(e,"httpVersion")?t(null,Number(e.headers["content-length"])):$e(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+As(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&un(c,r.header);var l;for(var f in c)if($e(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=an.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=an.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&$e(e,"httpVersion")&&(r=an.basename(e.client._httpMessage.path||"")),r)return'filename="'+As(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=sn.lookup(e.name)),!r&&e&&e.path&&(r=sn.lookup(e.path)),!r&&e&&e.readable&&$e(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=sn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)$e(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+ad.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}sd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=nd(e),n=un({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=un(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=rd.request(n):r=td.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=o(function(g,_){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,g,_)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};ud(L.prototype,"FormData");zs.exports=L});var xd={};mn(xd,{gorgias:()=>vd});module.exports=Ws(xd);var Ks=Object.freeze({status:"aborted"});function I(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let g=c.prototype,_=Object.keys(g);for(let E=0;E<_.length;E++){let x=_[E];x in l||(l[x]=g[x].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var f;let g=r?.Parent?new u:this;n(g,l),(f=g._zod).deferred??(f.deferred=[]);for(let _ of g._zod.deferred)_();return g}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(I,"$constructor");var Js=Symbol("zod_brand"),ce=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},It=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ir={};function de(e){return e&&Object.assign(ir,e),ir}o(de,"config");function sr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(sr,"getEnumValues");function yn(e,t){return typeof t=="bigint"?t.toString():t}o(yn,"jsonStringifyReplacer");function $t(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o($t,"cached");function hn(e){return e==null}o(hn,"nullish");function Et(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Et,"cleanRegex");var gn=Symbol("evaluating");function W(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==gn)return n===void 0&&(n=gn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(W,"defineLazy");var ur="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Xe,"isObject");var Xs=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function vn(e){if(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(vn,"isPlainObject");var xn=new Set(["string","number","symbol"]);function Re(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Re,"escapeRegex");function St(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(St,"clone");function V(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(V,"normalizeParams");function _n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(_n,"optionalKeys");var Ys={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 Ne(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Ne,"aborted");function xe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(xe,"prefixIssues");function Tt(e){return typeof e=="string"?e:e?.message}o(Tt,"unwrapMessage");function _e(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Tt(e.inst?._zod.def?.error?.(e))??Tt(t?.error?.(e))??Tt(r.customError?.(e))??Tt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(_e,"finalizeIssue");function Pn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Pn,"getLengthableOrigin");function cr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(cr,"issue");var bn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,yn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),In=I("$ZodError",bn),Ye=I("$ZodError",bn,{Parent:Error});var eu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new ce;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>_e(f,u,de())));throw ur(l,i?.callee),l}return c.value},"_parse"),At=eu(Ye),tu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>_e(f,u,de())));throw ur(l,i?.callee),l}return c.value},"_parseAsync"),zt=tu(Ye),ru=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new ce;return u.issues.length?{success:!1,error:new(e??In)(u.issues.map(c=>_e(c,i,de())))}:{success:!0,data:u.value}},"_safeParse"),Qe=ru(Ye),nu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>_e(c,i,de())))}:{success:!0,data:u.value}},"_safeParseAsync"),et=nu(Ye);var ou="(?:(?:\\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])))",iu=new RegExp(`^${ou}$`);var Tn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),$n=/^-?\d+n?$/;var pr=/^-?\d+(?:\.\d+)?$/,En=/^(?:true|false)$/i;var De=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Sn=I("$ZodCheckMinLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!hn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=Pn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var lr=I("$ZodCheckStringFormat",(e,t)=>{var r,n;De.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),An=I("$ZodCheckRegex",(e,t)=>{lr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var kn={major:4,minor:3,patch:6};var H=I("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=kn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,f)=>{let g=Ne(c),_;for(let E of l){if(E._zod.def.when){if(!E._zod.def.when(c))continue}else if(g)continue;let x=c.issues.length,s=E._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new ce;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(g||(g=Ne(c,x)))});else{if(c.issues.length===x)continue;g||(g=Ne(c,x))}}return _?_.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(Ne(c))return c.aborted=!0,c;let g=i(l,n,f);if(g instanceof Promise){if(f.async===!1)throw new ce;return g.then(_=>e._zod.parse(_,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return g instanceof Promise?g.then(_=>u(_,c,l)):u(g,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new ce;return f.then(g=>i(g,n,l))}return i(f,n,l)}}W(e,"~standard",()=>({validate:o(i=>{try{let u=Qe(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return et(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),wt=I("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Tn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),dr=I("$ZodStringFormat",(e,t)=>{lr.init(e,t),wt.init(e,t)});var Dn=I("$ZodURL",(e,t)=>{dr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Cn=I("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??pr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}});var mr=I("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=En,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Un=I("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=$n,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 Mn=I("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),jn=I("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Ln=I("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Fn=I("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function On(e,t,r){e.issues.length&&t.issues.push(...xe(r,e.issues)),t.value[r]=e.value}o(On,"handleArrayResult");var Bn=I("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(g=>On(g,r,c))):On(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Ot(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...xe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Ot,"handlePropertyResult");function au(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=_n(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(au,"normalizeDef");function su(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,g=f.def.type,_=f.optout==="optional";for(let E in t){if(l.has(E))continue;if(g==="never"){c.push(E);continue}let x=f.run({value:t[E],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Ot(s,r,E,t,_))):Ot(x,r,E,t,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(su,"handleCatchall");var Zn=I("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=$t(()=>au(t));W(e._zod,"propValues",()=>{let l=t.shape,f={};for(let g in l){let _=l[g]._zod;if(_.values){f[g]??(f[g]=new Set);for(let E of _.values)f[g].add(E)}}return f});let i=Xe,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let g=l.value;if(!i(g))return l.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),l;l.value={};let _=[],E=c.shape;for(let x of c.keys){let s=E[x],d=s._zod.optout==="optional",y=s._zod.run({value:g[x],issues:[]},f);y instanceof Promise?_.push(y.then(m=>Ot(m,l,x,g,d))):Ot(y,l,x,g,d)}return u?su(_,g,l,f,n.value,e):_.length?Promise.all(_).then(()=>l):l}});function wn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Ne(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>_e(c,n,de())))}),t)}o(wn,"handleUnionResults");var fr=I("$ZodUnion",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Et(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let f of t.options){let g=f._zod.run({value:i.value,issues:[]},u);if(g instanceof Promise)l.push(g),c=!0;else{if(g.issues.length===0)return g;l.push(g)}}return c?Promise.all(l).then(f=>wn(f,i,e,u)):wn(l,i,e,u)}});var Vn=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,fr.init(e,t);let r=e._zod.parse;W(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let g of f)i[l].add(g)}}return i});let n=$t(()=>{let i=t.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of l){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Xe(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var Hn=I("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!vn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){l.add(typeof g=="number"?g.toString():g);let _=t.valueType._zod.run({value:i[g],issues:[]},n);_ instanceof Promise?u.push(_.then(E=>{E.issues.length&&r.issues.push(...xe(g,E.issues)),r.value[g]=E.value})):(_.issues.length&&r.issues.push(...xe(g,_.issues)),r.value[g]=_.value)}let f;for(let g in i)l.has(g)||(f=f??[],f.push(g));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&pr.test(l)&&f.issues.length){let E=t.keyType._zod.run({value:Number(l),issues:[]},n);if(E instanceof Promise)throw new Error("Async schemas not supported in object keys currently");E.issues.length===0&&(f=E)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(E=>_e(E,n,de())),input:l,path:[l],inst:e});continue}let _=t.valueType._zod.run({value:i[l],issues:[]},n);_ instanceof Promise?u.push(_.then(E=>{E.issues.length&&r.issues.push(...xe(l,E.issues)),r.value[f.value]=E.value})):(_.issues.length&&r.issues.push(...xe(l,_.issues)),r.value[f.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Gn=I("$ZodEnum",(e,t)=>{H.init(e,t);let r=sr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>xn.has(typeof i)).map(i=>typeof i=="string"?Re(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),qn=I("$ZodLiteral",(e,t)=>{if(H.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"?Re(n):n?Re(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Wn=I("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new It(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new ce;return r.value=i,r}});function Rn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Rn,"handleOptionalResult");var Kn=I("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Rn(u,r.value)):Rn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Jn=I("$ZodNullable",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)}|null)$`):void 0}),W(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 Xn=I("$ZodPipe",(e,t)=>{H.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>kt(c,t.in,n)):kt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>kt(u,t.out,n)):kt(i,t.out,n)}});function kt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(kt,"handlePipeResult");var Yn=I("$ZodCustom",(e,t)=>{De.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Nn(u,r,n,e));Nn(i,r,n,e)}});function Nn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(cr(i))}}o(Nn,"handleRefineResult");var eo,lu=Symbol("ZodOutput"),du=Symbol("ZodInput"),gr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function to(){return new gr}o(to,"registry");(eo=globalThis).__zod_globalRegistry??(eo.__zod_globalRegistry=to());var yr=globalThis.__zod_globalRegistry;function ro(e,t){return new e({type:"string",...V(t)})}o(ro,"_string");function no(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(no,"_coercedString");function oo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(oo,"_url");function io(e,t){return new e({type:"number",checks:[],...V(t)})}o(io,"_number");function ao(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(ao,"_coercedNumber");function so(e,t){return new e({type:"boolean",...V(t)})}o(so,"_boolean");function uo(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(uo,"_coercedBoolean");function co(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(co,"_coercedBigint");function po(e){return new e({type:"any"})}o(po,"_any");function lo(e){return new e({type:"unknown"})}o(lo,"_unknown");function mo(e,t){return new e({type:"void",...V(t)})}o(mo,"_void");function fo(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(fo,"_coercedDate");function se(e,t){return new Sn({check:"min_length",...V(t),minimum:e})}o(se,"_minLength");function Pe(e,t){return new An({check:"string_format",format:"regex",...V(t),pattern:e})}o(Pe,"_regex");function go(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(go,"_custom");var K=I("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>At(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Qe(e,r,n),e.parseAsync=async(r,n)=>zt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>et(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>St(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Nt=I("ZodMiniString",(e,t)=>{wt.init(e,t),K.init(e,t)});function a(e){return ro(Nt,e)}o(a,"string");var yo=I("ZodMiniStringFormat",(e,t)=>{dr.init(e,t),Nt.init(e,t)});var bu=I("ZodMiniURL",(e,t)=>{Dn.init(e,t),yo.init(e,t)});function ho(e){return oo(bu,e)}o(ho,"url");var hr=I("ZodMiniNumber",(e,t)=>{Cn.init(e,t),K.init(e,t)});function X(e){return io(hr,e)}o(X,"number");var vr=I("ZodMiniBoolean",(e,t)=>{mr.init(e,t),K.init(e,t)});function B(e){return so(vr,e)}o(B,"boolean");var vo=I("ZodMiniBigInt",(e,t)=>{Un.init(e,t),K.init(e,t)});var Iu=I("ZodMiniAny",(e,t)=>{Mn.init(e,t),K.init(e,t)});function rt(){return po(Iu)}o(rt,"any");var Tu=I("ZodMiniUnknown",(e,t)=>{jn.init(e,t),K.init(e,t)});function O(){return lo(Tu)}o(O,"unknown");var $u=I("ZodMiniVoid",(e,t)=>{Ln.init(e,t),K.init(e,t)});function xo(e){return mo($u,e)}o(xo,"_void");var _o=I("ZodMiniDate",(e,t)=>{Fn.init(e,t),K.init(e,t)});var Eu=I("ZodMiniArray",(e,t)=>{Bn.init(e,t),K.init(e,t)});function N(e,t){return new Eu({type:"array",element:e,...V(t)})}o(N,"array");var Su=I("ZodMiniObject",(e,t)=>{Zn.init(e,t),K.init(e,t),W(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...V(t)};return new Su(r)}o(p,"object");var Au=I("ZodMiniUnion",(e,t)=>{fr.init(e,t),K.init(e,t)});function D(e,t){return new Au({type:"union",options:e,...V(t)})}o(D,"union");var zu=I("ZodMiniDiscriminatedUnion",(e,t)=>{Vn.init(e,t),K.init(e,t)});function Ce(e,t,r){return new zu({type:"union",options:t,discriminator:e,...V(r)})}o(Ce,"discriminatedUnion");var ku=I("ZodMiniRecord",(e,t)=>{Hn.init(e,t),K.init(e,t)});function w(e,t,r){return new ku({type:"record",keyType:e,valueType:t,...V(r)})}o(w,"record");var Ou=I("ZodMiniEnum",(e,t)=>{Gn.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ou({type:"enum",entries:r,...V(t)})}o(U,"_enum");var wu=I("ZodMiniLiteral",(e,t)=>{qn.init(e,t),K.init(e,t)});function S(e,t){return new wu({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o(S,"literal");var Ru=I("ZodMiniTransform",(e,t)=>{Wn.init(e,t),K.init(e,t)});function be(e){return new Ru({type:"transform",transform:e})}o(be,"transform");var Nu=I("ZodMiniOptional",(e,t)=>{Kn.init(e,t),K.init(e,t)});function h(e){return new Nu({type:"optional",innerType:e})}o(h,"optional");var Du=I("ZodMiniNullable",(e,t)=>{Jn.init(e,t),K.init(e,t)});function nt(e){return new Du({type:"nullable",innerType:e})}o(nt,"nullable");var Cu=I("ZodMiniPipe",(e,t)=>{Xn.init(e,t),K.init(e,t)});function Ie(e,t){return new Cu({type:"pipe",in:e,out:t})}o(Ie,"pipe");var Uu=I("ZodMiniCustom",(e,t)=>{Yn.init(e,t),K.init(e,t)});function Dt(e,t){return go(Uu,e??(()=>!0),t)}o(Dt,"custom");var ot={};mn(ot,{bigint:()=>Vu,boolean:()=>Zu,date:()=>Hu,number:()=>Bu,string:()=>Fu});function Fu(e){return no(Nt,e)}o(Fu,"string");function Bu(e){return ao(hr,e)}o(Bu,"number");function Zu(e){return uo(vr,e)}o(Zu,"boolean");function Vu(e){return co(vo,e)}o(Vu,"bigint");function Hu(e){return fo(_o,e)}o(Hu,"date");var _r=p({retryOnFailure:p({defaultValue:h(B()),hide:h(B())}),continueOnFailure:p({defaultValue:h(B()),hide:h(B())})}),xr=class{constructor(t,r,n,i,u,c,l,f,g,_,E){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=_;this.aiMetadata=E}static{o(this,"IAction")}},Q=o(e=>new xr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=p({displayName:a(),description:h(a())}),C=o((e,t)=>p({type:S(t),required:B(),defaultValue:h(rt())}),"TPropertyValue");var re=p({...F.shape,...C(a(),"SHORT_TEXT").shape}),me=p({...F.shape,...C(a(),"LONG_TEXT").shape});var bo=p({label:a(),value:O()}),Ct=p({disabled:h(B()),placeholder:h(a()),options:N(bo)});var ne=p({...F.shape,options:Ct,...C(O(),"STATIC_DROPDOWN").shape}),fe=p({...F.shape,options:Ct,...C(N(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Pr=p({...F.shape,...C(O(),"DROPDOWN").shape,refreshers:N(a())}),it=p({...F.shape,...C(N(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ge=p({...F.shape,...C(B(),"CHECKBOX").shape});var ye=p({...F.shape,...C(X(),"NUMBER").shape});var at=p({...F.shape,...C(O(),"FILE").shape});var st=p({...F.shape,...C(a(),"DATE_TIME").shape});var Io=w(a(),D([re,me,ne,it,fe,ge,ye,at,st])),ut=p({...F.shape,properties:Io,...C(N(O()),"ARRAY").shape});var ct=p({...F.shape,...C(D([w(a(),O())]),"JSON").shape});var To=D([re,ne,ct,ut,fe]),qu=w(a(),To),br=p({refreshers:N(a()),...F.shape,...C(O(),"DYNAMIC").shape});var Ut=p({...F.shape,...C(xo(),"MARKDOWN").shape});var pt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(pt||{}),Ue=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ue||{}),Me=(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))(Me||{});var lt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(lt||{}),Ir="both_client_credentials_and_authorization_code";var Se=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Se||{}),dt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(dt||{}),Wu=p({strategy:U(dt),paramName:h(a())}),mt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(mt||{});var Mt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Mt||{}),$o=p({status:h(X()),body:h(O()),headers:h(w(a(),a()))}),Eo=p({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(U(Mt))}),So=p({type:S("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:$o,handlerId:h(a()),streamStepProgress:h(U(Mt))}),Ku=D([Eo,So]);var Ju=p({body:O(),rawBody:h(O()),headers:w(a(),a()),queryParams:w(a(),a())});function he(e){return e==null}o(he,"isNil");function ft(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ft,"isEmpty");function jt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(jt,"assertNotNullOrUndefined");var Tr=we(require("crypto"),1);var Xu=128,Ae,je,Yu=o(e=>{!Ae||Ae.length<e?(Ae=Buffer.allocUnsafe(e*Xu),Tr.default.randomFillSync(Ae),je=0):je+e>Ae.length&&(Tr.default.randomFillSync(Ae),je=0),je+=e},"fillPool"),Qu=o(e=>(Yu(e|=0),Ae.subarray(je-e,je)),"random"),ec=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===u)return c}}},"customRandom"),zo=o((e,t=21)=>ec(e,t,Qu),"customAlphabet");var tc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ko=21,rb=a().check(Pe(new RegExp(`^[0-9a-zA-Z]{${ko}}$`))),rc=zo(tc,ko);var Te=Ie(be(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:Te,updated:Te},Z=o(e=>h(nt(e)),"Nullable");function $r(e){return h(nt(U(e)))}o($r,"NullableEnum");var ib=Ie(be(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(B())),Lt=o(e=>Ie(be(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(N(e))),"OptionalArrayFromQuery");var ub=w(a(),O());var gt=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(gt||{});var _b=a().check(Pe(/^#[0-9A-Fa-f]{6}$/));var bb=p({filename:a(),data:O(),type:S("file"),mimetype:h(a())});var nc=we(wo());var zb=p({...ie,name:a(),permissions:N(a()),platformId:Z(a()),type:a(),userCount:h(X())});var Ro=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ro||{}),Er=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Er||{}),Sr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Sr||{});var Ar=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Ar||{});var zr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(zr||{});var oc=p({mode:U(Ro),value:O()}),ic=p({auth:h(a()),fields:w(a(),oc)}),ac=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(ic)}),sc=p({type:S("PIECE"),toolName:a().check(se(1)),pieceMetadata:ac}),uc=p({type:S("none")}),cc=p({type:S("access_token"),accessToken:a()}),pc=p({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),lc=p({type:S("headers"),headers:w(a(),a())}),dc=Ce("type",[uc,cc,pc,lc]),No=p({type:S("FLOW"),toolName:a().check(se(1)),externalFlowId:a(),flowDisplayName:h(a())}),Do=p({type:S("MCP"),toolName:a().check(se(1)),serverUrl:ho(),protocol:U(Sr),auth:dc}),Co=p({type:S("KNOWLEDGE_BASE"),toolName:a().check(se(1)),sourceType:U(Er),sourceId:a(),sourceName:a()}),mc=Ce("type",[sc,No,Do,Co]),fc=p({displayName:a(),description:h(a()),type:U(Ar)}),Uo=p({type:S("MARKDOWN"),markdown:a()}),Le={type:S("TOOL_CALL"),input:Z(w(a(),O())),output:h(O()),toolName:a(),status:U(zr),toolCallId:a(),startTime:a(),endTime:h(a())},rI=p(Le),Mo=Ce("toolCallType",[p({...Le,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Le,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),p({...Le,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),p({...Le,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Le,toolCallType:S("UNKNOWN"),displayName:a()})]),gc=D([Uo,Mo]);var kr=(r=>(r.IMAGE="image",r.TEXT="text",r))(kr||{}),ve=p({apiKey:a()}),yc=ve,hc=p({apiKey:a(),apiKeyHash:a()}),vc=ve,xc=ve,_c=ve,Pc=ve,bc=ve,Ic=ve,Tc=ve,jo=p({accessKeyId:a().check(se(1)),secretAccessKey:a().check(se(1))}),$c=p({}),Ec=p({}),Sc=p({}),Ac=p({}),zc=p({}),kc=p({}),Lo=p({modelId:a(),modelName:a(),modelType:U(kr)}),Fo=p({apiKeyHeader:a(),baseUrl:a(),models:N(Lo),defaultHeaders:h(w(a(),a()))}),Bo=p({accountId:a(),gatewayId:a(),models:N(Lo),vertexProject:h(a()),vertexRegion:h(a())}),Zo=p({resourceName:a(),apiVersion:Ie(be(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),Vo=p({region:a().check(se(1))}),Oc=D([yc,_c,Pc,bc,Ic,xc,vc,hc,jo,Tc]),Ho=D([Fo,Bo,Zo,Vo,$c,Sc,Ac,zc,Ec,kc]),wc=p({id:a(),name:a(),type:U(kr)}),Rc=p({id:a(),name:a(),provider:U(gt),config:Ho,enabledForChat:B()}),Nc=p({provider:U(gt),config:Ho,auth:Oc,platformId:a()});var aI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Dc=p({base64Url:a(),fileName:a(),extension:h(a())}),Cc=p({mimeType:a(),url:a(),fileName:h(a())}),Or=D([Dc,Cc]);var Uc=D([p({type:S("file"),value:Or}),p({type:S("markdown"),value:a(),files:h(N(Or))})]),Mc=p({sessionId:a(),message:a(),files:h(N(a()))});var qo=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(qo||{}),Wo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Wo||{}),wr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(wr||{});var jc=D([p({...ie,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...ie,name:a(),externalId:a(),type:D([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),Lc=p({...ie,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:$r(Wo),trigger:$r(qo)}),Fc=p({...ie,tableId:a(),projectId:a(),cells:w(a(),p({updated:a(),created:a(),value:O(),fieldName:a()}))}),Bc=p({events:N(U(wr)),webhookUrl:a(),flowId:a()}),Zc=p({fields:N(p({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),Vc=p({projectId:a(),limit:h(ot.number()),cursor:h(a()),name:h(a()),externalIds:Lt(a()),folderId:h(a()),folderIds:Lt(a())}),Hc=p({records:N(N(p({fieldId:a(),value:Jo()}))),tableId:a()}),Gc=p({cells:h(N(p({fieldId:a(),value:Jo()}))),tableId:a(),agentUpdate:h(B())}),Ko=Ce("operator",[ze("eq"),ze("neq"),ze("gt"),ze("gte"),ze("lt"),ze("lte"),ze("co"),Go("exists"),Go("not_exists")]),qc=p({tableId:a(),limit:h(ot.number()),cursor:h(a()),filters:Lt(Ko)});function Jo(){return Ie(be(e=>e==null?e:String(e)),nt(a()))}o(Jo,"coerceToString");function ze(e){return p({fieldId:a(),operator:S(e),value:a()})}o(ze,"valueFilter");function Go(e){return p({fieldId:a(),operator:S(e)})}o(Go,"existenceFilter");var Wc=p({status:h(X()),body:h(O()),headers:h(w(a(),a()))}),Kc=p({...ie,deleted:Z(Te),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var Xo=p({name:a(),description:h(a()),type:a(),required:B()}),Jc=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(Xo),returnsResponse:B()})});var Yo="^[0-9]+\\.[0-9]+\\.[0-9]+$",$I=new RegExp(Yo),Yc="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",EI=a().check(Pe(new RegExp(Yo))),SI=a().check(Pe(new RegExp(Yc))),Qc=p({packageType:S("ARCHIVE"),pieceType:U(Ue),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Qo=p({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ei=p({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),AI=D([Qo,ei]),zI=D([Qc,Qo,ei]),ti=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ti||{}),ep=p({type:U(ti),cronExpression:a(),timezone:a()}),kI=p({...ie,type:U(Se),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(ep),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),ri=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(ri||{}),ni=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ni||{}),oi=(r=>(r.S3="S3",r.DB="DB",r))(oi||{}),OI=p({...ie,projectId:Z(a()),platformId:Z(a()),type:U(ri),compression:U(ni),data:h(O()),location:U(oi),size:Z(X()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(w(a(),a()))}),ii=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(ii||{}),ai=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ai||{}),wI=p({id:a(),email:a(),firstName:a(),status:U(ai),externalId:Z(a()),platformId:Z(a()),platformRole:U(ii),lastName:a(),created:Te,updated:Te,lastActiveDate:Z(Te),imageUrl:Z(a())});var Rr=p({...F.shape,...C(w(a(),O()),"OBJECT").shape});var pi=p({...F.shape,...C(a(),"COLOR").shape});var Nr=D([re,me,Ut,ge,ne,fe,Pr,it,br,ye,ut,Rr,ct,st,at,pi]),b={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},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 pe=p({displayName:a(),description:h(a())});var li=p({username:a(),password:a()}),Dr=p({...pe.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...C(li,"BASIC_AUTH").shape});var op=w(a(),D([re,me,ye,ge,ne])),Cr=p({...pe.shape,props:op,...C(O(),"CUSTOM_AUTH").shape});var ke=p({...pe.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var ip=w(a(),D([re,me,ke,ye,ge,ne,fe,Ut])),di=p({...pe.shape,props:ip,...C(O(),"OIDC").shape});var Ur=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Ur||{}),mi=D([re,ke,ne]),fi=w(a(),mi),ap=p({props:h(w(a(),mi)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:h(D([S("none"),S("consent"),S("login"),S("omit")])),pkce:h(B()),pkceMethod:h(D([S("plain"),S("S256")])),authorizationMethod:h(U(Ur)),grantType:h(D([U(lt),S(Ir)])),extra:h(w(a(),a()))}),gi=p({access_token:a(),props:h(fi),data:w(a(),rt())}),Mr=p({...pe.shape,...ap.shape,...C(gi,"OAUTH2").shape});var Fe=D([Dr,Cr,di,Mr,ke]),yt="Connection",Bt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||yt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||yt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||yt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||yt}},None(){}};var p$={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 sp=p({...F.shape,...C(O(),"CUSTOM").shape,code:a()});var up=D([Nr,Fe]),jr=w(a(),up),k$=w(a(),Nr);var yi=D([p({strategy:S("CRON"),cronExpression:a()}),p({strategy:S("NONE")})]);var hi="2",Zt="0.82.0";var Lr=class{constructor(t,r,n,i,u,c,l,f,g=Zt,_,E=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=_;this.description=E;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:hi}),"getContextInfo");(!cp(g)||pp(g,Zt))&&(this.minimumSupportedRelease=Zt),u.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},vi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Lr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function cp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(cp,"isValidSimpleSemver");function pp(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(pp,"isSemverLessThan");var lp=h(w(a(),w(a(),a()))),xi=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:h(a()),directoryPath:h(a()),auth:h(D([Fe,N(Fe)])),version:a(),categories:h(N(U(Me))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),i18n:lp}),dp=U(["human","ai","both"]),_i=p({description:h(a()),idempotent:h(B())}),Pi=p({name:a(),displayName:a(),description:a(),props:jr,requireAuth:B(),errorHandlingOptions:h(_r),outputSchema:h(Dt()),audience:h(dp),aiMetadata:h(_i)}),bi=p({name:a(),displayName:a(),description:a(),props:jr,errorHandlingOptions:h(_r),type:U(Se),sampleData:O(),handshakeConfiguration:h(Dt()),renewConfiguration:h(yi),testStrategy:U(mt),outputSchema:h(Dt()),aiMetadata:h(_i)}),mp=p({...xi.shape,actions:w(a(),Pi),triggers:w(a(),bi)}),fp=p({...xi.shape,actions:X(),triggers:X(),suggestedActions:h(N(bi)),suggestedTriggers:h(N(Pi))}),Ii=p({projectUsage:X(),tags:h(N(a())),pieceType:U(Ue),packageType:U(pt),platformId:h(a()),archiveId:h(a())}),kE=p({...mp.shape,...Ii.shape}),OE=p({...fp.shape,...Ii.shape}),wE=p({name:a(),version:a()});var gp=we(require("path")),yp=we(require("fs/promises"));var Vt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};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 Ht=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Fr,r=new Br){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Fr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Br=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Gt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var qt=class extends Vt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Ht){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[j,te]of Object.entries(c))i.append(j,te);let l=i.toString(),f=l?`${n}?${l}`:n,g=t.responseType??"json",_=t.followRedirects??!0,E=t.retries??0,{body:x,extraHeaders:s,isStream:d}=hp(t.body,u),y=xp({...u,...s}),m=await vp(async()=>{let j=new AbortController,te=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let ae={method:t.method.toString(),headers:y,body:x,redirect:_?"follow":"manual",signal:j.signal};return d&&(ae.duplex="half"),r?.dispatcher!==void 0&&(ae.dispatcher=r.dispatcher),await fetch(f,ae)}finally{te!==void 0&&clearTimeout(te)}},E),v=_?300:400;if(m.status<200||m.status>=v){let j=await Ti(m,g),te=new Gt(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",te),te}let P=await Ti(m,g);return{status:m.status,headers:_p(m.headers),body:P}}};function hp(e,t){return bp(e)?{body:void 0,extraHeaders:{},isStream:!1}:Pp(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(hp,"serializeBody");async function Ti(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Ti,"parseResponseBody");async function vp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await $i(n);continue}return i}catch(i){if(r=i,n<t){await $i(n);continue}throw i}throw r}o(vp,"sendWithRetries");function $i(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o($i,"backoff");function xp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(xp,"normalizeHeaders");function _p(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(_p,"toHttpHeaders");function Pp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(Pp,"isNodeFormData");function bp(e){return e==null}o(bp,"isNil");var Be=new qt;var ht=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(ht||{});var cd=we(require("fs")),Os=we(ks());var pd={"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 ld(e){let t=e.split(";")[0].trim().toLowerCase();return pd[t]??""}o(ld,"contentTypeToExtension");var dd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),md=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function ws({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return Q({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:b.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:b.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${md(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:b.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(ht).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:b.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:b.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:b.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:b.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:g})=>{if(!g)return{};let _=g,E={};switch(_){case"none":break;case"json":E.data=b.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":E.data=b.LongText({displayName:"Raw Body",required:!0});break;case"form_data":E.data=b.Array({displayName:"Form Data",required:!0,properties:{fieldName:b.ShortText({displayName:"Field Name",required:!0}),fieldType:b.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:b.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:b.File({displayName:"File Field Value",required:!1})}});break}return E},"props")}),response_is_binary:b.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:b.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:b.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:b.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async g=>{let{method:_,url:E,headers:x,queryParams:s,body:d,body_type:y,failsafe:m,timeout:v,response_is_binary:P,followRedirects:j}=g.propsValue;jt(_,"Method"),jt(E,"URL");let te=he(r)?{}:await r(g.auth,g.propsValue),ae=E.url,Ke=ae.startsWith("http://")||ae.startsWith("https://")?ae:dd({baseUrl:t(g.auth),relativePath:ae}),Ee={method:_,url:Ke,headers:{...x??{},...f==="headers"||!he(f)?te:{}},queryParams:{...f==="queryParams"?te:{},...s??{}},timeout:v?v*1e3:0,followRedirects:j};if(P&&(Ee.responseType="arraybuffer"),d)if(y&&y!=="none"){let le=d.data;if(y==="form_data"){let Bs=le,bt=new Os.default;for(let{fieldName:pn,fieldType:ln,textFieldValue:dn,fileFieldValue:or}of Bs)ln==="text"&&!ft(dn)?bt.append(pn,dn):ln==="file"&&!ft(or)&&bt.append(pn,or.data,{filename:or?.filename});Ee.body=bt,Ee.headers={...Ee.headers,...bt.getHeaders()}}else Ee.body=le}else y||(Ee.body=d);try{let le=await Be.sendRequest(Ee);return await fd(g.files,le.body,le.status,le.headers,P)}catch(le){if(m)return le.errorMessage();throw le}},"run")})}o(ws,"createCustomApiCallAction");var fd=o(async(e,t,r,n,i)=>{let u;if(i&&gd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=ld(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),gd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Fs=require("buffer");function hd(e){return e.trim().replace(/^https?:\/\//,"").replace(/\.gorgias\.com.*$/i,"").replace(/^www\./,"").replace(/\/$/,"")}o(hd,"normalizeGorgiasDomain");function Pt(e){return`https://${hd(e)}.gorgias.com/api`}o(Pt,"getGorgiasBaseUrl");var Y=Bt.CustomAuth({displayName:"Gorgias",required:!0,description:"To connect your Gorgias account:\n\n1. Copy your helpdesk subdomain (for example, `acme` from `https://acme.gorgias.com`).\n2. In Gorgias, create or copy an API key.\n3. Use the email address associated with that API key.\n\nAuthentication uses HTTP Basic auth with `email:api_key`.",props:{domain:b.ShortText({displayName:"Helpdesk Domain",description:"Your Gorgias subdomain only, for example `acme` from https://acme.gorgias.com.",required:!0}),email:b.ShortText({displayName:"Email Address",description:"The email address associated with your Gorgias API key.",required:!0}),api_key:Bt.SecretText({displayName:"API Key",description:"Your Gorgias API key.",required:!0})},validate:o(async({auth:e})=>{try{return await Be.sendRequest({method:"GET",url:`${Pt(e.domain)}/tickets`,authentication:{type:"BASIC",username:e.email,password:e.api_key},queryParams:{limit:"1"}}),{valid:!0}}catch(t){let r=t;return r?.response?.status===401||r?.response?.status===403?{valid:!1,error:"Invalid domain, email, or API key."}:{valid:!1,error:"Could not reach the Gorgias API. Check your domain and network."}}},"validate")});async function oe({auth:e,method:t,resourceUri:r,query:n,body:i}){let u={};if(n)for(let[f,g]of Object.entries(n))g!=null&&g!==""&&(u[f]=String(g));let c={method:t,url:`${Pt(e.props.domain)}${r}`,authentication:{type:"BASIC",username:e.props.email,password:e.props.api_key},headers:{Accept:"application/json","Content-Type":"application/json"},queryParams:u,body:i};return(await Be.sendRequest(c)).body}o(oe,"gorgiasApiCall");async function Rs(e,t){let r=t.trim().toLowerCase();return(await oe({auth:e,method:"GET",resourceUri:"/customers",query:{email:r,limit:100}})).data.find(i=>{let u=typeof i.email=="string"?i.email.toLowerCase():void 0,c=Array.isArray(i.channels)?i.channels.some(l=>l.address?.toLowerCase()===r):!1;return u===r||c})??null}o(Rs,"findCustomerByEmail");var We={options:[{label:"Email",value:"email"},{label:"SMS",value:"sms"},{label:"Chat",value:"chat"},{label:"Facebook",value:"facebook"},{label:"Instagram",value:"instagram"},{label:"Internal Note",value:"internal-note"},{label:"Phone",value:"phone"}]},nr={options:[{label:"Help Center",value:"help-center"},{label:"API",value:"api"},{label:"Rule",value:"rule"},{label:"Manual",value:"manual"}]},Ns={options:[{label:"Open",value:"open"},{label:"Closed",value:"closed"}]};var Ds=Q({auth:Y,name:"create_gorgias_ticket",displayName:"Create Ticket",description:"Create a new Gorgias ticket with an initial message.",audience:"both",aiMetadata:{description:"Open a new support ticket in Gorgias seeded with one initial message, specifying the sender (from) and recipient (to) addresses, subject, body, and the channel/via the message came through. Use to start a fresh conversation rather than reply to an existing thread; to add a follow-up message to a ticket that already exists, use Create Message instead. Not idempotent: each call creates a separate ticket.",idempotent:!1},props:{fromAddress:b.ShortText({displayName:"From Address",description:"The sender address for the initial message, typically the customer email.",required:!0}),toAddress:b.ShortText({displayName:"To Address",description:"The recipient address for the initial message.",required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),message:b.LongText({displayName:"Message",description:"Initial ticket message. HTML is accepted by the API.",required:!0}),channel:b.StaticDropdown({displayName:"Channel",required:!0,options:We,defaultValue:"email"}),via:b.StaticDropdown({displayName:"Via",description:"How the message reached Gorgias.",required:!0,options:nr,defaultValue:"api"})},async run(e){let{fromAddress:t,toAddress:r,subject:n,message:i,channel:u,via:c}=e.propsValue;return await oe({auth:e.auth,method:"POST",resourceUri:"/tickets",body:{messages:[{from_agent:!1,subject:n,body_html:i,channel:u,via:c,source:{from:{address:t},to:[{address:r}]}}]}})}});var Cs=Q({auth:Y,name:"get_gorgias_ticket",displayName:"Get Ticket",description:"Retrieve a Gorgias ticket by ID.",audience:"both",aiMetadata:{description:"Fetch a single Gorgias support ticket by its numeric ID. Use when you already have the ticket ID and need its current details; to discover tickets without an ID, use List Tickets first. Idempotent read-only lookup.",idempotent:!0},props:{ticketId:b.Number({displayName:"Ticket ID",required:!0})},async run(e){return await oe({auth:e.auth,method:"GET",resourceUri:`/tickets/${e.propsValue.ticketId}`})}});var Us=Q({auth:Y,name:"update_gorgias_ticket",displayName:"Update Ticket",description:"Update a Gorgias ticket.",audience:"both",aiMetadata:{description:"Modify fields on an existing Gorgias ticket identified by its numeric ID, such as subject, status (e.g. open/closed), channel, attached customer, spam/unread flags, or external ID. Use to change ticket state or metadata; this does not add a reply or message (use Create Message for that). Idempotent: it sets fields to the supplied values, so repeating the same call leaves the ticket in the same state.",idempotent:!0},props:{ticketId:b.Number({displayName:"Ticket ID",required:!0}),subject:b.ShortText({displayName:"Subject",required:!1}),status:b.StaticDropdown({displayName:"Status",required:!1,options:Ns}),channel:b.StaticDropdown({displayName:"Channel",required:!1,options:We}),customerId:b.Number({displayName:"Customer ID",description:"Optional customer ID to attach to the ticket.",required:!1}),customerEmail:b.ShortText({displayName:"Customer Email",description:"Optional customer email to attach alongside the customer ID.",required:!1}),fromAgent:b.Checkbox({displayName:"From Agent",description:"Whether the first message of the ticket was sent by your company.",required:!1}),isUnread:b.Checkbox({displayName:"Is Unread",required:!1}),spam:b.Checkbox({displayName:"Spam",required:!1}),externalId:b.ShortText({displayName:"External ID",required:!1})},async run(e){let{ticketId:t,subject:r,status:n,channel:i,customerId:u,customerEmail:c,fromAgent:l,isUnread:f,spam:g,externalId:_}=e.propsValue;return await oe({auth:e.auth,method:"PUT",resourceUri:`/tickets/${t}`,body:{subject:r,status:n,channel:i,external_id:_,from_agent:l,is_unread:f,spam:g,customer:u?{id:u,email:c}:void 0}})}});var Ms=Q({auth:Y,name:"list_gorgias_tickets",displayName:"List Tickets",description:"List Gorgias tickets with cursor-based pagination support.",audience:"both",aiMetadata:{description:"List Gorgias support tickets, one page at a time, with optional filtering by customer ID and custom ordering. Use to discover or enumerate tickets when you do not have a specific ID; pass the cursor from a prior response to page through results. Idempotent read-only query.",idempotent:!0},props:{customerId:b.Number({displayName:"Customer ID",description:"Optional customer ID to filter tickets for one customer.",required:!1}),cursor:b.ShortText({displayName:"Cursor",description:"Optional cursor returned by a previous list response.",required:!1}),limit:b.Number({displayName:"Limit",description:"Maximum number of tickets to return in this page. Defaults to 25.",required:!1,defaultValue:25}),orderBy:b.ShortText({displayName:"Order By",description:"Optional ordering, for example `created_datetime:desc`.",required:!1})},async run(e){let{customerId:t,cursor:r,limit:n,orderBy:i}=e.propsValue;return await oe({auth:e.auth,method:"GET",resourceUri:"/tickets",query:{customer_id:t,cursor:r,limit:n??25,order_by:i}})}});var js=Q({auth:Y,name:"create_gorgias_ticket_message",displayName:"Create Message",description:"Create a reply or message on an existing Gorgias ticket.",audience:"both",aiMetadata:{description:"Append a new message (reply) to an existing Gorgias ticket identified by its numeric ID. The From Agent flag controls direction: when true the message comes from an agent/user (Sender ID is a user, Receiver ID a customer), when false it comes from the customer (the IDs swap). Use to continue an existing conversation; to open a brand-new ticket use Create Ticket. Not idempotent: each call appends another message.",idempotent:!1},props:{ticketId:b.Number({displayName:"Ticket ID",required:!0}),fromAgent:b.Checkbox({displayName:"From Agent",description:"True when the sender is an agent/user; false when the sender is a customer.",required:!0,defaultValue:!0}),senderId:b.Number({displayName:"Sender ID",description:"User ID when From Agent is true, otherwise Customer ID.",required:!0}),receiverId:b.Number({displayName:"Receiver ID",description:"Customer ID when From Agent is true, otherwise User ID.",required:!0}),fromAddress:b.ShortText({displayName:"From Address",description:"Email or channel address of the sender.",required:!0}),toAddress:b.ShortText({displayName:"To Address",description:"Email or channel address of the receiver.",required:!0}),message:b.LongText({displayName:"Message",description:"Message body. HTML is accepted by the API.",required:!0}),subject:b.ShortText({displayName:"Subject",required:!1}),channel:b.StaticDropdown({displayName:"Channel",required:!0,options:We,defaultValue:"email"}),via:b.StaticDropdown({displayName:"Via",required:!0,options:nr,defaultValue:"api"}),sentDatetime:b.ShortText({displayName:"Sent Datetime",description:"Optional ISO-8601 timestamp for when the message was sent.",required:!1})},async run(e){let{ticketId:t,fromAgent:r,senderId:n,receiverId:i,fromAddress:u,toAddress:c,message:l,subject:f,channel:g,via:_,sentDatetime:E}=e.propsValue;return await oe({auth:e.auth,method:"POST",resourceUri:`/tickets/${t}/messages`,body:{channel:g,body_html:l,via:_,subject:f,from_agent:r,sent_datetime:E,sender:{id:n},receiver:{id:i},source:{from:{address:u},to:[{address:c}]}}})}});var Ls=Q({auth:Y,name:"get_gorgias_customer",displayName:"Get Customer",description:"Retrieve a Gorgias customer by ID or find one by email.",audience:"both",aiMetadata:{description:"Look up a single Gorgias customer, operating in one of two modes: pass a Customer ID to fetch it directly, or omit the ID and pass an Email to search customers server-side and return the match. Use to resolve a customer record before working with their tickets; supply exactly one of the two inputs and the call errors if neither is given or no email match is found. Idempotent read-only lookup.",idempotent:!0},props:{customerId:b.Number({displayName:"Customer ID",description:"Use this when you already know the customer ID.",required:!1}),email:b.ShortText({displayName:"Email",description:"If Customer ID is not provided, search customers by email using Gorgias server-side filtering.",required:!1})},async run(e){let{customerId:t,email:r}=e.propsValue;if(t)return await oe({auth:e.auth,method:"GET",resourceUri:`/customers/${t}`});if(!r)throw new Error("Provide either Customer ID or Email.");let n=await Rs(e.auth,r);if(!n)throw new Error(`No customer found for email: ${r}`);return n}});var vd=vi({displayName:"Gorgias",description:"Helpdesk platform for ecommerce teams to manage tickets, customers, and support conversations.",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/gorgias.png",categories:["CUSTOMER_SUPPORT"],auth:Y,authors:["Harmatta"],actions:[Ds,Cs,Us,Ms,js,Ls,ws({baseUrl:o(e=>Pt(e?.props.domain??""),"baseUrl"),auth:Y,authMapping:o(async e=>{let t=`${e.props.email}:${e.props.api_key}`;return{Authorization:`Basic ${Fs.Buffer.from(t).toString("base64")}`}},"authMapping")})],triggers:[]});0&&(module.exports={gorgias});
4
+ /*! Bundled license information:
5
+
6
+ mime-types/index.js:
7
+ (*!
8
+ * mime-types
9
+ * Copyright(c) 2014 Jonathan Ong
10
+ * Copyright(c) 2015 Douglas Christopher Wilson
11
+ * MIT Licensed
12
+ *)
13
+ */
package/src/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export declare const gorgias: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- }>>;
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,OAAO;;;;GA2BlB,CAAC"}
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AACrD,mCAAgC;AAEhC,qCAA4D;AAC5D,+DAAiE;AACjE,yDAA2D;AAC3D,+DAAiE;AACjE,6DAA+D;AAC/D,iEAAmE;AACnE,6DAA+D;AAElD,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,gGAAgG;IAC7G,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,UAAU,EAAE,CAAC,sBAAa,CAAC,gBAAgB,CAAC;IAC5C,IAAI,EAAE,kBAAW;IACjB,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,OAAO,EAAE;QACP,kCAAkB;QAClB,4BAAe;QACf,kCAAkB;QAClB,gCAAiB;QACjB,oCAAmB;QACnB,gCAAiB;QACjB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,WAAC,OAAA,IAAA,wBAAiB,EAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,MAAM,mCAAI,EAAE,CAAC,CAAA,EAAA;YAC9D,IAAI,EAAE,kBAAW;YACjB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBAChE,OAAO;oBACL,aAAa,EAAE,SAAS,eAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;iBACtE,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- export declare const createMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- }>, {
6
- ticketId: import("@activepieces/pieces-framework").NumberProperty<true>;
7
- fromAgent: import("@activepieces/pieces-framework").CheckboxProperty<true>;
8
- senderId: import("@activepieces/pieces-framework").NumberProperty<true>;
9
- receiverId: import("@activepieces/pieces-framework").NumberProperty<true>;
10
- fromAddress: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- toAddress: import("@activepieces/pieces-framework").ShortTextProperty<true>;
12
- message: import("@activepieces/pieces-framework").LongTextProperty<true>;
13
- subject: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- channel: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
15
- via: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
16
- sentDatetime: import("@activepieces/pieces-framework").ShortTextProperty<false>;
17
- }>;
18
- //# sourceMappingURL=create-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-message.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;EA4G9B,CAAC"}
@@ -1,108 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createMessageAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const auth_1 = require("../auth");
8
- const client_1 = require("../common/client");
9
- const constants_1 = require("../common/constants");
10
- exports.createMessageAction = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.gorgiasAuth,
12
- name: 'create_gorgias_ticket_message',
13
- displayName: 'Create Message',
14
- description: 'Create a reply or message on an existing Gorgias ticket.',
15
- props: {
16
- ticketId: pieces_framework_1.Property.Number({
17
- displayName: 'Ticket ID',
18
- required: true,
19
- }),
20
- fromAgent: pieces_framework_1.Property.Checkbox({
21
- displayName: 'From Agent',
22
- description: 'True when the sender is an agent/user; false when the sender is a customer.',
23
- required: true,
24
- defaultValue: true,
25
- }),
26
- senderId: pieces_framework_1.Property.Number({
27
- displayName: 'Sender ID',
28
- description: 'User ID when From Agent is true, otherwise Customer ID.',
29
- required: true,
30
- }),
31
- receiverId: pieces_framework_1.Property.Number({
32
- displayName: 'Receiver ID',
33
- description: 'Customer ID when From Agent is true, otherwise User ID.',
34
- required: true,
35
- }),
36
- fromAddress: pieces_framework_1.Property.ShortText({
37
- displayName: 'From Address',
38
- description: 'Email or channel address of the sender.',
39
- required: true,
40
- }),
41
- toAddress: pieces_framework_1.Property.ShortText({
42
- displayName: 'To Address',
43
- description: 'Email or channel address of the receiver.',
44
- required: true,
45
- }),
46
- message: pieces_framework_1.Property.LongText({
47
- displayName: 'Message',
48
- description: 'Message body. HTML is accepted by the API.',
49
- required: true,
50
- }),
51
- subject: pieces_framework_1.Property.ShortText({
52
- displayName: 'Subject',
53
- required: false,
54
- }),
55
- channel: pieces_framework_1.Property.StaticDropdown({
56
- displayName: 'Channel',
57
- required: true,
58
- options: constants_1.GORGIAS_CHANNEL_OPTIONS,
59
- defaultValue: 'email',
60
- }),
61
- via: pieces_framework_1.Property.StaticDropdown({
62
- displayName: 'Via',
63
- required: true,
64
- options: constants_1.GORGIAS_VIA_OPTIONS,
65
- defaultValue: 'api',
66
- }),
67
- sentDatetime: pieces_framework_1.Property.ShortText({
68
- displayName: 'Sent Datetime',
69
- description: 'Optional ISO-8601 timestamp for when the message was sent.',
70
- required: false,
71
- }),
72
- },
73
- run(context) {
74
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
75
- const { ticketId, fromAgent, senderId, receiverId, fromAddress, toAddress, message, subject, channel, via, sentDatetime, } = context.propsValue;
76
- return yield (0, client_1.gorgiasApiCall)({
77
- auth: context.auth,
78
- method: pieces_common_1.HttpMethod.POST,
79
- resourceUri: `/tickets/${ticketId}/messages`,
80
- body: {
81
- channel,
82
- body_html: message,
83
- via,
84
- subject,
85
- from_agent: fromAgent,
86
- sent_datetime: sentDatetime,
87
- sender: {
88
- id: senderId,
89
- },
90
- receiver: {
91
- id: receiverId,
92
- },
93
- source: {
94
- from: {
95
- address: fromAddress,
96
- },
97
- to: [
98
- {
99
- address: toAddress,
100
- },
101
- ],
102
- },
103
- },
104
- });
105
- });
106
- },
107
- });
108
- //# sourceMappingURL=create-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-message.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AACxE,kCAAsC;AACtC,6CAAkD;AAClD,mDAG6B;AAEhB,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,0DAA0D;IACvE,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACxB,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC3B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,6EAA6E;YAC1F,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,IAAI;SACnB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACxB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,yDAAyD;YACtE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC1B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,yDAAyD;YACtE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC/B,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,mCAAuB;YAChC,YAAY,EAAE,OAAO;SACtB,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC3B,WAAW,EAAE,KAAK;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,+BAAmB;YAC5B,YAAY,EAAE,KAAK;SACpB,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EACJ,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,OAAO,EACP,OAAO,EACP,GAAG,EACH,YAAY,GACb,GAAG,OAAO,CAAC,UAAU,CAAC;YAEvB,OAAO,MAAM,IAAA,uBAAc,EAAC;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,WAAW,EAAE,YAAY,QAAQ,WAAW;gBAC5C,IAAI,EAAE;oBACJ,OAAO;oBACP,SAAS,EAAE,OAAO;oBAClB,GAAG;oBACH,OAAO;oBACP,UAAU,EAAE,SAAS;oBACrB,aAAa,EAAE,YAAY;oBAC3B,MAAM,EAAE;wBACN,EAAE,EAAE,QAAQ;qBACb;oBACD,QAAQ,EAAE;wBACR,EAAE,EAAE,UAAU;qBACf;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE;4BACJ,OAAO,EAAE,WAAW;yBACrB;wBACD,EAAE,EAAE;4BACF;gCACE,OAAO,EAAE,SAAS;6BACnB;yBACF;qBACF;iBACF;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- export declare const createTicketAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- domain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- }>, {
6
- fromAddress: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
- toAddress: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- subject: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- message: import("@activepieces/pieces-framework").LongTextProperty<true>;
10
- channel: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
11
- via: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
12
- }>;
13
- //# sourceMappingURL=create-ticket.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-ticket.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-ticket.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,kBAAkB;;;;;;;;;;;EAsE7B,CAAC"}