resend-cli 1.9.0-preview-automations.1 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -1,175 +1,165 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var _y=Object.create;var ci=Object.defineProperty;var yy=Object.getOwnPropertyDescriptor;var Cy=Object.getOwnPropertyNames;var Oy=Object.getPrototypeOf,Sy=Object.prototype.hasOwnProperty;var B=(e,t)=>()=>(e&&(t=e(e=0)),t);var f=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),or=(e,t)=>{for(var r in t)ci(e,r,{get:t[r],enumerable:!0})},td=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Cy(t))!Sy.call(e,n)&&n!==r&&ci(e,n,{get:()=>t[n],enumerable:!(i=yy(t,n))||i.enumerable});return e};var le=(e,t,r)=>(r=e!=null?_y(Oy(e)):{},td(t||!e||!e.__esModule?ci(r,"default",{value:e,enumerable:!0}):r,e)),xy=e=>td(ci({},"__esModule",{value:!0}),e);var Rr=f(mu=>{var di=class extends Error{constructor(t,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},du=class extends di{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};mu.CommanderError=di;mu.InvalidArgumentError=du});var mi=f(fu=>{var{InvalidArgumentError:wy}=Rr(),pu=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new wy(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function ky(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}fu.Argument=pu;fu.humanReadableArgName=ky});var bu=f(gu=>{var{humanReadableArgName:Ay}=mi(),hu=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),i=t._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,o)=>n.name().localeCompare(o.name())),r}compareOptions(t,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(t).localeCompare(i(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),i=t._getHelpOption();if(i&&!i.hidden){let n=i.short&&t._findOption(i.short),o=i.long&&t._findOption(i.long);!n&&!o?r.push(i):i.long&&!o?r.push(t.createOption(i.long,i.description)):i.short&&!n&&r.push(t.createOption(i.short,i.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let i=t.parent;i;i=i.parent){let n=i.options.filter(o=>!o.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(i=>Ay(i)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let i="";for(let n=t.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,r,i){return r.length===0?[]:[i.styleTitle(t),...r,""]}groupItems(t,r,i){let n=new Map;return t.forEach(o=>{let s=i(o);n.has(s)||n.set(s,[])}),r.forEach(o=>{let s=i(o);n.has(s)||n.set(s,[]),n.get(s).push(o)}),n}formatHelp(t,r){let i=r.padWidth(t,r),n=r.helpWidth??80;function o(c,m){return r.formatItem(c,i,m,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),n),""]));let u=r.visibleArguments(t).map(c=>o(r.styleArgumentTerm(r.argumentTerm(c)),r.styleArgumentDescription(r.argumentDescription(c))));if(s=s.concat(this.formatItemList("Arguments:",u,r)),this.groupItems(t.options,r.visibleOptions(t),c=>c.helpGroupHeading??"Options:").forEach((c,m)=>{let _=c.map(g=>o(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));s=s.concat(this.formatItemList(m,_,r))}),r.showGlobalOptions){let c=r.visibleGlobalOptions(t).map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList("Global Options:",c,r))}return this.groupItems(t.commands,r.visibleCommands(t),c=>c.helpGroup()||"Commands:").forEach((c,m)=>{let _=c.map(g=>o(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));s=s.concat(this.formatItemList(m,_,r))}),s.join(`
3
- `)}displayWidth(t){return rd(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,i,n){let s=" ".repeat(2);if(!i)return s+t;let a=t.padEnd(r+t.length-n.displayWidth(t)),u=2,d=(this.helpWidth??80)-r-u-2,c;return d<this.minWidthToWrap||n.preformatted(i)?c=i:c=n.boxWrap(i,d).replace(/\n/g,`
4
- `+" ".repeat(r+u)),s+a+" ".repeat(u)+c.replace(/\n/g,`
5
- ${s}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let i=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,o=[];return i.forEach(s=>{let a=s.match(n);if(a===null){o.push("");return}let u=[a.shift()],l=this.displayWidth(u[0]);a.forEach(d=>{let c=this.displayWidth(d);if(l+c<=r){u.push(d),l+=c;return}o.push(u.join(""));let m=d.trimStart();u=[m],l=this.displayWidth(m)}),o.push(u.join(""))}),o.join(`
6
- `)}};function rd(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}gu.Help=hu;gu.stripColor=rd});var Cu=f(yu=>{var{InvalidArgumentError:Ey}=Rr(),vu=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let i=Py(t);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new Ey(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?id(this.name().replace(/^no-/,"")):id(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},_u=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(t,r){let i=r.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,o=n!==void 0?n:!1;return r.negate===(o===t)}};function id(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Py(e){let t,r,i=/^-[^-]$/,n=/^--[^-]/,o=e.split(/[ |,]+/).concat("guard");if(i.test(o[0])&&(t=o.shift()),n.test(o[0])&&(r=o.shift()),!t&&i.test(o[0])&&(t=o.shift()),!t&&n.test(o[0])&&(t=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${e}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
2
+ "use strict";var a2=Object.create;var ci=Object.defineProperty;var u2=Object.getOwnPropertyDescriptor;var l2=Object.getOwnPropertyNames;var c2=Object.getPrototypeOf,d2=Object.prototype.hasOwnProperty;var H=(e,t)=>()=>(e&&(t=e(e=0)),t);var f=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),or=(e,t)=>{for(var r in t)ci(e,r,{get:t[r],enumerable:!0})},Gc=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of l2(t))!d2.call(e,n)&&n!==r&&ci(e,n,{get:()=>t[n],enumerable:!(i=u2(t,n))||i.enumerable});return e};var le=(e,t,r)=>(r=e!=null?a2(c2(e)):{},Gc(t||!e||!e.__esModule?ci(r,"default",{value:e,enumerable:!0}):r,e)),m2=e=>Gc(ci({},"__esModule",{value:!0}),e);var Fr=f(uu=>{var di=class extends Error{constructor(t,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},au=class extends di{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};uu.CommanderError=di;uu.InvalidArgumentError=au});var mi=f(cu=>{var{InvalidArgumentError:p2}=Fr(),lu=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new p2(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function f2(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}cu.Argument=lu;cu.humanReadableArgName=f2});var pu=f(mu=>{var{humanReadableArgName:h2}=mi(),du=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden),i=t._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,o)=>n.name().localeCompare(o.name())),r}compareOptions(t,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(t).localeCompare(i(r))}visibleOptions(t){let r=t.options.filter(n=>!n.hidden),i=t._getHelpOption();if(i&&!i.hidden){let n=i.short&&t._findOption(i.short),o=i.long&&t._findOption(i.long);!n&&!o?r.push(i):i.long&&!o?r.push(t.createOption(i.long,i.description)):i.short&&!n&&r.push(t.createOption(i.short,i.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let i=t.parent;i;i=i.parent){let n=i.options.filter(o=>!o.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(i=>h2(i)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let i="";for(let n=t.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return t.description?`${t.description} ${i}`:i}return t.description}formatItemList(t,r,i){return r.length===0?[]:[i.styleTitle(t),...r,""]}groupItems(t,r,i){let n=new Map;return t.forEach(o=>{let s=i(o);n.has(s)||n.set(s,[])}),r.forEach(o=>{let s=i(o);n.has(s)||n.set(s,[]),n.get(s).push(o)}),n}formatHelp(t,r){let i=r.padWidth(t,r),n=r.helpWidth??80;function o(d,m){return r.formatItem(d,i,m,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),n),""]));let u=r.visibleArguments(t).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",u,r)),this.groupItems(t.options,r.visibleOptions(t),d=>d.helpGroupHeading??"Options:").forEach((d,m)=>{let b=d.map(v=>o(r.styleOptionTerm(r.optionTerm(v)),r.styleOptionDescription(r.optionDescription(v))));s=s.concat(this.formatItemList(m,b,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(t).map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(t.commands,r.visibleCommands(t),d=>d.helpGroup()||"Commands:").forEach((d,m)=>{let b=d.map(v=>o(r.styleSubcommandTerm(r.subcommandTerm(v)),r.styleSubcommandDescription(r.subcommandDescription(v))));s=s.concat(this.formatItemList(m,b,r))}),s.join(`
3
+ `)}displayWidth(t){return Uc(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,i,n){let s=" ".repeat(2);if(!i)return s+t;let a=t.padEnd(r+t.length-n.displayWidth(t)),u=2,c=(this.helpWidth??80)-r-u-2,d;return c<this.minWidthToWrap||n.preformatted(i)?d=i:d=n.boxWrap(i,c).replace(/\n/g,`
4
+ `+" ".repeat(r+u)),s+a+" ".repeat(u)+d.replace(/\n/g,`
5
+ ${s}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let i=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,o=[];return i.forEach(s=>{let a=s.match(n);if(a===null){o.push("");return}let u=[a.shift()],l=this.displayWidth(u[0]);a.forEach(c=>{let d=this.displayWidth(c);if(l+d<=r){u.push(c),l+=d;return}o.push(u.join(""));let m=c.trimStart();u=[m],l=this.displayWidth(m)}),o.push(u.join(""))}),o.join(`
6
+ `)}};function Uc(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}mu.Help=du;mu.stripColor=Uc});var bu=f(gu=>{var{InvalidArgumentError:g2}=Fr(),fu=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let i=b2(t);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new g2(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Wc(this.name().replace(/^no-/,"")):Wc(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},hu=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(t,r){let i=r.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,o=n!==void 0?n:!1;return r.negate===(o===t)}};function Wc(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function b2(e){let t,r,i=/^-[^-]$/,n=/^--[^-]/,o=e.split(/[ |,]+/).concat("guard");if(i.test(o[0])&&(t=o.shift()),n.test(o[0])&&(r=o.shift()),!t&&i.test(o[0])&&(t=o.shift()),!t&&n.test(o[0])&&(t=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${e}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(s)?new Error(`${a}
10
10
  - too many short flags`):n.test(s)?new Error(`${a}
11
11
  - too many long flags`):new Error(`${a}
12
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}yu.Option=vu;yu.DualOptions=_u});var od=f(nd=>{function Ty(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let i=0;i<=e.length;i++)r[i]=[i];for(let i=0;i<=t.length;i++)r[0][i]=i;for(let i=1;i<=t.length;i++)for(let n=1;n<=e.length;n++){let o=1;e[n-1]===t[i-1]?o=0:o=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+o),n>1&&i>1&&e[n-1]===t[i-2]&&e[n-2]===t[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1))}return r[e.length][t.length]}function jy(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(s=>s.slice(2)));let i=[],n=3,o=.4;return t.forEach(s=>{if(s.length<=1)return;let a=Ty(e,s),u=Math.max(e.length,s.length);(u-a)/u>o&&(a<n?(n=a,i=[s]):a===n&&i.push(s))}),i.sort((s,a)=>s.localeCompare(a)),r&&(i=i.map(s=>`--${s}`)),i.length>1?`
12
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}gu.Option=fu;gu.DualOptions=hu});var Kc=f(Vc=>{function v2(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let i=0;i<=e.length;i++)r[i]=[i];for(let i=0;i<=t.length;i++)r[0][i]=i;for(let i=1;i<=t.length;i++)for(let n=1;n<=e.length;n++){let o=1;e[n-1]===t[i-1]?o=0:o=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+o),n>1&&i>1&&e[n-1]===t[i-2]&&e[n-2]===t[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1))}return r[e.length][t.length]}function _2(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(s=>s.slice(2)));let i=[],n=3,o=.4;return t.forEach(s=>{if(s.length<=1)return;let a=v2(e,s),u=Math.max(e.length,s.length);(u-a)/u>o&&(a<n?(n=a,i=[s]):a===n&&i.push(s))}),i.sort((s,a)=>s.localeCompare(a)),r&&(i=i.map(s=>`--${s}`)),i.length>1?`
13
13
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
14
- (Did you mean ${i[0]}?)`:""}nd.suggestSimilar=jy});var ld=f(ku=>{var Iy=require("node:events").EventEmitter,Ou=require("node:child_process"),mt=require("node:path"),pi=require("node:fs"),G=require("node:process"),{Argument:Dy,humanReadableArgName:$y}=mi(),{CommanderError:Su}=Rr(),{Help:qy,stripColor:Ry}=bu(),{Option:sd,DualOptions:zy}=Cu(),{suggestSimilar:ad}=od(),xu=class e extends Iy{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>G.stdout.write(r),writeErr:r=>G.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>G.stdout.isTTY?G.stdout.columns:void 0,getErrHelpWidth:()=>G.stderr.isTTY?G.stderr.columns:void 0,getOutHasColors:()=>wu()??(G.stdout.isTTY&&G.stdout.hasColors?.()),getErrHasColors:()=>wu()??(G.stderr.isTTY&&G.stderr.hasColors?.()),stripColor:r=>Ry(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,i){let n=r,o=i;typeof n=="object"&&n!==null&&(o=n,n=null),o=o||{};let[,s,a]=t.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return n&&(u.description(n),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),n?this:u}createCommand(t){return new e(t)}createHelp(){return Object.assign(new qy,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new Dy(t,r)}argument(t,r,i,n){let o=this.createArgument(t,r);return typeof i=="function"?o.default(n).argParser(i):o.default(i),this.addArgument(o),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=t??"help [command]",[,n,o]=i.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(n);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||r)&&this._initCommandGroup(a),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
- Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,i){this._exitCallback&&this._exitCallback(new Su(t,r,i)),G.exit(t)}action(t){let r=i=>{let n=this.registeredArguments.length,o=i.slice(0,n);return this._storeOptionsAsProperties?o[n]=this:o[n]=this.opts(),o.push(this),t.apply(this,o)};return this._actionHandler=r,this}createOption(t,r){return new sd(t,r)}_callParseArg(t,r,i,n){try{return t.parseArg(r,i)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${n} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let i=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
17
- - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=n=>[n.name()].concat(n.aliases()),i=r(t).find(n=>this._findCommand(n));if(i){let n=r(this._findCommand(i)).join("|"),o=r(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${n}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),i=t.attributeName();if(t.negate){let o=t.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(i,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(i,t.defaultValue,"default");let n=(o,s,a)=>{o==null&&t.presetArg!==void 0&&(o=t.presetArg);let u=this.getOptionValue(i);o!==null&&t.parseArg?o=this._callParseArg(t,o,u,s):o!==null&&t.variadic&&(o=t._collectValue(o,u)),o==null&&(t.negate?o=!1:t.isBoolean()||t.optional?o=!0:o=""),this.setOptionValueWithSource(i,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${t.flags}' argument '${o}' is invalid.`;n(o,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${t.flags}' value '${o}' from env '${t.envVar}' is invalid.`;n(o,s,"env")}),this}_optionEx(t,r,i,n,o){if(typeof r=="object"&&r instanceof sd)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,i);if(s.makeOptionMandatory(!!t.mandatory),typeof n=="function")s.default(o).argParser(n);else if(n instanceof RegExp){let a=n;n=(u,l)=>{let d=a.exec(u);return d?d[0]:l},s.default(o).argParser(n)}else s.default(n);return this.addOption(s)}option(t,r,i,n){return this._optionEx({},t,r,i,n)}requiredOption(t,r,i,n){return this._optionEx({mandatory:!0},t,r,i,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,i){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=i,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(t)!==void 0&&(r=i.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){G.versions?.electron&&(r.from="electron");let n=G.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=G.argv),this.rawArgs=t.slice();let i;switch(r.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2);break;case"electron":G.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(t,r){this._prepareForParse();let i=this._prepareUserArgs(t,r);return this._parseCommand([],i),this}async parseAsync(t,r){this._prepareForParse();let i=this._prepareUserArgs(t,r);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
14
+ (Did you mean ${i[0]}?)`:""}Vc.suggestSimilar=_2});var Xc=f(Ou=>{var y2=require("node:events").EventEmitter,vu=require("node:child_process"),pt=require("node:path"),pi=require("node:fs"),G=require("node:process"),{Argument:C2,humanReadableArgName:O2}=mi(),{CommanderError:_u}=Fr(),{Help:S2,stripColor:x2}=pu(),{Option:Yc,DualOptions:w2}=bu(),{suggestSimilar:Qc}=Kc(),yu=class e extends y2{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>G.stdout.write(r),writeErr:r=>G.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>G.stdout.isTTY?G.stdout.columns:void 0,getErrHelpWidth:()=>G.stderr.isTTY?G.stderr.columns:void 0,getOutHasColors:()=>Cu()??(G.stdout.isTTY&&G.stdout.hasColors?.()),getErrHasColors:()=>Cu()??(G.stderr.isTTY&&G.stderr.hasColors?.()),stripColor:r=>x2(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,i){let n=r,o=i;typeof n=="object"&&n!==null&&(o=n,n=null),o=o||{};let[,s,a]=t.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return n&&(u.description(n),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),n?this:u}createCommand(t){return new e(t)}createHelp(){return Object.assign(new S2,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new C2(t,r)}argument(t,r,i,n){let o=this.createArgument(t,r);return typeof i=="function"?o.default(n).argParser(i):o.default(i),this.addArgument(o),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=t??"help [command]",[,n,o]=i.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(n);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||r)&&this._initCommandGroup(a),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
+ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,i){this._exitCallback&&this._exitCallback(new _u(t,r,i)),G.exit(t)}action(t){let r=i=>{let n=this.registeredArguments.length,o=i.slice(0,n);return this._storeOptionsAsProperties?o[n]=this:o[n]=this.opts(),o.push(this),t.apply(this,o)};return this._actionHandler=r,this}createOption(t,r){return new Yc(t,r)}_callParseArg(t,r,i,n){try{return t.parseArg(r,i)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${n} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let i=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
17
+ - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=n=>[n.name()].concat(n.aliases()),i=r(t).find(n=>this._findCommand(n));if(i){let n=r(this._findCommand(i)).join("|"),o=r(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${n}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),i=t.attributeName();if(t.negate){let o=t.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(i,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(i,t.defaultValue,"default");let n=(o,s,a)=>{o==null&&t.presetArg!==void 0&&(o=t.presetArg);let u=this.getOptionValue(i);o!==null&&t.parseArg?o=this._callParseArg(t,o,u,s):o!==null&&t.variadic&&(o=t._collectValue(o,u)),o==null&&(t.negate?o=!1:t.isBoolean()||t.optional?o=!0:o=""),this.setOptionValueWithSource(i,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${t.flags}' argument '${o}' is invalid.`;n(o,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${t.flags}' value '${o}' from env '${t.envVar}' is invalid.`;n(o,s,"env")}),this}_optionEx(t,r,i,n,o){if(typeof r=="object"&&r instanceof Yc)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,i);if(s.makeOptionMandatory(!!t.mandatory),typeof n=="function")s.default(o).argParser(n);else if(n instanceof RegExp){let a=n;n=(u,l)=>{let c=a.exec(u);return c?c[0]:l},s.default(o).argParser(n)}else s.default(n);return this.addOption(s)}option(t,r,i,n){return this._optionEx({},t,r,i,n)}requiredOption(t,r,i,n){return this._optionEx({mandatory:!0},t,r,i,n)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,i){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=i,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(t)!==void 0&&(r=i.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){G.versions?.electron&&(r.from="electron");let n=G.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=G.argv),this.rawArgs=t.slice();let i;switch(r.from){case void 0:case"node":this._scriptPath=t[1],i=t.slice(2);break;case"electron":G.defaultApp?(this._scriptPath=t[1],i=t.slice(2)):i=t.slice(1);break;case"user":i=t.slice(0);break;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(t,r){this._prepareForParse();let i=this._prepareUserArgs(t,r);return this._parseCommand([],i),this}async parseAsync(t,r){this._prepareForParse();let i=this._prepareUserArgs(t,r);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
18
  - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,i){if(pi.existsSync(t))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${t}' does not exist
19
19
  - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${n}`;throw new Error(o)}_executeSubCommand(t,r){r=r.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function o(d,c){let m=mt.resolve(d,c);if(pi.existsSync(m))return m;if(n.includes(mt.extname(c)))return;let _=n.find(g=>pi.existsSync(`${m}${g}`));if(_)return`${m}${_}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let d;try{d=pi.realpathSync(this._scriptPath)}catch{d=this._scriptPath}a=mt.resolve(mt.dirname(d),a)}if(a){let d=o(a,s);if(!d&&!t._executableFile&&this._scriptPath){let c=mt.basename(this._scriptPath,mt.extname(this._scriptPath));c!==this._name&&(d=o(a,`${c}-${t._name}`))}s=d||s}i=n.includes(mt.extname(s));let u;G.platform!=="win32"?i?(r.unshift(s),r=ud(G.execArgv).concat(r),u=Ou.spawn(G.argv[0],r,{stdio:"inherit"})):u=Ou.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=ud(G.execArgv).concat(r),u=Ou.spawn(G.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{G.on(c,()=>{u.killed===!1&&u.exitCode===null&&u.kill(c)})});let l=this._exitCallback;u.on("close",d=>{d=d??1,l?l(new Su(d,"commander.executeSubCommandAsync","(close)")):G.exit(d)}),u.on("error",d=>{if(d.code==="ENOENT")this._checkForMissingExecutable(s,a,t._name);else if(d.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)G.exit(1);else{let c=new Su(1,"commander.executeSubCommandAsync","(error)");c.nestedError=d,l(c)}}),this.runningCommand=u}_dispatchSubcommand(t,r,i){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,n,"preSubcommand"),o=this._chainOrCall(o,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),o}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(i,n,o)=>{let s=n;if(n!==null&&i.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,n,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let o=i.defaultValue;i.variadic?n<this.args.length?(o=this.args.slice(n),i.parseArg&&(o=o.reduce((s,a)=>t(i,a,s),i.defaultValue))):o===void 0&&(o=[]):n<this.args.length&&(o=this.args[n],i.parseArg&&(o=t(i,o,i.defaultValue))),r[n]=o}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let i=t,n=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{n.push({hookedCommand:o,callback:s})})}),r==="postAction"&&n.reverse(),n.forEach(o=>{i=this._chainOrCall(i,()=>o.callback(o.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,r,i){let n=t;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(o=>{n=this._chainOrCall(n,()=>o(this,r))}),n}_parseCommand(t,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(i.operands),r=i.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,t,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=t.find(o=>i.conflictsWith.includes(o.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],i=[],n=r;function o(d){return d.length>1&&d[0]==="-"}let s=d=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(d)?!this._getCommandAndAncestors().some(c=>c.options.map(m=>m.short).some(m=>/^-\d$/.test(m))):!1,a=null,u=null,l=0;for(;l<t.length||u;){let d=u??t[l++];if(u=null,d==="--"){n===i&&n.push(d),n.push(...t.slice(l));break}if(a&&(!o(d)||s(d))){this.emit(`option:${a.name()}`,d);continue}if(a=null,o(d)){let c=this._findOption(d);if(c){if(c.required){let m=t[l++];m===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,m)}else if(c.optional){let m=null;l<t.length&&(!o(t[l])||s(t[l]))&&(m=t[l++]),this.emit(`option:${c.name()}`,m)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(d.length>2&&d[0]==="-"&&d[1]!=="-"){let c=this._findOption(`-${d[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,d.slice(2)):(this.emit(`option:${c.name()}`),u=`-${d.slice(2)}`);continue}}if(/^--[^=]+=/.test(d)){let c=d.indexOf("="),m=this._findOption(d.slice(0,c));if(m&&(m.required||m.optional)){this.emit(`option:${m.name()}`,d.slice(c+1));continue}}if(n===r&&o(d)&&!(this.commands.length===0&&s(d))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(d)){r.push(d),i.push(...t.slice(l));break}else if(this._getHelpCommand()&&d===this._getHelpCommand().name()){r.push(d,...t.slice(l));break}else if(this._defaultCommandName){i.push(d,...t.slice(l));break}}if(this._passThroughOptions){n.push(d,...t.slice(l));break}n.push(d)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
21
+ - ${n}`;throw new Error(o)}_executeSubCommand(t,r){r=r.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function o(c,d){let m=pt.resolve(c,d);if(pi.existsSync(m))return m;if(n.includes(pt.extname(d)))return;let b=n.find(v=>pi.existsSync(`${m}${v}`));if(b)return`${m}${b}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let c;try{c=pi.realpathSync(this._scriptPath)}catch{c=this._scriptPath}a=pt.resolve(pt.dirname(c),a)}if(a){let c=o(a,s);if(!c&&!t._executableFile&&this._scriptPath){let d=pt.basename(this._scriptPath,pt.extname(this._scriptPath));d!==this._name&&(c=o(a,`${d}-${t._name}`))}s=c||s}i=n.includes(pt.extname(s));let u;G.platform!=="win32"?i?(r.unshift(s),r=Zc(G.execArgv).concat(r),u=vu.spawn(G.argv[0],r,{stdio:"inherit"})):u=vu.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=Zc(G.execArgv).concat(r),u=vu.spawn(G.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{G.on(d,()=>{u.killed===!1&&u.exitCode===null&&u.kill(d)})});let l=this._exitCallback;u.on("close",c=>{c=c??1,l?l(new _u(c,"commander.executeSubCommandAsync","(close)")):G.exit(c)}),u.on("error",c=>{if(c.code==="ENOENT")this._checkForMissingExecutable(s,a,t._name);else if(c.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)G.exit(1);else{let d=new _u(1,"commander.executeSubCommandAsync","(error)");d.nestedError=c,l(d)}}),this.runningCommand=u}_dispatchSubcommand(t,r,i){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,n,"preSubcommand"),o=this._chainOrCall(o,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),o}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(i,n,o)=>{let s=n;if(n!==null&&i.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,n,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let o=i.defaultValue;i.variadic?n<this.args.length?(o=this.args.slice(n),i.parseArg&&(o=o.reduce((s,a)=>t(i,a,s),i.defaultValue))):o===void 0&&(o=[]):n<this.args.length&&(o=this.args[n],i.parseArg&&(o=t(i,o,i.defaultValue))),r[n]=o}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let i=t,n=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{n.push({hookedCommand:o,callback:s})})}),r==="postAction"&&n.reverse(),n.forEach(o=>{i=this._chainOrCall(i,()=>o.callback(o.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,r,i){let n=t;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(o=>{n=this._chainOrCall(n,()=>o(this,r))}),n}_parseCommand(t,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(i.operands),r=i.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,t,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});t.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=t.find(o=>i.conflictsWith.includes(o.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],i=[],n=r;function o(c){return c.length>1&&c[0]==="-"}let s=c=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(c)?!this._getCommandAndAncestors().some(d=>d.options.map(m=>m.short).some(m=>/^-\d$/.test(m))):!1,a=null,u=null,l=0;for(;l<t.length||u;){let c=u??t[l++];if(u=null,c==="--"){n===i&&n.push(c),n.push(...t.slice(l));break}if(a&&(!o(c)||s(c))){this.emit(`option:${a.name()}`,c);continue}if(a=null,o(c)){let d=this._findOption(c);if(d){if(d.required){let m=t[l++];m===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,m)}else if(d.optional){let m=null;l<t.length&&(!o(t[l])||s(t[l]))&&(m=t[l++]),this.emit(`option:${d.name()}`,m)}else this.emit(`option:${d.name()}`);a=d.variadic?d:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let d=this._findOption(`-${c[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,c.slice(2)):(this.emit(`option:${d.name()}`),u=`-${c.slice(2)}`);continue}}if(/^--[^=]+=/.test(c)){let d=c.indexOf("="),m=this._findOption(c.slice(0,d));if(m&&(m.required||m.optional)){this.emit(`option:${m.name()}`,c.slice(d+1));continue}}if(n===r&&o(c)&&!(this.commands.length===0&&s(c))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(c)){r.push(c),i.push(...t.slice(l));break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){r.push(c,...t.slice(l));break}else if(this._defaultCommandName){i.push(c,...t.slice(l));break}}if(this._passThroughOptions){n.push(c,...t.slice(l));break}n.push(c)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0}));let i=r||{},n=i.exitCode||1,o=i.code||"commander.error";this._exit(n,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in G.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,G.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new zy(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let i=s=>{let a=s.attributeName(),u=this.getOptionValue(a),l=this.options.find(c=>c.negate&&a===c.attributeName()),d=this.options.find(c=>!c.negate&&a===c.attributeName());return l&&(l.presetArg===void 0&&u===!1||l.presetArg!==void 0&&u===l.presetArg)?l:d||s},n=s=>{let a=i(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);n=n.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=ad(t,n)}let i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${i} but got ${t.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(o=>{n.push(o.name()),o.alias()&&n.push(o.alias())}),r=ad(t,n)}let i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
- `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(t);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>$y(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=mt.basename(t,mt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),i=this._getOutputContext(t);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,i,n,o;return r?(i=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:n,helpWidth:o}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let i=this._getOutputContext(t),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation({error:i.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(G.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.
24
+ `),this.outputHelp({error:!0}));let i=r||{},n=i.exitCode||1,o=i.code||"commander.error";this._exit(n,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in G.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,G.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new w2(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&t.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let i=s=>{let a=s.attributeName(),u=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),c=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&u===!1||l.presetArg!==void 0&&u===l.presetArg)?l:c||s},n=s=>{let a=i(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);n=n.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=Qc(t,n)}let i=`error: unknown option '${t}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${i} but got ${t.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(o=>{n.push(o.name()),o.alias()&&n.push(o.alias())}),r=Qc(t,n)}let i=`error: unknown command '${t}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(t,r,i){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
+ `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(t);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>O2(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=pt.basename(t,pt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),i=this._getOutputContext(t);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(t){t=t||{};let r=!!t.error,i,n,o;return r?(i=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:n,helpWidth:o}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let i=this._getOutputContext(t),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation({error:i.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",n))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(G.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${i.join("', '")}'`);let n=`${t}Help`;return this.on(n,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
27
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ud(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,i="127.0.0.1",n="9229",o;return(o=t.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?n=o[3]:i=o[3]):(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],i=o[3],n=o[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:t})}function wu(){if(G.env.NO_COLOR||G.env.FORCE_COLOR==="0"||G.env.FORCE_COLOR==="false")return!1;if(G.env.FORCE_COLOR||G.env.CLICOLOR_FORCE!==void 0)return!0}ku.Command=xu;ku.useColor=wu});var pd=f(Ue=>{var{Argument:cd}=mi(),{Command:Au}=ld(),{CommanderError:My,InvalidArgumentError:dd}=Rr(),{Help:Jy}=bu(),{Option:md}=Cu();Ue.program=new Au;Ue.createCommand=e=>new Au(e);Ue.createOption=(e,t)=>new md(e,t);Ue.createArgument=(e,t)=>new cd(e,t);Ue.Command=Au;Ue.Option=md;Ue.Argument=cd;Ue.Help=Jy;Ue.CommanderError=My;Ue.InvalidArgumentError=dd;Ue.InvalidOptionArgumentError=dd});var hd=f((Be,fd)=>{var tt=pd();Be=fd.exports={};Be.program=new tt.Command;Be.Argument=tt.Argument;Be.Command=tt.Command;Be.CommanderError=tt.CommanderError;Be.Help=tt.Help;Be.InvalidArgumentError=tt.InvalidArgumentError;Be.InvalidOptionArgumentError=tt.InvalidArgumentError;Be.Option=tt.Option;Be.createCommand=e=>new tt.Command(e);Be.createOption=(e,t)=>new tt.Option(e,t);Be.createArgument=(e,t)=>new tt.Argument(e,t)});var vt=f((Yw,Eu)=>{var hi=process||{},vd=hi.argv||[],fi=hi.env||{},Hy=!(fi.NO_COLOR||vd.includes("--no-color"))&&(!!fi.FORCE_COLOR||vd.includes("--color")||hi.platform==="win32"||(hi.stdout||{}).isTTY&&fi.TERM!=="dumb"||!!fi.CI),Fy=(e,t,r=e)=>i=>{let n=""+i,o=n.indexOf(t,e.length);return~o?e+By(n,t,r,o)+t:e+n+t},By=(e,t,r,i)=>{let n="",o=0;do n+=e.substring(o,i)+r,o=i+t.length,i=e.indexOf(t,o);while(~i);return n+e.substring(o)},_d=(e=Hy)=>{let t=e?Fy:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Eu.exports=_d();Eu.exports.createColors=_d});var Tu=f((Zw,yd)=>{"use strict";var Pu={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let r="";return e<0?r+=`\x1B[${-e}D`:e>0&&(r+=`\x1B[${e}C`),t<0?r+=`\x1B[${-t}A`:t>0&&(r+=`\x1B[${t}B`),r},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Uy={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},Wy={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?Pu.up():"");return e&&(t+=Pu.left),t}};yd.exports={cursor:Pu,scroll:Uy,erase:Wy,beep:"\x07"}});var Wu,Vd=B(()=>{Wu={name:"resend-cli",version:"1.9.0-preview-automations.1",description:"The official CLI for Resend",license:"MIT",repository:{type:"git",url:"https://github.com/resend/resend-cli"},homepage:"https://github.com/resend/resend-cli#readme",keywords:["cli","resend","email","api","tanstack-intent"],engines:{node:">=20"},packageManager:"pnpm@10.33.0",files:["dist/cli.cjs","skills/"],type:"module",bin:{resend:"./dist/cli.cjs"},scripts:{dev:"tsx src/cli.ts","dev:watch":"tsx --watch src/cli.ts",build:"node scripts/build.mjs","build:bin":"pnpm build && pkg dist/cli.cjs --compress Brotli --target node24 --output dist/resend",lint:"biome check .","lint:fix":"biome check --write .",typecheck:"tsc --noEmit",test:"vitest run","test:e2e":"vitest run --config vitest.config.e2e.ts",prepack:"pnpm build && node scripts/verify-bundle.mjs"},dependencies:{"@clack/prompts":"1.2.0","@commander-js/extra-typings":"14.0.0",commander:"14.0.3",esbuild:"0.28.0",picocolors:"1.1.1",resend:"6.11.0-canary.1"},pnpm:{onlyBuiltDependencies:["esbuild","@biomejs/biome"]},devDependencies:{"@biomejs/biome":"2.4.11","@types/node":"24.12.2","@yao-pkg/pkg":"6.14.2",tsx:"4.21.0",typescript:"5.9.3",vitest:"4.1.4"}}});var se,Kd,zt=B(()=>{"use strict";Vd();se=Wu.version,Kd=Wu.name});var Ri=f(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.ApplicationInSerializer=void 0;qi.ApplicationInSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid}}}});var rl=f(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.ApplicationOutSerializer=void 0;zi.ApplicationOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),id:e.id,metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,id:e.id,metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt}}}});var om=f(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.ApplicationPatchSerializer=void 0;Mi.ApplicationPatchSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,uid:e.uid}}}});var am=f(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.ListResponseApplicationOutSerializer=void 0;var sm=rl();Ji.ListResponseApplicationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>sm.ApplicationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>sm.ApplicationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var nl=f(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.ApiException=void 0;var il=class extends Error{constructor(t,r,i){super(`HTTP-Code: ${t}
28
- Headers: ${JSON.stringify(i)}`),this.code=t,this.body=r,this.headers={},i.forEach((n,o)=>{this.headers[o]=n})}};Hi.ApiException=il});var um,lm=B(()=>{um="ffffffff-ffff-ffff-ffff-ffffffffffff"});var cm,dm=B(()=>{cm="00000000-0000-0000-0000-000000000000"});var mm,pm=B(()=>{mm=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function V1(e){return typeof e=="string"&&mm.test(e)}var Ot,Wr=B(()=>{pm();Ot=V1});function K1(e){if(!Ot(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var St,Vr=B(()=>{Wr();St=K1});function Te(e,t=0){return(ke[e[t+0]]+ke[e[t+1]]+ke[e[t+2]]+ke[e[t+3]]+"-"+ke[e[t+4]]+ke[e[t+5]]+"-"+ke[e[t+6]]+ke[e[t+7]]+"-"+ke[e[t+8]]+ke[e[t+9]]+"-"+ke[e[t+10]]+ke[e[t+11]]+ke[e[t+12]]+ke[e[t+13]]+ke[e[t+14]]+ke[e[t+15]]).toLowerCase()}function Y1(e,t=0){let r=Te(e,t);if(!Ot(r))throw TypeError("Stringified UUID is invalid");return r}var ke,fm,pt=B(()=>{Wr();ke=[];for(let e=0;e<256;++e)ke.push((e+256).toString(16).slice(1));fm=Y1});function Ht(){return Fi>Bi.length-16&&(hm.default.randomFillSync(Bi),Fi=0),Bi.slice(Fi,Fi+=16)}var hm,Bi,Fi,Ni=B(()=>{hm=le(require("node:crypto")),Bi=new Uint8Array(256),Fi=Bi.length});function Q1(e,t,r){let i=t&&r||0,n=t||new Array(16);e=e||{};let o=e.node,s=e.clockseq;if(e._v6||(o||(o=ol),s==null&&(s=Li)),o==null||s==null){let m=e.random||(e.rng||Ht)();o==null&&(o=[m[0],m[1],m[2],m[3],m[4],m[5]],!ol&&!e._v6&&(o[0]|=1,ol=o)),s==null&&(s=(m[6]<<8|m[7])&16383,Li===void 0&&!e._v6&&(Li=s))}let a=e.msecs!==void 0?e.msecs:Date.now(),u=e.nsecs!==void 0?e.nsecs:al+1,l=a-sl+(u-al)/1e4;if(l<0&&e.clockseq===void 0&&(s=s+1&16383),(l<0||a>sl)&&e.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");sl=a,al=u,Li=s,a+=122192928e5;let d=((a&268435455)*1e4+u)%4294967296;n[i++]=d>>>24&255,n[i++]=d>>>16&255,n[i++]=d>>>8&255,n[i++]=d&255;let c=a/4294967296*1e4&268435455;n[i++]=c>>>8&255,n[i++]=c&255,n[i++]=c>>>24&15|16,n[i++]=c>>>16&255,n[i++]=s>>>8|128,n[i++]=s&255;for(let m=0;m<6;++m)n[i+m]=o[m];return t||Te(n)}var ol,Li,sl,al,Gi,ul=B(()=>{Ni();pt();sl=0,al=0;Gi=Q1});function Kr(e){let t=typeof e=="string"?St(e):e,r=Z1(t);return typeof e=="string"?Te(r):r}function Z1(e,t=!1){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}var ll=B(()=>{Vr();pt()});function X1(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}function Yr(e,t,r){function i(n,o,s,a){var u;if(typeof n=="string"&&(n=X1(n)),typeof o=="string"&&(o=St(o)),((u=o)===null||u===void 0?void 0:u.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+n.length);if(l.set(o),l.set(n,o.length),l=r(l),l[6]=l[6]&15|t,l[8]=l[8]&63|128,s){a=a||0;for(let d=0;d<16;++d)s[a+d]=l[d];return s}return Te(l)}try{i.name=e}catch{}return i.DNS=eC,i.URL=tC,i}var eC,tC,cl=B(()=>{pt();Vr();eC="6ba7b810-9dad-11d1-80b4-00c04fd430c8",tC="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function rC(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),gm.default.createHash("md5").update(e).digest()}var gm,bm,vm=B(()=>{gm=le(require("node:crypto"));bm=rC});var iC,_m,ym=B(()=>{cl();vm();iC=Yr("v3",48,bm),_m=iC});var Cm,dl,Om=B(()=>{Cm=le(require("node:crypto")),dl={randomUUID:Cm.default.randomUUID}});function nC(e,t,r){if(dl.randomUUID&&!t&&!e)return dl.randomUUID();e=e||{};let i=e.random||(e.rng||Ht)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return Te(i)}var Sm,xm=B(()=>{Om();Ni();pt();Sm=nC});function oC(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),wm.default.createHash("sha1").update(e).digest()}var wm,km,Am=B(()=>{wm=le(require("node:crypto"));km=oC});var sC,Em,Pm=B(()=>{cl();Am();sC=Yr("v5",80,km),Em=sC});function ml(e={},t,r=0){let i=Gi({...e,_v6:!0},new Uint8Array(16));if(i=Kr(i),t){for(let n=0;n<16;n++)t[r+n]=i[n];return t}return Te(i)}var Tm=B(()=>{pt();ul();ll()});function pl(e){let t=typeof e=="string"?St(e):e,r=aC(t);return typeof e=="string"?Te(r):r}function aC(e){return Uint8Array.of((e[3]&15)<<4|e[4]>>4&15,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|e[6]&15,e[7],(e[1]&15)<<4|(e[2]&240)>>4,(e[2]&15)<<4|(e[3]&240)>>4,16|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}var jm=B(()=>{Vr();pt()});function uC(e,t,r){e=e||{};let i=t&&r||0,n=t||new Uint8Array(16),o=e.random||(e.rng||Ht)(),s=e.msecs!==void 0?e.msecs:Date.now(),a=e.seq!==void 0?e.seq:null,u=Dm,l=Im;return s>rt&&e.msecs===void 0&&(rt=s,a!==null&&(u=null,l=null)),a!==null&&(a>2147483647&&(a=2147483647),u=a>>>19&4095,l=a&524287),(u===null||l===null)&&(u=o[6]&127,u=u<<8|o[7],l=o[8]&63,l=l<<8|o[9],l=l<<5|o[10]>>>3),s+1e4>rt&&a===null?++l>524287&&(l=0,++u>4095&&(u=0,rt++)):rt=s,Dm=u,Im=l,n[i++]=rt/1099511627776&255,n[i++]=rt/4294967296&255,n[i++]=rt/16777216&255,n[i++]=rt/65536&255,n[i++]=rt/256&255,n[i++]=rt&255,n[i++]=u>>>4&15|112,n[i++]=u&255,n[i++]=l>>>13&63|128,n[i++]=l>>>5&255,n[i++]=l<<3&255|o[10]&7,n[i++]=o[11],n[i++]=o[12],n[i++]=o[13],n[i++]=o[14],n[i++]=o[15],t||Te(n)}var Im,Dm,rt,$m,qm=B(()=>{Ni();pt();Im=null,Dm=null,rt=0;$m=uC});function lC(e){if(!Ot(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var Rm,zm=B(()=>{Wr();Rm=lC});var Mm={};or(Mm,{MAX:()=>um,NIL:()=>cm,parse:()=>St,stringify:()=>fm,v1:()=>Gi,v1ToV6:()=>Kr,v3:()=>_m,v4:()=>Sm,v5:()=>Em,v6:()=>ml,v6ToV1:()=>pl,v7:()=>$m,validate:()=>Ot,version:()=>Rm});var Jm=B(()=>{lm();dm();Vr();pt();ul();ll();ym();xm();Pm();Tm();jm();qm();Wr();zm()});var ne=f(Ve=>{"use strict";var Qr=Ve&&Ve.__awaiter||function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{l(i.next(d))}catch(c){s(c)}}function u(d){try{l(i.throw(d))}catch(c){s(c)}}function l(d){d.done?o(d.value):n(d.value).then(a,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.SvixRequest=Ve.HttpMethod=Ve.LIB_VERSION=void 0;var fl=nl(),cC=(Jm(),xy(Mm));Ve.LIB_VERSION="1.90.0";var dC=`svix-libs/${Ve.LIB_VERSION}/javascript`,mC;(function(e){e.GET="GET",e.HEAD="HEAD",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.CONNECT="CONNECT",e.OPTIONS="OPTIONS",e.TRACE="TRACE",e.PATCH="PATCH"})(mC=Ve.HttpMethod||(Ve.HttpMethod={}));var hl=class{constructor(t,r){this.method=t,this.path=r,this.queryParams={},this.headerParams={}}setPathParam(t,r){let i=this.path.replace(`{${t}}`,encodeURIComponent(r));if(this.path===i)throw new Error(`path parameter ${t} not found`);this.path=i}setQueryParams(t){for(let[r,i]of Object.entries(t))this.setQueryParam(r,i)}setQueryParam(t,r){if(r!=null)if(typeof r=="string")this.queryParams[t]=r;else if(typeof r=="boolean"||typeof r=="number")this.queryParams[t]=r.toString();else if(r instanceof Date)this.queryParams[t]=r.toISOString();else if(Array.isArray(r))r.length>0&&(this.queryParams[t]=r.join(","));else{let i=r;throw new Error(`query parameter ${t} has unsupported type`)}}setHeaderParam(t,r){r!==void 0&&(this.headerParams[t]=r)}setBody(t){this.body=JSON.stringify(t)}send(t,r){return Qr(this,void 0,void 0,function*(){let i=yield this.sendInner(t);if(i.status===204)return null;let n=yield i.text();return r(JSON.parse(n))})}sendNoResponseBody(t){return Qr(this,void 0,void 0,function*(){yield this.sendInner(t)})}sendInner(t){var r,i;return Qr(this,void 0,void 0,function*(){let n=new URL(t.baseUrl+this.path);for(let[u,l]of Object.entries(this.queryParams))n.searchParams.set(u,l);this.headerParams["idempotency-key"]===void 0&&this.method.toUpperCase()==="POST"&&(this.headerParams["idempotency-key"]=`auto_${(0,cC.v4)()}`);let o=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);this.body!=null&&(this.headerParams["content-type"]="application/json");let s="credentials"in Request.prototype,a=yield Hm(n,{method:this.method.toString(),body:this.body,headers:Object.assign({accept:"application/json, */*;q=0.8",authorization:`Bearer ${t.token}`,"user-agent":dC,"svix-req-id":o.toString()},this.headerParams),credentials:s?"same-origin":void 0,signal:t.timeout!==void 0?AbortSignal.timeout(t.timeout):void 0},t.retryScheduleInMs,(r=t.retryScheduleInMs)===null||r===void 0?void 0:r[0],((i=t.retryScheduleInMs)===null||i===void 0?void 0:i.length)||t.numRetries,t.fetch);return pC(a)})}};Ve.SvixRequest=hl;function pC(e){return Qr(this,void 0,void 0,function*(){if(e.status<300)return e;let t=yield e.text();throw e.status===422?new fl.ApiException(e.status,JSON.parse(t),e.headers):e.status>=400&&e.status<=499?new fl.ApiException(e.status,JSON.parse(t),e.headers):new fl.ApiException(e.status,t,e.headers)})}function Hm(e,t,r,i=50,n=2,o=fetch,s=1){return Qr(this,void 0,void 0,function*(){let a=u=>new Promise(l=>setTimeout(l,u));try{let u=yield o(e,t);if(n<=0||u.status<500)return u}catch(u){if(n<=0)throw u}return yield a(i),t.headers["svix-retry-count"]=s.toString(),i=r?.[s]||i*2,yield Hm(e,t,r,i,--n,o,++s)})}});var Fm=f(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.Application=void 0;var gl=Ri(),Zr=rl(),fC=om(),hC=am(),Re=ne(),bl=class{constructor(t){this.requestCtx=t}list(t){let r=new Re.SvixRequest(Re.HttpMethod.GET,"/api/v1/app");return r.setQueryParams({exclude_apps_with_no_endpoints:t?.excludeAppsWithNoEndpoints,exclude_apps_with_disabled_endpoints:t?.excludeAppsWithDisabledEndpoints,exclude_apps_with_svix_play_endpoints:t?.excludeAppsWithSvixPlayEndpoints,limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,hC.ListResponseApplicationOutSerializer._fromJsonObject)}create(t,r){let i=new Re.SvixRequest(Re.HttpMethod.POST,"/api/v1/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(gl.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,Zr.ApplicationOutSerializer._fromJsonObject)}getOrCreate(t,r){let i=new Re.SvixRequest(Re.HttpMethod.POST,"/api/v1/app");return i.setQueryParam("get_if_exists",!0),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(gl.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,Zr.ApplicationOutSerializer._fromJsonObject)}get(t){let r=new Re.SvixRequest(Re.HttpMethod.GET,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.send(this.requestCtx,Zr.ApplicationOutSerializer._fromJsonObject)}update(t,r){let i=new Re.SvixRequest(Re.HttpMethod.PUT,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody(gl.ApplicationInSerializer._toJsonObject(r)),i.send(this.requestCtx,Zr.ApplicationOutSerializer._fromJsonObject)}delete(t){let r=new Re.SvixRequest(Re.HttpMethod.DELETE,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Re.SvixRequest(Re.HttpMethod.PATCH,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody(fC.ApplicationPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Zr.ApplicationOutSerializer._fromJsonObject)}};Ui.Application=bl});var Bm=f(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.ApiTokenOutSerializer=void 0;Wi.ApiTokenOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),expiresAt:e.expiresAt?new Date(e.expiresAt):null,id:e.id,name:e.name,scopes:e.scopes,token:e.token}},_toJsonObject(e){return{createdAt:e.createdAt,expiresAt:e.expiresAt,id:e.id,name:e.name,scopes:e.scopes,token:e.token}}}});var vl=f(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.AppPortalCapabilitySerializer=Ft.AppPortalCapability=void 0;var gC;(function(e){e.ViewBase="ViewBase",e.ViewEndpointSecret="ViewEndpointSecret",e.ManageEndpointSecret="ManageEndpointSecret",e.ManageTransformations="ManageTransformations",e.CreateAttempts="CreateAttempts",e.ManageEndpoint="ManageEndpoint"})(gC=Ft.AppPortalCapability||(Ft.AppPortalCapability={}));Ft.AppPortalCapabilitySerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Gm=f(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.AppPortalAccessInSerializer=void 0;var Nm=vl(),Lm=Ri();Vi.AppPortalAccessInSerializer={_fromJsonObject(e){var t;return{application:e.application!=null?Lm.ApplicationInSerializer._fromJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>Nm.AppPortalCapabilitySerializer._fromJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}},_toJsonObject(e){var t;return{application:e.application!=null?Lm.ApplicationInSerializer._toJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>Nm.AppPortalCapabilitySerializer._toJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}}}});var Um=f(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.AppPortalAccessOutSerializer=void 0;Ki.AppPortalAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}});var Wm=f(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.ApplicationTokenExpireInSerializer=void 0;Yi.ApplicationTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}});var Vm=f(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.RotatePollerTokenInSerializer=void 0;Qi.RotatePollerTokenInSerializer={_fromJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}},_toJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}}}});var Km=f(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.StreamPortalAccessInSerializer=void 0;Zi.StreamPortalAccessInSerializer={_fromJsonObject(e){return{expiry:e.expiry,featureFlags:e.featureFlags,sessionId:e.sessionId}},_toJsonObject(e){return{expiry:e.expiry,featureFlags:e.featureFlags,sessionId:e.sessionId}}}});var Ym=f(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.StreamTokenExpireInSerializer=void 0;Xi.StreamTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}});var _l=f(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.DashboardAccessOutSerializer=void 0;en.DashboardAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}});var Xm=f(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.Authentication=void 0;var Qm=Bm(),bC=Gm(),Zm=Um(),vC=Wm(),_C=Vm(),yC=Km(),CC=Ym(),OC=_l(),ve=ne(),yl=class{constructor(t){this.requestCtx=t}appPortalAccess(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/app-portal-access/{app_id}");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(bC.AppPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,Zm.AppPortalAccessOutSerializer._fromJsonObject)}expireAll(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/app/{app_id}/expire-all");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(vC.ApplicationTokenExpireInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}dashboardAccess(t,r){let i=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/dashboard-access/{app_id}");return i.setPathParam("app_id",t),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.send(this.requestCtx,OC.DashboardAccessOutSerializer._fromJsonObject)}logout(t){let r=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/logout");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.sendNoResponseBody(this.requestCtx)}streamLogout(t){let r=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/stream-logout");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.sendNoResponseBody(this.requestCtx)}streamPortalAccess(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/stream-portal-access/{stream_id}");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(yC.StreamPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,Zm.AppPortalAccessOutSerializer._fromJsonObject)}streamExpireAll(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/expire-all");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(CC.StreamTokenExpireInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}getStreamPollerToken(t,r){let i=new ve.SvixRequest(ve.HttpMethod.GET,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,Qm.ApiTokenOutSerializer._fromJsonObject)}rotateStreamPollerToken(t,r,i,n){let o=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate");return o.setPathParam("stream_id",t),o.setPathParam("sink_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(_C.RotatePollerTokenInSerializer._toJsonObject(i)),o.send(this.requestCtx,Qm.ApiTokenOutSerializer._fromJsonObject)}};tn.Authentication=yl});var xt=f(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.BackgroundTaskStatusSerializer=Bt.BackgroundTaskStatus=void 0;var SC;(function(e){e.Running="running",e.Finished="finished",e.Failed="failed"})(SC=Bt.BackgroundTaskStatus||(Bt.BackgroundTaskStatus={}));Bt.BackgroundTaskStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var wt=f(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.BackgroundTaskTypeSerializer=Nt.BackgroundTaskType=void 0;var xC;(function(e){e.EndpointReplay="endpoint.replay",e.EndpointRecover="endpoint.recover",e.ApplicationStats="application.stats",e.MessageBroadcast="message.broadcast",e.SdkGenerate="sdk.generate",e.EventTypeAggregate="event-type.aggregate",e.ApplicationPurgeContent="application.purge_content",e.EndpointBulkReplay="endpoint.bulk-replay"})(xC=Nt.BackgroundTaskType||(Nt.BackgroundTaskType={}));Nt.BackgroundTaskTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Cl=f(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.BackgroundTaskOutSerializer=void 0;var ep=xt(),tp=wt();rn.BackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data,id:e.id,status:ep.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:tp.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{data:e.data,id:e.id,status:ep.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:tp.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var ip=f(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.ListResponseBackgroundTaskOutSerializer=void 0;var rp=Cl();nn.ListResponseBackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>rp.BackgroundTaskOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>rp.BackgroundTaskOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var np=f(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.BackgroundTask=void 0;var wC=Cl(),kC=ip(),on=ne(),Ol=class{constructor(t){this.requestCtx=t}list(t){let r=new on.SvixRequest(on.HttpMethod.GET,"/api/v1/background-task");return r.setQueryParams({status:t?.status,task:t?.task,limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,kC.ListResponseBackgroundTaskOutSerializer._fromJsonObject)}listByEndpoint(t){return this.list(t)}get(t){let r=new on.SvixRequest(on.HttpMethod.GET,"/api/v1/background-task/{task_id}");return r.setPathParam("task_id",t),r.send(this.requestCtx,wC.BackgroundTaskOutSerializer._fromJsonObject)}};sn.BackgroundTask=Ol});var ur=f(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.ConnectorKindSerializer=Lt.ConnectorKind=void 0;var AC;(function(e){e.Custom="Custom",e.AgenticCommerceProtocol="AgenticCommerceProtocol",e.CloseCrm="CloseCRM",e.CustomerIo="CustomerIO",e.Discord="Discord",e.Hubspot="Hubspot",e.Inngest="Inngest",e.Loops="Loops",e.Otel="Otel",e.Resend="Resend",e.Salesforce="Salesforce",e.Segment="Segment",e.Sendgrid="Sendgrid",e.Slack="Slack",e.Teams="Teams",e.TriggerDev="TriggerDev",e.Windmill="Windmill",e.Zapier="Zapier"})(AC=Lt.ConnectorKind||(Lt.ConnectorKind={}));Lt.ConnectorKindSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var an=f(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.ConnectorProductSerializer=Gt.ConnectorProduct=void 0;var EC;(function(e){e.Dispatch="Dispatch",e.Stream="Stream"})(EC=Gt.ConnectorProduct||(Gt.ConnectorProduct={}));Gt.ConnectorProductSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Sl=f(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.ConnectorInSerializer=void 0;var op=ur(),sp=an();un.ConnectorInSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?op.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?sp.ConnectorProductSerializer._fromJsonObject(e.productType):void 0,transformation:e.transformation,uid:e.uid}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?op.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?sp.ConnectorProductSerializer._toJsonObject(e.productType):void 0,transformation:e.transformation,uid:e.uid}}}});var cn=f(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.ConnectorOutSerializer=void 0;var ap=ur(),up=an();ln.ConnectorOutSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,createdAt:new Date(e.createdAt),description:e.description,featureFlags:e.featureFlags,id:e.id,instructions:e.instructions,kind:ap.ConnectorKindSerializer._fromJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:up.ConnectorProductSerializer._fromJsonObject(e.productType),transformation:e.transformation,transformationUpdatedAt:new Date(e.transformationUpdatedAt),uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,createdAt:e.createdAt,description:e.description,featureFlags:e.featureFlags,id:e.id,instructions:e.instructions,kind:ap.ConnectorKindSerializer._toJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:up.ConnectorProductSerializer._toJsonObject(e.productType),transformation:e.transformation,transformationUpdatedAt:e.transformationUpdatedAt,uid:e.uid,updatedAt:e.updatedAt}}}});var cp=f(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.ConnectorPatchSerializer=void 0;var lp=ur();dn.ConnectorPatchSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?lp.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?lp.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}}}});var mp=f(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.ConnectorUpdateSerializer=void 0;var dp=ur();mn.ConnectorUpdateSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?dp.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?dp.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}}}});var fp=f(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.ListResponseConnectorOutSerializer=void 0;var pp=cn();pn.ListResponseConnectorOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>pp.ConnectorOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>pp.ConnectorOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var hp=f(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.Connector=void 0;var PC=Sl(),fn=cn(),TC=cp(),jC=mp(),IC=fp(),Ke=ne(),xl=class{constructor(t){this.requestCtx=t}list(t){let r=new Ke.SvixRequest(Ke.HttpMethod.GET,"/api/v1/connector");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order,product_type:t?.productType}),r.send(this.requestCtx,IC.ListResponseConnectorOutSerializer._fromJsonObject)}create(t,r){let i=new Ke.SvixRequest(Ke.HttpMethod.POST,"/api/v1/connector");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(PC.ConnectorInSerializer._toJsonObject(t)),i.send(this.requestCtx,fn.ConnectorOutSerializer._fromJsonObject)}get(t){let r=new Ke.SvixRequest(Ke.HttpMethod.GET,"/api/v1/connector/{connector_id}");return r.setPathParam("connector_id",t),r.send(this.requestCtx,fn.ConnectorOutSerializer._fromJsonObject)}update(t,r){let i=new Ke.SvixRequest(Ke.HttpMethod.PUT,"/api/v1/connector/{connector_id}");return i.setPathParam("connector_id",t),i.setBody(jC.ConnectorUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,fn.ConnectorOutSerializer._fromJsonObject)}delete(t){let r=new Ke.SvixRequest(Ke.HttpMethod.DELETE,"/api/v1/connector/{connector_id}");return r.setPathParam("connector_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Ke.SvixRequest(Ke.HttpMethod.PATCH,"/api/v1/connector/{connector_id}");return i.setPathParam("connector_id",t),i.setBody(TC.ConnectorPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,fn.ConnectorOutSerializer._fromJsonObject)}};hn.Connector=xl});var lr=f(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.MessageStatusSerializer=Ut.MessageStatus=void 0;var DC;(function(e){e[e.Success=0]="Success",e[e.Pending=1]="Pending",e[e.Fail=2]="Fail",e[e.Sending=3]="Sending"})(DC=Ut.MessageStatus||(Ut.MessageStatus={}));Ut.MessageStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var wl=f(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.StatusCodeClassSerializer=Wt.StatusCodeClass=void 0;var $C;(function(e){e[e.CodeNone=0]="CodeNone",e[e.Code1xx=100]="Code1xx",e[e.Code2xx=200]="Code2xx",e[e.Code3xx=300]="Code3xx",e[e.Code4xx=400]="Code4xx",e[e.Code5xx=500]="Code5xx"})($C=Wt.StatusCodeClass||(Wt.StatusCodeClass={}));Wt.StatusCodeClassSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var vp=f(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.BulkReplayInSerializer=void 0;var gp=lr(),bp=wl();gn.BulkReplayInSerializer={_fromJsonObject(e){return{channel:e.channel,eventTypes:e.eventTypes,since:new Date(e.since),status:e.status!=null?gp.MessageStatusSerializer._fromJsonObject(e.status):void 0,statusCodeClass:e.statusCodeClass!=null?bp.StatusCodeClassSerializer._fromJsonObject(e.statusCodeClass):void 0,tag:e.tag,until:e.until?new Date(e.until):null}},_toJsonObject(e){return{channel:e.channel,eventTypes:e.eventTypes,since:e.since,status:e.status!=null?gp.MessageStatusSerializer._toJsonObject(e.status):void 0,statusCodeClass:e.statusCodeClass!=null?bp.StatusCodeClassSerializer._toJsonObject(e.statusCodeClass):void 0,tag:e.tag,until:e.until}}}});var _p=f(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.EndpointHeadersInSerializer=void 0;bn.EndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var kl=f(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.EndpointHeadersOutSerializer=void 0;vn.EndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var yp=f(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.EndpointHeadersPatchInSerializer=void 0;_n.EndpointHeadersPatchInSerializer={_fromJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}},_toJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}}}});var Cp=f(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.EndpointInSerializer=void 0;yn.EndpointInSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,headers:e.headers,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,headers:e.headers,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}});var Al=f(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.EndpointOutSerializer=void 0;Cn.EndpointOutSerializer={_fromJsonObject(e){return{channels:e.channels,createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}});var Op=f(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.EndpointPatchSerializer=void 0;On.EndpointPatchSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}});var Sp=f(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.EndpointSecretOutSerializer=void 0;Sn.EndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var El=f(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.EndpointSecretRotateInSerializer=void 0;xn.EndpointSecretRotateInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var xp=f(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.EndpointStatsSerializer=void 0;wn.EndpointStatsSerializer={_fromJsonObject(e){return{fail:e.fail,pending:e.pending,sending:e.sending,success:e.success}},_toJsonObject(e){return{fail:e.fail,pending:e.pending,sending:e.sending,success:e.success}}}});var wp=f(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.EndpointTransformationInSerializer=void 0;kn.EndpointTransformationInSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var kp=f(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.EndpointTransformationOutSerializer=void 0;An.EndpointTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled,updatedAt:e.updatedAt?new Date(e.updatedAt):null}},_toJsonObject(e){return{code:e.code,enabled:e.enabled,updatedAt:e.updatedAt}}}});var Ap=f(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.EndpointTransformationPatchSerializer=void 0;En.EndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var Ep=f(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.EndpointUpdateSerializer=void 0;Pn.EndpointUpdateSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}});var Pp=f(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.EventExampleInSerializer=void 0;Tn.EventExampleInSerializer={_fromJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}},_toJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}}}});var jp=f(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.ListResponseEndpointOutSerializer=void 0;var Tp=Al();jn.ListResponseEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Tp.EndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Tp.EndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Xr=f(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.MessageOutSerializer=void 0;In.MessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,id:e.id,payload:e.payload,tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,id:e.id,payload:e.payload,tags:e.tags,timestamp:e.timestamp}}}});var Ip=f(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.RecoverInSerializer=void 0;Dn.RecoverInSerializer={_fromJsonObject(e){return{since:new Date(e.since),until:e.until?new Date(e.until):null}},_toJsonObject(e){return{since:e.since,until:e.until}}}});var qp=f($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.RecoverOutSerializer=void 0;var Dp=xt(),$p=wt();$n.RecoverOutSerializer={_fromJsonObject(e){return{id:e.id,status:Dp.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:$p.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:Dp.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:$p.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var Rp=f(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.ReplayInSerializer=void 0;qn.ReplayInSerializer={_fromJsonObject(e){return{since:new Date(e.since),until:e.until?new Date(e.until):null}},_toJsonObject(e){return{since:e.since,until:e.until}}}});var Jp=f(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.ReplayOutSerializer=void 0;var zp=xt(),Mp=wt();Rn.ReplayOutSerializer={_fromJsonObject(e){return{id:e.id,status:zp.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Mp.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:zp.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Mp.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var Fp=f(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.Endpoint=void 0;var qC=vp(),RC=_p(),zC=kl(),MC=yp(),JC=Cp(),zn=Al(),HC=Op(),FC=Sp(),BC=El(),NC=xp(),LC=wp(),GC=kp(),UC=Ap(),WC=Ep(),VC=Pp(),KC=jp(),YC=Xr(),QC=Ip(),ZC=qp(),XC=Rp(),Hp=Jp(),$=ne(),Pl=class{constructor(t){this.requestCtx=t}list(t,r){let i=new $.SvixRequest($.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint");return i.setPathParam("app_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,KC.ListResponseEndpointOutSerializer._fromJsonObject)}create(t,r,i){let n=new $.SvixRequest($.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(JC.EndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,zn.EndpointOutSerializer._fromJsonObject)}get(t,r){let i=new $.SvixRequest($.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,zn.EndpointOutSerializer._fromJsonObject)}update(t,r,i){let n=new $.SvixRequest($.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(WC.EndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,zn.EndpointOutSerializer._fromJsonObject)}delete(t,r){let i=new $.SvixRequest($.HttpMethod.DELETE,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.sendNoResponseBody(this.requestCtx)}patch(t,r,i){let n=new $.SvixRequest($.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(HC.EndpointPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,zn.EndpointOutSerializer._fromJsonObject)}bulkReplay(t,r,i,n){let o=new $.SvixRequest($.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/bulk-replay");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(qC.BulkReplayInSerializer._toJsonObject(i)),o.send(this.requestCtx,Hp.ReplayOutSerializer._fromJsonObject)}getHeaders(t,r){let i=new $.SvixRequest($.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,zC.EndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r,i){let n=new $.SvixRequest($.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(RC.EndpointHeadersInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}headersUpdate(t,r,i){return this.updateHeaders(t,r,i)}patchHeaders(t,r,i){let n=new $.SvixRequest($.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(MC.EndpointHeadersPatchInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}headersPatch(t,r,i){return this.patchHeaders(t,r,i)}recover(t,r,i,n){let o=new $.SvixRequest($.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(QC.RecoverInSerializer._toJsonObject(i)),o.send(this.requestCtx,ZC.RecoverOutSerializer._fromJsonObject)}replayMissing(t,r,i,n){let o=new $.SvixRequest($.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(XC.ReplayInSerializer._toJsonObject(i)),o.send(this.requestCtx,Hp.ReplayOutSerializer._fromJsonObject)}getSecret(t,r){let i=new $.SvixRequest($.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,FC.EndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let o=new $.SvixRequest($.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(BC.EndpointSecretRotateInSerializer._toJsonObject(i)),o.sendNoResponseBody(this.requestCtx)}sendExample(t,r,i,n){let o=new $.SvixRequest($.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(VC.EventExampleInSerializer._toJsonObject(i)),o.send(this.requestCtx,YC.MessageOutSerializer._fromJsonObject)}getStats(t,r,i){let n=new $.SvixRequest($.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setQueryParams({since:i?.since,until:i?.until}),n.send(this.requestCtx,NC.EndpointStatsSerializer._fromJsonObject)}transformationGet(t,r){let i=new $.SvixRequest($.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,GC.EndpointTransformationOutSerializer._fromJsonObject)}patchTransformation(t,r,i){let n=new $.SvixRequest($.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(UC.EndpointTransformationPatchSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}transformationPartialUpdate(t,r,i){let n=new $.SvixRequest($.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(LC.EndpointTransformationInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};Mn.Endpoint=Pl});var Tl=f(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.EventTypeInSerializer=void 0;Jn.EventTypeInSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}}}});var Lp=f(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.EnvironmentInSerializer=void 0;var Bp=Sl(),Np=Tl();Hn.EnvironmentInSerializer={_fromJsonObject(e){var t,r;return{connectors:(t=e.connectors)===null||t===void 0?void 0:t.map(i=>Bp.ConnectorInSerializer._fromJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>Np.EventTypeInSerializer._fromJsonObject(i)),settings:e.settings}},_toJsonObject(e){var t,r;return{connectors:(t=e.connectors)===null||t===void 0?void 0:t.map(i=>Bp.ConnectorInSerializer._toJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>Np.EventTypeInSerializer._toJsonObject(i)),settings:e.settings}}}});var Bn=f(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.EventTypeOutSerializer=void 0;Fn.EventTypeOutSerializer={_fromJsonObject(e){return{archived:e.archived,createdAt:new Date(e.createdAt),deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{archived:e.archived,createdAt:e.createdAt,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas,updatedAt:e.updatedAt}}}});var Wp=f(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.EnvironmentOutSerializer=void 0;var Gp=cn(),Up=Bn();Nn.EnvironmentOutSerializer={_fromJsonObject(e){return{connectors:e.connectors.map(t=>Gp.ConnectorOutSerializer._fromJsonObject(t)),createdAt:new Date(e.createdAt),eventTypes:e.eventTypes.map(t=>Up.EventTypeOutSerializer._fromJsonObject(t)),settings:e.settings,version:e.version}},_toJsonObject(e){return{connectors:e.connectors.map(t=>Gp.ConnectorOutSerializer._toJsonObject(t)),createdAt:e.createdAt,eventTypes:e.eventTypes.map(t=>Up.EventTypeOutSerializer._toJsonObject(t)),settings:e.settings,version:e.version}}}});var Vp=f(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.Environment=void 0;var eO=Lp(),tO=Wp(),Ln=ne(),jl=class{constructor(t){this.requestCtx=t}export(t){let r=new Ln.SvixRequest(Ln.HttpMethod.POST,"/api/v1/environment/export");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.send(this.requestCtx,tO.EnvironmentOutSerializer._fromJsonObject)}import(t,r){let i=new Ln.SvixRequest(Ln.HttpMethod.POST,"/api/v1/environment/import");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(eO.EnvironmentInSerializer._toJsonObject(t)),i.sendNoResponseBody(this.requestCtx)}};Gn.Environment=jl});var Kp=f(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.EventTypeImportOpenApiInSerializer=void 0;Un.EventTypeImportOpenApiInSerializer={_fromJsonObject(e){return{dryRun:e.dryRun,replaceAll:e.replaceAll,spec:e.spec,specRaw:e.specRaw}},_toJsonObject(e){return{dryRun:e.dryRun,replaceAll:e.replaceAll,spec:e.spec,specRaw:e.specRaw}}}});var Yp=f(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.EventTypeFromOpenApiSerializer=void 0;Wn.EventTypeFromOpenApiSerializer={_fromJsonObject(e){return{deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}},_toJsonObject(e){return{deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}}}});var Zp=f(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.EventTypeImportOpenApiOutDataSerializer=void 0;var Qp=Yp();Vn.EventTypeImportOpenApiOutDataSerializer={_fromJsonObject(e){var t;return{modified:e.modified,toModify:(t=e.to_modify)===null||t===void 0?void 0:t.map(r=>Qp.EventTypeFromOpenApiSerializer._fromJsonObject(r))}},_toJsonObject(e){var t;return{modified:e.modified,to_modify:(t=e.toModify)===null||t===void 0?void 0:t.map(r=>Qp.EventTypeFromOpenApiSerializer._toJsonObject(r))}}}});var ef=f(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.EventTypeImportOpenApiOutSerializer=void 0;var Xp=Zp();Kn.EventTypeImportOpenApiOutSerializer={_fromJsonObject(e){return{data:Xp.EventTypeImportOpenApiOutDataSerializer._fromJsonObject(e.data)}},_toJsonObject(e){return{data:Xp.EventTypeImportOpenApiOutDataSerializer._toJsonObject(e.data)}}}});var tf=f(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.EventTypePatchSerializer=void 0;Yn.EventTypePatchSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}}}});var rf=f(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.EventTypeUpdateSerializer=void 0;Qn.EventTypeUpdateSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}}}});var of=f(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ListResponseEventTypeOutSerializer=void 0;var nf=Bn();Zn.ListResponseEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>nf.EventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>nf.EventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var sf=f(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.EventType=void 0;var rO=Kp(),iO=ef(),nO=Tl(),Xn=Bn(),oO=tf(),sO=rf(),aO=of(),ze=ne(),Il=class{constructor(t){this.requestCtx=t}list(t){let r=new ze.SvixRequest(ze.HttpMethod.GET,"/api/v1/event-type");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order,include_archived:t?.includeArchived,with_content:t?.withContent}),r.send(this.requestCtx,aO.ListResponseEventTypeOutSerializer._fromJsonObject)}create(t,r){let i=new ze.SvixRequest(ze.HttpMethod.POST,"/api/v1/event-type");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(nO.EventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,Xn.EventTypeOutSerializer._fromJsonObject)}importOpenapi(t,r){let i=new ze.SvixRequest(ze.HttpMethod.POST,"/api/v1/event-type/import/openapi");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(rO.EventTypeImportOpenApiInSerializer._toJsonObject(t)),i.send(this.requestCtx,iO.EventTypeImportOpenApiOutSerializer._fromJsonObject)}get(t){let r=new ze.SvixRequest(ze.HttpMethod.GET,"/api/v1/event-type/{event_type_name}");return r.setPathParam("event_type_name",t),r.send(this.requestCtx,Xn.EventTypeOutSerializer._fromJsonObject)}update(t,r){let i=new ze.SvixRequest(ze.HttpMethod.PUT,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(sO.EventTypeUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Xn.EventTypeOutSerializer._fromJsonObject)}delete(t,r){let i=new ze.SvixRequest(ze.HttpMethod.DELETE,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setQueryParams({expunge:r?.expunge}),i.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new ze.SvixRequest(ze.HttpMethod.PATCH,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(oO.EventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Xn.EventTypeOutSerializer._fromJsonObject)}};eo.EventType=Il});var uf=f(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.Health=void 0;var af=ne(),Dl=class{constructor(t){this.requestCtx=t}get(){return new af.SvixRequest(af.HttpMethod.GET,"/api/v1/health").sendNoResponseBody(this.requestCtx)}};to.Health=Dl});var lf=f(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.IngestSourceConsumerPortalAccessInSerializer=void 0;ro.IngestSourceConsumerPortalAccessInSerializer={_fromJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}},_toJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}}}});var cf=f(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.IngestEndpointHeadersInSerializer=void 0;io.IngestEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var df=f(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.IngestEndpointHeadersOutSerializer=void 0;no.IngestEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var mf=f(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.IngestEndpointInSerializer=void 0;oo.IngestEndpointInSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}}}});var $l=f(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.IngestEndpointOutSerializer=void 0;so.IngestEndpointOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url}},_toJsonObject(e){return{createdAt:e.createdAt,description:e.description,disabled:e.disabled,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:e.updatedAt,url:e.url}}}});var pf=f(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.IngestEndpointSecretInSerializer=void 0;ao.IngestEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var ff=f(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.IngestEndpointSecretOutSerializer=void 0;uo.IngestEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var hf=f(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.IngestEndpointTransformationOutSerializer=void 0;lo.IngestEndpointTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var gf=f(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.IngestEndpointTransformationPatchSerializer=void 0;co.IngestEndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var bf=f(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.IngestEndpointUpdateSerializer=void 0;mo.IngestEndpointUpdateSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}}}});var _f=f(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.ListResponseIngestEndpointOutSerializer=void 0;var vf=$l();po.ListResponseIngestEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>vf.IngestEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>vf.IngestEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var yf=f(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.IngestEndpoint=void 0;var uO=cf(),lO=df(),cO=mf(),ql=$l(),dO=pf(),mO=ff(),pO=hf(),fO=gf(),hO=bf(),gO=_f(),ae=ne(),Rl=class{constructor(t){this.requestCtx=t}list(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint");return i.setPathParam("source_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,gO.ListResponseIngestEndpointOutSerializer._fromJsonObject)}create(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint");return n.setPathParam("source_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(cO.IngestEndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,ql.IngestEndpointOutSerializer._fromJsonObject)}get(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,ql.IngestEndpointOutSerializer._fromJsonObject)}update(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return n.setPathParam("source_id",t),n.setPathParam("endpoint_id",r),n.setBody(hO.IngestEndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,ql.IngestEndpointOutSerializer._fromJsonObject)}delete(t,r){let i=new ae.SvixRequest(ae.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.sendNoResponseBody(this.requestCtx)}getHeaders(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,lO.IngestEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return n.setPathParam("source_id",t),n.setPathParam("endpoint_id",r),n.setBody(uO.IngestEndpointHeadersInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}getSecret(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,mO.IngestEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let o=new ae.SvixRequest(ae.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate");return o.setPathParam("source_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(dO.IngestEndpointSecretInSerializer._toJsonObject(i)),o.sendNoResponseBody(this.requestCtx)}getTransformation(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,pO.IngestEndpointTransformationOutSerializer._fromJsonObject)}setTransformation(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.PATCH,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return n.setPathParam("source_id",t),n.setPathParam("endpoint_id",r),n.setBody(fO.IngestEndpointTransformationPatchSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};fo.IngestEndpoint=Rl});var Cf=f(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.AdobeSignConfigSerializer=void 0;ho.AdobeSignConfigSerializer={_fromJsonObject(e){return{clientId:e.clientId}},_toJsonObject(e){return{clientId:e.clientId}}}});var Of=f(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.AirwallexConfigSerializer=void 0;go.AirwallexConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Sf=f(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.CheckbookConfigSerializer=void 0;bo.CheckbookConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var zl=f(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.CronConfigSerializer=void 0;vo.CronConfigSerializer={_fromJsonObject(e){return{contentType:e.contentType,payload:e.payload,schedule:e.schedule}},_toJsonObject(e){return{contentType:e.contentType,payload:e.payload,schedule:e.schedule}}}});var xf=f(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.DocusignConfigSerializer=void 0;_o.DocusignConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var wf=f(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.EasypostConfigSerializer=void 0;yo.EasypostConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var kf=f(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.GithubConfigSerializer=void 0;Co.GithubConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Af=f(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.HubspotConfigSerializer=void 0;Oo.HubspotConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Ef=f(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.MetaConfigSerializer=void 0;So.MetaConfigSerializer={_fromJsonObject(e){return{secret:e.secret,verifyToken:e.verifyToken}},_toJsonObject(e){return{secret:e.secret,verifyToken:e.verifyToken}}}});var Pf=f(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.OrumIoConfigSerializer=void 0;xo.OrumIoConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Tf=f(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.PandaDocConfigSerializer=void 0;wo.PandaDocConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var jf=f(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.PortIoConfigSerializer=void 0;ko.PortIoConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var If=f(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.RutterConfigSerializer=void 0;Ao.RutterConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Df=f(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.SegmentConfigSerializer=void 0;Eo.SegmentConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var $f=f(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.ShopifyConfigSerializer=void 0;Po.ShopifyConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var qf=f(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.SlackConfigSerializer=void 0;To.SlackConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Rf=f(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.StripeConfigSerializer=void 0;jo.StripeConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var zf=f(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.SvixConfigSerializer=void 0;Io.SvixConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Mf=f(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.TelnyxConfigSerializer=void 0;Do.TelnyxConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Jf=f($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.VapiConfigSerializer=void 0;$o.VapiConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Hf=f(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.VeriffConfigSerializer=void 0;qo.VeriffConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Ff=f(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.ZoomConfigSerializer=void 0;Ro.ZoomConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var lh=f(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.IngestSourceInSerializer=void 0;var Bf=Cf(),Nf=Of(),Lf=Sf(),Gf=zl(),Uf=xf(),Wf=wf(),Vf=kf(),Kf=Af(),Yf=Ef(),Qf=Pf(),Zf=Tf(),Xf=jf(),eh=If(),th=Df(),rh=$f(),ih=qf(),nh=Rf(),J=zf(),oh=Mf(),sh=Jf(),ah=Hf(),uh=Ff();zo.IngestSourceInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return Gf.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return Bf.AdobeSignConfigSerializer._fromJsonObject(e.config);case"beehiiv":return J.SvixConfigSerializer._fromJsonObject(e.config);case"brex":return J.SvixConfigSerializer._fromJsonObject(e.config);case"checkbook":return Lf.CheckbookConfigSerializer._fromJsonObject(e.config);case"clerk":return J.SvixConfigSerializer._fromJsonObject(e.config);case"docusign":return Uf.DocusignConfigSerializer._fromJsonObject(e.config);case"easypost":return Wf.EasypostConfigSerializer._fromJsonObject(e.config);case"github":return Vf.GithubConfigSerializer._fromJsonObject(e.config);case"guesty":return J.SvixConfigSerializer._fromJsonObject(e.config);case"hubspot":return Kf.HubspotConfigSerializer._fromJsonObject(e.config);case"incident-io":return J.SvixConfigSerializer._fromJsonObject(e.config);case"lithic":return J.SvixConfigSerializer._fromJsonObject(e.config);case"meta":return Yf.MetaConfigSerializer._fromJsonObject(e.config);case"nash":return J.SvixConfigSerializer._fromJsonObject(e.config);case"orum-io":return Qf.OrumIoConfigSerializer._fromJsonObject(e.config);case"panda-doc":return Zf.PandaDocConfigSerializer._fromJsonObject(e.config);case"port-io":return Xf.PortIoConfigSerializer._fromJsonObject(e.config);case"pleo":return J.SvixConfigSerializer._fromJsonObject(e.config);case"psi-fi":return J.SvixConfigSerializer._fromJsonObject(e.config);case"replicate":return J.SvixConfigSerializer._fromJsonObject(e.config);case"resend":return J.SvixConfigSerializer._fromJsonObject(e.config);case"rutter":return eh.RutterConfigSerializer._fromJsonObject(e.config);case"safebase":return J.SvixConfigSerializer._fromJsonObject(e.config);case"sardine":return J.SvixConfigSerializer._fromJsonObject(e.config);case"segment":return th.SegmentConfigSerializer._fromJsonObject(e.config);case"shopify":return rh.ShopifyConfigSerializer._fromJsonObject(e.config);case"slack":return ih.SlackConfigSerializer._fromJsonObject(e.config);case"stripe":return nh.StripeConfigSerializer._fromJsonObject(e.config);case"stych":return J.SvixConfigSerializer._fromJsonObject(e.config);case"svix":return J.SvixConfigSerializer._fromJsonObject(e.config);case"zoom":return uh.ZoomConfigSerializer._fromJsonObject(e.config);case"telnyx":return oh.TelnyxConfigSerializer._fromJsonObject(e.config);case"vapi":return sh.VapiConfigSerializer._fromJsonObject(e.config);case"open-ai":return J.SvixConfigSerializer._fromJsonObject(e.config);case"render":return J.SvixConfigSerializer._fromJsonObject(e.config);case"veriff":return ah.VeriffConfigSerializer._fromJsonObject(e.config);case"airwallex":return Nf.AirwallexConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),metadata:e.metadata,name:e.name,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"generic-webhook":t={};break;case"cron":t=Gf.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=Bf.AdobeSignConfigSerializer._toJsonObject(e.config);break;case"beehiiv":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"brex":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"checkbook":t=Lf.CheckbookConfigSerializer._toJsonObject(e.config);break;case"clerk":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"docusign":t=Uf.DocusignConfigSerializer._toJsonObject(e.config);break;case"easypost":t=Wf.EasypostConfigSerializer._toJsonObject(e.config);break;case"github":t=Vf.GithubConfigSerializer._toJsonObject(e.config);break;case"guesty":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"hubspot":t=Kf.HubspotConfigSerializer._toJsonObject(e.config);break;case"incident-io":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"lithic":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"meta":t=Yf.MetaConfigSerializer._toJsonObject(e.config);break;case"nash":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"orum-io":t=Qf.OrumIoConfigSerializer._toJsonObject(e.config);break;case"panda-doc":t=Zf.PandaDocConfigSerializer._toJsonObject(e.config);break;case"port-io":t=Xf.PortIoConfigSerializer._toJsonObject(e.config);break;case"pleo":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"psi-fi":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"replicate":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"resend":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"rutter":t=eh.RutterConfigSerializer._toJsonObject(e.config);break;case"safebase":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"sardine":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"segment":t=th.SegmentConfigSerializer._toJsonObject(e.config);break;case"shopify":t=rh.ShopifyConfigSerializer._toJsonObject(e.config);break;case"slack":t=ih.SlackConfigSerializer._toJsonObject(e.config);break;case"stripe":t=nh.StripeConfigSerializer._toJsonObject(e.config);break;case"stych":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"svix":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"zoom":t=uh.ZoomConfigSerializer._toJsonObject(e.config);break;case"telnyx":t=oh.TelnyxConfigSerializer._toJsonObject(e.config);break;case"vapi":t=sh.VapiConfigSerializer._toJsonObject(e.config);break;case"open-ai":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"render":t=J.SvixConfigSerializer._toJsonObject(e.config);break;case"veriff":t=ah.VeriffConfigSerializer._toJsonObject(e.config);break;case"airwallex":t=Nf.AirwallexConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,metadata:e.metadata,name:e.name,uid:e.uid}}}});var ch=f(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.AdobeSignConfigOutSerializer=void 0;Mo.AdobeSignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var dh=f(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.AirwallexConfigOutSerializer=void 0;Jo.AirwallexConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var mh=f(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.CheckbookConfigOutSerializer=void 0;Ho.CheckbookConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ph=f(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.DocusignConfigOutSerializer=void 0;Fo.DocusignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var fh=f(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.EasypostConfigOutSerializer=void 0;Bo.EasypostConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var hh=f(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.GithubConfigOutSerializer=void 0;No.GithubConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var gh=f(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.HubspotConfigOutSerializer=void 0;Lo.HubspotConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var bh=f(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.MetaConfigOutSerializer=void 0;Go.MetaConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var vh=f(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.OrumIoConfigOutSerializer=void 0;Uo.OrumIoConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var _h=f(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.PandaDocConfigOutSerializer=void 0;Wo.PandaDocConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var yh=f(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.PortIoConfigOutSerializer=void 0;Vo.PortIoConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Ch=f(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.RutterConfigOutSerializer=void 0;Ko.RutterConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Oh=f(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.SegmentConfigOutSerializer=void 0;Yo.SegmentConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Sh=f(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.ShopifyConfigOutSerializer=void 0;Qo.ShopifyConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var xh=f(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.SlackConfigOutSerializer=void 0;Zo.SlackConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var wh=f(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.StripeConfigOutSerializer=void 0;Xo.StripeConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var kh=f(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.SvixConfigOutSerializer=void 0;es.SvixConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Ah=f(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.TelnyxConfigOutSerializer=void 0;ts.TelnyxConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Eh=f(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.VapiConfigOutSerializer=void 0;rs.VapiConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Ph=f(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.VeriffConfigOutSerializer=void 0;is.VeriffConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Th=f(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.ZoomConfigOutSerializer=void 0;ns.ZoomConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Ml=f(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.IngestSourceOutSerializer=void 0;var jh=ch(),Ih=dh(),Dh=mh(),$h=zl(),qh=ph(),Rh=fh(),zh=hh(),Mh=gh(),Jh=bh(),Hh=vh(),Fh=_h(),Bh=yh(),Nh=Ch(),Lh=Oh(),Gh=Sh(),Uh=xh(),Wh=wh(),H=kh(),Vh=Ah(),Kh=Eh(),Yh=Ph(),Qh=Th();os.IngestSourceOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return $h.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return jh.AdobeSignConfigOutSerializer._fromJsonObject(e.config);case"beehiiv":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"brex":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"checkbook":return Dh.CheckbookConfigOutSerializer._fromJsonObject(e.config);case"clerk":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"docusign":return qh.DocusignConfigOutSerializer._fromJsonObject(e.config);case"easypost":return Rh.EasypostConfigOutSerializer._fromJsonObject(e.config);case"github":return zh.GithubConfigOutSerializer._fromJsonObject(e.config);case"guesty":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"hubspot":return Mh.HubspotConfigOutSerializer._fromJsonObject(e.config);case"incident-io":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"lithic":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"meta":return Jh.MetaConfigOutSerializer._fromJsonObject(e.config);case"nash":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"orum-io":return Hh.OrumIoConfigOutSerializer._fromJsonObject(e.config);case"panda-doc":return Fh.PandaDocConfigOutSerializer._fromJsonObject(e.config);case"port-io":return Bh.PortIoConfigOutSerializer._fromJsonObject(e.config);case"psi-fi":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"pleo":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"replicate":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"resend":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"rutter":return Nh.RutterConfigOutSerializer._fromJsonObject(e.config);case"safebase":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"sardine":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"segment":return Lh.SegmentConfigOutSerializer._fromJsonObject(e.config);case"shopify":return Gh.ShopifyConfigOutSerializer._fromJsonObject(e.config);case"slack":return Uh.SlackConfigOutSerializer._fromJsonObject(e.config);case"stripe":return Wh.StripeConfigOutSerializer._fromJsonObject(e.config);case"stych":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"svix":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"zoom":return Qh.ZoomConfigOutSerializer._fromJsonObject(e.config);case"telnyx":return Vh.TelnyxConfigOutSerializer._fromJsonObject(e.config);case"vapi":return Kh.VapiConfigOutSerializer._fromJsonObject(e.config);case"open-ai":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"render":return H.SvixConfigOutSerializer._fromJsonObject(e.config);case"veriff":return Yh.VeriffConfigOutSerializer._fromJsonObject(e.config);case"airwallex":return Ih.AirwallexConfigOutSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),createdAt:new Date(e.createdAt),id:e.id,ingestUrl:e.ingestUrl,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){let t;switch(e.type){case"generic-webhook":t={};break;case"cron":t=$h.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=jh.AdobeSignConfigOutSerializer._toJsonObject(e.config);break;case"beehiiv":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"brex":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"checkbook":t=Dh.CheckbookConfigOutSerializer._toJsonObject(e.config);break;case"clerk":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"docusign":t=qh.DocusignConfigOutSerializer._toJsonObject(e.config);break;case"easypost":t=Rh.EasypostConfigOutSerializer._toJsonObject(e.config);break;case"github":t=zh.GithubConfigOutSerializer._toJsonObject(e.config);break;case"guesty":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"hubspot":t=Mh.HubspotConfigOutSerializer._toJsonObject(e.config);break;case"incident-io":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"lithic":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"meta":t=Jh.MetaConfigOutSerializer._toJsonObject(e.config);break;case"nash":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"orum-io":t=Hh.OrumIoConfigOutSerializer._toJsonObject(e.config);break;case"panda-doc":t=Fh.PandaDocConfigOutSerializer._toJsonObject(e.config);break;case"port-io":t=Bh.PortIoConfigOutSerializer._toJsonObject(e.config);break;case"psi-fi":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"pleo":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"replicate":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"resend":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"rutter":t=Nh.RutterConfigOutSerializer._toJsonObject(e.config);break;case"safebase":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"sardine":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"segment":t=Lh.SegmentConfigOutSerializer._toJsonObject(e.config);break;case"shopify":t=Gh.ShopifyConfigOutSerializer._toJsonObject(e.config);break;case"slack":t=Uh.SlackConfigOutSerializer._toJsonObject(e.config);break;case"stripe":t=Wh.StripeConfigOutSerializer._toJsonObject(e.config);break;case"stych":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"svix":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"zoom":t=Qh.ZoomConfigOutSerializer._toJsonObject(e.config);break;case"telnyx":t=Vh.TelnyxConfigOutSerializer._toJsonObject(e.config);break;case"vapi":t=Kh.VapiConfigOutSerializer._toJsonObject(e.config);break;case"open-ai":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"render":t=H.SvixConfigOutSerializer._toJsonObject(e.config);break;case"veriff":t=Yh.VeriffConfigOutSerializer._toJsonObject(e.config);break;case"airwallex":t=Ih.AirwallexConfigOutSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,createdAt:e.createdAt,id:e.id,ingestUrl:e.ingestUrl,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:e.updatedAt}}}});var Xh=f(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.ListResponseIngestSourceOutSerializer=void 0;var Zh=Ml();ss.ListResponseIngestSourceOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Zh.IngestSourceOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Zh.IngestSourceOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var eg=f(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.RotateTokenOutSerializer=void 0;as.RotateTokenOutSerializer={_fromJsonObject(e){return{ingestUrl:e.ingestUrl}},_toJsonObject(e){return{ingestUrl:e.ingestUrl}}}});var rg=f(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.IngestSource=void 0;var tg=lh(),Jl=Ml(),bO=Xh(),vO=eg(),Ye=ne(),Hl=class{constructor(t){this.requestCtx=t}list(t){let r=new Ye.SvixRequest(Ye.HttpMethod.GET,"/ingest/api/v1/source");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,bO.ListResponseIngestSourceOutSerializer._fromJsonObject)}create(t,r){let i=new Ye.SvixRequest(Ye.HttpMethod.POST,"/ingest/api/v1/source");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(tg.IngestSourceInSerializer._toJsonObject(t)),i.send(this.requestCtx,Jl.IngestSourceOutSerializer._fromJsonObject)}get(t){let r=new Ye.SvixRequest(Ye.HttpMethod.GET,"/ingest/api/v1/source/{source_id}");return r.setPathParam("source_id",t),r.send(this.requestCtx,Jl.IngestSourceOutSerializer._fromJsonObject)}update(t,r){let i=new Ye.SvixRequest(Ye.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}");return i.setPathParam("source_id",t),i.setBody(tg.IngestSourceInSerializer._toJsonObject(r)),i.send(this.requestCtx,Jl.IngestSourceOutSerializer._fromJsonObject)}delete(t){let r=new Ye.SvixRequest(Ye.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}");return r.setPathParam("source_id",t),r.sendNoResponseBody(this.requestCtx)}rotateToken(t,r){let i=new Ye.SvixRequest(Ye.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/token/rotate");return i.setPathParam("source_id",t),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.send(this.requestCtx,vO.RotateTokenOutSerializer._fromJsonObject)}};us.IngestSource=Hl});var ng=f(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.Ingest=void 0;var _O=_l(),yO=lf(),CO=yf(),OO=rg(),ig=ne(),Fl=class{constructor(t){this.requestCtx=t}get endpoint(){return new CO.IngestEndpoint(this.requestCtx)}get source(){return new OO.IngestSource(this.requestCtx)}dashboard(t,r,i){let n=new ig.SvixRequest(ig.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/dashboard");return n.setPathParam("source_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(yO.IngestSourceConsumerPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,_O.DashboardAccessOutSerializer._fromJsonObject)}};ls.Ingest=Fl});var og=f(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.IntegrationInSerializer=void 0;cs.IntegrationInSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var sg=f(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.IntegrationKeyOutSerializer=void 0;ds.IntegrationKeyOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Bl=f(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.IntegrationOutSerializer=void 0;ms.IntegrationOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),featureFlags:e.featureFlags,id:e.id,name:e.name,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,featureFlags:e.featureFlags,id:e.id,name:e.name,updatedAt:e.updatedAt}}}});var ag=f(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.IntegrationUpdateSerializer=void 0;ps.IntegrationUpdateSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var lg=f(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.ListResponseIntegrationOutSerializer=void 0;var ug=Bl();fs.ListResponseIntegrationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>ug.IntegrationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>ug.IntegrationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var dg=f(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.Integration=void 0;var SO=og(),cg=sg(),Nl=Bl(),xO=ag(),wO=lg(),Me=ne(),Ll=class{constructor(t){this.requestCtx=t}list(t,r){let i=new Me.SvixRequest(Me.HttpMethod.GET,"/api/v1/app/{app_id}/integration");return i.setPathParam("app_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,wO.ListResponseIntegrationOutSerializer._fromJsonObject)}create(t,r,i){let n=new Me.SvixRequest(Me.HttpMethod.POST,"/api/v1/app/{app_id}/integration");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(SO.IntegrationInSerializer._toJsonObject(r)),n.send(this.requestCtx,Nl.IntegrationOutSerializer._fromJsonObject)}get(t,r){let i=new Me.SvixRequest(Me.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}");return i.setPathParam("app_id",t),i.setPathParam("integ_id",r),i.send(this.requestCtx,Nl.IntegrationOutSerializer._fromJsonObject)}update(t,r,i){let n=new Me.SvixRequest(Me.HttpMethod.PUT,"/api/v1/app/{app_id}/integration/{integ_id}");return n.setPathParam("app_id",t),n.setPathParam("integ_id",r),n.setBody(xO.IntegrationUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,Nl.IntegrationOutSerializer._fromJsonObject)}delete(t,r){let i=new Me.SvixRequest(Me.HttpMethod.DELETE,"/api/v1/app/{app_id}/integration/{integ_id}");return i.setPathParam("app_id",t),i.setPathParam("integ_id",r),i.sendNoResponseBody(this.requestCtx)}getKey(t,r){let i=new Me.SvixRequest(Me.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}/key");return i.setPathParam("app_id",t),i.setPathParam("integ_id",r),i.send(this.requestCtx,cg.IntegrationKeyOutSerializer._fromJsonObject)}rotateKey(t,r,i){let n=new Me.SvixRequest(Me.HttpMethod.POST,"/api/v1/app/{app_id}/integration/{integ_id}/key/rotate");return n.setPathParam("app_id",t),n.setPathParam("integ_id",r),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.send(this.requestCtx,cg.IntegrationKeyOutSerializer._fromJsonObject)}};hs.Integration=Ll});var fg=f(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.ExpungeAllContentsOutSerializer=void 0;var mg=xt(),pg=wt();gs.ExpungeAllContentsOutSerializer={_fromJsonObject(e){return{id:e.id,status:mg.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:pg.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:mg.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:pg.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var gg=f(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.ListResponseMessageOutSerializer=void 0;var hg=Xr();bs.ListResponseMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>hg.MessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>hg.MessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var bg=f(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.MessagePrecheckInSerializer=void 0;vs.MessagePrecheckInSerializer={_fromJsonObject(e){return{channels:e.channels,eventType:e.eventType}},_toJsonObject(e){return{channels:e.channels,eventType:e.eventType}}}});var vg=f(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.MessagePrecheckOutSerializer=void 0;_s.MessagePrecheckOutSerializer={_fromJsonObject(e){return{active:e.active}},_toJsonObject(e){return{active:e.active}}}});var _g=f(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.PollingEndpointConsumerSeekInSerializer=void 0;ys.PollingEndpointConsumerSeekInSerializer={_fromJsonObject(e){return{after:new Date(e.after)}},_toJsonObject(e){return{after:e.after}}}});var yg=f(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.PollingEndpointConsumerSeekOutSerializer=void 0;Cs.PollingEndpointConsumerSeekOutSerializer={_fromJsonObject(e){return{iterator:e.iterator}},_toJsonObject(e){return{iterator:e.iterator}}}});var Cg=f(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.PollingEndpointMessageOutSerializer=void 0;Os.PollingEndpointMessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,headers:e.headers,id:e.id,payload:e.payload,tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,headers:e.headers,id:e.id,payload:e.payload,tags:e.tags,timestamp:e.timestamp}}}});var Sg=f(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.PollingEndpointOutSerializer=void 0;var Og=Cg();Ss.PollingEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Og.PollingEndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>Og.PollingEndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var wg=f(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.MessagePoller=void 0;var kO=_g(),AO=yg(),xg=Sg(),cr=ne(),Gl=class{constructor(t){this.requestCtx=t}poll(t,r,i){let n=new cr.SvixRequest(cr.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}");return n.setPathParam("app_id",t),n.setPathParam("sink_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,event_type:i?.eventType,channel:i?.channel,after:i?.after}),n.send(this.requestCtx,xg.PollingEndpointOutSerializer._fromJsonObject)}consumerPoll(t,r,i,n){let o=new cr.SvixRequest(cr.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}");return o.setPathParam("app_id",t),o.setPathParam("sink_id",r),o.setPathParam("consumer_id",i),o.setQueryParams({limit:n?.limit,iterator:n?.iterator}),o.send(this.requestCtx,xg.PollingEndpointOutSerializer._fromJsonObject)}consumerSeek(t,r,i,n,o){let s=new cr.SvixRequest(cr.HttpMethod.POST,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek");return s.setPathParam("app_id",t),s.setPathParam("sink_id",r),s.setPathParam("consumer_id",i),s.setHeaderParam("idempotency-key",o?.idempotencyKey),s.setBody(kO.PollingEndpointConsumerSeekInSerializer._toJsonObject(n)),s.send(this.requestCtx,AO.PollingEndpointConsumerSeekOutSerializer._fromJsonObject)}};xs.MessagePoller=Gl});var Ag=f(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.MessageInSerializer=void 0;var kg=Ri();ws.MessageInSerializer={_fromJsonObject(e){return{application:e.application!=null?kg.ApplicationInSerializer._fromJsonObject(e.application):void 0,channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,payload:e.payload,payloadRetentionHours:e.payloadRetentionHours,payloadRetentionPeriod:e.payloadRetentionPeriod,tags:e.tags,transformationsParams:e.transformationsParams}},_toJsonObject(e){return{application:e.application!=null?kg.ApplicationInSerializer._toJsonObject(e.application):void 0,channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,payload:e.payload,payloadRetentionHours:e.payloadRetentionHours,payloadRetentionPeriod:e.payloadRetentionPeriod,tags:e.tags,transformationsParams:e.transformationsParams}}}});var Wl=f(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.messageInRaw=dr.Message=void 0;var EO=fg(),PO=gg(),Eg=Xr(),TO=bg(),jO=vg(),IO=wg(),Qe=ne(),DO=Ag(),Ul=class{constructor(t){this.requestCtx=t}get poller(){return new IO.MessagePoller(this.requestCtx)}list(t,r){let i=new Qe.SvixRequest(Qe.HttpMethod.GET,"/api/v1/app/{app_id}/msg");return i.setPathParam("app_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,channel:r?.channel,before:r?.before,after:r?.after,with_content:r?.withContent,tag:r?.tag,event_types:r?.eventTypes}),i.send(this.requestCtx,PO.ListResponseMessageOutSerializer._fromJsonObject)}create(t,r,i){let n=new Qe.SvixRequest(Qe.HttpMethod.POST,"/api/v1/app/{app_id}/msg");return n.setPathParam("app_id",t),n.setQueryParams({with_content:i?.withContent}),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(DO.MessageInSerializer._toJsonObject(r)),n.send(this.requestCtx,Eg.MessageOutSerializer._fromJsonObject)}expungeAllContents(t,r){let i=new Qe.SvixRequest(Qe.HttpMethod.POST,"/api/v1/app/{app_id}/msg/expunge-all-contents");return i.setPathParam("app_id",t),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.send(this.requestCtx,EO.ExpungeAllContentsOutSerializer._fromJsonObject)}precheck(t,r,i){let n=new Qe.SvixRequest(Qe.HttpMethod.POST,"/api/v1/app/{app_id}/msg/precheck/active");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(TO.MessagePrecheckInSerializer._toJsonObject(r)),n.send(this.requestCtx,jO.MessagePrecheckOutSerializer._fromJsonObject)}get(t,r,i){let n=new Qe.SvixRequest(Qe.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setQueryParams({with_content:i?.withContent}),n.send(this.requestCtx,Eg.MessageOutSerializer._fromJsonObject)}expungeContent(t,r){let i=new Qe.SvixRequest(Qe.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/content");return i.setPathParam("app_id",t),i.setPathParam("msg_id",r),i.sendNoResponseBody(this.requestCtx)}};dr.Message=Ul;function $O(e,t,r){return{eventType:e,payload:{},transformationsParams:{rawPayload:t,headers:r?{"content-type":r}:void 0}}}dr.messageInRaw=$O});var Vl=f(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.EmptyResponseSerializer=void 0;ks.EmptyResponseSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ei=f(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.MessageStatusTextSerializer=Vt.MessageStatusText=void 0;var qO;(function(e){e.Success="success",e.Pending="pending",e.Fail="fail",e.Sending="sending"})(qO=Vt.MessageStatusText||(Vt.MessageStatusText={}));Vt.MessageStatusTextSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var jg=f(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.EndpointMessageOutSerializer=void 0;var Pg=lr(),Tg=ei();As.EndpointMessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,id:e.id,nextAttempt:e.nextAttempt?new Date(e.nextAttempt):null,payload:e.payload,status:Pg.MessageStatusSerializer._fromJsonObject(e.status),statusText:Tg.MessageStatusTextSerializer._fromJsonObject(e.statusText),tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,id:e.id,nextAttempt:e.nextAttempt,payload:e.payload,status:Pg.MessageStatusSerializer._toJsonObject(e.status),statusText:Tg.MessageStatusTextSerializer._toJsonObject(e.statusText),tags:e.tags,timestamp:e.timestamp}}}});var Dg=f(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.ListResponseEndpointMessageOutSerializer=void 0;var Ig=jg();Es.ListResponseEndpointMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Ig.EndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Ig.EndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Kl=f(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.MessageAttemptTriggerTypeSerializer=Kt.MessageAttemptTriggerType=void 0;var RO;(function(e){e[e.Scheduled=0]="Scheduled",e[e.Manual=1]="Manual"})(RO=Kt.MessageAttemptTriggerType||(Kt.MessageAttemptTriggerType={}));Kt.MessageAttemptTriggerTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Yl=f(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.MessageAttemptOutSerializer=void 0;var $g=Kl(),qg=Xr(),Rg=lr(),zg=ei();Ps.MessageAttemptOutSerializer={_fromJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?qg.MessageOutSerializer._fromJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:Rg.MessageStatusSerializer._fromJsonObject(e.status),statusText:zg.MessageStatusTextSerializer._fromJsonObject(e.statusText),timestamp:new Date(e.timestamp),triggerType:$g.MessageAttemptTriggerTypeSerializer._fromJsonObject(e.triggerType),url:e.url}},_toJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?qg.MessageOutSerializer._toJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:Rg.MessageStatusSerializer._toJsonObject(e.status),statusText:zg.MessageStatusTextSerializer._toJsonObject(e.statusText),timestamp:e.timestamp,triggerType:$g.MessageAttemptTriggerTypeSerializer._toJsonObject(e.triggerType),url:e.url}}}});var Jg=f(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.ListResponseMessageAttemptOutSerializer=void 0;var Mg=Yl();Ts.ListResponseMessageAttemptOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Mg.MessageAttemptOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Mg.MessageAttemptOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Bg=f(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.MessageEndpointOutSerializer=void 0;var Hg=lr(),Fg=ei();js.MessageEndpointOutSerializer={_fromJsonObject(e){return{channels:e.channels,createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,nextAttempt:e.nextAttempt?new Date(e.nextAttempt):null,rateLimit:e.rateLimit,status:Hg.MessageStatusSerializer._fromJsonObject(e.status),statusText:Fg.MessageStatusTextSerializer._fromJsonObject(e.statusText),throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,nextAttempt:e.nextAttempt,rateLimit:e.rateLimit,status:Hg.MessageStatusSerializer._toJsonObject(e.status),statusText:Fg.MessageStatusTextSerializer._toJsonObject(e.statusText),throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}});var Lg=f(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.ListResponseMessageEndpointOutSerializer=void 0;var Ng=Bg();Is.ListResponseMessageEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Ng.MessageEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Ng.MessageEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Ug=f(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.MessageAttempt=void 0;var zO=Vl(),MO=Dg(),Gg=Jg(),JO=Lg(),HO=Yl(),Je=ne(),Ql=class{constructor(t){this.requestCtx=t}listByEndpoint(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,status:i?.status,status_code_class:i?.statusCodeClass,channel:i?.channel,tag:i?.tag,before:i?.before,after:i?.after,with_content:i?.withContent,with_msg:i?.withMsg,event_types:i?.eventTypes}),n.send(this.requestCtx,Gg.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listByMsg(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/msg/{msg_id}");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,status:i?.status,status_code_class:i?.statusCodeClass,channel:i?.channel,tag:i?.tag,endpoint_id:i?.endpointId,before:i?.before,after:i?.after,with_content:i?.withContent,event_types:i?.eventTypes}),n.send(this.requestCtx,Gg.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listAttemptedMessages(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,channel:i?.channel,tag:i?.tag,status:i?.status,before:i?.before,after:i?.after,with_content:i?.withContent,event_types:i?.eventTypes}),n.send(this.requestCtx,MO.ListResponseEndpointMessageOutSerializer._fromJsonObject)}get(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setPathParam("attempt_id",i),n.send(this.requestCtx,HO.MessageAttemptOutSerializer._fromJsonObject)}expungeContent(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setPathParam("attempt_id",i),n.sendNoResponseBody(this.requestCtx)}listAttemptedDestinations(t,r,i){let n=new Je.SvixRequest(Je.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator}),n.send(this.requestCtx,JO.ListResponseMessageEndpointOutSerializer._fromJsonObject)}resend(t,r,i,n){let o=new Je.SvixRequest(Je.HttpMethod.POST,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend");return o.setPathParam("app_id",t),o.setPathParam("msg_id",r),o.setPathParam("endpoint_id",i),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.send(this.requestCtx,zO.EmptyResponseSerializer._fromJsonObject)}};Ds.MessageAttempt=Ql});var Zl=f($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.OperationalWebhookEndpointOutSerializer=void 0;$s.OperationalWebhookEndpointOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url}},_toJsonObject(e){return{createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:e.updatedAt,url:e.url}}}});var Vg=f(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.ListResponseOperationalWebhookEndpointOutSerializer=void 0;var Wg=Zl();qs.ListResponseOperationalWebhookEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Wg.OperationalWebhookEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Wg.OperationalWebhookEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Kg=f(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.OperationalWebhookEndpointHeadersInSerializer=void 0;Rs.OperationalWebhookEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var Yg=f(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.OperationalWebhookEndpointHeadersOutSerializer=void 0;zs.OperationalWebhookEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var Qg=f(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.OperationalWebhookEndpointInSerializer=void 0;Ms.OperationalWebhookEndpointInSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}}}});var Zg=f(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.OperationalWebhookEndpointSecretInSerializer=void 0;Js.OperationalWebhookEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Xg=f(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.OperationalWebhookEndpointSecretOutSerializer=void 0;Hs.OperationalWebhookEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var eb=f(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.OperationalWebhookEndpointUpdateSerializer=void 0;Fs.OperationalWebhookEndpointUpdateSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}}}});var tc=f(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.OperationalWebhookEndpoint=void 0;var FO=Vg(),BO=Kg(),NO=Yg(),LO=Qg(),Xl=Zl(),GO=Zg(),UO=Xg(),WO=eb(),_e=ne(),ec=class{constructor(t){this.requestCtx=t}list(t){let r=new _e.SvixRequest(_e.HttpMethod.GET,"/api/v1/operational-webhook/endpoint");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,FO.ListResponseOperationalWebhookEndpointOutSerializer._fromJsonObject)}create(t,r){let i=new _e.SvixRequest(_e.HttpMethod.POST,"/api/v1/operational-webhook/endpoint");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(LO.OperationalWebhookEndpointInSerializer._toJsonObject(t)),i.send(this.requestCtx,Xl.OperationalWebhookEndpointOutSerializer._fromJsonObject)}get(t){let r=new _e.SvixRequest(_e.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,Xl.OperationalWebhookEndpointOutSerializer._fromJsonObject)}update(t,r){let i=new _e.SvixRequest(_e.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return i.setPathParam("endpoint_id",t),i.setBody(WO.OperationalWebhookEndpointUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Xl.OperationalWebhookEndpointOutSerializer._fromJsonObject)}delete(t){let r=new _e.SvixRequest(_e.HttpMethod.DELETE,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return r.setPathParam("endpoint_id",t),r.sendNoResponseBody(this.requestCtx)}getHeaders(t){let r=new _e.SvixRequest(_e.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,NO.OperationalWebhookEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r){let i=new _e.SvixRequest(_e.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return i.setPathParam("endpoint_id",t),i.setBody(BO.OperationalWebhookEndpointHeadersInSerializer._toJsonObject(r)),i.sendNoResponseBody(this.requestCtx)}getSecret(t){let r=new _e.SvixRequest(_e.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,UO.OperationalWebhookEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i){let n=new _e.SvixRequest(_e.HttpMethod.POST,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate");return n.setPathParam("endpoint_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(GO.OperationalWebhookEndpointSecretInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}};Bs.OperationalWebhookEndpoint=ec});var tb=f(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.OperationalWebhook=void 0;var VO=tc(),rc=class{constructor(t){this.requestCtx=t}get endpoint(){return new VO.OperationalWebhookEndpoint(this.requestCtx)}};Ns.OperationalWebhook=rc});var nb=f(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.AggregateEventTypesOutSerializer=void 0;var rb=xt(),ib=wt();Ls.AggregateEventTypesOutSerializer={_fromJsonObject(e){return{id:e.id,status:rb.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:ib.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:rb.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:ib.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var ob=f(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.AppUsageStatsInSerializer=void 0;Gs.AppUsageStatsInSerializer={_fromJsonObject(e){return{appIds:e.appIds,since:new Date(e.since),until:new Date(e.until)}},_toJsonObject(e){return{appIds:e.appIds,since:e.since,until:e.until}}}});var ub=f(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.AppUsageStatsOutSerializer=void 0;var sb=xt(),ab=wt();Us.AppUsageStatsOutSerializer={_fromJsonObject(e){return{id:e.id,status:sb.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:ab.BackgroundTaskTypeSerializer._fromJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:sb.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:ab.BackgroundTaskTypeSerializer._toJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds,updatedAt:e.updatedAt}}}});var lb=f(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.Statistics=void 0;var KO=nb(),YO=ob(),QO=ub(),Ws=ne(),ic=class{constructor(t){this.requestCtx=t}aggregateAppStats(t,r){let i=new Ws.SvixRequest(Ws.HttpMethod.POST,"/api/v1/stats/usage/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(YO.AppUsageStatsInSerializer._toJsonObject(t)),i.send(this.requestCtx,QO.AppUsageStatsOutSerializer._fromJsonObject)}aggregateEventTypes(){return new Ws.SvixRequest(Ws.HttpMethod.PUT,"/api/v1/stats/usage/event-types").send(this.requestCtx,KO.AggregateEventTypesOutSerializer._fromJsonObject)}};Vs.Statistics=ic});var cb=f(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.HttpSinkHeadersPatchInSerializer=void 0;Ks.HttpSinkHeadersPatchInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var db=f(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.SinkTransformationOutSerializer=void 0;Ys.SinkTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var nc=f(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.StreamEventTypeOutSerializer=void 0;Qs.StreamEventTypeOutSerializer={_fromJsonObject(e){return{archived:e.archived,createdAt:new Date(e.createdAt),deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{archived:e.archived,createdAt:e.createdAt,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name,updatedAt:e.updatedAt}}}});var pb=f(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.ListResponseStreamEventTypeOutSerializer=void 0;var mb=nc();Zs.ListResponseStreamEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>mb.StreamEventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>mb.StreamEventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var fb=f(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.StreamEventTypeInSerializer=void 0;Xs.StreamEventTypeInSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}}}});var hb=f(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.StreamEventTypePatchSerializer=void 0;ea.StreamEventTypePatchSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}}}});var bb=f(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.StreamingEventType=void 0;var ZO=pb(),gb=fb(),ta=nc(),XO=hb(),Ze=ne(),oc=class{constructor(t){this.requestCtx=t}list(t){let r=new Ze.SvixRequest(Ze.HttpMethod.GET,"/api/v1/stream/event-type");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order,include_archived:t?.includeArchived}),r.send(this.requestCtx,ZO.ListResponseStreamEventTypeOutSerializer._fromJsonObject)}create(t,r){let i=new Ze.SvixRequest(Ze.HttpMethod.POST,"/api/v1/stream/event-type");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(gb.StreamEventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,ta.StreamEventTypeOutSerializer._fromJsonObject)}get(t){let r=new Ze.SvixRequest(Ze.HttpMethod.GET,"/api/v1/stream/event-type/{name}");return r.setPathParam("name",t),r.send(this.requestCtx,ta.StreamEventTypeOutSerializer._fromJsonObject)}update(t,r){let i=new Ze.SvixRequest(Ze.HttpMethod.PUT,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setBody(gb.StreamEventTypeInSerializer._toJsonObject(r)),i.send(this.requestCtx,ta.StreamEventTypeOutSerializer._fromJsonObject)}delete(t,r){let i=new Ze.SvixRequest(Ze.HttpMethod.DELETE,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setQueryParams({expunge:r?.expunge}),i.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Ze.SvixRequest(Ze.HttpMethod.PATCH,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setBody(XO.StreamEventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,ta.StreamEventTypeOutSerializer._fromJsonObject)}};ra.StreamingEventType=oc});var vb=f(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.EventInSerializer=void 0;ia.EventInSerializer={_fromJsonObject(e){return{eventType:e.eventType,payload:e.payload}},_toJsonObject(e){return{eventType:e.eventType,payload:e.payload}}}});var sc=f(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.StreamInSerializer=void 0;na.StreamInSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,uid:e.uid}}}});var Cb=f(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.CreateStreamEventsInSerializer=void 0;var _b=vb(),yb=sc();oa.CreateStreamEventsInSerializer={_fromJsonObject(e){return{events:e.events.map(t=>_b.EventInSerializer._fromJsonObject(t)),stream:e.stream!=null?yb.StreamInSerializer._fromJsonObject(e.stream):void 0}},_toJsonObject(e){return{events:e.events.map(t=>_b.EventInSerializer._toJsonObject(t)),stream:e.stream!=null?yb.StreamInSerializer._toJsonObject(e.stream):void 0}}}});var Ob=f(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.CreateStreamEventsOutSerializer=void 0;sa.CreateStreamEventsOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Sb=f(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.EventOutSerializer=void 0;aa.EventOutSerializer={_fromJsonObject(e){return{eventType:e.eventType,payload:e.payload,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{eventType:e.eventType,payload:e.payload,timestamp:e.timestamp}}}});var wb=f(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.EventStreamOutSerializer=void 0;var xb=Sb();ua.EventStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>xb.EventOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>xb.EventOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var kb=f(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.StreamingEvents=void 0;var eS=Cb(),tS=Ob(),rS=wb(),la=ne(),ac=class{constructor(t){this.requestCtx=t}create(t,r,i){let n=new la.SvixRequest(la.HttpMethod.POST,"/api/v1/stream/{stream_id}/events");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(eS.CreateStreamEventsInSerializer._toJsonObject(r)),n.send(this.requestCtx,tS.CreateStreamEventsOutSerializer._fromJsonObject)}get(t,r,i){let n=new la.SvixRequest(la.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/events");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,after:i?.after}),n.send(this.requestCtx,rS.EventStreamOutSerializer._fromJsonObject)}};ca.StreamingEvents=ac});var uc=f(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.AzureBlobStorageConfigSerializer=void 0;da.AzureBlobStorageConfigSerializer={_fromJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}},_toJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}}}});var lc=f(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.GoogleCloudStorageConfigSerializer=void 0;ma.GoogleCloudStorageConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var cc=f(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.S3ConfigSerializer=void 0;pa.S3ConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}}}});var dc=f(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.SinkHttpConfigSerializer=void 0;fa.SinkHttpConfigSerializer={_fromJsonObject(e){return{headers:e.headers,key:e.key,url:e.url}},_toJsonObject(e){return{headers:e.headers,key:e.key,url:e.url}}}});var mc=f(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.SinkOtelV1ConfigSerializer=void 0;ha.SinkOtelV1ConfigSerializer={_fromJsonObject(e){return{headers:e.headers,url:e.url}},_toJsonObject(e){return{headers:e.headers,url:e.url}}}});var pc=f(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.SinkStatusSerializer=Yt.SinkStatus=void 0;var iS;(function(e){e.Enabled="enabled",e.Paused="paused",e.Disabled="disabled",e.Retrying="retrying"})(iS=Yt.SinkStatus||(Yt.SinkStatus={}));Yt.SinkStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var fc=f(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.StreamSinkOutSerializer=void 0;var Ab=uc(),Eb=lc(),Pb=cc(),Tb=dc(),jb=mc(),Ib=pc();ga.StreamSinkOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return Ab.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return jb.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return Tb.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Pb.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return Eb.GoogleCloudStorageConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),batchSize:e.batchSize,createdAt:new Date(e.createdAt),currentIterator:e.currentIterator,eventTypes:e.eventTypes,failureReason:e.failureReason,id:e.id,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,nextRetryAt:e.nextRetryAt?new Date(e.nextRetryAt):null,status:Ib.SinkStatusSerializer._fromJsonObject(e.status),uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=Ab.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=jb.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=Tb.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Pb.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=Eb.GoogleCloudStorageConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,batchSize:e.batchSize,createdAt:e.createdAt,currentIterator:e.currentIterator,eventTypes:e.eventTypes,failureReason:e.failureReason,id:e.id,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,nextRetryAt:e.nextRetryAt,status:Ib.SinkStatusSerializer._toJsonObject(e.status),uid:e.uid,updatedAt:e.updatedAt}}}});var $b=f(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.ListResponseStreamSinkOutSerializer=void 0;var Db=fc();ba.ListResponseStreamSinkOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Db.StreamSinkOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Db.StreamSinkOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var qb=f(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.SinkSecretOutSerializer=void 0;va.SinkSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Rb=f(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.SinkTransformInSerializer=void 0;_a.SinkTransformInSerializer={_fromJsonObject(e){return{code:e.code}},_toJsonObject(e){return{code:e.code}}}});var ya=f(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.SinkStatusInSerializer=Qt.SinkStatusIn=void 0;var nS;(function(e){e.Enabled="enabled",e.Disabled="disabled"})(nS=Qt.SinkStatusIn||(Qt.SinkStatusIn={}));Qt.SinkStatusInSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Nb=f(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.StreamSinkInSerializer=void 0;var zb=uc(),Mb=lc(),Jb=cc(),Hb=dc(),Fb=mc(),Bb=ya();Ca.StreamSinkInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return zb.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return Fb.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return Hb.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Jb.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return Mb.GoogleCloudStorageConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?Bb.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=zb.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=Fb.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=Hb.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Jb.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=Mb.GoogleCloudStorageConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?Bb.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var Lb=f(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.AmazonS3PatchConfigSerializer=void 0;Oa.AmazonS3PatchConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}}}});var Gb=f(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.AzureBlobStoragePatchConfigSerializer=void 0;Sa.AzureBlobStoragePatchConfigSerializer={_fromJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}},_toJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}}}});var Ub=f(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.GoogleCloudStoragePatchConfigSerializer=void 0;xa.GoogleCloudStoragePatchConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var Wb=f(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.HttpPatchConfigSerializer=void 0;wa.HttpPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var Vb=f(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.OtelTracingPatchConfigSerializer=void 0;ka.OtelTracingPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var t0=f(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.StreamSinkPatchSerializer=void 0;var Kb=Lb(),Yb=Gb(),Qb=Ub(),Zb=Wb(),Xb=Vb(),e0=ya();Aa.StreamSinkPatchSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return Yb.AzureBlobStoragePatchConfigSerializer._fromJsonObject(e.config);case"otelTracing":return Xb.OtelTracingPatchConfigSerializer._fromJsonObject(e.config);case"http":return Zb.HttpPatchConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Kb.AmazonS3PatchConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return Qb.GoogleCloudStoragePatchConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?e0.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=Yb.AzureBlobStoragePatchConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=Xb.OtelTracingPatchConfigSerializer._toJsonObject(e.config);break;case"http":t=Zb.HttpPatchConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Kb.AmazonS3PatchConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=Qb.GoogleCloudStoragePatchConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?e0.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var n0=f(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.StreamingSink=void 0;var r0=Vl(),oS=El(),sS=$b(),aS=qb(),uS=Rb(),i0=Nb(),Ea=fc(),lS=t0(),ye=ne(),hc=class{constructor(t){this.requestCtx=t}list(t,r){let i=new ye.SvixRequest(ye.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink");return i.setPathParam("stream_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,sS.ListResponseStreamSinkOutSerializer._fromJsonObject)}create(t,r,i){let n=new ye.SvixRequest(ye.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(i0.StreamSinkInSerializer._toJsonObject(r)),n.send(this.requestCtx,Ea.StreamSinkOutSerializer._fromJsonObject)}get(t,r){let i=new ye.SvixRequest(ye.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,Ea.StreamSinkOutSerializer._fromJsonObject)}update(t,r,i){let n=new ye.SvixRequest(ye.HttpMethod.PUT,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(i0.StreamSinkInSerializer._toJsonObject(i)),n.send(this.requestCtx,Ea.StreamSinkOutSerializer._fromJsonObject)}delete(t,r){let i=new ye.SvixRequest(ye.HttpMethod.DELETE,"/api/v1/stream/{stream_id}/sink/{sink_id}");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.sendNoResponseBody(this.requestCtx)}patch(t,r,i){let n=new ye.SvixRequest(ye.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(lS.StreamSinkPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,Ea.StreamSinkOutSerializer._fromJsonObject)}getSecret(t,r){let i=new ye.SvixRequest(ye.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,aS.SinkSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let o=new ye.SvixRequest(ye.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate");return o.setPathParam("stream_id",t),o.setPathParam("sink_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(oS.EndpointSecretRotateInSerializer._toJsonObject(i)),o.send(this.requestCtx,r0.EmptyResponseSerializer._fromJsonObject)}transformationPartialUpdate(t,r,i){let n=new ye.SvixRequest(ye.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(uS.SinkTransformInSerializer._toJsonObject(i)),n.send(this.requestCtx,r0.EmptyResponseSerializer._fromJsonObject)}};Pa.StreamingSink=hc});var gc=f(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.StreamOutSerializer=void 0;Ta.StreamOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),id:e.id,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,id:e.id,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:e.updatedAt}}}});var s0=f(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.ListResponseStreamOutSerializer=void 0;var o0=gc();ja.ListResponseStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>o0.StreamOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>o0.StreamOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var a0=f(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.StreamPatchSerializer=void 0;Ia.StreamPatchSerializer={_fromJsonObject(e){return{description:e.description,metadata:e.metadata,uid:e.uid}},_toJsonObject(e){return{description:e.description,metadata:e.metadata,uid:e.uid}}}});var l0=f($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.StreamingStream=void 0;var cS=s0(),u0=sc(),Da=gc(),dS=a0(),Xe=ne(),bc=class{constructor(t){this.requestCtx=t}list(t){let r=new Xe.SvixRequest(Xe.HttpMethod.GET,"/api/v1/stream");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,cS.ListResponseStreamOutSerializer._fromJsonObject)}create(t,r){let i=new Xe.SvixRequest(Xe.HttpMethod.POST,"/api/v1/stream");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(u0.StreamInSerializer._toJsonObject(t)),i.send(this.requestCtx,Da.StreamOutSerializer._fromJsonObject)}get(t){let r=new Xe.SvixRequest(Xe.HttpMethod.GET,"/api/v1/stream/{stream_id}");return r.setPathParam("stream_id",t),r.send(this.requestCtx,Da.StreamOutSerializer._fromJsonObject)}update(t,r){let i=new Xe.SvixRequest(Xe.HttpMethod.PUT,"/api/v1/stream/{stream_id}");return i.setPathParam("stream_id",t),i.setBody(u0.StreamInSerializer._toJsonObject(r)),i.send(this.requestCtx,Da.StreamOutSerializer._fromJsonObject)}delete(t){let r=new Xe.SvixRequest(Xe.HttpMethod.DELETE,"/api/v1/stream/{stream_id}");return r.setPathParam("stream_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Xe.SvixRequest(Xe.HttpMethod.PATCH,"/api/v1/stream/{stream_id}");return i.setPathParam("stream_id",t),i.setBody(dS.StreamPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Da.StreamOutSerializer._fromJsonObject)}};$a.StreamingStream=bc});var d0=f(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.Streaming=void 0;var c0=kl(),mS=cb(),pS=db(),fS=bb(),hS=kb(),gS=n0(),bS=l0(),mr=ne(),vc=class{constructor(t){this.requestCtx=t}get event_type(){return new fS.StreamingEventType(this.requestCtx)}get events(){return new hS.StreamingEvents(this.requestCtx)}get sink(){return new gS.StreamingSink(this.requestCtx)}get stream(){return new bS.StreamingStream(this.requestCtx)}sinkHeadersGet(t,r){let i=new mr.SvixRequest(mr.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,c0.EndpointHeadersOutSerializer._fromJsonObject)}sinkHeadersPatch(t,r,i){let n=new mr.SvixRequest(mr.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(mS.HttpSinkHeadersPatchInSerializer._toJsonObject(i)),n.send(this.requestCtx,c0.EndpointHeadersOutSerializer._fromJsonObject)}sinkTransformationGet(t,r){let i=new mr.SvixRequest(mr.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,pS.SinkTransformationOutSerializer._fromJsonObject)}};qa.Streaming=vc});var m0=f(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.HTTPValidationError=kt.ValidationError=kt.HttpErrorOut=void 0;var pr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};kt.HttpErrorOut=pr;pr.discriminator=void 0;pr.mapping=void 0;pr.attributeTypeMap=[{name:"code",baseName:"code",type:"string",format:""},{name:"detail",baseName:"detail",type:"string",format:""}];var fr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};kt.ValidationError=fr;fr.discriminator=void 0;fr.mapping=void 0;fr.attributeTypeMap=[{name:"loc",baseName:"loc",type:"Array<string>",format:""},{name:"msg",baseName:"msg",type:"string",format:""},{name:"type",baseName:"type",type:"string",format:""}];var hr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};kt.HTTPValidationError=hr;hr.discriminator=void 0;hr.mapping=void 0;hr.attributeTypeMap=[{name:"detail",baseName:"detail",type:"Array<ValidationError>",format:""}]});var f0=f(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.timingSafeEqual=void 0;function p0(e,t=""){if(!e)throw new Error(t)}function vS(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),p0(e instanceof DataView),p0(t instanceof DataView);let r=e.byteLength,i=0,n=-1;for(;++n<r;)i|=e.getUint8(n)^t.getUint8(n);return i===0}Ra.timingSafeEqual=vS});var b0=f(Le=>{"use strict";var _S=Le&&Le.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},e(t,r)};return function(t,r){e(t,r);function i(){this.constructor=t}t.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})();Object.defineProperty(Le,"__esModule",{value:!0});var de=256,_c=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var r="",i=0;i<t.length-2;i+=3){var n=t[i]<<16|t[i+1]<<8|t[i+2];r+=this._encodeByte(n>>>18&63),r+=this._encodeByte(n>>>12&63),r+=this._encodeByte(n>>>6&63),r+=this._encodeByte(n>>>0&63)}var o=t.length-i;if(o>0){var n=t[i]<<16|(o===2?t[i+1]<<8:0);r+=this._encodeByte(n>>>18&63),r+=this._encodeByte(n>>>12&63),o===2?r+=this._encodeByte(n>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(t),i=t.length-r,n=new Uint8Array(this.maxDecodedLength(i)),o=0,s=0,a=0,u=0,l=0,d=0,c=0;s<i-4;s+=4)u=this._decodeChar(t.charCodeAt(s+0)),l=this._decodeChar(t.charCodeAt(s+1)),d=this._decodeChar(t.charCodeAt(s+2)),c=this._decodeChar(t.charCodeAt(s+3)),n[o++]=u<<2|l>>>4,n[o++]=l<<4|d>>>2,n[o++]=d<<6|c,a|=u&de,a|=l&de,a|=d&de,a|=c&de;if(s<i-1&&(u=this._decodeChar(t.charCodeAt(s)),l=this._decodeChar(t.charCodeAt(s+1)),n[o++]=u<<2|l>>>4,a|=u&de,a|=l&de),s<i-2&&(d=this._decodeChar(t.charCodeAt(s+2)),n[o++]=l<<4|d>>>2,a|=d&de),s<i-3&&(c=this._decodeChar(t.charCodeAt(s+3)),n[o++]=d<<6|c,a|=c&de),a!==0)throw new Error("Base64Coder: incorrect characters for decoding");return n},e.prototype._encodeByte=function(t){var r=t;return r+=65,r+=25-t>>>8&6,r+=51-t>>>8&-75,r+=61-t>>>8&-15,r+=62-t>>>8&3,String.fromCharCode(r)},e.prototype._decodeChar=function(t){var r=de;return r+=(42-t&t-44)>>>8&-de+t-43+62,r+=(46-t&t-48)>>>8&-de+t-47+63,r+=(47-t&t-58)>>>8&-de+t-48+52,r+=(64-t&t-91)>>>8&-de+t-65+0,r+=(96-t&t-123)>>>8&-de+t-97+26,r},e.prototype._getPaddingLength=function(t){var r=0;if(this._paddingCharacter){for(var i=t.length-1;i>=0&&t[i]===this._paddingCharacter;i--)r++;if(t.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},e})();Le.Coder=_c;var ti=new _c;function yS(e){return ti.encode(e)}Le.encode=yS;function CS(e){return ti.decode(e)}Le.decode=CS;var h0=(function(e){_S(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(r){var i=r;return i+=65,i+=25-r>>>8&6,i+=51-r>>>8&-75,i+=61-r>>>8&-13,i+=62-r>>>8&49,String.fromCharCode(i)},t.prototype._decodeChar=function(r){var i=de;return i+=(44-r&r-46)>>>8&-de+r-45+62,i+=(94-r&r-96)>>>8&-de+r-95+63,i+=(47-r&r-58)>>>8&-de+r-48+52,i+=(64-r&r-91)>>>8&-de+r-65+0,i+=(96-r&r-123)>>>8&-de+r-97+26,i},t})(_c);Le.URLSafeCoder=h0;var g0=new h0;function OS(e){return g0.encode(e)}Le.encodeURLSafe=OS;function SS(e){return g0.decode(e)}Le.decodeURLSafe=SS;Le.encodedLength=function(e){return ti.encodedLength(e)};Le.maxDecodedLength=function(e){return ti.maxDecodedLength(e)};Le.decodedLength=function(e){return ti.decodedLength(e)}});var _0=f((v0,za)=>{(function(e,t){var r={};t(r);var i=r.default;for(var n in r)i[n]=r[n];typeof za=="object"&&typeof za.exports=="object"?za.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(v0,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(c,m,_,g,b){for(var O,x,S,A,T,P,I,w,E,W,be,we,li;b>=64;){for(O=m[0],x=m[1],S=m[2],A=m[3],T=m[4],P=m[5],I=m[6],w=m[7],W=0;W<16;W++)be=g+W*4,c[W]=(_[be]&255)<<24|(_[be+1]&255)<<16|(_[be+2]&255)<<8|_[be+3]&255;for(W=16;W<64;W++)E=c[W-2],we=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10,E=c[W-15],li=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3,c[W]=(we+c[W-7]|0)+(li+c[W-16]|0);for(W=0;W<64;W++)we=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&P^~T&I)|0)+(w+(t[W]+c[W]|0)|0)|0,li=((O>>>2|O<<30)^(O>>>13|O<<19)^(O>>>22|O<<10))+(O&x^O&S^x&S)|0,w=I,I=P,P=T,T=A+we|0,A=S,S=x,x=O,O=we+li|0;m[0]+=O,m[1]+=x,m[2]+=S,m[3]+=A,m[4]+=T,m[5]+=P,m[6]+=I,m[7]+=w,g+=64,b-=64}return g}var i=(function(){function c(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return c.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},c.prototype.clean=function(){for(var m=0;m<this.buffer.length;m++)this.buffer[m]=0;for(var m=0;m<this.temp.length;m++)this.temp[m]=0;this.reset()},c.prototype.update=function(m,_){if(_===void 0&&(_=m.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var g=0;if(this.bytesHashed+=_,this.bufferLength>0){for(;this.bufferLength<64&&_>0;)this.buffer[this.bufferLength++]=m[g++],_--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(_>=64&&(g=r(this.temp,this.state,m,g,_),_%=64);_>0;)this.buffer[this.bufferLength++]=m[g++],_--;return this},c.prototype.finish=function(m){if(!this.finished){var _=this.bytesHashed,g=this.bufferLength,b=_/536870912|0,O=_<<3,x=_%64<56?64:128;this.buffer[g]=128;for(var S=g+1;S<x-8;S++)this.buffer[S]=0;this.buffer[x-8]=b>>>24&255,this.buffer[x-7]=b>>>16&255,this.buffer[x-6]=b>>>8&255,this.buffer[x-5]=b>>>0&255,this.buffer[x-4]=O>>>24&255,this.buffer[x-3]=O>>>16&255,this.buffer[x-2]=O>>>8&255,this.buffer[x-1]=O>>>0&255,r(this.temp,this.state,this.buffer,0,x),this.finished=!0}for(var S=0;S<8;S++)m[S*4+0]=this.state[S]>>>24&255,m[S*4+1]=this.state[S]>>>16&255,m[S*4+2]=this.state[S]>>>8&255,m[S*4+3]=this.state[S]>>>0&255;return this},c.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},c.prototype._saveState=function(m){for(var _=0;_<this.state.length;_++)m[_]=this.state[_]},c.prototype._restoreState=function(m,_){for(var g=0;g<this.state.length;g++)this.state[g]=m[g];this.bytesHashed=_,this.finished=!1,this.bufferLength=0},c})();e.Hash=i;var n=(function(){function c(m){this.inner=new i,this.outer=new i,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var _=new Uint8Array(this.blockSize);if(m.length>this.blockSize)new i().update(m).finish(_).clean();else for(var g=0;g<m.length;g++)_[g]=m[g];for(var g=0;g<_.length;g++)_[g]^=54;this.inner.update(_);for(var g=0;g<_.length;g++)_[g]^=106;this.outer.update(_),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var g=0;g<_.length;g++)_[g]=0}return c.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},c.prototype.clean=function(){for(var m=0;m<this.istate.length;m++)this.ostate[m]=this.istate[m]=0;this.inner.clean(),this.outer.clean()},c.prototype.update=function(m){return this.inner.update(m),this},c.prototype.finish=function(m){return this.outer.finished?this.outer.finish(m):(this.inner.finish(m),this.outer.update(m,this.digestLength).finish(m)),this},c.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},c})();e.HMAC=n;function o(c){var m=new i().update(c),_=m.digest();return m.clean(),_}e.hash=o,e.default=o;function s(c,m){var _=new n(c).update(m),g=_.digest();return _.clean(),g}e.hmac=s;function a(c,m,_,g){var b=g[0];if(b===0)throw new Error("hkdf: cannot expand more");m.reset(),b>1&&m.update(c),_&&m.update(_),m.update(g),m.finish(c),g[0]++}var u=new Uint8Array(e.digestLength);function l(c,m,_,g){m===void 0&&(m=u),g===void 0&&(g=32);for(var b=new Uint8Array([1]),O=s(m,c),x=new n(O),S=new Uint8Array(x.digestLength),A=S.length,T=new Uint8Array(g),P=0;P<g;P++)A===S.length&&(a(S,x,_,b),A=0),T[P]=S[A++];return x.clean(),S.fill(0),b.fill(0),T}e.hkdf=l;function d(c,m,_,g){for(var b=new n(c),O=b.digestLength,x=new Uint8Array(4),S=new Uint8Array(O),A=new Uint8Array(O),T=new Uint8Array(g),P=0;P*O<g;P++){var I=P+1;x[0]=I>>>24&255,x[1]=I>>>16&255,x[2]=I>>>8&255,x[3]=I>>>0&255,b.reset(),b.update(m),b.update(x),b.finish(A);for(var w=0;w<O;w++)S[w]=A[w];for(var w=2;w<=_;w++){b.reset(),b.update(A).finish(A);for(var E=0;E<O;E++)S[E]^=A[E]}for(var w=0;w<O&&P*O+w<g;w++)T[P*O+w]=S[w]}for(var P=0;P<O;P++)S[P]=A[P]=0;for(var P=0;P<4;P++)x[P]=0;return b.clean(),T}e.pbkdf2=d})});var Cc=f(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.Webhook=gr.WebhookVerificationError=void 0;var xS=f0(),y0=b0(),wS=_0(),C0=300,yc=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},At=class e extends yc{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};gr.WebhookVerificationError=At;var Ma=class e{constructor(t,r){if(!t)throw new Error("Secret can't be empty.");if(r?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,i=>i.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=y0.decode(t)}}verify(t,r){let i={};for(let m of Object.keys(r))i[m.toLowerCase()]=r[m];let n=i["webhook-id"],o=i["webhook-signature"],s=i["webhook-timestamp"];if(!o||!n||!s)throw new At("Missing required headers");let a=this.verifyTimestamp(s),l=this.sign(n,a,t).split(",")[1],d=o.split(" "),c=new globalThis.TextEncoder;for(let m of d){let[_,g]=m.split(",");if(_==="v1"&&(0,xS.timingSafeEqual)(c.encode(g),c.encode(l)))return JSON.parse(t.toString())}throw new At("No matching signature found")}sign(t,r,i){if(typeof i!="string")if(i.constructor.name==="Buffer")i=i.toString();else throw new Error("Expected payload to be of type string or Buffer.");let n=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=n.encode(`${t}.${o}.${i}`);return`v1,${y0.encode(wS.hmac(this.key,s))}`}verifyTimestamp(t){let r=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(isNaN(i))throw new At("Invalid Signature Headers");if(r-i>C0)throw new At("Message timestamp too old");if(i>r+C0)throw new At("Message timestamp too new");return new Date(i*1e3)}};gr.Webhook=Ma;Ma.prefix="whsec_"});var O0=f(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.Webhook=br.WebhookVerificationError=void 0;var kS=Cc(),AS=Cc();Object.defineProperty(br,"WebhookVerificationError",{enumerable:!0,get:function(){return AS.WebhookVerificationError}});var Oc=class{constructor(t,r){this.inner=new kS.Webhook(t,r)}verify(t,r){var i,n,o,s,a,u;let l={};for(let d of Object.keys(r))l[d.toLowerCase()]=r[d];return l["webhook-id"]=(n=(i=l["svix-id"])!==null&&i!==void 0?i:l["webhook-id"])!==null&&n!==void 0?n:"",l["webhook-signature"]=(s=(o=l["svix-signature"])!==null&&o!==void 0?o:l["webhook-signature"])!==null&&s!==void 0?s:"",l["webhook-timestamp"]=(u=(a=l["svix-timestamp"])!==null&&a!==void 0?a:l["webhook-timestamp"])!==null&&u!==void 0?u:"",this.inner.verify(t,l)}sign(t,r,i){return this.inner.sign(t,r,i)}};br.Webhook=Oc});var S0=f(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.EndpointDisabledTriggerSerializer=Zt.EndpointDisabledTrigger=void 0;var ES;(function(e){e.Manual="manual",e.Automatic="automatic"})(ES=Zt.EndpointDisabledTrigger||(Zt.EndpointDisabledTrigger={}));Zt.EndpointDisabledTriggerSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var x0=f(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.OrderingSerializer=Xt.Ordering=void 0;var PS;(function(e){e.Ascending="ascending",e.Descending="descending"})(PS=Xt.Ordering||(Xt.Ordering={}));Xt.OrderingSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var w0=f(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.StatusCodeClass=X.SinkStatusIn=X.SinkStatus=X.Ordering=X.MessageStatusText=X.MessageStatus=X.MessageAttemptTriggerType=X.EndpointDisabledTrigger=X.ConnectorProduct=X.ConnectorKind=X.BackgroundTaskType=X.BackgroundTaskStatus=X.AppPortalCapability=void 0;var TS=vl();Object.defineProperty(X,"AppPortalCapability",{enumerable:!0,get:function(){return TS.AppPortalCapability}});var jS=xt();Object.defineProperty(X,"BackgroundTaskStatus",{enumerable:!0,get:function(){return jS.BackgroundTaskStatus}});var IS=wt();Object.defineProperty(X,"BackgroundTaskType",{enumerable:!0,get:function(){return IS.BackgroundTaskType}});var DS=ur();Object.defineProperty(X,"ConnectorKind",{enumerable:!0,get:function(){return DS.ConnectorKind}});var $S=an();Object.defineProperty(X,"ConnectorProduct",{enumerable:!0,get:function(){return $S.ConnectorProduct}});var qS=S0();Object.defineProperty(X,"EndpointDisabledTrigger",{enumerable:!0,get:function(){return qS.EndpointDisabledTrigger}});var RS=Kl();Object.defineProperty(X,"MessageAttemptTriggerType",{enumerable:!0,get:function(){return RS.MessageAttemptTriggerType}});var zS=lr();Object.defineProperty(X,"MessageStatus",{enumerable:!0,get:function(){return zS.MessageStatus}});var MS=ei();Object.defineProperty(X,"MessageStatusText",{enumerable:!0,get:function(){return MS.MessageStatusText}});var JS=x0();Object.defineProperty(X,"Ordering",{enumerable:!0,get:function(){return JS.Ordering}});var HS=pc();Object.defineProperty(X,"SinkStatus",{enumerable:!0,get:function(){return HS.SinkStatus}});var FS=ya();Object.defineProperty(X,"SinkStatusIn",{enumerable:!0,get:function(){return FS.SinkStatusIn}});var BS=wl();Object.defineProperty(X,"StatusCodeClass",{enumerable:!0,get:function(){return BS.StatusCodeClass}})});var A0=f(me=>{"use strict";var NS=me&&me.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),k0=me&&me.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&NS(t,e,r)};Object.defineProperty(me,"__esModule",{value:!0});me.Svix=me.messageInRaw=me.ValidationError=me.HttpErrorOut=me.HTTPValidationError=me.ApiException=void 0;var LS=Fm(),GS=Xm(),US=np(),WS=hp(),VS=Fp(),KS=Vp(),YS=sf(),QS=uf(),ZS=ng(),XS=dg(),ex=Wl(),tx=Ug(),rx=tb(),ix=lb(),nx=d0(),ox=tc(),sx=nl();Object.defineProperty(me,"ApiException",{enumerable:!0,get:function(){return sx.ApiException}});var xc=m0();Object.defineProperty(me,"HTTPValidationError",{enumerable:!0,get:function(){return xc.HTTPValidationError}});Object.defineProperty(me,"HttpErrorOut",{enumerable:!0,get:function(){return xc.HttpErrorOut}});Object.defineProperty(me,"ValidationError",{enumerable:!0,get:function(){return xc.ValidationError}});k0(O0(),me);k0(w0(),me);var ax=Wl();Object.defineProperty(me,"messageInRaw",{enumerable:!0,get:function(){return ax.messageInRaw}});var ux=[{region:"us",url:"https://api.us.svix.com"},{region:"eu",url:"https://api.eu.svix.com"},{region:"in",url:"https://api.in.svix.com"},{region:"ca",url:"https://api.ca.svix.com"},{region:"au",url:"https://api.au.svix.com"}],Sc=class{constructor(t,r={}){var i,n,o;let s=(i=ux.find(u=>u.region===t.split(".")[1]))===null||i===void 0?void 0:i.url,a=(o=(n=r.serverUrl)!==null&&n!==void 0?n:s)!==null&&o!==void 0?o:"https://api.svix.com";if(r.retryScheduleInMs){this.requestCtx={baseUrl:a,token:t,timeout:r.requestTimeout,retryScheduleInMs:r.retryScheduleInMs,fetch:r.fetch};return}if(r.numRetries){this.requestCtx={baseUrl:a,token:t,timeout:r.requestTimeout,numRetries:r.numRetries,fetch:r.fetch};return}this.requestCtx={baseUrl:a,token:t,timeout:r.requestTimeout,fetch:r.fetch}}get application(){return new LS.Application(this.requestCtx)}get authentication(){return new GS.Authentication(this.requestCtx)}get backgroundTask(){return new US.BackgroundTask(this.requestCtx)}get connector(){return new WS.Connector(this.requestCtx)}get endpoint(){return new VS.Endpoint(this.requestCtx)}get environment(){return new KS.Environment(this.requestCtx)}get eventType(){return new YS.EventType(this.requestCtx)}get health(){return new QS.Health(this.requestCtx)}get ingest(){return new ZS.Ingest(this.requestCtx)}get integration(){return new XS.Integration(this.requestCtx)}get message(){return new ex.Message(this.requestCtx)}get messageAttempt(){return new tx.MessageAttempt(this.requestCtx)}get operationalWebhook(){return new rx.OperationalWebhook(this.requestCtx)}get statistics(){return new ix.Statistics(this.requestCtx)}get streaming(){return new nx.Streaming(this.requestCtx)}get operationalWebhookEndpoint(){return new ox.OperationalWebhookEndpoint(this.requestCtx)}};me.Svix=Sc});var kc={};or(kc,{FileBackend:()=>wc});var wc,Ac=B(()=>{"use strict";je();wc=class{name="plaintext file";isSecure=!1;async get(t,r){let i=Ae();return i?i.profiles[r]?.api_key??null:null}async set(t,r,i){Ec(i,r)}async delete(t,r){try{return Pc(r),!0}catch{return!1}}async isAvailable(){return!0}}});var J0={};or(J0,{MacOSBackend:()=>jc});function Tc(e,t){return new Promise(r=>{(0,M0.execFile)(e,t,{timeout:5e3},(i,n,o)=>{let s=i&&"code"in i?i.code:0;r({stdout:n??"",stderr:o??"",code:s})})})}var M0,jc,H0=B(()=>{"use strict";M0=require("node:child_process");jc=class{name="macOS Keychain";isSecure=!0;async get(t,r){let{stdout:i,stderr:n,code:o}=await Tc("/usr/bin/security",["find-generic-password","-s",t,"-a",r,"-w"]);if(o===44)return null;if(o!==0)throw new Error(`Failed to read from macOS Keychain (exit code ${o}): ${n.trim()}`);return i.trim()||null}async set(t,r,i){let{code:n,stderr:o}=await Tc("/usr/bin/security",["add-generic-password","-s",t,"-a",r,"-w",i,"-U"]);if(n!==0)throw new Error(`Failed to store credential in macOS Keychain: ${o.trim()}`)}async delete(t,r){let{code:i}=await Tc("/usr/bin/security",["delete-generic-password","-s",t,"-a",r]);return i===0}async isAvailable(){return process.platform==="darwin"}}});var F0={};or(F0,{LinuxBackend:()=>Ic});function Ha(e,t,r){return new Promise(i=>{(0,Fa.execFile)(e,t,{timeout:r?.timeout??5e3},(n,o,s)=>{let a=n&&"code"in n?n.code:0;i({stdout:o??"",stderr:s??"",code:a})})})}function Mx(e,t,r){return new Promise(i=>{let n=(0,Fa.spawn)(e,t,{stdio:["pipe","ignore","pipe"],timeout:5e3}),o="";n.stderr?.on("data",s=>{o+=s.toString()}),n.on("close",s=>{i({code:s,stderr:o})}),n.on("error",()=>{i({code:1,stderr:"Failed to spawn process"})}),n.stdin?.on("error",()=>{}),n.stdin?.write(r),n.stdin?.end()})}var Fa,Ic,B0=B(()=>{"use strict";Fa=require("node:child_process");Ic=class{name="Secret Service (libsecret)";isSecure=!0;async get(t,r){let{stdout:i,code:n}=await Ha("secret-tool",["lookup","service",t,"account",r]);return n!==0||!i.trim()?null:i.trim()}async set(t,r,i){let{code:n,stderr:o}=await Mx("secret-tool",["store",`--label=Resend CLI (${r})`,"service",t,"account",r],i);if(n!==0)throw new Error(`Failed to store credential in Secret Service: ${o.trim()}`)}async delete(t,r){let{code:i}=await Ha("secret-tool",["clear","service",t,"account",r]);return i===0}async isAvailable(){if(process.platform!=="linux"||(await Ha("which",["secret-tool"])).code!==0)return!1;let r=await Ha("secret-tool",["lookup","service","__resend_cli_probe__"],{timeout:3e3});return r.code===0||r.code===1}}});var N0={};or(N0,{WindowsBackend:()=>Dc});function Ba(e){return new Promise(t=>{(0,Na.execFile)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{timeout:1e4},(r,i,n)=>{let o=r&&"code"in r?r.code:0;t({stdout:i??"",stderr:n??"",code:o})})})}function Jx(e,t){return new Promise(r=>{let i=(0,Na.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{stdio:["pipe","pipe","pipe"],timeout:1e4}),n="",o="";i.stdout?.on("data",s=>{n+=s.toString()}),i.stderr?.on("data",s=>{o+=s.toString()}),i.on("close",s=>{r({stdout:n,stderr:o,code:s})}),i.on("error",()=>{r({stdout:"",stderr:"Failed to spawn process",code:1})}),i.stdin?.on("error",()=>{}),i.stdin?.write(t),i.stdin?.end()})}function Et(e){return e.replace(/'/g,"''")}var Na,ri,Dc,L0=B(()=>{"use strict";Na=require("node:child_process");ri=`
27
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Zc(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,i="127.0.0.1",n="9229",o;return(o=t.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?n=o[3]:i=o[3]):(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],i=o[3],n=o[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:t})}function Cu(){if(G.env.NO_COLOR||G.env.FORCE_COLOR==="0"||G.env.FORCE_COLOR==="false")return!1;if(G.env.FORCE_COLOR||G.env.CLICOLOR_FORCE!==void 0)return!0}Ou.Command=yu;Ou.useColor=Cu});var id=f(Ue=>{var{Argument:ed}=mi(),{Command:Su}=Xc(),{CommanderError:k2,InvalidArgumentError:td}=Fr(),{Help:A2}=pu(),{Option:rd}=bu();Ue.program=new Su;Ue.createCommand=e=>new Su(e);Ue.createOption=(e,t)=>new rd(e,t);Ue.createArgument=(e,t)=>new ed(e,t);Ue.Command=Su;Ue.Option=rd;Ue.Argument=ed;Ue.Help=A2;Ue.CommanderError=k2;Ue.InvalidArgumentError=td;Ue.InvalidOptionArgumentError=td});var od=f((He,nd)=>{var tt=id();He=nd.exports={};He.program=new tt.Command;He.Argument=tt.Argument;He.Command=tt.Command;He.CommanderError=tt.CommanderError;He.Help=tt.Help;He.InvalidArgumentError=tt.InvalidArgumentError;He.InvalidOptionArgumentError=tt.InvalidArgumentError;He.Option=tt.Option;He.createCommand=e=>new tt.Command(e);He.createOption=(e,t)=>new tt.Option(e,t);He.createArgument=(e,t)=>new tt.Argument(e,t)});var _t=f((Sw,xu)=>{var hi=process||{},ud=hi.argv||[],fi=hi.env||{},E2=!(fi.NO_COLOR||ud.includes("--no-color"))&&(!!fi.FORCE_COLOR||ud.includes("--color")||hi.platform==="win32"||(hi.stdout||{}).isTTY&&fi.TERM!=="dumb"||!!fi.CI),P2=(e,t,r=e)=>i=>{let n=""+i,o=n.indexOf(t,e.length);return~o?e+T2(n,t,r,o)+t:e+n+t},T2=(e,t,r,i)=>{let n="",o=0;do n+=e.substring(o,i)+r,o=i+t.length,i=e.indexOf(t,o);while(~i);return n+e.substring(o)},ld=(e=E2)=>{let t=e?P2:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};xu.exports=ld();xu.exports.createColors=ld});var Du=f((Iw,Od)=>{"use strict";var Tu={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let r="";return e<0?r+=`\x1B[${-e}D`:e>0&&(r+=`\x1B[${e}C`),t<0?r+=`\x1B[${-t}A`:t>0&&(r+=`\x1B[${t}B`),r},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},N2={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},L2={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?Tu.up():"");return e&&(t+=Tu.left),t}};Od.exports={cursor:Tu,scroll:N2,erase:L2,beep:"\x07"}});var Fu,Rd=H(()=>{Fu={name:"resend-cli",version:"1.9.1",description:"The official CLI for Resend",license:"MIT",repository:{type:"git",url:"https://github.com/resend/resend-cli"},homepage:"https://github.com/resend/resend-cli#readme",keywords:["cli","resend","email","api","tanstack-intent"],engines:{node:">=20"},packageManager:"pnpm@10.33.0",files:["dist/cli.cjs","skills/"],type:"module",bin:{resend:"./dist/cli.cjs"},scripts:{dev:"tsx src/cli.ts","dev:watch":"tsx --watch src/cli.ts",build:"node scripts/build.mjs","build:bin":"pnpm build && pkg dist/cli.cjs --compress Brotli --target node24 --output dist/resend",lint:"biome check .","lint:fix":"biome check --write .",typecheck:"tsc --noEmit",test:"vitest run","test:e2e":"vitest run --config vitest.config.e2e.ts",prepack:"pnpm install && pnpm build && node scripts/verify-bundle.mjs"},dependencies:{"@clack/prompts":"1.2.0","@commander-js/extra-typings":"14.0.0",commander:"14.0.3",esbuild:"0.28.0",picocolors:"1.1.1",resend:"6.11.0"},pnpm:{onlyBuiltDependencies:["esbuild","@biomejs/biome"]},devDependencies:{"@biomejs/biome":"2.4.11","@types/node":"24.12.2","@yao-pkg/pkg":"6.14.2",tsx:"4.21.0",typescript:"5.9.3",vitest:"4.1.4"}}});var se,Fd,Ft=H(()=>{"use strict";Rd();se=Fu.version,Fd=Fu.name});var Ii=f(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.ApplicationInSerializer=void 0;Di.ApplicationInSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid}}}});var Uu=f(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.ApplicationOutSerializer=void 0;ji.ApplicationOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),id:e.id,metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,id:e.id,metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt}}}});var Wd=f($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.ApplicationPatchSerializer=void 0;$i.ApplicationPatchSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,uid:e.uid}}}});var Kd=f(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.ListResponseApplicationOutSerializer=void 0;var Vd=Uu();qi.ListResponseApplicationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Vd.ApplicationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Vd.ApplicationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Vu=f(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.ApiException=void 0;var Wu=class extends Error{constructor(t,r,i){super(`HTTP-Code: ${t}
28
+ Headers: ${JSON.stringify(i)}`),this.code=t,this.body=r,this.headers={},i.forEach((n,o)=>{this.headers[o]=n})}};Ri.ApiException=Wu});var Yd,Qd=H(()=>{Yd="ffffffff-ffff-ffff-ffff-ffffffffffff"});var Zd,Xd=H(()=>{Zd="00000000-0000-0000-0000-000000000000"});var em,tm=H(()=>{em=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function CC(e){return typeof e=="string"&&em.test(e)}var xt,Wr=H(()=>{tm();xt=CC});function OC(e){if(!xt(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var wt,Vr=H(()=>{Wr();wt=OC});function Te(e,t=0){return(xe[e[t+0]]+xe[e[t+1]]+xe[e[t+2]]+xe[e[t+3]]+"-"+xe[e[t+4]]+xe[e[t+5]]+"-"+xe[e[t+6]]+xe[e[t+7]]+"-"+xe[e[t+8]]+xe[e[t+9]]+"-"+xe[e[t+10]]+xe[e[t+11]]+xe[e[t+12]]+xe[e[t+13]]+xe[e[t+14]]+xe[e[t+15]]).toLowerCase()}function SC(e,t=0){let r=Te(e,t);if(!xt(r))throw TypeError("Stringified UUID is invalid");return r}var xe,rm,ft=H(()=>{Wr();xe=[];for(let e=0;e<256;++e)xe.push((e+256).toString(16).slice(1));rm=SC});function Jt(){return Fi>zi.length-16&&(im.default.randomFillSync(zi),Fi=0),zi.slice(Fi,Fi+=16)}var im,zi,Fi,Mi=H(()=>{im=le(require("node:crypto")),zi=new Uint8Array(256),Fi=zi.length});function xC(e,t,r){let i=t&&r||0,n=t||new Array(16);e=e||{};let o=e.node,s=e.clockseq;if(e._v6||(o||(o=Ku),s==null&&(s=Ji)),o==null||s==null){let m=e.random||(e.rng||Jt)();o==null&&(o=[m[0],m[1],m[2],m[3],m[4],m[5]],!Ku&&!e._v6&&(o[0]|=1,Ku=o)),s==null&&(s=(m[6]<<8|m[7])&16383,Ji===void 0&&!e._v6&&(Ji=s))}let a=e.msecs!==void 0?e.msecs:Date.now(),u=e.nsecs!==void 0?e.nsecs:Qu+1,l=a-Yu+(u-Qu)/1e4;if(l<0&&e.clockseq===void 0&&(s=s+1&16383),(l<0||a>Yu)&&e.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Yu=a,Qu=u,Ji=s,a+=122192928e5;let c=((a&268435455)*1e4+u)%4294967296;n[i++]=c>>>24&255,n[i++]=c>>>16&255,n[i++]=c>>>8&255,n[i++]=c&255;let d=a/4294967296*1e4&268435455;n[i++]=d>>>8&255,n[i++]=d&255,n[i++]=d>>>24&15|16,n[i++]=d>>>16&255,n[i++]=s>>>8|128,n[i++]=s&255;for(let m=0;m<6;++m)n[i+m]=o[m];return t||Te(n)}var Ku,Ji,Yu,Qu,Bi,Zu=H(()=>{Mi();ft();Yu=0,Qu=0;Bi=xC});function Kr(e){let t=typeof e=="string"?wt(e):e,r=wC(t);return typeof e=="string"?Te(r):r}function wC(e,t=!1){return Uint8Array.of((e[6]&15)<<4|e[7]>>4&15,(e[7]&15)<<4|(e[4]&240)>>4,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,(e[1]&15)<<4|(e[2]&240)>>4,96|e[2]&15,e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}var Xu=H(()=>{Vr();ft()});function kC(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}function Yr(e,t,r){function i(n,o,s,a){var u;if(typeof n=="string"&&(n=kC(n)),typeof o=="string"&&(o=wt(o)),((u=o)===null||u===void 0?void 0:u.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+n.length);if(l.set(o),l.set(n,o.length),l=r(l),l[6]=l[6]&15|t,l[8]=l[8]&63|128,s){a=a||0;for(let c=0;c<16;++c)s[a+c]=l[c];return s}return Te(l)}try{i.name=e}catch{}return i.DNS=AC,i.URL=EC,i}var AC,EC,el=H(()=>{ft();Vr();AC="6ba7b810-9dad-11d1-80b4-00c04fd430c8",EC="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function PC(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),nm.default.createHash("md5").update(e).digest()}var nm,om,sm=H(()=>{nm=le(require("node:crypto"));om=PC});var TC,am,um=H(()=>{el();sm();TC=Yr("v3",48,om),am=TC});var lm,tl,cm=H(()=>{lm=le(require("node:crypto")),tl={randomUUID:lm.default.randomUUID}});function DC(e,t,r){if(tl.randomUUID&&!t&&!e)return tl.randomUUID();e=e||{};let i=e.random||(e.rng||Jt)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=i[n];return t}return Te(i)}var dm,mm=H(()=>{cm();Mi();ft();dm=DC});function IC(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),pm.default.createHash("sha1").update(e).digest()}var pm,fm,hm=H(()=>{pm=le(require("node:crypto"));fm=IC});var jC,gm,bm=H(()=>{el();hm();jC=Yr("v5",80,fm),gm=jC});function rl(e={},t,r=0){let i=Bi({...e,_v6:!0},new Uint8Array(16));if(i=Kr(i),t){for(let n=0;n<16;n++)t[r+n]=i[n];return t}return Te(i)}var vm=H(()=>{ft();Zu();Xu()});function il(e){let t=typeof e=="string"?wt(e):e,r=$C(t);return typeof e=="string"?Te(r):r}function $C(e){return Uint8Array.of((e[3]&15)<<4|e[4]>>4&15,(e[4]&15)<<4|(e[5]&240)>>4,(e[5]&15)<<4|e[6]&15,e[7],(e[1]&15)<<4|(e[2]&240)>>4,(e[2]&15)<<4|(e[3]&240)>>4,16|(e[0]&240)>>4,(e[0]&15)<<4|(e[1]&240)>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}var _m=H(()=>{Vr();ft()});function qC(e,t,r){e=e||{};let i=t&&r||0,n=t||new Uint8Array(16),o=e.random||(e.rng||Jt)(),s=e.msecs!==void 0?e.msecs:Date.now(),a=e.seq!==void 0?e.seq:null,u=Cm,l=ym;return s>rt&&e.msecs===void 0&&(rt=s,a!==null&&(u=null,l=null)),a!==null&&(a>2147483647&&(a=2147483647),u=a>>>19&4095,l=a&524287),(u===null||l===null)&&(u=o[6]&127,u=u<<8|o[7],l=o[8]&63,l=l<<8|o[9],l=l<<5|o[10]>>>3),s+1e4>rt&&a===null?++l>524287&&(l=0,++u>4095&&(u=0,rt++)):rt=s,Cm=u,ym=l,n[i++]=rt/1099511627776&255,n[i++]=rt/4294967296&255,n[i++]=rt/16777216&255,n[i++]=rt/65536&255,n[i++]=rt/256&255,n[i++]=rt&255,n[i++]=u>>>4&15|112,n[i++]=u&255,n[i++]=l>>>13&63|128,n[i++]=l>>>5&255,n[i++]=l<<3&255|o[10]&7,n[i++]=o[11],n[i++]=o[12],n[i++]=o[13],n[i++]=o[14],n[i++]=o[15],t||Te(n)}var ym,Cm,rt,Om,Sm=H(()=>{Mi();ft();ym=null,Cm=null,rt=0;Om=qC});function RC(e){if(!xt(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var xm,wm=H(()=>{Wr();xm=RC});var km={};or(km,{MAX:()=>Yd,NIL:()=>Zd,parse:()=>wt,stringify:()=>rm,v1:()=>Bi,v1ToV6:()=>Kr,v3:()=>am,v4:()=>dm,v5:()=>gm,v6:()=>rl,v6ToV1:()=>il,v7:()=>Om,validate:()=>xt,version:()=>xm});var Am=H(()=>{Qd();Xd();Vr();ft();Zu();Xu();um();mm();bm();vm();_m();Sm();Wr();wm()});var ne=f(Ve=>{"use strict";var Qr=Ve&&Ve.__awaiter||function(e,t,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(i.next(c))}catch(d){s(d)}}function u(c){try{l(i.throw(c))}catch(d){s(d)}}function l(c){c.done?o(c.value):n(c.value).then(a,u)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.SvixRequest=Ve.HttpMethod=Ve.LIB_VERSION=void 0;var nl=Vu(),FC=(Am(),m2(km));Ve.LIB_VERSION="1.90.0";var zC=`svix-libs/${Ve.LIB_VERSION}/javascript`,MC;(function(e){e.GET="GET",e.HEAD="HEAD",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.CONNECT="CONNECT",e.OPTIONS="OPTIONS",e.TRACE="TRACE",e.PATCH="PATCH"})(MC=Ve.HttpMethod||(Ve.HttpMethod={}));var ol=class{constructor(t,r){this.method=t,this.path=r,this.queryParams={},this.headerParams={}}setPathParam(t,r){let i=this.path.replace(`{${t}}`,encodeURIComponent(r));if(this.path===i)throw new Error(`path parameter ${t} not found`);this.path=i}setQueryParams(t){for(let[r,i]of Object.entries(t))this.setQueryParam(r,i)}setQueryParam(t,r){if(r!=null)if(typeof r=="string")this.queryParams[t]=r;else if(typeof r=="boolean"||typeof r=="number")this.queryParams[t]=r.toString();else if(r instanceof Date)this.queryParams[t]=r.toISOString();else if(Array.isArray(r))r.length>0&&(this.queryParams[t]=r.join(","));else{let i=r;throw new Error(`query parameter ${t} has unsupported type`)}}setHeaderParam(t,r){r!==void 0&&(this.headerParams[t]=r)}setBody(t){this.body=JSON.stringify(t)}send(t,r){return Qr(this,void 0,void 0,function*(){let i=yield this.sendInner(t);if(i.status===204)return null;let n=yield i.text();return r(JSON.parse(n))})}sendNoResponseBody(t){return Qr(this,void 0,void 0,function*(){yield this.sendInner(t)})}sendInner(t){var r,i;return Qr(this,void 0,void 0,function*(){let n=new URL(t.baseUrl+this.path);for(let[u,l]of Object.entries(this.queryParams))n.searchParams.set(u,l);this.headerParams["idempotency-key"]===void 0&&this.method.toUpperCase()==="POST"&&(this.headerParams["idempotency-key"]=`auto_${(0,FC.v4)()}`);let o=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);this.body!=null&&(this.headerParams["content-type"]="application/json");let s="credentials"in Request.prototype,a=yield Em(n,{method:this.method.toString(),body:this.body,headers:Object.assign({accept:"application/json, */*;q=0.8",authorization:`Bearer ${t.token}`,"user-agent":zC,"svix-req-id":o.toString()},this.headerParams),credentials:s?"same-origin":void 0,signal:t.timeout!==void 0?AbortSignal.timeout(t.timeout):void 0},t.retryScheduleInMs,(r=t.retryScheduleInMs)===null||r===void 0?void 0:r[0],((i=t.retryScheduleInMs)===null||i===void 0?void 0:i.length)||t.numRetries,t.fetch);return JC(a)})}};Ve.SvixRequest=ol;function JC(e){return Qr(this,void 0,void 0,function*(){if(e.status<300)return e;let t=yield e.text();throw e.status===422?new nl.ApiException(e.status,JSON.parse(t),e.headers):e.status>=400&&e.status<=499?new nl.ApiException(e.status,JSON.parse(t),e.headers):new nl.ApiException(e.status,t,e.headers)})}function Em(e,t,r,i=50,n=2,o=fetch,s=1){return Qr(this,void 0,void 0,function*(){let a=u=>new Promise(l=>setTimeout(l,u));try{let u=yield o(e,t);if(n<=0||u.status<500)return u}catch(u){if(n<=0)throw u}return yield a(i),t.headers["svix-retry-count"]=s.toString(),i=r?.[s]||i*2,yield Em(e,t,r,i,--n,o,++s)})}});var Pm=f(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.Application=void 0;var sl=Ii(),Zr=Uu(),BC=Wd(),HC=Kd(),qe=ne(),al=class{constructor(t){this.requestCtx=t}list(t){let r=new qe.SvixRequest(qe.HttpMethod.GET,"/api/v1/app");return r.setQueryParams({exclude_apps_with_no_endpoints:t?.excludeAppsWithNoEndpoints,exclude_apps_with_disabled_endpoints:t?.excludeAppsWithDisabledEndpoints,exclude_apps_with_svix_play_endpoints:t?.excludeAppsWithSvixPlayEndpoints,limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,HC.ListResponseApplicationOutSerializer._fromJsonObject)}create(t,r){let i=new qe.SvixRequest(qe.HttpMethod.POST,"/api/v1/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(sl.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,Zr.ApplicationOutSerializer._fromJsonObject)}getOrCreate(t,r){let i=new qe.SvixRequest(qe.HttpMethod.POST,"/api/v1/app");return i.setQueryParam("get_if_exists",!0),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(sl.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,Zr.ApplicationOutSerializer._fromJsonObject)}get(t){let r=new qe.SvixRequest(qe.HttpMethod.GET,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.send(this.requestCtx,Zr.ApplicationOutSerializer._fromJsonObject)}update(t,r){let i=new qe.SvixRequest(qe.HttpMethod.PUT,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody(sl.ApplicationInSerializer._toJsonObject(r)),i.send(this.requestCtx,Zr.ApplicationOutSerializer._fromJsonObject)}delete(t){let r=new qe.SvixRequest(qe.HttpMethod.DELETE,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new qe.SvixRequest(qe.HttpMethod.PATCH,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody(BC.ApplicationPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Zr.ApplicationOutSerializer._fromJsonObject)}};Hi.Application=al});var Tm=f(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.ApiTokenOutSerializer=void 0;Ni.ApiTokenOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),expiresAt:e.expiresAt?new Date(e.expiresAt):null,id:e.id,name:e.name,scopes:e.scopes,token:e.token}},_toJsonObject(e){return{createdAt:e.createdAt,expiresAt:e.expiresAt,id:e.id,name:e.name,scopes:e.scopes,token:e.token}}}});var ul=f(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.AppPortalCapabilitySerializer=Bt.AppPortalCapability=void 0;var NC;(function(e){e.ViewBase="ViewBase",e.ViewEndpointSecret="ViewEndpointSecret",e.ManageEndpointSecret="ManageEndpointSecret",e.ManageTransformations="ManageTransformations",e.CreateAttempts="CreateAttempts",e.ManageEndpoint="ManageEndpoint"})(NC=Bt.AppPortalCapability||(Bt.AppPortalCapability={}));Bt.AppPortalCapabilitySerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var jm=f(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});Li.AppPortalAccessInSerializer=void 0;var Dm=ul(),Im=Ii();Li.AppPortalAccessInSerializer={_fromJsonObject(e){var t;return{application:e.application!=null?Im.ApplicationInSerializer._fromJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>Dm.AppPortalCapabilitySerializer._fromJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}},_toJsonObject(e){var t;return{application:e.application!=null?Im.ApplicationInSerializer._toJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>Dm.AppPortalCapabilitySerializer._toJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}}}});var $m=f(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.AppPortalAccessOutSerializer=void 0;Gi.AppPortalAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}});var qm=f(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.ApplicationTokenExpireInSerializer=void 0;Ui.ApplicationTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}});var Rm=f(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.RotatePollerTokenInSerializer=void 0;Wi.RotatePollerTokenInSerializer={_fromJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}},_toJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}}}});var Fm=f(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.StreamPortalAccessInSerializer=void 0;Vi.StreamPortalAccessInSerializer={_fromJsonObject(e){return{expiry:e.expiry,featureFlags:e.featureFlags,sessionId:e.sessionId}},_toJsonObject(e){return{expiry:e.expiry,featureFlags:e.featureFlags,sessionId:e.sessionId}}}});var zm=f(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.StreamTokenExpireInSerializer=void 0;Ki.StreamTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}});var ll=f(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.DashboardAccessOutSerializer=void 0;Yi.DashboardAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}});var Bm=f(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.Authentication=void 0;var Mm=Tm(),LC=jm(),Jm=$m(),GC=qm(),UC=Rm(),WC=Fm(),VC=zm(),KC=ll(),be=ne(),cl=class{constructor(t){this.requestCtx=t}appPortalAccess(t,r,i){let n=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/app-portal-access/{app_id}");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(LC.AppPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,Jm.AppPortalAccessOutSerializer._fromJsonObject)}expireAll(t,r,i){let n=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/app/{app_id}/expire-all");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(GC.ApplicationTokenExpireInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}dashboardAccess(t,r){let i=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/dashboard-access/{app_id}");return i.setPathParam("app_id",t),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.send(this.requestCtx,KC.DashboardAccessOutSerializer._fromJsonObject)}logout(t){let r=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/logout");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.sendNoResponseBody(this.requestCtx)}streamLogout(t){let r=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/stream-logout");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.sendNoResponseBody(this.requestCtx)}streamPortalAccess(t,r,i){let n=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/stream-portal-access/{stream_id}");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(WC.StreamPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,Jm.AppPortalAccessOutSerializer._fromJsonObject)}streamExpireAll(t,r,i){let n=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/expire-all");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(VC.StreamTokenExpireInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}getStreamPollerToken(t,r){let i=new be.SvixRequest(be.HttpMethod.GET,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,Mm.ApiTokenOutSerializer._fromJsonObject)}rotateStreamPollerToken(t,r,i,n){let o=new be.SvixRequest(be.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate");return o.setPathParam("stream_id",t),o.setPathParam("sink_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(UC.RotatePollerTokenInSerializer._toJsonObject(i)),o.send(this.requestCtx,Mm.ApiTokenOutSerializer._fromJsonObject)}};Qi.Authentication=cl});var kt=f(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.BackgroundTaskStatusSerializer=Ht.BackgroundTaskStatus=void 0;var YC;(function(e){e.Running="running",e.Finished="finished",e.Failed="failed"})(YC=Ht.BackgroundTaskStatus||(Ht.BackgroundTaskStatus={}));Ht.BackgroundTaskStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var At=f(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.BackgroundTaskTypeSerializer=Nt.BackgroundTaskType=void 0;var QC;(function(e){e.EndpointReplay="endpoint.replay",e.EndpointRecover="endpoint.recover",e.ApplicationStats="application.stats",e.MessageBroadcast="message.broadcast",e.SdkGenerate="sdk.generate",e.EventTypeAggregate="event-type.aggregate",e.ApplicationPurgeContent="application.purge_content",e.EndpointBulkReplay="endpoint.bulk-replay"})(QC=Nt.BackgroundTaskType||(Nt.BackgroundTaskType={}));Nt.BackgroundTaskTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var dl=f(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.BackgroundTaskOutSerializer=void 0;var Hm=kt(),Nm=At();Zi.BackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data,id:e.id,status:Hm.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Nm.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{data:e.data,id:e.id,status:Hm.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Nm.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var Gm=f(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.ListResponseBackgroundTaskOutSerializer=void 0;var Lm=dl();Xi.ListResponseBackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Lm.BackgroundTaskOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Lm.BackgroundTaskOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Um=f(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.BackgroundTask=void 0;var ZC=dl(),XC=Gm(),en=ne(),ml=class{constructor(t){this.requestCtx=t}list(t){let r=new en.SvixRequest(en.HttpMethod.GET,"/api/v1/background-task");return r.setQueryParams({status:t?.status,task:t?.task,limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,XC.ListResponseBackgroundTaskOutSerializer._fromJsonObject)}listByEndpoint(t){return this.list(t)}get(t){let r=new en.SvixRequest(en.HttpMethod.GET,"/api/v1/background-task/{task_id}");return r.setPathParam("task_id",t),r.send(this.requestCtx,ZC.BackgroundTaskOutSerializer._fromJsonObject)}};tn.BackgroundTask=ml});var lr=f(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.ConnectorKindSerializer=Lt.ConnectorKind=void 0;var eO;(function(e){e.Custom="Custom",e.AgenticCommerceProtocol="AgenticCommerceProtocol",e.CloseCrm="CloseCRM",e.CustomerIo="CustomerIO",e.Discord="Discord",e.Hubspot="Hubspot",e.Inngest="Inngest",e.Loops="Loops",e.Otel="Otel",e.Resend="Resend",e.Salesforce="Salesforce",e.Segment="Segment",e.Sendgrid="Sendgrid",e.Slack="Slack",e.Teams="Teams",e.TriggerDev="TriggerDev",e.Windmill="Windmill",e.Zapier="Zapier"})(eO=Lt.ConnectorKind||(Lt.ConnectorKind={}));Lt.ConnectorKindSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var rn=f(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.ConnectorProductSerializer=Gt.ConnectorProduct=void 0;var tO;(function(e){e.Dispatch="Dispatch",e.Stream="Stream"})(tO=Gt.ConnectorProduct||(Gt.ConnectorProduct={}));Gt.ConnectorProductSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var pl=f(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.ConnectorInSerializer=void 0;var Wm=lr(),Vm=rn();nn.ConnectorInSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?Wm.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?Vm.ConnectorProductSerializer._fromJsonObject(e.productType):void 0,transformation:e.transformation,uid:e.uid}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?Wm.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?Vm.ConnectorProductSerializer._toJsonObject(e.productType):void 0,transformation:e.transformation,uid:e.uid}}}});var sn=f(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.ConnectorOutSerializer=void 0;var Km=lr(),Ym=rn();on.ConnectorOutSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,createdAt:new Date(e.createdAt),description:e.description,featureFlags:e.featureFlags,id:e.id,instructions:e.instructions,kind:Km.ConnectorKindSerializer._fromJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:Ym.ConnectorProductSerializer._fromJsonObject(e.productType),transformation:e.transformation,transformationUpdatedAt:new Date(e.transformationUpdatedAt),uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,createdAt:e.createdAt,description:e.description,featureFlags:e.featureFlags,id:e.id,instructions:e.instructions,kind:Km.ConnectorKindSerializer._toJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:Ym.ConnectorProductSerializer._toJsonObject(e.productType),transformation:e.transformation,transformationUpdatedAt:e.transformationUpdatedAt,uid:e.uid,updatedAt:e.updatedAt}}}});var Zm=f(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.ConnectorPatchSerializer=void 0;var Qm=lr();an.ConnectorPatchSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?Qm.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?Qm.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}}}});var ep=f(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.ConnectorUpdateSerializer=void 0;var Xm=lr();un.ConnectorUpdateSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?Xm.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}},_toJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?Xm.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}}}});var rp=f(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.ListResponseConnectorOutSerializer=void 0;var tp=sn();ln.ListResponseConnectorOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>tp.ConnectorOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>tp.ConnectorOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var ip=f(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.Connector=void 0;var rO=pl(),cn=sn(),iO=Zm(),nO=ep(),oO=rp(),Ke=ne(),fl=class{constructor(t){this.requestCtx=t}list(t){let r=new Ke.SvixRequest(Ke.HttpMethod.GET,"/api/v1/connector");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order,product_type:t?.productType}),r.send(this.requestCtx,oO.ListResponseConnectorOutSerializer._fromJsonObject)}create(t,r){let i=new Ke.SvixRequest(Ke.HttpMethod.POST,"/api/v1/connector");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(rO.ConnectorInSerializer._toJsonObject(t)),i.send(this.requestCtx,cn.ConnectorOutSerializer._fromJsonObject)}get(t){let r=new Ke.SvixRequest(Ke.HttpMethod.GET,"/api/v1/connector/{connector_id}");return r.setPathParam("connector_id",t),r.send(this.requestCtx,cn.ConnectorOutSerializer._fromJsonObject)}update(t,r){let i=new Ke.SvixRequest(Ke.HttpMethod.PUT,"/api/v1/connector/{connector_id}");return i.setPathParam("connector_id",t),i.setBody(nO.ConnectorUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,cn.ConnectorOutSerializer._fromJsonObject)}delete(t){let r=new Ke.SvixRequest(Ke.HttpMethod.DELETE,"/api/v1/connector/{connector_id}");return r.setPathParam("connector_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Ke.SvixRequest(Ke.HttpMethod.PATCH,"/api/v1/connector/{connector_id}");return i.setPathParam("connector_id",t),i.setBody(iO.ConnectorPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,cn.ConnectorOutSerializer._fromJsonObject)}};dn.Connector=fl});var cr=f(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.MessageStatusSerializer=Ut.MessageStatus=void 0;var sO;(function(e){e[e.Success=0]="Success",e[e.Pending=1]="Pending",e[e.Fail=2]="Fail",e[e.Sending=3]="Sending"})(sO=Ut.MessageStatus||(Ut.MessageStatus={}));Ut.MessageStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var hl=f(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.StatusCodeClassSerializer=Wt.StatusCodeClass=void 0;var aO;(function(e){e[e.CodeNone=0]="CodeNone",e[e.Code1xx=100]="Code1xx",e[e.Code2xx=200]="Code2xx",e[e.Code3xx=300]="Code3xx",e[e.Code4xx=400]="Code4xx",e[e.Code5xx=500]="Code5xx"})(aO=Wt.StatusCodeClass||(Wt.StatusCodeClass={}));Wt.StatusCodeClassSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var sp=f(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.BulkReplayInSerializer=void 0;var np=cr(),op=hl();mn.BulkReplayInSerializer={_fromJsonObject(e){return{channel:e.channel,eventTypes:e.eventTypes,since:new Date(e.since),status:e.status!=null?np.MessageStatusSerializer._fromJsonObject(e.status):void 0,statusCodeClass:e.statusCodeClass!=null?op.StatusCodeClassSerializer._fromJsonObject(e.statusCodeClass):void 0,tag:e.tag,until:e.until?new Date(e.until):null}},_toJsonObject(e){return{channel:e.channel,eventTypes:e.eventTypes,since:e.since,status:e.status!=null?np.MessageStatusSerializer._toJsonObject(e.status):void 0,statusCodeClass:e.statusCodeClass!=null?op.StatusCodeClassSerializer._toJsonObject(e.statusCodeClass):void 0,tag:e.tag,until:e.until}}}});var ap=f(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.EndpointHeadersInSerializer=void 0;pn.EndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var gl=f(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.EndpointHeadersOutSerializer=void 0;fn.EndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var up=f(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.EndpointHeadersPatchInSerializer=void 0;hn.EndpointHeadersPatchInSerializer={_fromJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}},_toJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}}}});var lp=f(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.EndpointInSerializer=void 0;gn.EndpointInSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,headers:e.headers,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,headers:e.headers,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}});var bl=f(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.EndpointOutSerializer=void 0;bn.EndpointOutSerializer={_fromJsonObject(e){return{channels:e.channels,createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}});var cp=f(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.EndpointPatchSerializer=void 0;vn.EndpointPatchSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}});var dp=f(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.EndpointSecretOutSerializer=void 0;_n.EndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var vl=f(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.EndpointSecretRotateInSerializer=void 0;yn.EndpointSecretRotateInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var mp=f(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.EndpointStatsSerializer=void 0;Cn.EndpointStatsSerializer={_fromJsonObject(e){return{fail:e.fail,pending:e.pending,sending:e.sending,success:e.success}},_toJsonObject(e){return{fail:e.fail,pending:e.pending,sending:e.sending,success:e.success}}}});var pp=f(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.EndpointTransformationInSerializer=void 0;On.EndpointTransformationInSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var fp=f(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.EndpointTransformationOutSerializer=void 0;Sn.EndpointTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled,updatedAt:e.updatedAt?new Date(e.updatedAt):null}},_toJsonObject(e){return{code:e.code,enabled:e.enabled,updatedAt:e.updatedAt}}}});var hp=f(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.EndpointTransformationPatchSerializer=void 0;xn.EndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var gp=f(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.EndpointUpdateSerializer=void 0;wn.EndpointUpdateSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,throttleRate:e.throttleRate,uid:e.uid,url:e.url,version:e.version}}}});var bp=f(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.EventExampleInSerializer=void 0;kn.EventExampleInSerializer={_fromJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}},_toJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}}}});var _p=f(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.ListResponseEndpointOutSerializer=void 0;var vp=bl();An.ListResponseEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>vp.EndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>vp.EndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Xr=f(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.MessageOutSerializer=void 0;En.MessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,id:e.id,payload:e.payload,tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,id:e.id,payload:e.payload,tags:e.tags,timestamp:e.timestamp}}}});var yp=f(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.RecoverInSerializer=void 0;Pn.RecoverInSerializer={_fromJsonObject(e){return{since:new Date(e.since),until:e.until?new Date(e.until):null}},_toJsonObject(e){return{since:e.since,until:e.until}}}});var Sp=f(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.RecoverOutSerializer=void 0;var Cp=kt(),Op=At();Tn.RecoverOutSerializer={_fromJsonObject(e){return{id:e.id,status:Cp.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Op.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:Cp.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Op.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var xp=f(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ReplayInSerializer=void 0;Dn.ReplayInSerializer={_fromJsonObject(e){return{since:new Date(e.since),until:e.until?new Date(e.until):null}},_toJsonObject(e){return{since:e.since,until:e.until}}}});var Ap=f(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.ReplayOutSerializer=void 0;var wp=kt(),kp=At();In.ReplayOutSerializer={_fromJsonObject(e){return{id:e.id,status:wp.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:kp.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:wp.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:kp.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var Pp=f($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.Endpoint=void 0;var uO=sp(),lO=ap(),cO=gl(),dO=up(),mO=lp(),jn=bl(),pO=cp(),fO=dp(),hO=vl(),gO=mp(),bO=pp(),vO=fp(),_O=hp(),yO=gp(),CO=bp(),OO=_p(),SO=Xr(),xO=yp(),wO=Sp(),kO=xp(),Ep=Ap(),q=ne(),_l=class{constructor(t){this.requestCtx=t}list(t,r){let i=new q.SvixRequest(q.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint");return i.setPathParam("app_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,OO.ListResponseEndpointOutSerializer._fromJsonObject)}create(t,r,i){let n=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(mO.EndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,jn.EndpointOutSerializer._fromJsonObject)}get(t,r){let i=new q.SvixRequest(q.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,jn.EndpointOutSerializer._fromJsonObject)}update(t,r,i){let n=new q.SvixRequest(q.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(yO.EndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,jn.EndpointOutSerializer._fromJsonObject)}delete(t,r){let i=new q.SvixRequest(q.HttpMethod.DELETE,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.sendNoResponseBody(this.requestCtx)}patch(t,r,i){let n=new q.SvixRequest(q.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(pO.EndpointPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,jn.EndpointOutSerializer._fromJsonObject)}bulkReplay(t,r,i,n){let o=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/bulk-replay");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(uO.BulkReplayInSerializer._toJsonObject(i)),o.send(this.requestCtx,Ep.ReplayOutSerializer._fromJsonObject)}getHeaders(t,r){let i=new q.SvixRequest(q.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,cO.EndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r,i){let n=new q.SvixRequest(q.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(lO.EndpointHeadersInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}headersUpdate(t,r,i){return this.updateHeaders(t,r,i)}patchHeaders(t,r,i){let n=new q.SvixRequest(q.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(dO.EndpointHeadersPatchInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}headersPatch(t,r,i){return this.patchHeaders(t,r,i)}recover(t,r,i,n){let o=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(xO.RecoverInSerializer._toJsonObject(i)),o.send(this.requestCtx,wO.RecoverOutSerializer._fromJsonObject)}replayMissing(t,r,i,n){let o=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(kO.ReplayInSerializer._toJsonObject(i)),o.send(this.requestCtx,Ep.ReplayOutSerializer._fromJsonObject)}getSecret(t,r){let i=new q.SvixRequest(q.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,fO.EndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let o=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(hO.EndpointSecretRotateInSerializer._toJsonObject(i)),o.sendNoResponseBody(this.requestCtx)}sendExample(t,r,i,n){let o=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example");return o.setPathParam("app_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(CO.EventExampleInSerializer._toJsonObject(i)),o.send(this.requestCtx,SO.MessageOutSerializer._fromJsonObject)}getStats(t,r,i){let n=new q.SvixRequest(q.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setQueryParams({since:i?.since,until:i?.until}),n.send(this.requestCtx,gO.EndpointStatsSerializer._fromJsonObject)}transformationGet(t,r){let i=new q.SvixRequest(q.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return i.setPathParam("app_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,vO.EndpointTransformationOutSerializer._fromJsonObject)}patchTransformation(t,r,i){let n=new q.SvixRequest(q.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(_O.EndpointTransformationPatchSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}transformationPartialUpdate(t,r,i){let n=new q.SvixRequest(q.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setBody(bO.EndpointTransformationInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};$n.Endpoint=_l});var yl=f(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.EventTypeInSerializer=void 0;qn.EventTypeInSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}}}});var Ip=f(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.EnvironmentInSerializer=void 0;var Tp=pl(),Dp=yl();Rn.EnvironmentInSerializer={_fromJsonObject(e){var t,r;return{connectors:(t=e.connectors)===null||t===void 0?void 0:t.map(i=>Tp.ConnectorInSerializer._fromJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>Dp.EventTypeInSerializer._fromJsonObject(i)),settings:e.settings}},_toJsonObject(e){var t,r;return{connectors:(t=e.connectors)===null||t===void 0?void 0:t.map(i=>Tp.ConnectorInSerializer._toJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>Dp.EventTypeInSerializer._toJsonObject(i)),settings:e.settings}}}});var zn=f(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.EventTypeOutSerializer=void 0;Fn.EventTypeOutSerializer={_fromJsonObject(e){return{archived:e.archived,createdAt:new Date(e.createdAt),deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{archived:e.archived,createdAt:e.createdAt,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas,updatedAt:e.updatedAt}}}});var qp=f(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.EnvironmentOutSerializer=void 0;var jp=sn(),$p=zn();Mn.EnvironmentOutSerializer={_fromJsonObject(e){return{connectors:e.connectors.map(t=>jp.ConnectorOutSerializer._fromJsonObject(t)),createdAt:new Date(e.createdAt),eventTypes:e.eventTypes.map(t=>$p.EventTypeOutSerializer._fromJsonObject(t)),settings:e.settings,version:e.version}},_toJsonObject(e){return{connectors:e.connectors.map(t=>jp.ConnectorOutSerializer._toJsonObject(t)),createdAt:e.createdAt,eventTypes:e.eventTypes.map(t=>$p.EventTypeOutSerializer._toJsonObject(t)),settings:e.settings,version:e.version}}}});var Rp=f(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.Environment=void 0;var AO=Ip(),EO=qp(),Jn=ne(),Cl=class{constructor(t){this.requestCtx=t}export(t){let r=new Jn.SvixRequest(Jn.HttpMethod.POST,"/api/v1/environment/export");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.send(this.requestCtx,EO.EnvironmentOutSerializer._fromJsonObject)}import(t,r){let i=new Jn.SvixRequest(Jn.HttpMethod.POST,"/api/v1/environment/import");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(AO.EnvironmentInSerializer._toJsonObject(t)),i.sendNoResponseBody(this.requestCtx)}};Bn.Environment=Cl});var Fp=f(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.EventTypeImportOpenApiInSerializer=void 0;Hn.EventTypeImportOpenApiInSerializer={_fromJsonObject(e){return{dryRun:e.dryRun,replaceAll:e.replaceAll,spec:e.spec,specRaw:e.specRaw}},_toJsonObject(e){return{dryRun:e.dryRun,replaceAll:e.replaceAll,spec:e.spec,specRaw:e.specRaw}}}});var zp=f(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.EventTypeFromOpenApiSerializer=void 0;Nn.EventTypeFromOpenApiSerializer={_fromJsonObject(e){return{deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}},_toJsonObject(e){return{deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,name:e.name,schemas:e.schemas}}}});var Jp=f(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.EventTypeImportOpenApiOutDataSerializer=void 0;var Mp=zp();Ln.EventTypeImportOpenApiOutDataSerializer={_fromJsonObject(e){var t;return{modified:e.modified,toModify:(t=e.to_modify)===null||t===void 0?void 0:t.map(r=>Mp.EventTypeFromOpenApiSerializer._fromJsonObject(r))}},_toJsonObject(e){var t;return{modified:e.modified,to_modify:(t=e.toModify)===null||t===void 0?void 0:t.map(r=>Mp.EventTypeFromOpenApiSerializer._toJsonObject(r))}}}});var Hp=f(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.EventTypeImportOpenApiOutSerializer=void 0;var Bp=Jp();Gn.EventTypeImportOpenApiOutSerializer={_fromJsonObject(e){return{data:Bp.EventTypeImportOpenApiOutDataSerializer._fromJsonObject(e.data)}},_toJsonObject(e){return{data:Bp.EventTypeImportOpenApiOutDataSerializer._toJsonObject(e.data)}}}});var Np=f(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.EventTypePatchSerializer=void 0;Un.EventTypePatchSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}}}});var Lp=f(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.EventTypeUpdateSerializer=void 0;Wn.EventTypeUpdateSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlag:e.featureFlag,featureFlags:e.featureFlags,groupName:e.groupName,schemas:e.schemas}}}});var Up=f(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.ListResponseEventTypeOutSerializer=void 0;var Gp=zn();Vn.ListResponseEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Gp.EventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Gp.EventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Wp=f(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.EventType=void 0;var PO=Fp(),TO=Hp(),DO=yl(),Kn=zn(),IO=Np(),jO=Lp(),$O=Up(),Re=ne(),Ol=class{constructor(t){this.requestCtx=t}list(t){let r=new Re.SvixRequest(Re.HttpMethod.GET,"/api/v1/event-type");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order,include_archived:t?.includeArchived,with_content:t?.withContent}),r.send(this.requestCtx,$O.ListResponseEventTypeOutSerializer._fromJsonObject)}create(t,r){let i=new Re.SvixRequest(Re.HttpMethod.POST,"/api/v1/event-type");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(DO.EventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,Kn.EventTypeOutSerializer._fromJsonObject)}importOpenapi(t,r){let i=new Re.SvixRequest(Re.HttpMethod.POST,"/api/v1/event-type/import/openapi");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(PO.EventTypeImportOpenApiInSerializer._toJsonObject(t)),i.send(this.requestCtx,TO.EventTypeImportOpenApiOutSerializer._fromJsonObject)}get(t){let r=new Re.SvixRequest(Re.HttpMethod.GET,"/api/v1/event-type/{event_type_name}");return r.setPathParam("event_type_name",t),r.send(this.requestCtx,Kn.EventTypeOutSerializer._fromJsonObject)}update(t,r){let i=new Re.SvixRequest(Re.HttpMethod.PUT,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(jO.EventTypeUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Kn.EventTypeOutSerializer._fromJsonObject)}delete(t,r){let i=new Re.SvixRequest(Re.HttpMethod.DELETE,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setQueryParams({expunge:r?.expunge}),i.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Re.SvixRequest(Re.HttpMethod.PATCH,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(IO.EventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Kn.EventTypeOutSerializer._fromJsonObject)}};Yn.EventType=Ol});var Kp=f(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.Health=void 0;var Vp=ne(),Sl=class{constructor(t){this.requestCtx=t}get(){return new Vp.SvixRequest(Vp.HttpMethod.GET,"/api/v1/health").sendNoResponseBody(this.requestCtx)}};Qn.Health=Sl});var Yp=f(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.IngestSourceConsumerPortalAccessInSerializer=void 0;Zn.IngestSourceConsumerPortalAccessInSerializer={_fromJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}},_toJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}}}});var Qp=f(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.IngestEndpointHeadersInSerializer=void 0;Xn.IngestEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var Zp=f(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.IngestEndpointHeadersOutSerializer=void 0;eo.IngestEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var Xp=f(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.IngestEndpointInSerializer=void 0;to.IngestEndpointInSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}}}});var xl=f(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.IngestEndpointOutSerializer=void 0;ro.IngestEndpointOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url}},_toJsonObject(e){return{createdAt:e.createdAt,description:e.description,disabled:e.disabled,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:e.updatedAt,url:e.url}}}});var ef=f(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.IngestEndpointSecretInSerializer=void 0;io.IngestEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var tf=f(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.IngestEndpointSecretOutSerializer=void 0;no.IngestEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var rf=f(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.IngestEndpointTransformationOutSerializer=void 0;oo.IngestEndpointTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var nf=f(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.IngestEndpointTransformationPatchSerializer=void 0;so.IngestEndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var of=f(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.IngestEndpointUpdateSerializer=void 0;ao.IngestEndpointUpdateSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}}}});var af=f(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.ListResponseIngestEndpointOutSerializer=void 0;var sf=xl();uo.ListResponseIngestEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>sf.IngestEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>sf.IngestEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var uf=f(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.IngestEndpoint=void 0;var qO=Qp(),RO=Zp(),FO=Xp(),wl=xl(),zO=ef(),MO=tf(),JO=rf(),BO=nf(),HO=of(),NO=af(),ae=ne(),kl=class{constructor(t){this.requestCtx=t}list(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint");return i.setPathParam("source_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,NO.ListResponseIngestEndpointOutSerializer._fromJsonObject)}create(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint");return n.setPathParam("source_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(FO.IngestEndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,wl.IngestEndpointOutSerializer._fromJsonObject)}get(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,wl.IngestEndpointOutSerializer._fromJsonObject)}update(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return n.setPathParam("source_id",t),n.setPathParam("endpoint_id",r),n.setBody(HO.IngestEndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,wl.IngestEndpointOutSerializer._fromJsonObject)}delete(t,r){let i=new ae.SvixRequest(ae.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.sendNoResponseBody(this.requestCtx)}getHeaders(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,RO.IngestEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return n.setPathParam("source_id",t),n.setPathParam("endpoint_id",r),n.setBody(qO.IngestEndpointHeadersInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}getSecret(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,MO.IngestEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let o=new ae.SvixRequest(ae.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate");return o.setPathParam("source_id",t),o.setPathParam("endpoint_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(zO.IngestEndpointSecretInSerializer._toJsonObject(i)),o.sendNoResponseBody(this.requestCtx)}getTransformation(t,r){let i=new ae.SvixRequest(ae.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return i.setPathParam("source_id",t),i.setPathParam("endpoint_id",r),i.send(this.requestCtx,JO.IngestEndpointTransformationOutSerializer._fromJsonObject)}setTransformation(t,r,i){let n=new ae.SvixRequest(ae.HttpMethod.PATCH,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return n.setPathParam("source_id",t),n.setPathParam("endpoint_id",r),n.setBody(BO.IngestEndpointTransformationPatchSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};lo.IngestEndpoint=kl});var lf=f(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.AdobeSignConfigSerializer=void 0;co.AdobeSignConfigSerializer={_fromJsonObject(e){return{clientId:e.clientId}},_toJsonObject(e){return{clientId:e.clientId}}}});var cf=f(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.AirwallexConfigSerializer=void 0;mo.AirwallexConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var df=f(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.CheckbookConfigSerializer=void 0;po.CheckbookConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Al=f(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.CronConfigSerializer=void 0;fo.CronConfigSerializer={_fromJsonObject(e){return{contentType:e.contentType,payload:e.payload,schedule:e.schedule}},_toJsonObject(e){return{contentType:e.contentType,payload:e.payload,schedule:e.schedule}}}});var mf=f(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.DocusignConfigSerializer=void 0;ho.DocusignConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var pf=f(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.EasypostConfigSerializer=void 0;go.EasypostConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var ff=f(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.GithubConfigSerializer=void 0;bo.GithubConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var hf=f(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.HubspotConfigSerializer=void 0;vo.HubspotConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var gf=f(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.MetaConfigSerializer=void 0;_o.MetaConfigSerializer={_fromJsonObject(e){return{secret:e.secret,verifyToken:e.verifyToken}},_toJsonObject(e){return{secret:e.secret,verifyToken:e.verifyToken}}}});var bf=f(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.OrumIoConfigSerializer=void 0;yo.OrumIoConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var vf=f(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.PandaDocConfigSerializer=void 0;Co.PandaDocConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var _f=f(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.PortIoConfigSerializer=void 0;Oo.PortIoConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var yf=f(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.RutterConfigSerializer=void 0;So.RutterConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Cf=f(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.SegmentConfigSerializer=void 0;xo.SegmentConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Of=f(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.ShopifyConfigSerializer=void 0;wo.ShopifyConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Sf=f(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.SlackConfigSerializer=void 0;ko.SlackConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var xf=f(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.StripeConfigSerializer=void 0;Ao.StripeConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var wf=f(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.SvixConfigSerializer=void 0;Eo.SvixConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var kf=f(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.TelnyxConfigSerializer=void 0;Po.TelnyxConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Af=f(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.VapiConfigSerializer=void 0;To.VapiConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Ef=f(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.VeriffConfigSerializer=void 0;Do.VeriffConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Pf=f(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.ZoomConfigSerializer=void 0;Io.ZoomConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Qf=f(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.IngestSourceInSerializer=void 0;var Tf=lf(),Df=cf(),If=df(),jf=Al(),$f=mf(),qf=pf(),Rf=ff(),Ff=hf(),zf=gf(),Mf=bf(),Jf=vf(),Bf=_f(),Hf=yf(),Nf=Cf(),Lf=Of(),Gf=Sf(),Uf=xf(),M=wf(),Wf=kf(),Vf=Af(),Kf=Ef(),Yf=Pf();jo.IngestSourceInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return jf.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return Tf.AdobeSignConfigSerializer._fromJsonObject(e.config);case"beehiiv":return M.SvixConfigSerializer._fromJsonObject(e.config);case"brex":return M.SvixConfigSerializer._fromJsonObject(e.config);case"checkbook":return If.CheckbookConfigSerializer._fromJsonObject(e.config);case"clerk":return M.SvixConfigSerializer._fromJsonObject(e.config);case"docusign":return $f.DocusignConfigSerializer._fromJsonObject(e.config);case"easypost":return qf.EasypostConfigSerializer._fromJsonObject(e.config);case"github":return Rf.GithubConfigSerializer._fromJsonObject(e.config);case"guesty":return M.SvixConfigSerializer._fromJsonObject(e.config);case"hubspot":return Ff.HubspotConfigSerializer._fromJsonObject(e.config);case"incident-io":return M.SvixConfigSerializer._fromJsonObject(e.config);case"lithic":return M.SvixConfigSerializer._fromJsonObject(e.config);case"meta":return zf.MetaConfigSerializer._fromJsonObject(e.config);case"nash":return M.SvixConfigSerializer._fromJsonObject(e.config);case"orum-io":return Mf.OrumIoConfigSerializer._fromJsonObject(e.config);case"panda-doc":return Jf.PandaDocConfigSerializer._fromJsonObject(e.config);case"port-io":return Bf.PortIoConfigSerializer._fromJsonObject(e.config);case"pleo":return M.SvixConfigSerializer._fromJsonObject(e.config);case"psi-fi":return M.SvixConfigSerializer._fromJsonObject(e.config);case"replicate":return M.SvixConfigSerializer._fromJsonObject(e.config);case"resend":return M.SvixConfigSerializer._fromJsonObject(e.config);case"rutter":return Hf.RutterConfigSerializer._fromJsonObject(e.config);case"safebase":return M.SvixConfigSerializer._fromJsonObject(e.config);case"sardine":return M.SvixConfigSerializer._fromJsonObject(e.config);case"segment":return Nf.SegmentConfigSerializer._fromJsonObject(e.config);case"shopify":return Lf.ShopifyConfigSerializer._fromJsonObject(e.config);case"slack":return Gf.SlackConfigSerializer._fromJsonObject(e.config);case"stripe":return Uf.StripeConfigSerializer._fromJsonObject(e.config);case"stych":return M.SvixConfigSerializer._fromJsonObject(e.config);case"svix":return M.SvixConfigSerializer._fromJsonObject(e.config);case"zoom":return Yf.ZoomConfigSerializer._fromJsonObject(e.config);case"telnyx":return Wf.TelnyxConfigSerializer._fromJsonObject(e.config);case"vapi":return Vf.VapiConfigSerializer._fromJsonObject(e.config);case"open-ai":return M.SvixConfigSerializer._fromJsonObject(e.config);case"render":return M.SvixConfigSerializer._fromJsonObject(e.config);case"veriff":return Kf.VeriffConfigSerializer._fromJsonObject(e.config);case"airwallex":return Df.AirwallexConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),metadata:e.metadata,name:e.name,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"generic-webhook":t={};break;case"cron":t=jf.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=Tf.AdobeSignConfigSerializer._toJsonObject(e.config);break;case"beehiiv":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"brex":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"checkbook":t=If.CheckbookConfigSerializer._toJsonObject(e.config);break;case"clerk":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"docusign":t=$f.DocusignConfigSerializer._toJsonObject(e.config);break;case"easypost":t=qf.EasypostConfigSerializer._toJsonObject(e.config);break;case"github":t=Rf.GithubConfigSerializer._toJsonObject(e.config);break;case"guesty":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"hubspot":t=Ff.HubspotConfigSerializer._toJsonObject(e.config);break;case"incident-io":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"lithic":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"meta":t=zf.MetaConfigSerializer._toJsonObject(e.config);break;case"nash":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"orum-io":t=Mf.OrumIoConfigSerializer._toJsonObject(e.config);break;case"panda-doc":t=Jf.PandaDocConfigSerializer._toJsonObject(e.config);break;case"port-io":t=Bf.PortIoConfigSerializer._toJsonObject(e.config);break;case"pleo":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"psi-fi":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"replicate":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"resend":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"rutter":t=Hf.RutterConfigSerializer._toJsonObject(e.config);break;case"safebase":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"sardine":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"segment":t=Nf.SegmentConfigSerializer._toJsonObject(e.config);break;case"shopify":t=Lf.ShopifyConfigSerializer._toJsonObject(e.config);break;case"slack":t=Gf.SlackConfigSerializer._toJsonObject(e.config);break;case"stripe":t=Uf.StripeConfigSerializer._toJsonObject(e.config);break;case"stych":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"svix":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"zoom":t=Yf.ZoomConfigSerializer._toJsonObject(e.config);break;case"telnyx":t=Wf.TelnyxConfigSerializer._toJsonObject(e.config);break;case"vapi":t=Vf.VapiConfigSerializer._toJsonObject(e.config);break;case"open-ai":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"render":t=M.SvixConfigSerializer._toJsonObject(e.config);break;case"veriff":t=Kf.VeriffConfigSerializer._toJsonObject(e.config);break;case"airwallex":t=Df.AirwallexConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,metadata:e.metadata,name:e.name,uid:e.uid}}}});var Zf=f($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.AdobeSignConfigOutSerializer=void 0;$o.AdobeSignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Xf=f(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.AirwallexConfigOutSerializer=void 0;qo.AirwallexConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var eh=f(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.CheckbookConfigOutSerializer=void 0;Ro.CheckbookConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var th=f(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.DocusignConfigOutSerializer=void 0;Fo.DocusignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var rh=f(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.EasypostConfigOutSerializer=void 0;zo.EasypostConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ih=f(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.GithubConfigOutSerializer=void 0;Mo.GithubConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var nh=f(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.HubspotConfigOutSerializer=void 0;Jo.HubspotConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var oh=f(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.MetaConfigOutSerializer=void 0;Bo.MetaConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var sh=f(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.OrumIoConfigOutSerializer=void 0;Ho.OrumIoConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var ah=f(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.PandaDocConfigOutSerializer=void 0;No.PandaDocConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var uh=f(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.PortIoConfigOutSerializer=void 0;Lo.PortIoConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var lh=f(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.RutterConfigOutSerializer=void 0;Go.RutterConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ch=f(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.SegmentConfigOutSerializer=void 0;Uo.SegmentConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var dh=f(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.ShopifyConfigOutSerializer=void 0;Wo.ShopifyConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var mh=f(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.SlackConfigOutSerializer=void 0;Vo.SlackConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ph=f(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.StripeConfigOutSerializer=void 0;Ko.StripeConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var fh=f(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.SvixConfigOutSerializer=void 0;Yo.SvixConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var hh=f(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.TelnyxConfigOutSerializer=void 0;Qo.TelnyxConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var gh=f(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.VapiConfigOutSerializer=void 0;Zo.VapiConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var bh=f(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.VeriffConfigOutSerializer=void 0;Xo.VeriffConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var vh=f(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.ZoomConfigOutSerializer=void 0;es.ZoomConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var El=f(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.IngestSourceOutSerializer=void 0;var _h=Zf(),yh=Xf(),Ch=eh(),Oh=Al(),Sh=th(),xh=rh(),wh=ih(),kh=nh(),Ah=oh(),Eh=sh(),Ph=ah(),Th=uh(),Dh=lh(),Ih=ch(),jh=dh(),$h=mh(),qh=ph(),J=fh(),Rh=hh(),Fh=gh(),zh=bh(),Mh=vh();ts.IngestSourceOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return Oh.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return _h.AdobeSignConfigOutSerializer._fromJsonObject(e.config);case"beehiiv":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"brex":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"checkbook":return Ch.CheckbookConfigOutSerializer._fromJsonObject(e.config);case"clerk":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"docusign":return Sh.DocusignConfigOutSerializer._fromJsonObject(e.config);case"easypost":return xh.EasypostConfigOutSerializer._fromJsonObject(e.config);case"github":return wh.GithubConfigOutSerializer._fromJsonObject(e.config);case"guesty":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"hubspot":return kh.HubspotConfigOutSerializer._fromJsonObject(e.config);case"incident-io":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"lithic":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"meta":return Ah.MetaConfigOutSerializer._fromJsonObject(e.config);case"nash":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"orum-io":return Eh.OrumIoConfigOutSerializer._fromJsonObject(e.config);case"panda-doc":return Ph.PandaDocConfigOutSerializer._fromJsonObject(e.config);case"port-io":return Th.PortIoConfigOutSerializer._fromJsonObject(e.config);case"psi-fi":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"pleo":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"replicate":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"resend":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"rutter":return Dh.RutterConfigOutSerializer._fromJsonObject(e.config);case"safebase":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"sardine":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"segment":return Ih.SegmentConfigOutSerializer._fromJsonObject(e.config);case"shopify":return jh.ShopifyConfigOutSerializer._fromJsonObject(e.config);case"slack":return $h.SlackConfigOutSerializer._fromJsonObject(e.config);case"stripe":return qh.StripeConfigOutSerializer._fromJsonObject(e.config);case"stych":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"svix":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"zoom":return Mh.ZoomConfigOutSerializer._fromJsonObject(e.config);case"telnyx":return Rh.TelnyxConfigOutSerializer._fromJsonObject(e.config);case"vapi":return Fh.VapiConfigOutSerializer._fromJsonObject(e.config);case"open-ai":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"render":return J.SvixConfigOutSerializer._fromJsonObject(e.config);case"veriff":return zh.VeriffConfigOutSerializer._fromJsonObject(e.config);case"airwallex":return yh.AirwallexConfigOutSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),createdAt:new Date(e.createdAt),id:e.id,ingestUrl:e.ingestUrl,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){let t;switch(e.type){case"generic-webhook":t={};break;case"cron":t=Oh.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=_h.AdobeSignConfigOutSerializer._toJsonObject(e.config);break;case"beehiiv":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"brex":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"checkbook":t=Ch.CheckbookConfigOutSerializer._toJsonObject(e.config);break;case"clerk":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"docusign":t=Sh.DocusignConfigOutSerializer._toJsonObject(e.config);break;case"easypost":t=xh.EasypostConfigOutSerializer._toJsonObject(e.config);break;case"github":t=wh.GithubConfigOutSerializer._toJsonObject(e.config);break;case"guesty":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"hubspot":t=kh.HubspotConfigOutSerializer._toJsonObject(e.config);break;case"incident-io":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"lithic":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"meta":t=Ah.MetaConfigOutSerializer._toJsonObject(e.config);break;case"nash":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"orum-io":t=Eh.OrumIoConfigOutSerializer._toJsonObject(e.config);break;case"panda-doc":t=Ph.PandaDocConfigOutSerializer._toJsonObject(e.config);break;case"port-io":t=Th.PortIoConfigOutSerializer._toJsonObject(e.config);break;case"psi-fi":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"pleo":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"replicate":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"resend":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"rutter":t=Dh.RutterConfigOutSerializer._toJsonObject(e.config);break;case"safebase":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"sardine":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"segment":t=Ih.SegmentConfigOutSerializer._toJsonObject(e.config);break;case"shopify":t=jh.ShopifyConfigOutSerializer._toJsonObject(e.config);break;case"slack":t=$h.SlackConfigOutSerializer._toJsonObject(e.config);break;case"stripe":t=qh.StripeConfigOutSerializer._toJsonObject(e.config);break;case"stych":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"svix":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"zoom":t=Mh.ZoomConfigOutSerializer._toJsonObject(e.config);break;case"telnyx":t=Rh.TelnyxConfigOutSerializer._toJsonObject(e.config);break;case"vapi":t=Fh.VapiConfigOutSerializer._toJsonObject(e.config);break;case"open-ai":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"render":t=J.SvixConfigOutSerializer._toJsonObject(e.config);break;case"veriff":t=zh.VeriffConfigOutSerializer._toJsonObject(e.config);break;case"airwallex":t=yh.AirwallexConfigOutSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,createdAt:e.createdAt,id:e.id,ingestUrl:e.ingestUrl,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:e.updatedAt}}}});var Bh=f(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.ListResponseIngestSourceOutSerializer=void 0;var Jh=El();rs.ListResponseIngestSourceOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Jh.IngestSourceOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Jh.IngestSourceOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Hh=f(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.RotateTokenOutSerializer=void 0;is.RotateTokenOutSerializer={_fromJsonObject(e){return{ingestUrl:e.ingestUrl}},_toJsonObject(e){return{ingestUrl:e.ingestUrl}}}});var Lh=f(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.IngestSource=void 0;var Nh=Qf(),Pl=El(),LO=Bh(),GO=Hh(),Ye=ne(),Tl=class{constructor(t){this.requestCtx=t}list(t){let r=new Ye.SvixRequest(Ye.HttpMethod.GET,"/ingest/api/v1/source");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,LO.ListResponseIngestSourceOutSerializer._fromJsonObject)}create(t,r){let i=new Ye.SvixRequest(Ye.HttpMethod.POST,"/ingest/api/v1/source");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(Nh.IngestSourceInSerializer._toJsonObject(t)),i.send(this.requestCtx,Pl.IngestSourceOutSerializer._fromJsonObject)}get(t){let r=new Ye.SvixRequest(Ye.HttpMethod.GET,"/ingest/api/v1/source/{source_id}");return r.setPathParam("source_id",t),r.send(this.requestCtx,Pl.IngestSourceOutSerializer._fromJsonObject)}update(t,r){let i=new Ye.SvixRequest(Ye.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}");return i.setPathParam("source_id",t),i.setBody(Nh.IngestSourceInSerializer._toJsonObject(r)),i.send(this.requestCtx,Pl.IngestSourceOutSerializer._fromJsonObject)}delete(t){let r=new Ye.SvixRequest(Ye.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}");return r.setPathParam("source_id",t),r.sendNoResponseBody(this.requestCtx)}rotateToken(t,r){let i=new Ye.SvixRequest(Ye.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/token/rotate");return i.setPathParam("source_id",t),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.send(this.requestCtx,GO.RotateTokenOutSerializer._fromJsonObject)}};ns.IngestSource=Tl});var Uh=f(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.Ingest=void 0;var UO=ll(),WO=Yp(),VO=uf(),KO=Lh(),Gh=ne(),Dl=class{constructor(t){this.requestCtx=t}get endpoint(){return new VO.IngestEndpoint(this.requestCtx)}get source(){return new KO.IngestSource(this.requestCtx)}dashboard(t,r,i){let n=new Gh.SvixRequest(Gh.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/dashboard");return n.setPathParam("source_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(WO.IngestSourceConsumerPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,UO.DashboardAccessOutSerializer._fromJsonObject)}};os.Ingest=Dl});var Wh=f(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.IntegrationInSerializer=void 0;ss.IntegrationInSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var Vh=f(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.IntegrationKeyOutSerializer=void 0;as.IntegrationKeyOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Il=f(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.IntegrationOutSerializer=void 0;us.IntegrationOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),featureFlags:e.featureFlags,id:e.id,name:e.name,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,featureFlags:e.featureFlags,id:e.id,name:e.name,updatedAt:e.updatedAt}}}});var Kh=f(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.IntegrationUpdateSerializer=void 0;ls.IntegrationUpdateSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var Qh=f(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.ListResponseIntegrationOutSerializer=void 0;var Yh=Il();cs.ListResponseIntegrationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Yh.IntegrationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Yh.IntegrationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Xh=f(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.Integration=void 0;var YO=Wh(),Zh=Vh(),jl=Il(),QO=Kh(),ZO=Qh(),Fe=ne(),$l=class{constructor(t){this.requestCtx=t}list(t,r){let i=new Fe.SvixRequest(Fe.HttpMethod.GET,"/api/v1/app/{app_id}/integration");return i.setPathParam("app_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,ZO.ListResponseIntegrationOutSerializer._fromJsonObject)}create(t,r,i){let n=new Fe.SvixRequest(Fe.HttpMethod.POST,"/api/v1/app/{app_id}/integration");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(YO.IntegrationInSerializer._toJsonObject(r)),n.send(this.requestCtx,jl.IntegrationOutSerializer._fromJsonObject)}get(t,r){let i=new Fe.SvixRequest(Fe.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}");return i.setPathParam("app_id",t),i.setPathParam("integ_id",r),i.send(this.requestCtx,jl.IntegrationOutSerializer._fromJsonObject)}update(t,r,i){let n=new Fe.SvixRequest(Fe.HttpMethod.PUT,"/api/v1/app/{app_id}/integration/{integ_id}");return n.setPathParam("app_id",t),n.setPathParam("integ_id",r),n.setBody(QO.IntegrationUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,jl.IntegrationOutSerializer._fromJsonObject)}delete(t,r){let i=new Fe.SvixRequest(Fe.HttpMethod.DELETE,"/api/v1/app/{app_id}/integration/{integ_id}");return i.setPathParam("app_id",t),i.setPathParam("integ_id",r),i.sendNoResponseBody(this.requestCtx)}getKey(t,r){let i=new Fe.SvixRequest(Fe.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}/key");return i.setPathParam("app_id",t),i.setPathParam("integ_id",r),i.send(this.requestCtx,Zh.IntegrationKeyOutSerializer._fromJsonObject)}rotateKey(t,r,i){let n=new Fe.SvixRequest(Fe.HttpMethod.POST,"/api/v1/app/{app_id}/integration/{integ_id}/key/rotate");return n.setPathParam("app_id",t),n.setPathParam("integ_id",r),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.send(this.requestCtx,Zh.IntegrationKeyOutSerializer._fromJsonObject)}};ds.Integration=$l});var rg=f(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.ExpungeAllContentsOutSerializer=void 0;var eg=kt(),tg=At();ms.ExpungeAllContentsOutSerializer={_fromJsonObject(e){return{id:e.id,status:eg.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:tg.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:eg.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:tg.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var ng=f(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.ListResponseMessageOutSerializer=void 0;var ig=Xr();ps.ListResponseMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>ig.MessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>ig.MessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var og=f(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.MessagePrecheckInSerializer=void 0;fs.MessagePrecheckInSerializer={_fromJsonObject(e){return{channels:e.channels,eventType:e.eventType}},_toJsonObject(e){return{channels:e.channels,eventType:e.eventType}}}});var sg=f(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.MessagePrecheckOutSerializer=void 0;hs.MessagePrecheckOutSerializer={_fromJsonObject(e){return{active:e.active}},_toJsonObject(e){return{active:e.active}}}});var ag=f(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.PollingEndpointConsumerSeekInSerializer=void 0;gs.PollingEndpointConsumerSeekInSerializer={_fromJsonObject(e){return{after:new Date(e.after)}},_toJsonObject(e){return{after:e.after}}}});var ug=f(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.PollingEndpointConsumerSeekOutSerializer=void 0;bs.PollingEndpointConsumerSeekOutSerializer={_fromJsonObject(e){return{iterator:e.iterator}},_toJsonObject(e){return{iterator:e.iterator}}}});var lg=f(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.PollingEndpointMessageOutSerializer=void 0;vs.PollingEndpointMessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,headers:e.headers,id:e.id,payload:e.payload,tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,headers:e.headers,id:e.id,payload:e.payload,tags:e.tags,timestamp:e.timestamp}}}});var dg=f(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.PollingEndpointOutSerializer=void 0;var cg=lg();_s.PollingEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>cg.PollingEndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>cg.PollingEndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var pg=f(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.MessagePoller=void 0;var XO=ag(),eS=ug(),mg=dg(),dr=ne(),ql=class{constructor(t){this.requestCtx=t}poll(t,r,i){let n=new dr.SvixRequest(dr.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}");return n.setPathParam("app_id",t),n.setPathParam("sink_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,event_type:i?.eventType,channel:i?.channel,after:i?.after}),n.send(this.requestCtx,mg.PollingEndpointOutSerializer._fromJsonObject)}consumerPoll(t,r,i,n){let o=new dr.SvixRequest(dr.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}");return o.setPathParam("app_id",t),o.setPathParam("sink_id",r),o.setPathParam("consumer_id",i),o.setQueryParams({limit:n?.limit,iterator:n?.iterator}),o.send(this.requestCtx,mg.PollingEndpointOutSerializer._fromJsonObject)}consumerSeek(t,r,i,n,o){let s=new dr.SvixRequest(dr.HttpMethod.POST,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek");return s.setPathParam("app_id",t),s.setPathParam("sink_id",r),s.setPathParam("consumer_id",i),s.setHeaderParam("idempotency-key",o?.idempotencyKey),s.setBody(XO.PollingEndpointConsumerSeekInSerializer._toJsonObject(n)),s.send(this.requestCtx,eS.PollingEndpointConsumerSeekOutSerializer._fromJsonObject)}};ys.MessagePoller=ql});var hg=f(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.MessageInSerializer=void 0;var fg=Ii();Cs.MessageInSerializer={_fromJsonObject(e){return{application:e.application!=null?fg.ApplicationInSerializer._fromJsonObject(e.application):void 0,channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,payload:e.payload,payloadRetentionHours:e.payloadRetentionHours,payloadRetentionPeriod:e.payloadRetentionPeriod,tags:e.tags,transformationsParams:e.transformationsParams}},_toJsonObject(e){return{application:e.application!=null?fg.ApplicationInSerializer._toJsonObject(e.application):void 0,channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,payload:e.payload,payloadRetentionHours:e.payloadRetentionHours,payloadRetentionPeriod:e.payloadRetentionPeriod,tags:e.tags,transformationsParams:e.transformationsParams}}}});var Fl=f(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.messageInRaw=mr.Message=void 0;var tS=rg(),rS=ng(),gg=Xr(),iS=og(),nS=sg(),oS=pg(),Qe=ne(),sS=hg(),Rl=class{constructor(t){this.requestCtx=t}get poller(){return new oS.MessagePoller(this.requestCtx)}list(t,r){let i=new Qe.SvixRequest(Qe.HttpMethod.GET,"/api/v1/app/{app_id}/msg");return i.setPathParam("app_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,channel:r?.channel,before:r?.before,after:r?.after,with_content:r?.withContent,tag:r?.tag,event_types:r?.eventTypes}),i.send(this.requestCtx,rS.ListResponseMessageOutSerializer._fromJsonObject)}create(t,r,i){let n=new Qe.SvixRequest(Qe.HttpMethod.POST,"/api/v1/app/{app_id}/msg");return n.setPathParam("app_id",t),n.setQueryParams({with_content:i?.withContent}),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(sS.MessageInSerializer._toJsonObject(r)),n.send(this.requestCtx,gg.MessageOutSerializer._fromJsonObject)}expungeAllContents(t,r){let i=new Qe.SvixRequest(Qe.HttpMethod.POST,"/api/v1/app/{app_id}/msg/expunge-all-contents");return i.setPathParam("app_id",t),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.send(this.requestCtx,tS.ExpungeAllContentsOutSerializer._fromJsonObject)}precheck(t,r,i){let n=new Qe.SvixRequest(Qe.HttpMethod.POST,"/api/v1/app/{app_id}/msg/precheck/active");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(iS.MessagePrecheckInSerializer._toJsonObject(r)),n.send(this.requestCtx,nS.MessagePrecheckOutSerializer._fromJsonObject)}get(t,r,i){let n=new Qe.SvixRequest(Qe.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setQueryParams({with_content:i?.withContent}),n.send(this.requestCtx,gg.MessageOutSerializer._fromJsonObject)}expungeContent(t,r){let i=new Qe.SvixRequest(Qe.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/content");return i.setPathParam("app_id",t),i.setPathParam("msg_id",r),i.sendNoResponseBody(this.requestCtx)}};mr.Message=Rl;function aS(e,t,r){return{eventType:e,payload:{},transformationsParams:{rawPayload:t,headers:r?{"content-type":r}:void 0}}}mr.messageInRaw=aS});var zl=f(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.EmptyResponseSerializer=void 0;Os.EmptyResponseSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ei=f(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.MessageStatusTextSerializer=Vt.MessageStatusText=void 0;var uS;(function(e){e.Success="success",e.Pending="pending",e.Fail="fail",e.Sending="sending"})(uS=Vt.MessageStatusText||(Vt.MessageStatusText={}));Vt.MessageStatusTextSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var _g=f(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.EndpointMessageOutSerializer=void 0;var bg=cr(),vg=ei();Ss.EndpointMessageOutSerializer={_fromJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt?new Date(e.deliverAt):null,eventId:e.eventId,eventType:e.eventType,id:e.id,nextAttempt:e.nextAttempt?new Date(e.nextAttempt):null,payload:e.payload,status:bg.MessageStatusSerializer._fromJsonObject(e.status),statusText:vg.MessageStatusTextSerializer._fromJsonObject(e.statusText),tags:e.tags,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{channels:e.channels,deliverAt:e.deliverAt,eventId:e.eventId,eventType:e.eventType,id:e.id,nextAttempt:e.nextAttempt,payload:e.payload,status:bg.MessageStatusSerializer._toJsonObject(e.status),statusText:vg.MessageStatusTextSerializer._toJsonObject(e.statusText),tags:e.tags,timestamp:e.timestamp}}}});var Cg=f(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.ListResponseEndpointMessageOutSerializer=void 0;var yg=_g();xs.ListResponseEndpointMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>yg.EndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>yg.EndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Ml=f(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.MessageAttemptTriggerTypeSerializer=Kt.MessageAttemptTriggerType=void 0;var lS;(function(e){e[e.Scheduled=0]="Scheduled",e[e.Manual=1]="Manual"})(lS=Kt.MessageAttemptTriggerType||(Kt.MessageAttemptTriggerType={}));Kt.MessageAttemptTriggerTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Jl=f(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.MessageAttemptOutSerializer=void 0;var Og=Ml(),Sg=Xr(),xg=cr(),wg=ei();ws.MessageAttemptOutSerializer={_fromJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?Sg.MessageOutSerializer._fromJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:xg.MessageStatusSerializer._fromJsonObject(e.status),statusText:wg.MessageStatusTextSerializer._fromJsonObject(e.statusText),timestamp:new Date(e.timestamp),triggerType:Og.MessageAttemptTriggerTypeSerializer._fromJsonObject(e.triggerType),url:e.url}},_toJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?Sg.MessageOutSerializer._toJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:xg.MessageStatusSerializer._toJsonObject(e.status),statusText:wg.MessageStatusTextSerializer._toJsonObject(e.statusText),timestamp:e.timestamp,triggerType:Og.MessageAttemptTriggerTypeSerializer._toJsonObject(e.triggerType),url:e.url}}}});var Ag=f(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.ListResponseMessageAttemptOutSerializer=void 0;var kg=Jl();ks.ListResponseMessageAttemptOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>kg.MessageAttemptOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>kg.MessageAttemptOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Tg=f(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.MessageEndpointOutSerializer=void 0;var Eg=cr(),Pg=ei();As.MessageEndpointOutSerializer={_fromJsonObject(e){return{channels:e.channels,createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,nextAttempt:e.nextAttempt?new Date(e.nextAttempt):null,rateLimit:e.rateLimit,status:Eg.MessageStatusSerializer._fromJsonObject(e.status),statusText:Pg.MessageStatusTextSerializer._fromJsonObject(e.statusText),throttleRate:e.throttleRate,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url,version:e.version}},_toJsonObject(e){return{channels:e.channels,createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,nextAttempt:e.nextAttempt,rateLimit:e.rateLimit,status:Eg.MessageStatusSerializer._toJsonObject(e.status),statusText:Pg.MessageStatusTextSerializer._toJsonObject(e.statusText),throttleRate:e.throttleRate,uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}});var Ig=f(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.ListResponseMessageEndpointOutSerializer=void 0;var Dg=Tg();Es.ListResponseMessageEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Dg.MessageEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Dg.MessageEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var $g=f(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.MessageAttempt=void 0;var cS=zl(),dS=Cg(),jg=Ag(),mS=Ig(),pS=Jl(),ze=ne(),Bl=class{constructor(t){this.requestCtx=t}listByEndpoint(t,r,i){let n=new ze.SvixRequest(ze.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,status:i?.status,status_code_class:i?.statusCodeClass,channel:i?.channel,tag:i?.tag,before:i?.before,after:i?.after,with_content:i?.withContent,with_msg:i?.withMsg,event_types:i?.eventTypes}),n.send(this.requestCtx,jg.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listByMsg(t,r,i){let n=new ze.SvixRequest(ze.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/msg/{msg_id}");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,status:i?.status,status_code_class:i?.statusCodeClass,channel:i?.channel,tag:i?.tag,endpoint_id:i?.endpointId,before:i?.before,after:i?.after,with_content:i?.withContent,event_types:i?.eventTypes}),n.send(this.requestCtx,jg.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listAttemptedMessages(t,r,i){let n=new ze.SvixRequest(ze.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg");return n.setPathParam("app_id",t),n.setPathParam("endpoint_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,channel:i?.channel,tag:i?.tag,status:i?.status,before:i?.before,after:i?.after,with_content:i?.withContent,event_types:i?.eventTypes}),n.send(this.requestCtx,dS.ListResponseEndpointMessageOutSerializer._fromJsonObject)}get(t,r,i){let n=new ze.SvixRequest(ze.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setPathParam("attempt_id",i),n.send(this.requestCtx,pS.MessageAttemptOutSerializer._fromJsonObject)}expungeContent(t,r,i){let n=new ze.SvixRequest(ze.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setPathParam("attempt_id",i),n.sendNoResponseBody(this.requestCtx)}listAttemptedDestinations(t,r,i){let n=new ze.SvixRequest(ze.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint");return n.setPathParam("app_id",t),n.setPathParam("msg_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator}),n.send(this.requestCtx,mS.ListResponseMessageEndpointOutSerializer._fromJsonObject)}resend(t,r,i,n){let o=new ze.SvixRequest(ze.HttpMethod.POST,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend");return o.setPathParam("app_id",t),o.setPathParam("msg_id",r),o.setPathParam("endpoint_id",i),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.send(this.requestCtx,cS.EmptyResponseSerializer._fromJsonObject)}};Ps.MessageAttempt=Bl});var Hl=f(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.OperationalWebhookEndpointOutSerializer=void 0;Ts.OperationalWebhookEndpointOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:new Date(e.updatedAt),url:e.url}},_toJsonObject(e){return{createdAt:e.createdAt,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,id:e.id,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,updatedAt:e.updatedAt,url:e.url}}}});var Rg=f(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.ListResponseOperationalWebhookEndpointOutSerializer=void 0;var qg=Hl();Ds.ListResponseOperationalWebhookEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>qg.OperationalWebhookEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>qg.OperationalWebhookEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Fg=f(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.OperationalWebhookEndpointHeadersInSerializer=void 0;Is.OperationalWebhookEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var zg=f(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.OperationalWebhookEndpointHeadersOutSerializer=void 0;js.OperationalWebhookEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var Mg=f($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.OperationalWebhookEndpointInSerializer=void 0;$s.OperationalWebhookEndpointInSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,secret:e.secret,uid:e.uid,url:e.url}}}});var Jg=f(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.OperationalWebhookEndpointSecretInSerializer=void 0;qs.OperationalWebhookEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Bg=f(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.OperationalWebhookEndpointSecretOutSerializer=void 0;Rs.OperationalWebhookEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Hg=f(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.OperationalWebhookEndpointUpdateSerializer=void 0;Fs.OperationalWebhookEndpointUpdateSerializer={_fromJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}},_toJsonObject(e){return{description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,uid:e.uid,url:e.url}}}});var Gl=f(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.OperationalWebhookEndpoint=void 0;var fS=Rg(),hS=Fg(),gS=zg(),bS=Mg(),Nl=Hl(),vS=Jg(),_S=Bg(),yS=Hg(),ve=ne(),Ll=class{constructor(t){this.requestCtx=t}list(t){let r=new ve.SvixRequest(ve.HttpMethod.GET,"/api/v1/operational-webhook/endpoint");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,fS.ListResponseOperationalWebhookEndpointOutSerializer._fromJsonObject)}create(t,r){let i=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/operational-webhook/endpoint");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(bS.OperationalWebhookEndpointInSerializer._toJsonObject(t)),i.send(this.requestCtx,Nl.OperationalWebhookEndpointOutSerializer._fromJsonObject)}get(t){let r=new ve.SvixRequest(ve.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,Nl.OperationalWebhookEndpointOutSerializer._fromJsonObject)}update(t,r){let i=new ve.SvixRequest(ve.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return i.setPathParam("endpoint_id",t),i.setBody(yS.OperationalWebhookEndpointUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Nl.OperationalWebhookEndpointOutSerializer._fromJsonObject)}delete(t){let r=new ve.SvixRequest(ve.HttpMethod.DELETE,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return r.setPathParam("endpoint_id",t),r.sendNoResponseBody(this.requestCtx)}getHeaders(t){let r=new ve.SvixRequest(ve.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,gS.OperationalWebhookEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r){let i=new ve.SvixRequest(ve.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return i.setPathParam("endpoint_id",t),i.setBody(hS.OperationalWebhookEndpointHeadersInSerializer._toJsonObject(r)),i.sendNoResponseBody(this.requestCtx)}getSecret(t){let r=new ve.SvixRequest(ve.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,_S.OperationalWebhookEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i){let n=new ve.SvixRequest(ve.HttpMethod.POST,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate");return n.setPathParam("endpoint_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(vS.OperationalWebhookEndpointSecretInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}};zs.OperationalWebhookEndpoint=Ll});var Ng=f(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.OperationalWebhook=void 0;var CS=Gl(),Ul=class{constructor(t){this.requestCtx=t}get endpoint(){return new CS.OperationalWebhookEndpoint(this.requestCtx)}};Ms.OperationalWebhook=Ul});var Ug=f(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.AggregateEventTypesOutSerializer=void 0;var Lg=kt(),Gg=At();Js.AggregateEventTypesOutSerializer={_fromJsonObject(e){return{id:e.id,status:Lg.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Gg.BackgroundTaskTypeSerializer._fromJsonObject(e.task),updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:Lg.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Gg.BackgroundTaskTypeSerializer._toJsonObject(e.task),updatedAt:e.updatedAt}}}});var Wg=f(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.AppUsageStatsInSerializer=void 0;Bs.AppUsageStatsInSerializer={_fromJsonObject(e){return{appIds:e.appIds,since:new Date(e.since),until:new Date(e.until)}},_toJsonObject(e){return{appIds:e.appIds,since:e.since,until:e.until}}}});var Yg=f(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.AppUsageStatsOutSerializer=void 0;var Vg=kt(),Kg=At();Hs.AppUsageStatsOutSerializer={_fromJsonObject(e){return{id:e.id,status:Vg.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Kg.BackgroundTaskTypeSerializer._fromJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{id:e.id,status:Vg.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Kg.BackgroundTaskTypeSerializer._toJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds,updatedAt:e.updatedAt}}}});var Qg=f(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.Statistics=void 0;var OS=Ug(),SS=Wg(),xS=Yg(),Ns=ne(),Wl=class{constructor(t){this.requestCtx=t}aggregateAppStats(t,r){let i=new Ns.SvixRequest(Ns.HttpMethod.POST,"/api/v1/stats/usage/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(SS.AppUsageStatsInSerializer._toJsonObject(t)),i.send(this.requestCtx,xS.AppUsageStatsOutSerializer._fromJsonObject)}aggregateEventTypes(){return new Ns.SvixRequest(Ns.HttpMethod.PUT,"/api/v1/stats/usage/event-types").send(this.requestCtx,OS.AggregateEventTypesOutSerializer._fromJsonObject)}};Ls.Statistics=Wl});var Zg=f(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.HttpSinkHeadersPatchInSerializer=void 0;Gs.HttpSinkHeadersPatchInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var Xg=f(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.SinkTransformationOutSerializer=void 0;Us.SinkTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var Vl=f(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.StreamEventTypeOutSerializer=void 0;Ws.StreamEventTypeOutSerializer={_fromJsonObject(e){return{archived:e.archived,createdAt:new Date(e.createdAt),deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{archived:e.archived,createdAt:e.createdAt,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name,updatedAt:e.updatedAt}}}});var tb=f(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.ListResponseStreamEventTypeOutSerializer=void 0;var eb=Vl();Vs.ListResponseStreamEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>eb.StreamEventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>eb.StreamEventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var rb=f(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.StreamEventTypeInSerializer=void 0;Ks.StreamEventTypeInSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}}}});var ib=f(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.StreamEventTypePatchSerializer=void 0;Ys.StreamEventTypePatchSerializer={_fromJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{archived:e.archived,deprecated:e.deprecated,description:e.description,featureFlags:e.featureFlags,name:e.name}}}});var ob=f(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.StreamingEventType=void 0;var wS=tb(),nb=rb(),Qs=Vl(),kS=ib(),Ze=ne(),Kl=class{constructor(t){this.requestCtx=t}list(t){let r=new Ze.SvixRequest(Ze.HttpMethod.GET,"/api/v1/stream/event-type");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order,include_archived:t?.includeArchived}),r.send(this.requestCtx,wS.ListResponseStreamEventTypeOutSerializer._fromJsonObject)}create(t,r){let i=new Ze.SvixRequest(Ze.HttpMethod.POST,"/api/v1/stream/event-type");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(nb.StreamEventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,Qs.StreamEventTypeOutSerializer._fromJsonObject)}get(t){let r=new Ze.SvixRequest(Ze.HttpMethod.GET,"/api/v1/stream/event-type/{name}");return r.setPathParam("name",t),r.send(this.requestCtx,Qs.StreamEventTypeOutSerializer._fromJsonObject)}update(t,r){let i=new Ze.SvixRequest(Ze.HttpMethod.PUT,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setBody(nb.StreamEventTypeInSerializer._toJsonObject(r)),i.send(this.requestCtx,Qs.StreamEventTypeOutSerializer._fromJsonObject)}delete(t,r){let i=new Ze.SvixRequest(Ze.HttpMethod.DELETE,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setQueryParams({expunge:r?.expunge}),i.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Ze.SvixRequest(Ze.HttpMethod.PATCH,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setBody(kS.StreamEventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Qs.StreamEventTypeOutSerializer._fromJsonObject)}};Zs.StreamingEventType=Kl});var sb=f(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.EventInSerializer=void 0;Xs.EventInSerializer={_fromJsonObject(e){return{eventType:e.eventType,payload:e.payload}},_toJsonObject(e){return{eventType:e.eventType,payload:e.payload}}}});var Yl=f(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.StreamInSerializer=void 0;ea.StreamInSerializer={_fromJsonObject(e){return{metadata:e.metadata,name:e.name,uid:e.uid}},_toJsonObject(e){return{metadata:e.metadata,name:e.name,uid:e.uid}}}});var lb=f(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.CreateStreamEventsInSerializer=void 0;var ab=sb(),ub=Yl();ta.CreateStreamEventsInSerializer={_fromJsonObject(e){return{events:e.events.map(t=>ab.EventInSerializer._fromJsonObject(t)),stream:e.stream!=null?ub.StreamInSerializer._fromJsonObject(e.stream):void 0}},_toJsonObject(e){return{events:e.events.map(t=>ab.EventInSerializer._toJsonObject(t)),stream:e.stream!=null?ub.StreamInSerializer._toJsonObject(e.stream):void 0}}}});var cb=f(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.CreateStreamEventsOutSerializer=void 0;ra.CreateStreamEventsOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var db=f(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.EventOutSerializer=void 0;ia.EventOutSerializer={_fromJsonObject(e){return{eventType:e.eventType,payload:e.payload,timestamp:new Date(e.timestamp)}},_toJsonObject(e){return{eventType:e.eventType,payload:e.payload,timestamp:e.timestamp}}}});var pb=f(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.EventStreamOutSerializer=void 0;var mb=db();na.EventStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>mb.EventOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>mb.EventOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var fb=f(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.StreamingEvents=void 0;var AS=lb(),ES=cb(),PS=pb(),oa=ne(),Ql=class{constructor(t){this.requestCtx=t}create(t,r,i){let n=new oa.SvixRequest(oa.HttpMethod.POST,"/api/v1/stream/{stream_id}/events");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(AS.CreateStreamEventsInSerializer._toJsonObject(r)),n.send(this.requestCtx,ES.CreateStreamEventsOutSerializer._fromJsonObject)}get(t,r,i){let n=new oa.SvixRequest(oa.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/events");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setQueryParams({limit:i?.limit,iterator:i?.iterator,after:i?.after}),n.send(this.requestCtx,PS.EventStreamOutSerializer._fromJsonObject)}};sa.StreamingEvents=Ql});var Zl=f(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.AzureBlobStorageConfigSerializer=void 0;aa.AzureBlobStorageConfigSerializer={_fromJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}},_toJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}}}});var Xl=f(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.GoogleCloudStorageConfigSerializer=void 0;ua.GoogleCloudStorageConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var ec=f(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.S3ConfigSerializer=void 0;la.S3ConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}}}});var tc=f(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.SinkHttpConfigSerializer=void 0;ca.SinkHttpConfigSerializer={_fromJsonObject(e){return{headers:e.headers,key:e.key,url:e.url}},_toJsonObject(e){return{headers:e.headers,key:e.key,url:e.url}}}});var rc=f(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.SinkOtelV1ConfigSerializer=void 0;da.SinkOtelV1ConfigSerializer={_fromJsonObject(e){return{headers:e.headers,url:e.url}},_toJsonObject(e){return{headers:e.headers,url:e.url}}}});var ic=f(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.SinkStatusSerializer=Yt.SinkStatus=void 0;var TS;(function(e){e.Enabled="enabled",e.Paused="paused",e.Disabled="disabled",e.Retrying="retrying"})(TS=Yt.SinkStatus||(Yt.SinkStatus={}));Yt.SinkStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var nc=f(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.StreamSinkOutSerializer=void 0;var hb=Zl(),gb=Xl(),bb=ec(),vb=tc(),_b=rc(),yb=ic();ma.StreamSinkOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return hb.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return _b.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return vb.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return bb.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return gb.GoogleCloudStorageConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),batchSize:e.batchSize,createdAt:new Date(e.createdAt),currentIterator:e.currentIterator,eventTypes:e.eventTypes,failureReason:e.failureReason,id:e.id,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,nextRetryAt:e.nextRetryAt?new Date(e.nextRetryAt):null,status:yb.SinkStatusSerializer._fromJsonObject(e.status),uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=hb.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=_b.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=vb.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=bb.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=gb.GoogleCloudStorageConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,batchSize:e.batchSize,createdAt:e.createdAt,currentIterator:e.currentIterator,eventTypes:e.eventTypes,failureReason:e.failureReason,id:e.id,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,nextRetryAt:e.nextRetryAt,status:yb.SinkStatusSerializer._toJsonObject(e.status),uid:e.uid,updatedAt:e.updatedAt}}}});var Ob=f(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.ListResponseStreamSinkOutSerializer=void 0;var Cb=nc();pa.ListResponseStreamSinkOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Cb.StreamSinkOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Cb.StreamSinkOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Sb=f(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.SinkSecretOutSerializer=void 0;fa.SinkSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var xb=f(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.SinkTransformInSerializer=void 0;ha.SinkTransformInSerializer={_fromJsonObject(e){return{code:e.code}},_toJsonObject(e){return{code:e.code}}}});var ga=f(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.SinkStatusInSerializer=Qt.SinkStatusIn=void 0;var DS;(function(e){e.Enabled="enabled",e.Disabled="disabled"})(DS=Qt.SinkStatusIn||(Qt.SinkStatusIn={}));Qt.SinkStatusInSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Db=f(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.StreamSinkInSerializer=void 0;var wb=Zl(),kb=Xl(),Ab=ec(),Eb=tc(),Pb=rc(),Tb=ga();ba.StreamSinkInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return wb.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return Pb.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return Eb.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Ab.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return kb.GoogleCloudStorageConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?Tb.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=wb.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=Pb.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=Eb.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Ab.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=kb.GoogleCloudStorageConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?Tb.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var Ib=f(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.AmazonS3PatchConfigSerializer=void 0;va.AmazonS3PatchConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,endpointUrl:e.endpointUrl,region:e.region,secretAccessKey:e.secretAccessKey}}}});var jb=f(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.AzureBlobStoragePatchConfigSerializer=void 0;_a.AzureBlobStoragePatchConfigSerializer={_fromJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}},_toJsonObject(e){return{accessKey:e.accessKey,account:e.account,container:e.container}}}});var $b=f(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.GoogleCloudStoragePatchConfigSerializer=void 0;ya.GoogleCloudStoragePatchConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var qb=f(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.HttpPatchConfigSerializer=void 0;Ca.HttpPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var Rb=f(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.OtelTracingPatchConfigSerializer=void 0;Oa.OtelTracingPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var Nb=f(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.StreamSinkPatchSerializer=void 0;var Fb=Ib(),zb=jb(),Mb=$b(),Jb=qb(),Bb=Rb(),Hb=ga();Sa.StreamSinkPatchSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return zb.AzureBlobStoragePatchConfigSerializer._fromJsonObject(e.config);case"otelTracing":return Bb.OtelTracingPatchConfigSerializer._fromJsonObject(e.config);case"http":return Jb.HttpPatchConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Fb.AmazonS3PatchConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return Mb.GoogleCloudStoragePatchConfigSerializer._fromJsonObject(e.config);default:throw new Error(`Unexpected type: ${i}`)}}return{type:t,config:r(t),batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?Hb.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=zb.AzureBlobStoragePatchConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=Bb.OtelTracingPatchConfigSerializer._toJsonObject(e.config);break;case"http":t=Jb.HttpPatchConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Fb.AmazonS3PatchConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=Mb.GoogleCloudStoragePatchConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,batchSize:e.batchSize,eventTypes:e.eventTypes,maxWaitSecs:e.maxWaitSecs,metadata:e.metadata,status:e.status!=null?Hb.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var Ub=f(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.StreamingSink=void 0;var Lb=zl(),IS=vl(),jS=Ob(),$S=Sb(),qS=xb(),Gb=Db(),xa=nc(),RS=Nb(),_e=ne(),oc=class{constructor(t){this.requestCtx=t}list(t,r){let i=new _e.SvixRequest(_e.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink");return i.setPathParam("stream_id",t),i.setQueryParams({limit:r?.limit,iterator:r?.iterator,order:r?.order}),i.send(this.requestCtx,jS.ListResponseStreamSinkOutSerializer._fromJsonObject)}create(t,r,i){let n=new _e.SvixRequest(_e.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(Gb.StreamSinkInSerializer._toJsonObject(r)),n.send(this.requestCtx,xa.StreamSinkOutSerializer._fromJsonObject)}get(t,r){let i=new _e.SvixRequest(_e.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,xa.StreamSinkOutSerializer._fromJsonObject)}update(t,r,i){let n=new _e.SvixRequest(_e.HttpMethod.PUT,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(Gb.StreamSinkInSerializer._toJsonObject(i)),n.send(this.requestCtx,xa.StreamSinkOutSerializer._fromJsonObject)}delete(t,r){let i=new _e.SvixRequest(_e.HttpMethod.DELETE,"/api/v1/stream/{stream_id}/sink/{sink_id}");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.sendNoResponseBody(this.requestCtx)}patch(t,r,i){let n=new _e.SvixRequest(_e.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(RS.StreamSinkPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,xa.StreamSinkOutSerializer._fromJsonObject)}getSecret(t,r){let i=new _e.SvixRequest(_e.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,$S.SinkSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let o=new _e.SvixRequest(_e.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate");return o.setPathParam("stream_id",t),o.setPathParam("sink_id",r),o.setHeaderParam("idempotency-key",n?.idempotencyKey),o.setBody(IS.EndpointSecretRotateInSerializer._toJsonObject(i)),o.send(this.requestCtx,Lb.EmptyResponseSerializer._fromJsonObject)}transformationPartialUpdate(t,r,i){let n=new _e.SvixRequest(_e.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(qS.SinkTransformInSerializer._toJsonObject(i)),n.send(this.requestCtx,Lb.EmptyResponseSerializer._fromJsonObject)}};wa.StreamingSink=oc});var sc=f(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.StreamOutSerializer=void 0;ka.StreamOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),id:e.id,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:new Date(e.updatedAt)}},_toJsonObject(e){return{createdAt:e.createdAt,id:e.id,metadata:e.metadata,name:e.name,uid:e.uid,updatedAt:e.updatedAt}}}});var Vb=f(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.ListResponseStreamOutSerializer=void 0;var Wb=sc();Aa.ListResponseStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Wb.StreamOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Wb.StreamOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Kb=f(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.StreamPatchSerializer=void 0;Ea.StreamPatchSerializer={_fromJsonObject(e){return{description:e.description,metadata:e.metadata,uid:e.uid}},_toJsonObject(e){return{description:e.description,metadata:e.metadata,uid:e.uid}}}});var Qb=f(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.StreamingStream=void 0;var FS=Vb(),Yb=Yl(),Pa=sc(),zS=Kb(),Xe=ne(),ac=class{constructor(t){this.requestCtx=t}list(t){let r=new Xe.SvixRequest(Xe.HttpMethod.GET,"/api/v1/stream");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,FS.ListResponseStreamOutSerializer._fromJsonObject)}create(t,r){let i=new Xe.SvixRequest(Xe.HttpMethod.POST,"/api/v1/stream");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(Yb.StreamInSerializer._toJsonObject(t)),i.send(this.requestCtx,Pa.StreamOutSerializer._fromJsonObject)}get(t){let r=new Xe.SvixRequest(Xe.HttpMethod.GET,"/api/v1/stream/{stream_id}");return r.setPathParam("stream_id",t),r.send(this.requestCtx,Pa.StreamOutSerializer._fromJsonObject)}update(t,r){let i=new Xe.SvixRequest(Xe.HttpMethod.PUT,"/api/v1/stream/{stream_id}");return i.setPathParam("stream_id",t),i.setBody(Yb.StreamInSerializer._toJsonObject(r)),i.send(this.requestCtx,Pa.StreamOutSerializer._fromJsonObject)}delete(t){let r=new Xe.SvixRequest(Xe.HttpMethod.DELETE,"/api/v1/stream/{stream_id}");return r.setPathParam("stream_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Xe.SvixRequest(Xe.HttpMethod.PATCH,"/api/v1/stream/{stream_id}");return i.setPathParam("stream_id",t),i.setBody(zS.StreamPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Pa.StreamOutSerializer._fromJsonObject)}};Ta.StreamingStream=ac});var Xb=f(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.Streaming=void 0;var Zb=gl(),MS=Zg(),JS=Xg(),BS=ob(),HS=fb(),NS=Ub(),LS=Qb(),pr=ne(),uc=class{constructor(t){this.requestCtx=t}get event_type(){return new BS.StreamingEventType(this.requestCtx)}get events(){return new HS.StreamingEvents(this.requestCtx)}get sink(){return new NS.StreamingSink(this.requestCtx)}get stream(){return new LS.StreamingStream(this.requestCtx)}sinkHeadersGet(t,r){let i=new pr.SvixRequest(pr.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,Zb.EndpointHeadersOutSerializer._fromJsonObject)}sinkHeadersPatch(t,r,i){let n=new pr.SvixRequest(pr.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(MS.HttpSinkHeadersPatchInSerializer._toJsonObject(i)),n.send(this.requestCtx,Zb.EndpointHeadersOutSerializer._fromJsonObject)}sinkTransformationGet(t,r){let i=new pr.SvixRequest(pr.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return i.setPathParam("stream_id",t),i.setPathParam("sink_id",r),i.send(this.requestCtx,JS.SinkTransformationOutSerializer._fromJsonObject)}};Da.Streaming=uc});var e0=f(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.HTTPValidationError=Et.ValidationError=Et.HttpErrorOut=void 0;var fr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};Et.HttpErrorOut=fr;fr.discriminator=void 0;fr.mapping=void 0;fr.attributeTypeMap=[{name:"code",baseName:"code",type:"string",format:""},{name:"detail",baseName:"detail",type:"string",format:""}];var hr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};Et.ValidationError=hr;hr.discriminator=void 0;hr.mapping=void 0;hr.attributeTypeMap=[{name:"loc",baseName:"loc",type:"Array<string>",format:""},{name:"msg",baseName:"msg",type:"string",format:""},{name:"type",baseName:"type",type:"string",format:""}];var gr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};Et.HTTPValidationError=gr;gr.discriminator=void 0;gr.mapping=void 0;gr.attributeTypeMap=[{name:"detail",baseName:"detail",type:"Array<ValidationError>",format:""}]});var r0=f(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.timingSafeEqual=void 0;function t0(e,t=""){if(!e)throw new Error(t)}function GS(e,t){if(e.byteLength!==t.byteLength)return!1;e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),t0(e instanceof DataView),t0(t instanceof DataView);let r=e.byteLength,i=0,n=-1;for(;++n<r;)i|=e.getUint8(n)^t.getUint8(n);return i===0}Ia.timingSafeEqual=GS});var o0=f(Le=>{"use strict";var US=Le&&Le.__extends||(function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},e(t,r)};return function(t,r){e(t,r);function i(){this.constructor=t}t.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})();Object.defineProperty(Le,"__esModule",{value:!0});var de=256,lc=(function(){function e(t){t===void 0&&(t="="),this._paddingCharacter=t}return e.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(t*8+5)/6|0},e.prototype.encode=function(t){for(var r="",i=0;i<t.length-2;i+=3){var n=t[i]<<16|t[i+1]<<8|t[i+2];r+=this._encodeByte(n>>>18&63),r+=this._encodeByte(n>>>12&63),r+=this._encodeByte(n>>>6&63),r+=this._encodeByte(n>>>0&63)}var o=t.length-i;if(o>0){var n=t[i]<<16|(o===2?t[i+1]<<8:0);r+=this._encodeByte(n>>>18&63),r+=this._encodeByte(n>>>12&63),o===2?r+=this._encodeByte(n>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},e.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(t*6+7)/8|0},e.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},e.prototype.decode=function(t){if(t.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(t),i=t.length-r,n=new Uint8Array(this.maxDecodedLength(i)),o=0,s=0,a=0,u=0,l=0,c=0,d=0;s<i-4;s+=4)u=this._decodeChar(t.charCodeAt(s+0)),l=this._decodeChar(t.charCodeAt(s+1)),c=this._decodeChar(t.charCodeAt(s+2)),d=this._decodeChar(t.charCodeAt(s+3)),n[o++]=u<<2|l>>>4,n[o++]=l<<4|c>>>2,n[o++]=c<<6|d,a|=u&de,a|=l&de,a|=c&de,a|=d&de;if(s<i-1&&(u=this._decodeChar(t.charCodeAt(s)),l=this._decodeChar(t.charCodeAt(s+1)),n[o++]=u<<2|l>>>4,a|=u&de,a|=l&de),s<i-2&&(c=this._decodeChar(t.charCodeAt(s+2)),n[o++]=l<<4|c>>>2,a|=c&de),s<i-3&&(d=this._decodeChar(t.charCodeAt(s+3)),n[o++]=c<<6|d,a|=d&de),a!==0)throw new Error("Base64Coder: incorrect characters for decoding");return n},e.prototype._encodeByte=function(t){var r=t;return r+=65,r+=25-t>>>8&6,r+=51-t>>>8&-75,r+=61-t>>>8&-15,r+=62-t>>>8&3,String.fromCharCode(r)},e.prototype._decodeChar=function(t){var r=de;return r+=(42-t&t-44)>>>8&-de+t-43+62,r+=(46-t&t-48)>>>8&-de+t-47+63,r+=(47-t&t-58)>>>8&-de+t-48+52,r+=(64-t&t-91)>>>8&-de+t-65+0,r+=(96-t&t-123)>>>8&-de+t-97+26,r},e.prototype._getPaddingLength=function(t){var r=0;if(this._paddingCharacter){for(var i=t.length-1;i>=0&&t[i]===this._paddingCharacter;i--)r++;if(t.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},e})();Le.Coder=lc;var ti=new lc;function WS(e){return ti.encode(e)}Le.encode=WS;function VS(e){return ti.decode(e)}Le.decode=VS;var i0=(function(e){US(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype._encodeByte=function(r){var i=r;return i+=65,i+=25-r>>>8&6,i+=51-r>>>8&-75,i+=61-r>>>8&-13,i+=62-r>>>8&49,String.fromCharCode(i)},t.prototype._decodeChar=function(r){var i=de;return i+=(44-r&r-46)>>>8&-de+r-45+62,i+=(94-r&r-96)>>>8&-de+r-95+63,i+=(47-r&r-58)>>>8&-de+r-48+52,i+=(64-r&r-91)>>>8&-de+r-65+0,i+=(96-r&r-123)>>>8&-de+r-97+26,i},t})(lc);Le.URLSafeCoder=i0;var n0=new i0;function KS(e){return n0.encode(e)}Le.encodeURLSafe=KS;function YS(e){return n0.decode(e)}Le.decodeURLSafe=YS;Le.encodedLength=function(e){return ti.encodedLength(e)};Le.maxDecodedLength=function(e){return ti.maxDecodedLength(e)};Le.decodedLength=function(e){return ti.decodedLength(e)}});var a0=f((s0,ja)=>{(function(e,t){var r={};t(r);var i=r.default;for(var n in r)i[n]=r[n];typeof ja=="object"&&typeof ja.exports=="object"?ja.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(s0,function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(d,m,b,v,_){for(var x,w,S,A,I,E,j,k,D,Q,Ee,Be,li;_>=64;){for(x=m[0],w=m[1],S=m[2],A=m[3],I=m[4],E=m[5],j=m[6],k=m[7],Q=0;Q<16;Q++)Ee=v+Q*4,d[Q]=(b[Ee]&255)<<24|(b[Ee+1]&255)<<16|(b[Ee+2]&255)<<8|b[Ee+3]&255;for(Q=16;Q<64;Q++)D=d[Q-2],Be=(D>>>17|D<<15)^(D>>>19|D<<13)^D>>>10,D=d[Q-15],li=(D>>>7|D<<25)^(D>>>18|D<<14)^D>>>3,d[Q]=(Be+d[Q-7]|0)+(li+d[Q-16]|0);for(Q=0;Q<64;Q++)Be=(((I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7))+(I&E^~I&j)|0)+(k+(t[Q]+d[Q]|0)|0)|0,li=((x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10))+(x&w^x&S^w&S)|0,k=j,j=E,E=I,I=A+Be|0,A=S,S=w,w=x,x=Be+li|0;m[0]+=x,m[1]+=w,m[2]+=S,m[3]+=A,m[4]+=I,m[5]+=E,m[6]+=j,m[7]+=k,v+=64,_-=64}return v}var i=(function(){function d(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return d.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},d.prototype.clean=function(){for(var m=0;m<this.buffer.length;m++)this.buffer[m]=0;for(var m=0;m<this.temp.length;m++)this.temp[m]=0;this.reset()},d.prototype.update=function(m,b){if(b===void 0&&(b=m.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var v=0;if(this.bytesHashed+=b,this.bufferLength>0){for(;this.bufferLength<64&&b>0;)this.buffer[this.bufferLength++]=m[v++],b--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(b>=64&&(v=r(this.temp,this.state,m,v,b),b%=64);b>0;)this.buffer[this.bufferLength++]=m[v++],b--;return this},d.prototype.finish=function(m){if(!this.finished){var b=this.bytesHashed,v=this.bufferLength,_=b/536870912|0,x=b<<3,w=b%64<56?64:128;this.buffer[v]=128;for(var S=v+1;S<w-8;S++)this.buffer[S]=0;this.buffer[w-8]=_>>>24&255,this.buffer[w-7]=_>>>16&255,this.buffer[w-6]=_>>>8&255,this.buffer[w-5]=_>>>0&255,this.buffer[w-4]=x>>>24&255,this.buffer[w-3]=x>>>16&255,this.buffer[w-2]=x>>>8&255,this.buffer[w-1]=x>>>0&255,r(this.temp,this.state,this.buffer,0,w),this.finished=!0}for(var S=0;S<8;S++)m[S*4+0]=this.state[S]>>>24&255,m[S*4+1]=this.state[S]>>>16&255,m[S*4+2]=this.state[S]>>>8&255,m[S*4+3]=this.state[S]>>>0&255;return this},d.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},d.prototype._saveState=function(m){for(var b=0;b<this.state.length;b++)m[b]=this.state[b]},d.prototype._restoreState=function(m,b){for(var v=0;v<this.state.length;v++)this.state[v]=m[v];this.bytesHashed=b,this.finished=!1,this.bufferLength=0},d})();e.Hash=i;var n=(function(){function d(m){this.inner=new i,this.outer=new i,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var b=new Uint8Array(this.blockSize);if(m.length>this.blockSize)new i().update(m).finish(b).clean();else for(var v=0;v<m.length;v++)b[v]=m[v];for(var v=0;v<b.length;v++)b[v]^=54;this.inner.update(b);for(var v=0;v<b.length;v++)b[v]^=106;this.outer.update(b),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var v=0;v<b.length;v++)b[v]=0}return d.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},d.prototype.clean=function(){for(var m=0;m<this.istate.length;m++)this.ostate[m]=this.istate[m]=0;this.inner.clean(),this.outer.clean()},d.prototype.update=function(m){return this.inner.update(m),this},d.prototype.finish=function(m){return this.outer.finished?this.outer.finish(m):(this.inner.finish(m),this.outer.update(m,this.digestLength).finish(m)),this},d.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},d})();e.HMAC=n;function o(d){var m=new i().update(d),b=m.digest();return m.clean(),b}e.hash=o,e.default=o;function s(d,m){var b=new n(d).update(m),v=b.digest();return b.clean(),v}e.hmac=s;function a(d,m,b,v){var _=v[0];if(_===0)throw new Error("hkdf: cannot expand more");m.reset(),_>1&&m.update(d),b&&m.update(b),m.update(v),m.finish(d),v[0]++}var u=new Uint8Array(e.digestLength);function l(d,m,b,v){m===void 0&&(m=u),v===void 0&&(v=32);for(var _=new Uint8Array([1]),x=s(m,d),w=new n(x),S=new Uint8Array(w.digestLength),A=S.length,I=new Uint8Array(v),E=0;E<v;E++)A===S.length&&(a(S,w,b,_),A=0),I[E]=S[A++];return w.clean(),S.fill(0),_.fill(0),I}e.hkdf=l;function c(d,m,b,v){for(var _=new n(d),x=_.digestLength,w=new Uint8Array(4),S=new Uint8Array(x),A=new Uint8Array(x),I=new Uint8Array(v),E=0;E*x<v;E++){var j=E+1;w[0]=j>>>24&255,w[1]=j>>>16&255,w[2]=j>>>8&255,w[3]=j>>>0&255,_.reset(),_.update(m),_.update(w),_.finish(A);for(var k=0;k<x;k++)S[k]=A[k];for(var k=2;k<=b;k++){_.reset(),_.update(A).finish(A);for(var D=0;D<x;D++)S[D]^=A[D]}for(var k=0;k<x&&E*x+k<v;k++)I[E*x+k]=S[k]}for(var E=0;E<x;E++)S[E]=A[E]=0;for(var E=0;E<4;E++)w[E]=0;return _.clean(),I}e.pbkdf2=c})});var dc=f(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.Webhook=br.WebhookVerificationError=void 0;var QS=r0(),u0=o0(),ZS=a0(),l0=300,cc=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},Pt=class e extends cc{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};br.WebhookVerificationError=Pt;var $a=class e{constructor(t,r){if(!t)throw new Error("Secret can't be empty.");if(r?.format==="raw")t instanceof Uint8Array?this.key=t:this.key=Uint8Array.from(t,i=>i.charCodeAt(0));else{if(typeof t!="string")throw new Error("Expected secret to be of type string");t.startsWith(e.prefix)&&(t=t.substring(e.prefix.length)),this.key=u0.decode(t)}}verify(t,r){let i={};for(let m of Object.keys(r))i[m.toLowerCase()]=r[m];let n=i["webhook-id"],o=i["webhook-signature"],s=i["webhook-timestamp"];if(!o||!n||!s)throw new Pt("Missing required headers");let a=this.verifyTimestamp(s),l=this.sign(n,a,t).split(",")[1],c=o.split(" "),d=new globalThis.TextEncoder;for(let m of c){let[b,v]=m.split(",");if(b==="v1"&&(0,QS.timingSafeEqual)(d.encode(v),d.encode(l)))return JSON.parse(t.toString())}throw new Pt("No matching signature found")}sign(t,r,i){if(typeof i!="string")if(i.constructor.name==="Buffer")i=i.toString();else throw new Error("Expected payload to be of type string or Buffer.");let n=new TextEncoder,o=Math.floor(r.getTime()/1e3),s=n.encode(`${t}.${o}.${i}`);return`v1,${u0.encode(ZS.hmac(this.key,s))}`}verifyTimestamp(t){let r=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(isNaN(i))throw new Pt("Invalid Signature Headers");if(r-i>l0)throw new Pt("Message timestamp too old");if(i>r+l0)throw new Pt("Message timestamp too new");return new Date(i*1e3)}};br.Webhook=$a;$a.prefix="whsec_"});var c0=f(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.Webhook=vr.WebhookVerificationError=void 0;var XS=dc(),e1=dc();Object.defineProperty(vr,"WebhookVerificationError",{enumerable:!0,get:function(){return e1.WebhookVerificationError}});var mc=class{constructor(t,r){this.inner=new XS.Webhook(t,r)}verify(t,r){var i,n,o,s,a,u;let l={};for(let c of Object.keys(r))l[c.toLowerCase()]=r[c];return l["webhook-id"]=(n=(i=l["svix-id"])!==null&&i!==void 0?i:l["webhook-id"])!==null&&n!==void 0?n:"",l["webhook-signature"]=(s=(o=l["svix-signature"])!==null&&o!==void 0?o:l["webhook-signature"])!==null&&s!==void 0?s:"",l["webhook-timestamp"]=(u=(a=l["svix-timestamp"])!==null&&a!==void 0?a:l["webhook-timestamp"])!==null&&u!==void 0?u:"",this.inner.verify(t,l)}sign(t,r,i){return this.inner.sign(t,r,i)}};vr.Webhook=mc});var d0=f(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.EndpointDisabledTriggerSerializer=Zt.EndpointDisabledTrigger=void 0;var t1;(function(e){e.Manual="manual",e.Automatic="automatic"})(t1=Zt.EndpointDisabledTrigger||(Zt.EndpointDisabledTrigger={}));Zt.EndpointDisabledTriggerSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var m0=f(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.OrderingSerializer=Xt.Ordering=void 0;var r1;(function(e){e.Ascending="ascending",e.Descending="descending"})(r1=Xt.Ordering||(Xt.Ordering={}));Xt.OrderingSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var p0=f(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.StatusCodeClass=X.SinkStatusIn=X.SinkStatus=X.Ordering=X.MessageStatusText=X.MessageStatus=X.MessageAttemptTriggerType=X.EndpointDisabledTrigger=X.ConnectorProduct=X.ConnectorKind=X.BackgroundTaskType=X.BackgroundTaskStatus=X.AppPortalCapability=void 0;var i1=ul();Object.defineProperty(X,"AppPortalCapability",{enumerable:!0,get:function(){return i1.AppPortalCapability}});var n1=kt();Object.defineProperty(X,"BackgroundTaskStatus",{enumerable:!0,get:function(){return n1.BackgroundTaskStatus}});var o1=At();Object.defineProperty(X,"BackgroundTaskType",{enumerable:!0,get:function(){return o1.BackgroundTaskType}});var s1=lr();Object.defineProperty(X,"ConnectorKind",{enumerable:!0,get:function(){return s1.ConnectorKind}});var a1=rn();Object.defineProperty(X,"ConnectorProduct",{enumerable:!0,get:function(){return a1.ConnectorProduct}});var u1=d0();Object.defineProperty(X,"EndpointDisabledTrigger",{enumerable:!0,get:function(){return u1.EndpointDisabledTrigger}});var l1=Ml();Object.defineProperty(X,"MessageAttemptTriggerType",{enumerable:!0,get:function(){return l1.MessageAttemptTriggerType}});var c1=cr();Object.defineProperty(X,"MessageStatus",{enumerable:!0,get:function(){return c1.MessageStatus}});var d1=ei();Object.defineProperty(X,"MessageStatusText",{enumerable:!0,get:function(){return d1.MessageStatusText}});var m1=m0();Object.defineProperty(X,"Ordering",{enumerable:!0,get:function(){return m1.Ordering}});var p1=ic();Object.defineProperty(X,"SinkStatus",{enumerable:!0,get:function(){return p1.SinkStatus}});var f1=ga();Object.defineProperty(X,"SinkStatusIn",{enumerable:!0,get:function(){return f1.SinkStatusIn}});var h1=hl();Object.defineProperty(X,"StatusCodeClass",{enumerable:!0,get:function(){return h1.StatusCodeClass}})});var h0=f(me=>{"use strict";var g1=me&&me.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),f0=me&&me.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&g1(t,e,r)};Object.defineProperty(me,"__esModule",{value:!0});me.Svix=me.messageInRaw=me.ValidationError=me.HttpErrorOut=me.HTTPValidationError=me.ApiException=void 0;var b1=Pm(),v1=Bm(),_1=Um(),y1=ip(),C1=Pp(),O1=Rp(),S1=Wp(),x1=Kp(),w1=Uh(),k1=Xh(),A1=Fl(),E1=$g(),P1=Ng(),T1=Qg(),D1=Xb(),I1=Gl(),j1=Vu();Object.defineProperty(me,"ApiException",{enumerable:!0,get:function(){return j1.ApiException}});var fc=e0();Object.defineProperty(me,"HTTPValidationError",{enumerable:!0,get:function(){return fc.HTTPValidationError}});Object.defineProperty(me,"HttpErrorOut",{enumerable:!0,get:function(){return fc.HttpErrorOut}});Object.defineProperty(me,"ValidationError",{enumerable:!0,get:function(){return fc.ValidationError}});f0(c0(),me);f0(p0(),me);var $1=Fl();Object.defineProperty(me,"messageInRaw",{enumerable:!0,get:function(){return $1.messageInRaw}});var q1=[{region:"us",url:"https://api.us.svix.com"},{region:"eu",url:"https://api.eu.svix.com"},{region:"in",url:"https://api.in.svix.com"},{region:"ca",url:"https://api.ca.svix.com"},{region:"au",url:"https://api.au.svix.com"}],pc=class{constructor(t,r={}){var i,n,o;let s=(i=q1.find(u=>u.region===t.split(".")[1]))===null||i===void 0?void 0:i.url,a=(o=(n=r.serverUrl)!==null&&n!==void 0?n:s)!==null&&o!==void 0?o:"https://api.svix.com";if(r.retryScheduleInMs){this.requestCtx={baseUrl:a,token:t,timeout:r.requestTimeout,retryScheduleInMs:r.retryScheduleInMs,fetch:r.fetch};return}if(r.numRetries){this.requestCtx={baseUrl:a,token:t,timeout:r.requestTimeout,numRetries:r.numRetries,fetch:r.fetch};return}this.requestCtx={baseUrl:a,token:t,timeout:r.requestTimeout,fetch:r.fetch}}get application(){return new b1.Application(this.requestCtx)}get authentication(){return new v1.Authentication(this.requestCtx)}get backgroundTask(){return new _1.BackgroundTask(this.requestCtx)}get connector(){return new y1.Connector(this.requestCtx)}get endpoint(){return new C1.Endpoint(this.requestCtx)}get environment(){return new O1.Environment(this.requestCtx)}get eventType(){return new S1.EventType(this.requestCtx)}get health(){return new x1.Health(this.requestCtx)}get ingest(){return new w1.Ingest(this.requestCtx)}get integration(){return new k1.Integration(this.requestCtx)}get message(){return new A1.Message(this.requestCtx)}get messageAttempt(){return new E1.MessageAttempt(this.requestCtx)}get operationalWebhook(){return new P1.OperationalWebhook(this.requestCtx)}get statistics(){return new T1.Statistics(this.requestCtx)}get streaming(){return new D1.Streaming(this.requestCtx)}get operationalWebhookEndpoint(){return new I1.OperationalWebhookEndpoint(this.requestCtx)}};me.Svix=pc});var gc={};or(gc,{FileBackend:()=>hc});var hc,bc=H(()=>{"use strict";De();hc=class{name="plaintext file";isSecure=!1;async get(t,r){let i=we();return i?i.profiles[r]?.api_key??null:null}async set(t,r,i){vc(i,r)}async delete(t,r){try{return _c(r),!0}catch{return!1}}async isAvailable(){return!0}}});var A0={};or(A0,{MacOSBackend:()=>Cc});function yc(e,t){return new Promise(r=>{(0,k0.execFile)(e,t,{timeout:5e3},(i,n,o)=>{let s=i&&"code"in i?i.code:0;r({stdout:n??"",stderr:o??"",code:s})})})}var k0,Cc,E0=H(()=>{"use strict";k0=require("node:child_process");Cc=class{name="macOS Keychain";isSecure=!0;async get(t,r){let{stdout:i,stderr:n,code:o}=await yc("/usr/bin/security",["find-generic-password","-s",t,"-a",r,"-w"]);if(o===44)return null;if(o!==0)throw new Error(`Failed to read from macOS Keychain (exit code ${o}): ${n.trim()}`);return i.trim()||null}async set(t,r,i){let{code:n,stderr:o}=await yc("/usr/bin/security",["add-generic-password","-s",t,"-a",r,"-w",i,"-U"]);if(n!==0)throw new Error(`Failed to store credential in macOS Keychain: ${o.trim()}`)}async delete(t,r){let{code:i}=await yc("/usr/bin/security",["delete-generic-password","-s",t,"-a",r]);return i===0}async isAvailable(){return process.platform==="darwin"}}});var P0={};or(P0,{LinuxBackend:()=>Oc});function Ra(e,t,r){return new Promise(i=>{(0,Fa.execFile)(e,t,{timeout:r?.timeout??5e3},(n,o,s)=>{let a=n&&"code"in n?n.code:0;i({stdout:o??"",stderr:s??"",code:a})})})}function dx(e,t,r){return new Promise(i=>{let n=(0,Fa.spawn)(e,t,{stdio:["pipe","ignore","pipe"],timeout:5e3}),o="";n.stderr?.on("data",s=>{o+=s.toString()}),n.on("close",s=>{i({code:s,stderr:o})}),n.on("error",()=>{i({code:1,stderr:"Failed to spawn process"})}),n.stdin?.on("error",()=>{}),n.stdin?.write(r),n.stdin?.end()})}var Fa,Oc,T0=H(()=>{"use strict";Fa=require("node:child_process");Oc=class{name="Secret Service (libsecret)";isSecure=!0;async get(t,r){let{stdout:i,code:n}=await Ra("secret-tool",["lookup","service",t,"account",r]);return n!==0||!i.trim()?null:i.trim()}async set(t,r,i){let{code:n,stderr:o}=await dx("secret-tool",["store",`--label=Resend CLI (${r})`,"service",t,"account",r],i);if(n!==0)throw new Error(`Failed to store credential in Secret Service: ${o.trim()}`)}async delete(t,r){let{code:i}=await Ra("secret-tool",["clear","service",t,"account",r]);return i===0}async isAvailable(){if(process.platform!=="linux"||(await Ra("which",["secret-tool"])).code!==0)return!1;let r=await Ra("secret-tool",["lookup","service","__resend_cli_probe__"],{timeout:3e3});return r.code===0||r.code===1}}});var D0={};or(D0,{WindowsBackend:()=>Sc});function za(e){return new Promise(t=>{(0,Ma.execFile)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{timeout:1e4},(r,i,n)=>{let o=r&&"code"in r?r.code:0;t({stdout:i??"",stderr:n??"",code:o})})})}function mx(e,t){return new Promise(r=>{let i=(0,Ma.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{stdio:["pipe","pipe","pipe"],timeout:1e4}),n="",o="";i.stdout?.on("data",s=>{n+=s.toString()}),i.stderr?.on("data",s=>{o+=s.toString()}),i.on("close",s=>{r({stdout:n,stderr:o,code:s})}),i.on("error",()=>{r({stdout:"",stderr:"Failed to spawn process",code:1})}),i.stdin?.on("error",()=>{}),i.stdin?.write(t),i.stdin?.end()})}function Tt(e){return e.replace(/'/g,"''")}var Ma,ri,Sc,I0=H(()=>{"use strict";Ma=require("node:child_process");ri=`
29
29
  try { $null = [Windows.Security.Credentials.PasswordVault] } catch {
30
30
  [void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
31
31
  }
32
- `,Dc=class{name="Windows Credential Manager";isSecure=!0;async get(t,r){let i=`${ri}
32
+ `,Sc=class{name="Windows Credential Manager";isSecure=!0;async get(t,r){let i=`${ri}
33
33
  $v = New-Object Windows.Security.Credentials.PasswordVault
34
34
  try {
35
- $c = $v.Retrieve('${Et(t)}', '${Et(r)}')
35
+ $c = $v.Retrieve('${Tt(t)}', '${Tt(r)}')
36
36
  $c.RetrievePassword()
37
37
  Write-Output $c.Password
38
38
  } catch {
39
39
  exit 1
40
40
  }
41
- `,{stdout:n,code:o}=await Ba(i);return o!==0||!n.trim()?null:n.trim()}async set(t,r,i){let n=`${ri}
41
+ `,{stdout:n,code:o}=await za(i);return o!==0||!n.trim()?null:n.trim()}async set(t,r,i){let n=`${ri}
42
42
  $v = New-Object Windows.Security.Credentials.PasswordVault
43
43
  try {
44
- $c = $v.Retrieve('${Et(t)}', '${Et(r)}')
44
+ $c = $v.Retrieve('${Tt(t)}', '${Tt(r)}')
45
45
  $v.Remove($c)
46
46
  } catch {}
47
- `;await Ba(n);let o=`${ri}
47
+ `;await za(n);let o=`${ri}
48
48
  $secret = [Console]::In.ReadLine()
49
49
  $v = New-Object Windows.Security.Credentials.PasswordVault
50
- $c = New-Object Windows.Security.Credentials.PasswordCredential('${Et(t)}', '${Et(r)}', $secret)
50
+ $c = New-Object Windows.Security.Credentials.PasswordCredential('${Tt(t)}', '${Tt(r)}', $secret)
51
51
  $v.Add($c)
52
- `,{code:s,stderr:a}=await Jx(o,i);if(s!==0)throw new Error(`Failed to store credential in Windows Credential Manager: ${a.trim()}`)}async delete(t,r){let i=`${ri}
52
+ `,{code:s,stderr:a}=await mx(o,i);if(s!==0)throw new Error(`Failed to store credential in Windows Credential Manager: ${a.trim()}`)}async delete(t,r){let i=`${ri}
53
53
  $v = New-Object Windows.Security.Credentials.PasswordVault
54
54
  try {
55
- $c = $v.Retrieve('${Et(t)}', '${Et(r)}')
55
+ $c = $v.Retrieve('${Tt(t)}', '${Tt(r)}')
56
56
  $v.Remove($c)
57
57
  } catch {
58
58
  exit 1
59
59
  }
60
- `,{code:n}=await Ba(i);return n===0}async isAvailable(){if(process.platform!=="win32")return!1;let{code:t}=await Ba(`${ri} $null = New-Object Windows.Security.Credentials.PasswordVault`);return t===0}}});async function ht(){if(ot)return ot;let e=process.env.RESEND_CREDENTIAL_STORE;if(e==="file"){let{FileBackend:r}=await Promise.resolve().then(()=>(Ac(),kc));return ot=new r,ot}if(e==="secure_storage"||e==="keychain"){let r=await G0();if(r)return ot=r,ot}if(!e){let r=await G0();if(r)return ot=r,ot}let{FileBackend:t}=await Promise.resolve().then(()=>(Ac(),kc));return ot=new t,ot}async function G0(){if(process.platform==="darwin"){let{MacOSBackend:e}=await Promise.resolve().then(()=>(H0(),J0)),t=new e;if(await t.isAvailable())return t}else if(process.platform==="linux"){let{LinuxBackend:e}=await Promise.resolve().then(()=>(B0(),F0)),t=new e;if(await t.isAvailable())return t}else if(process.platform==="win32"){let{WindowsBackend:e}=await Promise.resolve().then(()=>(L0(),N0)),t=new e;if(await t.isAvailable())return t}return null}var ft,ot,$c=B(()=>{"use strict";ft="resend-cli",ot=null});function st(){return process.env.XDG_CONFIG_HOME?(0,ii.join)(process.env.XDG_CONFIG_HOME,"resend"):process.platform==="win32"&&process.env.APPDATA?(0,ii.join)(process.env.APPDATA,"resend"):(0,ii.join)((0,U0.homedir)(),".config","resend")}function er(){return(0,ii.join)(st(),"credentials.json")}function Ae(){try{let e=JSON.parse((0,Ie.readFileSync)(er(),"utf-8"));if(e.api_key&&!e.profiles&&!e.teams)return{active_profile:"default",profiles:{default:{api_key:e.api_key}}};if(e.profiles){let t=e.storage==="keychain"?"secure_storage":e.storage;return{active_profile:e.active_profile??"default",...t?{storage:t}:{},profiles:e.profiles}}return e.teams?{active_profile:e.active_team??"default",profiles:e.teams}:null}catch{return null}}function yr(e){let t=st();(0,Ie.mkdirSync)(t,{recursive:!0,mode:448});let r=er();return(0,Ie.writeFileSync)(r,`${JSON.stringify(e,null,2)}
61
- `,{mode:384}),(0,Ie.chmodSync)(r,384),r}function Cr(e){if(e)return e;let t=process.env.RESEND_PROFILE||process.env.RESEND_TEAM;if(t)return t;let r=Ae();return r?.active_profile?r.active_profile:"default"}function Ec(e,t,r){let i=t||"default",n=fe(i);if(n)throw new Error(n);let o=Ae()||{active_profile:"default",profiles:{}};return o.profiles[i]={api_key:e,...r&&{permission:r}},Object.keys(o.profiles).length===1&&(o.active_profile=i),yr(o)}function Pc(e){let t=Ae();if(!t){let i=er();if(!(0,Ie.existsSync)(i))throw new Error("No credentials file found.");return(0,Ie.unlinkSync)(i),i}let r=e||Cr();if(!t.profiles[r])throw new Error(`Profile "${r}" not found. Available profiles: ${Object.keys(t.profiles).join(", ")}`);if(delete t.profiles[r],t.active_profile===r){let i=Object.keys(t.profiles);t.active_profile=i[0]||"default"}if(Object.keys(t.profiles).length===0){let i=er();return(0,Ie.unlinkSync)(i),i}return yr(t)}function La(e){let t=fe(e);if(t)throw new Error(t);let r=Ae();if(!r)throw new Error("No credentials file found. Run: resend login");if(!r.profiles[e])throw new Error(`Profile "${e}" not found. Available profiles: ${Object.keys(r.profiles).join(", ")}`);r.active_profile=e,yr(r)}function De(){let e=Ae();return e?Object.keys(e.profiles).map(t=>({name:t,active:t===e.active_profile})):[]}function fe(e){if(!e||e.length===0)return"Profile name must not be empty";if(e.length>64)return"Profile name must be 64 characters or fewer";if(!/^[a-zA-Z0-9._-]+$/.test(e))return"Profile name must contain only letters, numbers, dots, dashes, and underscores"}function Hx(e,t){if(e===t)return;let r=fe(t);if(r)throw new Error(r);let i=Ae();if(!i)throw new Error("No credentials file found. Run: resend login");if(!i.profiles[e])throw new Error(`Profile "${e}" not found. Available profiles: ${Object.keys(i.profiles).join(", ")}`);if(e!==t&&i.profiles[t])throw new Error(`Profile "${t}" already exists.`);i.profiles[t]=i.profiles[e],delete i.profiles[e],i.active_profile===e&&(i.active_profile=t),yr(i)}function tr(e){return e.length<=7?`${e.slice(0,3)}...`:`${e.slice(0,3)}...${e.slice(-4)}`}async function rr(e,t){if(e)return{key:e,source:"flag"};let r=process.env.RESEND_API_KEY;if(r)return{key:r,source:"env"};let i=Ae(),n=t||process.env.RESEND_PROFILE||process.env.RESEND_TEAM||i?.active_profile||"default";if(i?.storage==="secure_storage"){let s=await(await ht()).get(ft,n);if(s){let a=i.profiles[n]?.permission;return{key:s,source:"secure_storage",profile:n,permission:a}}}if(i){let o=i.profiles[n];if(o?.api_key){let s=await ht();if(s.isSecure)try{await s.set(ft,n,o.api_key),i.profiles[n]={...o.permission&&{permission:o.permission}},i.storage="secure_storage",yr(i),process.stderr.write(`Notice: API key for profile "${n}" has been moved to ${s.name}
62
- `)}catch{}return{key:o.api_key,source:"config",profile:n,permission:o.permission}}}return null}async function W0(e,t,r){let i=t||"default",n=fe(i);if(n)throw new Error(n);let o=await ht();if(!o.isSecure)return{configPath:Ec(e,i,r),backend:o};await o.set(ft,i,e);let a=Ae()||{active_profile:"default",profiles:{}};return a.storage="secure_storage",a.profiles[i]={...r&&{permission:r}},Object.keys(a.profiles).length===1&&(a.active_profile=i),{configPath:yr(a),backend:o}}async function Ga(e){let t=Ae(),r=e||process.env.RESEND_PROFILE||process.env.RESEND_TEAM||t?.active_profile||"default";if(t?.storage==="secure_storage"){let i=await ht();i.isSecure&&await i.delete(ft,r)}return Pc(r)}async function V0(){let e=Ae(),t=er();if(e?.storage==="secure_storage"){let r=await ht();r.isSecure&&await Promise.all(Object.keys(e.profiles).map(i=>r.delete(ft,i)))}return(0,Ie.existsSync)(t)&&(0,Ie.unlinkSync)(t),t}async function Ua(e,t){if(Ae()?.storage==="secure_storage"){let i=await ht();if(i.isSecure){let n=await i.get(ft,e);n&&(await i.set(ft,t,n),await i.delete(ft,e))}}Hx(e,t)}var Ie,U0,ii,_r,je=B(()=>{"use strict";Ie=require("node:fs"),U0=require("node:os"),ii=require("node:path");$c();_r=`Sending-only keys work with: emails send, emails batch, broadcasts send.
63
- Create a full access key at https://resend.com/api-keys`});function k(){return!(!process.stdin.isTTY||!process.stdout.isTTY||process.env.CI==="true"||process.env.CI==="1"||process.env.GITHUB_ACTIONS||process.env.TERM==="dumb")}var gt,ee=B(()=>{"use strict";gt=process.platform!=="win32"||!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"});function I_(){return(0,j_.join)(st(),"update-state.json")}function aw(){try{return JSON.parse((0,jr.readFileSync)(I_(),"utf-8"))}catch{return null}}function uw(e){(0,jr.mkdirSync)(st(),{recursive:!0,mode:448}),(0,jr.writeFileSync)(I_(),JSON.stringify(e),{mode:384})}function su(e,t){let r=l=>l.replace(/^v/,"").split(".").map(Number),[i,n,o]=r(e),[s,a,u]=r(t);return s!==i?s>i:a!==n?a>n:u>o}async function Wc(){try{let e=await fetch(Uc,{headers:{Accept:"application/vnd.github.v3+json"},signal:AbortSignal.timeout(5e3)});if(!e.ok)return null;let t=await e.json();if(t.prerelease||t.draft)return null;let r=t.tag_name?.replace(/^v/,"");return!r||!/^\d+\.\d+\.\d+$/.test(r)?null:r}catch{return null}}function lw(e){return!!(e?.json||process.env.RESEND_NO_UPDATE_NOTIFIER==="1"||process.env.CI==="true"||process.env.CI==="1"||process.env.GITHUB_ACTIONS||!process.stdout.isTTY)}function D_(){let e=au();return e.startsWith("npm")?"npm":e.startsWith("brew")?"homebrew":e.startsWith("curl")||e.startsWith("irm")?"install-script":"manual"}function au(){let e=process.execPath||process.argv[0]||"",t=process.argv[1]||"";return process.env.npm_execpath||/node_modules/.test(t)||/node_modules/.test(e)?"npm install -g resend-cli":/\/(Cellar|homebrew)\//i.test(e)?"brew update && brew upgrade resend":/[/\\]\.resend[/\\]bin[/\\]/.test(e)?process.platform==="win32"?"irm https://resend.com/install.ps1 | iex":"curl -fsSL https://resend.com/install.sh | bash":"https://github.com/resend/resend-cli/releases/latest"}function T_(e){let t=au(),r=t.startsWith("http"),i="\x1B[2m",n="\x1B[33m",o="\x1B[36m",s="\x1B[0m",a=["",`${i}Update available: ${n}v${se}${s}${i} \u2192 ${o}v${e}${s}`,`${i}${r?"Visit":"Run"}: ${o}${t}${s}`];return process.platform==="win32"&&a.push(`${i}Or download from: ${o}https://github.com/resend/resend-cli/releases/latest${s}`),a.push(""),a.join(`
64
- `)}async function $_(e){if(lw(e))return;let t=aw(),r=Date.now();if(t&&r-t.lastChecked<sw){su(se,t.latestVersion)&&process.stderr.write(T_(t.latestVersion));return}let i=await Wc();i&&(uw({lastChecked:r,latestVersion:i}),su(se,i)&&process.stderr.write(T_(i)))}var jr,j_,sw,Uc,ui=B(()=>{"use strict";jr=require("node:fs"),j_=require("node:path");je();zt();sw=3600*1e3,Uc="https://api.github.com/repos/resend/resend-cli/releases/latest"});var fy={};or(fy,{flushFromFile:()=>Iw,flushPayload:()=>py,getOrCreateAnonymousId:()=>my,isDisabled:()=>dy,trackCommand:()=>Zc});function Tw(){return Pw[process.platform]??process.platform}function dy(){return!cy||process.env.DO_NOT_TRACK==="1"||process.env.RESEND_TELEMETRY_DISABLED==="1"}function my(){let e=st(),t=(0,dt.join)(e,"telemetry-id");try{let i=(0,L.readFileSync)(t,"utf-8").trim();if(i)return i}catch{}let r=crypto.randomUUID();return(0,L.mkdirSync)(e,{recursive:!0,mode:448}),(0,L.writeFileSync)(t,r,{mode:384}),r}function jw(e){if(!e)return;let t=st(),r=(0,dt.join)(t,"telemetry-notice-shown");(0,L.existsSync)(r)||((0,L.mkdirSync)(t,{recursive:!0,mode:448}),(0,L.writeFileSync)(r,"",{mode:384}),process.stderr.write(`
60
+ `,{code:n}=await za(i);return n===0}async isAvailable(){if(process.platform!=="win32")return!1;let{code:t}=await za(`${ri} $null = New-Object Windows.Security.Credentials.PasswordVault`);return t===0}}});async function gt(){if(st)return st;let e=process.env.RESEND_CREDENTIAL_STORE;if(e==="file"){let{FileBackend:r}=await Promise.resolve().then(()=>(bc(),gc));return st=new r,st}if(e==="secure_storage"||e==="keychain"){let r=await j0();if(r)return st=r,st}if(!e){let r=await j0();if(r)return st=r,st}let{FileBackend:t}=await Promise.resolve().then(()=>(bc(),gc));return st=new t,st}async function j0(){if(process.platform==="darwin"){let{MacOSBackend:e}=await Promise.resolve().then(()=>(E0(),A0)),t=new e;if(await t.isAvailable())return t}else if(process.platform==="linux"){let{LinuxBackend:e}=await Promise.resolve().then(()=>(T0(),P0)),t=new e;if(await t.isAvailable())return t}else if(process.platform==="win32"){let{WindowsBackend:e}=await Promise.resolve().then(()=>(I0(),D0)),t=new e;if(await t.isAvailable())return t}return null}var ht,st,xc=H(()=>{"use strict";ht="resend-cli",st=null});function at(){return process.env.XDG_CONFIG_HOME?(0,ii.join)(process.env.XDG_CONFIG_HOME,"resend"):process.platform==="win32"&&process.env.APPDATA?(0,ii.join)(process.env.APPDATA,"resend"):(0,ii.join)((0,$0.homedir)(),".config","resend")}function er(){return(0,ii.join)(at(),"credentials.json")}function we(){try{let e=JSON.parse((0,Ie.readFileSync)(er(),"utf-8"));if(e.api_key&&!e.profiles&&!e.teams)return{active_profile:"default",profiles:{default:{api_key:e.api_key}}};if(e.profiles){let t=e.storage==="keychain"?"secure_storage":e.storage;return{active_profile:e.active_profile??"default",...t?{storage:t}:{},profiles:e.profiles}}return e.teams?{active_profile:e.active_team??"default",profiles:e.teams}:null}catch{return null}}function Cr(e){let t=at();(0,Ie.mkdirSync)(t,{recursive:!0,mode:448});let r=er();return(0,Ie.writeFileSync)(r,`${JSON.stringify(e,null,2)}
61
+ `,{mode:384}),(0,Ie.chmodSync)(r,384),r}function Or(e){if(e)return e;let t=process.env.RESEND_PROFILE||process.env.RESEND_TEAM;if(t)return t;let r=we();return r?.active_profile?r.active_profile:"default"}function vc(e,t,r){let i=t||"default",n=fe(i);if(n)throw new Error(n);let o=we()||{active_profile:"default",profiles:{}};return o.profiles[i]={api_key:e,...r&&{permission:r}},Object.keys(o.profiles).length===1&&(o.active_profile=i),Cr(o)}function _c(e){let t=we();if(!t){let i=er();if(!(0,Ie.existsSync)(i))throw new Error("No credentials file found.");return(0,Ie.unlinkSync)(i),i}let r=e||Or();if(!t.profiles[r])throw new Error(`Profile "${r}" not found. Available profiles: ${Object.keys(t.profiles).join(", ")}`);if(delete t.profiles[r],t.active_profile===r){let i=Object.keys(t.profiles);t.active_profile=i[0]||"default"}if(Object.keys(t.profiles).length===0){let i=er();return(0,Ie.unlinkSync)(i),i}return Cr(t)}function Ja(e){let t=fe(e);if(t)throw new Error(t);let r=we();if(!r)throw new Error("No credentials file found. Run: resend login");if(!r.profiles[e])throw new Error(`Profile "${e}" not found. Available profiles: ${Object.keys(r.profiles).join(", ")}`);r.active_profile=e,Cr(r)}function je(){let e=we();return e?Object.keys(e.profiles).map(t=>({name:t,active:t===e.active_profile})):[]}function fe(e){if(!e||e.length===0)return"Profile name must not be empty";if(e.length>64)return"Profile name must be 64 characters or fewer";if(!/^[a-zA-Z0-9._-]+$/.test(e))return"Profile name must contain only letters, numbers, dots, dashes, and underscores"}function px(e,t){if(e===t)return;let r=fe(t);if(r)throw new Error(r);let i=we();if(!i)throw new Error("No credentials file found. Run: resend login");if(!i.profiles[e])throw new Error(`Profile "${e}" not found. Available profiles: ${Object.keys(i.profiles).join(", ")}`);if(e!==t&&i.profiles[t])throw new Error(`Profile "${t}" already exists.`);i.profiles[t]=i.profiles[e],delete i.profiles[e],i.active_profile===e&&(i.active_profile=t),Cr(i)}function tr(e){return e.length<=7?`${e.slice(0,3)}...`:`${e.slice(0,3)}...${e.slice(-4)}`}async function rr(e,t){if(e)return{key:e,source:"flag"};let r=process.env.RESEND_API_KEY;if(r)return{key:r,source:"env"};let i=we(),n=t||process.env.RESEND_PROFILE||process.env.RESEND_TEAM||i?.active_profile||"default";if(i?.storage==="secure_storage"){let s=await(await gt()).get(ht,n);if(s){let a=i.profiles[n]?.permission;return{key:s,source:"secure_storage",profile:n,permission:a}}}if(i){let o=i.profiles[n];if(o?.api_key){let s=await gt();if(s.isSecure)try{await s.set(ht,n,o.api_key),i.profiles[n]={...o.permission&&{permission:o.permission}},i.storage="secure_storage",Cr(i),process.stderr.write(`Notice: API key for profile "${n}" has been moved to ${s.name}
62
+ `)}catch{}return{key:o.api_key,source:"config",profile:n,permission:o.permission}}}return null}async function q0(e,t,r){let i=t||"default",n=fe(i);if(n)throw new Error(n);let o=await gt();if(!o.isSecure)return{configPath:vc(e,i,r),backend:o};await o.set(ht,i,e);let a=we()||{active_profile:"default",profiles:{}};return a.storage="secure_storage",a.profiles[i]={...r&&{permission:r}},Object.keys(a.profiles).length===1&&(a.active_profile=i),{configPath:Cr(a),backend:o}}async function Ba(e){let t=we(),r=e||process.env.RESEND_PROFILE||process.env.RESEND_TEAM||t?.active_profile||"default";if(t?.storage==="secure_storage"){let i=await gt();i.isSecure&&await i.delete(ht,r)}return _c(r)}async function R0(){let e=we(),t=er();if(e?.storage==="secure_storage"){let r=await gt();r.isSecure&&await Promise.all(Object.keys(e.profiles).map(i=>r.delete(ht,i)))}return(0,Ie.existsSync)(t)&&(0,Ie.unlinkSync)(t),t}async function Ha(e,t){if(we()?.storage==="secure_storage"){let i=await gt();if(i.isSecure){let n=await i.get(ht,e);n&&(await i.set(ht,t,n),await i.delete(ht,e))}}px(e,t)}var Ie,$0,ii,yr,De=H(()=>{"use strict";Ie=require("node:fs"),$0=require("node:os"),ii=require("node:path");xc();yr=`Sending-only keys work with: emails send, emails batch, broadcasts send.
63
+ Create a full access key at https://resend.com/api-keys`});function O(){return!(!process.stdin.isTTY||!process.stdout.isTTY||process.env.CI==="true"||process.env.CI==="1"||process.env.GITHUB_ACTIONS||process.env.TERM==="dumb")}var bt,ee=H(()=>{"use strict";bt=process.platform!=="win32"||!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"});function y_(){return(0,__.join)(at(),"update-state.json")}function $x(){try{return JSON.parse((0,Ir.readFileSync)(y_(),"utf-8"))}catch{return null}}function qx(e){(0,Ir.mkdirSync)(at(),{recursive:!0,mode:448}),(0,Ir.writeFileSync)(y_(),JSON.stringify(e),{mode:384})}function ru(e,t){let r=l=>l.replace(/^v/,"").split(".").map(Number),[i,n,o]=r(e),[s,a,u]=r(t);return s!==i?s>i:a!==n?a>n:u>o}async function Fc(){try{let e=await fetch(Rc,{headers:{Accept:"application/vnd.github.v3+json"},signal:AbortSignal.timeout(5e3)});if(!e.ok)return null;let t=await e.json();if(t.prerelease||t.draft)return null;let r=t.tag_name?.replace(/^v/,"");return!r||!/^\d+\.\d+\.\d+$/.test(r)?null:r}catch{return null}}function Rx(e){return!!(e?.json||process.env.RESEND_NO_UPDATE_NOTIFIER==="1"||process.env.CI==="true"||process.env.CI==="1"||process.env.GITHUB_ACTIONS||!process.stdout.isTTY)}function C_(){let e=iu();return e.startsWith("npm")?"npm":e.startsWith("brew")?"homebrew":e.startsWith("curl")||e.startsWith("irm")?"install-script":"manual"}function iu(){let e=process.execPath||process.argv[0]||"",t=process.argv[1]||"";return process.env.npm_execpath||/node_modules/.test(t)||/node_modules/.test(e)?"npm install -g resend-cli":/\/(Cellar|homebrew)\//i.test(e)?"brew update && brew upgrade resend":/[/\\]\.resend[/\\]bin[/\\]/.test(e)?process.platform==="win32"?"irm https://resend.com/install.ps1 | iex":"curl -fsSL https://resend.com/install.sh | bash":"https://github.com/resend/resend-cli/releases/latest"}function v_(e){let t=iu(),r=t.startsWith("http"),i="\x1B[2m",n="\x1B[33m",o="\x1B[36m",s="\x1B[0m",a=["",`${i}Update available: ${n}v${se}${s}${i} \u2192 ${o}v${e}${s}`,`${i}${r?"Visit":"Run"}: ${o}${t}${s}`];return process.platform==="win32"&&a.push(`${i}Or download from: ${o}https://github.com/resend/resend-cli/releases/latest${s}`),a.push(""),a.join(`
64
+ `)}async function O_(e){if(Rx(e))return;let t=$x(),r=Date.now();if(t&&r-t.lastChecked<jx){ru(se,t.latestVersion)&&process.stderr.write(v_(t.latestVersion));return}let i=await Fc();i&&(qx({lastChecked:r,latestVersion:i}),ru(se,i)&&process.stderr.write(v_(i)))}var Ir,__,jx,Rc,ui=H(()=>{"use strict";Ir=require("node:fs"),__=require("node:path");De();Ft();jx=3600*1e3,Rc="https://api.github.com/repos/resend/resend-cli/releases/latest"});var r2={};or(r2,{flushFromFile:()=>ow,flushPayload:()=>t2,getOrCreateAnonymousId:()=>e2,isDisabled:()=>Xy,trackCommand:()=>Hc});function iw(){return rw[process.platform]??process.platform}function Xy(){return!Zy||process.env.DO_NOT_TRACK==="1"||process.env.RESEND_TELEMETRY_DISABLED==="1"}function e2(){let e=at(),t=(0,mt.join)(e,"telemetry-id");try{let i=(0,L.readFileSync)(t,"utf-8").trim();if(i)return i}catch{}let r=crypto.randomUUID();return(0,L.mkdirSync)(e,{recursive:!0,mode:448}),(0,L.writeFileSync)(t,r,{mode:384}),r}function nw(e){if(!e)return;let t=at(),r=(0,mt.join)(t,"telemetry-notice-shown");(0,L.existsSync)(r)||((0,L.mkdirSync)(t,{recursive:!0,mode:448}),(0,L.writeFileSync)(r,"",{mode:384}),process.stderr.write(`
65
65
  Resend collects anonymous CLI usage data to improve the tool.
66
66
  To opt out: export RESEND_TELEMETRY_DISABLED=1
67
67
 
68
- `))}function Zc(e,t){if(!dy())try{let r=k()&&!t.json;jw(r);let i=my(),n={command:e,cli_version:se,os:Tw(),node_version:process.version,interactive:r,install_method:D_()};t.flags?.length&&(n.flags=t.flags),t.globalFlags?.length&&(n.global_flags=t.globalFlags);let o=JSON.stringify({api_key:cy,distinct_id:i,event:"cli.used",properties:n}),s=(0,dt.join)((0,Qc.tmpdir)(),`resend-telemetry-${crypto.randomUUID()}.json`),a=(0,L.openSync)(s,L.constants.O_CREAT|L.constants.O_EXCL|L.constants.O_WRONLY|(L.constants.O_NOFOLLOW??0),384);try{(0,L.writeFileSync)(a,o)}finally{(0,L.closeSync)(a)}let u="pkg"in process,l=u?["telemetry","flush",s]:process.execArgv.concat([process.argv[1],"telemetry","flush",s]);(0,ly.spawn)(process.execPath,l,{detached:!0,stdio:"ignore",env:{...process.env,RESEND_TELEMETRY_DISABLED:"1",...u?{PKG_EXECPATH:""}:{}}}).unref()}catch{}}async function py(e){JSON.parse(e);let t=await fetch(Ew,{method:"POST",headers:{"Content-Type":"application/json"},body:e,signal:AbortSignal.timeout(3e3)});if(!t.ok)throw new Error(`telemetry flush failed: ${t.status}`)}async function Iw(e){let t=(0,dt.join)(e),r=(0,Qc.tmpdir)(),i=(0,dt.basename)(t);if((0,dt.dirname)(t)!==r||!/resend-telemetry-.*\.json$/.test(i)||(0,L.realpathSync)((0,dt.dirname)(t))!==(0,L.realpathSync)(r))throw new Error("invalid telemetry flush path");let n=(0,L.openSync)(t,L.constants.O_RDONLY|L.constants.O_NOFOLLOW),o;try{if(!(0,L.fstatSync)(n).isFile())throw new Error("invalid telemetry flush path");o=(0,L.readFileSync)(n,"utf-8")}finally{(0,L.closeSync)(n)}await py(o),(0,L.unlinkSync)(t)}var ly,L,Qc,dt,cy,Ew,Pw,Xc=B(()=>{"use strict";ly=require("node:child_process"),L=require("node:fs"),Qc=require("node:os"),dt=require("node:path");je();ee();ui();zt();cy="phc_AgEBpcQTRsBl3UgQX2U8XvimTlgdXG6YEhfvJl2cUfc",Ew="https://us.i.posthog.com/capture/",Pw={darwin:"macOS",win32:"Windows",linux:"Linux"}});var gd=le(hd(),1),{program:Fw,createCommand:Bw,createArgument:Nw,createOption:Lw,CommanderError:Gw,InvalidArgumentError:Uw,InvalidOptionArgumentError:Ww,Command:p,Argument:bd,Option:ce,Help:Vw}=gd.default;var qr=le(vt(),1);var Ny=`Global options:
68
+ `))}function Hc(e,t){if(!Xy())try{let r=O()&&!t.json;nw(r);let i=e2(),n={command:e,cli_version:se,os:iw(),node_version:process.version,interactive:r,install_method:C_()};t.flags?.length&&(n.flags=t.flags),t.globalFlags?.length&&(n.global_flags=t.globalFlags);let o=JSON.stringify({api_key:Zy,distinct_id:i,event:"cli.used",properties:n}),s=(0,mt.join)((0,Bc.tmpdir)(),`resend-telemetry-${crypto.randomUUID()}.json`),a=(0,L.openSync)(s,L.constants.O_CREAT|L.constants.O_EXCL|L.constants.O_WRONLY|(L.constants.O_NOFOLLOW??0),384);try{(0,L.writeFileSync)(a,o)}finally{(0,L.closeSync)(a)}let u="pkg"in process,l=u?["telemetry","flush",s]:process.execArgv.concat([process.argv[1],"telemetry","flush",s]);(0,Qy.spawn)(process.execPath,l,{detached:!0,stdio:"ignore",env:{...process.env,RESEND_TELEMETRY_DISABLED:"1",...u?{PKG_EXECPATH:""}:{}}}).unref()}catch{}}async function t2(e){JSON.parse(e);let t=await fetch(tw,{method:"POST",headers:{"Content-Type":"application/json"},body:e,signal:AbortSignal.timeout(3e3)});if(!t.ok)throw new Error(`telemetry flush failed: ${t.status}`)}async function ow(e){let t=(0,mt.join)(e),r=(0,Bc.tmpdir)(),i=(0,mt.basename)(t);if((0,mt.dirname)(t)!==r||!/resend-telemetry-.*\.json$/.test(i)||(0,L.realpathSync)((0,mt.dirname)(t))!==(0,L.realpathSync)(r))throw new Error("invalid telemetry flush path");let n=(0,L.openSync)(t,L.constants.O_RDONLY|L.constants.O_NOFOLLOW),o;try{if(!(0,L.fstatSync)(n).isFile())throw new Error("invalid telemetry flush path");o=(0,L.readFileSync)(n,"utf-8")}finally{(0,L.closeSync)(n)}await t2(o),(0,L.unlinkSync)(t)}var Qy,L,Bc,mt,Zy,tw,rw,Nc=H(()=>{"use strict";Qy=require("node:child_process"),L=require("node:fs"),Bc=require("node:os"),mt=require("node:path");De();ee();ui();Ft();Zy="phc_AgEBpcQTRsBl3UgQX2U8XvimTlgdXG6YEhfvJl2cUfc",tw="https://us.i.posthog.com/capture/",rw={darwin:"macOS",win32:"Windows",linux:"Linux"}});var sd=le(od(),1),{program:fw,createCommand:hw,createArgument:gw,createOption:bw,CommanderError:vw,InvalidArgumentError:_w,InvalidOptionArgumentError:yw,Command:p,Argument:ad,Option:ce,Help:Cw}=sd.default;var Rr=le(_t(),1);var D2=`Global options:
69
69
  --api-key <key> API key (or set RESEND_API_KEY env var)
70
70
  -p, --profile <name> Profile to use (overrides RESEND_PROFILE)
71
71
  --json Force JSON output (also auto-enabled when stdout is piped)
72
- -q, --quiet Suppress spinners and status output (implies --json)`,Ly=`Global options:
72
+ -q, --quiet Suppress spinners and status output (implies --json)`,I2=`Global options:
73
73
  -p, --profile <name> Profile to use
74
74
  --json Force JSON output
75
- -q, --quiet Suppress spinners and status output (implies --json)`,Gy=' {"error":{"message":"<message>","code":"<code>"}}';function h(e){let t=[];return e.context!=null&&t.push(e.context),t.push(e.setup?Ly:Ny),e.output!=null&&t.push(`Output (--json or piped):
75
+ -q, --quiet Suppress spinners and status output (implies --json)`,j2=' {"error":{"message":"<message>","code":"<code>"}}';function h(e){let t=[];return e.context!=null&&t.push(e.context),t.push(e.setup?I2:D2),e.output!=null&&t.push(`Output (--json or piped):
76
76
  ${e.output}`),e.errorCodes!=null&&t.push(`Errors (exit code 1, JSON on stderr when using --json or non-TTY):
77
- ${Gy}
77
+ ${j2}
78
78
  Codes: ${e.errorCodes.join(" | ")}`),t.push(`Examples:
79
79
  ${e.examples.map(r=>` $ ${r}`).join(`
80
80
  `)}`),`
81
81
  ${t.join(`
82
82
 
83
- `)}`}var yi=require("node:util"),Mr=require("node:process");var xd=le(require("node:readline"),1),Ne=le(Tu(),1);function $t(e,t,r){if(!r.some(s=>!s.disabled))return e;let i=e+t,n=Math.max(r.length-1,0),o=i<0?n:i>n?0:i;return r[o].disabled?$t(o,t<0?-1:1,r):o}var Vy=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,Ky=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Yy=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,ju=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,gi=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,bi=/\t{1,1000}/y,Iu=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,vi=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Qy=/\p{M}+/gu,Zy={limit:1/0,ellipsis:""},wd=(e,t={},r={})=>{let i=t.limit??1/0,n=t.ellipsis??"",o=t?.ellipsisWidth??(n?wd(n,Zy,r).width:0),s=r.ansiWidth??0,a=r.controlWidth??0,u=r.tabWidth??8,l=r.ambiguousWidth??1,d=r.emojiWidth??2,c=r.fullWidthWidth??2,m=r.regularWidth??1,_=r.wideWidth??2,g=0,b=0,O=e.length,x=0,S=!1,A=O,T=Math.max(0,i-o),P=0,I=0,w=0,E=0;e:for(;;){if(I>P||b>=O&&b>g){let W=e.slice(P,I)||e.slice(g,b);x=0;for(let be of W.replaceAll(Qy,"")){let we=be.codePointAt(0)||0;if(Ky(we)?E=c:Yy(we)?E=_:l!==m&&Vy(we)?E=l:E=m,w+E>T&&(A=Math.min(A,Math.max(P,g)+x)),w+E>i){S=!0;break e}x+=be.length,w+=E}P=I=0}if(b>=O)break;if(vi.lastIndex=b,vi.test(e)){if(x=vi.lastIndex-b,E=x*m,w+E>T&&(A=Math.min(A,b+Math.floor((T-w)/m))),w+E>i){S=!0;break}w+=E,P=g,I=b,b=g=vi.lastIndex;continue}if(ju.lastIndex=b,ju.test(e)){if(w+s>T&&(A=Math.min(A,b)),w+s>i){S=!0;break}w+=s,P=g,I=b,b=g=ju.lastIndex;continue}if(gi.lastIndex=b,gi.test(e)){if(x=gi.lastIndex-b,E=x*a,w+E>T&&(A=Math.min(A,b+Math.floor((T-w)/a))),w+E>i){S=!0;break}w+=E,P=g,I=b,b=g=gi.lastIndex;continue}if(bi.lastIndex=b,bi.test(e)){if(x=bi.lastIndex-b,E=x*u,w+E>T&&(A=Math.min(A,b+Math.floor((T-w)/u))),w+E>i){S=!0;break}w+=E,P=g,I=b,b=g=bi.lastIndex;continue}if(Iu.lastIndex=b,Iu.test(e)){if(w+d>T&&(A=Math.min(A,b)),w+d>i){S=!0;break}w+=d,P=g,I=b,b=g=Iu.lastIndex;continue}b+=1}return{width:S?T:w,index:S?A:O,truncated:S,ellipsed:S&&i>=o}},Xy={limit:1/0,ellipsis:"",ellipsisWidth:0},zr=(e,t={})=>wd(e,Xy,t).width,wi="\x1B",kd="\x9B",e1=39,Ru="\x07",Ad="[",t1="]",Ed="m",zu=`${t1}8;;`,Cd=new RegExp(`(?:\\${Ad}(?<code>\\d+)m|\\${zu}(?<uri>.*)${Ru})`,"y"),r1=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Od=e=>`${wi}${Ad}${e}${Ed}`,Sd=e=>`${wi}${zu}${e}${Ru}`,i1=e=>e.map(t=>zr(t)),Du=(e,t,r)=>{let i=t[Symbol.iterator](),n=!1,o=!1,s=e.at(-1),a=s===void 0?0:zr(s),u=i.next(),l=i.next(),d=0;for(;!u.done;){let c=u.value,m=zr(c);a+m<=r?e[e.length-1]+=c:(e.push(c),a=0),(c===wi||c===kd)&&(n=!0,o=t.startsWith(zu,d+1)),n?o?c===Ru&&(n=!1,o=!1):c===Ed&&(n=!1):(a+=m,a===r&&!l.done&&(e.push(""),a=0)),u=l,l=i.next(),d+=c.length}s=e.at(-1),!a&&s!==void 0&&s.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},n1=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(zr(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},o1=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,o,s=e.split(" "),a=i1(s),u=[""];for(let[g,b]of s.entries()){r.trim!==!1&&(u[u.length-1]=(u.at(-1)??"").trimStart());let O=zr(u.at(-1)??"");if(g!==0&&(O>=t&&(r.wordWrap===!1||r.trim===!1)&&(u.push(""),O=0),(O>0||r.trim===!1)&&(u[u.length-1]+=" ",O++)),r.hard&&a[g]>t){let x=t-O,S=1+Math.floor((a[g]-x-1)/t);Math.floor((a[g]-1)/t)<S&&u.push(""),Du(u,b,t);continue}if(O+a[g]>t&&O>0&&a[g]>0){if(r.wordWrap===!1&&O<t){Du(u,b,t);continue}u.push("")}if(O+a[g]>t&&r.wordWrap===!1){Du(u,b,t);continue}u[u.length-1]+=b}r.trim!==!1&&(u=u.map(g=>n1(g)));let l=u.join(`
84
- `),d=l[Symbol.iterator](),c=d.next(),m=d.next(),_=0;for(;!c.done;){let g=c.value,b=m.value;if(i+=g,g===wi||g===kd){Cd.lastIndex=_+1;let x=Cd.exec(l)?.groups;if(x?.code!==void 0){let S=Number.parseFloat(x.code);n=S===e1?void 0:S}else x?.uri!==void 0&&(o=x.uri.length===0?void 0:x.uri)}let O=n?r1(n):void 0;b===`
85
- `?(o&&(i+=Sd("")),n&&O&&(i+=Od(O))):g===`
86
- `&&(n&&O&&(i+=Od(n)),o&&(i+=Sd(o))),_+=g.length,c=m,m=d.next()}return i};function $u(e,t,r){return String(e).normalize().replaceAll(`\r
87
- `,`
88
- `).split(`
89
- `).map(i=>o1(i,t,r)).join(`
90
- `)}var s1=["up","down","left","right","space","enter","cancel"],$e={actions:new Set(s1),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function Pd(e,t){if(typeof e=="string")return $e.aliases.get(e)===t;for(let r of e)if(r!==void 0&&Pd(r,t))return!0;return!1}function a1(e,t){if(e===t)return;let r=e.split(`
83
+ `)}`}var Ci=require("node:util"),zr=require("node:process");var Sd=le(require("node:readline"),1);var cd=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,dd=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,md=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141;var wu=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,gi=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,bi=/\t{1,1000}/y,ku=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,vi=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,$2=/\p{M}+/gu,q2={limit:1/0,ellipsis:""},pd=(e,t={},r={})=>{let i=t.limit??1/0,n=t.ellipsis??"",o=t?.ellipsisWidth??(n?pd(n,q2,r).width:0),s=r.ansiWidth??0,a=r.controlWidth??0,u=r.tabWidth??8,l=r.ambiguousWidth??1,c=r.emojiWidth??2,d=r.fullWidthWidth??2,m=r.regularWidth??1,b=r.wideWidth??2,v=0,_=0,x=e.length,w=0,S=!1,A=x,I=Math.max(0,i-o),E=0,j=0,k=0,D=0;e:for(;;){if(j>E||_>=x&&_>v){let Q=e.slice(E,j)||e.slice(v,_);w=0;for(let Ee of Q.replaceAll($2,"")){let Be=Ee.codePointAt(0)||0;if(dd(Be)?D=d:md(Be)?D=b:l!==m&&cd(Be)?D=l:D=m,k+D>I&&(A=Math.min(A,Math.max(E,v)+w)),k+D>i){S=!0;break e}w+=Ee.length,k+=D}E=j=0}if(_>=x)break;if(vi.lastIndex=_,vi.test(e)){if(w=vi.lastIndex-_,D=w*m,k+D>I&&(A=Math.min(A,_+Math.floor((I-k)/m))),k+D>i){S=!0;break}k+=D,E=v,j=_,_=v=vi.lastIndex;continue}if(wu.lastIndex=_,wu.test(e)){if(k+s>I&&(A=Math.min(A,_)),k+s>i){S=!0;break}k+=s,E=v,j=_,_=v=wu.lastIndex;continue}if(gi.lastIndex=_,gi.test(e)){if(w=gi.lastIndex-_,D=w*a,k+D>I&&(A=Math.min(A,_+Math.floor((I-k)/a))),k+D>i){S=!0;break}k+=D,E=v,j=_,_=v=gi.lastIndex;continue}if(bi.lastIndex=_,bi.test(e)){if(w=bi.lastIndex-_,D=w*u,k+D>I&&(A=Math.min(A,_+Math.floor((I-k)/u))),k+D>i){S=!0;break}k+=D,E=v,j=_,_=v=bi.lastIndex;continue}if(ku.lastIndex=_,ku.test(e)){if(k+c>I&&(A=Math.min(A,_)),k+c>i){S=!0;break}k+=c,E=v,j=_,_=v=ku.lastIndex;continue}_+=1}return{width:S?I:k,index:S?A:x,truncated:S,ellipsed:S&&i>=o}},fd=pd;var R2={limit:1/0,ellipsis:"",ellipsisWidth:0},F2=(e,t={})=>fd(e,R2,t).width,nt=F2;var _i="\x1B",_d="\x9B",z2=39,Eu="\x07",yd="[",M2="]",Cd="m",Pu=`${M2}8;;`,hd=new RegExp(`(?:\\${yd}(?<code>\\d+)m|\\${Pu}(?<uri>.*)${Eu})`,"y"),gd=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},bd=e=>`${_i}${yd}${e}${Cd}`,vd=e=>`${_i}${Pu}${e}${Eu}`,Au=(e,t,r)=>{let i=t[Symbol.iterator](),n=!1,o=!1,s=e.at(-1),a=s===void 0?0:nt(s),u=i.next(),l=i.next(),c=0;for(;!u.done;){let d=u.value,m=nt(d);a+m<=r?e[e.length-1]+=d:(e.push(d),a=0),(d===_i||d===_d)&&(n=!0,o=t.startsWith(Pu,c+1)),n?o?d===Eu&&(n=!1,o=!1):d===Cd&&(n=!1):(a+=m,a===r&&!l.done&&(e.push(""),a=0)),u=l,l=i.next(),c+=d.length}s=e.at(-1),!a&&s!==void 0&&s.length&&e.length>1&&(e[e.length-2]+=e.pop())},J2=e=>{let t=e.split(" "),r=t.length;for(;r&&!nt(t[r-1]);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},B2=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,o,s=e.split(" "),a=[""],u=0;for(let d=0;d<s.length;d++){let m=s[d];if(r.trim!==!1){let v=a.at(-1)??"",_=v.trimStart();v.length!==_.length&&(a[a.length-1]=_,u=nt(_))}d!==0&&(u>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),u=0),(u||r.trim===!1)&&(a[a.length-1]+=" ",u++));let b=nt(m);if(r.hard&&b>t){let v=t-u,_=1+Math.floor((b-v-1)/t);Math.floor((b-1)/t)<_&&a.push(""),Au(a,m,t),u=nt(a.at(-1)??"");continue}if(u+b>t&&u&&b){if(r.wordWrap===!1&&u<t){Au(a,m,t),u=nt(a.at(-1)??"");continue}a.push(""),u=0}if(u+b>t&&r.wordWrap===!1){Au(a,m,t),u=nt(a.at(-1)??"");continue}a[a.length-1]+=m,u+=b}r.trim!==!1&&(a=a.map(d=>J2(d)));let l=a.join(`
84
+ `),c=!1;for(let d=0;d<l.length;d++){let m=l[d];if(i+=m,!c)c=m>="\uD800"&&m<="\uDBFF";else continue;if(m===_i||m===_d){hd.lastIndex=d+1;let v=hd.exec(l)?.groups;if(v?.code!==void 0){let _=Number.parseFloat(v.code);n=_===z2?void 0:_}else v?.uri!==void 0&&(o=v.uri.length===0?void 0:v.uri)}if(l[d+1]===`
85
+ `){o&&(i+=vd(""));let b=n?gd(n):void 0;n&&b&&(i+=bd(b))}else m===`
86
+ `&&(n&&gd(n)&&(i+=bd(n)),o&&(i+=vd(o)))}return i},H2=/\r?\n/;function sr(e,t,r){return String(e).normalize().split(H2).map(i=>B2(i,t,r)).join(`
87
+ `)}var Ne=le(Du(),1);function Rt(e,t,r){if(!r.some(s=>!s.disabled))return e;let i=e+t,n=Math.max(r.length-1,0),o=i<0?n:i>n?0:i;return r[o].disabled?Rt(o,t<0?-1:1,r):o}var G2=["up","down","left","right","space","enter","cancel"],U2=["January","February","March","April","May","June","July","August","September","October","November","December"],Pe={actions:new Set(G2),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...U2],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function xd(e,t){if(typeof e=="string")return Pe.aliases.get(e)===t;for(let r of e)if(r!==void 0&&xd(r,t))return!0;return!1}function W2(e,t){if(e===t)return;let r=e.split(`
91
88
  `),i=t.split(`
92
- `),n=Math.max(r.length,i.length),o=[];for(let s=0;s<n;s++)r[s]!==i[s]&&o.push(s);return{lines:o,numLinesBefore:r.length,numLinesAfter:i.length,numLines:n}}var Xw=globalThis.process.platform.startsWith("win"),qu=Symbol("clack:cancel");function j(e){return e===qu}function _i(e,t){let r=e;r.isTTY&&r.setRawMode(t)}var Mu=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,Ju=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function Rt(e,t,r,i=r){let n=Mu(e??Mr.stdout);return $u(t,n-r.length,{hard:!0,trim:!1}).split(`
89
+ `),n=Math.max(r.length,i.length),o=[];for(let s=0;s<n;s++)r[s]!==i[s]&&o.push(s);return{lines:o,numLinesBefore:r.length,numLinesAfter:i.length,numLines:n}}var $w=globalThis.process.platform.startsWith("win"),Iu=Symbol("clack:cancel");function P(e){return e===Iu}function yi(e,t){let r=e;r.isTTY&&r.setRawMode(t)}var ju=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,$u=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function yt(e,t,r,i=r){let n=ju(e??zr.stdout);return sr(t,n-r.length,{hard:!0,trim:!1}).split(`
93
90
  `).map((o,s)=>`${s===0?i:r}${o}`).join(`
94
- `)}var qt=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(t,r=!0){let{input:i=Mr.stdin,output:n=Mr.stdout,render:o,signal:s,...a}=t;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=r,this._abortSignal=s,this.input=i,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(t,r){let i=this._subscribers.get(t)??[];i.push(r),this._subscribers.set(t,i)}on(t,r){this.setSubscriber(t,{cb:r})}once(t,r){this.setSubscriber(t,{cb:r,once:!0})}emit(t,...r){let i=this._subscribers.get(t)??[],n=[];for(let o of i)o.cb(...r),o.once&&n.push(()=>i.splice(i.indexOf(o),1));for(let o of n)o()}prompt(){return new Promise(t=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(qu);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=xd.default.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),_i(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Ne.cursor.show),this.output.off("resize",this.render),_i(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(Ne.cursor.show),this.output.off("resize",this.render),_i(this.input,!1),t(qu)})})}_isActionKey(t,r){return t===" "}_setValue(t){this.value=t,this.emit("value",this.value)}_setUserInput(t,r){this.userInput=t??"",this.emit("userInput",this.userInput),r&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(t,r){if(this._track&&r.name!=="return"&&(r.name&&this._isActionKey(t,r)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&$e.aliases.has(r.name)&&this.emit("cursor",$e.aliases.get(r.name)),$e.actions.has(r.name)&&this.emit("cursor",r.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),this.emit("key",t?.toLowerCase(),r),r?.name==="return"){if(this.opts.validate){let i=this.opts.validate(this.value);i&&(this.error=i instanceof Error?i.message:i,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}Pd([t,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
95
- `),_i(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=$u(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
96
- `).length-1;this.output.write(Ne.cursor.move(-999,t*-1))}render(){let t=$u(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(Ne.cursor.hide);else{let r=a1(this._prevFrame,t),i=Ju(this.output);if(this.restoreCursor(),r){let n=Math.max(0,r.numLinesAfter-i),o=Math.max(0,r.numLinesBefore-i),s=r.lines.find(a=>a>=n);if(s===void 0){this._prevFrame=t;return}if(r.lines.length===1){this.output.write(Ne.cursor.move(0,s-o)),this.output.write(Ne.erase.lines(1));let a=t.split(`
97
- `);this.output.write(a[s]),this._prevFrame=t,this.output.write(Ne.cursor.move(0,a.length-s-1));return}else if(r.lines.length>1){if(n<o)s=n;else{let u=s-o;u>0&&this.output.write(Ne.cursor.move(0,u))}this.output.write(Ne.erase.down());let a=t.split(`
98
- `).slice(s);this.output.write(a.join(`
99
- `)),this._prevFrame=t;return}}this.output.write(Ne.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};var Ci=class extends qt{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(Ne.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var Td=class extends qt{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions,t=this.value!==void 0&&this.value.length===e.length;this.value=t?[]:e.map(r=>r.value)}toggleInvert(){let e=this.value;if(!e)return;let t=this._enabledOptions.filter(r=>!e.includes(r.value));this.value=t.map(r=>r.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(t=>t!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let t=Math.max(this.options.findIndex(({value:r})=>r===e.cursorAt),0);this.cursor=this.options[t].disabled?$t(t,1,this.options):t,this.on("key",r=>{r==="a"&&this.toggleAll(),r==="i"&&this.toggleInvert()}),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=$t(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=$t(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},Oi=class extends qt{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${(0,yi.styleText)(["inverse","hidden"],"_")}`;let r=this.masked,i=r.slice(0,this.cursor),n=r.slice(this.cursor);return`${i}${(0,yi.styleText)("inverse",n[0])}${n.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:t,...r}){super(r),this._mask=t??"\u2022",this.on("userInput",i=>{this._setValue(i)})}},Si=class extends qt{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(t){super(t,!1),this.options=t.options;let r=this.options.findIndex(({value:n})=>n===t.initialValue),i=r===-1?0:r;this.cursor=this.options[i].disabled?$t(i,1,this.options):i,this.changeValue(),this.on("cursor",n=>{switch(n){case"left":case"up":this.cursor=$t(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=$t(this.cursor,1,this.options);break}this.changeValue()})}};var xi=class extends qt{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let r=t.slice(0,this.cursor),[i,...n]=t.slice(this.cursor);return`${r}${(0,yi.styleText)("inverse",i)}${n.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}};var y=require("node:util"),We=le(require("node:process"),1);var Rd=le(Tu(),1);function u1(){return We.default.platform!=="win32"?We.default.env.TERM!=="linux":!!We.default.env.CI||!!We.default.env.WT_SESSION||!!We.default.env.TERMINUS_SUBLIME||We.default.env.ConEmuTask==="{cmd::Cmder}"||We.default.env.TERM_PROGRAM==="Terminus-Sublime"||We.default.env.TERM_PROGRAM==="vscode"||We.default.env.TERM==="xterm-256color"||We.default.env.TERM==="alacritty"||We.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var l1=u1();var Z=(e,t)=>l1?e:t,c1=Z("\u25C6","*"),d1=Z("\u25A0","x"),m1=Z("\u25B2","x"),zd=Z("\u25C7","o"),p1=Z("\u250C","T"),R=Z("\u2502","|"),nt=Z("\u2514","\u2014"),uk=Z("\u2510","T"),lk=Z("\u2518","\u2014"),Nu=Z("\u25CF",">"),Ti=Z("\u25CB"," "),f1=Z("\u25FB","[\u2022]"),jd=Z("\u25FC","[+]"),Id=Z("\u25FB","[ ]"),h1=Z("\u25AA","\u2022"),ck=Z("\u2500","-"),dk=Z("\u256E","+"),mk=Z("\u251C","+"),pk=Z("\u256F","+"),fk=Z("\u2570","+"),hk=Z("\u256D","+"),g1=Z("\u25CF","\u2022"),b1=Z("\u25C6","*"),v1=Z("\u25B2","!"),_1=Z("\u25A0","x"),Fr=e=>{switch(e){case"initial":case"active":return(0,y.styleText)("cyan",c1);case"cancel":return(0,y.styleText)("red",d1);case"error":return(0,y.styleText)("yellow",m1);case"submit":return(0,y.styleText)("green",zd)}},Md=e=>{switch(e){case"initial":case"active":return(0,y.styleText)("cyan",R);case"cancel":return(0,y.styleText)("red",R);case"error":return(0,y.styleText)("yellow",R);case"submit":return(0,y.styleText)("green",R)}},y1=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,C1=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,O1=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,Hu=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,ki=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ai=/\t{1,1000}/y,Fu=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Ei=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,S1=/\p{M}+/gu,x1={limit:1/0,ellipsis:""},Jd=(e,t={},r={})=>{let i=t.limit??1/0,n=t.ellipsis??"",o=t?.ellipsisWidth??(n?Jd(n,x1,r).width:0),s=r.ansiWidth??0,a=r.controlWidth??0,u=r.tabWidth??8,l=r.ambiguousWidth??1,d=r.emojiWidth??2,c=r.fullWidthWidth??2,m=r.regularWidth??1,_=r.wideWidth??2,g=0,b=0,O=e.length,x=0,S=!1,A=O,T=Math.max(0,i-o),P=0,I=0,w=0,E=0;e:for(;;){if(I>P||b>=O&&b>g){let W=e.slice(P,I)||e.slice(g,b);x=0;for(let be of W.replaceAll(S1,"")){let we=be.codePointAt(0)||0;if(C1(we)?E=c:O1(we)?E=_:l!==m&&y1(we)?E=l:E=m,w+E>T&&(A=Math.min(A,Math.max(P,g)+x)),w+E>i){S=!0;break e}x+=be.length,w+=E}P=I=0}if(b>=O)break;if(Ei.lastIndex=b,Ei.test(e)){if(x=Ei.lastIndex-b,E=x*m,w+E>T&&(A=Math.min(A,b+Math.floor((T-w)/m))),w+E>i){S=!0;break}w+=E,P=g,I=b,b=g=Ei.lastIndex;continue}if(Hu.lastIndex=b,Hu.test(e)){if(w+s>T&&(A=Math.min(A,b)),w+s>i){S=!0;break}w+=s,P=g,I=b,b=g=Hu.lastIndex;continue}if(ki.lastIndex=b,ki.test(e)){if(x=ki.lastIndex-b,E=x*a,w+E>T&&(A=Math.min(A,b+Math.floor((T-w)/a))),w+E>i){S=!0;break}w+=E,P=g,I=b,b=g=ki.lastIndex;continue}if(Ai.lastIndex=b,Ai.test(e)){if(x=Ai.lastIndex-b,E=x*u,w+E>T&&(A=Math.min(A,b+Math.floor((T-w)/u))),w+E>i){S=!0;break}w+=E,P=g,I=b,b=g=Ai.lastIndex;continue}if(Fu.lastIndex=b,Fu.test(e)){if(w+d>T&&(A=Math.min(A,b)),w+d>i){S=!0;break}w+=d,P=g,I=b,b=g=Fu.lastIndex;continue}b+=1}return{width:S?T:w,index:S?A:O,truncated:S,ellipsed:S&&i>=o}},w1={limit:1/0,ellipsis:"",ellipsisWidth:0},Hr=(e,t={})=>Jd(e,w1,t).width,ji="\x1B",Hd="\x9B",k1=39,Gu="\x07",Fd="[",A1="]",Bd="m",Uu=`${A1}8;;`,Dd=new RegExp(`(?:\\${Fd}(?<code>\\d+)m|\\${Uu}(?<uri>.*)${Gu})`,"y"),E1=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},$d=e=>`${ji}${Fd}${e}${Bd}`,qd=e=>`${ji}${Uu}${e}${Gu}`,P1=e=>e.map(t=>Hr(t)),Bu=(e,t,r)=>{let i=t[Symbol.iterator](),n=!1,o=!1,s=e.at(-1),a=s===void 0?0:Hr(s),u=i.next(),l=i.next(),d=0;for(;!u.done;){let c=u.value,m=Hr(c);a+m<=r?e[e.length-1]+=c:(e.push(c),a=0),(c===ji||c===Hd)&&(n=!0,o=t.startsWith(Uu,d+1)),n?o?c===Gu&&(n=!1,o=!1):c===Bd&&(n=!1):(a+=m,a===r&&!l.done&&(e.push(""),a=0)),u=l,l=i.next(),d+=c.length}s=e.at(-1),!a&&s!==void 0&&s.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},T1=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(Hr(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},j1=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,o,s=e.split(" "),a=P1(s),u=[""];for(let[g,b]of s.entries()){r.trim!==!1&&(u[u.length-1]=(u.at(-1)??"").trimStart());let O=Hr(u.at(-1)??"");if(g!==0&&(O>=t&&(r.wordWrap===!1||r.trim===!1)&&(u.push(""),O=0),(O>0||r.trim===!1)&&(u[u.length-1]+=" ",O++)),r.hard&&a[g]>t){let x=t-O,S=1+Math.floor((a[g]-x-1)/t);Math.floor((a[g]-1)/t)<S&&u.push(""),Bu(u,b,t);continue}if(O+a[g]>t&&O>0&&a[g]>0){if(r.wordWrap===!1&&O<t){Bu(u,b,t);continue}u.push("")}if(O+a[g]>t&&r.wordWrap===!1){Bu(u,b,t);continue}u[u.length-1]+=b}r.trim!==!1&&(u=u.map(g=>T1(g)));let l=u.join(`
100
- `),d=l[Symbol.iterator](),c=d.next(),m=d.next(),_=0;for(;!c.done;){let g=c.value,b=m.value;if(i+=g,g===ji||g===Hd){Dd.lastIndex=_+1;let x=Dd.exec(l)?.groups;if(x?.code!==void 0){let S=Number.parseFloat(x.code);n=S===k1?void 0:S}else x?.uri!==void 0&&(o=x.uri.length===0?void 0:x.uri)}let O=n?E1(n):void 0;b===`
101
- `?(o&&(i+=qd("")),n&&O&&(i+=$d(O))):g===`
102
- `&&(n&&O&&(i+=$d(n)),o&&(i+=qd(o))),_+=g.length,c=m,m=d.next()}return i};function I1(e,t,r){return String(e).normalize().replaceAll(`\r
103
- `,`
104
- `).split(`
105
- `).map(i=>j1(i,t,r)).join(`
106
- `)}var D1=(e,t,r,i,n)=>{let o=t,s=0;for(let a=r;a<i;a++){let u=e[a];if(o=o-u.length,s++,o<=n)break}return{lineCount:o,removals:s}},Lu=({cursor:e,options:t,style:r,output:i=process.stdout,maxItems:n=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:s=4})=>{let a=Mu(i)-o,u=Ju(i),l=(0,y.styleText)("dim","..."),d=Math.max(u-s,0),c=Math.max(Math.min(n,d),5),m=0;e>=c-3&&(m=Math.max(Math.min(e-c+3,t.length-c),0));let _=c<t.length&&m>0,g=c<t.length&&m+c<t.length,b=Math.min(m+c,t.length),O=[],x=0;_&&x++,g&&x++;let S=m+(_?1:0),A=b-(g?1:0);for(let P=S;P<A;P++){let I=I1(r(t[P],P===e),a,{hard:!0,trim:!1}).split(`
107
- `);O.push(I),x+=I.length}if(x>d){let P=0,I=0,w=x,E=e-S,W=(be,we)=>D1(O,w,be,we,d);_?({lineCount:w,removals:P}=W(0,E),w>d&&({lineCount:w,removals:I}=W(E+1,O.length))):({lineCount:w,removals:I}=W(E+1,O.length),w>d&&({lineCount:w,removals:P}=W(0,E))),P>0&&(_=!0,O.splice(0,P)),I>0&&(g=!0,O.splice(O.length-I,I))}let T=[];_&&T.push(l);for(let P of O)for(let I of P)T.push(I);return g&&T.push(l),T};var _t=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new Ci({active:t,inactive:r,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let i=e.withGuide??$e.withGuide,n=`${i?`${(0,y.styleText)("gray",R)}
108
- `:""}${Fr(this.state)} ${e.message}
109
- `,o=this.value?t:r;switch(this.state){case"submit":{let s=i?`${(0,y.styleText)("gray",R)} `:"";return`${n}${s}${(0,y.styleText)("dim",o)}`}case"cancel":{let s=i?`${(0,y.styleText)("gray",R)} `:"";return`${n}${s}${(0,y.styleText)(["strikethrough","dim"],o)}${i?`
110
- ${(0,y.styleText)("gray",R)}`:""}`}default:{let s=i?`${(0,y.styleText)("cyan",R)} `:"",a=i?(0,y.styleText)("cyan",nt):"";return`${n}${s}${this.value?`${(0,y.styleText)("green",Nu)} ${t}`:`${(0,y.styleText)("dim",Ti)} ${(0,y.styleText)("dim",t)}`}${e.vertical?i?`
111
- ${(0,y.styleText)("cyan",R)} `:`
112
- `:` ${(0,y.styleText)("dim","/")} `}${this.value?`${(0,y.styleText)("dim",Ti)} ${(0,y.styleText)("dim",r)}`:`${(0,y.styleText)("green",Nu)} ${r}`}
113
- ${a}
114
- `}}}}).prompt()},Nd=async(e,t)=>{let r={},i=Object.keys(e);for(let n of i){let o=e[n],s=await o({results:r})?.catch(a=>{throw a});if(typeof t?.onCancel=="function"&&j(s)){r[n]="canceled",t.onCancel({results:r});continue}r[n]=s}return r};var ie={message:(e=[],{symbol:t=(0,y.styleText)("gray",R),secondarySymbol:r=(0,y.styleText)("gray",R),output:i=process.stdout,spacing:n=1,withGuide:o}={})=>{let s=[],a=o??$e.withGuide,u=a?r:"",l=a?`${t} `:"",d=a?`${r} `:"";for(let m=0;m<n;m++)s.push(u);let c=Array.isArray(e)?e:e.split(`
115
- `);if(c.length>0){let[m,..._]=c;m.length>0?s.push(`${l}${m}`):s.push(a?t:"");for(let g of _)g.length>0?s.push(`${d}${g}`):s.push(a?r:"")}i.write(`${s.join(`
91
+ `)}var Mr=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,t=!0){let{input:r=zr.stdin,output:i=zr.stdout,render:n,signal:o,...s}=e;this.opts=s,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=n.bind(this),this._track=t,this._abortSignal=o,this.input=r,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let r=this._subscribers.get(e)??[];r.push(t),this._subscribers.set(e,r)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let r=this._subscribers.get(e)??[],i=[];for(let n of r)n.cb(...t),n.once&&i.push(()=>r.splice(r.indexOf(n),1));for(let n of i)n()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Iu);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=Sd.default.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),yi(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Ne.cursor.show),this.output.off("resize",this.render),yi(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(Ne.cursor.show),this.output.off("resize",this.render),yi(this.input,!1),e(Iu)})})}_isActionKey(e,t){return e===" "}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,t){this.userInput=e??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&Pe.aliases.has(t.name)&&this.emit("cursor",Pe.aliases.get(t.name)),Pe.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e?.toLowerCase(),t),t?.name==="return"){if(this.opts.validate){let r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}xd([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
92
+ `),yi(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=sr(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
93
+ `).length-1;this.output.write(Ne.cursor.move(-999,e*-1))}render(){let e=sr(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Ne.cursor.hide);else{let t=W2(this._prevFrame,e),r=$u(this.output);if(this.restoreCursor(),t){let i=Math.max(0,t.numLinesAfter-r),n=Math.max(0,t.numLinesBefore-r),o=t.lines.find(s=>s>=i);if(o===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(Ne.cursor.move(0,o-n)),this.output.write(Ne.erase.lines(1));let s=e.split(`
94
+ `);this.output.write(s[o]),this._prevFrame=e,this.output.write(Ne.cursor.move(0,s.length-o-1));return}else if(t.lines.length>1){if(i<n)o=i;else{let a=o-n;a>0&&this.output.write(Ne.cursor.move(0,a))}this.output.write(Ne.erase.down());let s=e.split(`
95
+ `).slice(o);this.output.write(s.join(`
96
+ `)),this._prevFrame=e;return}}this.output.write(Ne.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var Oi=class extends Mr{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(Ne.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var wd=class extends Mr{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions,t=this.value!==void 0&&this.value.length===e.length;this.value=t?[]:e.map(r=>r.value)}toggleInvert(){let e=this.value;if(!e)return;let t=this._enabledOptions.filter(r=>!e.includes(r.value));this.value=t.map(r=>r.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(t=>t!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let t=Math.max(this.options.findIndex(({value:r})=>r===e.cursorAt),0);this.cursor=this.options[t].disabled?Rt(t,1,this.options):t,this.on("key",r=>{r==="a"&&this.toggleAll(),r==="i"&&this.toggleInvert()}),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=Rt(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Rt(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},Si=class extends Mr{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${(0,Ci.styleText)(["inverse","hidden"],"_")}`;let r=this.masked,i=r.slice(0,this.cursor),n=r.slice(this.cursor);return`${i}${(0,Ci.styleText)("inverse",n[0])}${n.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:t,...r}){super(r),this._mask=t??"\u2022",this.on("userInput",i=>{this._setValue(i)})}},xi=class extends Mr{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(t){super(t,!1),this.options=t.options;let r=this.options.findIndex(({value:n})=>n===t.initialValue),i=r===-1?0:r;this.cursor=this.options[i].disabled?Rt(i,1,this.options):i,this.changeValue(),this.on("cursor",n=>{switch(n){case"left":case"up":this.cursor=Rt(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Rt(this.cursor,1,this.options);break}this.changeValue()})}};var wi=class extends Mr{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let r=t.slice(0,this.cursor),[i,...n]=t.slice(this.cursor);return`${r}${(0,Ci.styleText)("inverse",i)}${n.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}};var y=require("node:util"),We=le(require("node:process"),1);var Ed=le(Du(),1);function V2(){return We.default.platform!=="win32"?We.default.env.TERM!=="linux":!!We.default.env.CI||!!We.default.env.WT_SESSION||!!We.default.env.TERMINUS_SUBLIME||We.default.env.ConEmuTask==="{cmd::Cmder}"||We.default.env.TERM_PROGRAM==="Terminus-Sublime"||We.default.env.TERM_PROGRAM==="vscode"||We.default.env.TERM==="xterm-256color"||We.default.env.TERM==="alacritty"||We.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var K2=V2();var Z=(e,t)=>K2?e:t,Y2=Z("\u25C6","*"),Q2=Z("\u25A0","x"),Z2=Z("\u25B2","x"),Pd=Z("\u25C7","o"),X2=Z("\u250C","T"),$=Z("\u2502","|"),ot=Z("\u2514","\u2014"),Ww=Z("\u2510","T"),Vw=Z("\u2518","\u2014"),qu=Z("\u25CF",">"),Ai=Z("\u25CB"," "),eC=Z("\u25FB","[\u2022]"),kd=Z("\u25FC","[+]"),Ad=Z("\u25FB","[ ]"),tC=Z("\u25AA","\u2022"),Kw=Z("\u2500","-"),Yw=Z("\u256E","+"),Qw=Z("\u251C","+"),Zw=Z("\u256F","+"),Xw=Z("\u2570","+"),ek=Z("\u256D","+"),rC=Z("\u25CF","\u2022"),iC=Z("\u25C6","*"),nC=Z("\u25B2","!"),oC=Z("\u25A0","x"),Br=e=>{switch(e){case"initial":case"active":return(0,y.styleText)("cyan",Y2);case"cancel":return(0,y.styleText)("red",Q2);case"error":return(0,y.styleText)("yellow",Z2);case"submit":return(0,y.styleText)("green",Pd)}},Td=e=>{switch(e){case"initial":case"active":return(0,y.styleText)("cyan",$);case"cancel":return(0,y.styleText)("red",$);case"error":return(0,y.styleText)("yellow",$);case"submit":return(0,y.styleText)("green",$)}},sC=(e,t,r,i,n)=>{let o=t,s=0;for(let a=r;a<i;a++){let u=e[a];if(o=o-u.length,s++,o<=n)break}return{lineCount:o,removals:s}},Ru=({cursor:e,options:t,style:r,output:i=process.stdout,maxItems:n=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:s=4})=>{let a=ju(i)-o,u=$u(i),l=(0,y.styleText)("dim","..."),c=Math.max(u-s,0),d=Math.max(Math.min(n,c),5),m=0;e>=d-3&&(m=Math.max(Math.min(e-d+3,t.length-d),0));let b=d<t.length&&m>0,v=d<t.length&&m+d<t.length,_=Math.min(m+d,t.length),x=[],w=0;b&&w++,v&&w++;let S=m+(b?1:0),A=_-(v?1:0);for(let E=S;E<A;E++){let j=sr(r(t[E],E===e),a,{hard:!0,trim:!1}).split(`
97
+ `);x.push(j),w+=j.length}if(w>c){let E=0,j=0,k=w,D=e-S,Q=(Ee,Be)=>sC(x,k,Ee,Be,c);b?({lineCount:k,removals:E}=Q(0,D),k>c&&({lineCount:k,removals:j}=Q(D+1,x.length))):({lineCount:k,removals:j}=Q(D+1,x.length),k>c&&({lineCount:k,removals:E}=Q(0,D))),E>0&&(b=!0,x.splice(0,E)),j>0&&(v=!0,x.splice(x.length-j,j))}let I=[];b&&I.push(l);for(let E of x)for(let j of E)I.push(j);return v&&I.push(l),I};var Ct=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new Oi({active:t,inactive:r,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let i=e.withGuide??Pe.withGuide,n=`${Br(this.state)} `,o=i?`${(0,y.styleText)("gray",$)} `:"",s=yt(e.output,e.message,o,n),a=`${i?`${(0,y.styleText)("gray",$)}
98
+ `:""}${s}
99
+ `,u=this.value?t:r;switch(this.state){case"submit":{let l=i?`${(0,y.styleText)("gray",$)} `:"";return`${a}${l}${(0,y.styleText)("dim",u)}`}case"cancel":{let l=i?`${(0,y.styleText)("gray",$)} `:"";return`${a}${l}${(0,y.styleText)(["strikethrough","dim"],u)}${i?`
100
+ ${(0,y.styleText)("gray",$)}`:""}`}default:{let l=i?`${(0,y.styleText)("cyan",$)} `:"",c=i?(0,y.styleText)("cyan",ot):"";return`${a}${l}${this.value?`${(0,y.styleText)("green",qu)} ${t}`:`${(0,y.styleText)("dim",Ai)} ${(0,y.styleText)("dim",t)}`}${e.vertical?i?`
101
+ ${(0,y.styleText)("cyan",$)} `:`
102
+ `:` ${(0,y.styleText)("dim","/")} `}${this.value?`${(0,y.styleText)("dim",Ai)} ${(0,y.styleText)("dim",r)}`:`${(0,y.styleText)("green",qu)} ${r}`}
103
+ ${c}
104
+ `}}}}).prompt()};var Dd=async(e,t)=>{let r={},i=Object.keys(e);for(let n of i){let o=e[n],s=await o({results:r})?.catch(a=>{throw a});if(typeof t?.onCancel=="function"&&P(s)){r[n]="canceled",t.onCancel({results:r});continue}r[n]=s}return r};var ie={message:(e=[],{symbol:t=(0,y.styleText)("gray",$),secondarySymbol:r=(0,y.styleText)("gray",$),output:i=process.stdout,spacing:n=1,withGuide:o}={})=>{let s=[],a=o??Pe.withGuide,u=a?r:"",l=a?`${t} `:"",c=a?`${r} `:"";for(let m=0;m<n;m++)s.push(u);let d=Array.isArray(e)?e:e.split(`
105
+ `);if(d.length>0){let[m,...b]=d;m.length>0?s.push(`${l}${m}`):s.push(a?t:"");for(let v of b)v.length>0?s.push(`${c}${v}`):s.push(a?r:"")}i.write(`${s.join(`
116
106
  `)}
117
- `)},info:(e,t)=>{ie.message(e,{...t,symbol:(0,y.styleText)("blue",g1)})},success:(e,t)=>{ie.message(e,{...t,symbol:(0,y.styleText)("green",b1)})},step:(e,t)=>{ie.message(e,{...t,symbol:(0,y.styleText)("green",zd)})},warn:(e,t)=>{ie.message(e,{...t,symbol:(0,y.styleText)("yellow",v1)})},warning:(e,t)=>{ie.warn(e,t)},error:(e,t)=>{ie.message(e,{...t,symbol:(0,y.styleText)("red",_1)})}},Ld=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??$e.withGuide?`${(0,y.styleText)("gray",nt)} `:"";r.write(`${i}${(0,y.styleText)("red",e)}
107
+ `)},info:(e,t)=>{ie.message(e,{...t,symbol:(0,y.styleText)("blue",rC)})},success:(e,t)=>{ie.message(e,{...t,symbol:(0,y.styleText)("green",iC)})},step:(e,t)=>{ie.message(e,{...t,symbol:(0,y.styleText)("green",Pd)})},warn:(e,t)=>{ie.message(e,{...t,symbol:(0,y.styleText)("yellow",nC)})},warning:(e,t)=>{ie.warn(e,t)},error:(e,t)=>{ie.message(e,{...t,symbol:(0,y.styleText)("red",oC)})}},Id=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??Pe.withGuide?`${(0,y.styleText)("gray",ot)} `:"";r.write(`${i}${(0,y.styleText)("red",e)}
118
108
 
119
- `)},Gd=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??$e.withGuide?`${(0,y.styleText)("gray",p1)} `:"";r.write(`${i}${e}
120
- `)},Ii=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??$e.withGuide?`${(0,y.styleText)("gray",R)}
121
- ${(0,y.styleText)("gray",nt)} `:"";r.write(`${i}${e}
109
+ `)},jd=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??Pe.withGuide?`${(0,y.styleText)("gray",X2)} `:"";r.write(`${i}${e}
110
+ `)},Ei=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??Pe.withGuide?`${(0,y.styleText)("gray",$)}
111
+ ${(0,y.styleText)("gray",ot)} `:"";r.write(`${i}${e}
122
112
 
123
113
  `)},Jr=(e,t)=>e.split(`
124
114
  `).map(r=>t(r)).join(`
125
- `),Ud=e=>{let t=(i,n)=>{let o=i.label??String(i.value);return n==="disabled"?`${(0,y.styleText)("gray",Id)} ${Jr(o,s=>(0,y.styleText)(["strikethrough","gray"],s))}${i.hint?` ${(0,y.styleText)("dim",`(${i.hint??"disabled"})`)}`:""}`:n==="active"?`${(0,y.styleText)("cyan",f1)} ${o}${i.hint?` ${(0,y.styleText)("dim",`(${i.hint})`)}`:""}`:n==="selected"?`${(0,y.styleText)("green",jd)} ${Jr(o,s=>(0,y.styleText)("dim",s))}${i.hint?` ${(0,y.styleText)("dim",`(${i.hint})`)}`:""}`:n==="cancelled"?`${Jr(o,s=>(0,y.styleText)(["strikethrough","dim"],s))}`:n==="active-selected"?`${(0,y.styleText)("green",jd)} ${o}${i.hint?` ${(0,y.styleText)("dim",`(${i.hint})`)}`:""}`:n==="submitted"?`${Jr(o,s=>(0,y.styleText)("dim",s))}`:`${(0,y.styleText)("dim",Id)} ${Jr(o,s=>(0,y.styleText)("dim",s))}`},r=e.required??!0;return new Td({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:r,cursorAt:e.cursorAt,validate(i){if(r&&(i===void 0||i.length===0))return`Please select at least one option.
126
- ${(0,y.styleText)("reset",(0,y.styleText)("dim",`Press ${(0,y.styleText)(["gray","bgWhite","inverse"]," space ")} to select, ${(0,y.styleText)("gray",(0,y.styleText)("bgWhite",(0,y.styleText)("inverse"," enter ")))} to submit`))}`},render(){let i=Rt(e.output,e.message,`${Md(this.state)} `,`${Fr(this.state)} `),n=`${(0,y.styleText)("gray",R)}
127
- ${i}
128
- `,o=this.value??[],s=(a,u)=>{if(a.disabled)return t(a,"disabled");let l=o.includes(a.value);return u&&l?t(a,"active-selected"):l?t(a,"selected"):t(a,u?"active":"inactive")};switch(this.state){case"submit":{let a=this.options.filter(({value:l})=>o.includes(l)).map(l=>t(l,"submitted")).join((0,y.styleText)("dim",", "))||(0,y.styleText)("dim","none"),u=Rt(e.output,a,`${(0,y.styleText)("gray",R)} `);return`${n}${u}`}case"cancel":{let a=this.options.filter(({value:l})=>o.includes(l)).map(l=>t(l,"cancelled")).join((0,y.styleText)("dim",", "));if(a.trim()==="")return`${n}${(0,y.styleText)("gray",R)}`;let u=Rt(e.output,a,`${(0,y.styleText)("gray",R)} `);return`${n}${u}
129
- ${(0,y.styleText)("gray",R)}`}case"error":{let a=`${(0,y.styleText)("yellow",R)} `,u=this.error.split(`
130
- `).map((c,m)=>m===0?`${(0,y.styleText)("yellow",nt)} ${(0,y.styleText)("yellow",c)}`:` ${c}`).join(`
131
- `),l=n.split(`
132
- `).length,d=u.split(`
133
- `).length+1;return`${n}${a}${Lu({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:l+d,style:s}).join(`
134
- ${a}`)}
135
- ${u}
136
- `}default:{let a=`${(0,y.styleText)("cyan",R)} `,u=n.split(`
137
- `).length;return`${n}${a}${Lu({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:u+2,style:s}).join(`
138
- ${a}`)}
139
- ${(0,y.styleText)("cyan",nt)}
140
- `}}}}).prompt()};var Wd=e=>new Oi({validate:e.validate,mask:e.mask??h1,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??$e.withGuide,r=`${t?`${(0,y.styleText)("gray",R)}
141
- `:""}${Fr(this.state)} ${e.message}
142
- `,i=this.userInputWithCursor,n=this.masked;switch(this.state){case"error":{let o=t?`${(0,y.styleText)("yellow",R)} `:"",s=t?`${(0,y.styleText)("yellow",nt)} `:"",a=n??"";return e.clearOnError&&this.clear(),`${r.trim()}
115
+ `),$d=e=>{let t=(i,n)=>{let o=i.label??String(i.value);return n==="disabled"?`${(0,y.styleText)("gray",Ad)} ${Jr(o,s=>(0,y.styleText)(["strikethrough","gray"],s))}${i.hint?` ${(0,y.styleText)("dim",`(${i.hint??"disabled"})`)}`:""}`:n==="active"?`${(0,y.styleText)("cyan",eC)} ${o}${i.hint?` ${(0,y.styleText)("dim",`(${i.hint})`)}`:""}`:n==="selected"?`${(0,y.styleText)("green",kd)} ${Jr(o,s=>(0,y.styleText)("dim",s))}${i.hint?` ${(0,y.styleText)("dim",`(${i.hint})`)}`:""}`:n==="cancelled"?`${Jr(o,s=>(0,y.styleText)(["strikethrough","dim"],s))}`:n==="active-selected"?`${(0,y.styleText)("green",kd)} ${o}${i.hint?` ${(0,y.styleText)("dim",`(${i.hint})`)}`:""}`:n==="submitted"?`${Jr(o,s=>(0,y.styleText)("dim",s))}`:`${(0,y.styleText)("dim",Ad)} ${Jr(o,s=>(0,y.styleText)("dim",s))}`},r=e.required??!0;return new wd({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:r,cursorAt:e.cursorAt,validate(i){if(r&&(i===void 0||i.length===0))return`Please select at least one option.
116
+ ${(0,y.styleText)("reset",(0,y.styleText)("dim",`Press ${(0,y.styleText)(["gray","bgWhite","inverse"]," space ")} to select, ${(0,y.styleText)("gray",(0,y.styleText)("bgWhite",(0,y.styleText)("inverse"," enter ")))} to submit`))}`},render(){let i=e.withGuide??Pe.withGuide,n=yt(e.output,e.message,i?`${Td(this.state)} `:"",`${Br(this.state)} `),o=`${i?`${(0,y.styleText)("gray",$)}
117
+ `:""}${n}
118
+ `,s=this.value??[],a=(u,l)=>{if(u.disabled)return t(u,"disabled");let c=s.includes(u.value);return l&&c?t(u,"active-selected"):c?t(u,"selected"):t(u,l?"active":"inactive")};switch(this.state){case"submit":{let u=this.options.filter(({value:c})=>s.includes(c)).map(c=>t(c,"submitted")).join((0,y.styleText)("dim",", "))||(0,y.styleText)("dim","none"),l=yt(e.output,u,i?`${(0,y.styleText)("gray",$)} `:"");return`${o}${l}`}case"cancel":{let u=this.options.filter(({value:c})=>s.includes(c)).map(c=>t(c,"cancelled")).join((0,y.styleText)("dim",", "));if(u.trim()==="")return`${o}${(0,y.styleText)("gray",$)}`;let l=yt(e.output,u,i?`${(0,y.styleText)("gray",$)} `:"");return`${o}${l}${i?`
119
+ ${(0,y.styleText)("gray",$)}`:""}`}case"error":{let u=i?`${(0,y.styleText)("yellow",$)} `:"",l=this.error.split(`
120
+ `).map((m,b)=>b===0?`${i?`${(0,y.styleText)("yellow",ot)} `:""}${(0,y.styleText)("yellow",m)}`:` ${m}`).join(`
121
+ `),c=o.split(`
122
+ `).length,d=l.split(`
123
+ `).length+1;return`${o}${u}${Ru({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:u.length,rowPadding:c+d,style:a}).join(`
124
+ ${u}`)}
125
+ ${l}
126
+ `}default:{let u=i?`${(0,y.styleText)("cyan",$)} `:"",l=o.split(`
127
+ `).length,c=i?2:1;return`${o}${u}${Ru({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:u.length,rowPadding:l+c,style:a}).join(`
128
+ ${u}`)}
129
+ ${i?(0,y.styleText)("cyan",ot):""}
130
+ `}}}}).prompt()};var qd=e=>new Si({validate:e.validate,mask:e.mask??tC,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??Pe.withGuide,r=`${t?`${(0,y.styleText)("gray",$)}
131
+ `:""}${Br(this.state)} ${e.message}
132
+ `,i=this.userInputWithCursor,n=this.masked;switch(this.state){case"error":{let o=t?`${(0,y.styleText)("yellow",$)} `:"",s=t?`${(0,y.styleText)("yellow",ot)} `:"",a=n??"";return e.clearOnError&&this.clear(),`${r.trim()}
143
133
  ${o}${a}
144
134
  ${s}${(0,y.styleText)("yellow",this.error)}
145
- `}case"submit":{let o=t?`${(0,y.styleText)("gray",R)} `:"",s=n?(0,y.styleText)("dim",n):"";return`${r}${o}${s}`}case"cancel":{let o=t?`${(0,y.styleText)("gray",R)} `:"",s=n?(0,y.styleText)(["strikethrough","dim"],n):"";return`${r}${o}${s}${n&&t?`
146
- ${(0,y.styleText)("gray",R)}`:""}`}default:{let o=t?`${(0,y.styleText)("cyan",R)} `:"",s=t?(0,y.styleText)("cyan",nt):"";return`${r}${o}${i}
135
+ `}case"submit":{let o=t?`${(0,y.styleText)("gray",$)} `:"",s=n?(0,y.styleText)("dim",n):"";return`${r}${o}${s}`}case"cancel":{let o=t?`${(0,y.styleText)("gray",$)} `:"",s=n?(0,y.styleText)(["strikethrough","dim"],n):"";return`${r}${o}${s}${n&&t?`
136
+ ${(0,y.styleText)("gray",$)}`:""}`}default:{let o=t?`${(0,y.styleText)("cyan",$)} `:"",s=t?(0,y.styleText)("cyan",ot):"";return`${r}${o}${i}
147
137
  ${s}
148
- `}}}}).prompt();var gk={light:Z("\u2500","-"),heavy:Z("\u2501","="),block:Z("\u2588","#")};var Pi=(e,t)=>e.includes(`
138
+ `}}}}).prompt();var tk={light:Z("\u2500","-"),heavy:Z("\u2501","="),block:Z("\u2588","#")};var ki=(e,t)=>e.includes(`
149
139
  `)?e.split(`
150
140
  `).map(r=>t(r)).join(`
151
- `):t(e),pe=e=>{let t=(r,i)=>{let n=r.label??String(r.value);switch(i){case"disabled":return`${(0,y.styleText)("gray",Ti)} ${Pi(n,o=>(0,y.styleText)("gray",o))}${r.hint?` ${(0,y.styleText)("dim",`(${r.hint??"disabled"})`)}`:""}`;case"selected":return`${Pi(n,o=>(0,y.styleText)("dim",o))}`;case"active":return`${(0,y.styleText)("green",Nu)} ${n}${r.hint?` ${(0,y.styleText)("dim",`(${r.hint})`)}`:""}`;case"cancelled":return`${Pi(n,o=>(0,y.styleText)(["strikethrough","dim"],o))}`;default:return`${(0,y.styleText)("dim",Ti)} ${Pi(n,o=>(0,y.styleText)("dim",o))}`}};return new Si({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let r=e.withGuide??$e.withGuide,i=`${Fr(this.state)} `,n=`${Md(this.state)} `,o=Rt(e.output,e.message,n,i),s=`${r?`${(0,y.styleText)("gray",R)}
141
+ `):t(e),pe=e=>{let t=(r,i)=>{let n=r.label??String(r.value);switch(i){case"disabled":return`${(0,y.styleText)("gray",Ai)} ${ki(n,o=>(0,y.styleText)("gray",o))}${r.hint?` ${(0,y.styleText)("dim",`(${r.hint??"disabled"})`)}`:""}`;case"selected":return`${ki(n,o=>(0,y.styleText)("dim",o))}`;case"active":return`${(0,y.styleText)("green",qu)} ${n}${r.hint?` ${(0,y.styleText)("dim",`(${r.hint})`)}`:""}`;case"cancelled":return`${ki(n,o=>(0,y.styleText)(["strikethrough","dim"],o))}`;default:return`${(0,y.styleText)("dim",Ai)} ${ki(n,o=>(0,y.styleText)("dim",o))}`}};return new xi({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let r=e.withGuide??Pe.withGuide,i=`${Br(this.state)} `,n=`${Td(this.state)} `,o=yt(e.output,e.message,n,i),s=`${r?`${(0,y.styleText)("gray",$)}
152
142
  `:""}${o}
153
- `;switch(this.state){case"submit":{let a=r?`${(0,y.styleText)("gray",R)} `:"",u=Rt(e.output,t(this.options[this.cursor],"selected"),a);return`${s}${u}`}case"cancel":{let a=r?`${(0,y.styleText)("gray",R)} `:"",u=Rt(e.output,t(this.options[this.cursor],"cancelled"),a);return`${s}${u}${r?`
154
- ${(0,y.styleText)("gray",R)}`:""}`}default:{let a=r?`${(0,y.styleText)("cyan",R)} `:"",u=r?(0,y.styleText)("cyan",nt):"",l=s.split(`
155
- `).length,d=r?2:1;return`${s}${a}${Lu({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:a.length,rowPadding:l+d,style:(c,m)=>t(c,c.disabled?"disabled":m?"active":"inactive")}).join(`
143
+ `;switch(this.state){case"submit":{let a=r?`${(0,y.styleText)("gray",$)} `:"",u=yt(e.output,t(this.options[this.cursor],"selected"),a);return`${s}${u}`}case"cancel":{let a=r?`${(0,y.styleText)("gray",$)} `:"",u=yt(e.output,t(this.options[this.cursor],"cancelled"),a);return`${s}${u}${r?`
144
+ ${(0,y.styleText)("gray",$)}`:""}`}default:{let a=r?`${(0,y.styleText)("cyan",$)} `:"",u=r?(0,y.styleText)("cyan",ot):"",l=s.split(`
145
+ `).length,c=r?2:1;return`${s}${a}${Ru({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:a.length,rowPadding:l+c,style:(d,m)=>t(d,d.disabled?"disabled":m?"active":"inactive")}).join(`
156
146
  ${a}`)}
157
147
  ${u}
158
- `}}}}).prompt()};var bk=`${(0,y.styleText)("gray",R)} `;var te=e=>new xi({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??$e.withGuide,r=`${`${t?`${(0,y.styleText)("gray",R)}
159
- `:""}${Fr(this.state)} `}${e.message}
160
- `,i=e.placeholder?(0,y.styleText)("inverse",e.placeholder[0])+(0,y.styleText)("dim",e.placeholder.slice(1)):(0,y.styleText)(["inverse","hidden"],"_"),n=this.userInput?this.userInputWithCursor:i,o=this.value??"";switch(this.state){case"error":{let s=this.error?` ${(0,y.styleText)("yellow",this.error)}`:"",a=t?`${(0,y.styleText)("yellow",R)} `:"",u=t?(0,y.styleText)("yellow",nt):"";return`${r.trim()}
148
+ `}}}}).prompt()};var rk=`${(0,y.styleText)("gray",$)} `;var te=e=>new wi({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??Pe.withGuide,r=`${`${t?`${(0,y.styleText)("gray",$)}
149
+ `:""}${Br(this.state)} `}${e.message}
150
+ `,i=e.placeholder?(0,y.styleText)("inverse",e.placeholder[0])+(0,y.styleText)("dim",e.placeholder.slice(1)):(0,y.styleText)(["inverse","hidden"],"_"),n=this.userInput?this.userInputWithCursor:i,o=this.value??"";switch(this.state){case"error":{let s=this.error?` ${(0,y.styleText)("yellow",this.error)}`:"",a=t?`${(0,y.styleText)("yellow",$)} `:"",u=t?(0,y.styleText)("yellow",ot):"";return`${r.trim()}
161
151
  ${a}${n}
162
152
  ${u}${s}
163
- `}case"submit":{let s=o?` ${(0,y.styleText)("dim",o)}`:"",a=t?(0,y.styleText)("gray",R):"";return`${r}${a}${s}`}case"cancel":{let s=o?` ${(0,y.styleText)(["strikethrough","dim"],o)}`:"",a=t?(0,y.styleText)("gray",R):"";return`${r}${a}${s}${o.trim()?`
164
- ${a}`:""}`}default:{let s=t?`${(0,y.styleText)("cyan",R)} `:"",a=t?(0,y.styleText)("cyan",nt):"";return`${r}${s}${n}
153
+ `}case"submit":{let s=o?` ${(0,y.styleText)("dim",o)}`:"",a=t?(0,y.styleText)("gray",$):"";return`${r}${a}${s}`}case"cancel":{let s=o?` ${(0,y.styleText)(["strikethrough","dim"],o)}`:"",a=t?(0,y.styleText)("gray",$):"";return`${r}${a}${s}${o.trim()?`
154
+ ${a}`:""}`}default:{let s=t?`${(0,y.styleText)("cyan",$)} `:"",a=t?(0,y.styleText)("cyan",ot):"";return`${r}${s}${n}
165
155
  ${a}
166
- `}}}}).prompt();var ni=le(vt(),1);zt();process.env.RESEND_USER_AGENT=`resend-cli:${se}`;var yt=new TextEncoder,Yd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Br=new Uint8Array(256);for(let e=0;e<Yd.length;e++)Br[Yd.charCodeAt(e)]=e;function Di(e){let t=Math.ceil(e.length/4)*3,r=e.length,i=0;e.length%4===3?t--:e.length%4===2?t-=2:e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);let n=new ArrayBuffer(t),o=new Uint8Array(n);for(let s=0;s<r;s+=4){let a=Br[e.charCodeAt(s)],u=Br[e.charCodeAt(s+1)],l=Br[e.charCodeAt(s+2)],d=Br[e.charCodeAt(s+3)];o[i++]=a<<2|u>>4,o[i++]=(u&15)<<4|l>>2,o[i++]=(l&3)<<6|d&63}return n}function sr(e){e=e||"utf8";let t;try{t=new TextDecoder(e)}catch{t=new TextDecoder("windows-1252")}return t}async function Ct(e){if("arrayBuffer"in e)return await e.arrayBuffer();let t=new FileReader;return new Promise((r,i)=>{t.onload=function(n){r(n.target.result)},t.onerror=function(n){i(t.error)},t.readAsArrayBuffer(e)})}function Qd(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70?String.fromCharCode(e):!1}function q1(e,t,r){let i=e.indexOf("*");i>=0&&(e=e.substr(0,i)),t=t.toUpperCase();let n;if(t==="Q"){r=r.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let o=yt.encode(r),s=[];for(let u=0,l=o.length;u<l;u++){let d=o[u];if(u<=l-2&&d===61){let c=Qd(o[u+1]),m=Qd(o[u+2]);if(c&&m){let _=parseInt(c+m,16);s.push(_),u+=2;continue}}s.push(d)}n=new ArrayBuffer(s.length);let a=new DataView(n);for(let u=0,l=s.length;u<l;u++)a.setUint8(u,s[u])}else t==="B"?n=Di(r.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):n=yt.encode(r);return sr(e).decode(n)}function Mt(e){let t=!0,r=!1;for(;!r;){let i=(e||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(n,o,s,a,u)=>t&&s===u&&a.length%4===0&&!/=$/.test(a)?o+"__\0JOIN\0__":n).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(n,o,s,a)=>t&&s===a?o+"__\0JOIN\0__":n).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(n,o,s,a)=>q1(o,s,a));if(t&&i.indexOf("\uFFFD")>=0)t=!1;else return i}}function R1(e,t){t=t||"utf-8";let r=[];for(let o=0;o<e.length;o++){let s=e.charAt(o);if(s==="%"&&/^[a-f0-9]{2}/i.test(e.substr(o+1,2))){let a=e.substr(o+1,2);o+=2,r.push(parseInt(a,16))}else if(s.charCodeAt(0)>126){s=yt.encode(s);for(let a=0;a<s.length;a++)r.push(s[a])}else r.push(s.charCodeAt(0))}let i=new ArrayBuffer(r.length),n=new DataView(i);for(let o=0,s=r.length;o<s;o++)n.setUint8(o,r[o]);return sr(t).decode(i)}function Zd(e){let t=new Map;Object.keys(e.params).forEach(r=>{let i=r.match(/\*((\d+)\*?)?$/);if(!i)return;let n=r.substr(0,i.index).toLowerCase(),o=Number(i[2])||0,s;t.has(n)?s=t.get(n):(s={charset:!1,values:[]},t.set(n,s));let a=e.params[r];o===0&&i[0].charAt(i[0].length-1)==="*"&&(i=a.match(/^([^']*)'[^']*'(.*)$/))&&(s.charset=i[1]||"utf-8",a=i[2]),s.values.push({nr:o,value:a}),delete e.params[r]}),t.forEach((r,i)=>{e.params[i]=R1(r.values.sort((n,o)=>n.nr-o.nr).map(n=>n.value).join(""),r.charset)})}var Nr=class{constructor(){this.chunks=[]}update(t){this.chunks.push(t),this.chunks.push(`
167
- `)}finalize(){return Ct(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Lr=class{constructor(t){t=t||{},this.decoder=t.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.chunks=[],this.remainder=""}update(t){let r=this.decoder.decode(t);if(r=r.replace(/[^a-zA-Z0-9+\/]+/g,""),this.remainder+=r,this.remainder.length>=this.maxChunkSize){let i=Math.floor(this.remainder.length/4)*4,n;i===this.remainder.length?(n=this.remainder,this.remainder=""):(n=this.remainder.substr(0,i),this.remainder=this.remainder.substr(i)),n.length&&this.chunks.push(Di(n))}}finalize(){return this.remainder&&!/^=+$/.test(this.remainder)&&this.chunks.push(Di(this.remainder)),Ct(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Xd=/^=[a-f0-9]{2}$/i,z1=/(?==[a-f0-9]{2})/i,M1=/=\r?\n/g,J1=/=[a-fA-F0-9]?$/,Gr=class{constructor(t){t=t||{},this.decoder=t.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.remainder="",this.chunks=[]}decodeQPBytes(t){let r=new ArrayBuffer(t.length),i=new DataView(r);for(let n=0,o=t.length;n<o;n++)i.setUint8(n,parseInt(t[n],16));return r}decodeChunks(t){t=t.replace(M1,"");let r=t.split(z1),i=[];for(let n of r){if(n.charAt(0)!=="="){i.length&&(this.chunks.push(this.decodeQPBytes(i)),i=[]),this.chunks.push(n);continue}if(n.length===3){Xd.test(n)?i.push(n.substr(1)):(i.length&&(this.chunks.push(this.decodeQPBytes(i)),i=[]),this.chunks.push(n));continue}if(n.length>3){let o=n.substr(0,3);Xd.test(o)?(i.push(n.substr(1,2)),this.chunks.push(this.decodeQPBytes(i)),i=[],n=n.substr(3),this.chunks.push(n)):(i.length&&(this.chunks.push(this.decodeQPBytes(i)),i=[]),this.chunks.push(n))}}i.length&&this.chunks.push(this.decodeQPBytes(i))}update(t){let r=this.decoder.decode(t)+`
168
- `;if(r=this.remainder+r,r.length<this.maxChunkSize){this.remainder=r;return}this.remainder="";let i=r.match(J1);if(i){if(i.index===0){this.remainder=r;return}this.remainder=r.substr(i.index),r=r.substr(0,i.index)}this.decodeChunks(r)}finalize(){return this.remainder.length&&(this.decodeChunks(this.remainder),this.remainder=""),Ct(new Blob(this.chunks,{type:"application/octet-stream"}))}};var H1=sr(),ar=class{constructor(t){if(this.options=t||{},this.postalMime=this.options.postalMime,this.root=!!this.options.parentNode,this.childNodes=[],this.options.parentNode){if(this.parentNode=this.options.parentNode,this.depth=this.parentNode.depth+1,this.depth>this.options.maxNestingDepth)throw new Error(`Maximum MIME nesting depth of ${this.options.maxNestingDepth} levels exceeded`);this.options.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[],this.headerSize=0;let i=(this.options.parentMultipartType||null)==="digest"?"message/rfc822":"text/plain";this.contentType={value:i,default:!0},this.contentTransferEncoding={value:"8bit"},this.contentDisposition={value:""},this.headers=[],this.contentDecoder=!1}setupContentDecoder(t){/base64/i.test(t)?this.contentDecoder=new Lr:/quoted-printable/i.test(t)?this.contentDecoder=new Gr({decoder:sr(this.contentType.parsed.params.charset)}):this.contentDecoder=new Nr}async finalize(){if(this.state==="finished")return;this.state==="header"&&this.processHeaders();let t=this.postalMime.boundaries;for(let r=t.length-1;r>=0;r--)if(t[r].node===this){t.splice(r,1);break}await this.finalizeChildNodes(),this.content=this.contentDecoder?await this.contentDecoder.finalize():null,this.state="finished"}async finalizeChildNodes(){for(let t of this.childNodes)await t.finalize()}stripComments(t){let r="",i=0,n=!1,o=!1;for(let s=0;s<t.length;s++){let a=t.charAt(s);if(n){i===0&&(r+=a),n=!1;continue}if(a==="\\"){n=!0,i===0&&(r+=a);continue}if(a==='"'&&i===0){o=!o,r+=a;continue}if(!o){if(a==="("){i++;continue}if(a===")"&&i>0){i--;continue}}i===0&&(r+=a)}return r}parseStructuredHeader(t){t=this.stripComments(t);let r={value:!1,params:{}},i=!1,n="",o="value",s=!1,a=!1,u;for(let l=0,d=t.length;l<d;l++)switch(u=t.charAt(l),o){case"key":if(u==="="){i=n.trim().toLowerCase(),o="value",n="";break}n+=u;break;case"value":if(a)n+=u;else if(u==="\\"){a=!0;continue}else s&&u===s?s=!1:!s&&u==='"'?s=u:!s&&u===";"?(i===!1?r.value=n.trim():r.params[i]=n.trim(),o="key",n=""):n+=u;a=!1;break}return n=n.trim(),o==="value"?i===!1?r.value=n:r.params[i]=n:n&&(r.params[n.toLowerCase()]=""),r.value&&(r.value=r.value.toLowerCase()),Zd(r),r}decodeFlowedText(t,r){return t.split(/\r?\n/).reduce((i,n)=>i.endsWith(" ")&&i!=="-- "&&!i.endsWith(`
156
+ `}}}}).prompt();var ni=le(_t(),1);Ft();process.env.RESEND_USER_AGENT=`resend-cli:${se}`;var Ot=new TextEncoder,zd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hr=new Uint8Array(256);for(let e=0;e<zd.length;e++)Hr[zd.charCodeAt(e)]=e;function Pi(e){let t=Math.ceil(e.length/4)*3,r=e.length,i=0;e.length%4===3?t--:e.length%4===2?t-=2:e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);let n=new ArrayBuffer(t),o=new Uint8Array(n);for(let s=0;s<r;s+=4){let a=Hr[e.charCodeAt(s)],u=Hr[e.charCodeAt(s+1)],l=Hr[e.charCodeAt(s+2)],c=Hr[e.charCodeAt(s+3)];o[i++]=a<<2|u>>4,o[i++]=(u&15)<<4|l>>2,o[i++]=(l&3)<<6|c&63}return n}function ar(e){e=e||"utf8";let t;try{t=new TextDecoder(e)}catch{t=new TextDecoder("windows-1252")}return t}async function St(e){if("arrayBuffer"in e)return await e.arrayBuffer();let t=new FileReader;return new Promise((r,i)=>{t.onload=function(n){r(n.target.result)},t.onerror=function(n){i(t.error)},t.readAsArrayBuffer(e)})}function Md(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70?String.fromCharCode(e):!1}function uC(e,t,r){let i=e.indexOf("*");i>=0&&(e=e.substr(0,i)),t=t.toUpperCase();let n;if(t==="Q"){r=r.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let o=Ot.encode(r),s=[];for(let u=0,l=o.length;u<l;u++){let c=o[u];if(u<=l-2&&c===61){let d=Md(o[u+1]),m=Md(o[u+2]);if(d&&m){let b=parseInt(d+m,16);s.push(b),u+=2;continue}}s.push(c)}n=new ArrayBuffer(s.length);let a=new DataView(n);for(let u=0,l=s.length;u<l;u++)a.setUint8(u,s[u])}else t==="B"?n=Pi(r.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):n=Ot.encode(r);return ar(e).decode(n)}function zt(e){let t=!0,r=!1;for(;!r;){let i=(e||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(n,o,s,a,u)=>t&&s===u&&a.length%4===0&&!/=$/.test(a)?o+"__\0JOIN\0__":n).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(n,o,s,a)=>t&&s===a?o+"__\0JOIN\0__":n).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(n,o,s,a)=>uC(o,s,a));if(t&&i.indexOf("\uFFFD")>=0)t=!1;else return i}}function lC(e,t){t=t||"utf-8";let r=[];for(let o=0;o<e.length;o++){let s=e.charAt(o);if(s==="%"&&/^[a-f0-9]{2}/i.test(e.substr(o+1,2))){let a=e.substr(o+1,2);o+=2,r.push(parseInt(a,16))}else if(s.charCodeAt(0)>126){s=Ot.encode(s);for(let a=0;a<s.length;a++)r.push(s[a])}else r.push(s.charCodeAt(0))}let i=new ArrayBuffer(r.length),n=new DataView(i);for(let o=0,s=r.length;o<s;o++)n.setUint8(o,r[o]);return ar(t).decode(i)}function Jd(e){let t=new Map;Object.keys(e.params).forEach(r=>{let i=r.match(/\*((\d+)\*?)?$/);if(!i)return;let n=r.substr(0,i.index).toLowerCase(),o=Number(i[2])||0,s;t.has(n)?s=t.get(n):(s={charset:!1,values:[]},t.set(n,s));let a=e.params[r];o===0&&i[0].charAt(i[0].length-1)==="*"&&(i=a.match(/^([^']*)'[^']*'(.*)$/))&&(s.charset=i[1]||"utf-8",a=i[2]),s.values.push({nr:o,value:a}),delete e.params[r]}),t.forEach((r,i)=>{e.params[i]=lC(r.values.sort((n,o)=>n.nr-o.nr).map(n=>n.value).join(""),r.charset)})}var Nr=class{constructor(){this.chunks=[]}update(t){this.chunks.push(t),this.chunks.push(`
157
+ `)}finalize(){return St(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Lr=class{constructor(t){t=t||{},this.decoder=t.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.chunks=[],this.remainder=""}update(t){let r=this.decoder.decode(t);if(r=r.replace(/[^a-zA-Z0-9+\/]+/g,""),this.remainder+=r,this.remainder.length>=this.maxChunkSize){let i=Math.floor(this.remainder.length/4)*4,n;i===this.remainder.length?(n=this.remainder,this.remainder=""):(n=this.remainder.substr(0,i),this.remainder=this.remainder.substr(i)),n.length&&this.chunks.push(Pi(n))}}finalize(){return this.remainder&&!/^=+$/.test(this.remainder)&&this.chunks.push(Pi(this.remainder)),St(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Bd=/^=[a-f0-9]{2}$/i,cC=/(?==[a-f0-9]{2})/i,dC=/=\r?\n/g,mC=/=[a-fA-F0-9]?$/,Gr=class{constructor(t){t=t||{},this.decoder=t.decoder||new TextDecoder,this.maxChunkSize=100*1024,this.remainder="",this.chunks=[]}decodeQPBytes(t){let r=new ArrayBuffer(t.length),i=new DataView(r);for(let n=0,o=t.length;n<o;n++)i.setUint8(n,parseInt(t[n],16));return r}decodeChunks(t){t=t.replace(dC,"");let r=t.split(cC),i=[];for(let n of r){if(n.charAt(0)!=="="){i.length&&(this.chunks.push(this.decodeQPBytes(i)),i=[]),this.chunks.push(n);continue}if(n.length===3){Bd.test(n)?i.push(n.substr(1)):(i.length&&(this.chunks.push(this.decodeQPBytes(i)),i=[]),this.chunks.push(n));continue}if(n.length>3){let o=n.substr(0,3);Bd.test(o)?(i.push(n.substr(1,2)),this.chunks.push(this.decodeQPBytes(i)),i=[],n=n.substr(3),this.chunks.push(n)):(i.length&&(this.chunks.push(this.decodeQPBytes(i)),i=[]),this.chunks.push(n))}}i.length&&this.chunks.push(this.decodeQPBytes(i))}update(t){let r=this.decoder.decode(t)+`
158
+ `;if(r=this.remainder+r,r.length<this.maxChunkSize){this.remainder=r;return}this.remainder="";let i=r.match(mC);if(i){if(i.index===0){this.remainder=r;return}this.remainder=r.substr(i.index),r=r.substr(0,i.index)}this.decodeChunks(r)}finalize(){return this.remainder.length&&(this.decodeChunks(this.remainder),this.remainder=""),St(new Blob(this.chunks,{type:"application/octet-stream"}))}};var pC=ar(),ur=class{constructor(t){if(this.options=t||{},this.postalMime=this.options.postalMime,this.root=!!this.options.parentNode,this.childNodes=[],this.options.parentNode){if(this.parentNode=this.options.parentNode,this.depth=this.parentNode.depth+1,this.depth>this.options.maxNestingDepth)throw new Error(`Maximum MIME nesting depth of ${this.options.maxNestingDepth} levels exceeded`);this.options.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[],this.headerSize=0;let i=(this.options.parentMultipartType||null)==="digest"?"message/rfc822":"text/plain";this.contentType={value:i,default:!0},this.contentTransferEncoding={value:"8bit"},this.contentDisposition={value:""},this.headers=[],this.contentDecoder=!1}setupContentDecoder(t){/base64/i.test(t)?this.contentDecoder=new Lr:/quoted-printable/i.test(t)?this.contentDecoder=new Gr({decoder:ar(this.contentType.parsed.params.charset)}):this.contentDecoder=new Nr}async finalize(){if(this.state==="finished")return;this.state==="header"&&this.processHeaders();let t=this.postalMime.boundaries;for(let r=t.length-1;r>=0;r--)if(t[r].node===this){t.splice(r,1);break}await this.finalizeChildNodes(),this.content=this.contentDecoder?await this.contentDecoder.finalize():null,this.state="finished"}async finalizeChildNodes(){for(let t of this.childNodes)await t.finalize()}stripComments(t){let r="",i=0,n=!1,o=!1;for(let s=0;s<t.length;s++){let a=t.charAt(s);if(n){i===0&&(r+=a),n=!1;continue}if(a==="\\"){n=!0,i===0&&(r+=a);continue}if(a==='"'&&i===0){o=!o,r+=a;continue}if(!o){if(a==="("){i++;continue}if(a===")"&&i>0){i--;continue}}i===0&&(r+=a)}return r}parseStructuredHeader(t){t=this.stripComments(t);let r={value:!1,params:{}},i=!1,n="",o="value",s=!1,a=!1,u;for(let l=0,c=t.length;l<c;l++)switch(u=t.charAt(l),o){case"key":if(u==="="){i=n.trim().toLowerCase(),o="value",n="";break}n+=u;break;case"value":if(a)n+=u;else if(u==="\\"){a=!0;continue}else s&&u===s?s=!1:!s&&u==='"'?s=u:!s&&u===";"?(i===!1?r.value=n.trim():r.params[i]=n.trim(),o="key",n=""):n+=u;a=!1;break}return n=n.trim(),o==="value"?i===!1?r.value=n:r.params[i]=n:n&&(r.params[n.toLowerCase()]=""),r.value&&(r.value=r.value.toLowerCase()),Jd(r),r}decodeFlowedText(t,r){return t.split(/\r?\n/).reduce((i,n)=>i.endsWith(" ")&&i!=="-- "&&!i.endsWith(`
169
159
  -- `)?r?i.slice(0,-1)+n:i+n:i+`
170
- `+n).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let t=sr(this.contentType.parsed.params.charset).decode(this.content);return/^flowed$/i.test(this.contentType.parsed.params.format)&&(t=this.decodeFlowedText(t,/^yes$/i.test(this.contentType.parsed.params.delsp))),t}processHeaders(){for(let t=this.headerLines.length-1;t>=0;t--){let r=this.headerLines[t];t&&/^\s/.test(r)&&(this.headerLines[t-1]+=`
171
- `+r,this.headerLines.splice(t,1))}this.rawHeaderLines=[];for(let t=this.headerLines.length-1;t>=0;t--){let r=this.headerLines[t],i=r.indexOf(":"),n=i<0?r.trim():r.substr(0,i).trim();this.rawHeaderLines.push({key:n.toLowerCase(),line:r});let o=r.replace(/\s+/g," ");i=o.indexOf(":");let s=i<0?o.trim():o.substr(0,i).trim(),a=i<0?"":o.substr(i+1).trim();switch(this.headers.push({key:s.toLowerCase(),originalKey:s,value:a}),s.toLowerCase()){case"content-type":this.contentType.default&&(this.contentType={value:a,parsed:{}});break;case"content-transfer-encoding":this.contentTransferEncoding={value:a,parsed:{}};break;case"content-disposition":this.contentDisposition={value:a,parsed:{}};break;case"content-id":this.contentId=a;break;case"content-description":this.contentDescription=a;break}}this.contentType.parsed=this.parseStructuredHeader(this.contentType.value),this.contentType.multipart=/^multipart\//i.test(this.contentType.parsed.value)?this.contentType.parsed.value.substr(this.contentType.parsed.value.indexOf("/")+1):!1,this.contentType.multipart&&this.contentType.parsed.params.boundary&&this.postalMime.boundaries.push({value:yt.encode(this.contentType.parsed.params.boundary),node:this}),this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value),this.contentTransferEncoding.encoding=this.contentTransferEncoding.value.toLowerCase().split(/[^\w-]/).shift(),this.setupContentDecoder(this.contentTransferEncoding.encoding)}feed(t){switch(this.state){case"header":if(!t.length)return this.state="body",this.processHeaders();if(this.headerSize+=t.length,this.headerSize>this.options.maxHeadersSize)throw new Error(`Maximum header size of ${this.options.maxHeadersSize} bytes exceeded`);this.headerLines.push(H1.decode(t));break;case"body":this.contentDecoder.update(t)}}};var F1={"&AElig":"\xC6","&AElig;":"\xC6","&AMP":"&","&AMP;":"&","&Aacute":"\xC1","&Aacute;":"\xC1","&Abreve;":"\u0102","&Acirc":"\xC2","&Acirc;":"\xC2","&Acy;":"\u0410","&Afr;":"\u{1D504}","&Agrave":"\xC0","&Agrave;":"\xC0","&Alpha;":"\u0391","&Amacr;":"\u0100","&And;":"\u2A53","&Aogon;":"\u0104","&Aopf;":"\u{1D538}","&ApplyFunction;":"\u2061","&Aring":"\xC5","&Aring;":"\xC5","&Ascr;":"\u{1D49C}","&Assign;":"\u2254","&Atilde":"\xC3","&Atilde;":"\xC3","&Auml":"\xC4","&Auml;":"\xC4","&Backslash;":"\u2216","&Barv;":"\u2AE7","&Barwed;":"\u2306","&Bcy;":"\u0411","&Because;":"\u2235","&Bernoullis;":"\u212C","&Beta;":"\u0392","&Bfr;":"\u{1D505}","&Bopf;":"\u{1D539}","&Breve;":"\u02D8","&Bscr;":"\u212C","&Bumpeq;":"\u224E","&CHcy;":"\u0427","&COPY":"\xA9","&COPY;":"\xA9","&Cacute;":"\u0106","&Cap;":"\u22D2","&CapitalDifferentialD;":"\u2145","&Cayleys;":"\u212D","&Ccaron;":"\u010C","&Ccedil":"\xC7","&Ccedil;":"\xC7","&Ccirc;":"\u0108","&Cconint;":"\u2230","&Cdot;":"\u010A","&Cedilla;":"\xB8","&CenterDot;":"\xB7","&Cfr;":"\u212D","&Chi;":"\u03A7","&CircleDot;":"\u2299","&CircleMinus;":"\u2296","&CirclePlus;":"\u2295","&CircleTimes;":"\u2297","&ClockwiseContourIntegral;":"\u2232","&CloseCurlyDoubleQuote;":"\u201D","&CloseCurlyQuote;":"\u2019","&Colon;":"\u2237","&Colone;":"\u2A74","&Congruent;":"\u2261","&Conint;":"\u222F","&ContourIntegral;":"\u222E","&Copf;":"\u2102","&Coproduct;":"\u2210","&CounterClockwiseContourIntegral;":"\u2233","&Cross;":"\u2A2F","&Cscr;":"\u{1D49E}","&Cup;":"\u22D3","&CupCap;":"\u224D","&DD;":"\u2145","&DDotrahd;":"\u2911","&DJcy;":"\u0402","&DScy;":"\u0405","&DZcy;":"\u040F","&Dagger;":"\u2021","&Darr;":"\u21A1","&Dashv;":"\u2AE4","&Dcaron;":"\u010E","&Dcy;":"\u0414","&Del;":"\u2207","&Delta;":"\u0394","&Dfr;":"\u{1D507}","&DiacriticalAcute;":"\xB4","&DiacriticalDot;":"\u02D9","&DiacriticalDoubleAcute;":"\u02DD","&DiacriticalGrave;":"`","&DiacriticalTilde;":"\u02DC","&Diamond;":"\u22C4","&DifferentialD;":"\u2146","&Dopf;":"\u{1D53B}","&Dot;":"\xA8","&DotDot;":"\u20DC","&DotEqual;":"\u2250","&DoubleContourIntegral;":"\u222F","&DoubleDot;":"\xA8","&DoubleDownArrow;":"\u21D3","&DoubleLeftArrow;":"\u21D0","&DoubleLeftRightArrow;":"\u21D4","&DoubleLeftTee;":"\u2AE4","&DoubleLongLeftArrow;":"\u27F8","&DoubleLongLeftRightArrow;":"\u27FA","&DoubleLongRightArrow;":"\u27F9","&DoubleRightArrow;":"\u21D2","&DoubleRightTee;":"\u22A8","&DoubleUpArrow;":"\u21D1","&DoubleUpDownArrow;":"\u21D5","&DoubleVerticalBar;":"\u2225","&DownArrow;":"\u2193","&DownArrowBar;":"\u2913","&DownArrowUpArrow;":"\u21F5","&DownBreve;":"\u0311","&DownLeftRightVector;":"\u2950","&DownLeftTeeVector;":"\u295E","&DownLeftVector;":"\u21BD","&DownLeftVectorBar;":"\u2956","&DownRightTeeVector;":"\u295F","&DownRightVector;":"\u21C1","&DownRightVectorBar;":"\u2957","&DownTee;":"\u22A4","&DownTeeArrow;":"\u21A7","&Downarrow;":"\u21D3","&Dscr;":"\u{1D49F}","&Dstrok;":"\u0110","&ENG;":"\u014A","&ETH":"\xD0","&ETH;":"\xD0","&Eacute":"\xC9","&Eacute;":"\xC9","&Ecaron;":"\u011A","&Ecirc":"\xCA","&Ecirc;":"\xCA","&Ecy;":"\u042D","&Edot;":"\u0116","&Efr;":"\u{1D508}","&Egrave":"\xC8","&Egrave;":"\xC8","&Element;":"\u2208","&Emacr;":"\u0112","&EmptySmallSquare;":"\u25FB","&EmptyVerySmallSquare;":"\u25AB","&Eogon;":"\u0118","&Eopf;":"\u{1D53C}","&Epsilon;":"\u0395","&Equal;":"\u2A75","&EqualTilde;":"\u2242","&Equilibrium;":"\u21CC","&Escr;":"\u2130","&Esim;":"\u2A73","&Eta;":"\u0397","&Euml":"\xCB","&Euml;":"\xCB","&Exists;":"\u2203","&ExponentialE;":"\u2147","&Fcy;":"\u0424","&Ffr;":"\u{1D509}","&FilledSmallSquare;":"\u25FC","&FilledVerySmallSquare;":"\u25AA","&Fopf;":"\u{1D53D}","&ForAll;":"\u2200","&Fouriertrf;":"\u2131","&Fscr;":"\u2131","&GJcy;":"\u0403","&GT":">","&GT;":">","&Gamma;":"\u0393","&Gammad;":"\u03DC","&Gbreve;":"\u011E","&Gcedil;":"\u0122","&Gcirc;":"\u011C","&Gcy;":"\u0413","&Gdot;":"\u0120","&Gfr;":"\u{1D50A}","&Gg;":"\u22D9","&Gopf;":"\u{1D53E}","&GreaterEqual;":"\u2265","&GreaterEqualLess;":"\u22DB","&GreaterFullEqual;":"\u2267","&GreaterGreater;":"\u2AA2","&GreaterLess;":"\u2277","&GreaterSlantEqual;":"\u2A7E","&GreaterTilde;":"\u2273","&Gscr;":"\u{1D4A2}","&Gt;":"\u226B","&HARDcy;":"\u042A","&Hacek;":"\u02C7","&Hat;":"^","&Hcirc;":"\u0124","&Hfr;":"\u210C","&HilbertSpace;":"\u210B","&Hopf;":"\u210D","&HorizontalLine;":"\u2500","&Hscr;":"\u210B","&Hstrok;":"\u0126","&HumpDownHump;":"\u224E","&HumpEqual;":"\u224F","&IEcy;":"\u0415","&IJlig;":"\u0132","&IOcy;":"\u0401","&Iacute":"\xCD","&Iacute;":"\xCD","&Icirc":"\xCE","&Icirc;":"\xCE","&Icy;":"\u0418","&Idot;":"\u0130","&Ifr;":"\u2111","&Igrave":"\xCC","&Igrave;":"\xCC","&Im;":"\u2111","&Imacr;":"\u012A","&ImaginaryI;":"\u2148","&Implies;":"\u21D2","&Int;":"\u222C","&Integral;":"\u222B","&Intersection;":"\u22C2","&InvisibleComma;":"\u2063","&InvisibleTimes;":"\u2062","&Iogon;":"\u012E","&Iopf;":"\u{1D540}","&Iota;":"\u0399","&Iscr;":"\u2110","&Itilde;":"\u0128","&Iukcy;":"\u0406","&Iuml":"\xCF","&Iuml;":"\xCF","&Jcirc;":"\u0134","&Jcy;":"\u0419","&Jfr;":"\u{1D50D}","&Jopf;":"\u{1D541}","&Jscr;":"\u{1D4A5}","&Jsercy;":"\u0408","&Jukcy;":"\u0404","&KHcy;":"\u0425","&KJcy;":"\u040C","&Kappa;":"\u039A","&Kcedil;":"\u0136","&Kcy;":"\u041A","&Kfr;":"\u{1D50E}","&Kopf;":"\u{1D542}","&Kscr;":"\u{1D4A6}","&LJcy;":"\u0409","&LT":"<","&LT;":"<","&Lacute;":"\u0139","&Lambda;":"\u039B","&Lang;":"\u27EA","&Laplacetrf;":"\u2112","&Larr;":"\u219E","&Lcaron;":"\u013D","&Lcedil;":"\u013B","&Lcy;":"\u041B","&LeftAngleBracket;":"\u27E8","&LeftArrow;":"\u2190","&LeftArrowBar;":"\u21E4","&LeftArrowRightArrow;":"\u21C6","&LeftCeiling;":"\u2308","&LeftDoubleBracket;":"\u27E6","&LeftDownTeeVector;":"\u2961","&LeftDownVector;":"\u21C3","&LeftDownVectorBar;":"\u2959","&LeftFloor;":"\u230A","&LeftRightArrow;":"\u2194","&LeftRightVector;":"\u294E","&LeftTee;":"\u22A3","&LeftTeeArrow;":"\u21A4","&LeftTeeVector;":"\u295A","&LeftTriangle;":"\u22B2","&LeftTriangleBar;":"\u29CF","&LeftTriangleEqual;":"\u22B4","&LeftUpDownVector;":"\u2951","&LeftUpTeeVector;":"\u2960","&LeftUpVector;":"\u21BF","&LeftUpVectorBar;":"\u2958","&LeftVector;":"\u21BC","&LeftVectorBar;":"\u2952","&Leftarrow;":"\u21D0","&Leftrightarrow;":"\u21D4","&LessEqualGreater;":"\u22DA","&LessFullEqual;":"\u2266","&LessGreater;":"\u2276","&LessLess;":"\u2AA1","&LessSlantEqual;":"\u2A7D","&LessTilde;":"\u2272","&Lfr;":"\u{1D50F}","&Ll;":"\u22D8","&Lleftarrow;":"\u21DA","&Lmidot;":"\u013F","&LongLeftArrow;":"\u27F5","&LongLeftRightArrow;":"\u27F7","&LongRightArrow;":"\u27F6","&Longleftarrow;":"\u27F8","&Longleftrightarrow;":"\u27FA","&Longrightarrow;":"\u27F9","&Lopf;":"\u{1D543}","&LowerLeftArrow;":"\u2199","&LowerRightArrow;":"\u2198","&Lscr;":"\u2112","&Lsh;":"\u21B0","&Lstrok;":"\u0141","&Lt;":"\u226A","&Map;":"\u2905","&Mcy;":"\u041C","&MediumSpace;":"\u205F","&Mellintrf;":"\u2133","&Mfr;":"\u{1D510}","&MinusPlus;":"\u2213","&Mopf;":"\u{1D544}","&Mscr;":"\u2133","&Mu;":"\u039C","&NJcy;":"\u040A","&Nacute;":"\u0143","&Ncaron;":"\u0147","&Ncedil;":"\u0145","&Ncy;":"\u041D","&NegativeMediumSpace;":"\u200B","&NegativeThickSpace;":"\u200B","&NegativeThinSpace;":"\u200B","&NegativeVeryThinSpace;":"\u200B","&NestedGreaterGreater;":"\u226B","&NestedLessLess;":"\u226A","&NewLine;":`
172
- `,"&Nfr;":"\u{1D511}","&NoBreak;":"\u2060","&NonBreakingSpace;":"\xA0","&Nopf;":"\u2115","&Not;":"\u2AEC","&NotCongruent;":"\u2262","&NotCupCap;":"\u226D","&NotDoubleVerticalBar;":"\u2226","&NotElement;":"\u2209","&NotEqual;":"\u2260","&NotEqualTilde;":"\u2242\u0338","&NotExists;":"\u2204","&NotGreater;":"\u226F","&NotGreaterEqual;":"\u2271","&NotGreaterFullEqual;":"\u2267\u0338","&NotGreaterGreater;":"\u226B\u0338","&NotGreaterLess;":"\u2279","&NotGreaterSlantEqual;":"\u2A7E\u0338","&NotGreaterTilde;":"\u2275","&NotHumpDownHump;":"\u224E\u0338","&NotHumpEqual;":"\u224F\u0338","&NotLeftTriangle;":"\u22EA","&NotLeftTriangleBar;":"\u29CF\u0338","&NotLeftTriangleEqual;":"\u22EC","&NotLess;":"\u226E","&NotLessEqual;":"\u2270","&NotLessGreater;":"\u2278","&NotLessLess;":"\u226A\u0338","&NotLessSlantEqual;":"\u2A7D\u0338","&NotLessTilde;":"\u2274","&NotNestedGreaterGreater;":"\u2AA2\u0338","&NotNestedLessLess;":"\u2AA1\u0338","&NotPrecedes;":"\u2280","&NotPrecedesEqual;":"\u2AAF\u0338","&NotPrecedesSlantEqual;":"\u22E0","&NotReverseElement;":"\u220C","&NotRightTriangle;":"\u22EB","&NotRightTriangleBar;":"\u29D0\u0338","&NotRightTriangleEqual;":"\u22ED","&NotSquareSubset;":"\u228F\u0338","&NotSquareSubsetEqual;":"\u22E2","&NotSquareSuperset;":"\u2290\u0338","&NotSquareSupersetEqual;":"\u22E3","&NotSubset;":"\u2282\u20D2","&NotSubsetEqual;":"\u2288","&NotSucceeds;":"\u2281","&NotSucceedsEqual;":"\u2AB0\u0338","&NotSucceedsSlantEqual;":"\u22E1","&NotSucceedsTilde;":"\u227F\u0338","&NotSuperset;":"\u2283\u20D2","&NotSupersetEqual;":"\u2289","&NotTilde;":"\u2241","&NotTildeEqual;":"\u2244","&NotTildeFullEqual;":"\u2247","&NotTildeTilde;":"\u2249","&NotVerticalBar;":"\u2224","&Nscr;":"\u{1D4A9}","&Ntilde":"\xD1","&Ntilde;":"\xD1","&Nu;":"\u039D","&OElig;":"\u0152","&Oacute":"\xD3","&Oacute;":"\xD3","&Ocirc":"\xD4","&Ocirc;":"\xD4","&Ocy;":"\u041E","&Odblac;":"\u0150","&Ofr;":"\u{1D512}","&Ograve":"\xD2","&Ograve;":"\xD2","&Omacr;":"\u014C","&Omega;":"\u03A9","&Omicron;":"\u039F","&Oopf;":"\u{1D546}","&OpenCurlyDoubleQuote;":"\u201C","&OpenCurlyQuote;":"\u2018","&Or;":"\u2A54","&Oscr;":"\u{1D4AA}","&Oslash":"\xD8","&Oslash;":"\xD8","&Otilde":"\xD5","&Otilde;":"\xD5","&Otimes;":"\u2A37","&Ouml":"\xD6","&Ouml;":"\xD6","&OverBar;":"\u203E","&OverBrace;":"\u23DE","&OverBracket;":"\u23B4","&OverParenthesis;":"\u23DC","&PartialD;":"\u2202","&Pcy;":"\u041F","&Pfr;":"\u{1D513}","&Phi;":"\u03A6","&Pi;":"\u03A0","&PlusMinus;":"\xB1","&Poincareplane;":"\u210C","&Popf;":"\u2119","&Pr;":"\u2ABB","&Precedes;":"\u227A","&PrecedesEqual;":"\u2AAF","&PrecedesSlantEqual;":"\u227C","&PrecedesTilde;":"\u227E","&Prime;":"\u2033","&Product;":"\u220F","&Proportion;":"\u2237","&Proportional;":"\u221D","&Pscr;":"\u{1D4AB}","&Psi;":"\u03A8","&QUOT":'"',"&QUOT;":'"',"&Qfr;":"\u{1D514}","&Qopf;":"\u211A","&Qscr;":"\u{1D4AC}","&RBarr;":"\u2910","&REG":"\xAE","&REG;":"\xAE","&Racute;":"\u0154","&Rang;":"\u27EB","&Rarr;":"\u21A0","&Rarrtl;":"\u2916","&Rcaron;":"\u0158","&Rcedil;":"\u0156","&Rcy;":"\u0420","&Re;":"\u211C","&ReverseElement;":"\u220B","&ReverseEquilibrium;":"\u21CB","&ReverseUpEquilibrium;":"\u296F","&Rfr;":"\u211C","&Rho;":"\u03A1","&RightAngleBracket;":"\u27E9","&RightArrow;":"\u2192","&RightArrowBar;":"\u21E5","&RightArrowLeftArrow;":"\u21C4","&RightCeiling;":"\u2309","&RightDoubleBracket;":"\u27E7","&RightDownTeeVector;":"\u295D","&RightDownVector;":"\u21C2","&RightDownVectorBar;":"\u2955","&RightFloor;":"\u230B","&RightTee;":"\u22A2","&RightTeeArrow;":"\u21A6","&RightTeeVector;":"\u295B","&RightTriangle;":"\u22B3","&RightTriangleBar;":"\u29D0","&RightTriangleEqual;":"\u22B5","&RightUpDownVector;":"\u294F","&RightUpTeeVector;":"\u295C","&RightUpVector;":"\u21BE","&RightUpVectorBar;":"\u2954","&RightVector;":"\u21C0","&RightVectorBar;":"\u2953","&Rightarrow;":"\u21D2","&Ropf;":"\u211D","&RoundImplies;":"\u2970","&Rrightarrow;":"\u21DB","&Rscr;":"\u211B","&Rsh;":"\u21B1","&RuleDelayed;":"\u29F4","&SHCHcy;":"\u0429","&SHcy;":"\u0428","&SOFTcy;":"\u042C","&Sacute;":"\u015A","&Sc;":"\u2ABC","&Scaron;":"\u0160","&Scedil;":"\u015E","&Scirc;":"\u015C","&Scy;":"\u0421","&Sfr;":"\u{1D516}","&ShortDownArrow;":"\u2193","&ShortLeftArrow;":"\u2190","&ShortRightArrow;":"\u2192","&ShortUpArrow;":"\u2191","&Sigma;":"\u03A3","&SmallCircle;":"\u2218","&Sopf;":"\u{1D54A}","&Sqrt;":"\u221A","&Square;":"\u25A1","&SquareIntersection;":"\u2293","&SquareSubset;":"\u228F","&SquareSubsetEqual;":"\u2291","&SquareSuperset;":"\u2290","&SquareSupersetEqual;":"\u2292","&SquareUnion;":"\u2294","&Sscr;":"\u{1D4AE}","&Star;":"\u22C6","&Sub;":"\u22D0","&Subset;":"\u22D0","&SubsetEqual;":"\u2286","&Succeeds;":"\u227B","&SucceedsEqual;":"\u2AB0","&SucceedsSlantEqual;":"\u227D","&SucceedsTilde;":"\u227F","&SuchThat;":"\u220B","&Sum;":"\u2211","&Sup;":"\u22D1","&Superset;":"\u2283","&SupersetEqual;":"\u2287","&Supset;":"\u22D1","&THORN":"\xDE","&THORN;":"\xDE","&TRADE;":"\u2122","&TSHcy;":"\u040B","&TScy;":"\u0426","&Tab;":" ","&Tau;":"\u03A4","&Tcaron;":"\u0164","&Tcedil;":"\u0162","&Tcy;":"\u0422","&Tfr;":"\u{1D517}","&Therefore;":"\u2234","&Theta;":"\u0398","&ThickSpace;":"\u205F\u200A","&ThinSpace;":"\u2009","&Tilde;":"\u223C","&TildeEqual;":"\u2243","&TildeFullEqual;":"\u2245","&TildeTilde;":"\u2248","&Topf;":"\u{1D54B}","&TripleDot;":"\u20DB","&Tscr;":"\u{1D4AF}","&Tstrok;":"\u0166","&Uacute":"\xDA","&Uacute;":"\xDA","&Uarr;":"\u219F","&Uarrocir;":"\u2949","&Ubrcy;":"\u040E","&Ubreve;":"\u016C","&Ucirc":"\xDB","&Ucirc;":"\xDB","&Ucy;":"\u0423","&Udblac;":"\u0170","&Ufr;":"\u{1D518}","&Ugrave":"\xD9","&Ugrave;":"\xD9","&Umacr;":"\u016A","&UnderBar;":"_","&UnderBrace;":"\u23DF","&UnderBracket;":"\u23B5","&UnderParenthesis;":"\u23DD","&Union;":"\u22C3","&UnionPlus;":"\u228E","&Uogon;":"\u0172","&Uopf;":"\u{1D54C}","&UpArrow;":"\u2191","&UpArrowBar;":"\u2912","&UpArrowDownArrow;":"\u21C5","&UpDownArrow;":"\u2195","&UpEquilibrium;":"\u296E","&UpTee;":"\u22A5","&UpTeeArrow;":"\u21A5","&Uparrow;":"\u21D1","&Updownarrow;":"\u21D5","&UpperLeftArrow;":"\u2196","&UpperRightArrow;":"\u2197","&Upsi;":"\u03D2","&Upsilon;":"\u03A5","&Uring;":"\u016E","&Uscr;":"\u{1D4B0}","&Utilde;":"\u0168","&Uuml":"\xDC","&Uuml;":"\xDC","&VDash;":"\u22AB","&Vbar;":"\u2AEB","&Vcy;":"\u0412","&Vdash;":"\u22A9","&Vdashl;":"\u2AE6","&Vee;":"\u22C1","&Verbar;":"\u2016","&Vert;":"\u2016","&VerticalBar;":"\u2223","&VerticalLine;":"|","&VerticalSeparator;":"\u2758","&VerticalTilde;":"\u2240","&VeryThinSpace;":"\u200A","&Vfr;":"\u{1D519}","&Vopf;":"\u{1D54D}","&Vscr;":"\u{1D4B1}","&Vvdash;":"\u22AA","&Wcirc;":"\u0174","&Wedge;":"\u22C0","&Wfr;":"\u{1D51A}","&Wopf;":"\u{1D54E}","&Wscr;":"\u{1D4B2}","&Xfr;":"\u{1D51B}","&Xi;":"\u039E","&Xopf;":"\u{1D54F}","&Xscr;":"\u{1D4B3}","&YAcy;":"\u042F","&YIcy;":"\u0407","&YUcy;":"\u042E","&Yacute":"\xDD","&Yacute;":"\xDD","&Ycirc;":"\u0176","&Ycy;":"\u042B","&Yfr;":"\u{1D51C}","&Yopf;":"\u{1D550}","&Yscr;":"\u{1D4B4}","&Yuml;":"\u0178","&ZHcy;":"\u0416","&Zacute;":"\u0179","&Zcaron;":"\u017D","&Zcy;":"\u0417","&Zdot;":"\u017B","&ZeroWidthSpace;":"\u200B","&Zeta;":"\u0396","&Zfr;":"\u2128","&Zopf;":"\u2124","&Zscr;":"\u{1D4B5}","&aacute":"\xE1","&aacute;":"\xE1","&abreve;":"\u0103","&ac;":"\u223E","&acE;":"\u223E\u0333","&acd;":"\u223F","&acirc":"\xE2","&acirc;":"\xE2","&acute":"\xB4","&acute;":"\xB4","&acy;":"\u0430","&aelig":"\xE6","&aelig;":"\xE6","&af;":"\u2061","&afr;":"\u{1D51E}","&agrave":"\xE0","&agrave;":"\xE0","&alefsym;":"\u2135","&aleph;":"\u2135","&alpha;":"\u03B1","&amacr;":"\u0101","&amalg;":"\u2A3F","&amp":"&","&amp;":"&","&and;":"\u2227","&andand;":"\u2A55","&andd;":"\u2A5C","&andslope;":"\u2A58","&andv;":"\u2A5A","&ang;":"\u2220","&ange;":"\u29A4","&angle;":"\u2220","&angmsd;":"\u2221","&angmsdaa;":"\u29A8","&angmsdab;":"\u29A9","&angmsdac;":"\u29AA","&angmsdad;":"\u29AB","&angmsdae;":"\u29AC","&angmsdaf;":"\u29AD","&angmsdag;":"\u29AE","&angmsdah;":"\u29AF","&angrt;":"\u221F","&angrtvb;":"\u22BE","&angrtvbd;":"\u299D","&angsph;":"\u2222","&angst;":"\xC5","&angzarr;":"\u237C","&aogon;":"\u0105","&aopf;":"\u{1D552}","&ap;":"\u2248","&apE;":"\u2A70","&apacir;":"\u2A6F","&ape;":"\u224A","&apid;":"\u224B","&apos;":"'","&approx;":"\u2248","&approxeq;":"\u224A","&aring":"\xE5","&aring;":"\xE5","&ascr;":"\u{1D4B6}","&ast;":"*","&asymp;":"\u2248","&asympeq;":"\u224D","&atilde":"\xE3","&atilde;":"\xE3","&auml":"\xE4","&auml;":"\xE4","&awconint;":"\u2233","&awint;":"\u2A11","&bNot;":"\u2AED","&backcong;":"\u224C","&backepsilon;":"\u03F6","&backprime;":"\u2035","&backsim;":"\u223D","&backsimeq;":"\u22CD","&barvee;":"\u22BD","&barwed;":"\u2305","&barwedge;":"\u2305","&bbrk;":"\u23B5","&bbrktbrk;":"\u23B6","&bcong;":"\u224C","&bcy;":"\u0431","&bdquo;":"\u201E","&becaus;":"\u2235","&because;":"\u2235","&bemptyv;":"\u29B0","&bepsi;":"\u03F6","&bernou;":"\u212C","&beta;":"\u03B2","&beth;":"\u2136","&between;":"\u226C","&bfr;":"\u{1D51F}","&bigcap;":"\u22C2","&bigcirc;":"\u25EF","&bigcup;":"\u22C3","&bigodot;":"\u2A00","&bigoplus;":"\u2A01","&bigotimes;":"\u2A02","&bigsqcup;":"\u2A06","&bigstar;":"\u2605","&bigtriangledown;":"\u25BD","&bigtriangleup;":"\u25B3","&biguplus;":"\u2A04","&bigvee;":"\u22C1","&bigwedge;":"\u22C0","&bkarow;":"\u290D","&blacklozenge;":"\u29EB","&blacksquare;":"\u25AA","&blacktriangle;":"\u25B4","&blacktriangledown;":"\u25BE","&blacktriangleleft;":"\u25C2","&blacktriangleright;":"\u25B8","&blank;":"\u2423","&blk12;":"\u2592","&blk14;":"\u2591","&blk34;":"\u2593","&block;":"\u2588","&bne;":"=\u20E5","&bnequiv;":"\u2261\u20E5","&bnot;":"\u2310","&bopf;":"\u{1D553}","&bot;":"\u22A5","&bottom;":"\u22A5","&bowtie;":"\u22C8","&boxDL;":"\u2557","&boxDR;":"\u2554","&boxDl;":"\u2556","&boxDr;":"\u2553","&boxH;":"\u2550","&boxHD;":"\u2566","&boxHU;":"\u2569","&boxHd;":"\u2564","&boxHu;":"\u2567","&boxUL;":"\u255D","&boxUR;":"\u255A","&boxUl;":"\u255C","&boxUr;":"\u2559","&boxV;":"\u2551","&boxVH;":"\u256C","&boxVL;":"\u2563","&boxVR;":"\u2560","&boxVh;":"\u256B","&boxVl;":"\u2562","&boxVr;":"\u255F","&boxbox;":"\u29C9","&boxdL;":"\u2555","&boxdR;":"\u2552","&boxdl;":"\u2510","&boxdr;":"\u250C","&boxh;":"\u2500","&boxhD;":"\u2565","&boxhU;":"\u2568","&boxhd;":"\u252C","&boxhu;":"\u2534","&boxminus;":"\u229F","&boxplus;":"\u229E","&boxtimes;":"\u22A0","&boxuL;":"\u255B","&boxuR;":"\u2558","&boxul;":"\u2518","&boxur;":"\u2514","&boxv;":"\u2502","&boxvH;":"\u256A","&boxvL;":"\u2561","&boxvR;":"\u255E","&boxvh;":"\u253C","&boxvl;":"\u2524","&boxvr;":"\u251C","&bprime;":"\u2035","&breve;":"\u02D8","&brvbar":"\xA6","&brvbar;":"\xA6","&bscr;":"\u{1D4B7}","&bsemi;":"\u204F","&bsim;":"\u223D","&bsime;":"\u22CD","&bsol;":"\\","&bsolb;":"\u29C5","&bsolhsub;":"\u27C8","&bull;":"\u2022","&bullet;":"\u2022","&bump;":"\u224E","&bumpE;":"\u2AAE","&bumpe;":"\u224F","&bumpeq;":"\u224F","&cacute;":"\u0107","&cap;":"\u2229","&capand;":"\u2A44","&capbrcup;":"\u2A49","&capcap;":"\u2A4B","&capcup;":"\u2A47","&capdot;":"\u2A40","&caps;":"\u2229\uFE00","&caret;":"\u2041","&caron;":"\u02C7","&ccaps;":"\u2A4D","&ccaron;":"\u010D","&ccedil":"\xE7","&ccedil;":"\xE7","&ccirc;":"\u0109","&ccups;":"\u2A4C","&ccupssm;":"\u2A50","&cdot;":"\u010B","&cedil":"\xB8","&cedil;":"\xB8","&cemptyv;":"\u29B2","&cent":"\xA2","&cent;":"\xA2","&centerdot;":"\xB7","&cfr;":"\u{1D520}","&chcy;":"\u0447","&check;":"\u2713","&checkmark;":"\u2713","&chi;":"\u03C7","&cir;":"\u25CB","&cirE;":"\u29C3","&circ;":"\u02C6","&circeq;":"\u2257","&circlearrowleft;":"\u21BA","&circlearrowright;":"\u21BB","&circledR;":"\xAE","&circledS;":"\u24C8","&circledast;":"\u229B","&circledcirc;":"\u229A","&circleddash;":"\u229D","&cire;":"\u2257","&cirfnint;":"\u2A10","&cirmid;":"\u2AEF","&cirscir;":"\u29C2","&clubs;":"\u2663","&clubsuit;":"\u2663","&colon;":":","&colone;":"\u2254","&coloneq;":"\u2254","&comma;":",","&commat;":"@","&comp;":"\u2201","&compfn;":"\u2218","&complement;":"\u2201","&complexes;":"\u2102","&cong;":"\u2245","&congdot;":"\u2A6D","&conint;":"\u222E","&copf;":"\u{1D554}","&coprod;":"\u2210","&copy":"\xA9","&copy;":"\xA9","&copysr;":"\u2117","&crarr;":"\u21B5","&cross;":"\u2717","&cscr;":"\u{1D4B8}","&csub;":"\u2ACF","&csube;":"\u2AD1","&csup;":"\u2AD0","&csupe;":"\u2AD2","&ctdot;":"\u22EF","&cudarrl;":"\u2938","&cudarrr;":"\u2935","&cuepr;":"\u22DE","&cuesc;":"\u22DF","&cularr;":"\u21B6","&cularrp;":"\u293D","&cup;":"\u222A","&cupbrcap;":"\u2A48","&cupcap;":"\u2A46","&cupcup;":"\u2A4A","&cupdot;":"\u228D","&cupor;":"\u2A45","&cups;":"\u222A\uFE00","&curarr;":"\u21B7","&curarrm;":"\u293C","&curlyeqprec;":"\u22DE","&curlyeqsucc;":"\u22DF","&curlyvee;":"\u22CE","&curlywedge;":"\u22CF","&curren":"\xA4","&curren;":"\xA4","&curvearrowleft;":"\u21B6","&curvearrowright;":"\u21B7","&cuvee;":"\u22CE","&cuwed;":"\u22CF","&cwconint;":"\u2232","&cwint;":"\u2231","&cylcty;":"\u232D","&dArr;":"\u21D3","&dHar;":"\u2965","&dagger;":"\u2020","&daleth;":"\u2138","&darr;":"\u2193","&dash;":"\u2010","&dashv;":"\u22A3","&dbkarow;":"\u290F","&dblac;":"\u02DD","&dcaron;":"\u010F","&dcy;":"\u0434","&dd;":"\u2146","&ddagger;":"\u2021","&ddarr;":"\u21CA","&ddotseq;":"\u2A77","&deg":"\xB0","&deg;":"\xB0","&delta;":"\u03B4","&demptyv;":"\u29B1","&dfisht;":"\u297F","&dfr;":"\u{1D521}","&dharl;":"\u21C3","&dharr;":"\u21C2","&diam;":"\u22C4","&diamond;":"\u22C4","&diamondsuit;":"\u2666","&diams;":"\u2666","&die;":"\xA8","&digamma;":"\u03DD","&disin;":"\u22F2","&div;":"\xF7","&divide":"\xF7","&divide;":"\xF7","&divideontimes;":"\u22C7","&divonx;":"\u22C7","&djcy;":"\u0452","&dlcorn;":"\u231E","&dlcrop;":"\u230D","&dollar;":"$","&dopf;":"\u{1D555}","&dot;":"\u02D9","&doteq;":"\u2250","&doteqdot;":"\u2251","&dotminus;":"\u2238","&dotplus;":"\u2214","&dotsquare;":"\u22A1","&doublebarwedge;":"\u2306","&downarrow;":"\u2193","&downdownarrows;":"\u21CA","&downharpoonleft;":"\u21C3","&downharpoonright;":"\u21C2","&drbkarow;":"\u2910","&drcorn;":"\u231F","&drcrop;":"\u230C","&dscr;":"\u{1D4B9}","&dscy;":"\u0455","&dsol;":"\u29F6","&dstrok;":"\u0111","&dtdot;":"\u22F1","&dtri;":"\u25BF","&dtrif;":"\u25BE","&duarr;":"\u21F5","&duhar;":"\u296F","&dwangle;":"\u29A6","&dzcy;":"\u045F","&dzigrarr;":"\u27FF","&eDDot;":"\u2A77","&eDot;":"\u2251","&eacute":"\xE9","&eacute;":"\xE9","&easter;":"\u2A6E","&ecaron;":"\u011B","&ecir;":"\u2256","&ecirc":"\xEA","&ecirc;":"\xEA","&ecolon;":"\u2255","&ecy;":"\u044D","&edot;":"\u0117","&ee;":"\u2147","&efDot;":"\u2252","&efr;":"\u{1D522}","&eg;":"\u2A9A","&egrave":"\xE8","&egrave;":"\xE8","&egs;":"\u2A96","&egsdot;":"\u2A98","&el;":"\u2A99","&elinters;":"\u23E7","&ell;":"\u2113","&els;":"\u2A95","&elsdot;":"\u2A97","&emacr;":"\u0113","&empty;":"\u2205","&emptyset;":"\u2205","&emptyv;":"\u2205","&emsp13;":"\u2004","&emsp14;":"\u2005","&emsp;":"\u2003","&eng;":"\u014B","&ensp;":"\u2002","&eogon;":"\u0119","&eopf;":"\u{1D556}","&epar;":"\u22D5","&eparsl;":"\u29E3","&eplus;":"\u2A71","&epsi;":"\u03B5","&epsilon;":"\u03B5","&epsiv;":"\u03F5","&eqcirc;":"\u2256","&eqcolon;":"\u2255","&eqsim;":"\u2242","&eqslantgtr;":"\u2A96","&eqslantless;":"\u2A95","&equals;":"=","&equest;":"\u225F","&equiv;":"\u2261","&equivDD;":"\u2A78","&eqvparsl;":"\u29E5","&erDot;":"\u2253","&erarr;":"\u2971","&escr;":"\u212F","&esdot;":"\u2250","&esim;":"\u2242","&eta;":"\u03B7","&eth":"\xF0","&eth;":"\xF0","&euml":"\xEB","&euml;":"\xEB","&euro;":"\u20AC","&excl;":"!","&exist;":"\u2203","&expectation;":"\u2130","&exponentiale;":"\u2147","&fallingdotseq;":"\u2252","&fcy;":"\u0444","&female;":"\u2640","&ffilig;":"\uFB03","&fflig;":"\uFB00","&ffllig;":"\uFB04","&ffr;":"\u{1D523}","&filig;":"\uFB01","&fjlig;":"fj","&flat;":"\u266D","&fllig;":"\uFB02","&fltns;":"\u25B1","&fnof;":"\u0192","&fopf;":"\u{1D557}","&forall;":"\u2200","&fork;":"\u22D4","&forkv;":"\u2AD9","&fpartint;":"\u2A0D","&frac12":"\xBD","&frac12;":"\xBD","&frac13;":"\u2153","&frac14":"\xBC","&frac14;":"\xBC","&frac15;":"\u2155","&frac16;":"\u2159","&frac18;":"\u215B","&frac23;":"\u2154","&frac25;":"\u2156","&frac34":"\xBE","&frac34;":"\xBE","&frac35;":"\u2157","&frac38;":"\u215C","&frac45;":"\u2158","&frac56;":"\u215A","&frac58;":"\u215D","&frac78;":"\u215E","&frasl;":"\u2044","&frown;":"\u2322","&fscr;":"\u{1D4BB}","&gE;":"\u2267","&gEl;":"\u2A8C","&gacute;":"\u01F5","&gamma;":"\u03B3","&gammad;":"\u03DD","&gap;":"\u2A86","&gbreve;":"\u011F","&gcirc;":"\u011D","&gcy;":"\u0433","&gdot;":"\u0121","&ge;":"\u2265","&gel;":"\u22DB","&geq;":"\u2265","&geqq;":"\u2267","&geqslant;":"\u2A7E","&ges;":"\u2A7E","&gescc;":"\u2AA9","&gesdot;":"\u2A80","&gesdoto;":"\u2A82","&gesdotol;":"\u2A84","&gesl;":"\u22DB\uFE00","&gesles;":"\u2A94","&gfr;":"\u{1D524}","&gg;":"\u226B","&ggg;":"\u22D9","&gimel;":"\u2137","&gjcy;":"\u0453","&gl;":"\u2277","&glE;":"\u2A92","&gla;":"\u2AA5","&glj;":"\u2AA4","&gnE;":"\u2269","&gnap;":"\u2A8A","&gnapprox;":"\u2A8A","&gne;":"\u2A88","&gneq;":"\u2A88","&gneqq;":"\u2269","&gnsim;":"\u22E7","&gopf;":"\u{1D558}","&grave;":"`","&gscr;":"\u210A","&gsim;":"\u2273","&gsime;":"\u2A8E","&gsiml;":"\u2A90","&gt":">","&gt;":">","&gtcc;":"\u2AA7","&gtcir;":"\u2A7A","&gtdot;":"\u22D7","&gtlPar;":"\u2995","&gtquest;":"\u2A7C","&gtrapprox;":"\u2A86","&gtrarr;":"\u2978","&gtrdot;":"\u22D7","&gtreqless;":"\u22DB","&gtreqqless;":"\u2A8C","&gtrless;":"\u2277","&gtrsim;":"\u2273","&gvertneqq;":"\u2269\uFE00","&gvnE;":"\u2269\uFE00","&hArr;":"\u21D4","&hairsp;":"\u200A","&half;":"\xBD","&hamilt;":"\u210B","&hardcy;":"\u044A","&harr;":"\u2194","&harrcir;":"\u2948","&harrw;":"\u21AD","&hbar;":"\u210F","&hcirc;":"\u0125","&hearts;":"\u2665","&heartsuit;":"\u2665","&hellip;":"\u2026","&hercon;":"\u22B9","&hfr;":"\u{1D525}","&hksearow;":"\u2925","&hkswarow;":"\u2926","&hoarr;":"\u21FF","&homtht;":"\u223B","&hookleftarrow;":"\u21A9","&hookrightarrow;":"\u21AA","&hopf;":"\u{1D559}","&horbar;":"\u2015","&hscr;":"\u{1D4BD}","&hslash;":"\u210F","&hstrok;":"\u0127","&hybull;":"\u2043","&hyphen;":"\u2010","&iacute":"\xED","&iacute;":"\xED","&ic;":"\u2063","&icirc":"\xEE","&icirc;":"\xEE","&icy;":"\u0438","&iecy;":"\u0435","&iexcl":"\xA1","&iexcl;":"\xA1","&iff;":"\u21D4","&ifr;":"\u{1D526}","&igrave":"\xEC","&igrave;":"\xEC","&ii;":"\u2148","&iiiint;":"\u2A0C","&iiint;":"\u222D","&iinfin;":"\u29DC","&iiota;":"\u2129","&ijlig;":"\u0133","&imacr;":"\u012B","&image;":"\u2111","&imagline;":"\u2110","&imagpart;":"\u2111","&imath;":"\u0131","&imof;":"\u22B7","&imped;":"\u01B5","&in;":"\u2208","&incare;":"\u2105","&infin;":"\u221E","&infintie;":"\u29DD","&inodot;":"\u0131","&int;":"\u222B","&intcal;":"\u22BA","&integers;":"\u2124","&intercal;":"\u22BA","&intlarhk;":"\u2A17","&intprod;":"\u2A3C","&iocy;":"\u0451","&iogon;":"\u012F","&iopf;":"\u{1D55A}","&iota;":"\u03B9","&iprod;":"\u2A3C","&iquest":"\xBF","&iquest;":"\xBF","&iscr;":"\u{1D4BE}","&isin;":"\u2208","&isinE;":"\u22F9","&isindot;":"\u22F5","&isins;":"\u22F4","&isinsv;":"\u22F3","&isinv;":"\u2208","&it;":"\u2062","&itilde;":"\u0129","&iukcy;":"\u0456","&iuml":"\xEF","&iuml;":"\xEF","&jcirc;":"\u0135","&jcy;":"\u0439","&jfr;":"\u{1D527}","&jmath;":"\u0237","&jopf;":"\u{1D55B}","&jscr;":"\u{1D4BF}","&jsercy;":"\u0458","&jukcy;":"\u0454","&kappa;":"\u03BA","&kappav;":"\u03F0","&kcedil;":"\u0137","&kcy;":"\u043A","&kfr;":"\u{1D528}","&kgreen;":"\u0138","&khcy;":"\u0445","&kjcy;":"\u045C","&kopf;":"\u{1D55C}","&kscr;":"\u{1D4C0}","&lAarr;":"\u21DA","&lArr;":"\u21D0","&lAtail;":"\u291B","&lBarr;":"\u290E","&lE;":"\u2266","&lEg;":"\u2A8B","&lHar;":"\u2962","&lacute;":"\u013A","&laemptyv;":"\u29B4","&lagran;":"\u2112","&lambda;":"\u03BB","&lang;":"\u27E8","&langd;":"\u2991","&langle;":"\u27E8","&lap;":"\u2A85","&laquo":"\xAB","&laquo;":"\xAB","&larr;":"\u2190","&larrb;":"\u21E4","&larrbfs;":"\u291F","&larrfs;":"\u291D","&larrhk;":"\u21A9","&larrlp;":"\u21AB","&larrpl;":"\u2939","&larrsim;":"\u2973","&larrtl;":"\u21A2","&lat;":"\u2AAB","&latail;":"\u2919","&late;":"\u2AAD","&lates;":"\u2AAD\uFE00","&lbarr;":"\u290C","&lbbrk;":"\u2772","&lbrace;":"{","&lbrack;":"[","&lbrke;":"\u298B","&lbrksld;":"\u298F","&lbrkslu;":"\u298D","&lcaron;":"\u013E","&lcedil;":"\u013C","&lceil;":"\u2308","&lcub;":"{","&lcy;":"\u043B","&ldca;":"\u2936","&ldquo;":"\u201C","&ldquor;":"\u201E","&ldrdhar;":"\u2967","&ldrushar;":"\u294B","&ldsh;":"\u21B2","&le;":"\u2264","&leftarrow;":"\u2190","&leftarrowtail;":"\u21A2","&leftharpoondown;":"\u21BD","&leftharpoonup;":"\u21BC","&leftleftarrows;":"\u21C7","&leftrightarrow;":"\u2194","&leftrightarrows;":"\u21C6","&leftrightharpoons;":"\u21CB","&leftrightsquigarrow;":"\u21AD","&leftthreetimes;":"\u22CB","&leg;":"\u22DA","&leq;":"\u2264","&leqq;":"\u2266","&leqslant;":"\u2A7D","&les;":"\u2A7D","&lescc;":"\u2AA8","&lesdot;":"\u2A7F","&lesdoto;":"\u2A81","&lesdotor;":"\u2A83","&lesg;":"\u22DA\uFE00","&lesges;":"\u2A93","&lessapprox;":"\u2A85","&lessdot;":"\u22D6","&lesseqgtr;":"\u22DA","&lesseqqgtr;":"\u2A8B","&lessgtr;":"\u2276","&lesssim;":"\u2272","&lfisht;":"\u297C","&lfloor;":"\u230A","&lfr;":"\u{1D529}","&lg;":"\u2276","&lgE;":"\u2A91","&lhard;":"\u21BD","&lharu;":"\u21BC","&lharul;":"\u296A","&lhblk;":"\u2584","&ljcy;":"\u0459","&ll;":"\u226A","&llarr;":"\u21C7","&llcorner;":"\u231E","&llhard;":"\u296B","&lltri;":"\u25FA","&lmidot;":"\u0140","&lmoust;":"\u23B0","&lmoustache;":"\u23B0","&lnE;":"\u2268","&lnap;":"\u2A89","&lnapprox;":"\u2A89","&lne;":"\u2A87","&lneq;":"\u2A87","&lneqq;":"\u2268","&lnsim;":"\u22E6","&loang;":"\u27EC","&loarr;":"\u21FD","&lobrk;":"\u27E6","&longleftarrow;":"\u27F5","&longleftrightarrow;":"\u27F7","&longmapsto;":"\u27FC","&longrightarrow;":"\u27F6","&looparrowleft;":"\u21AB","&looparrowright;":"\u21AC","&lopar;":"\u2985","&lopf;":"\u{1D55D}","&loplus;":"\u2A2D","&lotimes;":"\u2A34","&lowast;":"\u2217","&lowbar;":"_","&loz;":"\u25CA","&lozenge;":"\u25CA","&lozf;":"\u29EB","&lpar;":"(","&lparlt;":"\u2993","&lrarr;":"\u21C6","&lrcorner;":"\u231F","&lrhar;":"\u21CB","&lrhard;":"\u296D","&lrm;":"\u200E","&lrtri;":"\u22BF","&lsaquo;":"\u2039","&lscr;":"\u{1D4C1}","&lsh;":"\u21B0","&lsim;":"\u2272","&lsime;":"\u2A8D","&lsimg;":"\u2A8F","&lsqb;":"[","&lsquo;":"\u2018","&lsquor;":"\u201A","&lstrok;":"\u0142","&lt":"<","&lt;":"<","&ltcc;":"\u2AA6","&ltcir;":"\u2A79","&ltdot;":"\u22D6","&lthree;":"\u22CB","&ltimes;":"\u22C9","&ltlarr;":"\u2976","&ltquest;":"\u2A7B","&ltrPar;":"\u2996","&ltri;":"\u25C3","&ltrie;":"\u22B4","&ltrif;":"\u25C2","&lurdshar;":"\u294A","&luruhar;":"\u2966","&lvertneqq;":"\u2268\uFE00","&lvnE;":"\u2268\uFE00","&mDDot;":"\u223A","&macr":"\xAF","&macr;":"\xAF","&male;":"\u2642","&malt;":"\u2720","&maltese;":"\u2720","&map;":"\u21A6","&mapsto;":"\u21A6","&mapstodown;":"\u21A7","&mapstoleft;":"\u21A4","&mapstoup;":"\u21A5","&marker;":"\u25AE","&mcomma;":"\u2A29","&mcy;":"\u043C","&mdash;":"\u2014","&measuredangle;":"\u2221","&mfr;":"\u{1D52A}","&mho;":"\u2127","&micro":"\xB5","&micro;":"\xB5","&mid;":"\u2223","&midast;":"*","&midcir;":"\u2AF0","&middot":"\xB7","&middot;":"\xB7","&minus;":"\u2212","&minusb;":"\u229F","&minusd;":"\u2238","&minusdu;":"\u2A2A","&mlcp;":"\u2ADB","&mldr;":"\u2026","&mnplus;":"\u2213","&models;":"\u22A7","&mopf;":"\u{1D55E}","&mp;":"\u2213","&mscr;":"\u{1D4C2}","&mstpos;":"\u223E","&mu;":"\u03BC","&multimap;":"\u22B8","&mumap;":"\u22B8","&nGg;":"\u22D9\u0338","&nGt;":"\u226B\u20D2","&nGtv;":"\u226B\u0338","&nLeftarrow;":"\u21CD","&nLeftrightarrow;":"\u21CE","&nLl;":"\u22D8\u0338","&nLt;":"\u226A\u20D2","&nLtv;":"\u226A\u0338","&nRightarrow;":"\u21CF","&nVDash;":"\u22AF","&nVdash;":"\u22AE","&nabla;":"\u2207","&nacute;":"\u0144","&nang;":"\u2220\u20D2","&nap;":"\u2249","&napE;":"\u2A70\u0338","&napid;":"\u224B\u0338","&napos;":"\u0149","&napprox;":"\u2249","&natur;":"\u266E","&natural;":"\u266E","&naturals;":"\u2115","&nbsp":"\xA0","&nbsp;":"\xA0","&nbump;":"\u224E\u0338","&nbumpe;":"\u224F\u0338","&ncap;":"\u2A43","&ncaron;":"\u0148","&ncedil;":"\u0146","&ncong;":"\u2247","&ncongdot;":"\u2A6D\u0338","&ncup;":"\u2A42","&ncy;":"\u043D","&ndash;":"\u2013","&ne;":"\u2260","&neArr;":"\u21D7","&nearhk;":"\u2924","&nearr;":"\u2197","&nearrow;":"\u2197","&nedot;":"\u2250\u0338","&nequiv;":"\u2262","&nesear;":"\u2928","&nesim;":"\u2242\u0338","&nexist;":"\u2204","&nexists;":"\u2204","&nfr;":"\u{1D52B}","&ngE;":"\u2267\u0338","&nge;":"\u2271","&ngeq;":"\u2271","&ngeqq;":"\u2267\u0338","&ngeqslant;":"\u2A7E\u0338","&nges;":"\u2A7E\u0338","&ngsim;":"\u2275","&ngt;":"\u226F","&ngtr;":"\u226F","&nhArr;":"\u21CE","&nharr;":"\u21AE","&nhpar;":"\u2AF2","&ni;":"\u220B","&nis;":"\u22FC","&nisd;":"\u22FA","&niv;":"\u220B","&njcy;":"\u045A","&nlArr;":"\u21CD","&nlE;":"\u2266\u0338","&nlarr;":"\u219A","&nldr;":"\u2025","&nle;":"\u2270","&nleftarrow;":"\u219A","&nleftrightarrow;":"\u21AE","&nleq;":"\u2270","&nleqq;":"\u2266\u0338","&nleqslant;":"\u2A7D\u0338","&nles;":"\u2A7D\u0338","&nless;":"\u226E","&nlsim;":"\u2274","&nlt;":"\u226E","&nltri;":"\u22EA","&nltrie;":"\u22EC","&nmid;":"\u2224","&nopf;":"\u{1D55F}","&not":"\xAC","&not;":"\xAC","&notin;":"\u2209","&notinE;":"\u22F9\u0338","&notindot;":"\u22F5\u0338","&notinva;":"\u2209","&notinvb;":"\u22F7","&notinvc;":"\u22F6","&notni;":"\u220C","&notniva;":"\u220C","&notnivb;":"\u22FE","&notnivc;":"\u22FD","&npar;":"\u2226","&nparallel;":"\u2226","&nparsl;":"\u2AFD\u20E5","&npart;":"\u2202\u0338","&npolint;":"\u2A14","&npr;":"\u2280","&nprcue;":"\u22E0","&npre;":"\u2AAF\u0338","&nprec;":"\u2280","&npreceq;":"\u2AAF\u0338","&nrArr;":"\u21CF","&nrarr;":"\u219B","&nrarrc;":"\u2933\u0338","&nrarrw;":"\u219D\u0338","&nrightarrow;":"\u219B","&nrtri;":"\u22EB","&nrtrie;":"\u22ED","&nsc;":"\u2281","&nsccue;":"\u22E1","&nsce;":"\u2AB0\u0338","&nscr;":"\u{1D4C3}","&nshortmid;":"\u2224","&nshortparallel;":"\u2226","&nsim;":"\u2241","&nsime;":"\u2244","&nsimeq;":"\u2244","&nsmid;":"\u2224","&nspar;":"\u2226","&nsqsube;":"\u22E2","&nsqsupe;":"\u22E3","&nsub;":"\u2284","&nsubE;":"\u2AC5\u0338","&nsube;":"\u2288","&nsubset;":"\u2282\u20D2","&nsubseteq;":"\u2288","&nsubseteqq;":"\u2AC5\u0338","&nsucc;":"\u2281","&nsucceq;":"\u2AB0\u0338","&nsup;":"\u2285","&nsupE;":"\u2AC6\u0338","&nsupe;":"\u2289","&nsupset;":"\u2283\u20D2","&nsupseteq;":"\u2289","&nsupseteqq;":"\u2AC6\u0338","&ntgl;":"\u2279","&ntilde":"\xF1","&ntilde;":"\xF1","&ntlg;":"\u2278","&ntriangleleft;":"\u22EA","&ntrianglelefteq;":"\u22EC","&ntriangleright;":"\u22EB","&ntrianglerighteq;":"\u22ED","&nu;":"\u03BD","&num;":"#","&numero;":"\u2116","&numsp;":"\u2007","&nvDash;":"\u22AD","&nvHarr;":"\u2904","&nvap;":"\u224D\u20D2","&nvdash;":"\u22AC","&nvge;":"\u2265\u20D2","&nvgt;":">\u20D2","&nvinfin;":"\u29DE","&nvlArr;":"\u2902","&nvle;":"\u2264\u20D2","&nvlt;":"<\u20D2","&nvltrie;":"\u22B4\u20D2","&nvrArr;":"\u2903","&nvrtrie;":"\u22B5\u20D2","&nvsim;":"\u223C\u20D2","&nwArr;":"\u21D6","&nwarhk;":"\u2923","&nwarr;":"\u2196","&nwarrow;":"\u2196","&nwnear;":"\u2927","&oS;":"\u24C8","&oacute":"\xF3","&oacute;":"\xF3","&oast;":"\u229B","&ocir;":"\u229A","&ocirc":"\xF4","&ocirc;":"\xF4","&ocy;":"\u043E","&odash;":"\u229D","&odblac;":"\u0151","&odiv;":"\u2A38","&odot;":"\u2299","&odsold;":"\u29BC","&oelig;":"\u0153","&ofcir;":"\u29BF","&ofr;":"\u{1D52C}","&ogon;":"\u02DB","&ograve":"\xF2","&ograve;":"\xF2","&ogt;":"\u29C1","&ohbar;":"\u29B5","&ohm;":"\u03A9","&oint;":"\u222E","&olarr;":"\u21BA","&olcir;":"\u29BE","&olcross;":"\u29BB","&oline;":"\u203E","&olt;":"\u29C0","&omacr;":"\u014D","&omega;":"\u03C9","&omicron;":"\u03BF","&omid;":"\u29B6","&ominus;":"\u2296","&oopf;":"\u{1D560}","&opar;":"\u29B7","&operp;":"\u29B9","&oplus;":"\u2295","&or;":"\u2228","&orarr;":"\u21BB","&ord;":"\u2A5D","&order;":"\u2134","&orderof;":"\u2134","&ordf":"\xAA","&ordf;":"\xAA","&ordm":"\xBA","&ordm;":"\xBA","&origof;":"\u22B6","&oror;":"\u2A56","&orslope;":"\u2A57","&orv;":"\u2A5B","&oscr;":"\u2134","&oslash":"\xF8","&oslash;":"\xF8","&osol;":"\u2298","&otilde":"\xF5","&otilde;":"\xF5","&otimes;":"\u2297","&otimesas;":"\u2A36","&ouml":"\xF6","&ouml;":"\xF6","&ovbar;":"\u233D","&par;":"\u2225","&para":"\xB6","&para;":"\xB6","&parallel;":"\u2225","&parsim;":"\u2AF3","&parsl;":"\u2AFD","&part;":"\u2202","&pcy;":"\u043F","&percnt;":"%","&period;":".","&permil;":"\u2030","&perp;":"\u22A5","&pertenk;":"\u2031","&pfr;":"\u{1D52D}","&phi;":"\u03C6","&phiv;":"\u03D5","&phmmat;":"\u2133","&phone;":"\u260E","&pi;":"\u03C0","&pitchfork;":"\u22D4","&piv;":"\u03D6","&planck;":"\u210F","&planckh;":"\u210E","&plankv;":"\u210F","&plus;":"+","&plusacir;":"\u2A23","&plusb;":"\u229E","&pluscir;":"\u2A22","&plusdo;":"\u2214","&plusdu;":"\u2A25","&pluse;":"\u2A72","&plusmn":"\xB1","&plusmn;":"\xB1","&plussim;":"\u2A26","&plustwo;":"\u2A27","&pm;":"\xB1","&pointint;":"\u2A15","&popf;":"\u{1D561}","&pound":"\xA3","&pound;":"\xA3","&pr;":"\u227A","&prE;":"\u2AB3","&prap;":"\u2AB7","&prcue;":"\u227C","&pre;":"\u2AAF","&prec;":"\u227A","&precapprox;":"\u2AB7","&preccurlyeq;":"\u227C","&preceq;":"\u2AAF","&precnapprox;":"\u2AB9","&precneqq;":"\u2AB5","&precnsim;":"\u22E8","&precsim;":"\u227E","&prime;":"\u2032","&primes;":"\u2119","&prnE;":"\u2AB5","&prnap;":"\u2AB9","&prnsim;":"\u22E8","&prod;":"\u220F","&profalar;":"\u232E","&profline;":"\u2312","&profsurf;":"\u2313","&prop;":"\u221D","&propto;":"\u221D","&prsim;":"\u227E","&prurel;":"\u22B0","&pscr;":"\u{1D4C5}","&psi;":"\u03C8","&puncsp;":"\u2008","&qfr;":"\u{1D52E}","&qint;":"\u2A0C","&qopf;":"\u{1D562}","&qprime;":"\u2057","&qscr;":"\u{1D4C6}","&quaternions;":"\u210D","&quatint;":"\u2A16","&quest;":"?","&questeq;":"\u225F","&quot":'"',"&quot;":'"',"&rAarr;":"\u21DB","&rArr;":"\u21D2","&rAtail;":"\u291C","&rBarr;":"\u290F","&rHar;":"\u2964","&race;":"\u223D\u0331","&racute;":"\u0155","&radic;":"\u221A","&raemptyv;":"\u29B3","&rang;":"\u27E9","&rangd;":"\u2992","&range;":"\u29A5","&rangle;":"\u27E9","&raquo":"\xBB","&raquo;":"\xBB","&rarr;":"\u2192","&rarrap;":"\u2975","&rarrb;":"\u21E5","&rarrbfs;":"\u2920","&rarrc;":"\u2933","&rarrfs;":"\u291E","&rarrhk;":"\u21AA","&rarrlp;":"\u21AC","&rarrpl;":"\u2945","&rarrsim;":"\u2974","&rarrtl;":"\u21A3","&rarrw;":"\u219D","&ratail;":"\u291A","&ratio;":"\u2236","&rationals;":"\u211A","&rbarr;":"\u290D","&rbbrk;":"\u2773","&rbrace;":"}","&rbrack;":"]","&rbrke;":"\u298C","&rbrksld;":"\u298E","&rbrkslu;":"\u2990","&rcaron;":"\u0159","&rcedil;":"\u0157","&rceil;":"\u2309","&rcub;":"}","&rcy;":"\u0440","&rdca;":"\u2937","&rdldhar;":"\u2969","&rdquo;":"\u201D","&rdquor;":"\u201D","&rdsh;":"\u21B3","&real;":"\u211C","&realine;":"\u211B","&realpart;":"\u211C","&reals;":"\u211D","&rect;":"\u25AD","&reg":"\xAE","&reg;":"\xAE","&rfisht;":"\u297D","&rfloor;":"\u230B","&rfr;":"\u{1D52F}","&rhard;":"\u21C1","&rharu;":"\u21C0","&rharul;":"\u296C","&rho;":"\u03C1","&rhov;":"\u03F1","&rightarrow;":"\u2192","&rightarrowtail;":"\u21A3","&rightharpoondown;":"\u21C1","&rightharpoonup;":"\u21C0","&rightleftarrows;":"\u21C4","&rightleftharpoons;":"\u21CC","&rightrightarrows;":"\u21C9","&rightsquigarrow;":"\u219D","&rightthreetimes;":"\u22CC","&ring;":"\u02DA","&risingdotseq;":"\u2253","&rlarr;":"\u21C4","&rlhar;":"\u21CC","&rlm;":"\u200F","&rmoust;":"\u23B1","&rmoustache;":"\u23B1","&rnmid;":"\u2AEE","&roang;":"\u27ED","&roarr;":"\u21FE","&robrk;":"\u27E7","&ropar;":"\u2986","&ropf;":"\u{1D563}","&roplus;":"\u2A2E","&rotimes;":"\u2A35","&rpar;":")","&rpargt;":"\u2994","&rppolint;":"\u2A12","&rrarr;":"\u21C9","&rsaquo;":"\u203A","&rscr;":"\u{1D4C7}","&rsh;":"\u21B1","&rsqb;":"]","&rsquo;":"\u2019","&rsquor;":"\u2019","&rthree;":"\u22CC","&rtimes;":"\u22CA","&rtri;":"\u25B9","&rtrie;":"\u22B5","&rtrif;":"\u25B8","&rtriltri;":"\u29CE","&ruluhar;":"\u2968","&rx;":"\u211E","&sacute;":"\u015B","&sbquo;":"\u201A","&sc;":"\u227B","&scE;":"\u2AB4","&scap;":"\u2AB8","&scaron;":"\u0161","&sccue;":"\u227D","&sce;":"\u2AB0","&scedil;":"\u015F","&scirc;":"\u015D","&scnE;":"\u2AB6","&scnap;":"\u2ABA","&scnsim;":"\u22E9","&scpolint;":"\u2A13","&scsim;":"\u227F","&scy;":"\u0441","&sdot;":"\u22C5","&sdotb;":"\u22A1","&sdote;":"\u2A66","&seArr;":"\u21D8","&searhk;":"\u2925","&searr;":"\u2198","&searrow;":"\u2198","&sect":"\xA7","&sect;":"\xA7","&semi;":";","&seswar;":"\u2929","&setminus;":"\u2216","&setmn;":"\u2216","&sext;":"\u2736","&sfr;":"\u{1D530}","&sfrown;":"\u2322","&sharp;":"\u266F","&shchcy;":"\u0449","&shcy;":"\u0448","&shortmid;":"\u2223","&shortparallel;":"\u2225","&shy":"\xAD","&shy;":"\xAD","&sigma;":"\u03C3","&sigmaf;":"\u03C2","&sigmav;":"\u03C2","&sim;":"\u223C","&simdot;":"\u2A6A","&sime;":"\u2243","&simeq;":"\u2243","&simg;":"\u2A9E","&simgE;":"\u2AA0","&siml;":"\u2A9D","&simlE;":"\u2A9F","&simne;":"\u2246","&simplus;":"\u2A24","&simrarr;":"\u2972","&slarr;":"\u2190","&smallsetminus;":"\u2216","&smashp;":"\u2A33","&smeparsl;":"\u29E4","&smid;":"\u2223","&smile;":"\u2323","&smt;":"\u2AAA","&smte;":"\u2AAC","&smtes;":"\u2AAC\uFE00","&softcy;":"\u044C","&sol;":"/","&solb;":"\u29C4","&solbar;":"\u233F","&sopf;":"\u{1D564}","&spades;":"\u2660","&spadesuit;":"\u2660","&spar;":"\u2225","&sqcap;":"\u2293","&sqcaps;":"\u2293\uFE00","&sqcup;":"\u2294","&sqcups;":"\u2294\uFE00","&sqsub;":"\u228F","&sqsube;":"\u2291","&sqsubset;":"\u228F","&sqsubseteq;":"\u2291","&sqsup;":"\u2290","&sqsupe;":"\u2292","&sqsupset;":"\u2290","&sqsupseteq;":"\u2292","&squ;":"\u25A1","&square;":"\u25A1","&squarf;":"\u25AA","&squf;":"\u25AA","&srarr;":"\u2192","&sscr;":"\u{1D4C8}","&ssetmn;":"\u2216","&ssmile;":"\u2323","&sstarf;":"\u22C6","&star;":"\u2606","&starf;":"\u2605","&straightepsilon;":"\u03F5","&straightphi;":"\u03D5","&strns;":"\xAF","&sub;":"\u2282","&subE;":"\u2AC5","&subdot;":"\u2ABD","&sube;":"\u2286","&subedot;":"\u2AC3","&submult;":"\u2AC1","&subnE;":"\u2ACB","&subne;":"\u228A","&subplus;":"\u2ABF","&subrarr;":"\u2979","&subset;":"\u2282","&subseteq;":"\u2286","&subseteqq;":"\u2AC5","&subsetneq;":"\u228A","&subsetneqq;":"\u2ACB","&subsim;":"\u2AC7","&subsub;":"\u2AD5","&subsup;":"\u2AD3","&succ;":"\u227B","&succapprox;":"\u2AB8","&succcurlyeq;":"\u227D","&succeq;":"\u2AB0","&succnapprox;":"\u2ABA","&succneqq;":"\u2AB6","&succnsim;":"\u22E9","&succsim;":"\u227F","&sum;":"\u2211","&sung;":"\u266A","&sup1":"\xB9","&sup1;":"\xB9","&sup2":"\xB2","&sup2;":"\xB2","&sup3":"\xB3","&sup3;":"\xB3","&sup;":"\u2283","&supE;":"\u2AC6","&supdot;":"\u2ABE","&supdsub;":"\u2AD8","&supe;":"\u2287","&supedot;":"\u2AC4","&suphsol;":"\u27C9","&suphsub;":"\u2AD7","&suplarr;":"\u297B","&supmult;":"\u2AC2","&supnE;":"\u2ACC","&supne;":"\u228B","&supplus;":"\u2AC0","&supset;":"\u2283","&supseteq;":"\u2287","&supseteqq;":"\u2AC6","&supsetneq;":"\u228B","&supsetneqq;":"\u2ACC","&supsim;":"\u2AC8","&supsub;":"\u2AD4","&supsup;":"\u2AD6","&swArr;":"\u21D9","&swarhk;":"\u2926","&swarr;":"\u2199","&swarrow;":"\u2199","&swnwar;":"\u292A","&szlig":"\xDF","&szlig;":"\xDF","&target;":"\u2316","&tau;":"\u03C4","&tbrk;":"\u23B4","&tcaron;":"\u0165","&tcedil;":"\u0163","&tcy;":"\u0442","&tdot;":"\u20DB","&telrec;":"\u2315","&tfr;":"\u{1D531}","&there4;":"\u2234","&therefore;":"\u2234","&theta;":"\u03B8","&thetasym;":"\u03D1","&thetav;":"\u03D1","&thickapprox;":"\u2248","&thicksim;":"\u223C","&thinsp;":"\u2009","&thkap;":"\u2248","&thksim;":"\u223C","&thorn":"\xFE","&thorn;":"\xFE","&tilde;":"\u02DC","&times":"\xD7","&times;":"\xD7","&timesb;":"\u22A0","&timesbar;":"\u2A31","&timesd;":"\u2A30","&tint;":"\u222D","&toea;":"\u2928","&top;":"\u22A4","&topbot;":"\u2336","&topcir;":"\u2AF1","&topf;":"\u{1D565}","&topfork;":"\u2ADA","&tosa;":"\u2929","&tprime;":"\u2034","&trade;":"\u2122","&triangle;":"\u25B5","&triangledown;":"\u25BF","&triangleleft;":"\u25C3","&trianglelefteq;":"\u22B4","&triangleq;":"\u225C","&triangleright;":"\u25B9","&trianglerighteq;":"\u22B5","&tridot;":"\u25EC","&trie;":"\u225C","&triminus;":"\u2A3A","&triplus;":"\u2A39","&trisb;":"\u29CD","&tritime;":"\u2A3B","&trpezium;":"\u23E2","&tscr;":"\u{1D4C9}","&tscy;":"\u0446","&tshcy;":"\u045B","&tstrok;":"\u0167","&twixt;":"\u226C","&twoheadleftarrow;":"\u219E","&twoheadrightarrow;":"\u21A0","&uArr;":"\u21D1","&uHar;":"\u2963","&uacute":"\xFA","&uacute;":"\xFA","&uarr;":"\u2191","&ubrcy;":"\u045E","&ubreve;":"\u016D","&ucirc":"\xFB","&ucirc;":"\xFB","&ucy;":"\u0443","&udarr;":"\u21C5","&udblac;":"\u0171","&udhar;":"\u296E","&ufisht;":"\u297E","&ufr;":"\u{1D532}","&ugrave":"\xF9","&ugrave;":"\xF9","&uharl;":"\u21BF","&uharr;":"\u21BE","&uhblk;":"\u2580","&ulcorn;":"\u231C","&ulcorner;":"\u231C","&ulcrop;":"\u230F","&ultri;":"\u25F8","&umacr;":"\u016B","&uml":"\xA8","&uml;":"\xA8","&uogon;":"\u0173","&uopf;":"\u{1D566}","&uparrow;":"\u2191","&updownarrow;":"\u2195","&upharpoonleft;":"\u21BF","&upharpoonright;":"\u21BE","&uplus;":"\u228E","&upsi;":"\u03C5","&upsih;":"\u03D2","&upsilon;":"\u03C5","&upuparrows;":"\u21C8","&urcorn;":"\u231D","&urcorner;":"\u231D","&urcrop;":"\u230E","&uring;":"\u016F","&urtri;":"\u25F9","&uscr;":"\u{1D4CA}","&utdot;":"\u22F0","&utilde;":"\u0169","&utri;":"\u25B5","&utrif;":"\u25B4","&uuarr;":"\u21C8","&uuml":"\xFC","&uuml;":"\xFC","&uwangle;":"\u29A7","&vArr;":"\u21D5","&vBar;":"\u2AE8","&vBarv;":"\u2AE9","&vDash;":"\u22A8","&vangrt;":"\u299C","&varepsilon;":"\u03F5","&varkappa;":"\u03F0","&varnothing;":"\u2205","&varphi;":"\u03D5","&varpi;":"\u03D6","&varpropto;":"\u221D","&varr;":"\u2195","&varrho;":"\u03F1","&varsigma;":"\u03C2","&varsubsetneq;":"\u228A\uFE00","&varsubsetneqq;":"\u2ACB\uFE00","&varsupsetneq;":"\u228B\uFE00","&varsupsetneqq;":"\u2ACC\uFE00","&vartheta;":"\u03D1","&vartriangleleft;":"\u22B2","&vartriangleright;":"\u22B3","&vcy;":"\u0432","&vdash;":"\u22A2","&vee;":"\u2228","&veebar;":"\u22BB","&veeeq;":"\u225A","&vellip;":"\u22EE","&verbar;":"|","&vert;":"|","&vfr;":"\u{1D533}","&vltri;":"\u22B2","&vnsub;":"\u2282\u20D2","&vnsup;":"\u2283\u20D2","&vopf;":"\u{1D567}","&vprop;":"\u221D","&vrtri;":"\u22B3","&vscr;":"\u{1D4CB}","&vsubnE;":"\u2ACB\uFE00","&vsubne;":"\u228A\uFE00","&vsupnE;":"\u2ACC\uFE00","&vsupne;":"\u228B\uFE00","&vzigzag;":"\u299A","&wcirc;":"\u0175","&wedbar;":"\u2A5F","&wedge;":"\u2227","&wedgeq;":"\u2259","&weierp;":"\u2118","&wfr;":"\u{1D534}","&wopf;":"\u{1D568}","&wp;":"\u2118","&wr;":"\u2240","&wreath;":"\u2240","&wscr;":"\u{1D4CC}","&xcap;":"\u22C2","&xcirc;":"\u25EF","&xcup;":"\u22C3","&xdtri;":"\u25BD","&xfr;":"\u{1D535}","&xhArr;":"\u27FA","&xharr;":"\u27F7","&xi;":"\u03BE","&xlArr;":"\u27F8","&xlarr;":"\u27F5","&xmap;":"\u27FC","&xnis;":"\u22FB","&xodot;":"\u2A00","&xopf;":"\u{1D569}","&xoplus;":"\u2A01","&xotime;":"\u2A02","&xrArr;":"\u27F9","&xrarr;":"\u27F6","&xscr;":"\u{1D4CD}","&xsqcup;":"\u2A06","&xuplus;":"\u2A04","&xutri;":"\u25B3","&xvee;":"\u22C1","&xwedge;":"\u22C0","&yacute":"\xFD","&yacute;":"\xFD","&yacy;":"\u044F","&ycirc;":"\u0177","&ycy;":"\u044B","&yen":"\xA5","&yen;":"\xA5","&yfr;":"\u{1D536}","&yicy;":"\u0457","&yopf;":"\u{1D56A}","&yscr;":"\u{1D4CE}","&yucy;":"\u044E","&yuml":"\xFF","&yuml;":"\xFF","&zacute;":"\u017A","&zcaron;":"\u017E","&zcy;":"\u0437","&zdot;":"\u017C","&zeetrf;":"\u2128","&zeta;":"\u03B6","&zfr;":"\u{1D537}","&zhcy;":"\u0436","&zigrarr;":"\u21DD","&zopf;":"\u{1D56B}","&zscr;":"\u{1D4CF}","&zwj;":"\u200D","&zwnj;":"\u200C"},Vu=F1;function B1(e){return e.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(t,r)=>{if(typeof Vu[t]=="string")return Vu[t];if(r.charAt(0)!=="#"||t.charAt(t.length-1)!==";")return t;let i;r.charAt(1)==="x"?i=parseInt(r.substr(2),16):i=parseInt(r.substr(1),10);let n="";return i>=55296&&i<=57343||i>1114111?"\uFFFD":(i>65535&&(i-=65536,n+=String.fromCharCode(i>>>10&1023|55296),i=56320|i&1023),n+=String.fromCharCode(i),n)})}function Jt(e){return e.trim().replace(/[<>"'?&]/g,t=>{let r=t.charCodeAt(0).toString(16);return r.length<2&&(r="0"+r),"&#x"+r.toUpperCase()+";"})}function em(e){return"<div>"+Jt(e).replace(/\n/g,"<br />")+"</div>"}function tm(e){return e=e.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
160
+ `+n).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let t=ar(this.contentType.parsed.params.charset).decode(this.content);return/^flowed$/i.test(this.contentType.parsed.params.format)&&(t=this.decodeFlowedText(t,/^yes$/i.test(this.contentType.parsed.params.delsp))),t}processHeaders(){for(let t=this.headerLines.length-1;t>=0;t--){let r=this.headerLines[t];t&&/^\s/.test(r)&&(this.headerLines[t-1]+=`
161
+ `+r,this.headerLines.splice(t,1))}this.rawHeaderLines=[];for(let t=this.headerLines.length-1;t>=0;t--){let r=this.headerLines[t],i=r.indexOf(":"),n=i<0?r.trim():r.substr(0,i).trim();this.rawHeaderLines.push({key:n.toLowerCase(),line:r});let o=r.replace(/\s+/g," ");i=o.indexOf(":");let s=i<0?o.trim():o.substr(0,i).trim(),a=i<0?"":o.substr(i+1).trim();switch(this.headers.push({key:s.toLowerCase(),originalKey:s,value:a}),s.toLowerCase()){case"content-type":this.contentType.default&&(this.contentType={value:a,parsed:{}});break;case"content-transfer-encoding":this.contentTransferEncoding={value:a,parsed:{}};break;case"content-disposition":this.contentDisposition={value:a,parsed:{}};break;case"content-id":this.contentId=a;break;case"content-description":this.contentDescription=a;break}}this.contentType.parsed=this.parseStructuredHeader(this.contentType.value),this.contentType.multipart=/^multipart\//i.test(this.contentType.parsed.value)?this.contentType.parsed.value.substr(this.contentType.parsed.value.indexOf("/")+1):!1,this.contentType.multipart&&this.contentType.parsed.params.boundary&&this.postalMime.boundaries.push({value:Ot.encode(this.contentType.parsed.params.boundary),node:this}),this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value),this.contentTransferEncoding.encoding=this.contentTransferEncoding.value.toLowerCase().split(/[^\w-]/).shift(),this.setupContentDecoder(this.contentTransferEncoding.encoding)}feed(t){switch(this.state){case"header":if(!t.length)return this.state="body",this.processHeaders();if(this.headerSize+=t.length,this.headerSize>this.options.maxHeadersSize)throw new Error(`Maximum header size of ${this.options.maxHeadersSize} bytes exceeded`);this.headerLines.push(pC.decode(t));break;case"body":this.contentDecoder.update(t)}}};var fC={"&AElig":"\xC6","&AElig;":"\xC6","&AMP":"&","&AMP;":"&","&Aacute":"\xC1","&Aacute;":"\xC1","&Abreve;":"\u0102","&Acirc":"\xC2","&Acirc;":"\xC2","&Acy;":"\u0410","&Afr;":"\u{1D504}","&Agrave":"\xC0","&Agrave;":"\xC0","&Alpha;":"\u0391","&Amacr;":"\u0100","&And;":"\u2A53","&Aogon;":"\u0104","&Aopf;":"\u{1D538}","&ApplyFunction;":"\u2061","&Aring":"\xC5","&Aring;":"\xC5","&Ascr;":"\u{1D49C}","&Assign;":"\u2254","&Atilde":"\xC3","&Atilde;":"\xC3","&Auml":"\xC4","&Auml;":"\xC4","&Backslash;":"\u2216","&Barv;":"\u2AE7","&Barwed;":"\u2306","&Bcy;":"\u0411","&Because;":"\u2235","&Bernoullis;":"\u212C","&Beta;":"\u0392","&Bfr;":"\u{1D505}","&Bopf;":"\u{1D539}","&Breve;":"\u02D8","&Bscr;":"\u212C","&Bumpeq;":"\u224E","&CHcy;":"\u0427","&COPY":"\xA9","&COPY;":"\xA9","&Cacute;":"\u0106","&Cap;":"\u22D2","&CapitalDifferentialD;":"\u2145","&Cayleys;":"\u212D","&Ccaron;":"\u010C","&Ccedil":"\xC7","&Ccedil;":"\xC7","&Ccirc;":"\u0108","&Cconint;":"\u2230","&Cdot;":"\u010A","&Cedilla;":"\xB8","&CenterDot;":"\xB7","&Cfr;":"\u212D","&Chi;":"\u03A7","&CircleDot;":"\u2299","&CircleMinus;":"\u2296","&CirclePlus;":"\u2295","&CircleTimes;":"\u2297","&ClockwiseContourIntegral;":"\u2232","&CloseCurlyDoubleQuote;":"\u201D","&CloseCurlyQuote;":"\u2019","&Colon;":"\u2237","&Colone;":"\u2A74","&Congruent;":"\u2261","&Conint;":"\u222F","&ContourIntegral;":"\u222E","&Copf;":"\u2102","&Coproduct;":"\u2210","&CounterClockwiseContourIntegral;":"\u2233","&Cross;":"\u2A2F","&Cscr;":"\u{1D49E}","&Cup;":"\u22D3","&CupCap;":"\u224D","&DD;":"\u2145","&DDotrahd;":"\u2911","&DJcy;":"\u0402","&DScy;":"\u0405","&DZcy;":"\u040F","&Dagger;":"\u2021","&Darr;":"\u21A1","&Dashv;":"\u2AE4","&Dcaron;":"\u010E","&Dcy;":"\u0414","&Del;":"\u2207","&Delta;":"\u0394","&Dfr;":"\u{1D507}","&DiacriticalAcute;":"\xB4","&DiacriticalDot;":"\u02D9","&DiacriticalDoubleAcute;":"\u02DD","&DiacriticalGrave;":"`","&DiacriticalTilde;":"\u02DC","&Diamond;":"\u22C4","&DifferentialD;":"\u2146","&Dopf;":"\u{1D53B}","&Dot;":"\xA8","&DotDot;":"\u20DC","&DotEqual;":"\u2250","&DoubleContourIntegral;":"\u222F","&DoubleDot;":"\xA8","&DoubleDownArrow;":"\u21D3","&DoubleLeftArrow;":"\u21D0","&DoubleLeftRightArrow;":"\u21D4","&DoubleLeftTee;":"\u2AE4","&DoubleLongLeftArrow;":"\u27F8","&DoubleLongLeftRightArrow;":"\u27FA","&DoubleLongRightArrow;":"\u27F9","&DoubleRightArrow;":"\u21D2","&DoubleRightTee;":"\u22A8","&DoubleUpArrow;":"\u21D1","&DoubleUpDownArrow;":"\u21D5","&DoubleVerticalBar;":"\u2225","&DownArrow;":"\u2193","&DownArrowBar;":"\u2913","&DownArrowUpArrow;":"\u21F5","&DownBreve;":"\u0311","&DownLeftRightVector;":"\u2950","&DownLeftTeeVector;":"\u295E","&DownLeftVector;":"\u21BD","&DownLeftVectorBar;":"\u2956","&DownRightTeeVector;":"\u295F","&DownRightVector;":"\u21C1","&DownRightVectorBar;":"\u2957","&DownTee;":"\u22A4","&DownTeeArrow;":"\u21A7","&Downarrow;":"\u21D3","&Dscr;":"\u{1D49F}","&Dstrok;":"\u0110","&ENG;":"\u014A","&ETH":"\xD0","&ETH;":"\xD0","&Eacute":"\xC9","&Eacute;":"\xC9","&Ecaron;":"\u011A","&Ecirc":"\xCA","&Ecirc;":"\xCA","&Ecy;":"\u042D","&Edot;":"\u0116","&Efr;":"\u{1D508}","&Egrave":"\xC8","&Egrave;":"\xC8","&Element;":"\u2208","&Emacr;":"\u0112","&EmptySmallSquare;":"\u25FB","&EmptyVerySmallSquare;":"\u25AB","&Eogon;":"\u0118","&Eopf;":"\u{1D53C}","&Epsilon;":"\u0395","&Equal;":"\u2A75","&EqualTilde;":"\u2242","&Equilibrium;":"\u21CC","&Escr;":"\u2130","&Esim;":"\u2A73","&Eta;":"\u0397","&Euml":"\xCB","&Euml;":"\xCB","&Exists;":"\u2203","&ExponentialE;":"\u2147","&Fcy;":"\u0424","&Ffr;":"\u{1D509}","&FilledSmallSquare;":"\u25FC","&FilledVerySmallSquare;":"\u25AA","&Fopf;":"\u{1D53D}","&ForAll;":"\u2200","&Fouriertrf;":"\u2131","&Fscr;":"\u2131","&GJcy;":"\u0403","&GT":">","&GT;":">","&Gamma;":"\u0393","&Gammad;":"\u03DC","&Gbreve;":"\u011E","&Gcedil;":"\u0122","&Gcirc;":"\u011C","&Gcy;":"\u0413","&Gdot;":"\u0120","&Gfr;":"\u{1D50A}","&Gg;":"\u22D9","&Gopf;":"\u{1D53E}","&GreaterEqual;":"\u2265","&GreaterEqualLess;":"\u22DB","&GreaterFullEqual;":"\u2267","&GreaterGreater;":"\u2AA2","&GreaterLess;":"\u2277","&GreaterSlantEqual;":"\u2A7E","&GreaterTilde;":"\u2273","&Gscr;":"\u{1D4A2}","&Gt;":"\u226B","&HARDcy;":"\u042A","&Hacek;":"\u02C7","&Hat;":"^","&Hcirc;":"\u0124","&Hfr;":"\u210C","&HilbertSpace;":"\u210B","&Hopf;":"\u210D","&HorizontalLine;":"\u2500","&Hscr;":"\u210B","&Hstrok;":"\u0126","&HumpDownHump;":"\u224E","&HumpEqual;":"\u224F","&IEcy;":"\u0415","&IJlig;":"\u0132","&IOcy;":"\u0401","&Iacute":"\xCD","&Iacute;":"\xCD","&Icirc":"\xCE","&Icirc;":"\xCE","&Icy;":"\u0418","&Idot;":"\u0130","&Ifr;":"\u2111","&Igrave":"\xCC","&Igrave;":"\xCC","&Im;":"\u2111","&Imacr;":"\u012A","&ImaginaryI;":"\u2148","&Implies;":"\u21D2","&Int;":"\u222C","&Integral;":"\u222B","&Intersection;":"\u22C2","&InvisibleComma;":"\u2063","&InvisibleTimes;":"\u2062","&Iogon;":"\u012E","&Iopf;":"\u{1D540}","&Iota;":"\u0399","&Iscr;":"\u2110","&Itilde;":"\u0128","&Iukcy;":"\u0406","&Iuml":"\xCF","&Iuml;":"\xCF","&Jcirc;":"\u0134","&Jcy;":"\u0419","&Jfr;":"\u{1D50D}","&Jopf;":"\u{1D541}","&Jscr;":"\u{1D4A5}","&Jsercy;":"\u0408","&Jukcy;":"\u0404","&KHcy;":"\u0425","&KJcy;":"\u040C","&Kappa;":"\u039A","&Kcedil;":"\u0136","&Kcy;":"\u041A","&Kfr;":"\u{1D50E}","&Kopf;":"\u{1D542}","&Kscr;":"\u{1D4A6}","&LJcy;":"\u0409","&LT":"<","&LT;":"<","&Lacute;":"\u0139","&Lambda;":"\u039B","&Lang;":"\u27EA","&Laplacetrf;":"\u2112","&Larr;":"\u219E","&Lcaron;":"\u013D","&Lcedil;":"\u013B","&Lcy;":"\u041B","&LeftAngleBracket;":"\u27E8","&LeftArrow;":"\u2190","&LeftArrowBar;":"\u21E4","&LeftArrowRightArrow;":"\u21C6","&LeftCeiling;":"\u2308","&LeftDoubleBracket;":"\u27E6","&LeftDownTeeVector;":"\u2961","&LeftDownVector;":"\u21C3","&LeftDownVectorBar;":"\u2959","&LeftFloor;":"\u230A","&LeftRightArrow;":"\u2194","&LeftRightVector;":"\u294E","&LeftTee;":"\u22A3","&LeftTeeArrow;":"\u21A4","&LeftTeeVector;":"\u295A","&LeftTriangle;":"\u22B2","&LeftTriangleBar;":"\u29CF","&LeftTriangleEqual;":"\u22B4","&LeftUpDownVector;":"\u2951","&LeftUpTeeVector;":"\u2960","&LeftUpVector;":"\u21BF","&LeftUpVectorBar;":"\u2958","&LeftVector;":"\u21BC","&LeftVectorBar;":"\u2952","&Leftarrow;":"\u21D0","&Leftrightarrow;":"\u21D4","&LessEqualGreater;":"\u22DA","&LessFullEqual;":"\u2266","&LessGreater;":"\u2276","&LessLess;":"\u2AA1","&LessSlantEqual;":"\u2A7D","&LessTilde;":"\u2272","&Lfr;":"\u{1D50F}","&Ll;":"\u22D8","&Lleftarrow;":"\u21DA","&Lmidot;":"\u013F","&LongLeftArrow;":"\u27F5","&LongLeftRightArrow;":"\u27F7","&LongRightArrow;":"\u27F6","&Longleftarrow;":"\u27F8","&Longleftrightarrow;":"\u27FA","&Longrightarrow;":"\u27F9","&Lopf;":"\u{1D543}","&LowerLeftArrow;":"\u2199","&LowerRightArrow;":"\u2198","&Lscr;":"\u2112","&Lsh;":"\u21B0","&Lstrok;":"\u0141","&Lt;":"\u226A","&Map;":"\u2905","&Mcy;":"\u041C","&MediumSpace;":"\u205F","&Mellintrf;":"\u2133","&Mfr;":"\u{1D510}","&MinusPlus;":"\u2213","&Mopf;":"\u{1D544}","&Mscr;":"\u2133","&Mu;":"\u039C","&NJcy;":"\u040A","&Nacute;":"\u0143","&Ncaron;":"\u0147","&Ncedil;":"\u0145","&Ncy;":"\u041D","&NegativeMediumSpace;":"\u200B","&NegativeThickSpace;":"\u200B","&NegativeThinSpace;":"\u200B","&NegativeVeryThinSpace;":"\u200B","&NestedGreaterGreater;":"\u226B","&NestedLessLess;":"\u226A","&NewLine;":`
162
+ `,"&Nfr;":"\u{1D511}","&NoBreak;":"\u2060","&NonBreakingSpace;":"\xA0","&Nopf;":"\u2115","&Not;":"\u2AEC","&NotCongruent;":"\u2262","&NotCupCap;":"\u226D","&NotDoubleVerticalBar;":"\u2226","&NotElement;":"\u2209","&NotEqual;":"\u2260","&NotEqualTilde;":"\u2242\u0338","&NotExists;":"\u2204","&NotGreater;":"\u226F","&NotGreaterEqual;":"\u2271","&NotGreaterFullEqual;":"\u2267\u0338","&NotGreaterGreater;":"\u226B\u0338","&NotGreaterLess;":"\u2279","&NotGreaterSlantEqual;":"\u2A7E\u0338","&NotGreaterTilde;":"\u2275","&NotHumpDownHump;":"\u224E\u0338","&NotHumpEqual;":"\u224F\u0338","&NotLeftTriangle;":"\u22EA","&NotLeftTriangleBar;":"\u29CF\u0338","&NotLeftTriangleEqual;":"\u22EC","&NotLess;":"\u226E","&NotLessEqual;":"\u2270","&NotLessGreater;":"\u2278","&NotLessLess;":"\u226A\u0338","&NotLessSlantEqual;":"\u2A7D\u0338","&NotLessTilde;":"\u2274","&NotNestedGreaterGreater;":"\u2AA2\u0338","&NotNestedLessLess;":"\u2AA1\u0338","&NotPrecedes;":"\u2280","&NotPrecedesEqual;":"\u2AAF\u0338","&NotPrecedesSlantEqual;":"\u22E0","&NotReverseElement;":"\u220C","&NotRightTriangle;":"\u22EB","&NotRightTriangleBar;":"\u29D0\u0338","&NotRightTriangleEqual;":"\u22ED","&NotSquareSubset;":"\u228F\u0338","&NotSquareSubsetEqual;":"\u22E2","&NotSquareSuperset;":"\u2290\u0338","&NotSquareSupersetEqual;":"\u22E3","&NotSubset;":"\u2282\u20D2","&NotSubsetEqual;":"\u2288","&NotSucceeds;":"\u2281","&NotSucceedsEqual;":"\u2AB0\u0338","&NotSucceedsSlantEqual;":"\u22E1","&NotSucceedsTilde;":"\u227F\u0338","&NotSuperset;":"\u2283\u20D2","&NotSupersetEqual;":"\u2289","&NotTilde;":"\u2241","&NotTildeEqual;":"\u2244","&NotTildeFullEqual;":"\u2247","&NotTildeTilde;":"\u2249","&NotVerticalBar;":"\u2224","&Nscr;":"\u{1D4A9}","&Ntilde":"\xD1","&Ntilde;":"\xD1","&Nu;":"\u039D","&OElig;":"\u0152","&Oacute":"\xD3","&Oacute;":"\xD3","&Ocirc":"\xD4","&Ocirc;":"\xD4","&Ocy;":"\u041E","&Odblac;":"\u0150","&Ofr;":"\u{1D512}","&Ograve":"\xD2","&Ograve;":"\xD2","&Omacr;":"\u014C","&Omega;":"\u03A9","&Omicron;":"\u039F","&Oopf;":"\u{1D546}","&OpenCurlyDoubleQuote;":"\u201C","&OpenCurlyQuote;":"\u2018","&Or;":"\u2A54","&Oscr;":"\u{1D4AA}","&Oslash":"\xD8","&Oslash;":"\xD8","&Otilde":"\xD5","&Otilde;":"\xD5","&Otimes;":"\u2A37","&Ouml":"\xD6","&Ouml;":"\xD6","&OverBar;":"\u203E","&OverBrace;":"\u23DE","&OverBracket;":"\u23B4","&OverParenthesis;":"\u23DC","&PartialD;":"\u2202","&Pcy;":"\u041F","&Pfr;":"\u{1D513}","&Phi;":"\u03A6","&Pi;":"\u03A0","&PlusMinus;":"\xB1","&Poincareplane;":"\u210C","&Popf;":"\u2119","&Pr;":"\u2ABB","&Precedes;":"\u227A","&PrecedesEqual;":"\u2AAF","&PrecedesSlantEqual;":"\u227C","&PrecedesTilde;":"\u227E","&Prime;":"\u2033","&Product;":"\u220F","&Proportion;":"\u2237","&Proportional;":"\u221D","&Pscr;":"\u{1D4AB}","&Psi;":"\u03A8","&QUOT":'"',"&QUOT;":'"',"&Qfr;":"\u{1D514}","&Qopf;":"\u211A","&Qscr;":"\u{1D4AC}","&RBarr;":"\u2910","&REG":"\xAE","&REG;":"\xAE","&Racute;":"\u0154","&Rang;":"\u27EB","&Rarr;":"\u21A0","&Rarrtl;":"\u2916","&Rcaron;":"\u0158","&Rcedil;":"\u0156","&Rcy;":"\u0420","&Re;":"\u211C","&ReverseElement;":"\u220B","&ReverseEquilibrium;":"\u21CB","&ReverseUpEquilibrium;":"\u296F","&Rfr;":"\u211C","&Rho;":"\u03A1","&RightAngleBracket;":"\u27E9","&RightArrow;":"\u2192","&RightArrowBar;":"\u21E5","&RightArrowLeftArrow;":"\u21C4","&RightCeiling;":"\u2309","&RightDoubleBracket;":"\u27E7","&RightDownTeeVector;":"\u295D","&RightDownVector;":"\u21C2","&RightDownVectorBar;":"\u2955","&RightFloor;":"\u230B","&RightTee;":"\u22A2","&RightTeeArrow;":"\u21A6","&RightTeeVector;":"\u295B","&RightTriangle;":"\u22B3","&RightTriangleBar;":"\u29D0","&RightTriangleEqual;":"\u22B5","&RightUpDownVector;":"\u294F","&RightUpTeeVector;":"\u295C","&RightUpVector;":"\u21BE","&RightUpVectorBar;":"\u2954","&RightVector;":"\u21C0","&RightVectorBar;":"\u2953","&Rightarrow;":"\u21D2","&Ropf;":"\u211D","&RoundImplies;":"\u2970","&Rrightarrow;":"\u21DB","&Rscr;":"\u211B","&Rsh;":"\u21B1","&RuleDelayed;":"\u29F4","&SHCHcy;":"\u0429","&SHcy;":"\u0428","&SOFTcy;":"\u042C","&Sacute;":"\u015A","&Sc;":"\u2ABC","&Scaron;":"\u0160","&Scedil;":"\u015E","&Scirc;":"\u015C","&Scy;":"\u0421","&Sfr;":"\u{1D516}","&ShortDownArrow;":"\u2193","&ShortLeftArrow;":"\u2190","&ShortRightArrow;":"\u2192","&ShortUpArrow;":"\u2191","&Sigma;":"\u03A3","&SmallCircle;":"\u2218","&Sopf;":"\u{1D54A}","&Sqrt;":"\u221A","&Square;":"\u25A1","&SquareIntersection;":"\u2293","&SquareSubset;":"\u228F","&SquareSubsetEqual;":"\u2291","&SquareSuperset;":"\u2290","&SquareSupersetEqual;":"\u2292","&SquareUnion;":"\u2294","&Sscr;":"\u{1D4AE}","&Star;":"\u22C6","&Sub;":"\u22D0","&Subset;":"\u22D0","&SubsetEqual;":"\u2286","&Succeeds;":"\u227B","&SucceedsEqual;":"\u2AB0","&SucceedsSlantEqual;":"\u227D","&SucceedsTilde;":"\u227F","&SuchThat;":"\u220B","&Sum;":"\u2211","&Sup;":"\u22D1","&Superset;":"\u2283","&SupersetEqual;":"\u2287","&Supset;":"\u22D1","&THORN":"\xDE","&THORN;":"\xDE","&TRADE;":"\u2122","&TSHcy;":"\u040B","&TScy;":"\u0426","&Tab;":" ","&Tau;":"\u03A4","&Tcaron;":"\u0164","&Tcedil;":"\u0162","&Tcy;":"\u0422","&Tfr;":"\u{1D517}","&Therefore;":"\u2234","&Theta;":"\u0398","&ThickSpace;":"\u205F\u200A","&ThinSpace;":"\u2009","&Tilde;":"\u223C","&TildeEqual;":"\u2243","&TildeFullEqual;":"\u2245","&TildeTilde;":"\u2248","&Topf;":"\u{1D54B}","&TripleDot;":"\u20DB","&Tscr;":"\u{1D4AF}","&Tstrok;":"\u0166","&Uacute":"\xDA","&Uacute;":"\xDA","&Uarr;":"\u219F","&Uarrocir;":"\u2949","&Ubrcy;":"\u040E","&Ubreve;":"\u016C","&Ucirc":"\xDB","&Ucirc;":"\xDB","&Ucy;":"\u0423","&Udblac;":"\u0170","&Ufr;":"\u{1D518}","&Ugrave":"\xD9","&Ugrave;":"\xD9","&Umacr;":"\u016A","&UnderBar;":"_","&UnderBrace;":"\u23DF","&UnderBracket;":"\u23B5","&UnderParenthesis;":"\u23DD","&Union;":"\u22C3","&UnionPlus;":"\u228E","&Uogon;":"\u0172","&Uopf;":"\u{1D54C}","&UpArrow;":"\u2191","&UpArrowBar;":"\u2912","&UpArrowDownArrow;":"\u21C5","&UpDownArrow;":"\u2195","&UpEquilibrium;":"\u296E","&UpTee;":"\u22A5","&UpTeeArrow;":"\u21A5","&Uparrow;":"\u21D1","&Updownarrow;":"\u21D5","&UpperLeftArrow;":"\u2196","&UpperRightArrow;":"\u2197","&Upsi;":"\u03D2","&Upsilon;":"\u03A5","&Uring;":"\u016E","&Uscr;":"\u{1D4B0}","&Utilde;":"\u0168","&Uuml":"\xDC","&Uuml;":"\xDC","&VDash;":"\u22AB","&Vbar;":"\u2AEB","&Vcy;":"\u0412","&Vdash;":"\u22A9","&Vdashl;":"\u2AE6","&Vee;":"\u22C1","&Verbar;":"\u2016","&Vert;":"\u2016","&VerticalBar;":"\u2223","&VerticalLine;":"|","&VerticalSeparator;":"\u2758","&VerticalTilde;":"\u2240","&VeryThinSpace;":"\u200A","&Vfr;":"\u{1D519}","&Vopf;":"\u{1D54D}","&Vscr;":"\u{1D4B1}","&Vvdash;":"\u22AA","&Wcirc;":"\u0174","&Wedge;":"\u22C0","&Wfr;":"\u{1D51A}","&Wopf;":"\u{1D54E}","&Wscr;":"\u{1D4B2}","&Xfr;":"\u{1D51B}","&Xi;":"\u039E","&Xopf;":"\u{1D54F}","&Xscr;":"\u{1D4B3}","&YAcy;":"\u042F","&YIcy;":"\u0407","&YUcy;":"\u042E","&Yacute":"\xDD","&Yacute;":"\xDD","&Ycirc;":"\u0176","&Ycy;":"\u042B","&Yfr;":"\u{1D51C}","&Yopf;":"\u{1D550}","&Yscr;":"\u{1D4B4}","&Yuml;":"\u0178","&ZHcy;":"\u0416","&Zacute;":"\u0179","&Zcaron;":"\u017D","&Zcy;":"\u0417","&Zdot;":"\u017B","&ZeroWidthSpace;":"\u200B","&Zeta;":"\u0396","&Zfr;":"\u2128","&Zopf;":"\u2124","&Zscr;":"\u{1D4B5}","&aacute":"\xE1","&aacute;":"\xE1","&abreve;":"\u0103","&ac;":"\u223E","&acE;":"\u223E\u0333","&acd;":"\u223F","&acirc":"\xE2","&acirc;":"\xE2","&acute":"\xB4","&acute;":"\xB4","&acy;":"\u0430","&aelig":"\xE6","&aelig;":"\xE6","&af;":"\u2061","&afr;":"\u{1D51E}","&agrave":"\xE0","&agrave;":"\xE0","&alefsym;":"\u2135","&aleph;":"\u2135","&alpha;":"\u03B1","&amacr;":"\u0101","&amalg;":"\u2A3F","&amp":"&","&amp;":"&","&and;":"\u2227","&andand;":"\u2A55","&andd;":"\u2A5C","&andslope;":"\u2A58","&andv;":"\u2A5A","&ang;":"\u2220","&ange;":"\u29A4","&angle;":"\u2220","&angmsd;":"\u2221","&angmsdaa;":"\u29A8","&angmsdab;":"\u29A9","&angmsdac;":"\u29AA","&angmsdad;":"\u29AB","&angmsdae;":"\u29AC","&angmsdaf;":"\u29AD","&angmsdag;":"\u29AE","&angmsdah;":"\u29AF","&angrt;":"\u221F","&angrtvb;":"\u22BE","&angrtvbd;":"\u299D","&angsph;":"\u2222","&angst;":"\xC5","&angzarr;":"\u237C","&aogon;":"\u0105","&aopf;":"\u{1D552}","&ap;":"\u2248","&apE;":"\u2A70","&apacir;":"\u2A6F","&ape;":"\u224A","&apid;":"\u224B","&apos;":"'","&approx;":"\u2248","&approxeq;":"\u224A","&aring":"\xE5","&aring;":"\xE5","&ascr;":"\u{1D4B6}","&ast;":"*","&asymp;":"\u2248","&asympeq;":"\u224D","&atilde":"\xE3","&atilde;":"\xE3","&auml":"\xE4","&auml;":"\xE4","&awconint;":"\u2233","&awint;":"\u2A11","&bNot;":"\u2AED","&backcong;":"\u224C","&backepsilon;":"\u03F6","&backprime;":"\u2035","&backsim;":"\u223D","&backsimeq;":"\u22CD","&barvee;":"\u22BD","&barwed;":"\u2305","&barwedge;":"\u2305","&bbrk;":"\u23B5","&bbrktbrk;":"\u23B6","&bcong;":"\u224C","&bcy;":"\u0431","&bdquo;":"\u201E","&becaus;":"\u2235","&because;":"\u2235","&bemptyv;":"\u29B0","&bepsi;":"\u03F6","&bernou;":"\u212C","&beta;":"\u03B2","&beth;":"\u2136","&between;":"\u226C","&bfr;":"\u{1D51F}","&bigcap;":"\u22C2","&bigcirc;":"\u25EF","&bigcup;":"\u22C3","&bigodot;":"\u2A00","&bigoplus;":"\u2A01","&bigotimes;":"\u2A02","&bigsqcup;":"\u2A06","&bigstar;":"\u2605","&bigtriangledown;":"\u25BD","&bigtriangleup;":"\u25B3","&biguplus;":"\u2A04","&bigvee;":"\u22C1","&bigwedge;":"\u22C0","&bkarow;":"\u290D","&blacklozenge;":"\u29EB","&blacksquare;":"\u25AA","&blacktriangle;":"\u25B4","&blacktriangledown;":"\u25BE","&blacktriangleleft;":"\u25C2","&blacktriangleright;":"\u25B8","&blank;":"\u2423","&blk12;":"\u2592","&blk14;":"\u2591","&blk34;":"\u2593","&block;":"\u2588","&bne;":"=\u20E5","&bnequiv;":"\u2261\u20E5","&bnot;":"\u2310","&bopf;":"\u{1D553}","&bot;":"\u22A5","&bottom;":"\u22A5","&bowtie;":"\u22C8","&boxDL;":"\u2557","&boxDR;":"\u2554","&boxDl;":"\u2556","&boxDr;":"\u2553","&boxH;":"\u2550","&boxHD;":"\u2566","&boxHU;":"\u2569","&boxHd;":"\u2564","&boxHu;":"\u2567","&boxUL;":"\u255D","&boxUR;":"\u255A","&boxUl;":"\u255C","&boxUr;":"\u2559","&boxV;":"\u2551","&boxVH;":"\u256C","&boxVL;":"\u2563","&boxVR;":"\u2560","&boxVh;":"\u256B","&boxVl;":"\u2562","&boxVr;":"\u255F","&boxbox;":"\u29C9","&boxdL;":"\u2555","&boxdR;":"\u2552","&boxdl;":"\u2510","&boxdr;":"\u250C","&boxh;":"\u2500","&boxhD;":"\u2565","&boxhU;":"\u2568","&boxhd;":"\u252C","&boxhu;":"\u2534","&boxminus;":"\u229F","&boxplus;":"\u229E","&boxtimes;":"\u22A0","&boxuL;":"\u255B","&boxuR;":"\u2558","&boxul;":"\u2518","&boxur;":"\u2514","&boxv;":"\u2502","&boxvH;":"\u256A","&boxvL;":"\u2561","&boxvR;":"\u255E","&boxvh;":"\u253C","&boxvl;":"\u2524","&boxvr;":"\u251C","&bprime;":"\u2035","&breve;":"\u02D8","&brvbar":"\xA6","&brvbar;":"\xA6","&bscr;":"\u{1D4B7}","&bsemi;":"\u204F","&bsim;":"\u223D","&bsime;":"\u22CD","&bsol;":"\\","&bsolb;":"\u29C5","&bsolhsub;":"\u27C8","&bull;":"\u2022","&bullet;":"\u2022","&bump;":"\u224E","&bumpE;":"\u2AAE","&bumpe;":"\u224F","&bumpeq;":"\u224F","&cacute;":"\u0107","&cap;":"\u2229","&capand;":"\u2A44","&capbrcup;":"\u2A49","&capcap;":"\u2A4B","&capcup;":"\u2A47","&capdot;":"\u2A40","&caps;":"\u2229\uFE00","&caret;":"\u2041","&caron;":"\u02C7","&ccaps;":"\u2A4D","&ccaron;":"\u010D","&ccedil":"\xE7","&ccedil;":"\xE7","&ccirc;":"\u0109","&ccups;":"\u2A4C","&ccupssm;":"\u2A50","&cdot;":"\u010B","&cedil":"\xB8","&cedil;":"\xB8","&cemptyv;":"\u29B2","&cent":"\xA2","&cent;":"\xA2","&centerdot;":"\xB7","&cfr;":"\u{1D520}","&chcy;":"\u0447","&check;":"\u2713","&checkmark;":"\u2713","&chi;":"\u03C7","&cir;":"\u25CB","&cirE;":"\u29C3","&circ;":"\u02C6","&circeq;":"\u2257","&circlearrowleft;":"\u21BA","&circlearrowright;":"\u21BB","&circledR;":"\xAE","&circledS;":"\u24C8","&circledast;":"\u229B","&circledcirc;":"\u229A","&circleddash;":"\u229D","&cire;":"\u2257","&cirfnint;":"\u2A10","&cirmid;":"\u2AEF","&cirscir;":"\u29C2","&clubs;":"\u2663","&clubsuit;":"\u2663","&colon;":":","&colone;":"\u2254","&coloneq;":"\u2254","&comma;":",","&commat;":"@","&comp;":"\u2201","&compfn;":"\u2218","&complement;":"\u2201","&complexes;":"\u2102","&cong;":"\u2245","&congdot;":"\u2A6D","&conint;":"\u222E","&copf;":"\u{1D554}","&coprod;":"\u2210","&copy":"\xA9","&copy;":"\xA9","&copysr;":"\u2117","&crarr;":"\u21B5","&cross;":"\u2717","&cscr;":"\u{1D4B8}","&csub;":"\u2ACF","&csube;":"\u2AD1","&csup;":"\u2AD0","&csupe;":"\u2AD2","&ctdot;":"\u22EF","&cudarrl;":"\u2938","&cudarrr;":"\u2935","&cuepr;":"\u22DE","&cuesc;":"\u22DF","&cularr;":"\u21B6","&cularrp;":"\u293D","&cup;":"\u222A","&cupbrcap;":"\u2A48","&cupcap;":"\u2A46","&cupcup;":"\u2A4A","&cupdot;":"\u228D","&cupor;":"\u2A45","&cups;":"\u222A\uFE00","&curarr;":"\u21B7","&curarrm;":"\u293C","&curlyeqprec;":"\u22DE","&curlyeqsucc;":"\u22DF","&curlyvee;":"\u22CE","&curlywedge;":"\u22CF","&curren":"\xA4","&curren;":"\xA4","&curvearrowleft;":"\u21B6","&curvearrowright;":"\u21B7","&cuvee;":"\u22CE","&cuwed;":"\u22CF","&cwconint;":"\u2232","&cwint;":"\u2231","&cylcty;":"\u232D","&dArr;":"\u21D3","&dHar;":"\u2965","&dagger;":"\u2020","&daleth;":"\u2138","&darr;":"\u2193","&dash;":"\u2010","&dashv;":"\u22A3","&dbkarow;":"\u290F","&dblac;":"\u02DD","&dcaron;":"\u010F","&dcy;":"\u0434","&dd;":"\u2146","&ddagger;":"\u2021","&ddarr;":"\u21CA","&ddotseq;":"\u2A77","&deg":"\xB0","&deg;":"\xB0","&delta;":"\u03B4","&demptyv;":"\u29B1","&dfisht;":"\u297F","&dfr;":"\u{1D521}","&dharl;":"\u21C3","&dharr;":"\u21C2","&diam;":"\u22C4","&diamond;":"\u22C4","&diamondsuit;":"\u2666","&diams;":"\u2666","&die;":"\xA8","&digamma;":"\u03DD","&disin;":"\u22F2","&div;":"\xF7","&divide":"\xF7","&divide;":"\xF7","&divideontimes;":"\u22C7","&divonx;":"\u22C7","&djcy;":"\u0452","&dlcorn;":"\u231E","&dlcrop;":"\u230D","&dollar;":"$","&dopf;":"\u{1D555}","&dot;":"\u02D9","&doteq;":"\u2250","&doteqdot;":"\u2251","&dotminus;":"\u2238","&dotplus;":"\u2214","&dotsquare;":"\u22A1","&doublebarwedge;":"\u2306","&downarrow;":"\u2193","&downdownarrows;":"\u21CA","&downharpoonleft;":"\u21C3","&downharpoonright;":"\u21C2","&drbkarow;":"\u2910","&drcorn;":"\u231F","&drcrop;":"\u230C","&dscr;":"\u{1D4B9}","&dscy;":"\u0455","&dsol;":"\u29F6","&dstrok;":"\u0111","&dtdot;":"\u22F1","&dtri;":"\u25BF","&dtrif;":"\u25BE","&duarr;":"\u21F5","&duhar;":"\u296F","&dwangle;":"\u29A6","&dzcy;":"\u045F","&dzigrarr;":"\u27FF","&eDDot;":"\u2A77","&eDot;":"\u2251","&eacute":"\xE9","&eacute;":"\xE9","&easter;":"\u2A6E","&ecaron;":"\u011B","&ecir;":"\u2256","&ecirc":"\xEA","&ecirc;":"\xEA","&ecolon;":"\u2255","&ecy;":"\u044D","&edot;":"\u0117","&ee;":"\u2147","&efDot;":"\u2252","&efr;":"\u{1D522}","&eg;":"\u2A9A","&egrave":"\xE8","&egrave;":"\xE8","&egs;":"\u2A96","&egsdot;":"\u2A98","&el;":"\u2A99","&elinters;":"\u23E7","&ell;":"\u2113","&els;":"\u2A95","&elsdot;":"\u2A97","&emacr;":"\u0113","&empty;":"\u2205","&emptyset;":"\u2205","&emptyv;":"\u2205","&emsp13;":"\u2004","&emsp14;":"\u2005","&emsp;":"\u2003","&eng;":"\u014B","&ensp;":"\u2002","&eogon;":"\u0119","&eopf;":"\u{1D556}","&epar;":"\u22D5","&eparsl;":"\u29E3","&eplus;":"\u2A71","&epsi;":"\u03B5","&epsilon;":"\u03B5","&epsiv;":"\u03F5","&eqcirc;":"\u2256","&eqcolon;":"\u2255","&eqsim;":"\u2242","&eqslantgtr;":"\u2A96","&eqslantless;":"\u2A95","&equals;":"=","&equest;":"\u225F","&equiv;":"\u2261","&equivDD;":"\u2A78","&eqvparsl;":"\u29E5","&erDot;":"\u2253","&erarr;":"\u2971","&escr;":"\u212F","&esdot;":"\u2250","&esim;":"\u2242","&eta;":"\u03B7","&eth":"\xF0","&eth;":"\xF0","&euml":"\xEB","&euml;":"\xEB","&euro;":"\u20AC","&excl;":"!","&exist;":"\u2203","&expectation;":"\u2130","&exponentiale;":"\u2147","&fallingdotseq;":"\u2252","&fcy;":"\u0444","&female;":"\u2640","&ffilig;":"\uFB03","&fflig;":"\uFB00","&ffllig;":"\uFB04","&ffr;":"\u{1D523}","&filig;":"\uFB01","&fjlig;":"fj","&flat;":"\u266D","&fllig;":"\uFB02","&fltns;":"\u25B1","&fnof;":"\u0192","&fopf;":"\u{1D557}","&forall;":"\u2200","&fork;":"\u22D4","&forkv;":"\u2AD9","&fpartint;":"\u2A0D","&frac12":"\xBD","&frac12;":"\xBD","&frac13;":"\u2153","&frac14":"\xBC","&frac14;":"\xBC","&frac15;":"\u2155","&frac16;":"\u2159","&frac18;":"\u215B","&frac23;":"\u2154","&frac25;":"\u2156","&frac34":"\xBE","&frac34;":"\xBE","&frac35;":"\u2157","&frac38;":"\u215C","&frac45;":"\u2158","&frac56;":"\u215A","&frac58;":"\u215D","&frac78;":"\u215E","&frasl;":"\u2044","&frown;":"\u2322","&fscr;":"\u{1D4BB}","&gE;":"\u2267","&gEl;":"\u2A8C","&gacute;":"\u01F5","&gamma;":"\u03B3","&gammad;":"\u03DD","&gap;":"\u2A86","&gbreve;":"\u011F","&gcirc;":"\u011D","&gcy;":"\u0433","&gdot;":"\u0121","&ge;":"\u2265","&gel;":"\u22DB","&geq;":"\u2265","&geqq;":"\u2267","&geqslant;":"\u2A7E","&ges;":"\u2A7E","&gescc;":"\u2AA9","&gesdot;":"\u2A80","&gesdoto;":"\u2A82","&gesdotol;":"\u2A84","&gesl;":"\u22DB\uFE00","&gesles;":"\u2A94","&gfr;":"\u{1D524}","&gg;":"\u226B","&ggg;":"\u22D9","&gimel;":"\u2137","&gjcy;":"\u0453","&gl;":"\u2277","&glE;":"\u2A92","&gla;":"\u2AA5","&glj;":"\u2AA4","&gnE;":"\u2269","&gnap;":"\u2A8A","&gnapprox;":"\u2A8A","&gne;":"\u2A88","&gneq;":"\u2A88","&gneqq;":"\u2269","&gnsim;":"\u22E7","&gopf;":"\u{1D558}","&grave;":"`","&gscr;":"\u210A","&gsim;":"\u2273","&gsime;":"\u2A8E","&gsiml;":"\u2A90","&gt":">","&gt;":">","&gtcc;":"\u2AA7","&gtcir;":"\u2A7A","&gtdot;":"\u22D7","&gtlPar;":"\u2995","&gtquest;":"\u2A7C","&gtrapprox;":"\u2A86","&gtrarr;":"\u2978","&gtrdot;":"\u22D7","&gtreqless;":"\u22DB","&gtreqqless;":"\u2A8C","&gtrless;":"\u2277","&gtrsim;":"\u2273","&gvertneqq;":"\u2269\uFE00","&gvnE;":"\u2269\uFE00","&hArr;":"\u21D4","&hairsp;":"\u200A","&half;":"\xBD","&hamilt;":"\u210B","&hardcy;":"\u044A","&harr;":"\u2194","&harrcir;":"\u2948","&harrw;":"\u21AD","&hbar;":"\u210F","&hcirc;":"\u0125","&hearts;":"\u2665","&heartsuit;":"\u2665","&hellip;":"\u2026","&hercon;":"\u22B9","&hfr;":"\u{1D525}","&hksearow;":"\u2925","&hkswarow;":"\u2926","&hoarr;":"\u21FF","&homtht;":"\u223B","&hookleftarrow;":"\u21A9","&hookrightarrow;":"\u21AA","&hopf;":"\u{1D559}","&horbar;":"\u2015","&hscr;":"\u{1D4BD}","&hslash;":"\u210F","&hstrok;":"\u0127","&hybull;":"\u2043","&hyphen;":"\u2010","&iacute":"\xED","&iacute;":"\xED","&ic;":"\u2063","&icirc":"\xEE","&icirc;":"\xEE","&icy;":"\u0438","&iecy;":"\u0435","&iexcl":"\xA1","&iexcl;":"\xA1","&iff;":"\u21D4","&ifr;":"\u{1D526}","&igrave":"\xEC","&igrave;":"\xEC","&ii;":"\u2148","&iiiint;":"\u2A0C","&iiint;":"\u222D","&iinfin;":"\u29DC","&iiota;":"\u2129","&ijlig;":"\u0133","&imacr;":"\u012B","&image;":"\u2111","&imagline;":"\u2110","&imagpart;":"\u2111","&imath;":"\u0131","&imof;":"\u22B7","&imped;":"\u01B5","&in;":"\u2208","&incare;":"\u2105","&infin;":"\u221E","&infintie;":"\u29DD","&inodot;":"\u0131","&int;":"\u222B","&intcal;":"\u22BA","&integers;":"\u2124","&intercal;":"\u22BA","&intlarhk;":"\u2A17","&intprod;":"\u2A3C","&iocy;":"\u0451","&iogon;":"\u012F","&iopf;":"\u{1D55A}","&iota;":"\u03B9","&iprod;":"\u2A3C","&iquest":"\xBF","&iquest;":"\xBF","&iscr;":"\u{1D4BE}","&isin;":"\u2208","&isinE;":"\u22F9","&isindot;":"\u22F5","&isins;":"\u22F4","&isinsv;":"\u22F3","&isinv;":"\u2208","&it;":"\u2062","&itilde;":"\u0129","&iukcy;":"\u0456","&iuml":"\xEF","&iuml;":"\xEF","&jcirc;":"\u0135","&jcy;":"\u0439","&jfr;":"\u{1D527}","&jmath;":"\u0237","&jopf;":"\u{1D55B}","&jscr;":"\u{1D4BF}","&jsercy;":"\u0458","&jukcy;":"\u0454","&kappa;":"\u03BA","&kappav;":"\u03F0","&kcedil;":"\u0137","&kcy;":"\u043A","&kfr;":"\u{1D528}","&kgreen;":"\u0138","&khcy;":"\u0445","&kjcy;":"\u045C","&kopf;":"\u{1D55C}","&kscr;":"\u{1D4C0}","&lAarr;":"\u21DA","&lArr;":"\u21D0","&lAtail;":"\u291B","&lBarr;":"\u290E","&lE;":"\u2266","&lEg;":"\u2A8B","&lHar;":"\u2962","&lacute;":"\u013A","&laemptyv;":"\u29B4","&lagran;":"\u2112","&lambda;":"\u03BB","&lang;":"\u27E8","&langd;":"\u2991","&langle;":"\u27E8","&lap;":"\u2A85","&laquo":"\xAB","&laquo;":"\xAB","&larr;":"\u2190","&larrb;":"\u21E4","&larrbfs;":"\u291F","&larrfs;":"\u291D","&larrhk;":"\u21A9","&larrlp;":"\u21AB","&larrpl;":"\u2939","&larrsim;":"\u2973","&larrtl;":"\u21A2","&lat;":"\u2AAB","&latail;":"\u2919","&late;":"\u2AAD","&lates;":"\u2AAD\uFE00","&lbarr;":"\u290C","&lbbrk;":"\u2772","&lbrace;":"{","&lbrack;":"[","&lbrke;":"\u298B","&lbrksld;":"\u298F","&lbrkslu;":"\u298D","&lcaron;":"\u013E","&lcedil;":"\u013C","&lceil;":"\u2308","&lcub;":"{","&lcy;":"\u043B","&ldca;":"\u2936","&ldquo;":"\u201C","&ldquor;":"\u201E","&ldrdhar;":"\u2967","&ldrushar;":"\u294B","&ldsh;":"\u21B2","&le;":"\u2264","&leftarrow;":"\u2190","&leftarrowtail;":"\u21A2","&leftharpoondown;":"\u21BD","&leftharpoonup;":"\u21BC","&leftleftarrows;":"\u21C7","&leftrightarrow;":"\u2194","&leftrightarrows;":"\u21C6","&leftrightharpoons;":"\u21CB","&leftrightsquigarrow;":"\u21AD","&leftthreetimes;":"\u22CB","&leg;":"\u22DA","&leq;":"\u2264","&leqq;":"\u2266","&leqslant;":"\u2A7D","&les;":"\u2A7D","&lescc;":"\u2AA8","&lesdot;":"\u2A7F","&lesdoto;":"\u2A81","&lesdotor;":"\u2A83","&lesg;":"\u22DA\uFE00","&lesges;":"\u2A93","&lessapprox;":"\u2A85","&lessdot;":"\u22D6","&lesseqgtr;":"\u22DA","&lesseqqgtr;":"\u2A8B","&lessgtr;":"\u2276","&lesssim;":"\u2272","&lfisht;":"\u297C","&lfloor;":"\u230A","&lfr;":"\u{1D529}","&lg;":"\u2276","&lgE;":"\u2A91","&lhard;":"\u21BD","&lharu;":"\u21BC","&lharul;":"\u296A","&lhblk;":"\u2584","&ljcy;":"\u0459","&ll;":"\u226A","&llarr;":"\u21C7","&llcorner;":"\u231E","&llhard;":"\u296B","&lltri;":"\u25FA","&lmidot;":"\u0140","&lmoust;":"\u23B0","&lmoustache;":"\u23B0","&lnE;":"\u2268","&lnap;":"\u2A89","&lnapprox;":"\u2A89","&lne;":"\u2A87","&lneq;":"\u2A87","&lneqq;":"\u2268","&lnsim;":"\u22E6","&loang;":"\u27EC","&loarr;":"\u21FD","&lobrk;":"\u27E6","&longleftarrow;":"\u27F5","&longleftrightarrow;":"\u27F7","&longmapsto;":"\u27FC","&longrightarrow;":"\u27F6","&looparrowleft;":"\u21AB","&looparrowright;":"\u21AC","&lopar;":"\u2985","&lopf;":"\u{1D55D}","&loplus;":"\u2A2D","&lotimes;":"\u2A34","&lowast;":"\u2217","&lowbar;":"_","&loz;":"\u25CA","&lozenge;":"\u25CA","&lozf;":"\u29EB","&lpar;":"(","&lparlt;":"\u2993","&lrarr;":"\u21C6","&lrcorner;":"\u231F","&lrhar;":"\u21CB","&lrhard;":"\u296D","&lrm;":"\u200E","&lrtri;":"\u22BF","&lsaquo;":"\u2039","&lscr;":"\u{1D4C1}","&lsh;":"\u21B0","&lsim;":"\u2272","&lsime;":"\u2A8D","&lsimg;":"\u2A8F","&lsqb;":"[","&lsquo;":"\u2018","&lsquor;":"\u201A","&lstrok;":"\u0142","&lt":"<","&lt;":"<","&ltcc;":"\u2AA6","&ltcir;":"\u2A79","&ltdot;":"\u22D6","&lthree;":"\u22CB","&ltimes;":"\u22C9","&ltlarr;":"\u2976","&ltquest;":"\u2A7B","&ltrPar;":"\u2996","&ltri;":"\u25C3","&ltrie;":"\u22B4","&ltrif;":"\u25C2","&lurdshar;":"\u294A","&luruhar;":"\u2966","&lvertneqq;":"\u2268\uFE00","&lvnE;":"\u2268\uFE00","&mDDot;":"\u223A","&macr":"\xAF","&macr;":"\xAF","&male;":"\u2642","&malt;":"\u2720","&maltese;":"\u2720","&map;":"\u21A6","&mapsto;":"\u21A6","&mapstodown;":"\u21A7","&mapstoleft;":"\u21A4","&mapstoup;":"\u21A5","&marker;":"\u25AE","&mcomma;":"\u2A29","&mcy;":"\u043C","&mdash;":"\u2014","&measuredangle;":"\u2221","&mfr;":"\u{1D52A}","&mho;":"\u2127","&micro":"\xB5","&micro;":"\xB5","&mid;":"\u2223","&midast;":"*","&midcir;":"\u2AF0","&middot":"\xB7","&middot;":"\xB7","&minus;":"\u2212","&minusb;":"\u229F","&minusd;":"\u2238","&minusdu;":"\u2A2A","&mlcp;":"\u2ADB","&mldr;":"\u2026","&mnplus;":"\u2213","&models;":"\u22A7","&mopf;":"\u{1D55E}","&mp;":"\u2213","&mscr;":"\u{1D4C2}","&mstpos;":"\u223E","&mu;":"\u03BC","&multimap;":"\u22B8","&mumap;":"\u22B8","&nGg;":"\u22D9\u0338","&nGt;":"\u226B\u20D2","&nGtv;":"\u226B\u0338","&nLeftarrow;":"\u21CD","&nLeftrightarrow;":"\u21CE","&nLl;":"\u22D8\u0338","&nLt;":"\u226A\u20D2","&nLtv;":"\u226A\u0338","&nRightarrow;":"\u21CF","&nVDash;":"\u22AF","&nVdash;":"\u22AE","&nabla;":"\u2207","&nacute;":"\u0144","&nang;":"\u2220\u20D2","&nap;":"\u2249","&napE;":"\u2A70\u0338","&napid;":"\u224B\u0338","&napos;":"\u0149","&napprox;":"\u2249","&natur;":"\u266E","&natural;":"\u266E","&naturals;":"\u2115","&nbsp":"\xA0","&nbsp;":"\xA0","&nbump;":"\u224E\u0338","&nbumpe;":"\u224F\u0338","&ncap;":"\u2A43","&ncaron;":"\u0148","&ncedil;":"\u0146","&ncong;":"\u2247","&ncongdot;":"\u2A6D\u0338","&ncup;":"\u2A42","&ncy;":"\u043D","&ndash;":"\u2013","&ne;":"\u2260","&neArr;":"\u21D7","&nearhk;":"\u2924","&nearr;":"\u2197","&nearrow;":"\u2197","&nedot;":"\u2250\u0338","&nequiv;":"\u2262","&nesear;":"\u2928","&nesim;":"\u2242\u0338","&nexist;":"\u2204","&nexists;":"\u2204","&nfr;":"\u{1D52B}","&ngE;":"\u2267\u0338","&nge;":"\u2271","&ngeq;":"\u2271","&ngeqq;":"\u2267\u0338","&ngeqslant;":"\u2A7E\u0338","&nges;":"\u2A7E\u0338","&ngsim;":"\u2275","&ngt;":"\u226F","&ngtr;":"\u226F","&nhArr;":"\u21CE","&nharr;":"\u21AE","&nhpar;":"\u2AF2","&ni;":"\u220B","&nis;":"\u22FC","&nisd;":"\u22FA","&niv;":"\u220B","&njcy;":"\u045A","&nlArr;":"\u21CD","&nlE;":"\u2266\u0338","&nlarr;":"\u219A","&nldr;":"\u2025","&nle;":"\u2270","&nleftarrow;":"\u219A","&nleftrightarrow;":"\u21AE","&nleq;":"\u2270","&nleqq;":"\u2266\u0338","&nleqslant;":"\u2A7D\u0338","&nles;":"\u2A7D\u0338","&nless;":"\u226E","&nlsim;":"\u2274","&nlt;":"\u226E","&nltri;":"\u22EA","&nltrie;":"\u22EC","&nmid;":"\u2224","&nopf;":"\u{1D55F}","&not":"\xAC","&not;":"\xAC","&notin;":"\u2209","&notinE;":"\u22F9\u0338","&notindot;":"\u22F5\u0338","&notinva;":"\u2209","&notinvb;":"\u22F7","&notinvc;":"\u22F6","&notni;":"\u220C","&notniva;":"\u220C","&notnivb;":"\u22FE","&notnivc;":"\u22FD","&npar;":"\u2226","&nparallel;":"\u2226","&nparsl;":"\u2AFD\u20E5","&npart;":"\u2202\u0338","&npolint;":"\u2A14","&npr;":"\u2280","&nprcue;":"\u22E0","&npre;":"\u2AAF\u0338","&nprec;":"\u2280","&npreceq;":"\u2AAF\u0338","&nrArr;":"\u21CF","&nrarr;":"\u219B","&nrarrc;":"\u2933\u0338","&nrarrw;":"\u219D\u0338","&nrightarrow;":"\u219B","&nrtri;":"\u22EB","&nrtrie;":"\u22ED","&nsc;":"\u2281","&nsccue;":"\u22E1","&nsce;":"\u2AB0\u0338","&nscr;":"\u{1D4C3}","&nshortmid;":"\u2224","&nshortparallel;":"\u2226","&nsim;":"\u2241","&nsime;":"\u2244","&nsimeq;":"\u2244","&nsmid;":"\u2224","&nspar;":"\u2226","&nsqsube;":"\u22E2","&nsqsupe;":"\u22E3","&nsub;":"\u2284","&nsubE;":"\u2AC5\u0338","&nsube;":"\u2288","&nsubset;":"\u2282\u20D2","&nsubseteq;":"\u2288","&nsubseteqq;":"\u2AC5\u0338","&nsucc;":"\u2281","&nsucceq;":"\u2AB0\u0338","&nsup;":"\u2285","&nsupE;":"\u2AC6\u0338","&nsupe;":"\u2289","&nsupset;":"\u2283\u20D2","&nsupseteq;":"\u2289","&nsupseteqq;":"\u2AC6\u0338","&ntgl;":"\u2279","&ntilde":"\xF1","&ntilde;":"\xF1","&ntlg;":"\u2278","&ntriangleleft;":"\u22EA","&ntrianglelefteq;":"\u22EC","&ntriangleright;":"\u22EB","&ntrianglerighteq;":"\u22ED","&nu;":"\u03BD","&num;":"#","&numero;":"\u2116","&numsp;":"\u2007","&nvDash;":"\u22AD","&nvHarr;":"\u2904","&nvap;":"\u224D\u20D2","&nvdash;":"\u22AC","&nvge;":"\u2265\u20D2","&nvgt;":">\u20D2","&nvinfin;":"\u29DE","&nvlArr;":"\u2902","&nvle;":"\u2264\u20D2","&nvlt;":"<\u20D2","&nvltrie;":"\u22B4\u20D2","&nvrArr;":"\u2903","&nvrtrie;":"\u22B5\u20D2","&nvsim;":"\u223C\u20D2","&nwArr;":"\u21D6","&nwarhk;":"\u2923","&nwarr;":"\u2196","&nwarrow;":"\u2196","&nwnear;":"\u2927","&oS;":"\u24C8","&oacute":"\xF3","&oacute;":"\xF3","&oast;":"\u229B","&ocir;":"\u229A","&ocirc":"\xF4","&ocirc;":"\xF4","&ocy;":"\u043E","&odash;":"\u229D","&odblac;":"\u0151","&odiv;":"\u2A38","&odot;":"\u2299","&odsold;":"\u29BC","&oelig;":"\u0153","&ofcir;":"\u29BF","&ofr;":"\u{1D52C}","&ogon;":"\u02DB","&ograve":"\xF2","&ograve;":"\xF2","&ogt;":"\u29C1","&ohbar;":"\u29B5","&ohm;":"\u03A9","&oint;":"\u222E","&olarr;":"\u21BA","&olcir;":"\u29BE","&olcross;":"\u29BB","&oline;":"\u203E","&olt;":"\u29C0","&omacr;":"\u014D","&omega;":"\u03C9","&omicron;":"\u03BF","&omid;":"\u29B6","&ominus;":"\u2296","&oopf;":"\u{1D560}","&opar;":"\u29B7","&operp;":"\u29B9","&oplus;":"\u2295","&or;":"\u2228","&orarr;":"\u21BB","&ord;":"\u2A5D","&order;":"\u2134","&orderof;":"\u2134","&ordf":"\xAA","&ordf;":"\xAA","&ordm":"\xBA","&ordm;":"\xBA","&origof;":"\u22B6","&oror;":"\u2A56","&orslope;":"\u2A57","&orv;":"\u2A5B","&oscr;":"\u2134","&oslash":"\xF8","&oslash;":"\xF8","&osol;":"\u2298","&otilde":"\xF5","&otilde;":"\xF5","&otimes;":"\u2297","&otimesas;":"\u2A36","&ouml":"\xF6","&ouml;":"\xF6","&ovbar;":"\u233D","&par;":"\u2225","&para":"\xB6","&para;":"\xB6","&parallel;":"\u2225","&parsim;":"\u2AF3","&parsl;":"\u2AFD","&part;":"\u2202","&pcy;":"\u043F","&percnt;":"%","&period;":".","&permil;":"\u2030","&perp;":"\u22A5","&pertenk;":"\u2031","&pfr;":"\u{1D52D}","&phi;":"\u03C6","&phiv;":"\u03D5","&phmmat;":"\u2133","&phone;":"\u260E","&pi;":"\u03C0","&pitchfork;":"\u22D4","&piv;":"\u03D6","&planck;":"\u210F","&planckh;":"\u210E","&plankv;":"\u210F","&plus;":"+","&plusacir;":"\u2A23","&plusb;":"\u229E","&pluscir;":"\u2A22","&plusdo;":"\u2214","&plusdu;":"\u2A25","&pluse;":"\u2A72","&plusmn":"\xB1","&plusmn;":"\xB1","&plussim;":"\u2A26","&plustwo;":"\u2A27","&pm;":"\xB1","&pointint;":"\u2A15","&popf;":"\u{1D561}","&pound":"\xA3","&pound;":"\xA3","&pr;":"\u227A","&prE;":"\u2AB3","&prap;":"\u2AB7","&prcue;":"\u227C","&pre;":"\u2AAF","&prec;":"\u227A","&precapprox;":"\u2AB7","&preccurlyeq;":"\u227C","&preceq;":"\u2AAF","&precnapprox;":"\u2AB9","&precneqq;":"\u2AB5","&precnsim;":"\u22E8","&precsim;":"\u227E","&prime;":"\u2032","&primes;":"\u2119","&prnE;":"\u2AB5","&prnap;":"\u2AB9","&prnsim;":"\u22E8","&prod;":"\u220F","&profalar;":"\u232E","&profline;":"\u2312","&profsurf;":"\u2313","&prop;":"\u221D","&propto;":"\u221D","&prsim;":"\u227E","&prurel;":"\u22B0","&pscr;":"\u{1D4C5}","&psi;":"\u03C8","&puncsp;":"\u2008","&qfr;":"\u{1D52E}","&qint;":"\u2A0C","&qopf;":"\u{1D562}","&qprime;":"\u2057","&qscr;":"\u{1D4C6}","&quaternions;":"\u210D","&quatint;":"\u2A16","&quest;":"?","&questeq;":"\u225F","&quot":'"',"&quot;":'"',"&rAarr;":"\u21DB","&rArr;":"\u21D2","&rAtail;":"\u291C","&rBarr;":"\u290F","&rHar;":"\u2964","&race;":"\u223D\u0331","&racute;":"\u0155","&radic;":"\u221A","&raemptyv;":"\u29B3","&rang;":"\u27E9","&rangd;":"\u2992","&range;":"\u29A5","&rangle;":"\u27E9","&raquo":"\xBB","&raquo;":"\xBB","&rarr;":"\u2192","&rarrap;":"\u2975","&rarrb;":"\u21E5","&rarrbfs;":"\u2920","&rarrc;":"\u2933","&rarrfs;":"\u291E","&rarrhk;":"\u21AA","&rarrlp;":"\u21AC","&rarrpl;":"\u2945","&rarrsim;":"\u2974","&rarrtl;":"\u21A3","&rarrw;":"\u219D","&ratail;":"\u291A","&ratio;":"\u2236","&rationals;":"\u211A","&rbarr;":"\u290D","&rbbrk;":"\u2773","&rbrace;":"}","&rbrack;":"]","&rbrke;":"\u298C","&rbrksld;":"\u298E","&rbrkslu;":"\u2990","&rcaron;":"\u0159","&rcedil;":"\u0157","&rceil;":"\u2309","&rcub;":"}","&rcy;":"\u0440","&rdca;":"\u2937","&rdldhar;":"\u2969","&rdquo;":"\u201D","&rdquor;":"\u201D","&rdsh;":"\u21B3","&real;":"\u211C","&realine;":"\u211B","&realpart;":"\u211C","&reals;":"\u211D","&rect;":"\u25AD","&reg":"\xAE","&reg;":"\xAE","&rfisht;":"\u297D","&rfloor;":"\u230B","&rfr;":"\u{1D52F}","&rhard;":"\u21C1","&rharu;":"\u21C0","&rharul;":"\u296C","&rho;":"\u03C1","&rhov;":"\u03F1","&rightarrow;":"\u2192","&rightarrowtail;":"\u21A3","&rightharpoondown;":"\u21C1","&rightharpoonup;":"\u21C0","&rightleftarrows;":"\u21C4","&rightleftharpoons;":"\u21CC","&rightrightarrows;":"\u21C9","&rightsquigarrow;":"\u219D","&rightthreetimes;":"\u22CC","&ring;":"\u02DA","&risingdotseq;":"\u2253","&rlarr;":"\u21C4","&rlhar;":"\u21CC","&rlm;":"\u200F","&rmoust;":"\u23B1","&rmoustache;":"\u23B1","&rnmid;":"\u2AEE","&roang;":"\u27ED","&roarr;":"\u21FE","&robrk;":"\u27E7","&ropar;":"\u2986","&ropf;":"\u{1D563}","&roplus;":"\u2A2E","&rotimes;":"\u2A35","&rpar;":")","&rpargt;":"\u2994","&rppolint;":"\u2A12","&rrarr;":"\u21C9","&rsaquo;":"\u203A","&rscr;":"\u{1D4C7}","&rsh;":"\u21B1","&rsqb;":"]","&rsquo;":"\u2019","&rsquor;":"\u2019","&rthree;":"\u22CC","&rtimes;":"\u22CA","&rtri;":"\u25B9","&rtrie;":"\u22B5","&rtrif;":"\u25B8","&rtriltri;":"\u29CE","&ruluhar;":"\u2968","&rx;":"\u211E","&sacute;":"\u015B","&sbquo;":"\u201A","&sc;":"\u227B","&scE;":"\u2AB4","&scap;":"\u2AB8","&scaron;":"\u0161","&sccue;":"\u227D","&sce;":"\u2AB0","&scedil;":"\u015F","&scirc;":"\u015D","&scnE;":"\u2AB6","&scnap;":"\u2ABA","&scnsim;":"\u22E9","&scpolint;":"\u2A13","&scsim;":"\u227F","&scy;":"\u0441","&sdot;":"\u22C5","&sdotb;":"\u22A1","&sdote;":"\u2A66","&seArr;":"\u21D8","&searhk;":"\u2925","&searr;":"\u2198","&searrow;":"\u2198","&sect":"\xA7","&sect;":"\xA7","&semi;":";","&seswar;":"\u2929","&setminus;":"\u2216","&setmn;":"\u2216","&sext;":"\u2736","&sfr;":"\u{1D530}","&sfrown;":"\u2322","&sharp;":"\u266F","&shchcy;":"\u0449","&shcy;":"\u0448","&shortmid;":"\u2223","&shortparallel;":"\u2225","&shy":"\xAD","&shy;":"\xAD","&sigma;":"\u03C3","&sigmaf;":"\u03C2","&sigmav;":"\u03C2","&sim;":"\u223C","&simdot;":"\u2A6A","&sime;":"\u2243","&simeq;":"\u2243","&simg;":"\u2A9E","&simgE;":"\u2AA0","&siml;":"\u2A9D","&simlE;":"\u2A9F","&simne;":"\u2246","&simplus;":"\u2A24","&simrarr;":"\u2972","&slarr;":"\u2190","&smallsetminus;":"\u2216","&smashp;":"\u2A33","&smeparsl;":"\u29E4","&smid;":"\u2223","&smile;":"\u2323","&smt;":"\u2AAA","&smte;":"\u2AAC","&smtes;":"\u2AAC\uFE00","&softcy;":"\u044C","&sol;":"/","&solb;":"\u29C4","&solbar;":"\u233F","&sopf;":"\u{1D564}","&spades;":"\u2660","&spadesuit;":"\u2660","&spar;":"\u2225","&sqcap;":"\u2293","&sqcaps;":"\u2293\uFE00","&sqcup;":"\u2294","&sqcups;":"\u2294\uFE00","&sqsub;":"\u228F","&sqsube;":"\u2291","&sqsubset;":"\u228F","&sqsubseteq;":"\u2291","&sqsup;":"\u2290","&sqsupe;":"\u2292","&sqsupset;":"\u2290","&sqsupseteq;":"\u2292","&squ;":"\u25A1","&square;":"\u25A1","&squarf;":"\u25AA","&squf;":"\u25AA","&srarr;":"\u2192","&sscr;":"\u{1D4C8}","&ssetmn;":"\u2216","&ssmile;":"\u2323","&sstarf;":"\u22C6","&star;":"\u2606","&starf;":"\u2605","&straightepsilon;":"\u03F5","&straightphi;":"\u03D5","&strns;":"\xAF","&sub;":"\u2282","&subE;":"\u2AC5","&subdot;":"\u2ABD","&sube;":"\u2286","&subedot;":"\u2AC3","&submult;":"\u2AC1","&subnE;":"\u2ACB","&subne;":"\u228A","&subplus;":"\u2ABF","&subrarr;":"\u2979","&subset;":"\u2282","&subseteq;":"\u2286","&subseteqq;":"\u2AC5","&subsetneq;":"\u228A","&subsetneqq;":"\u2ACB","&subsim;":"\u2AC7","&subsub;":"\u2AD5","&subsup;":"\u2AD3","&succ;":"\u227B","&succapprox;":"\u2AB8","&succcurlyeq;":"\u227D","&succeq;":"\u2AB0","&succnapprox;":"\u2ABA","&succneqq;":"\u2AB6","&succnsim;":"\u22E9","&succsim;":"\u227F","&sum;":"\u2211","&sung;":"\u266A","&sup1":"\xB9","&sup1;":"\xB9","&sup2":"\xB2","&sup2;":"\xB2","&sup3":"\xB3","&sup3;":"\xB3","&sup;":"\u2283","&supE;":"\u2AC6","&supdot;":"\u2ABE","&supdsub;":"\u2AD8","&supe;":"\u2287","&supedot;":"\u2AC4","&suphsol;":"\u27C9","&suphsub;":"\u2AD7","&suplarr;":"\u297B","&supmult;":"\u2AC2","&supnE;":"\u2ACC","&supne;":"\u228B","&supplus;":"\u2AC0","&supset;":"\u2283","&supseteq;":"\u2287","&supseteqq;":"\u2AC6","&supsetneq;":"\u228B","&supsetneqq;":"\u2ACC","&supsim;":"\u2AC8","&supsub;":"\u2AD4","&supsup;":"\u2AD6","&swArr;":"\u21D9","&swarhk;":"\u2926","&swarr;":"\u2199","&swarrow;":"\u2199","&swnwar;":"\u292A","&szlig":"\xDF","&szlig;":"\xDF","&target;":"\u2316","&tau;":"\u03C4","&tbrk;":"\u23B4","&tcaron;":"\u0165","&tcedil;":"\u0163","&tcy;":"\u0442","&tdot;":"\u20DB","&telrec;":"\u2315","&tfr;":"\u{1D531}","&there4;":"\u2234","&therefore;":"\u2234","&theta;":"\u03B8","&thetasym;":"\u03D1","&thetav;":"\u03D1","&thickapprox;":"\u2248","&thicksim;":"\u223C","&thinsp;":"\u2009","&thkap;":"\u2248","&thksim;":"\u223C","&thorn":"\xFE","&thorn;":"\xFE","&tilde;":"\u02DC","&times":"\xD7","&times;":"\xD7","&timesb;":"\u22A0","&timesbar;":"\u2A31","&timesd;":"\u2A30","&tint;":"\u222D","&toea;":"\u2928","&top;":"\u22A4","&topbot;":"\u2336","&topcir;":"\u2AF1","&topf;":"\u{1D565}","&topfork;":"\u2ADA","&tosa;":"\u2929","&tprime;":"\u2034","&trade;":"\u2122","&triangle;":"\u25B5","&triangledown;":"\u25BF","&triangleleft;":"\u25C3","&trianglelefteq;":"\u22B4","&triangleq;":"\u225C","&triangleright;":"\u25B9","&trianglerighteq;":"\u22B5","&tridot;":"\u25EC","&trie;":"\u225C","&triminus;":"\u2A3A","&triplus;":"\u2A39","&trisb;":"\u29CD","&tritime;":"\u2A3B","&trpezium;":"\u23E2","&tscr;":"\u{1D4C9}","&tscy;":"\u0446","&tshcy;":"\u045B","&tstrok;":"\u0167","&twixt;":"\u226C","&twoheadleftarrow;":"\u219E","&twoheadrightarrow;":"\u21A0","&uArr;":"\u21D1","&uHar;":"\u2963","&uacute":"\xFA","&uacute;":"\xFA","&uarr;":"\u2191","&ubrcy;":"\u045E","&ubreve;":"\u016D","&ucirc":"\xFB","&ucirc;":"\xFB","&ucy;":"\u0443","&udarr;":"\u21C5","&udblac;":"\u0171","&udhar;":"\u296E","&ufisht;":"\u297E","&ufr;":"\u{1D532}","&ugrave":"\xF9","&ugrave;":"\xF9","&uharl;":"\u21BF","&uharr;":"\u21BE","&uhblk;":"\u2580","&ulcorn;":"\u231C","&ulcorner;":"\u231C","&ulcrop;":"\u230F","&ultri;":"\u25F8","&umacr;":"\u016B","&uml":"\xA8","&uml;":"\xA8","&uogon;":"\u0173","&uopf;":"\u{1D566}","&uparrow;":"\u2191","&updownarrow;":"\u2195","&upharpoonleft;":"\u21BF","&upharpoonright;":"\u21BE","&uplus;":"\u228E","&upsi;":"\u03C5","&upsih;":"\u03D2","&upsilon;":"\u03C5","&upuparrows;":"\u21C8","&urcorn;":"\u231D","&urcorner;":"\u231D","&urcrop;":"\u230E","&uring;":"\u016F","&urtri;":"\u25F9","&uscr;":"\u{1D4CA}","&utdot;":"\u22F0","&utilde;":"\u0169","&utri;":"\u25B5","&utrif;":"\u25B4","&uuarr;":"\u21C8","&uuml":"\xFC","&uuml;":"\xFC","&uwangle;":"\u29A7","&vArr;":"\u21D5","&vBar;":"\u2AE8","&vBarv;":"\u2AE9","&vDash;":"\u22A8","&vangrt;":"\u299C","&varepsilon;":"\u03F5","&varkappa;":"\u03F0","&varnothing;":"\u2205","&varphi;":"\u03D5","&varpi;":"\u03D6","&varpropto;":"\u221D","&varr;":"\u2195","&varrho;":"\u03F1","&varsigma;":"\u03C2","&varsubsetneq;":"\u228A\uFE00","&varsubsetneqq;":"\u2ACB\uFE00","&varsupsetneq;":"\u228B\uFE00","&varsupsetneqq;":"\u2ACC\uFE00","&vartheta;":"\u03D1","&vartriangleleft;":"\u22B2","&vartriangleright;":"\u22B3","&vcy;":"\u0432","&vdash;":"\u22A2","&vee;":"\u2228","&veebar;":"\u22BB","&veeeq;":"\u225A","&vellip;":"\u22EE","&verbar;":"|","&vert;":"|","&vfr;":"\u{1D533}","&vltri;":"\u22B2","&vnsub;":"\u2282\u20D2","&vnsup;":"\u2283\u20D2","&vopf;":"\u{1D567}","&vprop;":"\u221D","&vrtri;":"\u22B3","&vscr;":"\u{1D4CB}","&vsubnE;":"\u2ACB\uFE00","&vsubne;":"\u228A\uFE00","&vsupnE;":"\u2ACC\uFE00","&vsupne;":"\u228B\uFE00","&vzigzag;":"\u299A","&wcirc;":"\u0175","&wedbar;":"\u2A5F","&wedge;":"\u2227","&wedgeq;":"\u2259","&weierp;":"\u2118","&wfr;":"\u{1D534}","&wopf;":"\u{1D568}","&wp;":"\u2118","&wr;":"\u2240","&wreath;":"\u2240","&wscr;":"\u{1D4CC}","&xcap;":"\u22C2","&xcirc;":"\u25EF","&xcup;":"\u22C3","&xdtri;":"\u25BD","&xfr;":"\u{1D535}","&xhArr;":"\u27FA","&xharr;":"\u27F7","&xi;":"\u03BE","&xlArr;":"\u27F8","&xlarr;":"\u27F5","&xmap;":"\u27FC","&xnis;":"\u22FB","&xodot;":"\u2A00","&xopf;":"\u{1D569}","&xoplus;":"\u2A01","&xotime;":"\u2A02","&xrArr;":"\u27F9","&xrarr;":"\u27F6","&xscr;":"\u{1D4CD}","&xsqcup;":"\u2A06","&xuplus;":"\u2A04","&xutri;":"\u25B3","&xvee;":"\u22C1","&xwedge;":"\u22C0","&yacute":"\xFD","&yacute;":"\xFD","&yacy;":"\u044F","&ycirc;":"\u0177","&ycy;":"\u044B","&yen":"\xA5","&yen;":"\xA5","&yfr;":"\u{1D536}","&yicy;":"\u0457","&yopf;":"\u{1D56A}","&yscr;":"\u{1D4CE}","&yucy;":"\u044E","&yuml":"\xFF","&yuml;":"\xFF","&zacute;":"\u017A","&zcaron;":"\u017E","&zcy;":"\u0437","&zdot;":"\u017C","&zeetrf;":"\u2128","&zeta;":"\u03B6","&zfr;":"\u{1D537}","&zhcy;":"\u0436","&zigrarr;":"\u21DD","&zopf;":"\u{1D56B}","&zscr;":"\u{1D4CF}","&zwj;":"\u200D","&zwnj;":"\u200C"},zu=fC;function hC(e){return e.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(t,r)=>{if(typeof zu[t]=="string")return zu[t];if(r.charAt(0)!=="#"||t.charAt(t.length-1)!==";")return t;let i;r.charAt(1)==="x"?i=parseInt(r.substr(2),16):i=parseInt(r.substr(1),10);let n="";return i>=55296&&i<=57343||i>1114111?"\uFFFD":(i>65535&&(i-=65536,n+=String.fromCharCode(i>>>10&1023|55296),i=56320|i&1023),n+=String.fromCharCode(i),n)})}function Mt(e){return e.trim().replace(/[<>"'?&]/g,t=>{let r=t.charCodeAt(0).toString(16);return r.length<2&&(r="0"+r),"&#x"+r.toUpperCase()+";"})}function Hd(e){return"<div>"+Mt(e).replace(/\n/g,"<br />")+"</div>"}function Nd(e){return e=e.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
173
163
  `).replace(/<\/?(p|div|table|tr|td|th)\b[^>]*>/gi,`
174
164
 
175
165
  `).replace(/<script\b[^>]*>.*?<\/script\b[^>]*>/gi," ").replace(/^.*<body\b[^>]*>/i,"").replace(/^.*<\/head\b[^>]*>/i,"").replace(/^.*<\!doctype\b[^>]*>/i,"").replace(/<\/body\b[^>]*>.*$/i,"").replace(/<\/html\b[^>]*>.*$/i,"").replace(/<a\b[^>]*href\s*=\s*["']?([^\s"']+)[^>]*>/gi," ($1) ").replace(/<\/?(span|em|i|strong|b|u|a)\b[^>]*>/gi,"").replace(/<li\b[^>]*>[\n\u0001\s]*/gi,"* ").replace(/<hr\b[^>]*>/g,`
@@ -179,56 +169,56 @@ ${a}
179
169
 
180
170
  `).replace(/^\n+/,`
181
171
  `).replace(/\n+$/,`
182
- `),e=B1(e),e}function rm(e){return[].concat(e.name||[]).concat(e.name?`<${e.address}>`:e.address).join(" ")}function Ku(e){let t=[],r=(i,n)=>{if(n&&t.push(", "),i.group){let o=`${i.name}:`,s=";";t.push(o),i.group.forEach(r),t.push(s)}else t.push(rm(i))};return e.forEach(r),t.join("")}function im(e){return`<a href="mailto:${Jt(e.address)}" class="postal-email-address">${Jt(e.name||`<${e.address}>`)}</a>`}function Yu(e){let t=[],r=(i,n)=>{if(n&&t.push('<span class="postal-email-address-separator">, </span>'),i.group){let o=`<span class="postal-email-address-group">${Jt(i.name)}:</span>`,s='<span class="postal-email-address-group">;</span>';t.push(o),i.group.forEach(r),t.push(s)}else t.push(im(i))};return e.forEach(r),t.join(" ")}function N1(e,t,r){e=(e||"").toString(),t=t||76;let i=0,n=e.length,o="",s,a;for(;i<n;){if(s=e.substr(i,t),s.length<t){o+=s;break}if(a=s.match(/^[^\n\r]*(\r?\n|\r)/)){s=a[0],o+=s,i+=s.length;continue}else(a=s.match(/(\s+)[^\s]*$/))&&a[0].length-(r?(a[1]||"").length:0)<s.length?s=s.substr(0,s.length-(a[0].length-(r?(a[1]||"").length:0))):(a=e.substr(i+s.length).match(/^[^\s]+(\s*)/))&&(s=s+a[0].substr(0,a[0].length-(r?0:(a[1]||"").length)));o+=s,i+=s.length,i<n&&(o+=`\r
183
- `)}return o}function Qu(e){let t=[];if(e.from&&t.push({key:"From",val:rm(e.from)}),e.subject&&t.push({key:"Subject",val:e.subject}),e.date){let s={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},a=typeof Intl>"u"?e.date:new Intl.DateTimeFormat("default",s).format(new Date(e.date));t.push({key:"Date",val:a})}e.to&&e.to.length&&t.push({key:"To",val:Ku(e.to)}),e.cc&&e.cc.length&&t.push({key:"Cc",val:Ku(e.cc)}),e.bcc&&e.bcc.length&&t.push({key:"Bcc",val:Ku(e.bcc)});let r=t.map(s=>s.key.length).reduce((s,a)=>a>s?a:s,0);t=t.flatMap(s=>{let a=r-s.key.length,u=`${s.key}: ${" ".repeat(a)}`,l=`${" ".repeat(s.key.length+1)} ${" ".repeat(a)}`;return N1(s.val,80,!0).split(/\r?\n/).map(c=>c.trim()).map((c,m)=>`${m?l:u}${c}`)});let i=t.map(s=>s.length).reduce((s,a)=>a>s?a:s,0),n="-".repeat(i);return`
172
+ `),e=hC(e),e}function Ld(e){return[].concat(e.name||[]).concat(e.name?`<${e.address}>`:e.address).join(" ")}function Mu(e){let t=[],r=(i,n)=>{if(n&&t.push(", "),i.group){let o=`${i.name}:`,s=";";t.push(o),i.group.forEach(r),t.push(s)}else t.push(Ld(i))};return e.forEach(r),t.join("")}function Gd(e){return`<a href="mailto:${Mt(e.address)}" class="postal-email-address">${Mt(e.name||`<${e.address}>`)}</a>`}function Ju(e){let t=[],r=(i,n)=>{if(n&&t.push('<span class="postal-email-address-separator">, </span>'),i.group){let o=`<span class="postal-email-address-group">${Mt(i.name)}:</span>`,s='<span class="postal-email-address-group">;</span>';t.push(o),i.group.forEach(r),t.push(s)}else t.push(Gd(i))};return e.forEach(r),t.join(" ")}function gC(e,t,r){e=(e||"").toString(),t=t||76;let i=0,n=e.length,o="",s,a;for(;i<n;){if(s=e.substr(i,t),s.length<t){o+=s;break}if(a=s.match(/^[^\n\r]*(\r?\n|\r)/)){s=a[0],o+=s,i+=s.length;continue}else(a=s.match(/(\s+)[^\s]*$/))&&a[0].length-(r?(a[1]||"").length:0)<s.length?s=s.substr(0,s.length-(a[0].length-(r?(a[1]||"").length:0))):(a=e.substr(i+s.length).match(/^[^\s]+(\s*)/))&&(s=s+a[0].substr(0,a[0].length-(r?0:(a[1]||"").length)));o+=s,i+=s.length,i<n&&(o+=`\r
173
+ `)}return o}function Bu(e){let t=[];if(e.from&&t.push({key:"From",val:Ld(e.from)}),e.subject&&t.push({key:"Subject",val:e.subject}),e.date){let s={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},a=typeof Intl>"u"?e.date:new Intl.DateTimeFormat("default",s).format(new Date(e.date));t.push({key:"Date",val:a})}e.to&&e.to.length&&t.push({key:"To",val:Mu(e.to)}),e.cc&&e.cc.length&&t.push({key:"Cc",val:Mu(e.cc)}),e.bcc&&e.bcc.length&&t.push({key:"Bcc",val:Mu(e.bcc)});let r=t.map(s=>s.key.length).reduce((s,a)=>a>s?a:s,0);t=t.flatMap(s=>{let a=r-s.key.length,u=`${s.key}: ${" ".repeat(a)}`,l=`${" ".repeat(s.key.length+1)} ${" ".repeat(a)}`;return gC(s.val,80,!0).split(/\r?\n/).map(d=>d.trim()).map((d,m)=>`${m?l:u}${d}`)});let i=t.map(s=>s.length).reduce((s,a)=>a>s?a:s,0),n="-".repeat(i);return`
184
174
  ${n}
185
175
  ${t.join(`
186
176
  `)}
187
177
  ${n}
188
- `}function Zu(e){let t=[];if(e.from&&t.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${im(e.from)}</div>`),e.subject&&t.push(`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${Jt(e.subject)}</div>`),e.date){let i={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},n=typeof Intl>"u"?e.date:new Intl.DateTimeFormat("default",i).format(new Date(e.date));t.push(`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${Jt(e.date)}">${Jt(n)}</div>`)}return e.to&&e.to.length&&t.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${Yu(e.to)}</div>`),e.cc&&e.cc.length&&t.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${Yu(e.cc)}</div>`),e.bcc&&e.bcc.length&&t.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${Yu(e.bcc)}</div>`),`<div class="postal-email-header">${t.length?'<div class="postal-email-header-row">':""}${t.join(`</div>
189
- <div class="postal-email-header-row">`)}${t.length?"</div>":""}</div>`}function L1(e,t){let r=!1,i="text",n,o=[],s={address:[],comment:[],group:[],text:[],textWasQuoted:[]},a,u,l=!1;for(a=0,u=e.length;a<u;a++){let d=e[a],c=a?e[a-1]:null;if(d.type==="operator")switch(d.value){case"<":i="address",l=!1;break;case"(":i="comment",l=!1;break;case":":i="group",r=!0,l=!1;break;case'"':l=!l,i="text";break;default:i="text",l=!1;break}else d.value&&(i==="address"&&(d.value=d.value.replace(/^[^<]*<\s*/,"")),c&&c.noBreak&&s[i].length?(s[i][s[i].length-1]+=d.value,i==="text"&&l&&(s.textWasQuoted[s.textWasQuoted.length-1]=!0)):(s[i].push(d.value),i==="text"&&s.textWasQuoted.push(l)))}if(!s.text.length&&s.comment.length&&(s.text=s.comment,s.comment=[]),r){s.text=s.text.join(" ");let d=[];s.group.length&&el(s.group.join(","),{_depth:t+1}).forEach(m=>{m.group?d=d.concat(m.group):d.push(m)}),o.push({name:Mt(s.text||n&&n.name),group:d})}else{if(!s.address.length&&s.text.length){for(a=s.text.length-1;a>=0;a--)if(!s.textWasQuoted[a]&&s.text[a].match(/^[^@\s]+@[^@\s]+$/)){s.address=s.text.splice(a,1),s.textWasQuoted.splice(a,1);break}let d=function(c){return s.address.length?c:(s.address=[c.trim()]," ")};if(!s.address.length)for(a=s.text.length-1;a>=0&&!(!s.textWasQuoted[a]&&(s.text[a]=s.text[a].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,d).trim(),s.address.length));a--);}if(!s.text.length&&s.comment.length&&(s.text=s.comment,s.comment=[]),s.address.length>1&&(s.text=s.text.concat(s.address.splice(1))),s.text=s.text.join(" "),s.address=s.address.join(" "),!s.address&&/^=\?[^=]+?=$/.test(s.text.trim())){let d=Mt(s.text);if(/<[^<>]+@[^<>]+>/.test(d)){let c=el(d);if(c&&c.length)return c}return[{address:"",name:d}]}n={address:s.address||s.text||"",name:Mt(s.text||s.address||"")},n.address===n.name&&((n.address||"").match(/@/)?n.name="":n.address=""),o.push(n)}return o}var Xu=class{constructor(t){this.str=(t||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){let t=[];for(let r=0,i=this.str.length;r<i;r++){let n=this.str.charAt(r),o=r<i-1?this.str.charAt(r+1):null;this.checkChar(n,o)}return this.list.forEach(r=>{r.value=(r.value||"").toString().trim(),r.value&&t.push(r)}),t}checkChar(t,r){if(!this.escaped){if(t===this.operatorExpecting){this.node={type:"operator",value:t},r&&![" "," ","\r",`
178
+ `}function Hu(e){let t=[];if(e.from&&t.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${Gd(e.from)}</div>`),e.subject&&t.push(`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${Mt(e.subject)}</div>`),e.date){let i={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},n=typeof Intl>"u"?e.date:new Intl.DateTimeFormat("default",i).format(new Date(e.date));t.push(`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${Mt(e.date)}">${Mt(n)}</div>`)}return e.to&&e.to.length&&t.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${Ju(e.to)}</div>`),e.cc&&e.cc.length&&t.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${Ju(e.cc)}</div>`),e.bcc&&e.bcc.length&&t.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${Ju(e.bcc)}</div>`),`<div class="postal-email-header">${t.length?'<div class="postal-email-header-row">':""}${t.join(`</div>
179
+ <div class="postal-email-header-row">`)}${t.length?"</div>":""}</div>`}function bC(e,t){let r=!1,i="text",n,o=[],s={address:[],comment:[],group:[],text:[],textWasQuoted:[]},a,u,l=!1;for(a=0,u=e.length;a<u;a++){let c=e[a],d=a?e[a-1]:null;if(c.type==="operator")switch(c.value){case"<":i="address",l=!1;break;case"(":i="comment",l=!1;break;case":":i="group",r=!0,l=!1;break;case'"':l=!l,i="text";break;default:i="text",l=!1;break}else c.value&&(i==="address"&&(c.value=c.value.replace(/^[^<]*<\s*/,"")),d&&d.noBreak&&s[i].length?(s[i][s[i].length-1]+=c.value,i==="text"&&l&&(s.textWasQuoted[s.textWasQuoted.length-1]=!0)):(s[i].push(c.value),i==="text"&&s.textWasQuoted.push(l)))}if(!s.text.length&&s.comment.length&&(s.text=s.comment,s.comment=[]),r){s.text=s.text.join(" ");let c=[];s.group.length&&Lu(s.group.join(","),{_depth:t+1}).forEach(m=>{m.group?c=c.concat(m.group):c.push(m)}),o.push({name:zt(s.text||n&&n.name),group:c})}else{if(!s.address.length&&s.text.length){for(a=s.text.length-1;a>=0;a--)if(!s.textWasQuoted[a]&&s.text[a].match(/^[^@\s]+@[^@\s]+$/)){s.address=s.text.splice(a,1),s.textWasQuoted.splice(a,1);break}let c=function(d){return s.address.length?d:(s.address=[d.trim()]," ")};if(!s.address.length)for(a=s.text.length-1;a>=0&&!(!s.textWasQuoted[a]&&(s.text[a]=s.text[a].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,c).trim(),s.address.length));a--);}if(!s.text.length&&s.comment.length&&(s.text=s.comment,s.comment=[]),s.address.length>1&&(s.text=s.text.concat(s.address.splice(1))),s.text=s.text.join(" "),s.address=s.address.join(" "),!s.address&&/^=\?[^=]+?=$/.test(s.text.trim())){let c=zt(s.text);if(/<[^<>]+@[^<>]+>/.test(c)){let d=Lu(c);if(d&&d.length)return d}return[{address:"",name:c}]}n={address:s.address||s.text||"",name:zt(s.text||s.address||"")},n.address===n.name&&((n.address||"").match(/@/)?n.name="":n.address=""),o.push(n)}return o}var Nu=class{constructor(t){this.str=(t||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){let t=[];for(let r=0,i=this.str.length;r<i;r++){let n=this.str.charAt(r),o=r<i-1?this.str.charAt(r+1):null;this.checkChar(n,o)}return this.list.forEach(r=>{r.value=(r.value||"").toString().trim(),r.value&&t.push(r)}),t}checkChar(t,r){if(!this.escaped){if(t===this.operatorExpecting){this.node={type:"operator",value:t},r&&![" "," ","\r",`
190
180
  `,",",";"].includes(r)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",this.escaped=!1;return}else if(!this.operatorExpecting&&t in this.operators){this.node={type:"operator",value:t},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[t],this.escaped=!1;return}else if(this.operatorExpecting==='"'&&t==="\\"){this.escaped=!0;return}}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),t===`
191
- `&&(t=" "),(t.charCodeAt(0)>=33||[" "," "].includes(t))&&(this.node.value+=t),this.escaped=!1}},G1=50;function el(e,t){t=t||{};let r=t._depth||0;if(r>G1)return[];let n=new Xu(e).tokenize(),o=[],s=[],a=[];if(n.forEach(u=>{u.type==="operator"&&(u.value===","||u.value===";")?(s.length&&o.push(s),s=[]):s.push(u)}),s.length&&o.push(s),o.forEach(u=>{u=L1(u,r),u.length&&(a=a.concat(u))}),t.flatten){let u=[],l=d=>{d.forEach(c=>{if(c.group)return l(c.group);u.push(c)})};return l(a),u}return a}var $i=el;function nm(e){for(var t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(e),n=i.byteLength,o=n%3,s=n-o,a,u,l,d,c,m=0;m<s;m=m+3)c=i[m]<<16|i[m+1]<<8|i[m+2],a=(c&16515072)>>18,u=(c&258048)>>12,l=(c&4032)>>6,d=c&63,t+=r[a]+r[u]+r[l]+r[d];return o==1?(c=i[s],a=(c&252)>>2,u=(c&3)<<4,t+=r[a]+r[u]+"=="):o==2&&(c=i[s]<<8|i[s+1],a=(c&64512)>>10,u=(c&1008)>>4,l=(c&15)<<2,t+=r[a]+r[u]+r[l]+"="),t}var U1=256,W1=2*1024*1024;function tl(e){return e.replace(/-(.)/g,(t,r)=>r.toUpperCase())}var Ur=class e{static parse(t,r){return new e(r).parse(t)}constructor(t){this.options=t||{},this.mimeOptions={maxNestingDepth:this.options.maxNestingDepth||U1,maxHeadersSize:this.options.maxHeadersSize||W1},this.root=this.currentNode=new ar({postalMime:this,...this.mimeOptions}),this.boundaries=[],this.textContent={},this.attachments=[],this.attachmentEncoding=(this.options.attachmentEncoding||"").toString().replace(/[-_\s]/g,"").trim().toLowerCase()||"arraybuffer",this.started=!1}async finalize(){await this.root.finalize()}async processLine(t,r){let i=this.boundaries;if(i.length&&t.length>2&&t[0]===45&&t[1]===45)for(let n=i.length-1;n>=0;n--){let o=i[n];if(t.length<o.value.length+2)continue;let s=!0;for(let d=0;d<o.value.length;d++)if(t[d+2]!==o.value[d]){s=!1;break}if(!s)continue;let a=o.value.length+2,u=!1;t.length>=o.value.length+4&&t[o.value.length+2]===45&&t[o.value.length+3]===45&&(u=!0,a=o.value.length+4);let l=!0;for(let d=a;d<t.length;d++)if(t[d]!==32&&t[d]!==9){l=!1;break}if(l)return u?(await o.node.finalize(),this.currentNode=o.node.parentNode||this.root):(await o.node.finalizeChildNodes(),this.currentNode=new ar({postalMime:this,parentNode:o.node,parentMultipartType:o.node.contentType.multipart,...this.mimeOptions})),r?this.finalize():void 0}if(this.currentNode.feed(t),r)return this.finalize()}readLine(){let t=this.readPos,r=this.readPos;for(;this.readPos<this.av.length;){let i=this.av[this.readPos++];if(i!==13&&i!==10&&(r=this.readPos),i===10)return{bytes:new Uint8Array(this.buf,t,r-t),done:this.readPos>=this.av.length}}return{bytes:new Uint8Array(this.buf,t,r-t),done:this.readPos>=this.av.length}}async processNodeTree(){let t={},r=new Set,i=this.textMap=new Map,n=this.forceRfc822Attachments(),o=async(s,a,u)=>{if(a=a||!1,u=u||!1,s.contentType.multipart)s.contentType.multipart==="alternative"?a=s:s.contentType.multipart==="related"&&(u=s);else if(this.isInlineMessageRfc822(s)&&!n){let l=new e;s.subMessage=await l.parse(s.content),i.has(s)||i.set(s,{});let d=i.get(s);(s.subMessage.text||!s.subMessage.html)&&(d.plain=d.plain||[],d.plain.push({type:"subMessage",value:s.subMessage}),r.add("plain")),s.subMessage.html&&(d.html=d.html||[],d.html.push({type:"subMessage",value:s.subMessage}),r.add("html")),l.textMap&&l.textMap.forEach((c,m)=>{i.set(m,c)});for(let c of s.subMessage.attachments||[])this.attachments.push(c)}else if(this.isInlineTextNode(s)){let l=s.contentType.parsed.value.substr(s.contentType.parsed.value.indexOf("/")+1),d=a||s;i.has(d)||i.set(d,{});let c=i.get(d);c[l]=c[l]||[],c[l].push({type:"text",value:s.getTextContent()}),r.add(l)}else if(s.content){let l=s.contentDisposition?.parsed?.params?.filename||s.contentType.parsed.params.name||null,d={filename:l?Mt(l):null,mimeType:s.contentType.parsed.value,disposition:s.contentDisposition?.parsed?.value||null};switch(u&&s.contentId&&(d.related=!0),s.contentDescription&&(d.description=s.contentDescription),s.contentId&&(d.contentId=s.contentId),s.contentType.parsed.value){case"text/calendar":case"application/ics":{s.contentType.parsed.params.method&&(d.method=s.contentType.parsed.params.method.toString().toUpperCase().trim());let c=s.getTextContent().replace(/\r?\n/g,`
181
+ `&&(t=" "),(t.charCodeAt(0)>=33||[" "," "].includes(t))&&(this.node.value+=t),this.escaped=!1}},vC=50;function Lu(e,t){t=t||{};let r=t._depth||0;if(r>vC)return[];let n=new Nu(e).tokenize(),o=[],s=[],a=[];if(n.forEach(u=>{u.type==="operator"&&(u.value===","||u.value===";")?(s.length&&o.push(s),s=[]):s.push(u)}),s.length&&o.push(s),o.forEach(u=>{u=bC(u,r),u.length&&(a=a.concat(u))}),t.flatten){let u=[],l=c=>{c.forEach(d=>{if(d.group)return l(d.group);u.push(d)})};return l(a),u}return a}var Ti=Lu;function Ud(e){for(var t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(e),n=i.byteLength,o=n%3,s=n-o,a,u,l,c,d,m=0;m<s;m=m+3)d=i[m]<<16|i[m+1]<<8|i[m+2],a=(d&16515072)>>18,u=(d&258048)>>12,l=(d&4032)>>6,c=d&63,t+=r[a]+r[u]+r[l]+r[c];return o==1?(d=i[s],a=(d&252)>>2,u=(d&3)<<4,t+=r[a]+r[u]+"=="):o==2&&(d=i[s]<<8|i[s+1],a=(d&64512)>>10,u=(d&1008)>>4,l=(d&15)<<2,t+=r[a]+r[u]+r[l]+"="),t}var _C=256,yC=2*1024*1024;function Gu(e){return e.replace(/-(.)/g,(t,r)=>r.toUpperCase())}var Ur=class e{static parse(t,r){return new e(r).parse(t)}constructor(t){this.options=t||{},this.mimeOptions={maxNestingDepth:this.options.maxNestingDepth||_C,maxHeadersSize:this.options.maxHeadersSize||yC},this.root=this.currentNode=new ur({postalMime:this,...this.mimeOptions}),this.boundaries=[],this.textContent={},this.attachments=[],this.attachmentEncoding=(this.options.attachmentEncoding||"").toString().replace(/[-_\s]/g,"").trim().toLowerCase()||"arraybuffer",this.started=!1}async finalize(){await this.root.finalize()}async processLine(t,r){let i=this.boundaries;if(i.length&&t.length>2&&t[0]===45&&t[1]===45)for(let n=i.length-1;n>=0;n--){let o=i[n];if(t.length<o.value.length+2)continue;let s=!0;for(let c=0;c<o.value.length;c++)if(t[c+2]!==o.value[c]){s=!1;break}if(!s)continue;let a=o.value.length+2,u=!1;t.length>=o.value.length+4&&t[o.value.length+2]===45&&t[o.value.length+3]===45&&(u=!0,a=o.value.length+4);let l=!0;for(let c=a;c<t.length;c++)if(t[c]!==32&&t[c]!==9){l=!1;break}if(l)return u?(await o.node.finalize(),this.currentNode=o.node.parentNode||this.root):(await o.node.finalizeChildNodes(),this.currentNode=new ur({postalMime:this,parentNode:o.node,parentMultipartType:o.node.contentType.multipart,...this.mimeOptions})),r?this.finalize():void 0}if(this.currentNode.feed(t),r)return this.finalize()}readLine(){let t=this.readPos,r=this.readPos;for(;this.readPos<this.av.length;){let i=this.av[this.readPos++];if(i!==13&&i!==10&&(r=this.readPos),i===10)return{bytes:new Uint8Array(this.buf,t,r-t),done:this.readPos>=this.av.length}}return{bytes:new Uint8Array(this.buf,t,r-t),done:this.readPos>=this.av.length}}async processNodeTree(){let t={},r=new Set,i=this.textMap=new Map,n=this.forceRfc822Attachments(),o=async(s,a,u)=>{if(a=a||!1,u=u||!1,s.contentType.multipart)s.contentType.multipart==="alternative"?a=s:s.contentType.multipart==="related"&&(u=s);else if(this.isInlineMessageRfc822(s)&&!n){let l=new e;s.subMessage=await l.parse(s.content),i.has(s)||i.set(s,{});let c=i.get(s);(s.subMessage.text||!s.subMessage.html)&&(c.plain=c.plain||[],c.plain.push({type:"subMessage",value:s.subMessage}),r.add("plain")),s.subMessage.html&&(c.html=c.html||[],c.html.push({type:"subMessage",value:s.subMessage}),r.add("html")),l.textMap&&l.textMap.forEach((d,m)=>{i.set(m,d)});for(let d of s.subMessage.attachments||[])this.attachments.push(d)}else if(this.isInlineTextNode(s)){let l=s.contentType.parsed.value.substr(s.contentType.parsed.value.indexOf("/")+1),c=a||s;i.has(c)||i.set(c,{});let d=i.get(c);d[l]=d[l]||[],d[l].push({type:"text",value:s.getTextContent()}),r.add(l)}else if(s.content){let l=s.contentDisposition?.parsed?.params?.filename||s.contentType.parsed.params.name||null,c={filename:l?zt(l):null,mimeType:s.contentType.parsed.value,disposition:s.contentDisposition?.parsed?.value||null};switch(u&&s.contentId&&(c.related=!0),s.contentDescription&&(c.description=s.contentDescription),s.contentId&&(c.contentId=s.contentId),s.contentType.parsed.value){case"text/calendar":case"application/ics":{s.contentType.parsed.params.method&&(c.method=s.contentType.parsed.params.method.toString().toUpperCase().trim());let d=s.getTextContent().replace(/\r?\n/g,`
192
182
  `).replace(/\n*$/,`
193
- `);d.content=yt.encode(c);break}default:d.content=s.content}this.attachments.push(d)}for(let l of s.childNodes)await o(l,a,u)};await o(this.root,!1,!1),i.forEach(s=>{r.forEach(a=>{if(t[a]||(t[a]=[]),s[a])s[a].forEach(u=>{switch(u.type){case"text":t[a].push(u.value);break;case"subMessage":switch(a){case"html":t[a].push(Zu(u.value));break;case"plain":t[a].push(Qu(u.value));break}break}});else{let u;switch(a){case"html":u="plain";break;case"plain":u="html";break}(s[u]||[]).forEach(l=>{switch(l.type){case"text":switch(a){case"html":t[a].push(em(l.value));break;case"plain":t[a].push(tm(l.value));break}break;case"subMessage":switch(a){case"html":t[a].push(Zu(l.value));break;case"plain":t[a].push(Qu(l.value));break}break}})}})}),Object.keys(t).forEach(s=>{t[s]=t[s].join(`
194
- `)}),this.textContent=t}isInlineTextNode(t){if(t.contentDisposition?.parsed?.value==="attachment")return!1;switch(t.contentType.parsed?.value){case"text/html":case"text/plain":return!0;default:return!1}}isInlineMessageRfc822(t){return t.contentType.parsed?.value!=="message/rfc822"?!1:(t.contentDisposition?.parsed?.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let t=!1,r=i=>{i.contentType.multipart||i.contentType.parsed&&["message/delivery-status","message/feedback-report"].includes(i.contentType.parsed.value)&&(t=!0);for(let n of i.childNodes)r(n)};return r(this.root),t}async resolveStream(t){let r=0,i=[],n=t.getReader();for(;;){let{done:a,value:u}=await n.read();if(a)break;i.push(u),r+=u.length}let o=new Uint8Array(r),s=0;for(let a of i)o.set(a,s),s+=a.length;return o}async parse(t){if(this.started)throw new Error("Can not reuse parser, create a new PostalMime object");for(this.started=!0,t&&typeof t.getReader=="function"&&(t=await this.resolveStream(t)),t=t||new ArrayBuffer(0),typeof t=="string"&&(t=yt.encode(t)),(t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]")&&(t=await Ct(t)),t.buffer instanceof ArrayBuffer&&(t=new Uint8Array(t).buffer),this.buf=t,this.av=new Uint8Array(t),this.readPos=0;this.readPos<this.av.length;){let n=this.readLine();await this.processLine(n.bytes,n.done)}await this.processNodeTree();let r={headers:this.root.headers.map(n=>({key:n.key,originalKey:n.originalKey,value:n.value})).reverse()};for(let n of["from","sender"]){let o=this.root.headers.find(s=>s.key===n);if(o&&o.value){let s=$i(o.value);s&&s.length&&(r[n]=s[0])}}for(let n of["delivered-to","return-path"]){let o=this.root.headers.find(s=>s.key===n);if(o&&o.value){let s=$i(o.value);if(s&&s.length&&s[0].address){let a=tl(n);r[a]=s[0].address}}}for(let n of["to","cc","bcc","reply-to"]){let o=this.root.headers.filter(a=>a.key===n),s=[];if(o.filter(a=>a&&a.value).map(a=>$i(a.value)).forEach(a=>s=s.concat(a||[])),s&&s.length){let a=tl(n);r[a]=s}}for(let n of["subject","message-id","in-reply-to","references"]){let o=this.root.headers.find(s=>s.key===n);if(o&&o.value){let s=tl(n);r[s]=Mt(o.value)}}let i=this.root.headers.find(n=>n.key==="date");if(i){let n=new Date(i.value);n.toString()==="Invalid Date"?n=i.value:n=n.toISOString(),r.date=n}switch(this.textContent?.html&&(r.html=this.textContent.html),this.textContent?.plain&&(r.text=this.textContent.plain),r.attachments=this.attachments,r.headerLines=(this.root.rawHeaderLines||[]).slice().reverse(),this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let o of r.attachments||[])o?.content&&(o.content=nm(o.content),o.encoding="base64");break;case"utf8":let n=new TextDecoder("utf8");for(let o of r.attachments||[])o?.content&&(o.content=n.decode(o.content),o.encoding="utf8");break;default:throw new Error("Unknown attachment encoding")}return r}};var $0=le(A0(),1),lx="6.11.0-canary.1";function Ce(e){let t=new URLSearchParams;return e.limit!==void 0&&t.set("limit",e.limit.toString()),"after"in e&&e.after!==void 0&&t.set("after",e.after),"before"in e&&e.before!==void 0&&t.set("before",e.before),t.toString()}var cx=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/api-keys",e,t)}async list(e={}){let t=Ce(e),r=t?`/api-keys?${t}`:"/api-keys";return await this.resend.get(r)}async remove(e){return await this.resend.delete(`/api-keys/${e}`)}},dx=class{constructor(e){this.resend=e}async get(e){return await this.resend.get(`/automations/${e.automationId}/runs/${e.runId}`)}async list(e){let t=Ce(e),r=new URLSearchParams(t);if(e.status){let o=Array.isArray(e.status)?e.status.join(","):e.status;r.set("status",o)}let i=r.toString(),n=i?`/automations/${e.automationId}/runs?${i}`:`/automations/${e.automationId}/runs`;return await this.resend.get(n)}};function q0(e){switch(e.type){case"trigger":return{key:e.key,type:e.type,config:{event_name:e.config.eventName}};case"delay":return{key:e.key,type:e.type,config:e.config};case"send_email":return{key:e.key,type:e.type,config:{template:e.config.template,subject:e.config.subject,from:e.config.from,reply_to:e.config.replyTo}};case"wait_for_event":return{key:e.key,type:e.type,config:{event_name:e.config.eventName,timeout:e.config.timeout,filter_rule:e.config.filterRule}};case"condition":return{key:e.key,type:e.type,config:e.config};case"contact_update":return{key:e.key,type:e.type,config:{first_name:e.config.firstName,last_name:e.config.lastName,unsubscribed:e.config.unsubscribed,properties:e.config.properties}};case"contact_delete":return{key:e.key,type:e.type,config:e.config};case"add_to_segment":return{key:e.key,type:e.type,config:{segment_id:e.config.segmentId}}}}function R0(e){return{from:e.from,to:e.to,type:e.type}}function mx(e){return{name:e.name,status:e.status,steps:e.steps.map(q0),connections:e.connections.map(R0)}}function px(e){return{event:e.event,contact_id:e.contactId,email:e.email,payload:e.payload}}var fx=class{constructor(e){this.resend=e,this.runs=new dx(this.resend)}async create(e){return await this.resend.post("/automations",mx(e))}async list(e={}){let t=[Ce(e)];e.status&&t.push(`status=${encodeURIComponent(e.status)}`);let r=t.filter(Boolean).join("&"),i=r?`/automations?${r}`:"/automations";return await this.resend.get(i)}async get(e){return await this.resend.get(`/automations/${e}`)}async remove(e){return await this.resend.delete(`/automations/${e}`)}async update(e,t){let r={};return t.name!==void 0&&(r.name=t.name),t.status!==void 0&&(r.status=t.status),t.steps!==void 0&&(r.steps=t.steps.map(q0)),t.connections!==void 0&&(r.connections=t.connections.map(R0)),await this.resend.patch(`/automations/${e}`,r)}async stop(e){return await this.resend.post(`/automations/${e}/stop`)}};function hx(e){return e?.map(t=>({content:t.content,filename:t.filename,path:t.path,content_type:t.contentType,content_id:t.contentId}))}function z0(e){return{attachments:hx(e.attachments),bcc:e.bcc,cc:e.cc,from:e.from,headers:e.headers,html:e.html,reply_to:e.replyTo,scheduled_at:e.scheduledAt,subject:e.subject,tags:e.tags,text:e.text,to:e.to,template:e.template?{id:e.template.id,variables:e.template.variables}:void 0,topic_id:e.topicId}}async function Ja(e){let t;try{({render:t}=await import("@react-email/render"))}catch{throw new Error("Failed to render React component. Make sure to install `@react-email/render` or `@react-email/components`.")}return t(e)}var gx=class{constructor(e){this.resend=e}async send(e,t){return this.create(e,t)}async create(e,t){let r=[];for(let i of e)i.react&&(i.html=await Ja(i.react),i.react=void 0),r.push(z0(i));return await this.resend.post("/emails/batch",r,{...t,headers:{"x-batch-validation":t?.batchValidation??"strict",...t?.headers}})}},bx=class{constructor(e){this.resend=e}async create(e,t={}){return e.react&&(e.html=await Ja(e.react)),await this.resend.post("/broadcasts",{name:e.name,segment_id:e.segmentId,audience_id:e.audienceId,preview_text:e.previewText,from:e.from,html:e.html,reply_to:e.replyTo,subject:e.subject,text:e.text,topic_id:e.topicId,send:e.send,scheduled_at:e.scheduledAt},t)}async send(e,t){return await this.resend.post(`/broadcasts/${e}/send`,{scheduled_at:t?.scheduledAt})}async list(e={}){let t=Ce(e),r=t?`/broadcasts?${t}`:"/broadcasts";return await this.resend.get(r)}async get(e){return await this.resend.get(`/broadcasts/${e}`)}async remove(e){return await this.resend.delete(`/broadcasts/${e}`)}async update(e,t){return t.react&&(t.html=await Ja(t.react)),await this.resend.patch(`/broadcasts/${e}`,{name:t.name,segment_id:t.segmentId,audience_id:t.audienceId,from:t.from,html:t.html,text:t.text,subject:t.subject,reply_to:t.replyTo,preview_text:t.previewText,topic_id:t.topicId})}};function E0(e){return{id:e.id,key:e.key,createdAt:e.created_at,type:e.type,fallbackValue:e.fallback_value}}function P0(e){return"key"in e?{key:e.key,type:e.type,fallback_value:e.fallbackValue}:{fallback_value:e.fallbackValue}}var vx=class{constructor(e){this.resend=e}async create(e){let t=P0(e);return await this.resend.post("/contact-properties",t)}async list(e={}){let t=Ce(e),r=t?`/contact-properties?${t}`:"/contact-properties",i=await this.resend.get(r);return i.data?{data:{...i.data,data:i.data.data.map(n=>E0(n))},headers:i.headers,error:null}:i}async get(e){if(!e)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let t=await this.resend.get(`/contact-properties/${e}`);return t.data?{data:{object:"contact_property",...E0(t.data)},headers:t.headers,error:null}:t}async update(e){if(!e.id)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let t=P0(e);return await this.resend.patch(`/contact-properties/${e.id}`,t)}async remove(e){return e?await this.resend.delete(`/contact-properties/${e}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}},_x=class{constructor(e){this.resend=e}async list(e){if(!e.contactId&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.contactId,r=Ce(e),i=r?`/contacts/${t}/segments?${r}`:`/contacts/${t}/segments`;return await this.resend.get(i)}async add(e){if(!e.contactId&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.contactId;return this.resend.post(`/contacts/${t}/segments/${e.segmentId}`)}async remove(e){if(!e.contactId&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.contactId;return this.resend.delete(`/contacts/${t}/segments/${e.segmentId}`)}},yx=class{constructor(e){this.resend=e}async update(e){if(!e.id&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.id;return this.resend.patch(`/contacts/${t}/topics`,e.topics)}async list(e){if(!e.id&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.id,r=Ce(e),i=r?`/contacts/${t}/topics?${r}`:`/contacts/${t}/topics`;return this.resend.get(i)}},Cx=class{constructor(e){this.resend=e,this.topics=new yx(this.resend),this.segments=new _x(this.resend)}async create(e,t={}){return"audienceId"in e?"segments"in e||"topics"in e?{data:null,headers:null,error:{message:"`audienceId` is deprecated, and cannot be used together with `segments` or `topics`. Use `segments` instead to add one or more segments to the new contact.",statusCode:null,name:"invalid_parameter"}}:await this.resend.post(`/audiences/${e.audienceId}/contacts`,{unsubscribed:e.unsubscribed,email:e.email,first_name:e.firstName,last_name:e.lastName,properties:e.properties},t):await this.resend.post("/contacts",{unsubscribed:e.unsubscribed,email:e.email,first_name:e.firstName,last_name:e.lastName,properties:e.properties,segments:e.segments,topics:e.topics},t)}async list(e={}){let t=e.segmentId??e.audienceId;if(!t){let n=Ce(e),o=n?`/contacts?${n}`:"/contacts";return await this.resend.get(o)}let r=Ce(e),i=r?`/segments/${t}/contacts?${r}`:`/segments/${t}/contacts`;return await this.resend.get(i)}async get(e){return typeof e=="string"?this.resend.get(`/contacts/${e}`):!e.id&&!e.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:e.audienceId?this.resend.get(`/audiences/${e.audienceId}/contacts/${e?.email?e?.email:e?.id}`):this.resend.get(`/contacts/${e?.email?e?.email:e?.id}`)}async update(e){return!e.id&&!e.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:e.audienceId?await this.resend.patch(`/audiences/${e.audienceId}/contacts/${e?.email?e?.email:e?.id}`,{unsubscribed:e.unsubscribed,first_name:e.firstName,last_name:e.lastName,properties:e.properties}):await this.resend.patch(`/contacts/${e?.email?e?.email:e?.id}`,{unsubscribed:e.unsubscribed,first_name:e.firstName,last_name:e.lastName,properties:e.properties})}async remove(e){return typeof e=="string"?this.resend.delete(`/contacts/${e}`):!e.id&&!e.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:e.audienceId?this.resend.delete(`/audiences/${e.audienceId}/contacts/${e?.email?e?.email:e?.id}`):this.resend.delete(`/contacts/${e?.email?e?.email:e?.id}`)}};function Ox(e){return{name:e.name,region:e.region,custom_return_path:e.customReturnPath,capabilities:e.capabilities,open_tracking:e.openTracking,click_tracking:e.clickTracking,tls:e.tls}}var Sx=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/domains",Ox(e),t)}async list(e={}){let t=Ce(e),r=t?`/domains?${t}`:"/domains";return await this.resend.get(r)}async get(e){return await this.resend.get(`/domains/${e}`)}async update(e){return await this.resend.patch(`/domains/${e.id}`,{click_tracking:e.clickTracking,open_tracking:e.openTracking,tls:e.tls,capabilities:e.capabilities})}async remove(e){return await this.resend.delete(`/domains/${e}`)}async verify(e){return await this.resend.post(`/domains/${e}/verify`)}},xx=class{constructor(e){this.resend=e}async get(e){let{emailId:t,id:r}=e;return await this.resend.get(`/emails/${t}/attachments/${r}`)}async list(e){let{emailId:t}=e,r=Ce(e),i=r?`/emails/${t}/attachments?${r}`:`/emails/${t}/attachments`;return await this.resend.get(i)}},wx=class{constructor(e){this.resend=e}async get(e){let{emailId:t,id:r}=e;return await this.resend.get(`/emails/receiving/${t}/attachments/${r}`)}async list(e){let{emailId:t}=e,r=Ce(e),i=r?`/emails/receiving/${t}/attachments?${r}`:`/emails/receiving/${t}/attachments`;return await this.resend.get(i)}},kx=class{constructor(e){this.resend=e,this.attachments=new wx(e)}async get(e){return await this.resend.get(`/emails/receiving/${e}`)}async list(e={}){let t=Ce(e),r=t?`/emails/receiving?${t}`:"/emails/receiving";return await this.resend.get(r)}async forward(e){let{emailId:t,to:r,from:i}=e,n=e.passthrough!==!1,o=await this.get(t);if(o.error)return{data:null,error:o.error,headers:o.headers};let s=o.data,a=s.subject||"(no subject)";if(n)return this.forwardPassthrough(s,{to:r,from:i,subject:a});let u=a.startsWith("Fwd:")?a:`Fwd: ${a}`;return this.forwardWrapped(s,{to:r,from:i,subject:u,text:"text"in e?e.text:void 0,html:"html"in e?e.html:void 0})}async forwardPassthrough(e,t){let{to:r,from:i,subject:n}=t;if(!e.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let o=await fetch(e.raw.download_url);if(!o.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:o.status},headers:null};let s=await o.text(),a=await Ur.parse(s,{attachmentEncoding:"base64"}),u=a.attachments.map(l=>{let d=l.contentId?l.contentId.replace(/^<|>$/g,""):void 0;return{filename:l.filename,content:l.content.toString(),content_type:l.mimeType,content_id:d||void 0}});return await this.resend.post("/emails",{from:i,to:r,subject:n,text:a.text||void 0,html:a.html||void 0,attachments:u.length>0?u:void 0})}async forwardWrapped(e,t){let{to:r,from:i,subject:n,text:o,html:s}=t;if(!e.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let a=await fetch(e.raw.download_url);if(!a.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:a.status},headers:null};let u=await a.text();return await this.resend.post("/emails",{from:i,to:r,subject:n,text:o,html:s,attachments:[{filename:"forwarded_message.eml",content:Buffer.from(u).toString("base64"),content_type:"message/rfc822"}]})}},Ax=class{constructor(e){this.resend=e,this.attachments=new xx(e),this.receiving=new kx(e)}async send(e,t={}){return this.create(e,t)}async create(e,t={}){return e.react&&(e.html=await Ja(e.react)),await this.resend.post("/emails",z0(e),t)}async get(e){return await this.resend.get(`/emails/${e}`)}async list(e={}){let t=Ce(e),r=t?`/emails?${t}`:"/emails";return await this.resend.get(r)}async update(e){return await this.resend.patch(`/emails/${e.id}`,{scheduled_at:e.scheduledAt})}async cancel(e){return await this.resend.post(`/emails/${e}/cancel`)}},Ex=class{constructor(e){this.resend=e}async send(e){return await this.resend.post("/events/send",px(e))}async create(e){return await this.resend.post("/events",e)}async get(e){return await this.resend.get(`/events/${encodeURIComponent(e)}`)}async list(e={}){let t=Ce(e),r=t?`/events?${t}`:"/events";return await this.resend.get(r)}async update(e,t){return await this.resend.patch(`/events/${encodeURIComponent(e)}`,t)}async remove(e){return await this.resend.delete(`/events/${encodeURIComponent(e)}`)}},Px=class{constructor(e){this.resend=e}async list(e={}){let t=Ce(e),r=t?`/logs?${t}`:"/logs";return await this.resend.get(r)}async get(e){return await this.resend.get(`/logs/${e}`)}},Tx=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/segments",e,t)}async list(e={}){let t=Ce(e),r=t?`/segments?${t}`:"/segments";return await this.resend.get(r)}async get(e){return await this.resend.get(`/segments/${e}`)}async remove(e){return await this.resend.delete(`/segments/${e}`)}};function jx(e={}){let t=new URLSearchParams;return e.before&&t.set("before",e.before),e.after&&t.set("after",e.after),e.limit&&t.set("limit",e.limit.toString()),t.size>0?`?${t.toString()}`:""}function Ix(e){return e?.map(t=>({key:t.key,type:t.type,fallback_value:t.fallbackValue}))}function T0(e){return{name:"name"in e?e.name:void 0,subject:e.subject,html:e.html,text:e.text,alias:e.alias,from:e.from,reply_to:e.replyTo,variables:Ix(e.variables)}}var j0=class{constructor(e,t){this.promise=e,this.publishFn=t}then(e,t){return this.promise.then(e,t)}async publish(){let{data:e,error:t}=await this.promise;return t?{data:null,headers:null,error:t}:this.publishFn(e.id)}},Dx=class{constructor(e){this.resend=e}create(e){return new j0(this.performCreate(e),this.publish.bind(this))}async performCreate(e){if(e.react){if(!this.renderAsync)try{let{renderAsync:t}=await import("@react-email/render");this.renderAsync=t}catch{throw new Error("Failed to render React component. Make sure to install `@react-email/render`")}e.html=await this.renderAsync(e.react)}return this.resend.post("/templates",T0(e))}async remove(e){return await this.resend.delete(`/templates/${e}`)}async get(e){return await this.resend.get(`/templates/${e}`)}async list(e={}){return this.resend.get(`/templates${jx(e)}`)}duplicate(e){return new j0(this.resend.post(`/templates/${e}/duplicate`),this.publish.bind(this))}async publish(e){return await this.resend.post(`/templates/${e}/publish`)}async update(e,t){return await this.resend.patch(`/templates/${e}`,T0(t))}},$x=class{constructor(e){this.resend=e}async create(e){let{defaultSubscription:t,...r}=e;return await this.resend.post("/topics",{...r,default_subscription:t})}async list(){return await this.resend.get("/topics")}async get(e){return e?await this.resend.get(`/topics/${e}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}async update(e){return e.id?await this.resend.patch(`/topics/${e.id}`,e):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}async remove(e){return e?await this.resend.delete(`/topics/${e}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}},qx=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/webhooks",e,t)}async get(e){return await this.resend.get(`/webhooks/${e}`)}async list(e={}){let t=Ce(e),r=t?`/webhooks?${t}`:"/webhooks";return await this.resend.get(r)}async update(e,t){return await this.resend.patch(`/webhooks/${e}`,t)}async remove(e){return await this.resend.delete(`/webhooks/${e}`)}verify(e){return new $0.Webhook(e.webhookSecret).verify(e.payload,{"svix-id":e.headers.id,"svix-timestamp":e.headers.timestamp,"svix-signature":e.headers.signature})}},I0="https://api.resend.com",D0=`resend-node:${lx}`,Rx=typeof process<"u"&&process.env&&process.env.RESEND_BASE_URL||I0,zx=typeof process<"u"&&process.env&&process.env.RESEND_USER_AGENT||D0,vr=class{constructor(e){if(this.key=e,this.segments=new Tx(this),this.apiKeys=new cx(this),this.audiences=this.segments,this.automations=new fx(this),this.batch=new gx(this),this.broadcasts=new bx(this),this.contactProperties=new vx(this),this.contacts=new Cx(this),this.domains=new Sx(this),this.emails=new Ax(this),this.events=new Ex(this),this.logs=new Px(this),this.templates=new Dx(this),this.topics=new $x(this),this.webhooks=new qx(this),!e&&(typeof process<"u"&&process.env&&(this.key=process.env.RESEND_API_KEY),!this.key))throw new Error('Missing API key. Pass it to the constructor `new Resend("re_123")`');this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":zx,"Content-Type":"application/json"})}async fetchRequest(e,t={}){try{let r=await fetch(`${Rx}${e}`,t);if(!r.ok)try{let i=await r.text();return{data:null,error:JSON.parse(i),headers:Object.fromEntries(r.headers.entries())}}catch(i){if(i instanceof SyntaxError)return{data:null,error:{name:"application_error",statusCode:r.status,message:"Internal server error. We are unable to process your request right now, please try again later."},headers:Object.fromEntries(r.headers.entries())};let n={message:r.statusText,statusCode:r.status,name:"application_error"};return i instanceof Error?{data:null,error:{...n,message:i.message},headers:Object.fromEntries(r.headers.entries())}:{data:null,error:n,headers:Object.fromEntries(r.headers.entries())}}return{data:await r.json(),error:null,headers:Object.fromEntries(r.headers.entries())}}catch{return{data:null,error:{name:"application_error",statusCode:null,message:"Unable to fetch data. The request could not be resolved."},headers:null}}}async post(e,t,r={}){let i=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())i.set(o,s);r.idempotencyKey&&i.set("Idempotency-Key",r.idempotencyKey);let n={method:"POST",body:JSON.stringify(t),...r,headers:i};return this.fetchRequest(e,n)}async get(e,t={}){let r=new Headers(this.headers);if(t.headers)for(let[n,o]of new Headers(t.headers).entries())r.set(n,o);let i={method:"GET",...t,headers:r};return this.fetchRequest(e,i)}async put(e,t,r={}){let i=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())i.set(o,s);let n={method:"PUT",body:JSON.stringify(t),...r,headers:i};return this.fetchRequest(e,n)}async patch(e,t,r={}){let i=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())i.set(o,s);let n={method:"PATCH",body:JSON.stringify(t),...r,headers:i};return this.fetchRequest(e,n)}async delete(e,t){let r={method:"DELETE",body:JSON.stringify(t),headers:this.headers};return this.fetchRequest(e,r)}};je();var K0=le(vt(),1);function Q(e,t){return e instanceof Error?e.message:t}function Y0(e){return!!(e||!process.stdout.isTTY)}function z(e,t={}){Y0(t.json)?console.log(JSON.stringify(e,null,2)):console.log(typeof e=="string"?e:JSON.stringify(e,null,2)),t.exitCode!==void 0&&process.exit(t.exitCode)}function v(e,t={}){let r=t.exitCode??1;Y0(t.json)?console.error(JSON.stringify({error:{message:e.message,code:e.code??"unknown"}},null,2)):console.error(`${K0.default.red("Error:")} ${e.message}`),process.exit(r)}var Q0={sending_access:0,full_access:1};function Fx(e,t){return Q0[e]>=Q0[t]}async function oe(e,t){let r=e.profile??e.team;try{let i=await rr(e.apiKey,r);if(!i){if(r){let n=De();if(!n.some(s=>s.name===r))throw new Error(`Profile "${r}" not found. Available profiles: ${n.map(s=>s.name).join(", ")||"(none)"}`)}throw new Error("No API key found. Set RESEND_API_KEY, use --api-key, or run: resend login")}if(i.permission){let n=t?.permission??"full_access";Fx(i.permission,n)||v({message:`This command requires a full access API key. Your current key has sending access only.
195
- ${_r}`,code:"insufficient_permissions"},{json:e.json})}return new vr(i.key)}catch(i){v({message:Q(i,"Failed to create client"),code:"auth_error"},{json:e.json})}}var Z0=130;function Bx(){process.stderr.isTTY&&process.stderr.write("\r\x1B[2K"),console.error("Cancelled."),process.exit(Z0)}var Or;function X0(){Or=Bx,process.on("SIGINT",Or),process.on("uncaughtException",e=>{v({message:Q(e,"An unexpected error occurred"),code:"unexpected_error"},{}),process.exit(1)})}function Wa(e){Or&&process.removeListener("SIGINT",Or),Or=e,process.on("SIGINT",Or)}function Sr(){return Z0}je();var Va=le(vt(),1);ee();var Nx=gt?String.fromCodePoint(10004):"v",Lx=gt?String.fromCodePoint(9888):"!",Gx=gt?String.fromCodePoint(10007):"x",Ux=["\u2839","\u2838","\u2834","\u2826","\u2807","\u280F","\u2819","\u2839"],Wx=80,ev=[1,2,4],Vx=ev.length;function Kx(e){let t=e?.["retry-after"];if(!t)return;let r=Number(t);if(Number.isFinite(r)&&r>=0)return r}function Yx(e){return new Promise(t=>setTimeout(t,e))}async function He(e,t,r,i){let n=he(e,i.quiet);try{for(let o=0;;o++){let{data:s,error:a,headers:u}=await t();if(a){if(o<Vx&&a.name==="rate_limit_exceeded"){let l=Kx(u)??ev[o];n.update(`Rate limited, retrying in ${l}s...`),await Yx(l*1e3),n.update(e);continue}n.stop(),v({message:a.message,code:r},{json:i.json})}return s===null&&(n.stop(),v({message:"Unexpected empty response",code:r},{json:i.json})),n.stop(),s}}catch(o){return n.stop(),v({message:Q(o,"Unknown error"),code:r},{json:i.json})}}function he(e,t){if(t||!k())return{update(a){},stop(a){},clear(){},warn(a){},fail(a){}};let r=gt?Ux:["-","\\","|","/"],i=Wx,n=0,o=e,s=setInterval(()=>{process.stderr.write(`\r\x1B[2K ${r[n++%r.length]} ${o}`)},i);return{update(a){o=a},stop(a){clearInterval(s),a?process.stderr.write(`\r\x1B[2K ${Va.default.green(Nx)} ${a}
196
- `):process.stderr.write("\r\x1B[2K")},clear(){clearInterval(s),process.stderr.write("\r\x1B[2K")},warn(a){clearInterval(s),process.stderr.write(`\r\x1B[2K ${Va.default.yellow(Lx)} ${a}
197
- `)},fail(a){clearInterval(s),process.stderr.write(`\r\x1B[2K ${Va.default.red(Gx)} ${a}
198
- `)}}}ee();function D(e){Ld(e),process.exit(Sr())}async function iv(e,t,r){(!k()||r.json)&&v({message:"Use --yes to confirm deletion in non-interactive mode.",code:"confirmation_required"},{json:r.json});let i=await _t({message:t});(j(i)||!i)&&D("Deletion cancelled.")}async function Ka(e,t){let r=fe(e);if(!r)return e;if(!k()||t.json)return v({message:`Profile "${e}" has an invalid name: ${r}`,code:"invalid_profile_name"},{json:t.json}),null;ie.warn(`Profile "${e}" has an invalid name: ${r}`);let i=await te({message:"Enter a new name for this profile:",placeholder:e.replace(/[^a-zA-Z0-9._-]/g,"-"),validate:n=>fe(n)});j(i)&&D("Rename cancelled.");try{await Ua(e,i)}catch(n){return v({message:Q(n,"Failed to rename profile"),code:"rename_failed"},{json:t.json}),null}return ie.success(`Profile renamed to '${i}'.`),i}async function U(e,t,r,i){if(e)return e;(!k()||i.json)&&v(r,{json:i.json});let n=await te({message:t.message,placeholder:t.placeholder,defaultValue:t.defaultValue,validate:t.validate??(o=>!t.defaultValue&&(!o||o.length===0)?`${t.message} is required`:void 0)});return j(n)&&D("Cancelled."),n}async function xr(e,t,r,i){if(e)return e;(!k()||i.json)&&v(r,{json:i.json});let n=await pe({message:t.message,options:t.options});return j(n)&&D("Cancelled."),n}async function nv(e,t,r){let i=t.filter(s=>s.required!==!1&&e[s.flag]==="");if(i.length>0){let s=i.map(a=>`--${a.flag}`).join(", ");v({message:`Empty value for required flags: ${s}`,code:"invalid_options"},{json:r.json})}let n=t.filter(s=>s.required!==!1&&!e[s.flag]);if(n.length===0)return e;if(!k()||r.json){let s=n.map(a=>`--${a.flag}`).join(", ");v({message:`Missing required flags: ${s}`,code:"missing_flags"},{json:r.json})}let o=await Nd(Object.fromEntries(n.map(s=>[s.flag,()=>te({message:s.message,placeholder:s.placeholder,defaultValue:s.defaultValue,validate:s.validate??(a=>!s.defaultValue&&(!a||a.length===0)?`${s.message} is required`:void 0)})])),{onCancel:()=>D("Operation cancelled.")});return{...e,...o}}var Qx=20,tv="__fetch_more__",rv="__none__";async function C(e,t,r,i){if(e)return e;let n=i?.optional??!1;if(!k()||r.json){if(n)return;v({message:"Missing required argument: id",code:"missing_id"},{json:r.json})}let o=await oe(r),s=[];for(;;){let a=s.at(-1)?.id,u=he(s.length===0?`Fetching ${t.resourcePlural}...`:`Fetching more ${t.resourcePlural}...`,r.quiet),l=await t.fetchItems(o,{limit:Qx,...a&&{after:a}});if(l.error||!l.data){if(n){u.clear();return}u.fail(`Failed to fetch ${t.resourcePlural}`),v({message:l.error?.message??"Unexpected empty response",code:"list_error"},{json:r.json})}s.push(...l.data.data);let d=l.data.has_more??!1,c=t.filter?s.filter(t.filter):s;if(c.length===0&&!d&&n){u.clear();return}if(u.stop(s.length===c.length?`${t.resourcePlural} fetched`:`More ${t.resourcePlural} fetched`),c.length===0&&!d&&(ie.warn(`No ${t.resourcePlural} found.`),v({message:`No ${t.resourcePlural} found.`,code:"no_items"},{json:r.json})),c.length===0&&d&&!n)continue;let m=c.map(g=>({value:g.id,...t.display(g)}));n&&m.unshift({value:rv,label:"None"}),d&&m.push({value:tv,label:"Fetch more..."});let _=await pe({message:`Select a ${t.resource}`,options:m});if(j(_)&&D("Cancelled."),_===rv)return;if(_!==tv)return _}}ee();async function N(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await oe(t,r),n=await He(e.loading,()=>e.sdkCall(i),"fetch_error",t);!t.json&&k()?e.onInteractive(n):z(n,{json:t.json})}async function ue(e,t,r,i){let n=r.permission?{permission:r.permission}:void 0,o=await oe(i,n);t||await iv(e,r.confirmMessage,i),await He(r.loading,()=>r.sdkCall(o),"delete_error",i),!i.json&&k()?console.log(r.successMsg):z({object:r.object,id:e,deleted:!0},{json:i.json})}async function re(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await oe(t,r),n=await He(e.loading,()=>e.sdkCall(i),"create_error",t);!t.json&&k()?e.onInteractive(n):z(n,{json:t.json})}async function F(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await oe(t,r),n=await He(e.loading,()=>e.sdkCall(i),e.errorCode,t);!t.json&&k()?console.log(e.successMsg):z(n,{json:t.json})}async function q(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await oe(t,r),n=await He(e.loading,()=>e.sdkCall(i),"list_error",t);!t.json&&k()?e.onInteractive(n):z(n,{json:t.json})}ee();ee();var Oe=gt?{h:String.fromCodePoint(9472),v:String.fromCodePoint(9474),tl:String.fromCodePoint(9484),tr:String.fromCodePoint(9488),bl:String.fromCodePoint(9492),br:String.fromCodePoint(9496),lm:String.fromCodePoint(9500),rm:String.fromCodePoint(9508),tm:String.fromCodePoint(9516),bm:String.fromCodePoint(9524),mm:String.fromCodePoint(9532)}:{h:"-",v:"|",tl:"+",tr:"+",bl:"+",br:"+",lm:"+",rm:"+",tm:"+",bm:"+",mm:"+"};function Zx(){return process.stdout.columns}function Xx(e,t,r){let i=Math.max(...e.map(o=>o.length)),n=Math.max(20,Math.min(r,60));return t.map((o,s)=>{let a=String(s+1),u=`${Oe.h}${Oe.h} ${a} ${Oe.h.repeat(Math.max(0,n-a.length-4))}`,l=e.map((d,c)=>` ${d.padEnd(i)} ${o[c]}`);return[u,...l].join(`
183
+ `);c.content=Ot.encode(d);break}default:c.content=s.content}this.attachments.push(c)}for(let l of s.childNodes)await o(l,a,u)};await o(this.root,!1,!1),i.forEach(s=>{r.forEach(a=>{if(t[a]||(t[a]=[]),s[a])s[a].forEach(u=>{switch(u.type){case"text":t[a].push(u.value);break;case"subMessage":switch(a){case"html":t[a].push(Hu(u.value));break;case"plain":t[a].push(Bu(u.value));break}break}});else{let u;switch(a){case"html":u="plain";break;case"plain":u="html";break}(s[u]||[]).forEach(l=>{switch(l.type){case"text":switch(a){case"html":t[a].push(Hd(l.value));break;case"plain":t[a].push(Nd(l.value));break}break;case"subMessage":switch(a){case"html":t[a].push(Hu(l.value));break;case"plain":t[a].push(Bu(l.value));break}break}})}})}),Object.keys(t).forEach(s=>{t[s]=t[s].join(`
184
+ `)}),this.textContent=t}isInlineTextNode(t){if(t.contentDisposition?.parsed?.value==="attachment")return!1;switch(t.contentType.parsed?.value){case"text/html":case"text/plain":return!0;default:return!1}}isInlineMessageRfc822(t){return t.contentType.parsed?.value!=="message/rfc822"?!1:(t.contentDisposition?.parsed?.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let t=!1,r=i=>{i.contentType.multipart||i.contentType.parsed&&["message/delivery-status","message/feedback-report"].includes(i.contentType.parsed.value)&&(t=!0);for(let n of i.childNodes)r(n)};return r(this.root),t}async resolveStream(t){let r=0,i=[],n=t.getReader();for(;;){let{done:a,value:u}=await n.read();if(a)break;i.push(u),r+=u.length}let o=new Uint8Array(r),s=0;for(let a of i)o.set(a,s),s+=a.length;return o}async parse(t){if(this.started)throw new Error("Can not reuse parser, create a new PostalMime object");for(this.started=!0,t&&typeof t.getReader=="function"&&(t=await this.resolveStream(t)),t=t||new ArrayBuffer(0),typeof t=="string"&&(t=Ot.encode(t)),(t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]")&&(t=await St(t)),t.buffer instanceof ArrayBuffer&&(t=new Uint8Array(t).buffer),this.buf=t,this.av=new Uint8Array(t),this.readPos=0;this.readPos<this.av.length;){let n=this.readLine();await this.processLine(n.bytes,n.done)}await this.processNodeTree();let r={headers:this.root.headers.map(n=>({key:n.key,originalKey:n.originalKey,value:n.value})).reverse()};for(let n of["from","sender"]){let o=this.root.headers.find(s=>s.key===n);if(o&&o.value){let s=Ti(o.value);s&&s.length&&(r[n]=s[0])}}for(let n of["delivered-to","return-path"]){let o=this.root.headers.find(s=>s.key===n);if(o&&o.value){let s=Ti(o.value);if(s&&s.length&&s[0].address){let a=Gu(n);r[a]=s[0].address}}}for(let n of["to","cc","bcc","reply-to"]){let o=this.root.headers.filter(a=>a.key===n),s=[];if(o.filter(a=>a&&a.value).map(a=>Ti(a.value)).forEach(a=>s=s.concat(a||[])),s&&s.length){let a=Gu(n);r[a]=s}}for(let n of["subject","message-id","in-reply-to","references"]){let o=this.root.headers.find(s=>s.key===n);if(o&&o.value){let s=Gu(n);r[s]=zt(o.value)}}let i=this.root.headers.find(n=>n.key==="date");if(i){let n=new Date(i.value);n.toString()==="Invalid Date"?n=i.value:n=n.toISOString(),r.date=n}switch(this.textContent?.html&&(r.html=this.textContent.html),this.textContent?.plain&&(r.text=this.textContent.plain),r.attachments=this.attachments,r.headerLines=(this.root.rawHeaderLines||[]).slice().reverse(),this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let o of r.attachments||[])o?.content&&(o.content=Ud(o.content),o.encoding="base64");break;case"utf8":let n=new TextDecoder("utf8");for(let o of r.attachments||[])o?.content&&(o.content=n.decode(o.content),o.encoding="utf8");break;default:throw new Error("Unknown attachment encoding")}return r}};var O0=le(h0(),1),R1="6.11.0";function ye(e){let t=new URLSearchParams;return e.limit!==void 0&&t.set("limit",e.limit.toString()),"after"in e&&e.after!==void 0&&t.set("after",e.after),"before"in e&&e.before!==void 0&&t.set("before",e.before),t.toString()}var F1=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/api-keys",e,t)}async list(e={}){let t=ye(e),r=t?`/api-keys?${t}`:"/api-keys";return await this.resend.get(r)}async remove(e){return await this.resend.delete(`/api-keys/${e}`)}},z1=class{constructor(e){this.resend=e}async get(e){return await this.resend.get(`/automations/${e.automationId}/runs/${e.runId}`)}async list(e){let t=ye(e),r=new URLSearchParams(t);if(e.status){let o=Array.isArray(e.status)?e.status.join(","):e.status;r.set("status",o)}let i=r.toString(),n=i?`/automations/${e.automationId}/runs?${i}`:`/automations/${e.automationId}/runs`;return await this.resend.get(n)}};function S0(e){switch(e.type){case"trigger":return{key:e.key,type:e.type,config:{event_name:e.config.eventName}};case"delay":return{key:e.key,type:e.type,config:e.config};case"send_email":return{key:e.key,type:e.type,config:{template:e.config.template,subject:e.config.subject,from:e.config.from,reply_to:e.config.replyTo}};case"wait_for_event":return{key:e.key,type:e.type,config:{event_name:e.config.eventName,timeout:e.config.timeout,filter_rule:e.config.filterRule}};case"condition":return{key:e.key,type:e.type,config:e.config};case"contact_update":return{key:e.key,type:e.type,config:{first_name:e.config.firstName,last_name:e.config.lastName,unsubscribed:e.config.unsubscribed,properties:e.config.properties}};case"contact_delete":return{key:e.key,type:e.type,config:e.config};case"add_to_segment":return{key:e.key,type:e.type,config:{segment_id:e.config.segmentId}}}}function x0(e){return{from:e.from,to:e.to,type:e.type}}function M1(e){return{name:e.name,status:e.status,steps:e.steps.map(S0),connections:e.connections.map(x0)}}function J1(e){return{event:e.event,contact_id:e.contactId,email:e.email,payload:e.payload}}var B1=class{constructor(e){this.resend=e,this.runs=new z1(this.resend)}async create(e){return await this.resend.post("/automations",M1(e))}async list(e={}){let t=[ye(e)];e.status&&t.push(`status=${encodeURIComponent(e.status)}`);let r=t.filter(Boolean).join("&"),i=r?`/automations?${r}`:"/automations";return await this.resend.get(i)}async get(e){return await this.resend.get(`/automations/${e}`)}async remove(e){return await this.resend.delete(`/automations/${e}`)}async update(e,t){let r={};return t.name!==void 0&&(r.name=t.name),t.status!==void 0&&(r.status=t.status),t.steps!==void 0&&(r.steps=t.steps.map(S0)),t.connections!==void 0&&(r.connections=t.connections.map(x0)),await this.resend.patch(`/automations/${e}`,r)}async stop(e){return await this.resend.post(`/automations/${e}/stop`)}};function H1(e){return e?.map(t=>({content:t.content,filename:t.filename,path:t.path,content_type:t.contentType,content_id:t.contentId}))}function w0(e){return{attachments:H1(e.attachments),bcc:e.bcc,cc:e.cc,from:e.from,headers:e.headers,html:e.html,reply_to:e.replyTo,scheduled_at:e.scheduledAt,subject:e.subject,tags:e.tags,text:e.text,to:e.to,template:e.template?{id:e.template.id,variables:e.template.variables}:void 0,topic_id:e.topicId}}async function qa(e){let t;try{({render:t}=await import("@react-email/render"))}catch{throw new Error("Failed to render React component. Make sure to install `@react-email/render` or `@react-email/components`.")}return t(e)}var N1=class{constructor(e){this.resend=e}async send(e,t){return this.create(e,t)}async create(e,t){let r=[];for(let i of e)i.react&&(i.html=await qa(i.react),i.react=void 0),r.push(w0(i));return await this.resend.post("/emails/batch",r,{...t,headers:{"x-batch-validation":t?.batchValidation??"strict",...t?.headers}})}},L1=class{constructor(e){this.resend=e}async create(e,t={}){return e.react&&(e.html=await qa(e.react)),await this.resend.post("/broadcasts",{name:e.name,segment_id:e.segmentId,audience_id:e.audienceId,preview_text:e.previewText,from:e.from,html:e.html,reply_to:e.replyTo,subject:e.subject,text:e.text,topic_id:e.topicId,send:e.send,scheduled_at:e.scheduledAt},t)}async send(e,t){return await this.resend.post(`/broadcasts/${e}/send`,{scheduled_at:t?.scheduledAt})}async list(e={}){let t=ye(e),r=t?`/broadcasts?${t}`:"/broadcasts";return await this.resend.get(r)}async get(e){return await this.resend.get(`/broadcasts/${e}`)}async remove(e){return await this.resend.delete(`/broadcasts/${e}`)}async update(e,t){return t.react&&(t.html=await qa(t.react)),await this.resend.patch(`/broadcasts/${e}`,{name:t.name,segment_id:t.segmentId,audience_id:t.audienceId,from:t.from,html:t.html,text:t.text,subject:t.subject,reply_to:t.replyTo,preview_text:t.previewText,topic_id:t.topicId})}};function g0(e){return{id:e.id,key:e.key,createdAt:e.created_at,type:e.type,fallbackValue:e.fallback_value}}function b0(e){return"key"in e?{key:e.key,type:e.type,fallback_value:e.fallbackValue}:{fallback_value:e.fallbackValue}}var G1=class{constructor(e){this.resend=e}async create(e){let t=b0(e);return await this.resend.post("/contact-properties",t)}async list(e={}){let t=ye(e),r=t?`/contact-properties?${t}`:"/contact-properties",i=await this.resend.get(r);return i.data?{data:{...i.data,data:i.data.data.map(n=>g0(n))},headers:i.headers,error:null}:i}async get(e){if(!e)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let t=await this.resend.get(`/contact-properties/${e}`);return t.data?{data:{object:"contact_property",...g0(t.data)},headers:t.headers,error:null}:t}async update(e){if(!e.id)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let t=b0(e);return await this.resend.patch(`/contact-properties/${e.id}`,t)}async remove(e){return e?await this.resend.delete(`/contact-properties/${e}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}},U1=class{constructor(e){this.resend=e}async list(e){if(!e.contactId&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.contactId,r=ye(e),i=r?`/contacts/${t}/segments?${r}`:`/contacts/${t}/segments`;return await this.resend.get(i)}async add(e){if(!e.contactId&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.contactId;return this.resend.post(`/contacts/${t}/segments/${e.segmentId}`)}async remove(e){if(!e.contactId&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.contactId;return this.resend.delete(`/contacts/${t}/segments/${e.segmentId}`)}},W1=class{constructor(e){this.resend=e}async update(e){if(!e.id&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.id;return this.resend.patch(`/contacts/${t}/topics`,e.topics)}async list(e){if(!e.id&&!e.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let t=e.email?e.email:e.id,r=ye(e),i=r?`/contacts/${t}/topics?${r}`:`/contacts/${t}/topics`;return this.resend.get(i)}},V1=class{constructor(e){this.resend=e,this.topics=new W1(this.resend),this.segments=new U1(this.resend)}async create(e,t={}){return"audienceId"in e?"segments"in e||"topics"in e?{data:null,headers:null,error:{message:"`audienceId` is deprecated, and cannot be used together with `segments` or `topics`. Use `segments` instead to add one or more segments to the new contact.",statusCode:null,name:"invalid_parameter"}}:await this.resend.post(`/audiences/${e.audienceId}/contacts`,{unsubscribed:e.unsubscribed,email:e.email,first_name:e.firstName,last_name:e.lastName,properties:e.properties},t):await this.resend.post("/contacts",{unsubscribed:e.unsubscribed,email:e.email,first_name:e.firstName,last_name:e.lastName,properties:e.properties,segments:e.segments,topics:e.topics},t)}async list(e={}){let t=e.segmentId??e.audienceId;if(!t){let n=ye(e),o=n?`/contacts?${n}`:"/contacts";return await this.resend.get(o)}let r=ye(e),i=r?`/segments/${t}/contacts?${r}`:`/segments/${t}/contacts`;return await this.resend.get(i)}async get(e){return typeof e=="string"?this.resend.get(`/contacts/${e}`):!e.id&&!e.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:e.audienceId?this.resend.get(`/audiences/${e.audienceId}/contacts/${e?.email?e?.email:e?.id}`):this.resend.get(`/contacts/${e?.email?e?.email:e?.id}`)}async update(e){return!e.id&&!e.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:e.audienceId?await this.resend.patch(`/audiences/${e.audienceId}/contacts/${e?.email?e?.email:e?.id}`,{unsubscribed:e.unsubscribed,first_name:e.firstName,last_name:e.lastName,properties:e.properties}):await this.resend.patch(`/contacts/${e?.email?e?.email:e?.id}`,{unsubscribed:e.unsubscribed,first_name:e.firstName,last_name:e.lastName,properties:e.properties})}async remove(e){return typeof e=="string"?this.resend.delete(`/contacts/${e}`):!e.id&&!e.email?{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}}:e.audienceId?this.resend.delete(`/audiences/${e.audienceId}/contacts/${e?.email?e?.email:e?.id}`):this.resend.delete(`/contacts/${e?.email?e?.email:e?.id}`)}};function K1(e){return{name:e.name,region:e.region,custom_return_path:e.customReturnPath,capabilities:e.capabilities,open_tracking:e.openTracking,click_tracking:e.clickTracking,tls:e.tls}}var Y1=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/domains",K1(e),t)}async list(e={}){let t=ye(e),r=t?`/domains?${t}`:"/domains";return await this.resend.get(r)}async get(e){return await this.resend.get(`/domains/${e}`)}async update(e){return await this.resend.patch(`/domains/${e.id}`,{click_tracking:e.clickTracking,open_tracking:e.openTracking,tls:e.tls,capabilities:e.capabilities})}async remove(e){return await this.resend.delete(`/domains/${e}`)}async verify(e){return await this.resend.post(`/domains/${e}/verify`)}},Q1=class{constructor(e){this.resend=e}async get(e){let{emailId:t,id:r}=e;return await this.resend.get(`/emails/${t}/attachments/${r}`)}async list(e){let{emailId:t}=e,r=ye(e),i=r?`/emails/${t}/attachments?${r}`:`/emails/${t}/attachments`;return await this.resend.get(i)}},Z1=class{constructor(e){this.resend=e}async get(e){let{emailId:t,id:r}=e;return await this.resend.get(`/emails/receiving/${t}/attachments/${r}`)}async list(e){let{emailId:t}=e,r=ye(e),i=r?`/emails/receiving/${t}/attachments?${r}`:`/emails/receiving/${t}/attachments`;return await this.resend.get(i)}},X1=class{constructor(e){this.resend=e,this.attachments=new Z1(e)}async get(e){return await this.resend.get(`/emails/receiving/${e}`)}async list(e={}){let t=ye(e),r=t?`/emails/receiving?${t}`:"/emails/receiving";return await this.resend.get(r)}async forward(e){let{emailId:t,to:r,from:i}=e,n=e.passthrough!==!1,o=await this.get(t);if(o.error)return{data:null,error:o.error,headers:o.headers};let s=o.data,a=s.subject||"(no subject)";if(n)return this.forwardPassthrough(s,{to:r,from:i,subject:a});let u=a.startsWith("Fwd:")?a:`Fwd: ${a}`;return this.forwardWrapped(s,{to:r,from:i,subject:u,text:"text"in e?e.text:void 0,html:"html"in e?e.html:void 0})}async forwardPassthrough(e,t){let{to:r,from:i,subject:n}=t;if(!e.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let o=await fetch(e.raw.download_url);if(!o.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:o.status},headers:null};let s=await o.text(),a=await Ur.parse(s,{attachmentEncoding:"base64"}),u=a.attachments.map(l=>{let c=l.contentId?l.contentId.replace(/^<|>$/g,""):void 0;return{filename:l.filename,content:l.content.toString(),content_type:l.mimeType,content_id:c||void 0}});return await this.resend.post("/emails",{from:i,to:r,subject:n,text:a.text||void 0,html:a.html||void 0,attachments:u.length>0?u:void 0})}async forwardWrapped(e,t){let{to:r,from:i,subject:n,text:o,html:s}=t;if(!e.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let a=await fetch(e.raw.download_url);if(!a.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:a.status},headers:null};let u=await a.text();return await this.resend.post("/emails",{from:i,to:r,subject:n,text:o,html:s,attachments:[{filename:"forwarded_message.eml",content:Buffer.from(u).toString("base64"),content_type:"message/rfc822"}]})}},ex=class{constructor(e){this.resend=e,this.attachments=new Q1(e),this.receiving=new X1(e)}async send(e,t={}){return this.create(e,t)}async create(e,t={}){return e.react&&(e.html=await qa(e.react)),await this.resend.post("/emails",w0(e),t)}async get(e){return await this.resend.get(`/emails/${e}`)}async list(e={}){let t=ye(e),r=t?`/emails?${t}`:"/emails";return await this.resend.get(r)}async update(e){return await this.resend.patch(`/emails/${e.id}`,{scheduled_at:e.scheduledAt})}async cancel(e){return await this.resend.post(`/emails/${e}/cancel`)}},tx=class{constructor(e){this.resend=e}async send(e){return await this.resend.post("/events/send",J1(e))}async create(e){return await this.resend.post("/events",e)}async get(e){return await this.resend.get(`/events/${encodeURIComponent(e)}`)}async list(e={}){let t=ye(e),r=t?`/events?${t}`:"/events";return await this.resend.get(r)}async update(e,t){return await this.resend.patch(`/events/${encodeURIComponent(e)}`,t)}async remove(e){return await this.resend.delete(`/events/${encodeURIComponent(e)}`)}},rx=class{constructor(e){this.resend=e}async list(e={}){let t=ye(e),r=t?`/logs?${t}`:"/logs";return await this.resend.get(r)}async get(e){return await this.resend.get(`/logs/${e}`)}},ix=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/segments",e,t)}async list(e={}){let t=ye(e),r=t?`/segments?${t}`:"/segments";return await this.resend.get(r)}async get(e){return await this.resend.get(`/segments/${e}`)}async remove(e){return await this.resend.delete(`/segments/${e}`)}};function nx(e={}){let t=new URLSearchParams;return e.before&&t.set("before",e.before),e.after&&t.set("after",e.after),e.limit&&t.set("limit",e.limit.toString()),t.size>0?`?${t.toString()}`:""}function ox(e){return e?.map(t=>({key:t.key,type:t.type,fallback_value:t.fallbackValue}))}function v0(e){return{name:"name"in e?e.name:void 0,subject:e.subject,html:e.html,text:e.text,alias:e.alias,from:e.from,reply_to:e.replyTo,variables:ox(e.variables)}}var _0=class{constructor(e,t){this.promise=e,this.publishFn=t}then(e,t){return this.promise.then(e,t)}async publish(){let{data:e,error:t}=await this.promise;return t?{data:null,headers:null,error:t}:this.publishFn(e.id)}},sx=class{constructor(e){this.resend=e}create(e){return new _0(this.performCreate(e),this.publish.bind(this))}async performCreate(e){if(e.react){if(!this.renderAsync)try{let{renderAsync:t}=await import("@react-email/render");this.renderAsync=t}catch{throw new Error("Failed to render React component. Make sure to install `@react-email/render`")}e.html=await this.renderAsync(e.react)}return this.resend.post("/templates",v0(e))}async remove(e){return await this.resend.delete(`/templates/${e}`)}async get(e){return await this.resend.get(`/templates/${e}`)}async list(e={}){return this.resend.get(`/templates${nx(e)}`)}duplicate(e){return new _0(this.resend.post(`/templates/${e}/duplicate`),this.publish.bind(this))}async publish(e){return await this.resend.post(`/templates/${e}/publish`)}async update(e,t){return await this.resend.patch(`/templates/${e}`,v0(t))}},ax=class{constructor(e){this.resend=e}async create(e){let{defaultSubscription:t,...r}=e;return await this.resend.post("/topics",{...r,default_subscription:t})}async list(){return await this.resend.get("/topics")}async get(e){return e?await this.resend.get(`/topics/${e}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}async update(e){return e.id?await this.resend.patch(`/topics/${e.id}`,e):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}async remove(e){return e?await this.resend.delete(`/topics/${e}`):{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}}}},ux=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/webhooks",e,t)}async get(e){return await this.resend.get(`/webhooks/${e}`)}async list(e={}){let t=ye(e),r=t?`/webhooks?${t}`:"/webhooks";return await this.resend.get(r)}async update(e,t){return await this.resend.patch(`/webhooks/${e}`,t)}async remove(e){return await this.resend.delete(`/webhooks/${e}`)}verify(e){return new O0.Webhook(e.webhookSecret).verify(e.payload,{"svix-id":e.headers.id,"svix-timestamp":e.headers.timestamp,"svix-signature":e.headers.signature})}},y0="https://api.resend.com",C0=`resend-node:${R1}`,lx=typeof process<"u"&&process.env&&process.env.RESEND_BASE_URL||y0,cx=typeof process<"u"&&process.env&&process.env.RESEND_USER_AGENT||C0,_r=class{constructor(e){if(this.key=e,this.segments=new ix(this),this.apiKeys=new F1(this),this.audiences=this.segments,this.automations=new B1(this),this.batch=new N1(this),this.broadcasts=new L1(this),this.contactProperties=new G1(this),this.contacts=new V1(this),this.domains=new Y1(this),this.emails=new ex(this),this.events=new tx(this),this.logs=new rx(this),this.templates=new sx(this),this.topics=new ax(this),this.webhooks=new ux(this),!e&&(typeof process<"u"&&process.env&&(this.key=process.env.RESEND_API_KEY),!this.key))throw new Error('Missing API key. Pass it to the constructor `new Resend("re_123")`');this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":cx,"Content-Type":"application/json"})}async fetchRequest(e,t={}){try{let r=await fetch(`${lx}${e}`,t);if(!r.ok)try{let i=await r.text();return{data:null,error:JSON.parse(i),headers:Object.fromEntries(r.headers.entries())}}catch(i){if(i instanceof SyntaxError)return{data:null,error:{name:"application_error",statusCode:r.status,message:"Internal server error. We are unable to process your request right now, please try again later."},headers:Object.fromEntries(r.headers.entries())};let n={message:r.statusText,statusCode:r.status,name:"application_error"};return i instanceof Error?{data:null,error:{...n,message:i.message},headers:Object.fromEntries(r.headers.entries())}:{data:null,error:n,headers:Object.fromEntries(r.headers.entries())}}return{data:await r.json(),error:null,headers:Object.fromEntries(r.headers.entries())}}catch{return{data:null,error:{name:"application_error",statusCode:null,message:"Unable to fetch data. The request could not be resolved."},headers:null}}}async post(e,t,r={}){let i=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())i.set(o,s);r.idempotencyKey&&i.set("Idempotency-Key",r.idempotencyKey);let n={method:"POST",body:JSON.stringify(t),...r,headers:i};return this.fetchRequest(e,n)}async get(e,t={}){let r=new Headers(this.headers);if(t.headers)for(let[n,o]of new Headers(t.headers).entries())r.set(n,o);let i={method:"GET",...t,headers:r};return this.fetchRequest(e,i)}async put(e,t,r={}){let i=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())i.set(o,s);let n={method:"PUT",body:JSON.stringify(t),...r,headers:i};return this.fetchRequest(e,n)}async patch(e,t,r={}){let i=new Headers(this.headers);if(r.headers)for(let[o,s]of new Headers(r.headers).entries())i.set(o,s);let n={method:"PATCH",body:JSON.stringify(t),...r,headers:i};return this.fetchRequest(e,n)}async delete(e,t){let r={method:"DELETE",body:JSON.stringify(t),headers:this.headers};return this.fetchRequest(e,r)}};De();var F0=le(_t(),1);function Y(e,t){return e instanceof Error?e.message:t}function z0(e){return!!(e||!process.stdout.isTTY)}function F(e,t={}){z0(t.json)?console.log(JSON.stringify(e,null,2)):console.log(typeof e=="string"?e:JSON.stringify(e,null,2)),t.exitCode!==void 0&&process.exit(t.exitCode)}function g(e,t={}){let r=t.exitCode??1;z0(t.json)?console.error(JSON.stringify({error:{message:e.message,code:e.code??"unknown"}},null,2)):console.error(`${F0.default.red("Error:")} ${e.message}`),process.exit(r)}var M0={sending_access:0,full_access:1};function fx(e,t){return M0[e]>=M0[t]}async function oe(e,t){let r=e.profile??e.team;try{let i=await rr(e.apiKey,r);if(!i){if(r){let n=je();if(!n.some(s=>s.name===r))throw new Error(`Profile "${r}" not found. Available profiles: ${n.map(s=>s.name).join(", ")||"(none)"}`)}throw new Error("No API key found. Set RESEND_API_KEY, use --api-key, or run: resend login")}if(i.permission){let n=t?.permission??"full_access";fx(i.permission,n)||g({message:`This command requires a full access API key. Your current key has sending access only.
185
+ ${yr}`,code:"insufficient_permissions"},{json:e.json})}return new _r(i.key)}catch(i){g({message:Y(i,"Failed to create client"),code:"auth_error"},{json:e.json})}}var J0=130;function hx(){process.stderr.isTTY&&process.stderr.write("\r\x1B[2K"),console.error("Cancelled."),process.exit(J0)}var Sr;function B0(){Sr=hx,process.on("SIGINT",Sr),process.on("uncaughtException",e=>{g({message:Y(e,"An unexpected error occurred"),code:"unexpected_error"},{}),process.exit(1)})}function Na(e){Sr&&process.removeListener("SIGINT",Sr),Sr=e,process.on("SIGINT",Sr)}function xr(){return J0}De();var La=le(_t(),1);ee();var gx=bt?String.fromCodePoint(10004):"v",bx=bt?String.fromCodePoint(9888):"!",vx=bt?String.fromCodePoint(10007):"x",_x=["\u2839","\u2838","\u2834","\u2826","\u2807","\u280F","\u2819","\u2839"],yx=80,H0=[1,2,4],Cx=H0.length;function Ox(e){let t=e?.["retry-after"];if(!t)return;let r=Number(t);if(Number.isFinite(r)&&r>=0)return r}function Sx(e){return new Promise(t=>setTimeout(t,e))}async function Me(e,t,r,i){let n=he(e,i.quiet);try{for(let o=0;;o++){let{data:s,error:a,headers:u}=await t();if(a){if(o<Cx&&a.name==="rate_limit_exceeded"){let l=Ox(u)??H0[o];n.update(`Rate limited, retrying in ${l}s...`),await Sx(l*1e3),n.update(e);continue}n.stop(),g({message:a.message,code:r},{json:i.json})}return s===null&&(n.stop(),g({message:"Unexpected empty response",code:r},{json:i.json})),n.stop(),s}}catch(o){return n.stop(),g({message:Y(o,"Unknown error"),code:r},{json:i.json})}}function he(e,t){if(t||!O())return{update(a){},stop(a){},clear(){},warn(a){},fail(a){}};let r=bt?_x:["-","\\","|","/"],i=yx,n=0,o=e,s=setInterval(()=>{process.stderr.write(`\r\x1B[2K ${r[n++%r.length]} ${o}`)},i);return{update(a){o=a},stop(a){clearInterval(s),a?process.stderr.write(`\r\x1B[2K ${La.default.green(gx)} ${a}
186
+ `):process.stderr.write("\r\x1B[2K")},clear(){clearInterval(s),process.stderr.write("\r\x1B[2K")},warn(a){clearInterval(s),process.stderr.write(`\r\x1B[2K ${La.default.yellow(bx)} ${a}
187
+ `)},fail(a){clearInterval(s),process.stderr.write(`\r\x1B[2K ${La.default.red(vx)} ${a}
188
+ `)}}}ee();function T(e){Id(e),process.exit(xr())}async function G0(e,t,r){(!O()||r.json)&&g({message:"Use --yes to confirm deletion in non-interactive mode.",code:"confirmation_required"},{json:r.json});let i=await Ct({message:t});(P(i)||!i)&&T("Deletion cancelled.")}async function Ga(e,t){let r=fe(e);if(!r)return e;if(!O()||t.json)return g({message:`Profile "${e}" has an invalid name: ${r}`,code:"invalid_profile_name"},{json:t.json}),null;ie.warn(`Profile "${e}" has an invalid name: ${r}`);let i=await te({message:"Enter a new name for this profile:",placeholder:e.replace(/[^a-zA-Z0-9._-]/g,"-"),validate:n=>fe(n)});P(i)&&T("Rename cancelled.");try{await Ha(e,i)}catch(n){return g({message:Y(n,"Failed to rename profile"),code:"rename_failed"},{json:t.json}),null}return ie.success(`Profile renamed to '${i}'.`),i}async function U(e,t,r,i){if(e!==void 0)return e;(!O()||i.json)&&g(r,{json:i.json});let n=await te({message:t.message,placeholder:t.placeholder,defaultValue:t.defaultValue,validate:t.validate??(o=>!t.defaultValue&&(!o||o.length===0)?`${t.message} is required`:void 0)});return P(n)&&T("Cancelled."),n}async function wr(e,t,r,i){if(e!==void 0)return e;(!O()||i.json)&&g(r,{json:i.json});let n=await pe({message:t.message,options:t.options});return P(n)&&T("Cancelled."),n}async function U0(e,t,r){let i=t.filter(s=>s.required!==!1&&e[s.flag]==="");if(i.length>0){let s=i.map(a=>`--${a.flag}`).join(", ");g({message:`Empty value for required flags: ${s}`,code:"invalid_options"},{json:r.json})}let n=t.filter(s=>s.required!==!1&&!e[s.flag]);if(n.length===0)return e;if(!O()||r.json){let s=n.map(a=>`--${a.flag}`).join(", ");g({message:`Missing required flags: ${s}`,code:"missing_flags"},{json:r.json})}let o=await Dd(Object.fromEntries(n.map(s=>[s.flag,()=>te({message:s.message,placeholder:s.placeholder,defaultValue:s.defaultValue,validate:s.validate??(a=>!s.defaultValue&&(!a||a.length===0)?`${s.message} is required`:void 0)})])),{onCancel:()=>T("Operation cancelled.")});return{...e,...o}}var xx=20,N0="__fetch_more__",L0="__none__";async function C(e,t,r,i){if(e)return e;let n=i?.optional??!1;if(!O()||r.json){if(n)return;g({message:"Missing required argument: id",code:"missing_id"},{json:r.json})}let o=await oe(r),s=[];for(;;){let a=s.at(-1)?.id,u=he(s.length===0?`Fetching ${t.resourcePlural}...`:`Fetching more ${t.resourcePlural}...`,r.quiet),l=await t.fetchItems(o,{limit:xx,...a&&{after:a}});if(l.error||!l.data){if(n){u.clear();return}u.fail(`Failed to fetch ${t.resourcePlural}`),g({message:l.error?.message??"Unexpected empty response",code:"list_error"},{json:r.json})}s.push(...l.data.data);let c=l.data.has_more??!1,d=t.filter?s.filter(t.filter):s;if(d.length===0&&!c&&n){u.clear();return}if(u.stop(s.length===d.length?`${t.resourcePlural} fetched`:`More ${t.resourcePlural} fetched`),d.length===0&&!c&&(ie.warn(`No ${t.resourcePlural} found.`),g({message:`No ${t.resourcePlural} found.`,code:"no_items"},{json:r.json})),d.length===0&&c&&!n)continue;let m=d.map(v=>({value:v.id,...t.display(v)}));n&&m.unshift({value:L0,label:"None"}),c&&m.push({value:N0,label:"Fetch more..."});let b=await pe({message:`Select a ${t.resource}`,options:m});if(P(b)&&T("Cancelled."),b===L0)return;if(b!==N0)return b}}ee();async function N(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await oe(t,r),n=await Me(e.loading,()=>e.sdkCall(i),"fetch_error",t);!t.json&&O()?e.onInteractive(n):F(n,{json:t.json})}async function ue(e,t,r,i){let n=r.permission?{permission:r.permission}:void 0,o=await oe(i,n);t||await G0(e,r.confirmMessage,i),await Me(r.loading,()=>r.sdkCall(o),"delete_error",i),!i.json&&O()?console.log(r.successMsg):F({object:r.object,id:e,deleted:!0},{json:i.json})}async function re(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await oe(t,r),n=await Me(e.loading,()=>e.sdkCall(i),"create_error",t);!t.json&&O()?e.onInteractive(n):F(n,{json:t.json})}async function B(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await oe(t,r),n=await Me(e.loading,()=>e.sdkCall(i),e.errorCode,t);!t.json&&O()?console.log(e.successMsg):F(n,{json:t.json})}async function R(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await oe(t,r),n=await Me(e.loading,()=>e.sdkCall(i),"list_error",t);!t.json&&O()?e.onInteractive(n):F(n,{json:t.json})}ee();ee();var Ce=bt?{h:String.fromCodePoint(9472),v:String.fromCodePoint(9474),tl:String.fromCodePoint(9484),tr:String.fromCodePoint(9488),bl:String.fromCodePoint(9492),br:String.fromCodePoint(9496),lm:String.fromCodePoint(9500),rm:String.fromCodePoint(9508),tm:String.fromCodePoint(9516),bm:String.fromCodePoint(9524),mm:String.fromCodePoint(9532)}:{h:"-",v:"|",tl:"+",tr:"+",bl:"+",br:"+",lm:"+",rm:"+",tm:"+",bm:"+",mm:"+"};function wx(){return process.stdout.columns}function kx(e,t,r){let i=Math.max(...e.map(o=>o.length)),n=Math.max(20,Math.min(r,60));return t.map((o,s)=>{let a=String(s+1),u=`${Ce.h}${Ce.h} ${a} ${Ce.h.repeat(Math.max(0,n-a.length-4))}`,l=e.map((c,d)=>` ${c.padEnd(i)} ${o[d]}`);return[u,...l].join(`
199
189
  `)}).join(`
200
190
 
201
- `)}function M(e,t,r="(no results)"){if(t.length===0)return r;let i=e.map((l,d)=>Math.max(l.length,...t.map(c=>c[d].length))),n=Zx();if(n!==void 0&&i.reduce((d,c)=>d+c,0)+3*i.length+1>n)return Xx(e,t,n);let o=Oe.tl+i.map(l=>Oe.h.repeat(l+2)).join(Oe.tm)+Oe.tr,s=Oe.lm+i.map(l=>Oe.h.repeat(l+2)).join(Oe.mm)+Oe.rm,a=Oe.bl+i.map(l=>Oe.h.repeat(l+2)).join(Oe.bm)+Oe.br,u=l=>Oe.v+" "+l.map((d,c)=>d.padEnd(i[c])).join(` ${Oe.v} `)+" "+Oe.v;return[o,u(e),s,...t.map(u),a].join(`
202
- `)}ee();var qc=gt?String.fromCodePoint(9472):"-";function Ya(e,t){return e.length===0?"(no DNS records)":e.map(i=>{let n=i.name?i.name.includes(".")?i.name:`${i.name}.${t}`:t;return[`${qc}${qc} ${i.type} ${qc.repeat(40)}`,` Name ${n}`,` TTL ${i.ttl}`,` Value ${i.value}`].join(`
191
+ `)}function z(e,t,r="(no results)"){if(t.length===0)return r;let i=e.map((l,c)=>Math.max(l.length,...t.map(d=>d[c].length))),n=wx();if(n!==void 0&&i.reduce((c,d)=>c+d,0)+3*i.length+1>n)return kx(e,t,n);let o=Ce.tl+i.map(l=>Ce.h.repeat(l+2)).join(Ce.tm)+Ce.tr,s=Ce.lm+i.map(l=>Ce.h.repeat(l+2)).join(Ce.mm)+Ce.rm,a=Ce.bl+i.map(l=>Ce.h.repeat(l+2)).join(Ce.bm)+Ce.br,u=l=>Ce.v+" "+l.map((c,d)=>c.padEnd(i[d])).join(` ${Ce.v} `)+" "+Ce.v;return[o,u(e),s,...t.map(u),a].join(`
192
+ `)}ee();var wc=bt?String.fromCodePoint(9472):"-";function Ua(e,t){return e.length===0?"(no DNS records)":e.map(i=>{let n=i.name?i.name.includes(".")?i.name:`${i.name}.${t}`:t;return[`${wc}${wc} ${i.type} ${wc.repeat(40)}`,` Name ${n}`,` TTL ${i.ttl}`,` Value ${i.value}`].join(`
203
193
  `)}).join(`
204
194
 
205
- `)}function ov(e){let t=e.map(r=>[r.name,r.status,r.region,r.id]);return M(["Name","Status","Region","ID"],t,"(no domains)")}function sv(e){switch(e){case"verified":return"\u2713 Verified";case"pending":return"\u23F3 Pending";case"not_started":return"\u25CB Not started";case"failed":case"temporary_failure":return"\u2717 Failed";default:return e}}var at={resource:"domain",resourcePlural:"domains",fetchItems:(e,{limit:t,after:r})=>e.domains.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};var av=new p("create").description("Create a new API key and display the token (shown once \u2014 store it immediately)").option("--name <name>","API key name (max 50 characters)").addOption(new ce("--permission <permission>","Permission level").choices(["full_access","sending_access"])).option("--domain-id <id>","Restrict a sending_access key to a single domain ID").addHelpText("after",h({context:`Non-interactive: --name is required (no prompts when stdin/stdout is not a TTY).
195
+ `)}function W0(e){let t=e.map(r=>[r.name,r.status,r.region,r.id]);return z(["Name","Status","Region","ID"],t,"(no domains)")}function V0(e){switch(e){case"verified":return"\u2713 Verified";case"pending":return"\u23F3 Pending";case"not_started":return"\u25CB Not started";case"failed":case"temporary_failure":return"\u2717 Failed";default:return e}}var ut={resource:"domain",resourcePlural:"domains",fetchItems:(e,{limit:t,after:r})=>e.domains.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};var K0=new p("create").description("Create a new API key and display the token (shown once \u2014 store it immediately)").option("--name <name>","API key name (max 50 characters)").addOption(new ce("--permission <permission>","Permission level").choices(["full_access","sending_access"])).option("--domain-id <id>","Restrict a sending_access key to a single domain ID").addHelpText("after",h({context:`Non-interactive: --name is required (no prompts when stdin/stdout is not a TTY).
206
196
 
207
197
  Permissions:
208
198
  full_access Full API access (default)
209
199
  sending_access Send-only access; optionally scope to a domain with --domain-id`,output:` {"id":"<id>","token":"<token>"}
210
- The token is only returned at creation time and cannot be retrieved again.`,errorCodes:["auth_error","missing_name","invalid_flags","create_error"],examples:['resend api-keys create --name "Production"','resend api-keys create --name "CI Token" --permission sending_access','resend api-keys create --name "Domain Token" --permission sending_access --domain-id <domain-id>','resend api-keys create --name "Production" --json']})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=e.name,n=e.permission;if(!i){(!k()||r.json)&&v({message:"Missing --name flag.",code:"missing_name"},{json:r.json});let s=await te({message:"Key name",placeholder:"e.g. My API Key",validate:u=>{if(!u)return"Name is required";if(u.length>50)return"Name must be 50 characters or less"}});j(s)&&D("Cancelled."),i=s;let a=await pe({message:"Permission level",options:[{value:"full_access",label:"Full access"},{value:"sending_access",label:"Sending access only"}]});j(a)&&D("Cancelled."),n=a}let o=e.domainId;o!==void 0&&n!=="sending_access"&&v({message:"--domain-id requires --permission sending_access",code:"invalid_flags"},{json:r.json}),!o&&n==="sending_access"&&(o=await C(void 0,at,r,{optional:!0})),await re({loading:"Creating API key...",sdkCall:s=>s.apiKeys.create({name:i,...n&&{permission:n},...o&&{domain_id:o}}),onInteractive:s=>{console.log(` ${ni.default.gray("Name:")} ${i}`),console.log(` ${ni.default.gray("ID:")} ${s.id}`),console.log(` ${ni.default.gray("Token:")} ${s.token}`),console.log(`
211
- ${ni.default.yellow("\u26A0")} Store this token now \u2014 it cannot be retrieved again.`)}},r)});var uv={resource:"API key",resourcePlural:"API keys",fetchItems:e=>e.apiKeys.list().then(t=>({...t,data:t.data?{data:t.data.data,has_more:!1}:null})),display:e=>({label:e.name,hint:e.id})};function lv(e){let t=e.map(r=>[r.name,r.id,r.created_at,r.last_used_at??""]);return M(["Name","ID","Created","Last used"],t,"(no API keys)")}var cv=new p("delete").alias("rm").description("Delete an API key \u2014 any services using it will immediately lose access").argument("[id]","API key ID").option("--yes","Skip confirmation prompt").addHelpText("after",h({context:`Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.
200
+ The token is only returned at creation time and cannot be retrieved again.`,errorCodes:["auth_error","missing_name","invalid_flags","create_error"],examples:['resend api-keys create --name "Production"','resend api-keys create --name "CI Token" --permission sending_access','resend api-keys create --name "Domain Token" --permission sending_access --domain-id <domain-id>','resend api-keys create --name "Production" --json']})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=e.name,n=e.permission;if(!i){(!O()||r.json)&&g({message:"Missing --name flag.",code:"missing_name"},{json:r.json});let s=await te({message:"Key name",placeholder:"e.g. My API Key",validate:u=>{if(!u)return"Name is required";if(u.length>50)return"Name must be 50 characters or less"}});P(s)&&T("Cancelled."),i=s;let a=await pe({message:"Permission level",options:[{value:"full_access",label:"Full access"},{value:"sending_access",label:"Sending access only"}]});P(a)&&T("Cancelled."),n=a}let o=e.domainId;o!==void 0&&n!=="sending_access"&&g({message:"--domain-id requires --permission sending_access",code:"invalid_flags"},{json:r.json}),!o&&n==="sending_access"&&(o=await C(void 0,ut,r,{optional:!0})),await re({loading:"Creating API key...",sdkCall:s=>s.apiKeys.create({name:i,...n&&{permission:n},...o&&{domain_id:o}}),onInteractive:s=>{console.log(` ${ni.default.gray("Name:")} ${i}`),console.log(` ${ni.default.gray("ID:")} ${s.id}`),console.log(` ${ni.default.gray("Token:")} ${s.token}`),console.log(`
201
+ ${ni.default.yellow("\u26A0")} Store this token now \u2014 it cannot be retrieved again.`)}},r)});var Y0={resource:"API key",resourcePlural:"API keys",fetchItems:e=>e.apiKeys.list().then(t=>({...t,data:t.data?{data:t.data.data,has_more:!1}:null})),display:e=>({label:e.name,hint:e.id})};function Q0(e){let t=e.map(r=>[r.name,r.id,r.created_at,r.last_used_at??""]);return z(["Name","ID","Created","Last used"],t,"(no API keys)")}var Z0=new p("delete").alias("rm").description("Delete an API key \u2014 any services using it will immediately lose access").argument("[id]","API key ID").option("--yes","Skip confirmation prompt").addHelpText("after",h({context:`Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.
212
202
 
213
203
  Warning: Deleting a key is immediate and irreversible. Any service using this key
214
204
  will stop authenticating instantly. The current key (used to call this command)
215
- can delete itself \u2014 the API does not prevent self-deletion.`,output:' {"object":"api-key","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend api-keys delete dacf4072-aa82-4ff3-97de-514ae3000ee0 --yes","resend api-keys delete dacf4072-aa82-4ff3-97de-514ae3000ee0 --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,uv,i);await ue(n,!!t.yes,{confirmMessage:`Delete API key ${n}?
216
- Any services using this key will stop working.`,loading:"Deleting API key...",object:"api-key",successMsg:"API key deleted",sdkCall:o=>o.apiKeys.remove(n)},i)});var dv=new p("list").alias("ls").description("List all API keys (IDs and names \u2014 tokens are never returned by this endpoint)").addHelpText("after",h({output:` {"object":"list","data":[{"id":"<id>","name":"<name>","created_at":"<date>","last_used_at":"<date>|null"}]}
217
- Tokens are never included in list responses.`,errorCodes:["auth_error","list_error"],examples:["resend api-keys list","resend api-keys list --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await q({loading:"Fetching API keys...",sdkCall:i=>i.apiKeys.list(),onInteractive:i=>console.log(lv(i.data))},r)});var mv=new p("api-keys").description("Manage API keys for authentication").addHelpText("after",h({context:`Security notes:
205
+ can delete itself \u2014 the API does not prevent self-deletion.`,output:' {"object":"api-key","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend api-keys delete dacf4072-aa82-4ff3-97de-514ae3000ee0 --yes","resend api-keys delete dacf4072-aa82-4ff3-97de-514ae3000ee0 --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Y0,i);await ue(n,!!t.yes,{confirmMessage:`Delete API key ${n}?
206
+ Any services using this key will stop working.`,loading:"Deleting API key...",object:"api-key",successMsg:"API key deleted",sdkCall:o=>o.apiKeys.remove(n)},i)});var X0=new p("list").alias("ls").description("List all API keys (IDs and names \u2014 tokens are never returned by this endpoint)").addHelpText("after",h({output:` {"object":"list","data":[{"id":"<id>","name":"<name>","created_at":"<date>","last_used_at":"<date>|null"}]}
207
+ Tokens are never included in list responses.`,errorCodes:["auth_error","list_error"],examples:["resend api-keys list","resend api-keys list --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await R({loading:"Fetching API keys...",sdkCall:i=>i.apiKeys.list(),onInteractive:i=>console.log(Q0(i.data))},r)});var ev=new p("api-keys").description("Manage API keys for authentication").addHelpText("after",h({context:`Security notes:
218
208
  - Tokens are only shown at creation time and cannot be retrieved again.
219
209
  - Use sending_access keys with --domain-id for per-domain CI tokens.
220
- - Deleting a key is immediate \u2014 any service using it loses access instantly.`,examples:["resend api-keys list",'resend api-keys create --name "Production"','resend api-keys create --name "CI Token" --permission sending_access --domain-id <domain-id>',"resend api-keys delete <id> --yes"]})).addCommand(av).addCommand(dv,{isDefault:!0}).addCommand(cv);je();ee();function Rc(e){let t=De();if(e.json){z({profiles:t},{json:!0});return}if(t.length===0){console.log("No profiles configured. Run: resend login");return}k()&&console.log(`
210
+ - Deleting a key is immediate \u2014 any service using it loses access instantly.`,examples:["resend api-keys list",'resend api-keys create --name "Production"','resend api-keys create --name "CI Token" --permission sending_access --domain-id <domain-id>',"resend api-keys delete <id> --yes"]})).addCommand(K0).addCommand(X0,{isDefault:!0}).addCommand(Z0);De();ee();function kc(e){let t=je();if(e.json){F({profiles:t},{json:!0});return}if(t.length===0){console.log("No profiles configured. Run: resend login");return}O()&&console.log(`
221
211
  Profiles
222
- `);let r=!1;for(let i of t){let n=i.active?" (active)":"",o=fe(i.name)!==void 0;o&&(r=!0),console.log(` ${i.active?"\u25B8":" "} ${i.name}${n}${o?" (invalid name)":""}`)}r&&k()&&console.log("\n Profiles with invalid names can be renamed via `resend auth rename`."),k()&&console.log("")}var pv=new p("list").description("List all profiles").action((e,t)=>{Rc(t.optsWithGlobals())});var fv=require("node:child_process"),oi=le(vt(),1),it="https://resend.com";function zc(e){return new Promise(t=>{let r=process.platform==="win32"?"cmd.exe":process.platform==="darwin"?"open":"xdg-open",i=e.replaceAll('"',""),n=process.platform==="win32"?["/c","start",'""',`"${i}"`]:[e];(0,fv.execFile)(r,n,{timeout:5e3,windowsVerbatimArguments:!0},o=>t(!o))})}async function Fe(e,t){let r=await zc(e);t?.json||t?.quiet||(r?console.log(oi.default.dim("Opened"),oi.default.blue(e)):console.warn(oi.default.yellow("Could not open browser. Visit this link:"),oi.default.blue(e)))}var Se={emails:`${it}/emails`,logs:`${it}/logs`,log:e=>`${it}/logs/${e}`,templates:`${it}/templates`,template:e=>`${it}/templates/${e}`,broadcasts:`${it}/broadcasts`,broadcast:e=>`${it}/broadcasts/${e}`,documentation:`${it}/docs`,automations:`${it}/automations`,automation:e=>`${it}/automations/${e}/editor`,events:`${it}/automations/events`};je();ee();var Mc="https://resend.com/api-keys?new=true",Qa=new p("login").description("Save a Resend API key").option("--key <key>","API key to store (required in non-interactive mode)").addHelpText("after",h({setup:!0,context:"Non-interactive: --key is required (no prompts will appear when stdin/stdout is not a TTY).",output:' {"success":true,"config_path":"<path>","profile":"<name>"}',errorCodes:["missing_key","invalid_key_format","validation_failed","invalid_profile_name","switch_failed","write_failed"],examples:["resend login --key re_123456789","resend login (interactive \u2014 prompts and opens browser)","RESEND_API_KEY=re_123 resend emails send ... (skip login; use env var directly)"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=typeof e.key=="string"?e.key.trim():e.key;if(!i){(!k()||r.json)&&v({message:"Missing --key flag. Provide your API key in non-interactive mode.",code:"missing_key"},{json:r.json}),Gd("Resend Authentication"),ie.info(`Use a full access API key for complete CLI access.
223
- ${_r}`);let d=await pe({message:"How would you like to get your API key?",options:[{value:"browser",label:"Open resend.com/api-keys in browser"},{value:"manual",label:"Enter API key manually"}]});j(d)&&D("Login cancelled."),d==="browser"&&(await zc(Mc)?ie.info(`Opened ${Mc}`):ie.warn(`Could not open browser. Visit ${Mc} manually.`));let c=await Wd({message:"Enter your Resend API key:",validate:m=>{if(!m)return"API key is required";if(!m.startsWith("re_"))return"API key must start with re_"}});j(c)&&D("Login cancelled."),i=c.trim()}(!i||!i.startsWith("re_"))&&v({message:"Invalid API key format. Key must start with re_",code:"invalid_key_format"},{json:r.json});let n=he("Validating API key...",r.quiet),o="full_access";try{let d=new vr(i),{error:c}=await d.domains.list();if(c){let m=c;if(m.name==="restricted_api_key")o="sending_access",n.warn("API key is valid (sending access only)");else{n.fail("API key validation failed"),v({message:m.message||"Failed to validate API key",code:"validation_failed"},{json:r.json});return}}else n.stop("API key is valid (full access)")}catch(d){n.fail("API key validation failed"),v({message:Q(d,"Failed to validate API key"),code:"validation_failed"},{json:r.json})}let s=(r.profile??r.team)?.trim()||void 0;if(s){let d=fe(s);if(d){v({message:d,code:"invalid_profile_name"},{json:r.json});return}}if(!s&&k()&&!r.json){let d=De();if(d.length>0){let c=[...d.map(_=>({value:_.name,label:`${_.name} (overwrite)`,hint:fe(_.name)?"invalid name":void 0})),{value:"__new__",label:"+ Create new profile"}],m=await pe({message:"Save API key to which profile?",options:c});if(j(m)&&D("Login cancelled."),m==="__new__"){let _=await te({message:"Enter a name for the new profile:",validate:b=>fe((b??"").trim())});if(j(_)&&D("Login cancelled."),s=(_??"").trim()||"default",d.some(b=>b.name===s)){let b=await _t({message:`Profile '${s}' already exists. Overwrite?`});(j(b)||!b)&&D("Login cancelled.")}}else if(fe(m)){let _=await Ka(m,r);if(!_)return;s=_}else s=m}else s="default"}let{configPath:a,backend:u}=await W0(i,s,o),l=s||"default";if(s)try{La(l)}catch(d){v({message:Q(d,"Failed to switch profile"),code:"switch_failed"},{json:r.json})}if(r.json)z({success:!0,config_path:a,profile:l,storage:u.name,permission:o},{json:!0});else{let d=u.isSecure?`in ${u.name}`:`at ${a}`,c=`API key stored for profile '${l}' ${d}`;if(k()?Ii(c):console.log(c),!u.isSecure&&process.platform==="linux"){let m="Tip: Install libsecret-tools and a Secret Service provider (e.g. gnome-keyring) to store keys in secure storage instead of a plaintext file.";k()?ie.info(m):console.log(m)}}});var hv=require("node:fs");je();ee();var Za=new p("logout").description("Remove your saved Resend API key").addHelpText("after",h({setup:!0,context:`Removes the saved API key from secure storage and the credentials file.
212
+ `);let r=!1;for(let i of t){let n=i.active?" (active)":"",o=fe(i.name)!==void 0;o&&(r=!0),console.log(` ${i.active?"\u25B8":" "} ${i.name}${n}${o?" (invalid name)":""}`)}r&&O()&&console.log("\n Profiles with invalid names can be renamed via `resend auth rename`."),O()&&console.log("")}var tv=new p("list").description("List all profiles").action((e,t)=>{kc(t.optsWithGlobals())});var rv=require("node:child_process"),oi=le(_t(),1),it="https://resend.com";function Ac(e){return new Promise(t=>{let r=process.platform==="win32"?"cmd.exe":process.platform==="darwin"?"open":"xdg-open",i=e.replaceAll('"',""),n=process.platform==="win32"?["/c","start",'""',`"${i}"`]:[e];(0,rv.execFile)(r,n,{timeout:5e3,windowsVerbatimArguments:!0},o=>t(!o))})}async function Je(e,t){let r=await Ac(e);t?.json||t?.quiet||(r?console.log(oi.default.dim("Opened"),oi.default.blue(e)):console.warn(oi.default.yellow("Could not open browser. Visit this link:"),oi.default.blue(e)))}var Oe={emails:`${it}/emails`,logs:`${it}/logs`,log:e=>`${it}/logs/${e}`,templates:`${it}/templates`,template:e=>`${it}/templates/${e}`,broadcasts:`${it}/broadcasts`,broadcast:e=>`${it}/broadcasts/${e}`,documentation:`${it}/docs`,automations:`${it}/automations`,automation:e=>`${it}/automations/${e}/editor`,events:`${it}/automations/events`};De();ee();var Ec="https://resend.com/api-keys?new=true",Wa=new p("login").description("Save a Resend API key").option("--key <key>","API key to store (required in non-interactive mode)").addHelpText("after",h({setup:!0,context:"Non-interactive: --key is required (no prompts will appear when stdin/stdout is not a TTY).",output:' {"success":true,"config_path":"<path>","profile":"<name>"}',errorCodes:["missing_key","invalid_key_format","validation_failed","invalid_profile_name","switch_failed","write_failed"],examples:["resend login --key re_123456789","resend login (interactive \u2014 prompts and opens browser)","RESEND_API_KEY=re_123 resend emails send ... (skip login; use env var directly)"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=typeof e.key=="string"?e.key.trim():e.key;if(!i){(!O()||r.json)&&g({message:"Missing --key flag. Provide your API key in non-interactive mode.",code:"missing_key"},{json:r.json}),jd("Resend Authentication"),ie.info(`Use a full access API key for complete CLI access.
213
+ ${yr}`);let c=await pe({message:"How would you like to get your API key?",options:[{value:"browser",label:"Open resend.com/api-keys in browser"},{value:"manual",label:"Enter API key manually"}]});P(c)&&T("Login cancelled."),c==="browser"&&(await Ac(Ec)?ie.info(`Opened ${Ec}`):ie.warn(`Could not open browser. Visit ${Ec} manually.`));let d=await qd({message:"Enter your Resend API key:",validate:m=>{if(!m)return"API key is required";if(!m.startsWith("re_"))return"API key must start with re_"}});P(d)&&T("Login cancelled."),i=d.trim()}(!i||!i.startsWith("re_"))&&g({message:"Invalid API key format. Key must start with re_",code:"invalid_key_format"},{json:r.json});let n=he("Validating API key...",r.quiet),o="full_access";try{let c=new _r(i),{error:d}=await c.domains.list();if(d){let m=d;if(m.name==="restricted_api_key")o="sending_access",n.warn("API key is valid (sending access only)");else{n.fail("API key validation failed"),g({message:m.message||"Failed to validate API key",code:"validation_failed"},{json:r.json});return}}else n.stop("API key is valid (full access)")}catch(c){n.fail("API key validation failed"),g({message:Y(c,"Failed to validate API key"),code:"validation_failed"},{json:r.json})}let s=(r.profile??r.team)?.trim()||void 0;if(s){let c=fe(s);if(c){g({message:c,code:"invalid_profile_name"},{json:r.json});return}}if(!s&&O()&&!r.json){let c=je();if(c.length>0){let d=[...c.map(b=>({value:b.name,label:`${b.name} (overwrite)`,hint:fe(b.name)?"invalid name":void 0})),{value:"__new__",label:"+ Create new profile"}],m=await pe({message:"Save API key to which profile?",options:d});if(P(m)&&T("Login cancelled."),m==="__new__"){let b=await te({message:"Enter a name for the new profile:",validate:_=>fe((_??"").trim())});if(P(b)&&T("Login cancelled."),s=(b??"").trim()||"default",c.some(_=>_.name===s)){let _=await Ct({message:`Profile '${s}' already exists. Overwrite?`});(P(_)||!_)&&T("Login cancelled.")}}else if(fe(m)){let b=await Ga(m,r);if(!b)return;s=b}else s=m}else s="default"}let{configPath:a,backend:u}=await q0(i,s,o),l=s||"default";if(s)try{Ja(l)}catch(c){g({message:Y(c,"Failed to switch profile"),code:"switch_failed"},{json:r.json})}if(r.json)F({success:!0,config_path:a,profile:l,storage:u.name,permission:o},{json:!0});else{let c=u.isSecure?`in ${u.name}`:`at ${a}`,d=`API key stored for profile '${l}' ${c}`;if(O()?Ei(d):console.log(d),!u.isSecure&&process.platform==="linux"){let m="Tip: Install libsecret-tools and a Secret Service provider (e.g. gnome-keyring) to store keys in secure storage instead of a plaintext file.";O()?ie.info(m):console.log(m)}}});var iv=require("node:fs");De();ee();var Va=new p("logout").description("Remove your saved Resend API key").addHelpText("after",h({setup:!0,context:`Removes the saved API key from secure storage and the credentials file.
224
214
 
225
215
  When --profile is specified, only that profile's entry is removed.
226
216
  When no profile is specified, all profiles are removed.
227
217
 
228
- If no credentials file exists, exits cleanly with no error.`,output:' {"success":true,"config_path":"<path>"}',errorCodes:["remove_failed"],examples:["resend logout","resend logout --profile staging","resend logout --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=er();if(!Ae()&&!(0,hv.existsSync)(i)){!r.json&&k()?console.log("No saved credentials found. Nothing to remove."):z({success:!0,already_logged_out:!0},{json:r.json});return}let o=r.profile??r.team,s=!o,a=o||Cr();if(!r.json&&k()){let u=s?"Remove all saved API keys?":`Remove saved API key for profile '${a}'?`,l=await _t({message:u});(j(l)||!l)&&D("Logout cancelled.")}try{s?await V0():await Ga(a)}catch(u){v({message:Q(u,"Failed to remove credentials"),code:"remove_failed"},{json:r.json})}if(!r.json&&k()){let u=s?"Logged out. All API keys removed.":`Logged out. API key removed for profile '${a}'.`;Ii(u)}else z({success:!0,config_path:i,profile:s?"all":a},{json:r.json})});je();ee();async function Jc(e,t){let r=e;if(!r){if(!k()||t.json){v({message:"Missing profile name. Provide a profile name in non-interactive mode.",code:"missing_name"},{json:t.json});return}let i=De();if(i.length===0){v({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:t.json});return}let n=await pe({message:"Remove which profile?",options:i.map(o=>({value:o.name,label:o.name,hint:o.active?"active":void 0}))});j(n)&&D("Remove cancelled."),r=n}if(!t.json&&k()){let i=await _t({message:`Remove profile '${r}' and its API key?`});(j(i)||!i)&&D("Remove cancelled.")}try{await Ga(r)}catch(i){v({message:Q(i,"Failed to remove profile"),code:"remove_failed"},{json:t.json});return}t.json?z({success:!0,removed_profile:r},{json:!0}):console.log(`Profile '${r}' removed.`)}var gv=new p("remove").description("Remove a profile").argument("[name]","Profile name to remove").action(async(e,t,r)=>{await Jc(e,r.optsWithGlobals())});je();ee();async function ew(e,t,r){let i=e,n=t;if(!i){if(!k()||r.json){v({message:"Missing profile name. Provide old and new names in non-interactive mode.",code:"missing_name"},{json:r.json});return}let o=De();if(o.length===0){v({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:r.json});return}let s=await pe({message:"Rename which profile?",options:o.map(a=>({value:a.name,label:a.name,hint:a.active?"active":fe(a.name)?"invalid name":void 0}))});j(s)&&D("Rename cancelled."),i=s}if(!n){if(!k()||r.json){v({message:"Missing new name. Provide old and new names in non-interactive mode.",code:"missing_name"},{json:r.json});return}let o=await te({message:`Enter new name for '${i}':`,placeholder:i.replace(/[^a-zA-Z0-9._-]/g,"-"),validate:s=>fe(s)});j(o)&&D("Rename cancelled."),n=o}try{await Ua(i,n)}catch(o){v({message:Q(o,"Failed to rename profile"),code:"rename_failed"},{json:r.json});return}r.json?z({success:!0,old_name:i,new_name:n},{json:!0}):console.log(`Profile '${i}' renamed to '${n}'.`)}var bv=new p("rename").description("Rename a profile").argument("[old-name]","Current profile name").argument("[new-name]","New profile name").action(async(e,t,r,i)=>{await ew(e,t,i.optsWithGlobals())});je();ee();async function Hc(e,t){let r=e;if(!r){if(!k()||t.json){v({message:"Missing profile name. Provide a profile name in non-interactive mode.",code:"missing_name"},{json:t.json});return}let o=De();if(o.length===0){v({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:t.json});return}let s=await pe({message:"Switch to which profile?",options:o.map(a=>({value:a.name,label:a.name,hint:a.active?"active":fe(a.name)?"invalid name":void 0}))});j(s)&&D("Switch cancelled."),r=s}if(De().some(o=>o.name===r)){let o=await Ka(r,t);if(!o)return;r=o}try{La(r)}catch(o){v({message:Q(o,"Failed to switch profile"),code:"switch_failed"},{json:t.json});return}t.json?z({success:!0,active_profile:r},{json:!0}):console.log(`Switched to profile '${r}'.`)}var vv=new p("switch").description("Switch the active profile").argument("[name]","Profile name to switch to").action(async(e,t,r)=>{await Hc(e,r.optsWithGlobals())});var _v=new p("auth").description("Manage authentication and profiles").addHelpText("after",h({setup:!0,context:`Environment variables:
218
+ If no credentials file exists, exits cleanly with no error.`,output:' {"success":true,"config_path":"<path>"}',errorCodes:["remove_failed"],examples:["resend logout","resend logout --profile staging","resend logout --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=er();if(!we()&&!(0,iv.existsSync)(i)){!r.json&&O()?console.log("No saved credentials found. Nothing to remove."):F({success:!0,already_logged_out:!0},{json:r.json});return}let o=r.profile??r.team,s=!o,a=o||Or();if(!r.json&&O()){let u=s?"Remove all saved API keys?":`Remove saved API key for profile '${a}'?`,l=await Ct({message:u});(P(l)||!l)&&T("Logout cancelled.")}try{s?await R0():await Ba(a)}catch(u){g({message:Y(u,"Failed to remove credentials"),code:"remove_failed"},{json:r.json})}if(!r.json&&O()){let u=s?"Logged out. All API keys removed.":`Logged out. API key removed for profile '${a}'.`;Ei(u)}else F({success:!0,config_path:i,profile:s?"all":a},{json:r.json})});De();ee();async function Pc(e,t){let r=e;if(!r){if(!O()||t.json){g({message:"Missing profile name. Provide a profile name in non-interactive mode.",code:"missing_name"},{json:t.json});return}let i=je();if(i.length===0){g({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:t.json});return}let n=await pe({message:"Remove which profile?",options:i.map(o=>({value:o.name,label:o.name,hint:o.active?"active":void 0}))});P(n)&&T("Remove cancelled."),r=n}if(!t.json&&O()){let i=await Ct({message:`Remove profile '${r}' and its API key?`});(P(i)||!i)&&T("Remove cancelled.")}try{await Ba(r)}catch(i){g({message:Y(i,"Failed to remove profile"),code:"remove_failed"},{json:t.json});return}t.json?F({success:!0,removed_profile:r},{json:!0}):console.log(`Profile '${r}' removed.`)}var nv=new p("remove").description("Remove a profile").argument("[name]","Profile name to remove").action(async(e,t,r)=>{await Pc(e,r.optsWithGlobals())});De();ee();async function Ax(e,t,r){let i=e,n=t;if(!i){if(!O()||r.json){g({message:"Missing profile name. Provide old and new names in non-interactive mode.",code:"missing_name"},{json:r.json});return}let o=je();if(o.length===0){g({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:r.json});return}let s=await pe({message:"Rename which profile?",options:o.map(a=>({value:a.name,label:a.name,hint:a.active?"active":fe(a.name)?"invalid name":void 0}))});P(s)&&T("Rename cancelled."),i=s}if(!n){if(!O()||r.json){g({message:"Missing new name. Provide old and new names in non-interactive mode.",code:"missing_name"},{json:r.json});return}let o=await te({message:`Enter new name for '${i}':`,placeholder:i.replace(/[^a-zA-Z0-9._-]/g,"-"),validate:s=>fe(s)});P(o)&&T("Rename cancelled."),n=o}try{await Ha(i,n)}catch(o){g({message:Y(o,"Failed to rename profile"),code:"rename_failed"},{json:r.json});return}r.json?F({success:!0,old_name:i,new_name:n},{json:!0}):console.log(`Profile '${i}' renamed to '${n}'.`)}var ov=new p("rename").description("Rename a profile").argument("[old-name]","Current profile name").argument("[new-name]","New profile name").action(async(e,t,r,i)=>{await Ax(e,t,i.optsWithGlobals())});De();ee();async function Tc(e,t){let r=e;if(!r){if(!O()||t.json){g({message:"Missing profile name. Provide a profile name in non-interactive mode.",code:"missing_name"},{json:t.json});return}let o=je();if(o.length===0){g({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:t.json});return}let s=await pe({message:"Switch to which profile?",options:o.map(a=>({value:a.name,label:a.name,hint:a.active?"active":fe(a.name)?"invalid name":void 0}))});P(s)&&T("Switch cancelled."),r=s}if(je().some(o=>o.name===r)){let o=await Ga(r,t);if(!o)return;r=o}try{Ja(r)}catch(o){g({message:Y(o,"Failed to switch profile"),code:"switch_failed"},{json:t.json});return}t.json?F({success:!0,active_profile:r},{json:!0}):console.log(`Switched to profile '${r}'.`)}var sv=new p("switch").description("Switch the active profile").argument("[name]","Profile name to switch to").action(async(e,t,r)=>{await Tc(e,r.optsWithGlobals())});var av=new p("auth").description("Manage authentication and profiles").addHelpText("after",h({setup:!0,context:`Environment variables:
229
219
  RESEND_API_KEY API key (overrides stored credentials)
230
220
  RESEND_PROFILE Profile name (overrides config default)
231
- RESEND_CREDENTIAL_STORE Storage method: "secure_storage" or "file"`,examples:["resend login","resend login --key re_123456789","resend logout","resend auth list","resend auth switch staging","resend auth rename staging production","resend auth remove staging"]})).addCommand(Qa).addCommand(Za).addCommand(pv,{isDefault:!0}).addCommand(vv).addCommand(bv).addCommand(gv);var Fc=require("node:fs");function ge(e,t){if(e==="-"){process.stdin.isTTY&&v({message:"No input piped to stdin",code:"stdin_read_error"},{json:t.json});try{return(0,Fc.readFileSync)(0,"utf-8")}catch{v({message:"Failed to read from stdin",code:"stdin_read_error"},{json:t.json})}}try{return(0,Fc.readFileSync)(e,"utf-8")}catch{v({message:`Failed to read file: ${e}`,code:"file_read_error"},{json:t.json})}}function ir(e,t,r){if(e)try{return JSON.parse(e)}catch(i){v({message:`Invalid JSON for ${t}: ${i instanceof Error?i.message:"parse error"}`,code:"invalid_json"},{json:r.json})}}var yv=new p("create").description("Create a new automation").option("--name <name>","Automation name").addOption(new ce("--status <status>","Initial status").choices(["enabled","disabled"])).option("--steps <json>","Steps array as JSON string").option("--connections <json>","Connections array as JSON string").option("--file <path>",'Path to a JSON file containing the full automation payload (use "-" for stdin)').addHelpText("after",h({context:`Non-interactive: --name and --steps/--connections (or --file) are required.
221
+ RESEND_CREDENTIAL_STORE Storage method: "secure_storage" or "file"`,examples:["resend login","resend login --key re_123456789","resend logout","resend auth list","resend auth switch staging","resend auth rename staging production","resend auth remove staging"]})).addCommand(Wa).addCommand(Va).addCommand(tv,{isDefault:!0}).addCommand(sv).addCommand(ov).addCommand(nv);var Dc=require("node:fs");function ge(e,t){if(e==="-"){process.stdin.isTTY&&g({message:"No input piped to stdin",code:"stdin_read_error"},{json:t.json});try{return(0,Dc.readFileSync)(0,"utf-8")}catch{g({message:"Failed to read from stdin",code:"stdin_read_error"},{json:t.json})}}try{return(0,Dc.readFileSync)(e,"utf-8")}catch{g({message:`Failed to read file: ${e}`,code:"file_read_error"},{json:t.json})}}function ir(e,t,r){if(e!==void 0)try{return JSON.parse(e)}catch(i){g({message:`Invalid JSON for ${t}: ${i instanceof Error?i.message:"parse error"}`,code:"invalid_json"},{json:r.json})}}var uv=new p("create").description("Create a new automation").option("--name <name>","Automation name").addOption(new ce("--status <status>","Initial status").choices(["enabled","disabled"])).option("--steps <json>","Steps array as JSON string").option("--connections <json>","Connections array as JSON string").option("--file <path>",'Path to a JSON file containing the full automation payload (use "-" for stdin)').addHelpText("after",h({context:`Non-interactive: --name and --steps/--connections (or --file) are required.
232
222
 
233
223
  Payload format:
234
224
  --file accepts a JSON object with { name, status?, steps, connections }.
@@ -236,19 +226,19 @@ Payload format:
236
226
  When using --file, --name/--status/--steps/--connections flags override file values.
237
227
 
238
228
  Step types: trigger, delay, send_email, wait_for_event, condition
239
- Connection types: default, condition_met, condition_not_met, timeout, event_received`,output:' {"object":"automation","id":"<id>"}',errorCodes:["auth_error","missing_name","missing_steps","missing_connections","invalid_json","file_read_error","create_error"],examples:["resend automations create --file automation.json","cat automation.json | resend automations create --file -","resend automations create --file automation.json --status disabled",`resend automations create --name "Welcome Flow" --steps '[...]' --connections '[...]'`]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i={};if(e.file){let u=ge(e.file,r);try{i=JSON.parse(u)}catch(l){v({message:`Invalid JSON in --file: ${l instanceof Error?l.message:"parse error"}`,code:"invalid_json"},{json:r.json})}(typeof i!="object"||i===null||Array.isArray(i))&&v({message:"--file must contain a JSON object with automation properties (name, steps, connections).",code:"invalid_json"},{json:r.json})}let n=await U(e.name??i.name,{message:"Automation name",placeholder:"e.g. Welcome Flow"},{message:"Missing --name flag.",code:"missing_name"},r),o=ir(e.steps,"--steps",r)??i.steps;(!o||!Array.isArray(o)||o.length===0)&&v({message:"Missing or empty steps. Provide --steps as a JSON array or use --file.",code:"missing_steps"},{json:r.json});let s=ir(e.connections,"--connections",r)??i.connections;s||v({message:"Missing connections. Provide --connections as a JSON array or use --file (empty array is valid for single-step automations).",code:"missing_connections"},{json:r.json}),Array.isArray(s)||v({message:"--connections must be a JSON array.",code:"invalid_json"},{json:r.json});let a=e.status??i.status;await re({loading:"Creating automation...",sdkCall:u=>u.automations.create({name:n,steps:o,connections:s,...a&&{status:a}}),onInteractive:u=>{console.log(`Automation created: ${u.id}`)}},r)});function Cv(e){let t=e.map(r=>[r.name,Bc(r.status),r.created_at,r.id]);return M(["Name","Status","Created","ID"],t,"(no automations)")}function Bc(e){switch(e){case"enabled":return"\u2713 Enabled";case"disabled":return"\u25CB Disabled";default:return e}}var Pt={resource:"automation",resourcePlural:"automations",fetchItems:(e,{limit:t,after:r})=>e.automations.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};var Ov=new p("delete").alias("rm").description("Delete an automation").argument("[id]","Automation ID").option("--yes","Skip confirmation prompt").addHelpText("after",h({context:"Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.",output:' {"object":"automation","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend automations delete <id> --yes","resend automations delete <id> --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Pt,i);await ue(n,!!t.yes,{confirmMessage:`Delete automation ${n}?
240
- This cannot be undone.`,loading:"Deleting automation...",object:"automation",successMsg:"Automation deleted",sdkCall:o=>o.automations.remove(n)},i)});var Sv=new p("get").description("Retrieve an automation with its steps and connections").argument("[id]","Automation ID").addHelpText("after",h({output:` Full automation object including steps and connections arrays.
229
+ Connection types: default, condition_met, condition_not_met, timeout, event_received`,output:' {"object":"automation","id":"<id>"}',errorCodes:["auth_error","missing_name","missing_steps","missing_connections","invalid_json","file_read_error","create_error"],examples:["resend automations create --file automation.json","cat automation.json | resend automations create --file -","resend automations create --file automation.json --status disabled",`resend automations create --name "Welcome Flow" --steps '[...]' --connections '[...]'`]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i={};if(e.file){let u=ge(e.file,r);try{i=JSON.parse(u)}catch(l){g({message:`Invalid JSON in --file: ${l instanceof Error?l.message:"parse error"}`,code:"invalid_json"},{json:r.json})}(typeof i!="object"||i===null||Array.isArray(i))&&g({message:"--file must contain a JSON object with automation properties (name, steps, connections).",code:"invalid_json"},{json:r.json})}let n=await U(e.name??i.name,{message:"Automation name",placeholder:"e.g. Welcome Flow"},{message:"Missing --name flag.",code:"missing_name"},r),o=ir(e.steps,"--steps",r)??i.steps;(!o||!Array.isArray(o)||o.length===0)&&g({message:"Missing or empty steps. Provide --steps as a JSON array or use --file.",code:"missing_steps"},{json:r.json});let s=ir(e.connections,"--connections",r)??i.connections;s||g({message:"Missing connections. Provide --connections as a JSON array or use --file (empty array is valid for single-step automations).",code:"missing_connections"},{json:r.json}),Array.isArray(s)||g({message:"--connections must be a JSON array.",code:"invalid_json"},{json:r.json});let a=e.status??i.status;await re({loading:"Creating automation...",sdkCall:u=>u.automations.create({name:n,steps:o,connections:s,...a&&{status:a}}),onInteractive:u=>{console.log(`Automation created: ${u.id}`)}},r)});function lv(e){let t=e.map(r=>[r.name,Ic(r.status),r.created_at,r.id]);return z(["Name","Status","Created","ID"],t,"(no automations)")}function Ic(e){switch(e){case"enabled":return"\u2713 Enabled";case"disabled":return"\u25CB Disabled";default:return e}}var Dt={resource:"automation",resourcePlural:"automations",fetchItems:(e,{limit:t,after:r})=>e.automations.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};var cv=new p("delete").alias("rm").description("Delete an automation").argument("[id]","Automation ID").option("--yes","Skip confirmation prompt").addHelpText("after",h({context:"Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.",output:' {"object":"automation","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend automations delete <id> --yes","resend automations delete <id> --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Dt,i);await ue(n,!!t.yes,{confirmMessage:`Delete automation ${n}?
230
+ This cannot be undone.`,loading:"Deleting automation...",object:"automation",successMsg:"Automation deleted",sdkCall:o=>o.automations.remove(n)},i)});var dv=new p("get").description("Retrieve an automation with its steps and connections").argument("[id]","Automation ID").addHelpText("after",h({output:` Full automation object including steps and connections arrays.
241
231
 
242
- Automation status values: enabled | disabled`,errorCodes:["auth_error","fetch_error"],examples:["resend automations get <id>","resend automations get <id> --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Pt,i);await N({loading:"Fetching automation...",sdkCall:o=>o.automations.get(n),onInteractive:o=>{if(console.log(`${o.name} \u2014 ${Bc(o.status)}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`),o.updated_at&&console.log(`Updated: ${o.updated_at}`),o.steps.length>0){console.log(`
243
- Steps:`);let s=o.steps.map(a=>[a.key,a.type]);console.log(M(["Key","Type"],s,"(no steps)"))}if(o.connections.length>0){console.log(`
244
- Connections:`);let s=o.connections.map(a=>[a.from,a.to,a.type]);console.log(M(["From","To","Type"],s,"(no connections)"))}}},i)});je();function V(e,t){let r=parseInt(e,10);return(Number.isNaN(r)||r<1||r>100)&&v({message:"--limit must be an integer between 1 and 100",code:"invalid_limit"},{json:t.json}),r}function K(e,t,r,i){return t!==void 0&&r!==void 0&&v({message:"Cannot use --after and --before together. Pass only one cursor.",code:"invalid_pagination"},{json:i.json}),t?{limit:e,after:t}:r?{limit:e,before:r}:{limit:e}}function Y(e,t,r){if(!e.has_more||e.data.length===0)return;let i=!!r.before,n=i?e.data[0].id:e.data[e.data.length-1].id,o=i?"--before":"--after",s=r.limit?` --limit ${r.limit}`:"",a=r.apiKey?` --api-key ${tr(r.apiKey)}`:"",u=r.profile?` --profile ${r.profile}`:"";console.log(`
232
+ Automation status values: enabled | disabled`,errorCodes:["auth_error","fetch_error"],examples:["resend automations get <id>","resend automations get <id> --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Dt,i);await N({loading:"Fetching automation...",sdkCall:o=>o.automations.get(n),onInteractive:o=>{if(console.log(`${o.name} \u2014 ${Ic(o.status)}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`),o.updated_at&&console.log(`Updated: ${o.updated_at}`),o.steps.length>0){console.log(`
233
+ Steps:`);let s=o.steps.map(a=>[a.key,a.type]);console.log(z(["Key","Type"],s,"(no steps)"))}if(o.connections.length>0){console.log(`
234
+ Connections:`);let s=o.connections.map(a=>[a.from,a.to,a.type]);console.log(z(["From","To","Type"],s,"(no connections)"))}}},i)});De();function W(e,t){let r=parseInt(e,10);return(Number.isNaN(r)||r<1||r>100)&&g({message:"--limit must be an integer between 1 and 100",code:"invalid_limit"},{json:t.json}),r}function V(e,t,r,i){return t!==void 0&&r!==void 0&&g({message:"Cannot use --after and --before together. Pass only one cursor.",code:"invalid_pagination"},{json:i.json}),t!==void 0?{limit:e,after:t}:r!==void 0?{limit:e,before:r}:{limit:e}}function K(e,t,r){if(!e.has_more||e.data.length===0)return;let i=!!r.before,n=i?e.data[0].id:e.data[e.data.length-1].id,o=i?"--before":"--after",s=r.limit?` --limit ${r.limit}`:"",a=r.apiKey?` --api-key ${tr(r.apiKey)}`:"",u=r.profile?` --profile ${r.profile}`:"";console.log(`
245
235
  Fetch the next page:
246
- $ resend ${t} ${o} ${n}${s}${a}${u}`)}var xv=new p("list").alias("ls").description("List all automations").option("--limit <n>","Maximum number of automations to return (1-100)","10").option("--after <cursor>","Return automations after this cursor (next page)").option("--before <cursor>","Return automations before this cursor (previous page)").addHelpText("after",h({output:' {"object":"list","data":[...],"has_more":true}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend automations list","resend automations list --limit 25 --json","resend automations list --after <cursor> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching automations...",sdkCall:o=>o.automations.list(n),onInteractive:o=>{console.log(Cv(o.data)),Y(o,"automations list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var wv=new p("open").description("Open an automation or the automations list in the Resend dashboard").argument("[id]","Automation ID \u2014 omit to open the automations list").addHelpText("after",h({context:`Opens the Resend dashboard in your default browser.
236
+ $ resend ${t} ${o} ${n}${s}${a}${u}`)}var mv=new p("list").alias("ls").description("List all automations").option("--limit <n>","Maximum number of automations to return (1-100)","10").option("--after <cursor>","Return automations after this cursor (next page)").option("--before <cursor>","Return automations before this cursor (previous page)").addHelpText("after",h({output:' {"object":"list","data":[...],"has_more":true}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend automations list","resend automations list --limit 25 --json","resend automations list --after <cursor> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching automations...",sdkCall:o=>o.automations.list(n),onInteractive:o=>{console.log(lv(o.data)),K(o,"automations list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var pv=new p("open").description("Open an automation or the automations list in the Resend dashboard").argument("[id]","Automation ID \u2014 omit to open the automations list").addHelpText("after",h({context:`Opens the Resend dashboard in your default browser.
247
237
  With an ID: opens that automation's editor.
248
- Without an ID: opens the automations list.`,examples:["resend automations open","resend automations open 019d4ef1-8266-71d4-a1aa-60ce5d0eaea7"]})).action(async(e,t,r)=>{let i=e?Se.automation(e):Se.automations,n=r.optsWithGlobals();await Fe(i,n)});var kv=new p("get").description("Retrieve details of a specific automation run").option("--automation-id <id>","Automation ID").option("--run-id <id>","Run ID").addHelpText("after",h({output:" Full automation run object with status, trigger, and timestamps.",errorCodes:["auth_error","missing_automation_id","missing_run_id","fetch_error"],examples:["resend automations runs get --automation-id <id> --run-id <id>","resend automations runs get --automation-id <id> --run-id <id> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.automationId,{message:"Automation ID"},{message:"Missing --automation-id flag.",code:"missing_automation_id"},r),n=await U(e.runId,{message:"Run ID"},{message:"Missing --run-id flag.",code:"missing_run_id"},r);await N({loading:"Fetching automation run...",sdkCall:o=>o.automations.runs.get({automationId:i,runId:n}),onInteractive:o=>{console.log(`Run: ${o.id}`),console.log(`Status: ${o.status}`),o.started_at&&console.log(`Started: ${o.started_at}`),o.completed_at&&console.log(`Completed: ${o.completed_at}`),console.log(`Created: ${o.created_at}`)}},r)});var Av=new p("list").alias("ls").description("List runs for an automation").argument("[automation-id]","Automation ID").option("--limit <n>","Maximum number of runs to return (1-100)","10").option("--after <cursor>","Return runs after this cursor (next page)").option("--before <cursor>","Return runs before this cursor (previous page)").addHelpText("after",h({output:' {"object":"list","data":[...],"has_more":true}',errorCodes:["auth_error","missing_id","invalid_limit","list_error"],examples:["resend automations runs <automation-id>","resend automations runs list <automation-id>","resend automations runs list <automation-id> --limit 25 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Pt,i),o=V(t.limit,i),s=K(o,t.after,t.before,i);await q({loading:"Fetching automation runs...",sdkCall:a=>a.automations.runs.list({automationId:n,...s}),onInteractive:a=>{let u=a.data.map(l=>[l.id,l.status,l.started_at??"-",l.completed_at??"-"]);console.log(M(["ID","Status","Started","Completed"],u,"(no runs)")),Y(a,`automations runs list ${n}`,{limit:o,before:t.before,apiKey:i.apiKey,profile:i.profile})}},i)});var Ev=new p("runs").description("Manage automation runs").addHelpText("after",h({context:`Runs represent individual executions of an automation.
238
+ Without an ID: opens the automations list.`,examples:["resend automations open","resend automations open 019d4ef1-8266-71d4-a1aa-60ce5d0eaea7"]})).action(async(e,t,r)=>{let i=e?Oe.automation(e):Oe.automations,n=r.optsWithGlobals();await Je(i,n)});var fv=new p("get").description("Retrieve details of a specific automation run").option("--automation-id <id>","Automation ID").option("--run-id <id>","Run ID").addHelpText("after",h({output:" Full automation run object with status, trigger, and timestamps.",errorCodes:["auth_error","missing_automation_id","missing_run_id","fetch_error"],examples:["resend automations runs get --automation-id <id> --run-id <id>","resend automations runs get --automation-id <id> --run-id <id> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.automationId,{message:"Automation ID"},{message:"Missing --automation-id flag.",code:"missing_automation_id"},r),n=await U(e.runId,{message:"Run ID"},{message:"Missing --run-id flag.",code:"missing_run_id"},r);await N({loading:"Fetching automation run...",sdkCall:o=>o.automations.runs.get({automationId:i,runId:n}),onInteractive:o=>{console.log(`Run: ${o.id}`),console.log(`Status: ${o.status}`),o.started_at&&console.log(`Started: ${o.started_at}`),o.completed_at&&console.log(`Completed: ${o.completed_at}`),console.log(`Created: ${o.created_at}`)}},r)});var hv=new p("list").alias("ls").description("List runs for an automation").argument("[automation-id]","Automation ID").option("--limit <n>","Maximum number of runs to return (1-100)","10").option("--after <cursor>","Return runs after this cursor (next page)").option("--before <cursor>","Return runs before this cursor (previous page)").addHelpText("after",h({output:' {"object":"list","data":[...],"has_more":true}',errorCodes:["auth_error","missing_id","invalid_limit","list_error"],examples:["resend automations runs <automation-id>","resend automations runs list <automation-id>","resend automations runs list <automation-id> --limit 25 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Dt,i),o=W(t.limit,i),s=V(o,t.after,t.before,i);await R({loading:"Fetching automation runs...",sdkCall:a=>a.automations.runs.list({automationId:n,...s}),onInteractive:a=>{let u=a.data.map(l=>[l.id,l.status,l.started_at??"-",l.completed_at??"-"]);console.log(z(["ID","Status","Started","Completed"],u,"(no runs)")),K(a,`automations runs list ${n}`,{limit:o,before:t.before,apiKey:i.apiKey,profile:i.profile})}},i)});var gv=new p("runs").description("Manage automation runs").addHelpText("after",h({context:`Runs represent individual executions of an automation.
249
239
  Each run is triggered by an event and progresses through the automation's steps.
250
240
 
251
- Run status values: running | completed | failed | cancelled`,examples:["resend automations runs <automation-id>","resend automations runs list <automation-id> --limit 25","resend automations runs get --automation-id <id> --run-id <id>"]})).addCommand(Av,{isDefault:!0}).addCommand(kv);var Pv=new p("update").description("Update an automation status (enable or disable)").argument("[id]","Automation ID").addOption(new ce("--status <status>","New status").choices(["enabled","disabled"])).addHelpText("after",h({output:' {"object":"automation","id":"<id>","status":"<status>"}',errorCodes:["auth_error","missing_status","update_error"],examples:["resend automations update <id> --status enabled","resend automations update <id> --status disabled --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Pt,i),o=await xr(t.status,{message:"Status",options:[{value:"enabled",label:"Enabled"},{value:"disabled",label:"Disabled"}]},{message:"Missing --status flag.",code:"missing_status"},i);await F({loading:"Updating automation...",sdkCall:s=>s.automations.update(n,{status:o}),errorCode:"update_error",successMsg:`Automation updated: ${n} (${o})`},i)});var Tv=new p("automations").description("Manage automations").addHelpText("after",h({context:`Automations are event-driven workflows composed of steps and connections.
241
+ Run status values: running | completed | failed | cancelled`,examples:["resend automations runs <automation-id>","resend automations runs list <automation-id> --limit 25","resend automations runs get --automation-id <id> --run-id <id>"]})).addCommand(hv,{isDefault:!0}).addCommand(fv);var bv=new p("update").description("Update an automation status (enable or disable)").argument("[id]","Automation ID").addOption(new ce("--status <status>","New status").choices(["enabled","disabled"])).addHelpText("after",h({output:' {"object":"automation","id":"<id>","status":"<status>"}',errorCodes:["auth_error","missing_status","update_error"],examples:["resend automations update <id> --status enabled","resend automations update <id> --status disabled --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Dt,i),o=await wr(t.status,{message:"Status",options:[{value:"enabled",label:"Enabled"},{value:"disabled",label:"Disabled"}]},{message:"Missing --status flag.",code:"missing_status"},i);await B({loading:"Updating automation...",sdkCall:s=>s.automations.update(n,{status:o}),errorCode:"update_error",successMsg:`Automation updated: ${n} (${o})`},i)});var vv=new p("automations").description("Manage automations").addHelpText("after",h({context:`Automations are event-driven workflows composed of steps and connections.
252
242
 
253
243
  Steps define the actions (trigger, delay, send_email, wait_for_event, condition).
254
244
  Connections define the flow between steps (default, condition_met, condition_not_met, timeout, event_received).
@@ -257,10 +247,10 @@ Lifecycle:
257
247
  1. resend automations create --name "Welcome" --file workflow.json
258
248
  2. resend automations update <id> --status enabled
259
249
  3. resend automations runs <id> (inspect runs)
260
- 4. resend automations open <id> (view in dashboard)`,examples:["resend automations list",'resend automations create --name "Welcome Flow" --file workflow.json',"resend automations get <id>","resend automations update <id> --status enabled","resend automations delete <id> --yes","resend automations runs <automation-id>","resend automations runs get --automation-id <id> --run-id <id>","resend automations open <id>"]})).addCommand(yv).addCommand(Sv).addCommand(xv,{isDefault:!0}).addCommand(Pv).addCommand(Ov).addCommand(wv).addCommand(Ev);async function Xa(e){try{let{data:t,error:r}=await e.domains.list();return r||!t?[]:t.data.filter(i=>i.status==="verified"&&i.capabilities.sending==="enabled").map(i=>i.name)}catch{return[]}}var tw=["noreply","hello"];async function eu(e){let t;if(e.length===1)t=e[0];else{let n=await pe({message:"Select a verified domain",options:e.map(o=>({value:o,label:o}))});j(n)&&D("Send cancelled."),t=n}let r=tw.map(n=>({value:`${n}@${t}`,label:`${n}@${t}`}));r.push({value:null,label:"Custom address..."});let i=await pe({message:`From address (@${t})`,options:r});if(j(i)&&D("Send cancelled."),i===null){let n=await te({message:"From address",placeholder:`e.g. you@${t}`,validate:o=>!o||!o.includes("@")?"Enter a valid email address":void 0});return j(n)&&D("Send cancelled."),n}return i}var kr=require("node:fs"),Hv=require("node:path");var tu=require("node:fs"),qv=require("node:os"),wr=le(require("node:path"),1),Rv=require("esbuild");var Iv=require("node:fs"),Dv=le(require("node:path"),1);function jv(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var $v=e=>({name:"rendering-utilities-exporter",setup:t=>{t.onLoad({filter:new RegExp(e.map(r=>jv(r)).join("|"))},async({path:r})=>({contents:`${await Iv.promises.readFile(r,"utf8")};
250
+ 4. resend automations open <id> (view in dashboard)`,examples:["resend automations list",'resend automations create --name "Welcome Flow" --file workflow.json',"resend automations get <id>","resend automations update <id> --status enabled","resend automations delete <id> --yes","resend automations runs <automation-id>","resend automations runs get --automation-id <id> --run-id <id>","resend automations open <id>"]})).addCommand(uv).addCommand(dv).addCommand(mv,{isDefault:!0}).addCommand(bv).addCommand(cv).addCommand(pv).addCommand(gv);async function Ka(e){try{let{data:t,error:r}=await e.domains.list();return r||!t?[]:t.data.filter(i=>i.status==="verified"&&i.capabilities.sending==="enabled").map(i=>i.name)}catch{return[]}}var Ex=["noreply","hello"];async function Ya(e){let t;if(e.length===1)t=e[0];else{let n=await pe({message:"Select a verified domain",options:e.map(o=>({value:o,label:o}))});P(n)&&T("Send cancelled."),t=n}let r=Ex.map(n=>({value:`${n}@${t}`,label:`${n}@${t}`}));r.push({value:null,label:"Custom address..."});let i=await pe({message:`From address (@${t})`,options:r});if(P(i)&&T("Send cancelled."),i===null){let n=await te({message:"From address",placeholder:`e.g. you@${t}`,validate:o=>!o||!o.includes("@")?"Enter a valid email address":void 0});return P(n)&&T("Send cancelled."),n}return i}var Ar=require("node:fs"),Ev=require("node:path");var Qa=require("node:fs"),Sv=require("node:os"),kr=le(require("node:path"),1),xv=require("esbuild");var yv=require("node:fs"),Cv=le(require("node:path"),1);function _v(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Ov=e=>({name:"rendering-utilities-exporter",setup:t=>{t.onLoad({filter:new RegExp(e.map(r=>_v(r)).join("|"))},async({path:r})=>({contents:`${await yv.promises.readFile(r,"utf8")};
261
251
  export { render } from 'react-email-module-that-will-export-render'
262
252
  export { createElement as reactEmailCreateReactElement } from 'react';
263
- `,loader:Dv.default.extname(r).slice(1)})),t.onResolve({filter:/^react-email-module-that-will-export-render$/},async r=>{let i={kind:"import-statement",importer:r.importer,resolveDir:r.resolveDir,namespace:r.namespace},n=await t.resolve("@react-email/render",i);return n.errors.length===0||(n=await t.resolve("@react-email/components",i),n.errors.length>0&&n.errors[0]&&(n.errors[0].text="Failed trying to import `render` from either `@react-email/render` or `@react-email/components` to be able to render your email template.\n Maybe you don't have either of them installed?")),n})}});async function zv(e){let t=wr.default.resolve(e),r=(0,tu.mkdtempSync)(wr.default.join((0,qv.tmpdir)(),"resend-react-email-"));try{await(0,Rv.build)({bundle:!0,entryPoints:[t],format:"cjs",jsx:"automatic",logLevel:"silent",outExtension:{".js":".cjs"},outdir:r,platform:"node",plugins:[$v([t])],write:!0})}catch(o){throw(0,tu.rmSync)(r,{recursive:!0,force:!0}),o}let i=wr.default.basename(t,wr.default.extname(t));return{cjsPath:wr.default.join(r,`${i}.cjs`),tmpDir:r}}var Mv=require("node:module");async function Jv(e){let t=(0,Mv.createRequire)(e);delete t.cache[e];let r=t(e);return r.render(r.reactEmailCreateReactElement(r.default,{}),{})}var Nc=e=>{e&&(0,kr.rmSync)(e,{recursive:!0,force:!0})},et=async(e,t)=>{if(e.trim()==="")return v({message:"--react-email path cannot be empty",code:"react_email_build_error"},{json:t.json});if("pkg"in process)return v({message:"--react-email requires a Node.js install (npm i -g resend-cli or npx resend-cli)",code:"react_email_build_error"},{json:t.json});let r=(0,Hv.resolve)(e);if(!(0,kr.existsSync)(r))return v({message:`File not found: ${e}`,code:"react_email_build_error"},{json:t.json});if(!(0,kr.statSync)(r).isFile())return v({message:`--react-email path must be a file, got a directory: ${e}`,code:"react_email_build_error"},{json:t.json});let i=he("Bundling React Email template...",t.quiet),n;try{let o=await zv(e);n=o.tmpDir,i.stop("Bundled React Email template");let s=he("Rendering React Email template...",t.quiet);try{let a=await Jv(o.cjsPath);return s.stop("Rendered React Email template"),Nc(n),a}catch(a){return s.fail("Failed to render React Email template"),Nc(n),v({message:Q(a,"Failed to render React Email template"),code:"react_email_render_error"},{json:t.json})}}catch(o){return i.fail("Failed to bundle React Email template"),Nc(n),v({message:Q(o,"Failed to bundle React Email template"),code:"react_email_build_error"},{json:t.json})}};ee();var ut={resource:"segment",resourcePlural:"segments",fetchItems:(e,{limit:t,after:r})=>e.segments.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};function ru(e){let t=e.map(r=>[r.name,r.id,r.created_at]);return M(["Name","ID","Created"],t,"(no segments)")}var Tt={resource:"topic",resourcePlural:"topics",fetchItems:e=>e.topics.list().then(t=>({...t,data:t.data?{data:t.data.data,has_more:!1}:null})),display:e=>({label:e.name,hint:e.id})};function Fv(e){let t=e.map(r=>[r.name,r.description??"",r.id,r.created_at]);return M(["Name","Description","ID","Created"],t,"(no topics)")}var Bv=new p("create").description("Create a broadcast draft (or send immediately with --send)").option("--from <address>","Sender address \u2014 required").option("--subject <subject>","Email subject \u2014 required").option("--segment-id <id>","Target segment ID \u2014 required").option("--html <html>","HTML body (supports {{{FIRST_NAME|fallback}}} triple-brace variable interpolation)").option("--html-file <path>",'Path to an HTML file for the body (use "-" for stdin, supports {{{FIRST_NAME|fallback}}} variable interpolation)').option("--text <text>","Plain-text body").option("--text-file <path>",'Path to a plain-text file for the body (use "-" for stdin)').option("--react-email <path>","Path to a React Email template (.tsx) to bundle, render, and use as HTML body (npm install only)").option("--name <name>","Internal label for the broadcast (optional)").option("--reply-to <address>","Reply-to address (optional)").option("--preview-text <text>","Preview text shown in inbox below the subject line (optional)").option("--topic-id <id>","Associate with a topic for subscription filtering (optional)").option("--send","Send immediately on create instead of saving as draft").option("--scheduled-at <datetime>",'Schedule delivery \u2014 ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET" (only valid with --send)').option("--dry-run","Validate input and print the create request JSON without calling the API (interactive: type segment/topic IDs; lists are not fetched)").addHelpText("after",h({context:`Non-interactive: --from, --subject, and --segment-id are required.
253
+ `,loader:Cv.default.extname(r).slice(1)})),t.onResolve({filter:/^react-email-module-that-will-export-render$/},async r=>{let i={kind:"import-statement",importer:r.importer,resolveDir:r.resolveDir,namespace:r.namespace},n=await t.resolve("@react-email/render",i);return n.errors.length===0||(n=await t.resolve("@react-email/components",i),n.errors.length>0&&n.errors[0]&&(n.errors[0].text="Failed trying to import `render` from either `@react-email/render` or `@react-email/components` to be able to render your email template.\n Maybe you don't have either of them installed?")),n})}});async function wv(e){let t=kr.default.resolve(e),r=(0,Qa.mkdtempSync)(kr.default.join((0,Sv.tmpdir)(),"resend-react-email-"));try{await(0,xv.build)({bundle:!0,entryPoints:[t],format:"cjs",jsx:"automatic",logLevel:"silent",outExtension:{".js":".cjs"},outdir:r,platform:"node",plugins:[Ov([t])],write:!0})}catch(o){throw(0,Qa.rmSync)(r,{recursive:!0,force:!0}),o}let i=kr.default.basename(t,kr.default.extname(t));return{cjsPath:kr.default.join(r,`${i}.cjs`),tmpDir:r}}var kv=require("node:module");async function Av(e){let t=(0,kv.createRequire)(e);delete t.cache[e];let r=t(e);return r.render(r.reactEmailCreateReactElement(r.default,{}),{})}var jc=e=>{e&&(0,Ar.rmSync)(e,{recursive:!0,force:!0})},et=async(e,t)=>{if(e.trim()==="")return g({message:"--react-email path cannot be empty",code:"react_email_build_error"},{json:t.json});if("pkg"in process)return g({message:"--react-email requires a Node.js install (npm i -g resend-cli or npx resend-cli)",code:"react_email_build_error"},{json:t.json});let r=(0,Ev.resolve)(e);if(!(0,Ar.existsSync)(r))return g({message:`File not found: ${e}`,code:"react_email_build_error"},{json:t.json});if(!(0,Ar.statSync)(r).isFile())return g({message:`--react-email path must be a file, got a directory: ${e}`,code:"react_email_build_error"},{json:t.json});let i=he("Bundling React Email template...",t.quiet),n;try{let o=await wv(e);n=o.tmpDir,i.stop("Bundled React Email template");let s=he("Rendering React Email template...",t.quiet);try{let a=await Av(o.cjsPath);return s.stop("Rendered React Email template"),jc(n),a}catch(a){return s.fail("Failed to render React Email template"),jc(n),g({message:Y(a,"Failed to render React Email template"),code:"react_email_render_error"},{json:t.json})}}catch(o){return i.fail("Failed to bundle React Email template"),jc(n),g({message:Y(o,"Failed to bundle React Email template"),code:"react_email_build_error"},{json:t.json})}};ee();var lt={resource:"segment",resourcePlural:"segments",fetchItems:(e,{limit:t,after:r})=>e.segments.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};function Za(e){let t=e.map(r=>[r.name,r.id,r.created_at]);return z(["Name","ID","Created"],t,"(no segments)")}var It={resource:"topic",resourcePlural:"topics",fetchItems:e=>e.topics.list().then(t=>({...t,data:t.data?{data:t.data.data,has_more:!1}:null})),display:e=>({label:e.name,hint:e.id})};function Pv(e){let t=e.map(r=>[r.name,r.description??"",r.id,r.created_at]);return z(["Name","Description","ID","Created"],t,"(no topics)")}var Tv=new p("create").description("Create a broadcast draft (or send immediately with --send)").option("--from <address>","Sender address \u2014 required").option("--subject <subject>","Email subject \u2014 required").option("--segment-id <id>","Target segment ID \u2014 required").option("--html <html>","HTML body (supports {{{FIRST_NAME|fallback}}} triple-brace variable interpolation)").option("--html-file <path>",'Path to an HTML file for the body (use "-" for stdin, supports {{{FIRST_NAME|fallback}}} variable interpolation)').option("--text <text>","Plain-text body").option("--text-file <path>",'Path to a plain-text file for the body (use "-" for stdin)').option("--react-email <path>","Path to a React Email template (.tsx) to bundle, render, and use as HTML body (npm install only)").option("--name <name>","Internal label for the broadcast (optional)").option("--reply-to <address>","Reply-to address (optional)").option("--preview-text <text>","Preview text shown in inbox below the subject line (optional)").option("--topic-id <id>","Associate with a topic for subscription filtering (optional)").option("--send","Send immediately on create instead of saving as draft").option("--scheduled-at <datetime>",'Schedule delivery \u2014 ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET" (only valid with --send)').option("--dry-run","Validate input and print the create request JSON without calling the API (interactive: type segment/topic IDs; lists are not fetched)").addHelpText("after",h({context:`Non-interactive: --from, --subject, and --segment-id are required.
264
254
  Body: provide at least one of --html, --html-file, --text, --text-file, or --react-email.
265
255
 
266
256
  Use --dry-run to print the request JSON without creating a broadcast.
@@ -272,25 +262,25 @@ Variable interpolation:
272
262
  Scheduling:
273
263
  Use --scheduled-at with --send to schedule delivery.
274
264
  Accepts ISO 8601 (e.g. 2026-08-05T11:52:01Z) or natural language (e.g. "in 1 hour").
275
- --scheduled-at without --send is ignored.`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","missing_from","missing_subject","missing_segment","missing_body","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","create_error"],examples:['resend broadcasts create --from onboarding@resend.com --subject "Weekly Update" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hello {{{FIRST_NAME|there}}}</p>"','resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html-file ./email.html --send','resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --text "Hello!" --send --scheduled-at "tomorrow at 9am ET"']})).action(async(e,t)=>{let r=t.optsWithGlobals();e.htmlFile==="-"&&e.textFile==="-"&&v({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:r.json}),e.reactEmail&&(e.html||e.htmlFile)&&v({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:r.json}),e.html!==void 0&&e.htmlFile!==void 0&&v({message:"--html and --html-file are mutually exclusive.",code:"invalid_options"},{json:r.json}),e.text!==void 0&&e.textFile!==void 0&&v({message:"--text and --text-file are mutually exclusive.",code:"invalid_options"},{json:r.json});let i=e.from,n=e.subject,o=e.segmentId;if(!i&&k()&&!r.json&&!e.dryRun){let d=await oe(r),c=await Xa(d);c.length>0&&(i=await eu(c))}if(!i){(!k()||r.json)&&v({message:"Missing --from flag.",code:"missing_from"},{json:r.json});let d=await te({message:"From address",placeholder:"e.g. onboarding@resend.com",validate:c=>c?void 0:"Required"});j(d)&&D("Cancelled."),i=d}if(!n){(!k()||r.json)&&v({message:"Missing --subject flag.",code:"missing_subject"},{json:r.json});let d=await te({message:"Subject",placeholder:"e.g. Weekly Newsletter",validate:c=>c?void 0:"Required"});j(d)&&D("Cancelled."),n=d}if(!o)if((!k()||r.json)&&v({message:"Missing --segment-id flag.",code:"missing_segment"},{json:r.json}),e.dryRun){let d=await te({message:"Segment ID",placeholder:"e.g. 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d",validate:c=>c?void 0:"Required"});j(d)&&D("Cancelled."),o=d}else o=await C(void 0,ut,r);let s=e.reactEmail?await et(e.reactEmail,r):e.htmlFile?ge(e.htmlFile,r):e.html,a=e.textFile?ge(e.textFile,r):e.text;if(!s&&!a){(!k()||r.json)&&v({message:"Missing body. Provide --html, --html-file, --text, --text-file, or --react-email.",code:"missing_body"},{json:r.json});let d=await te({message:"Body (plain text)",placeholder:"e.g. Hello {{{FIRST_NAME|there}}}!",validate:c=>c?void 0:"Required"});j(d)&&D("Cancelled."),a=d}let u=e.topicId;if(!u&&k()&&!r.json)if(e.dryRun){let d=await te({message:"Topic ID (optional)",placeholder:"Press Enter to skip"});j(d)&&D("Cancelled."),u=d.trim()||void 0}else u=await C(void 0,Tt,r,{optional:!0});let l={from:i,subject:n,segmentId:o,...s&&{html:s},...a&&{text:a},...e.name&&{name:e.name},...e.replyTo&&{replyTo:e.replyTo},...e.previewText&&{previewText:e.previewText},...u&&{topicId:u},...e.send&&{send:!0},...e.send&&e.scheduledAt&&{scheduledAt:e.scheduledAt}};if(e.dryRun){z({dryRun:!0,request:l},{json:r.json});return}await re({loading:"Creating broadcast...",sdkCall:d=>d.broadcasts.create(l),onInteractive:d=>{e.send?e.scheduledAt?console.log(`Broadcast scheduled: ${d.id}`):console.log(`Broadcast sent: ${d.id}`):(console.log(`Broadcast created: ${d.id}`),console.log("Status: draft"),console.log(`Send it with: resend broadcasts send ${d.id}`))}},r)});function Lc(e){switch(e){case"draft":return"\u25CB Draft";case"queued":return"\u23F3 Queued";case"sent":return"\u2713 Sent";default:return e}}var Ar={resource:"broadcast",resourcePlural:"broadcasts",fetchItems:(e,{limit:t,after:r})=>e.broadcasts.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name??"(untitled)",hint:e.id})},Nv={resource:"broadcast",resourcePlural:"broadcasts",fetchItems:(e,{limit:t,after:r})=>e.broadcasts.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name??"(untitled)",hint:`${Lc(e.status)} ${e.id}`}),filter:e=>e.status==="draft"};function Lv(e){let t=e.map(r=>[r.name??"(untitled)",r.status,r.created_at,r.id]);return M(["Name","Status","Created","ID"],t,"(no broadcasts)")}var Gv=new p("delete").alias("rm").description("Delete a broadcast \u2014 draft broadcasts are removed; scheduled broadcasts are cancelled before delivery").argument("[id]","Broadcast ID").option("--yes","Skip confirmation prompt").addHelpText("after",h({context:`Warning: Deleting a scheduled broadcast cancels its delivery immediately.
265
+ --scheduled-at without --send is ignored.`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","missing_from","missing_subject","missing_segment","missing_body","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","create_error"],examples:['resend broadcasts create --from onboarding@resend.com --subject "Weekly Update" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hello {{{FIRST_NAME|there}}}</p>"','resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html-file ./email.html --send','resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --text "Hello!" --send --scheduled-at "tomorrow at 9am ET"']})).action(async(e,t)=>{let r=t.optsWithGlobals();e.htmlFile==="-"&&e.textFile==="-"&&g({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:r.json}),e.reactEmail&&(e.html||e.htmlFile)&&g({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:r.json}),e.html!==void 0&&e.htmlFile!==void 0&&g({message:"--html and --html-file are mutually exclusive.",code:"invalid_options"},{json:r.json}),e.text!==void 0&&e.textFile!==void 0&&g({message:"--text and --text-file are mutually exclusive.",code:"invalid_options"},{json:r.json});let i=e.from,n=e.subject,o=e.segmentId;if(!i&&O()&&!r.json&&!e.dryRun){let c=await oe(r),d=await Ka(c);d.length>0&&(i=await Ya(d))}if(!i){(!O()||r.json)&&g({message:"Missing --from flag.",code:"missing_from"},{json:r.json});let c=await te({message:"From address",placeholder:"e.g. onboarding@resend.com",validate:d=>d?void 0:"Required"});P(c)&&T("Cancelled."),i=c}if(!n){(!O()||r.json)&&g({message:"Missing --subject flag.",code:"missing_subject"},{json:r.json});let c=await te({message:"Subject",placeholder:"e.g. Weekly Newsletter",validate:d=>d?void 0:"Required"});P(c)&&T("Cancelled."),n=c}if(!o)if((!O()||r.json)&&g({message:"Missing --segment-id flag.",code:"missing_segment"},{json:r.json}),e.dryRun){let c=await te({message:"Segment ID",placeholder:"e.g. 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d",validate:d=>d?void 0:"Required"});P(c)&&T("Cancelled."),o=c}else o=await C(void 0,lt,r);let s=e.reactEmail?await et(e.reactEmail,r):e.htmlFile?ge(e.htmlFile,r):e.html,a=e.textFile?ge(e.textFile,r):e.text;if(!s&&!a){(!O()||r.json)&&g({message:"Missing body. Provide --html, --html-file, --text, --text-file, or --react-email.",code:"missing_body"},{json:r.json});let c=await te({message:"Body (plain text)",placeholder:"e.g. Hello {{{FIRST_NAME|there}}}!",validate:d=>d?void 0:"Required"});P(c)&&T("Cancelled."),a=c}let u=e.topicId;if(!u&&O()&&!r.json)if(e.dryRun){let c=await te({message:"Topic ID (optional)",placeholder:"Press Enter to skip"});P(c)&&T("Cancelled."),u=c.trim()||void 0}else u=await C(void 0,It,r,{optional:!0});let l={from:i,subject:n,segmentId:o,...s&&{html:s},...a&&{text:a},...e.name&&{name:e.name},...e.replyTo&&{replyTo:e.replyTo},...e.previewText&&{previewText:e.previewText},...u&&{topicId:u},...e.send&&{send:!0},...e.send&&e.scheduledAt&&{scheduledAt:e.scheduledAt}};if(e.dryRun){F({dryRun:!0,request:l},{json:r.json});return}await re({loading:"Creating broadcast...",sdkCall:c=>c.broadcasts.create(l),onInteractive:c=>{e.send?e.scheduledAt?console.log(`Broadcast scheduled: ${c.id}`):console.log(`Broadcast sent: ${c.id}`):(console.log(`Broadcast created: ${c.id}`),console.log("Status: draft"),console.log(`Send it with: resend broadcasts send ${c.id}`))}},r)});function $c(e){switch(e){case"draft":return"\u25CB Draft";case"queued":return"\u23F3 Queued";case"sent":return"\u2713 Sent";default:return e}}var Er={resource:"broadcast",resourcePlural:"broadcasts",fetchItems:(e,{limit:t,after:r})=>e.broadcasts.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name??"(untitled)",hint:e.id})},Dv={resource:"broadcast",resourcePlural:"broadcasts",fetchItems:(e,{limit:t,after:r})=>e.broadcasts.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name??"(untitled)",hint:`${$c(e.status)} ${e.id}`}),filter:e=>e.status==="draft"};function Iv(e){let t=e.map(r=>[r.name??"(untitled)",r.status,r.created_at,r.id]);return z(["Name","Status","Created","ID"],t,"(no broadcasts)")}var jv=new p("delete").alias("rm").description("Delete a broadcast \u2014 draft broadcasts are removed; scheduled broadcasts are cancelled before delivery").argument("[id]","Broadcast ID").option("--yes","Skip confirmation prompt").addHelpText("after",h({context:`Warning: Deleting a scheduled broadcast cancels its delivery immediately.
276
266
  Only draft and scheduled broadcasts can be deleted; sent broadcasts cannot.
277
267
 
278
- Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"broadcast","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes","resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ar,i);await ue(n,!!t.yes,{confirmMessage:`Delete broadcast ${n}?
279
- If scheduled, delivery will be cancelled.`,loading:"Deleting broadcast...",object:"broadcast",successMsg:"Broadcast deleted",sdkCall:o=>o.broadcasts.remove(n)},i)});var Uv=new p("get").description("Retrieve full details for a broadcast including HTML body, status, and delivery times").argument("[id]","Broadcast ID").addHelpText("after",h({context:`Note: The list command returns summary objects without html/text/from/subject.
280
- Use this command to retrieve the full broadcast payload.`,output:' {"id":"...","object":"broadcast","name":"...","segment_id":"...","from":"...","subject":"...","status":"draft|queued|sent","created_at":"...","scheduled_at":null,"sent_at":null}',errorCodes:["auth_error","fetch_error"],examples:["resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6","resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ar,i);await N({loading:"Fetching broadcast...",sdkCall:o=>o.broadcasts.get(n),onInteractive:o=>{console.log(`Broadcast: ${o.id}`),console.log(` Status: ${Lc(o.status)}`),console.log(` Name: ${o.name??"(untitled)"}`),console.log(` From: ${o.from??"\u2014"}`),console.log(` Subject: ${o.subject??"\u2014"}`),console.log(` Segment: ${o.segment_id??"\u2014"}`),o.preview_text&&console.log(` Preview: ${o.preview_text}`),o.topic_id&&console.log(` Topic: ${o.topic_id}`),console.log(` Created: ${o.created_at}`),o.scheduled_at&&console.log(` Scheduled: ${o.scheduled_at}`),o.sent_at&&console.log(` Sent: ${o.sent_at}`)}},i)});var Wv=new p("list").alias("ls").description('List broadcasts \u2014 returns summary objects (use "get <id>" for full details including html/text)').option("--limit <n>","Maximum number of results to return (1-100)","10").option("--after <cursor>","Cursor for forward pagination \u2014 list items after this ID").option("--before <cursor>","Cursor for backward pagination \u2014 list items before this ID").addHelpText("after",h({context:`Note: List results include name, status, created_at, and id only.
281
- To retrieve full details (html, from, subject), use: resend broadcasts get <id>`,output:' {"object":"list","has_more":false,"data":[{"id":"...","name":"...","status":"draft|queued|sent","created_at":"..."}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend broadcasts list","resend broadcasts list --limit 5","resend broadcasts list --after d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --limit 10","resend broadcasts list --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching broadcasts...",sdkCall:o=>o.broadcasts.list(n),onInteractive:o=>{console.log(Lv(o.data)),Y(o,"broadcasts list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Vv=new p("open").description("Open a broadcast or the broadcasts list in the Resend dashboard").argument("[id]","Broadcast ID \u2014 omit to open the broadcasts list").addHelpText("after",h({context:`Opens the Resend dashboard in your default browser.
268
+ Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"broadcast","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes","resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Er,i);await ue(n,!!t.yes,{confirmMessage:`Delete broadcast ${n}?
269
+ If scheduled, delivery will be cancelled.`,loading:"Deleting broadcast...",object:"broadcast",successMsg:"Broadcast deleted",sdkCall:o=>o.broadcasts.remove(n)},i)});var $v=new p("get").description("Retrieve full details for a broadcast including HTML body, status, and delivery times").argument("[id]","Broadcast ID").addHelpText("after",h({context:`Note: The list command returns summary objects without html/text/from/subject.
270
+ Use this command to retrieve the full broadcast payload.`,output:' {"id":"...","object":"broadcast","name":"...","segment_id":"...","from":"...","subject":"...","status":"draft|queued|sent","created_at":"...","scheduled_at":null,"sent_at":null}',errorCodes:["auth_error","fetch_error"],examples:["resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6","resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Er,i);await N({loading:"Fetching broadcast...",sdkCall:o=>o.broadcasts.get(n),onInteractive:o=>{console.log(`Broadcast: ${o.id}`),console.log(` Status: ${$c(o.status)}`),console.log(` Name: ${o.name??"(untitled)"}`),console.log(` From: ${o.from??"\u2014"}`),console.log(` Subject: ${o.subject??"\u2014"}`),console.log(` Segment: ${o.segment_id??"\u2014"}`),o.preview_text&&console.log(` Preview: ${o.preview_text}`),o.topic_id&&console.log(` Topic: ${o.topic_id}`),console.log(` Created: ${o.created_at}`),o.scheduled_at&&console.log(` Scheduled: ${o.scheduled_at}`),o.sent_at&&console.log(` Sent: ${o.sent_at}`)}},i)});var qv=new p("list").alias("ls").description('List broadcasts \u2014 returns summary objects (use "get <id>" for full details including html/text)').option("--limit <n>","Maximum number of results to return (1-100)","10").option("--after <cursor>","Cursor for forward pagination \u2014 list items after this ID").option("--before <cursor>","Cursor for backward pagination \u2014 list items before this ID").addHelpText("after",h({context:`Note: List results include name, status, created_at, and id only.
271
+ To retrieve full details (html, from, subject), use: resend broadcasts get <id>`,output:' {"object":"list","has_more":false,"data":[{"id":"...","name":"...","status":"draft|queued|sent","created_at":"..."}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend broadcasts list","resend broadcasts list --limit 5","resend broadcasts list --after d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --limit 10","resend broadcasts list --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching broadcasts...",sdkCall:o=>o.broadcasts.list(n),onInteractive:o=>{console.log(Iv(o.data)),K(o,"broadcasts list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Rv=new p("open").description("Open a broadcast or the broadcasts list in the Resend dashboard").argument("[id]","Broadcast ID \u2014 omit to open the broadcasts list").addHelpText("after",h({context:`Opens the Resend dashboard in your default browser.
282
272
  With an ID: opens that broadcast's page for viewing or editing.
283
- Without an ID: opens the broadcasts list.`,examples:["resend broadcasts open","resend broadcasts open d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6"]})).action(async(e,t,r)=>{let i=e?Se.broadcast(e):Se.broadcasts,n=r.optsWithGlobals();await Fe(i,n)});var Kv=new p("send").description("Send a draft broadcast (API-created drafts only \u2014 dashboard broadcasts cannot be sent via API)").argument("[id]","Broadcast ID").option("--scheduled-at <datetime>",'Schedule delivery \u2014 ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET"').addHelpText("after",h({context:`Note: Only broadcasts created via the API can be sent via this command.
273
+ Without an ID: opens the broadcasts list.`,examples:["resend broadcasts open","resend broadcasts open d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6"]})).action(async(e,t,r)=>{let i=e?Oe.broadcast(e):Oe.broadcasts,n=r.optsWithGlobals();await Je(i,n)});var Fv=new p("send").description("Send a draft broadcast (API-created drafts only \u2014 dashboard broadcasts cannot be sent via API)").argument("[id]","Broadcast ID").option("--scheduled-at <datetime>",'Schedule delivery \u2014 ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET"').addHelpText("after",h({context:`Note: Only broadcasts created via the API can be sent via this command.
284
274
  Broadcasts created in the Resend dashboard cannot be sent programmatically.
285
275
 
286
276
  Scheduling:
287
277
  --scheduled-at accepts ISO 8601 (e.g. 2026-08-05T11:52:01Z) or
288
- natural language (e.g. "in 1 hour", "tomorrow at 9am ET").`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","send_error"],examples:["resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "in 1 hour"','resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "2026-08-05T11:52:01Z" --json']})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Nv,i);await F({loading:t.scheduledAt?"Scheduling broadcast...":"Sending broadcast...",sdkCall:o=>o.broadcasts.send(n,{...t.scheduledAt&&{scheduledAt:t.scheduledAt}}),errorCode:"send_error",successMsg:t.scheduledAt?"Broadcast scheduled":"Broadcast sent",permission:"sending_access"},i)});var Yv=new p("update").description("Update a draft broadcast \u2014 only drafts can be updated; sent broadcasts are immutable").argument("[id]","Broadcast ID").option("--from <address>","Update sender address").option("--subject <subject>","Update subject").option("--html <html>","Update HTML body (supports {{{FIRST_NAME|fallback}}} variable interpolation)").option("--html-file <path>",'Path to an HTML file to replace the body (use "-" for stdin, supports {{{FIRST_NAME|fallback}}} variable interpolation)').option("--text <text>","Update plain-text body").option("--text-file <path>",'Path to a plain-text file to replace the body (use "-" for stdin)').option("--react-email <path>","Path to a React Email template (.tsx) to bundle, render, and use as HTML body (npm install only)").option("--name <name>","Update internal label").addHelpText("after",h({context:`Note: Only draft broadcasts can be updated.
278
+ natural language (e.g. "in 1 hour", "tomorrow at 9am ET").`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","send_error"],examples:["resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "in 1 hour"','resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "2026-08-05T11:52:01Z" --json']})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Dv,i);await B({loading:t.scheduledAt?"Scheduling broadcast...":"Sending broadcast...",sdkCall:o=>o.broadcasts.send(n,{...t.scheduledAt&&{scheduledAt:t.scheduledAt}}),errorCode:"send_error",successMsg:t.scheduledAt?"Broadcast scheduled":"Broadcast sent",permission:"sending_access"},i)});var zv=new p("update").description("Update a draft broadcast \u2014 only drafts can be updated; sent broadcasts are immutable").argument("[id]","Broadcast ID").option("--from <address>","Update sender address").option("--subject <subject>","Update subject").option("--html <html>","Update HTML body (supports {{{FIRST_NAME|fallback}}} variable interpolation)").option("--html-file <path>",'Path to an HTML file to replace the body (use "-" for stdin, supports {{{FIRST_NAME|fallback}}} variable interpolation)').option("--text <text>","Update plain-text body").option("--text-file <path>",'Path to a plain-text file to replace the body (use "-" for stdin)').option("--react-email <path>","Path to a React Email template (.tsx) to bundle, render, and use as HTML body (npm install only)").option("--name <name>","Update internal label").addHelpText("after",h({context:`Note: Only draft broadcasts can be updated.
289
279
  If the broadcast is already sent or sending, the API will return an error.
290
280
 
291
281
  Variable interpolation:
292
282
  HTML bodies support triple-brace syntax for contact properties.
293
- Example: {{{FIRST_NAME|Friend}}} \u2014 uses FIRST_NAME or falls back to "Friend".`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","no_changes","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","update_error"],examples:['resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --subject "Updated Subject"',"resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --html-file ./new-email.html",'resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --name "Q1 Newsletter" --from "onboarding@resend.com" --json','echo "<p>New content</p>" | resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --html-file -']})).action(async(e,t,r)=>{let i=r.optsWithGlobals();t.from==null&&t.subject==null&&t.html==null&&t.htmlFile==null&&t.text==null&&t.textFile==null&&t.reactEmail==null&&t.name==null&&v({message:"Provide at least one option to update: --from, --subject, --html, --html-file, --text, --text-file, --react-email, or --name.",code:"no_changes"},{json:i.json}),t.htmlFile==="-"&&t.textFile==="-"&&v({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:i.json}),t.reactEmail!=null&&(t.html!=null||t.htmlFile!=null)&&v({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:i.json}),t.html!=null&&t.htmlFile!=null&&v({message:"--html and --html-file are mutually exclusive.",code:"invalid_options"},{json:i.json}),t.text!=null&&t.textFile!=null&&v({message:"--text and --text-file are mutually exclusive.",code:"invalid_options"},{json:i.json});let n=await C(e,Ar,i),o=t.reactEmail!=null?await et(t.reactEmail,i):t.htmlFile!=null?ge(t.htmlFile,i):t.html,s=t.textFile!=null?ge(t.textFile,i):t.text;await F({loading:"Updating broadcast...",sdkCall:a=>a.broadcasts.update(n,{...t.from!=null&&{from:t.from},...t.subject!=null&&{subject:t.subject},...o!=null&&{html:o},...s!=null&&{text:s},...t.name!=null&&{name:t.name}}),errorCode:"update_error",successMsg:`Broadcast updated: ${n}`},i)});var Qv=new p("broadcasts").description("Manage broadcasts").addHelpText("after",h({context:`Lifecycle:
283
+ Example: {{{FIRST_NAME|Friend}}} \u2014 uses FIRST_NAME or falls back to "Friend".`,output:' {"id":"<broadcast-id>"}',errorCodes:["auth_error","no_changes","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","update_error"],examples:['resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --subject "Updated Subject"',"resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --html-file ./new-email.html",'resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --name "Q1 Newsletter" --from "onboarding@resend.com" --json','echo "<p>New content</p>" | resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --html-file -']})).action(async(e,t,r)=>{let i=r.optsWithGlobals();t.from==null&&t.subject==null&&t.html==null&&t.htmlFile==null&&t.text==null&&t.textFile==null&&t.reactEmail==null&&t.name==null&&g({message:"Provide at least one option to update: --from, --subject, --html, --html-file, --text, --text-file, --react-email, or --name.",code:"no_changes"},{json:i.json}),t.htmlFile==="-"&&t.textFile==="-"&&g({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:i.json}),t.reactEmail!=null&&(t.html!=null||t.htmlFile!=null)&&g({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:i.json}),t.html!=null&&t.htmlFile!=null&&g({message:"--html and --html-file are mutually exclusive.",code:"invalid_options"},{json:i.json}),t.text!=null&&t.textFile!=null&&g({message:"--text and --text-file are mutually exclusive.",code:"invalid_options"},{json:i.json});let n=await C(e,Er,i),o=t.reactEmail!=null?await et(t.reactEmail,i):t.htmlFile!=null?ge(t.htmlFile,i):t.html,s=t.textFile!=null?ge(t.textFile,i):t.text;await B({loading:"Updating broadcast...",sdkCall:a=>a.broadcasts.update(n,{...t.from!=null&&{from:t.from},...t.subject!=null&&{subject:t.subject},...o!=null&&{html:o},...s!=null&&{text:s},...t.name!=null&&{name:t.name}}),errorCode:"update_error",successMsg:`Broadcast updated: ${n}`},i)});var Mv=new p("broadcasts").description("Manage broadcasts").addHelpText("after",h({context:`Lifecycle:
294
284
  Broadcasts follow a draft \u2192 send flow:
295
285
  1. create \u2014 creates a draft (or sends immediately with --send)
296
286
  2. send \u2014 sends an API-created draft (dashboard broadcasts cannot be sent via API)
@@ -301,25 +291,25 @@ Template variables:
301
291
  Example: {{{FIRST_NAME|Friend}}} \u2014 uses FIRST_NAME or falls back to "Friend".
302
292
 
303
293
  Scheduling:
304
- --scheduled-at accepts ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET".`,examples:["resend broadcasts list",'resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hi {{{FIRST_NAME|there}}}</p>"',"resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "in 1 hour"',"resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --subject "Updated Subject"',"resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes","resend broadcasts open","resend broadcasts open d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6"]})).addCommand(Bv).addCommand(Vv).addCommand(Kv).addCommand(Uv).addCommand(Wv,{isDefault:!0}).addCommand(Yv).addCommand(Gv);function si(e){let t=[];for(let i of e.commands)i._hidden||t.push(si(i));let r=[];for(let i of e.options)i.hidden||r.push({long:i.long,short:i.short,description:i.description,takesValue:i.required||i.optional,choices:i.argChoices});return{name:e.name(),aliases:e.aliases(),description:e.description(),subcommands:t,options:r}}function ai(e,t,r){let i=t?`${t} ${e.name}`:e.name,n=[],o=[];for(let a of e.subcommands){o.push({name:a.name,description:a.description});for(let u of a.aliases)o.push({name:u,description:a.description})}let s=[...e.options,...r];n.push({path:i,subcommands:o,options:s});for(let a of e.subcommands)n.push(...ai(a,i,r));return n}function Gc(e){let t=new Set;function r(i){for(let n of i.options)n.takesValue&&(n.long&&t.add(n.long),n.short&&t.add(n.short));for(let n of i.subcommands)r(n)}return r(e),[...t]}function Xv(e){let t=ai(e,"",[]),r=[],i=e.name;r.push(`# bash completion for ${i}`),r.push(`# Generated by: ${i} completion bash`),r.push(""),r.push(`_${i}_completions() {`),r.push(" local cur prev words cword"),r.push(" if type _init_completion &>/dev/null; then _init_completion || return; else"),r.push(' cur="${COMP_WORDS[COMP_CWORD]}"'),r.push(' prev="${COMP_WORDS[COMP_CWORD-1]}"'),r.push(' words=("${COMP_WORDS[@]}")'),r.push(" cword=$COMP_CWORD"),r.push(" fi"),r.push("");let o=Gc(e).join("|");r.push(' local cmd_path=""'),r.push(" local i=1"),r.push(" while [ $i -lt $cword ]; do"),r.push(' case "${words[$i]}" in'),o&&r.push(` ${o}) i=$((i + 1)) ;;`),r.push(" -*) ;;"),r.push(' *) cmd_path="${cmd_path:+$cmd_path }${words[$i]}" ;;'),r.push(" esac"),r.push(" i=$((i + 1))"),r.push(" done"),r.push(""),r.push(' case "$cmd_path" in');for(let s of t){let a=s.path===e.name?"":s.path.replace(`${e.name} `,""),u=s.options.filter(b=>b.choices&&b.long),l=s.options.map(b=>b.long).filter(Boolean).join(" "),d=s.subcommands.map(b=>b.name).join(" "),c=u.length>0,m=l.length>0,_=d.length>0;if(!c&&!m&&!_)continue;r.push(` "${a}")`);let g=s.options.filter(b=>b.takesValue&&!b.choices);if(c||g.length>0){r.push(' case "$prev" in');for(let b of u)r.push(` ${b.long}) COMPREPLY=($(compgen -W "${b.choices?.join(" ")}" -- "$cur")); return ;;`);if(g.length>0){let b=g.flatMap(O=>[O.long,O.short].filter(Boolean)).join("|");r.push(` ${b}) return ;;`)}r.push(" esac")}m&&(r.push(' if [[ "$cur" == -* ]]; then'),r.push(` COMPREPLY=($(compgen -W "${l}" -- "$cur")); return`),r.push(" fi")),_&&r.push(` COMPREPLY=($(compgen -W "${d}" -- "$cur"))`),r.push(" ;;")}return r.push(" esac"),r.push("}"),r.push(""),r.push(`complete -o default -F _${i}_completions ${i}`),r.join(`
305
- `)}function e_(e){let t=ai(e,"",[]),r=[],i=e.name;r.push(`#compdef ${i}`),r.push(`# zsh completion for ${i}`),r.push(`# Generated by: ${i} completion zsh`),r.push(""),r.push(`_${i}() {`),r.push(" local cur prev cmd_path"),r.push(' cur="${words[$CURRENT]}"'),r.push(' prev="${words[$CURRENT-1]}"'),r.push("");let o=Gc(e).join("|");r.push(' cmd_path=""'),r.push(" for ((i=2; i < CURRENT; i++)); do"),r.push(' case "${words[$i]}" in'),o&&r.push(` ${o}) ((i++)) ;;`),r.push(" -*) ;;"),r.push(' *) cmd_path="${cmd_path:+$cmd_path }${words[$i]}" ;;'),r.push(" esac"),r.push(" done"),r.push(""),r.push(' case "$cmd_path" in');for(let s of t){let a=s.path===e.name?"":s.path.replace(`${e.name} `,""),u=s.options.filter(m=>m.choices&&m.long),l=s.options.filter(m=>m.long),d=s.subcommands.length>0;r.push(` "${a}")`);let c=s.options.filter(m=>m.takesValue&&!m.choices);if(u.length>0||c.length>0){r.push(' case "$prev" in');for(let m of u)r.push(` ${m.long}) compadd -- ${m.choices?.join(" ")}; return ;;`);if(c.length>0){let m=c.flatMap(_=>[_.long,_.short].filter(Boolean)).join("|");r.push(` ${m}) _files; return ;;`)}r.push(" esac")}if(l.length>0){r.push(' if [[ "$cur" == -* ]]; then');let m=l.map(_=>`"${_.long}:${Zv(_.description)}"`).join(" ");r.push(` local -a opts=(${m}); _describe 'option' opts; return`),r.push(" fi")}if(d){let m=s.subcommands.map(_=>`"${_.name}:${Zv(_.description)}"`).join(" ");r.push(` local -a cmds=(${m}); _describe 'command' cmds`)}else r.push(" _files");r.push(" ;;")}return r.push(" esac"),r.push("}"),r.push(""),r.push(`compdef _${i} ${i}`),r.join(`
306
- `)}function t_(e){let t=e.name,r=ai(e,"",[]),i=[];i.push(`# fish completion for ${t}`),i.push(`# Generated by: ${t} completion fish`),i.push("");let n=r[0];for(let o of n.subcommands)i.push(`complete -c ${t} -n "__fish_use_subcommand" -a "${o.name}" -d "${iu(o.description)}"`);for(let o of e.options)if(o.long){let s=o.long.replace("--",""),a=`complete -c ${t} -l "${s}"`;o.short&&(a+=` -s "${o.short.replace("-","")}"`),o.takesValue&&(a+=" -r"),o.choices&&(a+=` -a "${o.choices.join(" ")}"`),a+=` -d "${iu(o.description)}"`,i.push(a)}for(let o of r.slice(1)){let s=o.path.split(" ").slice(1),u=`__fish_seen_subcommand_from ${s[s.length-1]}`;for(let l of o.subcommands)i.push(`complete -c ${t} -n "${u}" -a "${l.name}" -d "${iu(l.description)}"`);for(let l of o.options)if(l.long){let d=l.long.replace("--",""),c=`complete -c ${t} -n "${u}" -l "${d}"`;l.short&&(c+=` -s "${l.short.replace("-","")}"`),l.takesValue&&(c+=" -r"),l.choices&&(c+=` -a "${l.choices.join(" ")}"`),c+=` -d "${iu(l.description)}"`,i.push(c)}}return i.join(`
307
- `)}function Zv(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/:/g,"\\:")}function iu(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function r_(e){let t=e.name,r=ai(e,"",[]),i=[];i.push(`# PowerShell completion for ${t}`),i.push(`# Generated by: ${t} completion powershell`),i.push(""),i.push(`Register-ArgumentCompleter -Native -CommandName ${t} -ScriptBlock {`),i.push(" param($wordToComplete, $commandAst, $cursorPosition)"),i.push(""),i.push(' $words = $commandAst.ToString().Substring(0, $cursorPosition) -split "\\s+"');let o=Gc(e).map(s=>`"${s}"`).join(", ");i.push(" $cmdPath = @()"),i.push(` $valueFlags = @(${o})`),i.push(" for ($i = 1; $i -lt $words.Count - 1; $i++) {"),i.push(" if ($valueFlags -contains $words[$i]) { $i++; continue }"),i.push(' if ($words[$i] -notlike "-*") { $cmdPath += $words[$i] }'),i.push(" }"),i.push(' $joined = $cmdPath -join " "'),i.push(" $cur = $words[-1]"),i.push(' if ($words.Count -eq 1) { $cur = "" }'),i.push(""),i.push(' $prev = if ($words.Count -ge 2) { $words[-2] } else { "" }'),i.push(""),i.push(" switch ($joined) {");for(let s of r){let a=s.path===e.name?"":s.path.replace(`${e.name} `,""),u=s.options.filter(b=>b.choices&&b.long),l=s.options.map(b=>b.long).filter(Boolean).map(b=>`"${b}"`).join(", "),d=s.subcommands.map(b=>`"${b.name}"`).join(", "),c=u.length>0,m=l.length>0,_=d.length>0;if(!c&&!m&&!_)continue;i.push(` "${a}" {`);let g=s.options.filter(b=>b.takesValue&&!b.choices);if(c||g.length>0){i.push(" switch ($prev) {");for(let b of u){let O=b.choices?.map(x=>`"${x}"`).join(", ");i.push(` "${b.long}" { @(${O}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }; return }`)}if(g.length>0){let b=g.flatMap(O=>[O.long,O.short].filter(Boolean)).map(O=>`"${O}"`).join(", ");i.push(` { $_ -in @(${b}) } { return }`)}i.push(" }")}m&&(i.push(' if ($cur -like "-*") {'),i.push(` @(${l}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }; return`),i.push(" }")),_&&i.push(` @(${d}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }`),i.push(" }")}return i.push(" }"),i.push("}"),i.join(`
308
- `)}var i_=new p("commands").description("Print the full command tree as JSON (for agents and tooling)").addHelpText("after",h({context:`Outputs every subcommand, option, and description from the CLI definition.
309
- In machine mode (piped, CI, or --json), the tree is JSON you can feed to agents or scripts.`,examples:["resend commands","resend commands --json",'resend commands | jq ".subcommands[].name"']})).action((e,t)=>{let r=t.parent;if(!r)throw new Error("commands must be registered on the root program");let i=t.optsWithGlobals(),n=si(r);z(n,{json:i.json})});var xe=require("node:fs"),jt=require("node:os"),Ge=require("node:path");ee();var s_=["bash","zsh","fish","powershell"],nu="# resend shell completion";function rw(){let e=process.env.SHELL;if(e){let t=(0,Ge.basename)(e);if(t==="bash")return"bash";if(t==="zsh")return"zsh";if(t==="fish")return"fish"}if(process.env.PSModulePath)return"powershell"}async function iw(e){if(e)return e;let t=rw();if(t)return t;k()||(process.stderr.write(`error: could not detect shell. Pass the shell name explicitly.
310
- `),process.exit(1));let r=await pe({message:"Which shell do you use?",options:s_.map(i=>({value:i,label:i}))});return j(r)&&D("Cancelled."),r}function n_(e){switch(e){case"bash":return process.platform==="darwin"?(0,Ge.join)((0,jt.homedir)(),".bash_profile"):(0,Ge.join)((0,jt.homedir)(),".bashrc");case"zsh":return(0,Ge.join)((0,jt.homedir)(),".zshrc");case"powershell":return process.platform==="win32"?(0,Ge.join)((0,jt.homedir)(),"Documents","PowerShell","Microsoft.PowerShell_profile.ps1"):(0,Ge.join)((0,jt.homedir)(),".config","powershell","Microsoft.PowerShell_profile.ps1")}}function nw(e,t){switch(e){case"bash":return Xv(t);case"zsh":return e_(t);case"fish":return t_(t);case"powershell":return r_(t)}}function o_(e,t,r){(0,xe.existsSync)(e)||(0,xe.mkdirSync)(e,{recursive:!0});let i=(0,Ge.join)(e,t);return(0,xe.writeFileSync)(i,`${r}
311
- `),i}function ow(e,t){switch(e){case"zsh":{let r=(0,Ge.join)((0,jt.homedir)(),".zsh","completions"),i=o_(r,"_resend",t);ie.success(`Completions written to ${i}`);let n=n_(e),o=!0;if((0,xe.existsSync)(n)&&(0,xe.readFileSync)(n,"utf8").includes(r)&&(o=!1),o){let s=`${nu}
294
+ --scheduled-at accepts ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET".`,examples:["resend broadcasts list",'resend broadcasts create --from onboarding@resend.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hi {{{FIRST_NAME|there}}}</p>"',"resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts send d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --scheduled-at "in 1 hour"',"resend broadcasts get d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6",'resend broadcasts update d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --subject "Updated Subject"',"resend broadcasts delete d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6 --yes","resend broadcasts open","resend broadcasts open d1c2b3a4-5e6f-7a8b-9c0d-e1f2a3b4c5d6"]})).addCommand(Tv).addCommand(Rv).addCommand(Fv).addCommand($v).addCommand(qv,{isDefault:!0}).addCommand(zv).addCommand(jv);function si(e){let t=[];for(let i of e.commands)i._hidden||t.push(si(i));let r=[];for(let i of e.options)i.hidden||r.push({long:i.long,short:i.short,description:i.description,takesValue:i.required||i.optional,choices:i.argChoices});return{name:e.name(),aliases:e.aliases(),description:e.description(),subcommands:t,options:r}}function ai(e,t,r){let i=t?`${t} ${e.name}`:e.name,n=[],o=[];for(let a of e.subcommands){o.push({name:a.name,description:a.description});for(let u of a.aliases)o.push({name:u,description:a.description})}let s=[...e.options,...r];n.push({path:i,subcommands:o,options:s});for(let a of e.subcommands)n.push(...ai(a,i,r));return n}function qc(e){let t=new Set;function r(i){for(let n of i.options)n.takesValue&&(n.long&&t.add(n.long),n.short&&t.add(n.short));for(let n of i.subcommands)r(n)}return r(e),[...t]}function Bv(e){let t=ai(e,"",[]),r=[],i=e.name;r.push(`# bash completion for ${i}`),r.push(`# Generated by: ${i} completion bash`),r.push(""),r.push(`_${i}_completions() {`),r.push(" local cur prev words cword"),r.push(" if type _init_completion &>/dev/null; then _init_completion || return; else"),r.push(' cur="${COMP_WORDS[COMP_CWORD]}"'),r.push(' prev="${COMP_WORDS[COMP_CWORD-1]}"'),r.push(' words=("${COMP_WORDS[@]}")'),r.push(" cword=$COMP_CWORD"),r.push(" fi"),r.push("");let o=qc(e).join("|");r.push(' local cmd_path=""'),r.push(" local i=1"),r.push(" while [ $i -lt $cword ]; do"),r.push(' case "${words[$i]}" in'),o&&r.push(` ${o}) i=$((i + 1)) ;;`),r.push(" -*) ;;"),r.push(' *) cmd_path="${cmd_path:+$cmd_path }${words[$i]}" ;;'),r.push(" esac"),r.push(" i=$((i + 1))"),r.push(" done"),r.push(""),r.push(' case "$cmd_path" in');for(let s of t){let a=s.path===e.name?"":s.path.replace(`${e.name} `,""),u=s.options.filter(_=>_.choices&&_.long),l=s.options.map(_=>_.long).filter(Boolean).join(" "),c=s.subcommands.map(_=>_.name).join(" "),d=u.length>0,m=l.length>0,b=c.length>0;if(!d&&!m&&!b)continue;r.push(` "${a}")`);let v=s.options.filter(_=>_.takesValue&&!_.choices);if(d||v.length>0){r.push(' case "$prev" in');for(let _ of u)r.push(` ${_.long}) COMPREPLY=($(compgen -W "${_.choices?.join(" ")}" -- "$cur")); return ;;`);if(v.length>0){let _=v.flatMap(x=>[x.long,x.short].filter(Boolean)).join("|");r.push(` ${_}) return ;;`)}r.push(" esac")}m&&(r.push(' if [[ "$cur" == -* ]]; then'),r.push(` COMPREPLY=($(compgen -W "${l}" -- "$cur")); return`),r.push(" fi")),b&&r.push(` COMPREPLY=($(compgen -W "${c}" -- "$cur"))`),r.push(" ;;")}return r.push(" esac"),r.push("}"),r.push(""),r.push(`complete -o default -F _${i}_completions ${i}`),r.join(`
295
+ `)}function Hv(e){let t=ai(e,"",[]),r=[],i=e.name;r.push(`#compdef ${i}`),r.push(`# zsh completion for ${i}`),r.push(`# Generated by: ${i} completion zsh`),r.push(""),r.push(`_${i}() {`),r.push(" local cur prev cmd_path"),r.push(' cur="${words[$CURRENT]}"'),r.push(' prev="${words[$CURRENT-1]}"'),r.push("");let o=qc(e).join("|");r.push(' cmd_path=""'),r.push(" for ((i=2; i < CURRENT; i++)); do"),r.push(' case "${words[$i]}" in'),o&&r.push(` ${o}) ((i++)) ;;`),r.push(" -*) ;;"),r.push(' *) cmd_path="${cmd_path:+$cmd_path }${words[$i]}" ;;'),r.push(" esac"),r.push(" done"),r.push(""),r.push(' case "$cmd_path" in');for(let s of t){let a=s.path===e.name?"":s.path.replace(`${e.name} `,""),u=s.options.filter(m=>m.choices&&m.long),l=s.options.filter(m=>m.long),c=s.subcommands.length>0;r.push(` "${a}")`);let d=s.options.filter(m=>m.takesValue&&!m.choices);if(u.length>0||d.length>0){r.push(' case "$prev" in');for(let m of u)r.push(` ${m.long}) compadd -- ${m.choices?.join(" ")}; return ;;`);if(d.length>0){let m=d.flatMap(b=>[b.long,b.short].filter(Boolean)).join("|");r.push(` ${m}) _files; return ;;`)}r.push(" esac")}if(l.length>0){r.push(' if [[ "$cur" == -* ]]; then');let m=l.map(b=>`"${b.long}:${Jv(b.description)}"`).join(" ");r.push(` local -a opts=(${m}); _describe 'option' opts; return`),r.push(" fi")}if(c){let m=s.subcommands.map(b=>`"${b.name}:${Jv(b.description)}"`).join(" ");r.push(` local -a cmds=(${m}); _describe 'command' cmds`)}else r.push(" _files");r.push(" ;;")}return r.push(" esac"),r.push("}"),r.push(""),r.push(`compdef _${i} ${i}`),r.join(`
296
+ `)}function Nv(e){let t=e.name,r=ai(e,"",[]),i=[];i.push(`# fish completion for ${t}`),i.push(`# Generated by: ${t} completion fish`),i.push("");let n=r[0];for(let o of n.subcommands)i.push(`complete -c ${t} -n "__fish_use_subcommand" -a "${o.name}" -d "${Xa(o.description)}"`);for(let o of e.options)if(o.long){let s=o.long.replace("--",""),a=`complete -c ${t} -l "${s}"`;o.short&&(a+=` -s "${o.short.replace("-","")}"`),o.takesValue&&(a+=" -r"),o.choices&&(a+=` -a "${o.choices.join(" ")}"`),a+=` -d "${Xa(o.description)}"`,i.push(a)}for(let o of r.slice(1)){let s=o.path.split(" ").slice(1),u=`__fish_seen_subcommand_from ${s[s.length-1]}`;for(let l of o.subcommands)i.push(`complete -c ${t} -n "${u}" -a "${l.name}" -d "${Xa(l.description)}"`);for(let l of o.options)if(l.long){let c=l.long.replace("--",""),d=`complete -c ${t} -n "${u}" -l "${c}"`;l.short&&(d+=` -s "${l.short.replace("-","")}"`),l.takesValue&&(d+=" -r"),l.choices&&(d+=` -a "${l.choices.join(" ")}"`),d+=` -d "${Xa(l.description)}"`,i.push(d)}}return i.join(`
297
+ `)}function Jv(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/:/g,"\\:")}function Xa(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Lv(e){let t=e.name,r=ai(e,"",[]),i=[];i.push(`# PowerShell completion for ${t}`),i.push(`# Generated by: ${t} completion powershell`),i.push(""),i.push(`Register-ArgumentCompleter -Native -CommandName ${t} -ScriptBlock {`),i.push(" param($wordToComplete, $commandAst, $cursorPosition)"),i.push(""),i.push(' $words = $commandAst.ToString().Substring(0, $cursorPosition) -split "\\s+"');let o=qc(e).map(s=>`"${s}"`).join(", ");i.push(" $cmdPath = @()"),i.push(` $valueFlags = @(${o})`),i.push(" for ($i = 1; $i -lt $words.Count - 1; $i++) {"),i.push(" if ($valueFlags -contains $words[$i]) { $i++; continue }"),i.push(' if ($words[$i] -notlike "-*") { $cmdPath += $words[$i] }'),i.push(" }"),i.push(' $joined = $cmdPath -join " "'),i.push(" $cur = $words[-1]"),i.push(' if ($words.Count -eq 1) { $cur = "" }'),i.push(""),i.push(' $prev = if ($words.Count -ge 2) { $words[-2] } else { "" }'),i.push(""),i.push(" switch ($joined) {");for(let s of r){let a=s.path===e.name?"":s.path.replace(`${e.name} `,""),u=s.options.filter(_=>_.choices&&_.long),l=s.options.map(_=>_.long).filter(Boolean).map(_=>`"${_}"`).join(", "),c=s.subcommands.map(_=>`"${_.name}"`).join(", "),d=u.length>0,m=l.length>0,b=c.length>0;if(!d&&!m&&!b)continue;i.push(` "${a}" {`);let v=s.options.filter(_=>_.takesValue&&!_.choices);if(d||v.length>0){i.push(" switch ($prev) {");for(let _ of u){let x=_.choices?.map(w=>`"${w}"`).join(", ");i.push(` "${_.long}" { @(${x}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }; return }`)}if(v.length>0){let _=v.flatMap(x=>[x.long,x.short].filter(Boolean)).map(x=>`"${x}"`).join(", ");i.push(` { $_ -in @(${_}) } { return }`)}i.push(" }")}m&&(i.push(' if ($cur -like "-*") {'),i.push(` @(${l}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }; return`),i.push(" }")),b&&i.push(` @(${c}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }`),i.push(" }")}return i.push(" }"),i.push("}"),i.join(`
298
+ `)}var Gv=new p("commands").description("Print the full command tree as JSON (for agents and tooling)").addHelpText("after",h({context:`Outputs every subcommand, option, and description from the CLI definition.
299
+ In machine mode (piped, CI, or --json), the tree is JSON you can feed to agents or scripts.`,examples:["resend commands","resend commands --json",'resend commands | jq ".subcommands[].name"']})).action((e,t)=>{let r=t.parent;if(!r)throw new Error("commands must be registered on the root program");let i=t.optsWithGlobals(),n=si(r);F(n,{json:i.json})});var Se=require("node:fs"),jt=require("node:os"),Ge=require("node:path");ee();var Vv=["bash","zsh","fish","powershell"],eu="# resend shell completion";function Px(){let e=process.env.SHELL;if(e){let t=(0,Ge.basename)(e);if(t==="bash")return"bash";if(t==="zsh")return"zsh";if(t==="fish")return"fish"}if(process.env.PSModulePath)return"powershell"}async function Tx(e){if(e)return e;let t=Px();if(t)return t;O()||(process.stderr.write(`error: could not detect shell. Pass the shell name explicitly.
300
+ `),process.exit(1));let r=await pe({message:"Which shell do you use?",options:Vv.map(i=>({value:i,label:i}))});return P(r)&&T("Cancelled."),r}function Uv(e){switch(e){case"bash":return process.platform==="darwin"?(0,Ge.join)((0,jt.homedir)(),".bash_profile"):(0,Ge.join)((0,jt.homedir)(),".bashrc");case"zsh":return(0,Ge.join)((0,jt.homedir)(),".zshrc");case"powershell":return process.platform==="win32"?(0,Ge.join)((0,jt.homedir)(),"Documents","PowerShell","Microsoft.PowerShell_profile.ps1"):(0,Ge.join)((0,jt.homedir)(),".config","powershell","Microsoft.PowerShell_profile.ps1")}}function Dx(e,t){switch(e){case"bash":return Bv(t);case"zsh":return Hv(t);case"fish":return Nv(t);case"powershell":return Lv(t)}}function Wv(e,t,r){(0,Se.existsSync)(e)||(0,Se.mkdirSync)(e,{recursive:!0});let i=(0,Ge.join)(e,t);return(0,Se.writeFileSync)(i,`${r}
301
+ `),i}function Ix(e,t){switch(e){case"zsh":{let r=(0,Ge.join)((0,jt.homedir)(),".zsh","completions"),i=Wv(r,"_resend",t);ie.success(`Completions written to ${i}`);let n=Uv(e),o=!0;if((0,Se.existsSync)(n)&&(0,Se.readFileSync)(n,"utf8").includes(r)&&(o=!1),o){let s=`${eu}
312
302
  fpath=(${r} $fpath)
313
- `,a=(0,xe.existsSync)(n)?(0,xe.readFileSync)(n,"utf8"):"",u=a.match(/^.*compinit.*$/m);if(u){let l=a.indexOf(u[0]),d=a.slice(0,l),c=a.slice(l);(0,xe.writeFileSync)(n,`${d}${s}
314
- ${c}`)}else{let l=`
303
+ `,a=(0,Se.existsSync)(n)?(0,Se.readFileSync)(n,"utf8"):"",u=a.match(/^.*compinit.*$/m);if(u){let l=a.indexOf(u[0]),c=a.slice(0,l),d=a.slice(l);(0,Se.writeFileSync)(n,`${c}${s}
304
+ ${d}`)}else{let l=`
315
305
  ${s}autoload -Uz compinit && compinit
316
- `;(0,xe.writeFileSync)(n,l,{flag:"a"})}ie.info(`Added completion path to ${n}`)}ie.info("Restart your shell to activate completions.");return}case"fish":{let r=(0,Ge.join)((0,jt.homedir)(),".config","fish","completions"),i=o_(r,"resend.fish",t);ie.success(`Completions written to ${i}`),ie.info("Completions will be available in new fish sessions.");return}case"bash":case"powershell":{let r=n_(e),i=e==="powershell"?`
317
- ${nu}
306
+ `;(0,Se.writeFileSync)(n,l,{flag:"a"})}ie.info(`Added completion path to ${n}`)}ie.info("Restart your shell to activate completions.");return}case"fish":{let r=(0,Ge.join)((0,jt.homedir)(),".config","fish","completions"),i=Wv(r,"resend.fish",t);ie.success(`Completions written to ${i}`),ie.info("Completions will be available in new fish sessions.");return}case"bash":case"powershell":{let r=Uv(e),i=e==="powershell"?`
307
+ ${eu}
318
308
  resend completion powershell | Invoke-Expression
319
309
  `:`
320
- ${nu}
310
+ ${eu}
321
311
  eval "$(resend completion ${e})"
322
- `;if((0,xe.existsSync)(r)&&(0,xe.readFileSync)(r,"utf8").includes(nu)){ie.info(`Completions already installed in ${r}`);return}let n=(0,Ge.dirname)(r);(0,xe.existsSync)(n)||(0,xe.mkdirSync)(n,{recursive:!0}),(0,xe.writeFileSync)(r,i,{flag:"a"}),ie.success(`Completions added to ${r}`),ie.info("Restart your shell to activate completions.");return}}}var a_=new p("completion").description("Generate shell completion script").addArgument(new bd("[shell]","Shell type").choices(s_)).option("--install","Install completions into your shell profile").addHelpText("after",h({context:`Outputs a completion script for the given shell. The shell is auto-detected
312
+ `;if((0,Se.existsSync)(r)&&(0,Se.readFileSync)(r,"utf8").includes(eu)){ie.info(`Completions already installed in ${r}`);return}let n=(0,Ge.dirname)(r);(0,Se.existsSync)(n)||(0,Se.mkdirSync)(n,{recursive:!0}),(0,Se.writeFileSync)(r,i,{flag:"a"}),ie.success(`Completions added to ${r}`),ie.info("Restart your shell to activate completions.");return}}}var Kv=new p("completion").description("Generate shell completion script").addArgument(new ad("[shell]","Shell type").choices(Vv)).option("--install","Install completions into your shell profile").addHelpText("after",h({context:`Outputs a completion script for the given shell. The shell is auto-detected
323
313
  from $SHELL when not specified.
324
314
 
325
315
  Quick setup:
@@ -339,7 +329,7 @@ Manual setup:
339
329
  PowerShell (add to $PROFILE):
340
330
  resend completion powershell >> $PROFILE
341
331
 
342
- Homebrew users: completions may be configured automatically by your formula.`,examples:["resend completion --install","resend completion bash","resend completion zsh",'eval "$(resend completion bash)"']})).action(async(e,t,r)=>{let i=await iw(e),n=r.parent;if(!n)throw new Error("completion command must be registered under a parent");let o=si(n),s=nw(i,o);if(t.install){ow(i,s);return}if(!e&&k()){r.help();return}console.log(s)});var u_=new p("create").description("Create a new contact property definition").addOption(new ce("--key <key>","Property key name, used in broadcast template interpolation (e.g. company_name, department)")).addOption(new ce("--type <type>","Property data type: 'string' for text values, 'number' for numeric values").choices(["string","number"])).option("--fallback-value <value>","Default value used in broadcast templates when a contact has no value set for this property").addHelpText("after",h({context:`Property keys are used as identifiers in broadcast HTML template interpolation:
332
+ Homebrew users: completions may be configured automatically by your formula.`,examples:["resend completion --install","resend completion bash","resend completion zsh",'eval "$(resend completion bash)"']})).action(async(e,t,r)=>{let i=await Tx(e),n=r.parent;if(!n)throw new Error("completion command must be registered under a parent");let o=si(n),s=Dx(i,o);if(t.install){Ix(i,s);return}if(!e&&O()){r.help();return}console.log(s)});var Yv=new p("create").description("Create a new contact property definition").addOption(new ce("--key <key>","Property key name, used in broadcast template interpolation (e.g. company_name, department)")).addOption(new ce("--type <type>","Property data type: 'string' for text values, 'number' for numeric values").choices(["string","number"])).option("--fallback-value <value>","Default value used in broadcast templates when a contact has no value set for this property").addHelpText("after",h({context:`Property keys are used as identifiers in broadcast HTML template interpolation:
343
333
  {{{PROPERTY_NAME|fallback}}} \u2014 triple-brace syntax substitutes the contact's value
344
334
  {{{company_name|Unknown}}} \u2014 falls back to "Unknown" if the property is not set
345
335
 
@@ -347,19 +337,19 @@ Reserved keys (cannot be used): FIRST_NAME, LAST_NAME, EMAIL, UNSUBSCRIBE_URL
347
337
 
348
338
  Non-interactive: --key and --type are required. --fallback-value is optional.
349
339
  Warning: do not create properties with reserved key names \u2014 they will conflict with
350
- built-in contact fields and may cause unexpected behavior in broadcasts.`,output:' {"object":"contact_property","id":"<id>"}',errorCodes:["auth_error","missing_key","missing_type","invalid_fallback_value","create_error"],examples:["resend contact-properties create --key company_name --type string",'resend contact-properties create --key company_name --type string --fallback-value "Unknown"',"resend contact-properties create --key employee_count --type number --fallback-value 0","resend contact-properties create --key department --type string --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.key,{message:"Property key",placeholder:"e.g. company_name"},{message:"Missing --key flag.",code:"missing_key"},r),n=await xr(e.type,{message:"Property data type",options:[{value:"string",label:"string \u2014 text values"},{value:"number",label:"number \u2014 numeric values"}]},{message:"Missing --type flag.",code:"missing_type"},r),o;if(e.fallbackValue!==void 0)if(n==="number"){let a=parseFloat(e.fallbackValue);Number.isNaN(a)&&v({message:"--fallback-value must be a valid number for number-type properties.",code:"invalid_fallback_value"},{json:r.json}),o=a}else o=e.fallbackValue;let s={key:i,type:n,...o!==void 0&&{fallbackValue:o}};await re({loading:"Creating contact property...",sdkCall:a=>a.contactProperties.create(s),onInteractive:a=>{console.log(`Contact property created: ${a.id}`)}},r)});var Er={resource:"contact property",resourcePlural:"contact properties",fetchItems:(e,{limit:t,after:r})=>e.contactProperties.list({limit:t,...r&&{after:r}}),display:e=>({label:`${e.key} (${e.type})`,hint:e.id})};function l_(e){let t=e.map(r=>[r.key,r.type,r.fallbackValue!=null?String(r.fallbackValue):"",r.id,r.createdAt]);return M(["Key","Type","Fallback Value","ID","Created"],t,"(no contact properties)")}var c_=new p("delete").alias("rm").description("Delete a contact property definition").argument("[id]","Contact property UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`WARNING: Deleting a property definition removes that property value from ALL contacts
340
+ built-in contact fields and may cause unexpected behavior in broadcasts.`,output:' {"object":"contact_property","id":"<id>"}',errorCodes:["auth_error","missing_key","missing_type","invalid_fallback_value","create_error"],examples:["resend contact-properties create --key company_name --type string",'resend contact-properties create --key company_name --type string --fallback-value "Unknown"',"resend contact-properties create --key employee_count --type number --fallback-value 0","resend contact-properties create --key department --type string --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.key,{message:"Property key",placeholder:"e.g. company_name"},{message:"Missing --key flag.",code:"missing_key"},r),n=await wr(e.type,{message:"Property data type",options:[{value:"string",label:"string \u2014 text values"},{value:"number",label:"number \u2014 numeric values"}]},{message:"Missing --type flag.",code:"missing_type"},r),o;if(e.fallbackValue!==void 0)if(n==="number"){let a=parseFloat(e.fallbackValue);Number.isNaN(a)&&g({message:"--fallback-value must be a valid number for number-type properties.",code:"invalid_fallback_value"},{json:r.json}),o=a}else o=e.fallbackValue;let s={key:i,type:n,...o!==void 0&&{fallbackValue:o}};await re({loading:"Creating contact property...",sdkCall:a=>a.contactProperties.create(s),onInteractive:a=>{console.log(`Contact property created: ${a.id}`)}},r)});var Pr={resource:"contact property",resourcePlural:"contact properties",fetchItems:(e,{limit:t,after:r})=>e.contactProperties.list({limit:t,...r&&{after:r}}),display:e=>({label:`${e.key} (${e.type})`,hint:e.id})};function Qv(e){let t=e.map(r=>[r.key,r.type,r.fallbackValue!=null?String(r.fallbackValue):"",r.id,r.createdAt]);return z(["Key","Type","Fallback Value","ID","Created"],t,"(no contact properties)")}var Zv=new p("delete").alias("rm").description("Delete a contact property definition").argument("[id]","Contact property UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`WARNING: Deleting a property definition removes that property value from ALL contacts
351
341
  permanently. This cannot be undone, and any broadcasts that reference this property key
352
342
  via {{{PROPERTY_NAME}}} will render an empty string or their inline fallback instead.
353
343
 
354
- Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"contact_property","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes","resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Er,i);await ue(n,!!t.yes,{confirmMessage:`Delete contact property "${n}"?
355
- This will remove this property from ALL contacts permanently.`,loading:"Deleting contact property...",object:"contact_property",successMsg:"Contact property deleted",sdkCall:o=>o.contactProperties.remove(n)},i)});var d_=new p("get").description("Retrieve a contact property definition by ID").argument("[id]","Contact property UUID").addHelpText("after",h({output:` {
344
+ Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"contact_property","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes","resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Pr,i);await ue(n,!!t.yes,{confirmMessage:`Delete contact property "${n}"?
345
+ This will remove this property from ALL contacts permanently.`,loading:"Deleting contact property...",object:"contact_property",successMsg:"Contact property deleted",sdkCall:o=>o.contactProperties.remove(n)},i)});var Xv=new p("get").description("Retrieve a contact property definition by ID").argument("[id]","Contact property UUID").addHelpText("after",h({output:` {
356
346
  "object": "contact_property",
357
347
  "id": "<uuid>",
358
348
  "key": "company_name",
359
349
  "type": "string",
360
350
  "fallbackValue": null,
361
351
  "createdAt": "2026-01-01T00:00:00.000Z"
362
- }`,errorCodes:["auth_error","fetch_error"],examples:["resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d","resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Er,i);await N({loading:"Fetching contact property...",sdkCall:o=>o.contactProperties.get(n),onInteractive:o=>{console.log(`${o.key} (${o.type})`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.createdAt}`),console.log(`Fallback value: ${o.fallbackValue??"(none)"}`)}},i)});var m_=new p("list").alias("ls").description("List all contact property definitions").option("--limit <n>","Maximum number of contact properties to return (1-100)","10").option("--after <cursor>","Return contact properties after this cursor (next page)").option("--before <cursor>","Return contact properties before this cursor (previous page)").addHelpText("after",h({context:`Pagination: use --after or --before with a contact property ID as the cursor.
352
+ }`,errorCodes:["auth_error","fetch_error"],examples:["resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d","resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Pr,i);await N({loading:"Fetching contact property...",sdkCall:o=>o.contactProperties.get(n),onInteractive:o=>{console.log(`${o.key} (${o.type})`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.createdAt}`),console.log(`Fallback value: ${o.fallbackValue??"(none)"}`)}},i)});var e_=new p("list").alias("ls").description("List all contact property definitions").option("--limit <n>","Maximum number of contact properties to return (1-100)","10").option("--after <cursor>","Return contact properties after this cursor (next page)").option("--before <cursor>","Return contact properties before this cursor (previous page)").addHelpText("after",h({context:`Pagination: use --after or --before with a contact property ID as the cursor.
363
353
  Only one of --after or --before may be used at a time.
364
354
  The response includes has_more: true when additional pages exist.`,output:` {
365
355
  "object": "list",
@@ -367,14 +357,14 @@ This will remove this property from ALL contacts permanently.`,loading:"Deleting
367
357
  "data": [
368
358
  { "id": "<uuid>", "key": "company_name", "type": "string", "fallbackValue": null, "createdAt": "..." }
369
359
  ]
370
- }`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend contact-properties list","resend contact-properties list --limit 25 --json","resend contact-properties list --after b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching contact properties...",sdkCall:o=>o.contactProperties.list(n),onInteractive:o=>{console.log(l_(o.data)),Y(o,"contact-properties list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var p_=new p("update").description("Update a contact property definition").argument("[id]","Contact property UUID").option("--fallback-value <value>","New fallback value used in broadcast templates when a contact has no value set for this property").option("--clear-fallback-value","Remove the fallback value (sets it to null)").addHelpText("after",h({context:`Note: the property key and type cannot be changed after creation. Only the fallback value
360
+ }`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend contact-properties list","resend contact-properties list --limit 25 --json","resend contact-properties list --after b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching contact properties...",sdkCall:o=>o.contactProperties.list(n),onInteractive:o=>{console.log(Qv(o.data)),K(o,"contact-properties list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var t_=new p("update").description("Update a contact property definition").argument("[id]","Contact property UUID").option("--fallback-value <value>","New fallback value used in broadcast templates when a contact has no value set for this property").option("--clear-fallback-value","Remove the fallback value (sets it to null)").addHelpText("after",h({context:`Note: the property key and type cannot be changed after creation. Only the fallback value
371
361
  is updatable. Renaming a property would break existing broadcasts that reference the old key.
372
362
 
373
363
  --fallback-value and --clear-fallback-value are mutually exclusive.
374
364
 
375
365
  The fallback value is used in broadcast template interpolation when a contact has no value:
376
366
  {{{company_name|Unknown}}} \u2014 inline fallback (takes precedence over the property's fallback)
377
- {{{company_name}}} \u2014 uses the property's stored fallback value if set`,output:' {"object":"contact_property","id":"<id>"}',errorCodes:["auth_error","no_changes","conflicting_flags","fetch_error","invalid_fallback_value","update_error"],examples:['resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Acme Corp"',"resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value 42","resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --clear-fallback-value",'resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Unknown" --json']})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Er,i);t.fallbackValue===void 0&&!t.clearFallbackValue&&v({message:"Provide at least one option to update: --fallback-value or --clear-fallback-value.",code:"no_changes"},{json:i.json}),t.fallbackValue!==void 0&&t.clearFallbackValue&&v({message:"--fallback-value and --clear-fallback-value are mutually exclusive.",code:"conflicting_flags"},{json:i.json});let o=t.clearFallbackValue?null:t.fallbackValue;if(typeof o=="string"){let s=await oe(i);if((await He("Fetching contact property...",()=>s.contactProperties.get(n),"fetch_error",i)).type==="number"){let u=parseFloat(o);Number.isNaN(u)&&v({message:"--fallback-value must be a valid number for number-type properties.",code:"invalid_fallback_value"},{json:i.json}),o=u}}await F({loading:"Updating contact property...",sdkCall:s=>s.contactProperties.update({id:n,...o!==void 0&&{fallbackValue:o}}),errorCode:"update_error",successMsg:`Contact property updated: ${n}`},i)});var f_=new p("contact-properties").description("Manage contact property definitions").addHelpText("after",h({context:`Contact properties define the schema for custom data stored on contacts.
367
+ {{{company_name}}} \u2014 uses the property's stored fallback value if set`,output:' {"object":"contact_property","id":"<id>"}',errorCodes:["auth_error","no_changes","conflicting_flags","fetch_error","invalid_fallback_value","update_error"],examples:['resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Acme Corp"',"resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value 42","resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --clear-fallback-value",'resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Unknown" --json']})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Pr,i);t.fallbackValue===void 0&&!t.clearFallbackValue&&g({message:"Provide at least one option to update: --fallback-value or --clear-fallback-value.",code:"no_changes"},{json:i.json}),t.fallbackValue!==void 0&&t.clearFallbackValue&&g({message:"--fallback-value and --clear-fallback-value are mutually exclusive.",code:"conflicting_flags"},{json:i.json});let o=t.clearFallbackValue?null:t.fallbackValue;if(typeof o=="string"){let s=await oe(i);if((await Me("Fetching contact property...",()=>s.contactProperties.get(n),"fetch_error",i)).type==="number"){let u=parseFloat(o);Number.isNaN(u)&&g({message:"--fallback-value must be a valid number for number-type properties.",code:"invalid_fallback_value"},{json:i.json}),o=u}}await B({loading:"Updating contact property...",sdkCall:s=>s.contactProperties.update({id:n,...o!==void 0&&{fallbackValue:o}}),errorCode:"update_error",successMsg:`Contact property updated: ${n}`},i)});var r_=new p("contact-properties").description("Manage contact property definitions").addHelpText("after",h({context:`Contact properties define the schema for custom data stored on contacts.
378
368
  Think of them as column definitions \u2014 you create a property definition (e.g. company_name)
379
369
  and then set values for that property on individual contacts via "resend contacts update --properties".
380
370
 
@@ -389,9 +379,9 @@ Supported types:
389
379
  number \u2014 numeric values (useful for counts, scores, thresholds)
390
380
 
391
381
  Note: property keys and types are immutable after creation. Only the fallback value can
392
- be updated. Deleting a property removes it from all contacts.`,examples:["resend contact-properties list","resend contact-properties create --key company_name --type string",'resend contact-properties create --key plan --type string --fallback-value "free"',"resend contact-properties create --key score --type number --fallback-value 0","resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d",'resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Unknown"',"resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --clear-fallback-value","resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes"]})).addCommand(u_).addCommand(d_).addCommand(m_,{isDefault:!0}).addCommand(p_).addCommand(c_);function h_(e){let t=e.map(r=>[r.email,r.first_name??"",r.last_name??"",r.unsubscribed?"yes":"no",r.id]);return M(["Email","First Name","Last Name","Unsubscribed","ID"],t,"(no contacts)")}function g_(e){let t=e.map(r=>[r.name,r.subscription,r.id,r.description??""]);return M(["Name","Subscription","ID","Description"],t,"(no topic subscriptions)")}var Ee={resource:"contact",resourcePlural:"contacts",fetchItems:(e,{limit:t,after:r})=>e.contacts.list({limit:t,...r&&{after:r}}),display:e=>({label:e.email,hint:e.id})};function Pr(e){return e.includes("@")?{email:e}:{id:e}}function Tr(e){return e.includes("@")?{email:e}:{contactId:e}}function b_(e,t){let r;try{r=JSON.parse(e)}catch{v({message:"Invalid --topics JSON. Expected an array of {id, subscription} objects.",code:"invalid_topics"},{json:t.json})}return Array.isArray(r)||v({message:"Invalid --topics JSON. Expected an array of {id, subscription} objects.",code:"invalid_topics"},{json:t.json}),r}function ou(e,t){if(e)try{return JSON.parse(e)}catch{v({message:"Invalid --properties JSON.",code:"invalid_properties"},{json:t.json})}}var v_=new p("add-segment").description("Add a contact to a segment").argument("[contactId]","Contact UUID or email address").option("--segment-id <id>","Segment ID to add the contact to (required)").addHelpText("after",h({context:`The <contactId> argument accepts either a UUID or an email address.
382
+ be updated. Deleting a property removes it from all contacts.`,examples:["resend contact-properties list","resend contact-properties create --key company_name --type string",'resend contact-properties create --key plan --type string --fallback-value "free"',"resend contact-properties create --key score --type number --fallback-value 0","resend contact-properties get b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d",'resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --fallback-value "Unknown"',"resend contact-properties update b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --clear-fallback-value","resend contact-properties delete b4a3c2d1-6e5f-8a7b-0c9d-2e1f4a3b6c5d --yes"]})).addCommand(Yv).addCommand(Xv).addCommand(e_,{isDefault:!0}).addCommand(t_).addCommand(Zv);function i_(e){let t=e.map(r=>[r.email,r.first_name??"",r.last_name??"",r.unsubscribed?"yes":"no",r.id]);return z(["Email","First Name","Last Name","Unsubscribed","ID"],t,"(no contacts)")}function n_(e){let t=e.map(r=>[r.name,r.subscription,r.id,r.description??""]);return z(["Name","Subscription","ID","Description"],t,"(no topic subscriptions)")}var ke={resource:"contact",resourcePlural:"contacts",fetchItems:(e,{limit:t,after:r})=>e.contacts.list({limit:t,...r&&{after:r}}),display:e=>({label:e.email,hint:e.id})};function Tr(e){return e.includes("@")?{email:e}:{id:e}}function Dr(e){return e.includes("@")?{email:e}:{contactId:e}}function o_(e,t){let r;try{r=JSON.parse(e)}catch{g({message:"Invalid --topics JSON. Expected an array of {id, subscription} objects.",code:"invalid_topics"},{json:t.json})}return Array.isArray(r)||g({message:"Invalid --topics JSON. Expected an array of {id, subscription} objects.",code:"invalid_topics"},{json:t.json}),r}function tu(e,t){if(e)try{return JSON.parse(e)}catch{g({message:"Invalid --properties JSON.",code:"invalid_properties"},{json:t.json})}}var s_=new p("add-segment").description("Add a contact to a segment").argument("[contactId]","Contact UUID or email address").option("--segment-id <id>","Segment ID to add the contact to (required)").addHelpText("after",h({context:`The <contactId> argument accepts either a UUID or an email address.
393
383
 
394
- Non-interactive: --segment-id is required.`,output:' {"id":"<segment-membership-id>"}',errorCodes:["auth_error","missing_segment_id","add_segment_error"],examples:["resend contacts add-segment e169aa45-1ecf-4183-9955-b1499d5701d3 --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts add-segment steve.wozniak@gmail.com --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ee,i),o=await C(t.segmentId,ut,i),s={...Tr(n),segmentId:o};await F({loading:"Adding contact to segment...",sdkCall:a=>a.contacts.segments.add(s),errorCode:"add_segment_error",successMsg:`Contact added to segment: ${o}`},i)});ee();var __=new p("create").description("Create a new contact").option("--email <email>","Contact email address (required)").option("--first-name <name>","First name").option("--last-name <name>","Last name").option("--unsubscribed","Globally unsubscribe the contact from all broadcasts").option("--properties <json>",`Custom properties as a JSON string (e.g. '{"company":"Acme"}')`).option("--segment-id <id...>","Segment ID to add the contact to on creation (repeatable: --segment-id abc --segment-id def)").addHelpText("after",h({context:`Non-interactive: --email is required. All other flags are optional.
384
+ Non-interactive: --segment-id is required.`,output:' {"id":"<segment-membership-id>"}',errorCodes:["auth_error","missing_segment_id","add_segment_error"],examples:["resend contacts add-segment e169aa45-1ecf-4183-9955-b1499d5701d3 --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts add-segment steve.wozniak@gmail.com --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ke,i),o=await C(t.segmentId,lt,i),s={...Dr(n),segmentId:o};await B({loading:"Adding contact to segment...",sdkCall:a=>a.contacts.segments.add(s),errorCode:"add_segment_error",successMsg:`Contact added to segment: ${o}`},i)});ee();var a_=new p("create").description("Create a new contact").option("--email <email>","Contact email address (required)").option("--first-name <name>","First name").option("--last-name <name>","Last name").option("--unsubscribed","Globally unsubscribe the contact from all broadcasts").option("--properties <json>",`Custom properties as a JSON string (e.g. '{"company":"Acme"}')`).option("--segment-id <id...>","Segment ID to add the contact to on creation (repeatable: --segment-id abc --segment-id def)").addHelpText("after",h({context:`Non-interactive: --email is required. All other flags are optional.
395
385
 
396
386
  Properties: pass a JSON object string to --properties (e.g. '{"plan":"pro","company":"Acme"}').
397
387
  Properties are stored as custom contact attributes. To clear a property, set it to null.
@@ -399,10 +389,10 @@ Properties: pass a JSON object string to --properties (e.g. '{"plan":"pro","comp
399
389
 
400
390
  Segments: use --segment-id once per segment to add the contact to one or more segments on creation.
401
391
 
402
- Unsubscribed: setting --unsubscribed is a team-wide opt-out from all broadcasts, regardless of segments/topics.`,output:' {"object":"contact","id":"<id>"}',errorCodes:["auth_error","missing_email","invalid_properties","create_error"],examples:["resend contacts create --email steve.wozniak@gmail.com","resend contacts create --email steve.wozniak@gmail.com --first-name Steve --last-name Wozniak",`resend contacts create --email steve.wozniak@gmail.com --properties '{"company":"Acme","plan":"pro"}'`]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.email,{message:"Email address",placeholder:"steve.wozniak@gmail.com"},{message:"Missing --email flag.",code:"missing_email"},r),n=e.firstName,o=e.lastName;if(k()&&!r.json&&!e.firstName){let u=await te({message:"First name (optional)"});j(u)&&D("Cancelled."),u&&(n=u)}if(k()&&!r.json&&!e.lastName){let u=await te({message:"Last name (optional)"});j(u)&&D("Cancelled."),u&&(o=u)}let s=ou(e.properties,r),a=e.segmentId??[];await re({loading:"Creating contact...",sdkCall:u=>u.contacts.create({email:i,...n&&{firstName:n},...o&&{lastName:o},...e.unsubscribed&&{unsubscribed:!0},...s&&{properties:s},...a.length>0&&{segments:a.map(l=>({id:l}))}}),onInteractive:u=>{console.log(`Contact created: ${u.id}`)}},r)});var y_=new p("delete").alias("rm").description("Delete a contact").argument("[id]","Contact UUID or email address \u2014 both are accepted by the API").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`The <id> argument accepts either a UUID or an email address.
392
+ Unsubscribed: setting --unsubscribed is a team-wide opt-out from all broadcasts, regardless of segments/topics.`,output:' {"object":"contact","id":"<id>"}',errorCodes:["auth_error","missing_email","invalid_properties","create_error"],examples:["resend contacts create --email steve.wozniak@gmail.com","resend contacts create --email steve.wozniak@gmail.com --first-name Steve --last-name Wozniak",`resend contacts create --email steve.wozniak@gmail.com --properties '{"company":"Acme","plan":"pro"}'`]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.email,{message:"Email address",placeholder:"steve.wozniak@gmail.com"},{message:"Missing --email flag.",code:"missing_email"},r),n=e.firstName,o=e.lastName;if(O()&&!r.json&&!e.firstName){let u=await te({message:"First name (optional)"});P(u)&&T("Cancelled."),u&&(n=u)}if(O()&&!r.json&&!e.lastName){let u=await te({message:"Last name (optional)"});P(u)&&T("Cancelled."),u&&(o=u)}let s=tu(e.properties,r),a=e.segmentId??[];await re({loading:"Creating contact...",sdkCall:u=>u.contacts.create({email:i,...n&&{firstName:n},...o&&{lastName:o},...e.unsubscribed&&{unsubscribed:!0},...s&&{properties:s},...a.length>0&&{segments:a.map(l=>({id:l}))}}),onInteractive:u=>{console.log(`Contact created: ${u.id}`)}},r)});var u_=new p("delete").alias("rm").description("Delete a contact").argument("[id]","Contact UUID or email address \u2014 both are accepted by the API").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`The <id> argument accepts either a UUID or an email address.
403
393
 
404
- Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"contact","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend contacts delete 520784e2-887d-4c25-b53c-4ad46ad38100 --yes","resend contacts delete acme@example.com --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ee,i);await ue(n,!!t.yes,{confirmMessage:`Delete contact ${n}?
405
- This cannot be undone.`,loading:"Deleting contact...",object:"contact",successMsg:"Contact deleted",sdkCall:o=>o.contacts.remove(n)},i)});var C_=new p("get").description("Retrieve a contact by ID or email address").argument("[id]","Contact UUID or email address \u2014 both are accepted by the API").addHelpText("after",h({output:` {
394
+ Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"contact","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend contacts delete 520784e2-887d-4c25-b53c-4ad46ad38100 --yes","resend contacts delete acme@example.com --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ke,i);await ue(n,!!t.yes,{confirmMessage:`Delete contact ${n}?
395
+ This cannot be undone.`,loading:"Deleting contact...",object:"contact",successMsg:"Contact deleted",sdkCall:o=>o.contacts.remove(n)},i)});var l_=new p("get").description("Retrieve a contact by ID or email address").argument("[id]","Contact UUID or email address \u2014 both are accepted by the API").addHelpText("after",h({output:` {
406
396
  "object": "contact",
407
397
  "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
408
398
  "email": "steve.wozniak@gmail.com",
@@ -411,17 +401,17 @@ This cannot be undone.`,loading:"Deleting contact...",object:"contact",successMs
411
401
  "created_at": "2026-01-01T00:00:00.000Z",
412
402
  "unsubscribed": false,
413
403
  "properties": {}
414
- }`,errorCodes:["auth_error","fetch_error"],examples:["resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts get steve.wozniak@gmail.com","resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ee,i);await N({loading:"Fetching contact...",sdkCall:o=>o.contacts.get(n),onInteractive:o=>{let s=[o.first_name,o.last_name].filter(Boolean).join(" ");console.log(`${o.email}${s?` (${s})`:""}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`),console.log(`Unsubscribed: ${o.unsubscribed?"yes":"no"}`);let a=Object.entries(o.properties??{});if(a.length>0){console.log("Properties:");for(let[u,l]of a)console.log(` ${u}: ${l.value}`)}}},i)});var O_=new p("list").alias("ls").description("List all contacts").option("--limit <n>","Maximum number of contacts to return (1-100)","10").option("--after <cursor>","Return contacts after this cursor (next page)").option("--before <cursor>","Return contacts before this cursor (previous page)").addHelpText("after",h({context:`Contacts are global \u2014 they are not scoped to audiences or segments since the 2025 migration.
404
+ }`,errorCodes:["auth_error","fetch_error"],examples:["resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts get steve.wozniak@gmail.com","resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ke,i);await N({loading:"Fetching contact...",sdkCall:o=>o.contacts.get(n),onInteractive:o=>{let s=[o.first_name,o.last_name].filter(Boolean).join(" ");console.log(`${o.email}${s?` (${s})`:""}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`),console.log(`Unsubscribed: ${o.unsubscribed?"yes":"no"}`);let a=Object.entries(o.properties??{});if(a.length>0){console.log("Properties:");for(let[u,l]of a)console.log(` ${u}: ${l.value}`)}}},i)});var c_=new p("list").alias("ls").description("List all contacts").option("--limit <n>","Maximum number of contacts to return (1-100)","10").option("--after <cursor>","Return contacts after this cursor (next page)").option("--before <cursor>","Return contacts before this cursor (previous page)").addHelpText("after",h({context:`Contacts are global \u2014 they are not scoped to audiences or segments since the 2025 migration.
415
405
 
416
406
  Pagination: use --after or --before with a contact ID as the cursor.
417
407
  Only one of --after or --before may be used at a time.
418
- The response includes has_more: true when additional pages exist.`,output:' {"object":"list","data":[{"id":"...","email":"...","first_name":"...","last_name":"...","unsubscribed":false}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend contacts list","resend contacts list --limit 25 --json","resend contacts list --after 479e3145-dd38-4932-8c0c-e58b548c9e76 --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching contacts...",sdkCall:o=>o.contacts.list(n),onInteractive:o=>{console.log(h_(o.data)),Y(o,"contacts list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var S_=new p("remove-segment").description("Remove a contact from a segment").argument("[contactId]","Contact UUID or email address").argument("[segmentId]","Segment ID to remove the contact from").addHelpText("after",h({context:`The <contactId> argument accepts either a UUID or an email address.
419
- The <segmentId> argument must be a segment UUID (not an email).`,output:' {"id":"<segment-id>","deleted":true}',errorCodes:["auth_error","remove_segment_error"],examples:["resend contacts remove-segment e169aa45-1ecf-4183-9955-b1499d5701d3 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts remove-segment steve.wozniak@gmail.com 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r,i)=>{let n=i.optsWithGlobals(),o=await C(e,Ee,n),s=await C(t,ut,n),a={...Tr(o),segmentId:s};await F({loading:"Removing contact from segment...",sdkCall:u=>u.contacts.segments.remove(a),errorCode:"remove_segment_error",successMsg:`Contact removed from segment: ${s}`},n)});var x_=new p("segments").description("List the segments a contact belongs to").argument("[id]","Contact UUID or email address").addHelpText("after",h({context:"The <id> argument accepts either a UUID or an email address.",output:' {"object":"list","data":[{"id":"<segment-uuid>","name":"Newsletter Subscribers","created_at":"..."}],"has_more":false}',errorCodes:["auth_error","list_error"],examples:["resend contacts segments e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts segments steve.wozniak@gmail.com","resend contacts segments e169aa45-1ecf-4183-9955-b1499d5701d3 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ee,i);await q({loading:"Fetching segments...",sdkCall:o=>o.contacts.segments.list(Tr(n)),onInteractive:o=>console.log(ru(o.data))},i)});var w_=new p("topics").description("List a contact's topic subscriptions").argument("[id]","Contact UUID or email address").addHelpText("after",h({context:`The <id> argument accepts either a UUID or an email address.
408
+ The response includes has_more: true when additional pages exist.`,output:' {"object":"list","data":[{"id":"...","email":"...","first_name":"...","last_name":"...","unsubscribed":false}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend contacts list","resend contacts list --limit 25 --json","resend contacts list --after 479e3145-dd38-4932-8c0c-e58b548c9e76 --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching contacts...",sdkCall:o=>o.contacts.list(n),onInteractive:o=>{console.log(i_(o.data)),K(o,"contacts list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var d_=new p("remove-segment").description("Remove a contact from a segment").argument("[contactId]","Contact UUID or email address").argument("[segmentId]","Segment ID to remove the contact from").addHelpText("after",h({context:`The <contactId> argument accepts either a UUID or an email address.
409
+ The <segmentId> argument must be a segment UUID (not an email).`,output:' {"id":"<segment-id>","deleted":true}',errorCodes:["auth_error","remove_segment_error"],examples:["resend contacts remove-segment e169aa45-1ecf-4183-9955-b1499d5701d3 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts remove-segment steve.wozniak@gmail.com 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r,i)=>{let n=i.optsWithGlobals(),o=await C(e,ke,n),s=await C(t,lt,n),a={...Dr(o),segmentId:s};await B({loading:"Removing contact from segment...",sdkCall:u=>u.contacts.segments.remove(a),errorCode:"remove_segment_error",successMsg:`Contact removed from segment: ${s}`},n)});var m_=new p("segments").description("List the segments a contact belongs to").argument("[id]","Contact UUID or email address").addHelpText("after",h({context:"The <id> argument accepts either a UUID or an email address.",output:' {"object":"list","data":[{"id":"<segment-uuid>","name":"Newsletter Subscribers","created_at":"..."}],"has_more":false}',errorCodes:["auth_error","list_error"],examples:["resend contacts segments e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts segments steve.wozniak@gmail.com","resend contacts segments e169aa45-1ecf-4183-9955-b1499d5701d3 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ke,i);await R({loading:"Fetching segments...",sdkCall:o=>o.contacts.segments.list(Dr(n)),onInteractive:o=>console.log(Za(o.data))},i)});var p_=new p("topics").description("List a contact's topic subscriptions").argument("[id]","Contact UUID or email address").addHelpText("after",h({context:`The <id> argument accepts either a UUID or an email address.
420
410
 
421
411
  Topics control which broadcast email types a contact receives.
422
412
  subscription values: "opt_in" (receiving) | "opt_out" (not receiving)
423
413
 
424
- Use "resend contacts update-topics <id>" to change subscription statuses.`,output:' {"object":"list","data":[{"id":"...","name":"Product Updates","description":"...","subscription":"opt_in"}],"has_more":false}',errorCodes:["auth_error","list_error"],examples:["resend contacts topics e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts topics steve.wozniak@gmail.com","resend contacts topics e169aa45-1ecf-4183-9955-b1499d5701d3 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ee,i);await q({loading:"Fetching topic subscriptions...",sdkCall:o=>o.contacts.topics.list(Pr(n)),onInteractive:o=>console.log(g_(o.data))},i)});var k_=new p("update").description("Update a contact's subscription status or custom properties").argument("[id]","Contact UUID or email address \u2014 both are accepted by the API").option("--unsubscribed","Globally unsubscribe the contact from all broadcasts").option("--no-unsubscribed","Re-subscribe the contact (clears the global unsubscribe flag)").option("--properties <json>",`JSON object of properties to merge (e.g. '{"company":"Acme"}'); set a key to null to clear it`).addHelpText("after",h({context:`The <id> argument accepts either a UUID or an email address.
414
+ Use "resend contacts update-topics <id>" to change subscription statuses.`,output:' {"object":"list","data":[{"id":"...","name":"Product Updates","description":"...","subscription":"opt_in"}],"has_more":false}',errorCodes:["auth_error","list_error"],examples:["resend contacts topics e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts topics steve.wozniak@gmail.com","resend contacts topics e169aa45-1ecf-4183-9955-b1499d5701d3 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ke,i);await R({loading:"Fetching topic subscriptions...",sdkCall:o=>o.contacts.topics.list(Tr(n)),onInteractive:o=>console.log(n_(o.data))},i)});var f_=new p("update").description("Update a contact's subscription status or custom properties").argument("[id]","Contact UUID or email address \u2014 both are accepted by the API").option("--unsubscribed","Globally unsubscribe the contact from all broadcasts").option("--no-unsubscribed","Re-subscribe the contact (clears the global unsubscribe flag)").option("--properties <json>",`JSON object of properties to merge (e.g. '{"company":"Acme"}'); set a key to null to clear it`).addHelpText("after",h({context:`The <id> argument accepts either a UUID or an email address.
425
415
 
426
416
  Subscription toggle:
427
417
  --unsubscribed Sets unsubscribed: true \u2014 contact will not receive any broadcasts.
@@ -429,7 +419,7 @@ Subscription toggle:
429
419
  Omitting both flags leaves the subscription status unchanged.
430
420
 
431
421
  Properties: --properties merges the given JSON object with existing properties.
432
- Set a key to null to clear it: '{"company":null}'.`,output:' {"object":"contact","id":"<id>"}',errorCodes:["auth_error","invalid_properties","update_error"],examples:["resend contacts update e169aa45-1ecf-4183-9955-b1499d5701d3 --unsubscribed","resend contacts update acme@example.com --no-unsubscribed",`resend contacts update e169aa45-1ecf-4183-9955-b1499d5701d3 --properties '{"plan":"pro"}'`,"resend contacts update acme@example.com --unsubscribed --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ee,i),o=ou(t.properties,i),s={...Pr(n),...t.unsubscribed!==void 0&&{unsubscribed:t.unsubscribed},...o&&{properties:o}};await F({loading:"Updating contact...",sdkCall:a=>a.contacts.update(s),errorCode:"update_error",successMsg:`Contact updated: ${n}`},i)});ee();var A_=new p("update-topics").description("Update a contact's topic subscription statuses").argument("[id]","Contact UUID or email address").option("--topics <json>",`JSON array of topic subscriptions (required) \u2014 e.g. '[{"id":"topic-uuid","subscription":"opt_in"}]'`).addHelpText("after",h({context:`The <id> argument accepts either a UUID or an email address.
422
+ Set a key to null to clear it: '{"company":null}'.`,output:' {"object":"contact","id":"<id>"}',errorCodes:["auth_error","invalid_properties","update_error"],examples:["resend contacts update e169aa45-1ecf-4183-9955-b1499d5701d3 --unsubscribed","resend contacts update acme@example.com --no-unsubscribed",`resend contacts update e169aa45-1ecf-4183-9955-b1499d5701d3 --properties '{"plan":"pro"}'`,"resend contacts update acme@example.com --unsubscribed --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ke,i),o=tu(t.properties,i),s={...Tr(n),...t.unsubscribed!==void 0&&{unsubscribed:t.unsubscribed},...o&&{properties:o}};await B({loading:"Updating contact...",sdkCall:a=>a.contacts.update(s),errorCode:"update_error",successMsg:`Contact updated: ${n}`},i)});ee();var h_=new p("update-topics").description("Update a contact's topic subscription statuses").argument("[id]","Contact UUID or email address").option("--topics <json>",`JSON array of topic subscriptions (required) \u2014 e.g. '[{"id":"topic-uuid","subscription":"opt_in"}]'`).addHelpText("after",h({context:`The <id> argument accepts either a UUID or an email address.
433
423
 
434
424
  Non-interactive: --topics is required.
435
425
 
@@ -438,7 +428,7 @@ Topics JSON format:
438
428
  subscription values: "opt_in" | "opt_out"
439
429
 
440
430
  This operation replaces all topic subscriptions for the specified topics.
441
- Topics not included in the array are left unchanged.`,output:' {"id":"<contact-id>"}',errorCodes:["auth_error","missing_topics","invalid_topics","update_topics_error"],examples:[`resend contacts update-topics e169aa45-1ecf-4183-9955-b1499d5701d3 --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_in"}]'`,`resend contacts update-topics steve.wozniak@gmail.com --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_out"},{"id":"07d84122-7224-4881-9c31-1c048e204602","subscription":"opt_in"}]' --json`]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ee,i),o=await oe(i),s=t.topics;if(!s){(!k()||i.json)&&v({message:"Missing --topics flag.",code:"missing_topics"},{json:i.json});let l=await te({message:`Topics JSON (e.g. '[{"id":"topic-uuid","subscription":"opt_in"}]')`,placeholder:'[{"id":"topic-uuid","subscription":"opt_in"}]',validate:d=>d?void 0:"Required"});j(l)&&D("Cancelled."),s=l}let a=b_(s,i),u=await He("Updating topic subscriptions...",()=>o.contacts.topics.update({...Pr(n),topics:a}),"update_topics_error",i);!i.json&&k()?console.log(`Topic subscriptions updated for contact: ${n}`):z(u,{json:i.json})});var E_=new p("contacts").description("Manage contacts").addHelpText("after",h({context:`Contacts are global entities (not audience-scoped since the 2025 migration).
431
+ Topics not included in the array are left unchanged.`,output:' {"id":"<contact-id>"}',errorCodes:["auth_error","missing_topics","invalid_topics","update_topics_error"],examples:[`resend contacts update-topics e169aa45-1ecf-4183-9955-b1499d5701d3 --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_in"}]'`,`resend contacts update-topics steve.wozniak@gmail.com --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_out"},{"id":"07d84122-7224-4881-9c31-1c048e204602","subscription":"opt_in"}]' --json`]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ke,i),o=await oe(i),s=t.topics;if(!s){(!O()||i.json)&&g({message:"Missing --topics flag.",code:"missing_topics"},{json:i.json});let l=await te({message:`Topics JSON (e.g. '[{"id":"topic-uuid","subscription":"opt_in"}]')`,placeholder:'[{"id":"topic-uuid","subscription":"opt_in"}]',validate:c=>c?void 0:"Required"});P(l)&&T("Cancelled."),s=l}let a=o_(s,i),u=await Me("Updating topic subscriptions...",()=>o.contacts.topics.update({...Tr(n),topics:a}),"update_topics_error",i);!i.json&&O()?console.log(`Topic subscriptions updated for contact: ${n}`):F(u,{json:i.json})});var g_=new p("contacts").description("Manage contacts").addHelpText("after",h({context:`Contacts are global entities (not audience-scoped since the 2025 migration).
442
432
  Each contact is identified by a UUID or email address \u2014 both are accepted in all subcommands.
443
433
 
444
434
  Properties:
@@ -452,7 +442,7 @@ Subscription:
452
442
 
453
443
  Segments:
454
444
  Contacts can belong to multiple segments. Segments determine which contacts receive a broadcast.
455
- Manage membership with "resend contacts add-segment" and "resend contacts remove-segment".`,examples:["resend contacts list","resend contacts create --email steve.wozniak@gmail.com --first-name Steve","resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts get steve.wozniak@gmail.com","resend contacts update acme@example.com --unsubscribed","resend contacts delete e169aa45-1ecf-4183-9955-b1499d5701d3 --yes","resend contacts segments steve.wozniak@gmail.com","resend contacts add-segment steve.wozniak@gmail.com --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts remove-segment steve.wozniak@gmail.com 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts topics steve.wozniak@gmail.com",`resend contacts update-topics steve.wozniak@gmail.com --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_in"}]'`]})).addCommand(__).addCommand(C_).addCommand(O_,{isDefault:!0}).addCommand(k_).addCommand(y_).addCommand(x_).addCommand(v_).addCommand(S_).addCommand(w_).addCommand(A_);var P_=new p("docs").description("Open the Resend documentation in your browser").addHelpText("after",h({context:"Opens https://resend.com/docs in your default browser.",examples:["resend docs"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await Fe(Se.documentation,r)});je();$c();ee();ui();zt();async function cw(){try{let e=await fetch(Uc,{headers:{Accept:"application/vnd.github.v3+json"},signal:AbortSignal.timeout(5e3)});if(!e.ok)return{name:"CLI Version",status:"warn",message:`v${se} (could not check for updates)`};let t=await e.json();if(t.prerelease||t.draft)return{name:"CLI Version",status:"warn",message:`v${se} (could not check for updates)`};let r=t.tag_name?.replace(/^v/,"")??"unknown";return r===se?{name:"CLI Version",status:"pass",message:`v${se} (latest)`}:{name:"CLI Version",status:"warn",message:`v${se} (latest: v${r})`,detail:"Update available"}}catch{return{name:"CLI Version",status:"warn",message:`v${se} (could not check for updates)`}}}async function dw(e){let t=await rr(e);if(!t)return{name:"API Key",status:"fail",message:"No API key found",detail:"Run: resend login"};let r=t.profile?`, profile: ${t.profile}`:"";return{name:"API Key",status:"pass",message:`${tr(t.key)} (source: ${t.source}${r})`}}async function mw(e){let t=await rr(e);if(!t)return{name:"API Validation",status:"fail",message:"Skipped \u2014 no API key"};try{let r=new vr(t.key),{data:i,error:n}=await r.domains.list();if(n)return n.name==="restricted_api_key"?{name:"API Validation",status:"warn",message:"Sending-only API key",detail:_r}:{name:"API Validation",status:"fail",message:`API key invalid: ${n.message}`};let o=i?.data??[],s=o.filter(u=>u.status==="verified"),a=o.filter(u=>u.status!=="verified");return o.length===0?{name:"Domains",status:"warn",message:"No domains configured",detail:"Add a domain at https://resend.com/domains"}:s.length===0?{name:"Domains",status:"warn",message:`${a.length} domain(s) pending verification`,detail:o.map(u=>`${u.name} (${u.status})`).join(", ")}:{name:"Domains",status:"pass",message:`${s.length} verified, ${a.length} pending`,detail:o.map(u=>`${u.name} (${u.status})`).join(", ")}}catch(r){return{name:"API Validation",status:"fail",message:Q(r,"Failed to validate API key")}}}var q_=new p("doctor").description("Check CLI version, API key, and domain status").addHelpText("after",h({setup:!0,context:`Checks performed:
445
+ Manage membership with "resend contacts add-segment" and "resend contacts remove-segment".`,examples:["resend contacts list","resend contacts create --email steve.wozniak@gmail.com --first-name Steve","resend contacts get e169aa45-1ecf-4183-9955-b1499d5701d3","resend contacts get steve.wozniak@gmail.com","resend contacts update acme@example.com --unsubscribed","resend contacts delete e169aa45-1ecf-4183-9955-b1499d5701d3 --yes","resend contacts segments steve.wozniak@gmail.com","resend contacts add-segment steve.wozniak@gmail.com --segment-id 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts remove-segment steve.wozniak@gmail.com 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend contacts topics steve.wozniak@gmail.com",`resend contacts update-topics steve.wozniak@gmail.com --topics '[{"id":"b6d24b8e-af0b-4c3c-be0c-359bbd97381e","subscription":"opt_in"}]'`]})).addCommand(a_).addCommand(l_).addCommand(c_,{isDefault:!0}).addCommand(f_).addCommand(u_).addCommand(m_).addCommand(s_).addCommand(d_).addCommand(p_).addCommand(h_);var b_=new p("docs").description("Open the Resend documentation in your browser").addHelpText("after",h({context:"Opens https://resend.com/docs in your default browser.",examples:["resend docs"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await Je(Oe.documentation,r)});De();xc();ee();ui();Ft();async function Fx(){try{let e=await fetch(Rc,{headers:{Accept:"application/vnd.github.v3+json"},signal:AbortSignal.timeout(5e3)});if(!e.ok)return{name:"CLI Version",status:"warn",message:`v${se} (could not check for updates)`};let t=await e.json();if(t.prerelease||t.draft)return{name:"CLI Version",status:"warn",message:`v${se} (could not check for updates)`};let r=t.tag_name?.replace(/^v/,"")??"unknown";return r===se?{name:"CLI Version",status:"pass",message:`v${se} (latest)`}:{name:"CLI Version",status:"warn",message:`v${se} (latest: v${r})`,detail:"Update available"}}catch{return{name:"CLI Version",status:"warn",message:`v${se} (could not check for updates)`}}}async function zx(e){let t=await rr(e);if(!t)return{name:"API Key",status:"fail",message:"No API key found",detail:"Run: resend login"};let r=t.profile?`, profile: ${t.profile}`:"";return{name:"API Key",status:"pass",message:`${tr(t.key)} (source: ${t.source}${r})`}}async function Mx(e){let t=await rr(e);if(!t)return{name:"API Validation",status:"fail",message:"Skipped \u2014 no API key"};try{let r=new _r(t.key),{data:i,error:n}=await r.domains.list();if(n)return n.name==="restricted_api_key"?{name:"API Validation",status:"warn",message:"Sending-only API key",detail:yr}:{name:"API Validation",status:"fail",message:`API key invalid: ${n.message}`};let o=i?.data??[],s=o.filter(u=>u.status==="verified"),a=o.filter(u=>u.status!=="verified");return o.length===0?{name:"Domains",status:"warn",message:"No domains configured",detail:"Add a domain at https://resend.com/domains"}:s.length===0?{name:"Domains",status:"warn",message:`${a.length} domain(s) pending verification`,detail:o.map(u=>`${u.name} (${u.status})`).join(", ")}:{name:"Domains",status:"pass",message:`${s.length} verified, ${a.length} pending`,detail:o.map(u=>`${u.name} (${u.status})`).join(", ")}}catch(r){return{name:"API Validation",status:"fail",message:Y(r,"Failed to validate API key")}}}var S_=new p("doctor").description("Check CLI version, API key, and domain status").addHelpText("after",h({setup:!0,context:`Checks performed:
456
446
  CLI Version Is the installed version up to date?
457
447
  API Key Is a key present (--api-key, RESEND_API_KEY, or credentials file)?
458
448
  Credential Storage Which backend is storing credentials (secure storage vs plaintext file)?
@@ -465,27 +455,27 @@ Segments:
465
455
  ]
466
456
  }
467
457
  status values: "pass" | "warn" | "fail"
468
- Exit code 1 if any check has status "fail"`,examples:["resend doctor","resend doctor --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=[],n=k()&&!r.json;n&&console.log(`
458
+ Exit code 1 if any check has status "fail"`,examples:["resend doctor","resend doctor --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=[],n=O()&&!r.json;n&&console.log(`
469
459
  Resend Doctor
470
- `);let o=n?he("Checking CLI version..."):null,s=await cw();i.push(s),s.status==="warn"?o?.warn(s.message):o?.stop(s.message),o=n?he("Checking API key..."):null;let a=await dw(r.apiKey);i.push(a),a.status==="fail"?o?.fail(a.message):o?.stop(a.message),o=n?he("Checking credential storage..."):null;let u=await ht(),l=Ae(),d=u.isSecure,c={name:"Credential Storage",status:d?"pass":"warn",message:d?u.name:"plaintext file",...!d&&process.env.RESEND_CREDENTIAL_STORE!=="file"&&(l?.storage==="secure_storage"||process.env.RESEND_CREDENTIAL_STORE==="secure_storage"||process.env.RESEND_CREDENTIAL_STORE==="keychain")?{detail:"Secure backend unavailable despite secure storage preference \u2014 falling back to plaintext"}:{}};i.push(c),c.status==="warn"?o?.warn(c.message):o?.stop(c.message),o=n?he("Validating API key & domains..."):null;let m=await mw(r.apiKey);i.push(m),m.status==="fail"?o?.fail(m.message):m.status==="warn"?o?.warn(m.message):o?.stop(m.message);let _=i.some(g=>g.status==="fail");!r.json&&k()?console.log(""):z({ok:!_,checks:i},{json:r.json}),_&&process.exit(1)});var R_=new p("create").description("Create a new domain and receive DNS records to configure").option("--name <domain>","Domain name (e.g. example.com)").addOption(new ce("--region <region>","Sending region").choices(["us-east-1","eu-west-1","sa-east-1","ap-northeast-1"])).addOption(new ce("--tls <mode>","TLS mode (default: opportunistic)").choices(["opportunistic","enforced"])).option("--sending","Enable sending capability (default: enabled)").option("--receiving","Enable receiving capability (default: disabled)").addHelpText("after",h({context:"Non-interactive: --name is required (no prompts when stdin/stdout is not a TTY)",output:" Full domain object with DNS records array to configure in your DNS provider.",errorCodes:["auth_error","missing_name","create_error"],examples:["resend domains create --name example.com","resend domains create --name example.com --region eu-west-1 --tls enforced","resend domains create --name example.com --receiving --json","resend domains create --name example.com --sending --receiving --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.name,{message:"Domain name",placeholder:"example.com"},{message:"Missing --name flag.",code:"missing_name"},r);await re({loading:"Creating domain...",sdkCall:n=>n.domains.create({name:i,...e.region&&{region:e.region},...e.tls&&{tls:e.tls},...(e.sending||e.receiving)&&{capabilities:{...e.sending&&{sending:"enabled"},...e.receiving&&{receiving:"enabled"}}}}),onInteractive:n=>{console.log(`Domain created: ${n.name} (id: ${n.id})`),console.log(`
471
- DNS Records to configure:`),console.log(Ya(n.records,n.name)),console.log(`
472
- Run \`resend domains verify ${n.id}\` after configuring DNS.`)}},r)});var z_=new p("delete").alias("rm").description("Delete a domain").argument("[id]","Domain ID").option("--yes","Skip confirmation prompt").addHelpText("after",h({context:"Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.",output:' {"object":"domain","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend domains delete 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --yes","resend domains delete 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,at,i);await ue(n,!!t.yes,{confirmMessage:`Delete domain ${n}?
473
- This cannot be undone.`,loading:"Deleting domain...",object:"domain",successMsg:"Domain deleted",sdkCall:o=>o.domains.remove(n)},i)});var M_=new p("get").description("Retrieve a domain with its DNS records and current verification status").argument("[id]","Domain ID").addHelpText("after",h({output:` Full domain object including records array and current status.
474
-
475
- Domain status values: not_started | pending | verified | failed | temporary_failure`,errorCodes:["auth_error","fetch_error"],examples:["resend domains get 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains get 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,at,i);await N({loading:"Fetching domain...",sdkCall:o=>o.domains.get(n),onInteractive:o=>{console.log(`${o.name} \u2014 ${sv(o.status)}`),console.log(`ID: ${o.id}`),console.log(`Region: ${o.region}`),console.log(`Created: ${o.created_at}`),o.records.length>0&&(console.log(`
476
- DNS Records:`),console.log(Ya(o.records,o.name)))}},i)});var J_=new p("list").alias("ls").description("List all domains").option("--limit <n>","Maximum number of domains to return (1-100)","10").option("--after <cursor>","Return domains after this cursor (next page)").option("--before <cursor>","Return domains before this cursor (previous page)").addHelpText("after",h({output:` {"object":"list","data":[...],"has_more":true}
477
- The list response does not include DNS records \u2014 use "resend domains get <id>" for that.`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend domains list","resend domains list --limit 25 --json","resend domains list --after <cursor> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching domains...",sdkCall:o=>o.domains.list(n),onInteractive:o=>{console.log(ov(o.data)),Y(o,"domains list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var H_=new p("update").description("Update domain settings: TLS mode, open tracking, and click tracking").argument("[id]","Domain ID").addOption(new ce("--tls <mode>","TLS mode").choices(["opportunistic","enforced"])).option("--open-tracking","Enable open tracking").option("--no-open-tracking","Disable open tracking").option("--click-tracking","Enable click tracking").option("--no-click-tracking","Disable click tracking").addHelpText("after",h({output:' {"object":"domain","id":"<id>"}',errorCodes:["auth_error","no_changes","update_error"],examples:["resend domains update <id> --tls enforced","resend domains update <id> --open-tracking --click-tracking","resend domains update <id> --no-open-tracking --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,at,i),{tls:o,openTracking:s,clickTracking:a}=t;!o&&s===void 0&&a===void 0&&v({message:"Provide at least one option to update: --tls, --open-tracking, or --click-tracking.",code:"no_changes"},{json:i.json});let u={id:n};o&&(u.tls=o),s!==void 0&&(u.openTracking=s),a!==void 0&&(u.clickTracking=a),await F({loading:"Updating domain...",sdkCall:l=>l.domains.update(u),errorCode:"update_error",successMsg:`Domain updated: ${n}`},i)});var F_=new p("verify").description("Trigger async DNS verification for a domain").argument("[id]","Domain ID").addHelpText("after",h({context:`Verification is async \u2014 the domain enters "pending" status while DNS records are checked.
478
- Poll the status with: resend domains get <id>`,output:' {"object":"domain","id":"<id>"}',errorCodes:["auth_error","verify_error"],examples:["resend domains verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,at,i);await F({loading:"Verifying domain...",sdkCall:o=>o.domains.verify(n),errorCode:"verify_error",successMsg:`Domain verification started. Check status with resend domains get ${n}.`},i)});var B_=new p("domains").description("Manage verified sending and receiving domains").addHelpText("after",h({context:`Domain lifecycle:
460
+ `);let o=n?he("Checking CLI version..."):null,s=await Fx();i.push(s),s.status==="warn"?o?.warn(s.message):o?.stop(s.message),o=n?he("Checking API key..."):null;let a=await zx(r.apiKey);i.push(a),a.status==="fail"?o?.fail(a.message):o?.stop(a.message),o=n?he("Checking credential storage..."):null;let u=await gt(),l=we(),c=u.isSecure,d={name:"Credential Storage",status:c?"pass":"warn",message:c?u.name:"plaintext file",...!c&&process.env.RESEND_CREDENTIAL_STORE!=="file"&&(l?.storage==="secure_storage"||process.env.RESEND_CREDENTIAL_STORE==="secure_storage"||process.env.RESEND_CREDENTIAL_STORE==="keychain")?{detail:"Secure backend unavailable despite secure storage preference \u2014 falling back to plaintext"}:{}};i.push(d),d.status==="warn"?o?.warn(d.message):o?.stop(d.message),o=n?he("Validating API key & domains..."):null;let m=await Mx(r.apiKey);i.push(m),m.status==="fail"?o?.fail(m.message):m.status==="warn"?o?.warn(m.message):o?.stop(m.message);let b=i.some(v=>v.status==="fail");!r.json&&O()?console.log(""):F({ok:!b,checks:i},{json:r.json}),b&&process.exit(1)});var x_=new p("create").description("Create a new domain and receive DNS records to configure").option("--name <domain>","Domain name (e.g. example.com)").addOption(new ce("--region <region>","Sending region").choices(["us-east-1","eu-west-1","sa-east-1","ap-northeast-1"])).addOption(new ce("--tls <mode>","TLS mode (default: opportunistic)").choices(["opportunistic","enforced"])).option("--sending","Enable sending capability (default: enabled)").option("--receiving","Enable receiving capability (default: disabled)").addHelpText("after",h({context:"Non-interactive: --name is required (no prompts when stdin/stdout is not a TTY)",output:" Full domain object with DNS records array to configure in your DNS provider.",errorCodes:["auth_error","missing_name","create_error"],examples:["resend domains create --name example.com","resend domains create --name example.com --region eu-west-1 --tls enforced","resend domains create --name example.com --receiving --json","resend domains create --name example.com --sending --receiving --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.name,{message:"Domain name",placeholder:"example.com"},{message:"Missing --name flag.",code:"missing_name"},r);await re({loading:"Creating domain...",sdkCall:n=>n.domains.create({name:i,...e.region&&{region:e.region},...e.tls&&{tls:e.tls},...(e.sending||e.receiving)&&{capabilities:{...e.sending&&{sending:"enabled"},...e.receiving&&{receiving:"enabled"}}}}),onInteractive:n=>{console.log(`Domain created: ${n.name} (id: ${n.id})`),console.log(`
461
+ DNS Records to configure:`),console.log(Ua(n.records,n.name)),console.log(`
462
+ Run \`resend domains verify ${n.id}\` after configuring DNS.`)}},r)});var w_=new p("delete").alias("rm").description("Delete a domain").argument("[id]","Domain ID").option("--yes","Skip confirmation prompt").addHelpText("after",h({context:"Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.",output:' {"object":"domain","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend domains delete 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --yes","resend domains delete 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ut,i);await ue(n,!!t.yes,{confirmMessage:`Delete domain ${n}?
463
+ This cannot be undone.`,loading:"Deleting domain...",object:"domain",successMsg:"Domain deleted",sdkCall:o=>o.domains.remove(n)},i)});var k_=new p("get").description("Retrieve a domain with its DNS records and current verification status").argument("[id]","Domain ID").addHelpText("after",h({output:` Full domain object including records array and current status.
464
+
465
+ Domain status values: not_started | pending | verified | failed | temporary_failure`,errorCodes:["auth_error","fetch_error"],examples:["resend domains get 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains get 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ut,i);await N({loading:"Fetching domain...",sdkCall:o=>o.domains.get(n),onInteractive:o=>{console.log(`${o.name} \u2014 ${V0(o.status)}`),console.log(`ID: ${o.id}`),console.log(`Region: ${o.region}`),console.log(`Created: ${o.created_at}`),o.records.length>0&&(console.log(`
466
+ DNS Records:`),console.log(Ua(o.records,o.name)))}},i)});var A_=new p("list").alias("ls").description("List all domains").option("--limit <n>","Maximum number of domains to return (1-100)","10").option("--after <cursor>","Return domains after this cursor (next page)").option("--before <cursor>","Return domains before this cursor (previous page)").addHelpText("after",h({output:` {"object":"list","data":[...],"has_more":true}
467
+ The list response does not include DNS records \u2014 use "resend domains get <id>" for that.`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend domains list","resend domains list --limit 25 --json","resend domains list --after <cursor> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching domains...",sdkCall:o=>o.domains.list(n),onInteractive:o=>{console.log(W0(o.data)),K(o,"domains list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var E_=new p("update").description("Update domain settings: TLS mode, open tracking, and click tracking").argument("[id]","Domain ID").addOption(new ce("--tls <mode>","TLS mode").choices(["opportunistic","enforced"])).option("--open-tracking","Enable open tracking").option("--no-open-tracking","Disable open tracking").option("--click-tracking","Enable click tracking").option("--no-click-tracking","Disable click tracking").addHelpText("after",h({output:' {"object":"domain","id":"<id>"}',errorCodes:["auth_error","no_changes","update_error"],examples:["resend domains update <id> --tls enforced","resend domains update <id> --open-tracking --click-tracking","resend domains update <id> --no-open-tracking --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ut,i),{tls:o,openTracking:s,clickTracking:a}=t;!o&&s===void 0&&a===void 0&&g({message:"Provide at least one option to update: --tls, --open-tracking, or --click-tracking.",code:"no_changes"},{json:i.json});let u={id:n};o&&(u.tls=o),s!==void 0&&(u.openTracking=s),a!==void 0&&(u.clickTracking=a),await B({loading:"Updating domain...",sdkCall:l=>l.domains.update(u),errorCode:"update_error",successMsg:`Domain updated: ${n}`},i)});var P_=new p("verify").description("Trigger async DNS verification for a domain").argument("[id]","Domain ID").addHelpText("after",h({context:`Verification is async \u2014 the domain enters "pending" status while DNS records are checked.
468
+ Poll the status with: resend domains get <id>`,output:' {"object":"domain","id":"<id>"}',errorCodes:["auth_error","verify_error"],examples:["resend domains verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ut,i);await B({loading:"Verifying domain...",sdkCall:o=>o.domains.verify(n),errorCode:"verify_error",successMsg:`Domain verification started. Check status with resend domains get ${n}.`},i)});var T_=new p("domains").description("Manage verified sending and receiving domains").addHelpText("after",h({context:`Domain lifecycle:
479
469
  1. resend domains create --name example.com (get DNS records)
480
470
  2. Configure DNS records at your DNS provider
481
471
  3. resend domains verify <id> (trigger verification)
482
- 4. resend domains get <id> (poll until "verified")`,examples:["resend domains list","resend domains create --name example.com --region us-east-1","resend domains verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains get 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains update <id> --tls enforced --open-tracking","resend domains delete <id> --yes"]})).addCommand(R_).addCommand(F_).addCommand(M_).addCommand(J_,{isDefault:!0}).addCommand(H_).addCommand(z_);var lt={resource:"email",resourcePlural:"emails",fetchItems:(e,{limit:t,after:r})=>e.emails.list({limit:t,...r&&{after:r}}),display:e=>({label:e.subject||"(no subject)",hint:e.id})};function N_(e){return{resource:"attachment",resourcePlural:"attachments",fetchItems:(t,{limit:r,after:i})=>t.emails.attachments.list({emailId:e,limit:r,...i&&{after:i}}),display:t=>({label:t.filename??"(unnamed)",hint:t.id})}}function uu(e){let t=e.map(r=>[r.filename??"(unnamed)",r.content_type,String(r.size),r.id]);return M(["Filename","Content-Type","Size (bytes)","ID"],t,"(no attachments)")}var L_=new p("attachment").description("Retrieve a single attachment from a sent (outbound) email").argument("[emailId]","Email UUID").argument("[attachmentId]","Attachment UUID").addHelpText("after",h({context:`The download_url is a signed URL that expires in ~1 hour. Download the file directly:
483
- resend emails attachment <emailId> <attachmentId> --json | jq -r .download_url | xargs curl -O`,output:' {"object":"attachment","id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<signed-url>","expires_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend emails attachment <email-id> <attachment-id>","resend emails attachment <email-id> <attachment-id> --json"]})).action(async(e,t,r,i)=>{let n=i.optsWithGlobals(),o=await C(e,lt,n),s=await C(t,N_(o),n);await N({loading:"Fetching attachment...",sdkCall:a=>a.emails.attachments.get({emailId:o,id:s}),onInteractive:a=>{console.log(`${a.filename??"(unnamed)"}`),console.log(`ID: ${a.id}`),console.log(`Content-Type: ${a.content_type}`),console.log(`Size: ${a.size} bytes`),console.log(`Disposition: ${a.content_disposition}`),console.log(`Download URL: ${a.download_url}`),console.log(`Expires: ${a.expires_at}`)}},n)});var G_=new p("attachments").description("List attachments on a sent (outbound) email").argument("[emailId]","Email UUID").option("--limit <n>","Maximum number of attachments to return (1-100)","10").option("--after <cursor>","Return attachments after this cursor (next page)").option("--before <cursor>","Return attachments before this cursor (previous page)").addHelpText("after",h({context:`Each attachment has a download_url (signed, expires ~1 hour).
472
+ 4. resend domains get <id> (poll until "verified")`,examples:["resend domains list","resend domains create --name example.com --region us-east-1","resend domains verify 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains get 4dd369bc-aa82-4ff3-97de-514ae3000ee0","resend domains update <id> --tls enforced --open-tracking","resend domains delete <id> --yes"]})).addCommand(x_).addCommand(P_).addCommand(k_).addCommand(A_,{isDefault:!0}).addCommand(E_).addCommand(w_);var ct={resource:"email",resourcePlural:"emails",fetchItems:(e,{limit:t,after:r})=>e.emails.list({limit:t,...r&&{after:r}}),display:e=>({label:e.subject||"(no subject)",hint:e.id})};function D_(e){return{resource:"attachment",resourcePlural:"attachments",fetchItems:(t,{limit:r,after:i})=>t.emails.attachments.list({emailId:e,limit:r,...i&&{after:i}}),display:t=>({label:t.filename??"(unnamed)",hint:t.id})}}function nu(e){let t=e.map(r=>[r.filename??"(unnamed)",r.content_type,String(r.size),r.id]);return z(["Filename","Content-Type","Size (bytes)","ID"],t,"(no attachments)")}var I_=new p("attachment").description("Retrieve a single attachment from a sent (outbound) email").argument("[emailId]","Email UUID").argument("[attachmentId]","Attachment UUID").addHelpText("after",h({context:`The download_url is a signed URL that expires in ~1 hour. Download the file directly:
473
+ resend emails attachment <emailId> <attachmentId> --json | jq -r .download_url | xargs curl -O`,output:' {"object":"attachment","id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<signed-url>","expires_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend emails attachment <email-id> <attachment-id>","resend emails attachment <email-id> <attachment-id> --json"]})).action(async(e,t,r,i)=>{let n=i.optsWithGlobals(),o=await C(e,ct,n),s=await C(t,D_(o),n);await N({loading:"Fetching attachment...",sdkCall:a=>a.emails.attachments.get({emailId:o,id:s}),onInteractive:a=>{console.log(`${a.filename??"(unnamed)"}`),console.log(`ID: ${a.id}`),console.log(`Content-Type: ${a.content_type}`),console.log(`Size: ${a.size} bytes`),console.log(`Disposition: ${a.content_disposition}`),console.log(`Download URL: ${a.download_url}`),console.log(`Expires: ${a.expires_at}`)}},n)});var j_=new p("attachments").description("List attachments on a sent (outbound) email").argument("[emailId]","Email UUID").option("--limit <n>","Maximum number of attachments to return (1-100)","10").option("--after <cursor>","Return attachments after this cursor (next page)").option("--before <cursor>","Return attachments before this cursor (previous page)").addHelpText("after",h({context:`Each attachment has a download_url (signed, expires ~1 hour).
484
474
  Use the attachment sub-command to retrieve a single attachment with its download URL:
485
475
  resend emails attachment <emailId> <attachmentId>
486
476
 
487
477
  content_disposition: "inline" means the attachment is embedded in the HTML body (e.g. an image).
488
- content_disposition: "attachment" means it is a standalone file download.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<url>","expires_at":"<iso-date>"}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails attachments <email-id>","resend emails attachments <email-id> --json","resend emails attachments <email-id> --limit 25 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,lt,i),o=V(t.limit,i),s=K(o,t.after,t.before,i);await q({loading:"Fetching attachments...",sdkCall:a=>a.emails.attachments.list({emailId:n,...s}),onInteractive:a=>{console.log(uu(a.data)),Y(a,`emails attachments ${n}`,{limit:o,before:t.before,apiKey:i.apiKey,profile:i.profile})}},i)});ee();var U_=new p("batch").description("Send up to 100 emails in a single API request from a JSON file").option("--file <path>",'Path to a JSON file containing an array of email objects (use "-" for stdin; required in non-interactive mode)').option("--react-email <path>","Path to a React Email template (.tsx) \u2014 rendered HTML is set on every email in the batch (npm install only)").option("--idempotency-key <key>","Deduplicate this batch request using this key").addOption(new ce("--batch-validation <mode>","Validation mode: strict (default, fail all on error) or permissive (partial success)").choices(["strict","permissive"])).addHelpText("after",h({context:`Non-interactive: --file
478
+ content_disposition: "attachment" means it is a standalone file download.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<url>","expires_at":"<iso-date>"}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails attachments <email-id>","resend emails attachments <email-id> --json","resend emails attachments <email-id> --limit 25 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ct,i),o=W(t.limit,i),s=V(o,t.after,t.before,i);await R({loading:"Fetching attachments...",sdkCall:a=>a.emails.attachments.list({emailId:n,...s}),onInteractive:a=>{console.log(nu(a.data)),K(a,`emails attachments ${n}`,{limit:o,before:t.before,apiKey:i.apiKey,profile:i.profile})}},i)});ee();var $_=new p("batch").description("Send up to 100 emails in a single API request from a JSON file").option("--file <path>",'Path to a JSON file containing an array of email objects (use "-" for stdin; required in non-interactive mode)').option("--react-email <path>","Path to a React Email template (.tsx) \u2014 rendered HTML is set on every email in the batch (npm install only)").option("--idempotency-key <key>","Deduplicate this batch request using this key").addOption(new ce("--batch-validation <mode>","Validation mode: strict (default, fail all on error) or permissive (partial success)").choices(["strict","permissive"])).addHelpText("after",h({context:`Non-interactive: --file
489
479
  Limit: 100 emails per request (API hard limit \u2014 warned if exceeded)
490
480
  Unsupported per-email fields: attachments, scheduled_at
491
481
 
@@ -493,52 +483,52 @@ File format (--file path):
493
483
  [
494
484
  {"from":"onboarding@resend.com","to":["delivered@resend.com"],"subject":"Hello","text":"Hi"},
495
485
  {"from":"onboarding@resend.com","to":["delivered@resend.com"],"subject":"Hello","html":"<b>Hi</b>"}
496
- ]`,output:' [{"id":"<email-id>"},{"id":"<email-id>"}]',errorCodes:["auth_error","missing_file","file_read_error","stdin_read_error","invalid_json","invalid_format","react_email_build_error","react_email_render_error","batch_error"],examples:["resend emails batch --file ./emails.json","resend emails batch --file ./emails.json --batch-validation permissive",`echo '[{"from":"onboarding@resend.com","to":["delivered@resend.com"],"subject":"Hi","text":"Hello"}]' | resend emails batch --file -`]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await oe(r,{permission:"sending_access"}),n=await U(e.file,{message:"Path to JSON file",placeholder:"./emails.json"},{message:"Missing --file flag. Provide a JSON file with an array of email objects.",code:"missing_file"},r),o=ge(n,r),s;try{s=JSON.parse(o)}catch{v({message:"File content is not valid JSON.",code:"invalid_json"},{json:r.json})}Array.isArray(s)||v({message:"File content must be a JSON array of email objects.",code:"invalid_format"},{json:r.json});let a=s;if(a.length>100&&console.warn(`Warning: ${a.length} emails exceeds the 100-email limit. The API may reject this request.`),e.reactEmail){let c=await et(e.reactEmail,r);for(let m of a)m.html=c}for(let c=0;c<a.length;c++){let m=a[c];(m===null||typeof m!="object"||Array.isArray(m))&&v({message:`Email at index ${c} must be a JSON object.`,code:"invalid_format"},{json:r.json}),"attachments"in m&&v({message:`Email at index ${c} contains "attachments", which is not supported in batch sends.`,code:"batch_error"},{json:r.json}),"scheduled_at"in m&&v({message:`Email at index ${c} contains "scheduled_at", which is not supported in batch sends.`,code:"batch_error"},{json:r.json})}let u=await He("Sending batch...",()=>{let c={...e.idempotencyKey&&{idempotencyKey:e.idempotencyKey},...e.batchValidation&&{batchValidation:e.batchValidation}};return i.batch.send(a,Object.keys(c).length>0?c:void 0)},"batch_error",r),l=u.data,d=u.errors;if(!r.json&&k()){console.log(`Sent ${l.length} email${l.length===1?"":"s"}`);for(let c of l)console.log(` ${c.id}`);if(d&&d.length>0){console.warn(`
497
- ${d.length} email${d.length===1?"":"s"} failed:`);for(let c of d)console.warn(` [${c.index}] ${c.message}`)}}else z(d&&d.length>0?{data:l,errors:d}:l,{json:r.json})});var W_=new p("cancel").description("Cancel a scheduled email").argument("[id]","Email ID").addHelpText("after",h({output:' {"object":"email","id":"<email-id>"}',errorCodes:["auth_error","cancel_error"],examples:["resend emails cancel <email-id>","resend emails cancel <email-id> --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,lt,i);await F({loading:"Cancelling email...",sdkCall:o=>o.emails.cancel(n),errorCode:"cancel_error",successMsg:`Email cancelled: ${n}`},i)});var V_=new p("get").description("Retrieve a sent email by ID").argument("[id]","Email ID").addHelpText("after",h({output:' {"object":"email","id":"<uuid>","from":"onboarding@resend.com","to":["delivered@resend.com"],"subject":"Hello","html":"<p>Hi</p>","text":"Hi","last_event":"delivered","created_at":"<iso-date>","scheduled_at":null,"bcc":null,"cc":null,"reply_to":null}',errorCodes:["auth_error","fetch_error"],examples:["resend emails get <email-id>","resend emails get <email-id> --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,lt,i);await N({loading:"Fetching email...",sdkCall:o=>o.emails.get(n),onInteractive:o=>{console.log(`From: ${o.from}`),console.log(`To: ${o.to.join(", ")}`),console.log(`Subject: ${o.subject}`),console.log(`Status: ${o.last_event}`),console.log(`Date: ${o.created_at}`),o.scheduled_at&&console.log(`Scheduled: ${o.scheduled_at}`)}},i)});function pw(e){let t=e.map(r=>{let i=r.to.join(", "),n=i.length>40?`${i.slice(0,37)}...`:i,o=r.subject.length>50?`${r.subject.slice(0,47)}...`:r.subject;return[r.from,n,o,r.last_event??"\u2014",r.created_at,r.id]});return M(["From","To","Subject","Status","Created","ID"],t,"(no sent emails)")}var K_=new p("list").alias("ls").description('List sent emails \u2014 returns summary (use "get <id>" for full details)').option("--limit <n>","Maximum number of emails to return (1-100)","10").option("--after <cursor>","Cursor for forward pagination \u2014 list items after this ID").option("--before <cursor>","Cursor for backward pagination \u2014 list items before this ID").addHelpText("after",h({context:"Lists emails sent by your team. For emails received by your domain, use: resend emails receiving list",output:' {"object":"list","has_more":false,"data":[{"id":"...","to":["..."],"from":"...","subject":"...","created_at":"...","last_event":"delivered|opened|...","scheduled_at":null}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails list","resend emails list --limit 5","resend emails list --after <email-id> --limit 10","resend emails list --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching sent emails...",sdkCall:o=>o.emails.list(n),onInteractive:o=>{console.log(pw(o.data)),Y(o,"emails list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var It={resource:"received email",resourcePlural:"received emails",fetchItems:(e,{limit:t,after:r})=>e.emails.receiving.list({limit:t,...r&&{after:r}}),display:e=>({label:e.subject||"(no subject)",hint:e.id})};function Y_(e){return{resource:"attachment",resourcePlural:"attachments",fetchItems:(t,{limit:r,after:i})=>t.emails.receiving.attachments.list({emailId:e,limit:r,...i&&{after:i}}),display:t=>({label:t.filename??"(unnamed)",hint:t.id})}}function Q_(e){let t=e.map(r=>{let i=r.to.join(", "),n=i.length>40?`${i.slice(0,37)}...`:i,o=r.subject.length>50?`${r.subject.slice(0,47)}...`:r.subject;return[r.from,n,o,r.created_at,r.id]});return M(["From","To","Subject","Created At","ID"],t,"(no received emails)")}var Z_=new p("attachment").description("Retrieve a single attachment from a received (inbound) email").argument("[emailId]","Received email UUID").argument("[attachmentId]","Attachment UUID").addHelpText("after",h({context:`The download_url is a signed URL that expires in ~1 hour. Download the file directly:
498
- resend emails receiving attachment <emailId> <attachmentId> --json | jq -r .download_url | xargs curl -O`,output:' {"object":"attachment","id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<signed-url>","expires_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend emails receiving attachment <email-id> <attachment-id>","resend emails receiving attachment <email-id> <attachment-id> --json"]})).action(async(e,t,r,i)=>{let n=i.optsWithGlobals(),o=await C(e,It,n),s=await C(t,Y_(o),n);await N({loading:"Fetching attachment...",sdkCall:a=>a.emails.receiving.attachments.get({emailId:o,id:s}),onInteractive:a=>{console.log(`${a.filename??"(unnamed)"}`),console.log(`ID: ${a.id}`),console.log(`Content-Type: ${a.content_type}`),console.log(`Size: ${a.size} bytes`),console.log(`Disposition: ${a.content_disposition}`),console.log(`Download URL: ${a.download_url}`),console.log(`Expires: ${a.expires_at}`)}},n)});var X_=new p("attachments").description("List attachments on a received (inbound) email").argument("[emailId]","Received email UUID").option("--limit <n>","Maximum number of attachments to return (1-100)","10").option("--after <cursor>","Return attachments after this cursor (next page)").option("--before <cursor>","Return attachments before this cursor (previous page)").addHelpText("after",h({context:`Each attachment has a download_url (signed, expires ~1 hour).
486
+ ]`,output:' [{"id":"<email-id>"},{"id":"<email-id>"}]',errorCodes:["auth_error","missing_file","file_read_error","stdin_read_error","invalid_json","invalid_format","react_email_build_error","react_email_render_error","batch_error"],examples:["resend emails batch --file ./emails.json","resend emails batch --file ./emails.json --batch-validation permissive",`echo '[{"from":"onboarding@resend.com","to":["delivered@resend.com"],"subject":"Hi","text":"Hello"}]' | resend emails batch --file -`]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await oe(r,{permission:"sending_access"}),n=await U(e.file,{message:"Path to JSON file",placeholder:"./emails.json"},{message:"Missing --file flag. Provide a JSON file with an array of email objects.",code:"missing_file"},r),o=ge(n,r),s;try{s=JSON.parse(o)}catch{g({message:"File content is not valid JSON.",code:"invalid_json"},{json:r.json})}Array.isArray(s)||g({message:"File content must be a JSON array of email objects.",code:"invalid_format"},{json:r.json});let a=s;if(a.length>100&&console.warn(`Warning: ${a.length} emails exceeds the 100-email limit. The API may reject this request.`),e.reactEmail){let d=await et(e.reactEmail,r);for(let m of a)m.html=d}for(let d=0;d<a.length;d++){let m=a[d];(m===null||typeof m!="object"||Array.isArray(m))&&g({message:`Email at index ${d} must be a JSON object.`,code:"invalid_format"},{json:r.json}),"attachments"in m&&g({message:`Email at index ${d} contains "attachments", which is not supported in batch sends.`,code:"batch_error"},{json:r.json}),"scheduled_at"in m&&g({message:`Email at index ${d} contains "scheduled_at", which is not supported in batch sends.`,code:"batch_error"},{json:r.json})}let u=await Me("Sending batch...",()=>{let d={...e.idempotencyKey&&{idempotencyKey:e.idempotencyKey},...e.batchValidation&&{batchValidation:e.batchValidation}};return i.batch.send(a,Object.keys(d).length>0?d:void 0)},"batch_error",r),l=u.data,c=u.errors;if(!r.json&&O()){console.log(`Sent ${l.length} email${l.length===1?"":"s"}`);for(let d of l)console.log(` ${d.id}`);if(c&&c.length>0){console.warn(`
487
+ ${c.length} email${c.length===1?"":"s"} failed:`);for(let d of c)console.warn(` [${d.index}] ${d.message}`)}}else F(c&&c.length>0?{data:l,errors:c}:l,{json:r.json})});var q_=new p("cancel").description("Cancel a scheduled email").argument("[id]","Email ID").addHelpText("after",h({output:' {"object":"email","id":"<email-id>"}',errorCodes:["auth_error","cancel_error"],examples:["resend emails cancel <email-id>","resend emails cancel <email-id> --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ct,i);await B({loading:"Cancelling email...",sdkCall:o=>o.emails.cancel(n),errorCode:"cancel_error",successMsg:`Email cancelled: ${n}`},i)});var R_=new p("get").description("Retrieve a sent email by ID").argument("[id]","Email ID").addHelpText("after",h({output:' {"object":"email","id":"<uuid>","from":"onboarding@resend.com","to":["delivered@resend.com"],"subject":"Hello","html":"<p>Hi</p>","text":"Hi","last_event":"delivered","created_at":"<iso-date>","scheduled_at":null,"bcc":null,"cc":null,"reply_to":null}',errorCodes:["auth_error","fetch_error"],examples:["resend emails get <email-id>","resend emails get <email-id> --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ct,i);await N({loading:"Fetching email...",sdkCall:o=>o.emails.get(n),onInteractive:o=>{console.log(`From: ${o.from}`),console.log(`To: ${o.to.join(", ")}`),console.log(`Subject: ${o.subject}`),console.log(`Status: ${o.last_event}`),console.log(`Date: ${o.created_at}`),o.scheduled_at&&console.log(`Scheduled: ${o.scheduled_at}`)}},i)});function Jx(e){let t=e.map(r=>{let i=r.to.join(", "),n=i.length>40?`${i.slice(0,37)}...`:i,o=r.subject.length>50?`${r.subject.slice(0,47)}...`:r.subject;return[r.from,n,o,r.last_event??"\u2014",r.created_at,r.id]});return z(["From","To","Subject","Status","Created","ID"],t,"(no sent emails)")}var F_=new p("list").alias("ls").description('List sent emails \u2014 returns summary (use "get <id>" for full details)').option("--limit <n>","Maximum number of emails to return (1-100)","10").option("--after <cursor>","Cursor for forward pagination \u2014 list items after this ID").option("--before <cursor>","Cursor for backward pagination \u2014 list items before this ID").addHelpText("after",h({context:"Lists emails sent by your team. For emails received by your domain, use: resend emails receiving list",output:' {"object":"list","has_more":false,"data":[{"id":"...","to":["..."],"from":"...","subject":"...","created_at":"...","last_event":"delivered|opened|...","scheduled_at":null}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails list","resend emails list --limit 5","resend emails list --after <email-id> --limit 10","resend emails list --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching sent emails...",sdkCall:o=>o.emails.list(n),onInteractive:o=>{console.log(Jx(o.data)),K(o,"emails list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var $t={resource:"received email",resourcePlural:"received emails",fetchItems:(e,{limit:t,after:r})=>e.emails.receiving.list({limit:t,...r&&{after:r}}),display:e=>({label:e.subject||"(no subject)",hint:e.id})};function z_(e){return{resource:"attachment",resourcePlural:"attachments",fetchItems:(t,{limit:r,after:i})=>t.emails.receiving.attachments.list({emailId:e,limit:r,...i&&{after:i}}),display:t=>({label:t.filename??"(unnamed)",hint:t.id})}}function M_(e){let t=e.map(r=>{let i=r.to.join(", "),n=i.length>40?`${i.slice(0,37)}...`:i,o=r.subject.length>50?`${r.subject.slice(0,47)}...`:r.subject;return[r.from,n,o,r.created_at,r.id]});return z(["From","To","Subject","Created At","ID"],t,"(no received emails)")}var J_=new p("attachment").description("Retrieve a single attachment from a received (inbound) email").argument("[emailId]","Received email UUID").argument("[attachmentId]","Attachment UUID").addHelpText("after",h({context:`The download_url is a signed URL that expires in ~1 hour. Download the file directly:
488
+ resend emails receiving attachment <emailId> <attachmentId> --json | jq -r .download_url | xargs curl -O`,output:' {"object":"attachment","id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<signed-url>","expires_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend emails receiving attachment <email-id> <attachment-id>","resend emails receiving attachment <email-id> <attachment-id> --json"]})).action(async(e,t,r,i)=>{let n=i.optsWithGlobals(),o=await C(e,$t,n),s=await C(t,z_(o),n);await N({loading:"Fetching attachment...",sdkCall:a=>a.emails.receiving.attachments.get({emailId:o,id:s}),onInteractive:a=>{console.log(`${a.filename??"(unnamed)"}`),console.log(`ID: ${a.id}`),console.log(`Content-Type: ${a.content_type}`),console.log(`Size: ${a.size} bytes`),console.log(`Disposition: ${a.content_disposition}`),console.log(`Download URL: ${a.download_url}`),console.log(`Expires: ${a.expires_at}`)}},n)});var B_=new p("attachments").description("List attachments on a received (inbound) email").argument("[emailId]","Received email UUID").option("--limit <n>","Maximum number of attachments to return (1-100)","10").option("--after <cursor>","Return attachments after this cursor (next page)").option("--before <cursor>","Return attachments before this cursor (previous page)").addHelpText("after",h({context:`Each attachment has a download_url (signed, expires ~1 hour).
499
489
  Use the attachment sub-command to retrieve a single attachment with its download URL:
500
490
  resend emails receiving attachment <emailId> <attachmentId>
501
491
 
502
492
  content_disposition: "inline" means the attachment is embedded in the HTML body (e.g. an image).
503
- content_disposition: "attachment" means it is a standalone file download.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<url>","expires_at":"<iso-date>"}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails receiving attachments <email-id>","resend emails receiving attachments <email-id> --json","resend emails receiving attachments <email-id> --limit 25 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,It,i),o=V(t.limit,i),s=K(o,t.after,t.before,i);await q({loading:"Fetching attachments...",sdkCall:a=>a.emails.receiving.attachments.list({emailId:n,...s}),onInteractive:a=>{console.log(uu(a.data)),Y(a,`emails receiving attachments ${n}`,{limit:o,before:t.before,apiKey:i.apiKey,profile:i.profile})}},i)});var e2=new p("forward").description("Forward a received email").argument("[id]","Received email ID").requiredOption("--to <addresses...>","Recipient address(es)").requiredOption("--from <address>","Sender address").addHelpText("after",h({context:`Required: --to, --from
504
- Forwards the original email content (passthrough mode).`,output:' {"id":"<email-id>"}',errorCodes:["auth_error","create_error"],examples:["resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com","resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,It,i);await re({loading:"Forwarding email...",sdkCall:o=>o.emails.receiving.forward({emailId:n,to:t.to,from:t.from}),onInteractive:o=>{console.log(`Email forwarded: ${o.id}`)}},i)});var t2=new p("get").description("Retrieve a single received (inbound) email with full details including HTML, text, and headers").argument("[id]","Received email UUID").addHelpText("after",h({context:`The raw.download_url field is a signed URL (expires ~1 hour) containing the full RFC 2822
493
+ content_disposition: "attachment" means it is a standalone file download.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","filename":"invoice.pdf","size":51200,"content_type":"application/pdf","content_disposition":"attachment","content_id":null,"download_url":"<url>","expires_at":"<iso-date>"}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails receiving attachments <email-id>","resend emails receiving attachments <email-id> --json","resend emails receiving attachments <email-id> --limit 25 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,$t,i),o=W(t.limit,i),s=V(o,t.after,t.before,i);await R({loading:"Fetching attachments...",sdkCall:a=>a.emails.receiving.attachments.list({emailId:n,...s}),onInteractive:a=>{console.log(nu(a.data)),K(a,`emails receiving attachments ${n}`,{limit:o,before:t.before,apiKey:i.apiKey,profile:i.profile})}},i)});var H_=new p("forward").description("Forward a received email").argument("[id]","Received email ID").requiredOption("--to <addresses...>","Recipient address(es)").requiredOption("--from <address>","Sender address").addHelpText("after",h({context:`Required: --to, --from
494
+ Forwards the original email content (passthrough mode).`,output:' {"id":"<email-id>"}',errorCodes:["auth_error","create_error"],examples:["resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com","resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,$t,i);await re({loading:"Forwarding email...",sdkCall:o=>o.emails.receiving.forward({emailId:n,to:t.to,from:t.from}),onInteractive:o=>{console.log(`Email forwarded: ${o.id}`)}},i)});var N_=new p("get").description("Retrieve a single received (inbound) email with full details including HTML, text, and headers").argument("[id]","Received email UUID").addHelpText("after",h({context:`The raw.download_url field is a signed URL (expires ~1 hour) containing the full RFC 2822
505
495
  MIME message. Pipe it to curl to save the original email:
506
496
  resend emails receiving get <id> --json | jq -r .raw.download_url | xargs curl > email.eml
507
497
 
508
498
  Attachments are listed in the attachments array. Use the attachments sub-command to get
509
499
  download URLs:
510
- resend emails receiving attachments <id>`,output:' {"object":"email","id":"<uuid>","to":["inbox@yourdomain.com"],"from":"sender@external.com","subject":"Hello","html":"<p>Hello!</p>","text":"Hello!","headers":{"x-mailer":"..."},"message_id":"<str>","bcc":[],"cc":[],"reply_to":[],"raw":{"download_url":"<url>","expires_at":"<iso-date>"},"attachments":[]}',errorCodes:["auth_error","fetch_error"],examples:["resend emails receiving get <email-id>","resend emails receiving get <email-id> --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,It,i);await N({loading:"Fetching received email...",sdkCall:o=>o.emails.receiving.get(n),onInteractive:o=>{if(console.log(`From: ${o.from}`),console.log(`To: ${o.to.join(", ")}`),console.log(`Subject: ${o.subject}`),console.log(`Date: ${o.created_at}`),o.attachments.length>0&&console.log(`Files: ${o.attachments.length} attachment(s)`),o.text){let s=o.text.length>200?`${o.text.slice(0,197)}...`:o.text;console.log(`${s}`)}else o.html&&console.log(`
511
- (HTML body only \u2014 use --json to view or pipe to a browser)`)}},i)});var r2=new p("list").alias("ls").description("List received (inbound) emails for domains with receiving enabled").option("--limit <n>","Maximum number of emails to return (1-100)","10").option("--after <cursor>","Return emails after this cursor (next page)").option("--before <cursor>","Return emails before this cursor (previous page)").addHelpText("after",h({context:`Receiving must be enabled on the domain first:
500
+ resend emails receiving attachments <id>`,output:' {"object":"email","id":"<uuid>","to":["inbox@yourdomain.com"],"from":"sender@external.com","subject":"Hello","html":"<p>Hello!</p>","text":"Hello!","headers":{"x-mailer":"..."},"message_id":"<str>","bcc":[],"cc":[],"reply_to":[],"raw":{"download_url":"<url>","expires_at":"<iso-date>"},"attachments":[]}',errorCodes:["auth_error","fetch_error"],examples:["resend emails receiving get <email-id>","resend emails receiving get <email-id> --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,$t,i);await N({loading:"Fetching received email...",sdkCall:o=>o.emails.receiving.get(n),onInteractive:o=>{if(console.log(`From: ${o.from}`),console.log(`To: ${o.to.join(", ")}`),console.log(`Subject: ${o.subject}`),console.log(`Date: ${o.created_at}`),o.attachments.length>0&&console.log(`Files: ${o.attachments.length} attachment(s)`),o.text){let s=o.text.length>200?`${o.text.slice(0,197)}...`:o.text;console.log(`${s}`)}else o.html&&console.log(`
501
+ (HTML body only \u2014 use --json to view or pipe to a browser)`)}},i)});var L_=new p("list").alias("ls").description("List received (inbound) emails for domains with receiving enabled").option("--limit <n>","Maximum number of emails to return (1-100)","10").option("--after <cursor>","Return emails after this cursor (next page)").option("--before <cursor>","Return emails before this cursor (previous page)").addHelpText("after",h({context:`Receiving must be enabled on the domain first:
512
502
  resend domains update <id> --receiving enabled
513
503
 
514
504
  Pagination: use --after or --before with a received email ID as the cursor.
515
505
  Only one of --after or --before may be used at a time.
516
- The response includes has_more: true when additional pages exist.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","to":["inbox@yourdomain.com"],"from":"sender@external.com","subject":"Hello","created_at":"<iso-date>","message_id":"<str>","bcc":null,"cc":null,"reply_to":null,"attachments":[]}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails receiving list","resend emails receiving list --limit 25 --json","resend emails receiving list --after <email-id> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching received emails...",sdkCall:o=>o.emails.receiving.list(n),onInteractive:o=>{console.log(Q_(o.data)),Y(o,"emails receiving list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var nr=le(vt(),1);ee();var fw=100;function i2(){return new Date().toLocaleTimeString("en-GB",{hour12:!1})}function hw(e,t){if(t)console.log(JSON.stringify(e));else{let r=e.to.join(", "),i=nr.default.dim(`[${i2()}]`),n=e.subject.length>50?`${e.subject.slice(0,47)}...`:e.subject;process.stderr.write(`${i} ${e.from} -> ${r} ${nr.default.bold(`"${n}"`)} ${nr.default.dim(e.id)}
517
- `)}}var n2=new p("listen").description("Poll for new inbound emails and display them as they arrive").option("--interval <seconds>","Polling interval in seconds (minimum 2)","5").addHelpText("after",h({context:`Long-running command that polls the receiving API at a fixed
506
+ The response includes has_more: true when additional pages exist.`,output:' {"object":"list","has_more":false,"data":[{"id":"<uuid>","to":["inbox@yourdomain.com"],"from":"sender@external.com","subject":"Hello","created_at":"<iso-date>","message_id":"<str>","bcc":null,"cc":null,"reply_to":null,"attachments":[]}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend emails receiving list","resend emails receiving list --limit 25 --json","resend emails receiving list --after <email-id> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching received emails...",sdkCall:o=>o.emails.receiving.list(n),onInteractive:o=>{console.log(M_(o.data)),K(o,"emails receiving list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var nr=le(_t(),1);ee();var Bx=100;function G_(){return new Date().toLocaleTimeString("en-GB",{hour12:!1})}function Hx(e,t){if(t)console.log(JSON.stringify(e));else{let r=e.to.join(", "),i=nr.default.dim(`[${G_()}]`),n=e.subject.length>50?`${e.subject.slice(0,47)}...`:e.subject;process.stderr.write(`${i} ${e.from} -> ${r} ${nr.default.bold(`"${n}"`)} ${nr.default.dim(e.id)}
507
+ `)}}var U_=new p("listen").description("Poll for new inbound emails and display them as they arrive").option("--interval <seconds>","Polling interval in seconds (minimum 2)","5").addHelpText("after",h({context:`Long-running command that polls the receiving API at a fixed
518
508
  interval and prints each new email as it arrives.
519
509
 
520
510
  Interactive output shows one line per email. When piped (or with --json),
521
511
  output is NDJSON (one JSON object per line).
522
512
 
523
- Ctrl+C exits cleanly.`,examples:["resend emails receiving listen","resend emails receiving listen --interval 10","resend emails receiving listen --json | head -3"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=Number.parseInt(e.interval??"5",10);(Number.isNaN(i)||i<2)&&v({message:"Polling interval must be at least 2 seconds.",code:"invalid_interval"},{json:r.json});let n=await oe(r),o=r.json||!k(),s=he("Connecting...",r.quiet||o),a=new Set,u=0;try{let{data:_,error:g}=await n.emails.receiving.list({limit:1});(g||!_)&&(s.fail("Failed to connect"),v({message:g?.message??"Unexpected empty response",code:"list_error"},{json:r.json}));for(let b of _.data)a.add(b.id);s.stop("Ready")}catch(_){s.fail("Failed to connect"),v({message:Q(_,"Unknown error"),code:"list_error"},{json:r.json})}o||(process.stderr.write(`
513
+ Ctrl+C exits cleanly.`,examples:["resend emails receiving listen","resend emails receiving listen --interval 10","resend emails receiving listen --json | head -3"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=Number.parseInt(e.interval??"5",10);(Number.isNaN(i)||i<2)&&g({message:"Polling interval must be at least 2 seconds.",code:"invalid_interval"},{json:r.json});let n=await oe(r),o=r.json||!O(),s=he("Connecting...",r.quiet||o),a=new Set,u=0;try{let{data:b,error:v}=await n.emails.receiving.list({limit:1});(v||!b)&&(s.fail("Failed to connect"),g({message:v?.message??"Unexpected empty response",code:"list_error"},{json:r.json}));for(let _ of b.data)a.add(_.id);s.stop("Ready")}catch(b){s.fail("Failed to connect"),g({message:Y(b,"Unknown error"),code:"list_error"},{json:r.json})}o||(process.stderr.write(`
524
514
  `),process.stderr.write(` ${nr.default.bold("Polling:")} every ${i}s
525
515
  `),process.stderr.write(`
526
516
  Listening for new inbound emails. Press Ctrl+C to stop.
527
517
 
528
- `));function l(_){u++,o||process.stderr.write(`${nr.default.dim(`[${i2()}]`)} ${nr.default.yellow("Warning:")} ${_}
529
- `),u>=5&&v({message:"Exiting after 5 consecutive API failures.",code:"poll_error"},{json:r.json})}let d;async function c(){try{let _=[],g,b=!0;for(;b;){let O={limit:fw};g&&(O.after=g);let{data:x,error:S}=await n.emails.receiving.list(O);if(S||!x){l(S?.message??"Empty response");return}let A=!1;for(let T of x.data){if(a.has(T.id)){A=!0;break}_.push(T)}A||!x.has_more?b=!1:g=x.data[x.data.length-1]?.id}u=0;for(let O of _)a.add(O.id);for(let O of _.reverse())hw(O,o)}catch(_){l(Q(_,"Unknown error"))}finally{d=setTimeout(c,i*1e3)}}d=setTimeout(c,i*1e3);let m=()=>{clearTimeout(d),o||process.stderr.write(`
518
+ `));function l(b){u++,o||process.stderr.write(`${nr.default.dim(`[${G_()}]`)} ${nr.default.yellow("Warning:")} ${b}
519
+ `),u>=5&&g({message:"Exiting after 5 consecutive API failures.",code:"poll_error"},{json:r.json})}let c;async function d(){try{let b=[],v,_=!0;for(;_;){let x={limit:Bx};v&&(x.after=v);let{data:w,error:S}=await n.emails.receiving.list(x);if(S||!w){l(S?.message??"Empty response");return}let A=!1;for(let I of w.data){if(a.has(I.id)){A=!0;break}b.push(I)}A||!w.has_more?_=!1:v=w.data[w.data.length-1]?.id}u=0;for(let x of b)a.add(x.id);for(let x of b.reverse())Hx(x,o)}catch(b){l(Y(b,"Unknown error"))}finally{c=setTimeout(d,i*1e3)}}c=setTimeout(d,i*1e3);let m=()=>{clearTimeout(c),o||process.stderr.write(`
530
520
  Stopped listening.
531
- `),process.exit(Sr())};Wa(m),process.on("SIGTERM",m),await new Promise(()=>{})});var o2=new p("receiving").description("Manage received (inbound) emails \u2014 requires domain receiving to be enabled").addHelpText("after",h({context:`Receiving must be enabled on the domain first:
532
- resend domains update <id> --receiving enabled`,examples:["resend emails receiving list","resend emails receiving listen","resend emails receiving get <email-id>","resend emails receiving attachments <email-id>","resend emails receiving attachment <email-id> <attachment-id>","resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com"]})).addCommand(r2,{isDefault:!0}).addCommand(t2).addCommand(n2).addCommand(X_).addCommand(Z_).addCommand(e2);var s2=require("node:fs"),a2=require("node:path");ee();function gw(e){let{attachments:t,...r}=e;return t?.length?{...r,attachments:t.map(i=>({filename:i.filename,byteLength:Buffer.isBuffer(i.content)?i.content.byteLength:Buffer.byteLength(String(i.content),"utf8")}))}:r}var u2=new p("send").description("Send an email").option("--from <address>","Sender address (required unless using --template)").option("--to <addresses...>","Recipient address(es) (required)").option("--subject <subject>","Email subject (required unless using --template)").option("--html <html>","HTML body").option("--html-file <path>",'Path to an HTML file for the body (use "-" for stdin)').option("--text <text>","Plain-text body").option("--text-file <path>",'Path to a plain-text file for the body (use "-" for stdin)').option("--react-email <path>","Path to a React Email template (.tsx) to bundle, render, and send (npm install only)").option("--cc <addresses...>","CC recipients").option("--bcc <addresses...>","BCC recipients").option("--reply-to <address>","Reply-to address").option("--scheduled-at <datetime>",'Schedule email for later \u2014 ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET"').option("--attachment <paths...>","File path(s) to attach").option("--headers <key=value...>","Custom headers as key=value pairs (e.g. X-Entity-Ref-ID=123)").option("--tags <name=value...>","Email tags as name=value pairs (e.g. category=marketing)").option("--idempotency-key <key>","Deduplicate this send request using this key").option("--dry-run","Validate input and print the request JSON without calling the API (interactive: verified-domain list is not fetched)").option("--template <id>","Template ID to use").option("--var <key=value...>","Template variables as key=value pairs (repeatable, e.g. --var name=John --var count=42)").addHelpText("after",h({context:`Required: --to and either --template, --react-email, or (--from, --subject, and one of --text | --text-file | --html | --html-file).
533
- Use --dry-run to print the request JSON without sending (attachments show filename and byteLength only).`,output:' {"id":"<email-id>"}',errorCodes:["auth_error","missing_body","file_read_error","invalid_options","stdin_read_error","invalid_header","invalid_tag","invalid_var","template_body_conflict","template_attachment_conflict","react_email_build_error","react_email_render_error","send_error"],examples:['resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --text "Hi"','resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --html "<b>Hi</b>"','resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --text "Hi" --attachment ./report.pdf',"resend emails send --template tmpl_123 --to delivered@resend.com"]})).action(async(e,t)=>{let r=t.optsWithGlobals();e.htmlFile==="-"&&e.textFile==="-"&&v({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:r.json}),e.from===""&&v({message:"--from cannot be empty",code:"invalid_options"},{json:r.json});let i=!!e.template;e.var&&!i&&v({message:"--var can only be used with --template",code:"invalid_var"},{json:r.json}),e.reactEmail&&(e.html||e.htmlFile||i)&&v({message:"Cannot use --react-email with --html, --html-file, or --template",code:"invalid_options"},{json:r.json}),i&&(e.html||e.htmlFile||e.text||e.textFile)&&v({message:"Cannot use --template with --html, --html-file, --text, or --text-file",code:"template_body_conflict"},{json:r.json}),i&&e.attachment&&v({message:"Cannot use --attachment with --template",code:"template_attachment_conflict"},{json:r.json});let n=e.var?Object.fromEntries(e.var.map(S=>{let A=S.indexOf("=");A<1&&v({message:`Invalid var format: "${S}". Expected key=value.`,code:"invalid_var"},{json:r.json});let T=S.slice(0,A),P=S.slice(A+1);return[T,P]})):void 0,o=e.from;if(!e.dryRun&&!o&&!i&&k()&&!r.json){let S=await oe(r,{permission:"sending_access"}),A=await Xa(S);A.length>0&&(o=await eu(A))}let s=[{flag:"from",message:"From address",placeholder:"onboarding@resend.dev",defaultValue:"onboarding@resend.dev",required:!i},{flag:"to",message:"To address",placeholder:"delivered@resend.dev",defaultValue:"delivered@resend.dev"},{flag:"subject",message:"Subject",placeholder:"Hello!",defaultValue:"Hello!",required:!i}],a=await nv({from:o,to:e.to?.[0],subject:e.subject},s,r),u=e.html,l=e.text;e.htmlFile&&(e.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
521
+ `),process.exit(xr())};Na(m),process.on("SIGTERM",m),await new Promise(()=>{})});var W_=new p("receiving").description("Manage received (inbound) emails \u2014 requires domain receiving to be enabled").addHelpText("after",h({context:`Receiving must be enabled on the domain first:
522
+ resend domains update <id> --receiving enabled`,examples:["resend emails receiving list","resend emails receiving listen","resend emails receiving get <email-id>","resend emails receiving attachments <email-id>","resend emails receiving attachment <email-id> <attachment-id>","resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com"]})).addCommand(L_,{isDefault:!0}).addCommand(N_).addCommand(U_).addCommand(B_).addCommand(J_).addCommand(H_);var V_=require("node:fs"),K_=require("node:path");ee();function Nx(e){let{attachments:t,...r}=e;return t?.length?{...r,attachments:t.map(i=>({filename:i.filename,byteLength:Buffer.isBuffer(i.content)?i.content.byteLength:Buffer.byteLength(String(i.content),"utf8")}))}:r}var Y_=new p("send").description("Send an email").option("--from <address>","Sender address (required unless using --template)").option("--to <addresses...>","Recipient address(es) (required)").option("--subject <subject>","Email subject (required unless using --template)").option("--html <html>","HTML body").option("--html-file <path>",'Path to an HTML file for the body (use "-" for stdin)').option("--text <text>","Plain-text body").option("--text-file <path>",'Path to a plain-text file for the body (use "-" for stdin)').option("--react-email <path>","Path to a React Email template (.tsx) to bundle, render, and send (npm install only)").option("--cc <addresses...>","CC recipients").option("--bcc <addresses...>","BCC recipients").option("--reply-to <address>","Reply-to address").option("--scheduled-at <datetime>",'Schedule email for later \u2014 ISO 8601 or natural language e.g. "in 1 hour", "tomorrow at 9am ET"').option("--attachment <paths...>","File path(s) to attach").option("--headers <key=value...>","Custom headers as key=value pairs (e.g. X-Entity-Ref-ID=123)").option("--tags <name=value...>","Email tags as name=value pairs (e.g. category=marketing)").option("--idempotency-key <key>","Deduplicate this send request using this key").option("--dry-run","Validate input and print the request JSON without calling the API (interactive: verified-domain list is not fetched)").option("--template <id>","Template ID to use").option("--var <key=value...>","Template variables as key=value pairs (repeatable, e.g. --var name=John --var count=42)").addHelpText("after",h({context:`Required: --to and either --template, --react-email, or (--from, --subject, and one of --text | --text-file | --html | --html-file).
523
+ Use --dry-run to print the request JSON without sending (attachments show filename and byteLength only).`,output:' {"id":"<email-id>"}',errorCodes:["auth_error","missing_body","file_read_error","invalid_options","stdin_read_error","invalid_header","invalid_tag","invalid_var","template_body_conflict","template_attachment_conflict","react_email_build_error","react_email_render_error","send_error"],examples:['resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --text "Hi"','resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --html "<b>Hi</b>"','resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --text "Hi" --attachment ./report.pdf',"resend emails send --template tmpl_123 --to delivered@resend.com"]})).action(async(e,t)=>{let r=t.optsWithGlobals();e.htmlFile==="-"&&e.textFile==="-"&&g({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:r.json}),e.from===""&&g({message:"--from cannot be empty",code:"invalid_options"},{json:r.json});let i=!!e.template;e.var&&!i&&g({message:"--var can only be used with --template",code:"invalid_var"},{json:r.json}),e.reactEmail&&(e.html||e.htmlFile||i)&&g({message:"Cannot use --react-email with --html, --html-file, or --template",code:"invalid_options"},{json:r.json}),i&&(e.html||e.htmlFile||e.text||e.textFile)&&g({message:"Cannot use --template with --html, --html-file, --text, or --text-file",code:"template_body_conflict"},{json:r.json}),i&&e.attachment&&g({message:"Cannot use --attachment with --template",code:"template_attachment_conflict"},{json:r.json});let n=e.var?Object.fromEntries(e.var.map(S=>{let A=S.indexOf("=");A<1&&g({message:`Invalid var format: "${S}". Expected key=value.`,code:"invalid_var"},{json:r.json});let I=S.slice(0,A),E=S.slice(A+1);return[I,E]})):void 0,o=e.from;if(!e.dryRun&&!o&&!i&&O()&&!r.json){let S=await oe(r,{permission:"sending_access"}),A=await Ka(S);A.length>0&&(o=await Ya(A))}let s=[{flag:"from",message:"From address",placeholder:"onboarding@resend.dev",defaultValue:"onboarding@resend.dev",required:!i},{flag:"to",message:"To address",placeholder:"delivered@resend.dev",defaultValue:"delivered@resend.dev"},{flag:"subject",message:"Subject",placeholder:"Hello!",defaultValue:"Hello!",required:!i}],a=await U0({from:o,to:e.to?.[0],subject:e.subject},s,r),u=e.html,l=e.text;e.htmlFile&&(e.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
534
524
  `),u=ge(e.htmlFile,r)),e.textFile&&(e.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
535
- `),l=ge(e.textFile,r)),e.reactEmail&&(u=await et(e.reactEmail,r));let d=l;!i&&!e.reactEmail&&!u&&!l&&(d=await U(void 0,{message:"Email body (plain text)",placeholder:"Hello, World!",defaultValue:"Hello, World!"},{message:"Missing email body. Provide --html, --html-file, --text, --text-file, or --react-email",code:"missing_body"},r));let c=e.to??[a.to],m=e.attachment?.map(S=>{try{let A=(0,s2.readFileSync)(S);return{filename:(0,a2.basename)(S),content:A}}catch{return v({message:`Failed to read file: ${S}`,code:"file_read_error"},{json:r.json})}}),_=e.headers?Object.fromEntries(e.headers.map(S=>{let A=S.indexOf("=");return A<1&&v({message:`Invalid header format: "${S}". Expected key=value.`,code:"invalid_header"},{json:r.json}),[S.slice(0,A),S.slice(A+1)]})):void 0,g=e.tags?.map(S=>{let A=S.indexOf("=");return A<1&&v({message:`Invalid tag format: "${S}". Expected name=value.`,code:"invalid_tag"},{json:r.json}),{name:S.slice(0,A),value:S.slice(A+1)}}),b;if(i?b={template:{id:e.template,...n&&{variables:n}},to:c,...a.from&&{from:a.from},...a.subject&&{subject:a.subject},...e.cc&&{cc:e.cc},...e.bcc&&{bcc:e.bcc},...e.replyTo&&{replyTo:e.replyTo},...e.scheduledAt&&{scheduledAt:e.scheduledAt},..._&&{headers:_},...g&&{tags:g}}:b={from:a.from,to:c,subject:a.subject,...u&&{html:u},...d&&{text:d},...e.cc&&{cc:e.cc},...e.bcc&&{bcc:e.bcc},...e.replyTo&&{replyTo:e.replyTo},...e.scheduledAt&&{scheduledAt:e.scheduledAt},...m&&{attachments:m},..._&&{headers:_},...g&&{tags:g}},e.dryRun){z({dryRun:!0,request:gw(b)},{json:r.json});return}let O=await oe(r,{permission:"sending_access"}),x=await He(e.scheduledAt?"Scheduling email...":"Sending email...",()=>O.emails.send(b,e.idempotencyKey?{idempotencyKey:e.idempotencyKey}:void 0),"send_error",r);!r.json&&k()?e.scheduledAt?console.log(`Email scheduled: ${x.id}`):console.log(`Email sent: ${x.id}`):z(x,{json:r.json})});var l2=new p("update").description("Update a scheduled email").argument("[id]","Email ID").requiredOption("--scheduled-at <datetime>","New scheduled date in ISO 8601 format (e.g. 2024-08-05T11:52:01.858Z)").addHelpText("after",h({context:"Required: --scheduled-at",output:' {"object":"email","id":"<email-id>"}',errorCodes:["auth_error","update_error"],examples:["resend emails update <email-id> --scheduled-at 2024-08-05T11:52:01.858Z","resend emails update <email-id> --scheduled-at 2024-08-05T11:52:01.858Z --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,lt,i);await F({loading:"Updating email...",sdkCall:o=>o.emails.update({id:n,scheduledAt:t.scheduledAt}),errorCode:"update_error",successMsg:`Email updated: ${n}`},i)});var c2=new p("emails").description("Send and manage emails").addHelpText("after",h({examples:['resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --text "Hi"',"resend emails get <email-id>","resend emails batch --file ./emails.json","resend emails cancel <email-id>","resend emails attachments <email-id>","resend emails attachment <email-id> <attachment-id>","resend emails receiving list","resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com"]})).addCommand(K_,{isDefault:!0}).addCommand(u2).addCommand(V_).addCommand(U_).addCommand(W_).addCommand(l2).addCommand(G_).addCommand(L_).addCommand(o2);var bw=new Set(["string","number","boolean","date"]);function Vc(e){if(!e)return"(none)";let t=Object.entries(e);return t.length===0?"(empty)":t.map(([r,i])=>`${r}:${i}`).join(", ")}function d2(e){let t=e.map(r=>[r.name,Vc(r.schema),r.created_at,r.id]);return M(["Name","Schema","Created","ID"],t,"(no events)")}function lu(e,t){if(e==="null")return null;let r=ir(e,"--schema",t);(typeof r!="object"||r===null||Array.isArray(r))&&v({message:"--schema must be a JSON object mapping field names to types (string | number | boolean | date).",code:"invalid_schema"},{json:t.json});for(let[i,n]of Object.entries(r))(typeof n!="string"||!bw.has(n))&&v({message:`Invalid schema type for "${i}": "${n}". Must be one of: string, number, boolean, date.`,code:"invalid_schema"},{json:t.json});return r}var Ir={resource:"event",resourcePlural:"events",fetchItems:(e,{limit:t,after:r})=>e.events.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};var m2=new p("create").description("Create a new event definition").option("--name <name>","Event name (e.g. user.signed_up)").option("--schema <json>","Schema as JSON mapping field names to types (string | number | boolean | date)").addHelpText("after",h({context:`Non-interactive: --name is required. --schema is optional.
525
+ `),l=ge(e.textFile,r)),e.reactEmail&&(u=await et(e.reactEmail,r));let c=l;!i&&!e.reactEmail&&!u&&!l&&(c=await U(void 0,{message:"Email body (plain text)",placeholder:"Hello, World!",defaultValue:"Hello, World!"},{message:"Missing email body. Provide --html, --html-file, --text, --text-file, or --react-email",code:"missing_body"},r));let d=e.to??[a.to],m=e.attachment?.map(S=>{try{let A=(0,V_.readFileSync)(S);return{filename:(0,K_.basename)(S),content:A}}catch{return g({message:`Failed to read file: ${S}`,code:"file_read_error"},{json:r.json})}}),b=e.headers?Object.fromEntries(e.headers.map(S=>{let A=S.indexOf("=");return A<1&&g({message:`Invalid header format: "${S}". Expected key=value.`,code:"invalid_header"},{json:r.json}),[S.slice(0,A),S.slice(A+1)]})):void 0,v=e.tags?.map(S=>{let A=S.indexOf("=");return A<1&&g({message:`Invalid tag format: "${S}". Expected name=value.`,code:"invalid_tag"},{json:r.json}),{name:S.slice(0,A),value:S.slice(A+1)}}),_;if(i?_={template:{id:e.template,...n&&{variables:n}},to:d,...a.from&&{from:a.from},...a.subject&&{subject:a.subject},...e.cc&&{cc:e.cc},...e.bcc&&{bcc:e.bcc},...e.replyTo&&{replyTo:e.replyTo},...e.scheduledAt&&{scheduledAt:e.scheduledAt},...b&&{headers:b},...v&&{tags:v}}:_={from:a.from,to:d,subject:a.subject,...u&&{html:u},...c&&{text:c},...e.cc&&{cc:e.cc},...e.bcc&&{bcc:e.bcc},...e.replyTo&&{replyTo:e.replyTo},...e.scheduledAt&&{scheduledAt:e.scheduledAt},...m&&{attachments:m},...b&&{headers:b},...v&&{tags:v}},e.dryRun){F({dryRun:!0,request:Nx(_)},{json:r.json});return}let x=await oe(r,{permission:"sending_access"}),w=await Me(e.scheduledAt?"Scheduling email...":"Sending email...",()=>x.emails.send(_,e.idempotencyKey?{idempotencyKey:e.idempotencyKey}:void 0),"send_error",r);!r.json&&O()?e.scheduledAt?console.log(`Email scheduled: ${w.id}`):console.log(`Email sent: ${w.id}`):F(w,{json:r.json})});var Q_=new p("update").description("Update a scheduled email").argument("[id]","Email ID").requiredOption("--scheduled-at <datetime>","New scheduled date in ISO 8601 format (e.g. 2024-08-05T11:52:01.858Z)").addHelpText("after",h({context:"Required: --scheduled-at",output:' {"object":"email","id":"<email-id>"}',errorCodes:["auth_error","update_error"],examples:["resend emails update <email-id> --scheduled-at 2024-08-05T11:52:01.858Z","resend emails update <email-id> --scheduled-at 2024-08-05T11:52:01.858Z --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ct,i);await B({loading:"Updating email...",sdkCall:o=>o.emails.update({id:n,scheduledAt:t.scheduledAt}),errorCode:"update_error",successMsg:`Email updated: ${n}`},i)});var Z_=new p("emails").description("Send and manage emails").addHelpText("after",h({examples:['resend emails send --from onboarding@resend.com --to delivered@resend.com --subject "Hello" --text "Hi"',"resend emails get <email-id>","resend emails batch --file ./emails.json","resend emails cancel <email-id>","resend emails attachments <email-id>","resend emails attachment <email-id> <attachment-id>","resend emails receiving list","resend emails receiving forward <email-id> --to delivered@resend.com --from onboarding@resend.com"]})).addCommand(F_,{isDefault:!0}).addCommand(Y_).addCommand(R_).addCommand($_).addCommand(q_).addCommand(Q_).addCommand(j_).addCommand(I_).addCommand(W_);var Lx=new Set(["string","number","boolean","date"]);function zc(e){if(!e)return"(none)";let t=Object.entries(e);return t.length===0?"(empty)":t.map(([r,i])=>`${r}:${i}`).join(", ")}function X_(e){let t=e.map(r=>[r.name,zc(r.schema),r.created_at,r.id]);return z(["Name","Schema","Created","ID"],t,"(no events)")}function ou(e,t){if(e==="null")return null;let r=ir(e,"--schema",t);(typeof r!="object"||r===null||Array.isArray(r))&&g({message:"--schema must be a JSON object mapping field names to types (string | number | boolean | date).",code:"invalid_schema"},{json:t.json});for(let[i,n]of Object.entries(r))(typeof n!="string"||!Lx.has(n))&&g({message:`Invalid schema type for "${i}": "${n}". Must be one of: string, number, boolean, date.`,code:"invalid_schema"},{json:t.json});return r}var jr={resource:"event",resourcePlural:"events",fetchItems:(e,{limit:t,after:r})=>e.events.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};var ey=new p("create").description("Create a new event definition").option("--name <name>","Event name (e.g. user.signed_up)").option("--schema <json>","Schema as JSON mapping field names to types (string | number | boolean | date)").addHelpText("after",h({context:`Non-interactive: --name is required. --schema is optional.
536
526
 
537
527
  Schema format:
538
528
  A JSON object mapping field names to type strings.
539
529
  Valid types: string, number, boolean, date.
540
- Example: '{"plan":"string","age":"number","active":"boolean"}'`,output:' {"object":"event","id":"<id>"}',errorCodes:["auth_error","missing_name","invalid_schema","create_error"],examples:['resend events create --name "user.signed_up"',`resend events create --name "order.completed" --schema '{"amount":"number","currency":"string"}'`,'resend events create --name "user.signed_up" --json']})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.name,{message:"Event name",placeholder:"e.g. user.signed_up"},{message:"Missing --name flag.",code:"missing_name"},r),n=e.schema?lu(e.schema,r):void 0;await re({loading:"Creating event...",sdkCall:o=>o.events.create({name:i,...n!==void 0&&{schema:n}}),onInteractive:o=>{console.log(`Event created: ${o.id}`)}},r)});var p2=new p("delete").alias("rm").description("Delete an event definition").argument("[id]","Event ID").option("--yes","Skip confirmation prompt").addHelpText("after",h({context:"Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.",output:' {"object":"event","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend events delete <id> --yes","resend events delete <id> --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ir,i);await ue(n,!!t.yes,{confirmMessage:`Delete event ${n}?
541
- This cannot be undone.`,loading:"Deleting event...",object:"event",successMsg:"Event deleted",sdkCall:o=>o.events.remove(n)},i)});var f2=new p("get").description("Retrieve an event definition").argument("[id]","Event ID").addHelpText("after",h({output:" Full event object including schema.",errorCodes:["auth_error","fetch_error"],examples:["resend events get <id>","resend events get <id> --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ir,i);await N({loading:"Fetching event...",sdkCall:o=>o.events.get(n),onInteractive:o=>{console.log(o.name),console.log(`ID: ${o.id}`),console.log(`Schema: ${Vc(o.schema)}`),console.log(`Created: ${o.created_at}`),o.updated_at&&console.log(`Updated: ${o.updated_at}`)}},i)});var h2=new p("list").alias("ls").description("List all events").option("--limit <n>","Maximum number of events to return (1-100)","10").option("--after <cursor>","Return events after this cursor (next page)").option("--before <cursor>","Return events before this cursor (previous page)").addHelpText("after",h({output:' {"object":"list","data":[...],"has_more":true}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend events list","resend events list --limit 25 --json","resend events list --after <cursor> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching events...",sdkCall:o=>o.events.list(n),onInteractive:o=>{console.log(d2(o.data)),Y(o,"events list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var g2=new p("open").description("Open the events page in the Resend dashboard").addHelpText("after",h({context:"Opens the events management page in the Resend dashboard in your default browser.",examples:["resend events open"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await Fe(Se.events,r)});var b2=new p("send").description("Send an event to trigger automations for a contact").option("--event <name>","Event name (e.g. user.signed_up)").option("--contact-id <id>","Contact ID (mutually exclusive with --email)").option("--email <email>","Contact email (mutually exclusive with --contact-id)").option("--payload <json>","Event payload as JSON string").addHelpText("after",h({context:`Sends an event for a specific contact, triggering any automations listening for it.
530
+ Example: '{"plan":"string","age":"number","active":"boolean"}'`,output:' {"object":"event","id":"<id>"}',errorCodes:["auth_error","missing_name","invalid_schema","create_error"],examples:['resend events create --name "user.signed_up"',`resend events create --name "order.completed" --schema '{"amount":"number","currency":"string"}'`,'resend events create --name "user.signed_up" --json']})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.name,{message:"Event name",placeholder:"e.g. user.signed_up"},{message:"Missing --name flag.",code:"missing_name"},r),n=e.schema?ou(e.schema,r):void 0;await re({loading:"Creating event...",sdkCall:o=>o.events.create({name:i,...n!==void 0&&{schema:n}}),onInteractive:o=>{console.log(`Event created: ${o.id}`)}},r)});var ty=new p("delete").alias("rm").description("Delete an event definition").argument("[id]","Event ID").option("--yes","Skip confirmation prompt").addHelpText("after",h({context:"Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.",output:' {"object":"event","id":"<id>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend events delete <id> --yes","resend events delete <id> --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,jr,i);await ue(n,!!t.yes,{confirmMessage:`Delete event ${n}?
531
+ This cannot be undone.`,loading:"Deleting event...",object:"event",successMsg:"Event deleted",sdkCall:o=>o.events.remove(n)},i)});var ry=new p("get").description("Retrieve an event definition").argument("[id]","Event ID").addHelpText("after",h({output:" Full event object including schema.",errorCodes:["auth_error","fetch_error"],examples:["resend events get <id>","resend events get <id> --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,jr,i);await N({loading:"Fetching event...",sdkCall:o=>o.events.get(n),onInteractive:o=>{console.log(o.name),console.log(`ID: ${o.id}`),console.log(`Schema: ${zc(o.schema)}`),console.log(`Created: ${o.created_at}`),o.updated_at&&console.log(`Updated: ${o.updated_at}`)}},i)});var iy=new p("list").alias("ls").description("List all events").option("--limit <n>","Maximum number of events to return (1-100)","10").option("--after <cursor>","Return events after this cursor (next page)").option("--before <cursor>","Return events before this cursor (previous page)").addHelpText("after",h({output:' {"object":"list","data":[...],"has_more":true}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend events list","resend events list --limit 25 --json","resend events list --after <cursor> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching events...",sdkCall:o=>o.events.list(n),onInteractive:o=>{console.log(X_(o.data)),K(o,"events list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var ny=new p("open").description("Open the events page in the Resend dashboard").addHelpText("after",h({context:"Opens the events management page in the Resend dashboard in your default browser.",examples:["resend events open"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await Je(Oe.events,r)});var oy=new p("send").description("Send an event to trigger automations for a contact").option("--event <name>","Event name (e.g. user.signed_up)").option("--contact-id <id>","Contact ID (mutually exclusive with --email)").option("--email <email>","Contact email (mutually exclusive with --contact-id)").option("--payload <json>","Event payload as JSON string").addHelpText("after",h({context:`Sends an event for a specific contact, triggering any automations listening for it.
542
532
 
543
533
  Contact targeting:
544
534
  Provide exactly one of --contact-id or --email to identify the contact.
@@ -546,12 +536,12 @@ Contact targeting:
546
536
 
547
537
  Payload:
548
538
  Optional JSON object with event-specific data.
549
- Must match the event's schema if one is defined.`,output:' {"object":"event","event":"<name>"}',errorCodes:["auth_error","missing_event","missing_contact","conflicting_contact","invalid_json","send_error"],examples:['resend events send --event "user.signed_up" --contact-id <id>','resend events send --event "user.signed_up" --email user@example.com',`resend events send --event "order.completed" --contact-id <id> --payload '{"amount":99,"currency":"usd"}'`]})).action(async(e,t)=>{let r=t.optsWithGlobals();e.contactId&&e.email&&v({message:"Cannot use both --contact-id and --email. Provide only one.",code:"conflicting_contact"},{json:r.json});let i=await U(e.event,{message:"Event name",placeholder:"e.g. user.signed_up"},{message:"Missing --event flag.",code:"missing_event"},r),n=e.contactId,o=e.email;!n&&!o&&(await xr(void 0,{message:"Identify contact by",options:[{value:"contact-id",label:"Contact ID"},{value:"email",label:"Email address"}]},{message:"Missing --contact-id or --email flag.",code:"missing_contact"},r)==="contact-id"?n=await U(void 0,{message:"Contact ID"},{message:"Missing contact ID.",code:"missing_contact"},r):o=await U(void 0,{message:"Email address",placeholder:"user@example.com"},{message:"Missing email.",code:"missing_contact"},r));let s=ir(e.payload,"--payload",r),a=n?{event:i,contactId:n,...s&&{payload:s}}:{event:i,email:o,...s&&{payload:s}};await F({loading:"Sending event...",sdkCall:u=>u.events.send(a),errorCode:"send_error",successMsg:`Event sent: ${i}`},r)});ee();var v2=new p("update").description("Update an event schema").argument("[id]","Event ID").option("--schema <json>",'New schema as JSON (or "null" to clear the schema)').addHelpText("after",h({context:`Non-interactive: --schema is required. Pass "null" to remove the schema.
539
+ Must match the event's schema if one is defined.`,output:' {"object":"event","event":"<name>"}',errorCodes:["auth_error","missing_event","missing_contact","conflicting_contact","invalid_json","send_error"],examples:['resend events send --event "user.signed_up" --contact-id <id>','resend events send --event "user.signed_up" --email user@example.com',`resend events send --event "order.completed" --contact-id <id> --payload '{"amount":99,"currency":"usd"}'`]})).action(async(e,t)=>{let r=t.optsWithGlobals();e.contactId!==void 0&&e.email!==void 0&&g({message:"Cannot use both --contact-id and --email. Provide only one.",code:"conflicting_contact"},{json:r.json});let i=await U(e.event,{message:"Event name",placeholder:"e.g. user.signed_up"},{message:"Missing --event flag.",code:"missing_event"},r),n=e.contactId,o=e.email;!n&&!o&&(await wr(void 0,{message:"Identify contact by",options:[{value:"contact-id",label:"Contact ID"},{value:"email",label:"Email address"}]},{message:"Missing --contact-id or --email flag.",code:"missing_contact"},r)==="contact-id"?n=await U(void 0,{message:"Contact ID"},{message:"Missing contact ID.",code:"missing_contact"},r):o=await U(void 0,{message:"Email address",placeholder:"user@example.com"},{message:"Missing email.",code:"missing_contact"},r));let s=ir(e.payload,"--payload",r),a=n?{event:i,contactId:n,...s&&{payload:s}}:{event:i,email:o,...s&&{payload:s}};await B({loading:"Sending event...",sdkCall:u=>u.events.send(a),errorCode:"send_error",successMsg:`Event sent: ${i}`},r)});ee();var sy=new p("update").description("Update an event schema").argument("[id]","Event ID").option("--schema <json>",'New schema as JSON (or "null" to clear the schema)').addHelpText("after",h({context:`Non-interactive: --schema is required. Pass "null" to remove the schema.
550
540
 
551
541
  Schema format:
552
542
  A JSON object mapping field names to type strings.
553
543
  Valid types: string, number, boolean, date.
554
- Example: '{"plan":"string","age":"number"}'`,output:' {"object":"event","id":"<id>"}',errorCodes:["auth_error","missing_schema","invalid_schema","update_error"],examples:[`resend events update <id> --schema '{"plan":"string","age":"number"}'`,"resend events update <id> --schema null",`resend events update <id> --schema '{"plan":"string"}' --json`]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Ir,i),o=t.schema;o||((!k()||i.json)&&v({message:"Missing --schema flag.",code:"missing_schema"},{json:i.json}),o=await U(void 0,{message:'Schema JSON (or "null" to clear)',placeholder:'{"field":"string"}'},{message:"Missing --schema flag.",code:"missing_schema"},i));let s=lu(o,i);await F({loading:"Updating event...",sdkCall:a=>a.events.update(n,{schema:s}),errorCode:"update_error",successMsg:`Event updated: ${n}`},i)});var _2=new p("events").description("Manage events").addHelpText("after",h({context:`Events define the signals that trigger automations.
544
+ Example: '{"plan":"string","age":"number"}'`,output:' {"object":"event","id":"<id>"}',errorCodes:["auth_error","missing_schema","invalid_schema","update_error"],examples:[`resend events update <id> --schema '{"plan":"string","age":"number"}'`,"resend events update <id> --schema null",`resend events update <id> --schema '{"plan":"string"}' --json`]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,jr,i),o=t.schema;o===void 0&&((!O()||i.json)&&g({message:"Missing --schema flag.",code:"missing_schema"},{json:i.json}),o=await U(void 0,{message:'Schema JSON (or "null" to clear)',placeholder:'{"field":"string"}'},{message:"Missing --schema flag.",code:"missing_schema"},i));let s=ou(o,i);await B({loading:"Updating event...",sdkCall:a=>a.events.update(n,{schema:s}),errorCode:"update_error",successMsg:`Event updated: ${n}`},i)});var ay=new p("events").description("Manage events").addHelpText("after",h({context:`Events define the signals that trigger automations.
555
545
  Each event has a name and an optional typed schema (string | number | boolean | date fields).
556
546
 
557
547
  Lifecycle:
@@ -560,26 +550,26 @@ Lifecycle:
560
550
  3. resend events list
561
551
  4. resend events get <id>
562
552
  5. resend events update <id> --schema '{"plan":"string","trial":"boolean"}'
563
- 6. resend events delete <id> --yes`,examples:["resend events list",'resend events create --name "user.signed_up"',`resend events create --name "order.completed" --schema '{"amount":"number","currency":"string"}'`,"resend events get <id>",`resend events update <id> --schema '{"plan":"string"}'`,"resend events update <id> --schema null","resend events delete <id> --yes",'resend events send --event "user.signed_up" --contact-id <id>',`resend events send --event "user.signed_up" --email user@example.com --payload '{"plan":"pro"}'`]})).addCommand(m2).addCommand(f2).addCommand(h2,{isDefault:!0}).addCommand(v2).addCommand(p2).addCommand(g2).addCommand(b2);function y2(e){let t=e.map(r=>[r.method,r.endpoint,String(r.response_status),r.created_at,r.id]);return M(["Method","Endpoint","Status","Created","ID"],t,"(no logs)")}var C2={resource:"log",resourcePlural:"logs",fetchItems:(e,{limit:t,after:r})=>e.logs.list({limit:t,...r&&{after:r}}),display:e=>({label:`${e.method} ${e.endpoint}`,hint:e.id})};var O2=new p("get").description("Retrieve a single API request log with full request/response bodies").argument("[id]","Log ID").addHelpText("after",h({output:" Full log object including request_body and response_body.",errorCodes:["auth_error","fetch_error"],examples:["resend logs get 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55","resend logs get 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,C2,i);await N({loading:"Fetching log...",sdkCall:o=>o.logs.get(n),onInteractive:o=>{console.log(`${o.method} ${o.endpoint} \u2014 ${o.response_status}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`),console.log(`User-Agent: ${o.user_agent??"(none)"}`),o.request_body&&console.log(`
553
+ 6. resend events delete <id> --yes`,examples:["resend events list",'resend events create --name "user.signed_up"',`resend events create --name "order.completed" --schema '{"amount":"number","currency":"string"}'`,"resend events get <id>",`resend events update <id> --schema '{"plan":"string"}'`,"resend events update <id> --schema null","resend events delete <id> --yes",'resend events send --event "user.signed_up" --contact-id <id>',`resend events send --event "user.signed_up" --email user@example.com --payload '{"plan":"pro"}'`]})).addCommand(ey).addCommand(ry).addCommand(iy,{isDefault:!0}).addCommand(sy).addCommand(ty).addCommand(ny).addCommand(oy);function uy(e){let t=e.map(r=>[r.method,r.endpoint,String(r.response_status),r.created_at,r.id]);return z(["Method","Endpoint","Status","Created","ID"],t,"(no logs)")}var ly={resource:"log",resourcePlural:"logs",fetchItems:(e,{limit:t,after:r})=>e.logs.list({limit:t,...r&&{after:r}}),display:e=>({label:`${e.method} ${e.endpoint}`,hint:e.id})};var cy=new p("get").description("Retrieve a single API request log with full request/response bodies").argument("[id]","Log ID").addHelpText("after",h({output:" Full log object including request_body and response_body.",errorCodes:["auth_error","fetch_error"],examples:["resend logs get 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55","resend logs get 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ly,i);await N({loading:"Fetching log...",sdkCall:o=>o.logs.get(n),onInteractive:o=>{console.log(`${o.method} ${o.endpoint} \u2014 ${o.response_status}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`),console.log(`User-Agent: ${o.user_agent??"(none)"}`),o.request_body&&console.log(`
564
554
  Request Body:
565
555
  ${JSON.stringify(o.request_body,null,2)}`),o.response_body&&console.log(`
566
556
  Response Body:
567
- ${JSON.stringify(o.response_body,null,2)}`)}},i)});var S2=new p("list").alias("ls").description("List API request logs").option("--limit <n>","Maximum number of logs to return (1-100)","10").option("--after <cursor>","Return logs after this cursor (next page)").option("--before <cursor>","Return logs before this cursor (previous page)").addHelpText("after",h({output:` {"object":"list","data":[...],"has_more":true}
568
- The list response does not include request/response bodies \u2014 use "resend logs get <id>" for that.`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend logs list","resend logs list --limit 25 --json","resend logs list --after <cursor> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching logs...",sdkCall:o=>o.logs.list(n),onInteractive:o=>{console.log(y2(o.data)),Y(o,"logs list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var x2=new p("open").description("Open a log or the logs list in the Resend dashboard").argument("[id]","Log ID \u2014 omit to open the logs list").addHelpText("after",h({context:`Opens the Resend dashboard in your default browser.
557
+ ${JSON.stringify(o.response_body,null,2)}`)}},i)});var dy=new p("list").alias("ls").description("List API request logs").option("--limit <n>","Maximum number of logs to return (1-100)","10").option("--after <cursor>","Return logs after this cursor (next page)").option("--before <cursor>","Return logs before this cursor (previous page)").addHelpText("after",h({output:` {"object":"list","data":[...],"has_more":true}
558
+ The list response does not include request/response bodies \u2014 use "resend logs get <id>" for that.`,errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend logs list","resend logs list --limit 25 --json","resend logs list --after <cursor> --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching logs...",sdkCall:o=>o.logs.list(n),onInteractive:o=>{console.log(uy(o.data)),K(o,"logs list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var my=new p("open").description("Open a log or the logs list in the Resend dashboard").argument("[id]","Log ID \u2014 omit to open the logs list").addHelpText("after",h({context:`Opens the Resend dashboard in your default browser.
569
559
  With an ID: opens that log's detail page.
570
- Without an ID: opens the logs list.`,examples:["resend logs open","resend logs open 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55"]})).action(async(e,t,r)=>{let i=e?Se.log(e):Se.logs,n=r.optsWithGlobals();await Fe(i,n)});var w2=new p("logs").description("View API request logs").addHelpText("after",h({examples:["resend logs list","resend logs list --limit 25 --json","resend logs get 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55","resend logs open","resend logs open 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55"]})).addCommand(O2).addCommand(S2,{isDefault:!0}).addCommand(x2);var k2=new p("open").description("Open the Resend dashboard in your browser").addHelpText("after",h({context:"Opens https://resend.com/emails in your default browser.",examples:["resend open"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await Fe(Se.emails,r)});var A2=new p("create").description("Create a new segment").option("--name <name>","Segment name (required)").addHelpText("after",h({context:`Segments are named groups of contacts. Broadcasts target segments via segment_id.
560
+ Without an ID: opens the logs list.`,examples:["resend logs open","resend logs open 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55"]})).action(async(e,t,r)=>{let i=e?Oe.log(e):Oe.logs,n=r.optsWithGlobals();await Je(i,n)});var py=new p("logs").description("View API request logs").addHelpText("after",h({examples:["resend logs list","resend logs list --limit 25 --json","resend logs get 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55","resend logs open","resend logs open 3d4a472d-bc6d-4dd2-aa9d-d3d11b549e55"]})).addCommand(cy).addCommand(dy,{isDefault:!0}).addCommand(my);var fy=new p("open").description("Open the Resend dashboard in your browser").addHelpText("after",h({context:"Opens https://resend.com/emails in your default browser.",examples:["resend open"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await Je(Oe.emails,r)});var hy=new p("create").description("Create a new segment").option("--name <name>","Segment name (required)").addHelpText("after",h({context:`Segments are named groups of contacts. Broadcasts target segments via segment_id.
571
561
  Contacts can belong to multiple segments. Audiences are deprecated \u2014 use segments instead.
572
562
 
573
- Non-interactive: --name is required.`,output:' {"object":"segment","id":"<uuid>","name":"<name>"}',errorCodes:["auth_error","missing_name","create_error"],examples:['resend segments create --name "Newsletter Subscribers"','resend segments create --name "Beta Users" --json']})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.name,{message:"Segment name",placeholder:"e.g. Newsletter Subscribers"},{message:"Missing --name flag.",code:"missing_name"},r);await re({loading:"Creating segment...",sdkCall:n=>n.segments.create({name:i}),onInteractive:n=>{console.log(`Segment created: ${n.id}`),console.log(`Name: ${n.name}`)}},r)});var E2=new p("delete").alias("rm").description("Delete a segment").argument("[id]","Segment UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`Warning: Deleting a segment removes it as a target for future broadcasts,
563
+ Non-interactive: --name is required.`,output:' {"object":"segment","id":"<uuid>","name":"<name>"}',errorCodes:["auth_error","missing_name","create_error"],examples:['resend segments create --name "Newsletter Subscribers"','resend segments create --name "Beta Users" --json']})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.name,{message:"Segment name",placeholder:"e.g. Newsletter Subscribers"},{message:"Missing --name flag.",code:"missing_name"},r);await re({loading:"Creating segment...",sdkCall:n=>n.segments.create({name:i}),onInteractive:n=>{console.log(`Segment created: ${n.id}`),console.log(`Name: ${n.name}`)}},r)});var gy=new p("delete").alias("rm").description("Delete a segment").argument("[id]","Segment UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`Warning: Deleting a segment removes it as a target for future broadcasts,
574
564
  but does NOT delete the contacts within it.
575
565
 
576
- Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"segment","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ut,i);await ue(n,!!t.yes,{confirmMessage:`Delete segment ${n}?
577
- Contacts will not be deleted, but broadcasts targeting this segment will no longer work.`,loading:"Deleting segment...",object:"segment",successMsg:"Segment deleted",sdkCall:o=>o.segments.remove(n)},i)});var P2=new p("get").description("Retrieve a segment by ID").argument("[id]","Segment UUID").addHelpText("after",h({output:' {"object":"segment","id":"<uuid>","name":"<name>","created_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend segments get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend segments get 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ut,i);await N({loading:"Fetching segment...",sdkCall:o=>o.segments.get(n),onInteractive:o=>{console.log(`${o.name}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`)}},i)});var T2=new p("list").alias("ls").description("List all segments").option("--limit <n>","Maximum number of segments to return (1-100)","10").option("--after <cursor>","Return segments after this cursor (next page)").option("--before <cursor>","Return segments before this cursor (previous page)").addHelpText("after",h({context:`Pagination: use --after or --before with a segment ID as the cursor.
566
+ Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"segment","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,lt,i);await ue(n,!!t.yes,{confirmMessage:`Delete segment ${n}?
567
+ Contacts will not be deleted, but broadcasts targeting this segment will no longer work.`,loading:"Deleting segment...",object:"segment",successMsg:"Segment deleted",sdkCall:o=>o.segments.remove(n)},i)});var by=new p("get").description("Retrieve a segment by ID").argument("[id]","Segment UUID").addHelpText("after",h({output:' {"object":"segment","id":"<uuid>","name":"<name>","created_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend segments get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend segments get 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,lt,i);await N({loading:"Fetching segment...",sdkCall:o=>o.segments.get(n),onInteractive:o=>{console.log(`${o.name}`),console.log(`ID: ${o.id}`),console.log(`Created: ${o.created_at}`)}},i)});var vy=new p("list").alias("ls").description("List all segments").option("--limit <n>","Maximum number of segments to return (1-100)","10").option("--after <cursor>","Return segments after this cursor (next page)").option("--before <cursor>","Return segments before this cursor (previous page)").addHelpText("after",h({context:`Pagination: use --after or --before with a segment ID as the cursor.
578
568
  Only one of --after or --before may be used at a time.
579
569
  The response includes has_more: true when additional pages exist.
580
570
 
581
571
  Use "resend segments list" to discover segment IDs for use with broadcasts
582
- or "resend contacts add-segment".`,output:' {"object":"list","data":[{"id":"<uuid>","name":"<name>","created_at":"<iso-date>"}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend segments list","resend segments list --limit 25 --json","resend segments list --after 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching segments...",sdkCall:o=>o.segments.list(n),onInteractive:o=>{console.log(ru(o.data)),Y(o,"segments list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var j2=new p("segments").description("Manage segments").addHelpText("after",h({context:`Segments are the modern replacement for Audiences (deprecated).
572
+ or "resend contacts add-segment".`,output:' {"object":"list","data":[{"id":"<uuid>","name":"<name>","created_at":"<iso-date>"}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend segments list","resend segments list --limit 25 --json","resend segments list --after 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching segments...",sdkCall:o=>o.segments.list(n),onInteractive:o=>{console.log(Za(o.data)),K(o,"segments list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var _y=new p("segments").description("Manage segments").addHelpText("after",h({context:`Segments are the modern replacement for Audiences (deprecated).
583
573
  A segment is a named group of contacts. Broadcasts target segments via segment_id.
584
574
  Contacts can belong to multiple segments.
585
575
 
@@ -588,8 +578,8 @@ Segment membership is managed through the contacts namespace:
588
578
  resend contacts remove-segment <contactId> <segmentId>
589
579
  resend contacts segments <contactId>
590
580
 
591
- There is no "update" endpoint \u2014 to rename a segment, delete it and recreate.`,examples:["resend segments list",'resend segments create --name "Newsletter Subscribers"',"resend segments get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes"]})).addCommand(A2).addCommand(P2).addCommand(T2,{isDefault:!0}).addCommand(E2);function Kc(e){e.json||e.quiet||process.stderr.write(`Warning: "resend teams" is deprecated. Use "resend auth" instead.
592
- `)}var vw=new p("list").description("List all profiles").action((e,t)=>{let r=t.optsWithGlobals();Kc(r),Rc(r)}),_w=new p("switch").description("Switch the active profile").argument("[name]","Profile name to switch to").action(async(e,t,r)=>{let i=r.optsWithGlobals();Kc(i),await Hc(e,i)}),yw=new p("remove").description("Remove a profile").argument("[name]","Profile name to remove").action(async(e,t,r)=>{let i=r.optsWithGlobals();Kc(i),await Jc(e,i)}),Yc=new p("teams").description('(deprecated) Use "resend auth" instead').addCommand(vw).addCommand(_w).addCommand(yw);Yc._hidden=!0;ee();function cu(e){return e.map(t=>{let[r,i,...n]=t.split(":");if(!r)throw new Error(`Invalid --var "${t}": key is required.`);if(i!=="string"&&i!=="number")throw new Error(`Invalid --var "${t}": type must be "string" or "number".`);let o=n.length?n.join(":"):void 0;if(o!=null&&o==="")throw new Error(`Invalid --var "${t}": fallback value cannot be empty.`);let s=o;if(i==="number"){if(s!=null&&Number.isNaN(Number(s)))throw new Error(`Invalid --var "${t}": fallback "${s}" is not a valid number.`);return{key:r,type:"number",...s!=null?{fallbackValue:Number(s)}:{}}}return{key:r,type:"string",...s!=null?{fallbackValue:s}:{}}})}var ct={resource:"template",resourcePlural:"templates",fetchItems:(e,{limit:t,after:r})=>e.templates.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};function I2(e){let t=e.map(r=>[r.name,r.status,r.alias??"",r.id,r.created_at]);return M(["Name","Status","Alias","ID","Created"],t,"(no templates)")}var D2=new p("create").description("Create a new template").option("--name <name>","Template name \u2014 required").option("--html <html>","HTML body").option("--html-file <path>",'Path to an HTML file for the body (use "-" for stdin)').option("--subject <subject>","Email subject").option("--text <text>","Plain-text body").option("--text-file <path>",'Path to a plain-text file for the body (use "-" for stdin)').option("--react-email <path>","Path to a React Email template (.tsx) to bundle, render, and use as HTML body (npm install only)").option("--from <address>","Sender address").option("--reply-to <address>","Reply-to address").option("--alias <alias>","Template alias for lookup by name").option("--var <var...>","Template variable: KEY:type or KEY:type:fallback (repeatable)").addHelpText("after",h({context:`Creates a new draft template. Use "resend templates publish" to make it available for sending.
581
+ There is no "update" endpoint \u2014 to rename a segment, delete it and recreate.`,examples:["resend segments list",'resend segments create --name "Newsletter Subscribers"',"resend segments get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend segments delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes"]})).addCommand(hy).addCommand(by).addCommand(vy,{isDefault:!0}).addCommand(gy);function Mc(e){e.json||e.quiet||process.stderr.write(`Warning: "resend teams" is deprecated. Use "resend auth" instead.
582
+ `)}var Gx=new p("list").description("List all profiles").action((e,t)=>{let r=t.optsWithGlobals();Mc(r),kc(r)}),Ux=new p("switch").description("Switch the active profile").argument("[name]","Profile name to switch to").action(async(e,t,r)=>{let i=r.optsWithGlobals();Mc(i),await Tc(e,i)}),Wx=new p("remove").description("Remove a profile").argument("[name]","Profile name to remove").action(async(e,t,r)=>{let i=r.optsWithGlobals();Mc(i),await Pc(e,i)}),Jc=new p("teams").description('(deprecated) Use "resend auth" instead').addCommand(Gx).addCommand(Ux).addCommand(Wx);Jc._hidden=!0;ee();function su(e){return e.map(t=>{let[r,i,...n]=t.split(":");if(!r)throw new Error(`Invalid --var "${t}": key is required.`);if(i!=="string"&&i!=="number")throw new Error(`Invalid --var "${t}": type must be "string" or "number".`);let o=n.length?n.join(":"):void 0;if(o!=null&&o==="")throw new Error(`Invalid --var "${t}": fallback value cannot be empty.`);let s=o;if(i==="number"){if(s!=null&&Number.isNaN(Number(s)))throw new Error(`Invalid --var "${t}": fallback "${s}" is not a valid number.`);return{key:r,type:"number",...s!=null?{fallbackValue:Number(s)}:{}}}return{key:r,type:"string",...s!=null?{fallbackValue:s}:{}}})}var dt={resource:"template",resourcePlural:"templates",fetchItems:(e,{limit:t,after:r})=>e.templates.list({limit:t,...r&&{after:r}}),display:e=>({label:e.name,hint:e.id})};function yy(e){let t=e.map(r=>[r.name,r.status,r.alias??"",r.id,r.created_at]);return z(["Name","Status","Alias","ID","Created"],t,"(no templates)")}var Cy=new p("create").description("Create a new template").option("--name <name>","Template name \u2014 required").option("--html <html>","HTML body").option("--html-file <path>",'Path to an HTML file for the body (use "-" for stdin)').option("--subject <subject>","Email subject").option("--text <text>","Plain-text body").option("--text-file <path>",'Path to a plain-text file for the body (use "-" for stdin)').option("--react-email <path>","Path to a React Email template (.tsx) to bundle, render, and use as HTML body (npm install only)").option("--from <address>","Sender address").option("--reply-to <address>","Reply-to address").option("--alias <alias>","Template alias for lookup by name").option("--var <var...>","Template variable: KEY:type or KEY:type:fallback (repeatable)").addHelpText("after",h({context:`Creates a new draft template. Use "resend templates publish" to make it available for sending.
593
583
 
594
584
  --name is required. Body: provide --html, --html-file, or --react-email. Optionally add --text or --text-file for plain-text.
595
585
 
@@ -599,23 +589,23 @@ There is no "update" endpoint \u2014 to rename a segment, delete it and recreate
599
589
  --html "<p>Hi {{{NAME}}}, your total is {{{PRICE}}}</p>"
600
590
  --var NAME:string --var PRICE:number:0
601
591
 
602
- Non-interactive: --name and a body (--html, --html-file, or --react-email) are required. --text-file provides a plain-text fallback.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","missing_name","missing_body","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","create_error"],examples:['resend templates create --name "Welcome" --html "<h1>Hello</h1>" --subject "Welcome!"','resend templates create --name "Newsletter" --html-file ./template.html --from acme@example.com','resend templates create --name "Onboarding" --html "<p>Hi</p>" --alias onboarding --json','resend templates create --name "Order" --html "<p>{{{PRODUCT}}}: {{{PRICE}}}</p>" --var PRODUCT:string:item --var PRICE:number:25']})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=e.name;if(!i){(!k()||r.json)&&v({message:"Missing --name flag.",code:"missing_name"},{json:r.json});let s=await te({message:"Template name",placeholder:"e.g. Welcome Email",validate:a=>a?void 0:"Required"});j(s)&&D("Cancelled."),i=s}e.htmlFile==="-"&&e.textFile==="-"&&v({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:r.json}),e.reactEmail&&(e.html||e.htmlFile)&&v({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:r.json});let n=e.html,o=e.text;if(e.htmlFile&&(e.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
592
+ Non-interactive: --name and a body (--html, --html-file, or --react-email) are required. --text-file provides a plain-text fallback.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","missing_name","missing_body","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","create_error"],examples:['resend templates create --name "Welcome" --html "<h1>Hello</h1>" --subject "Welcome!"','resend templates create --name "Newsletter" --html-file ./template.html --from acme@example.com','resend templates create --name "Onboarding" --html "<p>Hi</p>" --alias onboarding --json','resend templates create --name "Order" --html "<p>{{{PRODUCT}}}: {{{PRICE}}}</p>" --var PRODUCT:string:item --var PRICE:number:25']})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=e.name;if(!i){(!O()||r.json)&&g({message:"Missing --name flag.",code:"missing_name"},{json:r.json});let s=await te({message:"Template name",placeholder:"e.g. Welcome Email",validate:a=>a?void 0:"Required"});P(s)&&T("Cancelled."),i=s}e.htmlFile==="-"&&e.textFile==="-"&&g({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:r.json}),e.reactEmail&&(e.html||e.htmlFile)&&g({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:r.json});let n=e.html,o=e.text;if(e.htmlFile&&(e.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
603
593
  `),n=ge(e.htmlFile,r)),e.textFile&&(e.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
604
- `),o=ge(e.textFile,r)),e.reactEmail&&(n=await et(e.reactEmail,r)),!n){(!k()||r.json)&&v({message:"Missing body. Provide --html, --html-file, or --react-email.",code:"missing_body"},{json:r.json});let s=await te({message:"HTML body",placeholder:"<h1>Hello {{name}}</h1>",validate:a=>a?void 0:"Required"});j(s)&&D("Cancelled."),n=s}await re({loading:"Creating template...",sdkCall:s=>Promise.resolve(s.templates.create({name:i,html:n,...e.subject&&{subject:e.subject},...o&&{text:o},...e.from&&{from:e.from},...e.replyTo&&{replyTo:e.replyTo},...e.alias&&{alias:e.alias},...e.var&&{variables:cu(e.var)}})),onInteractive:s=>{console.log(`Template created: ${s.id}`)}},r)});var $2=new p("delete").alias("rm").description("Delete a template").argument("[id]","Template ID or alias").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`Warning: Deleting a template is permanent and cannot be undone.
594
+ `),o=ge(e.textFile,r)),e.reactEmail&&(n=await et(e.reactEmail,r)),!n){(!O()||r.json)&&g({message:"Missing body. Provide --html, --html-file, or --react-email.",code:"missing_body"},{json:r.json});let s=await te({message:"HTML body",placeholder:"<h1>Hello {{name}}</h1>",validate:a=>a?void 0:"Required"});P(s)&&T("Cancelled."),n=s}await re({loading:"Creating template...",sdkCall:s=>Promise.resolve(s.templates.create({name:i,html:n,...e.subject&&{subject:e.subject},...o&&{text:o},...e.from&&{from:e.from},...e.replyTo&&{replyTo:e.replyTo},...e.alias&&{alias:e.alias},...e.var&&{variables:su(e.var)}})),onInteractive:s=>{console.log(`Template created: ${s.id}`)}},r)});var Oy=new p("delete").alias("rm").description("Delete a template").argument("[id]","Template ID or alias").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`Warning: Deleting a template is permanent and cannot be undone.
605
595
 
606
- Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"template","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend templates rm my-template-alias --yes","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ct,i);await ue(n,!!t.yes,{confirmMessage:`Delete template ${n}?
607
- This action is permanent and cannot be undone.`,loading:"Deleting template...",object:"template",successMsg:"Template deleted",sdkCall:o=>o.templates.remove(n)},i)});var q2=new p("duplicate").description("Duplicate a template").argument("[id]","Template ID or alias to duplicate").addHelpText("after",h({context:`Creates a copy of an existing template and returns the new template ID.
596
+ Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"template","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend templates rm my-template-alias --yes","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,dt,i);await ue(n,!!t.yes,{confirmMessage:`Delete template ${n}?
597
+ This action is permanent and cannot be undone.`,loading:"Deleting template...",object:"template",successMsg:"Template deleted",sdkCall:o=>o.templates.remove(n)},i)});var Sy=new p("duplicate").description("Duplicate a template").argument("[id]","Template ID or alias to duplicate").addHelpText("after",h({context:`Creates a copy of an existing template and returns the new template ID.
608
598
  The duplicate is created as a draft with " (Copy)" appended to the original name.
609
- All fields (HTML, subject, variables, etc.) are copied to the new template.`,output:' {"object":"template","id":"<new-template-id>"}',errorCodes:["auth_error","create_error"],examples:["resend templates duplicate 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates duplicate my-template-alias --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ct,i);await re({loading:"Duplicating template...",sdkCall:o=>Promise.resolve(o.templates.duplicate(n)),onInteractive:o=>{console.log(`Template duplicated: ${o.id}`)}},i)});var R2=new p("get").description("Retrieve a template by ID or alias").argument("[id]","Template ID or alias").addHelpText("after",h({context:"Returns the full template including HTML body, variables, and publication status.",output:' {"object":"template","id":"...","name":"...","subject":"...","status":"draft|published","html":"...","alias":"...","from":"...","reply_to":["..."],"variables":[...],"created_at":"...","updated_at":"..."}',errorCodes:["auth_error","fetch_error"],examples:["resend templates get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates get my-template-alias","resend templates get 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ct,i);await N({loading:"Fetching template...",sdkCall:o=>o.templates.get(n),onInteractive:o=>{if(console.log(`${o.name}`),console.log(`ID: ${o.id}`),console.log(`Status: ${o.status}`),o.alias&&console.log(`Alias: ${o.alias}`),o.subject&&console.log(`Subject: ${o.subject}`),o.from&&console.log(`From: ${o.from}`),o.reply_to?.length&&console.log(`Reply-To: ${o.reply_to.join(", ")}`),o.html){let s=o.html.length>200?`${o.html.slice(0,197)}...`:o.html;console.log(`HTML: ${s}`)}o.variables?.length&&console.log(`Variables: ${o.variables.map(s=>s.key).join(", ")}`),o.published_at&&console.log(`Published: ${o.published_at}`),console.log(`Created: ${o.created_at}`),console.log(`Updated: ${o.updated_at}`)}},i)});var z2=new p("list").alias("ls").description("List all templates").option("--limit <n>","Maximum number of templates to return (1-100)","10").option("--after <cursor>","Cursor for forward pagination \u2014 list items after this ID").option("--before <cursor>","Cursor for backward pagination \u2014 list items before this ID").addHelpText("after",h({output:' {"object":"list","has_more":false,"data":[{"id":"...","name":"...","status":"draft|published","alias":"...","created_at":"..."}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend templates list","resend templates list --limit 5","resend templates list --after <template-id> --limit 10","resend templates list --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching templates...",sdkCall:o=>o.templates.list(n),onInteractive:o=>{console.log(I2(o.data)),Y(o,"templates list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var M2=new p("open").description("Open a template or the templates list in the Resend dashboard").argument("[id]","Template ID \u2014 omit to open the templates list").addHelpText("after",h({context:`Opens the Resend dashboard in your default browser.
599
+ All fields (HTML, subject, variables, etc.) are copied to the new template.`,output:' {"object":"template","id":"<new-template-id>"}',errorCodes:["auth_error","create_error"],examples:["resend templates duplicate 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates duplicate my-template-alias --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,dt,i);await re({loading:"Duplicating template...",sdkCall:o=>Promise.resolve(o.templates.duplicate(n)),onInteractive:o=>{console.log(`Template duplicated: ${o.id}`)}},i)});var xy=new p("get").description("Retrieve a template by ID or alias").argument("[id]","Template ID or alias").addHelpText("after",h({context:"Returns the full template including HTML body, variables, and publication status.",output:' {"object":"template","id":"...","name":"...","subject":"...","status":"draft|published","html":"...","alias":"...","from":"...","reply_to":["..."],"variables":[...],"created_at":"...","updated_at":"..."}',errorCodes:["auth_error","fetch_error"],examples:["resend templates get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates get my-template-alias","resend templates get 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,dt,i);await N({loading:"Fetching template...",sdkCall:o=>o.templates.get(n),onInteractive:o=>{if(console.log(`${o.name}`),console.log(`ID: ${o.id}`),console.log(`Status: ${o.status}`),o.alias&&console.log(`Alias: ${o.alias}`),o.subject&&console.log(`Subject: ${o.subject}`),o.from&&console.log(`From: ${o.from}`),o.reply_to?.length&&console.log(`Reply-To: ${o.reply_to.join(", ")}`),o.html){let s=o.html.length>200?`${o.html.slice(0,197)}...`:o.html;console.log(`HTML: ${s}`)}o.variables?.length&&console.log(`Variables: ${o.variables.map(s=>s.key).join(", ")}`),o.published_at&&console.log(`Published: ${o.published_at}`),console.log(`Created: ${o.created_at}`),console.log(`Updated: ${o.updated_at}`)}},i)});var wy=new p("list").alias("ls").description("List all templates").option("--limit <n>","Maximum number of templates to return (1-100)","10").option("--after <cursor>","Cursor for forward pagination \u2014 list items after this ID").option("--before <cursor>","Cursor for backward pagination \u2014 list items before this ID").addHelpText("after",h({output:' {"object":"list","has_more":false,"data":[{"id":"...","name":"...","status":"draft|published","alias":"...","created_at":"..."}]}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend templates list","resend templates list --limit 5","resend templates list --after <template-id> --limit 10","resend templates list --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching templates...",sdkCall:o=>o.templates.list(n),onInteractive:o=>{console.log(yy(o.data)),K(o,"templates list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var ky=new p("open").description("Open a template or the templates list in the Resend dashboard").argument("[id]","Template ID \u2014 omit to open the templates list").addHelpText("after",h({context:`Opens the Resend dashboard in your default browser.
610
600
  With an ID: opens that template's page for editing or viewing.
611
- Without an ID: opens the templates list.`,examples:["resend templates open","resend templates open 78261eea-8f8b-4381-83c6-79fa7120f1cf"]})).action(async(e,t,r)=>{let i=e?Se.template(e):Se.templates,n=r.optsWithGlobals();await Fe(i,n)});var J2=new p("publish").description("Publish a draft template").argument("[id]","Template ID or alias").addHelpText("after",h({context:`Promotes a draft template to published status, making it available for use in emails.
601
+ Without an ID: opens the templates list.`,examples:["resend templates open","resend templates open 78261eea-8f8b-4381-83c6-79fa7120f1cf"]})).action(async(e,t,r)=>{let i=e?Oe.template(e):Oe.templates,n=r.optsWithGlobals();await Je(i,n)});var Ay=new p("publish").description("Publish a draft template").argument("[id]","Template ID or alias").addHelpText("after",h({context:`Promotes a draft template to published status, making it available for use in emails.
612
602
  After updating a published template, re-publish to make the changes live.
613
- Publishing an already-published template re-publishes it with the latest draft changes.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","publish_error"],examples:["resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,ct,i);await F({loading:"Publishing template...",sdkCall:o=>o.templates.publish(n),errorCode:"publish_error",successMsg:`Template published: ${n}`},i)});var H2=new p("update").description("Update an existing template").argument("[id]","Template ID or alias").option("--name <name>","Update template name").option("--html <html>","Update HTML body").option("--html-file <path>",'Path to an HTML file to replace the body (use "-" for stdin)').option("--subject <subject>","Update subject").option("--text <text>","Update plain-text body").option("--text-file <path>",'Path to a plain-text file to replace the body (use "-" for stdin)').option("--react-email <path>","Path to a React Email template (.tsx) to bundle, render, and use as HTML body (npm install only)").option("--from <address>","Update sender address").option("--reply-to <address>","Update reply-to address").option("--alias <alias>","Update template alias").option("--var <var...>","Template variable: KEY:type or KEY:type:fallback (repeatable)").addHelpText("after",h({context:`At least one option is required. Only the provided fields are changed; others are left as-is.
603
+ Publishing an already-published template re-publishes it with the latest draft changes.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","publish_error"],examples:["resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,dt,i);await B({loading:"Publishing template...",sdkCall:o=>o.templates.publish(n),errorCode:"publish_error",successMsg:`Template published: ${n}`},i)});var Ey=new p("update").description("Update an existing template").argument("[id]","Template ID or alias").option("--name <name>","Update template name").option("--html <html>","Update HTML body").option("--html-file <path>",'Path to an HTML file to replace the body (use "-" for stdin)').option("--subject <subject>","Update subject").option("--text <text>","Update plain-text body").option("--text-file <path>",'Path to a plain-text file to replace the body (use "-" for stdin)').option("--react-email <path>","Path to a React Email template (.tsx) to bundle, render, and use as HTML body (npm install only)").option("--from <address>","Update sender address").option("--reply-to <address>","Update reply-to address").option("--alias <alias>","Update template alias").option("--var <var...>","Template variable: KEY:type or KEY:type:fallback (repeatable)").addHelpText("after",h({context:`At least one option is required. Only the provided fields are changed; others are left as-is.
614
604
 
615
605
  --var declares a template variable using the format KEY:type or KEY:type:fallback.
616
606
  Valid types: string, number.
617
- Variables must match {{{KEY}}} placeholders in the HTML body.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","no_changes","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","update_error"],examples:['resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Updated Name"',"resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --html-file ./new-template.html",'resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --subject "New Subject" --from "acme@example.com" --json',"resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --var PRODUCT:string:item --var PRICE:number:25"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals();t.name==null&&t.html==null&&t.htmlFile==null&&t.reactEmail==null&&t.subject==null&&t.text==null&&t.textFile==null&&t.from==null&&t.replyTo==null&&t.alias==null&&t.var==null&&v({message:"Provide at least one option to update: --name, --html, --html-file, --react-email, --subject, --text, --text-file, --from, --reply-to, --alias, or --var.",code:"no_changes"},{json:i.json}),t.reactEmail!=null&&(t.html!=null||t.htmlFile!=null)&&v({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:i.json}),t.html!=null&&t.htmlFile!=null&&v({message:"--html and --html-file are mutually exclusive.",code:"invalid_options"},{json:i.json}),t.htmlFile==="-"&&t.textFile==="-"&&v({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:i.json});let n=await C(e,ct,i),o=t.html,s=t.text;t.htmlFile!=null&&(o=ge(t.htmlFile,i)),t.textFile!=null&&(t.text!=null&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
618
- `),s=ge(t.textFile,i)),t.reactEmail!=null&&(o=await et(t.reactEmail,i)),await F({loading:"Updating template...",sdkCall:a=>a.templates.update(n,{...t.name!=null&&{name:t.name},...o!=null&&{html:o},...t.subject!=null&&{subject:t.subject},...s!=null&&{text:s},...t.from!=null&&{from:t.from},...t.replyTo!=null&&{replyTo:t.replyTo},...t.alias!=null&&{alias:t.alias},...t.var!=null&&{variables:cu(t.var)}}),errorCode:"update_error",successMsg:`Template updated: ${n}`},i)});var F2=new p("templates").description("Manage templates").addHelpText("after",h({context:`Lifecycle:
607
+ Variables must match {{{KEY}}} placeholders in the HTML body.`,output:' {"object":"template","id":"<template-id>"}',errorCodes:["auth_error","no_changes","file_read_error","invalid_options","stdin_read_error","react_email_build_error","react_email_render_error","update_error"],examples:['resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Updated Name"',"resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --html-file ./new-template.html",'resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --subject "New Subject" --from "acme@example.com" --json',"resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --var PRODUCT:string:item --var PRICE:number:25"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals();t.name==null&&t.html==null&&t.htmlFile==null&&t.reactEmail==null&&t.subject==null&&t.text==null&&t.textFile==null&&t.from==null&&t.replyTo==null&&t.alias==null&&t.var==null&&g({message:"Provide at least one option to update: --name, --html, --html-file, --react-email, --subject, --text, --text-file, --from, --reply-to, --alias, or --var.",code:"no_changes"},{json:i.json}),t.reactEmail!=null&&(t.html!=null||t.htmlFile!=null)&&g({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:i.json}),t.html!=null&&t.htmlFile!=null&&g({message:"--html and --html-file are mutually exclusive.",code:"invalid_options"},{json:i.json}),t.htmlFile==="-"&&t.textFile==="-"&&g({message:"Cannot read both --html-file and --text-file from stdin. Pipe to one and pass the other as a file path.",code:"invalid_options"},{json:i.json});let n=await C(e,dt,i),o=t.html,s=t.text;t.htmlFile!=null&&(o=ge(t.htmlFile,i)),t.textFile!=null&&(t.text!=null&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
608
+ `),s=ge(t.textFile,i)),t.reactEmail!=null&&(o=await et(t.reactEmail,i)),await B({loading:"Updating template...",sdkCall:a=>a.templates.update(n,{...t.name!=null&&{name:t.name},...o!=null&&{html:o},...t.subject!=null&&{subject:t.subject},...s!=null&&{text:s},...t.from!=null&&{from:t.from},...t.replyTo!=null&&{replyTo:t.replyTo},...t.alias!=null&&{alias:t.alias},...t.var!=null&&{variables:su(t.var)}}),errorCode:"update_error",successMsg:`Template updated: ${n}`},i)});var Py=new p("templates").description("Manage templates").addHelpText("after",h({context:`Lifecycle:
619
609
  Templates follow a draft \u2192 published workflow:
620
610
  1. create \u2014 creates a draft template
621
611
  2. update \u2014 edits name, subject, HTML, variables, etc.
@@ -629,7 +619,7 @@ Template variables:
629
619
  Each variable must be declared with --var when creating or updating:
630
620
  --var KEY:type e.g. --var NAME:string
631
621
  --var KEY:type:fallback e.g. --var PRICE:number:25
632
- Valid types: string, number.`,examples:["resend templates list",'resend templates create --name "Welcome" --html "<h1>Hello {{{NAME}}}</h1>" --subject "Welcome!" --var NAME:string',"resend templates get 78261eea-8f8b-4381-83c6-79fa7120f1cf",'resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --subject "Updated Subject"',"resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates duplicate 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend templates open","resend templates open 78261eea-8f8b-4381-83c6-79fa7120f1cf"]})).addCommand(D2).addCommand(R2).addCommand(M2).addCommand(z2,{isDefault:!0}).addCommand(H2).addCommand($2).addCommand(J2).addCommand(q2);var B2=new p("create").description("Create a new topic for subscription management").option("--name <name>","Topic name (required)").option("--description <description>","Description shown to contacts when managing subscriptions").addOption(new ce("--default-subscription <mode>","Default subscription state for contacts").choices(["opt_in","opt_out"]).default("opt_in")).addHelpText("after",h({context:`Topics enable fine-grained subscription management. Contacts can opt in or out of
622
+ Valid types: string, number.`,examples:["resend templates list",'resend templates create --name "Welcome" --html "<h1>Hello {{{NAME}}}</h1>" --subject "Welcome!" --var NAME:string',"resend templates get 78261eea-8f8b-4381-83c6-79fa7120f1cf",'resend templates update 78261eea-8f8b-4381-83c6-79fa7120f1cf --subject "Updated Subject"',"resend templates publish 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates duplicate 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend templates delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend templates open","resend templates open 78261eea-8f8b-4381-83c6-79fa7120f1cf"]})).addCommand(Cy).addCommand(xy).addCommand(ky).addCommand(wy,{isDefault:!0}).addCommand(Ey).addCommand(Oy).addCommand(Ay).addCommand(Sy);var Ty=new p("create").description("Create a new topic for subscription management").option("--name <name>","Topic name (required)").option("--description <description>","Description shown to contacts when managing subscriptions").addOption(new ce("--default-subscription <mode>","Default subscription state for contacts").choices(["opt_in","opt_out"]).default("opt_in")).addHelpText("after",h({context:`Topics enable fine-grained subscription management. Contacts can opt in or out of
633
623
  individual topics. Broadcasts can target only contacts opted into a specific topic.
634
624
 
635
625
  Example topics: "Product Updates", "Security Alerts", "Weekly Digest".
@@ -638,15 +628,15 @@ Example topics: "Product Updates", "Security Alerts", "Weekly Digest".
638
628
  opt_in Contacts receive broadcasts unless they explicitly opt out (default)
639
629
  opt_out Contacts do NOT receive broadcasts unless they explicitly opt in
640
630
 
641
- Non-interactive: --name is required.`,output:' {"id":"<uuid>"}',errorCodes:["auth_error","missing_name","create_error"],examples:['resend topics create --name "Product Updates"','resend topics create --name "Weekly Digest" --default-subscription opt_out','resend topics create --name "Security Alerts" --description "Critical security notices" --json']})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.name,{message:"Topic name",placeholder:"e.g. Product Updates"},{message:"Missing --name flag.",code:"missing_name"},r);await re({loading:"Creating topic...",sdkCall:n=>n.topics.create({name:i,defaultSubscription:e.defaultSubscription,...e.description&&{description:e.description}}),onInteractive:n=>{console.log(`Topic created: ${n.id}`)}},r)});var N2=new p("delete").alias("rm").description("Delete a topic").argument("[id]","Topic UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`Warning: Deleting a topic removes all contact subscriptions to that topic and may affect
631
+ Non-interactive: --name is required.`,output:' {"id":"<uuid>"}',errorCodes:["auth_error","missing_name","create_error"],examples:['resend topics create --name "Product Updates"','resend topics create --name "Weekly Digest" --default-subscription opt_out','resend topics create --name "Security Alerts" --description "Critical security notices" --json']})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.name,{message:"Topic name",placeholder:"e.g. Product Updates"},{message:"Missing --name flag.",code:"missing_name"},r);await re({loading:"Creating topic...",sdkCall:n=>n.topics.create({name:i,defaultSubscription:e.defaultSubscription,...e.description&&{description:e.description}}),onInteractive:n=>{console.log(`Topic created: ${n.id}`)}},r)});var Dy=new p("delete").alias("rm").description("Delete a topic").argument("[id]","Topic UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`Warning: Deleting a topic removes all contact subscriptions to that topic and may affect
642
632
  broadcasts that reference this topic_id. Contacts themselves are not deleted.
643
633
 
644
- Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"topic","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Tt,i);await ue(n,!!t.yes,{confirmMessage:`Delete topic ${n}?
645
- All contact subscriptions and broadcast associations will be removed.`,loading:"Deleting topic...",object:"topic",successMsg:"Topic deleted",sdkCall:o=>o.topics.remove(n)},i)});var L2=new p("get").description("Retrieve a topic by ID").argument("[id]","Topic UUID").addHelpText("after",h({output:' {"id":"<uuid>","name":"<name>","description":"<desc>","default_subscription":"opt_in|opt_out","created_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend topics get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend topics get 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Tt,i);await N({loading:"Fetching topic...",sdkCall:o=>o.topics.get(n),onInteractive:o=>{console.log(`${o.name}`),console.log(`ID: ${o.id}`),o.description&&console.log(`Description: ${o.description}`),console.log(`Default subscription: ${o.default_subscription}`),console.log(`Created: ${o.created_at}`)}},i)});var G2=new p("list").alias("ls").description("List all topics").addHelpText("after",h({context:`Returns all topics in your account. Topic subscription management for individual
646
- contacts is handled via "resend contacts topics <contactId>".`,output:' {"data":[{"id":"<uuid>","name":"<name>","description":"<desc>","default_subscription":"opt_in|opt_out","created_at":"<iso-date>"}]}',errorCodes:["auth_error","list_error"],examples:["resend topics list","resend topics list --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await q({loading:"Fetching topics...",sdkCall:i=>i.topics.list(),onInteractive:i=>console.log(Fv(i.data))},r)});var U2=new p("update").description("Update a topic's name or description").argument("[id]","Topic UUID").option("--name <name>","New topic name").option("--description <description>","New description shown to contacts").addHelpText("after",h({context:`At least one of --name or --description must be provided to update the topic.
634
+ Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"topic","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes","resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,It,i);await ue(n,!!t.yes,{confirmMessage:`Delete topic ${n}?
635
+ All contact subscriptions and broadcast associations will be removed.`,loading:"Deleting topic...",object:"topic",successMsg:"Topic deleted",sdkCall:o=>o.topics.remove(n)},i)});var Iy=new p("get").description("Retrieve a topic by ID").argument("[id]","Topic UUID").addHelpText("after",h({output:' {"id":"<uuid>","name":"<name>","description":"<desc>","default_subscription":"opt_in|opt_out","created_at":"<iso-date>"}',errorCodes:["auth_error","fetch_error"],examples:["resend topics get 78261eea-8f8b-4381-83c6-79fa7120f1cf","resend topics get 78261eea-8f8b-4381-83c6-79fa7120f1cf --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,It,i);await N({loading:"Fetching topic...",sdkCall:o=>o.topics.get(n),onInteractive:o=>{console.log(`${o.name}`),console.log(`ID: ${o.id}`),o.description&&console.log(`Description: ${o.description}`),console.log(`Default subscription: ${o.default_subscription}`),console.log(`Created: ${o.created_at}`)}},i)});var jy=new p("list").alias("ls").description("List all topics").addHelpText("after",h({context:`Returns all topics in your account. Topic subscription management for individual
636
+ contacts is handled via "resend contacts topics <contactId>".`,output:' {"data":[{"id":"<uuid>","name":"<name>","description":"<desc>","default_subscription":"opt_in|opt_out","created_at":"<iso-date>"}]}',errorCodes:["auth_error","list_error"],examples:["resend topics list","resend topics list --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await R({loading:"Fetching topics...",sdkCall:i=>i.topics.list(),onInteractive:i=>console.log(Pv(i.data))},r)});var $y=new p("update").description("Update a topic's name or description").argument("[id]","Topic UUID").option("--name <name>","New topic name").option("--description <description>","New description shown to contacts").addHelpText("after",h({context:`At least one of --name or --description must be provided to update the topic.
647
637
 
648
638
  Note: --default-subscription cannot be changed after creation.
649
- To change the default subscription, delete the topic and recreate it.`,output:' {"id":"<uuid>"}',errorCodes:["auth_error","no_changes","update_error"],examples:['resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Security Alerts"','resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --description "Critical notices" --json']})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,Tt,i);!t.name&&!t.description&&v({message:"Provide at least one option to update: --name or --description.",code:"no_changes"},{json:i.json}),await F({loading:"Updating topic...",sdkCall:o=>o.topics.update({id:n,...t.name&&{name:t.name},...t.description&&{description:t.description}}),errorCode:"update_error",successMsg:`Topic updated: ${n}`},i)});var W2=new p("topics").description("Manage topics for contact subscription preferences").addHelpText("after",h({context:`Topics enable fine-grained subscription management beyond the global unsubscribe flag.
639
+ To change the default subscription, delete the topic and recreate it.`,output:' {"id":"<uuid>"}',errorCodes:["auth_error","no_changes","update_error"],examples:['resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Security Alerts"','resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --description "Critical notices" --json']})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,It,i);!t.name&&!t.description&&g({message:"Provide at least one option to update: --name or --description.",code:"no_changes"},{json:i.json}),await B({loading:"Updating topic...",sdkCall:o=>o.topics.update({id:n,...t.name&&{name:t.name},...t.description&&{description:t.description}}),errorCode:"update_error",successMsg:`Topic updated: ${n}`},i)});var qy=new p("topics").description("Manage topics for contact subscription preferences").addHelpText("after",h({context:`Topics enable fine-grained subscription management beyond the global unsubscribe flag.
650
640
  A contact can opt in or out of individual topics independently.
651
641
 
652
642
  Broadcasts can target a topic_id so only contacts who have opted into that topic
@@ -659,11 +649,11 @@ Subscription states:
659
649
 
660
650
  Contact topic subscriptions are managed via the contacts namespace:
661
651
  resend contacts topics <contactId>
662
- resend contacts update-topics <contactId> --topic-id <id> --subscription opt_in`,examples:["resend topics list",'resend topics create --name "Product Updates"','resend topics create --name "Weekly Digest" --default-subscription opt_out',"resend topics get 78261eea-8f8b-4381-83c6-79fa7120f1cf",'resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Security Alerts"',"resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes"]})).addCommand(B2).addCommand(L2).addCommand(G2,{isDefault:!0}).addCommand(U2).addCommand(N2);ee();ui();zt();var V2=new p("update").description("Check for available CLI updates").addHelpText("after",h({context:`Checks the latest release on GitHub (bypasses the cache).
652
+ resend contacts update-topics <contactId> --topic-id <id> --subscription opt_in`,examples:["resend topics list",'resend topics create --name "Product Updates"','resend topics create --name "Weekly Digest" --default-subscription opt_out',"resend topics get 78261eea-8f8b-4381-83c6-79fa7120f1cf",'resend topics update 78261eea-8f8b-4381-83c6-79fa7120f1cf --name "Security Alerts"',"resend topics delete 78261eea-8f8b-4381-83c6-79fa7120f1cf --yes"]})).addCommand(Ty).addCommand(Iy).addCommand(jy,{isDefault:!0}).addCommand($y).addCommand(Dy);ee();ui();Ft();var Ry=new p("update").description("Check for available CLI updates").addHelpText("after",h({context:`Checks the latest release on GitHub (bypasses the cache).
663
653
  Shows the current version, latest version, and how to upgrade.`,output:` {"current":"1.4.0","latest":"1.5.0","update_available":true,"upgrade_command":"npm install -g resend-cli"}
664
- {"current":"1.5.0","latest":"1.5.0","update_available":false}`,examples:["resend update","resend update --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),n=k()&&!r.json?he("Checking for updates..."):null,o=await Wc();if(!o){n?.fail("Could not check for updates"),v({message:"Could not reach GitHub releases",code:"fetch_failed"},{json:r.json});return}let s=su(se,o),a=au();if(r.json||!k()){z({current:se,latest:o,update_available:s,...s?{upgrade_command:a}:{}},{json:r.json});return}if(s){let u=a.startsWith("http");n?.warn(`Update available: v${se} \u2192 v${o}`),console.log(`
654
+ {"current":"1.5.0","latest":"1.5.0","update_available":false}`,examples:["resend update","resend update --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),n=O()&&!r.json?he("Checking for updates..."):null,o=await Fc();if(!o){n?.fail("Could not check for updates"),g({message:"Could not reach GitHub releases",code:"fetch_failed"},{json:r.json});return}let s=ru(se,o),a=iu();if(r.json||!O()){F({current:se,latest:o,update_available:s,...s?{upgrade_command:a}:{}},{json:r.json});return}if(s){let u=a.startsWith("http");n?.warn(`Update available: v${se} \u2192 v${o}`),console.log(`
665
655
  ${u?"Visit":"Run"}: \x1B[36m${a}\x1B[0m
666
- `)}else n?.stop(`Already up to date (v${se})`)});ee();var bt=["email.sent","email.delivered","email.delivery_delayed","email.bounced","email.complained","email.opened","email.clicked","email.failed","email.scheduled","email.suppressed","email.received","contact.created","contact.updated","contact.deleted","domain.created","domain.updated","domain.deleted"];function Dr(e){return e.flatMap(t=>t.split(",")).map(t=>t.trim()).filter(Boolean)}var $r={resource:"webhook",resourcePlural:"webhooks",fetchItems:(e,{limit:t,after:r})=>e.webhooks.list({limit:t,...r&&{after:r}}),display:e=>({label:e.endpoint,hint:e.id})};function K2(e){let t=e.map(r=>{let i=(r.events??[]).join(", "),n=i.length>60?`${i.slice(0,57)}...`:i;return[r.endpoint,n,r.status,r.id]});return M(["Endpoint","Events","Status","ID"],t,"(no webhooks)")}var Y2=new p("create").description("Register a new webhook endpoint to receive real-time event notifications").option("--endpoint <endpoint>","HTTPS URL to receive webhook events (required)").option("--events <events...>",'Event types to subscribe to (comma or space-separated). Use "all" for all 17 events.').addHelpText("after",h({context:`Webhooks deliver real-time event notifications to your HTTPS endpoint.
656
+ `)}else n?.stop(`Already up to date (v${se})`)});ee();var vt=["email.sent","email.delivered","email.delivery_delayed","email.bounced","email.complained","email.opened","email.clicked","email.failed","email.scheduled","email.suppressed","email.received","contact.created","contact.updated","contact.deleted","domain.created","domain.updated","domain.deleted"];function $r(e){return e.flatMap(t=>t.split(",")).map(t=>t.trim()).filter(Boolean)}var qr={resource:"webhook",resourcePlural:"webhooks",fetchItems:(e,{limit:t,after:r})=>e.webhooks.list({limit:t,...r&&{after:r}}),display:e=>({label:e.endpoint,hint:e.id})};function Fy(e){let t=e.map(r=>{let i=(r.events??[]).join(", "),n=i.length>60?`${i.slice(0,57)}...`:i;return[r.endpoint,n,r.status,r.id]});return z(["Endpoint","Events","Status","ID"],t,"(no webhooks)")}var zy=new p("create").description("Register a new webhook endpoint to receive real-time event notifications").option("--endpoint <endpoint>","HTTPS URL to receive webhook events (required)").option("--events <events...>",'Event types to subscribe to (comma or space-separated). Use "all" for all 17 events.').addHelpText("after",h({context:`Webhooks deliver real-time event notifications to your HTTPS endpoint.
667
657
  Events fire per-recipient: a batch email to 3 recipients generates 3 email.sent events.
668
658
 
669
659
  --endpoint must use HTTPS.
@@ -684,19 +674,19 @@ The signing_secret in the response is shown ONCE \u2014 save it immediately to v
684
674
  webhook payloads using Svix signature headers (svix-id, svix-timestamp, svix-signature).
685
675
  Use resend.webhooks.verify() in your application to validate incoming payloads.
686
676
 
687
- Non-interactive: --endpoint and --events are required.`,output:' {"object":"webhook","id":"<uuid>","signing_secret":"<whsec_...>"}',errorCodes:["auth_error","missing_endpoint","missing_events","create_error"],examples:["resend webhooks create --endpoint https://app.example.com/hooks/resend --events all","resend webhooks create --endpoint https://app.example.com/hooks/resend --events email.sent email.bounced","resend webhooks create --endpoint https://app.example.com/hooks/resend --events all --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.endpoint,{message:"Webhook endpoint URL",placeholder:"https://your-app.com/webhooks/resend",validate:s=>{if(!s)return"Endpoint URL is required";if(!s.startsWith("https://"))return"Endpoint must use HTTPS"}},{message:"Missing --endpoint flag.",code:"missing_endpoint"},r),n,o=e.events?.length?Dr(e.events):void 0;if(o?.includes("all"))n=bt;else if(o?.length)n=o;else{(!k()||r.json)&&v({message:"Missing --events flag.",code:"missing_events"},{json:r.json});let s=await Ud({message:"Select event types to subscribe to",options:bt.map(a=>({value:a,label:a}))});j(s)&&D("Cancelled."),n=s}await re({loading:"Creating webhook...",sdkCall:s=>s.webhooks.create({endpoint:i,events:n}),onInteractive:s=>{console.log("Webhook created"),console.log(`ID: ${s.id}`),console.log(`Signing Secret: ${s.signing_secret}`),console.log("Save the signing secret \u2014 it is only shown once.")}},r)});var Q2=new p("delete").alias("rm").description("Delete a webhook endpoint and stop all event deliveries to it").argument("[id]","Webhook UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`Warning: Deleting a webhook immediately stops event delivery to the endpoint.
677
+ Non-interactive: --endpoint and --events are required.`,output:' {"object":"webhook","id":"<uuid>","signing_secret":"<whsec_...>"}',errorCodes:["auth_error","missing_endpoint","missing_events","create_error"],examples:["resend webhooks create --endpoint https://app.example.com/hooks/resend --events all","resend webhooks create --endpoint https://app.example.com/hooks/resend --events email.sent email.bounced","resend webhooks create --endpoint https://app.example.com/hooks/resend --events all --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.endpoint,{message:"Webhook endpoint URL",placeholder:"https://your-app.com/webhooks/resend",validate:s=>{if(!s)return"Endpoint URL is required";if(!s.startsWith("https://"))return"Endpoint must use HTTPS"}},{message:"Missing --endpoint flag.",code:"missing_endpoint"},r),n,o=e.events?.length?$r(e.events):void 0;if(o?.includes("all"))n=vt;else if(o?.length)n=o;else{(!O()||r.json)&&g({message:"Missing --events flag.",code:"missing_events"},{json:r.json});let s=await $d({message:"Select event types to subscribe to",options:vt.map(a=>({value:a,label:a}))});P(s)&&T("Cancelled."),n=s}await re({loading:"Creating webhook...",sdkCall:s=>s.webhooks.create({endpoint:i,events:n}),onInteractive:s=>{console.log("Webhook created"),console.log(`ID: ${s.id}`),console.log(`Signing Secret: ${s.signing_secret}`),console.log("Save the signing secret \u2014 it is only shown once.")}},r)});var My=new p("delete").alias("rm").description("Delete a webhook endpoint and stop all event deliveries to it").argument("[id]","Webhook UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",h({context:`Warning: Deleting a webhook immediately stops event delivery to the endpoint.
688
678
  In-flight events may still be attempted once before the deletion takes effect.
689
679
  To temporarily pause delivery without losing configuration, use:
690
680
  resend webhooks update <id> --status disabled
691
681
 
692
- Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"webhook","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend webhooks delete wh_abc123 --yes","resend webhooks delete wh_abc123 --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,$r,i);await ue(n,!!t.yes,{confirmMessage:`Delete webhook ${n}?
693
- Events will no longer be delivered to this endpoint.`,loading:"Deleting webhook...",object:"webhook",successMsg:"Webhook deleted",sdkCall:o=>o.webhooks.remove(n)},i)});var Z2=new p("get").description("Retrieve a webhook endpoint configuration by ID").argument("[id]","Webhook UUID").addHelpText("after",h({context:`Note: The signing_secret is not returned by the get endpoint.
694
- To rotate secrets, delete the webhook and recreate it.`,output:' {"object":"webhook","id":"<uuid>","endpoint":"<url>","events":["<event>"],"status":"enabled|disabled","created_at":"<iso-date>","signing_secret":"<whsec_...>"}',errorCodes:["auth_error","fetch_error"],examples:["resend webhooks get wh_abc123","resend webhooks get wh_abc123 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,$r,i);await N({loading:"Fetching webhook...",sdkCall:o=>o.webhooks.get(n),onInteractive:o=>{console.log(`${o.endpoint}`),console.log(`ID: ${o.id}`),console.log(`Status: ${o.status}`),console.log(`Events: ${(o.events??[]).join(", ")||"(none)"}`),console.log(`Created: ${o.created_at}`)}},i)});var X2=new p("list").alias("ls").description("List all registered webhook endpoints").option("--limit <n>","Maximum number of webhooks to return (1-100)","10").option("--after <cursor>","Return webhooks after this cursor (next page)").option("--before <cursor>","Return webhooks before this cursor (previous page)").addHelpText("after",h({context:`Pagination: use --after or --before with a webhook ID as the cursor.
682
+ Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.`,output:' {"object":"webhook","id":"<uuid>","deleted":true}',errorCodes:["auth_error","confirmation_required","delete_error"],examples:["resend webhooks delete wh_abc123 --yes","resend webhooks delete wh_abc123 --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,qr,i);await ue(n,!!t.yes,{confirmMessage:`Delete webhook ${n}?
683
+ Events will no longer be delivered to this endpoint.`,loading:"Deleting webhook...",object:"webhook",successMsg:"Webhook deleted",sdkCall:o=>o.webhooks.remove(n)},i)});var Jy=new p("get").description("Retrieve a webhook endpoint configuration by ID").argument("[id]","Webhook UUID").addHelpText("after",h({context:`Note: The signing_secret is not returned by the get endpoint.
684
+ To rotate secrets, delete the webhook and recreate it.`,output:' {"object":"webhook","id":"<uuid>","endpoint":"<url>","events":["<event>"],"status":"enabled|disabled","created_at":"<iso-date>","signing_secret":"<whsec_...>"}',errorCodes:["auth_error","fetch_error"],examples:["resend webhooks get wh_abc123","resend webhooks get wh_abc123 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,qr,i);await N({loading:"Fetching webhook...",sdkCall:o=>o.webhooks.get(n),onInteractive:o=>{console.log(`${o.endpoint}`),console.log(`ID: ${o.id}`),console.log(`Status: ${o.status}`),console.log(`Events: ${(o.events??[]).join(", ")||"(none)"}`),console.log(`Created: ${o.created_at}`)}},i)});var By=new p("list").alias("ls").description("List all registered webhook endpoints").option("--limit <n>","Maximum number of webhooks to return (1-100)","10").option("--after <cursor>","Return webhooks after this cursor (next page)").option("--before <cursor>","Return webhooks before this cursor (previous page)").addHelpText("after",h({context:`Pagination: use --after or --before with a webhook ID as the cursor.
695
685
  Only one of --after or --before may be used at a time.
696
- The response includes has_more: true when additional pages exist.`,output:' {"object":"list","data":[{"id":"<uuid>","endpoint":"<url>","events":["<event>"],"status":"enabled","created_at":"<iso-date>"}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend webhooks list","resend webhooks list --limit 25 --json","resend webhooks list --after wh_abc123 --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=V(e.limit,r),n=K(i,e.after,e.before,r);await q({loading:"Fetching webhooks...",sdkCall:o=>o.webhooks.list(n),onInteractive:o=>{console.log(K2(o.data)),Y(o,"webhooks list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var ty=require("node:http");var Pe=le(vt(),1);ee();var ry=["svix-id","svix-timestamp","svix-signature"];function Cw(){return new Date().toLocaleTimeString("en-GB",{hour12:!1})}function Ow(e){let t=e.type??"unknown",r=e.data??{},i=r.id??"",n="";if(t.startsWith("email.")){let o=r.from??"",s=Array.isArray(r.to)?r.to[0]:"";(o||s)&&(n=`${o} -> ${s}`)}else t.startsWith("domain.")?n=r.name??"":t.startsWith("contact.")&&(n=r.email??"");return{type:t,resourceId:i,detail:n}}function Sw(e){let t=`${e} ${xw(e)}`;return e>=200&&e<300?Pe.default.green(t):e>=400&&e<500?Pe.default.yellow(t):Pe.default.red(t)}function xw(e){return{200:"OK",201:"Created",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??""}async function ey(e,t,r){let i={"content-type":"application/json"};for(let s of ry){let a=r[s];a&&(i[s]=a)}let n=e.startsWith("http")?e:`http://${e}`;return{status:(await fetch(n,{method:"POST",headers:i,body:t})).status}}function ww(e){return new Promise((t,r)=>{let i=[];e.on("data",n=>i.push(n)),e.on("end",()=>t(Buffer.concat(i).toString())),e.on("error",r)})}async function kw(e,t,r){process.stderr.write(`
686
+ The response includes has_more: true when additional pages exist.`,output:' {"object":"list","data":[{"id":"<uuid>","endpoint":"<url>","events":["<event>"],"status":"enabled","created_at":"<iso-date>"}],"has_more":false}',errorCodes:["auth_error","invalid_limit","list_error"],examples:["resend webhooks list","resend webhooks list --limit 25 --json","resend webhooks list --after wh_abc123 --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=W(e.limit,r),n=V(i,e.after,e.before,r);await R({loading:"Fetching webhooks...",sdkCall:o=>o.webhooks.list(n),onInteractive:o=>{console.log(Fy(o.data)),K(o,"webhooks list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Ny=require("node:http");var Ae=le(_t(),1);ee();var Ly=["svix-id","svix-timestamp","svix-signature"];function Vx(){return new Date().toLocaleTimeString("en-GB",{hour12:!1})}function Kx(e){let t=e.type??"unknown",r=e.data??{},i=r.id??"",n="";if(t.startsWith("email.")){let o=r.from??"",s=Array.isArray(r.to)?r.to[0]:"";(o||s)&&(n=`${o} -> ${s}`)}else t.startsWith("domain.")?n=r.name??"":t.startsWith("contact.")&&(n=r.email??"");return{type:t,resourceId:i,detail:n}}function Yx(e){let t=`${e} ${Qx(e)}`;return e>=200&&e<300?Ae.default.green(t):e>=400&&e<500?Ae.default.yellow(t):Ae.default.red(t)}function Qx(e){return{200:"OK",201:"Created",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??""}async function Hy(e,t,r){let i={"content-type":"application/json"};for(let s of Ly){let a=r[s];a&&(i[s]=a)}let n=e.startsWith("http")?e:`http://${e}`;return{status:(await fetch(n,{method:"POST",headers:i,body:t})).status}}function Zx(e){return new Promise((t,r)=>{let i=[];e.on("data",n=>i.push(n)),e.on("end",()=>t(Buffer.concat(i).toString())),e.on("error",r)})}async function Xx(e,t,r){process.stderr.write(`
697
687
  Cleaning up...`);try{await e.webhooks.remove(t),process.stderr.write(` Webhook ${t} deleted.
698
688
  `)}catch{process.stderr.write(` Failed to delete webhook ${t}.
699
- `)}r.close()}var iy=new p("listen").description("Listen for webhook events locally during development").option("--url <url>","Public URL for receiving webhooks (your tunnel URL)").option("--forward-to <url>","Forward payloads to this local URL").option("--events <events...>","Event types to listen for (default: all)").option("--port <port>","Local server port","4318").addHelpText("after",h({context:`Start a local server that receives Resend webhook events in real time.
689
+ `)}r.close()}var Gy=new p("listen").description("Listen for webhook events locally during development").option("--url <url>","Public URL for receiving webhooks (your tunnel URL)").option("--forward-to <url>","Forward payloads to this local URL").option("--events <events...>","Event types to listen for (default: all)").option("--port <port>","Local server port","4318").addHelpText("after",h({context:`Start a local server that receives Resend webhook events in real time.
700
690
 
701
691
  You must provide a public URL (e.g. from ngrok or localtunnel) that
702
692
  points to the local server port. The CLI will:
@@ -707,26 +697,26 @@ points to the local server port. The CLI will:
707
697
  5. Delete the temporary webhook on exit (Ctrl+C)
708
698
 
709
699
  Important: your tunnel must forward traffic to the same port as --port (default 4318).
710
- For example, if using ngrok: ngrok http 4318`,examples:["resend webhooks listen --url https://example.ngrok-free.app","resend webhooks listen --url https://example.ngrok-free.app --forward-to localhost:3000/webhook","resend webhooks listen --url https://example.ngrok-free.app --events email.sent email.bounced","resend webhooks listen --url https://example.ngrok-free.app --port 8080"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.url,{message:"Public tunnel URL",placeholder:"https://example.ngrok-free.app",validate:g=>{if(!g)return"URL is required";if(!g.startsWith("https://")&&!g.startsWith("http://"))return"URL must start with http:// or https://"}},{message:"Missing --url flag.",code:"missing_url"},r),n=Number.parseInt(e.port??"4318",10);(Number.isNaN(n)||n<1||n>65535)&&v({message:"Invalid port number.",code:"invalid_port"},{json:r.json});let o=e.events?.length?Dr(e.events):void 0,s;o?.includes("all")?s=bt:o?.length?s=o:s=bt;let a=await oe(r),u=r.json||!k(),l=(0,ty.createServer)(async(g,b)=>{if(g.method!=="POST"){b.writeHead(405).end("Method not allowed");return}let O=await ww(g),x;try{x=JSON.parse(O)}catch{b.writeHead(400).end("Invalid JSON");return}let S={};for(let I of ry){let w=g.headers[I];S[I]=Array.isArray(w)?w[0]:w}let{type:A,resourceId:T,detail:P}=Ow(x);if(u){let I={timestamp:new Date().toISOString(),type:A,resource_id:T,payload:x};if(e.forwardTo)try{let{status:w}=await ey(e.forwardTo,O,S);I.forwarded={url:e.forwardTo,status:w}}catch(w){I.forwarded={url:e.forwardTo,error:w instanceof Error?w.message:"Unknown error"}}console.log(JSON.stringify(I))}else{let I=Pe.default.dim(`[${Cw()}]`),w=A.padEnd(20),E=T.padEnd(14);if(process.stderr.write(`${I} ${Pe.default.bold(w)} ${Pe.default.cyan(E)} ${P}
711
- `),e.forwardTo){let W=e.forwardTo.startsWith("http")?e.forwardTo:`http://${e.forwardTo}`;try{let{status:be}=await ey(e.forwardTo,O,S);process.stderr.write(`${Pe.default.dim(" -> POST")} ${W} ${Pe.default.dim(`[${Sw(be)}]`)}
712
- `)}catch(be){let we=be instanceof Error?be.message:"Unknown error";process.stderr.write(`${Pe.default.dim(" -> POST")} ${W} ${Pe.default.red(`[Error: ${we}]`)}
713
- `)}}}b.writeHead(200).end("OK")});try{await new Promise((g,b)=>{l.on("error",b),l.listen(n,g)})}catch(g){v({message:g instanceof Error?`Failed to start local server on port ${n}: ${g.message}`:`Failed to start local server on port ${n}`,code:"server_listen_error"},{json:r.json})}let d=he("Setting up webhook listener...",r.quiet),c;try{let{data:g,error:b}=await a.webhooks.create({endpoint:i,events:s});(b||!g)&&(d.fail("Failed to create webhook"),l.close(),v({message:b?.message??"Unexpected empty response",code:"create_error"},{json:r.json})),c=g.id}catch(g){d.fail("Failed to create webhook"),l.close(),v({message:g instanceof Error?g.message:"Unknown error",code:"create_error"},{json:r.json})}if(d.stop("Webhook listener ready"),!u){let g=s.length===bt.length?"all events":s.length<=3?s.join(", "):`${s.slice(0,3).join(", ")} (+${s.length-3} more)`;if(process.stderr.write(`
714
- `),process.stderr.write(` ${Pe.default.bold("Webhook:")} ${c}
715
- `),process.stderr.write(` ${Pe.default.bold("Endpoint:")} ${i}
716
- `),process.stderr.write(` ${Pe.default.bold("Events:")} ${g}
717
- `),process.stderr.write(` ${Pe.default.bold("Server:")} http://localhost:${n}
718
- `),e.forwardTo){let b=e.forwardTo.startsWith("http")?e.forwardTo:`http://${e.forwardTo}`;process.stderr.write(` ${Pe.default.bold("Forward:")} ${b}
700
+ For example, if using ngrok: ngrok http 4318`,examples:["resend webhooks listen --url https://example.ngrok-free.app","resend webhooks listen --url https://example.ngrok-free.app --forward-to localhost:3000/webhook","resend webhooks listen --url https://example.ngrok-free.app --events email.sent email.bounced","resend webhooks listen --url https://example.ngrok-free.app --port 8080"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await U(e.url,{message:"Public tunnel URL",placeholder:"https://example.ngrok-free.app",validate:v=>{if(!v)return"URL is required";if(!v.startsWith("https://")&&!v.startsWith("http://"))return"URL must start with http:// or https://"}},{message:"Missing --url flag.",code:"missing_url"},r),n=Number.parseInt(e.port??"4318",10);(Number.isNaN(n)||n<1||n>65535)&&g({message:"Invalid port number.",code:"invalid_port"},{json:r.json});let o=e.events?.length?$r(e.events):void 0,s;o?.includes("all")?s=vt:o?.length?s=o:s=vt;let a=await oe(r),u=r.json||!O(),l=(0,Ny.createServer)(async(v,_)=>{if(v.method!=="POST"){_.writeHead(405).end("Method not allowed");return}let x=await Zx(v),w;try{w=JSON.parse(x)}catch{_.writeHead(400).end("Invalid JSON");return}let S={};for(let j of Ly){let k=v.headers[j];S[j]=Array.isArray(k)?k[0]:k}let{type:A,resourceId:I,detail:E}=Kx(w);if(u){let j={timestamp:new Date().toISOString(),type:A,resource_id:I,payload:w};if(e.forwardTo)try{let{status:k}=await Hy(e.forwardTo,x,S);j.forwarded={url:e.forwardTo,status:k}}catch(k){j.forwarded={url:e.forwardTo,error:k instanceof Error?k.message:"Unknown error"}}console.log(JSON.stringify(j))}else{let j=Ae.default.dim(`[${Vx()}]`),k=A.padEnd(20),D=I.padEnd(14);if(process.stderr.write(`${j} ${Ae.default.bold(k)} ${Ae.default.cyan(D)} ${E}
701
+ `),e.forwardTo){let Q=e.forwardTo.startsWith("http")?e.forwardTo:`http://${e.forwardTo}`;try{let{status:Ee}=await Hy(e.forwardTo,x,S);process.stderr.write(`${Ae.default.dim(" -> POST")} ${Q} ${Ae.default.dim(`[${Yx(Ee)}]`)}
702
+ `)}catch(Ee){let Be=Ee instanceof Error?Ee.message:"Unknown error";process.stderr.write(`${Ae.default.dim(" -> POST")} ${Q} ${Ae.default.red(`[Error: ${Be}]`)}
703
+ `)}}}_.writeHead(200).end("OK")});try{await new Promise((v,_)=>{l.on("error",_),l.listen(n,v)})}catch(v){g({message:v instanceof Error?`Failed to start local server on port ${n}: ${v.message}`:`Failed to start local server on port ${n}`,code:"server_listen_error"},{json:r.json})}let c=he("Setting up webhook listener...",r.quiet),d;try{let{data:v,error:_}=await a.webhooks.create({endpoint:i,events:s});(_||!v)&&(c.fail("Failed to create webhook"),l.close(),g({message:_?.message??"Unexpected empty response",code:"create_error"},{json:r.json})),d=v.id}catch(v){c.fail("Failed to create webhook"),l.close(),g({message:v instanceof Error?v.message:"Unknown error",code:"create_error"},{json:r.json})}if(c.stop("Webhook listener ready"),!u){let v=s.length===vt.length?"all events":s.length<=3?s.join(", "):`${s.slice(0,3).join(", ")} (+${s.length-3} more)`;if(process.stderr.write(`
704
+ `),process.stderr.write(` ${Ae.default.bold("Webhook:")} ${d}
705
+ `),process.stderr.write(` ${Ae.default.bold("Endpoint:")} ${i}
706
+ `),process.stderr.write(` ${Ae.default.bold("Events:")} ${v}
707
+ `),process.stderr.write(` ${Ae.default.bold("Server:")} http://localhost:${n}
708
+ `),e.forwardTo){let _=e.forwardTo.startsWith("http")?e.forwardTo:`http://${e.forwardTo}`;process.stderr.write(` ${Ae.default.bold("Forward:")} ${_}
719
709
  `)}process.stderr.write(`
720
710
  Ready! Listening for webhook events. Press Ctrl+C to stop.
721
711
 
722
- `)}let m=!1,_=async()=>{m||(m=!0,await kw(a,c,l),process.exit(Sr()))};Wa(_),process.on("SIGTERM",_),await new Promise(()=>{})});var ny=new p("update").description("Update a webhook's endpoint URL, event subscriptions, or enabled status").argument("[id]","Webhook UUID").option("--endpoint <endpoint>","New HTTPS URL for this webhook").option("--events <events...>",'Replace the full event subscription list (comma or space-separated). Use "all" for all 17 events.').addOption(new ce("--status <status>","Enable or disable event delivery for this webhook").choices(["enabled","disabled"])).addHelpText("after",h({context:`At least one of --endpoint, --events, or --status must be provided.
712
+ `)}let m=!1,b=async()=>{m||(m=!0,await Xx(a,d,l),process.exit(xr()))};Na(b),process.on("SIGTERM",b),await new Promise(()=>{})});var Uy=new p("update").description("Update a webhook's endpoint URL, event subscriptions, or enabled status").argument("[id]","Webhook UUID").option("--endpoint <endpoint>","New HTTPS URL for this webhook").option("--events <events...>",'Replace the full event subscription list (comma or space-separated). Use "all" for all 17 events.').addOption(new ce("--status <status>","Enable or disable event delivery for this webhook").choices(["enabled","disabled"])).addHelpText("after",h({context:`At least one of --endpoint, --events, or --status must be provided.
723
713
 
724
714
  --events replaces the entire event list (it is not additive).
725
715
  Use "all" as a shorthand for all 17 event types.
726
716
 
727
717
  --status controls whether events are delivered to this endpoint:
728
718
  enabled Events are delivered (default on creation)
729
- disabled Events are suppressed without deleting the webhook`,output:' {"object":"webhook","id":"<uuid>"}',errorCodes:["auth_error","no_changes","update_error"],examples:["resend webhooks update wh_abc123 --endpoint https://new-app.example.com/hooks/resend","resend webhooks update wh_abc123 --events email.sent email.bounced","resend webhooks update wh_abc123 --events all","resend webhooks update wh_abc123 --status disabled","resend webhooks update wh_abc123 --endpoint https://new-app.example.com/hooks/resend --events all --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,$r,i),o=t.events?.length?Dr(t.events):void 0,s=o!==void 0;!t.endpoint&&!s&&!t.status&&v({message:"Provide at least one option to update: --endpoint, --events, or --status.",code:"no_changes"},{json:i.json}),s&&!o.length&&v({message:"Missing --events values.",code:"no_changes"},{json:i.json});let a=o?.includes("all")?bt:o?.length?o:void 0;await F({loading:"Updating webhook...",sdkCall:u=>u.webhooks.update(n,{...t.endpoint&&{endpoint:t.endpoint},...a?.length&&{events:a},...t.status&&{status:t.status}}),errorCode:"update_error",successMsg:`Webhook updated: ${n}`},i)});var oy=new p("webhooks").description("Manage webhook endpoints for real-time event notifications").addHelpText("after",h({context:`Webhooks let you receive real-time event notifications from Resend at an HTTPS endpoint.
719
+ disabled Events are suppressed without deleting the webhook`,output:' {"object":"webhook","id":"<uuid>"}',errorCodes:["auth_error","no_changes","update_error"],examples:["resend webhooks update wh_abc123 --endpoint https://new-app.example.com/hooks/resend","resend webhooks update wh_abc123 --events email.sent email.bounced","resend webhooks update wh_abc123 --events all","resend webhooks update wh_abc123 --status disabled","resend webhooks update wh_abc123 --endpoint https://new-app.example.com/hooks/resend --events all --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await C(e,qr,i),o=t.events?.length?$r(t.events):void 0,s=o!==void 0;!t.endpoint&&!s&&!t.status&&g({message:"Provide at least one option to update: --endpoint, --events, or --status.",code:"no_changes"},{json:i.json}),s&&!o.length&&g({message:"Missing --events values.",code:"no_changes"},{json:i.json});let a=o?.includes("all")?vt:o?.length?o:void 0;await B({loading:"Updating webhook...",sdkCall:u=>u.webhooks.update(n,{...t.endpoint&&{endpoint:t.endpoint},...a?.length&&{events:a},...t.status&&{status:t.status}}),errorCode:"update_error",successMsg:`Webhook updated: ${n}`},i)});var Wy=new p("webhooks").description("Manage webhook endpoints for real-time event notifications").addHelpText("after",h({context:`Webhooks let you receive real-time event notifications from Resend at an HTTPS endpoint.
730
720
  Payloads are signed with Svix headers for verification.
731
721
 
732
722
  Event categories (17 total):
@@ -738,20 +728,20 @@ Event categories (17 total):
738
728
 
739
729
  Signature verification (Svix):
740
730
  Each delivery includes headers: svix-id, svix-timestamp, svix-signature
741
- Verify payloads in your application using: resend.webhooks.verify({ payload, headers, webhookSecret })`,examples:["resend webhooks list","resend webhooks create --endpoint https://app.example.com/hooks/resend --events all","resend webhooks get wh_abc123","resend webhooks update wh_abc123 --status disabled","resend webhooks delete wh_abc123 --yes"]})).addCommand(Y2).addCommand(Z2).addCommand(iy).addCommand(X2,{isDefault:!0}).addCommand(ny).addCommand(Q2);var sy=require("node:path");je();ee();var ay=new p("whoami").description("Show current authentication status").addHelpText("after",h({setup:!0,context:`Local only \u2014 no network calls.
731
+ Verify payloads in your application using: resend.webhooks.verify({ payload, headers, webhookSecret })`,examples:["resend webhooks list","resend webhooks create --endpoint https://app.example.com/hooks/resend --events all","resend webhooks get wh_abc123","resend webhooks update wh_abc123 --status disabled","resend webhooks delete wh_abc123 --yes"]})).addCommand(zy).addCommand(Jy).addCommand(Gy).addCommand(By,{isDefault:!0}).addCommand(Uy).addCommand(My);var Vy=require("node:path");De();ee();var Ky=new p("whoami").description("Show current authentication status").addHelpText("after",h({setup:!0,context:`Local only \u2014 no network calls.
742
732
  Shows which profile is active and where the API key comes from.`,output:` {"authenticated":true,"profile":"production","api_key":"re_...abcd","source":"config","config_path":"/Users/you/.config/resend/credentials.json"}
743
- {"authenticated":false}`,examples:["resend whoami","resend whoami --json","resend whoami --profile production"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=r.profile??r.team,n=await rr(r.apiKey,i);if(!n){let l=i||Cr(i),d=De(),c=d.some(b=>b.name===l),m=i||process.env.RESEND_PROFILE||process.env.RESEND_TEAM,_=m&&!c?`Profile "${l}" not found.
744
- Available profiles: ${d.map(b=>b.name).join(", ")||"(none)"}`:"Not authenticated.\nRun `resend login` to get started.",g=m&&!c?"profile_not_found":"not_authenticated";if(r.json||!k()){z({authenticated:!1,...m&&!c?{profile:l}:{}},{json:r.json,exitCode:1});return}v({message:_,code:g},{json:!1});return}let o=n.profile??Cr(i),s=(0,sy.join)(st(),"credentials.json");if(r.json||!k()){z({authenticated:!0,profile:o,api_key:tr(n.key),source:n.source,...n.permission&&{permission:n.permission},config_path:s},{json:r.json});return}let a=n.source==="secure_storage"?"secure storage":n.source==="config"?"config file":n.source==="env"?"environment variable":"flag",u=n.permission==="sending_access"?"sending access":n.permission==="full_access"?"full access":void 0;console.log(""),console.log(` Profile: ${o}`),console.log(` API Key: ${tr(n.key)}`),console.log(` Source: ${a}`),u&&console.log(` Access: ${u}`),console.log(` Config: ${s}`),console.log("")});var Aw=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 "," \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557"," \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551"," \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551"," \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D"," \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D "];function uy(){process.stdout.write(`
745
- `);for(let e of Aw)process.stdout.write(`${e}
733
+ {"authenticated":false}`,examples:["resend whoami","resend whoami --json","resend whoami --profile production"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=r.profile??r.team,n=await rr(r.apiKey,i);if(!n){let l=i||Or(i),c=je(),d=c.some(_=>_.name===l),m=i||process.env.RESEND_PROFILE||process.env.RESEND_TEAM,b=m&&!d?`Profile "${l}" not found.
734
+ Available profiles: ${c.map(_=>_.name).join(", ")||"(none)"}`:"Not authenticated.\nRun `resend login` to get started.",v=m&&!d?"profile_not_found":"not_authenticated";if(r.json||!O()){F({authenticated:!1,...m&&!d?{profile:l}:{}},{json:r.json,exitCode:1});return}g({message:b,code:v},{json:!1});return}let o=n.profile??Or(i),s=(0,Vy.join)(at(),"credentials.json");if(r.json||!O()){F({authenticated:!0,profile:o,api_key:tr(n.key),source:n.source,...n.permission&&{permission:n.permission},config_path:s},{json:r.json});return}let a=n.source==="secure_storage"?"secure storage":n.source==="config"?"config file":n.source==="env"?"environment variable":"flag",u=n.permission==="sending_access"?"sending access":n.permission==="full_access"?"full access":void 0;console.log(""),console.log(` Profile: ${o}`),console.log(` API Key: ${tr(n.key)}`),console.log(` Source: ${a}`),u&&console.log(` Access: ${u}`),console.log(` Config: ${s}`),console.log("")});var ew=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 "," \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557"," \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551"," \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551"," \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D"," \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D "];function Yy(){process.stdout.write(`
735
+ `);for(let e of ew)process.stdout.write(`${e}
746
736
  `);process.stdout.write(`
747
- `)}Xc();ui();zt();X0();var ed="",gy=[],by=[],Dt=new p().name("resend").description("Resend CLI \u2014 email for developers").configureHelp({showGlobalOptions:!0,styleTitle:e=>qr.default.gray(e)}).configureOutput({writeErr:e=>{process.stderr.write(e.replace(/^error:/,()=>qr.default.red("error:")))}}).helpCommand(!0).version(`${Kd} v${se}`,"-v, --version","Output the current version").option("--api-key <key>","Resend API key (overrides env/config)").option("-p, --profile <name>","Profile to use (overrides RESEND_PROFILE)").option("--team <name>","Deprecated: use --profile instead").option("--json","Force JSON output").option("-q, --quiet","Suppress spinners and status output (implies --json)").option("--insecure-storage","Save API key as plaintext instead of secure storage").hook("preAction",(e,t)=>{let r=[];for(let n=t;n?.parent;n=n.parent)r.unshift(n.name());ed=r.join(" ");let i=n=>n.options.filter(o=>n.getOptionValueSource(o.attributeName())==="cli").map(o=>o.long?.replace(/^--/,"")??o.short?.replace(/^-/,"")??"").filter(Boolean);gy=i(t),by=i(e),t.optsWithGlobals().quiet&&e.setOptionValue("json",!0),t.optsWithGlobals().insecureStorage&&(process.env.RESEND_CREDENTIAL_STORE="file")}).addHelpText("after",`
748
- ${qr.default.gray("Examples:")}
737
+ `)}Nc();ui();Ft();B0();var Lc="",n2=[],o2=[],qt=new p().name("resend").description("Resend CLI \u2014 email for developers").configureHelp({showGlobalOptions:!0,styleTitle:e=>Rr.default.gray(e)}).configureOutput({writeErr:e=>{process.stderr.write(e.replace(/^error:/,()=>Rr.default.red("error:")))}}).helpCommand(!0).version(`${Fd} v${se}`,"-v, --version","Output the current version").option("--api-key <key>","Resend API key (overrides env/config)").option("-p, --profile <name>","Profile to use (overrides RESEND_PROFILE)").option("--team <name>","Deprecated: use --profile instead").option("--json","Force JSON output").option("-q, --quiet","Suppress spinners and status output (implies --json)").option("--insecure-storage","Save API key as plaintext instead of secure storage").hook("preAction",(e,t)=>{let r=[];for(let n=t;n?.parent;n=n.parent)r.unshift(n.name());Lc=r.join(" ");let i=n=>n.options.filter(o=>n.getOptionValueSource(o.attributeName())==="cli").map(o=>o.long?.replace(/^--/,"")??o.short?.replace(/^-/,"")??"").filter(Boolean);n2=i(t),o2=i(e),t.optsWithGlobals().quiet&&e.setOptionValue("json",!0),t.optsWithGlobals().insecureStorage&&(process.env.RESEND_CREDENTIAL_STORE="file")}).addHelpText("after",`
738
+ ${Rr.default.gray("Examples:")}
749
739
 
750
740
  - Login to Resend
751
741
 
752
- ${qr.default.blue("$ resend login")}
742
+ ${Rr.default.blue("$ resend login")}
753
743
 
754
744
  - Send an email
755
745
 
756
- ${qr.default.blue("$ resend emails send")}
757
- `).action(()=>{process.stdout.isTTY&&uy();let e=Dt.opts();e.apiKey&&v({message:"--api-key is a per-command override and was not saved. To store your API key, run `resend login`.",code:"missing_command"},{json:e.json}),Dt.help()}).addCommand(Qa).addCommand(c2).addCommand(Qv).addCommand(Tv).addCommand(_2).addCommand(F2).addCommand(E_).addCommand(f_).addCommand(j2).addCommand(W2).addCommand(B_).addCommand(w2).addCommand(mv).addCommand(oy).addCommand(_v).addCommand(Za).addCommand(ay).addCommand(q_).addCommand(k2).addCommand(P_).addCommand(V2).addCommand(Yc).addCommand(i_).addCommand(a_),vy=new p("telemetry").description("Telemetry management").helpCommand(!1);vy.command("flush").argument("<file>").action(async e=>{let{flushFromFile:t}=await Promise.resolve().then(()=>(Xc(),fy));await t(e)});Dt.addCommand(vy,{hidden:!0});var hy=Dt.options.find(e=>e.long==="--team");hy&&(hy.hidden=!0);Dt.parseAsync().then(()=>{let e=Dt.args[0];if(e==="update"||e==="telemetry")return;ed&&Zc(ed,{...Dt.opts(),flags:gy,globalFlags:by});let t=Dt.opts();$_({json:!!(t.json||t.quiet)}).catch(()=>{})}).catch(e=>{v({message:Q(e,"An unexpected error occurred"),code:"unexpected_error"})});
746
+ ${Rr.default.blue("$ resend emails send")}
747
+ `).action(()=>{process.stdout.isTTY&&Yy();let e=qt.opts();e.apiKey&&g({message:"--api-key is a per-command override and was not saved. To store your API key, run `resend login`.",code:"missing_command"},{json:e.json}),qt.help()}).addCommand(Wa).addCommand(Z_).addCommand(Mv).addCommand(vv).addCommand(ay).addCommand(Py).addCommand(g_).addCommand(r_).addCommand(_y).addCommand(qy).addCommand(T_).addCommand(py).addCommand(ev).addCommand(Wy).addCommand(av).addCommand(Va).addCommand(Ky).addCommand(S_).addCommand(fy).addCommand(b_).addCommand(Ry).addCommand(Jc).addCommand(Gv).addCommand(Kv),s2=new p("telemetry").description("Telemetry management").helpCommand(!1);s2.command("flush").argument("<file>").action(async e=>{let{flushFromFile:t}=await Promise.resolve().then(()=>(Nc(),r2));await t(e)});qt.addCommand(s2,{hidden:!0});var i2=qt.options.find(e=>e.long==="--team");i2&&(i2.hidden=!0);qt.parseAsync().then(()=>{let e=qt.args[0];if(e==="update"||e==="telemetry")return;Lc&&Hc(Lc,{...qt.opts(),flags:n2,globalFlags:o2});let t=qt.opts();O_({json:!!(t.json||t.quiet)}).catch(()=>{})}).catch(e=>{g({message:Y(e,"An unexpected error occurred"),code:"unexpected_error"})});