@activepieces/piece-resend 0.4.1 → 0.4.3

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 (97) hide show
  1. package/package.json +7 -12
  2. package/src/index.js +14 -102
  3. package/src/index.d.ts +0 -3
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/cancel-scheduled-email.action.d.ts +0 -4
  7. package/src/lib/actions/cancel-scheduled-email.action.d.ts.map +0 -1
  8. package/src/lib/actions/cancel-scheduled-email.action.js +0 -31
  9. package/src/lib/actions/cancel-scheduled-email.action.js.map +0 -1
  10. package/src/lib/actions/create-audience.action.d.ts +0 -4
  11. package/src/lib/actions/create-audience.action.d.ts.map +0 -1
  12. package/src/lib/actions/create-audience.action.js +0 -32
  13. package/src/lib/actions/create-audience.action.js.map +0 -1
  14. package/src/lib/actions/create-broadcast.action.d.ts +0 -11
  15. package/src/lib/actions/create-broadcast.action.d.ts.map +0 -1
  16. package/src/lib/actions/create-broadcast.action.js +0 -82
  17. package/src/lib/actions/create-broadcast.action.js.map +0 -1
  18. package/src/lib/actions/create-contact.action.d.ts +0 -8
  19. package/src/lib/actions/create-contact.action.d.ts.map +0 -1
  20. package/src/lib/actions/create-contact.action.js +0 -45
  21. package/src/lib/actions/create-contact.action.js.map +0 -1
  22. package/src/lib/actions/create-domain.action.d.ts +0 -5
  23. package/src/lib/actions/create-domain.action.d.ts.map +0 -1
  24. package/src/lib/actions/create-domain.action.js +0 -59
  25. package/src/lib/actions/create-domain.action.js.map +0 -1
  26. package/src/lib/actions/delete-audience.action.d.ts +0 -4
  27. package/src/lib/actions/delete-audience.action.d.ts.map +0 -1
  28. package/src/lib/actions/delete-audience.action.js +0 -28
  29. package/src/lib/actions/delete-audience.action.js.map +0 -1
  30. package/src/lib/actions/delete-broadcast.action.d.ts +0 -4
  31. package/src/lib/actions/delete-broadcast.action.d.ts.map +0 -1
  32. package/src/lib/actions/delete-broadcast.action.js +0 -28
  33. package/src/lib/actions/delete-broadcast.action.js.map +0 -1
  34. package/src/lib/actions/delete-contact.action.d.ts +0 -5
  35. package/src/lib/actions/delete-contact.action.d.ts.map +0 -1
  36. package/src/lib/actions/delete-contact.action.js +0 -29
  37. package/src/lib/actions/delete-contact.action.js.map +0 -1
  38. package/src/lib/actions/delete-domain.action.d.ts +0 -4
  39. package/src/lib/actions/delete-domain.action.d.ts.map +0 -1
  40. package/src/lib/actions/delete-domain.action.js +0 -28
  41. package/src/lib/actions/delete-domain.action.js.map +0 -1
  42. package/src/lib/actions/get-email-status.action.d.ts +0 -4
  43. package/src/lib/actions/get-email-status.action.d.ts.map +0 -1
  44. package/src/lib/actions/get-email-status.action.js +0 -34
  45. package/src/lib/actions/get-email-status.action.js.map +0 -1
  46. package/src/lib/actions/list-audiences.action.d.ts +0 -2
  47. package/src/lib/actions/list-audiences.action.d.ts.map +0 -1
  48. package/src/lib/actions/list-audiences.action.js +0 -25
  49. package/src/lib/actions/list-audiences.action.js.map +0 -1
  50. package/src/lib/actions/list-broadcasts.action.d.ts +0 -2
  51. package/src/lib/actions/list-broadcasts.action.d.ts.map +0 -1
  52. package/src/lib/actions/list-broadcasts.action.js +0 -40
  53. package/src/lib/actions/list-broadcasts.action.js.map +0 -1
  54. package/src/lib/actions/list-contacts.action.d.ts +0 -4
  55. package/src/lib/actions/list-contacts.action.d.ts.map +0 -1
  56. package/src/lib/actions/list-contacts.action.js +0 -28
  57. package/src/lib/actions/list-contacts.action.js.map +0 -1
  58. package/src/lib/actions/list-domains.action.d.ts +0 -2
  59. package/src/lib/actions/list-domains.action.d.ts.map +0 -1
  60. package/src/lib/actions/list-domains.action.js +0 -36
  61. package/src/lib/actions/list-domains.action.js.map +0 -1
  62. package/src/lib/actions/list-emails.action.d.ts +0 -2
  63. package/src/lib/actions/list-emails.action.d.ts.map +0 -1
  64. package/src/lib/actions/list-emails.action.js +0 -39
  65. package/src/lib/actions/list-emails.action.js.map +0 -1
  66. package/src/lib/actions/reschedule-email.action.d.ts +0 -5
  67. package/src/lib/actions/reschedule-email.action.d.ts.map +0 -1
  68. package/src/lib/actions/reschedule-email.action.js +0 -37
  69. package/src/lib/actions/reschedule-email.action.js.map +0 -1
  70. package/src/lib/actions/send-batch-emails.action.d.ts +0 -5
  71. package/src/lib/actions/send-batch-emails.action.d.ts.map +0 -1
  72. package/src/lib/actions/send-batch-emails.action.js +0 -111
  73. package/src/lib/actions/send-batch-emails.action.js.map +0 -1
  74. package/src/lib/actions/send-broadcast.action.d.ts +0 -5
  75. package/src/lib/actions/send-broadcast.action.d.ts.map +0 -1
  76. package/src/lib/actions/send-broadcast.action.js +0 -37
  77. package/src/lib/actions/send-broadcast.action.js.map +0 -1
  78. package/src/lib/actions/send-email.d.ts +0 -12
  79. package/src/lib/actions/send-email.d.ts.map +0 -1
  80. package/src/lib/actions/send-email.js +0 -101
  81. package/src/lib/actions/send-email.js.map +0 -1
  82. package/src/lib/actions/update-contact.action.d.ts +0 -8
  83. package/src/lib/actions/update-contact.action.d.ts.map +0 -1
  84. package/src/lib/actions/update-contact.action.js +0 -52
  85. package/src/lib/actions/update-contact.action.js.map +0 -1
  86. package/src/lib/actions/verify-domain.action.d.ts +0 -4
  87. package/src/lib/actions/verify-domain.action.d.ts.map +0 -1
  88. package/src/lib/actions/verify-domain.action.js +0 -28
  89. package/src/lib/actions/verify-domain.action.js.map +0 -1
  90. package/src/lib/common/props.d.ts +0 -7
  91. package/src/lib/common/props.d.ts.map +0 -1
  92. package/src/lib/common/props.js +0 -93
  93. package/src/lib/common/props.js.map +0 -1
  94. package/src/lib/triggers/email-bounced.trigger.d.ts +0 -11
  95. package/src/lib/triggers/email-bounced.trigger.d.ts.map +0 -1
  96. package/src/lib/triggers/email-bounced.trigger.js +0 -135
  97. package/src/lib/triggers/email-bounced.trigger.js.map +0 -1
package/package.json CHANGED
@@ -1,16 +1,11 @@
1
1
  {
2
2
  "name": "@activepieces/piece-resend",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "main": "./src/index.js",
5
- "types": "./src/index.d.ts",
6
- "scripts": {
7
- "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
8
- "lint": "eslint 'src/**/*.ts'"
9
- },
10
- "dependencies": {
11
- "@activepieces/pieces-common": "0.12.3",
12
- "@activepieces/pieces-framework": "0.29.0",
13
- "@activepieces/shared": "0.82.0",
14
- "tslib": "2.6.2"
15
- }
5
+ "dependencies": {},
6
+ "files": [
7
+ "src/index.js",
8
+ "package.json",
9
+ "src/i18n"
10
+ ]
16
11
  }
package/src/index.js CHANGED
@@ -1,104 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resend = exports.resendAuth = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const shared_1 = require("@activepieces/shared");
8
- const send_email_1 = require("./lib/actions/send-email");
9
- const send_batch_emails_action_1 = require("./lib/actions/send-batch-emails.action");
10
- const create_contact_action_1 = require("./lib/actions/create-contact.action");
11
- const update_contact_action_1 = require("./lib/actions/update-contact.action");
12
- const delete_contact_action_1 = require("./lib/actions/delete-contact.action");
13
- const list_contacts_action_1 = require("./lib/actions/list-contacts.action");
14
- const get_email_status_action_1 = require("./lib/actions/get-email-status.action");
15
- const list_emails_action_1 = require("./lib/actions/list-emails.action");
16
- const cancel_scheduled_email_action_1 = require("./lib/actions/cancel-scheduled-email.action");
17
- const reschedule_email_action_1 = require("./lib/actions/reschedule-email.action");
18
- const list_domains_action_1 = require("./lib/actions/list-domains.action");
19
- const create_domain_action_1 = require("./lib/actions/create-domain.action");
20
- const delete_domain_action_1 = require("./lib/actions/delete-domain.action");
21
- const verify_domain_action_1 = require("./lib/actions/verify-domain.action");
22
- const list_audiences_action_1 = require("./lib/actions/list-audiences.action");
23
- const create_audience_action_1 = require("./lib/actions/create-audience.action");
24
- const delete_audience_action_1 = require("./lib/actions/delete-audience.action");
25
- const list_broadcasts_action_1 = require("./lib/actions/list-broadcasts.action");
26
- const create_broadcast_action_1 = require("./lib/actions/create-broadcast.action");
27
- const send_broadcast_action_1 = require("./lib/actions/send-broadcast.action");
28
- const delete_broadcast_action_1 = require("./lib/actions/delete-broadcast.action");
29
- const email_bounced_trigger_1 = require("./lib/triggers/email-bounced.trigger");
30
- const BASE_URL = 'https://api.resend.com';
31
- exports.resendAuth = pieces_framework_1.PieceAuth.SecretText({
32
- displayName: 'API Key',
33
- description: `To get your API key:
1
+ "use strict";var su=Object.create;var Qe=Object.defineProperty;var uu=Object.getOwnPropertyDescriptor;var cu=Object.getOwnPropertyNames;var lu=Object.getPrototypeOf,pu=Object.prototype.hasOwnProperty;var o=(e,t)=>Qe(e,"name",{value:t,configurable:!0});var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gn=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cu(t))!pu.call(e,i)&&i!==r&&Qe(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e};var Oe=(e,t,r)=>(r=e!=null?su(lu(e)):{},yn(t||!e||!e.__esModule?Qe(r,"default",{value:e,enumerable:!0}):r,e)),du=e=>yn(Qe({},"__esModule",{value:!0}),e);var No=$((Ro,Ft)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(p.zoneIndex)||[])[0],P,F;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(F=d-g,P=":";F--;)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 ie=s.split(":"),ce=[];for(let Ye=0;Ye<ie.length;Ye++)ce.push(parseInt(ie[Ye],16));return ce}(),{parts:d,zoneId:v}}o(f,"expandIPv6");function h(s,d,g,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=g-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=g,v+=1}return!0}o(h,"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 I(s,d){for(;s.length<d;)s=`0${s}`;return s}o(I,"padPart");let x={};x.IPv4=function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(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,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,F;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(F=m[P],g&&F!==0)return null;F!==8&&(g=!0),d+=F}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),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(g[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,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;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 g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];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,g,m;if(d=s.match(r.fourOctet))return function(){let v=d.slice(1,6),P=[];for(let F=0;F<v.length;F++)g=v[F],P.push(_(g));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],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=function(){function s(d,g){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");g&&(this.zoneId=g)}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,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!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 F=7;F>=0;F-=1)if(v=this.parts[F],v in m){if(P=m[v],g&&P!==0)return null;P!==16&&(g=!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,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(I(this.parts[v].toString(16),4));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},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),g=d[0],m=d[1];return new x.IPv4([g>>8,g&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(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,P;for(;P=d.exec(g);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(g[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,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch(F){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${F})`)}},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,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[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,g,m,v,P,F;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return f(s,8);if((m=s.match(p.transitional))&&(F=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+F,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<P.length;g++)if(v=P[g],!(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],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;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,g){let m,v,P,F;g==null&&(g="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(F=P[m],s.kind()===F[0].kind()&&s.match.apply(s,F))return v}return g},typeof Ft<"u"&&Ft.exports?Ft.exports=x:e.ipaddr=x})(Ro)});var Oi=$((_A,ki)=>{var zi=require("stream").Stream,Bl=require("util");ki.exports=de;function de(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(de,"DelayedStream");Bl.inherits(de,zi);de.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(de.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});de.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};de.prototype.resume=function(){this._released||this.release(),this.source.resume()};de.prototype.pause=function(){this.source.pause()};de.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};de.prototype.pipe=function(){var e=zi.prototype.pipe.apply(this,arguments);return this.resume(),e};de.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};de.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Di=$((bA,Ni)=>{var Fl=require("util"),Ri=require("stream").Stream,wi=Oi();Ni.exports=Y;function Y(){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(Y,"CombinedStream");Fl.inherits(Y,Ri);Y.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};Y.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};Y.prototype.append=function(e){var t=Y.isStreamLike(e);if(t){if(!(e instanceof wi)){var r=wi.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};Y.prototype.pipe=function(e,t){return Ri.prototype.pipe.call(this,e,t),this.resume(),e};Y.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}};Y.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=Y.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};Y.prototype._pipeNext=function(e){this._currentStream=e;var t=Y.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()};Y.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};Y.prototype.write=function(e){this.emit("data",e)};Y.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};Y.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")};Y.prototype.end=function(){this._reset(),this.emit("end")};Y.prototype.destroy=function(){this._reset(),this.emit("close")};Y.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Y.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};Y.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)};Y.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ui=$((EA,Ci)=>{"use strict";Ci.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 Li=$(oe=>{"use strict";var Wt=Ui(),Zl=require("path").extname,Mi=/^\s*([^;\s]*)(?:;|\s|$)/,Vl=/^text\//i;oe.charset=ji;oe.charsets={lookup:ji};oe.contentType=Hl;oe.extension=ql;oe.extensions=Object.create(null);oe.lookup=Wl;oe.types=Object.create(null);Gl(oe.extensions,oe.types);function ji(e){if(!e||typeof e!="string")return!1;var t=Mi.exec(e),r=t&&Wt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Vl.test(t[1])?"UTF-8":!1}o(ji,"charset");function Hl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?oe.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=oe.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Hl,"contentType");function ql(e){if(!e||typeof e!="string")return!1;var t=Mi.exec(e),r=t&&oe.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(ql,"extension");function Wl(e){if(!e||typeof e!="string")return!1;var t=Zl("x."+e).toLowerCase().substr(1);return t&&oe.types[t]||!1}o(Wl,"lookup");function Gl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Wt).forEach(o(function(i){var u=Wt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var f=c[p];if(t[f]){var h=r.indexOf(Wt[t[f]].source),_=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(h>_||h===_&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Gl,"populateMaps")});var Fi=$((SA,Bi)=>{Bi.exports=Kl;function Kl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Kl,"defer")});var Zr=$((zA,Vi)=>{var Zi=Fi();Vi.exports=Jl;function Jl(e){var t=!1;return Zi(function(){t=!0}),o(function(n,i){t?e(n,i):Zi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Jl,"async")});var Vr=$((OA,Hi)=>{Hi.exports=Xl;function Xl(e){Object.keys(e.jobs).forEach(Yl.bind(e)),e.jobs={}}o(Xl,"abort");function Yl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Yl,"clean")});var Hr=$((RA,Wi)=>{var qi=Zr(),Ql=Vr();Wi.exports=ep;function ep(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=tp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Ql(r):r.results[i]=c,n(u,r.results))})}o(ep,"iterate");function tp(e,t,r,n){var i;return e.length==2?i=e(r,qi(n)):i=e(r,t,qi(n)),i}o(tp,"runJob")});var qr=$((DA,Gi)=>{Gi.exports=rp;function rp(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(rp,"state")});var Wr=$((UA,Ki)=>{var np=Vr(),op=Zr();Ki.exports=ip;function ip(e){Object.keys(this.jobs).length&&(this.index=this.size,np(this),op(e)(null,this.results))}o(ip,"terminator")});var Xi=$((jA,Ji)=>{var ap=Hr(),sp=qr(),up=Wr();Ji.exports=cp;function cp(e,t,r){for(var n=sp(e);n.index<(n.keyedList||e).length;)ap(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 up.bind(n,r)}o(cp,"parallel")});var Gr=$((BA,Gt)=>{var Yi=Hr(),lp=qr(),pp=Wr();Gt.exports=dp;Gt.exports.ascending=Qi;Gt.exports.descending=mp;function dp(e,t,r,n){var i=lp(e,r);return Yi(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){Yi(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),pp.bind(i,n)}o(dp,"serialOrdered");function Qi(e,t){return e<t?-1:e>t?1:0}o(Qi,"ascending");function mp(e,t){return-1*Qi(e,t)}o(mp,"descending")});var ta=$((ZA,ea)=>{var fp=Gr();ea.exports=gp;function gp(e,t,r){return fp(e,t,null,r)}o(gp,"serial")});var na=$((HA,ra)=>{ra.exports={parallel:Xi(),serial:ta(),serialOrdered:Gr()}});var Kr=$((qA,oa)=>{"use strict";oa.exports=Object});var aa=$((WA,ia)=>{"use strict";ia.exports=Error});var ua=$((GA,sa)=>{"use strict";sa.exports=EvalError});var la=$((KA,ca)=>{"use strict";ca.exports=RangeError});var da=$((JA,pa)=>{"use strict";pa.exports=ReferenceError});var fa=$((XA,ma)=>{"use strict";ma.exports=SyntaxError});var Kt=$((YA,ga)=>{"use strict";ga.exports=TypeError});var ha=$((QA,ya)=>{"use strict";ya.exports=URIError});var xa=$((ez,va)=>{"use strict";va.exports=Math.abs});var Pa=$((tz,_a)=>{"use strict";_a.exports=Math.floor});var Ta=$((rz,ba)=>{"use strict";ba.exports=Math.max});var Ia=$((nz,Ea)=>{"use strict";Ea.exports=Math.min});var Sa=$((oz,$a)=>{"use strict";$a.exports=Math.pow});var za=$((iz,Aa)=>{"use strict";Aa.exports=Math.round});var Oa=$((az,ka)=>{"use strict";ka.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ra=$((uz,wa)=>{"use strict";var yp=Oa();wa.exports=o(function(t){return yp(t)||t===0?t:t<0?-1:1},"sign")});var Da=$((lz,Na)=>{"use strict";Na.exports=Object.getOwnPropertyDescriptor});var Jr=$((pz,Ca)=>{"use strict";var Jt=Da();if(Jt)try{Jt([],"length")}catch{Jt=null}Ca.exports=Jt});var Ma=$((dz,Ua)=>{"use strict";var Xt=Object.defineProperty||!1;if(Xt)try{Xt({},"a",{value:1})}catch{Xt=!1}Ua.exports=Xt});var Xr=$((mz,ja)=>{"use strict";ja.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var Fa=$((gz,Ba)=>{"use strict";var La=typeof Symbol<"u"&&Symbol,hp=Xr();Ba.exports=o(function(){return typeof La!="function"||typeof Symbol!="function"||typeof La("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hp()},"hasNativeSymbols")});var Yr=$((hz,Za)=>{"use strict";Za.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Qr=$((vz,Va)=>{"use strict";var vp=Kr();Va.exports=vp.getPrototypeOf||null});var Wa=$((xz,qa)=>{"use strict";var xp="Function.prototype.bind called on incompatible ",_p=Object.prototype.toString,Pp=Math.max,bp="[object Function]",Ha=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Tp=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Ep=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");qa.exports=o(function(t){var r=this;if(typeof r!="function"||_p.apply(r)!==bp)throw new TypeError(xp+r);for(var n=Tp(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,Ha(n,arguments));return Object(_)===_?_:this}return r.apply(t,Ha(n,arguments))},"binder"),c=Pp(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+Ep(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var We=$((Pz,Ga)=>{"use strict";var Ip=Wa();Ga.exports=Function.prototype.bind||Ip});var Yt=$((bz,Ka)=>{"use strict";Ka.exports=Function.prototype.call});var en=$((Tz,Ja)=>{"use strict";Ja.exports=Function.prototype.apply});var Ya=$((Ez,Xa)=>{"use strict";Xa.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var es=$((Iz,Qa)=>{"use strict";var $p=We(),Sp=en(),Ap=Yt(),zp=Ya();Qa.exports=zp||$p.call(Ap,Sp)});var rs=$(($z,ts)=>{"use strict";var kp=We(),Op=Kt(),wp=Yt(),Rp=es();ts.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Op("a function is required");return Rp(kp,wp,t)},"callBindBasic")});var us=$((Az,ss)=>{"use strict";var Np=rs(),ns=Jr(),is;try{is=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var tn=!!is&&ns&&ns(Object.prototype,"__proto__"),as=Object,os=as.getPrototypeOf;ss.exports=tn&&typeof tn.get=="function"?Np([tn.get]):typeof os=="function"?o(function(t){return os(t==null?t:as(t))},"getDunder"):!1});var ms=$((kz,ds)=>{"use strict";var cs=Yr(),ls=Qr(),ps=us();ds.exports=cs?o(function(t){return cs(t)},"getProto"):ls?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ls(t)},"getProto"):ps?o(function(t){return ps(t)},"getProto"):null});var rn=$((wz,fs)=>{"use strict";var Dp=Function.prototype.call,Cp=Object.prototype.hasOwnProperty,Up=We();fs.exports=Up.call(Dp,Cp)});var Ps=$((Rz,_s)=>{"use strict";var B,Mp=Kr(),jp=aa(),Lp=ua(),Bp=la(),Fp=da(),Xe=fa(),Je=Kt(),Zp=ha(),Vp=xa(),Hp=Pa(),qp=Ta(),Wp=Ia(),Gp=Sa(),Kp=za(),Jp=Ra(),vs=Function,nn=o(function(e){try{return vs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),_t=Jr(),Xp=Ma(),on=o(function(){throw new Je},"throwTypeError"),Yp=_t?function(){try{return arguments.callee,on}catch{try{return _t(arguments,"callee").get}catch{return on}}}():on,Ge=Fa()(),re=ms(),Qp=Qr(),ed=Yr(),xs=en(),Pt=Yt(),Ke={},td=typeof Uint8Array>"u"||!re?B:re(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?B:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?B:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&re?re([][Symbol.iterator]()):B,"%AsyncFromSyncIteratorPrototype%":B,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?B:Atomics,"%BigInt%":typeof BigInt>"u"?B:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?B:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?B:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?B:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":jp,"%eval%":eval,"%EvalError%":Lp,"%Float16Array%":typeof Float16Array>"u"?B:Float16Array,"%Float32Array%":typeof Float32Array>"u"?B:Float32Array,"%Float64Array%":typeof Float64Array>"u"?B:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?B:FinalizationRegistry,"%Function%":vs,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?B:Int8Array,"%Int16Array%":typeof Int16Array>"u"?B:Int16Array,"%Int32Array%":typeof Int32Array>"u"?B:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&re?re(re([][Symbol.iterator]())):B,"%JSON%":typeof JSON=="object"?JSON:B,"%Map%":typeof Map>"u"?B:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!re?B:re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Mp,"%Object.getOwnPropertyDescriptor%":_t,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?B:Promise,"%Proxy%":typeof Proxy>"u"?B:Proxy,"%RangeError%":Bp,"%ReferenceError%":Fp,"%Reflect%":typeof Reflect>"u"?B:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?B:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!re?B:re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?B:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&re?re(""[Symbol.iterator]()):B,"%Symbol%":Ge?Symbol:B,"%SyntaxError%":Xe,"%ThrowTypeError%":Yp,"%TypedArray%":td,"%TypeError%":Je,"%Uint8Array%":typeof Uint8Array>"u"?B:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?B:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?B:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?B:Uint32Array,"%URIError%":Zp,"%WeakMap%":typeof WeakMap>"u"?B:WeakMap,"%WeakRef%":typeof WeakRef>"u"?B:WeakRef,"%WeakSet%":typeof WeakSet>"u"?B:WeakSet,"%Function.prototype.call%":Pt,"%Function.prototype.apply%":xs,"%Object.defineProperty%":Xp,"%Object.getPrototypeOf%":Qp,"%Math.abs%":Vp,"%Math.floor%":Hp,"%Math.max%":qp,"%Math.min%":Wp,"%Math.pow%":Gp,"%Math.round%":Kp,"%Math.sign%":Jp,"%Reflect.getPrototypeOf%":ed};if(re)try{null.error}catch(e){gs=re(re(e)),De["%Error.prototype%"]=gs}var gs,rd=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&&re&&(r=re(i.prototype))}return De[t]=r,r},"doEval"),ys={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bt=We(),Qt=rn(),nd=bt.call(Pt,Array.prototype.concat),od=bt.call(xs,Array.prototype.splice),hs=bt.call(Pt,String.prototype.replace),er=bt.call(Pt,String.prototype.slice),id=bt.call(Pt,RegExp.prototype.exec),ad=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,sd=/\\(\\)?/g,ud=o(function(t){var r=er(t,0,1),n=er(t,-1);if(r==="%"&&n!=="%")throw new Xe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Xe("invalid intrinsic syntax, expected opening `%`");var i=[];return hs(t,ad,function(u,c,p,f){i[i.length]=p?hs(f,sd,"$1"):c||u}),i},"stringToPath"),cd=o(function(t,r){var n=t,i;if(Qt(ys,n)&&(i=ys[n],n="%"+i[0]+"%"),Qt(De,n)){var u=De[n];if(u===Ke&&(u=rd(n)),typeof u>"u"&&!r)throw new Je("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Xe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");_s.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Je('"allowMissing" argument must be a boolean');if(id(/^%?[^%]*%?$/,t)===null)throw new Xe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ud(t),i=n.length>0?n[0]:"",u=cd("%"+i+"%",r),c=u.name,p=u.value,f=!1,h=u.alias;h&&(i=h[0],od(n,nd([0,1],h)));for(var _=1,I=!0;_<n.length;_+=1){var x=n[_],s=er(x,0,1),d=er(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Xe("property names with quotes must have matching quotes");if((x==="constructor"||!I)&&(f=!0),i+="."+x,c="%"+i+"%",Qt(De,c))p=De[c];else if(p!=null){if(!(x in p)){if(!r)throw new Je("base intrinsic for "+t+" exists, but the property is not available.");return}if(_t&&_+1>=n.length){var g=_t(p,x);I=!!g,I&&"get"in g&&!("originalValue"in g.get)?p=g.get:p=p[x]}else I=Qt(p,x),p=p[x];I&&!f&&(De[c]=p)}}return p},"GetIntrinsic")});var Ts=$((Dz,bs)=>{"use strict";var ld=Xr();bs.exports=o(function(){return ld()&&!!Symbol.toStringTag},"hasToStringTagShams")});var $s=$((Uz,Is)=>{"use strict";var pd=Ps(),Es=pd("%Object.defineProperty%",!0),dd=Ts()(),md=rn(),fd=Kt(),tr=dd?Symbol.toStringTag:null;Is.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 fd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");tr&&(n||!md(t,tr))&&(Es?Es(t,tr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[tr]=r)},"setToStringTag")});var As=$((jz,Ss)=>{"use strict";var gd=Function.prototype.call,yd=Object.prototype.hasOwnProperty,hd=We();Ss.exports=hd.call(gd,yd)});var ks=$((Lz,zs)=>{"use strict";zs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Rs=$((Bz,ws)=>{"use strict";var cn=Di(),vd=require("util"),an=require("path"),xd=require("http"),_d=require("https"),Pd=require("url").parse,bd=require("fs"),Td=require("stream").Stream,Ed=require("crypto"),sn=Li(),Id=na(),$d=$s(),ze=As(),un=ks();function Os(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Os,"escapeHeaderParam");function Z(e){if(!(this instanceof Z))return new Z(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(Z,"FormData");vd.inherits(Z,cn);Z.LINE_BREAK=`\r
2
+ `;Z.DEFAULT_CONTENT_TYPE="application/octet-stream";Z.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)};Z.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)+Z.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ze(t,"httpVersion"))&&!(t instanceof Td))&&(r.knownLength||this._valuesToMeasure.push(t))};Z.prototype._lengthRetriever=function(e,t){ze(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):bd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):ze(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ze(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};Z.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="'+Os(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&un(c,r.header);var p;for(var f in c)if(ze(c,f)){if(p=c[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=f+": "+p.join("; ")+Z.LINE_BREAK)}return"--"+this.getBoundary()+Z.LINE_BREAK+u+Z.LINE_BREAK};Z.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&&ze(e,"httpVersion")&&(r=an.basename(e.client._httpMessage.path||"")),r)return'filename="'+Os(r)+'"'};Z.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&&ze(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=Z.DEFAULT_CONTENT_TYPE),r};Z.prototype._multiPartFooter=function(){return function(e){var t=Z.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};Z.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Z.LINE_BREAK};Z.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ze(e,t)&&(r[t.toLowerCase()]=e[t]);return r};Z.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};Z.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Z.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(Z.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Z.prototype._generateBoundary=function(){this._boundary="--------------------------"+Ed.randomBytes(12).toString("hex")};Z.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};Z.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};Z.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}Id.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};Z.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Pd(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=_d.request(n):r=xd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,f=o(function(h,_){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,h,_)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.bind(this)),r};Z.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};Z.prototype.toString=function(){return"[object FormData]"};$d(Z.prototype,"FormData");ws.exports=Z});var Zd={};gn(Zd,{resend:()=>Fd,resendAuth:()=>A});module.exports=du(Zd);var mu=Object.freeze({status:"aborted"});function T(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let h=c.prototype,_=Object.keys(h);for(let I=0;I<_.length;I++){let x=_[I];x in p||(p[x]=h[x].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var f;let h=r?.Parent?new u:this;n(h,p),(f=h._zod).deferred??(f.deferred=[]);for(let _ of h._zod.deferred)_();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var fu=Symbol("zod_brand"),me=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Et=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},or={};function ye(e){return e&&Object.assign(or,e),or}o(ye,"config");function ar(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(ar,"getEnumValues");function vn(e,t){return typeof t=="bigint"?t.toString():t}o(vn,"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 xn(e){return e==null}o(xn,"nullish");function St(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(St,"cleanRegex");var hn=Symbol("evaluating");function ee(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==hn)return n===void 0&&(n=hn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(ee,"defineLazy");var sr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(et,"isObject");var gu=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _n(e){if(et(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(et(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(_n,"isPlainObject");var Pn=new Set(["string","number","symbol"]);function Ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ce,"escapeRegex");function At(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(At,"clone");function K(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(K,"normalizeParams");function bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(bn,"optionalKeys");var yu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ue(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Ue,"aborted");function be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(be,"prefixIssues");function It(e){return typeof e=="string"?e:e?.message}o(It,"unwrapMessage");function Te(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(r.customError?.(e))??It(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Te,"finalizeIssue");function Tn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Tn,"getLengthableOrigin");function ur(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(ur,"issue");var En=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,vn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),In=T("$ZodError",En),tt=T("$ZodError",En,{Parent:Error});var vu=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 me;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>Te(f,u,ye())));throw sr(p,i?.callee),p}return c.value},"_parse"),zt=vu(tt),xu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>Te(f,u,ye())));throw sr(p,i?.callee),p}return c.value},"_parseAsync"),kt=xu(tt),_u=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 me;return u.issues.length?{success:!1,error:new(e??In)(u.issues.map(c=>Te(c,i,ye())))}:{success:!0,data:u.value}},"_safeParse"),rt=_u(tt),Pu=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=>Te(c,i,ye())))}:{success:!0,data:u.value}},"_safeParseAsync"),nt=Pu(tt);var bu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Tu=new RegExp(`^${bu}$`);var $n=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Sn=/^-?\d+n?$/;var cr=/^-?\d+(?:\.\d+)?$/,An=/^(?:true|false)$/i;var Me=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var zn=T("$ZodCheckMinLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!xn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=Tn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var lr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Me.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=()=>{})}),kn=T("$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 wn={major:4,minor:3,patch:6};var J=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,f)=>{let h=Ue(c),_;for(let I of p){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new me;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(h||(h=Ue(c,x)))});else{if(c.issues.length===x)continue;h||(h=Ue(c,x))}}return _?_.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(Ue(c))return c.aborted=!0,c;let h=i(p,n,f);if(h instanceof Promise){if(f.async===!1)throw new me;return h.then(_=>e._zod.parse(_,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return h instanceof Promise?h.then(_=>u(_,c,p)):u(h,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new me;return f.then(h=>i(h,n,p))}return i(f,n,p)}}ee(e,"~standard",()=>({validate:o(i=>{try{let u=rt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return nt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Rt=T("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$n(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),pr=T("$ZodStringFormat",(e,t)=>{lr.init(e,t),Rt.init(e,t)});var Un=T("$ZodURL",(e,t)=>{pr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Mn=T("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??cr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}});var dr=T("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=An,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}}),jn=T("$ZodBigInt",(e,t)=>{J.init(e,t),e._zod.pattern=Sn,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 Ln=T("$ZodAny",(e,t)=>{J.init(e,t),e._zod.parse=r=>r}),Bn=T("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=r=>r});var Fn=T("$ZodVoid",(e,t)=>{J.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}}),Zn=T("$ZodDate",(e,t)=>{J.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 Rn(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}o(Rn,"handleArrayResult");var Vn=T("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let p=i[c],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(h=>Rn(h,r,c))):Rn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function wt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(wt,"handlePropertyResult");function Eu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Eu,"normalizeDef");function Iu(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,h=f.def.type,_=f.optout==="optional";for(let I in t){if(p.has(I))continue;if(h==="never"){c.push(I);continue}let x=f.run({value:t[I],issues:[]},n);x instanceof Promise?e.push(x.then(s=>wt(s,r,I,t,_))):wt(x,r,I,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(Iu,"handleCatchall");var Hn=T("$ZodObject",(e,t)=>{if(J.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=$t(()=>Eu(t));ee(e._zod,"propValues",()=>{let p=t.shape,f={};for(let h in p){let _=p[h]._zod;if(_.values){f[h]??(f[h]=new Set);for(let I of _.values)f[h].add(I)}}return f});let i=et,u=t.catchall,c;e._zod.parse=(p,f)=>{c??(c=n.value);let h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;p.value={};let _=[],I=c.shape;for(let x of c.keys){let s=I[x],d=s._zod.optout==="optional",g=s._zod.run({value:h[x],issues:[]},f);g instanceof Promise?_.push(g.then(m=>wt(m,p,x,h,d))):wt(g,p,x,h,d)}return u?Iu(_,h,p,f,n.value,e):_.length?Promise.all(_).then(()=>p):p}});function Nn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Ue(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Te(c,n,ye())))}),t)}o(Nn,"handleUnionResults");var mr=T("$ZodUnion",(e,t)=>{J.init(e,t),ee(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ee(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ee(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ee(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=>St(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let f of t.options){let h=f._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)p.push(h),c=!0;else{if(h.issues.length===0)return h;p.push(h)}}return c?Promise.all(p).then(f=>Nn(f,i,e,u)):Nn(p,i,e,u)}});var qn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,mr.init(e,t);let r=e._zod.parse;ee(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let h of f)i[p].add(h)}}return i});let n=$t(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of p){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!et(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var Wn=T("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!_n(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){p.add(typeof h=="number"?h.toString():h);let _=t.valueType._zod.run({value:i[h],issues:[]},n);_ instanceof Promise?u.push(_.then(I=>{I.issues.length&&r.issues.push(...be(h,I.issues)),r.value[h]=I.value})):(_.issues.length&&r.issues.push(...be(h,_.issues)),r.value[h]=_.value)}let f;for(let h in i)p.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&cr.test(p)&&f.issues.length){let I=t.keyType._zod.run({value:Number(p),issues:[]},n);if(I instanceof Promise)throw new Error("Async schemas not supported in object keys currently");I.issues.length===0&&(f=I)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(I=>Te(I,n,ye())),input:p,path:[p],inst:e});continue}let _=t.valueType._zod.run({value:i[p],issues:[]},n);_ instanceof Promise?u.push(_.then(I=>{I.issues.length&&r.issues.push(...be(p,I.issues)),r.value[f.value]=I.value})):(_.issues.length&&r.issues.push(...be(p,_.issues)),r.value[f.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Gn=T("$ZodEnum",(e,t)=>{J.init(e,t);let r=ar(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Pn.has(typeof i)).map(i=>typeof i=="string"?Ce(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),Kn=T("$ZodLiteral",(e,t)=>{if(J.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ce(n):n?Ce(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Jn=T("$ZodTransform",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Et(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 me;return r.value=i,r}});function Dn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Dn,"handleOptionalResult");var Xn=T("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ee(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(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=>Dn(u,r.value)):Dn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Yn=T("$ZodNullable",(e,t)=>{J.init(e,t),ee(e._zod,"optin",()=>t.innerType._zod.optin),ee(e._zod,"optout",()=>t.innerType._zod.optout),ee(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)}|null)$`):void 0}),ee(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 Qn=T("$ZodPipe",(e,t)=>{J.init(e,t),ee(e._zod,"values",()=>t.in._zod.values),ee(e._zod,"optin",()=>t.in._zod.optin),ee(e._zod,"optout",()=>t.out._zod.optout),ee(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Ot(c,t.in,n)):Ot(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Ot(u,t.out,n)):Ot(i,t.out,n)}});function Ot(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Ot,"handlePipeResult");var eo=T("$ZodCustom",(e,t)=>{Me.init(e,t),J.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=>Cn(u,r,n,e));Cn(i,r,n,e)}});function Cn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(ur(i))}}o(Cn,"handleRefineResult");var ro,zu=Symbol("ZodOutput"),ku=Symbol("ZodInput"),fr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function no(){return new fr}o(no,"registry");(ro=globalThis).__zod_globalRegistry??(ro.__zod_globalRegistry=no());var gr=globalThis.__zod_globalRegistry;function oo(e,t){return new e({type:"string",...K(t)})}o(oo,"_string");function io(e,t){return new e({type:"string",coerce:!0,...K(t)})}o(io,"_coercedString");function ao(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...K(t)})}o(ao,"_url");function so(e,t){return new e({type:"number",checks:[],...K(t)})}o(so,"_number");function uo(e,t){return new e({type:"number",coerce:!0,checks:[],...K(t)})}o(uo,"_coercedNumber");function co(e,t){return new e({type:"boolean",...K(t)})}o(co,"_boolean");function lo(e,t){return new e({type:"boolean",coerce:!0,...K(t)})}o(lo,"_coercedBoolean");function po(e,t){return new e({type:"bigint",coerce:!0,...K(t)})}o(po,"_coercedBigint");function mo(e){return new e({type:"any"})}o(mo,"_any");function fo(e){return new e({type:"unknown"})}o(fo,"_unknown");function go(e,t){return new e({type:"void",...K(t)})}o(go,"_void");function yo(e,t){return new e({type:"date",coerce:!0,...K(t)})}o(yo,"_coercedDate");function le(e,t){return new zn({check:"min_length",...K(t),minimum:e})}o(le,"_minLength");function Ee(e,t){return new kn({check:"string_format",format:"regex",...K(t),pattern:e})}o(Ee,"_regex");function ho(e,t,r){let n=K(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(ho,"_custom");var te=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");J.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>zt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>rt(e,r,n),e.parseAsync=async(r,n)=>kt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>nt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>At(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Dt=T("ZodMiniString",(e,t)=>{Rt.init(e,t),te.init(e,t)});function a(e){return oo(Dt,e)}o(a,"string");var vo=T("ZodMiniStringFormat",(e,t)=>{pr.init(e,t),Dt.init(e,t)});var Lu=T("ZodMiniURL",(e,t)=>{Un.init(e,t),vo.init(e,t)});function xo(e){return ao(Lu,e)}o(xo,"url");var yr=T("ZodMiniNumber",(e,t)=>{Mn.init(e,t),te.init(e,t)});function ne(e){return so(yr,e)}o(ne,"number");var hr=T("ZodMiniBoolean",(e,t)=>{dr.init(e,t),te.init(e,t)});function H(e){return co(hr,e)}o(H,"boolean");var _o=T("ZodMiniBigInt",(e,t)=>{jn.init(e,t),te.init(e,t)});var Bu=T("ZodMiniAny",(e,t)=>{Ln.init(e,t),te.init(e,t)});function it(){return mo(Bu)}o(it,"any");var Fu=T("ZodMiniUnknown",(e,t)=>{Bn.init(e,t),te.init(e,t)});function R(){return fo(Fu)}o(R,"unknown");var Zu=T("ZodMiniVoid",(e,t)=>{Fn.init(e,t),te.init(e,t)});function Po(e){return go(Zu,e)}o(Po,"_void");var bo=T("ZodMiniDate",(e,t)=>{Zn.init(e,t),te.init(e,t)});var Vu=T("ZodMiniArray",(e,t)=>{Vn.init(e,t),te.init(e,t)});function U(e,t){return new Vu({type:"array",element:e,...K(t)})}o(U,"array");var Hu=T("ZodMiniObject",(e,t)=>{Hn.init(e,t),te.init(e,t),ee(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...K(t)};return new Hu(r)}o(l,"object");var qu=T("ZodMiniUnion",(e,t)=>{mr.init(e,t),te.init(e,t)});function M(e,t){return new qu({type:"union",options:e,...K(t)})}o(M,"union");var Wu=T("ZodMiniDiscriminatedUnion",(e,t)=>{qn.init(e,t),te.init(e,t)});function je(e,t,r){return new Wu({type:"union",options:t,discriminator:e,...K(r)})}o(je,"discriminatedUnion");var Gu=T("ZodMiniRecord",(e,t)=>{Wn.init(e,t),te.init(e,t)});function N(e,t,r){return new Gu({type:"record",keyType:e,valueType:t,...K(r)})}o(N,"record");var Ku=T("ZodMiniEnum",(e,t)=>{Gn.init(e,t),te.init(e,t),e.options=Object.values(t.entries)});function L(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ku({type:"enum",entries:r,...K(t)})}o(L,"_enum");var Ju=T("ZodMiniLiteral",(e,t)=>{Kn.init(e,t),te.init(e,t)});function z(e,t){return new Ju({type:"literal",values:Array.isArray(e)?e:[e],...K(t)})}o(z,"literal");var Xu=T("ZodMiniTransform",(e,t)=>{Jn.init(e,t),te.init(e,t)});function Ie(e){return new Xu({type:"transform",transform:e})}o(Ie,"transform");var Yu=T("ZodMiniOptional",(e,t)=>{Xn.init(e,t),te.init(e,t)});function y(e){return new Yu({type:"optional",innerType:e})}o(y,"optional");var Qu=T("ZodMiniNullable",(e,t)=>{Yn.init(e,t),te.init(e,t)});function at(e){return new Qu({type:"nullable",innerType:e})}o(at,"nullable");var ec=T("ZodMiniPipe",(e,t)=>{Qn.init(e,t),te.init(e,t)});function $e(e,t){return new ec({type:"pipe",in:e,out:t})}o($e,"pipe");var tc=T("ZodMiniCustom",(e,t)=>{eo.init(e,t),te.init(e,t)});function Ct(e,t){return ho(tc,e??(()=>!0),t)}o(Ct,"custom");var st={};gn(st,{bigint:()=>uc,boolean:()=>sc,date:()=>cc,number:()=>ac,string:()=>ic});function ic(e){return io(Dt,e)}o(ic,"string");function ac(e){return uo(yr,e)}o(ac,"number");function sc(e){return lo(hr,e)}o(sc,"boolean");function uc(e){return po(_o,e)}o(uc,"bigint");function cc(e){return yo(bo,e)}o(cc,"date");var xr=l({retryOnFailure:l({defaultValue:y(H()),hide:y(H())}),continueOnFailure:l({defaultValue:y(H()),hide:y(H())})}),vr=class{constructor(t,r,n,i,u,c,p,f,h,_,I){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=_;this.aiMetadata=I}static{o(this,"IAction")}},C=o(e=>new vr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var V=l({displayName:a(),description:y(a())}),j=o((e,t)=>l({type:z(t),required:H(),defaultValue:y(it())}),"TPropertyValue");var ae=l({...V.shape,...j(a(),"SHORT_TEXT").shape}),he=l({...V.shape,...j(a(),"LONG_TEXT").shape});var Eo=l({label:a(),value:R()}),Ut=l({disabled:y(H()),placeholder:y(a()),options:U(Eo)});var se=l({...V.shape,options:Ut,...j(R(),"STATIC_DROPDOWN").shape}),ve=l({...V.shape,options:Ut,...j(U(R()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var _r=l({...V.shape,...j(R(),"DROPDOWN").shape,refreshers:U(a())}),ut=l({...V.shape,...j(U(R()),"MULTI_SELECT_DROPDOWN").shape,refreshers:U(a())});var xe=l({...V.shape,...j(H(),"CHECKBOX").shape});var _e=l({...V.shape,...j(ne(),"NUMBER").shape});var ct=l({...V.shape,...j(R(),"FILE").shape});var lt=l({...V.shape,...j(a(),"DATE_TIME").shape});var Io=N(a(),M([ae,he,se,ut,ve,xe,_e,ct,lt])),pt=l({...V.shape,properties:Io,...j(U(R()),"ARRAY").shape});var dt=l({...V.shape,...j(M([N(a(),R())]),"JSON").shape});var $o=M([ae,se,dt,pt,ve]),pc=N(a(),$o),Pr=l({refreshers:U(a()),...V.shape,...j(R(),"DYNAMIC").shape});var Mt=l({...V.shape,...j(Po(),"MARKDOWN").shape});var mt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(mt||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),Be=(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))(Be||{});var ft=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ft||{}),br="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||{}),gt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(gt||{}),dc=l({strategy:L(gt),paramName:y(a())}),yt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(yt||{});var jt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(jt||{}),So=l({status:y(ne()),body:y(R()),headers:y(N(a(),a()))}),Ao=l({type:z("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(L(jt))}),zo=l({type:z("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:So,handlerId:y(a()),streamStepProgress:y(L(jt))}),mc=M([Ao,zo]);var fc=l({body:R(),rawBody:y(R()),headers:N(a(),a()),queryParams:N(a(),a())});function pe(e){return e==null}o(pe,"isNil");function ht(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ht,"isEmpty");function Lt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Lt,"assertNotNullOrUndefined");var Tr=Oe(require("crypto"),1);var gc=128,we,Fe,yc=o(e=>{!we||we.length<e?(we=Buffer.allocUnsafe(e*gc),Tr.default.randomFillSync(we),Fe=0):Fe+e>we.length&&(Tr.default.randomFillSync(we),Fe=0),Fe+=e},"fillPool"),hc=o(e=>(yc(e|=0),we.subarray(Fe-e,Fe)),"random"),vc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let p=r(i),f=i;for(;f--;)if(c+=e[p[f]&n]||"",c.length===u)return c}}},"customRandom"),Oo=o((e,t=21)=>vc(e,t,hc),"customAlphabet");var xc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",wo=21,$b=a().check(Ee(new RegExp(`^[0-9a-zA-Z]{${wo}}$`))),_c=Oo(xc,wo);var Ae=$e(Ie(e=>e instanceof Date?e.toISOString():e),a()),ue={id:a(),created:Ae,updated:Ae},W=o(e=>y(at(e)),"Nullable");function Er(e){return y(at(L(e)))}o(Er,"NullableEnum");var zb=$e(Ie(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(H())),Bt=o(e=>$e(Ie(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(U(e))),"OptionalArrayFromQuery");var wb=N(a(),R());var vt=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(vt||{});var Vb=a().check(Ee(/^#[0-9A-Fa-f]{6}$/));var qb=l({filename:a(),data:R(),type:z("file"),mimetype:y(a())});var Pc=Oe(No());var Qb=l({...ue,name:a(),permissions:U(a()),platformId:W(a()),type:a(),userCount:y(ne())});var Do=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Do||{}),Ir=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ir||{}),$r=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))($r||{});var Sr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Sr||{});var Ar=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ar||{});var bc=l({mode:L(Do),value:R()}),Tc=l({auth:y(a()),fields:N(a(),bc)}),Ec=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(Tc)}),Ic=l({type:z("PIECE"),toolName:a().check(le(1)),pieceMetadata:Ec}),$c=l({type:z("none")}),Sc=l({type:z("access_token"),accessToken:a()}),Ac=l({type:z("api_key"),apiKey:a(),apiKeyHeader:a()}),zc=l({type:z("headers"),headers:N(a(),a())}),kc=je("type",[$c,Sc,Ac,zc]),Co=l({type:z("FLOW"),toolName:a().check(le(1)),externalFlowId:a(),flowDisplayName:y(a())}),Uo=l({type:z("MCP"),toolName:a().check(le(1)),serverUrl:xo(),protocol:L($r),auth:kc}),Mo=l({type:z("KNOWLEDGE_BASE"),toolName:a().check(le(1)),sourceType:L(Ir),sourceId:a(),sourceName:a()}),Oc=je("type",[Ic,Co,Uo,Mo]),wc=l({displayName:a(),description:y(a()),type:L(Sr)}),jo=l({type:z("MARKDOWN"),markdown:a()}),Ze={type:z("TOOL_CALL"),input:W(N(a(),R())),output:y(R()),toolName:a(),status:L(Ar),toolCallId:a(),startTime:a(),endTime:y(a())},$T=l(Ze),Lo=je("toolCallType",[l({...Ze,toolCallType:z("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Ze,toolCallType:z("FLOW"),displayName:a(),externalFlowId:a()}),l({...Ze,toolCallType:z("MCP"),displayName:a(),serverUrl:a()}),l({...Ze,toolCallType:z("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Ze,toolCallType:z("UNKNOWN"),displayName:a()})]),Rc=M([jo,Lo]);var zr=(r=>(r.IMAGE="image",r.TEXT="text",r))(zr||{}),Pe=l({apiKey:a()}),Nc=Pe,Dc=l({apiKey:a(),apiKeyHash:a()}),Cc=Pe,Uc=Pe,Mc=Pe,jc=Pe,Lc=Pe,Bc=Pe,Fc=Pe,Bo=l({accessKeyId:a().check(le(1)),secretAccessKey:a().check(le(1))}),Zc=l({}),Vc=l({}),Hc=l({}),qc=l({}),Wc=l({}),Gc=l({}),Fo=l({modelId:a(),modelName:a(),modelType:L(zr)}),Zo=l({apiKeyHeader:a(),baseUrl:a(),models:U(Fo),defaultHeaders:y(N(a(),a()))}),Vo=l({accountId:a(),gatewayId:a(),models:U(Fo),vertexProject:y(a()),vertexRegion:y(a())}),Ho=l({resourceName:a(),apiVersion:$e(Ie(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),qo=l({region:a().check(le(1))}),Kc=M([Nc,Mc,jc,Lc,Bc,Uc,Cc,Dc,Bo,Fc]),Wo=M([Zo,Vo,Ho,qo,Zc,Hc,qc,Wc,Vc,Gc]),Jc=l({id:a(),name:a(),type:L(zr)}),Xc=l({id:a(),name:a(),provider:L(vt),config:Wo,enabledForChat:H()}),Yc=l({provider:L(vt),config:Wo,auth:Kc,platformId:a()});var kT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Qc=l({base64Url:a(),fileName:a(),extension:y(a())}),el=l({mimeType:a(),url:a(),fileName:y(a())}),kr=M([Qc,el]);var tl=M([l({type:z("file"),value:kr}),l({type:z("markdown"),value:a(),files:y(U(kr))})]),rl=l({sessionId:a(),message:a(),files:y(U(a()))});var Ko=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ko||{}),Jo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Jo||{}),Or=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Or||{});var nl=M([l({...ue,name:a(),externalId:a(),type:z("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:U(l({value:a()}))})}),l({...ue,name:a(),externalId:a(),type:M([z("TEXT"),z("NUMBER"),z("DATE")]),tableId:a(),projectId:a()})]),ol=l({...ue,name:a(),folderId:W(a()),projectId:a(),externalId:a(),status:Er(Jo),trigger:Er(Ko)}),il=l({...ue,tableId:a(),projectId:a(),cells:N(a(),l({updated:a(),created:a(),value:R(),fieldName:a()}))}),al=l({events:U(L(Or)),webhookUrl:a(),flowId:a()}),sl=l({fields:U(l({id:a(),name:a()})),rows:U(N(a(),a())),name:a()}),ul=l({projectId:a(),limit:y(st.number()),cursor:y(a()),name:y(a()),externalIds:Bt(a()),folderId:y(a()),folderIds:Bt(a())}),cl=l({records:U(U(l({fieldId:a(),value:Yo()}))),tableId:a()}),ll=l({cells:y(U(l({fieldId:a(),value:Yo()}))),tableId:a(),agentUpdate:y(H())}),Xo=je("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),Go("exists"),Go("not_exists")]),pl=l({tableId:a(),limit:y(st.number()),cursor:y(a()),filters:Bt(Xo)});function Yo(){return $e(Ie(e=>e==null?e:String(e)),at(a()))}o(Yo,"coerceToString");function Re(e){return l({fieldId:a(),operator:z(e),value:a()})}o(Re,"valueFilter");function Go(e){return l({fieldId:a(),operator:z(e)})}o(Go,"existenceFilter");var dl=l({status:y(ne()),body:y(R()),headers:y(N(a(),a()))}),ml=l({...ue,deleted:W(Ae),ownerId:a(),displayName:a(),platformId:a(),externalId:W(a())});var Qo=l({name:a(),description:y(a()),type:a(),required:H()}),fl=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:U(Qo),returnsResponse:H()})});var ei="^[0-9]+\\.[0-9]+\\.[0-9]+$",KT=new RegExp(ei),yl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",JT=a().check(Ee(new RegExp(ei))),XT=a().check(Ee(new RegExp(yl))),hl=l({packageType:z("ARCHIVE"),pieceType:L(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ti=l({packageType:z("REGISTRY"),pieceType:z("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ri=l({packageType:z("REGISTRY"),pieceType:z("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),YT=M([ti,ri]),QT=M([hl,ti,ri]),ni=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ni||{}),vl=l({type:L(ni),cronExpression:a(),timezone:a()}),eE=l({...ue,type:L(Se),projectId:a(),flowId:a(),triggerName:a(),schedule:W(vl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:W(a()),simulate:H()}),oi=(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))(oi||{}),ii=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ii||{}),ai=(r=>(r.S3="S3",r.DB="DB",r))(ai||{}),tE=l({...ue,projectId:W(a()),platformId:W(a()),type:L(oi),compression:L(ii),data:y(R()),location:L(ai),size:W(ne()),fileName:W(a()),s3Key:W(a()),metadata:W(N(a(),a()))}),si=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(si||{}),ui=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ui||{}),rE=l({id:a(),email:a(),firstName:a(),status:L(ui),externalId:W(a()),platformId:W(a()),platformRole:L(si),lastName:a(),created:Ae,updated:Ae,lastActiveDate:W(Ae),imageUrl:W(a())});var wr=l({...V.shape,...j(N(a(),R()),"OBJECT").shape});var di=l({...V.shape,...j(a(),"COLOR").shape});var Rr=M([ae,he,Mt,xe,se,ve,_r,ut,Pr,_e,pt,wr,dt,lt,ct,di]),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 fe=l({displayName:a(),description:y(a())});var mi=l({username:a(),password:a()}),Nr=l({...fe.shape,username:l({displayName:a(),description:y(a())}),password:l({displayName:a(),description:y(a())}),...j(mi,"BASIC_AUTH").shape});var bl=N(a(),M([ae,he,_e,xe,se])),Dr=l({...fe.shape,props:bl,...j(R(),"CUSTOM_AUTH").shape});var Ne=l({...fe.shape,...j(l({auth:a()}),"SECRET_TEXT").shape});var Tl=N(a(),M([ae,he,Ne,_e,xe,se,ve,Mt])),fi=l({...fe.shape,props:Tl,...j(R(),"OIDC").shape});var Cr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Cr||{}),gi=M([ae,Ne,se]),yi=N(a(),gi),El=l({props:y(N(a(),gi)),authUrl:a(),tokenUrl:a(),scope:U(a()),prompt:y(M([z("none"),z("consent"),z("login"),z("omit")])),pkce:y(H()),pkceMethod:y(M([z("plain"),z("S256")])),authorizationMethod:y(L(Cr)),grantType:y(M([L(ft),z(br)])),extra:y(N(a(),a()))}),hi=l({access_token:a(),props:y(yi),data:N(a(),it())}),Ur=l({...fe.shape,...El.shape,...j(hi,"OAUTH2").shape});var Ve=M([Nr,Dr,fi,Ur,Ne]),xt="Connection",Mr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||xt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||xt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||xt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||xt}},None(){}};var NI={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 Il=l({...V.shape,...j(R(),"CUSTOM").shape,code:a()});var $l=M([Rr,Ve]),jr=N(a(),$l),e$=N(a(),Rr);var vi=M([l({strategy:z("CRON"),cronExpression:a()}),l({strategy:z("NONE")})]),He=class{constructor(t,r,n,i,u,c,p,f,h,_,I,x,s,d,g,m,v,P,F){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=p;this.onHandshake=f;this.renewConfiguration=h;this.onRenew=_;this.onEnable=I;this.onDisable=x;this.onStart=s;this.run=d;this.test=g;this.sampleData=m;this.testStrategy=v;this.outputSchema=P;this.aiMetadata=F}static{o(this,"ITrigger")}},xi=o(e=>{switch(e.type){case"WEBHOOK":return new He(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new He(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new He(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new He(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,pe(e.sampleData)&&pe(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var _i="2",Zt="0.82.0";var Lr=class{constructor(t,r,n,i,u,c,p,f,h=Zt,_,I=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=_;this.description=I;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:_i}),"getContextInfo");(!Sl(h)||Al(h,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}},Pi=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 Sl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Sl,"isValidSimpleSemver");function Al(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(Al,"isSemverLessThan");var zl=y(N(a(),N(a(),a()))),bi=l({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:U(a()),platformId:y(a()),directoryPath:y(a()),auth:y(M([Ve,U(Ve)])),version:a(),categories:y(U(L(Be))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),i18n:zl}),kl=L(["human","ai","both"]),Ti=l({description:y(a()),idempotent:y(H())}),Ei=l({name:a(),displayName:a(),description:a(),props:jr,requireAuth:H(),errorHandlingOptions:y(xr),outputSchema:y(Ct()),audience:y(kl),aiMetadata:y(Ti)}),Ii=l({name:a(),displayName:a(),description:a(),props:jr,errorHandlingOptions:y(xr),type:L(Se),sampleData:R(),handshakeConfiguration:y(Ct()),renewConfiguration:y(vi),testStrategy:L(yt),outputSchema:y(Ct()),aiMetadata:y(Ti)}),Ol=l({...bi.shape,actions:N(a(),Ei),triggers:N(a(),Ii)}),wl=l({...bi.shape,actions:ne(),triggers:ne(),suggestedActions:y(U(Ii)),suggestedTriggers:y(U(Ei))}),$i=l({projectUsage:ne(),tags:y(U(a())),pieceType:L(Le),packageType:L(mt),platformId:y(a()),archiveId:y(a())}),eS=l({...Ol.shape,...$i.shape}),tS=l({...wl.shape,...$i.shape}),rS=l({name:a(),version:a()});var Rl=Oe(require("path")),Nl=Oe(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 Br,r=new Fr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Br=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Fr=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 qe=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[F,ie]of Object.entries(c))i.append(F,ie);let p=i.toString(),f=p?`${n}?${p}`:n,h=t.responseType??"json",_=t.followRedirects??!0,I=t.retries??0,{body:x,extraHeaders:s,isStream:d}=Dl(t.body,u),g=Ul({...u,...s}),m=await Cl(async()=>{let F=new AbortController,ie=t.timeout&&t.timeout>0?setTimeout(()=>F.abort(),t.timeout):void 0;try{let ce={method:t.method.toString(),headers:g,body:x,redirect:_?"follow":"manual",signal:F.signal};return d&&(ce.duplex="half"),r?.dispatcher!==void 0&&(ce.dispatcher=r.dispatcher),await fetch(f,ce)}finally{ie!==void 0&&clearTimeout(ie)}},I),v=_?300:400;if(m.status<200||m.status>=v){let F=await Si(m,h),ie=new qe(t.body,{status:m.status,responseBody:F});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ie),ie}let P=await Si(m,h);return{status:m.status,headers:Ml(m.headers),body:P}}};function Dl(e,t){return Ll(e)?{body:void 0,extraHeaders:{},isStream:!1}:jl(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(Dl,"serializeBody");async function Si(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(Si,"parseResponseBody");async function Cl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ai(n);continue}return i}catch(i){if(r=i,n<t){await Ai(n);continue}throw i}throw r}o(Cl,"sendWithRetries");function Ai(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ai,"backoff");function Ul(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(Ul,"normalizeHeaders");function Ml(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Ml,"toHttpHeaders");function jl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(jl,"isNodeFormData");function Ll(e){return e==null}o(Ll,"isNil");var S=new qt;var q=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(q||{});var Sd=Oe(require("fs")),Ns=Oe(Rs());var Ad={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function zd(e){let t=e.split(";")[0].trim().toLowerCase();return Ad[t]??""}o(zd,"contentTypeToExtension");var kd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Od=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 Ds({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return C({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:h})=>({url:b.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${Od(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:b.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(q).map(h=>({label:h,value:h}))},...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:h})=>{if(!h)return{};let _=h,I={};switch(_){case"none":break;case"json":I.data=b.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=b.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.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 I},"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}),...p},run:o(async h=>{let{method:_,url:I,headers:x,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:P,followRedirects:F}=h.propsValue;Lt(_,"Method"),Lt(I,"URL");let ie=pe(r)?{}:await r(h.auth,h.propsValue),ce=I.url,Ye=ce.startsWith("http://")||ce.startsWith("https://")?ce:kd({baseUrl:t(h.auth),relativePath:ce}),ke={method:_,url:Ye,headers:{...x??{},...f==="headers"||!pe(f)?ie:{}},queryParams:{...f==="queryParams"?ie:{},...s??{}},timeout:v?v*1e3:0,followRedirects:F};if(P&&(ke.responseType="arraybuffer"),d)if(g&&g!=="none"){let ge=d.data;if(g==="form_data"){let au=ge,Tt=new Ns.default;for(let{fieldName:dn,fieldType:mn,textFieldValue:fn,fileFieldValue:nr}of au)mn==="text"&&!ht(fn)?Tt.append(dn,fn):mn==="file"&&!ht(nr)&&Tt.append(dn,nr.data,{filename:nr?.filename});ke.body=Tt,ke.headers={...ke.headers,...Tt.getHeaders()}}else ke.body=ge}else g||(ke.body=d);try{let ge=await S.sendRequest(ke);return await wd(h.files,ge.body,ge.status,ge.headers,P)}catch(ge){if(m)return ge.errorMessage();throw ge}},"run")})}o(Ds,"createCustomApiCallAction");var wd=o(async(e,t,r,n,i)=>{let u;if(i&&Rd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=zd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Rd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Cs=C({auth:A,name:"send_email",displayName:"Send Email",description:"Send a text or HTML email",audience:"both",aiMetadata:{description:"Sends a single transactional email (plain text or HTML) to one or more recipients via Resend. Use this for one-off messages; the sender address must be on a domain you have verified in Resend. Not idempotent \u2014 each call sends a new email.",idempotent:!1},props:{to:b.Array({displayName:"To",description:"Emails of the recipients",required:!0}),from_name:b.ShortText({displayName:"Sender Name",description:"Sender name",required:!0}),from:b.ShortText({displayName:"Sender Email (From)",description:"Sender email",required:!0}),bcc:b.Array({displayName:"BCC",description:"List of emails in bcc",required:!1}),cc:b.Array({displayName:"CC",description:"List of emails in cc",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email to receive replies on (defaults to sender)",required:!1}),subject:b.ShortText({displayName:"Subject",description:void 0,required:!0}),content_type:b.Dropdown({auth:A,displayName:"Content Type",refreshers:[],required:!0,defaultValue:"html",options:o(async()=>({disabled:!1,options:[{label:"Plain Text",value:"text"},{label:"HTML",value:"html"}]}),"options")}),content:b.ShortText({displayName:"Content",description:"HTML is only allowed if you selected HTML as type",required:!0})},async run(e){let{to:t,from:r,from_name:n,reply_to:i,subject:u,content_type:c,content:p,cc:f,bcc:h}=e.propsValue,_={to:t,from:n?`${n} <${r}>`:r,reply_to:i??r,cc:f,bcc:h,subject:u};return c==="text"?_.text=p:c==="html"&&(_.html=p),await S.sendRequest({method:"POST",url:"https://api.resend.com/emails",body:_,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},queryParams:{}})}});var Nd="https://api.resend.com",Us=C({name:"send_batch_emails",auth:A,displayName:"Send Batch Emails",description:"Send up to 100 emails in a single API call",audience:"both",aiMetadata:{description:"Sends up to 100 distinct emails in one Resend API call, each with its own recipient, subject, and body. Use this instead of Send Email when delivering many independent messages at once. Senders must be on verified domains; pass an idempotency key to guard against duplicate batch sends, otherwise each call sends new emails.",idempotent:!1},props:{emails:b.Array({displayName:"Emails",description:"List of emails to send (max 100). Each email is sent independently with its own recipient, subject, and body.",required:!0,properties:{from:b.ShortText({displayName:"From",description:'Sender address. Use "Name <email@domain.com>" for a friendly name.',required:!0}),to:b.ShortText({displayName:"To",description:"Recipient email address.",required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0}),reply_to:b.ShortText({displayName:"Reply To",required:!1}),cc:b.ShortText({displayName:"CC",required:!1}),bcc:b.ShortText({displayName:"BCC",required:!1})}}),idempotency_key:b.ShortText({displayName:"Idempotency Key",description:"Optional unique key to prevent duplicate sends. Must be unique per request, expires after 24 hours, max 256 characters.",required:!1})},async run({auth:e,propsValue:t}){let r=(t.emails??[]).map(u=>{let c=u,p={from:c.from,to:c.to,subject:c.subject};return c.content_type==="html"?p.html=c.content:p.text=c.content,c.reply_to&&(p.reply_to=c.reply_to),c.cc&&(p.cc=c.cc),c.bcc&&(p.bcc=c.bcc),p}),n={};return t.idempotency_key&&(n["Idempotency-Key"]=t.idempotency_key),(await S.sendRequest({method:"POST",url:`${Nd}/emails/batch`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},headers:n,body:r})).body.data}});var rr="https://api.resend.com",Dd=b.Dropdown({displayName:"Audience",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await S.sendRequest({method:"GET",url:`${rr}/audiences`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),Cd=b.Dropdown({displayName:"Domain",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await S.sendRequest({method:"GET",url:`${rr}/domains`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),Ud=b.Dropdown({displayName:"Broadcast",required:!0,auth:A,refreshers:[],options:o(async({auth:e})=>e?{options:(await S.sendRequest({method:"GET",url:`${rr}/broadcasts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({label:r.name?`${r.name} \u2014 ${r.subject}`:r.subject,value:r.id}))}:{disabled:!0,placeholder:"Connect your Resend account first",options:[]},"options")}),Md=b.Dropdown({displayName:"Contact",required:!0,auth:A,refreshers:["audience_id"],options:o(async({auth:e,audience_id:t})=>!e||!t?{disabled:!0,placeholder:"Select an audience first",options:[]}:{options:(await S.sendRequest({method:"GET",url:`${rr}/audiences/${String(t)}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(n=>{let i=[n.first_name,n.last_name].filter(Boolean).join(" ");return{label:i?`${i} <${n.email}>`:n.email,value:n.id}})},"options")}),Q={audienceId:Dd,domainId:Cd,broadcastId:Ud,contactId:Md};var Ms=C({name:"create_contact",auth:A,displayName:"Create Contact",description:"Add a contact to a Resend audience",audience:"both",aiMetadata:{description:"Adds a new contact (email plus optional name and subscription status) to a specific Resend audience. Use this to grow a mailing list; requires the target audience ID (use List Audiences to find it). Not idempotent \u2014 each call creates a new contact, so guard against re-adding the same email.",idempotent:!1},props:{audience_id:Q.audienceId,email:b.ShortText({displayName:"Email",required:!0}),first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.Checkbox({displayName:"Unsubscribed",description:"If true, the contact will be unsubscribed from all broadcasts",required:!1,defaultValue:!1})},async run({auth:e,propsValue:t}){let r={email:t.email};return t.first_name&&(r.first_name=t.first_name),t.last_name&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&(r.unsubscribed=t.unsubscribed),(await S.sendRequest({method:"POST",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var js=C({name:"update_contact",auth:A,displayName:"Update Contact",description:"Update the name or subscription status of a contact in an audience",audience:"both",aiMetadata:{description:"Updates an existing contact's first name, last name, or subscribed/unsubscribed status within an audience, identified by audience ID and contact ID. Use this to change details or toggle subscription for a known contact. Idempotent \u2014 repeating with the same values leaves the contact in the same state.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId,first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),unsubscribed:b.StaticDropdown({displayName:"Subscription Status",required:!1,options:{options:[{label:"Subscribed",value:!1},{label:"Unsubscribed",value:!0}]}})},async run({auth:e,propsValue:t}){let r={};return t.first_name!==void 0&&t.first_name!==""&&(r.first_name=t.first_name),t.last_name!==void 0&&t.last_name!==""&&(r.last_name=t.last_name),t.unsubscribed!==void 0&&t.unsubscribed!==null&&(r.unsubscribed=t.unsubscribed),(await S.sendRequest({method:"PATCH",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var Ls=C({name:"delete_contact",auth:A,displayName:"Delete Contact",description:"Remove a contact from an audience",audience:"both",aiMetadata:{description:"Permanently removes a contact from a Resend audience, identified by audience ID and contact ID. Use this to delete a subscriber from a list. Effectively idempotent \u2014 once removed, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId,contact_id:Q.contactId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}/contacts/${t.contact_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Bs=C({name:"list_contacts",auth:A,displayName:"List Contacts",description:"Retrieve all contacts in an audience",audience:"both",aiMetadata:{description:"Retrieves all contacts in a specific Resend audience, including each contact's ID, email, name, and subscription status. Use this to discover contact IDs (e.g. to feed Update Contact or Delete Contact) or to inspect a mailing list; requires the audience ID. Read-only and idempotent.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"GET",url:`https://api.resend.com/audiences/${t.audience_id}/contacts`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var Fs=C({name:"get_email_status",auth:A,displayName:"Get Email Status",description:"Retrieve the delivery status of a sent email",audience:"both",aiMetadata:{description:"Looks up the current delivery status and details of a single previously sent email by its Resend email ID. Use this to check whether a specific email was delivered, bounced, or is still scheduled. Read-only and idempotent; requires the email ID returned when the email was sent.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:"The ID returned when you sent the email",required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"GET",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Zs=C({name:"list_emails",auth:A,displayName:"List Sent Emails",description:"Retrieve a list of emails sent from your Resend account",audience:"both",aiMetadata:{description:"Retrieves the list of emails sent from the connected Resend account, including their IDs, recipients, subjects, and latest delivery event. Use this to discover email IDs (e.g. to feed Get Email Status, Cancel Scheduled Email, or Reschedule Email) or to audit recent sends. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/emails",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,from:r.from,to:(r.to??[]).join(", "),subject:r.subject,last_event:r.last_event,created_at:r.created_at,scheduled_at:r.scheduled_at??"",cc:(r.cc??[]).join(", "),bcc:(r.bcc??[]).join(", "),reply_to:(r.reply_to??[]).join(", ")}))}});var Vs=C({name:"cancel_scheduled_email",auth:A,displayName:"Cancel Scheduled Email",description:"Cancel a scheduled email before it is sent",audience:"both",aiMetadata:{description:"Cancels a previously scheduled email so it will not be delivered, identified by its Resend email ID. Use this to stop a future send before its scheduled time. Effectively idempotent \u2014 once an email is cancelled, repeating the call has no further effect; only works while the email is still pending.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to cancel. Use "List Sent Emails" to find it.',required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"POST",url:`https://api.resend.com/emails/${t.email_id}/cancel`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Hs=C({name:"reschedule_email",auth:A,displayName:"Reschedule Email",description:"Update the send time of a scheduled email",audience:"both",aiMetadata:{description:"Changes the future send time of an already scheduled email, identified by its Resend email ID. Use this to move a pending send to a new time without cancelling and recreating it. Idempotent when called with the same target time; requires an ISO 8601 date-time and only works while the email is still scheduled.",idempotent:!0},props:{email_id:b.ShortText({displayName:"Email ID",description:'The ID of the scheduled email to reschedule. Use "List Sent Emails" to find it.',required:!0}),scheduled_at:b.ShortText({displayName:"New Send Time",description:"ISO 8601 date-time for when to send the email, e.g. 2024-12-01T10:00:00Z",required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"PATCH",url:`https://api.resend.com/emails/${t.email_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{scheduled_at:t.scheduled_at}})).body}});var qs=C({name:"list_domains",auth:A,displayName:"List Domains",description:"Retrieve all domains added to your Resend account",audience:"both",aiMetadata:{description:"Retrieves all sending domains configured on the connected Resend account, including each domain's ID, name, verification status, and region. Use this to find a domain ID (e.g. for Verify Domain or Delete Domain) or to check which domains are verified before sending. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name,status:r.status,region:r.region,created_at:r.created_at,sending:r.capabilities?.sending??"",receiving:r.capabilities?.receiving??""}))}});var Ws=C({name:"create_domain",auth:A,displayName:"Create Domain",description:"Add a sending domain to your Resend account and get the DNS records to verify it",audience:"both",aiMetadata:{description:"Registers a new sending domain on the Resend account and returns the DNS records that must be added to verify it. Use this as the first step in setting up a custom sending domain before triggering verification. Not idempotent \u2014 each call attempts to create a new domain entry.",idempotent:!1},props:{name:b.ShortText({displayName:"Domain Name",description:"The domain you want to send from, e.g. mail.yourdomain.com",required:!0}),region:b.StaticDropdown({displayName:"Region",description:"AWS region for email delivery. Defaults to US East.",required:!1,options:{options:[{label:"US East (N. Virginia)",value:"us-east-1"},{label:"EU West (Ireland)",value:"eu-west-1"},{label:"Asia Pacific (Tokyo)",value:"ap-northeast-1"},{label:"South America (S\xE3o Paulo)",value:"sa-east-1"}]}})},async run({auth:e,propsValue:t}){let r={name:t.name};t.region&&(r.region=t.region);let i=(await S.sendRequest({method:"POST",url:"https://api.resend.com/domains",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body;return{id:i.id,name:i.name,status:i.status,region:i.region,created_at:i.created_at,sending:i.capabilities?.sending??"",receiving:i.capabilities?.receiving??"",dns_records:i.records}}});var Gs=C({name:"delete_domain",auth:A,displayName:"Delete Domain",description:"Remove a domain from your Resend account",audience:"both",aiMetadata:{description:"Permanently removes a sending domain from the Resend account, identified by its domain ID. Use this to decommission a domain you no longer send from. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/domains/${t.domain_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Ks=C({name:"verify_domain",auth:A,displayName:"Verify Domain",description:"Trigger a DNS verification check for a domain",audience:"both",aiMetadata:{description:"Triggers Resend to re-check the DNS records of a domain and update its verification status, identified by domain ID. Use this after adding the required DNS records (from Create Domain) to confirm the domain is ready to send. Safe to call repeatedly \u2014 it only re-runs the check.",idempotent:!0},props:{domain_id:Q.domainId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"POST",url:`https://api.resend.com/domains/${t.domain_id}/verify`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Js=C({name:"list_audiences",auth:A,displayName:"List Audiences",description:"Retrieve all contact audiences in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all contact audiences (mailing lists) in the connected Resend account, including each audience's ID and name. Use this to discover an audience ID needed by contact and broadcast actions (e.g. Create Contact, List Contacts, Create Broadcast). Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data}});var Xs=C({name:"create_audience",auth:A,displayName:"Create Audience",description:"Create a new contact audience in Resend",audience:"both",aiMetadata:{description:"Creates a new contact audience (mailing list) in Resend with the given name and returns its ID. Use this before adding contacts or sending broadcasts when no suitable audience exists yet. Not idempotent \u2014 each call creates a new audience even if the name matches an existing one.",idempotent:!1},props:{name:b.ShortText({displayName:"Audience Name",description:'A label for this audience, e.g. "Newsletter Subscribers"',required:!0})},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"POST",url:"https://api.resend.com/audiences",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:{name:t.name}})).body}});var Ys=C({name:"delete_audience",auth:A,displayName:"Delete Audience",description:"Permanently delete an audience and all its contacts",audience:"both",aiMetadata:{description:"Permanently deletes an entire audience and all of its contacts from Resend, identified by audience ID. Use this to remove a whole mailing list; this is destructive and cannot be undone. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{audience_id:Q.audienceId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/audiences/${t.audience_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var Qs=C({name:"list_broadcasts",auth:A,displayName:"List Broadcasts",description:"Retrieve all broadcasts in your Resend account",audience:"both",aiMetadata:{description:"Retrieves all broadcast campaigns in the connected Resend account, including each broadcast's ID, name, audience, subject, and status (draft, scheduled, sent). Use this to find a broadcast ID (e.g. for Send Broadcast or Delete Broadcast) or to check campaign status. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){return(await S.sendRequest({method:"GET",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body.data.map(r=>({id:r.id,name:r.name??"",audience_id:r.audience_id,from:r.from,subject:r.subject,reply_to:Array.isArray(r.reply_to)?r.reply_to.join(", "):r.reply_to??"",preview_text:r.preview_text??"",status:r.status,created_at:r.created_at,scheduled_at:r.scheduled_at??"",sent_at:r.sent_at??""}))}});var eu=C({name:"create_broadcast",auth:A,displayName:"Create Broadcast",description:"Create a new broadcast email to send to an audience",audience:"both",aiMetadata:{description:"Creates a draft broadcast email (subject and body) targeting a Resend audience and returns its ID. Use this to prepare a campaign; it only creates the draft and does not deliver anything \u2014 pair it with Send Broadcast to actually send. Requires the audience ID and a sender on a verified domain. Not idempotent \u2014 each call creates a new broadcast.",idempotent:!1},props:{audience_id:Q.audienceId,from:b.ShortText({displayName:"From",description:'Sender address. Must be from a verified domain. Use "Name <email@yourdomain.com>" for a friendly name.',required:!0}),subject:b.ShortText({displayName:"Subject",required:!0}),name:b.ShortText({displayName:"Broadcast Name",description:"Internal label for this broadcast. Not visible to recipients.",required:!1}),reply_to:b.ShortText({displayName:"Reply To",description:"Email address recipients will reply to.",required:!1}),preview_text:b.ShortText({displayName:"Preview Text",description:"Short summary shown in email clients below the subject line.",required:!1}),content_type:b.StaticDropdown({displayName:"Content Type",required:!0,options:{options:[{label:"HTML",value:"html"},{label:"Plain Text",value:"text"}]}}),content:b.LongText({displayName:"Content",description:"Email body. Use HTML markup if Content Type is HTML.",required:!0})},async run({auth:e,propsValue:t}){let r={audience_id:t.audience_id,from:t.from,subject:t.subject};return t.content_type==="html"?r.html=t.content:r.text=t.content,t.name&&(r.name=t.name),t.reply_to&&(r.reply_to=t.reply_to),t.preview_text&&(r.preview_text=t.preview_text),(await S.sendRequest({method:"POST",url:"https://api.resend.com/broadcasts",authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var tu=C({name:"send_broadcast",auth:A,displayName:"Send Broadcast",description:"Send or schedule a broadcast email to its audience",audience:"both",aiMetadata:{description:"Sends an existing draft broadcast to its entire audience immediately, or schedules it for a future time, identified by broadcast ID. Use this after Create Broadcast to deliver the campaign. Not idempotent \u2014 repeating the call can dispatch the broadcast again; optionally pass an ISO 8601 time to schedule rather than send now.",idempotent:!1},props:{broadcast_id:Q.broadcastId,scheduled_at:b.ShortText({displayName:"Schedule For",description:"ISO 8601 date-time to schedule the send, e.g. 2024-12-01T10:00:00Z. Leave blank to send immediately.",required:!1})},async run({auth:e,propsValue:t}){let r={};return t.scheduled_at&&(r.scheduled_at=t.scheduled_at),(await S.sendRequest({method:"POST",url:`https://api.resend.com/broadcasts/${t.broadcast_id}/send`,authentication:{type:"BEARER_TOKEN",token:e.secret_text},body:r})).body}});var ru=C({name:"delete_broadcast",auth:A,displayName:"Delete Broadcast",description:"Permanently delete a broadcast from your Resend account",audience:"both",aiMetadata:{description:"Permanently deletes a broadcast from the Resend account, identified by broadcast ID. Use this to remove a draft or unwanted campaign; only broadcasts that have not been sent can be deleted. Effectively idempotent \u2014 once deleted, repeating the call has no further effect.",idempotent:!0},props:{broadcast_id:Q.broadcastId},async run({auth:e,propsValue:t}){return(await S.sendRequest({method:"DELETE",url:`https://api.resend.com/broadcasts/${t.broadcast_id}`,authentication:{type:"BEARER_TOKEN",token:e.secret_text}})).body}});var pn=Oe(require("crypto"));var nu="https://api.resend.com",ln="webhookData",jd=300,Ld=[{label:"Email Sent",value:"email.sent"},{label:"Email Delivered",value:"email.delivered"},{label:"Email Delivery Delayed",value:"email.delivery_delayed"},{label:"Email Complained",value:"email.complained"},{label:"Email Bounced",value:"email.bounced"},{label:"Email Opened",value:"email.opened"},{label:"Email Clicked",value:"email.clicked"},{label:"Email Failed",value:"email.failed"},{label:"Email Received",value:"email.received"},{label:"Email Scheduled",value:"email.scheduled"},{label:"Email Suppressed",value:"email.suppressed"},{label:"Domain Created",value:"domain.created"},{label:"Domain Updated",value:"domain.updated"},{label:"Domain Deleted",value:"domain.deleted"},{label:"Contact Created",value:"contact.created"},{label:"Contact Updated",value:"contact.updated"},{label:"Contact Deleted",value:"contact.deleted"}];function Bd({rawBody:e,headers:t,signingSecret:r}){let n=t["svix-id"],i=t["svix-timestamp"],u=t["svix-signature"];if(!n||!i||!u)return!1;let c=Math.floor(Date.now()/1e3);if(Math.abs(c-parseInt(i,10))>jd)return!1;let p=Buffer.isBuffer(e)?e.toString("utf8"):String(e),f=Buffer.from(r.replace("whsec_",""),"base64"),h=`${n}.${i}.${p}`,_=pn.default.createHmac("sha256",f).update(h).digest("base64");return u.split(" ").some(I=>{let[x,s]=I.split(",");if(x!=="v1"||!s)return!1;try{return pn.default.timingSafeEqual(Buffer.from(s,"base64"),Buffer.from(_,"base64"))}catch{return!1}})}o(Bd,"verifyResendWebhook");var ou=xi({name:"email_bounced",auth:A,displayName:"Email Event",description:"Triggers when a selected email or contact event occurs in Resend",aiMetadata:{description:"Fires when one of the subscribed Resend events occurs, such as an email being sent, delivered, bounced, opened, clicked, complained about, or failing, as well as domain and contact lifecycle events. The payload carries the event type and the affected email, domain, or contact. Subscribe to the specific event types you care about."},type:"WEBHOOK",props:{events:b.StaticMultiSelectDropdown({displayName:"Events",description:"Select one or more event types to subscribe to",required:!0,options:{options:Ld}})},async onEnable(e){let t=await S.sendRequest({method:"POST",url:`${nu}/webhooks`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text},body:{endpoint:e.webhookUrl,events:e.propsValue.events}});await e.store.put(ln,{id:t.body.id,signingSecret:t.body.signing_secret})},async onDisable(e){let t=await e.store.get(ln);t?.id&&await S.sendRequest({method:"DELETE",url:`${nu}/webhooks/${t.id}`,authentication:{type:"BEARER_TOKEN",token:e.auth.secret_text}})},async run(e){let t=await e.store.get(ln);return Bd({rawBody:e.payload.rawBody,headers:e.payload.headers,signingSecret:t?.signingSecret??""})?[e.payload.body]:[]},sampleData:{type:"email.bounced",created_at:"2024-03-08T09:37:40.912Z",data:{created_at:"2024-03-08T09:37:40.911Z",email_id:"562e3f00-6bad-4910-b1e3-38c2fca1e2ff",from:"onboarding@resend.dev",to:["john@example.com"],subject:"Re: Follow up"}}});var iu="https://api.resend.com",A=Mr.SecretText({displayName:"API Key",description:`To get your API key:
34
4
  1. Log in to your [Resend dashboard](https://resend.com/overview)
35
5
  2. Go to **API Keys** in the left sidebar
36
- 3. Click **Create API Key**, give it a name, and copy the key`,
37
- required: true,
38
- validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
39
- try {
40
- yield pieces_common_1.httpClient.sendRequest({
41
- method: pieces_common_1.HttpMethod.GET,
42
- url: `${BASE_URL}/api-keys`,
43
- authentication: {
44
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
45
- token: auth,
46
- },
47
- });
48
- return { valid: true };
49
- }
50
- catch (error) {
51
- // A restricted (send-only) key returns 401 with name 'restricted_api_key' — it is valid
52
- if (error instanceof pieces_common_1.HttpError) {
53
- const body = error.response.body;
54
- if (typeof body === 'object' && body !== null && 'name' in body && body.name === 'restricted_api_key') {
55
- return { valid: true };
56
- }
57
- }
58
- return { valid: false, error: 'Invalid API key. Please check your Resend API key.' };
59
- }
60
- }),
61
- });
62
- exports.resend = (0, pieces_framework_1.createPiece)({
63
- displayName: 'Resend',
64
- description: 'The email API for developers',
65
- auth: exports.resendAuth,
66
- minimumSupportedRelease: '0.36.1',
67
- logoUrl: 'https://cdn.activepieces.com/pieces/resend.png',
68
- categories: [shared_1.PieceCategory.COMMUNICATION],
69
- authors: ['Tosh94'],
70
- actions: [
71
- send_email_1.sendEmail,
72
- send_batch_emails_action_1.sendBatchEmails,
73
- get_email_status_action_1.getEmailStatus,
74
- list_emails_action_1.listEmails,
75
- cancel_scheduled_email_action_1.cancelScheduledEmail,
76
- reschedule_email_action_1.rescheduleEmail,
77
- create_contact_action_1.createContact,
78
- update_contact_action_1.updateContact,
79
- delete_contact_action_1.deleteContact,
80
- list_contacts_action_1.listContacts,
81
- list_domains_action_1.listDomains,
82
- create_domain_action_1.createDomain,
83
- delete_domain_action_1.deleteDomain,
84
- verify_domain_action_1.verifyDomain,
85
- list_audiences_action_1.listAudiences,
86
- create_audience_action_1.createAudience,
87
- delete_audience_action_1.deleteAudience,
88
- list_broadcasts_action_1.listBroadcasts,
89
- create_broadcast_action_1.createBroadcast,
90
- send_broadcast_action_1.sendBroadcast,
91
- delete_broadcast_action_1.deleteBroadcast,
92
- (0, pieces_common_1.createCustomApiCallAction)({
93
- baseUrl: () => BASE_URL,
94
- auth: exports.resendAuth,
95
- authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
96
- return ({
97
- Authorization: `Bearer ${auth.secret_text}`,
98
- });
99
- }),
100
- }),
101
- ],
102
- triggers: [email_bounced_trigger_1.emailBounced],
103
- });
104
- //# sourceMappingURL=index.js.map
6
+ 3. Click **Create API Key**, give it a name, and copy the key`,required:!0,validate:o(async({auth:e})=>{try{return await S.sendRequest({method:"GET",url:`${iu}/api-keys`,authentication:{type:"BEARER_TOKEN",token:e}}),{valid:!0}}catch(t){if(t instanceof qe){let r=t.response.body;if(typeof r=="object"&&r!==null&&"name"in r&&r.name==="restricted_api_key")return{valid:!0}}return{valid:!1,error:"Invalid API key. Please check your Resend API key."}}},"validate")}),Fd=Pi({displayName:"Resend",description:"The email API for developers",auth:A,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/resend.png",categories:["COMMUNICATION"],authors:["Tosh94"],actions:[Cs,Us,Fs,Zs,Vs,Hs,Ms,js,Ls,Bs,qs,Ws,Gs,Ks,Js,Xs,Ys,Qs,eu,tu,ru,Ds({baseUrl:o(()=>iu,"baseUrl"),auth:A,authMapping:o(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],triggers:[ou]});0&&(module.exports={resend,resendAuth});
7
+ /*! Bundled license information:
8
+
9
+ mime-types/index.js:
10
+ (*!
11
+ * mime-types
12
+ * Copyright(c) 2014 Jonathan Ong
13
+ * Copyright(c) 2015 Douglas Christopher Wilson
14
+ * MIT Licensed
15
+ *)
16
+ */
package/src/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export declare const resendAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
- export declare const resend: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,UAAU,mEA6BrB,CAAC;AAEH,eAAO,MAAM,MAAM,mHAuCjB,CAAC"}
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAMqC;AACrC,iDAAqD;AACrD,yDAAqD;AACrD,qFAAyE;AACzE,+EAAoE;AACpE,+EAAoE;AACpE,+EAAoE;AACpE,6EAAkE;AAClE,mFAAuE;AACvE,yEAA8D;AAC9D,+FAAmF;AACnF,mFAAwE;AACxE,2EAAgE;AAChE,6EAAkE;AAClE,6EAAkE;AAClE,6EAAkE;AAClE,+EAAoE;AACpE,iFAAsE;AACtE,iFAAsE;AACtE,iFAAsE;AACtE,mFAAwE;AACxE,+EAAoE;AACpE,mFAAwE;AACxE,gFAAoE;AAEpE,MAAM,QAAQ,GAAG,wBAAwB,CAAC;AAE7B,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE;;;8DAG+C;IAC5D,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,QAAQ,WAAW;gBAC3B,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,IAAI;iBACZ;aACF,CAAC,CAAC;YACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,wFAAwF;YACxF,IAAI,KAAK,YAAY,yBAAS,EAAE,CAAC;gBAC/B,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACjC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;oBACtG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;gBACzB,CAAC;YACH,CAAC;YACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,oDAAoD,EAAE,CAAC;QACvF,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,8BAA8B;IAC3C,IAAI,EAAE,kBAAU;IAChB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gDAAgD;IACzD,UAAU,EAAE,CAAC,sBAAa,CAAC,aAAa,CAAC;IACzC,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,OAAO,EAAE;QACP,sBAAS;QACT,0CAAe;QACf,wCAAc;QACd,+BAAU;QACV,oDAAoB;QACpB,yCAAe;QACf,qCAAa;QACb,qCAAa;QACb,qCAAa;QACb,mCAAY;QACZ,iCAAW;QACX,mCAAY;QACZ,mCAAY;QACZ,mCAAY;QACZ,qCAAa;QACb,uCAAc;QACd,uCAAc;QACd,uCAAc;QACd,yCAAe;QACf,qCAAa;QACb,yCAAe;QACf,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ;YACvB,IAAI,EAAE,kBAAU;YAChB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAW,IAAgC,CAAC,WAAW,EAAE;iBACzE,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,oCAAY,CAAC;CACzB,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const cancelScheduledEmail: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- email_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=cancel-scheduled-email.action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-scheduled-email.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/cancel-scheduled-email.action.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB;;EAoB/B,CAAC"}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cancelScheduledEmail = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- exports.cancelScheduledEmail = (0, pieces_framework_1.createAction)({
9
- name: 'cancel_scheduled_email',
10
- auth: __1.resendAuth,
11
- displayName: 'Cancel Scheduled Email',
12
- description: 'Cancel a scheduled email before it is sent',
13
- props: {
14
- email_id: pieces_framework_1.Property.ShortText({
15
- displayName: 'Email ID',
16
- description: 'The ID of the scheduled email to cancel. Use "List Sent Emails" to find it.',
17
- required: true,
18
- }),
19
- },
20
- run(_a) {
21
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
22
- const response = yield pieces_common_1.httpClient.sendRequest({
23
- method: pieces_common_1.HttpMethod.POST,
24
- url: `https://api.resend.com/emails/${propsValue.email_id}/cancel`,
25
- authentication: { type: pieces_common_1.AuthenticationType.BEARER_TOKEN, token: auth.secret_text },
26
- });
27
- return response.body;
28
- });
29
- },
30
- });
31
- //# sourceMappingURL=cancel-scheduled-email.action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-scheduled-email.action.js","sourceRoot":"","sources":["../../../../src/lib/actions/cancel-scheduled-email.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,6BAAmC;AAEtB,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,4CAA4C;IACzD,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,6EAA6E;YAC1F,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAiC;gBAC5E,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,iCAAiC,UAAU,CAAC,QAAQ,SAAS;gBAClE,cAAc,EAAE,EAAE,IAAI,EAAE,kCAAkB,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE;aACnF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const createAudience: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=create-audience.action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-audience.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-audience.action.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;EA0BzB,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAudience = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- exports.createAudience = (0, pieces_framework_1.createAction)({
9
- name: 'create_audience',
10
- auth: __1.resendAuth,
11
- displayName: 'Create Audience',
12
- description: 'Create a new contact audience in Resend',
13
- props: {
14
- name: pieces_framework_1.Property.ShortText({
15
- displayName: 'Audience Name',
16
- description: 'A label for this audience, e.g. "Newsletter Subscribers"',
17
- required: true,
18
- }),
19
- },
20
- run(_a) {
21
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
22
- const response = yield pieces_common_1.httpClient.sendRequest({
23
- method: pieces_common_1.HttpMethod.POST,
24
- url: 'https://api.resend.com/audiences',
25
- authentication: { type: pieces_common_1.AuthenticationType.BEARER_TOKEN, token: auth.secret_text },
26
- body: { name: propsValue.name },
27
- });
28
- return response.body;
29
- });
30
- },
31
- });
32
- //# sourceMappingURL=create-audience.action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-audience.action.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-audience.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyF;AACzF,6BAAmC;AAEtB,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,cAAU;IAChB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,yCAAyC;IACtD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAK1C;gBACD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,kCAAkC;gBACvC,cAAc,EAAE,EAAE,IAAI,EAAE,kCAAkB,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE;gBAClF,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE;aAChC,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}