resend-cli 1.6.0 → 1.7.0

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,173 +1,239 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var Ov=Object.create;var Br=Object.defineProperty;var Cv=Object.getOwnPropertyDescriptor;var Sv=Object.getOwnPropertyNames;var xv=Object.getPrototypeOf,wv=Object.prototype.hasOwnProperty;var z=(e,t)=>()=>(e&&(t=e(e=0)),t);var m=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ht=(e,t)=>{for(var r in t)Br(e,r,{get:t[r],enumerable:!0})},ml=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Sv(t))!wv.call(e,n)&&n!==r&&Br(e,n,{get:()=>t[n],enumerable:!(i=Cv(t,n))||i.enumerable});return e};var oe=(e,t,r)=>(r=e!=null?Ov(xv(e)):{},ml(t||!e||!e.__esModule?Br(r,"default",{value:e,enumerable:!0}):r,e)),kv=e=>ml(Br({},"__esModule",{value:!0}),e);var dr=m(ja=>{var Hr=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}},Da=class extends Hr{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};ja.CommanderError=Hr;ja.InvalidArgumentError=Da});var Lr=m(qa=>{var{InvalidArgumentError:Av}=dr(),Ia=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 Av(`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 Ev(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}qa.Argument=Ia;qa.humanReadableArgName=Ev});var Ra=m(za=>{var{humanReadableArgName:Tv}=Lr(),$a=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,s)=>n.name().localeCompare(s.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),s=i.long&&t._findOption(i.long);!n&&!s?r.push(i):i.long&&!s?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(s=>!s.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=>Tv(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(s=>{let o=i(s);n.has(o)||n.set(o,[])}),r.forEach(s=>{let o=i(s);n.has(o)||n.set(o,[]),n.get(o).push(s)}),n}formatHelp(t,r){let i=r.padWidth(t,r),n=r.helpWidth??80;function s(l,p){return r.formatItem(l,i,p,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),n),""]));let u=r.visibleArguments(t).map(l=>s(r.styleArgumentTerm(r.argumentTerm(l)),r.styleArgumentDescription(r.argumentDescription(l))));if(o=o.concat(this.formatItemList("Arguments:",u,r)),this.groupItems(t.options,r.visibleOptions(t),l=>l.helpGroupHeading??"Options:").forEach((l,p)=>{let y=l.map(h=>s(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));o=o.concat(this.formatItemList(p,y,r))}),r.showGlobalOptions){let l=r.visibleGlobalOptions(t).map(p=>s(r.styleOptionTerm(r.optionTerm(p)),r.styleOptionDescription(r.optionDescription(p))));o=o.concat(this.formatItemList("Global Options:",l,r))}return this.groupItems(t.commands,r.visibleCommands(t),l=>l.helpGroup()||"Commands:").forEach((l,p)=>{let y=l.map(h=>s(r.styleSubcommandTerm(r.subcommandTerm(h)),r.styleSubcommandDescription(r.subcommandDescription(h))));o=o.concat(this.formatItemList(p,y,r))}),o.join(`
3
- `)}displayWidth(t){return fl(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 o=" ".repeat(2);if(!i)return o+t;let a=t.padEnd(r+t.length-n.displayWidth(t)),u=2,d=(this.helpWidth??80)-r-u-2,l;return d<this.minWidthToWrap||n.preformatted(i)?l=i:l=n.boxWrap(i,d).replace(/\n/g,`
4
- `+" ".repeat(r+u)),o+a+" ".repeat(u)+l.replace(/\n/g,`
5
- ${o}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let i=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return i.forEach(o=>{let a=o.match(n);if(a===null){s.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(d=>{let l=this.displayWidth(d);if(c+l<=r){u.push(d),c+=l;return}s.push(u.join(""));let p=d.trimStart();u=[p],c=this.displayWidth(p)}),s.push(u.join(""))}),s.join(`
6
- `)}};function fl(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}za.Help=$a;za.stripColor=fl});var Ba=m(Fa=>{var{InvalidArgumentError:Pv}=dr(),Ma=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=Dv(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 Pv(`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?hl(this.name().replace(/^no-/,"")):hl(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}},Ja=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,s=n!==void 0?n:!1;return r.negate===(s===t)}};function hl(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Dv(e){let t,r,i=/^-[^-]$/,n=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(i.test(s[0])&&(t=s.shift()),n.test(s[0])&&(r=s.shift()),!t&&i.test(s[0])&&(t=s.shift()),!t&&n.test(s[0])&&(t=r,r=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${e}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
2
+ "use strict";var l1=Object.create;var sn=Object.defineProperty;var u1=Object.getOwnPropertyDescriptor;var c1=Object.getOwnPropertyNames;var d1=Object.getPrototypeOf,p1=Object.prototype.hasOwnProperty;var ee=(e,t)=>()=>(e&&(t=e(e=0)),t);var m=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Lr=(e,t)=>{for(var r in t)sn(e,r,{get:t[r],enumerable:!0})},np=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of c1(t))!p1.call(e,n)&&n!==r&&sn(e,n,{get:()=>t[n],enumerable:!(i=u1(t,n))||i.enumerable});return e};var me=(e,t,r)=>(r=e!=null?l1(d1(e)):{},np(t||!e||!e.__esModule?sn(r,"default",{value:e,enumerable:!0}):r,e)),m1=e=>np(sn({},"__esModule",{value:!0}),e);var Oi=m(pu=>{var on=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 on{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};pu.CommanderError=on;pu.InvalidArgumentError=du});var an=m(fu=>{var{InvalidArgumentError:f1}=Oi(),mu=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 f1(`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 h1(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}fu.Argument=mu;fu.humanReadableArgName=h1});var bu=m(gu=>{var{humanReadableArgName:g1}=an(),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,s)=>n.name().localeCompare(s.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),s=i.long&&t._findOption(i.long);!n&&!s?r.push(i):i.long&&!s?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(s=>!s.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=>g1(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(s=>{let o=i(s);n.has(o)||n.set(o,[])}),r.forEach(s=>{let o=i(s);n.has(o)||n.set(o,[]),n.get(o).push(s)}),n}formatHelp(t,r){let i=r.padWidth(t,r),n=r.helpWidth??80;function s(d,p){return r.formatItem(d,i,p,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),n),""]));let l=r.visibleArguments(t).map(d=>s(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",l,r)),this.groupItems(t.options,r.visibleOptions(t),d=>d.helpGroupHeading??"Options:").forEach((d,p)=>{let v=d.map(f=>s(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));o=o.concat(this.formatItemList(p,v,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(t).map(p=>s(r.styleOptionTerm(r.optionTerm(p)),r.styleOptionDescription(r.optionDescription(p))));o=o.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(t.commands,r.visibleCommands(t),d=>d.helpGroup()||"Commands:").forEach((d,p)=>{let v=d.map(f=>s(r.styleSubcommandTerm(r.subcommandTerm(f)),r.styleSubcommandDescription(r.subcommandDescription(f))));o=o.concat(this.formatItemList(p,v,r))}),o.join(`
3
+ `)}displayWidth(t){return sp(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 o=" ".repeat(2);if(!i)return o+t;let a=t.padEnd(r+t.length-n.displayWidth(t)),l=2,c=(this.helpWidth??80)-r-l-2,d;return c<this.minWidthToWrap||n.preformatted(i)?d=i:d=n.boxWrap(i,c).replace(/\n/g,`
4
+ `+" ".repeat(r+l)),o+a+" ".repeat(l)+d.replace(/\n/g,`
5
+ ${o}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let i=t.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return i.forEach(o=>{let a=o.match(n);if(a===null){s.push("");return}let l=[a.shift()],u=this.displayWidth(l[0]);a.forEach(c=>{let d=this.displayWidth(c);if(u+d<=r){l.push(c),u+=d;return}s.push(l.join(""));let p=c.trimStart();l=[p],u=this.displayWidth(p)}),s.push(l.join(""))}),s.join(`
6
+ `)}};function sp(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}gu.Help=hu;gu.stripColor=sp});var wu=m(_u=>{var{InvalidArgumentError:b1}=Oi(),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=v1(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 b1(`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?op(this.name().replace(/^no-/,"")):op(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}},yu=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,s=n!==void 0?n:!1;return r.negate===(s===t)}};function op(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function v1(e){let t,r,i=/^-[^-]$/,n=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(i.test(s[0])&&(t=s.shift()),n.test(s[0])&&(r=s.shift()),!t&&i.test(s[0])&&(t=s.shift()),!t&&n.test(s[0])&&(t=r,r=s.shift()),s[0].startsWith("-")){let o=s[0],a=`option creation failed due to '${o}' in option flags '${e}'`;throw/^-[^-][^-]/.test(o)?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(o)?new Error(`${a}
10
10
  - too many short flags`):n.test(o)?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}}Fa.Option=Ma;Fa.DualOptions=Ja});var bl=m(gl=>{function jv(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 s=1;e[n-1]===t[i-1]?s=0:s=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+s),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 Iv(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(o=>o.slice(2)));let i=[],n=3,s=.4;return t.forEach(o=>{if(o.length<=1)return;let a=jv(e,o),u=Math.max(e.length,o.length);(u-a)/u>s&&(a<n?(n=a,i=[o]):a===n&&i.push(o))}),i.sort((o,a)=>o.localeCompare(a)),r&&(i=i.map(o=>`--${o}`)),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}}_u.Option=vu;_u.DualOptions=yu});var lp=m(ap=>{function y1(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 s=1;e[n-1]===t[i-1]?s=0:s=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+s),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 _1(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(o=>o.slice(2)));let i=[],n=3,s=.4;return t.forEach(o=>{if(o.length<=1)return;let a=y1(e,o),l=Math.max(e.length,o.length);(l-a)/l>s&&(a<n?(n=a,i=[o]):a===n&&i.push(o))}),i.sort((o,a)=>o.localeCompare(a)),r&&(i=i.map(o=>`--${o}`)),i.length>1?`
13
13
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
14
- (Did you mean ${i[0]}?)`:""}gl.suggestSimilar=Iv});var Ol=m(Ua=>{var qv=require("node:events").EventEmitter,Ha=require("node:child_process"),Xe=require("node:path"),Nr=require("node:fs"),J=require("node:process"),{Argument:$v,humanReadableArgName:zv}=Lr(),{CommanderError:La}=dr(),{Help:Rv,stripColor:Mv}=Ra(),{Option:vl,DualOptions:Jv}=Ba(),{suggestSimilar:_l}=bl(),Na=class e extends qv{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=>J.stdout.write(r),writeErr:r=>J.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>J.stdout.isTTY?J.stdout.columns:void 0,getErrHelpWidth:()=>J.stderr.isTTY?J.stderr.columns:void 0,getOutHasColors:()=>Ga()??(J.stdout.isTTY&&J.stdout.hasColors?.()),getErrHasColors:()=>Ga()??(J.stderr.isTTY&&J.stderr.hasColors?.()),stripColor:r=>Mv(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,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,o,a]=t.match(/([^ ]+) *(.*)/),u=this.createCommand(o);return n&&(u.description(n),u._executableHandler=!0),s.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(s.noHelp||s.hidden),u._executableFile=s.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 Rv,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 $v(t,r)}argument(t,r,i,n){let s=this.createArgument(t,r);return typeof i=="function"?s.default(n).argParser(i):s.default(i),this.addArgument(s),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,s]=i.match(/([^ ]+) *(.*)/),o=r??"display help for command",a=this.createCommand(n);return a.helpOption(!1),s&&a.arguments(s),o&&a.description(o),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 La(t,r,i)),J.exit(t)}action(t){let r=i=>{let n=this.registeredArguments.length,s=i.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=r,this}createOption(t,r){return new vl(t,r)}_callParseArg(t,r,i,n){try{return t.parseArg(r,i)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${n} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_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("|"),s=r(t).join("|");throw new Error(`cannot add command '${s}' 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 s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(i,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(i,t.defaultValue,"default");let n=(s,o,a)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let u=this.getOptionValue(i);s!==null&&t.parseArg?s=this._callParseArg(t,s,u,o):s!==null&&t.variadic&&(s=t._collectValue(s,u)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(i,s,a)};return this.on("option:"+r,s=>{let o=`error: option '${t.flags}' argument '${s}' is invalid.`;n(s,o,"cli")}),t.envVar&&this.on("optionEnv:"+r,s=>{let o=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;n(s,o,"env")}),this}_optionEx(t,r,i,n,s){if(typeof r=="object"&&r instanceof vl)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,i);if(o.makeOptionMandatory(!!t.mandatory),typeof n=="function")o.default(s).argParser(n);else if(n instanceof RegExp){let a=n;n=(u,c)=>{let d=a.exec(u);return d?d[0]:c},o.default(s).argParser(n)}else o.default(n);return this.addOption(o)}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){J.versions?.electron&&(r.from="electron");let n=J.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=J.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":J.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
- - 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(Nr.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",s=`'${t}' does not exist
14
+ (Did you mean ${i[0]}?)`:""}ap.suggestSimilar=_1});var pp=m(ku=>{var w1=require("node:events").EventEmitter,Cu=require("node:child_process"),Jt=require("node:path"),ln=require("node:fs"),ie=require("node:process"),{Argument:C1,humanReadableArgName:S1}=an(),{CommanderError:Su}=Oi(),{Help:O1,stripColor:x1}=bu(),{Option:up,DualOptions:k1}=wu(),{suggestSimilar:cp}=lp(),Ou=class e extends w1{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=>ie.stdout.write(r),writeErr:r=>ie.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>ie.stdout.isTTY?ie.stdout.columns:void 0,getErrHelpWidth:()=>ie.stderr.isTTY?ie.stderr.columns:void 0,getOutHasColors:()=>xu()??(ie.stdout.isTTY&&ie.stdout.hasColors?.()),getErrHasColors:()=>xu()??(ie.stderr.isTTY&&ie.stderr.hasColors?.()),stripColor:r=>x1(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,s=i;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,o,a]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(o);return n&&(l.description(n),l._executableHandler=!0),s.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(s.noHelp||s.hidden),l._executableFile=s.executableFile||null,a&&l.arguments(a),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),n?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new O1,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 C1(t,r)}argument(t,r,i,n){let s=this.createArgument(t,r);return typeof i=="function"?s.default(n).argParser(i):s.default(i),this.addArgument(s),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,s]=i.match(/([^ ]+) *(.*)/),o=r??"display help for command",a=this.createCommand(n);return a.helpOption(!1),s&&a.arguments(s),o&&a.description(o),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)),ie.exit(t)}action(t){let r=i=>{let n=this.registeredArguments.length,s=i.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),t.apply(this,s)};return this._actionHandler=r,this}createOption(t,r){return new up(t,r)}_callParseArg(t,r,i,n){try{return t.parseArg(r,i)}catch(s){if(s.code==="commander.invalidArgument"){let o=`${n} ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}}_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("|"),s=r(t).join("|");throw new Error(`cannot add command '${s}' 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 s=t.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(i,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(i,t.defaultValue,"default");let n=(s,o,a)=>{s==null&&t.presetArg!==void 0&&(s=t.presetArg);let l=this.getOptionValue(i);s!==null&&t.parseArg?s=this._callParseArg(t,s,l,o):s!==null&&t.variadic&&(s=t._collectValue(s,l)),s==null&&(t.negate?s=!1:t.isBoolean()||t.optional?s=!0:s=""),this.setOptionValueWithSource(i,s,a)};return this.on("option:"+r,s=>{let o=`error: option '${t.flags}' argument '${s}' is invalid.`;n(s,o,"cli")}),t.envVar&&this.on("optionEnv:"+r,s=>{let o=`error: option '${t.flags}' value '${s}' from env '${t.envVar}' is invalid.`;n(s,o,"env")}),this}_optionEx(t,r,i,n,s){if(typeof r=="object"&&r instanceof up)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,i);if(o.makeOptionMandatory(!!t.mandatory),typeof n=="function")o.default(s).argParser(n);else if(n instanceof RegExp){let a=n;n=(l,u)=>{let c=a.exec(l);return c?c[0]:u},o.default(s).argParser(n)}else o.default(n);return this.addOption(o)}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){ie.versions?.electron&&(r.from="electron");let n=ie.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}t===void 0&&(t=ie.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":ie.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
+ - 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(ln.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",s=`'${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(s)}_executeSubCommand(t,r){r=r.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function s(d,l){let p=Xe.resolve(d,l);if(Nr.existsSync(p))return p;if(n.includes(Xe.extname(l)))return;let y=n.find(h=>Nr.existsSync(`${p}${h}`));if(y)return`${p}${y}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let d;try{d=Nr.realpathSync(this._scriptPath)}catch{d=this._scriptPath}a=Xe.resolve(Xe.dirname(d),a)}if(a){let d=s(a,o);if(!d&&!t._executableFile&&this._scriptPath){let l=Xe.basename(this._scriptPath,Xe.extname(this._scriptPath));l!==this._name&&(d=s(a,`${l}-${t._name}`))}o=d||o}i=n.includes(Xe.extname(o));let u;J.platform!=="win32"?i?(r.unshift(o),r=yl(J.execArgv).concat(r),u=Ha.spawn(J.argv[0],r,{stdio:"inherit"})):u=Ha.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,t._name),r.unshift(o),r=yl(J.execArgv).concat(r),u=Ha.spawn(J.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(l=>{J.on(l,()=>{u.killed===!1&&u.exitCode===null&&u.kill(l)})});let c=this._exitCallback;u.on("close",d=>{d=d??1,c?c(new La(d,"commander.executeSubCommandAsync","(close)")):J.exit(d)}),u.on("error",d=>{if(d.code==="ENOENT")this._checkForMissingExecutable(o,a,t._name);else if(d.code==="EACCES")throw new Error(`'${o}' not executable`);if(!c)J.exit(1);else{let l=new La(1,"commander.executeSubCommandAsync","(error)");l.nestedError=d,c(l)}}),this.runningCommand=u}_dispatchSubcommand(t,r,i){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),s}_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,s)=>{let o=n;if(n!==null&&i.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;o=this._callParseArg(i,n,s,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let s=i.defaultValue;i.variadic?n<this.args.length?(s=this.args.slice(n),i.parseArg&&(s=s.reduce((o,a)=>t(i,a,o),i.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],i.parseArg&&(s=t(i,s,i.defaultValue))),r[n]=s}),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(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(o=>{n.push({hookedCommand:s,callback:o})})}),r==="postAction"&&n.reverse(),n.forEach(s=>{i=this._chainOrCall(i,()=>s.callback(s.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,r,i){let n=t;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(s=>{n=this._chainOrCall(n,()=>s(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])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,t,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent?.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,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(s=>i.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],i=[],n=r;function s(d){return d.length>1&&d[0]==="-"}let o=d=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(d)?!this._getCommandAndAncestors().some(l=>l.options.map(p=>p.short).some(p=>/^-\d$/.test(p))):!1,a=null,u=null,c=0;for(;c<t.length||u;){let d=u??t[c++];if(u=null,d==="--"){n===i&&n.push(d),n.push(...t.slice(c));break}if(a&&(!s(d)||o(d))){this.emit(`option:${a.name()}`,d);continue}if(a=null,s(d)){let l=this._findOption(d);if(l){if(l.required){let p=t[c++];p===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,p)}else if(l.optional){let p=null;c<t.length&&(!s(t[c])||o(t[c]))&&(p=t[c++]),this.emit(`option:${l.name()}`,p)}else this.emit(`option:${l.name()}`);a=l.variadic?l:null;continue}}if(d.length>2&&d[0]==="-"&&d[1]!=="-"){let l=this._findOption(`-${d[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,d.slice(2)):(this.emit(`option:${l.name()}`),u=`-${d.slice(2)}`);continue}}if(/^--[^=]+=/.test(d)){let l=d.indexOf("="),p=this._findOption(d.slice(0,l));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,d.slice(l+1));continue}}if(n===r&&s(d)&&!(this.commands.length===0&&o(d))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(d)){r.push(d),i.push(...t.slice(c));break}else if(this._getHelpCommand()&&d===this._getHelpCommand().name()){r.push(d,...t.slice(c));break}else if(this._defaultCommandName){i.push(d,...t.slice(c));break}}if(this._passThroughOptions){n.push(d,...t.slice(c));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(s)}_executeSubCommand(t,r){r=r.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function s(c,d){let p=Jt.resolve(c,d);if(ln.existsSync(p))return p;if(n.includes(Jt.extname(d)))return;let v=n.find(f=>ln.existsSync(`${p}${f}`));if(v)return`${p}${v}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let c;try{c=ln.realpathSync(this._scriptPath)}catch{c=this._scriptPath}a=Jt.resolve(Jt.dirname(c),a)}if(a){let c=s(a,o);if(!c&&!t._executableFile&&this._scriptPath){let d=Jt.basename(this._scriptPath,Jt.extname(this._scriptPath));d!==this._name&&(c=s(a,`${d}-${t._name}`))}o=c||o}i=n.includes(Jt.extname(o));let l;ie.platform!=="win32"?i?(r.unshift(o),r=dp(ie.execArgv).concat(r),l=Cu.spawn(ie.argv[0],r,{stdio:"inherit"})):l=Cu.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,t._name),r.unshift(o),r=dp(ie.execArgv).concat(r),l=Cu.spawn(ie.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{ie.on(d,()=>{l.killed===!1&&l.exitCode===null&&l.kill(d)})});let u=this._exitCallback;l.on("close",c=>{c=c??1,u?u(new Su(c,"commander.executeSubCommandAsync","(close)")):ie.exit(c)}),l.on("error",c=>{if(c.code==="ENOENT")this._checkForMissingExecutable(o,a,t._name);else if(c.code==="EACCES")throw new Error(`'${o}' not executable`);if(!u)ie.exit(1);else{let d=new Su(1,"commander.executeSubCommandAsync","(error)");d.nestedError=c,u(d)}}),this.runningCommand=l}_dispatchSubcommand(t,r,i){let n=this._findCommand(t);n||this.help({error:!0}),n._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),s}_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,s)=>{let o=n;if(n!==null&&i.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;o=this._callParseArg(i,n,s,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let s=i.defaultValue;i.variadic?n<this.args.length?(s=this.args.slice(n),i.parseArg&&(s=s.reduce((o,a)=>t(i,a,o),i.defaultValue))):s===void 0&&(s=[]):n<this.args.length&&(s=this.args[n],i.parseArg&&(s=t(i,s,i.defaultValue))),r[n]=s}),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(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(o=>{n.push({hookedCommand:s,callback:o})})}),r==="postAction"&&n.reverse(),n.forEach(s=>{i=this._chainOrCall(i,()=>s.callback(s.hookedCommand,this))}),i}_chainOrCallSubCommandHook(t,r,i){let n=t;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(s=>{n=this._chainOrCall(n,()=>s(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])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(s,t,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent?.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,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(s=>i.conflictsWith.includes(s.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],i=[],n=r;function s(c){return c.length>1&&c[0]==="-"}let o=c=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(c)?!this._getCommandAndAncestors().some(d=>d.options.map(p=>p.short).some(p=>/^-\d$/.test(p))):!1,a=null,l=null,u=0;for(;u<t.length||l;){let c=l??t[u++];if(l=null,c==="--"){n===i&&n.push(c),n.push(...t.slice(u));break}if(a&&(!s(c)||o(c))){this.emit(`option:${a.name()}`,c);continue}if(a=null,s(c)){let d=this._findOption(c);if(d){if(d.required){let p=t[u++];p===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,p)}else if(d.optional){let p=null;u<t.length&&(!s(t[u])||o(t[u]))&&(p=t[u++]),this.emit(`option:${d.name()}`,p)}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()}`),l=`-${c.slice(2)}`);continue}}if(/^--[^=]+=/.test(c)){let d=c.indexOf("="),p=this._findOption(c.slice(0,d));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,c.slice(d+1));continue}}if(n===r&&s(c)&&!(this.commands.length===0&&o(c))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(c)){r.push(c),i.push(...t.slice(u));break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){r.push(c,...t.slice(u));break}else if(this._defaultCommandName){i.push(c,...t.slice(u));break}}if(this._passThroughOptions){n.push(c,...t.slice(u));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,s=i.code||"commander.error";this._exit(n,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in J.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()}`,J.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Jv(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=o=>{let a=o.attributeName(),u=this.getOptionValue(a),c=this.options.find(l=>l.negate&&a===l.attributeName()),d=this.options.find(l=>!l.negate&&a===l.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:d||o},n=o=>{let a=i(o),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);n=n.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);r=_l(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",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${i} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),r=_l(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=>zv(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=Xe.basename(t,Xe.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,s;return r?(i=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:n,helpWidth:s}}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(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:i.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.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(J.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,s=i.code||"commander.error";this._exit(n,s,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in ie.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()}`,ie.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new k1(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=o=>{let a=o.attributeName(),l=this.getOptionValue(a),u=this.options.find(d=>d.negate&&a===d.attributeName()),c=this.options.find(d=>!d.negate&&a===d.attributeName());return u&&(u.presetArg===void 0&&l===!1||u.presetArg!==void 0&&l===u.presetArg)?u:c||o},n=o=>{let a=i(o),l=a.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${n(t)} cannot be used with ${n(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);n=n.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);r=cp(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",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${i} but got ${t.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),r=cp(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=>S1(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=Jt.basename(t,Jt.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,s;return r?(i=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:n,helpWidth:s}}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(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:i.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.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(ie.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,s=>{let o;typeof r=="function"?o=r({error:s.error,command:s.command}):o=r,o&&s.write(`${o}
27
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function yl(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,i="127.0.0.1",n="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?n=s[3]:i=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],i=s[3],n=s[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:t})}function Ga(){if(J.env.NO_COLOR||J.env.FORCE_COLOR==="0"||J.env.FORCE_COLOR==="false")return!1;if(J.env.FORCE_COLOR||J.env.CLICOLOR_FORCE!==void 0)return!0}Ua.Command=Na;Ua.useColor=Ga});var wl=m(Fe=>{var{Argument:Cl}=Lr(),{Command:Wa}=Ol(),{CommanderError:Fv,InvalidArgumentError:Sl}=dr(),{Help:Bv}=Ra(),{Option:xl}=Ba();Fe.program=new Wa;Fe.createCommand=e=>new Wa(e);Fe.createOption=(e,t)=>new xl(e,t);Fe.createArgument=(e,t)=>new Cl(e,t);Fe.Command=Wa;Fe.Option=xl;Fe.Argument=Cl;Fe.Help=Bv;Fe.CommanderError=Fv;Fe.InvalidArgumentError=Sl;Fe.InvalidOptionArgumentError=Sl});var Al=m((Re,kl)=>{var Ve=wl();Re=kl.exports={};Re.program=new Ve.Command;Re.Argument=Ve.Argument;Re.Command=Ve.Command;Re.CommanderError=Ve.CommanderError;Re.Help=Ve.Help;Re.InvalidArgumentError=Ve.InvalidArgumentError;Re.InvalidOptionArgumentError=Ve.InvalidArgumentError;Re.Option=Ve.Option;Re.createCommand=e=>new Ve.Command(e);Re.createOption=(e,t)=>new Ve.Option(e,t);Re.createArgument=(e,t)=>new Ve.Argument(e,t)});var st=m((JS,Va)=>{var Ur=process||{},Tl=Ur.argv||[],Gr=Ur.env||{},Hv=!(Gr.NO_COLOR||Tl.includes("--no-color"))&&(!!Gr.FORCE_COLOR||Tl.includes("--color")||Ur.platform==="win32"||(Ur.stdout||{}).isTTY&&Gr.TERM!=="dumb"||!!Gr.CI),Lv=(e,t,r=e)=>i=>{let n=""+i,s=n.indexOf(t,e.length);return~s?e+Nv(n,t,r,s)+t:e+n+t},Nv=(e,t,r,i)=>{let n="",s=0;do n+=e.substring(s,i)+r,s=i+t.length,i=e.indexOf(t,s);while(~i);return n+e.substring(s)},Pl=(e=Hv)=>{let t=e?Lv:()=>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")}};Va.exports=Pl();Va.exports.createColors=Pl});var Ya=m((BS,Dl)=>{"use strict";var Ka={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"},Vv={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},Kv={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?Ka.up():"");return e&&(t+=Ka.left),t}};Dl.exports={cursor:Ka,scroll:Vv,erase:Kv,beep:"\x07"}});var mu,sd=z(()=>{mu={name:"resend-cli",version:"1.6.0",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.32.1",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","sync-skill-version":"node scripts/sync-skill-version.mjs",version:"pnpm run sync-skill-version && git add skills/resend-cli/SKILL.md",prepack:"pnpm run sync-skill-version && pnpm build && node scripts/verify-bundle.mjs"},dependencies:{"@clack/prompts":"1.1.0","@commander-js/extra-typings":"14.0.0",commander:"14.0.3",picocolors:"1.1.1",resend:"6.9.4"},pnpm:{onlyBuiltDependencies:["esbuild","@biomejs/biome"]},devDependencies:{"@biomejs/biome":"2.4.7","@types/node":"24.12.0",esbuild:"0.27.4",tsx:"4.21.0",typescript:"5.9.3",vitest:"4.1.0","@yao-pkg/pkg":"6.14.1"}}});var Y,od,yt=z(()=>{"use strict";sd();Y=mu.version,od=mu.name});var mi=m(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.ApplicationInSerializer=void 0;pi.ApplicationInSerializer={_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 Ou=m(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.ApplicationOutSerializer=void 0;fi.ApplicationOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),id:e.id,metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,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,uid:e.uid,updatedAt:e.updatedAt}}}});var gd=m(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.ApplicationPatchSerializer=void 0;hi.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 vd=m(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.ListResponseApplicationOutSerializer=void 0;var bd=Ou();gi.ListResponseApplicationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>bd.ApplicationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>bd.ApplicationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Su=m(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.ApiException=void 0;var Cu=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,s)=>{this.headers[s]=n})}};bi.ApiException=Cu});var _d,yd=z(()=>{_d="ffffffff-ffff-ffff-ffff-ffffffffffff"});var Od,Cd=z(()=>{Od="00000000-0000-0000-0000-000000000000"});var Sd,xd=z(()=>{Sd=/^(?:[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 K_(e){return typeof e=="string"&&Sd.test(e)}var ct,Sr=z(()=>{xd();ct=K_});function Y_(e){if(!ct(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 lt,xr=z(()=>{Sr();lt=Y_});function Oe(e,t=0){return(fe[e[t+0]]+fe[e[t+1]]+fe[e[t+2]]+fe[e[t+3]]+"-"+fe[e[t+4]]+fe[e[t+5]]+"-"+fe[e[t+6]]+fe[e[t+7]]+"-"+fe[e[t+8]]+fe[e[t+9]]+"-"+fe[e[t+10]]+fe[e[t+11]]+fe[e[t+12]]+fe[e[t+13]]+fe[e[t+14]]+fe[e[t+15]]).toLowerCase()}function Q_(e,t=0){let r=Oe(e,t);if(!ct(r))throw TypeError("Stringified UUID is invalid");return r}var fe,wd,et=z(()=>{Sr();fe=[];for(let e=0;e<256;++e)fe.push((e+256).toString(16).slice(1));wd=Q_});function St(){return vi>_i.length-16&&(kd.default.randomFillSync(_i),vi=0),_i.slice(vi,vi+=16)}var kd,_i,vi,yi=z(()=>{kd=oe(require("node:crypto")),_i=new Uint8Array(256),vi=_i.length});function Z_(e,t,r){let i=t&&r||0,n=t||new Array(16);e=e||{};let s=e.node,o=e.clockseq;if(e._v6||(s||(s=xu),o==null&&(o=Oi)),s==null||o==null){let p=e.random||(e.rng||St)();s==null&&(s=[p[0],p[1],p[2],p[3],p[4],p[5]],!xu&&!e._v6&&(s[0]|=1,xu=s)),o==null&&(o=(p[6]<<8|p[7])&16383,Oi===void 0&&!e._v6&&(Oi=o))}let a=e.msecs!==void 0?e.msecs:Date.now(),u=e.nsecs!==void 0?e.nsecs:ku+1,c=a-wu+(u-ku)/1e4;if(c<0&&e.clockseq===void 0&&(o=o+1&16383),(c<0||a>wu)&&e.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");wu=a,ku=u,Oi=o,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 l=a/4294967296*1e4&268435455;n[i++]=l>>>8&255,n[i++]=l&255,n[i++]=l>>>24&15|16,n[i++]=l>>>16&255,n[i++]=o>>>8|128,n[i++]=o&255;for(let p=0;p<6;++p)n[i+p]=s[p];return t||Oe(n)}var xu,Oi,wu,ku,Ci,Au=z(()=>{yi();et();wu=0,ku=0;Ci=Z_});function wr(e){let t=typeof e=="string"?lt(e):e,r=X_(t);return typeof e=="string"?Oe(r):r}function X_(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 Eu=z(()=>{xr();et()});function ey(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}function kr(e,t,r){function i(n,s,o,a){var u;if(typeof n=="string"&&(n=ey(n)),typeof s=="string"&&(s=lt(s)),((u=s)===null||u===void 0?void 0:u.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+n.length);if(c.set(s),c.set(n,s.length),c=r(c),c[6]=c[6]&15|t,c[8]=c[8]&63|128,o){a=a||0;for(let d=0;d<16;++d)o[a+d]=c[d];return o}return Oe(c)}try{i.name=e}catch{}return i.DNS=ty,i.URL=ry,i}var ty,ry,Tu=z(()=>{et();xr();ty="6ba7b810-9dad-11d1-80b4-00c04fd430c8",ry="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function iy(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Ad.default.createHash("md5").update(e).digest()}var Ad,Ed,Td=z(()=>{Ad=oe(require("node:crypto"));Ed=iy});var ny,Pd,Dd=z(()=>{Tu();Td();ny=kr("v3",48,Ed),Pd=ny});var jd,Pu,Id=z(()=>{jd=oe(require("node:crypto")),Pu={randomUUID:jd.default.randomUUID}});function sy(e,t,r){if(Pu.randomUUID&&!t&&!e)return Pu.randomUUID();e=e||{};let i=e.random||(e.rng||St)();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 Oe(i)}var qd,$d=z(()=>{Id();yi();et();qd=sy});function oy(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),zd.default.createHash("sha1").update(e).digest()}var zd,Rd,Md=z(()=>{zd=oe(require("node:crypto"));Rd=oy});var ay,Jd,Fd=z(()=>{Tu();Md();ay=kr("v5",80,Rd),Jd=ay});function Du(e={},t,r=0){let i=Ci({...e,_v6:!0},new Uint8Array(16));if(i=wr(i),t){for(let n=0;n<16;n++)t[r+n]=i[n];return t}return Oe(i)}var Bd=z(()=>{et();Au();Eu()});function ju(e){let t=typeof e=="string"?lt(e):e,r=uy(t);return typeof e=="string"?Oe(r):r}function uy(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 Hd=z(()=>{xr();et()});function cy(e,t,r){e=e||{};let i=t&&r||0,n=t||new Uint8Array(16),s=e.random||(e.rng||St)(),o=e.msecs!==void 0?e.msecs:Date.now(),a=e.seq!==void 0?e.seq:null,u=Nd,c=Ld;return o>Ke&&e.msecs===void 0&&(Ke=o,a!==null&&(u=null,c=null)),a!==null&&(a>2147483647&&(a=2147483647),u=a>>>19&4095,c=a&524287),(u===null||c===null)&&(u=s[6]&127,u=u<<8|s[7],c=s[8]&63,c=c<<8|s[9],c=c<<5|s[10]>>>3),o+1e4>Ke&&a===null?++c>524287&&(c=0,++u>4095&&(u=0,Ke++)):Ke=o,Nd=u,Ld=c,n[i++]=Ke/1099511627776&255,n[i++]=Ke/4294967296&255,n[i++]=Ke/16777216&255,n[i++]=Ke/65536&255,n[i++]=Ke/256&255,n[i++]=Ke&255,n[i++]=u>>>4&15|112,n[i++]=u&255,n[i++]=c>>>13&63|128,n[i++]=c>>>5&255,n[i++]=c<<3&255|s[10]&7,n[i++]=s[11],n[i++]=s[12],n[i++]=s[13],n[i++]=s[14],n[i++]=s[15],t||Oe(n)}var Ld,Nd,Ke,Gd,Ud=z(()=>{yi();et();Ld=null,Nd=null,Ke=0;Gd=cy});function ly(e){if(!ct(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var Wd,Vd=z(()=>{Sr();Wd=ly});var Kd={};Ht(Kd,{MAX:()=>_d,NIL:()=>Od,parse:()=>lt,stringify:()=>wd,v1:()=>Ci,v1ToV6:()=>wr,v3:()=>Pd,v4:()=>qd,v5:()=>Jd,v6:()=>Du,v6ToV1:()=>ju,v7:()=>Gd,validate:()=>ct,version:()=>Wd});var Yd=z(()=>{yd();Cd();xr();et();Au();Eu();Dd();$d();Fd();Bd();Hd();Ud();Sr();Vd()});var K=m(He=>{"use strict";var Ar=He&&He.__awaiter||function(e,t,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(d){try{c(i.next(d))}catch(l){o(l)}}function u(d){try{c(i.throw(d))}catch(l){o(l)}}function c(d){d.done?s(d.value):n(d.value).then(a,u)}c((i=i.apply(e,t||[])).next())})};Object.defineProperty(He,"__esModule",{value:!0});He.SvixRequest=He.HttpMethod=He.LIB_VERSION=void 0;var Iu=Su(),dy=(Yd(),kv(Kd));He.LIB_VERSION="1.86.0";var py=`svix-libs/${He.LIB_VERSION}/javascript`,my;(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"})(my=He.HttpMethod||(He.HttpMethod={}));var qu=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 Ar(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 Ar(this,void 0,void 0,function*(){yield this.sendInner(t)})}sendInner(t){var r,i;return Ar(this,void 0,void 0,function*(){let n=new URL(t.baseUrl+this.path);for(let[u,c]of Object.entries(this.queryParams))n.searchParams.set(u,c);this.headerParams["idempotency-key"]===void 0&&this.method.toUpperCase()==="POST"&&(this.headerParams["idempotency-key"]=`auto_${(0,dy.v4)()}`);let s=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);this.body!=null&&(this.headerParams["content-type"]="application/json");let o="credentials"in Request.prototype,a=yield Qd(n,{method:this.method.toString(),body:this.body,headers:Object.assign({accept:"application/json, */*;q=0.8",authorization:`Bearer ${t.token}`,"user-agent":py,"svix-req-id":s.toString()},this.headerParams),credentials:o?"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 fy(a)})}};He.SvixRequest=qu;function fy(e){return Ar(this,void 0,void 0,function*(){if(e.status<300)return e;let t=yield e.text();throw e.status===422?new Iu.ApiException(e.status,JSON.parse(t),e.headers):e.status>=400&&e.status<=499?new Iu.ApiException(e.status,JSON.parse(t),e.headers):new Iu.ApiException(e.status,t,e.headers)})}function Qd(e,t,r,i=50,n=2,s=fetch,o=1){return Ar(this,void 0,void 0,function*(){let a=u=>new Promise(c=>setTimeout(c,u));try{let u=yield s(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"]=o.toString(),i=r?.[o]||i*2,yield Qd(e,t,r,i,--n,s,++o)})}});var Zd=m(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.Application=void 0;var $u=mi(),Er=Ou(),hy=gd(),gy=vd(),Te=K(),zu=class{constructor(t){this.requestCtx=t}list(t){let r=new Te.SvixRequest(Te.HttpMethod.GET,"/api/v1/app");return r.setQueryParams({exclude_apps_with_no_endpoints:t?.excludeAppsWithNoEndpoints,exclude_apps_with_disabled_endpoints:t?.excludeAppsWithDisabledEndpoints,limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,gy.ListResponseApplicationOutSerializer._fromJsonObject)}create(t,r){let i=new Te.SvixRequest(Te.HttpMethod.POST,"/api/v1/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody($u.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,Er.ApplicationOutSerializer._fromJsonObject)}getOrCreate(t,r){let i=new Te.SvixRequest(Te.HttpMethod.POST,"/api/v1/app");return i.setQueryParam("get_if_exists",!0),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody($u.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,Er.ApplicationOutSerializer._fromJsonObject)}get(t){let r=new Te.SvixRequest(Te.HttpMethod.GET,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.send(this.requestCtx,Er.ApplicationOutSerializer._fromJsonObject)}update(t,r){let i=new Te.SvixRequest(Te.HttpMethod.PUT,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody($u.ApplicationInSerializer._toJsonObject(r)),i.send(this.requestCtx,Er.ApplicationOutSerializer._fromJsonObject)}delete(t){let r=new Te.SvixRequest(Te.HttpMethod.DELETE,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Te.SvixRequest(Te.HttpMethod.PATCH,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody(hy.ApplicationPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Er.ApplicationOutSerializer._fromJsonObject)}};Si.Application=zu});var Xd=m(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.ApiTokenOutSerializer=void 0;xi.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 Ru=m(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.AppPortalCapabilitySerializer=xt.AppPortalCapability=void 0;var by;(function(e){e.ViewBase="ViewBase",e.ViewEndpointSecret="ViewEndpointSecret",e.ManageEndpointSecret="ManageEndpointSecret",e.ManageTransformations="ManageTransformations",e.CreateAttempts="CreateAttempts",e.ManageEndpoint="ManageEndpoint"})(by=xt.AppPortalCapability||(xt.AppPortalCapability={}));xt.AppPortalCapabilitySerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var rp=m(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.AppPortalAccessInSerializer=void 0;var ep=Ru(),tp=mi();wi.AppPortalAccessInSerializer={_fromJsonObject(e){var t;return{application:e.application!=null?tp.ApplicationInSerializer._fromJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>ep.AppPortalCapabilitySerializer._fromJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}},_toJsonObject(e){var t;return{application:e.application!=null?tp.ApplicationInSerializer._toJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>ep.AppPortalCapabilitySerializer._toJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}}}});var ip=m(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 np=m(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.ApplicationTokenExpireInSerializer=void 0;Ai.ApplicationTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}});var sp=m(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.RotatePollerTokenInSerializer=void 0;Ei.RotatePollerTokenInSerializer={_fromJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}},_toJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}}}});var op=m(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.StreamPortalAccessInSerializer=void 0;Ti.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 Mu=m(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.DashboardAccessOutSerializer=void 0;Pi.DashboardAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}});var cp=m(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.Authentication=void 0;var ap=Xd(),vy=rp(),up=ip(),_y=np(),yy=sp(),Oy=op(),Cy=Mu(),Pe=K(),Ju=class{constructor(t){this.requestCtx=t}appPortalAccess(t,r,i){let n=new Pe.SvixRequest(Pe.HttpMethod.POST,"/api/v1/auth/app-portal-access/{app_id}");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(vy.AppPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,up.AppPortalAccessOutSerializer._fromJsonObject)}expireAll(t,r,i){let n=new Pe.SvixRequest(Pe.HttpMethod.POST,"/api/v1/auth/app/{app_id}/expire-all");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(_y.ApplicationTokenExpireInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}dashboardAccess(t,r){let i=new Pe.SvixRequest(Pe.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,Cy.DashboardAccessOutSerializer._fromJsonObject)}logout(t){let r=new Pe.SvixRequest(Pe.HttpMethod.POST,"/api/v1/auth/logout");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.sendNoResponseBody(this.requestCtx)}streamPortalAccess(t,r,i){let n=new Pe.SvixRequest(Pe.HttpMethod.POST,"/api/v1/auth/stream-portal-access/{stream_id}");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(Oy.StreamPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,up.AppPortalAccessOutSerializer._fromJsonObject)}getStreamPollerToken(t,r){let i=new Pe.SvixRequest(Pe.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,ap.ApiTokenOutSerializer._fromJsonObject)}rotateStreamPollerToken(t,r,i,n){let s=new Pe.SvixRequest(Pe.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate");return s.setPathParam("stream_id",t),s.setPathParam("sink_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(yy.RotatePollerTokenInSerializer._toJsonObject(i)),s.send(this.requestCtx,ap.ApiTokenOutSerializer._fromJsonObject)}};Di.Authentication=Ju});var dt=m(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.BackgroundTaskStatusSerializer=wt.BackgroundTaskStatus=void 0;var Sy;(function(e){e.Running="running",e.Finished="finished",e.Failed="failed"})(Sy=wt.BackgroundTaskStatus||(wt.BackgroundTaskStatus={}));wt.BackgroundTaskStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var pt=m(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.BackgroundTaskTypeSerializer=kt.BackgroundTaskType=void 0;var xy;(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"})(xy=kt.BackgroundTaskType||(kt.BackgroundTaskType={}));kt.BackgroundTaskTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Fu=m(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.BackgroundTaskOutSerializer=void 0;var lp=dt(),dp=pt();ji.BackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data,id:e.id,status:lp.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:dp.BackgroundTaskTypeSerializer._fromJsonObject(e.task)}},_toJsonObject(e){return{data:e.data,id:e.id,status:lp.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:dp.BackgroundTaskTypeSerializer._toJsonObject(e.task)}}}});var mp=m(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.ListResponseBackgroundTaskOutSerializer=void 0;var pp=Fu();Ii.ListResponseBackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>pp.BackgroundTaskOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>pp.BackgroundTaskOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var fp=m($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.BackgroundTask=void 0;var wy=Fu(),ky=mp(),qi=K(),Bu=class{constructor(t){this.requestCtx=t}list(t){let r=new qi.SvixRequest(qi.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,ky.ListResponseBackgroundTaskOutSerializer._fromJsonObject)}listByEndpoint(t){return this.list(t)}get(t){let r=new qi.SvixRequest(qi.HttpMethod.GET,"/api/v1/background-task/{task_id}");return r.setPathParam("task_id",t),r.send(this.requestCtx,wy.BackgroundTaskOutSerializer._fromJsonObject)}};$i.BackgroundTask=Bu});var Gt=m(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.ConnectorKindSerializer=At.ConnectorKind=void 0;var Ay;(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"})(Ay=At.ConnectorKind||(At.ConnectorKind={}));At.ConnectorKindSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var zi=m(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.ConnectorProductSerializer=Et.ConnectorProduct=void 0;var Ey;(function(e){e.Dispatch="Dispatch",e.Stream="Stream"})(Ey=Et.ConnectorProduct||(Et.ConnectorProduct={}));Et.ConnectorProductSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Hu=m(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.ConnectorInSerializer=void 0;var hp=Gt(),gp=zi();Ri.ConnectorInSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?hp.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?gp.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?hp.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?gp.ConnectorProductSerializer._toJsonObject(e.productType):void 0,transformation:e.transformation,uid:e.uid}}}});var Ji=m(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.ConnectorOutSerializer=void 0;var bp=Gt(),vp=zi();Mi.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:bp.ConnectorKindSerializer._fromJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:vp.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:bp.ConnectorKindSerializer._toJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:vp.ConnectorProductSerializer._toJsonObject(e.productType),transformation:e.transformation,transformationUpdatedAt:e.transformationUpdatedAt,uid:e.uid,updatedAt:e.updatedAt}}}});var yp=m(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.ConnectorPatchSerializer=void 0;var _p=Gt();Fi.ConnectorPatchSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?_p.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?_p.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}}}});var Cp=m(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.ConnectorUpdateSerializer=void 0;var Op=Gt();Bi.ConnectorUpdateSerializer={_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,transformation:e.transformation}},_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,transformation:e.transformation}}}});var xp=m(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.ListResponseConnectorOutSerializer=void 0;var Sp=Ji();Hi.ListResponseConnectorOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Sp.ConnectorOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Sp.ConnectorOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var wp=m(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.Connector=void 0;var Ty=Hu(),Li=Ji(),Py=yp(),Dy=Cp(),jy=xp(),Le=K(),Lu=class{constructor(t){this.requestCtx=t}list(t){let r=new Le.SvixRequest(Le.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,jy.ListResponseConnectorOutSerializer._fromJsonObject)}create(t,r){let i=new Le.SvixRequest(Le.HttpMethod.POST,"/api/v1/connector");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(Ty.ConnectorInSerializer._toJsonObject(t)),i.send(this.requestCtx,Li.ConnectorOutSerializer._fromJsonObject)}get(t){let r=new Le.SvixRequest(Le.HttpMethod.GET,"/api/v1/connector/{connector_id}");return r.setPathParam("connector_id",t),r.send(this.requestCtx,Li.ConnectorOutSerializer._fromJsonObject)}update(t,r){let i=new Le.SvixRequest(Le.HttpMethod.PUT,"/api/v1/connector/{connector_id}");return i.setPathParam("connector_id",t),i.setBody(Dy.ConnectorUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Li.ConnectorOutSerializer._fromJsonObject)}delete(t){let r=new Le.SvixRequest(Le.HttpMethod.DELETE,"/api/v1/connector/{connector_id}");return r.setPathParam("connector_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Le.SvixRequest(Le.HttpMethod.PATCH,"/api/v1/connector/{connector_id}");return i.setPathParam("connector_id",t),i.setBody(Py.ConnectorPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Li.ConnectorOutSerializer._fromJsonObject)}};Ni.Connector=Lu});var kp=m(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.EndpointHeadersInSerializer=void 0;Gi.EndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var Nu=m(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.EndpointHeadersOutSerializer=void 0;Ui.EndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var Ap=m(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.EndpointHeadersPatchInSerializer=void 0;Wi.EndpointHeadersPatchInSerializer={_fromJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}},_toJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}}}});var Ep=m(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.EndpointInSerializer=void 0;Vi.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,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,uid:e.uid,url:e.url,version:e.version}}}});var Gu=m(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.EndpointOutSerializer=void 0;Ki.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,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,uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}});var Tp=m(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.EndpointPatchSerializer=void 0;Yi.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,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,uid:e.uid,url:e.url,version:e.version}}}});var Pp=m(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.EndpointSecretOutSerializer=void 0;Qi.EndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Uu=m(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.EndpointSecretRotateInSerializer=void 0;Zi.EndpointSecretRotateInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Dp=m(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.EndpointStatsSerializer=void 0;Xi.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 jp=m(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.EndpointTransformationInSerializer=void 0;en.EndpointTransformationInSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var Ip=m(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.EndpointTransformationOutSerializer=void 0;tn.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 qp=m(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.EndpointTransformationPatchSerializer=void 0;rn.EndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var $p=m(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.EndpointUpdateSerializer=void 0;nn.EndpointUpdateSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,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,uid:e.uid,url:e.url,version:e.version}}}});var zp=m(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.EventExampleInSerializer=void 0;sn.EventExampleInSerializer={_fromJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}},_toJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}}}});var Mp=m(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.ListResponseEndpointOutSerializer=void 0;var Rp=Gu();on.ListResponseEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Rp.EndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Rp.EndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Tr=m(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.MessageOutSerializer=void 0;an.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 Jp=m(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.RecoverInSerializer=void 0;un.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 Hp=m(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.RecoverOutSerializer=void 0;var Fp=dt(),Bp=pt();cn.RecoverOutSerializer={_fromJsonObject(e){return{id:e.id,status:Fp.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Bp.BackgroundTaskTypeSerializer._fromJsonObject(e.task)}},_toJsonObject(e){return{id:e.id,status:Fp.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Bp.BackgroundTaskTypeSerializer._toJsonObject(e.task)}}}});var Lp=m(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.ReplayInSerializer=void 0;ln.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 Up=m(dn=>{"use strict";Object.defineProperty(dn,"__esModule",{value:!0});dn.ReplayOutSerializer=void 0;var Np=dt(),Gp=pt();dn.ReplayOutSerializer={_fromJsonObject(e){return{id:e.id,status:Np.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Gp.BackgroundTaskTypeSerializer._fromJsonObject(e.task)}},_toJsonObject(e){return{id:e.id,status:Np.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Gp.BackgroundTaskTypeSerializer._toJsonObject(e.task)}}}});var Wp=m(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.Endpoint=void 0;var Iy=kp(),qy=Nu(),$y=Ap(),zy=Ep(),pn=Gu(),Ry=Tp(),My=Pp(),Jy=Uu(),Fy=Dp(),By=jp(),Hy=Ip(),Ly=qp(),Ny=$p(),Gy=zp(),Uy=Mp(),Wy=Tr(),Vy=Jp(),Ky=Hp(),Yy=Lp(),Qy=Up(),q=K(),Wu=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,Uy.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(zy.EndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,pn.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,pn.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(Ny.EndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,pn.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(Ry.EndpointPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,pn.EndpointOutSerializer._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,qy.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(Iy.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($y.EndpointHeadersPatchInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}headersPatch(t,r,i){return this.patchHeaders(t,r,i)}recover(t,r,i,n){let s=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover");return s.setPathParam("app_id",t),s.setPathParam("endpoint_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(Vy.RecoverInSerializer._toJsonObject(i)),s.send(this.requestCtx,Ky.RecoverOutSerializer._fromJsonObject)}replayMissing(t,r,i,n){let s=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing");return s.setPathParam("app_id",t),s.setPathParam("endpoint_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(Yy.ReplayInSerializer._toJsonObject(i)),s.send(this.requestCtx,Qy.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,My.EndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let s=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate");return s.setPathParam("app_id",t),s.setPathParam("endpoint_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(Jy.EndpointSecretRotateInSerializer._toJsonObject(i)),s.sendNoResponseBody(this.requestCtx)}sendExample(t,r,i,n){let s=new q.SvixRequest(q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example");return s.setPathParam("app_id",t),s.setPathParam("endpoint_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(Gy.EventExampleInSerializer._toJsonObject(i)),s.send(this.requestCtx,Wy.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,Fy.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,Hy.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(Ly.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(By.EndpointTransformationInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};mn.Endpoint=Wu});var Vu=m(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.EventTypeInSerializer=void 0;fn.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 Yp=m(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.EnvironmentInSerializer=void 0;var Vp=Hu(),Kp=Vu();hn.EnvironmentInSerializer={_fromJsonObject(e){var t,r;return{connectors:(t=e.connectors)===null||t===void 0?void 0:t.map(i=>Vp.ConnectorInSerializer._fromJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>Kp.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=>Vp.ConnectorInSerializer._toJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>Kp.EventTypeInSerializer._toJsonObject(i)),settings:e.settings}}}});var bn=m(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.EventTypeOutSerializer=void 0;gn.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 Xp=m(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.EnvironmentOutSerializer=void 0;var Qp=Ji(),Zp=bn();vn.EnvironmentOutSerializer={_fromJsonObject(e){return{connectors:e.connectors.map(t=>Qp.ConnectorOutSerializer._fromJsonObject(t)),createdAt:new Date(e.createdAt),eventTypes:e.eventTypes.map(t=>Zp.EventTypeOutSerializer._fromJsonObject(t)),settings:e.settings,version:e.version}},_toJsonObject(e){return{connectors:e.connectors.map(t=>Qp.ConnectorOutSerializer._toJsonObject(t)),createdAt:e.createdAt,eventTypes:e.eventTypes.map(t=>Zp.EventTypeOutSerializer._toJsonObject(t)),settings:e.settings,version:e.version}}}});var em=m(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.Environment=void 0;var Zy=Yp(),Xy=Xp(),_n=K(),Ku=class{constructor(t){this.requestCtx=t}export(t){let r=new _n.SvixRequest(_n.HttpMethod.POST,"/api/v1/environment/export");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.send(this.requestCtx,Xy.EnvironmentOutSerializer._fromJsonObject)}import(t,r){let i=new _n.SvixRequest(_n.HttpMethod.POST,"/api/v1/environment/import");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(Zy.EnvironmentInSerializer._toJsonObject(t)),i.sendNoResponseBody(this.requestCtx)}};yn.Environment=Ku});var tm=m(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.EventTypeImportOpenApiInSerializer=void 0;On.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 rm=m(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.EventTypeFromOpenApiSerializer=void 0;Cn.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 nm=m(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.EventTypeImportOpenApiOutDataSerializer=void 0;var im=rm();Sn.EventTypeImportOpenApiOutDataSerializer={_fromJsonObject(e){var t;return{modified:e.modified,toModify:(t=e.to_modify)===null||t===void 0?void 0:t.map(r=>im.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=>im.EventTypeFromOpenApiSerializer._toJsonObject(r))}}}});var om=m(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.EventTypeImportOpenApiOutSerializer=void 0;var sm=nm();xn.EventTypeImportOpenApiOutSerializer={_fromJsonObject(e){return{data:sm.EventTypeImportOpenApiOutDataSerializer._fromJsonObject(e.data)}},_toJsonObject(e){return{data:sm.EventTypeImportOpenApiOutDataSerializer._toJsonObject(e.data)}}}});var am=m(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.EventTypePatchSerializer=void 0;wn.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 um=m(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.EventTypeUpdateSerializer=void 0;kn.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 lm=m(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.ListResponseEventTypeOutSerializer=void 0;var cm=bn();An.ListResponseEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>cm.EventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>cm.EventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var dm=m(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.EventType=void 0;var e1=tm(),t1=om(),r1=Vu(),En=bn(),i1=am(),n1=um(),s1=lm(),De=K(),Yu=class{constructor(t){this.requestCtx=t}list(t){let r=new De.SvixRequest(De.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,s1.ListResponseEventTypeOutSerializer._fromJsonObject)}create(t,r){let i=new De.SvixRequest(De.HttpMethod.POST,"/api/v1/event-type");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(r1.EventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,En.EventTypeOutSerializer._fromJsonObject)}importOpenapi(t,r){let i=new De.SvixRequest(De.HttpMethod.POST,"/api/v1/event-type/import/openapi");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(e1.EventTypeImportOpenApiInSerializer._toJsonObject(t)),i.send(this.requestCtx,t1.EventTypeImportOpenApiOutSerializer._fromJsonObject)}get(t){let r=new De.SvixRequest(De.HttpMethod.GET,"/api/v1/event-type/{event_type_name}");return r.setPathParam("event_type_name",t),r.send(this.requestCtx,En.EventTypeOutSerializer._fromJsonObject)}update(t,r){let i=new De.SvixRequest(De.HttpMethod.PUT,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(n1.EventTypeUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,En.EventTypeOutSerializer._fromJsonObject)}delete(t,r){let i=new De.SvixRequest(De.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 De.SvixRequest(De.HttpMethod.PATCH,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(i1.EventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,En.EventTypeOutSerializer._fromJsonObject)}};Tn.EventType=Yu});var mm=m(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.Health=void 0;var pm=K(),Qu=class{constructor(t){this.requestCtx=t}get(){return new pm.SvixRequest(pm.HttpMethod.GET,"/api/v1/health").sendNoResponseBody(this.requestCtx)}};Pn.Health=Qu});var fm=m(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.IngestSourceConsumerPortalAccessInSerializer=void 0;Dn.IngestSourceConsumerPortalAccessInSerializer={_fromJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}},_toJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}}}});var hm=m(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.IngestEndpointHeadersInSerializer=void 0;jn.IngestEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var gm=m(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.IngestEndpointHeadersOutSerializer=void 0;In.IngestEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var bm=m(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.IngestEndpointInSerializer=void 0;qn.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 Zu=m($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.IngestEndpointOutSerializer=void 0;$n.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 vm=m(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.IngestEndpointSecretInSerializer=void 0;zn.IngestEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var _m=m(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.IngestEndpointSecretOutSerializer=void 0;Rn.IngestEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var ym=m(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.IngestEndpointTransformationOutSerializer=void 0;Mn.IngestEndpointTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var Om=m(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.IngestEndpointTransformationPatchSerializer=void 0;Jn.IngestEndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var Cm=m(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.IngestEndpointUpdateSerializer=void 0;Fn.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 xm=m(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.ListResponseIngestEndpointOutSerializer=void 0;var Sm=Zu();Bn.ListResponseIngestEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Sm.IngestEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Sm.IngestEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var wm=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.IngestEndpoint=void 0;var o1=hm(),a1=gm(),u1=bm(),Xu=Zu(),c1=vm(),l1=_m(),d1=ym(),p1=Om(),m1=Cm(),f1=xm(),Q=K(),ec=class{constructor(t){this.requestCtx=t}list(t,r){let i=new Q.SvixRequest(Q.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,f1.ListResponseIngestEndpointOutSerializer._fromJsonObject)}create(t,r,i){let n=new Q.SvixRequest(Q.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint");return n.setPathParam("source_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(u1.IngestEndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,Xu.IngestEndpointOutSerializer._fromJsonObject)}get(t,r){let i=new Q.SvixRequest(Q.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,Xu.IngestEndpointOutSerializer._fromJsonObject)}update(t,r,i){let n=new Q.SvixRequest(Q.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return n.setPathParam("source_id",t),n.setPathParam("endpoint_id",r),n.setBody(m1.IngestEndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,Xu.IngestEndpointOutSerializer._fromJsonObject)}delete(t,r){let i=new Q.SvixRequest(Q.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 Q.SvixRequest(Q.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,a1.IngestEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r,i){let n=new Q.SvixRequest(Q.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(o1.IngestEndpointHeadersInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}getSecret(t,r){let i=new Q.SvixRequest(Q.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,l1.IngestEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let s=new Q.SvixRequest(Q.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate");return s.setPathParam("source_id",t),s.setPathParam("endpoint_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(c1.IngestEndpointSecretInSerializer._toJsonObject(i)),s.sendNoResponseBody(this.requestCtx)}getTransformation(t,r){let i=new Q.SvixRequest(Q.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,d1.IngestEndpointTransformationOutSerializer._fromJsonObject)}setTransformation(t,r,i){let n=new Q.SvixRequest(Q.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(p1.IngestEndpointTransformationPatchSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};Hn.IngestEndpoint=ec});var km=m(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.AdobeSignConfigSerializer=void 0;Ln.AdobeSignConfigSerializer={_fromJsonObject(e){return{clientId:e.clientId}},_toJsonObject(e){return{clientId:e.clientId}}}});var Am=m(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.AirwallexConfigSerializer=void 0;Nn.AirwallexConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Em=m(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.CheckbookConfigSerializer=void 0;Gn.CheckbookConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var tc=m(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.CronConfigSerializer=void 0;Un.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 Tm=m(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.DocusignConfigSerializer=void 0;Wn.DocusignConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Pm=m(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.EasypostConfigSerializer=void 0;Vn.EasypostConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Dm=m(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.GithubConfigSerializer=void 0;Kn.GithubConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var jm=m(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.HubspotConfigSerializer=void 0;Yn.HubspotConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Im=m(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.OrumIoConfigSerializer=void 0;Qn.OrumIoConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var qm=m(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.PandaDocConfigSerializer=void 0;Zn.PandaDocConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var $m=m(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.PortIoConfigSerializer=void 0;Xn.PortIoConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var zm=m(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.RutterConfigSerializer=void 0;es.RutterConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Rm=m(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.SegmentConfigSerializer=void 0;ts.SegmentConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Mm=m(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.ShopifyConfigSerializer=void 0;rs.ShopifyConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Jm=m(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.SlackConfigSerializer=void 0;is.SlackConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Fm=m(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.StripeConfigSerializer=void 0;ns.StripeConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Bm=m(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.SvixConfigSerializer=void 0;ss.SvixConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Hm=m(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.TelnyxConfigSerializer=void 0;os.TelnyxConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Lm=m(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.VapiConfigSerializer=void 0;as.VapiConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Nm=m(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.VeriffConfigSerializer=void 0;us.VeriffConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Gm=m(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.ZoomConfigSerializer=void 0;cs.ZoomConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var mf=m(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.IngestSourceInSerializer=void 0;var Um=km(),Wm=Am(),Vm=Em(),Km=tc(),Ym=Tm(),Qm=Pm(),Zm=Dm(),Xm=jm(),ef=Im(),tf=qm(),rf=$m(),nf=zm(),sf=Rm(),of=Mm(),af=Jm(),uf=Fm(),R=Bm(),cf=Hm(),lf=Lm(),df=Nm(),pf=Gm();ls.IngestSourceInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return Km.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return Um.AdobeSignConfigSerializer._fromJsonObject(e.config);case"beehiiv":return R.SvixConfigSerializer._fromJsonObject(e.config);case"brex":return R.SvixConfigSerializer._fromJsonObject(e.config);case"checkbook":return Vm.CheckbookConfigSerializer._fromJsonObject(e.config);case"clerk":return R.SvixConfigSerializer._fromJsonObject(e.config);case"docusign":return Ym.DocusignConfigSerializer._fromJsonObject(e.config);case"easypost":return Qm.EasypostConfigSerializer._fromJsonObject(e.config);case"github":return Zm.GithubConfigSerializer._fromJsonObject(e.config);case"guesty":return R.SvixConfigSerializer._fromJsonObject(e.config);case"hubspot":return Xm.HubspotConfigSerializer._fromJsonObject(e.config);case"incident-io":return R.SvixConfigSerializer._fromJsonObject(e.config);case"lithic":return R.SvixConfigSerializer._fromJsonObject(e.config);case"nash":return R.SvixConfigSerializer._fromJsonObject(e.config);case"orum-io":return ef.OrumIoConfigSerializer._fromJsonObject(e.config);case"panda-doc":return tf.PandaDocConfigSerializer._fromJsonObject(e.config);case"port-io":return rf.PortIoConfigSerializer._fromJsonObject(e.config);case"pleo":return R.SvixConfigSerializer._fromJsonObject(e.config);case"replicate":return R.SvixConfigSerializer._fromJsonObject(e.config);case"resend":return R.SvixConfigSerializer._fromJsonObject(e.config);case"rutter":return nf.RutterConfigSerializer._fromJsonObject(e.config);case"safebase":return R.SvixConfigSerializer._fromJsonObject(e.config);case"sardine":return R.SvixConfigSerializer._fromJsonObject(e.config);case"segment":return sf.SegmentConfigSerializer._fromJsonObject(e.config);case"shopify":return of.ShopifyConfigSerializer._fromJsonObject(e.config);case"slack":return af.SlackConfigSerializer._fromJsonObject(e.config);case"stripe":return uf.StripeConfigSerializer._fromJsonObject(e.config);case"stych":return R.SvixConfigSerializer._fromJsonObject(e.config);case"svix":return R.SvixConfigSerializer._fromJsonObject(e.config);case"zoom":return pf.ZoomConfigSerializer._fromJsonObject(e.config);case"telnyx":return cf.TelnyxConfigSerializer._fromJsonObject(e.config);case"vapi":return lf.VapiConfigSerializer._fromJsonObject(e.config);case"open-ai":return R.SvixConfigSerializer._fromJsonObject(e.config);case"render":return R.SvixConfigSerializer._fromJsonObject(e.config);case"veriff":return df.VeriffConfigSerializer._fromJsonObject(e.config);case"airwallex":return Wm.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=Km.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=Um.AdobeSignConfigSerializer._toJsonObject(e.config);break;case"beehiiv":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"brex":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"checkbook":t=Vm.CheckbookConfigSerializer._toJsonObject(e.config);break;case"clerk":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"docusign":t=Ym.DocusignConfigSerializer._toJsonObject(e.config);break;case"easypost":t=Qm.EasypostConfigSerializer._toJsonObject(e.config);break;case"github":t=Zm.GithubConfigSerializer._toJsonObject(e.config);break;case"guesty":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"hubspot":t=Xm.HubspotConfigSerializer._toJsonObject(e.config);break;case"incident-io":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"lithic":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"nash":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"orum-io":t=ef.OrumIoConfigSerializer._toJsonObject(e.config);break;case"panda-doc":t=tf.PandaDocConfigSerializer._toJsonObject(e.config);break;case"port-io":t=rf.PortIoConfigSerializer._toJsonObject(e.config);break;case"pleo":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"replicate":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"resend":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"rutter":t=nf.RutterConfigSerializer._toJsonObject(e.config);break;case"safebase":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"sardine":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"segment":t=sf.SegmentConfigSerializer._toJsonObject(e.config);break;case"shopify":t=of.ShopifyConfigSerializer._toJsonObject(e.config);break;case"slack":t=af.SlackConfigSerializer._toJsonObject(e.config);break;case"stripe":t=uf.StripeConfigSerializer._toJsonObject(e.config);break;case"stych":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"svix":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"zoom":t=pf.ZoomConfigSerializer._toJsonObject(e.config);break;case"telnyx":t=cf.TelnyxConfigSerializer._toJsonObject(e.config);break;case"vapi":t=lf.VapiConfigSerializer._toJsonObject(e.config);break;case"open-ai":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"render":t=R.SvixConfigSerializer._toJsonObject(e.config);break;case"veriff":t=df.VeriffConfigSerializer._toJsonObject(e.config);break;case"airwallex":t=Wm.AirwallexConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,metadata:e.metadata,name:e.name,uid:e.uid}}}});var ff=m(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.AdobeSignConfigOutSerializer=void 0;ds.AdobeSignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var hf=m(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.AirwallexConfigOutSerializer=void 0;ps.AirwallexConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var gf=m(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.CheckbookConfigOutSerializer=void 0;ms.CheckbookConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var bf=m(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.DocusignConfigOutSerializer=void 0;fs.DocusignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var vf=m(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.EasypostConfigOutSerializer=void 0;hs.EasypostConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var _f=m(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.GithubConfigOutSerializer=void 0;gs.GithubConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var yf=m(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.HubspotConfigOutSerializer=void 0;bs.HubspotConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Of=m(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.OrumIoConfigOutSerializer=void 0;vs.OrumIoConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Cf=m(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.PandaDocConfigOutSerializer=void 0;_s.PandaDocConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Sf=m(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.PortIoConfigOutSerializer=void 0;ys.PortIoConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var xf=m(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.RutterConfigOutSerializer=void 0;Os.RutterConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var wf=m(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.SegmentConfigOutSerializer=void 0;Cs.SegmentConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var kf=m(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.ShopifyConfigOutSerializer=void 0;Ss.ShopifyConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Af=m(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.SlackConfigOutSerializer=void 0;xs.SlackConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Ef=m(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.StripeConfigOutSerializer=void 0;ws.StripeConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Tf=m(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.SvixConfigOutSerializer=void 0;ks.SvixConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Pf=m(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.TelnyxConfigOutSerializer=void 0;As.TelnyxConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Df=m(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.VapiConfigOutSerializer=void 0;Es.VapiConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var jf=m(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.VeriffConfigOutSerializer=void 0;Ts.VeriffConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var If=m(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.ZoomConfigOutSerializer=void 0;Ps.ZoomConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var rc=m(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.IngestSourceOutSerializer=void 0;var qf=ff(),$f=hf(),zf=gf(),Rf=tc(),Mf=bf(),Jf=vf(),Ff=_f(),Bf=yf(),Hf=Of(),Lf=Cf(),Nf=Sf(),Gf=xf(),Uf=wf(),Wf=kf(),Vf=Af(),Kf=Ef(),M=Tf(),Yf=Pf(),Qf=Df(),Zf=jf(),Xf=If();Ds.IngestSourceOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return Rf.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return qf.AdobeSignConfigOutSerializer._fromJsonObject(e.config);case"beehiiv":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"brex":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"checkbook":return zf.CheckbookConfigOutSerializer._fromJsonObject(e.config);case"clerk":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"docusign":return Mf.DocusignConfigOutSerializer._fromJsonObject(e.config);case"easypost":return Jf.EasypostConfigOutSerializer._fromJsonObject(e.config);case"github":return Ff.GithubConfigOutSerializer._fromJsonObject(e.config);case"guesty":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"hubspot":return Bf.HubspotConfigOutSerializer._fromJsonObject(e.config);case"incident-io":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"lithic":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"nash":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"orum-io":return Hf.OrumIoConfigOutSerializer._fromJsonObject(e.config);case"panda-doc":return Lf.PandaDocConfigOutSerializer._fromJsonObject(e.config);case"port-io":return Nf.PortIoConfigOutSerializer._fromJsonObject(e.config);case"pleo":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"replicate":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"resend":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"rutter":return Gf.RutterConfigOutSerializer._fromJsonObject(e.config);case"safebase":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"sardine":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"segment":return Uf.SegmentConfigOutSerializer._fromJsonObject(e.config);case"shopify":return Wf.ShopifyConfigOutSerializer._fromJsonObject(e.config);case"slack":return Vf.SlackConfigOutSerializer._fromJsonObject(e.config);case"stripe":return Kf.StripeConfigOutSerializer._fromJsonObject(e.config);case"stych":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"svix":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"zoom":return Xf.ZoomConfigOutSerializer._fromJsonObject(e.config);case"telnyx":return Yf.TelnyxConfigOutSerializer._fromJsonObject(e.config);case"vapi":return Qf.VapiConfigOutSerializer._fromJsonObject(e.config);case"open-ai":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"render":return M.SvixConfigOutSerializer._fromJsonObject(e.config);case"veriff":return Zf.VeriffConfigOutSerializer._fromJsonObject(e.config);case"airwallex":return $f.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=Rf.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=qf.AdobeSignConfigOutSerializer._toJsonObject(e.config);break;case"beehiiv":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"brex":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"checkbook":t=zf.CheckbookConfigOutSerializer._toJsonObject(e.config);break;case"clerk":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"docusign":t=Mf.DocusignConfigOutSerializer._toJsonObject(e.config);break;case"easypost":t=Jf.EasypostConfigOutSerializer._toJsonObject(e.config);break;case"github":t=Ff.GithubConfigOutSerializer._toJsonObject(e.config);break;case"guesty":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"hubspot":t=Bf.HubspotConfigOutSerializer._toJsonObject(e.config);break;case"incident-io":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"lithic":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"nash":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"orum-io":t=Hf.OrumIoConfigOutSerializer._toJsonObject(e.config);break;case"panda-doc":t=Lf.PandaDocConfigOutSerializer._toJsonObject(e.config);break;case"port-io":t=Nf.PortIoConfigOutSerializer._toJsonObject(e.config);break;case"pleo":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"replicate":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"resend":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"rutter":t=Gf.RutterConfigOutSerializer._toJsonObject(e.config);break;case"safebase":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"sardine":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"segment":t=Uf.SegmentConfigOutSerializer._toJsonObject(e.config);break;case"shopify":t=Wf.ShopifyConfigOutSerializer._toJsonObject(e.config);break;case"slack":t=Vf.SlackConfigOutSerializer._toJsonObject(e.config);break;case"stripe":t=Kf.StripeConfigOutSerializer._toJsonObject(e.config);break;case"stych":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"svix":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"zoom":t=Xf.ZoomConfigOutSerializer._toJsonObject(e.config);break;case"telnyx":t=Yf.TelnyxConfigOutSerializer._toJsonObject(e.config);break;case"vapi":t=Qf.VapiConfigOutSerializer._toJsonObject(e.config);break;case"open-ai":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"render":t=M.SvixConfigOutSerializer._toJsonObject(e.config);break;case"veriff":t=Zf.VeriffConfigOutSerializer._toJsonObject(e.config);break;case"airwallex":t=$f.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 th=m(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.ListResponseIngestSourceOutSerializer=void 0;var eh=rc();js.ListResponseIngestSourceOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>eh.IngestSourceOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>eh.IngestSourceOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var rh=m(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 nh=m(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.IngestSource=void 0;var ih=mf(),ic=rc(),h1=th(),g1=rh(),Ne=K(),nc=class{constructor(t){this.requestCtx=t}list(t){let r=new Ne.SvixRequest(Ne.HttpMethod.GET,"/ingest/api/v1/source");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,h1.ListResponseIngestSourceOutSerializer._fromJsonObject)}create(t,r){let i=new Ne.SvixRequest(Ne.HttpMethod.POST,"/ingest/api/v1/source");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(ih.IngestSourceInSerializer._toJsonObject(t)),i.send(this.requestCtx,ic.IngestSourceOutSerializer._fromJsonObject)}get(t){let r=new Ne.SvixRequest(Ne.HttpMethod.GET,"/ingest/api/v1/source/{source_id}");return r.setPathParam("source_id",t),r.send(this.requestCtx,ic.IngestSourceOutSerializer._fromJsonObject)}update(t,r){let i=new Ne.SvixRequest(Ne.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}");return i.setPathParam("source_id",t),i.setBody(ih.IngestSourceInSerializer._toJsonObject(r)),i.send(this.requestCtx,ic.IngestSourceOutSerializer._fromJsonObject)}delete(t){let r=new Ne.SvixRequest(Ne.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}");return r.setPathParam("source_id",t),r.sendNoResponseBody(this.requestCtx)}rotateToken(t,r){let i=new Ne.SvixRequest(Ne.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,g1.RotateTokenOutSerializer._fromJsonObject)}};qs.IngestSource=nc});var oh=m($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.Ingest=void 0;var b1=Mu(),v1=fm(),_1=wm(),y1=nh(),sh=K(),sc=class{constructor(t){this.requestCtx=t}get endpoint(){return new _1.IngestEndpoint(this.requestCtx)}get source(){return new y1.IngestSource(this.requestCtx)}dashboard(t,r,i){let n=new sh.SvixRequest(sh.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/dashboard");return n.setPathParam("source_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(v1.IngestSourceConsumerPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,b1.DashboardAccessOutSerializer._fromJsonObject)}};$s.Ingest=sc});var ah=m(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.IntegrationInSerializer=void 0;zs.IntegrationInSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var uh=m(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.IntegrationKeyOutSerializer=void 0;Rs.IntegrationKeyOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var oc=m(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 ch=m(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.IntegrationUpdateSerializer=void 0;Js.IntegrationUpdateSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var dh=m(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.ListResponseIntegrationOutSerializer=void 0;var lh=oc();Fs.ListResponseIntegrationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>lh.IntegrationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>lh.IntegrationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var mh=m(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.Integration=void 0;var O1=ah(),ph=uh(),ac=oc(),C1=ch(),S1=dh(),je=K(),uc=class{constructor(t){this.requestCtx=t}list(t,r){let i=new je.SvixRequest(je.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,S1.ListResponseIntegrationOutSerializer._fromJsonObject)}create(t,r,i){let n=new je.SvixRequest(je.HttpMethod.POST,"/api/v1/app/{app_id}/integration");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(O1.IntegrationInSerializer._toJsonObject(r)),n.send(this.requestCtx,ac.IntegrationOutSerializer._fromJsonObject)}get(t,r){let i=new je.SvixRequest(je.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,ac.IntegrationOutSerializer._fromJsonObject)}update(t,r,i){let n=new je.SvixRequest(je.HttpMethod.PUT,"/api/v1/app/{app_id}/integration/{integ_id}");return n.setPathParam("app_id",t),n.setPathParam("integ_id",r),n.setBody(C1.IntegrationUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,ac.IntegrationOutSerializer._fromJsonObject)}delete(t,r){let i=new je.SvixRequest(je.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 je.SvixRequest(je.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,ph.IntegrationKeyOutSerializer._fromJsonObject)}rotateKey(t,r,i){let n=new je.SvixRequest(je.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,ph.IntegrationKeyOutSerializer._fromJsonObject)}};Bs.Integration=uc});var gh=m(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.ExpungeAllContentsOutSerializer=void 0;var fh=dt(),hh=pt();Hs.ExpungeAllContentsOutSerializer={_fromJsonObject(e){return{id:e.id,status:fh.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:hh.BackgroundTaskTypeSerializer._fromJsonObject(e.task)}},_toJsonObject(e){return{id:e.id,status:fh.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:hh.BackgroundTaskTypeSerializer._toJsonObject(e.task)}}}});var vh=m(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.ListResponseMessageOutSerializer=void 0;var bh=Tr();Ls.ListResponseMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>bh.MessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>bh.MessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var _h=m(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.MessagePrecheckInSerializer=void 0;Ns.MessagePrecheckInSerializer={_fromJsonObject(e){return{channels:e.channels,eventType:e.eventType}},_toJsonObject(e){return{channels:e.channels,eventType:e.eventType}}}});var yh=m(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.MessagePrecheckOutSerializer=void 0;Gs.MessagePrecheckOutSerializer={_fromJsonObject(e){return{active:e.active}},_toJsonObject(e){return{active:e.active}}}});var Oh=m(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.PollingEndpointConsumerSeekInSerializer=void 0;Us.PollingEndpointConsumerSeekInSerializer={_fromJsonObject(e){return{after:new Date(e.after)}},_toJsonObject(e){return{after:e.after}}}});var Ch=m(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.PollingEndpointConsumerSeekOutSerializer=void 0;Ws.PollingEndpointConsumerSeekOutSerializer={_fromJsonObject(e){return{iterator:e.iterator}},_toJsonObject(e){return{iterator:e.iterator}}}});var Sh=m(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 wh=m(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.PollingEndpointOutSerializer=void 0;var xh=Sh();Ks.PollingEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>xh.PollingEndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>xh.PollingEndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var Ah=m(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.MessagePoller=void 0;var x1=Oh(),w1=Ch(),kh=wh(),Ut=K(),cc=class{constructor(t){this.requestCtx=t}poll(t,r,i){let n=new Ut.SvixRequest(Ut.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,kh.PollingEndpointOutSerializer._fromJsonObject)}consumerPoll(t,r,i,n){let s=new Ut.SvixRequest(Ut.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}");return s.setPathParam("app_id",t),s.setPathParam("sink_id",r),s.setPathParam("consumer_id",i),s.setQueryParams({limit:n?.limit,iterator:n?.iterator}),s.send(this.requestCtx,kh.PollingEndpointOutSerializer._fromJsonObject)}consumerSeek(t,r,i,n,s){let o=new Ut.SvixRequest(Ut.HttpMethod.POST,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek");return o.setPathParam("app_id",t),o.setPathParam("sink_id",r),o.setPathParam("consumer_id",i),o.setHeaderParam("idempotency-key",s?.idempotencyKey),o.setBody(x1.PollingEndpointConsumerSeekInSerializer._toJsonObject(n)),o.send(this.requestCtx,w1.PollingEndpointConsumerSeekOutSerializer._fromJsonObject)}};Ys.MessagePoller=cc});var Th=m(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.MessageInSerializer=void 0;var Eh=mi();Qs.MessageInSerializer={_fromJsonObject(e){return{application:e.application!=null?Eh.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?Eh.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 dc=m(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.messageInRaw=Wt.Message=void 0;var k1=gh(),A1=vh(),Ph=Tr(),E1=_h(),T1=yh(),P1=Ah(),Ge=K(),D1=Th(),lc=class{constructor(t){this.requestCtx=t}get poller(){return new P1.MessagePoller(this.requestCtx)}list(t,r){let i=new Ge.SvixRequest(Ge.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,A1.ListResponseMessageOutSerializer._fromJsonObject)}create(t,r,i){let n=new Ge.SvixRequest(Ge.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(D1.MessageInSerializer._toJsonObject(r)),n.send(this.requestCtx,Ph.MessageOutSerializer._fromJsonObject)}expungeAllContents(t,r){let i=new Ge.SvixRequest(Ge.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,k1.ExpungeAllContentsOutSerializer._fromJsonObject)}precheck(t,r,i){let n=new Ge.SvixRequest(Ge.HttpMethod.POST,"/api/v1/app/{app_id}/msg/precheck/active");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(E1.MessagePrecheckInSerializer._toJsonObject(r)),n.send(this.requestCtx,T1.MessagePrecheckOutSerializer._fromJsonObject)}get(t,r,i){let n=new Ge.SvixRequest(Ge.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,Ph.MessageOutSerializer._fromJsonObject)}expungeContent(t,r){let i=new Ge.SvixRequest(Ge.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)}};Wt.Message=lc;function j1(e,t,r){return{eventType:e,payload:{},transformationsParams:{rawPayload:t,headers:r?{"content-type":r}:void 0}}}Wt.messageInRaw=j1});var pc=m(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.EmptyResponseSerializer=void 0;Zs.EmptyResponseSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Pr=m(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.MessageStatusSerializer=Tt.MessageStatus=void 0;var I1;(function(e){e[e.Success=0]="Success",e[e.Pending=1]="Pending",e[e.Fail=2]="Fail",e[e.Sending=3]="Sending"})(I1=Tt.MessageStatus||(Tt.MessageStatus={}));Tt.MessageStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Dr=m(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.MessageStatusTextSerializer=Pt.MessageStatusText=void 0;var q1;(function(e){e.Success="success",e.Pending="pending",e.Fail="fail",e.Sending="sending"})(q1=Pt.MessageStatusText||(Pt.MessageStatusText={}));Pt.MessageStatusTextSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Ih=m(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.EndpointMessageOutSerializer=void 0;var Dh=Pr(),jh=Dr();Xs.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:Dh.MessageStatusSerializer._fromJsonObject(e.status),statusText:jh.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:Dh.MessageStatusSerializer._toJsonObject(e.status),statusText:jh.MessageStatusTextSerializer._toJsonObject(e.statusText),tags:e.tags,timestamp:e.timestamp}}}});var $h=m(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.ListResponseEndpointMessageOutSerializer=void 0;var qh=Ih();eo.ListResponseEndpointMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>qh.EndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>qh.EndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var mc=m(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.MessageAttemptTriggerTypeSerializer=Dt.MessageAttemptTriggerType=void 0;var $1;(function(e){e[e.Scheduled=0]="Scheduled",e[e.Manual=1]="Manual"})($1=Dt.MessageAttemptTriggerType||(Dt.MessageAttemptTriggerType={}));Dt.MessageAttemptTriggerTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var fc=m(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.MessageAttemptOutSerializer=void 0;var zh=mc(),Rh=Tr(),Mh=Pr(),Jh=Dr();to.MessageAttemptOutSerializer={_fromJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?Rh.MessageOutSerializer._fromJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:Mh.MessageStatusSerializer._fromJsonObject(e.status),statusText:Jh.MessageStatusTextSerializer._fromJsonObject(e.statusText),timestamp:new Date(e.timestamp),triggerType:zh.MessageAttemptTriggerTypeSerializer._fromJsonObject(e.triggerType),url:e.url}},_toJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?Rh.MessageOutSerializer._toJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:Mh.MessageStatusSerializer._toJsonObject(e.status),statusText:Jh.MessageStatusTextSerializer._toJsonObject(e.statusText),timestamp:e.timestamp,triggerType:zh.MessageAttemptTriggerTypeSerializer._toJsonObject(e.triggerType),url:e.url}}}});var Bh=m(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.ListResponseMessageAttemptOutSerializer=void 0;var Fh=fc();ro.ListResponseMessageAttemptOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Fh.MessageAttemptOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Fh.MessageAttemptOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Nh=m(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.MessageEndpointOutSerializer=void 0;var Hh=Pr(),Lh=Dr();io.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:Hh.MessageStatusSerializer._fromJsonObject(e.status),statusText:Lh.MessageStatusTextSerializer._fromJsonObject(e.statusText),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:Hh.MessageStatusSerializer._toJsonObject(e.status),statusText:Lh.MessageStatusTextSerializer._toJsonObject(e.statusText),uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}});var Uh=m(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.ListResponseMessageEndpointOutSerializer=void 0;var Gh=Nh();no.ListResponseMessageEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Gh.MessageEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Gh.MessageEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Vh=m(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.MessageAttempt=void 0;var z1=pc(),R1=$h(),Wh=Bh(),M1=Uh(),J1=fc(),Ie=K(),hc=class{constructor(t){this.requestCtx=t}listByEndpoint(t,r,i){let n=new Ie.SvixRequest(Ie.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,Wh.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listByMsg(t,r,i){let n=new Ie.SvixRequest(Ie.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,Wh.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listAttemptedMessages(t,r,i){let n=new Ie.SvixRequest(Ie.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,R1.ListResponseEndpointMessageOutSerializer._fromJsonObject)}get(t,r,i){let n=new Ie.SvixRequest(Ie.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,J1.MessageAttemptOutSerializer._fromJsonObject)}expungeContent(t,r,i){let n=new Ie.SvixRequest(Ie.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 Ie.SvixRequest(Ie.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,M1.ListResponseMessageEndpointOutSerializer._fromJsonObject)}resend(t,r,i,n){let s=new Ie.SvixRequest(Ie.HttpMethod.POST,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend");return s.setPathParam("app_id",t),s.setPathParam("msg_id",r),s.setPathParam("endpoint_id",i),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.send(this.requestCtx,z1.EmptyResponseSerializer._fromJsonObject)}};so.MessageAttempt=hc});var gc=m(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.OperationalWebhookEndpointOutSerializer=void 0;oo.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 Yh=m(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.ListResponseOperationalWebhookEndpointOutSerializer=void 0;var Kh=gc();ao.ListResponseOperationalWebhookEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Kh.OperationalWebhookEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Kh.OperationalWebhookEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Qh=m(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.OperationalWebhookEndpointHeadersInSerializer=void 0;uo.OperationalWebhookEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var Zh=m(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.OperationalWebhookEndpointHeadersOutSerializer=void 0;co.OperationalWebhookEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var Xh=m(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.OperationalWebhookEndpointInSerializer=void 0;lo.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 eg=m(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.OperationalWebhookEndpointSecretInSerializer=void 0;po.OperationalWebhookEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var tg=m(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.OperationalWebhookEndpointSecretOutSerializer=void 0;mo.OperationalWebhookEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var rg=m(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.OperationalWebhookEndpointUpdateSerializer=void 0;fo.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 _c=m(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.OperationalWebhookEndpoint=void 0;var F1=Yh(),B1=Qh(),H1=Zh(),L1=Xh(),bc=gc(),N1=eg(),G1=tg(),U1=rg(),ce=K(),vc=class{constructor(t){this.requestCtx=t}list(t){let r=new ce.SvixRequest(ce.HttpMethod.GET,"/api/v1/operational-webhook/endpoint");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,F1.ListResponseOperationalWebhookEndpointOutSerializer._fromJsonObject)}create(t,r){let i=new ce.SvixRequest(ce.HttpMethod.POST,"/api/v1/operational-webhook/endpoint");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(L1.OperationalWebhookEndpointInSerializer._toJsonObject(t)),i.send(this.requestCtx,bc.OperationalWebhookEndpointOutSerializer._fromJsonObject)}get(t){let r=new ce.SvixRequest(ce.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,bc.OperationalWebhookEndpointOutSerializer._fromJsonObject)}update(t,r){let i=new ce.SvixRequest(ce.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return i.setPathParam("endpoint_id",t),i.setBody(U1.OperationalWebhookEndpointUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,bc.OperationalWebhookEndpointOutSerializer._fromJsonObject)}delete(t){let r=new ce.SvixRequest(ce.HttpMethod.DELETE,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return r.setPathParam("endpoint_id",t),r.sendNoResponseBody(this.requestCtx)}getHeaders(t){let r=new ce.SvixRequest(ce.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,H1.OperationalWebhookEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r){let i=new ce.SvixRequest(ce.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return i.setPathParam("endpoint_id",t),i.setBody(B1.OperationalWebhookEndpointHeadersInSerializer._toJsonObject(r)),i.sendNoResponseBody(this.requestCtx)}getSecret(t){let r=new ce.SvixRequest(ce.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,G1.OperationalWebhookEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i){let n=new ce.SvixRequest(ce.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(N1.OperationalWebhookEndpointSecretInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}};ho.OperationalWebhookEndpoint=vc});var ig=m(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.OperationalWebhook=void 0;var W1=_c(),yc=class{constructor(t){this.requestCtx=t}get endpoint(){return new W1.OperationalWebhookEndpoint(this.requestCtx)}};go.OperationalWebhook=yc});var og=m(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.AggregateEventTypesOutSerializer=void 0;var ng=dt(),sg=pt();bo.AggregateEventTypesOutSerializer={_fromJsonObject(e){return{id:e.id,status:ng.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:sg.BackgroundTaskTypeSerializer._fromJsonObject(e.task)}},_toJsonObject(e){return{id:e.id,status:ng.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:sg.BackgroundTaskTypeSerializer._toJsonObject(e.task)}}}});var ag=m(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.AppUsageStatsInSerializer=void 0;vo.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 lg=m(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.AppUsageStatsOutSerializer=void 0;var ug=dt(),cg=pt();_o.AppUsageStatsOutSerializer={_fromJsonObject(e){return{id:e.id,status:ug.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:cg.BackgroundTaskTypeSerializer._fromJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds}},_toJsonObject(e){return{id:e.id,status:ug.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:cg.BackgroundTaskTypeSerializer._toJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds}}}});var dg=m(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.Statistics=void 0;var V1=og(),K1=ag(),Y1=lg(),yo=K(),Oc=class{constructor(t){this.requestCtx=t}aggregateAppStats(t,r){let i=new yo.SvixRequest(yo.HttpMethod.POST,"/api/v1/stats/usage/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(K1.AppUsageStatsInSerializer._toJsonObject(t)),i.send(this.requestCtx,Y1.AppUsageStatsOutSerializer._fromJsonObject)}aggregateEventTypes(){return new yo.SvixRequest(yo.HttpMethod.PUT,"/api/v1/stats/usage/event-types").send(this.requestCtx,V1.AggregateEventTypesOutSerializer._fromJsonObject)}};Oo.Statistics=Oc});var pg=m(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.HttpSinkHeadersPatchInSerializer=void 0;Co.HttpSinkHeadersPatchInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var mg=m(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.SinkTransformationOutSerializer=void 0;So.SinkTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var Cc=m(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.StreamEventTypeOutSerializer=void 0;xo.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 hg=m(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.ListResponseStreamEventTypeOutSerializer=void 0;var fg=Cc();wo.ListResponseStreamEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>fg.StreamEventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>fg.StreamEventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var gg=m(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.StreamEventTypeInSerializer=void 0;ko.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 bg=m(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.StreamEventTypePatchSerializer=void 0;Ao.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 _g=m(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.StreamingEventType=void 0;var Q1=hg(),vg=gg(),Eo=Cc(),Z1=bg(),Ue=K(),Sc=class{constructor(t){this.requestCtx=t}list(t){let r=new Ue.SvixRequest(Ue.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,Q1.ListResponseStreamEventTypeOutSerializer._fromJsonObject)}create(t,r){let i=new Ue.SvixRequest(Ue.HttpMethod.POST,"/api/v1/stream/event-type");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(vg.StreamEventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,Eo.StreamEventTypeOutSerializer._fromJsonObject)}get(t){let r=new Ue.SvixRequest(Ue.HttpMethod.GET,"/api/v1/stream/event-type/{name}");return r.setPathParam("name",t),r.send(this.requestCtx,Eo.StreamEventTypeOutSerializer._fromJsonObject)}update(t,r){let i=new Ue.SvixRequest(Ue.HttpMethod.PUT,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setBody(vg.StreamEventTypeInSerializer._toJsonObject(r)),i.send(this.requestCtx,Eo.StreamEventTypeOutSerializer._fromJsonObject)}delete(t,r){let i=new Ue.SvixRequest(Ue.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 Ue.SvixRequest(Ue.HttpMethod.PATCH,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setBody(Z1.StreamEventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Eo.StreamEventTypeOutSerializer._fromJsonObject)}};To.StreamingEventType=Sc});var yg=m(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.EventInSerializer=void 0;Po.EventInSerializer={_fromJsonObject(e){return{eventType:e.eventType,payload:e.payload}},_toJsonObject(e){return{eventType:e.eventType,payload:e.payload}}}});var xc=m(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.StreamInSerializer=void 0;Do.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 Sg=m(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.CreateStreamEventsInSerializer=void 0;var Og=yg(),Cg=xc();jo.CreateStreamEventsInSerializer={_fromJsonObject(e){return{events:e.events.map(t=>Og.EventInSerializer._fromJsonObject(t)),stream:e.stream!=null?Cg.StreamInSerializer._fromJsonObject(e.stream):void 0}},_toJsonObject(e){return{events:e.events.map(t=>Og.EventInSerializer._toJsonObject(t)),stream:e.stream!=null?Cg.StreamInSerializer._toJsonObject(e.stream):void 0}}}});var xg=m(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.CreateStreamEventsOutSerializer=void 0;Io.CreateStreamEventsOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var wg=m(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.EventOutSerializer=void 0;qo.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 Ag=m($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.EventStreamOutSerializer=void 0;var kg=wg();$o.EventStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>kg.EventOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>kg.EventOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var Eg=m(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.StreamingEvents=void 0;var X1=Sg(),eO=xg(),tO=Ag(),zo=K(),wc=class{constructor(t){this.requestCtx=t}create(t,r,i){let n=new zo.SvixRequest(zo.HttpMethod.POST,"/api/v1/stream/{stream_id}/events");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(X1.CreateStreamEventsInSerializer._toJsonObject(r)),n.send(this.requestCtx,eO.CreateStreamEventsOutSerializer._fromJsonObject)}get(t,r,i){let n=new zo.SvixRequest(zo.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,tO.EventStreamOutSerializer._fromJsonObject)}};Ro.StreamingEvents=wc});var kc=m(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.AzureBlobStorageConfigSerializer=void 0;Mo.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 Ac=m(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.GoogleCloudStorageConfigSerializer=void 0;Jo.GoogleCloudStorageConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var Ec=m(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.S3ConfigSerializer=void 0;Fo.S3ConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,region:e.region,secretAccessKey:e.secretAccessKey}}}});var Tc=m(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.SinkHttpConfigSerializer=void 0;Bo.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 Pc=m(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.SinkOtelV1ConfigSerializer=void 0;Ho.SinkOtelV1ConfigSerializer={_fromJsonObject(e){return{headers:e.headers,url:e.url}},_toJsonObject(e){return{headers:e.headers,url:e.url}}}});var Dc=m(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.SinkStatusSerializer=jt.SinkStatus=void 0;var rO;(function(e){e.Enabled="enabled",e.Paused="paused",e.Disabled="disabled",e.Retrying="retrying"})(rO=jt.SinkStatus||(jt.SinkStatus={}));jt.SinkStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var jc=m(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.StreamSinkOutSerializer=void 0;var Tg=kc(),Pg=Ac(),Dg=Ec(),jg=Tc(),Ig=Pc(),qg=Dc();Lo.StreamSinkOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return Tg.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return Ig.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return jg.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Dg.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return Pg.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:qg.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=Tg.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=Ig.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=jg.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Dg.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=Pg.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:qg.SinkStatusSerializer._toJsonObject(e.status),uid:e.uid,updatedAt:e.updatedAt}}}});var zg=m(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.ListResponseStreamSinkOutSerializer=void 0;var $g=jc();No.ListResponseStreamSinkOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>$g.StreamSinkOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>$g.StreamSinkOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Rg=m(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.SinkSecretOutSerializer=void 0;Go.SinkSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Mg=m(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.SinkTransformInSerializer=void 0;Uo.SinkTransformInSerializer={_fromJsonObject(e){return{code:e.code}},_toJsonObject(e){return{code:e.code}}}});var Wo=m(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.SinkStatusInSerializer=It.SinkStatusIn=void 0;var iO;(function(e){e.Enabled="enabled",e.Disabled="disabled"})(iO=It.SinkStatusIn||(It.SinkStatusIn={}));It.SinkStatusInSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Gg=m(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.StreamSinkInSerializer=void 0;var Jg=kc(),Fg=Ac(),Bg=Ec(),Hg=Tc(),Lg=Pc(),Ng=Wo();Vo.StreamSinkInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return Jg.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return Lg.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return Hg.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Bg.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return Fg.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?Ng.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=Jg.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=Lg.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=Hg.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Bg.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=Fg.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?Ng.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var Ug=m(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.AmazonS3PatchConfigSerializer=void 0;Ko.AmazonS3PatchConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,region:e.region,secretAccessKey:e.secretAccessKey}}}});var Wg=m(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.AzureBlobStoragePatchConfigSerializer=void 0;Yo.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 Vg=m(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.GoogleCloudStoragePatchConfigSerializer=void 0;Qo.GoogleCloudStoragePatchConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var Kg=m(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.HttpPatchConfigSerializer=void 0;Zo.HttpPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var Yg=m(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.OtelTracingPatchConfigSerializer=void 0;Xo.OtelTracingPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var ib=m(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.StreamSinkPatchSerializer=void 0;var Qg=Ug(),Zg=Wg(),Xg=Vg(),eb=Kg(),tb=Yg(),rb=Wo();ea.StreamSinkPatchSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return Zg.AzureBlobStoragePatchConfigSerializer._fromJsonObject(e.config);case"otelTracing":return tb.OtelTracingPatchConfigSerializer._fromJsonObject(e.config);case"http":return eb.HttpPatchConfigSerializer._fromJsonObject(e.config);case"amazonS3":return Qg.AmazonS3PatchConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return Xg.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?rb.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=Zg.AzureBlobStoragePatchConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=tb.OtelTracingPatchConfigSerializer._toJsonObject(e.config);break;case"http":t=eb.HttpPatchConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=Qg.AmazonS3PatchConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=Xg.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?rb.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var ob=m(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.StreamingSink=void 0;var nb=pc(),nO=Uu(),sO=zg(),oO=Rg(),aO=Mg(),sb=Gg(),ta=jc(),uO=ib(),le=K(),Ic=class{constructor(t){this.requestCtx=t}list(t,r){let i=new le.SvixRequest(le.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,sO.ListResponseStreamSinkOutSerializer._fromJsonObject)}create(t,r,i){let n=new le.SvixRequest(le.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(sb.StreamSinkInSerializer._toJsonObject(r)),n.send(this.requestCtx,ta.StreamSinkOutSerializer._fromJsonObject)}get(t,r){let i=new le.SvixRequest(le.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,ta.StreamSinkOutSerializer._fromJsonObject)}update(t,r,i){let n=new le.SvixRequest(le.HttpMethod.PUT,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(sb.StreamSinkInSerializer._toJsonObject(i)),n.send(this.requestCtx,ta.StreamSinkOutSerializer._fromJsonObject)}delete(t,r){let i=new le.SvixRequest(le.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 le.SvixRequest(le.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(uO.StreamSinkPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,ta.StreamSinkOutSerializer._fromJsonObject)}getSecret(t,r){let i=new le.SvixRequest(le.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,oO.SinkSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let s=new le.SvixRequest(le.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate");return s.setPathParam("stream_id",t),s.setPathParam("sink_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(nO.EndpointSecretRotateInSerializer._toJsonObject(i)),s.send(this.requestCtx,nb.EmptyResponseSerializer._fromJsonObject)}transformationPartialUpdate(t,r,i){let n=new le.SvixRequest(le.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(aO.SinkTransformInSerializer._toJsonObject(i)),n.send(this.requestCtx,nb.EmptyResponseSerializer._fromJsonObject)}};ra.StreamingSink=Ic});var qc=m(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.StreamOutSerializer=void 0;ia.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 ub=m(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.ListResponseStreamOutSerializer=void 0;var ab=qc();na.ListResponseStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>ab.StreamOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>ab.StreamOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var cb=m(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.StreamPatchSerializer=void 0;sa.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 db=m(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.StreamingStream=void 0;var cO=ub(),lb=xc(),oa=qc(),lO=cb(),We=K(),$c=class{constructor(t){this.requestCtx=t}list(t){let r=new We.SvixRequest(We.HttpMethod.GET,"/api/v1/stream");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,cO.ListResponseStreamOutSerializer._fromJsonObject)}create(t,r){let i=new We.SvixRequest(We.HttpMethod.POST,"/api/v1/stream");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(lb.StreamInSerializer._toJsonObject(t)),i.send(this.requestCtx,oa.StreamOutSerializer._fromJsonObject)}get(t){let r=new We.SvixRequest(We.HttpMethod.GET,"/api/v1/stream/{stream_id}");return r.setPathParam("stream_id",t),r.send(this.requestCtx,oa.StreamOutSerializer._fromJsonObject)}update(t,r){let i=new We.SvixRequest(We.HttpMethod.PUT,"/api/v1/stream/{stream_id}");return i.setPathParam("stream_id",t),i.setBody(lb.StreamInSerializer._toJsonObject(r)),i.send(this.requestCtx,oa.StreamOutSerializer._fromJsonObject)}delete(t){let r=new We.SvixRequest(We.HttpMethod.DELETE,"/api/v1/stream/{stream_id}");return r.setPathParam("stream_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new We.SvixRequest(We.HttpMethod.PATCH,"/api/v1/stream/{stream_id}");return i.setPathParam("stream_id",t),i.setBody(lO.StreamPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,oa.StreamOutSerializer._fromJsonObject)}};aa.StreamingStream=$c});var mb=m(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.Streaming=void 0;var pb=Nu(),dO=pg(),pO=mg(),mO=_g(),fO=Eg(),hO=ob(),gO=db(),Vt=K(),zc=class{constructor(t){this.requestCtx=t}get event_type(){return new mO.StreamingEventType(this.requestCtx)}get events(){return new fO.StreamingEvents(this.requestCtx)}get sink(){return new hO.StreamingSink(this.requestCtx)}get stream(){return new gO.StreamingStream(this.requestCtx)}sinkHeadersGet(t,r){let i=new Vt.SvixRequest(Vt.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,pb.EndpointHeadersOutSerializer._fromJsonObject)}sinkHeadersPatch(t,r,i){let n=new Vt.SvixRequest(Vt.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(dO.HttpSinkHeadersPatchInSerializer._toJsonObject(i)),n.send(this.requestCtx,pb.EndpointHeadersOutSerializer._fromJsonObject)}sinkTransformationGet(t,r){let i=new Vt.SvixRequest(Vt.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,pO.SinkTransformationOutSerializer._fromJsonObject)}};ua.Streaming=zc});var fb=m(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.HTTPValidationError=mt.ValidationError=mt.HttpErrorOut=void 0;var Kt=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};mt.HttpErrorOut=Kt;Kt.discriminator=void 0;Kt.mapping=void 0;Kt.attributeTypeMap=[{name:"code",baseName:"code",type:"string",format:""},{name:"detail",baseName:"detail",type:"string",format:""}];var Yt=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};mt.ValidationError=Yt;Yt.discriminator=void 0;Yt.mapping=void 0;Yt.attributeTypeMap=[{name:"loc",baseName:"loc",type:"Array<string>",format:""},{name:"msg",baseName:"msg",type:"string",format:""},{name:"type",baseName:"type",type:"string",format:""}];var Qt=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};mt.HTTPValidationError=Qt;Qt.discriminator=void 0;Qt.mapping=void 0;Qt.attributeTypeMap=[{name:"detail",baseName:"detail",type:"Array<ValidationError>",format:""}]});var gb=m(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.timingSafeEqual=void 0;function hb(e,t=""){if(!e)throw new Error(t)}function bO(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)),hb(e instanceof DataView),hb(t instanceof DataView);let r=e.byteLength,i=0,n=-1;for(;++n<r;)i|=e.getUint8(n)^t.getUint8(n);return i===0}ca.timingSafeEqual=bO});var _b=m(Je=>{"use strict";var vO=Je&&Je.__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 s in n)n.hasOwnProperty(s)&&(i[s]=n[s])},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(Je,"__esModule",{value:!0});var X=256,Rc=(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 s=t.length-i;if(s>0){var n=t[i]<<16|(s===2?t[i+1]<<8:0);r+=this._encodeByte(n>>>18&63),r+=this._encodeByte(n>>>12&63),s===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)),s=0,o=0,a=0,u=0,c=0,d=0,l=0;o<i-4;o+=4)u=this._decodeChar(t.charCodeAt(o+0)),c=this._decodeChar(t.charCodeAt(o+1)),d=this._decodeChar(t.charCodeAt(o+2)),l=this._decodeChar(t.charCodeAt(o+3)),n[s++]=u<<2|c>>>4,n[s++]=c<<4|d>>>2,n[s++]=d<<6|l,a|=u&X,a|=c&X,a|=d&X,a|=l&X;if(o<i-1&&(u=this._decodeChar(t.charCodeAt(o)),c=this._decodeChar(t.charCodeAt(o+1)),n[s++]=u<<2|c>>>4,a|=u&X,a|=c&X),o<i-2&&(d=this._decodeChar(t.charCodeAt(o+2)),n[s++]=c<<4|d>>>2,a|=d&X),o<i-3&&(l=this._decodeChar(t.charCodeAt(o+3)),n[s++]=d<<6|l,a|=l&X),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=X;return r+=(42-t&t-44)>>>8&-X+t-43+62,r+=(46-t&t-48)>>>8&-X+t-47+63,r+=(47-t&t-58)>>>8&-X+t-48+52,r+=(64-t&t-91)>>>8&-X+t-65+0,r+=(96-t&t-123)>>>8&-X+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})();Je.Coder=Rc;var jr=new Rc;function _O(e){return jr.encode(e)}Je.encode=_O;function yO(e){return jr.decode(e)}Je.decode=yO;var bb=(function(e){vO(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=X;return i+=(44-r&r-46)>>>8&-X+r-45+62,i+=(94-r&r-96)>>>8&-X+r-95+63,i+=(47-r&r-58)>>>8&-X+r-48+52,i+=(64-r&r-91)>>>8&-X+r-65+0,i+=(96-r&r-123)>>>8&-X+r-97+26,i},t})(Rc);Je.URLSafeCoder=bb;var vb=new bb;function OO(e){return vb.encode(e)}Je.encodeURLSafe=OO;function CO(e){return vb.decode(e)}Je.decodeURLSafe=CO;Je.encodedLength=function(e){return jr.encodedLength(e)};Je.maxDecodedLength=function(e){return jr.maxDecodedLength(e)};Je.decodedLength=function(e){return jr.decodedLength(e)}});var Ob=m((yb,la)=>{(function(e,t){var r={};t(r);var i=r.default;for(var n in r)i[n]=r[n];typeof la=="object"&&typeof la.exports=="object"?la.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(yb,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(l,p,y,h,b){for(var C,S,O,k,T,E,P,x,A,F,ue,me,Fr;b>=64;){for(C=p[0],S=p[1],O=p[2],k=p[3],T=p[4],E=p[5],P=p[6],x=p[7],F=0;F<16;F++)ue=h+F*4,l[F]=(y[ue]&255)<<24|(y[ue+1]&255)<<16|(y[ue+2]&255)<<8|y[ue+3]&255;for(F=16;F<64;F++)A=l[F-2],me=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,A=l[F-15],Fr=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,l[F]=(me+l[F-7]|0)+(Fr+l[F-16]|0);for(F=0;F<64;F++)me=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&E^~T&P)|0)+(x+(t[F]+l[F]|0)|0)|0,Fr=((C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10))+(C&S^C&O^S&O)|0,x=P,P=E,E=T,T=k+me|0,k=O,O=S,S=C,C=me+Fr|0;p[0]+=C,p[1]+=S,p[2]+=O,p[3]+=k,p[4]+=T,p[5]+=E,p[6]+=P,p[7]+=x,h+=64,b-=64}return h}var i=(function(){function l(){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 l.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},l.prototype.clean=function(){for(var p=0;p<this.buffer.length;p++)this.buffer[p]=0;for(var p=0;p<this.temp.length;p++)this.temp[p]=0;this.reset()},l.prototype.update=function(p,y){if(y===void 0&&(y=p.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var h=0;if(this.bytesHashed+=y,this.bufferLength>0){for(;this.bufferLength<64&&y>0;)this.buffer[this.bufferLength++]=p[h++],y--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(y>=64&&(h=r(this.temp,this.state,p,h,y),y%=64);y>0;)this.buffer[this.bufferLength++]=p[h++],y--;return this},l.prototype.finish=function(p){if(!this.finished){var y=this.bytesHashed,h=this.bufferLength,b=y/536870912|0,C=y<<3,S=y%64<56?64:128;this.buffer[h]=128;for(var O=h+1;O<S-8;O++)this.buffer[O]=0;this.buffer[S-8]=b>>>24&255,this.buffer[S-7]=b>>>16&255,this.buffer[S-6]=b>>>8&255,this.buffer[S-5]=b>>>0&255,this.buffer[S-4]=C>>>24&255,this.buffer[S-3]=C>>>16&255,this.buffer[S-2]=C>>>8&255,this.buffer[S-1]=C>>>0&255,r(this.temp,this.state,this.buffer,0,S),this.finished=!0}for(var O=0;O<8;O++)p[O*4+0]=this.state[O]>>>24&255,p[O*4+1]=this.state[O]>>>16&255,p[O*4+2]=this.state[O]>>>8&255,p[O*4+3]=this.state[O]>>>0&255;return this},l.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},l.prototype._saveState=function(p){for(var y=0;y<this.state.length;y++)p[y]=this.state[y]},l.prototype._restoreState=function(p,y){for(var h=0;h<this.state.length;h++)this.state[h]=p[h];this.bytesHashed=y,this.finished=!1,this.bufferLength=0},l})();e.Hash=i;var n=(function(){function l(p){this.inner=new i,this.outer=new i,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var y=new Uint8Array(this.blockSize);if(p.length>this.blockSize)new i().update(p).finish(y).clean();else for(var h=0;h<p.length;h++)y[h]=p[h];for(var h=0;h<y.length;h++)y[h]^=54;this.inner.update(y);for(var h=0;h<y.length;h++)y[h]^=106;this.outer.update(y),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var h=0;h<y.length;h++)y[h]=0}return l.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},l.prototype.clean=function(){for(var p=0;p<this.istate.length;p++)this.ostate[p]=this.istate[p]=0;this.inner.clean(),this.outer.clean()},l.prototype.update=function(p){return this.inner.update(p),this},l.prototype.finish=function(p){return this.outer.finished?this.outer.finish(p):(this.inner.finish(p),this.outer.update(p,this.digestLength).finish(p)),this},l.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},l})();e.HMAC=n;function s(l){var p=new i().update(l),y=p.digest();return p.clean(),y}e.hash=s,e.default=s;function o(l,p){var y=new n(l).update(p),h=y.digest();return y.clean(),h}e.hmac=o;function a(l,p,y,h){var b=h[0];if(b===0)throw new Error("hkdf: cannot expand more");p.reset(),b>1&&p.update(l),y&&p.update(y),p.update(h),p.finish(l),h[0]++}var u=new Uint8Array(e.digestLength);function c(l,p,y,h){p===void 0&&(p=u),h===void 0&&(h=32);for(var b=new Uint8Array([1]),C=o(p,l),S=new n(C),O=new Uint8Array(S.digestLength),k=O.length,T=new Uint8Array(h),E=0;E<h;E++)k===O.length&&(a(O,S,y,b),k=0),T[E]=O[k++];return S.clean(),O.fill(0),b.fill(0),T}e.hkdf=c;function d(l,p,y,h){for(var b=new n(l),C=b.digestLength,S=new Uint8Array(4),O=new Uint8Array(C),k=new Uint8Array(C),T=new Uint8Array(h),E=0;E*C<h;E++){var P=E+1;S[0]=P>>>24&255,S[1]=P>>>16&255,S[2]=P>>>8&255,S[3]=P>>>0&255,b.reset(),b.update(p),b.update(S),b.finish(k);for(var x=0;x<C;x++)O[x]=k[x];for(var x=2;x<=y;x++){b.reset(),b.update(k).finish(k);for(var A=0;A<C;A++)O[A]^=k[A]}for(var x=0;x<C&&E*C+x<h;x++)T[E*C+x]=O[x]}for(var E=0;E<C;E++)O[E]=k[E]=0;for(var E=0;E<4;E++)S[E]=0;return b.clean(),T}e.pbkdf2=d})});var Jc=m(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.Webhook=Zt.WebhookVerificationError=void 0;var SO=gb(),Cb=_b(),xO=Ob(),Sb=300,Mc=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},ft=class e extends Mc{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};Zt.WebhookVerificationError=ft;var da=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=Cb.decode(t)}}verify(t,r){let i={};for(let p of Object.keys(r))i[p.toLowerCase()]=r[p];let n=i["webhook-id"],s=i["webhook-signature"],o=i["webhook-timestamp"];if(!s||!n||!o)throw new ft("Missing required headers");let a=this.verifyTimestamp(o),c=this.sign(n,a,t).split(",")[1],d=s.split(" "),l=new globalThis.TextEncoder;for(let p of d){let[y,h]=p.split(",");if(y==="v1"&&(0,SO.timingSafeEqual)(l.encode(h),l.encode(c)))return JSON.parse(t.toString())}throw new ft("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,s=Math.floor(r.getTime()/1e3),o=n.encode(`${t}.${s}.${i}`);return`v1,${Cb.encode(xO.hmac(this.key,o))}`}verifyTimestamp(t){let r=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(isNaN(i))throw new ft("Invalid Signature Headers");if(r-i>Sb)throw new ft("Message timestamp too old");if(i>r+Sb)throw new ft("Message timestamp too new");return new Date(i*1e3)}};Zt.Webhook=da;da.prefix="whsec_"});var xb=m(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.Webhook=Xt.WebhookVerificationError=void 0;var wO=Jc(),kO=Jc();Object.defineProperty(Xt,"WebhookVerificationError",{enumerable:!0,get:function(){return kO.WebhookVerificationError}});var Fc=class{constructor(t,r){this.inner=new wO.Webhook(t,r)}verify(t,r){var i,n,s,o,a,u;let c={};for(let d of Object.keys(r))c[d.toLowerCase()]=r[d];return c["webhook-id"]=(n=(i=c["svix-id"])!==null&&i!==void 0?i:c["webhook-id"])!==null&&n!==void 0?n:"",c["webhook-signature"]=(o=(s=c["svix-signature"])!==null&&s!==void 0?s:c["webhook-signature"])!==null&&o!==void 0?o:"",c["webhook-timestamp"]=(u=(a=c["svix-timestamp"])!==null&&a!==void 0?a:c["webhook-timestamp"])!==null&&u!==void 0?u:"",this.inner.verify(t,c)}sign(t,r,i){return this.inner.sign(t,r,i)}};Xt.Webhook=Fc});var wb=m(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.EndpointDisabledTriggerSerializer=qt.EndpointDisabledTrigger=void 0;var AO;(function(e){e.Manual="manual",e.Automatic="automatic"})(AO=qt.EndpointDisabledTrigger||(qt.EndpointDisabledTrigger={}));qt.EndpointDisabledTriggerSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var kb=m($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.OrderingSerializer=$t.Ordering=void 0;var EO;(function(e){e.Ascending="ascending",e.Descending="descending"})(EO=$t.Ordering||($t.Ordering={}));$t.OrderingSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Ab=m(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.StatusCodeClassSerializer=zt.StatusCodeClass=void 0;var TO;(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"})(TO=zt.StatusCodeClass||(zt.StatusCodeClass={}));zt.StatusCodeClassSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Eb=m(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.StatusCodeClass=H.SinkStatusIn=H.SinkStatus=H.Ordering=H.MessageStatusText=H.MessageStatus=H.MessageAttemptTriggerType=H.EndpointDisabledTrigger=H.ConnectorProduct=H.ConnectorKind=H.BackgroundTaskType=H.BackgroundTaskStatus=H.AppPortalCapability=void 0;var PO=Ru();Object.defineProperty(H,"AppPortalCapability",{enumerable:!0,get:function(){return PO.AppPortalCapability}});var DO=dt();Object.defineProperty(H,"BackgroundTaskStatus",{enumerable:!0,get:function(){return DO.BackgroundTaskStatus}});var jO=pt();Object.defineProperty(H,"BackgroundTaskType",{enumerable:!0,get:function(){return jO.BackgroundTaskType}});var IO=Gt();Object.defineProperty(H,"ConnectorKind",{enumerable:!0,get:function(){return IO.ConnectorKind}});var qO=zi();Object.defineProperty(H,"ConnectorProduct",{enumerable:!0,get:function(){return qO.ConnectorProduct}});var $O=wb();Object.defineProperty(H,"EndpointDisabledTrigger",{enumerable:!0,get:function(){return $O.EndpointDisabledTrigger}});var zO=mc();Object.defineProperty(H,"MessageAttemptTriggerType",{enumerable:!0,get:function(){return zO.MessageAttemptTriggerType}});var RO=Pr();Object.defineProperty(H,"MessageStatus",{enumerable:!0,get:function(){return RO.MessageStatus}});var MO=Dr();Object.defineProperty(H,"MessageStatusText",{enumerable:!0,get:function(){return MO.MessageStatusText}});var JO=kb();Object.defineProperty(H,"Ordering",{enumerable:!0,get:function(){return JO.Ordering}});var FO=Dc();Object.defineProperty(H,"SinkStatus",{enumerable:!0,get:function(){return FO.SinkStatus}});var BO=Wo();Object.defineProperty(H,"SinkStatusIn",{enumerable:!0,get:function(){return BO.SinkStatusIn}});var HO=Ab();Object.defineProperty(H,"StatusCodeClass",{enumerable:!0,get:function(){return HO.StatusCodeClass}})});var Pb=m(ee=>{"use strict";var LO=ee&&ee.__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]})),Tb=ee&&ee.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&LO(t,e,r)};Object.defineProperty(ee,"__esModule",{value:!0});ee.Svix=ee.messageInRaw=ee.ValidationError=ee.HttpErrorOut=ee.HTTPValidationError=ee.ApiException=void 0;var NO=Zd(),GO=cp(),UO=fp(),WO=wp(),VO=Wp(),KO=em(),YO=dm(),QO=mm(),ZO=oh(),XO=mh(),eC=dc(),tC=Vh(),rC=ig(),iC=dg(),nC=mb(),sC=_c(),oC=Su();Object.defineProperty(ee,"ApiException",{enumerable:!0,get:function(){return oC.ApiException}});var Hc=fb();Object.defineProperty(ee,"HTTPValidationError",{enumerable:!0,get:function(){return Hc.HTTPValidationError}});Object.defineProperty(ee,"HttpErrorOut",{enumerable:!0,get:function(){return Hc.HttpErrorOut}});Object.defineProperty(ee,"ValidationError",{enumerable:!0,get:function(){return Hc.ValidationError}});Tb(xb(),ee);Tb(Eb(),ee);var aC=dc();Object.defineProperty(ee,"messageInRaw",{enumerable:!0,get:function(){return aC.messageInRaw}});var uC=[{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"}],Bc=class{constructor(t,r={}){var i,n,s;let o=(i=uC.find(u=>u.region===t.split(".")[1]))===null||i===void 0?void 0:i.url,a=(s=(n=r.serverUrl)!==null&&n!==void 0?n:o)!==null&&s!==void 0?s:"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 NO.Application(this.requestCtx)}get authentication(){return new GO.Authentication(this.requestCtx)}get backgroundTask(){return new UO.BackgroundTask(this.requestCtx)}get connector(){return new WO.Connector(this.requestCtx)}get endpoint(){return new VO.Endpoint(this.requestCtx)}get environment(){return new KO.Environment(this.requestCtx)}get eventType(){return new YO.EventType(this.requestCtx)}get health(){return new QO.Health(this.requestCtx)}get ingest(){return new ZO.Ingest(this.requestCtx)}get integration(){return new XO.Integration(this.requestCtx)}get message(){return new eC.Message(this.requestCtx)}get messageAttempt(){return new tC.MessageAttempt(this.requestCtx)}get operationalWebhook(){return new rC.OperationalWebhook(this.requestCtx)}get statistics(){return new iC.Statistics(this.requestCtx)}get streaming(){return new nC.Streaming(this.requestCtx)}get operationalWebhookEndpoint(){return new sC.OperationalWebhookEndpoint(this.requestCtx)}};ee.Svix=Bc});var Nc={};Ht(Nc,{FileBackend:()=>Lc});var Lc,Gc=z(()=>{"use strict";Ce();Lc=class{name="plaintext file";isSecure=!1;async get(t,r){let i=he();return i?i.profiles[r]?.api_key??null:null}async set(t,r,i){Uc(i,r)}async delete(t,r){try{return Wc(r),!0}catch{return!1}}async isAvailable(){return!0}}});var Fb={};Ht(Fb,{MacOSBackend:()=>Kc});function Vc(e,t){return new Promise(r=>{(0,Jb.execFile)(e,t,{timeout:5e3},(i,n,s)=>{let o=i&&"code"in i?i.code:0;r({stdout:n??"",stderr:s??"",code:o})})})}var Jb,Kc,Bb=z(()=>{"use strict";Jb=require("node:child_process");Kc=class{name="macOS Keychain";isSecure=!0;async get(t,r){let{stdout:i,stderr:n,code:s}=await Vc("/usr/bin/security",["find-generic-password","-s",t,"-a",r,"-w"]);if(s===44)return null;if(s!==0)throw new Error(`Failed to read from macOS Keychain (exit code ${s}): ${n.trim()}`);return i.trim()||null}async set(t,r,i){let{code:n,stderr:s}=await Vc("/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: ${s.trim()}`)}async delete(t,r){let{code:i}=await Vc("/usr/bin/security",["delete-generic-password","-s",t,"-a",r]);return i===0}async isAvailable(){return process.platform==="darwin"}}});var Hb={};Ht(Hb,{LinuxBackend:()=>Yc});function ma(e,t,r){return new Promise(i=>{(0,fa.execFile)(e,t,{timeout:r?.timeout??5e3},(n,s,o)=>{let a=n&&"code"in n?n.code:0;i({stdout:s??"",stderr:o??"",code:a})})})}function jC(e,t,r){return new Promise(i=>{let n=(0,fa.spawn)(e,t,{stdio:["pipe","ignore","pipe"],timeout:5e3}),s="";n.stderr?.on("data",o=>{s+=o.toString()}),n.on("close",o=>{i({code:o,stderr:s})}),n.on("error",()=>{i({code:1,stderr:"Failed to spawn process"})}),n.stdin?.on("error",()=>{}),n.stdin?.write(r),n.stdin?.end()})}var fa,Yc,Lb=z(()=>{"use strict";fa=require("node:child_process");Yc=class{name="Secret Service (libsecret)";isSecure=!0;async get(t,r){let{stdout:i,code:n}=await ma("secret-tool",["lookup","service",t,"account",r]);return n!==0||!i.trim()?null:i.trim()}async set(t,r,i){let{code:n,stderr:s}=await jC("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: ${s.trim()}`)}async delete(t,r){let{code:i}=await ma("secret-tool",["clear","service",t,"account",r]);return i===0}async isAvailable(){if(process.platform!=="linux"||(await ma("which",["secret-tool"])).code!==0)return!1;let r=await ma("secret-tool",["lookup","service","__resend_cli_probe__"],{timeout:3e3});return r.code===0||r.code===1}}});var Nb={};Ht(Nb,{WindowsBackend:()=>Qc});function ha(e){return new Promise(t=>{(0,ga.execFile)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{timeout:1e4},(r,i,n)=>{let s=r&&"code"in r?r.code:0;t({stdout:i??"",stderr:n??"",code:s})})})}function IC(e,t){return new Promise(r=>{let i=(0,ga.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{stdio:["pipe","pipe","pipe"],timeout:1e4}),n="",s="";i.stdout?.on("data",o=>{n+=o.toString()}),i.stderr?.on("data",o=>{s+=o.toString()}),i.on("close",o=>{r({stdout:n,stderr:s,code:o})}),i.on("error",()=>{r({stdout:"",stderr:"Failed to spawn process",code:1})}),i.stdin?.on("error",()=>{}),i.stdin?.write(t),i.stdin?.end()})}function ht(e){return e.replace(/'/g,"''")}var ga,Ir,Qc,Gb=z(()=>{"use strict";ga=require("node:child_process");Ir=`
27
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function dp(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,i="127.0.0.1",n="9229",s;return(s=t.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?n=s[3]:i=s[3]):(s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],i=s[3],n=s[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:t})}function xu(){if(ie.env.NO_COLOR||ie.env.FORCE_COLOR==="0"||ie.env.FORCE_COLOR==="false")return!1;if(ie.env.FORCE_COLOR||ie.env.CLICOLOR_FORCE!==void 0)return!0}ku.Command=Ou;ku.useColor=xu});var gp=m(bt=>{var{Argument:mp}=an(),{Command:Eu}=pp(),{CommanderError:E1,InvalidArgumentError:fp}=Oi(),{Help:A1}=bu(),{Option:hp}=wu();bt.program=new Eu;bt.createCommand=e=>new Eu(e);bt.createOption=(e,t)=>new hp(e,t);bt.createArgument=(e,t)=>new mp(e,t);bt.Command=Eu;bt.Option=hp;bt.Argument=mp;bt.Help=A1;bt.CommanderError=E1;bt.InvalidArgumentError=fp;bt.InvalidOptionArgumentError=fp});var vp=m((ct,bp)=>{var At=gp();ct=bp.exports={};ct.program=new At.Command;ct.Argument=At.Argument;ct.Command=At.Command;ct.CommanderError=At.CommanderError;ct.Help=At.Help;ct.InvalidArgumentError=At.InvalidArgumentError;ct.InvalidOptionArgumentError=At.InvalidArgumentError;ct.Option=At.Option;ct.createCommand=e=>new At.Command(e);ct.createOption=(e,t)=>new At.Option(e,t);ct.createArgument=(e,t)=>new At.Argument(e,t)});var Kt=m((wE,Au)=>{var cn=process||{},wp=cn.argv||[],un=cn.env||{},P1=!(un.NO_COLOR||wp.includes("--no-color"))&&(!!un.FORCE_COLOR||wp.includes("--color")||cn.platform==="win32"||(cn.stdout||{}).isTTY&&un.TERM!=="dumb"||!!un.CI),T1=(e,t,r=e)=>i=>{let n=""+i,s=n.indexOf(t,e.length);return~s?e+$1(n,t,r,s)+t:e+n+t},$1=(e,t,r,i)=>{let n="",s=0;do n+=e.substring(s,i)+r,s=i+t.length,i=e.indexOf(t,s);while(~i);return n+e.substring(s)},Cp=(e=P1)=>{let t=e?T1:()=>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")}};Au.exports=Cp();Au.exports.createColors=Cp});var Tu=m((SE,Sp)=>{"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"},q1={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},R1={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}};Sp.exports={cursor:Pu,scroll:q1,erase:R1,beep:"\x07"}});var Wu,Qp=ee(()=>{Wu={name:"resend-cli",version:"1.7.0",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","sync-skill-version":"node scripts/sync-skill-version.mjs",version:"pnpm run sync-skill-version && git add skills/resend-cli/SKILL.md",prepack:"pnpm run sync-skill-version && pnpm build && node scripts/verify-bundle.mjs"},dependencies:{"@clack/prompts":"1.1.0","@commander-js/extra-typings":"14.0.0",commander:"14.0.3",picocolors:"1.1.1",resend:"6.9.4"},pnpm:{onlyBuiltDependencies:["esbuild","@biomejs/biome"]},devDependencies:{"@biomejs/biome":"2.4.8","@types/node":"24.12.0",esbuild:"0.27.4",tsx:"4.21.0",typescript:"5.9.3",vitest:"4.1.1","@yao-pkg/pkg":"6.14.1"}}});var ve,Zp,fr=ee(()=>{"use strict";Qp();ve=Wu.version,Zp=Wu.name});var $n=m(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.ApplicationInSerializer=void 0;Tn.ApplicationInSerializer={_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 tc=m(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.ApplicationOutSerializer=void 0;jn.ApplicationOutSerializer={_fromJsonObject(e){return{createdAt:new Date(e.createdAt),id:e.id,metadata:e.metadata,name:e.name,rateLimit:e.rateLimit,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,uid:e.uid,updatedAt:e.updatedAt}}}});var lm=m(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ApplicationPatchSerializer=void 0;Dn.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 cm=m(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.ListResponseApplicationOutSerializer=void 0;var um=tc();In.ListResponseApplicationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>um.ApplicationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>um.ApplicationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var ic=m(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.ApiException=void 0;var rc=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,s)=>{this.headers[s]=n})}};qn.ApiException=rc});var dm,pm=ee(()=>{dm="ffffffff-ffff-ffff-ffff-ffffffffffff"});var mm,fm=ee(()=>{mm="00000000-0000-0000-0000-000000000000"});var hm,gm=ee(()=>{hm=/^(?:[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 Rw(e){return typeof e=="string"&&hm.test(e)}var Xt,Ri=ee(()=>{gm();Xt=Rw});function Mw(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 er,Mi=ee(()=>{Ri();er=Mw});function Ue(e,t=0){return(Je[e[t+0]]+Je[e[t+1]]+Je[e[t+2]]+Je[e[t+3]]+"-"+Je[e[t+4]]+Je[e[t+5]]+"-"+Je[e[t+6]]+Je[e[t+7]]+"-"+Je[e[t+8]]+Je[e[t+9]]+"-"+Je[e[t+10]]+Je[e[t+11]]+Je[e[t+12]]+Je[e[t+13]]+Je[e[t+14]]+Je[e[t+15]]).toLowerCase()}function zw(e,t=0){let r=Ue(e,t);if(!Xt(r))throw TypeError("Stringified UUID is invalid");return r}var Je,bm,Bt=ee(()=>{Ri();Je=[];for(let e=0;e<256;++e)Je.push((e+256).toString(16).slice(1));bm=zw});function br(){return Rn>Mn.length-16&&(vm.default.randomFillSync(Mn),Rn=0),Mn.slice(Rn,Rn+=16)}var vm,Mn,Rn,zn=ee(()=>{vm=me(require("node:crypto")),Mn=new Uint8Array(256),Rn=Mn.length});function Fw(e,t,r){let i=t&&r||0,n=t||new Array(16);e=e||{};let s=e.node,o=e.clockseq;if(e._v6||(s||(s=nc),o==null&&(o=Fn)),s==null||o==null){let p=e.random||(e.rng||br)();s==null&&(s=[p[0],p[1],p[2],p[3],p[4],p[5]],!nc&&!e._v6&&(s[0]|=1,nc=s)),o==null&&(o=(p[6]<<8|p[7])&16383,Fn===void 0&&!e._v6&&(Fn=o))}let a=e.msecs!==void 0?e.msecs:Date.now(),l=e.nsecs!==void 0?e.nsecs:oc+1,u=a-sc+(l-oc)/1e4;if(u<0&&e.clockseq===void 0&&(o=o+1&16383),(u<0||a>sc)&&e.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");sc=a,oc=l,Fn=o,a+=122192928e5;let c=((a&268435455)*1e4+l)%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++]=o>>>8|128,n[i++]=o&255;for(let p=0;p<6;++p)n[i+p]=s[p];return t||Ue(n)}var nc,Fn,sc,oc,Jn,ac=ee(()=>{zn();Bt();sc=0,oc=0;Jn=Fw});function zi(e){let t=typeof e=="string"?er(e):e,r=Jw(t);return typeof e=="string"?Ue(r):r}function Jw(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 lc=ee(()=>{Mi();Bt()});function Bw(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}function Fi(e,t,r){function i(n,s,o,a){var l;if(typeof n=="string"&&(n=Bw(n)),typeof s=="string"&&(s=er(s)),((l=s)===null||l===void 0?void 0:l.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+n.length);if(u.set(s),u.set(n,s.length),u=r(u),u[6]=u[6]&15|t,u[8]=u[8]&63|128,o){a=a||0;for(let c=0;c<16;++c)o[a+c]=u[c];return o}return Ue(u)}try{i.name=e}catch{}return i.DNS=Hw,i.URL=Lw,i}var Hw,Lw,uc=ee(()=>{Bt();Mi();Hw="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Lw="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function Nw(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),ym.default.createHash("md5").update(e).digest()}var ym,_m,wm=ee(()=>{ym=me(require("node:crypto"));_m=Nw});var Gw,Cm,Sm=ee(()=>{uc();wm();Gw=Fi("v3",48,_m),Cm=Gw});var Om,cc,xm=ee(()=>{Om=me(require("node:crypto")),cc={randomUUID:Om.default.randomUUID}});function Uw(e,t,r){if(cc.randomUUID&&!t&&!e)return cc.randomUUID();e=e||{};let i=e.random||(e.rng||br)();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 Ue(i)}var km,Em=ee(()=>{xm();zn();Bt();km=Uw});function Ww(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Am.default.createHash("sha1").update(e).digest()}var Am,Pm,Tm=ee(()=>{Am=me(require("node:crypto"));Pm=Ww});var Vw,$m,jm=ee(()=>{uc();Tm();Vw=Fi("v5",80,Pm),$m=Vw});function dc(e={},t,r=0){let i=Jn({...e,_v6:!0},new Uint8Array(16));if(i=zi(i),t){for(let n=0;n<16;n++)t[r+n]=i[n];return t}return Ue(i)}var Dm=ee(()=>{Bt();ac();lc()});function pc(e){let t=typeof e=="string"?er(e):e,r=Kw(t);return typeof e=="string"?Ue(r):r}function Kw(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 Im=ee(()=>{Mi();Bt()});function Yw(e,t,r){e=e||{};let i=t&&r||0,n=t||new Uint8Array(16),s=e.random||(e.rng||br)(),o=e.msecs!==void 0?e.msecs:Date.now(),a=e.seq!==void 0?e.seq:null,l=Rm,u=qm;return o>Pt&&e.msecs===void 0&&(Pt=o,a!==null&&(l=null,u=null)),a!==null&&(a>2147483647&&(a=2147483647),l=a>>>19&4095,u=a&524287),(l===null||u===null)&&(l=s[6]&127,l=l<<8|s[7],u=s[8]&63,u=u<<8|s[9],u=u<<5|s[10]>>>3),o+1e4>Pt&&a===null?++u>524287&&(u=0,++l>4095&&(l=0,Pt++)):Pt=o,Rm=l,qm=u,n[i++]=Pt/1099511627776&255,n[i++]=Pt/4294967296&255,n[i++]=Pt/16777216&255,n[i++]=Pt/65536&255,n[i++]=Pt/256&255,n[i++]=Pt&255,n[i++]=l>>>4&15|112,n[i++]=l&255,n[i++]=u>>>13&63|128,n[i++]=u>>>5&255,n[i++]=u<<3&255|s[10]&7,n[i++]=s[11],n[i++]=s[12],n[i++]=s[13],n[i++]=s[14],n[i++]=s[15],t||Ue(n)}var qm,Rm,Pt,Mm,zm=ee(()=>{zn();Bt();qm=null,Rm=null,Pt=0;Mm=Yw});function Qw(e){if(!Xt(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}var Fm,Jm=ee(()=>{Ri();Fm=Qw});var Bm={};Lr(Bm,{MAX:()=>dm,NIL:()=>mm,parse:()=>er,stringify:()=>bm,v1:()=>Jn,v1ToV6:()=>zi,v3:()=>Cm,v4:()=>km,v5:()=>$m,v6:()=>dc,v6ToV1:()=>pc,v7:()=>Mm,validate:()=>Xt,version:()=>Fm});var Hm=ee(()=>{pm();fm();Mi();Bt();ac();lc();Sm();Em();jm();Dm();Im();zm();Ri();Jm()});var be=m(yt=>{"use strict";var Ji=yt&&yt.__awaiter||function(e,t,r,i){function n(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(c){try{u(i.next(c))}catch(d){o(d)}}function l(c){try{u(i.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):n(c.value).then(a,l)}u((i=i.apply(e,t||[])).next())})};Object.defineProperty(yt,"__esModule",{value:!0});yt.SvixRequest=yt.HttpMethod=yt.LIB_VERSION=void 0;var mc=ic(),Zw=(Hm(),m1(Bm));yt.LIB_VERSION="1.86.0";var Xw=`svix-libs/${yt.LIB_VERSION}/javascript`,eC;(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"})(eC=yt.HttpMethod||(yt.HttpMethod={}));var fc=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 Ji(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 Ji(this,void 0,void 0,function*(){yield this.sendInner(t)})}sendInner(t){var r,i;return Ji(this,void 0,void 0,function*(){let n=new URL(t.baseUrl+this.path);for(let[l,u]of Object.entries(this.queryParams))n.searchParams.set(l,u);this.headerParams["idempotency-key"]===void 0&&this.method.toUpperCase()==="POST"&&(this.headerParams["idempotency-key"]=`auto_${(0,Zw.v4)()}`);let s=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);this.body!=null&&(this.headerParams["content-type"]="application/json");let o="credentials"in Request.prototype,a=yield Lm(n,{method:this.method.toString(),body:this.body,headers:Object.assign({accept:"application/json, */*;q=0.8",authorization:`Bearer ${t.token}`,"user-agent":Xw,"svix-req-id":s.toString()},this.headerParams),credentials:o?"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 tC(a)})}};yt.SvixRequest=fc;function tC(e){return Ji(this,void 0,void 0,function*(){if(e.status<300)return e;let t=yield e.text();throw e.status===422?new mc.ApiException(e.status,JSON.parse(t),e.headers):e.status>=400&&e.status<=499?new mc.ApiException(e.status,JSON.parse(t),e.headers):new mc.ApiException(e.status,t,e.headers)})}function Lm(e,t,r,i=50,n=2,s=fetch,o=1){return Ji(this,void 0,void 0,function*(){let a=l=>new Promise(u=>setTimeout(u,l));try{let l=yield s(e,t);if(n<=0||l.status<500)return l}catch(l){if(n<=0)throw l}return yield a(i),t.headers["svix-retry-count"]=o.toString(),i=r?.[o]||i*2,yield Lm(e,t,r,i,--n,s,++o)})}});var Nm=m(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.Application=void 0;var hc=$n(),Bi=tc(),rC=lm(),iC=cm(),tt=be(),gc=class{constructor(t){this.requestCtx=t}list(t){let r=new tt.SvixRequest(tt.HttpMethod.GET,"/api/v1/app");return r.setQueryParams({exclude_apps_with_no_endpoints:t?.excludeAppsWithNoEndpoints,exclude_apps_with_disabled_endpoints:t?.excludeAppsWithDisabledEndpoints,limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,iC.ListResponseApplicationOutSerializer._fromJsonObject)}create(t,r){let i=new tt.SvixRequest(tt.HttpMethod.POST,"/api/v1/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(hc.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,Bi.ApplicationOutSerializer._fromJsonObject)}getOrCreate(t,r){let i=new tt.SvixRequest(tt.HttpMethod.POST,"/api/v1/app");return i.setQueryParam("get_if_exists",!0),i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(hc.ApplicationInSerializer._toJsonObject(t)),i.send(this.requestCtx,Bi.ApplicationOutSerializer._fromJsonObject)}get(t){let r=new tt.SvixRequest(tt.HttpMethod.GET,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.send(this.requestCtx,Bi.ApplicationOutSerializer._fromJsonObject)}update(t,r){let i=new tt.SvixRequest(tt.HttpMethod.PUT,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody(hc.ApplicationInSerializer._toJsonObject(r)),i.send(this.requestCtx,Bi.ApplicationOutSerializer._fromJsonObject)}delete(t){let r=new tt.SvixRequest(tt.HttpMethod.DELETE,"/api/v1/app/{app_id}");return r.setPathParam("app_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new tt.SvixRequest(tt.HttpMethod.PATCH,"/api/v1/app/{app_id}");return i.setPathParam("app_id",t),i.setBody(rC.ApplicationPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Bi.ApplicationOutSerializer._fromJsonObject)}};Bn.Application=gc});var Gm=m(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ApiTokenOutSerializer=void 0;Hn.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 bc=m(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.AppPortalCapabilitySerializer=vr.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=vr.AppPortalCapability||(vr.AppPortalCapability={}));vr.AppPortalCapabilitySerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Vm=m(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.AppPortalAccessInSerializer=void 0;var Um=bc(),Wm=$n();Ln.AppPortalAccessInSerializer={_fromJsonObject(e){var t;return{application:e.application!=null?Wm.ApplicationInSerializer._fromJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>Um.AppPortalCapabilitySerializer._fromJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}},_toJsonObject(e){var t;return{application:e.application!=null?Wm.ApplicationInSerializer._toJsonObject(e.application):void 0,capabilities:(t=e.capabilities)===null||t===void 0?void 0:t.map(r=>Um.AppPortalCapabilitySerializer._toJsonObject(r)),expiry:e.expiry,featureFlags:e.featureFlags,readOnly:e.readOnly,sessionId:e.sessionId}}}});var Km=m(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.AppPortalAccessOutSerializer=void 0;Nn.AppPortalAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}});var Ym=m(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.ApplicationTokenExpireInSerializer=void 0;Gn.ApplicationTokenExpireInSerializer={_fromJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}},_toJsonObject(e){return{expiry:e.expiry,sessionIds:e.sessionIds}}}});var Qm=m(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.RotatePollerTokenInSerializer=void 0;Un.RotatePollerTokenInSerializer={_fromJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}},_toJsonObject(e){return{expiry:e.expiry,oldTokenExpiry:e.oldTokenExpiry}}}});var Zm=m(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.StreamPortalAccessInSerializer=void 0;Wn.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 vc=m(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.DashboardAccessOutSerializer=void 0;Vn.DashboardAccessOutSerializer={_fromJsonObject(e){return{token:e.token,url:e.url}},_toJsonObject(e){return{token:e.token,url:e.url}}}});var tf=m(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.Authentication=void 0;var Xm=Gm(),sC=Vm(),ef=Km(),oC=Ym(),aC=Qm(),lC=Zm(),uC=vc(),rt=be(),yc=class{constructor(t){this.requestCtx=t}appPortalAccess(t,r,i){let n=new rt.SvixRequest(rt.HttpMethod.POST,"/api/v1/auth/app-portal-access/{app_id}");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(sC.AppPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,ef.AppPortalAccessOutSerializer._fromJsonObject)}expireAll(t,r,i){let n=new rt.SvixRequest(rt.HttpMethod.POST,"/api/v1/auth/app/{app_id}/expire-all");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(oC.ApplicationTokenExpireInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}dashboardAccess(t,r){let i=new rt.SvixRequest(rt.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,uC.DashboardAccessOutSerializer._fromJsonObject)}logout(t){let r=new rt.SvixRequest(rt.HttpMethod.POST,"/api/v1/auth/logout");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.sendNoResponseBody(this.requestCtx)}streamPortalAccess(t,r,i){let n=new rt.SvixRequest(rt.HttpMethod.POST,"/api/v1/auth/stream-portal-access/{stream_id}");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(lC.StreamPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,ef.AppPortalAccessOutSerializer._fromJsonObject)}getStreamPollerToken(t,r){let i=new rt.SvixRequest(rt.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,Xm.ApiTokenOutSerializer._fromJsonObject)}rotateStreamPollerToken(t,r,i,n){let s=new rt.SvixRequest(rt.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate");return s.setPathParam("stream_id",t),s.setPathParam("sink_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(aC.RotatePollerTokenInSerializer._toJsonObject(i)),s.send(this.requestCtx,Xm.ApiTokenOutSerializer._fromJsonObject)}};Kn.Authentication=yc});var tr=m(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.BackgroundTaskStatusSerializer=yr.BackgroundTaskStatus=void 0;var cC;(function(e){e.Running="running",e.Finished="finished",e.Failed="failed"})(cC=yr.BackgroundTaskStatus||(yr.BackgroundTaskStatus={}));yr.BackgroundTaskStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var rr=m(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.BackgroundTaskTypeSerializer=_r.BackgroundTaskType=void 0;var dC;(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"})(dC=_r.BackgroundTaskType||(_r.BackgroundTaskType={}));_r.BackgroundTaskTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var _c=m(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.BackgroundTaskOutSerializer=void 0;var rf=tr(),nf=rr();Yn.BackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data,id:e.id,status:rf.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:nf.BackgroundTaskTypeSerializer._fromJsonObject(e.task)}},_toJsonObject(e){return{data:e.data,id:e.id,status:rf.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:nf.BackgroundTaskTypeSerializer._toJsonObject(e.task)}}}});var of=m(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.ListResponseBackgroundTaskOutSerializer=void 0;var sf=_c();Qn.ListResponseBackgroundTaskOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>sf.BackgroundTaskOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>sf.BackgroundTaskOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var af=m(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.BackgroundTask=void 0;var pC=_c(),mC=of(),Zn=be(),wc=class{constructor(t){this.requestCtx=t}list(t){let r=new Zn.SvixRequest(Zn.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,mC.ListResponseBackgroundTaskOutSerializer._fromJsonObject)}listByEndpoint(t){return this.list(t)}get(t){let r=new Zn.SvixRequest(Zn.HttpMethod.GET,"/api/v1/background-task/{task_id}");return r.setPathParam("task_id",t),r.send(this.requestCtx,pC.BackgroundTaskOutSerializer._fromJsonObject)}};Xn.BackgroundTask=wc});var Ur=m(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.ConnectorKindSerializer=wr.ConnectorKind=void 0;var fC;(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"})(fC=wr.ConnectorKind||(wr.ConnectorKind={}));wr.ConnectorKindSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var es=m(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.ConnectorProductSerializer=Cr.ConnectorProduct=void 0;var hC;(function(e){e.Dispatch="Dispatch",e.Stream="Stream"})(hC=Cr.ConnectorProduct||(Cr.ConnectorProduct={}));Cr.ConnectorProductSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Cc=m(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.ConnectorInSerializer=void 0;var lf=Ur(),uf=es();ts.ConnectorInSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?lf.ConnectorKindSerializer._fromJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?uf.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?lf.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,productType:e.productType!=null?uf.ConnectorProductSerializer._toJsonObject(e.productType):void 0,transformation:e.transformation,uid:e.uid}}}});var is=m(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.ConnectorOutSerializer=void 0;var cf=Ur(),df=es();rs.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:cf.ConnectorKindSerializer._fromJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:df.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:cf.ConnectorKindSerializer._toJsonObject(e.kind),logo:e.logo,name:e.name,orgId:e.orgId,productType:df.ConnectorProductSerializer._toJsonObject(e.productType),transformation:e.transformation,transformationUpdatedAt:e.transformationUpdatedAt,uid:e.uid,updatedAt:e.updatedAt}}}});var mf=m(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.ConnectorPatchSerializer=void 0;var pf=Ur();ns.ConnectorPatchSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?pf.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?pf.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}}}});var hf=m(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.ConnectorUpdateSerializer=void 0;var ff=Ur();ss.ConnectorUpdateSerializer={_fromJsonObject(e){return{allowedEventTypes:e.allowedEventTypes,description:e.description,featureFlags:e.featureFlags,instructions:e.instructions,kind:e.kind!=null?ff.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?ff.ConnectorKindSerializer._toJsonObject(e.kind):void 0,logo:e.logo,name:e.name,transformation:e.transformation}}}});var bf=m(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.ListResponseConnectorOutSerializer=void 0;var gf=is();os.ListResponseConnectorOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>gf.ConnectorOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>gf.ConnectorOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var vf=m(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.Connector=void 0;var gC=Cc(),as=is(),bC=mf(),vC=hf(),yC=bf(),_t=be(),Sc=class{constructor(t){this.requestCtx=t}list(t){let r=new _t.SvixRequest(_t.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,yC.ListResponseConnectorOutSerializer._fromJsonObject)}create(t,r){let i=new _t.SvixRequest(_t.HttpMethod.POST,"/api/v1/connector");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(gC.ConnectorInSerializer._toJsonObject(t)),i.send(this.requestCtx,as.ConnectorOutSerializer._fromJsonObject)}get(t){let r=new _t.SvixRequest(_t.HttpMethod.GET,"/api/v1/connector/{connector_id}");return r.setPathParam("connector_id",t),r.send(this.requestCtx,as.ConnectorOutSerializer._fromJsonObject)}update(t,r){let i=new _t.SvixRequest(_t.HttpMethod.PUT,"/api/v1/connector/{connector_id}");return i.setPathParam("connector_id",t),i.setBody(vC.ConnectorUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,as.ConnectorOutSerializer._fromJsonObject)}delete(t){let r=new _t.SvixRequest(_t.HttpMethod.DELETE,"/api/v1/connector/{connector_id}");return r.setPathParam("connector_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new _t.SvixRequest(_t.HttpMethod.PATCH,"/api/v1/connector/{connector_id}");return i.setPathParam("connector_id",t),i.setBody(bC.ConnectorPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,as.ConnectorOutSerializer._fromJsonObject)}};ls.Connector=Sc});var yf=m(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.EndpointHeadersInSerializer=void 0;us.EndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var Oc=m(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.EndpointHeadersOutSerializer=void 0;cs.EndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var _f=m(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.EndpointHeadersPatchInSerializer=void 0;ds.EndpointHeadersPatchInSerializer={_fromJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}},_toJsonObject(e){return{deleteHeaders:e.deleteHeaders,headers:e.headers}}}});var wf=m(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.EndpointInSerializer=void 0;ps.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,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,uid:e.uid,url:e.url,version:e.version}}}});var xc=m(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.EndpointOutSerializer=void 0;ms.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,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,uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}});var Cf=m(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.EndpointPatchSerializer=void 0;fs.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,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,uid:e.uid,url:e.url,version:e.version}}}});var Sf=m(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.EndpointSecretOutSerializer=void 0;hs.EndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var kc=m(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.EndpointSecretRotateInSerializer=void 0;gs.EndpointSecretRotateInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Of=m(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.EndpointStatsSerializer=void 0;bs.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 xf=m(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.EndpointTransformationInSerializer=void 0;vs.EndpointTransformationInSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var kf=m(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.EndpointTransformationOutSerializer=void 0;ys.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 Ef=m(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.EndpointTransformationPatchSerializer=void 0;_s.EndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var Af=m(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.EndpointUpdateSerializer=void 0;ws.EndpointUpdateSerializer={_fromJsonObject(e){return{channels:e.channels,description:e.description,disabled:e.disabled,filterTypes:e.filterTypes,metadata:e.metadata,rateLimit:e.rateLimit,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,uid:e.uid,url:e.url,version:e.version}}}});var Pf=m(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.EventExampleInSerializer=void 0;Cs.EventExampleInSerializer={_fromJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}},_toJsonObject(e){return{eventType:e.eventType,exampleIndex:e.exampleIndex}}}});var $f=m(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.ListResponseEndpointOutSerializer=void 0;var Tf=xc();Ss.ListResponseEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Tf.EndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Tf.EndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Hi=m(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.MessageOutSerializer=void 0;Os.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 jf=m(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.RecoverInSerializer=void 0;xs.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 qf=m(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.RecoverOutSerializer=void 0;var Df=tr(),If=rr();ks.RecoverOutSerializer={_fromJsonObject(e){return{id:e.id,status:Df.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:If.BackgroundTaskTypeSerializer._fromJsonObject(e.task)}},_toJsonObject(e){return{id:e.id,status:Df.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:If.BackgroundTaskTypeSerializer._toJsonObject(e.task)}}}});var Rf=m(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.ReplayInSerializer=void 0;Es.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 Ff=m(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.ReplayOutSerializer=void 0;var Mf=tr(),zf=rr();As.ReplayOutSerializer={_fromJsonObject(e){return{id:e.id,status:Mf.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:zf.BackgroundTaskTypeSerializer._fromJsonObject(e.task)}},_toJsonObject(e){return{id:e.id,status:Mf.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:zf.BackgroundTaskTypeSerializer._toJsonObject(e.task)}}}});var Jf=m(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.Endpoint=void 0;var _C=yf(),wC=Oc(),CC=_f(),SC=wf(),Ps=xc(),OC=Cf(),xC=Sf(),kC=kc(),EC=Of(),AC=xf(),PC=kf(),TC=Ef(),$C=Af(),jC=Pf(),DC=$f(),IC=Hi(),qC=jf(),RC=qf(),MC=Rf(),zC=Ff(),Q=be(),Ec=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,DC.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(SC.EndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,Ps.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,Ps.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($C.EndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,Ps.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(OC.EndpointPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,Ps.EndpointOutSerializer._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,wC.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(_C.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(CC.EndpointHeadersPatchInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}headersPatch(t,r,i){return this.patchHeaders(t,r,i)}recover(t,r,i,n){let s=new Q.SvixRequest(Q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover");return s.setPathParam("app_id",t),s.setPathParam("endpoint_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(qC.RecoverInSerializer._toJsonObject(i)),s.send(this.requestCtx,RC.RecoverOutSerializer._fromJsonObject)}replayMissing(t,r,i,n){let s=new Q.SvixRequest(Q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing");return s.setPathParam("app_id",t),s.setPathParam("endpoint_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(MC.ReplayInSerializer._toJsonObject(i)),s.send(this.requestCtx,zC.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,xC.EndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let s=new Q.SvixRequest(Q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate");return s.setPathParam("app_id",t),s.setPathParam("endpoint_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(kC.EndpointSecretRotateInSerializer._toJsonObject(i)),s.sendNoResponseBody(this.requestCtx)}sendExample(t,r,i,n){let s=new Q.SvixRequest(Q.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example");return s.setPathParam("app_id",t),s.setPathParam("endpoint_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(jC.EventExampleInSerializer._toJsonObject(i)),s.send(this.requestCtx,IC.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,EC.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,PC.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(TC.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(AC.EndpointTransformationInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};Ts.Endpoint=Ec});var Ac=m($s=>{"use strict";Object.defineProperty($s,"__esModule",{value:!0});$s.EventTypeInSerializer=void 0;$s.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 Lf=m(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.EnvironmentInSerializer=void 0;var Bf=Cc(),Hf=Ac();js.EnvironmentInSerializer={_fromJsonObject(e){var t,r;return{connectors:(t=e.connectors)===null||t===void 0?void 0:t.map(i=>Bf.ConnectorInSerializer._fromJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>Hf.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=>Bf.ConnectorInSerializer._toJsonObject(i)),eventTypes:(r=e.eventTypes)===null||r===void 0?void 0:r.map(i=>Hf.EventTypeInSerializer._toJsonObject(i)),settings:e.settings}}}});var Is=m(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.EventTypeOutSerializer=void 0;Ds.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 Uf=m(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.EnvironmentOutSerializer=void 0;var Nf=is(),Gf=Is();qs.EnvironmentOutSerializer={_fromJsonObject(e){return{connectors:e.connectors.map(t=>Nf.ConnectorOutSerializer._fromJsonObject(t)),createdAt:new Date(e.createdAt),eventTypes:e.eventTypes.map(t=>Gf.EventTypeOutSerializer._fromJsonObject(t)),settings:e.settings,version:e.version}},_toJsonObject(e){return{connectors:e.connectors.map(t=>Nf.ConnectorOutSerializer._toJsonObject(t)),createdAt:e.createdAt,eventTypes:e.eventTypes.map(t=>Gf.EventTypeOutSerializer._toJsonObject(t)),settings:e.settings,version:e.version}}}});var Wf=m(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.Environment=void 0;var FC=Lf(),JC=Uf(),Rs=be(),Pc=class{constructor(t){this.requestCtx=t}export(t){let r=new Rs.SvixRequest(Rs.HttpMethod.POST,"/api/v1/environment/export");return r.setHeaderParam("idempotency-key",t?.idempotencyKey),r.send(this.requestCtx,JC.EnvironmentOutSerializer._fromJsonObject)}import(t,r){let i=new Rs.SvixRequest(Rs.HttpMethod.POST,"/api/v1/environment/import");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(FC.EnvironmentInSerializer._toJsonObject(t)),i.sendNoResponseBody(this.requestCtx)}};Ms.Environment=Pc});var Vf=m(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.EventTypeImportOpenApiInSerializer=void 0;zs.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 Kf=m(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.EventTypeFromOpenApiSerializer=void 0;Fs.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 Qf=m(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.EventTypeImportOpenApiOutDataSerializer=void 0;var Yf=Kf();Js.EventTypeImportOpenApiOutDataSerializer={_fromJsonObject(e){var t;return{modified:e.modified,toModify:(t=e.to_modify)===null||t===void 0?void 0:t.map(r=>Yf.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=>Yf.EventTypeFromOpenApiSerializer._toJsonObject(r))}}}});var Xf=m(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.EventTypeImportOpenApiOutSerializer=void 0;var Zf=Qf();Bs.EventTypeImportOpenApiOutSerializer={_fromJsonObject(e){return{data:Zf.EventTypeImportOpenApiOutDataSerializer._fromJsonObject(e.data)}},_toJsonObject(e){return{data:Zf.EventTypeImportOpenApiOutDataSerializer._toJsonObject(e.data)}}}});var eh=m(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.EventTypePatchSerializer=void 0;Hs.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 th=m(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.EventTypeUpdateSerializer=void 0;Ls.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 ih=m(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.ListResponseEventTypeOutSerializer=void 0;var rh=Is();Ns.ListResponseEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>rh.EventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>rh.EventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var nh=m(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.EventType=void 0;var BC=Vf(),HC=Xf(),LC=Ac(),Gs=Is(),NC=eh(),GC=th(),UC=ih(),it=be(),Tc=class{constructor(t){this.requestCtx=t}list(t){let r=new it.SvixRequest(it.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,UC.ListResponseEventTypeOutSerializer._fromJsonObject)}create(t,r){let i=new it.SvixRequest(it.HttpMethod.POST,"/api/v1/event-type");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(LC.EventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,Gs.EventTypeOutSerializer._fromJsonObject)}importOpenapi(t,r){let i=new it.SvixRequest(it.HttpMethod.POST,"/api/v1/event-type/import/openapi");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(BC.EventTypeImportOpenApiInSerializer._toJsonObject(t)),i.send(this.requestCtx,HC.EventTypeImportOpenApiOutSerializer._fromJsonObject)}get(t){let r=new it.SvixRequest(it.HttpMethod.GET,"/api/v1/event-type/{event_type_name}");return r.setPathParam("event_type_name",t),r.send(this.requestCtx,Gs.EventTypeOutSerializer._fromJsonObject)}update(t,r){let i=new it.SvixRequest(it.HttpMethod.PUT,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(GC.EventTypeUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Gs.EventTypeOutSerializer._fromJsonObject)}delete(t,r){let i=new it.SvixRequest(it.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 it.SvixRequest(it.HttpMethod.PATCH,"/api/v1/event-type/{event_type_name}");return i.setPathParam("event_type_name",t),i.setBody(NC.EventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Gs.EventTypeOutSerializer._fromJsonObject)}};Us.EventType=Tc});var oh=m(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.Health=void 0;var sh=be(),$c=class{constructor(t){this.requestCtx=t}get(){return new sh.SvixRequest(sh.HttpMethod.GET,"/api/v1/health").sendNoResponseBody(this.requestCtx)}};Ws.Health=$c});var ah=m(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.IngestSourceConsumerPortalAccessInSerializer=void 0;Vs.IngestSourceConsumerPortalAccessInSerializer={_fromJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}},_toJsonObject(e){return{expiry:e.expiry,readOnly:e.readOnly}}}});var lh=m(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.IngestEndpointHeadersInSerializer=void 0;Ks.IngestEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var uh=m(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.IngestEndpointHeadersOutSerializer=void 0;Ys.IngestEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var ch=m(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.IngestEndpointInSerializer=void 0;Qs.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 jc=m(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.IngestEndpointOutSerializer=void 0;Zs.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 dh=m(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.IngestEndpointSecretInSerializer=void 0;Xs.IngestEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var ph=m(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.IngestEndpointSecretOutSerializer=void 0;eo.IngestEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var mh=m(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.IngestEndpointTransformationOutSerializer=void 0;to.IngestEndpointTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var fh=m(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.IngestEndpointTransformationPatchSerializer=void 0;ro.IngestEndpointTransformationPatchSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var hh=m(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.IngestEndpointUpdateSerializer=void 0;io.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 bh=m(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.ListResponseIngestEndpointOutSerializer=void 0;var gh=jc();no.ListResponseIngestEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>gh.IngestEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>gh.IngestEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var vh=m(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.IngestEndpoint=void 0;var WC=lh(),VC=uh(),KC=ch(),Dc=jc(),YC=dh(),QC=ph(),ZC=mh(),XC=fh(),eS=hh(),tS=bh(),ye=be(),Ic=class{constructor(t){this.requestCtx=t}list(t,r){let i=new ye.SvixRequest(ye.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,tS.ListResponseIngestEndpointOutSerializer._fromJsonObject)}create(t,r,i){let n=new ye.SvixRequest(ye.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint");return n.setPathParam("source_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(KC.IngestEndpointInSerializer._toJsonObject(r)),n.send(this.requestCtx,Dc.IngestEndpointOutSerializer._fromJsonObject)}get(t,r){let i=new ye.SvixRequest(ye.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,Dc.IngestEndpointOutSerializer._fromJsonObject)}update(t,r,i){let n=new ye.SvixRequest(ye.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return n.setPathParam("source_id",t),n.setPathParam("endpoint_id",r),n.setBody(eS.IngestEndpointUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,Dc.IngestEndpointOutSerializer._fromJsonObject)}delete(t,r){let i=new ye.SvixRequest(ye.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 ye.SvixRequest(ye.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,VC.IngestEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r,i){let n=new ye.SvixRequest(ye.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(WC.IngestEndpointHeadersInSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}getSecret(t,r){let i=new ye.SvixRequest(ye.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,QC.IngestEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let s=new ye.SvixRequest(ye.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate");return s.setPathParam("source_id",t),s.setPathParam("endpoint_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(YC.IngestEndpointSecretInSerializer._toJsonObject(i)),s.sendNoResponseBody(this.requestCtx)}getTransformation(t,r){let i=new ye.SvixRequest(ye.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,ZC.IngestEndpointTransformationOutSerializer._fromJsonObject)}setTransformation(t,r,i){let n=new ye.SvixRequest(ye.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(XC.IngestEndpointTransformationPatchSerializer._toJsonObject(i)),n.sendNoResponseBody(this.requestCtx)}};so.IngestEndpoint=Ic});var yh=m(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.AdobeSignConfigSerializer=void 0;oo.AdobeSignConfigSerializer={_fromJsonObject(e){return{clientId:e.clientId}},_toJsonObject(e){return{clientId:e.clientId}}}});var _h=m(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.AirwallexConfigSerializer=void 0;ao.AirwallexConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var wh=m(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.CheckbookConfigSerializer=void 0;lo.CheckbookConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var qc=m(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.CronConfigSerializer=void 0;uo.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 Ch=m(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.DocusignConfigSerializer=void 0;co.DocusignConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Sh=m(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.EasypostConfigSerializer=void 0;po.EasypostConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Oh=m(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.GithubConfigSerializer=void 0;mo.GithubConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var xh=m(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.HubspotConfigSerializer=void 0;fo.HubspotConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var kh=m(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.OrumIoConfigSerializer=void 0;ho.OrumIoConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Eh=m(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.PandaDocConfigSerializer=void 0;go.PandaDocConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Ah=m(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.PortIoConfigSerializer=void 0;bo.PortIoConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Ph=m(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.RutterConfigSerializer=void 0;vo.RutterConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Th=m(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.SegmentConfigSerializer=void 0;yo.SegmentConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var $h=m(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.ShopifyConfigSerializer=void 0;_o.ShopifyConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var jh=m(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.SlackConfigSerializer=void 0;wo.SlackConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Dh=m(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.StripeConfigSerializer=void 0;Co.StripeConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Ih=m(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.SvixConfigSerializer=void 0;So.SvixConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var qh=m(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.TelnyxConfigSerializer=void 0;Oo.TelnyxConfigSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Rh=m(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.VapiConfigSerializer=void 0;xo.VapiConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var Mh=m(ko=>{"use strict";Object.defineProperty(ko,"__esModule",{value:!0});ko.VeriffConfigSerializer=void 0;ko.VeriffConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var zh=m(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.ZoomConfigSerializer=void 0;Eo.ZoomConfigSerializer={_fromJsonObject(e){return{secret:e.secret}},_toJsonObject(e){return{secret:e.secret}}}});var sg=m(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.IngestSourceInSerializer=void 0;var Fh=yh(),Jh=_h(),Bh=wh(),Hh=qc(),Lh=Ch(),Nh=Sh(),Gh=Oh(),Uh=xh(),Wh=kh(),Vh=Eh(),Kh=Ah(),Yh=Ph(),Qh=Th(),Zh=$h(),Xh=jh(),eg=Dh(),te=Ih(),tg=qh(),rg=Rh(),ig=Mh(),ng=zh();Ao.IngestSourceInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return Hh.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return Fh.AdobeSignConfigSerializer._fromJsonObject(e.config);case"beehiiv":return te.SvixConfigSerializer._fromJsonObject(e.config);case"brex":return te.SvixConfigSerializer._fromJsonObject(e.config);case"checkbook":return Bh.CheckbookConfigSerializer._fromJsonObject(e.config);case"clerk":return te.SvixConfigSerializer._fromJsonObject(e.config);case"docusign":return Lh.DocusignConfigSerializer._fromJsonObject(e.config);case"easypost":return Nh.EasypostConfigSerializer._fromJsonObject(e.config);case"github":return Gh.GithubConfigSerializer._fromJsonObject(e.config);case"guesty":return te.SvixConfigSerializer._fromJsonObject(e.config);case"hubspot":return Uh.HubspotConfigSerializer._fromJsonObject(e.config);case"incident-io":return te.SvixConfigSerializer._fromJsonObject(e.config);case"lithic":return te.SvixConfigSerializer._fromJsonObject(e.config);case"nash":return te.SvixConfigSerializer._fromJsonObject(e.config);case"orum-io":return Wh.OrumIoConfigSerializer._fromJsonObject(e.config);case"panda-doc":return Vh.PandaDocConfigSerializer._fromJsonObject(e.config);case"port-io":return Kh.PortIoConfigSerializer._fromJsonObject(e.config);case"pleo":return te.SvixConfigSerializer._fromJsonObject(e.config);case"replicate":return te.SvixConfigSerializer._fromJsonObject(e.config);case"resend":return te.SvixConfigSerializer._fromJsonObject(e.config);case"rutter":return Yh.RutterConfigSerializer._fromJsonObject(e.config);case"safebase":return te.SvixConfigSerializer._fromJsonObject(e.config);case"sardine":return te.SvixConfigSerializer._fromJsonObject(e.config);case"segment":return Qh.SegmentConfigSerializer._fromJsonObject(e.config);case"shopify":return Zh.ShopifyConfigSerializer._fromJsonObject(e.config);case"slack":return Xh.SlackConfigSerializer._fromJsonObject(e.config);case"stripe":return eg.StripeConfigSerializer._fromJsonObject(e.config);case"stych":return te.SvixConfigSerializer._fromJsonObject(e.config);case"svix":return te.SvixConfigSerializer._fromJsonObject(e.config);case"zoom":return ng.ZoomConfigSerializer._fromJsonObject(e.config);case"telnyx":return tg.TelnyxConfigSerializer._fromJsonObject(e.config);case"vapi":return rg.VapiConfigSerializer._fromJsonObject(e.config);case"open-ai":return te.SvixConfigSerializer._fromJsonObject(e.config);case"render":return te.SvixConfigSerializer._fromJsonObject(e.config);case"veriff":return ig.VeriffConfigSerializer._fromJsonObject(e.config);case"airwallex":return Jh.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=Hh.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=Fh.AdobeSignConfigSerializer._toJsonObject(e.config);break;case"beehiiv":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"brex":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"checkbook":t=Bh.CheckbookConfigSerializer._toJsonObject(e.config);break;case"clerk":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"docusign":t=Lh.DocusignConfigSerializer._toJsonObject(e.config);break;case"easypost":t=Nh.EasypostConfigSerializer._toJsonObject(e.config);break;case"github":t=Gh.GithubConfigSerializer._toJsonObject(e.config);break;case"guesty":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"hubspot":t=Uh.HubspotConfigSerializer._toJsonObject(e.config);break;case"incident-io":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"lithic":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"nash":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"orum-io":t=Wh.OrumIoConfigSerializer._toJsonObject(e.config);break;case"panda-doc":t=Vh.PandaDocConfigSerializer._toJsonObject(e.config);break;case"port-io":t=Kh.PortIoConfigSerializer._toJsonObject(e.config);break;case"pleo":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"replicate":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"resend":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"rutter":t=Yh.RutterConfigSerializer._toJsonObject(e.config);break;case"safebase":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"sardine":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"segment":t=Qh.SegmentConfigSerializer._toJsonObject(e.config);break;case"shopify":t=Zh.ShopifyConfigSerializer._toJsonObject(e.config);break;case"slack":t=Xh.SlackConfigSerializer._toJsonObject(e.config);break;case"stripe":t=eg.StripeConfigSerializer._toJsonObject(e.config);break;case"stych":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"svix":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"zoom":t=ng.ZoomConfigSerializer._toJsonObject(e.config);break;case"telnyx":t=tg.TelnyxConfigSerializer._toJsonObject(e.config);break;case"vapi":t=rg.VapiConfigSerializer._toJsonObject(e.config);break;case"open-ai":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"render":t=te.SvixConfigSerializer._toJsonObject(e.config);break;case"veriff":t=ig.VeriffConfigSerializer._toJsonObject(e.config);break;case"airwallex":t=Jh.AirwallexConfigSerializer._toJsonObject(e.config);break}return{type:e.type,config:t,metadata:e.metadata,name:e.name,uid:e.uid}}}});var og=m(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.AdobeSignConfigOutSerializer=void 0;Po.AdobeSignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ag=m(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.AirwallexConfigOutSerializer=void 0;To.AirwallexConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var lg=m($o=>{"use strict";Object.defineProperty($o,"__esModule",{value:!0});$o.CheckbookConfigOutSerializer=void 0;$o.CheckbookConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var ug=m(jo=>{"use strict";Object.defineProperty(jo,"__esModule",{value:!0});jo.DocusignConfigOutSerializer=void 0;jo.DocusignConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var cg=m(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.EasypostConfigOutSerializer=void 0;Do.EasypostConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var dg=m(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.GithubConfigOutSerializer=void 0;Io.GithubConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var pg=m(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.HubspotConfigOutSerializer=void 0;qo.HubspotConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var mg=m(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.OrumIoConfigOutSerializer=void 0;Ro.OrumIoConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var fg=m(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.PandaDocConfigOutSerializer=void 0;Mo.PandaDocConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var hg=m(zo=>{"use strict";Object.defineProperty(zo,"__esModule",{value:!0});zo.PortIoConfigOutSerializer=void 0;zo.PortIoConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var gg=m(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.RutterConfigOutSerializer=void 0;Fo.RutterConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var bg=m(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.SegmentConfigOutSerializer=void 0;Jo.SegmentConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var vg=m(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.ShopifyConfigOutSerializer=void 0;Bo.ShopifyConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var yg=m(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.SlackConfigOutSerializer=void 0;Ho.SlackConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var _g=m(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.StripeConfigOutSerializer=void 0;Lo.StripeConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var wg=m(No=>{"use strict";Object.defineProperty(No,"__esModule",{value:!0});No.SvixConfigOutSerializer=void 0;No.SvixConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Cg=m(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.TelnyxConfigOutSerializer=void 0;Go.TelnyxConfigOutSerializer={_fromJsonObject(e){return{publicKey:e.publicKey}},_toJsonObject(e){return{publicKey:e.publicKey}}}});var Sg=m(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.VapiConfigOutSerializer=void 0;Uo.VapiConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Og=m(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.VeriffConfigOutSerializer=void 0;Wo.VeriffConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var xg=m(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.ZoomConfigOutSerializer=void 0;Vo.ZoomConfigOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Rc=m(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.IngestSourceOutSerializer=void 0;var kg=og(),Eg=ag(),Ag=lg(),Pg=qc(),Tg=ug(),$g=cg(),jg=dg(),Dg=pg(),Ig=mg(),qg=fg(),Rg=hg(),Mg=gg(),zg=bg(),Fg=vg(),Jg=yg(),Bg=_g(),re=wg(),Hg=Cg(),Lg=Sg(),Ng=Og(),Gg=xg();Ko.IngestSourceOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"generic-webhook":return{};case"cron":return Pg.CronConfigSerializer._fromJsonObject(e.config);case"adobe-sign":return kg.AdobeSignConfigOutSerializer._fromJsonObject(e.config);case"beehiiv":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"brex":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"checkbook":return Ag.CheckbookConfigOutSerializer._fromJsonObject(e.config);case"clerk":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"docusign":return Tg.DocusignConfigOutSerializer._fromJsonObject(e.config);case"easypost":return $g.EasypostConfigOutSerializer._fromJsonObject(e.config);case"github":return jg.GithubConfigOutSerializer._fromJsonObject(e.config);case"guesty":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"hubspot":return Dg.HubspotConfigOutSerializer._fromJsonObject(e.config);case"incident-io":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"lithic":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"nash":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"orum-io":return Ig.OrumIoConfigOutSerializer._fromJsonObject(e.config);case"panda-doc":return qg.PandaDocConfigOutSerializer._fromJsonObject(e.config);case"port-io":return Rg.PortIoConfigOutSerializer._fromJsonObject(e.config);case"pleo":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"replicate":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"resend":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"rutter":return Mg.RutterConfigOutSerializer._fromJsonObject(e.config);case"safebase":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"sardine":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"segment":return zg.SegmentConfigOutSerializer._fromJsonObject(e.config);case"shopify":return Fg.ShopifyConfigOutSerializer._fromJsonObject(e.config);case"slack":return Jg.SlackConfigOutSerializer._fromJsonObject(e.config);case"stripe":return Bg.StripeConfigOutSerializer._fromJsonObject(e.config);case"stych":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"svix":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"zoom":return Gg.ZoomConfigOutSerializer._fromJsonObject(e.config);case"telnyx":return Hg.TelnyxConfigOutSerializer._fromJsonObject(e.config);case"vapi":return Lg.VapiConfigOutSerializer._fromJsonObject(e.config);case"open-ai":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"render":return re.SvixConfigOutSerializer._fromJsonObject(e.config);case"veriff":return Ng.VeriffConfigOutSerializer._fromJsonObject(e.config);case"airwallex":return Eg.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=Pg.CronConfigSerializer._toJsonObject(e.config);break;case"adobe-sign":t=kg.AdobeSignConfigOutSerializer._toJsonObject(e.config);break;case"beehiiv":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"brex":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"checkbook":t=Ag.CheckbookConfigOutSerializer._toJsonObject(e.config);break;case"clerk":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"docusign":t=Tg.DocusignConfigOutSerializer._toJsonObject(e.config);break;case"easypost":t=$g.EasypostConfigOutSerializer._toJsonObject(e.config);break;case"github":t=jg.GithubConfigOutSerializer._toJsonObject(e.config);break;case"guesty":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"hubspot":t=Dg.HubspotConfigOutSerializer._toJsonObject(e.config);break;case"incident-io":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"lithic":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"nash":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"orum-io":t=Ig.OrumIoConfigOutSerializer._toJsonObject(e.config);break;case"panda-doc":t=qg.PandaDocConfigOutSerializer._toJsonObject(e.config);break;case"port-io":t=Rg.PortIoConfigOutSerializer._toJsonObject(e.config);break;case"pleo":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"replicate":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"resend":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"rutter":t=Mg.RutterConfigOutSerializer._toJsonObject(e.config);break;case"safebase":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"sardine":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"segment":t=zg.SegmentConfigOutSerializer._toJsonObject(e.config);break;case"shopify":t=Fg.ShopifyConfigOutSerializer._toJsonObject(e.config);break;case"slack":t=Jg.SlackConfigOutSerializer._toJsonObject(e.config);break;case"stripe":t=Bg.StripeConfigOutSerializer._toJsonObject(e.config);break;case"stych":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"svix":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"zoom":t=Gg.ZoomConfigOutSerializer._toJsonObject(e.config);break;case"telnyx":t=Hg.TelnyxConfigOutSerializer._toJsonObject(e.config);break;case"vapi":t=Lg.VapiConfigOutSerializer._toJsonObject(e.config);break;case"open-ai":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"render":t=re.SvixConfigOutSerializer._toJsonObject(e.config);break;case"veriff":t=Ng.VeriffConfigOutSerializer._toJsonObject(e.config);break;case"airwallex":t=Eg.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 Wg=m(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.ListResponseIngestSourceOutSerializer=void 0;var Ug=Rc();Yo.ListResponseIngestSourceOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Ug.IngestSourceOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Ug.IngestSourceOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Vg=m(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.RotateTokenOutSerializer=void 0;Qo.RotateTokenOutSerializer={_fromJsonObject(e){return{ingestUrl:e.ingestUrl}},_toJsonObject(e){return{ingestUrl:e.ingestUrl}}}});var Yg=m(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.IngestSource=void 0;var Kg=sg(),Mc=Rc(),rS=Wg(),iS=Vg(),wt=be(),zc=class{constructor(t){this.requestCtx=t}list(t){let r=new wt.SvixRequest(wt.HttpMethod.GET,"/ingest/api/v1/source");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,rS.ListResponseIngestSourceOutSerializer._fromJsonObject)}create(t,r){let i=new wt.SvixRequest(wt.HttpMethod.POST,"/ingest/api/v1/source");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(Kg.IngestSourceInSerializer._toJsonObject(t)),i.send(this.requestCtx,Mc.IngestSourceOutSerializer._fromJsonObject)}get(t){let r=new wt.SvixRequest(wt.HttpMethod.GET,"/ingest/api/v1/source/{source_id}");return r.setPathParam("source_id",t),r.send(this.requestCtx,Mc.IngestSourceOutSerializer._fromJsonObject)}update(t,r){let i=new wt.SvixRequest(wt.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}");return i.setPathParam("source_id",t),i.setBody(Kg.IngestSourceInSerializer._toJsonObject(r)),i.send(this.requestCtx,Mc.IngestSourceOutSerializer._fromJsonObject)}delete(t){let r=new wt.SvixRequest(wt.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}");return r.setPathParam("source_id",t),r.sendNoResponseBody(this.requestCtx)}rotateToken(t,r){let i=new wt.SvixRequest(wt.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,iS.RotateTokenOutSerializer._fromJsonObject)}};Zo.IngestSource=zc});var Zg=m(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Ingest=void 0;var nS=vc(),sS=ah(),oS=vh(),aS=Yg(),Qg=be(),Fc=class{constructor(t){this.requestCtx=t}get endpoint(){return new oS.IngestEndpoint(this.requestCtx)}get source(){return new aS.IngestSource(this.requestCtx)}dashboard(t,r,i){let n=new Qg.SvixRequest(Qg.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/dashboard");return n.setPathParam("source_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(sS.IngestSourceConsumerPortalAccessInSerializer._toJsonObject(r)),n.send(this.requestCtx,nS.DashboardAccessOutSerializer._fromJsonObject)}};Xo.Ingest=Fc});var Xg=m(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.IntegrationInSerializer=void 0;ea.IntegrationInSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var eb=m(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.IntegrationKeyOutSerializer=void 0;ta.IntegrationKeyOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Jc=m(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.IntegrationOutSerializer=void 0;ra.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 tb=m(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.IntegrationUpdateSerializer=void 0;ia.IntegrationUpdateSerializer={_fromJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}},_toJsonObject(e){return{featureFlags:e.featureFlags,name:e.name}}}});var ib=m(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});na.ListResponseIntegrationOutSerializer=void 0;var rb=Jc();na.ListResponseIntegrationOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>rb.IntegrationOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>rb.IntegrationOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var sb=m(sa=>{"use strict";Object.defineProperty(sa,"__esModule",{value:!0});sa.Integration=void 0;var lS=Xg(),nb=eb(),Bc=Jc(),uS=tb(),cS=ib(),nt=be(),Hc=class{constructor(t){this.requestCtx=t}list(t,r){let i=new nt.SvixRequest(nt.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,cS.ListResponseIntegrationOutSerializer._fromJsonObject)}create(t,r,i){let n=new nt.SvixRequest(nt.HttpMethod.POST,"/api/v1/app/{app_id}/integration");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(lS.IntegrationInSerializer._toJsonObject(r)),n.send(this.requestCtx,Bc.IntegrationOutSerializer._fromJsonObject)}get(t,r){let i=new nt.SvixRequest(nt.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,Bc.IntegrationOutSerializer._fromJsonObject)}update(t,r,i){let n=new nt.SvixRequest(nt.HttpMethod.PUT,"/api/v1/app/{app_id}/integration/{integ_id}");return n.setPathParam("app_id",t),n.setPathParam("integ_id",r),n.setBody(uS.IntegrationUpdateSerializer._toJsonObject(i)),n.send(this.requestCtx,Bc.IntegrationOutSerializer._fromJsonObject)}delete(t,r){let i=new nt.SvixRequest(nt.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 nt.SvixRequest(nt.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,nb.IntegrationKeyOutSerializer._fromJsonObject)}rotateKey(t,r,i){let n=new nt.SvixRequest(nt.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,nb.IntegrationKeyOutSerializer._fromJsonObject)}};sa.Integration=Hc});var lb=m(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.ExpungeAllContentsOutSerializer=void 0;var ob=tr(),ab=rr();oa.ExpungeAllContentsOutSerializer={_fromJsonObject(e){return{id:e.id,status:ob.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:ab.BackgroundTaskTypeSerializer._fromJsonObject(e.task)}},_toJsonObject(e){return{id:e.id,status:ob.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:ab.BackgroundTaskTypeSerializer._toJsonObject(e.task)}}}});var cb=m(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.ListResponseMessageOutSerializer=void 0;var ub=Hi();aa.ListResponseMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>ub.MessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>ub.MessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var db=m(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.MessagePrecheckInSerializer=void 0;la.MessagePrecheckInSerializer={_fromJsonObject(e){return{channels:e.channels,eventType:e.eventType}},_toJsonObject(e){return{channels:e.channels,eventType:e.eventType}}}});var pb=m(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.MessagePrecheckOutSerializer=void 0;ua.MessagePrecheckOutSerializer={_fromJsonObject(e){return{active:e.active}},_toJsonObject(e){return{active:e.active}}}});var mb=m(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.PollingEndpointConsumerSeekInSerializer=void 0;ca.PollingEndpointConsumerSeekInSerializer={_fromJsonObject(e){return{after:new Date(e.after)}},_toJsonObject(e){return{after:e.after}}}});var fb=m(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.PollingEndpointConsumerSeekOutSerializer=void 0;da.PollingEndpointConsumerSeekOutSerializer={_fromJsonObject(e){return{iterator:e.iterator}},_toJsonObject(e){return{iterator:e.iterator}}}});var hb=m(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.PollingEndpointMessageOutSerializer=void 0;pa.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 bb=m(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.PollingEndpointOutSerializer=void 0;var gb=hb();ma.PollingEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>gb.PollingEndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>gb.PollingEndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var yb=m(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});fa.MessagePoller=void 0;var dS=mb(),pS=fb(),vb=bb(),Wr=be(),Lc=class{constructor(t){this.requestCtx=t}poll(t,r,i){let n=new Wr.SvixRequest(Wr.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,vb.PollingEndpointOutSerializer._fromJsonObject)}consumerPoll(t,r,i,n){let s=new Wr.SvixRequest(Wr.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}");return s.setPathParam("app_id",t),s.setPathParam("sink_id",r),s.setPathParam("consumer_id",i),s.setQueryParams({limit:n?.limit,iterator:n?.iterator}),s.send(this.requestCtx,vb.PollingEndpointOutSerializer._fromJsonObject)}consumerSeek(t,r,i,n,s){let o=new Wr.SvixRequest(Wr.HttpMethod.POST,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek");return o.setPathParam("app_id",t),o.setPathParam("sink_id",r),o.setPathParam("consumer_id",i),o.setHeaderParam("idempotency-key",s?.idempotencyKey),o.setBody(dS.PollingEndpointConsumerSeekInSerializer._toJsonObject(n)),o.send(this.requestCtx,pS.PollingEndpointConsumerSeekOutSerializer._fromJsonObject)}};fa.MessagePoller=Lc});var wb=m(ha=>{"use strict";Object.defineProperty(ha,"__esModule",{value:!0});ha.MessageInSerializer=void 0;var _b=$n();ha.MessageInSerializer={_fromJsonObject(e){return{application:e.application!=null?_b.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?_b.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 Gc=m(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.messageInRaw=Vr.Message=void 0;var mS=lb(),fS=cb(),Cb=Hi(),hS=db(),gS=pb(),bS=yb(),Ct=be(),vS=wb(),Nc=class{constructor(t){this.requestCtx=t}get poller(){return new bS.MessagePoller(this.requestCtx)}list(t,r){let i=new Ct.SvixRequest(Ct.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,fS.ListResponseMessageOutSerializer._fromJsonObject)}create(t,r,i){let n=new Ct.SvixRequest(Ct.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(vS.MessageInSerializer._toJsonObject(r)),n.send(this.requestCtx,Cb.MessageOutSerializer._fromJsonObject)}expungeAllContents(t,r){let i=new Ct.SvixRequest(Ct.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,mS.ExpungeAllContentsOutSerializer._fromJsonObject)}precheck(t,r,i){let n=new Ct.SvixRequest(Ct.HttpMethod.POST,"/api/v1/app/{app_id}/msg/precheck/active");return n.setPathParam("app_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(hS.MessagePrecheckInSerializer._toJsonObject(r)),n.send(this.requestCtx,gS.MessagePrecheckOutSerializer._fromJsonObject)}get(t,r,i){let n=new Ct.SvixRequest(Ct.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,Cb.MessageOutSerializer._fromJsonObject)}expungeContent(t,r){let i=new Ct.SvixRequest(Ct.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)}};Vr.Message=Nc;function yS(e,t,r){return{eventType:e,payload:{},transformationsParams:{rawPayload:t,headers:r?{"content-type":r}:void 0}}}Vr.messageInRaw=yS});var Uc=m(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});ga.EmptyResponseSerializer=void 0;ga.EmptyResponseSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var Li=m(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.MessageStatusSerializer=Sr.MessageStatus=void 0;var _S;(function(e){e[e.Success=0]="Success",e[e.Pending=1]="Pending",e[e.Fail=2]="Fail",e[e.Sending=3]="Sending"})(_S=Sr.MessageStatus||(Sr.MessageStatus={}));Sr.MessageStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Ni=m(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.MessageStatusTextSerializer=Or.MessageStatusText=void 0;var wS;(function(e){e.Success="success",e.Pending="pending",e.Fail="fail",e.Sending="sending"})(wS=Or.MessageStatusText||(Or.MessageStatusText={}));Or.MessageStatusTextSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var xb=m(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.EndpointMessageOutSerializer=void 0;var Sb=Li(),Ob=Ni();ba.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:Sb.MessageStatusSerializer._fromJsonObject(e.status),statusText:Ob.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:Sb.MessageStatusSerializer._toJsonObject(e.status),statusText:Ob.MessageStatusTextSerializer._toJsonObject(e.statusText),tags:e.tags,timestamp:e.timestamp}}}});var Eb=m(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.ListResponseEndpointMessageOutSerializer=void 0;var kb=xb();va.ListResponseEndpointMessageOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>kb.EndpointMessageOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>kb.EndpointMessageOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Wc=m(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.MessageAttemptTriggerTypeSerializer=xr.MessageAttemptTriggerType=void 0;var CS;(function(e){e[e.Scheduled=0]="Scheduled",e[e.Manual=1]="Manual"})(CS=xr.MessageAttemptTriggerType||(xr.MessageAttemptTriggerType={}));xr.MessageAttemptTriggerTypeSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var Vc=m(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.MessageAttemptOutSerializer=void 0;var Ab=Wc(),Pb=Hi(),Tb=Li(),$b=Ni();ya.MessageAttemptOutSerializer={_fromJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?Pb.MessageOutSerializer._fromJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:Tb.MessageStatusSerializer._fromJsonObject(e.status),statusText:$b.MessageStatusTextSerializer._fromJsonObject(e.statusText),timestamp:new Date(e.timestamp),triggerType:Ab.MessageAttemptTriggerTypeSerializer._fromJsonObject(e.triggerType),url:e.url}},_toJsonObject(e){return{endpointId:e.endpointId,id:e.id,msg:e.msg!=null?Pb.MessageOutSerializer._toJsonObject(e.msg):void 0,msgId:e.msgId,response:e.response,responseDurationMs:e.responseDurationMs,responseStatusCode:e.responseStatusCode,status:Tb.MessageStatusSerializer._toJsonObject(e.status),statusText:$b.MessageStatusTextSerializer._toJsonObject(e.statusText),timestamp:e.timestamp,triggerType:Ab.MessageAttemptTriggerTypeSerializer._toJsonObject(e.triggerType),url:e.url}}}});var Db=m(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.ListResponseMessageAttemptOutSerializer=void 0;var jb=Vc();_a.ListResponseMessageAttemptOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>jb.MessageAttemptOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>jb.MessageAttemptOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Rb=m(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.MessageEndpointOutSerializer=void 0;var Ib=Li(),qb=Ni();wa.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:Ib.MessageStatusSerializer._fromJsonObject(e.status),statusText:qb.MessageStatusTextSerializer._fromJsonObject(e.statusText),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:Ib.MessageStatusSerializer._toJsonObject(e.status),statusText:qb.MessageStatusTextSerializer._toJsonObject(e.statusText),uid:e.uid,updatedAt:e.updatedAt,url:e.url,version:e.version}}}});var zb=m(Ca=>{"use strict";Object.defineProperty(Ca,"__esModule",{value:!0});Ca.ListResponseMessageEndpointOutSerializer=void 0;var Mb=Rb();Ca.ListResponseMessageEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Mb.MessageEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Mb.MessageEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Jb=m(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.MessageAttempt=void 0;var SS=Uc(),OS=Eb(),Fb=Db(),xS=zb(),kS=Vc(),st=be(),Kc=class{constructor(t){this.requestCtx=t}listByEndpoint(t,r,i){let n=new st.SvixRequest(st.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,Fb.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listByMsg(t,r,i){let n=new st.SvixRequest(st.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,Fb.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listAttemptedMessages(t,r,i){let n=new st.SvixRequest(st.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,OS.ListResponseEndpointMessageOutSerializer._fromJsonObject)}get(t,r,i){let n=new st.SvixRequest(st.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,kS.MessageAttemptOutSerializer._fromJsonObject)}expungeContent(t,r,i){let n=new st.SvixRequest(st.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 st.SvixRequest(st.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,xS.ListResponseMessageEndpointOutSerializer._fromJsonObject)}resend(t,r,i,n){let s=new st.SvixRequest(st.HttpMethod.POST,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend");return s.setPathParam("app_id",t),s.setPathParam("msg_id",r),s.setPathParam("endpoint_id",i),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.send(this.requestCtx,SS.EmptyResponseSerializer._fromJsonObject)}};Sa.MessageAttempt=Kc});var Yc=m(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.OperationalWebhookEndpointOutSerializer=void 0;Oa.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 Hb=m(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.ListResponseOperationalWebhookEndpointOutSerializer=void 0;var Bb=Yc();xa.ListResponseOperationalWebhookEndpointOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>Bb.OperationalWebhookEndpointOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>Bb.OperationalWebhookEndpointOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var Lb=m(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.OperationalWebhookEndpointHeadersInSerializer=void 0;ka.OperationalWebhookEndpointHeadersInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var Nb=m(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.OperationalWebhookEndpointHeadersOutSerializer=void 0;Ea.OperationalWebhookEndpointHeadersOutSerializer={_fromJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}},_toJsonObject(e){return{headers:e.headers,sensitive:e.sensitive}}}});var Gb=m(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.OperationalWebhookEndpointInSerializer=void 0;Aa.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 Ub=m(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.OperationalWebhookEndpointSecretInSerializer=void 0;Pa.OperationalWebhookEndpointSecretInSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Wb=m(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.OperationalWebhookEndpointSecretOutSerializer=void 0;Ta.OperationalWebhookEndpointSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var Vb=m($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.OperationalWebhookEndpointUpdateSerializer=void 0;$a.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 Xc=m(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.OperationalWebhookEndpoint=void 0;var ES=Hb(),AS=Lb(),PS=Nb(),TS=Gb(),Qc=Yc(),$S=Ub(),jS=Wb(),DS=Vb(),Ie=be(),Zc=class{constructor(t){this.requestCtx=t}list(t){let r=new Ie.SvixRequest(Ie.HttpMethod.GET,"/api/v1/operational-webhook/endpoint");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,ES.ListResponseOperationalWebhookEndpointOutSerializer._fromJsonObject)}create(t,r){let i=new Ie.SvixRequest(Ie.HttpMethod.POST,"/api/v1/operational-webhook/endpoint");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(TS.OperationalWebhookEndpointInSerializer._toJsonObject(t)),i.send(this.requestCtx,Qc.OperationalWebhookEndpointOutSerializer._fromJsonObject)}get(t){let r=new Ie.SvixRequest(Ie.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,Qc.OperationalWebhookEndpointOutSerializer._fromJsonObject)}update(t,r){let i=new Ie.SvixRequest(Ie.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return i.setPathParam("endpoint_id",t),i.setBody(DS.OperationalWebhookEndpointUpdateSerializer._toJsonObject(r)),i.send(this.requestCtx,Qc.OperationalWebhookEndpointOutSerializer._fromJsonObject)}delete(t){let r=new Ie.SvixRequest(Ie.HttpMethod.DELETE,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return r.setPathParam("endpoint_id",t),r.sendNoResponseBody(this.requestCtx)}getHeaders(t){let r=new Ie.SvixRequest(Ie.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,PS.OperationalWebhookEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(t,r){let i=new Ie.SvixRequest(Ie.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return i.setPathParam("endpoint_id",t),i.setBody(AS.OperationalWebhookEndpointHeadersInSerializer._toJsonObject(r)),i.sendNoResponseBody(this.requestCtx)}getSecret(t){let r=new Ie.SvixRequest(Ie.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret");return r.setPathParam("endpoint_id",t),r.send(this.requestCtx,jS.OperationalWebhookEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i){let n=new Ie.SvixRequest(Ie.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($S.OperationalWebhookEndpointSecretInSerializer._toJsonObject(r)),n.sendNoResponseBody(this.requestCtx)}};ja.OperationalWebhookEndpoint=Zc});var Kb=m(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.OperationalWebhook=void 0;var IS=Xc(),ed=class{constructor(t){this.requestCtx=t}get endpoint(){return new IS.OperationalWebhookEndpoint(this.requestCtx)}};Da.OperationalWebhook=ed});var Zb=m(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.AggregateEventTypesOutSerializer=void 0;var Yb=tr(),Qb=rr();Ia.AggregateEventTypesOutSerializer={_fromJsonObject(e){return{id:e.id,status:Yb.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:Qb.BackgroundTaskTypeSerializer._fromJsonObject(e.task)}},_toJsonObject(e){return{id:e.id,status:Yb.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:Qb.BackgroundTaskTypeSerializer._toJsonObject(e.task)}}}});var Xb=m(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.AppUsageStatsInSerializer=void 0;qa.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 r0=m(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.AppUsageStatsOutSerializer=void 0;var e0=tr(),t0=rr();Ra.AppUsageStatsOutSerializer={_fromJsonObject(e){return{id:e.id,status:e0.BackgroundTaskStatusSerializer._fromJsonObject(e.status),task:t0.BackgroundTaskTypeSerializer._fromJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds}},_toJsonObject(e){return{id:e.id,status:e0.BackgroundTaskStatusSerializer._toJsonObject(e.status),task:t0.BackgroundTaskTypeSerializer._toJsonObject(e.task),unresolvedAppIds:e.unresolvedAppIds}}}});var i0=m(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.Statistics=void 0;var qS=Zb(),RS=Xb(),MS=r0(),Ma=be(),td=class{constructor(t){this.requestCtx=t}aggregateAppStats(t,r){let i=new Ma.SvixRequest(Ma.HttpMethod.POST,"/api/v1/stats/usage/app");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(RS.AppUsageStatsInSerializer._toJsonObject(t)),i.send(this.requestCtx,MS.AppUsageStatsOutSerializer._fromJsonObject)}aggregateEventTypes(){return new Ma.SvixRequest(Ma.HttpMethod.PUT,"/api/v1/stats/usage/event-types").send(this.requestCtx,qS.AggregateEventTypesOutSerializer._fromJsonObject)}};za.Statistics=td});var n0=m(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.HttpSinkHeadersPatchInSerializer=void 0;Fa.HttpSinkHeadersPatchInSerializer={_fromJsonObject(e){return{headers:e.headers}},_toJsonObject(e){return{headers:e.headers}}}});var s0=m(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.SinkTransformationOutSerializer=void 0;Ja.SinkTransformationOutSerializer={_fromJsonObject(e){return{code:e.code,enabled:e.enabled}},_toJsonObject(e){return{code:e.code,enabled:e.enabled}}}});var rd=m(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.StreamEventTypeOutSerializer=void 0;Ba.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 a0=m(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.ListResponseStreamEventTypeOutSerializer=void 0;var o0=rd();Ha.ListResponseStreamEventTypeOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>o0.StreamEventTypeOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>o0.StreamEventTypeOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var l0=m(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.StreamEventTypeInSerializer=void 0;La.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 u0=m(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.StreamEventTypePatchSerializer=void 0;Na.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 d0=m(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.StreamingEventType=void 0;var zS=a0(),c0=l0(),Ga=rd(),FS=u0(),St=be(),id=class{constructor(t){this.requestCtx=t}list(t){let r=new St.SvixRequest(St.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,zS.ListResponseStreamEventTypeOutSerializer._fromJsonObject)}create(t,r){let i=new St.SvixRequest(St.HttpMethod.POST,"/api/v1/stream/event-type");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(c0.StreamEventTypeInSerializer._toJsonObject(t)),i.send(this.requestCtx,Ga.StreamEventTypeOutSerializer._fromJsonObject)}get(t){let r=new St.SvixRequest(St.HttpMethod.GET,"/api/v1/stream/event-type/{name}");return r.setPathParam("name",t),r.send(this.requestCtx,Ga.StreamEventTypeOutSerializer._fromJsonObject)}update(t,r){let i=new St.SvixRequest(St.HttpMethod.PUT,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setBody(c0.StreamEventTypeInSerializer._toJsonObject(r)),i.send(this.requestCtx,Ga.StreamEventTypeOutSerializer._fromJsonObject)}delete(t,r){let i=new St.SvixRequest(St.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 St.SvixRequest(St.HttpMethod.PATCH,"/api/v1/stream/event-type/{name}");return i.setPathParam("name",t),i.setBody(FS.StreamEventTypePatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Ga.StreamEventTypeOutSerializer._fromJsonObject)}};Ua.StreamingEventType=id});var p0=m(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.EventInSerializer=void 0;Wa.EventInSerializer={_fromJsonObject(e){return{eventType:e.eventType,payload:e.payload}},_toJsonObject(e){return{eventType:e.eventType,payload:e.payload}}}});var nd=m(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.StreamInSerializer=void 0;Va.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 h0=m(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.CreateStreamEventsInSerializer=void 0;var m0=p0(),f0=nd();Ka.CreateStreamEventsInSerializer={_fromJsonObject(e){return{events:e.events.map(t=>m0.EventInSerializer._fromJsonObject(t)),stream:e.stream!=null?f0.StreamInSerializer._fromJsonObject(e.stream):void 0}},_toJsonObject(e){return{events:e.events.map(t=>m0.EventInSerializer._toJsonObject(t)),stream:e.stream!=null?f0.StreamInSerializer._toJsonObject(e.stream):void 0}}}});var g0=m(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.CreateStreamEventsOutSerializer=void 0;Ya.CreateStreamEventsOutSerializer={_fromJsonObject(e){return{}},_toJsonObject(e){return{}}}});var b0=m(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.EventOutSerializer=void 0;Qa.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 y0=m(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.EventStreamOutSerializer=void 0;var v0=b0();Za.EventStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>v0.EventOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator}},_toJsonObject(e){return{data:e.data.map(t=>v0.EventOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator}}}});var _0=m(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.StreamingEvents=void 0;var JS=h0(),BS=g0(),HS=y0(),Xa=be(),sd=class{constructor(t){this.requestCtx=t}create(t,r,i){let n=new Xa.SvixRequest(Xa.HttpMethod.POST,"/api/v1/stream/{stream_id}/events");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(JS.CreateStreamEventsInSerializer._toJsonObject(r)),n.send(this.requestCtx,BS.CreateStreamEventsOutSerializer._fromJsonObject)}get(t,r,i){let n=new Xa.SvixRequest(Xa.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,HS.EventStreamOutSerializer._fromJsonObject)}};el.StreamingEvents=sd});var od=m(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.AzureBlobStorageConfigSerializer=void 0;tl.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 ad=m(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.GoogleCloudStorageConfigSerializer=void 0;rl.GoogleCloudStorageConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var ld=m(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.S3ConfigSerializer=void 0;il.S3ConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,region:e.region,secretAccessKey:e.secretAccessKey}}}});var ud=m(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.SinkHttpConfigSerializer=void 0;nl.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 cd=m(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.SinkOtelV1ConfigSerializer=void 0;sl.SinkOtelV1ConfigSerializer={_fromJsonObject(e){return{headers:e.headers,url:e.url}},_toJsonObject(e){return{headers:e.headers,url:e.url}}}});var dd=m(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.SinkStatusSerializer=kr.SinkStatus=void 0;var LS;(function(e){e.Enabled="enabled",e.Paused="paused",e.Disabled="disabled",e.Retrying="retrying"})(LS=kr.SinkStatus||(kr.SinkStatus={}));kr.SinkStatusSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var pd=m(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.StreamSinkOutSerializer=void 0;var w0=od(),C0=ad(),S0=ld(),O0=ud(),x0=cd(),k0=dd();ol.StreamSinkOutSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return w0.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return x0.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return O0.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return S0.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return C0.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:k0.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=w0.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=x0.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=O0.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=S0.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=C0.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:k0.SinkStatusSerializer._toJsonObject(e.status),uid:e.uid,updatedAt:e.updatedAt}}}});var A0=m(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.ListResponseStreamSinkOutSerializer=void 0;var E0=pd();al.ListResponseStreamSinkOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>E0.StreamSinkOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>E0.StreamSinkOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var P0=m(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.SinkSecretOutSerializer=void 0;ll.SinkSecretOutSerializer={_fromJsonObject(e){return{key:e.key}},_toJsonObject(e){return{key:e.key}}}});var T0=m(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.SinkTransformInSerializer=void 0;ul.SinkTransformInSerializer={_fromJsonObject(e){return{code:e.code}},_toJsonObject(e){return{code:e.code}}}});var cl=m(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.SinkStatusInSerializer=Er.SinkStatusIn=void 0;var NS;(function(e){e.Enabled="enabled",e.Disabled="disabled"})(NS=Er.SinkStatusIn||(Er.SinkStatusIn={}));Er.SinkStatusInSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var M0=m(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.StreamSinkInSerializer=void 0;var $0=od(),j0=ad(),D0=ld(),I0=ud(),q0=cd(),R0=cl();dl.StreamSinkInSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return $0.AzureBlobStorageConfigSerializer._fromJsonObject(e.config);case"otelTracing":return q0.SinkOtelV1ConfigSerializer._fromJsonObject(e.config);case"http":return I0.SinkHttpConfigSerializer._fromJsonObject(e.config);case"amazonS3":return D0.S3ConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return j0.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?R0.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=$0.AzureBlobStorageConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=q0.SinkOtelV1ConfigSerializer._toJsonObject(e.config);break;case"http":t=I0.SinkHttpConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=D0.S3ConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=j0.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?R0.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var z0=m(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});pl.AmazonS3PatchConfigSerializer=void 0;pl.AmazonS3PatchConfigSerializer={_fromJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,region:e.region,secretAccessKey:e.secretAccessKey}},_toJsonObject(e){return{accessKeyId:e.accessKeyId,bucket:e.bucket,region:e.region,secretAccessKey:e.secretAccessKey}}}});var F0=m(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});ml.AzureBlobStoragePatchConfigSerializer=void 0;ml.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 J0=m(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.GoogleCloudStoragePatchConfigSerializer=void 0;fl.GoogleCloudStoragePatchConfigSerializer={_fromJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}},_toJsonObject(e){return{bucket:e.bucket,credentials:e.credentials}}}});var B0=m(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.HttpPatchConfigSerializer=void 0;hl.HttpPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var H0=m(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.OtelTracingPatchConfigSerializer=void 0;gl.OtelTracingPatchConfigSerializer={_fromJsonObject(e){return{url:e.url}},_toJsonObject(e){return{url:e.url}}}});var K0=m(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.StreamSinkPatchSerializer=void 0;var L0=z0(),N0=F0(),G0=J0(),U0=B0(),W0=H0(),V0=cl();bl.StreamSinkPatchSerializer={_fromJsonObject(e){let t=e.type;function r(i){switch(i){case"poller":return{};case"azureBlobStorage":return N0.AzureBlobStoragePatchConfigSerializer._fromJsonObject(e.config);case"otelTracing":return W0.OtelTracingPatchConfigSerializer._fromJsonObject(e.config);case"http":return U0.HttpPatchConfigSerializer._fromJsonObject(e.config);case"amazonS3":return L0.AmazonS3PatchConfigSerializer._fromJsonObject(e.config);case"googleCloudStorage":return G0.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?V0.SinkStatusInSerializer._fromJsonObject(e.status):void 0,uid:e.uid}},_toJsonObject(e){let t;switch(e.type){case"poller":t={};break;case"azureBlobStorage":t=N0.AzureBlobStoragePatchConfigSerializer._toJsonObject(e.config);break;case"otelTracing":t=W0.OtelTracingPatchConfigSerializer._toJsonObject(e.config);break;case"http":t=U0.HttpPatchConfigSerializer._toJsonObject(e.config);break;case"amazonS3":t=L0.AmazonS3PatchConfigSerializer._toJsonObject(e.config);break;case"googleCloudStorage":t=G0.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?V0.SinkStatusInSerializer._toJsonObject(e.status):void 0,uid:e.uid}}}});var Z0=m(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.StreamingSink=void 0;var Y0=Uc(),GS=kc(),US=A0(),WS=P0(),VS=T0(),Q0=M0(),vl=pd(),KS=K0(),qe=be(),md=class{constructor(t){this.requestCtx=t}list(t,r){let i=new qe.SvixRequest(qe.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,US.ListResponseStreamSinkOutSerializer._fromJsonObject)}create(t,r,i){let n=new qe.SvixRequest(qe.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink");return n.setPathParam("stream_id",t),n.setHeaderParam("idempotency-key",i?.idempotencyKey),n.setBody(Q0.StreamSinkInSerializer._toJsonObject(r)),n.send(this.requestCtx,vl.StreamSinkOutSerializer._fromJsonObject)}get(t,r){let i=new qe.SvixRequest(qe.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,vl.StreamSinkOutSerializer._fromJsonObject)}update(t,r,i){let n=new qe.SvixRequest(qe.HttpMethod.PUT,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(Q0.StreamSinkInSerializer._toJsonObject(i)),n.send(this.requestCtx,vl.StreamSinkOutSerializer._fromJsonObject)}delete(t,r){let i=new qe.SvixRequest(qe.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 qe.SvixRequest(qe.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(KS.StreamSinkPatchSerializer._toJsonObject(i)),n.send(this.requestCtx,vl.StreamSinkOutSerializer._fromJsonObject)}getSecret(t,r){let i=new qe.SvixRequest(qe.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,WS.SinkSecretOutSerializer._fromJsonObject)}rotateSecret(t,r,i,n){let s=new qe.SvixRequest(qe.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate");return s.setPathParam("stream_id",t),s.setPathParam("sink_id",r),s.setHeaderParam("idempotency-key",n?.idempotencyKey),s.setBody(GS.EndpointSecretRotateInSerializer._toJsonObject(i)),s.send(this.requestCtx,Y0.EmptyResponseSerializer._fromJsonObject)}transformationPartialUpdate(t,r,i){let n=new qe.SvixRequest(qe.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(VS.SinkTransformInSerializer._toJsonObject(i)),n.send(this.requestCtx,Y0.EmptyResponseSerializer._fromJsonObject)}};yl.StreamingSink=md});var fd=m(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.StreamOutSerializer=void 0;_l.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 ev=m(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.ListResponseStreamOutSerializer=void 0;var X0=fd();wl.ListResponseStreamOutSerializer={_fromJsonObject(e){return{data:e.data.map(t=>X0.StreamOutSerializer._fromJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}},_toJsonObject(e){return{data:e.data.map(t=>X0.StreamOutSerializer._toJsonObject(t)),done:e.done,iterator:e.iterator,prevIterator:e.prevIterator}}}});var tv=m(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.StreamPatchSerializer=void 0;Cl.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 iv=m(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.StreamingStream=void 0;var YS=ev(),rv=nd(),Sl=fd(),QS=tv(),Ot=be(),hd=class{constructor(t){this.requestCtx=t}list(t){let r=new Ot.SvixRequest(Ot.HttpMethod.GET,"/api/v1/stream");return r.setQueryParams({limit:t?.limit,iterator:t?.iterator,order:t?.order}),r.send(this.requestCtx,YS.ListResponseStreamOutSerializer._fromJsonObject)}create(t,r){let i=new Ot.SvixRequest(Ot.HttpMethod.POST,"/api/v1/stream");return i.setHeaderParam("idempotency-key",r?.idempotencyKey),i.setBody(rv.StreamInSerializer._toJsonObject(t)),i.send(this.requestCtx,Sl.StreamOutSerializer._fromJsonObject)}get(t){let r=new Ot.SvixRequest(Ot.HttpMethod.GET,"/api/v1/stream/{stream_id}");return r.setPathParam("stream_id",t),r.send(this.requestCtx,Sl.StreamOutSerializer._fromJsonObject)}update(t,r){let i=new Ot.SvixRequest(Ot.HttpMethod.PUT,"/api/v1/stream/{stream_id}");return i.setPathParam("stream_id",t),i.setBody(rv.StreamInSerializer._toJsonObject(r)),i.send(this.requestCtx,Sl.StreamOutSerializer._fromJsonObject)}delete(t){let r=new Ot.SvixRequest(Ot.HttpMethod.DELETE,"/api/v1/stream/{stream_id}");return r.setPathParam("stream_id",t),r.sendNoResponseBody(this.requestCtx)}patch(t,r){let i=new Ot.SvixRequest(Ot.HttpMethod.PATCH,"/api/v1/stream/{stream_id}");return i.setPathParam("stream_id",t),i.setBody(QS.StreamPatchSerializer._toJsonObject(r)),i.send(this.requestCtx,Sl.StreamOutSerializer._fromJsonObject)}};Ol.StreamingStream=hd});var sv=m(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.Streaming=void 0;var nv=Oc(),ZS=n0(),XS=s0(),eO=d0(),tO=_0(),rO=Z0(),iO=iv(),Kr=be(),gd=class{constructor(t){this.requestCtx=t}get event_type(){return new eO.StreamingEventType(this.requestCtx)}get events(){return new tO.StreamingEvents(this.requestCtx)}get sink(){return new rO.StreamingSink(this.requestCtx)}get stream(){return new iO.StreamingStream(this.requestCtx)}sinkHeadersGet(t,r){let i=new Kr.SvixRequest(Kr.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,nv.EndpointHeadersOutSerializer._fromJsonObject)}sinkHeadersPatch(t,r,i){let n=new Kr.SvixRequest(Kr.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return n.setPathParam("stream_id",t),n.setPathParam("sink_id",r),n.setBody(ZS.HttpSinkHeadersPatchInSerializer._toJsonObject(i)),n.send(this.requestCtx,nv.EndpointHeadersOutSerializer._fromJsonObject)}sinkTransformationGet(t,r){let i=new Kr.SvixRequest(Kr.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,XS.SinkTransformationOutSerializer._fromJsonObject)}};xl.Streaming=gd});var ov=m(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.HTTPValidationError=ir.ValidationError=ir.HttpErrorOut=void 0;var Yr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};ir.HttpErrorOut=Yr;Yr.discriminator=void 0;Yr.mapping=void 0;Yr.attributeTypeMap=[{name:"code",baseName:"code",type:"string",format:""},{name:"detail",baseName:"detail",type:"string",format:""}];var Qr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};ir.ValidationError=Qr;Qr.discriminator=void 0;Qr.mapping=void 0;Qr.attributeTypeMap=[{name:"loc",baseName:"loc",type:"Array<string>",format:""},{name:"msg",baseName:"msg",type:"string",format:""},{name:"type",baseName:"type",type:"string",format:""}];var Zr=class e{static getAttributeTypeMap(){return e.attributeTypeMap}};ir.HTTPValidationError=Zr;Zr.discriminator=void 0;Zr.mapping=void 0;Zr.attributeTypeMap=[{name:"detail",baseName:"detail",type:"Array<ValidationError>",format:""}]});var lv=m(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});kl.timingSafeEqual=void 0;function av(e,t=""){if(!e)throw new Error(t)}function nO(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)),av(e instanceof DataView),av(t instanceof DataView);let r=e.byteLength,i=0,n=-1;for(;++n<r;)i|=e.getUint8(n)^t.getUint8(n);return i===0}kl.timingSafeEqual=nO});var dv=m(pt=>{"use strict";var sO=pt&&pt.__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 s in n)n.hasOwnProperty(s)&&(i[s]=n[s])},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(pt,"__esModule",{value:!0});var Oe=256,bd=(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 s=t.length-i;if(s>0){var n=t[i]<<16|(s===2?t[i+1]<<8:0);r+=this._encodeByte(n>>>18&63),r+=this._encodeByte(n>>>12&63),s===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)),s=0,o=0,a=0,l=0,u=0,c=0,d=0;o<i-4;o+=4)l=this._decodeChar(t.charCodeAt(o+0)),u=this._decodeChar(t.charCodeAt(o+1)),c=this._decodeChar(t.charCodeAt(o+2)),d=this._decodeChar(t.charCodeAt(o+3)),n[s++]=l<<2|u>>>4,n[s++]=u<<4|c>>>2,n[s++]=c<<6|d,a|=l&Oe,a|=u&Oe,a|=c&Oe,a|=d&Oe;if(o<i-1&&(l=this._decodeChar(t.charCodeAt(o)),u=this._decodeChar(t.charCodeAt(o+1)),n[s++]=l<<2|u>>>4,a|=l&Oe,a|=u&Oe),o<i-2&&(c=this._decodeChar(t.charCodeAt(o+2)),n[s++]=u<<4|c>>>2,a|=c&Oe),o<i-3&&(d=this._decodeChar(t.charCodeAt(o+3)),n[s++]=c<<6|d,a|=d&Oe),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=Oe;return r+=(42-t&t-44)>>>8&-Oe+t-43+62,r+=(46-t&t-48)>>>8&-Oe+t-47+63,r+=(47-t&t-58)>>>8&-Oe+t-48+52,r+=(64-t&t-91)>>>8&-Oe+t-65+0,r+=(96-t&t-123)>>>8&-Oe+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})();pt.Coder=bd;var Gi=new bd;function oO(e){return Gi.encode(e)}pt.encode=oO;function aO(e){return Gi.decode(e)}pt.decode=aO;var uv=(function(e){sO(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=Oe;return i+=(44-r&r-46)>>>8&-Oe+r-45+62,i+=(94-r&r-96)>>>8&-Oe+r-95+63,i+=(47-r&r-58)>>>8&-Oe+r-48+52,i+=(64-r&r-91)>>>8&-Oe+r-65+0,i+=(96-r&r-123)>>>8&-Oe+r-97+26,i},t})(bd);pt.URLSafeCoder=uv;var cv=new uv;function lO(e){return cv.encode(e)}pt.encodeURLSafe=lO;function uO(e){return cv.decode(e)}pt.decodeURLSafe=uO;pt.encodedLength=function(e){return Gi.encodedLength(e)};pt.maxDecodedLength=function(e){return Gi.maxDecodedLength(e)};pt.decodedLength=function(e){return Gi.decodedLength(e)}});var mv=m((pv,El)=>{(function(e,t){var r={};t(r);var i=r.default;for(var n in r)i[n]=r[n];typeof El=="object"&&typeof El.exports=="object"?El.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):e.sha256=i})(pv,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,p,v,f,b){for(var S,T,x,E,k,w,_,C,P,q,M,$,j;b>=64;){for(S=p[0],T=p[1],x=p[2],E=p[3],k=p[4],w=p[5],_=p[6],C=p[7],q=0;q<16;q++)M=f+q*4,d[q]=(v[M]&255)<<24|(v[M+1]&255)<<16|(v[M+2]&255)<<8|v[M+3]&255;for(q=16;q<64;q++)P=d[q-2],$=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=d[q-15],j=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>3,d[q]=($+d[q-7]|0)+(j+d[q-16]|0);for(q=0;q<64;q++)$=(((k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7))+(k&w^~k&_)|0)+(C+(t[q]+d[q]|0)|0)|0,j=((S>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10))+(S&T^S&x^T&x)|0,C=_,_=w,w=k,k=E+$|0,E=x,x=T,T=S,S=$+j|0;p[0]+=S,p[1]+=T,p[2]+=x,p[3]+=E,p[4]+=k,p[5]+=w,p[6]+=_,p[7]+=C,f+=64,b-=64}return f}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 p=0;p<this.buffer.length;p++)this.buffer[p]=0;for(var p=0;p<this.temp.length;p++)this.temp[p]=0;this.reset()},d.prototype.update=function(p,v){if(v===void 0&&(v=p.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this.bytesHashed+=v,this.bufferLength>0){for(;this.bufferLength<64&&v>0;)this.buffer[this.bufferLength++]=p[f++],v--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(v>=64&&(f=r(this.temp,this.state,p,f,v),v%=64);v>0;)this.buffer[this.bufferLength++]=p[f++],v--;return this},d.prototype.finish=function(p){if(!this.finished){var v=this.bytesHashed,f=this.bufferLength,b=v/536870912|0,S=v<<3,T=v%64<56?64:128;this.buffer[f]=128;for(var x=f+1;x<T-8;x++)this.buffer[x]=0;this.buffer[T-8]=b>>>24&255,this.buffer[T-7]=b>>>16&255,this.buffer[T-6]=b>>>8&255,this.buffer[T-5]=b>>>0&255,this.buffer[T-4]=S>>>24&255,this.buffer[T-3]=S>>>16&255,this.buffer[T-2]=S>>>8&255,this.buffer[T-1]=S>>>0&255,r(this.temp,this.state,this.buffer,0,T),this.finished=!0}for(var x=0;x<8;x++)p[x*4+0]=this.state[x]>>>24&255,p[x*4+1]=this.state[x]>>>16&255,p[x*4+2]=this.state[x]>>>8&255,p[x*4+3]=this.state[x]>>>0&255;return this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d.prototype._saveState=function(p){for(var v=0;v<this.state.length;v++)p[v]=this.state[v]},d.prototype._restoreState=function(p,v){for(var f=0;f<this.state.length;f++)this.state[f]=p[f];this.bytesHashed=v,this.finished=!1,this.bufferLength=0},d})();e.Hash=i;var n=(function(){function d(p){this.inner=new i,this.outer=new i,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var v=new Uint8Array(this.blockSize);if(p.length>this.blockSize)new i().update(p).finish(v).clean();else for(var f=0;f<p.length;f++)v[f]=p[f];for(var f=0;f<v.length;f++)v[f]^=54;this.inner.update(v);for(var f=0;f<v.length;f++)v[f]^=106;this.outer.update(v),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var f=0;f<v.length;f++)v[f]=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 p=0;p<this.istate.length;p++)this.ostate[p]=this.istate[p]=0;this.inner.clean(),this.outer.clean()},d.prototype.update=function(p){return this.inner.update(p),this},d.prototype.finish=function(p){return this.outer.finished?this.outer.finish(p):(this.inner.finish(p),this.outer.update(p,this.digestLength).finish(p)),this},d.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},d})();e.HMAC=n;function s(d){var p=new i().update(d),v=p.digest();return p.clean(),v}e.hash=s,e.default=s;function o(d,p){var v=new n(d).update(p),f=v.digest();return v.clean(),f}e.hmac=o;function a(d,p,v,f){var b=f[0];if(b===0)throw new Error("hkdf: cannot expand more");p.reset(),b>1&&p.update(d),v&&p.update(v),p.update(f),p.finish(d),f[0]++}var l=new Uint8Array(e.digestLength);function u(d,p,v,f){p===void 0&&(p=l),f===void 0&&(f=32);for(var b=new Uint8Array([1]),S=o(p,d),T=new n(S),x=new Uint8Array(T.digestLength),E=x.length,k=new Uint8Array(f),w=0;w<f;w++)E===x.length&&(a(x,T,v,b),E=0),k[w]=x[E++];return T.clean(),x.fill(0),b.fill(0),k}e.hkdf=u;function c(d,p,v,f){for(var b=new n(d),S=b.digestLength,T=new Uint8Array(4),x=new Uint8Array(S),E=new Uint8Array(S),k=new Uint8Array(f),w=0;w*S<f;w++){var _=w+1;T[0]=_>>>24&255,T[1]=_>>>16&255,T[2]=_>>>8&255,T[3]=_>>>0&255,b.reset(),b.update(p),b.update(T),b.finish(E);for(var C=0;C<S;C++)x[C]=E[C];for(var C=2;C<=v;C++){b.reset(),b.update(E).finish(E);for(var P=0;P<S;P++)x[P]^=E[P]}for(var C=0;C<S&&w*S+C<f;C++)k[w*S+C]=x[C]}for(var w=0;w<S;w++)x[w]=E[w]=0;for(var w=0;w<4;w++)T[w]=0;return b.clean(),k}e.pbkdf2=c})});var yd=m(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.Webhook=Xr.WebhookVerificationError=void 0;var cO=lv(),fv=dv(),dO=mv(),hv=300,vd=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="ExtendableError",this.stack=new Error(t).stack}},nr=class e extends vd{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype),this.name="WebhookVerificationError"}};Xr.WebhookVerificationError=nr;var Al=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=fv.decode(t)}}verify(t,r){let i={};for(let p of Object.keys(r))i[p.toLowerCase()]=r[p];let n=i["webhook-id"],s=i["webhook-signature"],o=i["webhook-timestamp"];if(!s||!n||!o)throw new nr("Missing required headers");let a=this.verifyTimestamp(o),u=this.sign(n,a,t).split(",")[1],c=s.split(" "),d=new globalThis.TextEncoder;for(let p of c){let[v,f]=p.split(",");if(v==="v1"&&(0,cO.timingSafeEqual)(d.encode(f),d.encode(u)))return JSON.parse(t.toString())}throw new nr("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,s=Math.floor(r.getTime()/1e3),o=n.encode(`${t}.${s}.${i}`);return`v1,${fv.encode(dO.hmac(this.key,o))}`}verifyTimestamp(t){let r=Math.floor(Date.now()/1e3),i=parseInt(t,10);if(isNaN(i))throw new nr("Invalid Signature Headers");if(r-i>hv)throw new nr("Message timestamp too old");if(i>r+hv)throw new nr("Message timestamp too new");return new Date(i*1e3)}};Xr.Webhook=Al;Al.prefix="whsec_"});var gv=m(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.Webhook=ei.WebhookVerificationError=void 0;var pO=yd(),mO=yd();Object.defineProperty(ei,"WebhookVerificationError",{enumerable:!0,get:function(){return mO.WebhookVerificationError}});var _d=class{constructor(t,r){this.inner=new pO.Webhook(t,r)}verify(t,r){var i,n,s,o,a,l;let u={};for(let c of Object.keys(r))u[c.toLowerCase()]=r[c];return u["webhook-id"]=(n=(i=u["svix-id"])!==null&&i!==void 0?i:u["webhook-id"])!==null&&n!==void 0?n:"",u["webhook-signature"]=(o=(s=u["svix-signature"])!==null&&s!==void 0?s:u["webhook-signature"])!==null&&o!==void 0?o:"",u["webhook-timestamp"]=(l=(a=u["svix-timestamp"])!==null&&a!==void 0?a:u["webhook-timestamp"])!==null&&l!==void 0?l:"",this.inner.verify(t,u)}sign(t,r,i){return this.inner.sign(t,r,i)}};ei.Webhook=_d});var bv=m(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.EndpointDisabledTriggerSerializer=Ar.EndpointDisabledTrigger=void 0;var fO;(function(e){e.Manual="manual",e.Automatic="automatic"})(fO=Ar.EndpointDisabledTrigger||(Ar.EndpointDisabledTrigger={}));Ar.EndpointDisabledTriggerSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var vv=m(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.OrderingSerializer=Pr.Ordering=void 0;var hO;(function(e){e.Ascending="ascending",e.Descending="descending"})(hO=Pr.Ordering||(Pr.Ordering={}));Pr.OrderingSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var yv=m(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.StatusCodeClassSerializer=Tr.StatusCodeClass=void 0;var gO;(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"})(gO=Tr.StatusCodeClass||(Tr.StatusCodeClass={}));Tr.StatusCodeClassSerializer={_fromJsonObject(e){return e},_toJsonObject(e){return e}}});var _v=m(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.StatusCodeClass=oe.SinkStatusIn=oe.SinkStatus=oe.Ordering=oe.MessageStatusText=oe.MessageStatus=oe.MessageAttemptTriggerType=oe.EndpointDisabledTrigger=oe.ConnectorProduct=oe.ConnectorKind=oe.BackgroundTaskType=oe.BackgroundTaskStatus=oe.AppPortalCapability=void 0;var bO=bc();Object.defineProperty(oe,"AppPortalCapability",{enumerable:!0,get:function(){return bO.AppPortalCapability}});var vO=tr();Object.defineProperty(oe,"BackgroundTaskStatus",{enumerable:!0,get:function(){return vO.BackgroundTaskStatus}});var yO=rr();Object.defineProperty(oe,"BackgroundTaskType",{enumerable:!0,get:function(){return yO.BackgroundTaskType}});var _O=Ur();Object.defineProperty(oe,"ConnectorKind",{enumerable:!0,get:function(){return _O.ConnectorKind}});var wO=es();Object.defineProperty(oe,"ConnectorProduct",{enumerable:!0,get:function(){return wO.ConnectorProduct}});var CO=bv();Object.defineProperty(oe,"EndpointDisabledTrigger",{enumerable:!0,get:function(){return CO.EndpointDisabledTrigger}});var SO=Wc();Object.defineProperty(oe,"MessageAttemptTriggerType",{enumerable:!0,get:function(){return SO.MessageAttemptTriggerType}});var OO=Li();Object.defineProperty(oe,"MessageStatus",{enumerable:!0,get:function(){return OO.MessageStatus}});var xO=Ni();Object.defineProperty(oe,"MessageStatusText",{enumerable:!0,get:function(){return xO.MessageStatusText}});var kO=vv();Object.defineProperty(oe,"Ordering",{enumerable:!0,get:function(){return kO.Ordering}});var EO=dd();Object.defineProperty(oe,"SinkStatus",{enumerable:!0,get:function(){return EO.SinkStatus}});var AO=cl();Object.defineProperty(oe,"SinkStatusIn",{enumerable:!0,get:function(){return AO.SinkStatusIn}});var PO=yv();Object.defineProperty(oe,"StatusCodeClass",{enumerable:!0,get:function(){return PO.StatusCodeClass}})});var Cv=m(xe=>{"use strict";var TO=xe&&xe.__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]})),wv=xe&&xe.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&TO(t,e,r)};Object.defineProperty(xe,"__esModule",{value:!0});xe.Svix=xe.messageInRaw=xe.ValidationError=xe.HttpErrorOut=xe.HTTPValidationError=xe.ApiException=void 0;var $O=Nm(),jO=tf(),DO=af(),IO=vf(),qO=Jf(),RO=Wf(),MO=nh(),zO=oh(),FO=Zg(),JO=sb(),BO=Gc(),HO=Jb(),LO=Kb(),NO=i0(),GO=sv(),UO=Xc(),WO=ic();Object.defineProperty(xe,"ApiException",{enumerable:!0,get:function(){return WO.ApiException}});var Cd=ov();Object.defineProperty(xe,"HTTPValidationError",{enumerable:!0,get:function(){return Cd.HTTPValidationError}});Object.defineProperty(xe,"HttpErrorOut",{enumerable:!0,get:function(){return Cd.HttpErrorOut}});Object.defineProperty(xe,"ValidationError",{enumerable:!0,get:function(){return Cd.ValidationError}});wv(gv(),xe);wv(_v(),xe);var VO=Gc();Object.defineProperty(xe,"messageInRaw",{enumerable:!0,get:function(){return VO.messageInRaw}});var KO=[{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"}],wd=class{constructor(t,r={}){var i,n,s;let o=(i=KO.find(l=>l.region===t.split(".")[1]))===null||i===void 0?void 0:i.url,a=(s=(n=r.serverUrl)!==null&&n!==void 0?n:o)!==null&&s!==void 0?s:"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 $O.Application(this.requestCtx)}get authentication(){return new jO.Authentication(this.requestCtx)}get backgroundTask(){return new DO.BackgroundTask(this.requestCtx)}get connector(){return new IO.Connector(this.requestCtx)}get endpoint(){return new qO.Endpoint(this.requestCtx)}get environment(){return new RO.Environment(this.requestCtx)}get eventType(){return new MO.EventType(this.requestCtx)}get health(){return new zO.Health(this.requestCtx)}get ingest(){return new FO.Ingest(this.requestCtx)}get integration(){return new JO.Integration(this.requestCtx)}get message(){return new BO.Message(this.requestCtx)}get messageAttempt(){return new HO.MessageAttempt(this.requestCtx)}get operationalWebhook(){return new LO.OperationalWebhook(this.requestCtx)}get statistics(){return new NO.Statistics(this.requestCtx)}get streaming(){return new GO.Streaming(this.requestCtx)}get operationalWebhookEndpoint(){return new UO.OperationalWebhookEndpoint(this.requestCtx)}};xe.Svix=wd});var Od={};Lr(Od,{FileBackend:()=>Sd});var Sd,xd=ee(()=>{"use strict";We();Sd=class{name="plaintext file";isSecure=!1;async get(t,r){let i=Be();return i?i.profiles[r]?.api_key??null:null}async set(t,r,i){kd(i,r)}async delete(t,r){try{return Ed(r),!0}catch{return!1}}async isAvailable(){return!0}}});var jv={};Lr(jv,{MacOSBackend:()=>Pd});function Ad(e,t){return new Promise(r=>{(0,$v.execFile)(e,t,{timeout:5e3},(i,n,s)=>{let o=i&&"code"in i?i.code:0;r({stdout:n??"",stderr:s??"",code:o})})})}var $v,Pd,Dv=ee(()=>{"use strict";$v=require("node:child_process");Pd=class{name="macOS Keychain";isSecure=!0;async get(t,r){let{stdout:i,stderr:n,code:s}=await Ad("/usr/bin/security",["find-generic-password","-s",t,"-a",r,"-w"]);if(s===44)return null;if(s!==0)throw new Error(`Failed to read from macOS Keychain (exit code ${s}): ${n.trim()}`);return i.trim()||null}async set(t,r,i){let{code:n,stderr:s}=await Ad("/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: ${s.trim()}`)}async delete(t,r){let{code:i}=await Ad("/usr/bin/security",["delete-generic-password","-s",t,"-a",r]);return i===0}async isAvailable(){return process.platform==="darwin"}}});var Iv={};Lr(Iv,{LinuxBackend:()=>Td});function Tl(e,t,r){return new Promise(i=>{(0,$l.execFile)(e,t,{timeout:r?.timeout??5e3},(n,s,o)=>{let a=n&&"code"in n?n.code:0;i({stdout:s??"",stderr:o??"",code:a})})})}function yx(e,t,r){return new Promise(i=>{let n=(0,$l.spawn)(e,t,{stdio:["pipe","ignore","pipe"],timeout:5e3}),s="";n.stderr?.on("data",o=>{s+=o.toString()}),n.on("close",o=>{i({code:o,stderr:s})}),n.on("error",()=>{i({code:1,stderr:"Failed to spawn process"})}),n.stdin?.on("error",()=>{}),n.stdin?.write(r),n.stdin?.end()})}var $l,Td,qv=ee(()=>{"use strict";$l=require("node:child_process");Td=class{name="Secret Service (libsecret)";isSecure=!0;async get(t,r){let{stdout:i,code:n}=await Tl("secret-tool",["lookup","service",t,"account",r]);return n!==0||!i.trim()?null:i.trim()}async set(t,r,i){let{code:n,stderr:s}=await yx("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: ${s.trim()}`)}async delete(t,r){let{code:i}=await Tl("secret-tool",["clear","service",t,"account",r]);return i===0}async isAvailable(){if(process.platform!=="linux"||(await Tl("which",["secret-tool"])).code!==0)return!1;let r=await Tl("secret-tool",["lookup","service","__resend_cli_probe__"],{timeout:3e3});return r.code===0||r.code===1}}});var Rv={};Lr(Rv,{WindowsBackend:()=>$d});function jl(e){return new Promise(t=>{(0,Dl.execFile)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{timeout:1e4},(r,i,n)=>{let s=r&&"code"in r?r.code:0;t({stdout:i??"",stderr:n??"",code:s})})})}function _x(e,t){return new Promise(r=>{let i=(0,Dl.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e],{stdio:["pipe","pipe","pipe"],timeout:1e4}),n="",s="";i.stdout?.on("data",o=>{n+=o.toString()}),i.stderr?.on("data",o=>{s+=o.toString()}),i.on("close",o=>{r({stdout:n,stderr:s,code:o})}),i.on("error",()=>{r({stdout:"",stderr:"Failed to spawn process",code:1})}),i.stdin?.on("error",()=>{}),i.stdin?.write(t),i.stdin?.end()})}function sr(e){return e.replace(/'/g,"''")}var Dl,Ui,$d,Mv=ee(()=>{"use strict";Dl=require("node:child_process");Ui=`
29
29
  try { $null = [Windows.Security.Credentials.PasswordVault] } catch {
30
30
  [void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
31
31
  }
32
- `,Qc=class{name="Windows Credential Manager";isSecure=!0;async get(t,r){let i=`${Ir}
32
+ `,$d=class{name="Windows Credential Manager";isSecure=!0;async get(t,r){let i=`${Ui}
33
33
  $v = New-Object Windows.Security.Credentials.PasswordVault
34
34
  try {
35
- $c = $v.Retrieve('${ht(t)}', '${ht(r)}')
35
+ $c = $v.Retrieve('${sr(t)}', '${sr(r)}')
36
36
  $c.RetrievePassword()
37
37
  Write-Output $c.Password
38
38
  } catch {
39
39
  exit 1
40
40
  }
41
- `,{stdout:n,code:s}=await ha(i);return s!==0||!n.trim()?null:n.trim()}async set(t,r,i){let n=`${Ir}
41
+ `,{stdout:n,code:s}=await jl(i);return s!==0||!n.trim()?null:n.trim()}async set(t,r,i){let n=`${Ui}
42
42
  $v = New-Object Windows.Security.Credentials.PasswordVault
43
43
  try {
44
- $c = $v.Retrieve('${ht(t)}', '${ht(r)}')
44
+ $c = $v.Retrieve('${sr(t)}', '${sr(r)}')
45
45
  $v.Remove($c)
46
46
  } catch {}
47
- `;await ha(n);let s=`${Ir}
47
+ `;await jl(n);let s=`${Ui}
48
48
  $secret = [Console]::In.ReadLine()
49
49
  $v = New-Object Windows.Security.Credentials.PasswordVault
50
- $c = New-Object Windows.Security.Credentials.PasswordCredential('${ht(t)}', '${ht(r)}', $secret)
50
+ $c = New-Object Windows.Security.Credentials.PasswordCredential('${sr(t)}', '${sr(r)}', $secret)
51
51
  $v.Add($c)
52
- `,{code:o,stderr:a}=await IC(s,i);if(o!==0)throw new Error(`Failed to store credential in Windows Credential Manager: ${a.trim()}`)}async delete(t,r){let i=`${Ir}
52
+ `,{code:o,stderr:a}=await _x(s,i);if(o!==0)throw new Error(`Failed to store credential in Windows Credential Manager: ${a.trim()}`)}async delete(t,r){let i=`${Ui}
53
53
  $v = New-Object Windows.Security.Credentials.PasswordVault
54
54
  try {
55
- $c = $v.Retrieve('${ht(t)}', '${ht(r)}')
55
+ $c = $v.Retrieve('${sr(t)}', '${sr(r)}')
56
56
  $v.Remove($c)
57
57
  } catch {
58
58
  exit 1
59
59
  }
60
- `,{code:n}=await ha(i);return n===0}async isAvailable(){if(process.platform!=="win32")return!1;let{code:t}=await ha(`${Ir} $null = New-Object Windows.Security.Credentials.PasswordVault`);return t===0}}});async function rt(){if(Qe)return Qe;let e=process.env.RESEND_CREDENTIAL_STORE;if(e==="file"){let{FileBackend:r}=await Promise.resolve().then(()=>(Gc(),Nc));return Qe=new r,Qe}if(e==="secure_storage"||e==="keychain"){let r=await Ub();if(r)return Qe=r,Qe}if(!e){let r=await Ub();if(r)return Qe=r,Qe}let{FileBackend:t}=await Promise.resolve().then(()=>(Gc(),Nc));return Qe=new t,Qe}async function Ub(){if(process.platform==="darwin"){let{MacOSBackend:e}=await Promise.resolve().then(()=>(Bb(),Fb)),t=new e;if(await t.isAvailable())return t}else if(process.platform==="linux"){let{LinuxBackend:e}=await Promise.resolve().then(()=>(Lb(),Hb)),t=new e;if(await t.isAvailable())return t}else if(process.platform==="win32"){let{WindowsBackend:e}=await Promise.resolve().then(()=>(Gb(),Nb)),t=new e;if(await t.isAvailable())return t}return null}var tt,Qe,Zc=z(()=>{"use strict";tt="resend-cli",Qe=null});function Ze(){return process.env.XDG_CONFIG_HOME?(0,qr.join)(process.env.XDG_CONFIG_HOME,"resend"):process.platform==="win32"&&process.env.APPDATA?(0,qr.join)(process.env.APPDATA,"resend"):(0,qr.join)((0,Wb.homedir)(),".config","resend")}function Rt(){return(0,qr.join)(Ze(),"credentials.json")}function he(){try{let e=JSON.parse((0,Se.readFileSync)(Rt(),"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 tr(e){let t=Ze();(0,Se.mkdirSync)(t,{recursive:!0,mode:448});let r=Rt();return(0,Se.writeFileSync)(r,`${JSON.stringify(e,null,2)}
61
- `,{mode:384}),(0,Se.chmodSync)(r,384),r}function rr(e){if(e)return e;let t=process.env.RESEND_PROFILE||process.env.RESEND_TEAM;if(t)return t;let r=he();return r?.active_profile?r.active_profile:"default"}function Uc(e,t){let r=t||"default",i=ae(r);if(i)throw new Error(i);let n=he()||{active_profile:"default",profiles:{}};return n.profiles[r]={api_key:e},Object.keys(n.profiles).length===1&&(n.active_profile=r),tr(n)}function Wc(e){let t=he();if(!t){let i=Rt();if(!(0,Se.existsSync)(i))throw new Error("No credentials file found.");return(0,Se.unlinkSync)(i),i}let r=e||rr();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=Rt();return(0,Se.unlinkSync)(i),i}return tr(t)}function ba(e){let t=ae(e);if(t)throw new Error(t);let r=he();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,tr(r)}function xe(){let e=he();return e?Object.keys(e.profiles).map(t=>({name:t,active:t===e.active_profile})):[]}function ae(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 qC(e,t){if(e===t)return;let r=ae(t);if(r)throw new Error(r);let i=he();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),tr(i)}function Mt(e){return e.length<=7?`${e.slice(0,3)}...`:`${e.slice(0,3)}...${e.slice(-4)}`}async function it(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=he(),n=t||process.env.RESEND_PROFILE||process.env.RESEND_TEAM||i?.active_profile||"default";if(i?.storage==="secure_storage"){let o=await(await rt()).get(tt,n);if(o)return{key:o,source:"secure_storage",profile:n}}if(i){let s=i.profiles[n];if(s?.api_key){let o=await rt();if(o.isSecure)try{await o.set(tt,n,s.api_key),i.profiles[n]={},i.storage="secure_storage",tr(i),process.stderr.write(`Notice: API key for profile "${n}" has been moved to ${o.name}
62
- `)}catch{}return{key:s.api_key,source:"config",profile:n}}}return null}async function Vb(e,t){let r=t||"default",i=ae(r);if(i)throw new Error(i);let n=await rt();if(!n.isSecure)return{configPath:Uc(e,r),backend:n};await n.set(tt,r,e);let o=he()||{active_profile:"default",profiles:{}};return o.storage="secure_storage",o.profiles[r]={},Object.keys(o.profiles).length===1&&(o.active_profile=r),{configPath:tr(o),backend:n}}async function va(e){let t=he(),r=e||process.env.RESEND_PROFILE||process.env.RESEND_TEAM||t?.active_profile||"default";if(t?.storage==="secure_storage"){let i=await rt();i.isSecure&&await i.delete(tt,r)}return Wc(r)}async function Kb(){let e=he(),t=Rt();if(e?.storage==="secure_storage"){let r=await rt();r.isSecure&&await Promise.all(Object.keys(e.profiles).map(i=>r.delete(tt,i)))}return(0,Se.existsSync)(t)&&(0,Se.unlinkSync)(t),t}async function _a(e,t){if(he()?.storage==="secure_storage"){let i=await rt();if(i.isSecure){let n=await i.get(tt,e);n&&(await i.set(tt,t,n),await i.delete(tt,e))}}qC(e,t)}var Se,Wb,qr,Ce=z(()=>{"use strict";Se=require("node:fs"),Wb=require("node:os"),qr=require("node:path");Zc()});function w(){return!(!process.stdin.isTTY||!process.stdout.isTTY||process.env.CI==="true"||process.env.CI==="1"||process.env.GITHUB_ACTIONS||process.env.TERM==="dumb")}var Jt,G=z(()=>{"use strict";Jt=process.platform!=="win32"||!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"});function K0(){return(0,V0.join)(Ze(),"update-state.json")}function VC(){try{return JSON.parse((0,ur.readFileSync)(K0(),"utf-8"))}catch{return null}}function KC(e){(0,ur.mkdirSync)(Ze(),{recursive:!0,mode:448}),(0,ur.writeFileSync)(K0(),JSON.stringify(e),{mode:384})}function Aa(e,t){let r=c=>c.replace(/^v/,"").split(".").map(Number),[i,n,s]=r(e),[o,a,u]=r(t);return o!==i?o>i:a!==n?a>n:u>s}async function ol(){try{let e=await fetch(sl,{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 YC(){return!!(process.env.RESEND_NO_UPDATE_NOTIFIER==="1"||process.env.CI==="true"||process.env.CI==="1"||process.env.GITHUB_ACTIONS||!process.stdout.isTTY)}function Y0(){let e=Ea();return e.startsWith("npm")?"npm":e.startsWith("brew")?"homebrew":e.startsWith("curl")||e.startsWith("irm")?"install-script":"manual"}function Ea(){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 W0(e){let t=Ea(),r=t.startsWith("http"),i="\x1B[2m",n="\x1B[33m",s="\x1B[36m",o="\x1B[0m",a=["",`${i}Update available: ${n}v${Y}${o}${i} \u2192 ${s}v${e}${o}`,`${i}${r?"Visit":"Run"}: ${s}${t}${o}`];return process.platform==="win32"&&a.push(`${i}Or download from: ${s}https://github.com/resend/resend-cli/releases/latest${o}`),a.push(""),a.join(`
63
- `)}async function Q0(){if(YC())return;let e=VC(),t=Date.now();if(e&&t-e.lastChecked<WC){Aa(Y,e.latestVersion)&&process.stderr.write(W0(e.latestVersion));return}let r=await ol();r&&(KC({lastChecked:t,latestVersion:r}),Aa(Y,r)&&process.stderr.write(W0(r)))}var ur,V0,WC,sl,Mr=z(()=>{"use strict";ur=require("node:fs"),V0=require("node:path");Ce();yt();WC=3600*1e3,sl="https://api.github.com/repos/resend/resend-cli/releases/latest"});var gv={};Ht(gv,{flushFromFile:()=>yS,flushPayload:()=>hv,getOrCreateAnonymousId:()=>fv,isDisabled:()=>mv,trackCommand:()=>ll});function vS(){return bS[process.platform]??process.platform}function mv(){return!pv||process.env.DO_NOT_TRACK==="1"||process.env.RESEND_TELEMETRY_DISABLED==="1"}function fv(){let e=Ze(),t=(0,Jr.join)(e,"telemetry-id");try{let i=(0,ze.readFileSync)(t,"utf-8").trim();if(i)return i}catch{}let r=crypto.randomUUID();return(0,ze.mkdirSync)(e,{recursive:!0,mode:448}),(0,ze.writeFileSync)(t,r,{mode:384}),r}function _S(e){if(!e)return;let t=Ze(),r=(0,Jr.join)(t,"telemetry-notice-shown");(0,ze.existsSync)(r)||((0,ze.mkdirSync)(t,{recursive:!0,mode:448}),(0,ze.writeFileSync)(r,"",{mode:384}),process.stderr.write(`
60
+ `,{code:n}=await jl(i);return n===0}async isAvailable(){if(process.platform!=="win32")return!1;let{code:t}=await jl(`${Ui} $null = New-Object Windows.Security.Credentials.PasswordVault`);return t===0}}});async function Lt(){if(Dt)return Dt;let e=process.env.RESEND_CREDENTIAL_STORE;if(e==="file"){let{FileBackend:r}=await Promise.resolve().then(()=>(xd(),Od));return Dt=new r,Dt}if(e==="secure_storage"||e==="keychain"){let r=await zv();if(r)return Dt=r,Dt}if(!e){let r=await zv();if(r)return Dt=r,Dt}let{FileBackend:t}=await Promise.resolve().then(()=>(xd(),Od));return Dt=new t,Dt}async function zv(){if(process.platform==="darwin"){let{MacOSBackend:e}=await Promise.resolve().then(()=>(Dv(),jv)),t=new e;if(await t.isAvailable())return t}else if(process.platform==="linux"){let{LinuxBackend:e}=await Promise.resolve().then(()=>(qv(),Iv)),t=new e;if(await t.isAvailable())return t}else if(process.platform==="win32"){let{WindowsBackend:e}=await Promise.resolve().then(()=>(Mv(),Rv)),t=new e;if(await t.isAvailable())return t}return null}var Ht,Dt,jd=ee(()=>{"use strict";Ht="resend-cli",Dt=null});function It(){return process.env.XDG_CONFIG_HOME?(0,Wi.join)(process.env.XDG_CONFIG_HOME,"resend"):process.platform==="win32"&&process.env.APPDATA?(0,Wi.join)(process.env.APPDATA,"resend"):(0,Wi.join)((0,Fv.homedir)(),".config","resend")}function $r(){return(0,Wi.join)(It(),"credentials.json")}function Be(){try{let e=JSON.parse((0,Ve.readFileSync)($r(),"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 ii(e){let t=It();(0,Ve.mkdirSync)(t,{recursive:!0,mode:448});let r=$r();return(0,Ve.writeFileSync)(r,`${JSON.stringify(e,null,2)}
61
+ `,{mode:384}),(0,Ve.chmodSync)(r,384),r}function ni(e){if(e)return e;let t=process.env.RESEND_PROFILE||process.env.RESEND_TEAM;if(t)return t;let r=Be();return r?.active_profile?r.active_profile:"default"}function kd(e,t,r){let i=t||"default",n=je(i);if(n)throw new Error(n);let s=Be()||{active_profile:"default",profiles:{}};return s.profiles[i]={api_key:e,...r&&{permission:r}},Object.keys(s.profiles).length===1&&(s.active_profile=i),ii(s)}function Ed(e){let t=Be();if(!t){let i=$r();if(!(0,Ve.existsSync)(i))throw new Error("No credentials file found.");return(0,Ve.unlinkSync)(i),i}let r=e||ni();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=$r();return(0,Ve.unlinkSync)(i),i}return ii(t)}function Il(e){let t=je(e);if(t)throw new Error(t);let r=Be();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,ii(r)}function Ke(){let e=Be();return e?Object.keys(e.profiles).map(t=>({name:t,active:t===e.active_profile})):[]}function je(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 wx(e,t){if(e===t)return;let r=je(t);if(r)throw new Error(r);let i=Be();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),ii(i)}function jr(e){return e.length<=7?`${e.slice(0,3)}...`:`${e.slice(0,3)}...${e.slice(-4)}`}async function Dr(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=Be(),n=t||process.env.RESEND_PROFILE||process.env.RESEND_TEAM||i?.active_profile||"default";if(i?.storage==="secure_storage"){let o=await(await Lt()).get(Ht,n);if(o){let a=i.profiles[n]?.permission;return{key:o,source:"secure_storage",profile:n,permission:a}}}if(i){let s=i.profiles[n];if(s?.api_key){let o=await Lt();if(o.isSecure)try{await o.set(Ht,n,s.api_key),i.profiles[n]={...s.permission&&{permission:s.permission}},i.storage="secure_storage",ii(i),process.stderr.write(`Notice: API key for profile "${n}" has been moved to ${o.name}
62
+ `)}catch{}return{key:s.api_key,source:"config",profile:n,permission:s.permission}}}return null}async function Jv(e,t,r){let i=t||"default",n=je(i);if(n)throw new Error(n);let s=await Lt();if(!s.isSecure)return{configPath:kd(e,i,r),backend:s};await s.set(Ht,i,e);let a=Be()||{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:ii(a),backend:s}}async function ql(e){let t=Be(),r=e||process.env.RESEND_PROFILE||process.env.RESEND_TEAM||t?.active_profile||"default";if(t?.storage==="secure_storage"){let i=await Lt();i.isSecure&&await i.delete(Ht,r)}return Ed(r)}async function Bv(){let e=Be(),t=$r();if(e?.storage==="secure_storage"){let r=await Lt();r.isSecure&&await Promise.all(Object.keys(e.profiles).map(i=>r.delete(Ht,i)))}return(0,Ve.existsSync)(t)&&(0,Ve.unlinkSync)(t),t}async function Rl(e,t){if(Be()?.storage==="secure_storage"){let i=await Lt();if(i.isSecure){let n=await i.get(Ht,e);n&&(await i.set(Ht,t,n),await i.delete(Ht,e))}}wx(e,t)}var Ve,Fv,Wi,ri,We=ee(()=>{"use strict";Ve=require("node:fs"),Fv=require("node:os"),Wi=require("node:path");jd();ri=`Sending-only keys work with: emails send, emails batch, broadcasts send.
63
+ Create a full access key at https://resend.com/api-keys`});function D(){return!(!process.stdin.isTTY||!process.stdout.isTTY||process.env.CI==="true"||process.env.CI==="1"||process.env.GITHUB_ACTIONS||process.env.TERM==="dumb")}var Nt,ae=ee(()=>{"use strict";Nt=process.platform!=="win32"||!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"});var Nd=m((HD,q2)=>{"use strict";var Ld=Object.defineProperty,Mx=Object.getOwnPropertyDescriptor,zx=Object.getOwnPropertyNames,Fx=Object.prototype.hasOwnProperty,Jx=(e,t)=>{for(var r in t)Ld(e,r,{get:t[r],enumerable:!0})},Bx=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zx(t))!Fx.call(e,n)&&n!==r&&Ld(e,n,{get:()=>t[n],enumerable:!(i=Mx(t,n))||i.enumerable});return e},Hx=e=>Bx(Ld({},"__esModule",{value:!0}),e),en={};Jx(en,{analyzeMetafile:()=>yk,analyzeMetafileSync:()=>Sk,build:()=>hk,buildSync:()=>_k,context:()=>gk,default:()=>Ek,formatMessages:()=>vk,formatMessagesSync:()=>Ck,initialize:()=>xk,stop:()=>Ok,transform:()=>bk,transformSync:()=>wk,version:()=>fk});q2.exports=Hx(en);function d2(e){let t=i=>{if(i===null)r.write8(0);else if(typeof i=="boolean")r.write8(1),r.write8(+i);else if(typeof i=="number")r.write8(2),r.write32(i|0);else if(typeof i=="string")r.write8(3),r.write(Tt(i));else if(i instanceof Uint8Array)r.write8(4),r.write(i);else if(i instanceof Array){r.write8(5),r.write32(i.length);for(let n of i)t(n)}else{let n=Object.keys(i);r.write8(6),r.write32(n.length);for(let s of n)r.write(Tt(s)),t(i[s])}},r=new w2;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Jd(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Lx(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return zr(r.read());case 4:return r.read();case 5:{let o=r.read32(),a=[];for(let l=0;l<o;l++)a.push(t());return a}case 6:{let o=r.read32(),a={};for(let l=0;l<o;l++)a[zr(r.read())]=t();return a}default:throw new Error("Invalid packet")}},r=new w2(e),i=r.read32(),n=(i&1)===0;i>>>=1;let s=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:i,isRequest:n,value:s}}var w2=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e}write32(e){let t=this._write(4);Jd(this.buf,e,t)}write(e){let t=this._write(4+e.length);Jd(this.buf,e.length,t),this.buf.set(e,t+4)}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return C2(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},Tt,zr,Fd;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;Tt=r=>e.encode(r),zr=r=>t.decode(r),Fd='new TextEncoder().encode("")'}else if(typeof Buffer<"u")Tt=e=>Buffer.from(e),zr=e=>{let{buffer:t,byteOffset:r,byteLength:i}=e;return Buffer.from(t,r,i).toString()},Fd='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(Tt("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Fd} instanceof Uint8Array" is incorrectly false
64
+
65
+ This indicates that your JavaScript environment is broken. You cannot use
66
+ esbuild in this environment because esbuild relies on this invariant. This
67
+ is not a problem with esbuild. You need to fix your environment instead.
68
+ `);function C2(e,t){return(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0}function Jd(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var Gt=String.fromCharCode;function xt(e,t,r){let i=e[t],n=1,s=0;for(let o=0;o<t;o++)e[o]===10?(n++,s=0):s++;throw new SyntaxError(r||(t===e.length?"Unexpected end of input while parsing JSON":i>=32&&i<=126?`Unexpected character ${Gt(i)} in JSON at position ${t} (line ${n}, column ${s})`:`Unexpected byte 0x${i.toString(16)} in JSON at position ${t} (line ${n}, column ${s})`))}function Nx(e){if(!(e instanceof Uint8Array))throw new Error("JSON input must be a Uint8Array");let t=[],r=[],i=[],n=e.length,s=null,o=0,a,l=0;for(;l<n;){let u=e[l++];if(u<=32)continue;let c;switch(o===2&&s===null&&u!==34&&u!==125&&xt(e,--l),u){case 116:{(e[l++]!==114||e[l++]!==117||e[l++]!==101)&&xt(e,--l),c=!0;break}case 102:{(e[l++]!==97||e[l++]!==108||e[l++]!==115||e[l++]!==101)&&xt(e,--l),c=!1;break}case 110:{(e[l++]!==117||e[l++]!==108||e[l++]!==108)&&xt(e,--l),c=null;break}case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:{let d=l;for(c=Gt(u),u=e[l];;){switch(u){case 43:case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 101:case 69:{c+=Gt(u),u=e[++l];continue}}break}c=+c,isNaN(c)&&xt(e,--d,"Invalid number");break}case 34:{for(c="";l>=n&&xt(e,n),u=e[l++],u!==34;)if(u===92)switch(e[l++]){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
69
+ `;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{let d=0;for(let p=0;p<4;p++)u=e[l++],d<<=4,u>=48&&u<=57?d|=u-48:u>=97&&u<=102?d|=u+-87:u>=65&&u<=70?d|=u+-55:xt(e,--l);c+=Gt(d);break}default:xt(e,--l);break}else if(u<=127)c+=Gt(u);else if((u&224)===192)c+=Gt((u&31)<<6|e[l++]&63);else if((u&240)===224)c+=Gt((u&15)<<12|(e[l++]&63)<<6|e[l++]&63);else if((u&248)==240){let d=(u&7)<<18|(e[l++]&63)<<12|(e[l++]&63)<<6|e[l++]&63;d>65535&&(d-=65536,c+=Gt(d>>10&1023|55296),d=56320|d&1023),c+=Gt(d)}c[0];break}case 91:{c=[],t.push(s),r.push(a),i.push(o),s=null,a=c,o=1;continue}case 123:{c={},t.push(s),r.push(a),i.push(o),s=null,a=c,o=2;continue}case 93:{o!==1&&xt(e,--l),c=a,s=t.pop(),a=r.pop(),o=i.pop();break}case 125:{o!==2&&xt(e,--l),c=a,s=t.pop(),a=r.pop(),o=i.pop();break}default:xt(e,--l)}for(u=e[l];u<=32;)u=e[++l];switch(o){case 0:{if(l===n)return c;break}case 1:{if(a.push(c),u===44){l++;continue}if(u===93)continue;break}case 2:{if(s===null){if(s=c,u===58){l++;continue}}else{if(a[s]=c,s=null,u===44){l++;continue}if(u===125)continue}break}}break}xt(e,l)}var Ee=JSON.stringify,p2="warning",m2="silent";function ui(e,t){let r=[];for(let i of e){if(lt(i,t),i.indexOf(",")>=0)throw new Error(`Invalid ${t}: ${i}`);r.push(i)}return r.join(",")}var Ul=()=>null,ge=e=>typeof e=="boolean"?null:"a boolean",z=e=>typeof e=="string"?null:"a string",Wl=e=>e instanceof RegExp?null:"a RegExp object",qr=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Gx=e=>typeof e=="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",S2=e=>typeof e=="function"?null:"a function",Ut=e=>Array.isArray(e)?null:"an array",ut=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"an array of strings",mt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",Ux=e=>typeof e=="object"&&e!==null?null:"an array or an object",Wx=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",f2=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",O2=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",Vx=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",x2=e=>typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"a string or an array of strings",k2=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",Kx=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function y(e,t,r,i){let n=e[r];if(t[r+""]=!0,n===void 0)return;let s=i(n);if(s!==null)throw new Error(`${Ee(r)} must be ${s}`);return n}function Se(e,t,r){for(let i in e)if(!(i in t))throw new Error(`Invalid option ${r}: ${Ee(i)}`)}function Yx(e){let t=Object.create(null),r=y(e,t,"wasmURL",Kx),i=y(e,t,"wasmModule",Wx),n=y(e,t,"worker",ge);return Se(e,t,"in initialize() call"),{wasmURL:r,wasmModule:i,worker:n}}function E2(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let i=e[r];if(typeof i=="string"||i===!1)t[r]=i;else throw new Error(`Expected ${Ee(r)} in mangle cache to map to either a string or false`)}}return t}function Zl(e,t,r,i,n){let s=y(t,r,"color",ge),o=y(t,r,"logLevel",z),a=y(t,r,"logLimit",qr);s!==void 0?e.push(`--color=${s}`):i&&e.push("--color=true"),e.push(`--log-level=${o||n}`),e.push(`--log-limit=${a||0}`)}function lt(e,t,r){if(typeof e!="string")throw new Error(`Expected value for ${t}${r!==void 0?" "+Ee(r):""} to be a string, got ${typeof e} instead`);return e}function A2(e,t,r){let i=y(t,r,"legalComments",z),n=y(t,r,"sourceRoot",z),s=y(t,r,"sourcesContent",ge),o=y(t,r,"target",x2),a=y(t,r,"format",z),l=y(t,r,"globalName",z),u=y(t,r,"mangleProps",Wl),c=y(t,r,"reserveProps",Wl),d=y(t,r,"mangleQuoted",ge),p=y(t,r,"minify",ge),v=y(t,r,"minifySyntax",ge),f=y(t,r,"minifyWhitespace",ge),b=y(t,r,"minifyIdentifiers",ge),S=y(t,r,"lineLimit",qr),T=y(t,r,"drop",ut),x=y(t,r,"dropLabels",ut),E=y(t,r,"charset",z),k=y(t,r,"treeShaking",ge),w=y(t,r,"ignoreAnnotations",ge),_=y(t,r,"jsx",z),C=y(t,r,"jsxFactory",z),P=y(t,r,"jsxFragment",z),q=y(t,r,"jsxImportSource",z),M=y(t,r,"jsxDev",ge),$=y(t,r,"jsxSideEffects",ge),j=y(t,r,"define",mt),J=y(t,r,"logOverride",mt),G=y(t,r,"supported",mt),W=y(t,r,"pure",ut),N=y(t,r,"keepNames",ge),L=y(t,r,"platform",z),U=y(t,r,"tsconfigRaw",Vx),de=y(t,r,"absPaths",ut);if(i&&e.push(`--legal-comments=${i}`),n!==void 0&&e.push(`--source-root=${n}`),s!==void 0&&e.push(`--sources-content=${s}`),o&&e.push(`--target=${ui(Array.isArray(o)?o:[o],"target")}`),a&&e.push(`--format=${a}`),l&&e.push(`--global-name=${l}`),L&&e.push(`--platform=${L}`),U&&e.push(`--tsconfig-raw=${typeof U=="string"?U:JSON.stringify(U)}`),p&&e.push("--minify"),v&&e.push("--minify-syntax"),f&&e.push("--minify-whitespace"),b&&e.push("--minify-identifiers"),S&&e.push(`--line-limit=${S}`),E&&e.push(`--charset=${E}`),k!==void 0&&e.push(`--tree-shaking=${k}`),w&&e.push("--ignore-annotations"),T)for(let R of T)e.push(`--drop:${lt(R,"drop")}`);if(x&&e.push(`--drop-labels=${ui(x,"drop label")}`),de&&e.push(`--abs-paths=${ui(de,"abs paths")}`),u&&e.push(`--mangle-props=${Vl(u)}`),c&&e.push(`--reserve-props=${Vl(c)}`),d!==void 0&&e.push(`--mangle-quoted=${d}`),_&&e.push(`--jsx=${_}`),C&&e.push(`--jsx-factory=${C}`),P&&e.push(`--jsx-fragment=${P}`),q&&e.push(`--jsx-import-source=${q}`),M&&e.push("--jsx-dev"),$&&e.push("--jsx-side-effects"),j)for(let R in j){if(R.indexOf("=")>=0)throw new Error(`Invalid define: ${R}`);e.push(`--define:${R}=${lt(j[R],"define",R)}`)}if(J)for(let R in J){if(R.indexOf("=")>=0)throw new Error(`Invalid log override: ${R}`);e.push(`--log-override:${R}=${lt(J[R],"log override",R)}`)}if(G)for(let R in G){if(R.indexOf("=")>=0)throw new Error(`Invalid supported: ${R}`);let Z=G[R];if(typeof Z!="boolean")throw new Error(`Expected value for supported ${Ee(R)} to be a boolean, got ${typeof Z} instead`);e.push(`--supported:${R}=${Z}`)}if(W)for(let R of W)e.push(`--pure:${lt(R,"pure")}`);N&&e.push("--keep-names")}function Qx(e,t,r,i,n){var s;let o=[],a=[],l=Object.create(null),u=null,c=null;Zl(o,t,l,r,i),A2(o,t,l);let d=y(t,l,"sourcemap",O2),p=y(t,l,"bundle",ge),v=y(t,l,"splitting",ge),f=y(t,l,"preserveSymlinks",ge),b=y(t,l,"metafile",ge),S=y(t,l,"outfile",z),T=y(t,l,"outdir",z),x=y(t,l,"outbase",z),E=y(t,l,"tsconfig",z),k=y(t,l,"resolveExtensions",ut),w=y(t,l,"nodePaths",ut),_=y(t,l,"mainFields",ut),C=y(t,l,"conditions",ut),P=y(t,l,"external",ut),q=y(t,l,"packages",z),M=y(t,l,"alias",mt),$=y(t,l,"loader",mt),j=y(t,l,"outExtension",mt),J=y(t,l,"publicPath",z),G=y(t,l,"entryNames",z),W=y(t,l,"chunkNames",z),N=y(t,l,"assetNames",z),L=y(t,l,"inject",ut),U=y(t,l,"banner",mt),de=y(t,l,"footer",mt),R=y(t,l,"entryPoints",Ux),Z=y(t,l,"absWorkingDir",z),Y=y(t,l,"stdin",mt),V=(s=y(t,l,"write",ge))!=null?s:n,Ze=y(t,l,"allowOverwrite",ge),Ce=y(t,l,"mangleCache",mt);if(l.plugins=!0,Se(t,l,`in ${e}() call`),d&&o.push(`--sourcemap${d===!0?"":`=${d}`}`),p&&o.push("--bundle"),Ze&&o.push("--allow-overwrite"),v&&o.push("--splitting"),f&&o.push("--preserve-symlinks"),b&&o.push("--metafile"),S&&o.push(`--outfile=${S}`),T&&o.push(`--outdir=${T}`),x&&o.push(`--outbase=${x}`),E&&o.push(`--tsconfig=${E}`),q&&o.push(`--packages=${q}`),k&&o.push(`--resolve-extensions=${ui(k,"resolve extension")}`),J&&o.push(`--public-path=${J}`),G&&o.push(`--entry-names=${G}`),W&&o.push(`--chunk-names=${W}`),N&&o.push(`--asset-names=${N}`),_&&o.push(`--main-fields=${ui(_,"main field")}`),C&&o.push(`--conditions=${ui(C,"condition")}`),P)for(let F of P)o.push(`--external:${lt(F,"external")}`);if(M)for(let F in M){if(F.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${F}`);o.push(`--alias:${F}=${lt(M[F],"alias",F)}`)}if(U)for(let F in U){if(F.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${F}`);o.push(`--banner:${F}=${lt(U[F],"banner",F)}`)}if(de)for(let F in de){if(F.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${F}`);o.push(`--footer:${F}=${lt(de[F],"footer",F)}`)}if(L)for(let F of L)o.push(`--inject:${lt(F,"inject")}`);if($)for(let F in $){if(F.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${F}`);o.push(`--loader:${F}=${lt($[F],"loader",F)}`)}if(j)for(let F in j){if(F.indexOf("=")>=0)throw new Error(`Invalid out extension: ${F}`);o.push(`--out-extension:${F}=${lt(j[F],"out extension",F)}`)}if(R)if(Array.isArray(R))for(let F=0,zt=R.length;F<zt;F++){let ht=R[F];if(typeof ht=="object"&&ht!==null){let $t=Object.create(null),Ft=y(ht,$t,"in",z),gt=y(ht,$t,"out",z);if(Se(ht,$t,"in entry point at index "+F),Ft===void 0)throw new Error('Missing property "in" for entry point at index '+F);if(gt===void 0)throw new Error('Missing property "out" for entry point at index '+F);a.push([gt,Ft])}else a.push(["",lt(ht,"entry point at index "+F)])}else for(let F in R)a.push([F,lt(R[F],"entry point",F)]);if(Y){let F=Object.create(null),zt=y(Y,F,"contents",k2),ht=y(Y,F,"resolveDir",z),$t=y(Y,F,"sourcefile",z),Ft=y(Y,F,"loader",z);Se(Y,F,'in "stdin" object'),$t&&o.push(`--sourcefile=${$t}`),Ft&&o.push(`--loader=${Ft}`),ht&&(c=ht),typeof zt=="string"?u=Tt(zt):zt instanceof Uint8Array&&(u=zt)}let Mt=[];if(w)for(let F of w)F+="",Mt.push(F);return{entries:a,flags:o,write:V,stdinContents:u,stdinResolveDir:c,absWorkingDir:Z,nodePaths:Mt,mangleCache:E2(Ce)}}function Zx(e,t,r,i){let n=[],s=Object.create(null);Zl(n,t,s,r,i),A2(n,t,s);let o=y(t,s,"sourcemap",O2),a=y(t,s,"sourcefile",z),l=y(t,s,"loader",z),u=y(t,s,"banner",z),c=y(t,s,"footer",z),d=y(t,s,"mangleCache",mt);return Se(t,s,`in ${e}() call`),o&&n.push(`--sourcemap=${o===!0?"external":o}`),a&&n.push(`--sourcefile=${a}`),l&&n.push(`--loader=${l}`),u&&n.push(`--banner=${u}`),c&&n.push(`--footer=${c}`),{flags:n,mangleCache:E2(d)}}function P2(e){let t={},r={didClose:!1,reason:""},i={},n=0,s=0,o=new Uint8Array(16*1024),a=0,l=E=>{let k=a+E.length;if(k>o.length){let _=new Uint8Array(k*2);_.set(o),o=_}o.set(E,a),a+=E.length;let w=0;for(;w+4<=a;){let _=C2(o,w);if(w+4+_>a)break;w+=4,f(o.subarray(w,w+_)),w+=_}w>0&&(o.copyWithin(0,w,a),a-=w)},u=E=>{r.didClose=!0,E&&(r.reason=": "+(E.message||E));let k="The service was stopped"+r.reason;for(let w in i)i[w](k,null);i={}},c=(E,k,w)=>{if(r.didClose)return w("The service is no longer running"+r.reason,null);let _=n++;i[_]=(C,P)=>{try{w(C,P)}finally{E&&E.unref()}},E&&E.ref(),e.writeToStdin(d2({id:_,isRequest:!0,value:k}))},d=(E,k)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);e.writeToStdin(d2({id:E,isRequest:!1,value:k}))},p=async(E,k)=>{try{if(k.command==="ping"){d(E,{});return}if(typeof k.key=="number"){let w=t[k.key];if(!w)return;let _=w[k.command];if(_){await _(E,k);return}}throw new Error("Invalid command: "+k.command)}catch(w){let _=[Ir(w,e,null,void 0,"")];try{d(E,{errors:_})}catch{}}},v=!0,f=E=>{if(v){v=!1;let w=String.fromCharCode(...E);if(w!=="0.27.4")throw new Error(`Cannot start service: Host version "0.27.4" does not match binary version ${Ee(w)}`);return}let k=Lx(E);if(k.isRequest)p(k.id,k.value);else{let w=i[k.id];delete i[k.id],k.value.error?w(k.value.error,{}):w(null,k.value)}};return{readFromStdout:l,afterClose:u,service:{buildOrContext:({callName:E,refs:k,options:w,isTTY:_,defaultWD:C,callback:P})=>{let q=0,M=s++,$={},j={ref(){++q===1&&k&&k.ref()},unref(){--q===0&&(delete t[M],k&&k.unref())}};t[M]=$,j.ref(),Xx(E,M,c,d,j,e,$,w,_,C,(J,G)=>{try{P(J,G)}finally{j.unref()}})},transform:({callName:E,refs:k,input:w,options:_,isTTY:C,fs:P,callback:q})=>{let M=T2(),$=j=>{try{if(typeof w!="string"&&!(w instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:J,mangleCache:G}=Zx(E,_,C,m2),W={command:"transform",flags:J,inputFS:j!==null,input:j!==null?Tt(j):typeof w=="string"?Tt(w):w};G&&(W.mangleCache=G),c(k,W,(N,L)=>{if(N)return q(new Error(N),null);let U=ci(L.errors,M),de=ci(L.warnings,M),R=1,Z=()=>{if(--R===0){let Y={warnings:de,code:L.code,map:L.map,mangleCache:void 0,legalComments:void 0};"legalComments"in L&&(Y.legalComments=L?.legalComments),L.mangleCache&&(Y.mangleCache=L?.mangleCache),q(null,Y)}};if(U.length>0)return q(Zi("Transform failed",U,de),null);L.codeFS&&(R++,P.readFile(L.code,(Y,V)=>{Y!==null?q(Y,null):(L.code=V,Z())})),L.mapFS&&(R++,P.readFile(L.map,(Y,V)=>{Y!==null?q(Y,null):(L.map=V,Z())})),Z()})}catch(J){let G=[];try{Zl(G,_,{},C,m2)}catch{}let W=Ir(J,e,M,void 0,"");c(k,{command:"error",flags:G,error:W},()=>{W.detail=M.load(W.detail),q(Zi("Transform failed",[W],[]),null)})}};if((typeof w=="string"||w instanceof Uint8Array)&&w.length>1024*1024){let j=$;$=()=>P.writeFile(w,j)}$(null)},formatMessages:({callName:E,refs:k,messages:w,options:_,callback:C})=>{if(!_)throw new Error(`Missing second argument in ${E}() call`);let P={},q=y(_,P,"kind",z),M=y(_,P,"color",ge),$=y(_,P,"terminalWidth",qr);if(Se(_,P,`in ${E}() call`),q===void 0)throw new Error(`Missing "kind" in ${E}() call`);if(q!=="error"&&q!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${E}() call`);let j={command:"format-msgs",messages:Wt(w,"messages",null,"",$),isWarning:q==="warning"};M!==void 0&&(j.color=M),$!==void 0&&(j.terminalWidth=$),c(k,j,(J,G)=>{if(J)return C(new Error(J),null);C(null,G.messages)})},analyzeMetafile:({callName:E,refs:k,metafile:w,options:_,callback:C})=>{_===void 0&&(_={});let P={},q=y(_,P,"color",ge),M=y(_,P,"verbose",ge);Se(_,P,`in ${E}() call`);let $={command:"analyze-metafile",metafile:w};q!==void 0&&($.color=q),M!==void 0&&($.verbose=M),c(k,$,(j,J)=>{if(j)return C(new Error(j),null);C(null,J.result)})}}}}function Xx(e,t,r,i,n,s,o,a,l,u,c){let d=T2(),p=e==="context",v=(S,T)=>{let x=[];try{Zl(x,a,{},l,p2)}catch{}let E=Ir(S,s,d,void 0,T);r(n,{command:"error",flags:x,error:E},()=>{E.detail=d.load(E.detail),c(Zi(p?"Context failed":"Build failed",[E],[]),null)})},f;if(typeof a=="object"){let S=a.plugins;if(S!==void 0){if(!Array.isArray(S))return v(new Error('"plugins" must be an array'),"");f=S}}if(f&&f.length>0){if(s.isSync)return v(new Error("Cannot use plugins in synchronous API calls"),"");ek(t,r,i,n,s,o,a,f,d).then(S=>{if(!S.ok)return v(S.error,S.pluginName);try{b(S.requestPlugins,S.runOnEndCallbacks,S.scheduleOnDisposeCallbacks)}catch(T){v(T,"")}},S=>v(S,""));return}try{b(null,(S,T)=>T([],[]),()=>{})}catch(S){v(S,"")}function b(S,T,x){let E=s.hasFS,{entries:k,flags:w,write:_,stdinContents:C,stdinResolveDir:P,absWorkingDir:q,nodePaths:M,mangleCache:$}=Qx(e,a,l,p2,E);if(_&&!s.hasFS)throw new Error('The "write" option is unavailable in this environment');let j={command:"build",key:t,entries:k,flags:w,write:_,stdinContents:C,stdinResolveDir:P,absWorkingDir:q||u,nodePaths:M,context:p};S&&(j.plugins=S),$&&(j.mangleCache=$);let J=(N,L)=>{let U={errors:ci(N.errors,d),warnings:ci(N.warnings,d),outputFiles:void 0,metafile:void 0,mangleCache:void 0},de=U.errors.slice(),R=U.warnings.slice();N.outputFiles&&(U.outputFiles=N.outputFiles.map(rk)),N.metafile&&(U.metafile=ik(N.metafile)),N.mangleCache&&(U.mangleCache=N.mangleCache),N.writeToStdout!==void 0&&console.log(zr(N.writeToStdout).replace(/\n$/,"")),T(U,(Z,Y)=>{if(de.length>0||Z.length>0){let V=Zi("Build failed",de.concat(Z),R.concat(Y));return L(V,null,Z,Y)}L(null,U,Z,Y)})},G,W;p&&(o["on-end"]=(N,L)=>new Promise(U=>{J(L,(de,R,Z,Y)=>{let V={errors:Z,warnings:Y};W&&W(de,R),G=void 0,W=void 0,i(N,V),U()})})),r(n,j,(N,L)=>{if(N)return c(new Error(N),null);if(!p)return J(L,(R,Z)=>(x(),c(R,Z)));if(L.errors.length>0)return c(Zi("Context failed",L.errors,L.warnings),null);let U=!1,de={rebuild:()=>(G||(G=new Promise((R,Z)=>{let Y;W=(Ze,Ce)=>{Y||(Y=()=>Ze?Z(Ze):R(Ce))};let V=()=>{r(n,{command:"rebuild",key:t},(Ce,Mt)=>{Ce?Z(new Error(Ce)):Y?Y():V()})};V()})),G),watch:(R={})=>new Promise((Z,Y)=>{if(!s.hasFS)throw new Error('Cannot use the "watch" API in this environment');let V={},Ze=y(R,V,"delay",qr);Se(R,V,"in watch() call");let Ce={command:"watch",key:t};Ze&&(Ce.delay=Ze),r(n,Ce,Mt=>{Mt?Y(new Error(Mt)):Z(void 0)})}),serve:(R={})=>new Promise((Z,Y)=>{if(!s.hasFS)throw new Error('Cannot use the "serve" API in this environment');let V={},Ze=y(R,V,"port",Gx),Ce=y(R,V,"host",z),Mt=y(R,V,"servedir",z),F=y(R,V,"keyfile",z),zt=y(R,V,"certfile",z),ht=y(R,V,"fallback",z),$t=y(R,V,"cors",mt),Ft=y(R,V,"onRequest",S2);Se(R,V,"in serve() call");let gt={command:"serve",key:t,onRequest:!!Ft};if(Ze!==void 0&&(gt.port=Ze),Ce!==void 0&&(gt.host=Ce),Mt!==void 0&&(gt.servedir=Mt),F!==void 0&&(gt.keyfile=F),zt!==void 0&&(gt.certfile=zt),ht!==void 0&&(gt.fallback=ht),$t){let Si={},Hr=y($t,Si,"origin",x2);Se($t,Si,'on "cors" object'),Array.isArray(Hr)?gt.corsOrigin=Hr:Hr!==void 0&&(gt.corsOrigin=[Hr])}r(n,gt,(Si,Hr)=>{if(Si)return Y(new Error(Si));Ft&&(o["serve-request"]=(o1,a1)=>{Ft(a1.args),i(o1,{})}),Z(Hr)})}),cancel:()=>new Promise(R=>{if(U)return R();r(n,{command:"cancel",key:t},()=>{R()})}),dispose:()=>new Promise(R=>{if(U)return R();U=!0,r(n,{command:"dispose",key:t},()=>{R(),x(),n.unref()})})};n.ref(),c(null,de)})}}var ek=async(e,t,r,i,n,s,o,a,l)=>{let u=[],c=[],d={},p={},v=[],f=0,b=0,S=[],T=!1;a=[...a];for(let k of a){let w={};if(typeof k!="object")throw new Error(`Plugin at index ${b} must be an object`);let _=y(k,w,"name",z);if(typeof _!="string"||_==="")throw new Error(`Plugin at index ${b} is missing a name`);try{let C=y(k,w,"setup",S2);if(typeof C!="function")throw new Error("Plugin is missing a setup function");Se(k,w,`on plugin ${Ee(_)}`);let P={name:_,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};b++;let M=C({initialOptions:o,resolve:($,j={})=>{if(!T)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof $!="string")throw new Error("The path to resolve must be a string");let J=Object.create(null),G=y(j,J,"pluginName",z),W=y(j,J,"importer",z),N=y(j,J,"namespace",z),L=y(j,J,"resolveDir",z),U=y(j,J,"kind",z),de=y(j,J,"pluginData",Ul),R=y(j,J,"with",mt);return Se(j,J,"in resolve() call"),new Promise((Z,Y)=>{let V={command:"resolve",path:$,key:e,pluginName:_};if(G!=null&&(V.pluginName=G),W!=null&&(V.importer=W),N!=null&&(V.namespace=N),L!=null&&(V.resolveDir=L),U!=null)V.kind=U;else throw new Error('Must specify "kind" when calling "resolve"');de!=null&&(V.pluginData=l.store(de)),R!=null&&(V.with=tk(R,"with")),t(i,V,(Ze,Ce)=>{Ze!==null?Y(new Error(Ze)):Z({errors:ci(Ce.errors,l),warnings:ci(Ce.warnings,l),path:Ce.path,external:Ce.external,sideEffects:Ce.sideEffects,namespace:Ce.namespace,suffix:Ce.suffix,pluginData:l.load(Ce.pluginData)})})})},onStart($){let j='This error came from the "onStart" callback registered here:',J=Nl(new Error(j),n,"onStart");u.push({name:_,callback:$,note:J}),P.onStart=!0},onEnd($){let j='This error came from the "onEnd" callback registered here:',J=Nl(new Error(j),n,"onEnd");c.push({name:_,callback:$,note:J}),P.onEnd=!0},onResolve($,j){let J='This error came from the "onResolve" callback registered here:',G=Nl(new Error(J),n,"onResolve"),W={},N=y($,W,"filter",Wl),L=y($,W,"namespace",z);if(Se($,W,`in onResolve() call for plugin ${Ee(_)}`),N==null)throw new Error("onResolve() call is missing a filter");let U=f++;d[U]={name:_,callback:j,note:G},P.onResolve.push({id:U,filter:Vl(N),namespace:L||""})},onLoad($,j){let J='This error came from the "onLoad" callback registered here:',G=Nl(new Error(J),n,"onLoad"),W={},N=y($,W,"filter",Wl),L=y($,W,"namespace",z);if(Se($,W,`in onLoad() call for plugin ${Ee(_)}`),N==null)throw new Error("onLoad() call is missing a filter");let U=f++;p[U]={name:_,callback:j,note:G},P.onLoad.push({id:U,filter:Vl(N),namespace:L||""})},onDispose($){v.push($)},esbuild:n.esbuild});M&&await M,S.push(P)}catch(C){return{ok:!1,error:C,pluginName:_}}}s["on-start"]=async(k,w)=>{l.clear();let _={errors:[],warnings:[]};await Promise.all(u.map(async({name:C,callback:P,note:q})=>{try{let M=await P();if(M!=null){if(typeof M!="object")throw new Error(`Expected onStart() callback in plugin ${Ee(C)} to return an object`);let $={},j=y(M,$,"errors",Ut),J=y(M,$,"warnings",Ut);Se(M,$,`from onStart() callback in plugin ${Ee(C)}`),j!=null&&_.errors.push(...Wt(j,"errors",l,C,void 0)),J!=null&&_.warnings.push(...Wt(J,"warnings",l,C,void 0))}}catch(M){_.errors.push(Ir(M,n,l,q&&q(),C))}})),r(k,_)},s["on-resolve"]=async(k,w)=>{let _={},C="",P,q;for(let M of w.ids)try{({name:C,callback:P,note:q}=d[M]);let $=await P({path:w.path,importer:w.importer,namespace:w.namespace,resolveDir:w.resolveDir,kind:w.kind,pluginData:l.load(w.pluginData),with:w.with});if($!=null){if(typeof $!="object")throw new Error(`Expected onResolve() callback in plugin ${Ee(C)} to return an object`);let j={},J=y($,j,"pluginName",z),G=y($,j,"path",z),W=y($,j,"namespace",z),N=y($,j,"suffix",z),L=y($,j,"external",ge),U=y($,j,"sideEffects",ge),de=y($,j,"pluginData",Ul),R=y($,j,"errors",Ut),Z=y($,j,"warnings",Ut),Y=y($,j,"watchFiles",ut),V=y($,j,"watchDirs",ut);Se($,j,`from onResolve() callback in plugin ${Ee(C)}`),_.id=M,J!=null&&(_.pluginName=J),G!=null&&(_.path=G),W!=null&&(_.namespace=W),N!=null&&(_.suffix=N),L!=null&&(_.external=L),U!=null&&(_.sideEffects=U),de!=null&&(_.pluginData=l.store(de)),R!=null&&(_.errors=Wt(R,"errors",l,C,void 0)),Z!=null&&(_.warnings=Wt(Z,"warnings",l,C,void 0)),Y!=null&&(_.watchFiles=Gl(Y,"watchFiles")),V!=null&&(_.watchDirs=Gl(V,"watchDirs"));break}}catch($){_={id:M,errors:[Ir($,n,l,q&&q(),C)]};break}r(k,_)},s["on-load"]=async(k,w)=>{let _={},C="",P,q;for(let M of w.ids)try{({name:C,callback:P,note:q}=p[M]);let $=await P({path:w.path,namespace:w.namespace,suffix:w.suffix,pluginData:l.load(w.pluginData),with:w.with});if($!=null){if(typeof $!="object")throw new Error(`Expected onLoad() callback in plugin ${Ee(C)} to return an object`);let j={},J=y($,j,"pluginName",z),G=y($,j,"contents",k2),W=y($,j,"resolveDir",z),N=y($,j,"pluginData",Ul),L=y($,j,"loader",z),U=y($,j,"errors",Ut),de=y($,j,"warnings",Ut),R=y($,j,"watchFiles",ut),Z=y($,j,"watchDirs",ut);Se($,j,`from onLoad() callback in plugin ${Ee(C)}`),_.id=M,J!=null&&(_.pluginName=J),G instanceof Uint8Array?_.contents=G:G!=null&&(_.contents=Tt(G)),W!=null&&(_.resolveDir=W),N!=null&&(_.pluginData=l.store(N)),L!=null&&(_.loader=L),U!=null&&(_.errors=Wt(U,"errors",l,C,void 0)),de!=null&&(_.warnings=Wt(de,"warnings",l,C,void 0)),R!=null&&(_.watchFiles=Gl(R,"watchFiles")),Z!=null&&(_.watchDirs=Gl(Z,"watchDirs"));break}}catch($){_={id:M,errors:[Ir($,n,l,q&&q(),C)]};break}r(k,_)};let x=(k,w)=>w([],[]);c.length>0&&(x=(k,w)=>{(async()=>{let _=[],C=[];for(let{name:P,callback:q,note:M}of c){let $,j;try{let J=await q(k);if(J!=null){if(typeof J!="object")throw new Error(`Expected onEnd() callback in plugin ${Ee(P)} to return an object`);let G={},W=y(J,G,"errors",Ut),N=y(J,G,"warnings",Ut);Se(J,G,`from onEnd() callback in plugin ${Ee(P)}`),W!=null&&($=Wt(W,"errors",l,P,void 0)),N!=null&&(j=Wt(N,"warnings",l,P,void 0))}}catch(J){$=[Ir(J,n,l,M&&M(),P)]}if($){_.push(...$);try{k.errors.push(...$)}catch{}}if(j){C.push(...j);try{k.warnings.push(...j)}catch{}}}w(_,C)})()});let E=()=>{for(let k of v)setTimeout(()=>k(),0)};return T=!0,{ok:!0,requestPlugins:S,runOnEndCallbacks:x,scheduleOnDisposeCallbacks:E}};function T2(){let e=new Map,t=0;return{clear(){e.clear()},load(r){return e.get(r)},store(r){if(r===void 0)return-1;let i=t++;return e.set(i,r),i}}}function Nl(e,t,r){let i,n=!1;return()=>{if(n)return i;n=!0;try{let s=(e.stack+"").split(`
70
+ `);s.splice(1,1);let o=$2(t,s,r);if(o)return i={text:e.message,location:o},i}catch{}}}function Ir(e,t,r,i,n){let s="Internal error",o=null;try{s=(e&&e.message||e)+""}catch{}try{o=$2(t,(e.stack+"").split(`
71
+ `),"")}catch{}return{id:"",pluginName:n,text:s,location:o,notes:i?[i]:[],detail:r?r.store(e):-1}}function $2(e,t,r){let i=" at ";if(e.readFileSync&&!t[0].startsWith(i)&&t[1].startsWith(i))for(let n=1;n<t.length;n++){let s=t[n];if(s.startsWith(i))for(s=s.slice(i.length);;){let o=/^(?:new |async )?\S+ \((.*)\)$/.exec(s);if(o){s=o[1];continue}if(o=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(s),o){s=o[1];continue}if(o=/^(\S+):(\d+):(\d+)$/.exec(s),o){let a;try{a=e.readFileSync(o[1],"utf8")}catch{break}let l=a.split(/\r\n|\r|\n|\u2028|\u2029/)[+o[2]-1]||"",u=+o[3]-1,c=l.slice(u,u+r.length)===r?r.length:0;return{file:o[1],namespace:"file",line:+o[2],column:Tt(l.slice(0,u)).length,length:Tt(l.slice(u,u+c)).length,lineText:l+`
72
+ `+t.slice(1).join(`
73
+ `),suggestion:""}}break}}return null}function Zi(e,t,r){let i=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,i+1).map((s,o)=>{if(o===i)return`
74
+ ...`;if(!s.location)return`
75
+ error: ${s.text}`;let{file:a,line:l,column:u}=s.location,c=s.pluginName?`[plugin: ${s.pluginName}] `:"";return`
76
+ ${a}:${l}:${u}: ERROR: ${c}${s.text}`}).join("");let n=new Error(e);for(let[s,o]of[["errors",t],["warnings",r]])Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get:()=>o,set:a=>Object.defineProperty(n,s,{configurable:!0,enumerable:!0,value:a})});return n}function ci(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function h2(e,t,r){if(e==null)return null;let i={},n=y(e,i,"file",z),s=y(e,i,"namespace",z),o=y(e,i,"line",qr),a=y(e,i,"column",qr),l=y(e,i,"length",qr),u=y(e,i,"lineText",z),c=y(e,i,"suggestion",z);if(Se(e,i,t),u){let d=u.slice(0,(a&&a>0?a:0)+(l&&l>0?l:0)+(r&&r>0?r:80));!/[\x7F-\uFFFF]/.test(d)&&!/\n/.test(u)&&(u=d)}return{file:n||"",namespace:s||"",line:o||0,column:a||0,length:l||0,lineText:u||"",suggestion:c||""}}function Wt(e,t,r,i,n){let s=[],o=0;for(let a of e){let l={},u=y(a,l,"id",z),c=y(a,l,"pluginName",z),d=y(a,l,"text",z),p=y(a,l,"location",f2),v=y(a,l,"notes",Ut),f=y(a,l,"detail",Ul),b=`in element ${o} of "${t}"`;Se(a,l,b);let S=[];if(v)for(let T of v){let x={},E=y(T,x,"text",z),k=y(T,x,"location",f2);Se(T,x,b),S.push({text:E||"",location:h2(k,b,n)})}s.push({id:u||"",pluginName:c||i,text:d||"",location:h2(p,b,n),notes:S,detail:r?r.store(f):-1}),o++}return s}function Gl(e,t){let r=[];for(let i of e){if(typeof i!="string")throw new Error(`${Ee(t)} must be an array of strings`);r.push(i)}return r}function tk(e,t){let r=Object.create(null);for(let i in e){let n=e[i];if(typeof n!="string")throw new Error(`key ${Ee(i)} in object ${Ee(t)} must be a string`);r[i]=n}return r}function rk({path:e,contents:t,hash:r}){let i=null;return{path:e,contents:t,hash:r,get text(){let n=this.contents;return(i===null||n!==t)&&(t=n,i=zr(n)),i}}}function Vl(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}function ik(e){let t;try{t=zr(e)}catch{return Nx(e)}return JSON.parse(t)}var ar=require("fs"),g2=require("os"),kt=require("path"),li=process.env.ESBUILD_BINARY_PATH||li,nk=e=>!!e&&e!=="/usr/bin/esbuild",b2="@esbuild/darwin-arm64",v2="@esbuild/darwin-x64",Kl={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},Yl={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},y2={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function sk(){let e,t,r=!1,i=`${process.platform} ${g2.arch()} ${g2.endianness()}`;if(i in Kl)e=Kl[i],t="esbuild.exe";else if(i in Yl)e=Yl[i],t="bin/esbuild";else if(i in y2)e=y2[i],t="bin/esbuild",r=!0;else throw new Error(`Unsupported platform: ${i}`);return{pkg:e,subpath:t,isWASM:r}}function ok(){let e=require.resolve("esbuild"),t=kt.dirname(kt.dirname(kt.dirname(e)));if(kt.basename(t)==="node_modules"){for(let r in Yl)try{let i=Yl[r];if(ar.existsSync(kt.join(t,i)))return i}catch{}for(let r in Kl)try{let i=Kl[r];if(ar.existsSync(kt.join(t,i)))return i}catch{}}return null}function ak(e,t){let r=kt.dirname(require.resolve("esbuild"));return kt.join(r,`downloaded-${e.replace("/","-")}-${kt.basename(t)}`)}function lk(){if(nk(li))if(!ar.existsSync(li))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${li}`);else return{binPath:li,isWASM:!1};let{pkg:e,subpath:t,isWASM:r}=sk(),i;try{i=require.resolve(`${e}/${t}`)}catch(n){if(i=ak(e,t),!ar.existsSync(i)){try{require.resolve(e)}catch{let s=ok();if(s){let o=`
77
+ Specifically the "${s}" package is present but this platform
78
+ needs the "${e}" package instead. People often get into this
79
+ situation by installing esbuild on Windows or macOS and copying "node_modules"
80
+ into a Docker image that runs Linux, or by copying "node_modules" between
81
+ Windows and WSL environments.
82
+
83
+ If you are installing with npm, you can try not copying the "node_modules"
84
+ directory when you copy the files over, and running "npm ci" or "npm install"
85
+ on the destination platform after the copy. Or you could consider using yarn
86
+ instead of npm which has built-in support for installing a package on multiple
87
+ platforms simultaneously.
88
+
89
+ If you are installing with yarn, you can try listing both this platform and the
90
+ other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
91
+ feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
92
+ Keep in mind that this means multiple copies of esbuild will be present.
93
+ `;throw(e===v2&&s===b2||e===b2&&s===v2)&&(o=`
94
+ Specifically the "${s}" package is present but this platform
95
+ needs the "${e}" package instead. People often get into this
96
+ situation by installing esbuild with npm running inside of Rosetta 2 and then
97
+ trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
98
+ 2 is Apple's on-the-fly x86_64-to-arm64 translation service).
99
+
100
+ If you are installing with npm, you can try ensuring that both npm and node are
101
+ not running under Rosetta 2 and then reinstalling esbuild. This likely involves
102
+ changing how you installed npm and/or node. For example, installing node with
103
+ the universal installer here should work: https://nodejs.org/en/download/. Or
104
+ you could consider using yarn instead of npm which has built-in support for
105
+ installing a package on multiple platforms simultaneously.
106
+
107
+ If you are installing with yarn, you can try listing both "arm64" and "x64"
108
+ in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
109
+ https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
110
+ Keep in mind that this means multiple copies of esbuild will be present.
111
+ `),new Error(`
112
+ You installed esbuild for another platform than the one you're currently using.
113
+ This won't work because esbuild is written with native code and needs to
114
+ install a platform-specific binary executable.
115
+ ${o}
116
+ Another alternative is to use the "esbuild-wasm" package instead, which works
117
+ the same way on all platforms. But it comes with a heavy performance cost and
118
+ can sometimes be 10x slower than the "esbuild" package, so you may also not
119
+ want to do that.
120
+ `)}throw new Error(`The package "${e}" could not be found, and is needed by esbuild.
121
+
122
+ If you are installing esbuild with npm, make sure that you don't specify the
123
+ "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
124
+ of "package.json" is used by esbuild to install the correct binary executable
125
+ for your current platform.`)}throw n}}if(/\.zip\//.test(i)){let n;try{n=require("pnpapi")}catch{}if(n){let s=n.getPackageInformation(n.topLevel).packageLocation,o=kt.join(s,"node_modules",".cache","esbuild",`pnpapi-${e.replace("/","-")}-0.27.4-${kt.basename(t)}`);return ar.existsSync(o)||(ar.mkdirSync(kt.dirname(o),{recursive:!0}),ar.copyFileSync(i,o),ar.chmodSync(o,493)),{binPath:o,isWASM:r}}}return{binPath:i,isWASM:r}}var j2=require("child_process"),uk=require("crypto"),Bd=require("path"),Rr=require("fs"),ck=require("os"),dk=require("tty"),Ye;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{Ye=require("worker_threads")}catch{}let[e,t]=process.versions.node.split(".");(+e<12||+e==12&&+t<17||+e==13&&+t<13)&&(Ye=void 0)}var _2,tn=((_2=Ye?.workerData)==null?void 0:_2.esbuildVersion)==="0.27.4",D2=()=>{if(!li&&(Bd.basename(__filename)!=="main.js"||Bd.basename(__dirname)!=="lib"))throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
126
+
127
+ More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);{let{binPath:e,isWASM:t}=lk();return t?["node",[e]]:[e,[]]}},Xi=()=>dk.isatty(2),pk={readFile(e,t){try{let r=Rr.readFileSync(e,"utf8");try{Rr.unlinkSync(e)}catch{}t(null,r)}catch(r){t(r,null)}},writeFile(e,t){try{let r=I2();Rr.writeFileSync(r,e),t(r)}catch{t(null)}}},mk={readFile(e,t){try{Rr.readFile(e,"utf8",(r,i)=>{try{Rr.unlink(e,()=>t(r,i))}catch{t(r,i)}})}catch(r){t(r,null)}},writeFile(e,t){try{let r=I2();Rr.writeFile(r,e,i=>t(i!==null?null:r))}catch{t(null)}}},fk="0.27.4",hk=e=>Fr().build(e),gk=e=>Fr().context(e),bk=(e,t)=>Fr().transform(e,t),vk=(e,t)=>Fr().formatMessages(e,t),yk=(e,t)=>Fr().analyzeMetafile(e,t),_k=e=>{if(Ye&&!tn)return Qe||(Qe=eu(Ye)),Qe.buildSync(e);let t;return Xl(r=>r.buildOrContext({callName:"buildSync",refs:null,options:e,isTTY:Xi(),defaultWD:Mr,callback:(i,n)=>{if(i)throw i;t=n}})),t},wk=(e,t)=>{if(Ye&&!tn)return Qe||(Qe=eu(Ye)),Qe.transformSync(e,t);let r;return Xl(i=>i.transform({callName:"transformSync",refs:null,input:e,options:t||{},isTTY:Xi(),fs:pk,callback:(n,s)=>{if(n)throw n;r=s}})),r},Ck=(e,t)=>{if(Ye&&!tn)return Qe||(Qe=eu(Ye)),Qe.formatMessagesSync(e,t);let r;return Xl(i=>i.formatMessages({callName:"formatMessagesSync",refs:null,messages:e,options:t,callback:(n,s)=>{if(n)throw n;r=s}})),r},Sk=(e,t)=>{if(Ye&&!tn)return Qe||(Qe=eu(Ye)),Qe.analyzeMetafileSync(e,t);let r;return Xl(i=>i.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof e=="string"?e:JSON.stringify(e),options:t,callback:(n,s)=>{if(n)throw n;r=s}})),r},Ok=()=>(Ql&&Ql(),Qe&&Qe.stop(),Promise.resolve()),Hd=!1,xk=e=>{if(e=Yx(e||{}),e.wasmURL)throw new Error('The "wasmURL" option only works in the browser');if(e.wasmModule)throw new Error('The "wasmModule" option only works in the browser');if(e.worker)throw new Error('The "worker" option only works in the browser');if(Hd)throw new Error('Cannot call "initialize" more than once');return Fr(),Hd=!0,Promise.resolve()},Mr=process.cwd(),Qi,Ql,Fr=()=>{if(Qi)return Qi;let[e,t]=D2(),r=j2.spawn(e,t.concat("--service=0.27.4","--ping"),{windowsHide:!0,stdio:["pipe","pipe","inherit"],cwd:Mr}),{readFromStdout:i,afterClose:n,service:s}=P2({writeToStdin(c){r.stdin.write(c,d=>{d&&n(d)})},readFileSync:Rr.readFileSync,isSync:!1,hasFS:!0,esbuild:en});r.stdin.on("error",n),r.on("error",n);let o=r.stdin,a=r.stdout;a.on("data",i),a.on("end",n),Ql=()=>{o.destroy(),a.destroy(),r.kill(),Hd=!1,Qi=void 0,Ql=void 0};let l=0;r.unref(),o.unref&&o.unref(),a.unref&&a.unref();let u={ref(){++l===1&&r.ref()},unref(){--l===0&&r.unref()}};return Qi={build:c=>new Promise((d,p)=>{s.buildOrContext({callName:"build",refs:u,options:c,isTTY:Xi(),defaultWD:Mr,callback:(v,f)=>v?p(v):d(f)})}),context:c=>new Promise((d,p)=>s.buildOrContext({callName:"context",refs:u,options:c,isTTY:Xi(),defaultWD:Mr,callback:(v,f)=>v?p(v):d(f)})),transform:(c,d)=>new Promise((p,v)=>s.transform({callName:"transform",refs:u,input:c,options:d||{},isTTY:Xi(),fs:mk,callback:(f,b)=>f?v(f):p(b)})),formatMessages:(c,d)=>new Promise((p,v)=>s.formatMessages({callName:"formatMessages",refs:u,messages:c,options:d,callback:(f,b)=>f?v(f):p(b)})),analyzeMetafile:(c,d)=>new Promise((p,v)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:u,metafile:typeof c=="string"?c:JSON.stringify(c),options:d,callback:(f,b)=>f?v(f):p(b)}))},Qi},Xl=e=>{let[t,r]=D2(),i=new Uint8Array,{readFromStdout:n,afterClose:s,service:o}=P2({writeToStdin(l){if(i.length!==0)throw new Error("Must run at most one command");i=l},isSync:!0,hasFS:!0,esbuild:en});e(o);let a=j2.execFileSync(t,r.concat("--service=0.27.4"),{cwd:Mr,windowsHide:!0,input:i,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16*1024*1024});n(a),s(null)},I2=()=>Bd.join(ck.tmpdir(),`esbuild-${uk.randomBytes(32).toString("hex")}`),Qe=null,eu=e=>{let{port1:t,port2:r}=new e.MessageChannel,i=new e.Worker(__filename,{workerData:{workerPort:r,defaultWD:Mr,esbuildVersion:"0.27.4"},transferList:[r],execArgv:[]}),n=0,s=u=>{let c=new Error(`Build failed with 1 error:
128
+ error: ${u}`),d=[{id:"",pluginName:"",text:u,location:null,notes:[],detail:void 0}];return c.errors=d,c.warnings=[],c},o=u=>{if(!u)return;let c=u.plugins;if(c&&c.length>0)throw s("Cannot use plugins in synchronous API calls")},a=(u,c)=>{for(let d in c)u[d]=c[d]},l=(u,c)=>{let d=n++,p=new SharedArrayBuffer(8),v=new Int32Array(p),f={sharedBuffer:p,id:d,command:u,args:c};i.postMessage(f);let b=Atomics.wait(v,0,0);if(b!=="ok"&&b!=="not-equal")throw new Error("Internal error: Atomics.wait() failed: "+b);let{message:{id:S,resolve:T,reject:x,properties:E}}=e.receiveMessageOnPort(t);if(d!==S)throw new Error(`Internal error: Expected id ${d} but got id ${S}`);if(x)throw a(x,E),x;return T};return i.unref(),{buildSync(u){return o(u),l("build",[u])},transformSync(u,c){return l("transform",[u,c])},formatMessagesSync(u,c){return l("formatMessages",[u,c])},analyzeMetafileSync(u,c){return l("analyzeMetafile",[u,c])},stop(){i.terminate(),Qe=null}}},kk=()=>{let e=Ye.workerData.workerPort,t=Ye.parentPort,r=i=>{let n={};if(i&&typeof i=="object")for(let s in i)n[s]=i[s];return n};try{let i=Fr();Mr=Ye.workerData.defaultWD,t.on("message",n=>{(async()=>{let{sharedBuffer:s,id:o,command:a,args:l}=n,u=new Int32Array(s);try{switch(a){case"build":e.postMessage({id:o,resolve:await i.build(l[0])});break;case"transform":e.postMessage({id:o,resolve:await i.transform(l[0],l[1])});break;case"formatMessages":e.postMessage({id:o,resolve:await i.formatMessages(l[0],l[1])});break;case"analyzeMetafile":e.postMessage({id:o,resolve:await i.analyzeMetafile(l[0],l[1])});break;default:throw new Error(`Invalid command: ${a}`)}}catch(c){e.postMessage({id:o,reject:c,properties:r(c)})}Atomics.add(u,0,1),Atomics.notify(u,0,1/0)})()})}catch(i){t.on("message",n=>{let{sharedBuffer:s,id:o}=n,a=new Int32Array(s);e.postMessage({id:o,reject:i,properties:r(i)}),Atomics.add(a,0,1),Atomics.notify(a,0,1/0)})}};tn&&kk();var Ek=en});function Iy(){return(0,Dy.join)(It(),"update-state.json")}function Ik(){try{return JSON.parse((0,gi.readFileSync)(Iy(),"utf-8"))}catch{return null}}function qk(e){(0,gi.mkdirSync)(It(),{recursive:!0,mode:448}),(0,gi.writeFileSync)(Iy(),JSON.stringify(e),{mode:384})}function au(e,t){let r=u=>u.replace(/^v/,"").split(".").map(Number),[i,n,s]=r(e),[o,a,l]=r(t);return o!==i?o>i:a!==n?a>n:l>s}async function Yd(){try{let e=await fetch(Kd,{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 Rk(){return!!(process.env.RESEND_NO_UPDATE_NOTIFIER==="1"||process.env.CI==="true"||process.env.CI==="1"||process.env.GITHUB_ACTIONS||!process.stdout.isTTY)}function qy(){let e=lu();return e.startsWith("npm")?"npm":e.startsWith("brew")?"homebrew":e.startsWith("curl")||e.startsWith("irm")?"install-script":"manual"}function lu(){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 jy(e){let t=lu(),r=t.startsWith("http"),i="\x1B[2m",n="\x1B[33m",s="\x1B[36m",o="\x1B[0m",a=["",`${i}Update available: ${n}v${ve}${o}${i} \u2192 ${s}v${e}${o}`,`${i}${r?"Visit":"Run"}: ${s}${t}${o}`];return process.platform==="win32"&&a.push(`${i}Or download from: ${s}https://github.com/resend/resend-cli/releases/latest${o}`),a.push(""),a.join(`
129
+ `)}async function Ry(){if(Rk())return;let e=Ik(),t=Date.now();if(e&&t-e.lastChecked<Dk){au(ve,e.latestVersion)&&process.stderr.write(jy(e.latestVersion));return}let r=await Yd();r&&(qk({lastChecked:t,latestVersion:r}),au(ve,r)&&process.stderr.write(jy(r)))}var gi,Dy,Dk,Kd,nn=ee(()=>{"use strict";gi=require("node:fs"),Dy=require("node:path");We();fr();Dk=3600*1e3,Kd="https://api.github.com/repos/resend/resend-cli/releases/latest"});var t1={};Lr(t1,{flushFromFile:()=>iE,flushPayload:()=>e1,getOrCreateAnonymousId:()=>X_,isDisabled:()=>Z_,trackCommand:()=>tp});function tE(){return eE[process.platform]??process.platform}function Z_(){return!Q_||process.env.DO_NOT_TRACK==="1"||process.env.RESEND_TELEMETRY_DISABLED==="1"}function X_(){let e=It(),t=(0,Rt.join)(e,"telemetry-id");try{let i=(0,ce.readFileSync)(t,"utf-8").trim();if(i)return i}catch{}let r=crypto.randomUUID();return(0,ce.mkdirSync)(e,{recursive:!0,mode:448}),(0,ce.writeFileSync)(t,r,{mode:384}),r}function rE(e){if(!e)return;let t=It(),r=(0,Rt.join)(t,"telemetry-notice-shown");(0,ce.existsSync)(r)||((0,ce.mkdirSync)(t,{recursive:!0,mode:448}),(0,ce.writeFileSync)(r,"",{mode:384}),process.stderr.write(`
64
130
  Resend collects anonymous CLI usage data to improve the tool.
65
131
  To opt out: export RESEND_TELEMETRY_DISABLED=1
66
132
 
67
- `))}function ll(e,t){if(!mv())try{let r=w()&&!t.json;_S(r);let i=fv(),n={command:e,cli_version:Y,os:vS(),node_version:process.version,interactive:r,install_method:Y0()};t.flags?.length&&(n.flags=t.flags),t.globalFlags?.length&&(n.global_flags=t.globalFlags);let s=JSON.stringify({api_key:pv,distinct_id:i,event:"cli.used",properties:n}),o=(0,Jr.join)((0,cl.tmpdir)(),`resend-telemetry-${process.pid}-${Date.now()}.json`);(0,ze.writeFileSync)(o,s,{mode:384});let a="pkg"in process,u=a?["telemetry","flush",o]:process.execArgv.concat([process.argv[1],"telemetry","flush",o]);(0,dv.spawn)(process.execPath,u,{detached:!0,stdio:"ignore",env:{...process.env,RESEND_TELEMETRY_DISABLED:"1",...a?{PKG_EXECPATH:""}:{}}}).unref()}catch{}}async function hv(e){JSON.parse(e),await fetch(gS,{method:"POST",headers:{"Content-Type":"application/json"},body:e,signal:AbortSignal.timeout(3e3)})}async function yS(e){let t=(0,Jr.join)(e);if(!t.startsWith((0,cl.tmpdir)())||!/resend-telemetry-.*\.json$/.test(t))throw new Error("invalid telemetry flush path");let r=(0,ze.readFileSync)(t,"utf-8");(0,ze.unlinkSync)(t),await hv(r)}var dv,ze,cl,Jr,pv,gS,bS,dl=z(()=>{"use strict";dv=require("node:child_process"),ze=require("node:fs"),cl=require("node:os"),Jr=require("node:path");Ce();G();Mr();yt();pv="phc_AgEBpcQTRsBl3UgQX2U8XvimTlgdXG6YEhfvJl2cUfc",gS="https://us.i.posthog.com/capture/",bS={darwin:"macOS",win32:"Windows",linux:"Linux"}});var El=oe(Al(),1),{program:TS,createCommand:PS,createArgument:DS,createOption:jS,CommanderError:IS,InvalidArgumentError:qS,InvalidOptionArgumentError:$S,Command:f,Argument:zS,Option:be,Help:RS}=El.default;var lr=oe(st(),1);var Gv=`Global options:
133
+ `))}function tp(e,t){if(!Z_())try{let r=D()&&!t.json;rE(r);let i=X_(),n={command:e,cli_version:ve,os:tE(),node_version:process.version,interactive:r,install_method:qy()};t.flags?.length&&(n.flags=t.flags),t.globalFlags?.length&&(n.global_flags=t.globalFlags);let s=JSON.stringify({api_key:Q_,distinct_id:i,event:"cli.used",properties:n}),o=(0,Rt.join)((0,ep.tmpdir)(),`resend-telemetry-${process.pid}-${Date.now()}.json`);(0,ce.writeFileSync)(o,s,{mode:384});let a="pkg"in process,l=a?["telemetry","flush",o]:process.execArgv.concat([process.argv[1],"telemetry","flush",o]);(0,Y_.spawn)(process.execPath,l,{detached:!0,stdio:"ignore",env:{...process.env,RESEND_TELEMETRY_DISABLED:"1",...a?{PKG_EXECPATH:""}:{}}}).unref()}catch{}}async function e1(e){JSON.parse(e);let t=await fetch(Xk,{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 iE(e){let t=(0,Rt.join)(e),r=(0,ep.tmpdir)(),i=(0,Rt.basename)(t);if((0,Rt.dirname)(t)!==r||!/resend-telemetry-.*\.json$/.test(i)||(0,ce.realpathSync)((0,Rt.dirname)(t))!==(0,ce.realpathSync)(r))throw new Error("invalid telemetry flush path");let n=(0,ce.openSync)(t,ce.constants.O_RDONLY|ce.constants.O_NOFOLLOW),s;try{if(!(0,ce.fstatSync)(n).isFile())throw new Error("invalid telemetry flush path");s=(0,ce.readFileSync)(n,"utf-8")}finally{(0,ce.closeSync)(n)}await e1(s),(0,ce.unlinkSync)(t)}var Y_,ce,ep,Rt,Q_,Xk,eE,rp=ee(()=>{"use strict";Y_=require("node:child_process"),ce=require("node:fs"),ep=require("node:os"),Rt=require("node:path");We();ae();nn();fr();Q_="phc_AgEBpcQTRsBl3UgQX2U8XvimTlgdXG6YEhfvJl2cUfc",Xk="https://us.i.posthog.com/capture/",eE={darwin:"macOS",win32:"Windows",linux:"Linux"}});var yp=me(vp(),1),{program:pE,createCommand:mE,createArgument:fE,createOption:hE,CommanderError:gE,InvalidArgumentError:bE,InvalidOptionArgumentError:vE,Command:h,Argument:_p,Option:Le,Help:yE}=yp.default;var Ci=me(Kt(),1);var j1=`Global options:
68
134
  --api-key <key> API key (or set RESEND_API_KEY env var)
69
135
  -p, --profile <name> Profile to use (overrides RESEND_PROFILE)
70
136
  --json Force JSON output (also auto-enabled when stdout is piped)
71
- -q, --quiet Suppress spinners and status output (implies --json)`,Uv=`Global options:
137
+ -q, --quiet Suppress spinners and status output (implies --json)`,D1=`Global options:
72
138
  -p, --profile <name> Profile to use
73
139
  --json Force JSON output
74
- -q, --quiet Suppress spinners and status output (implies --json)`,Wv=' {"error":{"message":"<message>","code":"<code>"}}';function g(e){let t=[];return e.context!=null&&t.push(e.context),t.push(e.setup?Uv:Gv),e.output!=null&&t.push(`Output (--json or piped):
140
+ -q, --quiet Suppress spinners and status output (implies --json)`,I1=' {"error":{"message":"<message>","code":"<code>"}}';function g(e){let t=[];return e.context!=null&&t.push(e.context),t.push(e.setup?D1:j1),e.output!=null&&t.push(`Output (--json or piped):
75
141
  ${e.output}`),e.errorCodes!=null&&t.push(`Errors (exit code 1):
76
- ${Wv}
142
+ ${I1}
77
143
  Codes: ${e.errorCodes.join(" | ")}`),t.push(`Examples:
78
144
  ${e.examples.map(r=>` $ ${r}`).join(`
79
145
  `)}`),`
80
146
  ${t.join(`
81
147
 
82
- `)}`}var Qr=require("node:util"),mr=require("node:process");var $l=oe(require("node:readline"),1),Me=oe(Ya(),1);function bt(e,t,r){if(!r.some(o=>!o.disabled))return e;let i=e+t,n=Math.max(r.length-1,0),s=i<0?n:i>n?0:i;return r[s].disabled?bt(s,t<0?-1:1,r):s}var Yv=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,Qv=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Zv=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,Qa=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,Wr=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Vr=/\t{1,1000}/y,Za=/[\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,Kr=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Xv=/\p{M}+/gu,e_={limit:1/0,ellipsis:""},zl=(e,t={},r={})=>{let i=t.limit??1/0,n=t.ellipsis??"",s=t?.ellipsisWidth??(n?zl(n,e_,r).width:0),o=r.ansiWidth??0,a=r.controlWidth??0,u=r.tabWidth??8,c=r.ambiguousWidth??1,d=r.emojiWidth??2,l=r.fullWidthWidth??2,p=r.regularWidth??1,y=r.wideWidth??2,h=0,b=0,C=e.length,S=0,O=!1,k=C,T=Math.max(0,i-s),E=0,P=0,x=0,A=0;e:for(;;){if(P>E||b>=C&&b>h){let F=e.slice(E,P)||e.slice(h,b);S=0;for(let ue of F.replaceAll(Xv,"")){let me=ue.codePointAt(0)||0;if(Qv(me)?A=l:Zv(me)?A=y:c!==p&&Yv(me)?A=c:A=p,x+A>T&&(k=Math.min(k,Math.max(E,h)+S)),x+A>i){O=!0;break e}S+=ue.length,x+=A}E=P=0}if(b>=C)break;if(Kr.lastIndex=b,Kr.test(e)){if(S=Kr.lastIndex-b,A=S*p,x+A>T&&(k=Math.min(k,b+Math.floor((T-x)/p))),x+A>i){O=!0;break}x+=A,E=h,P=b,b=h=Kr.lastIndex;continue}if(Qa.lastIndex=b,Qa.test(e)){if(x+o>T&&(k=Math.min(k,b)),x+o>i){O=!0;break}x+=o,E=h,P=b,b=h=Qa.lastIndex;continue}if(Wr.lastIndex=b,Wr.test(e)){if(S=Wr.lastIndex-b,A=S*a,x+A>T&&(k=Math.min(k,b+Math.floor((T-x)/a))),x+A>i){O=!0;break}x+=A,E=h,P=b,b=h=Wr.lastIndex;continue}if(Vr.lastIndex=b,Vr.test(e)){if(S=Vr.lastIndex-b,A=S*u,x+A>T&&(k=Math.min(k,b+Math.floor((T-x)/u))),x+A>i){O=!0;break}x+=A,E=h,P=b,b=h=Vr.lastIndex;continue}if(Za.lastIndex=b,Za.test(e)){if(x+d>T&&(k=Math.min(k,b)),x+d>i){O=!0;break}x+=d,E=h,P=b,b=h=Za.lastIndex;continue}b+=1}return{width:O?T:x,index:O?k:C,truncated:O,ellipsed:O&&i>=s}},t_={limit:1/0,ellipsis:"",ellipsisWidth:0},pr=(e,t={})=>zl(e,t_,t).width,ri="\x1B",Rl="\x9B",r_=39,ru="\x07",Ml="[",i_="]",Jl="m",iu=`${i_}8;;`,jl=new RegExp(`(?:\\${Ml}(?<code>\\d+)m|\\${iu}(?<uri>.*)${ru})`,"y"),n_=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},Il=e=>`${ri}${Ml}${e}${Jl}`,ql=e=>`${ri}${iu}${e}${ru}`,s_=e=>e.map(t=>pr(t)),Xa=(e,t,r)=>{let i=t[Symbol.iterator](),n=!1,s=!1,o=e.at(-1),a=o===void 0?0:pr(o),u=i.next(),c=i.next(),d=0;for(;!u.done;){let l=u.value,p=pr(l);a+p<=r?e[e.length-1]+=l:(e.push(l),a=0),(l===ri||l===Rl)&&(n=!0,s=t.startsWith(iu,d+1)),n?s?l===ru&&(n=!1,s=!1):l===Jl&&(n=!1):(a+=p,a===r&&!c.done&&(e.push(""),a=0)),u=c,c=i.next(),d+=l.length}o=e.at(-1),!a&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},o_=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(pr(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},a_=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,s,o=e.split(" "),a=s_(o),u=[""];for(let[h,b]of o.entries()){r.trim!==!1&&(u[u.length-1]=(u.at(-1)??"").trimStart());let C=pr(u.at(-1)??"");if(h!==0&&(C>=t&&(r.wordWrap===!1||r.trim===!1)&&(u.push(""),C=0),(C>0||r.trim===!1)&&(u[u.length-1]+=" ",C++)),r.hard&&a[h]>t){let S=t-C,O=1+Math.floor((a[h]-S-1)/t);Math.floor((a[h]-1)/t)<O&&u.push(""),Xa(u,b,t);continue}if(C+a[h]>t&&C>0&&a[h]>0){if(r.wordWrap===!1&&C<t){Xa(u,b,t);continue}u.push("")}if(C+a[h]>t&&r.wordWrap===!1){Xa(u,b,t);continue}u[u.length-1]+=b}r.trim!==!1&&(u=u.map(h=>o_(h)));let c=u.join(`
83
- `),d=c[Symbol.iterator](),l=d.next(),p=d.next(),y=0;for(;!l.done;){let h=l.value,b=p.value;if(i+=h,h===ri||h===Rl){jl.lastIndex=y+1;let S=jl.exec(c)?.groups;if(S?.code!==void 0){let O=Number.parseFloat(S.code);n=O===r_?void 0:O}else S?.uri!==void 0&&(s=S.uri.length===0?void 0:S.uri)}let C=n?n_(n):void 0;b===`
84
- `?(s&&(i+=ql("")),n&&C&&(i+=Il(C))):h===`
85
- `&&(n&&C&&(i+=Il(n)),s&&(i+=ql(s))),y+=h.length,l=p,p=d.next()}return i};function eu(e,t,r){return String(e).normalize().replaceAll(`\r
148
+ `)}`}var hn=require("node:util"),ki=require("node:process");var Ep=me(require("node:readline"),1),dt=me(Tu(),1);function dr(e,t,r){if(!r.some(o=>!o.disabled))return e;let i=e+t,n=Math.max(r.length-1,0),s=i<0?n:i>n?0:i;return r[s].disabled?dr(s,t<0?-1:1,r):s}var M1=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,z1=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,F1=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,$u=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,dn=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,pn=/\t{1,1000}/y,ju=/[\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,mn=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,J1=/\p{M}+/gu,B1={limit:1/0,ellipsis:""},Ap=(e,t={},r={})=>{let i=t.limit??1/0,n=t.ellipsis??"",s=t?.ellipsisWidth??(n?Ap(n,B1,r).width:0),o=r.ansiWidth??0,a=r.controlWidth??0,l=r.tabWidth??8,u=r.ambiguousWidth??1,c=r.emojiWidth??2,d=r.fullWidthWidth??2,p=r.regularWidth??1,v=r.wideWidth??2,f=0,b=0,S=e.length,T=0,x=!1,E=S,k=Math.max(0,i-s),w=0,_=0,C=0,P=0;e:for(;;){if(_>w||b>=S&&b>f){let q=e.slice(w,_)||e.slice(f,b);T=0;for(let M of q.replaceAll(J1,"")){let $=M.codePointAt(0)||0;if(z1($)?P=d:F1($)?P=v:u!==p&&M1($)?P=u:P=p,C+P>k&&(E=Math.min(E,Math.max(w,f)+T)),C+P>i){x=!0;break e}T+=M.length,C+=P}w=_=0}if(b>=S)break;if(mn.lastIndex=b,mn.test(e)){if(T=mn.lastIndex-b,P=T*p,C+P>k&&(E=Math.min(E,b+Math.floor((k-C)/p))),C+P>i){x=!0;break}C+=P,w=f,_=b,b=f=mn.lastIndex;continue}if($u.lastIndex=b,$u.test(e)){if(C+o>k&&(E=Math.min(E,b)),C+o>i){x=!0;break}C+=o,w=f,_=b,b=f=$u.lastIndex;continue}if(dn.lastIndex=b,dn.test(e)){if(T=dn.lastIndex-b,P=T*a,C+P>k&&(E=Math.min(E,b+Math.floor((k-C)/a))),C+P>i){x=!0;break}C+=P,w=f,_=b,b=f=dn.lastIndex;continue}if(pn.lastIndex=b,pn.test(e)){if(T=pn.lastIndex-b,P=T*l,C+P>k&&(E=Math.min(E,b+Math.floor((k-C)/l))),C+P>i){x=!0;break}C+=P,w=f,_=b,b=f=pn.lastIndex;continue}if(ju.lastIndex=b,ju.test(e)){if(C+c>k&&(E=Math.min(E,b)),C+c>i){x=!0;break}C+=c,w=f,_=b,b=f=ju.lastIndex;continue}b+=1}return{width:x?k:C,index:x?E:S,truncated:x,ellipsed:x&&i>=s}},H1={limit:1/0,ellipsis:"",ellipsisWidth:0},xi=(e,t={})=>Ap(e,H1,t).width,_n="\x1B",Pp="\x9B",L1=39,Ru="\x07",Tp="[",N1="]",$p="m",Mu=`${N1}8;;`,Op=new RegExp(`(?:\\${Tp}(?<code>\\d+)m|\\${Mu}(?<uri>.*)${Ru})`,"y"),G1=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},xp=e=>`${_n}${Tp}${e}${$p}`,kp=e=>`${_n}${Mu}${e}${Ru}`,U1=e=>e.map(t=>xi(t)),Du=(e,t,r)=>{let i=t[Symbol.iterator](),n=!1,s=!1,o=e.at(-1),a=o===void 0?0:xi(o),l=i.next(),u=i.next(),c=0;for(;!l.done;){let d=l.value,p=xi(d);a+p<=r?e[e.length-1]+=d:(e.push(d),a=0),(d===_n||d===Pp)&&(n=!0,s=t.startsWith(Mu,c+1)),n?s?d===Ru&&(n=!1,s=!1):d===$p&&(n=!1):(a+=p,a===r&&!u.done&&(e.push(""),a=0)),l=u,u=i.next(),c+=d.length}o=e.at(-1),!a&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},W1=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(xi(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},V1=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,s,o=e.split(" "),a=U1(o),l=[""];for(let[f,b]of o.entries()){r.trim!==!1&&(l[l.length-1]=(l.at(-1)??"").trimStart());let S=xi(l.at(-1)??"");if(f!==0&&(S>=t&&(r.wordWrap===!1||r.trim===!1)&&(l.push(""),S=0),(S>0||r.trim===!1)&&(l[l.length-1]+=" ",S++)),r.hard&&a[f]>t){let T=t-S,x=1+Math.floor((a[f]-T-1)/t);Math.floor((a[f]-1)/t)<x&&l.push(""),Du(l,b,t);continue}if(S+a[f]>t&&S>0&&a[f]>0){if(r.wordWrap===!1&&S<t){Du(l,b,t);continue}l.push("")}if(S+a[f]>t&&r.wordWrap===!1){Du(l,b,t);continue}l[l.length-1]+=b}r.trim!==!1&&(l=l.map(f=>W1(f)));let u=l.join(`
149
+ `),c=u[Symbol.iterator](),d=c.next(),p=c.next(),v=0;for(;!d.done;){let f=d.value,b=p.value;if(i+=f,f===_n||f===Pp){Op.lastIndex=v+1;let T=Op.exec(u)?.groups;if(T?.code!==void 0){let x=Number.parseFloat(T.code);n=x===L1?void 0:x}else T?.uri!==void 0&&(s=T.uri.length===0?void 0:T.uri)}let S=n?G1(n):void 0;b===`
150
+ `?(s&&(i+=kp("")),n&&S&&(i+=xp(S))):f===`
151
+ `&&(n&&S&&(i+=xp(n)),s&&(i+=kp(s))),v+=f.length,d=p,p=c.next()}return i};function Iu(e,t,r){return String(e).normalize().replaceAll(`\r
86
152
  `,`
87
153
  `).split(`
88
- `).map(i=>a_(i,t,r)).join(`
89
- `)}var u_=["up","down","left","right","space","enter","cancel"],ke={actions:new Set(u_),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function Fl(e,t){if(typeof e=="string")return ke.aliases.get(e)===t;for(let r of e)if(r!==void 0&&Fl(r,t))return!0;return!1}function c_(e,t){if(e===t)return;let r=e.split(`
154
+ `).map(i=>V1(i,t,r)).join(`
155
+ `)}var K1=["up","down","left","right","space","enter","cancel"],Xe={actions:new Set(K1),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function jp(e,t){if(typeof e=="string")return Xe.aliases.get(e)===t;for(let r of e)if(r!==void 0&&jp(r,t))return!0;return!1}function Y1(e,t){if(e===t)return;let r=e.split(`
90
156
  `),i=t.split(`
91
- `),n=Math.max(r.length,i.length),s=[];for(let o=0;o<n;o++)r[o]!==i[o]&&s.push(o);return{lines:s,numLinesBefore:r.length,numLinesAfter:i.length,numLines:n}}var HS=globalThis.process.platform.startsWith("win"),tu=Symbol("clack:cancel");function D(e){return e===tu}function Yr(e,t){let r=e;r.isTTY&&r.setRawMode(t)}var nu=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,su=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function _t(e,t,r,i=r){let n=nu(e??mr.stdout);return eu(t,n-r.length,{hard:!0,trim:!1}).split(`
157
+ `),n=Math.max(r.length,i.length),s=[];for(let o=0;o<n;o++)r[o]!==i[o]&&s.push(o);return{lines:s,numLinesBefore:r.length,numLinesAfter:i.length,numLines:n}}var OE=globalThis.process.platform.startsWith("win"),qu=Symbol("clack:cancel");function B(e){return e===qu}function fn(e,t){let r=e;r.isTTY&&r.setRawMode(t)}var zu=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,Fu=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function mr(e,t,r,i=r){let n=zu(e??ki.stdout);return Iu(t,n-r.length,{hard:!0,trim:!1}).split(`
92
158
  `).map((s,o)=>`${o===0?i:r}${s}`).join(`
93
- `)}var vt=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:s,signal:o,...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=s.bind(this),this._track=r,this._abortSignal=o,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 s of i)s.cb(...r),s.once&&n.push(()=>i.splice(i.indexOf(s),1));for(let s of n)s()}prompt(){return new Promise(t=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(tu);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=$l.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),Yr(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Me.cursor.show),this.output.off("resize",this.render),Yr(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(Me.cursor.show),this.output.off("resize",this.render),Yr(this.input,!1),t(tu)})})}_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&&ke.aliases.has(r.name)&&this.emit("cursor",ke.aliases.get(r.name)),ke.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")}Fl([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(`
94
- `),Yr(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=eu(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
95
- `).length-1;this.output.write(Me.cursor.move(-999,t*-1))}render(){let t=eu(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(Me.cursor.hide);else{let r=c_(this._prevFrame,t),i=su(this.output);if(this.restoreCursor(),r){let n=Math.max(0,r.numLinesAfter-i),s=Math.max(0,r.numLinesBefore-i),o=r.lines.find(a=>a>=n);if(o===void 0){this._prevFrame=t;return}if(r.lines.length===1){this.output.write(Me.cursor.move(0,o-s)),this.output.write(Me.erase.lines(1));let a=t.split(`
96
- `);this.output.write(a[o]),this._prevFrame=t,this.output.write(Me.cursor.move(0,a.length-o-1));return}else if(r.lines.length>1){if(n<s)o=n;else{let u=o-s;u>0&&this.output.write(Me.cursor.move(0,u))}this.output.write(Me.erase.down());let a=t.split(`
159
+ `)}var pr=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=ki.stdin,output:n=ki.stdout,render:s,signal:o,...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=s.bind(this),this._track=r,this._abortSignal=o,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 s of i)s.cb(...r),s.once&&n.push(()=>i.splice(i.indexOf(s),1));for(let s of n)s()}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=Ep.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),fn(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(dt.cursor.show),this.output.off("resize",this.render),fn(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(dt.cursor.show),this.output.off("resize",this.render),fn(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&&Xe.aliases.has(r.name)&&this.emit("cursor",Xe.aliases.get(r.name)),Xe.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")}jp([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(`
160
+ `),fn(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=Iu(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
161
+ `).length-1;this.output.write(dt.cursor.move(-999,t*-1))}render(){let t=Iu(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(dt.cursor.hide);else{let r=Y1(this._prevFrame,t),i=Fu(this.output);if(this.restoreCursor(),r){let n=Math.max(0,r.numLinesAfter-i),s=Math.max(0,r.numLinesBefore-i),o=r.lines.find(a=>a>=n);if(o===void 0){this._prevFrame=t;return}if(r.lines.length===1){this.output.write(dt.cursor.move(0,o-s)),this.output.write(dt.erase.lines(1));let a=t.split(`
162
+ `);this.output.write(a[o]),this._prevFrame=t,this.output.write(dt.cursor.move(0,a.length-o-1));return}else if(r.lines.length>1){if(n<s)o=n;else{let l=o-s;l>0&&this.output.write(dt.cursor.move(0,l))}this.output.write(dt.erase.down());let a=t.split(`
97
163
  `).slice(o);this.output.write(a.join(`
98
- `)),this._prevFrame=t;return}}this.output.write(Me.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};var Zr=class extends vt{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(Me.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var Bl=class extends vt{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?bt(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=bt(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=bt(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},Xr=class extends vt{_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,Qr.styleText)(["inverse","hidden"],"_")}`;let r=this.masked,i=r.slice(0,this.cursor),n=r.slice(this.cursor);return`${i}${(0,Qr.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)})}},ei=class extends vt{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?bt(i,1,this.options):i,this.changeValue(),this.on("cursor",n=>{switch(n){case"left":case"up":this.cursor=bt(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=bt(this.cursor,1,this.options);break}this.changeValue()})}};var ti=class extends vt{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,Qr.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 _=require("node:util"),Be=oe(require("node:process"),1);var Wl=oe(Ya(),1);function l_(){return Be.default.platform!=="win32"?Be.default.env.TERM!=="linux":!!Be.default.env.CI||!!Be.default.env.WT_SESSION||!!Be.default.env.TERMINUS_SUBLIME||Be.default.env.ConEmuTask==="{cmd::Cmder}"||Be.default.env.TERM_PROGRAM==="Terminus-Sublime"||Be.default.env.TERM_PROGRAM==="vscode"||Be.default.env.TERM==="xterm-256color"||Be.default.env.TERM==="alacritty"||Be.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var d_=l_();var B=(e,t)=>d_?e:t,p_=B("\u25C6","*"),m_=B("\u25A0","x"),f_=B("\u25B2","x"),Vl=B("\u25C7","o"),h_=B("\u250C","T"),I=B("\u2502","|"),Ye=B("\u2514","\u2014"),QS=B("\u2510","T"),ZS=B("\u2518","\u2014"),cu=B("\u25CF",">"),ai=B("\u25CB"," "),g_=B("\u25FB","[\u2022]"),Hl=B("\u25FC","[+]"),Ll=B("\u25FB","[ ]"),b_=B("\u25AA","\u2022"),XS=B("\u2500","-"),ex=B("\u256E","+"),tx=B("\u251C","+"),rx=B("\u256F","+"),ix=B("\u2570","+"),nx=B("\u256D","+"),v_=B("\u25CF","\u2022"),__=B("\u25C6","*"),y_=B("\u25B2","!"),O_=B("\u25A0","x"),gr=e=>{switch(e){case"initial":case"active":return(0,_.styleText)("cyan",p_);case"cancel":return(0,_.styleText)("red",m_);case"error":return(0,_.styleText)("yellow",f_);case"submit":return(0,_.styleText)("green",Vl)}},Kl=e=>{switch(e){case"initial":case"active":return(0,_.styleText)("cyan",I);case"cancel":return(0,_.styleText)("red",I);case"error":return(0,_.styleText)("yellow",I);case"submit":return(0,_.styleText)("green",I)}},C_=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,S_=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,x_=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,ou=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,ii=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ni=/\t{1,1000}/y,au=/[\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,si=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,w_=/\p{M}+/gu,k_={limit:1/0,ellipsis:""},Yl=(e,t={},r={})=>{let i=t.limit??1/0,n=t.ellipsis??"",s=t?.ellipsisWidth??(n?Yl(n,k_,r).width:0),o=r.ansiWidth??0,a=r.controlWidth??0,u=r.tabWidth??8,c=r.ambiguousWidth??1,d=r.emojiWidth??2,l=r.fullWidthWidth??2,p=r.regularWidth??1,y=r.wideWidth??2,h=0,b=0,C=e.length,S=0,O=!1,k=C,T=Math.max(0,i-s),E=0,P=0,x=0,A=0;e:for(;;){if(P>E||b>=C&&b>h){let F=e.slice(E,P)||e.slice(h,b);S=0;for(let ue of F.replaceAll(w_,"")){let me=ue.codePointAt(0)||0;if(S_(me)?A=l:x_(me)?A=y:c!==p&&C_(me)?A=c:A=p,x+A>T&&(k=Math.min(k,Math.max(E,h)+S)),x+A>i){O=!0;break e}S+=ue.length,x+=A}E=P=0}if(b>=C)break;if(si.lastIndex=b,si.test(e)){if(S=si.lastIndex-b,A=S*p,x+A>T&&(k=Math.min(k,b+Math.floor((T-x)/p))),x+A>i){O=!0;break}x+=A,E=h,P=b,b=h=si.lastIndex;continue}if(ou.lastIndex=b,ou.test(e)){if(x+o>T&&(k=Math.min(k,b)),x+o>i){O=!0;break}x+=o,E=h,P=b,b=h=ou.lastIndex;continue}if(ii.lastIndex=b,ii.test(e)){if(S=ii.lastIndex-b,A=S*a,x+A>T&&(k=Math.min(k,b+Math.floor((T-x)/a))),x+A>i){O=!0;break}x+=A,E=h,P=b,b=h=ii.lastIndex;continue}if(ni.lastIndex=b,ni.test(e)){if(S=ni.lastIndex-b,A=S*u,x+A>T&&(k=Math.min(k,b+Math.floor((T-x)/u))),x+A>i){O=!0;break}x+=A,E=h,P=b,b=h=ni.lastIndex;continue}if(au.lastIndex=b,au.test(e)){if(x+d>T&&(k=Math.min(k,b)),x+d>i){O=!0;break}x+=d,E=h,P=b,b=h=au.lastIndex;continue}b+=1}return{width:O?T:x,index:O?k:C,truncated:O,ellipsed:O&&i>=s}},A_={limit:1/0,ellipsis:"",ellipsisWidth:0},hr=(e,t={})=>Yl(e,A_,t).width,ui="\x1B",Ql="\x9B",E_=39,du="\x07",Zl="[",T_="]",Xl="m",pu=`${T_}8;;`,Nl=new RegExp(`(?:\\${Zl}(?<code>\\d+)m|\\${pu}(?<uri>.*)${du})`,"y"),P_=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},Gl=e=>`${ui}${Zl}${e}${Xl}`,Ul=e=>`${ui}${pu}${e}${du}`,D_=e=>e.map(t=>hr(t)),uu=(e,t,r)=>{let i=t[Symbol.iterator](),n=!1,s=!1,o=e.at(-1),a=o===void 0?0:hr(o),u=i.next(),c=i.next(),d=0;for(;!u.done;){let l=u.value,p=hr(l);a+p<=r?e[e.length-1]+=l:(e.push(l),a=0),(l===ui||l===Ql)&&(n=!0,s=t.startsWith(pu,d+1)),n?s?l===du&&(n=!1,s=!1):l===Xl&&(n=!1):(a+=p,a===r&&!c.done&&(e.push(""),a=0)),u=c,c=i.next(),d+=l.length}o=e.at(-1),!a&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},j_=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("")},I_=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,s,o=e.split(" "),a=D_(o),u=[""];for(let[h,b]of o.entries()){r.trim!==!1&&(u[u.length-1]=(u.at(-1)??"").trimStart());let C=hr(u.at(-1)??"");if(h!==0&&(C>=t&&(r.wordWrap===!1||r.trim===!1)&&(u.push(""),C=0),(C>0||r.trim===!1)&&(u[u.length-1]+=" ",C++)),r.hard&&a[h]>t){let S=t-C,O=1+Math.floor((a[h]-S-1)/t);Math.floor((a[h]-1)/t)<O&&u.push(""),uu(u,b,t);continue}if(C+a[h]>t&&C>0&&a[h]>0){if(r.wordWrap===!1&&C<t){uu(u,b,t);continue}u.push("")}if(C+a[h]>t&&r.wordWrap===!1){uu(u,b,t);continue}u[u.length-1]+=b}r.trim!==!1&&(u=u.map(h=>j_(h)));let c=u.join(`
99
- `),d=c[Symbol.iterator](),l=d.next(),p=d.next(),y=0;for(;!l.done;){let h=l.value,b=p.value;if(i+=h,h===ui||h===Ql){Nl.lastIndex=y+1;let S=Nl.exec(c)?.groups;if(S?.code!==void 0){let O=Number.parseFloat(S.code);n=O===E_?void 0:O}else S?.uri!==void 0&&(s=S.uri.length===0?void 0:S.uri)}let C=n?P_(n):void 0;b===`
100
- `?(s&&(i+=Ul("")),n&&C&&(i+=Gl(C))):h===`
101
- `&&(n&&C&&(i+=Gl(n)),s&&(i+=Ul(s))),y+=h.length,l=p,p=d.next()}return i};function q_(e,t,r){return String(e).normalize().replaceAll(`\r
164
+ `)),this._prevFrame=t;return}}this.output.write(dt.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};var gn=class extends pr{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(dt.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var Dp=class extends pr{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?dr(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=dr(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=dr(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},bn=class extends pr{_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,hn.styleText)(["inverse","hidden"],"_")}`;let r=this.masked,i=r.slice(0,this.cursor),n=r.slice(this.cursor);return`${i}${(0,hn.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)})}},vn=class extends pr{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?dr(i,1,this.options):i,this.changeValue(),this.on("cursor",n=>{switch(n){case"left":case"up":this.cursor=dr(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=dr(this.cursor,1,this.options);break}this.changeValue()})}};var yn=class extends pr{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,hn.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 A=require("node:util"),vt=me(require("node:process"),1);var Fp=me(Tu(),1);function Q1(){return vt.default.platform!=="win32"?vt.default.env.TERM!=="linux":!!vt.default.env.CI||!!vt.default.env.WT_SESSION||!!vt.default.env.TERMINUS_SUBLIME||vt.default.env.ConEmuTask==="{cmd::Cmder}"||vt.default.env.TERM_PROGRAM==="Terminus-Sublime"||vt.default.env.TERM_PROGRAM==="vscode"||vt.default.env.TERM==="xterm-256color"||vt.default.env.TERM==="alacritty"||vt.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Z1=Q1();var se=(e,t)=>Z1?e:t,X1=se("\u25C6","*"),ew=se("\u25A0","x"),tw=se("\u25B2","x"),Jp=se("\u25C7","o"),rw=se("\u250C","T"),K=se("\u2502","|"),jt=se("\u2514","\u2014"),DE=se("\u2510","T"),IE=se("\u2518","\u2014"),Lu=se("\u25CF",">"),xn=se("\u25CB"," "),iw=se("\u25FB","[\u2022]"),Ip=se("\u25FC","[+]"),qp=se("\u25FB","[ ]"),nw=se("\u25AA","\u2022"),qE=se("\u2500","-"),RE=se("\u256E","+"),ME=se("\u251C","+"),zE=se("\u256F","+"),FE=se("\u2570","+"),JE=se("\u256D","+"),sw=se("\u25CF","\u2022"),ow=se("\u25C6","*"),aw=se("\u25B2","!"),lw=se("\u25A0","x"),Pi=e=>{switch(e){case"initial":case"active":return(0,A.styleText)("cyan",X1);case"cancel":return(0,A.styleText)("red",ew);case"error":return(0,A.styleText)("yellow",tw);case"submit":return(0,A.styleText)("green",Jp)}},Bp=e=>{switch(e){case"initial":case"active":return(0,A.styleText)("cyan",K);case"cancel":return(0,A.styleText)("red",K);case"error":return(0,A.styleText)("yellow",K);case"submit":return(0,A.styleText)("green",K)}},uw=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,cw=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,dw=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,wn=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Cn=/\t{1,1000}/y,Bu=/[\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,Sn=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,pw=/\p{M}+/gu,mw={limit:1/0,ellipsis:""},Hp=(e,t={},r={})=>{let i=t.limit??1/0,n=t.ellipsis??"",s=t?.ellipsisWidth??(n?Hp(n,mw,r).width:0),o=r.ansiWidth??0,a=r.controlWidth??0,l=r.tabWidth??8,u=r.ambiguousWidth??1,c=r.emojiWidth??2,d=r.fullWidthWidth??2,p=r.regularWidth??1,v=r.wideWidth??2,f=0,b=0,S=e.length,T=0,x=!1,E=S,k=Math.max(0,i-s),w=0,_=0,C=0,P=0;e:for(;;){if(_>w||b>=S&&b>f){let q=e.slice(w,_)||e.slice(f,b);T=0;for(let M of q.replaceAll(pw,"")){let $=M.codePointAt(0)||0;if(cw($)?P=d:dw($)?P=v:u!==p&&uw($)?P=u:P=p,C+P>k&&(E=Math.min(E,Math.max(w,f)+T)),C+P>i){x=!0;break e}T+=M.length,C+=P}w=_=0}if(b>=S)break;if(Sn.lastIndex=b,Sn.test(e)){if(T=Sn.lastIndex-b,P=T*p,C+P>k&&(E=Math.min(E,b+Math.floor((k-C)/p))),C+P>i){x=!0;break}C+=P,w=f,_=b,b=f=Sn.lastIndex;continue}if(Ju.lastIndex=b,Ju.test(e)){if(C+o>k&&(E=Math.min(E,b)),C+o>i){x=!0;break}C+=o,w=f,_=b,b=f=Ju.lastIndex;continue}if(wn.lastIndex=b,wn.test(e)){if(T=wn.lastIndex-b,P=T*a,C+P>k&&(E=Math.min(E,b+Math.floor((k-C)/a))),C+P>i){x=!0;break}C+=P,w=f,_=b,b=f=wn.lastIndex;continue}if(Cn.lastIndex=b,Cn.test(e)){if(T=Cn.lastIndex-b,P=T*l,C+P>k&&(E=Math.min(E,b+Math.floor((k-C)/l))),C+P>i){x=!0;break}C+=P,w=f,_=b,b=f=Cn.lastIndex;continue}if(Bu.lastIndex=b,Bu.test(e)){if(C+c>k&&(E=Math.min(E,b)),C+c>i){x=!0;break}C+=c,w=f,_=b,b=f=Bu.lastIndex;continue}b+=1}return{width:x?k:C,index:x?E:S,truncated:x,ellipsed:x&&i>=s}},fw={limit:1/0,ellipsis:"",ellipsisWidth:0},Ai=(e,t={})=>Hp(e,fw,t).width,kn="\x1B",Lp="\x9B",hw=39,Gu="\x07",Np="[",gw="]",Gp="m",Uu=`${gw}8;;`,Rp=new RegExp(`(?:\\${Np}(?<code>\\d+)m|\\${Uu}(?<uri>.*)${Gu})`,"y"),bw=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},Mp=e=>`${kn}${Np}${e}${Gp}`,zp=e=>`${kn}${Uu}${e}${Gu}`,vw=e=>e.map(t=>Ai(t)),Hu=(e,t,r)=>{let i=t[Symbol.iterator](),n=!1,s=!1,o=e.at(-1),a=o===void 0?0:Ai(o),l=i.next(),u=i.next(),c=0;for(;!l.done;){let d=l.value,p=Ai(d);a+p<=r?e[e.length-1]+=d:(e.push(d),a=0),(d===kn||d===Lp)&&(n=!0,s=t.startsWith(Uu,c+1)),n?s?d===Gu&&(n=!1,s=!1):d===Gp&&(n=!1):(a+=p,a===r&&!u.done&&(e.push(""),a=0)),l=u,u=i.next(),c+=d.length}o=e.at(-1),!a&&o!==void 0&&o.length>0&&e.length>1&&(e[e.length-2]+=e.pop())},yw=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(Ai(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},_w=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,s,o=e.split(" "),a=vw(o),l=[""];for(let[f,b]of o.entries()){r.trim!==!1&&(l[l.length-1]=(l.at(-1)??"").trimStart());let S=Ai(l.at(-1)??"");if(f!==0&&(S>=t&&(r.wordWrap===!1||r.trim===!1)&&(l.push(""),S=0),(S>0||r.trim===!1)&&(l[l.length-1]+=" ",S++)),r.hard&&a[f]>t){let T=t-S,x=1+Math.floor((a[f]-T-1)/t);Math.floor((a[f]-1)/t)<x&&l.push(""),Hu(l,b,t);continue}if(S+a[f]>t&&S>0&&a[f]>0){if(r.wordWrap===!1&&S<t){Hu(l,b,t);continue}l.push("")}if(S+a[f]>t&&r.wordWrap===!1){Hu(l,b,t);continue}l[l.length-1]+=b}r.trim!==!1&&(l=l.map(f=>yw(f)));let u=l.join(`
165
+ `),c=u[Symbol.iterator](),d=c.next(),p=c.next(),v=0;for(;!d.done;){let f=d.value,b=p.value;if(i+=f,f===kn||f===Lp){Rp.lastIndex=v+1;let T=Rp.exec(u)?.groups;if(T?.code!==void 0){let x=Number.parseFloat(T.code);n=x===hw?void 0:x}else T?.uri!==void 0&&(s=T.uri.length===0?void 0:T.uri)}let S=n?bw(n):void 0;b===`
166
+ `?(s&&(i+=zp("")),n&&S&&(i+=Mp(S))):f===`
167
+ `&&(n&&S&&(i+=Mp(n)),s&&(i+=zp(s))),v+=f.length,d=p,p=c.next()}return i};function ww(e,t,r){return String(e).normalize().replaceAll(`\r
102
168
  `,`
103
169
  `).split(`
104
- `).map(i=>I_(i,t,r)).join(`
105
- `)}var $_=(e,t,r,i,n)=>{let s=t,o=0;for(let a=r;a<i;a++){let u=e[a];if(s=s-u.length,o++,s<=n)break}return{lineCount:s,removals:o}},lu=({cursor:e,options:t,style:r,output:i=process.stdout,maxItems:n=Number.POSITIVE_INFINITY,columnPadding:s=0,rowPadding:o=4})=>{let a=nu(i)-s,u=su(i),c=(0,_.styleText)("dim","..."),d=Math.max(u-o,0),l=Math.max(Math.min(n,d),5),p=0;e>=l-3&&(p=Math.max(Math.min(e-l+3,t.length-l),0));let y=l<t.length&&p>0,h=l<t.length&&p+l<t.length,b=Math.min(p+l,t.length),C=[],S=0;y&&S++,h&&S++;let O=p+(y?1:0),k=b-(h?1:0);for(let E=O;E<k;E++){let P=q_(r(t[E],E===e),a,{hard:!0,trim:!1}).split(`
106
- `);C.push(P),S+=P.length}if(S>d){let E=0,P=0,x=S,A=e-O,F=(ue,me)=>$_(C,x,ue,me,d);y?({lineCount:x,removals:E}=F(0,A),x>d&&({lineCount:x,removals:P}=F(A+1,C.length))):({lineCount:x,removals:P}=F(A+1,C.length),x>d&&({lineCount:x,removals:E}=F(0,A))),E>0&&(y=!0,C.splice(0,E)),P>0&&(h=!0,C.splice(C.length-P,P))}let T=[];y&&T.push(c);for(let E of C)for(let P of E)T.push(P);return h&&T.push(c),T};var ot=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new Zr({active:t,inactive:r,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let i=e.withGuide??ke.withGuide,n=`${i?`${(0,_.styleText)("gray",I)}
107
- `:""}${gr(this.state)} ${e.message}
108
- `,s=this.value?t:r;switch(this.state){case"submit":{let o=i?`${(0,_.styleText)("gray",I)} `:"";return`${n}${o}${(0,_.styleText)("dim",s)}`}case"cancel":{let o=i?`${(0,_.styleText)("gray",I)} `:"";return`${n}${o}${(0,_.styleText)(["strikethrough","dim"],s)}${i?`
109
- ${(0,_.styleText)("gray",I)}`:""}`}default:{let o=i?`${(0,_.styleText)("cyan",I)} `:"",a=i?(0,_.styleText)("cyan",Ye):"";return`${n}${o}${this.value?`${(0,_.styleText)("green",cu)} ${t}`:`${(0,_.styleText)("dim",ai)} ${(0,_.styleText)("dim",t)}`}${e.vertical?i?`
110
- ${(0,_.styleText)("cyan",I)} `:`
111
- `:` ${(0,_.styleText)("dim","/")} `}${this.value?`${(0,_.styleText)("dim",ai)} ${(0,_.styleText)("dim",r)}`:`${(0,_.styleText)("green",cu)} ${r}`}
170
+ `).map(i=>_w(i,t,r)).join(`
171
+ `)}var Cw=(e,t,r,i,n)=>{let s=t,o=0;for(let a=r;a<i;a++){let l=e[a];if(s=s-l.length,o++,s<=n)break}return{lineCount:s,removals:o}},Nu=({cursor:e,options:t,style:r,output:i=process.stdout,maxItems:n=Number.POSITIVE_INFINITY,columnPadding:s=0,rowPadding:o=4})=>{let a=zu(i)-s,l=Fu(i),u=(0,A.styleText)("dim","..."),c=Math.max(l-o,0),d=Math.max(Math.min(n,c),5),p=0;e>=d-3&&(p=Math.max(Math.min(e-d+3,t.length-d),0));let v=d<t.length&&p>0,f=d<t.length&&p+d<t.length,b=Math.min(p+d,t.length),S=[],T=0;v&&T++,f&&T++;let x=p+(v?1:0),E=b-(f?1:0);for(let w=x;w<E;w++){let _=ww(r(t[w],w===e),a,{hard:!0,trim:!1}).split(`
172
+ `);S.push(_),T+=_.length}if(T>c){let w=0,_=0,C=T,P=e-x,q=(M,$)=>Cw(S,C,M,$,c);v?({lineCount:C,removals:w}=q(0,P),C>c&&({lineCount:C,removals:_}=q(P+1,S.length))):({lineCount:C,removals:_}=q(P+1,S.length),C>c&&({lineCount:C,removals:w}=q(0,P))),w>0&&(v=!0,S.splice(0,w)),_>0&&(f=!0,S.splice(S.length-_,_))}let k=[];v&&k.push(u);for(let w of S)for(let _ of w)k.push(_);return f&&k.push(u),k};var Yt=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new gn({active:t,inactive:r,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let i=e.withGuide??Xe.withGuide,n=`${i?`${(0,A.styleText)("gray",K)}
173
+ `:""}${Pi(this.state)} ${e.message}
174
+ `,s=this.value?t:r;switch(this.state){case"submit":{let o=i?`${(0,A.styleText)("gray",K)} `:"";return`${n}${o}${(0,A.styleText)("dim",s)}`}case"cancel":{let o=i?`${(0,A.styleText)("gray",K)} `:"";return`${n}${o}${(0,A.styleText)(["strikethrough","dim"],s)}${i?`
175
+ ${(0,A.styleText)("gray",K)}`:""}`}default:{let o=i?`${(0,A.styleText)("cyan",K)} `:"",a=i?(0,A.styleText)("cyan",jt):"";return`${n}${o}${this.value?`${(0,A.styleText)("green",Lu)} ${t}`:`${(0,A.styleText)("dim",xn)} ${(0,A.styleText)("dim",t)}`}${e.vertical?i?`
176
+ ${(0,A.styleText)("cyan",K)} `:`
177
+ `:` ${(0,A.styleText)("dim","/")} `}${this.value?`${(0,A.styleText)("dim",xn)} ${(0,A.styleText)("dim",r)}`:`${(0,A.styleText)("green",Lu)} ${r}`}
112
178
  ${a}
113
- `}}}}).prompt()},ed=async(e,t)=>{let r={},i=Object.keys(e);for(let n of i){let s=e[n],o=await s({results:r})?.catch(a=>{throw a});if(typeof t?.onCancel=="function"&&D(o)){r[n]="canceled",t.onCancel({results:r});continue}r[n]=o}return r};var Ae={message:(e=[],{symbol:t=(0,_.styleText)("gray",I),secondarySymbol:r=(0,_.styleText)("gray",I),output:i=process.stdout,spacing:n=1,withGuide:s}={})=>{let o=[],a=s??ke.withGuide,u=a?r:"",c=a?`${t} `:"",d=a?`${r} `:"";for(let p=0;p<n;p++)o.push(u);let l=Array.isArray(e)?e:e.split(`
114
- `);if(l.length>0){let[p,...y]=l;p.length>0?o.push(`${c}${p}`):o.push(a?t:"");for(let h of y)h.length>0?o.push(`${d}${h}`):o.push(a?r:"")}i.write(`${o.join(`
179
+ `}}}}).prompt()},Up=async(e,t)=>{let r={},i=Object.keys(e);for(let n of i){let s=e[n],o=await s({results:r})?.catch(a=>{throw a});if(typeof t?.onCancel=="function"&&B(o)){r[n]="canceled",t.onCancel({results:r});continue}r[n]=o}return r};var fe={message:(e=[],{symbol:t=(0,A.styleText)("gray",K),secondarySymbol:r=(0,A.styleText)("gray",K),output:i=process.stdout,spacing:n=1,withGuide:s}={})=>{let o=[],a=s??Xe.withGuide,l=a?r:"",u=a?`${t} `:"",c=a?`${r} `:"";for(let p=0;p<n;p++)o.push(l);let d=Array.isArray(e)?e:e.split(`
180
+ `);if(d.length>0){let[p,...v]=d;p.length>0?o.push(`${u}${p}`):o.push(a?t:"");for(let f of v)f.length>0?o.push(`${c}${f}`):o.push(a?r:"")}i.write(`${o.join(`
115
181
  `)}
116
- `)},info:(e,t)=>{Ae.message(e,{...t,symbol:(0,_.styleText)("blue",v_)})},success:(e,t)=>{Ae.message(e,{...t,symbol:(0,_.styleText)("green",__)})},step:(e,t)=>{Ae.message(e,{...t,symbol:(0,_.styleText)("green",Vl)})},warn:(e,t)=>{Ae.message(e,{...t,symbol:(0,_.styleText)("yellow",y_)})},warning:(e,t)=>{Ae.warn(e,t)},error:(e,t)=>{Ae.message(e,{...t,symbol:(0,_.styleText)("red",O_)})}},td=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??ke.withGuide?`${(0,_.styleText)("gray",Ye)} `:"";r.write(`${i}${(0,_.styleText)("red",e)}
182
+ `)},info:(e,t)=>{fe.message(e,{...t,symbol:(0,A.styleText)("blue",sw)})},success:(e,t)=>{fe.message(e,{...t,symbol:(0,A.styleText)("green",ow)})},step:(e,t)=>{fe.message(e,{...t,symbol:(0,A.styleText)("green",Jp)})},warn:(e,t)=>{fe.message(e,{...t,symbol:(0,A.styleText)("yellow",aw)})},warning:(e,t)=>{fe.warn(e,t)},error:(e,t)=>{fe.message(e,{...t,symbol:(0,A.styleText)("red",lw)})}},Wp=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??Xe.withGuide?`${(0,A.styleText)("gray",jt)} `:"";r.write(`${i}${(0,A.styleText)("red",e)}
117
183
 
118
- `)},rd=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??ke.withGuide?`${(0,_.styleText)("gray",h_)} `:"";r.write(`${i}${e}
119
- `)},ci=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??ke.withGuide?`${(0,_.styleText)("gray",I)}
120
- ${(0,_.styleText)("gray",Ye)} `:"";r.write(`${i}${e}
184
+ `)},Vp=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??Xe.withGuide?`${(0,A.styleText)("gray",rw)} `:"";r.write(`${i}${e}
185
+ `)},En=(e="",t)=>{let r=t?.output??process.stdout,i=t?.withGuide??Xe.withGuide?`${(0,A.styleText)("gray",K)}
186
+ ${(0,A.styleText)("gray",jt)} `:"";r.write(`${i}${e}
121
187
 
122
- `)},fr=(e,t)=>e.split(`
188
+ `)},Ei=(e,t)=>e.split(`
123
189
  `).map(r=>t(r)).join(`
124
- `),id=e=>{let t=(i,n)=>{let s=i.label??String(i.value);return n==="disabled"?`${(0,_.styleText)("gray",Ll)} ${fr(s,o=>(0,_.styleText)(["strikethrough","gray"],o))}${i.hint?` ${(0,_.styleText)("dim",`(${i.hint??"disabled"})`)}`:""}`:n==="active"?`${(0,_.styleText)("cyan",g_)} ${s}${i.hint?` ${(0,_.styleText)("dim",`(${i.hint})`)}`:""}`:n==="selected"?`${(0,_.styleText)("green",Hl)} ${fr(s,o=>(0,_.styleText)("dim",o))}${i.hint?` ${(0,_.styleText)("dim",`(${i.hint})`)}`:""}`:n==="cancelled"?`${fr(s,o=>(0,_.styleText)(["strikethrough","dim"],o))}`:n==="active-selected"?`${(0,_.styleText)("green",Hl)} ${s}${i.hint?` ${(0,_.styleText)("dim",`(${i.hint})`)}`:""}`:n==="submitted"?`${fr(s,o=>(0,_.styleText)("dim",o))}`:`${(0,_.styleText)("dim",Ll)} ${fr(s,o=>(0,_.styleText)("dim",o))}`},r=e.required??!0;return new Bl({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.
125
- ${(0,_.styleText)("reset",(0,_.styleText)("dim",`Press ${(0,_.styleText)(["gray","bgWhite","inverse"]," space ")} to select, ${(0,_.styleText)("gray",(0,_.styleText)("bgWhite",(0,_.styleText)("inverse"," enter ")))} to submit`))}`},render(){let i=_t(e.output,e.message,`${Kl(this.state)} `,`${gr(this.state)} `),n=`${(0,_.styleText)("gray",I)}
190
+ `),Kp=e=>{let t=(i,n)=>{let s=i.label??String(i.value);return n==="disabled"?`${(0,A.styleText)("gray",qp)} ${Ei(s,o=>(0,A.styleText)(["strikethrough","gray"],o))}${i.hint?` ${(0,A.styleText)("dim",`(${i.hint??"disabled"})`)}`:""}`:n==="active"?`${(0,A.styleText)("cyan",iw)} ${s}${i.hint?` ${(0,A.styleText)("dim",`(${i.hint})`)}`:""}`:n==="selected"?`${(0,A.styleText)("green",Ip)} ${Ei(s,o=>(0,A.styleText)("dim",o))}${i.hint?` ${(0,A.styleText)("dim",`(${i.hint})`)}`:""}`:n==="cancelled"?`${Ei(s,o=>(0,A.styleText)(["strikethrough","dim"],o))}`:n==="active-selected"?`${(0,A.styleText)("green",Ip)} ${s}${i.hint?` ${(0,A.styleText)("dim",`(${i.hint})`)}`:""}`:n==="submitted"?`${Ei(s,o=>(0,A.styleText)("dim",o))}`:`${(0,A.styleText)("dim",qp)} ${Ei(s,o=>(0,A.styleText)("dim",o))}`},r=e.required??!0;return new Dp({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.
191
+ ${(0,A.styleText)("reset",(0,A.styleText)("dim",`Press ${(0,A.styleText)(["gray","bgWhite","inverse"]," space ")} to select, ${(0,A.styleText)("gray",(0,A.styleText)("bgWhite",(0,A.styleText)("inverse"," enter ")))} to submit`))}`},render(){let i=mr(e.output,e.message,`${Bp(this.state)} `,`${Pi(this.state)} `),n=`${(0,A.styleText)("gray",K)}
126
192
  ${i}
127
- `,s=this.value??[],o=(a,u)=>{if(a.disabled)return t(a,"disabled");let c=s.includes(a.value);return u&&c?t(a,"active-selected"):c?t(a,"selected"):t(a,u?"active":"inactive")};switch(this.state){case"submit":{let a=this.options.filter(({value:c})=>s.includes(c)).map(c=>t(c,"submitted")).join((0,_.styleText)("dim",", "))||(0,_.styleText)("dim","none"),u=_t(e.output,a,`${(0,_.styleText)("gray",I)} `);return`${n}${u}`}case"cancel":{let a=this.options.filter(({value:c})=>s.includes(c)).map(c=>t(c,"cancelled")).join((0,_.styleText)("dim",", "));if(a.trim()==="")return`${n}${(0,_.styleText)("gray",I)}`;let u=_t(e.output,a,`${(0,_.styleText)("gray",I)} `);return`${n}${u}
128
- ${(0,_.styleText)("gray",I)}`}case"error":{let a=`${(0,_.styleText)("yellow",I)} `,u=this.error.split(`
129
- `).map((l,p)=>p===0?`${(0,_.styleText)("yellow",Ye)} ${(0,_.styleText)("yellow",l)}`:` ${l}`).join(`
130
- `),c=n.split(`
131
- `).length,d=u.split(`
132
- `).length+1;return`${n}${a}${lu({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:c+d,style:o}).join(`
193
+ `,s=this.value??[],o=(a,l)=>{if(a.disabled)return t(a,"disabled");let u=s.includes(a.value);return l&&u?t(a,"active-selected"):u?t(a,"selected"):t(a,l?"active":"inactive")};switch(this.state){case"submit":{let a=this.options.filter(({value:u})=>s.includes(u)).map(u=>t(u,"submitted")).join((0,A.styleText)("dim",", "))||(0,A.styleText)("dim","none"),l=mr(e.output,a,`${(0,A.styleText)("gray",K)} `);return`${n}${l}`}case"cancel":{let a=this.options.filter(({value:u})=>s.includes(u)).map(u=>t(u,"cancelled")).join((0,A.styleText)("dim",", "));if(a.trim()==="")return`${n}${(0,A.styleText)("gray",K)}`;let l=mr(e.output,a,`${(0,A.styleText)("gray",K)} `);return`${n}${l}
194
+ ${(0,A.styleText)("gray",K)}`}case"error":{let a=`${(0,A.styleText)("yellow",K)} `,l=this.error.split(`
195
+ `).map((d,p)=>p===0?`${(0,A.styleText)("yellow",jt)} ${(0,A.styleText)("yellow",d)}`:` ${d}`).join(`
196
+ `),u=n.split(`
197
+ `).length,c=l.split(`
198
+ `).length+1;return`${n}${a}${Nu({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:u+c,style:o}).join(`
133
199
  ${a}`)}
134
- ${u}
135
- `}default:{let a=`${(0,_.styleText)("cyan",I)} `,u=n.split(`
136
- `).length;return`${n}${a}${lu({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:u+2,style:o}).join(`
200
+ ${l}
201
+ `}default:{let a=`${(0,A.styleText)("cyan",K)} `,l=n.split(`
202
+ `).length;return`${n}${a}${Nu({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:l+2,style:o}).join(`
137
203
  ${a}`)}
138
- ${(0,_.styleText)("cyan",Ye)}
139
- `}}}}).prompt()};var nd=e=>new Xr({validate:e.validate,mask:e.mask??b_,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??ke.withGuide,r=`${t?`${(0,_.styleText)("gray",I)}
140
- `:""}${gr(this.state)} ${e.message}
141
- `,i=this.userInputWithCursor,n=this.masked;switch(this.state){case"error":{let s=t?`${(0,_.styleText)("yellow",I)} `:"",o=t?`${(0,_.styleText)("yellow",Ye)} `:"",a=n??"";return e.clearOnError&&this.clear(),`${r.trim()}
204
+ ${(0,A.styleText)("cyan",jt)}
205
+ `}}}}).prompt()};var Yp=e=>new bn({validate:e.validate,mask:e.mask??nw,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??Xe.withGuide,r=`${t?`${(0,A.styleText)("gray",K)}
206
+ `:""}${Pi(this.state)} ${e.message}
207
+ `,i=this.userInputWithCursor,n=this.masked;switch(this.state){case"error":{let s=t?`${(0,A.styleText)("yellow",K)} `:"",o=t?`${(0,A.styleText)("yellow",jt)} `:"",a=n??"";return e.clearOnError&&this.clear(),`${r.trim()}
142
208
  ${s}${a}
143
- ${o}${(0,_.styleText)("yellow",this.error)}
144
- `}case"submit":{let s=t?`${(0,_.styleText)("gray",I)} `:"",o=n?(0,_.styleText)("dim",n):"";return`${r}${s}${o}`}case"cancel":{let s=t?`${(0,_.styleText)("gray",I)} `:"",o=n?(0,_.styleText)(["strikethrough","dim"],n):"";return`${r}${s}${o}${n&&t?`
145
- ${(0,_.styleText)("gray",I)}`:""}`}default:{let s=t?`${(0,_.styleText)("cyan",I)} `:"",o=t?(0,_.styleText)("cyan",Ye):"";return`${r}${s}${i}
209
+ ${o}${(0,A.styleText)("yellow",this.error)}
210
+ `}case"submit":{let s=t?`${(0,A.styleText)("gray",K)} `:"",o=n?(0,A.styleText)("dim",n):"";return`${r}${s}${o}`}case"cancel":{let s=t?`${(0,A.styleText)("gray",K)} `:"",o=n?(0,A.styleText)(["strikethrough","dim"],n):"";return`${r}${s}${o}${n&&t?`
211
+ ${(0,A.styleText)("gray",K)}`:""}`}default:{let s=t?`${(0,A.styleText)("cyan",K)} `:"",o=t?(0,A.styleText)("cyan",jt):"";return`${r}${s}${i}
146
212
  ${o}
147
- `}}}}).prompt();var sx={light:B("\u2500","-"),heavy:B("\u2501","="),block:B("\u2588","#")};var oi=(e,t)=>e.includes(`
213
+ `}}}}).prompt();var BE={light:se("\u2500","-"),heavy:se("\u2501","="),block:se("\u2588","#")};var On=(e,t)=>e.includes(`
148
214
  `)?e.split(`
149
215
  `).map(r=>t(r)).join(`
150
- `):t(e),ve=e=>{let t=(r,i)=>{let n=r.label??String(r.value);switch(i){case"disabled":return`${(0,_.styleText)("gray",ai)} ${oi(n,s=>(0,_.styleText)("gray",s))}${r.hint?` ${(0,_.styleText)("dim",`(${r.hint??"disabled"})`)}`:""}`;case"selected":return`${oi(n,s=>(0,_.styleText)("dim",s))}`;case"active":return`${(0,_.styleText)("green",cu)} ${n}${r.hint?` ${(0,_.styleText)("dim",`(${r.hint})`)}`:""}`;case"cancelled":return`${oi(n,s=>(0,_.styleText)(["strikethrough","dim"],s))}`;default:return`${(0,_.styleText)("dim",ai)} ${oi(n,s=>(0,_.styleText)("dim",s))}`}};return new ei({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let r=e.withGuide??ke.withGuide,i=`${gr(this.state)} `,n=`${Kl(this.state)} `,s=_t(e.output,e.message,n,i),o=`${r?`${(0,_.styleText)("gray",I)}
216
+ `):t(e),$e=e=>{let t=(r,i)=>{let n=r.label??String(r.value);switch(i){case"disabled":return`${(0,A.styleText)("gray",xn)} ${On(n,s=>(0,A.styleText)("gray",s))}${r.hint?` ${(0,A.styleText)("dim",`(${r.hint??"disabled"})`)}`:""}`;case"selected":return`${On(n,s=>(0,A.styleText)("dim",s))}`;case"active":return`${(0,A.styleText)("green",Lu)} ${n}${r.hint?` ${(0,A.styleText)("dim",`(${r.hint})`)}`:""}`;case"cancelled":return`${On(n,s=>(0,A.styleText)(["strikethrough","dim"],s))}`;default:return`${(0,A.styleText)("dim",xn)} ${On(n,s=>(0,A.styleText)("dim",s))}`}};return new vn({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let r=e.withGuide??Xe.withGuide,i=`${Pi(this.state)} `,n=`${Bp(this.state)} `,s=mr(e.output,e.message,n,i),o=`${r?`${(0,A.styleText)("gray",K)}
151
217
  `:""}${s}
152
- `;switch(this.state){case"submit":{let a=r?`${(0,_.styleText)("gray",I)} `:"",u=_t(e.output,t(this.options[this.cursor],"selected"),a);return`${o}${u}`}case"cancel":{let a=r?`${(0,_.styleText)("gray",I)} `:"",u=_t(e.output,t(this.options[this.cursor],"cancelled"),a);return`${o}${u}${r?`
153
- ${(0,_.styleText)("gray",I)}`:""}`}default:{let a=r?`${(0,_.styleText)("cyan",I)} `:"",u=r?(0,_.styleText)("cyan",Ye):"",c=o.split(`
154
- `).length,d=r?2:1;return`${o}${a}${lu({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:a.length,rowPadding:c+d,style:(l,p)=>t(l,l.disabled?"disabled":p?"active":"inactive")}).join(`
218
+ `;switch(this.state){case"submit":{let a=r?`${(0,A.styleText)("gray",K)} `:"",l=mr(e.output,t(this.options[this.cursor],"selected"),a);return`${o}${l}`}case"cancel":{let a=r?`${(0,A.styleText)("gray",K)} `:"",l=mr(e.output,t(this.options[this.cursor],"cancelled"),a);return`${o}${l}${r?`
219
+ ${(0,A.styleText)("gray",K)}`:""}`}default:{let a=r?`${(0,A.styleText)("cyan",K)} `:"",l=r?(0,A.styleText)("cyan",jt):"",u=o.split(`
220
+ `).length,c=r?2:1;return`${o}${a}${Nu({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:a.length,rowPadding:u+c,style:(d,p)=>t(d,d.disabled?"disabled":p?"active":"inactive")}).join(`
155
221
  ${a}`)}
156
- ${u}
157
- `}}}}).prompt()};var ox=`${(0,_.styleText)("gray",I)} `;var N=e=>new ti({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??ke.withGuide,r=`${`${t?`${(0,_.styleText)("gray",I)}
158
- `:""}${gr(this.state)} `}${e.message}
159
- `,i=e.placeholder?(0,_.styleText)("inverse",e.placeholder[0])+(0,_.styleText)("dim",e.placeholder.slice(1)):(0,_.styleText)(["inverse","hidden"],"_"),n=this.userInput?this.userInputWithCursor:i,s=this.value??"";switch(this.state){case"error":{let o=this.error?` ${(0,_.styleText)("yellow",this.error)}`:"",a=t?`${(0,_.styleText)("yellow",I)} `:"",u=t?(0,_.styleText)("yellow",Ye):"";return`${r.trim()}
222
+ ${l}
223
+ `}}}}).prompt()};var HE=`${(0,A.styleText)("gray",K)} `;var pe=e=>new yn({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??Xe.withGuide,r=`${`${t?`${(0,A.styleText)("gray",K)}
224
+ `:""}${Pi(this.state)} `}${e.message}
225
+ `,i=e.placeholder?(0,A.styleText)("inverse",e.placeholder[0])+(0,A.styleText)("dim",e.placeholder.slice(1)):(0,A.styleText)(["inverse","hidden"],"_"),n=this.userInput?this.userInputWithCursor:i,s=this.value??"";switch(this.state){case"error":{let o=this.error?` ${(0,A.styleText)("yellow",this.error)}`:"",a=t?`${(0,A.styleText)("yellow",K)} `:"",l=t?(0,A.styleText)("yellow",jt):"";return`${r.trim()}
160
226
  ${a}${n}
161
- ${u}${o}
162
- `}case"submit":{let o=s?` ${(0,_.styleText)("dim",s)}`:"",a=t?(0,_.styleText)("gray",I):"";return`${r}${a}${o}`}case"cancel":{let o=s?` ${(0,_.styleText)(["strikethrough","dim"],s)}`:"",a=t?(0,_.styleText)("gray",I):"";return`${r}${a}${o}${s.trim()?`
163
- ${a}`:""}`}default:{let o=t?`${(0,_.styleText)("cyan",I)} `:"",a=t?(0,_.styleText)("cyan",Ye):"";return`${r}${o}${n}
227
+ ${l}${o}
228
+ `}case"submit":{let o=s?` ${(0,A.styleText)("dim",s)}`:"",a=t?(0,A.styleText)("gray",K):"";return`${r}${a}${o}`}case"cancel":{let o=s?` ${(0,A.styleText)(["strikethrough","dim"],s)}`:"",a=t?(0,A.styleText)("gray",K):"";return`${r}${a}${o}${s.trim()?`
229
+ ${a}`:""}`}default:{let o=t?`${(0,A.styleText)("cyan",K)} `:"",a=t?(0,A.styleText)("cyan",jt):"";return`${r}${o}${n}
164
230
  ${a}
165
- `}}}}).prompt();var $r=oe(st(),1);yt();process.env.RESEND_USER_AGENT=`resend-cli:${Y}`;var at=new TextEncoder,ad="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vr=new Uint8Array(256);for(br=0;br<ad.length;br++)vr[ad.charCodeAt(br)]=br;var br;function li(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),s=new Uint8Array(n);for(let o=0;o<r;o+=4){let a=vr[e.charCodeAt(o)],u=vr[e.charCodeAt(o+1)],c=vr[e.charCodeAt(o+2)],d=vr[e.charCodeAt(o+3)];s[i++]=a<<2|u>>4,s[i++]=(u&15)<<4|c>>2,s[i++]=(c&3)<<6|d&63}return n}function Lt(e){e=e||"utf8";let t;try{t=new TextDecoder(e)}catch{t=new TextDecoder("windows-1252")}return t}async function ut(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 ud(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70?String.fromCharCode(e):!1}function R_(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 s=at.encode(r),o=[];for(let u=0,c=s.length;u<c;u++){let d=s[u];if(u<=c-2&&d===61){let l=ud(s[u+1]),p=ud(s[u+2]);if(l&&p){let y=parseInt(l+p,16);o.push(y),u+=2;continue}}o.push(d)}n=new ArrayBuffer(o.length);let a=new DataView(n);for(let u=0,c=o.length;u<c;u++)a.setUint8(u,o[u])}else t==="B"?n=li(r.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):n=at.encode(r);return Lt(e).decode(n)}function Ot(e){let t=!0,r=!1;for(;!r;){let i=(e||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(n,s,o,a,u)=>t&&o===u&&a.length%4===0&&!/=$/.test(a)?s+"__\0JOIN\0__":n).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(n,s,o,a)=>t&&o===a?s+"__\0JOIN\0__":n).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(n,s,o,a)=>R_(s,o,a));if(t&&i.indexOf("\uFFFD")>=0)t=!1;else return i}}function M_(e,t){t=t||"utf-8";let r=[];for(let s=0;s<e.length;s++){let o=e.charAt(s);if(o==="%"&&/^[a-f0-9]{2}/i.test(e.substr(s+1,2))){let a=e.substr(s+1,2);s+=2,r.push(parseInt(a,16))}else if(o.charCodeAt(0)>126){o=at.encode(o);for(let a=0;a<o.length;a++)r.push(o[a])}else r.push(o.charCodeAt(0))}let i=new ArrayBuffer(r.length),n=new DataView(i);for(let s=0,o=r.length;s<o;s++)n.setUint8(s,r[s]);return Lt(t).decode(i)}function cd(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(),s=Number(i[2])||0,o;t.has(n)?o=t.get(n):(o={charset:!1,values:[]},t.set(n,o));let a=e.params[r];s===0&&i[0].charAt(i[0].length-1)==="*"&&(i=a.match(/^([^']*)'[^']*'(.*)$/))&&(o.charset=i[1]||"utf-8",a=i[2]),o.values.push({nr:s,value:a}),delete e.params[r]}),t.forEach((r,i)=>{e.params[i]=M_(r.values.sort((n,s)=>n.nr-s.nr).map(n=>n.value).join(""),r.charset)})}var _r=class{constructor(){this.chunks=[]}update(t){this.chunks.push(t),this.chunks.push(`
166
- `)}finalize(){return ut(new Blob(this.chunks,{type:"application/octet-stream"}))}};var yr=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(/[^a-zA-Z0-9+\/]/.test(r)&&(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(li(n))}}finalize(){return this.remainder&&!/^=+$/.test(this.remainder)&&this.chunks.push(li(this.remainder)),ut(new Blob(this.chunks,{type:"application/octet-stream"}))}};var ld=/^=[a-f0-9]{2}$/i,J_=/(?==[a-f0-9]{2})/i,F_=/=\r?\n/g,B_=/=[a-fA-F0-9]?$/,Or=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,s=t.length;n<s;n++)i.setUint8(n,parseInt(t[n],16));return r}decodeChunks(t){t=t.replace(F_,"");let r=t.split(J_),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){ld.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 s=n.substr(0,3);ld.test(s)?(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)),i=[])}update(t){let r=this.decoder.decode(t)+`
167
- `;if(r=this.remainder+r,r.length<this.maxChunkSize){this.remainder=r;return}this.remainder="";let i=r.match(B_);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=""),ut(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Nt=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 yr:/quoted-printable/i.test(t)?this.contentDecoder=new Or({decoder:Lt(this.contentType.parsed.params.charset)}):this.contentDecoder=new _r}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,s=!1;for(let o=0;o<t.length;o++){let a=t.charAt(o);if(n){i===0&&(r+=a),n=!1;continue}if(a==="\\"){n=!0,i===0&&(r+=a);continue}if(a==='"'&&i===0){s=!s,r+=a;continue}if(!s){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="",s="value",o=!1,a=!1,u;for(let c=0,d=t.length;c<d;c++)switch(u=t.charAt(c),s){case"key":if(u==="="){i=n.trim().toLowerCase(),s="value",n="";break}n+=u;break;case"value":if(a)n+=u;else if(u==="\\"){a=!0;continue}else o&&u===o?o=!1:!o&&u==='"'?o=u:!o&&u===";"?(i===!1?r.value=n.trim():r.params[i]=n.trim(),s="key",n=""):n+=u;a=!1;break}return n=n.trim(),s==="value"?i===!1?r.value=n:r.params[i]=n:n&&(r.params[n.toLowerCase()]=""),r.value&&(r.value=r.value.toLowerCase()),cd(r),r}decodeFlowedText(t,r){return t.split(/\r?\n/).reduce((i,n)=>/ $/.test(i)&&!/(^|\n)-- $/.test(i)?r?i.slice(0,-1)+n:i+n:i+`
168
- `+n).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let t=Lt(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]+=`
169
- `+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 s=r.replace(/\s+/g," ");i=s.indexOf(":");let o=i<0?s.trim():s.substr(0,i).trim(),a=i<0?"":s.substr(i+1).trim();switch(this.headers.push({key:o.toLowerCase(),originalKey:o,value:a}),o.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:at.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(Lt().decode(t));break;case"body":this.contentDecoder.update(t)}}};var H_={"&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;":`
170
- `,"&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"},fu=H_;function L_(e){return e.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(t,r)=>{if(typeof fu[t]=="string")return fu[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);var 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 Ct(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 dd(e){return"<div>"+Ct(e).replace(/\n/g,"<br />")+"</div>"}function pd(e){return e=e.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
231
+ `}}}}).prompt();var Vi=me(Kt(),1);fr();process.env.RESEND_USER_AGENT=`resend-cli:${ve}`;var Qt=new TextEncoder,Xp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$i=new Uint8Array(256);for(Ti=0;Ti<Xp.length;Ti++)$i[Xp.charCodeAt(Ti)]=Ti;var Ti;function An(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),s=new Uint8Array(n);for(let o=0;o<r;o+=4){let a=$i[e.charCodeAt(o)],l=$i[e.charCodeAt(o+1)],u=$i[e.charCodeAt(o+2)],c=$i[e.charCodeAt(o+3)];s[i++]=a<<2|l>>4,s[i++]=(l&15)<<4|u>>2,s[i++]=(u&3)<<6|c&63}return n}function Nr(e){e=e||"utf8";let t;try{t=new TextDecoder(e)}catch{t=new TextDecoder("windows-1252")}return t}async function Zt(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 em(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70?String.fromCharCode(e):!1}function Ow(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 s=Qt.encode(r),o=[];for(let l=0,u=s.length;l<u;l++){let c=s[l];if(l<=u-2&&c===61){let d=em(s[l+1]),p=em(s[l+2]);if(d&&p){let v=parseInt(d+p,16);o.push(v),l+=2;continue}}o.push(c)}n=new ArrayBuffer(o.length);let a=new DataView(n);for(let l=0,u=o.length;l<u;l++)a.setUint8(l,o[l])}else t==="B"?n=An(r.replace(/[^a-zA-Z0-9\+\/=]+/g,"")):n=Qt.encode(r);return Nr(e).decode(n)}function hr(e){let t=!0,r=!1;for(;!r;){let i=(e||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(n,s,o,a,l)=>t&&o===l&&a.length%4===0&&!/=$/.test(a)?s+"__\0JOIN\0__":n).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(n,s,o,a)=>t&&o===a?s+"__\0JOIN\0__":n).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(n,s,o,a)=>Ow(s,o,a));if(t&&i.indexOf("\uFFFD")>=0)t=!1;else return i}}function xw(e,t){t=t||"utf-8";let r=[];for(let s=0;s<e.length;s++){let o=e.charAt(s);if(o==="%"&&/^[a-f0-9]{2}/i.test(e.substr(s+1,2))){let a=e.substr(s+1,2);s+=2,r.push(parseInt(a,16))}else if(o.charCodeAt(0)>126){o=Qt.encode(o);for(let a=0;a<o.length;a++)r.push(o[a])}else r.push(o.charCodeAt(0))}let i=new ArrayBuffer(r.length),n=new DataView(i);for(let s=0,o=r.length;s<o;s++)n.setUint8(s,r[s]);return Nr(t).decode(i)}function tm(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(),s=Number(i[2])||0,o;t.has(n)?o=t.get(n):(o={charset:!1,values:[]},t.set(n,o));let a=e.params[r];s===0&&i[0].charAt(i[0].length-1)==="*"&&(i=a.match(/^([^']*)'[^']*'(.*)$/))&&(o.charset=i[1]||"utf-8",a=i[2]),o.values.push({nr:s,value:a}),delete e.params[r]}),t.forEach((r,i)=>{e.params[i]=xw(r.values.sort((n,s)=>n.nr-s.nr).map(n=>n.value).join(""),r.charset)})}var ji=class{constructor(){this.chunks=[]}update(t){this.chunks.push(t),this.chunks.push(`
232
+ `)}finalize(){return Zt(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Di=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(/[^a-zA-Z0-9+\/]/.test(r)&&(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(An(n))}}finalize(){return this.remainder&&!/^=+$/.test(this.remainder)&&this.chunks.push(An(this.remainder)),Zt(new Blob(this.chunks,{type:"application/octet-stream"}))}};var rm=/^=[a-f0-9]{2}$/i,kw=/(?==[a-f0-9]{2})/i,Ew=/=\r?\n/g,Aw=/=[a-fA-F0-9]?$/,Ii=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,s=t.length;n<s;n++)i.setUint8(n,parseInt(t[n],16));return r}decodeChunks(t){t=t.replace(Ew,"");let r=t.split(kw),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){rm.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 s=n.substr(0,3);rm.test(s)?(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)),i=[])}update(t){let r=this.decoder.decode(t)+`
233
+ `;if(r=this.remainder+r,r.length<this.maxChunkSize){this.remainder=r;return}this.remainder="";let i=r.match(Aw);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=""),Zt(new Blob(this.chunks,{type:"application/octet-stream"}))}};var Gr=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 Di:/quoted-printable/i.test(t)?this.contentDecoder=new Ii({decoder:Nr(this.contentType.parsed.params.charset)}):this.contentDecoder=new ji}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,s=!1;for(let o=0;o<t.length;o++){let a=t.charAt(o);if(n){i===0&&(r+=a),n=!1;continue}if(a==="\\"){n=!0,i===0&&(r+=a);continue}if(a==='"'&&i===0){s=!s,r+=a;continue}if(!s){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="",s="value",o=!1,a=!1,l;for(let u=0,c=t.length;u<c;u++)switch(l=t.charAt(u),s){case"key":if(l==="="){i=n.trim().toLowerCase(),s="value",n="";break}n+=l;break;case"value":if(a)n+=l;else if(l==="\\"){a=!0;continue}else o&&l===o?o=!1:!o&&l==='"'?o=l:!o&&l===";"?(i===!1?r.value=n.trim():r.params[i]=n.trim(),s="key",n=""):n+=l;a=!1;break}return n=n.trim(),s==="value"?i===!1?r.value=n:r.params[i]=n:n&&(r.params[n.toLowerCase()]=""),r.value&&(r.value=r.value.toLowerCase()),tm(r),r}decodeFlowedText(t,r){return t.split(/\r?\n/).reduce((i,n)=>/ $/.test(i)&&!/(^|\n)-- $/.test(i)?r?i.slice(0,-1)+n:i+n:i+`
234
+ `+n).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let t=Nr(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]+=`
235
+ `+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 s=r.replace(/\s+/g," ");i=s.indexOf(":");let o=i<0?s.trim():s.substr(0,i).trim(),a=i<0?"":s.substr(i+1).trim();switch(this.headers.push({key:o.toLowerCase(),originalKey:o,value:a}),o.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:Qt.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(Nr().decode(t));break;case"body":this.contentDecoder.update(t)}}};var Pw={"&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;":`
236
+ `,"&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=Pw;function Tw(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);var 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 gr(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 im(e){return"<div>"+gr(e).replace(/\n/g,"<br />")+"</div>"}function nm(e){return e=e.replace(/\r?\n/g,"").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
171
237
  `).replace(/<\/?(p|div|table|tr|td|th)\b[^>]*>/gi,`
172
238
 
173
239
  `).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,`
@@ -177,50 +243,58 @@ ${a}
177
243
 
178
244
  `).replace(/^\n+/,`
179
245
  `).replace(/\n+$/,`
180
- `),e=L_(e),e}function md(e){return[].concat(e.name||[]).concat(e.name?`<${e.address}>`:e.address).join(" ")}function hu(e){let t=[],r=(i,n)=>{if(n&&t.push(", "),i.group){let s=`${i.name}:`,o=";";t.push(s),i.group.forEach(r),t.push(o)}else t.push(md(i))};return e.forEach(r),t.join("")}function fd(e){return`<a href="mailto:${Ct(e.address)}" class="postal-email-address">${Ct(e.name||`<${e.address}>`)}</a>`}function gu(e){let t=[],r=(i,n)=>{if(n&&t.push('<span class="postal-email-address-separator">, </span>'),i.group){let s=`<span class="postal-email-address-group">${Ct(i.name)}:</span>`,o='<span class="postal-email-address-group">;</span>';t.push(s),i.group.forEach(r),t.push(o)}else t.push(fd(i))};return e.forEach(r),t.join(" ")}function N_(e,t,r){e=(e||"").toString(),t=t||76;let i=0,n=e.length,s="",o,a;for(;i<n;){if(o=e.substr(i,t),o.length<t){s+=o;break}if(a=o.match(/^[^\n\r]*(\r?\n|\r)/)){o=a[0],s+=o,i+=o.length;continue}else(a=o.match(/(\s+)[^\s]*$/))&&a[0].length-(r?(a[1]||"").length:0)<o.length?o=o.substr(0,o.length-(a[0].length-(r?(a[1]||"").length:0))):(a=e.substr(i+o.length).match(/^[^\s]+(\s*)/))&&(o=o+a[0].substr(0,a[0].length-(r?0:(a[1]||"").length)));s+=o,i+=o.length,i<n&&(s+=`\r
181
- `)}return s}function bu(e){let t=[];if(e.from&&t.push({key:"From",val:md(e.from)}),e.subject&&t.push({key:"Subject",val:e.subject}),e.date){let o={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},a=typeof Intl>"u"?e.date:new Intl.DateTimeFormat("default",o).format(new Date(e.date));t.push({key:"Date",val:a})}e.to&&e.to.length&&t.push({key:"To",val:hu(e.to)}),e.cc&&e.cc.length&&t.push({key:"Cc",val:hu(e.cc)}),e.bcc&&e.bcc.length&&t.push({key:"Bcc",val:hu(e.bcc)});let r=t.map(o=>o.key.length).reduce((o,a)=>a>o?a:o,0);t=t.flatMap(o=>{let a=r-o.key.length,u=`${o.key}: ${" ".repeat(a)}`,c=`${" ".repeat(o.key.length+1)} ${" ".repeat(a)}`;return N_(o.val,80,!0).split(/\r?\n/).map(l=>l.trim()).map((l,p)=>`${p?c:u}${l}`)});let i=t.map(o=>o.length).reduce((o,a)=>a>o?a:o,0),n="-".repeat(i);return`
246
+ `),e=Tw(e),e}function sm(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 s=`${i.name}:`,o=";";t.push(s),i.group.forEach(r),t.push(o)}else t.push(sm(i))};return e.forEach(r),t.join("")}function om(e){return`<a href="mailto:${gr(e.address)}" class="postal-email-address">${gr(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 s=`<span class="postal-email-address-group">${gr(i.name)}:</span>`,o='<span class="postal-email-address-group">;</span>';t.push(s),i.group.forEach(r),t.push(o)}else t.push(om(i))};return e.forEach(r),t.join(" ")}function $w(e,t,r){e=(e||"").toString(),t=t||76;let i=0,n=e.length,s="",o,a;for(;i<n;){if(o=e.substr(i,t),o.length<t){s+=o;break}if(a=o.match(/^[^\n\r]*(\r?\n|\r)/)){o=a[0],s+=o,i+=o.length;continue}else(a=o.match(/(\s+)[^\s]*$/))&&a[0].length-(r?(a[1]||"").length:0)<o.length?o=o.substr(0,o.length-(a[0].length-(r?(a[1]||"").length:0))):(a=e.substr(i+o.length).match(/^[^\s]+(\s*)/))&&(o=o+a[0].substr(0,a[0].length-(r?0:(a[1]||"").length)));s+=o,i+=o.length,i<n&&(s+=`\r
247
+ `)}return s}function Qu(e){let t=[];if(e.from&&t.push({key:"From",val:sm(e.from)}),e.subject&&t.push({key:"Subject",val:e.subject}),e.date){let o={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},a=typeof Intl>"u"?e.date:new Intl.DateTimeFormat("default",o).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(o=>o.key.length).reduce((o,a)=>a>o?a:o,0);t=t.flatMap(o=>{let a=r-o.key.length,l=`${o.key}: ${" ".repeat(a)}`,u=`${" ".repeat(o.key.length+1)} ${" ".repeat(a)}`;return $w(o.val,80,!0).split(/\r?\n/).map(d=>d.trim()).map((d,p)=>`${p?u:l}${d}`)});let i=t.map(o=>o.length).reduce((o,a)=>a>o?a:o,0),n="-".repeat(i);return`
182
248
  ${n}
183
249
  ${t.join(`
184
250
  `)}
185
251
  ${n}
186
- `}function vu(e){let t=[];if(e.from&&t.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${fd(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">${Ct(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="${Ct(e.date)}">${Ct(n)}</div>`)}return e.to&&e.to.length&&t.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${gu(e.to)}</div>`),e.cc&&e.cc.length&&t.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${gu(e.cc)}</div>`),e.bcc&&e.bcc.length&&t.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${gu(e.bcc)}</div>`),`<div class="postal-email-header">${t.length?'<div class="postal-email-header-row">':""}${t.join(`</div>
187
- <div class="postal-email-header-row">`)}${t.length?"</div>":""}</div>`}function G_(e,t){let r=!1,i="text",n,s=[],o={address:[],comment:[],group:[],text:[],textWasQuoted:[]},a,u,c=!1;for(a=0,u=e.length;a<u;a++){let d=e[a],l=a?e[a-1]:null;if(d.type==="operator")switch(d.value){case"<":i="address",c=!1;break;case"(":i="comment",c=!1;break;case":":i="group",r=!0,c=!1;break;case'"':c=!c,i="text";break;default:i="text",c=!1;break}else d.value&&(i==="address"&&(d.value=d.value.replace(/^[^<]*<\s*/,"")),l&&l.noBreak&&o[i].length?(o[i][o[i].length-1]+=d.value,i==="text"&&c&&(o.textWasQuoted[o.textWasQuoted.length-1]=!0)):(o[i].push(d.value),i==="text"&&o.textWasQuoted.push(c)))}if(!o.text.length&&o.comment.length&&(o.text=o.comment,o.comment=[]),r){o.text=o.text.join(" ");let d=[];o.group.length&&yu(o.group.join(","),{_depth:t+1}).forEach(p=>{p.group?d=d.concat(p.group):d.push(p)}),s.push({name:Ot(o.text||n&&n.name),group:d})}else{if(!o.address.length&&o.text.length){for(a=o.text.length-1;a>=0;a--)if(!o.textWasQuoted[a]&&o.text[a].match(/^[^@\s]+@[^@\s]+$/)){o.address=o.text.splice(a,1),o.textWasQuoted.splice(a,1);break}let d=function(l){return o.address.length?l:(o.address=[l.trim()]," ")};if(!o.address.length)for(a=o.text.length-1;a>=0&&!(!o.textWasQuoted[a]&&(o.text[a]=o.text[a].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,d).trim(),o.address.length));a--);}if(!o.text.length&&o.comment.length&&(o.text=o.comment,o.comment=[]),o.address.length>1&&(o.text=o.text.concat(o.address.splice(1))),o.text=o.text.join(" "),o.address=o.address.join(" "),!o.address&&/^=\?[^=]+?=$/.test(o.text.trim())){let d=yu(Ot(o.text));if(d&&d.length)return d}if(!o.address&&r)return[];n={address:o.address||o.text||"",name:Ot(o.text||o.address||"")},n.address===n.name&&((n.address||"").match(/@/)?n.name="":n.address=""),s.push(n)}return s}var _u=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),s=r<i-1?this.str.charAt(r+1):null;this.checkChar(n,s)}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",`
252
+ `}function Zu(e){let t=[];if(e.from&&t.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${om(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">${gr(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="${gr(e.date)}">${gr(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>
253
+ <div class="postal-email-header-row">`)}${t.length?"</div>":""}</div>`}function jw(e,t){let r=!1,i="text",n,s=[],o={address:[],comment:[],group:[],text:[],textWasQuoted:[]},a,l,u=!1;for(a=0,l=e.length;a<l;a++){let c=e[a],d=a?e[a-1]:null;if(c.type==="operator")switch(c.value){case"<":i="address",u=!1;break;case"(":i="comment",u=!1;break;case":":i="group",r=!0,u=!1;break;case'"':u=!u,i="text";break;default:i="text",u=!1;break}else c.value&&(i==="address"&&(c.value=c.value.replace(/^[^<]*<\s*/,"")),d&&d.noBreak&&o[i].length?(o[i][o[i].length-1]+=c.value,i==="text"&&u&&(o.textWasQuoted[o.textWasQuoted.length-1]=!0)):(o[i].push(c.value),i==="text"&&o.textWasQuoted.push(u)))}if(!o.text.length&&o.comment.length&&(o.text=o.comment,o.comment=[]),r){o.text=o.text.join(" ");let c=[];o.group.length&&ec(o.group.join(","),{_depth:t+1}).forEach(p=>{p.group?c=c.concat(p.group):c.push(p)}),s.push({name:hr(o.text||n&&n.name),group:c})}else{if(!o.address.length&&o.text.length){for(a=o.text.length-1;a>=0;a--)if(!o.textWasQuoted[a]&&o.text[a].match(/^[^@\s]+@[^@\s]+$/)){o.address=o.text.splice(a,1),o.textWasQuoted.splice(a,1);break}let c=function(d){return o.address.length?d:(o.address=[d.trim()]," ")};if(!o.address.length)for(a=o.text.length-1;a>=0&&!(!o.textWasQuoted[a]&&(o.text[a]=o.text[a].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,c).trim(),o.address.length));a--);}if(!o.text.length&&o.comment.length&&(o.text=o.comment,o.comment=[]),o.address.length>1&&(o.text=o.text.concat(o.address.splice(1))),o.text=o.text.join(" "),o.address=o.address.join(" "),!o.address&&/^=\?[^=]+?=$/.test(o.text.trim())){let c=ec(hr(o.text));if(c&&c.length)return c}if(!o.address&&r)return[];n={address:o.address||o.text||"",name:hr(o.text||o.address||"")},n.address===n.name&&((n.address||"").match(/@/)?n.name="":n.address=""),s.push(n)}return s}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),s=r<i-1?this.str.charAt(r+1):null;this.checkChar(n,s)}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",`
188
254
  `,",",";"].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(['"',"'"].includes(this.operatorExpecting)&&t==="\\"){this.escaped=!0;return}}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),t===`
189
- `&&(t=" "),(t.charCodeAt(0)>=33||[" "," "].includes(t))&&(this.node.value+=t),this.escaped=!1}},U_=50;function yu(e,t){t=t||{};let r=t._depth||0;if(r>U_)return[];let n=new _u(e).tokenize(),s=[],o=[],a=[];if(n.forEach(u=>{u.type==="operator"&&(u.value===","||u.value===";")?(o.length&&s.push(o),o=[]):o.push(u)}),o.length&&s.push(o),s.forEach(u=>{u=G_(u,r),u.length&&(a=a.concat(u))}),t.flatten){let u=[],c=d=>{d.forEach(l=>{if(l.group)return c(l.group);u.push(l)})};return c(a),u}return a}var di=yu;function hd(e){for(var t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(e),n=i.byteLength,s=n%3,o=n-s,a,u,c,d,l,p=0;p<o;p=p+3)l=i[p]<<16|i[p+1]<<8|i[p+2],a=(l&16515072)>>18,u=(l&258048)>>12,c=(l&4032)>>6,d=l&63,t+=r[a]+r[u]+r[c]+r[d];return s==1?(l=i[o],a=(l&252)>>2,u=(l&3)<<4,t+=r[a]+r[u]+"=="):s==2&&(l=i[o]<<8|i[o+1],a=(l&64512)>>10,u=(l&1008)>>4,c=(l&15)<<2,t+=r[a]+r[u]+r[c]+"="),t}var W_=256,V_=2*1024*1024,Cr=class e{static parse(t,r){return new e(r).parse(t)}constructor(t){this.options=t||{},this.mimeOptions={maxNestingDepth:this.options.maxNestingDepth||W_,maxHeadersSize:this.options.maxHeadersSize||V_},this.root=this.currentNode=new Nt({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 s=i[n];if(t.length<s.value.length+2)continue;let o=!0;for(let d=0;d<s.value.length;d++)if(t[d+2]!==s.value[d]){o=!1;break}if(!o)continue;let a=s.value.length+2,u=!1;t.length>=s.value.length+4&&t[s.value.length+2]===45&&t[s.value.length+3]===45&&(u=!0,a=s.value.length+4);let c=!0;for(let d=a;d<t.length;d++)if(t[d]!==32&&t[d]!==9){c=!1;break}if(c)return u?(await s.node.finalize(),this.currentNode=s.node.parentNode||this.root):(await s.node.finalizeChildNodes(),this.currentNode=new Nt({postalMime:this,parentNode:s.node,parentMultipartType:s.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,i=()=>({bytes:new Uint8Array(this.buf,t,r-t),done:this.readPos>=this.av.length});for(;this.readPos<this.av.length;){let n=this.av[this.readPos++];if(n!==13&&n!==10&&(r=this.readPos),n===10)return i()}return i()}async processNodeTree(){let t={},r=new Set,i=this.textMap=new Map,n=this.forceRfc822Attachments(),s=async(o,a,u)=>{if(a=a||!1,u=u||!1,o.contentType.multipart)o.contentType.multipart==="alternative"?a=o:o.contentType.multipart==="related"&&(u=o);else if(this.isInlineMessageRfc822(o)&&!n){let c=new e;o.subMessage=await c.parse(o.content),i.has(o)||i.set(o,{});let d=i.get(o);(o.subMessage.text||!o.subMessage.html)&&(d.plain=d.plain||[],d.plain.push({type:"subMessage",value:o.subMessage}),r.add("plain")),o.subMessage.html&&(d.html=d.html||[],d.html.push({type:"subMessage",value:o.subMessage}),r.add("html")),c.textMap&&c.textMap.forEach((l,p)=>{i.set(p,l)});for(let l of o.subMessage.attachments||[])this.attachments.push(l)}else if(this.isInlineTextNode(o)){let c=o.contentType.parsed.value.substr(o.contentType.parsed.value.indexOf("/")+1),d=a||o;i.has(d)||i.set(d,{});let l=i.get(d);l[c]=l[c]||[],l[c].push({type:"text",value:o.getTextContent()}),r.add(c)}else if(o.content){let c=o.contentDisposition?.parsed?.params?.filename||o.contentType.parsed.params.name||null,d={filename:c?Ot(c):null,mimeType:o.contentType.parsed.value,disposition:o.contentDisposition?.parsed?.value||null};switch(u&&o.contentId&&(d.related=!0),o.contentDescription&&(d.description=o.contentDescription),o.contentId&&(d.contentId=o.contentId),o.contentType.parsed.value){case"text/calendar":case"application/ics":{o.contentType.parsed.params.method&&(d.method=o.contentType.parsed.params.method.toString().toUpperCase().trim());let l=o.getTextContent().replace(/\r?\n/g,`
255
+ `&&(t=" "),(t.charCodeAt(0)>=33||[" "," "].includes(t))&&(this.node.value+=t),this.escaped=!1}},Dw=50;function ec(e,t){t=t||{};let r=t._depth||0;if(r>Dw)return[];let n=new Xu(e).tokenize(),s=[],o=[],a=[];if(n.forEach(l=>{l.type==="operator"&&(l.value===","||l.value===";")?(o.length&&s.push(o),o=[]):o.push(l)}),o.length&&s.push(o),s.forEach(l=>{l=jw(l,r),l.length&&(a=a.concat(l))}),t.flatten){let l=[],u=c=>{c.forEach(d=>{if(d.group)return u(d.group);l.push(d)})};return u(a),l}return a}var Pn=ec;function am(e){for(var t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=new Uint8Array(e),n=i.byteLength,s=n%3,o=n-s,a,l,u,c,d,p=0;p<o;p=p+3)d=i[p]<<16|i[p+1]<<8|i[p+2],a=(d&16515072)>>18,l=(d&258048)>>12,u=(d&4032)>>6,c=d&63,t+=r[a]+r[l]+r[u]+r[c];return s==1?(d=i[o],a=(d&252)>>2,l=(d&3)<<4,t+=r[a]+r[l]+"=="):s==2&&(d=i[o]<<8|i[o+1],a=(d&64512)>>10,l=(d&1008)>>4,u=(d&15)<<2,t+=r[a]+r[l]+r[u]+"="),t}var Iw=256,qw=2*1024*1024,qi=class e{static parse(t,r){return new e(r).parse(t)}constructor(t){this.options=t||{},this.mimeOptions={maxNestingDepth:this.options.maxNestingDepth||Iw,maxHeadersSize:this.options.maxHeadersSize||qw},this.root=this.currentNode=new Gr({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 s=i[n];if(t.length<s.value.length+2)continue;let o=!0;for(let c=0;c<s.value.length;c++)if(t[c+2]!==s.value[c]){o=!1;break}if(!o)continue;let a=s.value.length+2,l=!1;t.length>=s.value.length+4&&t[s.value.length+2]===45&&t[s.value.length+3]===45&&(l=!0,a=s.value.length+4);let u=!0;for(let c=a;c<t.length;c++)if(t[c]!==32&&t[c]!==9){u=!1;break}if(u)return l?(await s.node.finalize(),this.currentNode=s.node.parentNode||this.root):(await s.node.finalizeChildNodes(),this.currentNode=new Gr({postalMime:this,parentNode:s.node,parentMultipartType:s.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,i=()=>({bytes:new Uint8Array(this.buf,t,r-t),done:this.readPos>=this.av.length});for(;this.readPos<this.av.length;){let n=this.av[this.readPos++];if(n!==13&&n!==10&&(r=this.readPos),n===10)return i()}return i()}async processNodeTree(){let t={},r=new Set,i=this.textMap=new Map,n=this.forceRfc822Attachments(),s=async(o,a,l)=>{if(a=a||!1,l=l||!1,o.contentType.multipart)o.contentType.multipart==="alternative"?a=o:o.contentType.multipart==="related"&&(l=o);else if(this.isInlineMessageRfc822(o)&&!n){let u=new e;o.subMessage=await u.parse(o.content),i.has(o)||i.set(o,{});let c=i.get(o);(o.subMessage.text||!o.subMessage.html)&&(c.plain=c.plain||[],c.plain.push({type:"subMessage",value:o.subMessage}),r.add("plain")),o.subMessage.html&&(c.html=c.html||[],c.html.push({type:"subMessage",value:o.subMessage}),r.add("html")),u.textMap&&u.textMap.forEach((d,p)=>{i.set(p,d)});for(let d of o.subMessage.attachments||[])this.attachments.push(d)}else if(this.isInlineTextNode(o)){let u=o.contentType.parsed.value.substr(o.contentType.parsed.value.indexOf("/")+1),c=a||o;i.has(c)||i.set(c,{});let d=i.get(c);d[u]=d[u]||[],d[u].push({type:"text",value:o.getTextContent()}),r.add(u)}else if(o.content){let u=o.contentDisposition?.parsed?.params?.filename||o.contentType.parsed.params.name||null,c={filename:u?hr(u):null,mimeType:o.contentType.parsed.value,disposition:o.contentDisposition?.parsed?.value||null};switch(l&&o.contentId&&(c.related=!0),o.contentDescription&&(c.description=o.contentDescription),o.contentId&&(c.contentId=o.contentId),o.contentType.parsed.value){case"text/calendar":case"application/ics":{o.contentType.parsed.params.method&&(c.method=o.contentType.parsed.params.method.toString().toUpperCase().trim());let d=o.getTextContent().replace(/\r?\n/g,`
190
256
  `).replace(/\n*$/,`
191
- `);d.content=at.encode(l);break}default:d.content=o.content}this.attachments.push(d)}for(let c of o.childNodes)await s(c,a,u)};await s(this.root,!1,[]),i.forEach(o=>{r.forEach(a=>{if(t[a]||(t[a]=[]),o[a])o[a].forEach(u=>{switch(u.type){case"text":t[a].push(u.value);break;case"subMessage":switch(a){case"html":t[a].push(vu(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}(o[u]||[]).forEach(c=>{switch(c.type){case"text":switch(a){case"html":t[a].push(dd(c.value));break;case"plain":t[a].push(pd(c.value));break}break;case"subMessage":switch(a){case"html":t[a].push(vu(c.value));break;case"plain":t[a].push(bu(c.value));break}break}})}})}),Object.keys(t).forEach(o=>{t[o]=t[o].join(`
192
- `)}),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 s=new Uint8Array(r),o=0;for(let a of i)s.set(a,o),o+=a.length;return s}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=at.encode(t)),(t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]")&&(t=await ut(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,value:n.value})).reverse()};for(let n of["from","sender"]){let s=this.root.headers.find(o=>o.key===n);if(s&&s.value){let o=di(s.value);o&&o.length&&(r[n]=o[0])}}for(let n of["delivered-to","return-path"]){let s=this.root.headers.find(o=>o.key===n);if(s&&s.value){let o=di(s.value);if(o&&o.length&&o[0].address){let a=n.replace(/\-(.)/g,(u,c)=>c.toUpperCase());r[a]=o[0].address}}}for(let n of["to","cc","bcc","reply-to"]){let s=this.root.headers.filter(a=>a.key===n),o=[];if(s.filter(a=>a&&a.value).map(a=>di(a.value)).forEach(a=>o=o.concat(a||[])),o&&o.length){let a=n.replace(/\-(.)/g,(u,c)=>c.toUpperCase());r[a]=o}}for(let n of["subject","message-id","in-reply-to","references"]){let s=this.root.headers.find(o=>o.key===n);if(s&&s.value){let o=n.replace(/\-(.)/g,(a,u)=>u.toUpperCase());r[o]=Ot(s.value)}}let i=this.root.headers.find(n=>n.key==="date");if(i){let n=new Date(i.value);!n||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 s of r.attachments||[])s?.content&&(s.content=hd(s.content),s.encoding="base64");break;case"utf8":let n=new TextDecoder("utf8");for(let s of r.attachments||[])s?.content&&(s.content=n.decode(s.content),s.encoding="utf8");break;default:throw new Error("Unknwon attachment encoding")}return r}};var Rb=oe(Pb(),1),cC="6.9.4";function qe(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 lC=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/api-keys",e,t)}async list(e={}){let t=qe(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}`)}};function dC(e){return e?.map(t=>({content:t.content,filename:t.filename,path:t.path,content_type:t.contentType,content_id:t.contentId}))}function Mb(e){return{attachments:dC(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 pa(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 pC=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 pa(i.react),i.react=void 0),r.push(Mb(i));return await this.resend.post("/emails/batch",r,{...t,headers:{"x-batch-validation":t?.batchValidation??"strict",...t?.headers}})}},mC=class{constructor(e){this.resend=e}async create(e,t={}){return e.react&&(e.html=await pa(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=qe(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 pa(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 Db(e){return{id:e.id,key:e.key,createdAt:e.created_at,type:e.type,fallbackValue:e.fallback_value}}function jb(e){return"key"in e?{key:e.key,type:e.type,fallback_value:e.fallbackValue}:{fallback_value:e.fallbackValue}}var fC=class{constructor(e){this.resend=e}async create(e){let t=jb(e);return await this.resend.post("/contact-properties",t)}async list(e={}){let t=qe(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=>Db(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",...Db(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=jb(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"}}}},hC=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=qe(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}`)}},gC=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=qe(e),i=r?`/contacts/${t}/topics?${r}`:`/contacts/${t}/topics`;return this.resend.get(i)}},bC=class{constructor(e){this.resend=e,this.topics=new gC(this.resend),this.segments=new hC(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=qe(e),s=n?`/contacts?${n}`:"/contacts";return await this.resend.get(s)}let r=qe(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 vC(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 _C=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/domains",vC(e),t)}async list(e={}){let t=qe(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`)}},yC=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=qe(e),i=r?`/emails/${t}/attachments?${r}`:`/emails/${t}/attachments`;return await this.resend.get(i)}},OC=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=qe(e),i=r?`/emails/receiving/${t}/attachments?${r}`:`/emails/receiving/${t}/attachments`;return await this.resend.get(i)}},CC=class{constructor(e){this.resend=e,this.attachments=new OC(e)}async get(e){return await this.resend.get(`/emails/receiving/${e}`)}async list(e={}){let t=qe(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,s=await this.get(t);if(s.error)return{data:null,error:s.error,headers:s.headers};let o=s.data,a=o.subject||"(no subject)";if(n)return this.forwardPassthrough(o,{to:r,from:i,subject:a});let u=a.startsWith("Fwd:")?a:`Fwd: ${a}`;return this.forwardWrapped(o,{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 s=await fetch(e.raw.download_url);if(!s.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:s.status},headers:null};let o=await s.text(),a=await Cr.parse(o,{attachmentEncoding:"base64"}),u=a.attachments.map(c=>{let d=c.contentId?c.contentId.replace(/^<|>$/g,""):void 0;return{filename:c.filename,content:c.content.toString(),content_type:c.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:s,html:o}=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:s,html:o,attachments:[{filename:"forwarded_message.eml",content:Buffer.from(u).toString("base64"),content_type:"message/rfc822"}]})}},SC=class{constructor(e){this.resend=e,this.attachments=new yC(e),this.receiving=new CC(e)}async send(e,t={}){return this.create(e,t)}async create(e,t={}){return e.react&&(e.html=await pa(e.react)),await this.resend.post("/emails",Mb(e),t)}async get(e){return await this.resend.get(`/emails/${e}`)}async list(e={}){let t=qe(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`)}},xC=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/segments",e,t)}async list(e={}){let t=qe(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 wC(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 kC(e){return e?.map(t=>({key:t.key,type:t.type,fallback_value:t.fallbackValue}))}function Ib(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:kC(e.variables)}}var qb=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)}},AC=class{constructor(e){this.resend=e}create(e){return new qb(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",Ib(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${wC(e)}`)}duplicate(e){return new qb(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}`,Ib(t))}},EC=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"}}}},TC=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=qe(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 Rb.Webhook(e.webhookSecret).verify(e.payload,{"svix-id":e.headers.id,"svix-timestamp":e.headers.timestamp,"svix-signature":e.headers.signature})}},$b="https://api.resend.com",zb=`resend-node:${cC}`,PC=typeof process<"u"&&process.env&&process.env.RESEND_BASE_URL||$b,DC=typeof process<"u"&&process.env&&process.env.RESEND_USER_AGENT||zb,er=class{constructor(e){if(this.key=e,this.apiKeys=new lC(this),this.segments=new xC(this),this.audiences=this.segments,this.batch=new pC(this),this.broadcasts=new mC(this),this.contacts=new bC(this),this.contactProperties=new fC(this),this.domains=new _C(this),this.emails=new SC(this),this.webhooks=new TC(this),this.templates=new AC(this),this.topics=new EC(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":DC,"Content-Type":"application/json"})}async fetchRequest(e,t={}){try{let r=await fetch(`${PC}${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[s,o]of new Headers(r.headers).entries())i.set(s,o);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,s]of new Headers(t.headers).entries())r.set(n,s);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[s,o]of new Headers(r.headers).entries())i.set(s,o);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[s,o]of new Headers(r.headers).entries())i.set(s,o);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)}};Ce();var Yb=oe(st(),1);function U(e,t){return e instanceof Error?e.message:t}function Qb(e){return!!(e||!process.stdout.isTTY)}function $(e,t={}){Qb(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;Qb(t.json)?console.log(JSON.stringify({error:{message:e.message,code:e.code??"unknown"}},null,2)):console.error(`${Yb.default.red("Error:")} ${e.message}`),process.exit(r)}async function $C(e,t){let r=await it(e,t);if(!r){if(t){let i=xe();if(!i.some(s=>s.name===t))throw new Error(`Profile "${t}" not found. Available profiles: ${i.map(s=>s.name).join(", ")||"(none)"}`)}throw new Error("No API key found. Set RESEND_API_KEY, use --api-key, or run: resend login")}return new er(r.key)}async function te(e){try{return await $C(e.apiKey,e.profile??e.team)}catch(t){v({message:U(t,"Failed to create client"),code:"auth_error"},{json:e.json})}}var Zb=130;function zC(){process.stderr.isTTY&&process.stderr.write("\r\x1B[2K"),console.error("Cancelled."),process.exit(Zb)}var ir;function Xb(){ir=zC,process.on("SIGINT",ir),process.on("uncaughtException",e=>{v({message:U(e,"An unexpected error occurred"),code:"unexpected_error"},{}),process.exit(1)})}function ya(e){ir&&process.removeListener("SIGINT",ir),ir=e,process.on("SIGINT",ir)}function nr(){return Zb}Ce();G();function j(e){td(e),process.exit(nr())}async function e0(e,t,r){(!w()||r.json)&&v({message:"Use --yes to confirm deletion in non-interactive mode.",code:"confirmation_required"},{json:r.json});let i=await ot({message:t});(D(i)||!i)&&j("Deletion cancelled.")}async function Oa(e,t){let r=ae(e);if(!r)return e;if(!w()||t.json)return v({message:`Profile "${e}" has an invalid name: ${r}`,code:"invalid_profile_name"},{json:t.json}),null;Ae.warn(`Profile "${e}" has an invalid name: ${r}`);let i=await N({message:"Enter a new name for this profile:",placeholder:e.replace(/[^a-zA-Z0-9._-]/g,"-"),validate:n=>ae(n)});D(i)&&j("Rename cancelled.");try{await _a(e,i)}catch(n){return v({message:U(n,"Failed to rename profile"),code:"rename_failed"},{json:t.json}),null}return Ae.success(`Profile renamed to '${i}'.`),i}async function de(e,t,r,i){if(e)return e;(!w()||i.json)&&v(r,{json:i.json});let n=await N({message:t.message,placeholder:t.placeholder,validate:t.validate??(s=>!s||s.length===0?`${t.message} is required`:void 0)});return D(n)&&j("Cancelled."),n}async function t0(e,t,r,i){if(e)return e;(!w()||i.json)&&v(r,{json:i.json});let n=await ve({message:t.message,options:t.options});return D(n)&&j("Cancelled."),n}async function r0(e,t,r){let i=t.filter(o=>o.required!==!1&&e[o.flag]==="");if(i.length>0){let o=i.map(a=>`--${a.flag}`).join(", ");v({message:`Empty value for required flags: ${o}`,code:"invalid_options"},{json:r.json})}let n=t.filter(o=>o.required!==!1&&!e[o.flag]);if(n.length===0)return e;if(!w()||r.json){let o=n.map(a=>`--${a.flag}`).join(", ");v({message:`Missing required flags: ${o}`,code:"missing_flags"},{json:r.json})}let s=await ed(Object.fromEntries(n.map(o=>[o.flag,()=>N({message:o.message,placeholder:o.placeholder,validate:o.validate??(a=>!a||a.length===0?`${o.message} is required`:void 0)})])),{onCancel:()=>j("Operation cancelled.")});return{...e,...s}}var Ca=oe(st(),1);G();var RC=Jt?String.fromCodePoint(10004):"v",MC=Jt?String.fromCodePoint(9888):"!",JC=Jt?String.fromCodePoint(10007):"x",FC=["\u2839","\u2838","\u2834","\u2826","\u2807","\u280F","\u2819","\u2839"],BC=80,i0=[1,2,4],HC=i0.length;function LC(e){let t=e?.["retry-after"];if(!t)return;let r=Number(t);if(Number.isFinite(r)&&r>=0)return r}function NC(e){return new Promise(t=>setTimeout(t,e))}async function _e(e,t,r,i){let n=$e(e.loading,i.quiet);try{for(let s=0;;s++){let{data:o,error:a,headers:u}=await t();if(a){if(s<HC&&a.name==="rate_limit_exceeded"){let c=LC(u)??i0[s];n.update(`Rate limited, retrying in ${c}s...`),await NC(c*1e3),n.update(e.loading);continue}n.fail(e.fail),v({message:a.message,code:r},{json:i.json})}return o===null&&(n.fail(e.fail),v({message:"Unexpected empty response",code:r},{json:i.json})),n.stop(e.success),o}}catch(s){return n.fail(e.fail),v({message:U(s,"Unknown error"),code:r},{json:i.json})}}function $e(e,t){if(t||!w())return{update(a){},stop(a){},warn(a){},fail(a){}};let r=Jt?FC:["-","\\","|","/"],i=BC,n=0,s=e,o=setInterval(()=>{process.stderr.write(`\r\x1B[2K ${r[n++%r.length]} ${s}`)},i);return{update(a){s=a},stop(a){clearInterval(o),process.stderr.write(`\r\x1B[2K ${Ca.default.green(RC)} ${a}
193
- `)},warn(a){clearInterval(o),process.stderr.write(`\r\x1B[2K ${Ca.default.yellow(MC)} ${a}
194
- `)},fail(a){clearInterval(o),process.stderr.write(`\r\x1B[2K ${Ca.default.red(JC)} ${a}
195
- `)}}}G();async function re(e,t){let r=await te(t),i=await _e(e.spinner,()=>e.sdkCall(r),"fetch_error",t);!t.json&&w()?e.onInteractive(i):$(i,{json:t.json})}async function pe(e,t,r,i){let n=await te(i);t||await e0(e,r.confirmMessage,i),await _e(r.spinner,()=>r.sdkCall(n),"delete_error",i),!i.json&&w()?console.log(r.successMsg):$({object:r.object,id:e,deleted:!0},{json:i.json})}async function Z(e,t){let r=await te(t),i=await _e(e.spinner,()=>e.sdkCall(r),"create_error",t);!t.json&&w()?e.onInteractive(i):$(i,{json:t.json})}async function W(e,t){let r=await te(t),i=await _e(e.spinner,()=>e.sdkCall(r),e.errorCode,t);!t.json&&w()?console.log(e.successMsg):$(i,{json:t.json})}async function L(e,t){let r=await te(t),i=await _e(e.spinner,()=>e.sdkCall(r),"list_error",t);!t.json&&w()?e.onInteractive(i):$(i,{json:t.json})}G();var n0=new f("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 be("--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",g({context:`Non-interactive: --name is required (no prompts when stdin/stdout is not a TTY).
257
+ `);c.content=Qt.encode(d);break}default:c.content=o.content}this.attachments.push(c)}for(let u of o.childNodes)await s(u,a,l)};await s(this.root,!1,[]),i.forEach(o=>{r.forEach(a=>{if(t[a]||(t[a]=[]),o[a])o[a].forEach(l=>{switch(l.type){case"text":t[a].push(l.value);break;case"subMessage":switch(a){case"html":t[a].push(Zu(l.value));break;case"plain":t[a].push(Qu(l.value));break}break}});else{let l;switch(a){case"html":l="plain";break;case"plain":l="html";break}(o[l]||[]).forEach(u=>{switch(u.type){case"text":switch(a){case"html":t[a].push(im(u.value));break;case"plain":t[a].push(nm(u.value));break}break;case"subMessage":switch(a){case"html":t[a].push(Zu(u.value));break;case"plain":t[a].push(Qu(u.value));break}break}})}})}),Object.keys(t).forEach(o=>{t[o]=t[o].join(`
258
+ `)}),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:l}=await n.read();if(a)break;i.push(l),r+=l.length}let s=new Uint8Array(r),o=0;for(let a of i)s.set(a,o),o+=a.length;return s}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=Qt.encode(t)),(t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]")&&(t=await Zt(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,value:n.value})).reverse()};for(let n of["from","sender"]){let s=this.root.headers.find(o=>o.key===n);if(s&&s.value){let o=Pn(s.value);o&&o.length&&(r[n]=o[0])}}for(let n of["delivered-to","return-path"]){let s=this.root.headers.find(o=>o.key===n);if(s&&s.value){let o=Pn(s.value);if(o&&o.length&&o[0].address){let a=n.replace(/\-(.)/g,(l,u)=>u.toUpperCase());r[a]=o[0].address}}}for(let n of["to","cc","bcc","reply-to"]){let s=this.root.headers.filter(a=>a.key===n),o=[];if(s.filter(a=>a&&a.value).map(a=>Pn(a.value)).forEach(a=>o=o.concat(a||[])),o&&o.length){let a=n.replace(/\-(.)/g,(l,u)=>u.toUpperCase());r[a]=o}}for(let n of["subject","message-id","in-reply-to","references"]){let s=this.root.headers.find(o=>o.key===n);if(s&&s.value){let o=n.replace(/\-(.)/g,(a,l)=>l.toUpperCase());r[o]=hr(s.value)}}let i=this.root.headers.find(n=>n.key==="date");if(i){let n=new Date(i.value);!n||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 s of r.attachments||[])s?.content&&(s.content=am(s.content),s.encoding="base64");break;case"utf8":let n=new TextDecoder("utf8");for(let s of r.attachments||[])s?.content&&(s.content=n.decode(s.content),s.encoding="utf8");break;default:throw new Error("Unknwon attachment encoding")}return r}};var Pv=me(Cv(),1),YO="6.9.4";function ot(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 QO=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/api-keys",e,t)}async list(e={}){let t=ot(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}`)}};function ZO(e){return e?.map(t=>({content:t.content,filename:t.filename,path:t.path,content_type:t.contentType,content_id:t.contentId}))}function Tv(e){return{attachments:ZO(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 Pl(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 XO=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 Pl(i.react),i.react=void 0),r.push(Tv(i));return await this.resend.post("/emails/batch",r,{...t,headers:{"x-batch-validation":t?.batchValidation??"strict",...t?.headers}})}},ex=class{constructor(e){this.resend=e}async create(e,t={}){return e.react&&(e.html=await Pl(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=ot(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 Pl(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 Sv(e){return{id:e.id,key:e.key,createdAt:e.created_at,type:e.type,fallbackValue:e.fallback_value}}function Ov(e){return"key"in e?{key:e.key,type:e.type,fallback_value:e.fallbackValue}:{fallback_value:e.fallbackValue}}var tx=class{constructor(e){this.resend=e}async create(e){let t=Ov(e);return await this.resend.post("/contact-properties",t)}async list(e={}){let t=ot(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=>Sv(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",...Sv(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=Ov(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"}}}},rx=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=ot(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}`)}},ix=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=ot(e),i=r?`/contacts/${t}/topics?${r}`:`/contacts/${t}/topics`;return this.resend.get(i)}},nx=class{constructor(e){this.resend=e,this.topics=new ix(this.resend),this.segments=new rx(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=ot(e),s=n?`/contacts?${n}`:"/contacts";return await this.resend.get(s)}let r=ot(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 sx(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 ox=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/domains",sx(e),t)}async list(e={}){let t=ot(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`)}},ax=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=ot(e),i=r?`/emails/${t}/attachments?${r}`:`/emails/${t}/attachments`;return await this.resend.get(i)}},lx=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=ot(e),i=r?`/emails/receiving/${t}/attachments?${r}`:`/emails/receiving/${t}/attachments`;return await this.resend.get(i)}},ux=class{constructor(e){this.resend=e,this.attachments=new lx(e)}async get(e){return await this.resend.get(`/emails/receiving/${e}`)}async list(e={}){let t=ot(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,s=await this.get(t);if(s.error)return{data:null,error:s.error,headers:s.headers};let o=s.data,a=o.subject||"(no subject)";if(n)return this.forwardPassthrough(o,{to:r,from:i,subject:a});let l=a.startsWith("Fwd:")?a:`Fwd: ${a}`;return this.forwardWrapped(o,{to:r,from:i,subject:l,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 s=await fetch(e.raw.download_url);if(!s.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:s.status},headers:null};let o=await s.text(),a=await qi.parse(o,{attachmentEncoding:"base64"}),l=a.attachments.map(u=>{let c=u.contentId?u.contentId.replace(/^<|>$/g,""):void 0;return{filename:u.filename,content:u.content.toString(),content_type:u.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:l.length>0?l:void 0})}async forwardWrapped(e,t){let{to:r,from:i,subject:n,text:s,html:o}=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 l=await a.text();return await this.resend.post("/emails",{from:i,to:r,subject:n,text:s,html:o,attachments:[{filename:"forwarded_message.eml",content:Buffer.from(l).toString("base64"),content_type:"message/rfc822"}]})}},cx=class{constructor(e){this.resend=e,this.attachments=new ax(e),this.receiving=new ux(e)}async send(e,t={}){return this.create(e,t)}async create(e,t={}){return e.react&&(e.html=await Pl(e.react)),await this.resend.post("/emails",Tv(e),t)}async get(e){return await this.resend.get(`/emails/${e}`)}async list(e={}){let t=ot(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`)}},dx=class{constructor(e){this.resend=e}async create(e,t={}){return await this.resend.post("/segments",e,t)}async list(e={}){let t=ot(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 px(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 mx(e){return e?.map(t=>({key:t.key,type:t.type,fallback_value:t.fallbackValue}))}function xv(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:mx(e.variables)}}var kv=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)}},fx=class{constructor(e){this.resend=e}create(e){return new kv(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",xv(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${px(e)}`)}duplicate(e){return new kv(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}`,xv(t))}},hx=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"}}}},gx=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=ot(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 Pv.Webhook(e.webhookSecret).verify(e.payload,{"svix-id":e.headers.id,"svix-timestamp":e.headers.timestamp,"svix-signature":e.headers.signature})}},Ev="https://api.resend.com",Av=`resend-node:${YO}`,bx=typeof process<"u"&&process.env&&process.env.RESEND_BASE_URL||Ev,vx=typeof process<"u"&&process.env&&process.env.RESEND_USER_AGENT||Av,ti=class{constructor(e){if(this.key=e,this.apiKeys=new QO(this),this.segments=new dx(this),this.audiences=this.segments,this.batch=new XO(this),this.broadcasts=new ex(this),this.contacts=new nx(this),this.contactProperties=new tx(this),this.domains=new ox(this),this.emails=new cx(this),this.webhooks=new gx(this),this.templates=new fx(this),this.topics=new hx(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":vx,"Content-Type":"application/json"})}async fetchRequest(e,t={}){try{let r=await fetch(`${bx}${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[s,o]of new Headers(r.headers).entries())i.set(s,o);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,s]of new Headers(t.headers).entries())r.set(n,s);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[s,o]of new Headers(r.headers).entries())i.set(s,o);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[s,o]of new Headers(r.headers).entries())i.set(s,o);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)}};We();var Hv=me(Kt(),1);function ne(e,t){return e instanceof Error?e.message:t}function Lv(e){return!!(e||!process.stdout.isTTY)}function X(e,t={}){Lv(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 O(e,t={}){let r=t.exitCode??1;Lv(t.json)?console.log(JSON.stringify({error:{message:e.message,code:e.code??"unknown"}},null,2)):console.error(`${Hv.default.red("Error:")} ${e.message}`),process.exit(r)}var Nv={sending_access:0,full_access:1};function Cx(e,t){return Nv[e]>=Nv[t]}async function _e(e,t){let r=e.profile??e.team;try{let i=await Dr(e.apiKey,r);if(!i){if(r){let n=Ke();if(!n.some(o=>o.name===r))throw new Error(`Profile "${r}" not found. Available profiles: ${n.map(o=>o.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";Cx(i.permission,n)||O({message:`This command requires a full access API key. Your current key has sending access only.
259
+ ${ri}`,code:"insufficient_permissions"},{json:e.json})}return new ti(i.key)}catch(i){O({message:ne(i,"Failed to create client"),code:"auth_error"},{json:e.json})}}var Gv=130;function Sx(){process.stderr.isTTY&&process.stderr.write("\r\x1B[2K"),console.error("Cancelled."),process.exit(Gv)}var si;function Uv(){si=Sx,process.on("SIGINT",si),process.on("uncaughtException",e=>{O({message:ne(e,"An unexpected error occurred"),code:"unexpected_error"},{}),process.exit(1)})}function Ml(e){si&&process.removeListener("SIGINT",si),si=e,process.on("SIGINT",si)}function oi(){return Gv}We();var zl=me(Kt(),1);ae();var Ox=Nt?String.fromCodePoint(10004):"v",xx=Nt?String.fromCodePoint(9888):"!",kx=Nt?String.fromCodePoint(10007):"x",Ex=["\u2839","\u2838","\u2834","\u2826","\u2807","\u280F","\u2819","\u2839"],Ax=80,Wv=[1,2,4],Px=Wv.length;function Tx(e){let t=e?.["retry-after"];if(!t)return;let r=Number(t);if(Number.isFinite(r)&&r>=0)return r}function $x(e){return new Promise(t=>setTimeout(t,e))}async function at(e,t,r,i){let n=De(e.loading,i.quiet);try{for(let s=0;;s++){let{data:o,error:a,headers:l}=await t();if(a){if(s<Px&&a.name==="rate_limit_exceeded"){let u=Tx(l)??Wv[s];n.update(`Rate limited, retrying in ${u}s...`),await $x(u*1e3),n.update(e.loading);continue}n.fail(e.fail),O({message:a.message,code:r},{json:i.json})}return o===null&&(n.fail(e.fail),O({message:"Unexpected empty response",code:r},{json:i.json})),n.stop(e.success),o}}catch(s){return n.fail(e.fail),O({message:ne(s,"Unknown error"),code:r},{json:i.json})}}function De(e,t){if(t||!D())return{update(a){},stop(a){},warn(a){},fail(a){}};let r=Nt?Ex:["-","\\","|","/"],i=Ax,n=0,s=e,o=setInterval(()=>{process.stderr.write(`\r\x1B[2K ${r[n++%r.length]} ${s}`)},i);return{update(a){s=a},stop(a){clearInterval(o),process.stderr.write(`\r\x1B[2K ${zl.default.green(Ox)} ${a}
260
+ `)},warn(a){clearInterval(o),process.stderr.write(`\r\x1B[2K ${zl.default.yellow(xx)} ${a}
261
+ `)},fail(a){clearInterval(o),process.stderr.write(`\r\x1B[2K ${zl.default.red(kx)} ${a}
262
+ `)}}}ae();function H(e){Wp(e),process.exit(oi())}async function Kv(e,t,r){(!D()||r.json)&&O({message:"Use --yes to confirm deletion in non-interactive mode.",code:"confirmation_required"},{json:r.json});let i=await Yt({message:t});(B(i)||!i)&&H("Deletion cancelled.")}async function Fl(e,t){let r=je(e);if(!r)return e;if(!D()||t.json)return O({message:`Profile "${e}" has an invalid name: ${r}`,code:"invalid_profile_name"},{json:t.json}),null;fe.warn(`Profile "${e}" has an invalid name: ${r}`);let i=await pe({message:"Enter a new name for this profile:",placeholder:e.replace(/[^a-zA-Z0-9._-]/g,"-"),validate:n=>je(n)});B(i)&&H("Rename cancelled.");try{await Rl(e,i)}catch(n){return O({message:ne(n,"Failed to rename profile"),code:"rename_failed"},{json:t.json}),null}return fe.success(`Profile renamed to '${i}'.`),i}async function Re(e,t,r,i){if(e)return e;(!D()||i.json)&&O(r,{json:i.json});let n=await pe({message:t.message,placeholder:t.placeholder,defaultValue:t.defaultValue,validate:t.validate??(s=>!t.defaultValue&&(!s||s.length===0)?`${t.message} is required`:void 0)});return B(n)&&H("Cancelled."),n}async function Yv(e,t,r,i){if(e)return e;(!D()||i.json)&&O(r,{json:i.json});let n=await $e({message:t.message,options:t.options});return B(n)&&H("Cancelled."),n}async function Qv(e,t,r){let i=t.filter(o=>o.required!==!1&&e[o.flag]==="");if(i.length>0){let o=i.map(a=>`--${a.flag}`).join(", ");O({message:`Empty value for required flags: ${o}`,code:"invalid_options"},{json:r.json})}let n=t.filter(o=>o.required!==!1&&!e[o.flag]);if(n.length===0)return e;if(!D()||r.json){let o=n.map(a=>`--${a.flag}`).join(", ");O({message:`Missing required flags: ${o}`,code:"missing_flags"},{json:r.json})}let s=await Up(Object.fromEntries(n.map(o=>[o.flag,()=>pe({message:o.message,placeholder:o.placeholder,defaultValue:o.defaultValue,validate:o.validate??(a=>!o.defaultValue&&(!a||a.length===0)?`${o.message} is required`:void 0)})])),{onCancel:()=>H("Operation cancelled.")});return{...e,...s}}var jx=20,Vv="__fetch_more__";async function I(e,t,r){if(e)return e;(!D()||r.json)&&O({message:"Missing required argument: id",code:"missing_id"},{json:r.json});let i=await _e(r),n=[];for(;;){let s=n.at(-1)?.id,o=De(n.length===0?`Fetching ${t.resourcePlural}...`:`Fetching more ${t.resourcePlural}...`,r.quiet),a=await t.fetchItems(i,{limit:jx,...s&&{after:s}});(a.error||!a.data)&&(o.fail(`Failed to fetch ${t.resourcePlural}`),O({message:a.error?.message??"Unexpected empty response",code:"list_error"},{json:r.json})),o.stop(n.length===0?`${t.resourcePlural} fetched`:`More ${t.resourcePlural} fetched`),n.push(...a.data.data);let l=a.data.has_more??!1,u=t.filter?n.filter(t.filter):n;if(u.length===0&&!l&&(fe.warn(`No ${t.resourcePlural} found.`),O({message:`No ${t.resourcePlural} found.`,code:"no_items"},{json:r.json})),u.length===0&&l)continue;let c=u.map(p=>({value:p.id,...t.display(p)}));l&&c.push({value:Vv,label:"Fetch more..."});let d=await $e({message:`Select a ${t.resource}`,options:c});if(B(d)&&H("Cancelled."),d!==Vv)return d}}ae();async function ke(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await _e(t,r),n=await at(e.spinner,()=>e.sdkCall(i),"fetch_error",t);!t.json&&D()?e.onInteractive(n):X(n,{json:t.json})}async function Me(e,t,r,i){let n=r.permission?{permission:r.permission}:void 0,s=await _e(i,n);t||await Kv(e,r.confirmMessage,i),await at(r.spinner,()=>r.sdkCall(s),"delete_error",i),!i.json&&D()?console.log(r.successMsg):X({object:r.object,id:e,deleted:!0},{json:i.json})}async function we(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await _e(t,r),n=await at(e.spinner,()=>e.sdkCall(i),"create_error",t);!t.json&&D()?e.onInteractive(n):X(n,{json:t.json})}async function le(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await _e(t,r),n=await at(e.spinner,()=>e.sdkCall(i),e.errorCode,t);!t.json&&D()?console.log(e.successMsg):X(n,{json:t.json})}async function ue(e,t){let r=e.permission?{permission:e.permission}:void 0,i=await _e(t,r),n=await at(e.spinner,()=>e.sdkCall(i),"list_error",t);!t.json&&D()?e.onInteractive(n):X(n,{json:t.json})}ae();var Zv=new h("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 Le("--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",g({context:`Non-interactive: --name is required (no prompts when stdin/stdout is not a TTY).
196
263
 
197
264
  Permissions:
198
265
  full_access Full API access (default)
199
266
  sending_access Send-only access; optionally scope to a domain with --domain-id`,output:` {"id":"<id>","token":"<token>"}
200
- The token is only returned at creation time and cannot be retrieved again.`,errorCodes:["auth_error","missing_name","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){(!w()||r.json)&&v({message:"Missing --name flag.",code:"missing_name"},{json:r.json});let s=await N({message:"Key name",placeholder:"My API Key",validate:a=>{if(!a)return"Name is required";if(a.length>50)return"Name must be 50 characters or less"}});D(s)&&j("Cancelled."),i=s;let o=await ve({message:"Permission level",options:[{value:"full_access",label:"Full access"},{value:"sending_access",label:"Sending access only"}]});D(o)&&j("Cancelled."),n=o}await Z({spinner:{loading:"Creating API key...",success:"API key created",fail:"Failed to create API key"},sdkCall:s=>s.apiKeys.create({name:i,...n&&{permission:n},...e.domainId&&{domain_id:e.domainId}}),onInteractive:s=>{console.log(`
201
- ${$r.default.gray("Name:")} ${i}`),console.log(` ${$r.default.gray("ID:")} ${s.id}`),console.log(` ${$r.default.gray("Token:")} ${s.token}`),console.log(`
202
- ${$r.default.yellow("\u26A0")} Store this token now \u2014 it cannot be retrieved again.`)}},r)});var s0=new f("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",g({context:`Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.
267
+ The token is only returned at creation time and cannot be retrieved again.`,errorCodes:["auth_error","missing_name","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){(!D()||r.json)&&O({message:"Missing --name flag.",code:"missing_name"},{json:r.json});let s=await pe({message:"Key name",placeholder:"e.g. My API Key",validate:a=>{if(!a)return"Name is required";if(a.length>50)return"Name must be 50 characters or less"}});B(s)&&H("Cancelled."),i=s;let o=await $e({message:"Permission level",options:[{value:"full_access",label:"Full access"},{value:"sending_access",label:"Sending access only"}]});B(o)&&H("Cancelled."),n=o}await we({spinner:{loading:"Creating API key...",success:"API key created",fail:"Failed to create API key"},sdkCall:s=>s.apiKeys.create({name:i,...n&&{permission:n},...e.domainId&&{domain_id:e.domainId}}),onInteractive:s=>{console.log(`
268
+ ${Vi.default.gray("Name:")} ${i}`),console.log(` ${Vi.default.gray("ID:")} ${s.id}`),console.log(` ${Vi.default.gray("Token:")} ${s.token}`),console.log(`
269
+ ${Vi.default.yellow("\u26A0")} Store this token now \u2014 it cannot be retrieved again.`)}},r)});ae();var ze=Nt?{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 Dx(){return process.stdout.columns}function Ix(e,t,r){let i=Math.max(...e.map(s=>s.length)),n=Math.max(20,Math.min(r,60));return t.map((s,o)=>{let a=String(o+1),l=`${ze.h}${ze.h} ${a} ${ze.h.repeat(Math.max(0,n-a.length-4))}`,u=e.map((c,d)=>` ${c.padEnd(i)} ${s[d]}`);return[l,...u].join(`
270
+ `)}).join(`
271
+
272
+ `)}function he(e,t,r="(no results)"){if(t.length===0)return r;let i=e.map((u,c)=>Math.max(u.length,...t.map(d=>d[c].length))),n=Dx();if(n!==void 0&&i.reduce((c,d)=>c+d,0)+3*i.length+1>n)return Ix(e,t,n);let s=ze.tl+i.map(u=>ze.h.repeat(u+2)).join(ze.tm)+ze.tr,o=ze.lm+i.map(u=>ze.h.repeat(u+2)).join(ze.mm)+ze.rm,a=ze.bl+i.map(u=>ze.h.repeat(u+2)).join(ze.bm)+ze.br,l=u=>ze.v+" "+u.map((c,d)=>c.padEnd(i[d])).join(` ${ze.v} `)+" "+ze.v;return[s,l(e),o,...t.map(l),a].join(`
273
+ `)}var Xv={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 e2(e){let t=e.map(r=>[r.name,r.id,r.created_at,r.last_used_at??""]);return he(["Name","ID","Created","Last used"],t,"(no API keys)")}var t2=new h("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",g({context:`Non-interactive: --yes is required to confirm deletion when stdin/stdout is not a TTY.
203
274
 
204
275
  Warning: Deleting a key is immediate and irreversible. Any service using this key
205
276
  will stop authenticating instantly. The current key (used to call this command)
206
- 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();await pe(e,!!t.yes,{confirmMessage:`Delete API key ${e}?
207
- Any services using this key will stop working.`,spinner:{loading:"Deleting API key...",success:"API key deleted",fail:"Failed to delete API key"},object:"api-key",successMsg:"API key deleted.",sdkCall:n=>n.apiKeys.remove(e)},i)});G();var we=Jt?{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 V(e,t,r="(no results)"){if(t.length===0)return r;let i=e.map((u,c)=>Math.max(u.length,...t.map(d=>d[c].length))),n=we.tl+i.map(u=>we.h.repeat(u+2)).join(we.tm)+we.tr,s=we.lm+i.map(u=>we.h.repeat(u+2)).join(we.mm)+we.rm,o=we.bl+i.map(u=>we.h.repeat(u+2)).join(we.bm)+we.br,a=u=>we.v+" "+u.map((c,d)=>c.padEnd(i[d])).join(` ${we.v} `)+" "+we.v;return[n,a(e),s,...t.map(a),o].join(`
208
- `)}function o0(e){let t=e.map(r=>[r.name,r.id,r.created_at]);return V(["Name","ID","Created"],t,"(no API keys)")}var a0=new f("list").alias("ls").description("List all API keys (IDs and names \u2014 tokens are never returned by this endpoint)").addHelpText("after",g({output:` {"object":"list","data":[{"id":"<id>","name":"<name>","created_at":"<date>"}]}
209
- 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 L({spinner:{loading:"Fetching API keys...",success:"API keys fetched",fail:"Failed to list API keys"},sdkCall:i=>i.apiKeys.list(),onInteractive:i=>console.log(o0(i.data))},r)});var u0=new f("api-keys").description("Manage API keys for authentication").addHelpText("after",g({context:`Security notes:
277
+ 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 I(e,Xv,i);await Me(n,!!t.yes,{confirmMessage:`Delete API key ${n}?
278
+ Any services using this key will stop working.`,spinner:{loading:"Deleting API key...",success:"API key deleted",fail:"Failed to delete API key"},object:"api-key",successMsg:"API key deleted.",sdkCall:s=>s.apiKeys.remove(n)},i)});var r2=new h("list").alias("ls").description("List all API keys (IDs and names \u2014 tokens are never returned by this endpoint)").addHelpText("after",g({output:` {"object":"list","data":[{"id":"<id>","name":"<name>","created_at":"<date>","last_used_at":"<date>|null"}]}
279
+ 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 ue({spinner:{loading:"Fetching API keys...",success:"API keys fetched",fail:"Failed to list API keys"},sdkCall:i=>i.apiKeys.list(),onInteractive:i=>console.log(e2(i.data))},r)});var i2=new h("api-keys").description("Manage API keys for authentication").addHelpText("after",g({context:`Security notes:
210
280
  - Tokens are only shown at creation time and cannot be retrieved again.
211
281
  - Use sending_access keys with --domain-id for per-domain CI tokens.
212
- - 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(n0).addCommand(a0,{isDefault:!0}).addCommand(s0);Ce();G();function Xc(e){let t=xe();if(e.json){$({profiles:t},{json:!0});return}if(t.length===0){console.log("No profiles configured. Run: resend login");return}w()&&console.log(`
282
+ - 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(Zv).addCommand(r2,{isDefault:!0}).addCommand(t2);We();ae();function Dd(e){let t=Ke();if(e.json){X({profiles:t},{json:!0});return}if(t.length===0){console.log("No profiles configured. Run: resend login");return}D()&&console.log(`
213
283
  Profiles
214
- `);let r=!1;for(let i of t){let n=i.active?" (active)":"",s=ae(i.name)!==void 0;s&&(r=!0),console.log(` ${i.active?"\u25B8":" "} ${i.name}${n}${s?" (invalid name)":""}`)}r&&w()&&console.log("\n Profiles with invalid names can be renamed via `resend auth rename`."),w()&&console.log("")}var c0=new f("list").description("List all profiles").action((e,t)=>{Xc(t.optsWithGlobals())});var l0=require("node:child_process"),Rr=oe(st(),1),zr="https://resend.com";function el(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,l0.execFile)(r,n,{timeout:5e3,windowsVerbatimArguments:!0},s=>t(!s))})}async function sr(e,t){let r=await el(e);t?.json||t?.quiet||(r?console.log(Rr.default.dim("Opened"),Rr.default.blue(e)):console.warn(Rr.default.yellow("Could not open browser. Visit this link:"),Rr.default.blue(e)))}var gt={emails:`${zr}/emails`,templates:`${zr}/templates`,template:e=>`${zr}/templates/${e}`,broadcasts:`${zr}/broadcasts`,broadcast:e=>`${zr}/broadcasts/${e}`};Ce();G();var tl="https://resend.com/api-keys?new=true",GC={flag:"command line (--api-key)",env:"environment (RESEND_API_KEY)",config:"saved credentials"},Sa=new f("login").description("Save a Resend API key").option("--key <key>","API key to store (required in non-interactive mode)").addHelpText("after",g({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){(!w()||r.json)&&v({message:"Missing --key flag. Provide your API key in non-interactive mode.",code:"missing_key"},{json:r.json}),rd("Resend Authentication");let c=await it();if(c){let p=GC[c.source]??c.source;Ae.info(`Existing API key found (${p}). Enter a new key to replace it.`)}let d=await ve({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"}]});D(d)&&j("Login cancelled."),d==="browser"&&(await el(tl)?Ae.info(`Opened ${tl}`):Ae.warn(`Could not open browser. Visit ${tl} manually.`));let l=await nd({message:"Enter your Resend API key:",validate:p=>{if(!p)return"API key is required";if(!p.startsWith("re_"))return"API key must start with re_"}});D(l)&&j("Login cancelled."),i=l.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=$e("Validating API key...",r.quiet);try{let c=new er(i),{error:d}=await c.domains.list();if(d){n.fail("API key validation failed"),v({message:d.message||"Failed to validate API key",code:"validation_failed"},{json:r.json});return}n.stop("API key is valid")}catch(c){n.fail("API key validation failed"),v({message:U(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=ae(s);if(c){v({message:c,code:"invalid_profile_name"},{json:r.json});return}}if(!s&&w()&&!r.json){let c=xe();if(c.length>0){let d=[...c.map(p=>({value:p.name,label:`${p.name} (overwrite)`,hint:ae(p.name)?"invalid name":void 0})),{value:"__new__",label:"+ Create new profile"}],l=await ve({message:"Save API key to which profile?",options:d});if(D(l)&&j("Login cancelled."),l==="__new__"){let p=await N({message:"Enter a name for the new profile:",validate:h=>ae((h??"").trim())});if(D(p)&&j("Login cancelled."),s=(p??"").trim()||"default",c.some(h=>h.name===s)){let h=await ot({message:`Profile '${s}' already exists. Overwrite?`});(D(h)||!h)&&j("Login cancelled.")}}else if(ae(l)){let p=await Oa(l,r);if(!p)return;s=p}else s=l}else s="default"}let{configPath:o,backend:a}=await Vb(i,s),u=s||"default";if(s)try{ba(u)}catch(c){v({message:U(c,"Failed to switch profile"),code:"switch_failed"},{json:r.json})}if(r.json)$({success:!0,config_path:o,profile:u,storage:a.name},{json:!0});else{let c=a.isSecure?`in ${a.name}`:`at ${o}`,d=`API key stored for profile '${u}' ${c}`;if(w()?ci(d):console.log(d),!a.isSecure&&process.platform==="linux"){let l="Tip: Install libsecret-tools and a Secret Service provider (e.g. gnome-keyring) to store keys in secure storage instead of a plaintext file.";w()?Ae.info(l):console.log(l)}}});var d0=require("node:fs");Ce();G();var xa=new f("logout").description("Remove your saved Resend API key").addHelpText("after",g({setup:!0,context:`Removes the saved API key from secure storage and the credentials file.
284
+ `);let r=!1;for(let i of t){let n=i.active?" (active)":"",s=je(i.name)!==void 0;s&&(r=!0),console.log(` ${i.active?"\u25B8":" "} ${i.name}${n}${s?" (invalid name)":""}`)}r&&D()&&console.log("\n Profiles with invalid names can be renamed via `resend auth rename`."),D()&&console.log("")}var n2=new h("list").description("List all profiles").action((e,t)=>{Dd(t.optsWithGlobals())});var s2=require("node:child_process"),Yi=me(Kt(),1),Ki="https://resend.com";function Id(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,s2.execFile)(r,n,{timeout:5e3,windowsVerbatimArguments:!0},s=>t(!s))})}async function ai(e,t){let r=await Id(e);t?.json||t?.quiet||(r?console.log(Yi.default.dim("Opened"),Yi.default.blue(e)):console.warn(Yi.default.yellow("Could not open browser. Visit this link:"),Yi.default.blue(e)))}var or={emails:`${Ki}/emails`,templates:`${Ki}/templates`,template:e=>`${Ki}/templates/${e}`,broadcasts:`${Ki}/broadcasts`,broadcast:e=>`${Ki}/broadcasts/${e}`};We();ae();var qd="https://resend.com/api-keys?new=true",Jl=new h("login").description("Save a Resend API key").option("--key <key>","API key to store (required in non-interactive mode)").addHelpText("after",g({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){(!D()||r.json)&&O({message:"Missing --key flag. Provide your API key in non-interactive mode.",code:"missing_key"},{json:r.json}),Vp("Resend Authentication"),fe.info(`Use a full access API key for complete CLI access.
285
+ ${ri}`);let c=await $e({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"}]});B(c)&&H("Login cancelled."),c==="browser"&&(await Id(qd)?fe.info(`Opened ${qd}`):fe.warn(`Could not open browser. Visit ${qd} manually.`));let d=await Yp({message:"Enter your Resend API key:",validate:p=>{if(!p)return"API key is required";if(!p.startsWith("re_"))return"API key must start with re_"}});B(d)&&H("Login cancelled."),i=d.trim()}(!i||!i.startsWith("re_"))&&O({message:"Invalid API key format. Key must start with re_",code:"invalid_key_format"},{json:r.json});let n=De("Validating API key...",r.quiet),s="full_access";try{let c=new ti(i),{error:d}=await c.domains.list();if(d){let p=d;if(p.name==="restricted_api_key")s="sending_access",n.warn("API key is valid (sending access only)");else{n.fail("API key validation failed"),O({message:p.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"),O({message:ne(c,"Failed to validate API key"),code:"validation_failed"},{json:r.json})}let o=(r.profile??r.team)?.trim()||void 0;if(o){let c=je(o);if(c){O({message:c,code:"invalid_profile_name"},{json:r.json});return}}if(!o&&D()&&!r.json){let c=Ke();if(c.length>0){let d=[...c.map(v=>({value:v.name,label:`${v.name} (overwrite)`,hint:je(v.name)?"invalid name":void 0})),{value:"__new__",label:"+ Create new profile"}],p=await $e({message:"Save API key to which profile?",options:d});if(B(p)&&H("Login cancelled."),p==="__new__"){let v=await pe({message:"Enter a name for the new profile:",validate:b=>je((b??"").trim())});if(B(v)&&H("Login cancelled."),o=(v??"").trim()||"default",c.some(b=>b.name===o)){let b=await Yt({message:`Profile '${o}' already exists. Overwrite?`});(B(b)||!b)&&H("Login cancelled.")}}else if(je(p)){let v=await Fl(p,r);if(!v)return;o=v}else o=p}else o="default"}let{configPath:a,backend:l}=await Jv(i,o,s),u=o||"default";if(o)try{Il(u)}catch(c){O({message:ne(c,"Failed to switch profile"),code:"switch_failed"},{json:r.json})}if(r.json)X({success:!0,config_path:a,profile:u,storage:l.name,permission:s},{json:!0});else{let c=l.isSecure?`in ${l.name}`:`at ${a}`,d=`API key stored for profile '${u}' ${c}`;if(D()?En(d):console.log(d),!l.isSecure&&process.platform==="linux"){let p="Tip: Install libsecret-tools and a Secret Service provider (e.g. gnome-keyring) to store keys in secure storage instead of a plaintext file.";D()?fe.info(p):console.log(p)}}});var o2=require("node:fs");We();ae();var Bl=new h("logout").description("Remove your saved Resend API key").addHelpText("after",g({setup:!0,context:`Removes the saved API key from secure storage and the credentials file.
215
286
 
216
287
  When --profile is specified, only that profile's entry is removed.
217
288
  When no profile is specified, all profiles are removed.
218
289
 
219
- 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=Rt();if(!he()&&!(0,d0.existsSync)(i)){!r.json&&w()?console.log("No saved credentials found. Nothing to remove."):$({success:!0,already_logged_out:!0},{json:r.json});return}let s=r.profile??r.team,o=!s,a=s||rr();if(!r.json&&w()){let u=o?"Remove all saved API keys?":`Remove saved API key for profile '${a}'?`,c=await ot({message:u});(D(c)||!c)&&j("Logout cancelled.")}try{o?await Kb():await va(a)}catch(u){v({message:U(u,"Failed to remove credentials"),code:"remove_failed"},{json:r.json})}if(!r.json&&w()){let u=o?"Logged out. All API keys removed.":`Logged out. API key removed for profile '${a}'.`;ci(u)}else $({success:!0,config_path:i,profile:o?"all":a},{json:r.json})});Ce();G();async function rl(e,t){let r=e;if(!r){if(!w()||t.json){v({message:"Missing profile name. Provide a profile name in non-interactive mode.",code:"missing_name"},{json:t.json});return}let i=xe();if(i.length===0){v({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:t.json});return}let n=await ve({message:"Remove which profile?",options:i.map(s=>({value:s.name,label:s.name,hint:s.active?"active":void 0}))});D(n)&&j("Remove cancelled."),r=n}if(!t.json&&w()){let i=await ot({message:`Remove profile '${r}' and its API key?`});(D(i)||!i)&&j("Remove cancelled.")}try{await va(r)}catch(i){v({message:U(i,"Failed to remove profile"),code:"remove_failed"},{json:t.json});return}t.json?$({success:!0,removed_profile:r},{json:!0}):console.log(`Profile '${r}' removed.`)}var p0=new f("remove").description("Remove a profile").argument("[name]","Profile name to remove").action(async(e,t,r)=>{await rl(e,r.optsWithGlobals())});Ce();G();async function UC(e,t,r){let i=e,n=t;if(!i){if(!w()||r.json){v({message:"Missing profile name. Provide old and new names in non-interactive mode.",code:"missing_name"},{json:r.json});return}let s=xe();if(s.length===0){v({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:r.json});return}let o=await ve({message:"Rename which profile?",options:s.map(a=>({value:a.name,label:a.name,hint:a.active?"active":ae(a.name)?"invalid name":void 0}))});D(o)&&j("Rename cancelled."),i=o}if(!n){if(!w()||r.json){v({message:"Missing new name. Provide old and new names in non-interactive mode.",code:"missing_name"},{json:r.json});return}let s=await N({message:`Enter new name for '${i}':`,placeholder:i.replace(/[^a-zA-Z0-9._-]/g,"-"),validate:o=>ae(o)});D(s)&&j("Rename cancelled."),n=s}try{await _a(i,n)}catch(s){v({message:U(s,"Failed to rename profile"),code:"rename_failed"},{json:r.json});return}r.json?$({success:!0,old_name:i,new_name:n},{json:!0}):console.log(`Profile '${i}' renamed to '${n}'.`)}var m0=new f("rename").description("Rename a profile").argument("[old-name]","Current profile name").argument("[new-name]","New profile name").action(async(e,t,r,i)=>{await UC(e,t,i.optsWithGlobals())});Ce();G();async function il(e,t){let r=e;if(!r){if(!w()||t.json){v({message:"Missing profile name. Provide a profile name in non-interactive mode.",code:"missing_name"},{json:t.json});return}let s=xe();if(s.length===0){v({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:t.json});return}let o=await ve({message:"Switch to which profile?",options:s.map(a=>({value:a.name,label:a.name,hint:a.active?"active":ae(a.name)?"invalid name":void 0}))});D(o)&&j("Switch cancelled."),r=o}if(xe().some(s=>s.name===r)){let s=await Oa(r,t);if(!s)return;r=s}try{ba(r)}catch(s){v({message:U(s,"Failed to switch profile"),code:"switch_failed"},{json:t.json});return}t.json?$({success:!0,active_profile:r},{json:!0}):console.log(`Switched to profile '${r}'.`)}var f0=new f("switch").description("Switch the active profile").argument("[name]","Profile name to switch to").action(async(e,t,r)=>{await il(e,r.optsWithGlobals())});var h0=new f("auth").description("Manage authentication and profiles").addHelpText("after",g({setup:!0,context:`Environment variables:
290
+ 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=$r();if(!Be()&&!(0,o2.existsSync)(i)){!r.json&&D()?console.log("No saved credentials found. Nothing to remove."):X({success:!0,already_logged_out:!0},{json:r.json});return}let s=r.profile??r.team,o=!s,a=s||ni();if(!r.json&&D()){let l=o?"Remove all saved API keys?":`Remove saved API key for profile '${a}'?`,u=await Yt({message:l});(B(u)||!u)&&H("Logout cancelled.")}try{o?await Bv():await ql(a)}catch(l){O({message:ne(l,"Failed to remove credentials"),code:"remove_failed"},{json:r.json})}if(!r.json&&D()){let l=o?"Logged out. All API keys removed.":`Logged out. API key removed for profile '${a}'.`;En(l)}else X({success:!0,config_path:i,profile:o?"all":a},{json:r.json})});We();ae();async function Rd(e,t){let r=e;if(!r){if(!D()||t.json){O({message:"Missing profile name. Provide a profile name in non-interactive mode.",code:"missing_name"},{json:t.json});return}let i=Ke();if(i.length===0){O({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:t.json});return}let n=await $e({message:"Remove which profile?",options:i.map(s=>({value:s.name,label:s.name,hint:s.active?"active":void 0}))});B(n)&&H("Remove cancelled."),r=n}if(!t.json&&D()){let i=await Yt({message:`Remove profile '${r}' and its API key?`});(B(i)||!i)&&H("Remove cancelled.")}try{await ql(r)}catch(i){O({message:ne(i,"Failed to remove profile"),code:"remove_failed"},{json:t.json});return}t.json?X({success:!0,removed_profile:r},{json:!0}):console.log(`Profile '${r}' removed.`)}var a2=new h("remove").description("Remove a profile").argument("[name]","Profile name to remove").action(async(e,t,r)=>{await Rd(e,r.optsWithGlobals())});We();ae();async function qx(e,t,r){let i=e,n=t;if(!i){if(!D()||r.json){O({message:"Missing profile name. Provide old and new names in non-interactive mode.",code:"missing_name"},{json:r.json});return}let s=Ke();if(s.length===0){O({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:r.json});return}let o=await $e({message:"Rename which profile?",options:s.map(a=>({value:a.name,label:a.name,hint:a.active?"active":je(a.name)?"invalid name":void 0}))});B(o)&&H("Rename cancelled."),i=o}if(!n){if(!D()||r.json){O({message:"Missing new name. Provide old and new names in non-interactive mode.",code:"missing_name"},{json:r.json});return}let s=await pe({message:`Enter new name for '${i}':`,placeholder:i.replace(/[^a-zA-Z0-9._-]/g,"-"),validate:o=>je(o)});B(s)&&H("Rename cancelled."),n=s}try{await Rl(i,n)}catch(s){O({message:ne(s,"Failed to rename profile"),code:"rename_failed"},{json:r.json});return}r.json?X({success:!0,old_name:i,new_name:n},{json:!0}):console.log(`Profile '${i}' renamed to '${n}'.`)}var l2=new h("rename").description("Rename a profile").argument("[old-name]","Current profile name").argument("[new-name]","New profile name").action(async(e,t,r,i)=>{await qx(e,t,i.optsWithGlobals())});We();ae();async function Md(e,t){let r=e;if(!r){if(!D()||t.json){O({message:"Missing profile name. Provide a profile name in non-interactive mode.",code:"missing_name"},{json:t.json});return}let s=Ke();if(s.length===0){O({message:"No profiles configured. Run `resend login` first.",code:"no_profiles"},{json:t.json});return}let o=await $e({message:"Switch to which profile?",options:s.map(a=>({value:a.name,label:a.name,hint:a.active?"active":je(a.name)?"invalid name":void 0}))});B(o)&&H("Switch cancelled."),r=o}if(Ke().some(s=>s.name===r)){let s=await Fl(r,t);if(!s)return;r=s}try{Il(r)}catch(s){O({message:ne(s,"Failed to switch profile"),code:"switch_failed"},{json:t.json});return}t.json?X({success:!0,active_profile:r},{json:!0}):console.log(`Switched to profile '${r}'.`)}var u2=new h("switch").description("Switch the active profile").argument("[name]","Profile name to switch to").action(async(e,t,r)=>{await Md(e,r.optsWithGlobals())});var c2=new h("auth").description("Manage authentication and profiles").addHelpText("after",g({setup:!0,context:`Environment variables:
220
291
  RESEND_API_KEY API key (overrides stored credentials)
221
292
  RESEND_PROFILE Profile name (overrides config default)
222
- 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(Sa).addCommand(xa).addCommand(c0,{isDefault:!0}).addCommand(f0).addCommand(m0).addCommand(p0);var nl=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,nl.readFileSync)(0,"utf-8")}catch{v({message:"Failed to read from stdin",code:"stdin_read_error"},{json:t.json})}}try{return(0,nl.readFileSync)(e,"utf-8")}catch{v({message:`Failed to read file: ${e}`,code:"file_read_error"},{json:t.json})}}G();var g0=new f("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("--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)').addHelpText("after",g({context:`Non-interactive: --from, --subject, and --segment-id are required.
223
- Body: provide at least one of --html, --html-file, --text, or --text-file.
293
+ 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(Jl).addCommand(Bl).addCommand(n2,{isDefault:!0}).addCommand(u2).addCommand(l2).addCommand(a2);async function Hl(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 Rx=["noreply","hello"];async function Ll(e){let t;if(e.length===1)t=e[0];else{let n=await $e({message:"Select a verified domain",options:e.map(s=>({value:s,label:s}))});B(n)&&H("Send cancelled."),t=n}let r=Rx.map(n=>({value:`${n}@${t}`,label:`${n}@${t}`}));r.push({value:null,label:"Custom address..."});let i=await $e({message:`From address (@${t})`,options:r});if(B(i)&&H("Send cancelled."),i===null){let n=await pe({message:"From address",placeholder:`e.g. you@${t}`,validate:s=>!s||!s.includes("@")?"Enter a valid email address":void 0});return B(n)&&H("Send cancelled."),n}return i}var zd=require("node:fs");function He(e,t){if(e==="-"){process.stdin.isTTY&&O({message:"No input piped to stdin",code:"stdin_read_error"},{json:t.json});try{return(0,zd.readFileSync)(0,"utf-8")}catch{O({message:"Failed to read from stdin",code:"stdin_read_error"},{json:t.json})}}try{return(0,zd.readFileSync)(e,"utf-8")}catch{O({message:`Failed to read file: ${e}`,code:"file_read_error"},{json:t.json})}}var ru=require("node:fs"),G2=require("node:path");var tu=require("node:fs"),J2=require("node:os"),di=me(require("node:path"),1),B2=me(Nd(),1);var M2=require("node:fs"),z2=me(require("node:path"),1);function R2(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var F2=e=>({name:"rendering-utilities-exporter",setup:t=>{t.onLoad({filter:new RegExp(e.map(r=>R2(r)).join("|"))},async({path:r})=>({contents:`${await M2.promises.readFile(r,"utf8")};
294
+ export { render } from 'react-email-module-that-will-export-render'
295
+ export { createElement as reactEmailCreateReactElement } from 'react';
296
+ `,loader:z2.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 H2(e){let t=di.default.resolve(e),r=(0,tu.mkdtempSync)(di.default.join((0,J2.tmpdir)(),"resend-react-email-"));try{await(0,B2.build)({bundle:!0,entryPoints:[t],format:"cjs",jsx:"automatic",logLevel:"silent",outExtension:{".js":".cjs"},outdir:r,platform:"node",plugins:[F2([t])],write:!0})}catch(s){throw(0,tu.rmSync)(r,{recursive:!0,force:!0}),s}let i=di.default.basename(t,di.default.extname(t));return{cjsPath:di.default.join(r,`${i}.cjs`),tmpDir:r}}var L2=require("node:module"),Ak={};async function N2(e){let t=(0,L2.createRequire)(Ak.url);delete t.cache[e];let r=t(e);return r.render(r.reactEmailCreateReactElement(r.default,{}),{})}function Gd(e){e&&(0,ru.rmSync)(e,{recursive:!0,force:!0})}async function Et(e,t){let r=(0,G2.resolve)(e);if(!(0,ru.existsSync)(r))return O({message:`File not found: ${e}`,code:"react_email_build_error"},{json:t.json});let i=De("Bundling React Email template...",t.quiet),n;try{let s=await H2(e);n=s.tmpDir,i.stop("Bundled React Email template");let o=De("Rendering React Email template...",t.quiet);try{let a=await N2(s.cjsPath);return o.stop("Rendered React Email template"),Gd(n),a}catch(a){return o.fail("Failed to render React Email template"),Gd(n),O({message:ne(a,"Failed to render React Email template"),code:"react_email_render_error"},{json:t.json})}}catch(s){return i.fail("Failed to bundle React Email template"),Gd(n),O({message:ne(s,"Failed to bundle React Email template"),code:"react_email_build_error"},{json:t.json})}}ae();var U2=new h("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").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)').addHelpText("after",g({context:`Non-interactive: --from, --subject, and --segment-id are required.
297
+ Body: provide at least one of --html, --html-file, --text, --text-file, or --react-email.
224
298
 
225
299
  Variable interpolation:
226
300
  HTML bodies support triple-brace syntax for contact properties.
@@ -229,39 +303,39 @@ Variable interpolation:
229
303
  Scheduling:
230
304
  Use --scheduled-at with --send to schedule delivery.
231
305
  Accepts ISO 8601 (e.g. 2026-08-05T11:52:01Z) or natural language (e.g. "in 1 hour").
232
- --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","create_error"],examples:['resend broadcasts create --from hello@domain.com --subject "Weekly Update" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hello {{{FIRST_NAME|there}}}</p>"','resend broadcasts create --from hello@domain.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html-file ./email.html --send','resend broadcasts create --from hello@domain.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --text "Hello!" --send --scheduled-at "tomorrow at 9am ET"','resend broadcasts create --from hello@domain.com --subject "News" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hi</p>" --json','echo "<p>Hello</p>" | resend broadcasts create --from hello@domain.com --subject "Update" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html-file -']})).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});let i=e.from,n=e.subject,s=e.segmentId;if(!i){(!w()||r.json)&&v({message:"Missing --from flag.",code:"missing_from"},{json:r.json});let u=await N({message:"From address",placeholder:"hello@domain.com",validate:c=>c?void 0:"Required"});D(u)&&j("Cancelled."),i=u}if(!n){(!w()||r.json)&&v({message:"Missing --subject flag.",code:"missing_subject"},{json:r.json});let u=await N({message:"Subject",placeholder:"Weekly Newsletter",validate:c=>c?void 0:"Required"});D(u)&&j("Cancelled."),n=u}if(!s){(!w()||r.json)&&v({message:"Missing --segment-id flag.",code:"missing_segment"},{json:r.json});let u=await N({message:"Segment ID",placeholder:"7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d",validate:c=>c?void 0:"Required"});D(u)&&j("Cancelled."),s=u}let o=e.html,a=e.text;if(e.htmlFile&&(e.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
233
- `),o=ge(e.htmlFile,r)),e.textFile&&(e.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
234
- `),a=ge(e.textFile,r)),!o&&!a){(!w()||r.json)&&v({message:"Missing body. Provide --html, --html-file, --text, or --text-file.",code:"missing_body"},{json:r.json});let u=await N({message:"Body (plain text)",placeholder:"Hello {{{FIRST_NAME|there}}}!",validate:c=>c?void 0:"Required"});D(u)&&j("Cancelled."),a=u}await Z({spinner:{loading:"Creating broadcast...",success:e.send?e.scheduledAt?"Broadcast scheduled":"Broadcast sent":"Broadcast created",fail:"Failed to create broadcast"},sdkCall:u=>u.broadcasts.create({from:i,subject:n,segmentId:s,...o&&{html:o},...a&&{text:a},...e.name&&{name:e.name},...e.replyTo&&{replyTo:e.replyTo},...e.previewText&&{previewText:e.previewText},...e.topicId&&{topicId:e.topicId},...e.send&&{send:!0},...e.send&&e.scheduledAt&&{scheduledAt:e.scheduledAt}}),onInteractive:u=>{e.send?e.scheduledAt?console.log(`
306
+ --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 hello@domain.com --subject "Weekly Update" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hello {{{FIRST_NAME|there}}}</p>"','resend broadcasts create --from hello@domain.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html-file ./email.html --send','resend broadcasts create --from hello@domain.com --subject "Launch" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --text "Hello!" --send --scheduled-at "tomorrow at 9am ET"','resend broadcasts create --from hello@domain.com --subject "News" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html "<p>Hi</p>" --json','echo "<p>Hello</p>" | resend broadcasts create --from hello@domain.com --subject "Update" --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --html-file -']})).action(async(e,t)=>{let r=t.optsWithGlobals();e.htmlFile==="-"&&e.textFile==="-"&&O({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)&&O({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:r.json});let i=await _e(r),n=e.from,s=e.subject,o=e.segmentId;if(!n&&D()&&!r.json){let u=await Hl(i);u.length>0&&(n=await Ll(u))}if(!n){(!D()||r.json)&&O({message:"Missing --from flag.",code:"missing_from"},{json:r.json});let u=await pe({message:"From address",placeholder:"e.g. hello@domain.com",validate:c=>c?void 0:"Required"});B(u)&&H("Cancelled."),n=u}if(!s){(!D()||r.json)&&O({message:"Missing --subject flag.",code:"missing_subject"},{json:r.json});let u=await pe({message:"Subject",placeholder:"e.g. Weekly Newsletter",validate:c=>c?void 0:"Required"});B(u)&&H("Cancelled."),s=u}if(!o){(!D()||r.json)&&O({message:"Missing --segment-id flag.",code:"missing_segment"},{json:r.json});let u=await pe({message:"Segment ID",placeholder:"7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d",validate:c=>c?void 0:"Required"});B(u)&&H("Cancelled."),o=u}let a=e.html,l=e.text;if(e.htmlFile&&(e.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
307
+ `),a=He(e.htmlFile,r)),e.textFile&&(e.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
308
+ `),l=He(e.textFile,r)),e.reactEmail&&(a=await Et(e.reactEmail,r)),!a&&!l){(!D()||r.json)&&O({message:"Missing body. Provide --html, --html-file, --text, --text-file, or --react-email.",code:"missing_body"},{json:r.json});let u=await pe({message:"Body (plain text)",placeholder:"Hello {{{FIRST_NAME|there}}}!",validate:c=>c?void 0:"Required"});B(u)&&H("Cancelled."),l=u}await we({spinner:{loading:"Creating broadcast...",success:e.send?e.scheduledAt?"Broadcast scheduled":"Broadcast sent":"Broadcast created",fail:"Failed to create broadcast"},sdkCall:u=>u.broadcasts.create({from:n,subject:s,segmentId:o,...a&&{html:a},...l&&{text:l},...e.name&&{name:e.name},...e.replyTo&&{replyTo:e.replyTo},...e.previewText&&{previewText:e.previewText},...e.topicId&&{topicId:e.topicId},...e.send&&{send:!0},...e.send&&e.scheduledAt&&{scheduledAt:e.scheduledAt}}),onInteractive:u=>{e.send?e.scheduledAt?console.log(`
235
309
  Broadcast scheduled: ${u.id}`):console.log(`
236
310
  Broadcast sent: ${u.id}`):(console.log(`
237
311
  Broadcast created: ${u.id}`),console.log("Status: draft"),console.log(`
238
- Send it with: resend broadcasts send ${u.id}`))}},r)});var b0=new f("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",g({context:`Warning: Deleting a scheduled broadcast cancels its delivery immediately.
312
+ Send it with: resend broadcasts send ${u.id}`))}},r)});function Ud(e){switch(e){case"draft":return"\u25CB Draft";case"queued":return"\u23F3 Queued";case"sent":return"\u2713 Sent";default:return e}}var pi={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})},W2={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:`${Ud(e.status)} ${e.id}`}),filter:e=>e.status==="draft"};function V2(e){let t=e.map(r=>[r.name??"(untitled)",r.status,r.created_at,r.id]);return he(["Name","Status","Created","ID"],t,"(no broadcasts)")}var K2=new h("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",g({context:`Warning: Deleting a scheduled broadcast cancels its delivery immediately.
239
313
  Only draft and scheduled broadcasts can be deleted; sent broadcasts cannot.
240
314
 
241
- 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();await pe(e,!!t.yes,{confirmMessage:`Delete broadcast ${e}?
242
- If scheduled, delivery will be cancelled.`,spinner:{loading:"Deleting broadcast...",success:"Broadcast deleted",fail:"Failed to delete broadcast"},object:"broadcast",successMsg:"Broadcast deleted.",sdkCall:n=>n.broadcasts.remove(e)},i)});function v0(e){switch(e){case"draft":return"\u25CB Draft";case"queued":return"\u23F3 Queued";case"sent":return"\u2713 Sent";default:return e}}function _0(e){let t=e.map(r=>[r.name??"(untitled)",r.status,r.created_at,r.id]);return V(["Name","Status","Created","ID"],t,"(no broadcasts)")}var y0=new f("get").description("Retrieve full details for a broadcast including HTML body, status, and delivery times").argument("<id>","Broadcast ID").addHelpText("after",g({context:`Note: The list command returns summary objects without html/text/from/subject.
243
- 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();await re({spinner:{loading:"Fetching broadcast...",success:"Broadcast fetched",fail:"Failed to fetch broadcast"},sdkCall:n=>n.broadcasts.get(e),onInteractive:n=>{console.log(`
244
- Broadcast: ${n.id}`),console.log(` Status: ${v0(n.status)}`),console.log(` Name: ${n.name??"(untitled)"}`),console.log(` From: ${n.from??"\u2014"}`),console.log(` Subject: ${n.subject??"\u2014"}`),console.log(` Segment: ${n.segment_id??"\u2014"}`),n.preview_text&&console.log(` Preview: ${n.preview_text}`),n.topic_id&&console.log(` Topic: ${n.topic_id}`),console.log(` Created: ${n.created_at}`),n.scheduled_at&&console.log(` Scheduled: ${n.scheduled_at}`),n.sent_at&&console.log(` Sent: ${n.sent_at}`)}},i)});Ce();function ie(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 ne(e,t,r){return t?{limit:e,after:t}:r?{limit:e,before:r}:{limit:e}}function se(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,s=i?"--before":"--after",o=r.limit?` --limit ${r.limit}`:"",a=r.apiKey?` --api-key ${Mt(r.apiKey)}`:"",u=r.profile?` --profile ${r.profile}`:"";console.log(`
315
+ 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 I(e,pi,i);await Me(n,!!t.yes,{confirmMessage:`Delete broadcast ${n}?
316
+ If scheduled, delivery will be cancelled.`,spinner:{loading:"Deleting broadcast...",success:"Broadcast deleted",fail:"Failed to delete broadcast"},object:"broadcast",successMsg:"Broadcast deleted.",sdkCall:s=>s.broadcasts.remove(n)},i)});var Y2=new h("get").description("Retrieve full details for a broadcast including HTML body, status, and delivery times").argument("[id]","Broadcast ID").addHelpText("after",g({context:`Note: The list command returns summary objects without html/text/from/subject.
317
+ 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 I(e,pi,i);await ke({spinner:{loading:"Fetching broadcast...",success:"Broadcast fetched",fail:"Failed to fetch broadcast"},sdkCall:s=>s.broadcasts.get(n),onInteractive:s=>{console.log(`
318
+ Broadcast: ${s.id}`),console.log(` Status: ${Ud(s.status)}`),console.log(` Name: ${s.name??"(untitled)"}`),console.log(` From: ${s.from??"\u2014"}`),console.log(` Subject: ${s.subject??"\u2014"}`),console.log(` Segment: ${s.segment_id??"\u2014"}`),s.preview_text&&console.log(` Preview: ${s.preview_text}`),s.topic_id&&console.log(` Topic: ${s.topic_id}`),console.log(` Created: ${s.created_at}`),s.scheduled_at&&console.log(` Scheduled: ${s.scheduled_at}`),s.sent_at&&console.log(` Sent: ${s.sent_at}`)}},i)});We();function Ae(e,t){let r=parseInt(e,10);return(Number.isNaN(r)||r<1||r>100)&&O({message:"--limit must be an integer between 1 and 100",code:"invalid_limit"},{json:t.json}),r}function Pe(e,t,r){return t?{limit:e,after:t}:r?{limit:e,before:r}:{limit:e}}function Te(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,s=i?"--before":"--after",o=r.limit?` --limit ${r.limit}`:"",a=r.apiKey?` --api-key ${jr(r.apiKey)}`:"",l=r.profile?` --profile ${r.profile}`:"";console.log(`
245
319
  Fetch the next page:
246
- $ resend ${t} ${s} ${n}${o}${a}${u}`)}var O0=new f("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",g({context:`Note: List results include name, status, created_at, and id only.
247
- 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=ie(e.limit,r),n=ne(i,e.after,e.before);await L({spinner:{loading:"Fetching broadcasts...",success:"Broadcasts fetched",fail:"Failed to list broadcasts"},sdkCall:s=>s.broadcasts.list(n),onInteractive:s=>{console.log(_0(s.data)),se(s,"broadcasts list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var C0=new f("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",g({context:`Opens the Resend dashboard in your default browser.
320
+ $ resend ${t} ${s} ${n}${o}${a}${l}`)}var Q2=new h("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",g({context:`Note: List results include name, status, created_at, and id only.
321
+ 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=Ae(e.limit,r),n=Pe(i,e.after,e.before);await ue({spinner:{loading:"Fetching broadcasts...",success:"Broadcasts fetched",fail:"Failed to list broadcasts"},sdkCall:s=>s.broadcasts.list(n),onInteractive:s=>{console.log(V2(s.data)),Te(s,"broadcasts list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Z2=new h("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",g({context:`Opens the Resend dashboard in your default browser.
248
322
  With an ID: opens that broadcast's page for viewing or editing.
249
- 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?gt.broadcast(e):gt.broadcasts,n=r.optsWithGlobals();await sr(i,n)});var S0=new f("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",g({context:`Note: Only broadcasts created via the API can be sent via this command.
323
+ 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?or.broadcast(e):or.broadcasts,n=r.optsWithGlobals();await ai(i,n)});var X2=new h("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",g({context:`Note: Only broadcasts created via the API can be sent via this command.
250
324
  Broadcasts created in the Resend dashboard cannot be sent programmatically.
251
325
 
252
326
  Scheduling:
253
327
  --scheduled-at accepts ISO 8601 (e.g. 2026-08-05T11:52:01Z) or
254
- 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=t.scheduledAt?`
255
- Broadcast scheduled: ${e}`:`
256
- Broadcast sent: ${e}`;await W({spinner:{loading:t.scheduledAt?"Scheduling broadcast...":"Sending broadcast...",success:t.scheduledAt?"Broadcast scheduled":"Broadcast sent",fail:"Failed to send broadcast"},sdkCall:s=>s.broadcasts.send(e,{...t.scheduledAt&&{scheduledAt:t.scheduledAt}}),errorCode:"send_error",successMsg:n},i)});var x0=new f("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("--name <name>","Update internal label").addHelpText("after",g({context:`Note: Only draft broadcasts can be updated.
328
+ 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 I(e,W2,i),s=t.scheduledAt?`
329
+ Broadcast scheduled: ${n}`:`
330
+ Broadcast sent: ${n}`;await le({spinner:{loading:t.scheduledAt?"Scheduling broadcast...":"Sending broadcast...",success:t.scheduledAt?"Broadcast scheduled":"Broadcast sent",fail:"Failed to send broadcast"},sdkCall:o=>o.broadcasts.send(n,{...t.scheduledAt&&{scheduledAt:t.scheduledAt}}),errorCode:"send_error",successMsg:s,permission:"sending_access"},i)});var ey=new h("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").option("--name <name>","Update internal label").addHelpText("after",g({context:`Note: Only draft broadcasts can be updated.
257
331
  If the broadcast is already sent or sending, the API will return an error.
258
332
 
259
333
  Variable interpolation:
260
334
  HTML bodies support triple-brace syntax for contact properties.
261
- 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","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 "news@domain.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&&!t.subject&&!t.html&&!t.htmlFile&&!t.text&&!t.textFile&&!t.name&&v({message:"Provide at least one option to update: --from, --subject, --html, --html-file, --text, --text-file, 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});let n=t.html,s=t.text;t.htmlFile&&(t.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
262
- `),n=ge(t.htmlFile,i)),t.textFile&&(t.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
263
- `),s=ge(t.textFile,i)),await W({spinner:{loading:"Updating broadcast...",success:"Broadcast updated",fail:"Failed to update broadcast"},sdkCall:o=>o.broadcasts.update(e,{...t.from&&{from:t.from},...t.subject&&{subject:t.subject},...n&&{html:n},...s&&{text:s},...t.name&&{name:t.name}}),errorCode:"update_error",successMsg:`
264
- Broadcast updated: ${e}`},i)});var w0=new f("broadcasts").description("Manage broadcasts").addHelpText("after",g({context:`Lifecycle:
335
+ 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 "news@domain.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&&!t.subject&&!t.html&&!t.htmlFile&&!t.text&&!t.textFile&&!t.reactEmail&&!t.name&&O({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==="-"&&O({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&&(t.html||t.htmlFile)&&O({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:i.json});let n=await I(e,pi,i),s=t.html,o=t.text;t.htmlFile&&(t.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
336
+ `),s=He(t.htmlFile,i)),t.textFile&&(t.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
337
+ `),o=He(t.textFile,i)),t.reactEmail&&(s=await Et(t.reactEmail,i)),await le({spinner:{loading:"Updating broadcast...",success:"Broadcast updated",fail:"Failed to update broadcast"},sdkCall:a=>a.broadcasts.update(n,{...t.from&&{from:t.from},...t.subject&&{subject:t.subject},...s&&{html:s},...o&&{text:o},...t.name&&{name:t.name}}),errorCode:"update_error",successMsg:`
338
+ Broadcast updated: ${n}`},i)});var ty=new h("broadcasts").description("Manage broadcasts").addHelpText("after",g({context:`Lifecycle:
265
339
  Broadcasts follow a draft \u2192 send flow:
266
340
  1. create \u2014 creates a draft (or sends immediately with --send)
267
341
  2. send \u2014 sends an API-created draft (dashboard broadcasts cannot be sent via API)
@@ -272,7 +346,44 @@ Template variables:
272
346
  Example: {{{FIRST_NAME|Friend}}} \u2014 uses FIRST_NAME or falls back to "Friend".
273
347
 
274
348
  Scheduling:
275
- --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 hello@domain.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(g0).addCommand(C0).addCommand(S0).addCommand(y0).addCommand(O0,{isDefault:!0}).addCommand(x0).addCommand(b0);var k0=new f("create").description("Create a new contact property definition").addOption(new be("--key <key>","Property key name, used in broadcast template interpolation (e.g. company_name, department)")).addOption(new be("--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",g({context:`Property keys are used as identifiers in broadcast HTML template interpolation:
349
+ --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 hello@domain.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(U2).addCommand(Z2).addCommand(X2).addCommand(Y2).addCommand(Q2,{isDefault:!0}).addCommand(ey).addCommand(K2);var Fe=require("node:fs"),lr=require("node:os"),ft=require("node:path");function Wd(e){let t=[];for(let i of e.commands)i._hidden||t.push(Wd(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 rn(e,t,r){let i=t?`${t} ${e.name}`:e.name,n=[],s=[];for(let a of e.subcommands){s.push({name:a.name,description:a.description});for(let l of a.aliases)s.push({name:l,description:a.description})}let o=[...e.options,...r];n.push({path:i,subcommands:s,options:o});for(let a of e.subcommands)n.push(...rn(a,i,r));return n}function Vd(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 iy(e){let t=rn(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 s=Vd(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'),s&&r.push(` ${s}) 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 o of t){let a=o.path===e.name?"":o.path.replace(`${e.name} `,""),l=o.options.filter(f=>f.choices&&f.long),u=o.options.map(f=>f.long).filter(Boolean).join(" "),c=o.subcommands.map(f=>f.name).join(" "),d=l.length>0,p=u.length>0,v=c.length>0;if(!(!d&&!p&&!v)){if(r.push(` "${a}")`),d){r.push(' case "$prev" in');for(let f of l)r.push(` ${f.long}) COMPREPLY=($(compgen -W "${f.choices?.join(" ")}" -- "$cur")); return ;;`);r.push(" esac")}p&&(r.push(' if [[ "$cur" == -* ]]; then'),r.push(` COMPREPLY=($(compgen -W "${u}" -- "$cur")); return`),r.push(" fi")),v&&r.push(` COMPREPLY=($(compgen -W "${c}" -- "$cur"))`),r.push(" ;;")}}return r.push(" esac"),r.push("}"),r.push(""),r.push(`complete -F _${i}_completions ${i}`),r.join(`
350
+ `)}function ny(e){let t=rn(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 s=Vd(e).join("|");r.push(' cmd_path=""'),r.push(" for ((i=2; i < CURRENT; i++)); do"),r.push(' case "${words[$i]}" in'),s&&r.push(` ${s}) ((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 o of t){let a=o.path===e.name?"":o.path.replace(`${e.name} `,""),l=o.options.filter(d=>d.choices&&d.long),u=o.options.filter(d=>d.long),c=o.subcommands.length>0;if(!(l.length===0&&u.length===0&&!c)){if(r.push(` "${a}")`),l.length>0){r.push(' case "$prev" in');for(let d of l)r.push(` ${d.long}) compadd -- ${d.choices?.join(" ")}; return ;;`);r.push(" esac")}if(u.length>0){r.push(' if [[ "$cur" == -* ]]; then');let d=u.map(p=>`"${p.long}:${ry(p.description)}"`).join(" ");r.push(` local -a opts=(${d}); _describe 'option' opts; return`),r.push(" fi")}if(c){let d=o.subcommands.map(p=>`"${p.name}:${ry(p.description)}"`).join(" ");r.push(` local -a cmds=(${d}); _describe 'command' cmds`)}r.push(" ;;")}}return r.push(" esac"),r.push("}"),r.push(""),r.push(`compdef _${i} ${i}`),r.join(`
351
+ `)}function sy(e){let t=e.name,r=rn(e,"",[]),i=[];i.push(`# fish completion for ${t}`),i.push(`# Generated by: ${t} completion fish`),i.push("");let n=r[0];for(let s of n.subcommands)i.push(`complete -c ${t} -n "__fish_use_subcommand" -a "${s.name}" -d "${iu(s.description)}"`);for(let s of e.options)if(s.long){let o=s.long.replace("--",""),a=`complete -c ${t} -l "${o}"`;s.short&&(a+=` -s "${s.short.replace("-","")}"`),s.takesValue&&(a+=" -r"),s.choices&&(a+=` -a "${s.choices.join(" ")}"`),a+=` -d "${iu(s.description)}"`,i.push(a)}for(let s of r.slice(1)){let o=s.path.split(" ").slice(1),l=`__fish_seen_subcommand_from ${o[o.length-1]}`;for(let u of s.subcommands)i.push(`complete -c ${t} -n "${l}" -a "${u.name}" -d "${iu(u.description)}"`);for(let u of s.options)if(u.long){let c=u.long.replace("--",""),d=`complete -c ${t} -n "${l}" -l "${c}"`;u.short&&(d+=` -s "${u.short.replace("-","")}"`),u.takesValue&&(d+=" -r"),u.choices&&(d+=` -a "${u.choices.join(" ")}"`),d+=` -d "${iu(u.description)}"`,i.push(d)}}return i.join(`
352
+ `)}function ry(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/:/g,"\\:")}function iu(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function oy(e){let t=e.name,r=rn(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 s=Vd(e).map(o=>`"${o}"`).join(", ");i.push(" $cmdPath = @()"),i.push(` $valueFlags = @(${s})`),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 o of r){let a=o.path===e.name?"":o.path.replace(`${e.name} `,""),l=o.options.filter(f=>f.choices&&f.long),u=o.options.map(f=>f.long).filter(Boolean).map(f=>`"${f}"`).join(", "),c=o.subcommands.map(f=>`"${f.name}"`).join(", "),d=l.length>0,p=u.length>0,v=c.length>0;if(!(!d&&!p&&!v)){if(i.push(` "${a}" {`),d){i.push(" switch ($prev) {");for(let f of l){let b=f.choices?.map(S=>`"${S}"`).join(", ");i.push(` "${f.long}" { @(${b}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }; return }`)}i.push(" }")}p&&(i.push(' if ($cur -like "-*") {'),i.push(` @(${u}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }; return`),i.push(" }")),v&&i.push(` @(${c}) | Where-Object { $_ -like "$cur*" } | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_) }`),i.push(" }")}}return i.push(" }"),i.push("}"),i.join(`
353
+ `)}ae();var uy=["bash","zsh","fish","powershell"],nu="# resend shell completion";function Pk(){let e=process.env.SHELL;if(e){let t=(0,ft.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 Tk(e){if(e)return e;let t=Pk();if(t)return t;D()||(process.stderr.write(`error: could not detect shell. Pass the shell name explicitly.
354
+ `),process.exit(1));let r=await $e({message:"Which shell do you use?",options:uy.map(i=>({value:i,label:i}))});return B(r)&&H("Cancelled."),r}function ay(e){switch(e){case"bash":return process.platform==="darwin"?(0,ft.join)((0,lr.homedir)(),".bash_profile"):(0,ft.join)((0,lr.homedir)(),".bashrc");case"zsh":return(0,ft.join)((0,lr.homedir)(),".zshrc");case"powershell":return process.platform==="win32"?(0,ft.join)((0,lr.homedir)(),"Documents","PowerShell","Microsoft.PowerShell_profile.ps1"):(0,ft.join)((0,lr.homedir)(),".config","powershell","Microsoft.PowerShell_profile.ps1")}}function $k(e,t){switch(e){case"bash":return iy(t);case"zsh":return ny(t);case"fish":return sy(t);case"powershell":return oy(t)}}function ly(e,t,r){(0,Fe.existsSync)(e)||(0,Fe.mkdirSync)(e,{recursive:!0});let i=(0,ft.join)(e,t);return(0,Fe.writeFileSync)(i,`${r}
355
+ `),i}function jk(e,t){switch(e){case"zsh":{let r=(0,ft.join)((0,lr.homedir)(),".zsh","completions"),i=ly(r,"_resend",t);fe.success(`Completions written to ${i}`);let n=ay(e),s=!0;if((0,Fe.existsSync)(n)&&(0,Fe.readFileSync)(n,"utf8").includes(r)&&(s=!1),s){let o=`${nu}
356
+ fpath=(${r} $fpath)
357
+ `,a=(0,Fe.existsSync)(n)?(0,Fe.readFileSync)(n,"utf8"):"",l=a.match(/^.*compinit.*$/m);if(l){let u=a.indexOf(l[0]),c=a.slice(0,u),d=a.slice(u);(0,Fe.writeFileSync)(n,`${c}${o}
358
+ ${d}`)}else{let u=`
359
+ ${o}autoload -Uz compinit && compinit
360
+ `;(0,Fe.writeFileSync)(n,u,{flag:"a"})}fe.info(`Added completion path to ${n}`)}fe.info("Restart your shell to activate completions.");return}case"fish":{let r=(0,ft.join)((0,lr.homedir)(),".config","fish","completions"),i=ly(r,"resend.fish",t);fe.success(`Completions written to ${i}`),fe.info("Completions will be available in new fish sessions.");return}case"bash":case"powershell":{let r=ay(e),i=e==="powershell"?`
361
+ ${nu}
362
+ resend completion powershell | Invoke-Expression
363
+ `:`
364
+ ${nu}
365
+ eval "$(resend completion ${e})"
366
+ `;if((0,Fe.existsSync)(r)&&(0,Fe.readFileSync)(r,"utf8").includes(nu)){fe.info(`Completions already installed in ${r}`);return}let n=(0,ft.dirname)(r);(0,Fe.existsSync)(n)||(0,Fe.mkdirSync)(n,{recursive:!0}),(0,Fe.writeFileSync)(r,i,{flag:"a"}),fe.success(`Completions added to ${r}`),fe.info("Restart your shell to activate completions.");return}}}var cy=new h("completion").description("Generate shell completion script").addArgument(new _p("[shell]","Shell type").choices(uy)).option("--install","Install completions into your shell profile").addHelpText("after",g({context:`Outputs a completion script for the given shell. The shell is auto-detected
367
+ from $SHELL when not specified.
368
+
369
+ Quick setup:
370
+ resend completion --install
371
+
372
+ Manual setup:
373
+
374
+ Bash (add to ~/.bashrc):
375
+ eval "$(resend completion bash)"
376
+
377
+ Zsh (add to ~/.zshrc):
378
+ eval "$(resend completion zsh)"
379
+
380
+ Fish:
381
+ resend completion fish > ~/.config/fish/completions/resend.fish
382
+
383
+ PowerShell (add to $PROFILE):
384
+ resend completion powershell >> $PROFILE
385
+
386
+ 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 Tk(e),n=r.parent;if(!n)throw new Error("completion command must be registered under a parent");let s=Wd(n),o=$k(i,s);if(t.install){jk(i,o);return}if(!e&&D()){r.help();return}console.log(o)});var dy=new h("create").description("Create a new contact property definition").addOption(new Le("--key <key>","Property key name, used in broadcast template interpolation (e.g. company_name, department)")).addOption(new Le("--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",g({context:`Property keys are used as identifiers in broadcast HTML template interpolation:
276
387
  {{{PROPERTY_NAME|fallback}}} \u2014 triple-brace syntax substitutes the contact's value
277
388
  {{{company_name|Unknown}}} \u2014 falls back to "Unknown" if the property is not set
278
389
 
@@ -280,21 +391,21 @@ Reserved keys (cannot be used): FIRST_NAME, LAST_NAME, EMAIL, UNSUBSCRIBE_URL
280
391
 
281
392
  Non-interactive: --key and --type are required. --fallback-value is optional.
282
393
  Warning: do not create properties with reserved key names \u2014 they will conflict with
283
- 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 de(e.key,{message:"Property key",placeholder:"company_name"},{message:"Missing --key flag.",code:"missing_key"},r),n=await t0(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),s;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}),s=a}else s=e.fallbackValue;let o={key:i,type:n,...s!==void 0&&{fallbackValue:s}};await Z({spinner:{loading:"Creating contact property...",success:"Contact property created",fail:"Failed to create contact property"},sdkCall:a=>a.contactProperties.create(o),onInteractive:a=>{console.log(`
284
- Contact property created: ${a.id}`)}},r)});var A0=new f("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",g({context:`WARNING: Deleting a property definition removes that property value from ALL contacts
394
+ 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 Re(e.key,{message:"Property key",placeholder:"e.g. company_name"},{message:"Missing --key flag.",code:"missing_key"},r),n=await Yv(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),s;if(e.fallbackValue!==void 0)if(n==="number"){let a=parseFloat(e.fallbackValue);Number.isNaN(a)&&O({message:"--fallback-value must be a valid number for number-type properties.",code:"invalid_fallback_value"},{json:r.json}),s=a}else s=e.fallbackValue;let o={key:i,type:n,...s!==void 0&&{fallbackValue:s}};await we({spinner:{loading:"Creating contact property...",success:"Contact property created",fail:"Failed to create contact property"},sdkCall:a=>a.contactProperties.create(o),onInteractive:a=>{console.log(`
395
+ Contact property created: ${a.id}`)}},r)});var mi={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 py(e){let t=e.map(r=>[r.key,r.type,r.fallbackValue!=null?String(r.fallbackValue):"",r.id,r.createdAt]);return he(["Key","Type","Fallback Value","ID","Created"],t,"(no contact properties)")}var my=new h("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",g({context:`WARNING: Deleting a property definition removes that property value from ALL contacts
285
396
  permanently. This cannot be undone, and any broadcasts that reference this property key
286
397
  via {{{PROPERTY_NAME}}} will render an empty string or their inline fallback instead.
287
398
 
288
- 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();await pe(e,!!t.yes,{confirmMessage:`Delete contact property "${e}"?
289
- This will remove this property from ALL contacts permanently.`,spinner:{loading:"Deleting contact property...",success:"Contact property deleted",fail:"Failed to delete contact property"},object:"contact_property",successMsg:"Contact property deleted.",sdkCall:n=>n.contactProperties.remove(e)},i)});var E0=new f("get").description("Retrieve a contact property definition by ID").argument("<id>","Contact property UUID").addHelpText("after",g({output:` {
399
+ 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 I(e,mi,i);await Me(n,!!t.yes,{confirmMessage:`Delete contact property "${n}"?
400
+ This will remove this property from ALL contacts permanently.`,spinner:{loading:"Deleting contact property...",success:"Contact property deleted",fail:"Failed to delete contact property"},object:"contact_property",successMsg:"Contact property deleted.",sdkCall:s=>s.contactProperties.remove(n)},i)});var fy=new h("get").description("Retrieve a contact property definition by ID").argument("[id]","Contact property UUID").addHelpText("after",g({output:` {
290
401
  "object": "contact_property",
291
402
  "id": "<uuid>",
292
403
  "key": "company_name",
293
404
  "type": "string",
294
405
  "fallbackValue": null,
295
406
  "createdAt": "2026-01-01T00:00:00.000Z"
296
- }`,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();await re({spinner:{loading:"Fetching contact property...",success:"Contact property fetched",fail:"Failed to fetch contact property"},sdkCall:n=>n.contactProperties.get(e),onInteractive:n=>{console.log(`
297
- ${n.key} (${n.type})`),console.log(`ID: ${n.id}`),console.log(`Created: ${n.createdAt}`),console.log(`Fallback value: ${n.fallbackValue??"(none)"}`)}},i)});function T0(e){let t=e.map(r=>[r.key,r.type,r.fallbackValue!=null?String(r.fallbackValue):"",r.id,r.createdAt]);return V(["Key","Type","Fallback Value","ID","Created"],t,"(no contact properties)")}var P0=new f("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",g({context:`Pagination: use --after or --before with a contact property ID as the cursor.
407
+ }`,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 I(e,mi,i);await ke({spinner:{loading:"Fetching contact property...",success:"Contact property fetched",fail:"Failed to fetch contact property"},sdkCall:s=>s.contactProperties.get(n),onInteractive:s=>{console.log(`
408
+ ${s.key} (${s.type})`),console.log(`ID: ${s.id}`),console.log(`Created: ${s.createdAt}`),console.log(`Fallback value: ${s.fallbackValue??"(none)"}`)}},i)});var hy=new h("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",g({context:`Pagination: use --after or --before with a contact property ID as the cursor.
298
409
  Only one of --after or --before may be used at a time.
299
410
  The response includes has_more: true when additional pages exist.`,output:` {
300
411
  "object": "list",
@@ -302,14 +413,14 @@ ${n.key} (${n.type})`),console.log(`ID: ${n.id}`),console.log(`Created: ${n.crea
302
413
  "data": [
303
414
  { "id": "<uuid>", "key": "company_name", "type": "string", "fallbackValue": null, "createdAt": "..." }
304
415
  ]
305
- }`,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=ie(e.limit,r),n=ne(i,e.after,e.before);await L({spinner:{loading:"Fetching contact properties...",success:"Contact properties fetched",fail:"Failed to list contact properties"},sdkCall:s=>s.contactProperties.list(n),onInteractive:s=>{console.log(T0(s.data)),se(s,"contact-properties list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var D0=new f("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",g({context:`Note: the property key and type cannot be changed after creation. Only the fallback value
416
+ }`,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=Ae(e.limit,r),n=Pe(i,e.after,e.before);await ue({spinner:{loading:"Fetching contact properties...",success:"Contact properties fetched",fail:"Failed to list contact properties"},sdkCall:s=>s.contactProperties.list(n),onInteractive:s=>{console.log(py(s.data)),Te(s,"contact-properties list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var gy=new h("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",g({context:`Note: the property key and type cannot be changed after creation. Only the fallback value
306
417
  is updatable. Renaming a property would break existing broadcasts that reference the old key.
307
418
 
308
419
  --fallback-value and --clear-fallback-value are mutually exclusive.
309
420
 
310
421
  The fallback value is used in broadcast template interpolation when a contact has no value:
311
422
  {{{company_name|Unknown}}} \u2014 inline fallback (takes precedence over the property's fallback)
312
- {{{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","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();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 n=t.clearFallbackValue?null:t.fallbackValue;await W({spinner:{loading:"Updating contact property...",success:"Contact property updated",fail:"Failed to update contact property"},sdkCall:s=>s.contactProperties.update({id:e,...n!==void 0&&{fallbackValue:n}}),errorCode:"update_error",successMsg:`Contact property updated: ${e}`},i)});var j0=new f("contact-properties").description("Manage contact property definitions").addHelpText("after",g({context:`Contact properties define the schema for custom data stored on contacts.
423
+ {{{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","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 I(e,mi,i);t.fallbackValue===void 0&&!t.clearFallbackValue&&O({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&&O({message:"--fallback-value and --clear-fallback-value are mutually exclusive.",code:"conflicting_flags"},{json:i.json});let s=t.clearFallbackValue?null:t.fallbackValue;await le({spinner:{loading:"Updating contact property...",success:"Contact property updated",fail:"Failed to update contact property"},sdkCall:o=>o.contactProperties.update({id:n,...s!==void 0&&{fallbackValue:s}}),errorCode:"update_error",successMsg:`Contact property updated: ${n}`},i)});var by=new h("contact-properties").description("Manage contact property definitions").addHelpText("after",g({context:`Contact properties define the schema for custom data stored on contacts.
313
424
  Think of them as column definitions \u2014 you create a property definition (e.g. company_name)
314
425
  and then set values for that property on individual contacts via "resend contacts update --properties".
315
426
 
@@ -324,9 +435,9 @@ Supported types:
324
435
  number \u2014 numeric values (useful for counts, scores, thresholds)
325
436
 
326
437
  Note: property keys and types are immutable after creation. Only the fallback value can
327
- 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(k0).addCommand(E0).addCommand(P0,{isDefault:!0}).addCommand(D0).addCommand(A0);G();function I0(e){let t=e.map(r=>[r.email,r.first_name??"",r.last_name??"",r.unsubscribed?"yes":"no",r.id]);return V(["Email","First Name","Last Name","Unsubscribed","ID"],t,"(no contacts)")}function q0(e){let t=e.map(r=>[r.name,r.subscription,r.id,r.description??""]);return V(["Name","Subscription","ID","Description"],t,"(no topic subscriptions)")}function or(e){return e.includes("@")?{email:e}:{id:e}}function ar(e){return e.includes("@")?{email:e}:{contactId:e}}function $0(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 wa(e,t){if(e)try{return JSON.parse(e)}catch{v({message:"Invalid --properties JSON.",code:"invalid_properties"},{json:t.json})}}var z0=new f("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",g({context:`The <contactId> argument accepts either a UUID or an email address.
438
+ 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(dy).addCommand(fy).addCommand(hy,{isDefault:!0}).addCommand(gy).addCommand(my);var ur={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 su(e){let t=e.map(r=>[r.name,r.id,r.created_at]);return he(["Name","ID","Created"],t,"(no segments)")}function vy(e){let t=e.map(r=>[r.email,r.first_name??"",r.last_name??"",r.unsubscribed?"yes":"no",r.id]);return he(["Email","First Name","Last Name","Unsubscribed","ID"],t,"(no contacts)")}function yy(e){let t=e.map(r=>[r.name,r.subscription,r.id,r.description??""]);return he(["Name","Subscription","ID","Description"],t,"(no topic subscriptions)")}var Ne={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 fi(e){return e.includes("@")?{email:e}:{id:e}}function hi(e){return e.includes("@")?{email:e}:{contactId:e}}function _y(e,t){let r;try{r=JSON.parse(e)}catch{O({message:"Invalid --topics JSON. Expected an array of {id, subscription} objects.",code:"invalid_topics"},{json:t.json})}return Array.isArray(r)||O({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{O({message:"Invalid --properties JSON.",code:"invalid_properties"},{json:t.json})}}var wy=new h("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",g({context:`The <contactId> argument accepts either a UUID or an email address.
328
439
 
329
- 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 479e3145-dd38-4932-8c0c-e58b548c9e76 --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d","resend contacts add-segment user@example.com --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await te(i),s=t.segmentId;if(!s){(!w()||i.json)&&v({message:"Missing --segment-id flag.",code:"missing_segment_id"},{json:i.json});let u=await N({message:"Segment ID",placeholder:"7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d",validate:c=>c?void 0:"Required"});D(u)&&j("Cancelled."),s=u}let o={...ar(e),segmentId:s},a=await _e({loading:"Adding contact to segment...",success:"Contact added to segment",fail:"Failed to add contact to segment"},()=>n.contacts.segments.add(o),"add_segment_error",i);!i.json&&w()?console.log(`Contact added to segment: ${s}`):$(a,{json:i.json})});G();var R0=new f("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",g({context:`Non-interactive: --email is required. All other flags are optional.
440
+ 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 479e3145-dd38-4932-8c0c-e58b548c9e76 --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d","resend contacts add-segment user@example.com --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await I(e,Ne,i),s=await I(t.segmentId,ur,i),o={...hi(n),segmentId:s};await le({spinner:{loading:"Adding contact to segment...",success:"Contact added to segment",fail:"Failed to add contact to segment"},sdkCall:a=>a.contacts.segments.add(o),errorCode:"add_segment_error",successMsg:`Contact added to segment: ${s}`},i)});ae();var Cy=new h("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",g({context:`Non-interactive: --email is required. All other flags are optional.
330
441
 
331
442
  Properties: pass a JSON object string to --properties (e.g. '{"plan":"pro","company":"Acme"}').
332
443
  Properties are stored as custom contact attributes. To clear a property, set it to null.
@@ -334,11 +445,11 @@ Properties: pass a JSON object string to --properties (e.g. '{"plan":"pro","comp
334
445
 
335
446
  Segments: use --segment-id once per segment to add the contact to one or more segments on creation.
336
447
 
337
- 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 jane@example.com","resend contacts create --email jane@example.com --first-name Jane --last-name Smith","resend contacts create --email jane@example.com --unsubscribed",`resend contacts create --email jane@example.com --properties '{"company":"Acme","plan":"pro"}'`,"resend contacts create --email jane@example.com --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --segment-id a2f4c6e8-1b3d-5f7a-9c2e-4d6f8a1b3c5e","resend contacts create --email jane@example.com --first-name Jane --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await de(e.email,{message:"Email address",placeholder:"user@example.com"},{message:"Missing --email flag.",code:"missing_email"},r),n=e.firstName,s=e.lastName;if(w()&&!r.json&&!e.firstName){let u=await N({message:"First name (optional)",placeholder:"Jane"});D(u)&&j("Cancelled."),u&&(n=u)}if(w()&&!r.json&&!e.lastName){let u=await N({message:"Last name (optional)",placeholder:"Smith"});D(u)&&j("Cancelled."),u&&(s=u)}let o=wa(e.properties,r),a=e.segmentId??[];await Z({spinner:{loading:"Creating contact...",success:"Contact created",fail:"Failed to create contact"},sdkCall:u=>u.contacts.create({email:i,...n&&{firstName:n},...s&&{lastName:s},...e.unsubscribed&&{unsubscribed:!0},...o&&{properties:o},...a.length>0&&{segments:a.map(c=>({id:c}))}}),onInteractive:u=>{console.log(`
338
- Contact created: ${u.id}`)}},r)});var M0=new f("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",g({context:`The <id> argument accepts either a UUID or an email address.
448
+ 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 jane@example.com","resend contacts create --email jane@example.com --first-name Jane --last-name Smith","resend contacts create --email jane@example.com --unsubscribed",`resend contacts create --email jane@example.com --properties '{"company":"Acme","plan":"pro"}'`,"resend contacts create --email jane@example.com --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --segment-id a2f4c6e8-1b3d-5f7a-9c2e-4d6f8a1b3c5e","resend contacts create --email jane@example.com --first-name Jane --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await Re(e.email,{message:"Email address",placeholder:"user@example.com"},{message:"Missing --email flag.",code:"missing_email"},r),n=e.firstName,s=e.lastName;if(D()&&!r.json&&!e.firstName){let l=await pe({message:"First name (optional)"});B(l)&&H("Cancelled."),l&&(n=l)}if(D()&&!r.json&&!e.lastName){let l=await pe({message:"Last name (optional)"});B(l)&&H("Cancelled."),l&&(s=l)}let o=ou(e.properties,r),a=e.segmentId??[];await we({spinner:{loading:"Creating contact...",success:"Contact created",fail:"Failed to create contact"},sdkCall:l=>l.contacts.create({email:i,...n&&{firstName:n},...s&&{lastName:s},...e.unsubscribed&&{unsubscribed:!0},...o&&{properties:o},...a.length>0&&{segments:a.map(u=>({id:u}))}}),onInteractive:l=>{console.log(`
449
+ Contact created: ${l.id}`)}},r)});var Sy=new h("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",g({context:`The <id> argument accepts either a UUID or an email address.
339
450
 
340
- 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 479e3145-dd38-4932-8c0c-e58b548c9e76 --yes","resend contacts delete user@example.com --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals();await pe(e,!!t.yes,{confirmMessage:`Delete contact ${e}?
341
- This cannot be undone.`,spinner:{loading:"Deleting contact...",success:"Contact deleted",fail:"Failed to delete contact"},object:"contact",successMsg:"Contact deleted.",sdkCall:n=>n.contacts.remove(e)},i)});var J0=new f("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",g({output:` {
451
+ 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 479e3145-dd38-4932-8c0c-e58b548c9e76 --yes","resend contacts delete user@example.com --yes --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await I(e,Ne,i);await Me(n,!!t.yes,{confirmMessage:`Delete contact ${n}?
452
+ This cannot be undone.`,spinner:{loading:"Deleting contact...",success:"Contact deleted",fail:"Failed to delete contact"},object:"contact",successMsg:"Contact deleted.",sdkCall:s=>s.contacts.remove(n)},i)});var Oy=new h("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",g({output:` {
342
453
  "object": "contact",
343
454
  "id": "<uuid>",
344
455
  "email": "user@example.com",
@@ -347,18 +458,18 @@ This cannot be undone.`,spinner:{loading:"Deleting contact...",success:"Contact
347
458
  "created_at": "2026-01-01T00:00:00.000Z",
348
459
  "unsubscribed": false,
349
460
  "properties": {}
350
- }`,errorCodes:["auth_error","fetch_error"],examples:["resend contacts get 479e3145-dd38-4932-8c0c-e58b548c9e76","resend contacts get user@example.com","resend contacts get 479e3145-dd38-4932-8c0c-e58b548c9e76 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals();await re({spinner:{loading:"Fetching contact...",success:"Contact fetched",fail:"Failed to fetch contact"},sdkCall:n=>n.contacts.get(e),onInteractive:n=>{let s=[n.first_name,n.last_name].filter(Boolean).join(" ");console.log(`
351
- ${n.email}${s?` (${s})`:""}`),console.log(`ID: ${n.id}`),console.log(`Created: ${n.created_at}`),console.log(`Unsubscribed: ${n.unsubscribed?"yes":"no"}`);let o=Object.entries(n.properties??{});if(o.length>0){console.log("Properties:");for(let[a,u]of o)console.log(` ${a}: ${u.value}`)}}},i)});var F0=new f("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",g({context:`Contacts are global \u2014 they are not scoped to audiences or segments since the 2025 migration.
461
+ }`,errorCodes:["auth_error","fetch_error"],examples:["resend contacts get 479e3145-dd38-4932-8c0c-e58b548c9e76","resend contacts get user@example.com","resend contacts get 479e3145-dd38-4932-8c0c-e58b548c9e76 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await I(e,Ne,i);await ke({spinner:{loading:"Fetching contact...",success:"Contact fetched",fail:"Failed to fetch contact"},sdkCall:s=>s.contacts.get(n),onInteractive:s=>{let o=[s.first_name,s.last_name].filter(Boolean).join(" ");console.log(`
462
+ ${s.email}${o?` (${o})`:""}`),console.log(`ID: ${s.id}`),console.log(`Created: ${s.created_at}`),console.log(`Unsubscribed: ${s.unsubscribed?"yes":"no"}`);let a=Object.entries(s.properties??{});if(a.length>0){console.log("Properties:");for(let[l,u]of a)console.log(` ${l}: ${u.value}`)}}},i)});var xy=new h("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",g({context:`Contacts are global \u2014 they are not scoped to audiences or segments since the 2025 migration.
352
463
 
353
464
  Pagination: use --after or --before with a contact ID as the cursor.
354
465
  Only one of --after or --before may be used at a time.
355
- 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=ie(e.limit,r),n=ne(i,e.after,e.before);await L({spinner:{loading:"Fetching contacts...",success:"Contacts fetched",fail:"Failed to list contacts"},sdkCall:s=>s.contacts.list(n),onInteractive:s=>{console.log(I0(s.data)),se(s,"contacts list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var B0=new f("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",g({context:`The <contactId> argument accepts either a UUID or an email address.
356
- 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 479e3145-dd38-4932-8c0c-e58b548c9e76 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d","resend contacts remove-segment user@example.com 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --json"]})).action(async(e,t,r,i)=>{let n=i.optsWithGlobals(),s={...ar(e),segmentId:t};await W({spinner:{loading:"Removing contact from segment...",success:"Contact removed from segment",fail:"Failed to remove contact from segment"},sdkCall:o=>o.contacts.segments.remove(s),errorCode:"remove_segment_error",successMsg:`Contact removed from segment: ${t}`},n)});function ka(e){let t=e.map(r=>[r.name,r.id,r.created_at]);return V(["Name","ID","Created"],t,"(no segments)")}var H0=new f("segments").description("List the segments a contact belongs to").argument("<id>","Contact UUID or email address").addHelpText("after",g({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 479e3145-dd38-4932-8c0c-e58b548c9e76","resend contacts segments user@example.com","resend contacts segments 479e3145-dd38-4932-8c0c-e58b548c9e76 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals();await L({spinner:{loading:"Fetching segments...",success:"Segments fetched",fail:"Failed to list segments"},sdkCall:n=>n.contacts.segments.list(ar(e)),onInteractive:n=>console.log(ka(n.data))},i)});var L0=new f("topics").description("List a contact's topic subscriptions").argument("<id>","Contact UUID or email address").addHelpText("after",g({context:`The <id> argument accepts either a UUID or an email address.
466
+ 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=Ae(e.limit,r),n=Pe(i,e.after,e.before);await ue({spinner:{loading:"Fetching contacts...",success:"Contacts fetched",fail:"Failed to list contacts"},sdkCall:s=>s.contacts.list(n),onInteractive:s=>{console.log(vy(s.data)),Te(s,"contacts list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var ky=new h("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",g({context:`The <contactId> argument accepts either a UUID or an email address.
467
+ 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 479e3145-dd38-4932-8c0c-e58b548c9e76 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d","resend contacts remove-segment user@example.com 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d --json"]})).action(async(e,t,r,i)=>{let n=i.optsWithGlobals(),s=await I(e,Ne,n),o=await I(t,ur,n),a={...hi(s),segmentId:o};await le({spinner:{loading:"Removing contact from segment...",success:"Contact removed from segment",fail:"Failed to remove contact from segment"},sdkCall:l=>l.contacts.segments.remove(a),errorCode:"remove_segment_error",successMsg:`Contact removed from segment: ${o}`},n)});var Ey=new h("segments").description("List the segments a contact belongs to").argument("[id]","Contact UUID or email address").addHelpText("after",g({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 479e3145-dd38-4932-8c0c-e58b548c9e76","resend contacts segments user@example.com","resend contacts segments 479e3145-dd38-4932-8c0c-e58b548c9e76 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await I(e,Ne,i);await ue({spinner:{loading:"Fetching segments...",success:"Segments fetched",fail:"Failed to list segments"},sdkCall:s=>s.contacts.segments.list(hi(n)),onInteractive:s=>console.log(su(s.data))},i)});var Ay=new h("topics").description("List a contact's topic subscriptions").argument("[id]","Contact UUID or email address").addHelpText("after",g({context:`The <id> argument accepts either a UUID or an email address.
357
468
 
358
469
  Topics control which broadcast email types a contact receives.
359
470
  subscription values: "opt_in" (receiving) | "opt_out" (not receiving)
360
471
 
361
- 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 479e3145-dd38-4932-8c0c-e58b548c9e76","resend contacts topics user@example.com","resend contacts topics 479e3145-dd38-4932-8c0c-e58b548c9e76 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals();await L({spinner:{loading:"Fetching topic subscriptions...",success:"Topic subscriptions fetched",fail:"Failed to list topic subscriptions"},sdkCall:n=>n.contacts.topics.list(or(e)),onInteractive:n=>console.log(q0(n.data))},i)});var N0=new f("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",g({context:`The <id> argument accepts either a UUID or an email address.
472
+ 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 479e3145-dd38-4932-8c0c-e58b548c9e76","resend contacts topics user@example.com","resend contacts topics 479e3145-dd38-4932-8c0c-e58b548c9e76 --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await I(e,Ne,i);await ue({spinner:{loading:"Fetching topic subscriptions...",success:"Topic subscriptions fetched",fail:"Failed to list topic subscriptions"},sdkCall:s=>s.contacts.topics.list(fi(n)),onInteractive:s=>console.log(yy(s.data))},i)});var Py=new h("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",g({context:`The <id> argument accepts either a UUID or an email address.
362
473
 
363
474
  Subscription toggle:
364
475
  --unsubscribed Sets unsubscribed: true \u2014 contact will not receive any broadcasts.
@@ -366,7 +477,7 @@ Subscription toggle:
366
477
  Omitting both flags leaves the subscription status unchanged.
367
478
 
368
479
  Properties: --properties merges the given JSON object with existing properties.
369
- 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 479e3145-dd38-4932-8c0c-e58b548c9e76 --unsubscribed","resend contacts update user@example.com --no-unsubscribed",`resend contacts update 479e3145-dd38-4932-8c0c-e58b548c9e76 --properties '{"plan":"pro"}'`,"resend contacts update user@example.com --unsubscribed --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=wa(t.properties,i),s={...or(e),...t.unsubscribed!==void 0&&{unsubscribed:t.unsubscribed},...n&&{properties:n}};await W({spinner:{loading:"Updating contact...",success:"Contact updated",fail:"Failed to update contact"},sdkCall:o=>o.contacts.update(s),errorCode:"update_error",successMsg:`Contact updated: ${e}`},i)});G();var G0=new f("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",g({context:`The <id> argument accepts either a UUID or an email address.
480
+ 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 479e3145-dd38-4932-8c0c-e58b548c9e76 --unsubscribed","resend contacts update user@example.com --no-unsubscribed",`resend contacts update 479e3145-dd38-4932-8c0c-e58b548c9e76 --properties '{"plan":"pro"}'`,"resend contacts update user@example.com --unsubscribed --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await I(e,Ne,i),s=ou(t.properties,i),o={...fi(n),...t.unsubscribed!==void 0&&{unsubscribed:t.unsubscribed},...s&&{properties:s}};await le({spinner:{loading:"Updating contact...",success:"Contact updated",fail:"Failed to update contact"},sdkCall:a=>a.contacts.update(o),errorCode:"update_error",successMsg:`Contact updated: ${n}`},i)});ae();var Ty=new h("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",g({context:`The <id> argument accepts either a UUID or an email address.
370
481
 
371
482
  Non-interactive: --topics is required.
372
483
 
@@ -375,7 +486,7 @@ Topics JSON format:
375
486
  subscription values: "opt_in" | "opt_out"
376
487
 
377
488
  This operation replaces all topic subscriptions for the specified topics.
378
- 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 479e3145-dd38-4932-8c0c-e58b548c9e76 --topics '[{"id":"topic-uuid","subscription":"opt_in"}]'`,`resend contacts update-topics user@example.com --topics '[{"id":"t1","subscription":"opt_out"},{"id":"t2","subscription":"opt_in"}]' --json`]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await te(i),s=t.topics;if(!s){(!w()||i.json)&&v({message:"Missing --topics flag.",code:"missing_topics"},{json:i.json});let u=await N({message:`Topics JSON (e.g. '[{"id":"topic-uuid","subscription":"opt_in"}]')`,placeholder:'[{"id":"topic-uuid","subscription":"opt_in"}]',validate:c=>c?void 0:"Required"});D(u)&&j("Cancelled."),s=u}let o=$0(s,i),a=await _e({loading:"Updating topic subscriptions...",success:"Topic subscriptions updated",fail:"Failed to update topic subscriptions"},()=>n.contacts.topics.update({...or(e),topics:o}),"update_topics_error",i);!i.json&&w()?console.log(`Topic subscriptions updated for contact: ${e}`):$(a,{json:i.json})});var U0=new f("contacts").description("Manage contacts").addHelpText("after",g({context:`Contacts are global entities (not audience-scoped since the 2025 migration).
489
+ 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 479e3145-dd38-4932-8c0c-e58b548c9e76 --topics '[{"id":"topic-uuid","subscription":"opt_in"}]'`,`resend contacts update-topics user@example.com --topics '[{"id":"t1","subscription":"opt_out"},{"id":"t2","subscription":"opt_in"}]' --json`]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await I(e,Ne,i),s=await _e(i),o=t.topics;if(!o){(!D()||i.json)&&O({message:"Missing --topics flag.",code:"missing_topics"},{json:i.json});let u=await pe({message:`Topics JSON (e.g. '[{"id":"topic-uuid","subscription":"opt_in"}]')`,placeholder:'[{"id":"topic-uuid","subscription":"opt_in"}]',validate:c=>c?void 0:"Required"});B(u)&&H("Cancelled."),o=u}let a=_y(o,i),l=await at({loading:"Updating topic subscriptions...",success:"Topic subscriptions updated",fail:"Failed to update topic subscriptions"},()=>s.contacts.topics.update({...fi(n),topics:a}),"update_topics_error",i);!i.json&&D()?console.log(`Topic subscriptions updated for contact: ${n}`):X(l,{json:i.json})});var $y=new h("contacts").description("Manage contacts").addHelpText("after",g({context:`Contacts are global entities (not audience-scoped since the 2025 migration).
379
490
  Each contact is identified by a UUID or email address \u2014 both are accepted in all subcommands.
380
491
 
381
492
  Properties:
@@ -389,7 +500,7 @@ Subscription:
389
500
 
390
501
  Segments:
391
502
  Contacts can belong to multiple segments. Segments determine which contacts receive a broadcast.
392
- Manage membership with "resend contacts add-segment" and "resend contacts remove-segment".`,examples:["resend contacts list","resend contacts create --email jane@example.com --first-name Jane","resend contacts get 479e3145-dd38-4932-8c0c-e58b548c9e76","resend contacts get user@example.com","resend contacts update user@example.com --unsubscribed","resend contacts delete 479e3145-dd38-4932-8c0c-e58b548c9e76 --yes","resend contacts segments user@example.com","resend contacts add-segment user@example.com --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d","resend contacts remove-segment user@example.com 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d","resend contacts topics user@example.com",`resend contacts update-topics user@example.com --topics '[{"id":"topic-uuid","subscription":"opt_in"}]'`]})).addCommand(R0).addCommand(J0).addCommand(F0,{isDefault:!0}).addCommand(N0).addCommand(M0).addCommand(H0).addCommand(z0).addCommand(B0).addCommand(L0).addCommand(G0);Ce();Zc();G();Mr();yt();async function QC(){try{let e=await fetch(sl,{headers:{Accept:"application/vnd.github.v3+json"},signal:AbortSignal.timeout(5e3)});if(!e.ok)return{name:"CLI Version",status:"warn",message:`v${Y} (could not check for updates)`};let t=await e.json();if(t.prerelease||t.draft)return{name:"CLI Version",status:"warn",message:`v${Y} (could not check for updates)`};let r=t.tag_name?.replace(/^v/,"")??"unknown";return r===Y?{name:"CLI Version",status:"pass",message:`v${Y} (latest)`}:{name:"CLI Version",status:"warn",message:`v${Y} (latest: v${r})`,detail:"Update available"}}catch{return{name:"CLI Version",status:"warn",message:`v${Y} (could not check for updates)`}}}async function ZC(e){let t=await it(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:`${Mt(t.key)} (source: ${t.source}${r})`}}async function XC(e){let t=await it(e);if(!t)return{name:"API Validation",status:"fail",message:"Skipped \u2014 no API key"};try{let r=new er(t.key),{data:i,error:n}=await r.domains.list();if(n)return{name:"API Validation",status:"fail",message:`API key invalid: ${n.message}`};let s=i?.data??[],o=s.filter(u=>u.status==="verified"),a=s.filter(u=>u.status!=="verified");return s.length===0?{name:"Domains",status:"warn",message:"No domains configured",detail:"Add a domain at https://resend.com/domains"}:o.length===0?{name:"Domains",status:"warn",message:`${a.length} domain(s) pending verification`,detail:s.map(u=>`${u.name} (${u.status})`).join(", ")}:{name:"Domains",status:"pass",message:`${o.length} verified, ${a.length} pending`,detail:s.map(u=>`${u.name} (${u.status})`).join(", ")}}catch(r){return{name:"API Validation",status:"fail",message:U(r,"Failed to validate API key")}}}var Z0=new f("doctor").description("Check CLI version, API key, and domain status").addHelpText("after",g({setup:!0,context:`Checks performed:
503
+ Manage membership with "resend contacts add-segment" and "resend contacts remove-segment".`,examples:["resend contacts list","resend contacts create --email jane@example.com --first-name Jane","resend contacts get 479e3145-dd38-4932-8c0c-e58b548c9e76","resend contacts get user@example.com","resend contacts update user@example.com --unsubscribed","resend contacts delete 479e3145-dd38-4932-8c0c-e58b548c9e76 --yes","resend contacts segments user@example.com","resend contacts add-segment user@example.com --segment-id 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d","resend contacts remove-segment user@example.com 7b1e0a3d-4c5f-4e8a-9b2d-1a3c5e7f9b2d","resend contacts topics user@example.com",`resend contacts update-topics user@example.com --topics '[{"id":"topic-uuid","subscription":"opt_in"}]'`]})).addCommand(Cy).addCommand(Oy).addCommand(xy,{isDefault:!0}).addCommand(Py).addCommand(Sy).addCommand(Ey).addCommand(wy).addCommand(ky).addCommand(Ay).addCommand(Ty);We();jd();ae();nn();fr();async function Mk(){try{let e=await fetch(Kd,{headers:{Accept:"application/vnd.github.v3+json"},signal:AbortSignal.timeout(5e3)});if(!e.ok)return{name:"CLI Version",status:"warn",message:`v${ve} (could not check for updates)`};let t=await e.json();if(t.prerelease||t.draft)return{name:"CLI Version",status:"warn",message:`v${ve} (could not check for updates)`};let r=t.tag_name?.replace(/^v/,"")??"unknown";return r===ve?{name:"CLI Version",status:"pass",message:`v${ve} (latest)`}:{name:"CLI Version",status:"warn",message:`v${ve} (latest: v${r})`,detail:"Update available"}}catch{return{name:"CLI Version",status:"warn",message:`v${ve} (could not check for updates)`}}}async function zk(e){let t=await Dr(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:`${jr(t.key)} (source: ${t.source}${r})`}}async function Fk(e){let t=await Dr(e);if(!t)return{name:"API Validation",status:"fail",message:"Skipped \u2014 no API key"};try{let r=new ti(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:ri}:{name:"API Validation",status:"fail",message:`API key invalid: ${n.message}`};let s=i?.data??[],o=s.filter(l=>l.status==="verified"),a=s.filter(l=>l.status!=="verified");return s.length===0?{name:"Domains",status:"warn",message:"No domains configured",detail:"Add a domain at https://resend.com/domains"}:o.length===0?{name:"Domains",status:"warn",message:`${a.length} domain(s) pending verification`,detail:s.map(l=>`${l.name} (${l.status})`).join(", ")}:{name:"Domains",status:"pass",message:`${o.length} verified, ${a.length} pending`,detail:s.map(l=>`${l.name} (${l.status})`).join(", ")}}catch(r){return{name:"API Validation",status:"fail",message:ne(r,"Failed to validate API key")}}}var My=new h("doctor").description("Check CLI version, API key, and domain status").addHelpText("after",g({setup:!0,context:`Checks performed:
393
504
  CLI Version Is the installed version up to date?
394
505
  API Key Is a key present (--api-key, RESEND_API_KEY, or credentials file)?
395
506
  Credential Storage Which backend is storing credentials (secure storage vs plaintext file)?
@@ -402,23 +513,26 @@ Segments:
402
513
  ]
403
514
  }
404
515
  status values: "pass" | "warn" | "fail"
405
- 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=w()&&!r.json;n&&console.log(`
516
+ 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=D()&&!r.json;n&&console.log(`
406
517
  Resend Doctor
407
- `);let s=n?$e("Checking CLI version..."):null,o=await QC();i.push(o),o.status==="warn"?s?.warn(o.message):s?.stop(o.message),s=n?$e("Checking API key..."):null;let a=await ZC(r.apiKey);i.push(a),a.status==="fail"?s?.fail(a.message):s?.stop(a.message),s=n?$e("Checking credential storage..."):null;let u=await rt(),c=he(),d=u.isSecure,l={name:"Credential Storage",status:d?"pass":"warn",message:d?u.name:"plaintext file",...!d&&process.env.RESEND_CREDENTIAL_STORE!=="file"&&(c?.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(l),l.status==="warn"?s?.warn(l.message):s?.stop(l.message),s=n?$e("Validating API key & domains..."):null;let p=await XC(r.apiKey);i.push(p),p.status==="fail"?s?.fail(p.message):p.status==="warn"?s?.warn(p.message):s?.stop(p.message);let y=i.some(h=>h.status==="fail");!r.json&&w()?console.log(""):$({ok:!y,checks:i},{json:r.json}),y&&process.exit(1)});function Ta(e,t){let r=e.map(i=>{let n=i.name?i.name.includes(".")?i.name:`${i.name}.${t}`:t;return[i.type,n,i.ttl,i.value]});return V(["Type","Name","TTL","Value"],r,"(no DNS records)")}function X0(e){let t=e.map(r=>[r.name,r.status,r.region,r.id]);return V(["Name","Status","Region","ID"],t,"(no domains)")}function e2(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 t2=new f("create").description("Create a new domain and receive DNS records to configure").option("--name <domain>","Domain name (e.g. example.com)").addOption(new be("--region <region>","Sending region").choices(["us-east-1","eu-west-1","sa-east-1","ap-northeast-1"])).addOption(new be("--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",g({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 de(e.name,{message:"Domain name",placeholder:"example.com"},{message:"Missing --name flag.",code:"missing_name"},r);await Z({spinner:{loading:"Creating domain...",success:"Domain created",fail:"Failed to create 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(`
518
+ `);let s=n?De("Checking CLI version..."):null,o=await Mk();i.push(o),o.status==="warn"?s?.warn(o.message):s?.stop(o.message),s=n?De("Checking API key..."):null;let a=await zk(r.apiKey);i.push(a),a.status==="fail"?s?.fail(a.message):s?.stop(a.message),s=n?De("Checking credential storage..."):null;let l=await Lt(),u=Be(),c=l.isSecure,d={name:"Credential Storage",status:c?"pass":"warn",message:c?l.name:"plaintext file",...!c&&process.env.RESEND_CREDENTIAL_STORE!=="file"&&(u?.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"?s?.warn(d.message):s?.stop(d.message),s=n?De("Validating API key & domains..."):null;let p=await Fk(r.apiKey);i.push(p),p.status==="fail"?s?.fail(p.message):p.status==="warn"?s?.warn(p.message):s?.stop(p.message);let v=i.some(f=>f.status==="fail");!r.json&&D()?console.log(""):X({ok:!v,checks:i},{json:r.json}),v&&process.exit(1)});ae();var Qd=Nt?String.fromCodePoint(9472):"-";function uu(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[`${Qd}${Qd} ${i.type} ${Qd.repeat(40)}`,` Name ${n}`,` TTL ${i.ttl}`,` Value ${i.value}`].join(`
519
+ `)}).join(`
520
+
521
+ `)}function zy(e){let t=e.map(r=>[r.name,r.status,r.region,r.id]);return he(["Name","Status","Region","ID"],t,"(no domains)")}function Fy(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 cr={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 Jy=new h("create").description("Create a new domain and receive DNS records to configure").option("--name <domain>","Domain name (e.g. example.com)").addOption(new Le("--region <region>","Sending region").choices(["us-east-1","eu-west-1","sa-east-1","ap-northeast-1"])).addOption(new Le("--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",g({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 Re(e.name,{message:"Domain name",placeholder:"example.com"},{message:"Missing --name flag.",code:"missing_name"},r);await we({spinner:{loading:"Creating domain...",success:"Domain created",fail:"Failed to create 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(`
408
522
  Domain created: ${n.name} (id: ${n.id})`),console.log(`
409
- DNS Records to configure:`),console.log(Ta(n.records,n.name)),console.log(`
410
- Run \`resend domains verify ${n.id}\` after configuring DNS.`)}},r)});var r2=new f("delete").alias("rm").description("Delete a domain").argument("<id>","Domain ID").option("--yes","Skip confirmation prompt").addHelpText("after",g({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();await pe(e,!!t.yes,{confirmMessage:`Delete domain ${e}?
411
- This cannot be undone.`,spinner:{loading:"Deleting domain...",success:"Domain deleted",fail:"Failed to delete domain"},object:"domain",successMsg:"Domain deleted.",sdkCall:n=>n.domains.remove(e)},i)});var i2=new f("get").description("Retrieve a domain with its DNS records and current verification status").argument("<id>","Domain ID").addHelpText("after",g({output:` Full domain object including records array and current status.
412
-
413
- 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();await re({spinner:{loading:"Fetching domain...",success:"Domain fetched",fail:"Failed to fetch domain"},sdkCall:n=>n.domains.get(e),onInteractive:n=>{console.log(`
414
- ${n.name} \u2014 ${e2(n.status)}`),console.log(`ID: ${n.id}`),console.log(`Region: ${n.region}`),console.log(`Created: ${n.created_at}`),n.records.length>0&&(console.log(`
415
- DNS Records:`),console.log(Ta(n.records,n.name)))}},i)});var n2=new f("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",g({output:` {"object":"list","data":[...],"has_more":true}
416
- 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=ie(e.limit,r),n=ne(i,e.after,e.before);await L({spinner:{loading:"Fetching domains...",success:"Domains fetched",fail:"Failed to list domains"},sdkCall:s=>s.domains.list(n),onInteractive:s=>{console.log(X0(s.data)),se(s,"domains list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var s2=new f("update").description("Update domain settings: TLS mode, open tracking, and click tracking").argument("<id>","Domain ID").addOption(new be("--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",g({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(),{tls:n,openTracking:s,clickTracking:o}=t;!n&&s===void 0&&o===void 0&&v({message:"Provide at least one option to update: --tls, --open-tracking, or --click-tracking.",code:"no_changes"},{json:i.json});let a={id:e};n&&(a.tls=n),s!==void 0&&(a.openTracking=s),o!==void 0&&(a.clickTracking=o),await W({spinner:{loading:"Updating domain...",success:"Domain updated",fail:"Failed to update domain"},sdkCall:u=>u.domains.update(a),errorCode:"update_error",successMsg:`Domain updated: ${e}`},i)});var o2=new f("verify").description("Trigger async DNS verification for a domain").argument("<id>","Domain ID").addHelpText("after",g({context:`Verification is async \u2014 the domain enters "pending" status while DNS records are checked.
417
- 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();await W({spinner:{loading:"Verifying domain...",success:"Verification started",fail:"Failed to verify domain"},sdkCall:n=>n.domains.verify(e),errorCode:"verify_error",successMsg:`Domain verification started. Check status with resend domains get ${e}.`},i)});var a2=new f("domains").description("Manage verified sending and receiving domains").addHelpText("after",g({context:`Domain lifecycle:
523
+ DNS Records to configure:`),console.log(uu(n.records,n.name)),console.log(`
524
+ Run \`resend domains verify ${n.id}\` after configuring DNS.`)}},r)});var By=new h("delete").alias("rm").description("Delete a domain").argument("[id]","Domain ID").option("--yes","Skip confirmation prompt").addHelpText("after",g({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 I(e,cr,i);await Me(n,!!t.yes,{confirmMessage:`Delete domain ${n}?
525
+ This cannot be undone.`,spinner:{loading:"Deleting domain...",success:"Domain deleted",fail:"Failed to delete domain"},object:"domain",successMsg:"Domain deleted.",sdkCall:s=>s.domains.remove(n)},i)});var Hy=new h("get").description("Retrieve a domain with its DNS records and current verification status").argument("[id]","Domain ID").addHelpText("after",g({output:` Full domain object including records array and current status.
526
+
527
+ 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 I(e,cr,i);await ke({spinner:{loading:"Fetching domain...",success:"Domain fetched",fail:"Failed to fetch domain"},sdkCall:s=>s.domains.get(n),onInteractive:s=>{console.log(`
528
+ ${s.name} \u2014 ${Fy(s.status)}`),console.log(`ID: ${s.id}`),console.log(`Region: ${s.region}`),console.log(`Created: ${s.created_at}`),s.records.length>0&&(console.log(`
529
+ DNS Records:`),console.log(uu(s.records,s.name)))}},i)});var Ly=new h("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",g({output:` {"object":"list","data":[...],"has_more":true}
530
+ 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=Ae(e.limit,r),n=Pe(i,e.after,e.before);await ue({spinner:{loading:"Fetching domains...",success:"Domains fetched",fail:"Failed to list domains"},sdkCall:s=>s.domains.list(n),onInteractive:s=>{console.log(zy(s.data)),Te(s,"domains list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Ny=new h("update").description("Update domain settings: TLS mode, open tracking, and click tracking").argument("[id]","Domain ID").addOption(new Le("--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",g({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 I(e,cr,i),{tls:s,openTracking:o,clickTracking:a}=t;!s&&o===void 0&&a===void 0&&O({message:"Provide at least one option to update: --tls, --open-tracking, or --click-tracking.",code:"no_changes"},{json:i.json});let l={id:n};s&&(l.tls=s),o!==void 0&&(l.openTracking=o),a!==void 0&&(l.clickTracking=a),await le({spinner:{loading:"Updating domain...",success:"Domain updated",fail:"Failed to update domain"},sdkCall:u=>u.domains.update(l),errorCode:"update_error",successMsg:`Domain updated: ${n}`},i)});var Gy=new h("verify").description("Trigger async DNS verification for a domain").argument("[id]","Domain ID").addHelpText("after",g({context:`Verification is async \u2014 the domain enters "pending" status while DNS records are checked.
531
+ 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 I(e,cr,i);await le({spinner:{loading:"Verifying domain...",success:"Verification started",fail:"Failed to verify domain"},sdkCall:s=>s.domains.verify(n),errorCode:"verify_error",successMsg:`Domain verification started. Check status with resend domains get ${n}.`},i)});var Uy=new h("domains").description("Manage verified sending and receiving domains").addHelpText("after",g({context:`Domain lifecycle:
418
532
  1. resend domains create --name example.com (get DNS records)
419
533
  2. Configure DNS records at your DNS provider
420
534
  3. resend domains verify <id> (trigger verification)
421
- 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(t2).addCommand(o2).addCommand(i2).addCommand(n2,{isDefault:!0}).addCommand(s2).addCommand(r2);G();var u2=new f("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("--idempotency-key <key>","Deduplicate this batch request using this key").addOption(new be("--batch-validation <mode>","Validation mode: strict (default, fail all on error) or permissive (partial success)").choices(["strict","permissive"])).addHelpText("after",g({context:`Non-interactive: --file
535
+ 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(Jy).addCommand(Gy).addCommand(Hy).addCommand(Ly,{isDefault:!0}).addCommand(Ny).addCommand(By);ae();var Wy=new h("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").option("--idempotency-key <key>","Deduplicate this batch request using this key").addOption(new Le("--batch-validation <mode>","Validation mode: strict (default, fail all on error) or permissive (partial success)").choices(["strict","permissive"])).addHelpText("after",g({context:`Non-interactive: --file
422
536
  Limit: 100 emails per request (API hard limit \u2014 warned if exceeded)
423
537
  Unsupported per-email fields: attachments, scheduled_at
424
538
 
@@ -426,68 +540,68 @@ File format (--file path):
426
540
  [
427
541
  {"from":"you@domain.com","to":["user@example.com"],"subject":"Hello","text":"Hi"},
428
542
  {"from":"you@domain.com","to":["other@example.com"],"subject":"Hello","html":"<b>Hi</b>"}
429
- ]`,output:' [{"id":"<email-id>"},{"id":"<email-id>"}]',errorCodes:["auth_error","missing_file","file_read_error","stdin_read_error","invalid_json","invalid_format","batch_error"],examples:["resend emails batch --file ./emails.json","resend emails batch --file ./emails.json --json","resend emails batch --file ./emails.json --idempotency-key my-batch-2026-02-18","resend emails batch --file ./emails.json --batch-validation permissive",`echo '[{"from":"you@domain.com","to":["user@example.com"],"subject":"Hi","text":"Hello"}]' | resend emails batch --file -`,"RESEND_API_KEY=re_123 resend emails batch --file ./emails.json --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await te(r),n=await de(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),s=ge(n,r),o;try{o=JSON.parse(s)}catch{v({message:"File content is not valid JSON.",code:"invalid_json"},{json:r.json})}Array.isArray(o)||v({message:"File content must be a JSON array of email objects.",code:"invalid_format"},{json:r.json});let a=o;a.length>100&&console.warn(`Warning: ${a.length} emails exceeds the 100-email limit. The API may reject this request.`);for(let l=0;l<a.length;l++){let p=a[l];"attachments"in p&&v({message:`Email at index ${l} contains "attachments", which is not supported in batch sends.`,code:"batch_error"},{json:r.json}),"scheduled_at"in p&&v({message:`Email at index ${l} contains "scheduled_at", which is not supported in batch sends.`,code:"batch_error"},{json:r.json})}let u=await _e({loading:"Sending batch...",success:"Batch sent",fail:"Failed to send batch"},()=>{let l={...e.idempotencyKey&&{idempotencyKey:e.idempotencyKey},...e.batchValidation&&{batchValidation:e.batchValidation}};return i.batch.send(a,Object.keys(l).length>0?l:void 0)},"batch_error",r),c=u.data,d=u.errors;if(!r.json&&w()){console.log(`Sent ${c.length} email${c.length===1?"":"s"}`);for(let l of c)console.log(` ${l.id}`);if(d&&d.length>0){console.warn(`
430
- ${d.length} email${d.length===1?"":"s"} failed:`);for(let l of d)console.warn(` [${l.index}] ${l.message}`)}}else $(d&&d.length>0?{data:c,errors:d}:c,{json:r.json})});var c2=new f("cancel").description("Cancel a scheduled email").argument("<id>","Email ID").addHelpText("after",g({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();await W({spinner:{loading:"Cancelling email...",success:"Email cancelled",fail:"Failed to cancel email"},sdkCall:n=>n.emails.cancel(e),errorCode:"cancel_error",successMsg:`
431
- Email cancelled: ${e}`},i)});var l2=new f("get").description("Retrieve a sent email by ID").argument("<id>","Email ID").addHelpText("after",g({output:' {"object":"email","id":"<uuid>","from":"you@domain.com","to":["user@example.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();await re({spinner:{loading:"Fetching email...",success:"Email fetched",fail:"Failed to fetch email"},sdkCall:n=>n.emails.get(e),onInteractive:n=>{console.log(`
432
- From: ${n.from}`),console.log(`To: ${n.to.join(", ")}`),console.log(`Subject: ${n.subject}`),console.log(`Status: ${n.last_event}`),console.log(`Date: ${n.created_at}`),n.scheduled_at&&console.log(`Scheduled: ${n.scheduled_at}`)}},i)});function eS(e){let t=e.map(r=>{let i=r.to.join(", "),n=i.length>40?`${i.slice(0,37)}...`:i,s=r.subject.length>50?`${r.subject.slice(0,47)}...`:r.subject;return[r.from,n,s,r.last_event??"\u2014",r.created_at,r.id]});return V(["From","To","Subject","Status","Created","ID"],t,"(no sent emails)")}var d2=new f("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",g({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=ie(e.limit,r),n=ne(i,e.after,e.before);await L({spinner:{loading:"Fetching sent emails...",success:"Sent emails fetched",fail:"Failed to list emails"},sdkCall:s=>s.emails.list(n),onInteractive:s=>{console.log(eS(s.data)),se(s,"emails list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});G();var p2=new f("attachment").description("Retrieve a single attachment from a received (inbound) email").argument("<emailId>","Received email UUID").argument("<attachmentId>","Attachment UUID").addHelpText("after",g({context:`The download_url is a signed URL that expires in ~1 hour. Download the file directly:
433
- 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(),s=await te(n),o=await _e({loading:"Fetching attachment...",success:"Attachment fetched",fail:"Failed to fetch attachment"},()=>s.emails.receiving.attachments.get({emailId:e,id:t}),"fetch_error",n);if(!n.json&&w()){let a=o;console.log(`
434
- ${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}`)}else $(o,{json:n.json})});function m2(e){let t=e.map(r=>{let i=r.to.join(", "),n=i.length>40?`${i.slice(0,37)}...`:i,s=r.subject.length>50?`${r.subject.slice(0,47)}...`:r.subject;return[r.from,n,s,r.created_at,r.id]});return V(["From","To","Subject","Created At","ID"],t,"(no received emails)")}function f2(e){let t=e.map(r=>[r.filename??"(unnamed)",r.content_type,String(r.size),r.id]);return V(["Filename","Content-Type","Size (bytes)","ID"],t,"(no attachments)")}var h2=new f("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",g({context:`Each attachment has a download_url (signed, expires ~1 hour).
543
+ ]`,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 --json","resend emails batch --file ./emails.json --idempotency-key my-batch-2026-02-18","resend emails batch --file ./emails.json --batch-validation permissive",`echo '[{"from":"you@domain.com","to":["user@example.com"],"subject":"Hi","text":"Hello"}]' | resend emails batch --file -`,"RESEND_API_KEY=re_123 resend emails batch --file ./emails.json --json"]})).action(async(e,t)=>{let r=t.optsWithGlobals(),i=await _e(r,{permission:"sending_access"}),n=await Re(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),s=He(n,r),o;try{o=JSON.parse(s)}catch{O({message:"File content is not valid JSON.",code:"invalid_json"},{json:r.json})}Array.isArray(o)||O({message:"File content must be a JSON array of email objects.",code:"invalid_format"},{json:r.json});let a=o;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 p of a)p.html=d}for(let d=0;d<a.length;d++){let p=a[d];(p===null||typeof p!="object"||Array.isArray(p))&&O({message:`Email at index ${d} must be a JSON object.`,code:"invalid_format"},{json:r.json}),"attachments"in p&&O({message:`Email at index ${d} contains "attachments", which is not supported in batch sends.`,code:"batch_error"},{json:r.json}),"scheduled_at"in p&&O({message:`Email at index ${d} contains "scheduled_at", which is not supported in batch sends.`,code:"batch_error"},{json:r.json})}let l=await at({loading:"Sending batch...",success:"Batch sent",fail:"Failed to send 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),u=l.data,c=l.errors;if(!r.json&&D()){console.log(`Sent ${u.length} email${u.length===1?"":"s"}`);for(let d of u)console.log(` ${d.id}`);if(c&&c.length>0){console.warn(`
544
+ ${c.length} email${c.length===1?"":"s"} failed:`);for(let d of c)console.warn(` [${d.index}] ${d.message}`)}}else X(c&&c.length>0?{data:u,errors:c}:u,{json:r.json})});var bi={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})};var Vy=new h("cancel").description("Cancel a scheduled email").argument("[id]","Email ID").addHelpText("after",g({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 I(e,bi,i);await le({spinner:{loading:"Cancelling email...",success:"Email cancelled",fail:"Failed to cancel email"},sdkCall:s=>s.emails.cancel(n),errorCode:"cancel_error",successMsg:`
545
+ Email cancelled: ${n}`},i)});var Ky=new h("get").description("Retrieve a sent email by ID").argument("[id]","Email ID").addHelpText("after",g({output:' {"object":"email","id":"<uuid>","from":"you@domain.com","to":["user@example.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 I(e,bi,i);await ke({spinner:{loading:"Fetching email...",success:"Email fetched",fail:"Failed to fetch email"},sdkCall:s=>s.emails.get(n),onInteractive:s=>{console.log(`
546
+ From: ${s.from}`),console.log(`To: ${s.to.join(", ")}`),console.log(`Subject: ${s.subject}`),console.log(`Status: ${s.last_event}`),console.log(`Date: ${s.created_at}`),s.scheduled_at&&console.log(`Scheduled: ${s.scheduled_at}`)}},i)});function Jk(e){let t=e.map(r=>{let i=r.to.join(", "),n=i.length>40?`${i.slice(0,37)}...`:i,s=r.subject.length>50?`${r.subject.slice(0,47)}...`:r.subject;return[r.from,n,s,r.last_event??"\u2014",r.created_at,r.id]});return he(["From","To","Subject","Status","Created","ID"],t,"(no sent emails)")}var Yy=new h("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",g({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=Ae(e.limit,r),n=Pe(i,e.after,e.before);await ue({spinner:{loading:"Fetching sent emails...",success:"Sent emails fetched",fail:"Failed to list emails"},sdkCall:s=>s.emails.list(n),onInteractive:s=>{console.log(Jk(s.data)),Te(s,"emails list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});ae();var Qy=new h("attachment").description("Retrieve a single attachment from a received (inbound) email").argument("<emailId>","Received email UUID").argument("<attachmentId>","Attachment UUID").addHelpText("after",g({context:`The download_url is a signed URL that expires in ~1 hour. Download the file directly:
547
+ 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(),s=await _e(n),o=await at({loading:"Fetching attachment...",success:"Attachment fetched",fail:"Failed to fetch attachment"},()=>s.emails.receiving.attachments.get({emailId:e,id:t}),"fetch_error",n);if(!n.json&&D()){let a=o;console.log(`
548
+ ${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}`)}else X(o,{json:n.json})});var vi={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 Zy(e){let t=e.map(r=>{let i=r.to.join(", "),n=i.length>40?`${i.slice(0,37)}...`:i,s=r.subject.length>50?`${r.subject.slice(0,47)}...`:r.subject;return[r.from,n,s,r.created_at,r.id]});return he(["From","To","Subject","Created At","ID"],t,"(no received emails)")}function Xy(e){let t=e.map(r=>[r.filename??"(unnamed)",r.content_type,String(r.size),r.id]);return he(["Filename","Content-Type","Size (bytes)","ID"],t,"(no attachments)")}var e_=new h("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",g({context:`Each attachment has a download_url (signed, expires ~1 hour).
435
549
  Use the attachment sub-command to retrieve a single attachment with its download URL:
436
550
  resend emails receiving attachment <emailId> <attachmentId>
437
551
 
438
552
  content_disposition: "inline" means the attachment is embedded in the HTML body (e.g. an image).
439
- 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=ie(t.limit,i),s=ne(n,t.after,t.before);await L({spinner:{loading:"Fetching attachments...",success:"Attachments fetched",fail:"Failed to list attachments"},sdkCall:o=>o.emails.receiving.attachments.list({emailId:e,...s}),onInteractive:o=>{console.log(f2(o.data)),se(o,`emails receiving attachments ${e}`,{limit:n,before:t.before,apiKey:i.apiKey,profile:i.profile})}},i)});var g2=new f("forward").description("Forward a received email").argument("<id>","Received email ID").requiredOption("--to <addresses...>","Recipient address(es)").requiredOption("--from <address>","Sender address").addHelpText("after",g({context:`Required: --to, --from
440
- Forwards the original email content (passthrough mode).`,output:' {"id":"<email-id>"}',errorCodes:["auth_error","create_error"],examples:["resend emails receiving forward <email-id> --to user@example.com --from you@domain.com","resend emails receiving forward <email-id> --to a@example.com --to b@example.com --from you@domain.com --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals();await Z({spinner:{loading:"Forwarding email...",success:"Email forwarded",fail:"Failed to forward email"},sdkCall:n=>n.emails.receiving.forward({emailId:e,to:t.to,from:t.from}),onInteractive:n=>{console.log(`
441
- Email forwarded: ${n.id}`)}},i)});var b2=new f("get").description("Retrieve a single received (inbound) email with full details including HTML, text, and headers").argument("<id>","Received email UUID").addHelpText("after",g({context:`The raw.download_url field is a signed URL (expires ~1 hour) containing the full RFC 2822
553
+ 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 I(e,vi,i),s=Ae(t.limit,i),o=Pe(s,t.after,t.before);await ue({spinner:{loading:"Fetching attachments...",success:"Attachments fetched",fail:"Failed to list attachments"},sdkCall:a=>a.emails.receiving.attachments.list({emailId:n,...o}),onInteractive:a=>{console.log(Xy(a.data)),Te(a,`emails receiving attachments ${n}`,{limit:s,before:t.before,apiKey:i.apiKey,profile:i.profile})}},i)});var t_=new h("forward").description("Forward a received email").argument("[id]","Received email ID").requiredOption("--to <addresses...>","Recipient address(es)").requiredOption("--from <address>","Sender address").addHelpText("after",g({context:`Required: --to, --from
554
+ Forwards the original email content (passthrough mode).`,output:' {"id":"<email-id>"}',errorCodes:["auth_error","create_error"],examples:["resend emails receiving forward <email-id> --to user@example.com --from you@domain.com","resend emails receiving forward <email-id> --to a@example.com --to b@example.com --from you@domain.com --json"]})).action(async(e,t,r)=>{let i=r.optsWithGlobals(),n=await I(e,vi,i);await we({spinner:{loading:"Forwarding email...",success:"Email forwarded",fail:"Failed to forward email"},sdkCall:s=>s.emails.receiving.forward({emailId:n,to:t.to,from:t.from}),onInteractive:s=>{console.log(`
555
+ Email forwarded: ${s.id}`)}},i)});var r_=new h("get").description("Retrieve a single received (inbound) email with full details including HTML, text, and headers").argument("[id]","Received email UUID").addHelpText("after",g({context:`The raw.download_url field is a signed URL (expires ~1 hour) containing the full RFC 2822
442
556
  MIME message. Pipe it to curl to save the original email:
443
557
  resend emails receiving get <id> --json | jq -r .raw.download_url | xargs curl > email.eml
444
558
 
445
559
  Attachments are listed in the attachments array. Use the attachments sub-command to get
446
560
  download URLs:
447
- 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();await re({spinner:{loading:"Fetching received email...",success:"Received email fetched",fail:"Failed to fetch received email"},sdkCall:n=>n.emails.receiving.get(e),onInteractive:n=>{if(console.log(`
448
- From: ${n.from}`),console.log(`To: ${n.to.join(", ")}`),console.log(`Subject: ${n.subject}`),console.log(`Date: ${n.created_at}`),n.attachments.length>0&&console.log(`Files: ${n.attachments.length} attachment(s)`),n.text){let s=n.text.length>200?`${n.text.slice(0,197)}...`:n.text;console.log(`
449
- ${s}`)}else n.html&&console.log(`
450
- (HTML body only \u2014 use --json to view or pipe to a browser)`)}},i)});var v2=new f("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",g({context:`Receiving must be enabled on the domain first:
561
+ 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 I(e,vi,i);await ke({spinner:{loading:"Fetching received email...",success:"Received email fetched",fail:"Failed to fetch received email"},sdkCall:s=>s.emails.receiving.get(n),onInteractive:s=>{if(console.log(`
562
+ From: ${s.from}`),console.log(`To: ${s.to.join(", ")}`),console.log(`Subject: ${s.subject}`),console.log(`Date: ${s.created_at}`),s.attachments.length>0&&console.log(`Files: ${s.attachments.length} attachment(s)`),s.text){let o=s.text.length>200?`${s.text.slice(0,197)}...`:s.text;console.log(`
563
+ ${o}`)}else s.html&&console.log(`
564
+ (HTML body only \u2014 use --json to view or pipe to a browser)`)}},i)});var i_=new h("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",g({context:`Receiving must be enabled on the domain first:
451
565
  resend domains update <id> --receiving enabled
452
566
 
453
567
  Pagination: use --after or --before with a received email ID as the cursor.
454
568
  Only one of --after or --before may be used at a time.
455
- 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=ie(e.limit,r),n=ne(i,e.after,e.before);await L({spinner:{loading:"Fetching received emails...",success:"Received emails fetched",fail:"Failed to list received emails"},sdkCall:s=>s.emails.receiving.list(n),onInteractive:s=>{console.log(m2(s.data)),se(s,"emails receiving list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Ft=oe(st(),1);G();var tS=100;function _2(){return new Date().toLocaleTimeString("en-GB",{hour12:!1})}function rS(e,t){if(t)console.log(JSON.stringify(e));else{let r=e.to.join(", "),i=Ft.default.dim(`[${_2()}]`),n=e.subject.length>50?`${e.subject.slice(0,47)}...`:e.subject;process.stderr.write(`${i} ${e.from} -> ${r} ${Ft.default.bold(`"${n}"`)} ${Ft.default.dim(e.id)}
456
- `)}}var y2=new f("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",g({context:`Long-running command that polls the receiving API at a fixed
569
+ 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=Ae(e.limit,r),n=Pe(i,e.after,e.before);await ue({spinner:{loading:"Fetching received emails...",success:"Received emails fetched",fail:"Failed to list received emails"},sdkCall:s=>s.emails.receiving.list(n),onInteractive:s=>{console.log(Zy(s.data)),Te(s,"emails receiving list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var Jr=me(Kt(),1);ae();var Bk=100;function n_(){return new Date().toLocaleTimeString("en-GB",{hour12:!1})}function Hk(e,t){if(t)console.log(JSON.stringify(e));else{let r=e.to.join(", "),i=Jr.default.dim(`[${n_()}]`),n=e.subject.length>50?`${e.subject.slice(0,47)}...`:e.subject;process.stderr.write(`${i} ${e.from} -> ${r} ${Jr.default.bold(`"${n}"`)} ${Jr.default.dim(e.id)}
570
+ `)}}var s_=new h("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",g({context:`Long-running command that polls the receiving API at a fixed
457
571
  interval and prints each new email as it arrives.
458
572
 
459
573
  Interactive output shows one line per email. When piped (or with --json),
460
574
  output is NDJSON (one JSON object per line).
461
575
 
462
- 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 te(r),s=r.json||!w(),o=$e("Connecting...",r.quiet||s),a=new Set,u=0;try{let{data:y,error:h}=await n.emails.receiving.list({limit:1});(h||!y)&&(o.fail("Failed to connect"),v({message:h?.message??"Unexpected empty response",code:"list_error"},{json:r.json}));for(let b of y.data)a.add(b.id);o.stop("Ready")}catch(y){o.fail("Failed to connect"),v({message:U(y,"Unknown error"),code:"list_error"},{json:r.json})}s||(process.stderr.write(`
463
- `),process.stderr.write(` ${Ft.default.bold("Polling:")} every ${i}s
576
+ 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)&&O({message:"Polling interval must be at least 2 seconds.",code:"invalid_interval"},{json:r.json});let n=await _e(r),s=r.json||!D(),o=De("Connecting...",r.quiet||s),a=new Set,l=0;try{let{data:v,error:f}=await n.emails.receiving.list({limit:1});(f||!v)&&(o.fail("Failed to connect"),O({message:f?.message??"Unexpected empty response",code:"list_error"},{json:r.json}));for(let b of v.data)a.add(b.id);o.stop("Ready")}catch(v){o.fail("Failed to connect"),O({message:ne(v,"Unknown error"),code:"list_error"},{json:r.json})}s||(process.stderr.write(`
577
+ `),process.stderr.write(` ${Jr.default.bold("Polling:")} every ${i}s
464
578
  `),process.stderr.write(`
465
579
  Listening for new inbound emails. Press Ctrl+C to stop.
466
580
 
467
- `));function c(y){u++,s||process.stderr.write(`${Ft.default.dim(`[${_2()}]`)} ${Ft.default.yellow("Warning:")} ${y}
468
- `),u>=5&&v({message:"Exiting after 5 consecutive API failures.",code:"poll_error"},{json:r.json})}let d;async function l(){try{let y=[],h,b=!0;for(;b;){let C={limit:tS};h&&(C.after=h);let{data:S,error:O}=await n.emails.receiving.list(C);if(O||!S){c(O?.message??"Empty response");return}let k=!1;for(let T of S.data){if(a.has(T.id)){k=!0;break}y.push(T)}k||!S.has_more?b=!1:h=S.data[S.data.length-1]?.id}u=0;for(let C of y)a.add(C.id);for(let C of y.reverse())rS(C,s)}catch(y){c(U(y,"Unknown error"))}finally{d=setTimeout(l,i*1e3)}}d=setTimeout(l,i*1e3);let p=()=>{clearTimeout(d),s||process.stderr.write(`
581
+ `));function u(v){l++,s||process.stderr.write(`${Jr.default.dim(`[${n_()}]`)} ${Jr.default.yellow("Warning:")} ${v}
582
+ `),l>=5&&O({message:"Exiting after 5 consecutive API failures.",code:"poll_error"},{json:r.json})}let c;async function d(){try{let v=[],f,b=!0;for(;b;){let S={limit:Bk};f&&(S.after=f);let{data:T,error:x}=await n.emails.receiving.list(S);if(x||!T){u(x?.message??"Empty response");return}let E=!1;for(let k of T.data){if(a.has(k.id)){E=!0;break}v.push(k)}E||!T.has_more?b=!1:f=T.data[T.data.length-1]?.id}l=0;for(let S of v)a.add(S.id);for(let S of v.reverse())Hk(S,s)}catch(v){u(ne(v,"Unknown error"))}finally{c=setTimeout(d,i*1e3)}}c=setTimeout(d,i*1e3);let p=()=>{clearTimeout(c),s||process.stderr.write(`
469
583
  Stopped listening.
470
- `),process.exit(nr())};ya(p),process.on("SIGTERM",p),await new Promise(()=>{})});var O2=new f("receiving").description("Manage received (inbound) emails \u2014 requires domain receiving to be enabled").addHelpText("after",g({context:`Receiving must be enabled on the domain first:
471
- 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 user@example.com --from you@domain.com"]})).addCommand(v2,{isDefault:!0}).addCommand(b2).addCommand(y2).addCommand(h2).addCommand(p2).addCommand(g2);var C2=require("node:fs"),S2=require("node:path");G();async function iS(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 nS=["noreply","hello","hi","info","support","team"];async function sS(e){let t;if(e.length===1)t=e[0];else{let n=await ve({message:"Select a verified domain",options:e.map(s=>({value:s,label:s}))});D(n)&&j("Send cancelled."),t=n}let r=nS.map(n=>({value:`${n}@${t}`,label:`${n}@${t}`}));r.push({value:null,label:"Custom address..."});let i=await ve({message:`From address (@${t})`,options:r});if(D(i)&&j("Send cancelled."),i===null){let n=await N({message:"From address",placeholder:`you@${t}`,validate:s=>!s||!s.includes("@")?"Enter a valid email address":void 0});return D(n)&&j("Send cancelled."),n}return i}var x2=new f("send").description("Send an email").option("--from <address>","Sender address (required)").option("--to <addresses...>","Recipient address(es) (required)").option("--subject <subject>","Email subject (required)").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("--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("--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",g({context:"Required: --to and either --template or (--from, --subject, and one of --text | --text-file | --html | --html-file)",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","send_error"],examples:['resend emails send --from you@domain.com --to user@example.com --subject "Hello" --text "Hi"','resend emails send --from you@domain.com --to a@example.com --to b@example.com --subject "Hi" --html "<b>Hi</b>" --json','resend emails send --from you@domain.com --to user@example.com --subject "Hi" --html-file ./email.html --json','resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text "Hi" --scheduled-at 2024-08-05T11:52:01.858Z','resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text "Hi" --attachment ./report.pdf','resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text "Hi" --headers X-Entity-Ref-ID=123 --tags category=marketing','resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text-file ./body.txt','echo "Hello" | resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text-file -',"resend emails send --template tmpl_123 --to user@example.com","resend emails send --template tmpl_123 --to user@example.com --var name=John --var count=42",'RESEND_API_KEY=re_123 resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text "Hi"']})).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=await te(r),n=!!e.template;e.var&&!n&&v({message:"--var can only be used with --template",code:"invalid_var"},{json:r.json}),n&&(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}),n&&e.attachment&&v({message:"Cannot use --attachment with --template",code:"template_attachment_conflict"},{json:r.json});let s=e.var?Object.fromEntries(e.var.map(O=>{let k=O.indexOf("=");k<1&&v({message:`Invalid var format: "${O}". Expected key=value.`,code:"invalid_var"},{json:r.json});let T=O.slice(0,k),E=O.slice(k+1),P=Number(E);return[T,E!==""&&!Number.isNaN(P)?P:E]})):void 0,o=e.from;if(!o&&!n&&w()&&!r.json){let O=await iS(i);O.length>0&&(o=await sS(O))}let a=[{flag:"from",message:"From address",placeholder:"you@example.com",required:!n},{flag:"to",message:"To address",placeholder:"recipient@example.com"},{flag:"subject",message:"Subject",placeholder:"Hello!",required:!n}],u=await r0({from:o,to:e.to?.[0],subject:e.subject},a,r),c=e.html,d=e.text;e.htmlFile&&(e.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
472
- `),c=ge(e.htmlFile,r)),e.textFile&&(e.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
473
- `),d=ge(e.textFile,r));let l=d;!n&&!c&&!d&&(l=await de(void 0,{message:"Email body (plain text)",placeholder:"Type your message..."},{message:"Missing email body. Provide --html, --html-file, --text, or --text-file",code:"missing_body"},r));let p=e.to??[u.to],y=e.attachment?.map(O=>{try{let k=(0,C2.readFileSync)(O);return{filename:(0,S2.basename)(O),content:k}}catch{return v({message:`Failed to read file: ${O}`,code:"file_read_error"},{json:r.json})}}),h=e.headers?Object.fromEntries(e.headers.map(O=>{let k=O.indexOf("=");return k<1&&v({message:`Invalid header format: "${O}". Expected key=value.`,code:"invalid_header"},{json:r.json}),[O.slice(0,k),O.slice(k+1)]})):void 0,b=e.tags?.map(O=>{let k=O.indexOf("=");return k<1&&v({message:`Invalid tag format: "${O}". Expected name=value.`,code:"invalid_tag"},{json:r.json}),{name:O.slice(0,k),value:O.slice(k+1)}}),C;n?C={template:{id:e.template,...s&&{variables:s}},to:p,...u.from&&{from:u.from},...u.subject&&{subject:u.subject},...e.cc&&{cc:e.cc},...e.bcc&&{bcc:e.bcc},...e.replyTo&&{replyTo:e.replyTo},...e.scheduledAt&&{scheduledAt:e.scheduledAt},...h&&{headers:h},...b&&{tags:b}}:C={from:u.from,to:p,subject:u.subject,...c&&{html:c},...l&&{text:l},...e.cc&&{cc:e.cc},...e.bcc&&{bcc:e.bcc},...e.replyTo&&{replyTo:e.replyTo},...e.scheduledAt&&{scheduledAt:e.scheduledAt},...y&&{attachments:y},...h&&{headers:h},...b&&{tags:b}};let S=await _e({loading:e.scheduledAt?"Scheduling email...":"Sending email...",success:e.scheduledAt?"Email scheduled":"Email sent",fail:"Failed to send email"},()=>i.emails.send(C,e.idempotencyKey?{idempotencyKey:e.idempotencyKey}:void 0),"send_error",r);!r.json&&w()?e.scheduledAt?console.log(`
474
- Email scheduled: ${S.id}`):console.log(`
475
- Email sent: ${S.id}`):$(S,{json:r.json})});var w2=new f("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",g({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();await W({spinner:{loading:"Updating email...",success:"Email updated",fail:"Failed to update email"},sdkCall:n=>n.emails.update({id:e,scheduledAt:t.scheduledAt}),errorCode:"update_error",successMsg:`
476
- Email updated: ${e}`},i)});var k2=new f("emails").description("Send and manage emails").addHelpText("after",g({examples:["resend emails list",'resend emails send --from you@domain.com --to user@example.com --subject "Hello" --text "Hi"',"resend emails get <email-id>","resend emails batch --file ./emails.json","resend emails cancel <email-id>","resend emails update <email-id> --scheduled-at 2024-08-05T11:52:01.858Z","resend emails receiving list","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 user@example.com --from you@domain.com"]})).addCommand(d2,{isDefault:!0}).addCommand(x2).addCommand(l2).addCommand(u2).addCommand(c2).addCommand(w2).addCommand(O2);var A2=new f("open").description("Open the Resend dashboard in your browser").addHelpText("after",g({context:"Opens https://resend.com/emails in your default browser.",examples:["resend open"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await sr(gt.emails,r)});var E2=new f("create").description("Create a new segment").option("--name <name>","Segment name (required)").addHelpText("after",g({context:`Segments are named groups of contacts. Broadcasts target segments via segment_id.
584
+ `),process.exit(oi())};Ml(p),process.on("SIGTERM",p),await new Promise(()=>{})});var o_=new h("receiving").description("Manage received (inbound) emails \u2014 requires domain receiving to be enabled").addHelpText("after",g({context:`Receiving must be enabled on the domain first:
585
+ 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 user@example.com --from you@domain.com"]})).addCommand(i_,{isDefault:!0}).addCommand(r_).addCommand(s_).addCommand(e_).addCommand(Qy).addCommand(t_);var a_=require("node:fs"),l_=require("node:path");ae();var u_=new h("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").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("--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",g({context:"Required: --to and either --template, --react-email, or (--from, --subject, and one of --text | --text-file | --html | --html-file)",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 you@domain.com --to user@example.com --subject "Hello" --text "Hi"','resend emails send --from you@domain.com --to a@example.com --to b@example.com --subject "Hi" --html "<b>Hi</b>" --json','resend emails send --from you@domain.com --to user@example.com --subject "Hi" --html-file ./email.html --json','resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text "Hi" --scheduled-at 2024-08-05T11:52:01.858Z','resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text "Hi" --attachment ./report.pdf','resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text "Hi" --headers X-Entity-Ref-ID=123 --tags category=marketing','resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text-file ./body.txt','echo "Hello" | resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text-file -',"resend emails send --template tmpl_123 --to user@example.com","resend emails send --template tmpl_123 --to user@example.com --var name=John --var count=42",'resend emails send --from you@domain.com --to user@example.com --subject "Welcome" --react-email ./emails/welcome.tsx','RESEND_API_KEY=re_123 resend emails send --from you@domain.com --to user@example.com --subject "Hi" --text "Hi"']})).action(async(e,t)=>{let r=t.optsWithGlobals();e.htmlFile==="-"&&e.textFile==="-"&&O({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===""&&O({message:"--from cannot be empty",code:"invalid_options"},{json:r.json});let i=await _e(r,{permission:"sending_access"}),n=!!e.template;e.var&&!n&&O({message:"--var can only be used with --template",code:"invalid_var"},{json:r.json}),e.reactEmail&&(e.html||e.htmlFile||n)&&O({message:"Cannot use --react-email with --html, --html-file, or --template",code:"invalid_options"},{json:r.json}),n&&(e.html||e.htmlFile||e.text||e.textFile)&&O({message:"Cannot use --template with --html, --html-file, --text, or --text-file",code:"template_body_conflict"},{json:r.json}),n&&e.attachment&&O({message:"Cannot use --attachment with --template",code:"template_attachment_conflict"},{json:r.json});let s=e.var?Object.fromEntries(e.var.map(x=>{let E=x.indexOf("=");E<1&&O({message:`Invalid var format: "${x}". Expected key=value.`,code:"invalid_var"},{json:r.json});let k=x.slice(0,E),w=x.slice(E+1),_=Number(w);return[k,w!==""&&!Number.isNaN(_)?_:w]})):void 0,o=e.from;if(!o&&!n&&D()&&!r.json){let x=await Hl(i);x.length>0&&(o=await Ll(x))}let a=[{flag:"from",message:"From address",placeholder:"onboarding@resend.dev",defaultValue:"onboarding@resend.dev",required:!n},{flag:"to",message:"To address",placeholder:"delivered@resend.dev",defaultValue:"delivered@resend.dev"},{flag:"subject",message:"Subject",placeholder:"Hello!",defaultValue:"Hello!",required:!n}],l=await Qv({from:o,to:e.to?.[0],subject:e.subject},a,r),u=e.html,c=e.text;e.htmlFile&&(e.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
586
+ `),u=He(e.htmlFile,r)),e.textFile&&(e.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
587
+ `),c=He(e.textFile,r)),e.reactEmail&&(u=await Et(e.reactEmail,r));let d=c;!n&&!e.reactEmail&&!u&&!c&&(d=await Re(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 p=e.to??[l.to],v=e.attachment?.map(x=>{try{let E=(0,a_.readFileSync)(x);return{filename:(0,l_.basename)(x),content:E}}catch{return O({message:`Failed to read file: ${x}`,code:"file_read_error"},{json:r.json})}}),f=e.headers?Object.fromEntries(e.headers.map(x=>{let E=x.indexOf("=");return E<1&&O({message:`Invalid header format: "${x}". Expected key=value.`,code:"invalid_header"},{json:r.json}),[x.slice(0,E),x.slice(E+1)]})):void 0,b=e.tags?.map(x=>{let E=x.indexOf("=");return E<1&&O({message:`Invalid tag format: "${x}". Expected name=value.`,code:"invalid_tag"},{json:r.json}),{name:x.slice(0,E),value:x.slice(E+1)}}),S;n?S={template:{id:e.template,...s&&{variables:s}},to:p,...l.from&&{from:l.from},...l.subject&&{subject:l.subject},...e.cc&&{cc:e.cc},...e.bcc&&{bcc:e.bcc},...e.replyTo&&{replyTo:e.replyTo},...e.scheduledAt&&{scheduledAt:e.scheduledAt},...f&&{headers:f},...b&&{tags:b}}:S={from:l.from,to:p,subject:l.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},...v&&{attachments:v},...f&&{headers:f},...b&&{tags:b}};let T=await at({loading:e.scheduledAt?"Scheduling email...":"Sending email...",success:e.scheduledAt?"Email scheduled":"Email sent",fail:"Failed to send email"},()=>i.emails.send(S,e.idempotencyKey?{idempotencyKey:e.idempotencyKey}:void 0),"send_error",r);!r.json&&D()?e.scheduledAt?console.log(`
588
+ Email scheduled: ${T.id}`):console.log(`
589
+ Email sent: ${T.id}`):X(T,{json:r.json})});var c_=new h("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",g({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 I(e,bi,i);await le({spinner:{loading:"Updating email...",success:"Email updated",fail:"Failed to update email"},sdkCall:s=>s.emails.update({id:n,scheduledAt:t.scheduledAt}),errorCode:"update_error",successMsg:`
590
+ Email updated: ${n}`},i)});var d_=new h("emails").description("Send and manage emails").addHelpText("after",g({examples:["resend emails list",'resend emails send --from you@domain.com --to user@example.com --subject "Hello" --text "Hi"',"resend emails get <email-id>","resend emails batch --file ./emails.json","resend emails cancel <email-id>","resend emails update <email-id> --scheduled-at 2024-08-05T11:52:01.858Z","resend emails receiving list","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 user@example.com --from you@domain.com"]})).addCommand(Yy,{isDefault:!0}).addCommand(u_).addCommand(Ky).addCommand(Wy).addCommand(Vy).addCommand(c_).addCommand(o_);var p_=new h("open").description("Open the Resend dashboard in your browser").addHelpText("after",g({context:"Opens https://resend.com/emails in your default browser.",examples:["resend open"]})).action(async(e,t)=>{let r=t.optsWithGlobals();await ai(or.emails,r)});var m_=new h("create").description("Create a new segment").option("--name <name>","Segment name (required)").addHelpText("after",g({context:`Segments are named groups of contacts. Broadcasts target segments via segment_id.
477
591
  Contacts can belong to multiple segments. Audiences are deprecated \u2014 use segments instead.
478
592
 
479
- 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 de(e.name,{message:"Segment name",placeholder:"Newsletter Subscribers"},{message:"Missing --name flag.",code:"missing_name"},r);await Z({spinner:{loading:"Creating segment...",success:"Segment created",fail:"Failed to create segment"},sdkCall:n=>n.segments.create({name:i}),onInteractive:n=>{console.log(`
480
- Segment created: ${n.id}`),console.log(`Name: ${n.name}`)}},r)});var T2=new f("delete").alias("rm").description("Delete a segment").argument("<id>","Segment UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",g({context:`Warning: Deleting a segment removes it as a target for future broadcasts,
593
+ 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 Re(e.name,{message:"Segment name",placeholder:"e.g. Newsletter Subscribers"},{message:"Missing --name flag.",code:"missing_name"},r);await we({spinner:{loading:"Creating segment...",success:"Segment created",fail:"Failed to create segment"},sdkCall:n=>n.segments.create({name:i}),onInteractive:n=>{console.log(`
594
+ Segment created: ${n.id}`),console.log(`Name: ${n.name}`)}},r)});var f_=new h("delete").alias("rm").description("Delete a segment").argument("[id]","Segment UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",g({context:`Warning: Deleting a segment removes it as a target for future broadcasts,
481
595
  but does NOT delete the contacts within it.
482
596
 
483
- 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();await pe(e,!!t.yes,{confirmMessage:`Delete segment ${e}?
484
- Contacts will not be deleted, but broadcasts targeting this segment will no longer work.`,spinner:{loading:"Deleting segment...",success:"Segment deleted",fail:"Failed to delete segment"},object:"segment",successMsg:"Segment deleted.",sdkCall:n=>n.segments.remove(e)},i)});var P2=new f("get").description("Retrieve a segment by ID").argument("<id>","Segment UUID").addHelpText("after",g({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();await re({spinner:{loading:"Fetching segment...",success:"Segment fetched",fail:"Failed to fetch segment"},sdkCall:n=>n.segments.get(e),onInteractive:n=>{console.log(`
485
- ${n.name}`),console.log(`ID: ${n.id}`),console.log(`Created: ${n.created_at}`)}},i)});var D2=new f("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",g({context:`Pagination: use --after or --before with a segment ID as the cursor.
597
+ 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 I(e,ur,i);await Me(n,!!t.yes,{confirmMessage:`Delete segment ${n}?
598
+ Contacts will not be deleted, but broadcasts targeting this segment will no longer work.`,spinner:{loading:"Deleting segment...",success:"Segment deleted",fail:"Failed to delete segment"},object:"segment",successMsg:"Segment deleted.",sdkCall:s=>s.segments.remove(n)},i)});var h_=new h("get").description("Retrieve a segment by ID").argument("[id]","Segment UUID").addHelpText("after",g({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 I(e,ur,i);await ke({spinner:{loading:"Fetching segment...",success:"Segment fetched",fail:"Failed to fetch segment"},sdkCall:s=>s.segments.get(n),onInteractive:s=>{console.log(`
599
+ ${s.name}`),console.log(`ID: ${s.id}`),console.log(`Created: ${s.created_at}`)}},i)});var g_=new h("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",g({context:`Pagination: use --after or --before with a segment ID as the cursor.
486
600
  Only one of --after or --before may be used at a time.
487
601
  The response includes has_more: true when additional pages exist.
488
602
 
489
603
  Use "resend segments list" to discover segment IDs for use with broadcasts
490
- 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=ie(e.limit,r),n=ne(i,e.after,e.before);await L({spinner:{loading:"Fetching segments...",success:"Segments fetched",fail:"Failed to list segments"},sdkCall:s=>s.segments.list(n),onInteractive:s=>{console.log(ka(s.data)),se(s,"segments list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var j2=new f("segments").description("Manage segments").addHelpText("after",g({context:`Segments are the modern replacement for Audiences (deprecated).
604
+ 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=Ae(e.limit,r),n=Pe(i,e.after,e.before);await ue({spinner:{loading:"Fetching segments...",success:"Segments fetched",fail:"Failed to list segments"},sdkCall:s=>s.segments.list(n),onInteractive:s=>{console.log(su(s.data)),Te(s,"segments list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var b_=new h("segments").description("Manage segments").addHelpText("after",g({context:`Segments are the modern replacement for Audiences (deprecated).
491
605
  A segment is a named group of contacts. Broadcasts target segments via segment_id.
492
606
  Contacts can belong to multiple segments.
493
607
 
@@ -496,10 +610,10 @@ Segment membership is managed through the contacts namespace:
496
610
  resend contacts remove-segment <contactId> <segmentId>
497
611
  resend contacts segments <contactId>
498
612
 
499
- 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(E2).addCommand(P2).addCommand(D2,{isDefault:!0}).addCommand(T2);function al(e){e.json||e.quiet||process.stderr.write(`Warning: "resend teams" is deprecated. Use "resend auth" instead.
500
- `)}var oS=new f("list").description("List all profiles").action((e,t)=>{let r=t.optsWithGlobals();al(r),Xc(r)}),aS=new f("switch").description("Switch the active profile").argument("[name]","Profile name to switch to").action(async(e,t,r)=>{let i=r.optsWithGlobals();al(i),await il(e,i)}),uS=new f("remove").description("Remove a profile").argument("[name]","Profile name to remove").action(async(e,t,r)=>{let i=r.optsWithGlobals();al(i),await rl(e,i)}),ul=new f("teams").description('(deprecated) Use "resend auth" instead').addCommand(oS).addCommand(aS).addCommand(uS);ul._hidden=!0;G();function Pa(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 s=n.length?n.join(":"):void 0;if(s!=null&&s==="")throw new Error(`Invalid --var "${t}": fallback value cannot be empty.`);let o=s;if(i==="number"){if(o!=null&&Number.isNaN(Number(o)))throw new Error(`Invalid --var "${t}": fallback "${o}" is not a valid number.`);return{key:r,type:"number",...o!=null?{fallbackValue:Number(o)}:{}}}return{key:r,type:"string",...o!=null?{fallbackValue:o}:{}}})}function I2(e){let t=e.map(r=>[r.name,r.status,r.alias??"",r.id,r.created_at]);return V(["Name","Status","Alias","ID","Created"],t,"(no templates)")}var q2=new f("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("--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",g({context:`Creates a new draft template. Use "resend templates publish" to make it available for sending.
613
+ 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(m_).addCommand(h_).addCommand(g_,{isDefault:!0}).addCommand(f_);function Zd(e){e.json||e.quiet||process.stderr.write(`Warning: "resend teams" is deprecated. Use "resend auth" instead.
614
+ `)}var Lk=new h("list").description("List all profiles").action((e,t)=>{let r=t.optsWithGlobals();Zd(r),Dd(r)}),Nk=new h("switch").description("Switch the active profile").argument("[name]","Profile name to switch to").action(async(e,t,r)=>{let i=r.optsWithGlobals();Zd(i),await Md(e,i)}),Gk=new h("remove").description("Remove a profile").argument("[name]","Profile name to remove").action(async(e,t,r)=>{let i=r.optsWithGlobals();Zd(i),await Rd(e,i)}),Xd=new h("teams").description('(deprecated) Use "resend auth" instead').addCommand(Lk).addCommand(Nk).addCommand(Gk);Xd._hidden=!0;ae();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 s=n.length?n.join(":"):void 0;if(s!=null&&s==="")throw new Error(`Invalid --var "${t}": fallback value cannot be empty.`);let o=s;if(i==="number"){if(o!=null&&Number.isNaN(Number(o)))throw new Error(`Invalid --var "${t}": fallback "${o}" is not a valid number.`);return{key:r,type:"number",...o!=null?{fallbackValue:Number(o)}:{}}}return{key:r,type:"string",...o!=null?{fallbackValue:o}:{}}})}var qt={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 v_(e){let t=e.map(r=>[r.name,r.status,r.alias??"",r.id,r.created_at]);return he(["Name","Status","Alias","ID","Created"],t,"(no templates)")}var y_=new h("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").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",g({context:`Creates a new draft template. Use "resend templates publish" to make it available for sending.
501
615
 
502
- --name is required. Body: provide --html or --html-file. Optionally add --text or --text-file for plain-text.
616
+ --name is required. Body: provide --html, --html-file, or --react-email. Optionally add --text or --text-file for plain-text.
503
617
 
504
618
  --var declares a template variable using the format KEY:type or KEY:type:fallback.
505
619
  Valid types: string, number.
@@ -507,28 +621,28 @@ There is no "update" endpoint \u2014 to rename a segment, delete it and recreate
507
621
  --html "<p>Hi {{{NAME}}}, your total is {{{PRICE}}}</p>"
508
622
  --var NAME:string --var PRICE:number:0
509
623
 
510
- Non-interactive: --name and a body (--html or --html-file) 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","create_error"],examples:['resend templates create --name "Welcome" --html "<h1>Hello</h1>" --subject "Welcome!"','resend templates create --name "Newsletter" --html-file ./template.html --from hello@domain.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){(!w()||r.json)&&v({message:"Missing --name flag.",code:"missing_name"},{json:r.json});let o=await N({message:"Template name",placeholder:"Welcome Email",validate:a=>a?void 0:"Required"});D(o)&&j("Cancelled."),i=o}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});let n=e.html,s=e.text;if(e.htmlFile&&(e.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
511
- `),n=ge(e.htmlFile,r)),e.textFile&&(e.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
512
- `),s=ge(e.textFile,r)),!n){(!w()||r.json)&&v({message:"Missing body. Provide --html or --html-file.",code:"missing_body"},{json:r.json});let o=await N({message:"HTML body",placeholder:"<h1>Hello {{name}}</h1>",validate:a=>a?void 0:"Required"});D(o)&&j("Cancelled."),n=o}await Z({spinner:{loading:"Creating template...",success:"Template created",fail:"Failed to create template"},sdkCall:o=>Promise.resolve(o.templates.create({name:i,html:n,...e.subject&&{subject:e.subject},...s&&{text:s},...e.from&&{from:e.from},...e.replyTo&&{replyTo:e.replyTo},...e.alias&&{alias:e.alias},...e.var&&{variables:Pa(e.var)}})),onInteractive:o=>{console.log(`
513
- Template created: ${o.id}`)}},r)});var $2=new f("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",g({context:`Warning: Deleting a template is permanent and cannot be undone.
624
+ 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 hello@domain.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){(!D()||r.json)&&O({message:"Missing --name flag.",code:"missing_name"},{json:r.json});let o=await pe({message:"Template name",placeholder:"e.g. Welcome Email",validate:a=>a?void 0:"Required"});B(o)&&H("Cancelled."),i=o}e.htmlFile==="-"&&e.textFile==="-"&&O({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)&&O({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:r.json});let n=e.html,s=e.text;if(e.htmlFile&&(e.html&&process.stderr.write(`Warning: both --html and --html-file provided; using --html-file
625
+ `),n=He(e.htmlFile,r)),e.textFile&&(e.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
626
+ `),s=He(e.textFile,r)),e.reactEmail&&(n=await Et(e.reactEmail,r)),!n){(!D()||r.json)&&O({message:"Missing body. Provide --html, --html-file, or --react-email.",code:"missing_body"},{json:r.json});let o=await pe({message:"HTML body",placeholder:"<h1>Hello {{name}}</h1>",validate:a=>a?void 0:"Required"});B(o)&&H("Cancelled."),n=o}await we({spinner:{loading:"Creating template...",success:"Template created",fail:"Failed to create template"},sdkCall:o=>Promise.resolve(o.templates.create({name:i,html:n,...e.subject&&{subject:e.subject},...s&&{text:s},...e.from&&{from:e.from},...e.replyTo&&{replyTo:e.replyTo},...e.alias&&{alias:e.alias},...e.var&&{variables:cu(e.var)}})),onInteractive:o=>{console.log(`
627
+ Template created: ${o.id}`)}},r)});var __=new h("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",g({context:`Warning: Deleting a template is permanent and cannot be undone.
514
628
 
515
- 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();await pe(e,!!t.yes,{confirmMessage:`Delete template ${e}?
516
- This action is permanent and cannot be undone.`,spinner:{loading:"Deleting template...",success:"Template deleted",fail:"Failed to delete template"},object:"template",successMsg:"Template deleted.",sdkCall:n=>n.templates.remove(e)},i)});var z2=new f("duplicate").description("Duplicate a template").argument("<id>","Template ID or alias to duplicate").addHelpText("after",g({context:`Creates a copy of an existing template and returns the new template ID.
629
+ 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 I(e,qt,i);await Me(n,!!t.yes,{confirmMessage:`Delete template ${n}?
630
+ This action is permanent and cannot be undone.`,spinner:{loading:"Deleting template...",success:"Template deleted",fail:"Failed to delete template"},object:"template",successMsg:"Template deleted.",sdkCall:s=>s.templates.remove(n)},i)});var w_=new h("duplicate").description("Duplicate a template").argument("[id]","Template ID or alias to duplicate").addHelpText("after",g({context:`Creates a copy of an existing template and returns the new template ID.
517
631
  The duplicate is created as a draft with " (Copy)" appended to the original name.
518
- 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();await Z({spinner:{loading:"Duplicating template...",success:"Template duplicated",fail:"Failed to duplicate template"},sdkCall:n=>Promise.resolve(n.templates.duplicate(e)),onInteractive:n=>{console.log(`
519
- Template duplicated: ${n.id}`)}},i)});var R2=new f("get").description("Retrieve a template by ID or alias").argument("<id>","Template ID or alias").addHelpText("after",g({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();await re({spinner:{loading:"Fetching template...",success:"Template fetched",fail:"Failed to fetch template"},sdkCall:n=>n.templates.get(e),onInteractive:n=>{if(console.log(`
520
- ${n.name}`),console.log(`ID: ${n.id}`),console.log(`Status: ${n.status}`),n.alias&&console.log(`Alias: ${n.alias}`),n.subject&&console.log(`Subject: ${n.subject}`),n.from&&console.log(`From: ${n.from}`),n.reply_to?.length&&console.log(`Reply-To: ${n.reply_to.join(", ")}`),n.html){let s=n.html.length>200?`${n.html.slice(0,197)}...`:n.html;console.log(`HTML: ${s}`)}n.variables?.length&&console.log(`Variables: ${n.variables.map(s=>s.key).join(", ")}`),n.published_at&&console.log(`Published: ${n.published_at}`),console.log(`Created: ${n.created_at}`),console.log(`Updated: ${n.updated_at}`)}},i)});var M2=new f("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",g({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=ie(e.limit,r),n=ne(i,e.after,e.before);await L({spinner:{loading:"Fetching templates...",success:"Templates fetched",fail:"Failed to list templates"},sdkCall:s=>s.templates.list(n),onInteractive:s=>{console.log(I2(s.data)),se(s,"templates list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var J2=new f("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",g({context:`Opens the Resend dashboard in your default browser.
632
+ 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 I(e,qt,i);await we({spinner:{loading:"Duplicating template...",success:"Template duplicated",fail:"Failed to duplicate template"},sdkCall:s=>Promise.resolve(s.templates.duplicate(n)),onInteractive:s=>{console.log(`
633
+ Template duplicated: ${s.id}`)}},i)});var C_=new h("get").description("Retrieve a template by ID or alias").argument("[id]","Template ID or alias").addHelpText("after",g({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 I(e,qt,i);await ke({spinner:{loading:"Fetching template...",success:"Template fetched",fail:"Failed to fetch template"},sdkCall:s=>s.templates.get(n),onInteractive:s=>{if(console.log(`
634
+ ${s.name}`),console.log(`ID: ${s.id}`),console.log(`Status: ${s.status}`),s.alias&&console.log(`Alias: ${s.alias}`),s.subject&&console.log(`Subject: ${s.subject}`),s.from&&console.log(`From: ${s.from}`),s.reply_to?.length&&console.log(`Reply-To: ${s.reply_to.join(", ")}`),s.html){let o=s.html.length>200?`${s.html.slice(0,197)}...`:s.html;console.log(`HTML: ${o}`)}s.variables?.length&&console.log(`Variables: ${s.variables.map(o=>o.key).join(", ")}`),s.published_at&&console.log(`Published: ${s.published_at}`),console.log(`Created: ${s.created_at}`),console.log(`Updated: ${s.updated_at}`)}},i)});var S_=new h("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",g({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=Ae(e.limit,r),n=Pe(i,e.after,e.before);await ue({spinner:{loading:"Fetching templates...",success:"Templates fetched",fail:"Failed to list templates"},sdkCall:s=>s.templates.list(n),onInteractive:s=>{console.log(v_(s.data)),Te(s,"templates list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var O_=new h("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",g({context:`Opens the Resend dashboard in your default browser.
521
635
  With an ID: opens that template's page for editing or viewing.
522
- 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?gt.template(e):gt.templates,n=r.optsWithGlobals();await sr(i,n)});var F2=new f("publish").description("Publish a draft template").argument("<id>","Template ID or alias").addHelpText("after",g({context:`Promotes a draft template to published status, making it available for use in emails.
636
+ 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?or.template(e):or.templates,n=r.optsWithGlobals();await ai(i,n)});var x_=new h("publish").description("Publish a draft template").argument("[id]","Template ID or alias").addHelpText("after",g({context:`Promotes a draft template to published status, making it available for use in emails.
523
637
  After updating a published template, re-publish to make the changes live.
524
- 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();await W({spinner:{loading:"Publishing template...",success:"Template published",fail:"Failed to publish template"},sdkCall:n=>n.templates.publish(e),errorCode:"publish_error",successMsg:`
525
- Template published: ${e}`},i)});var B2=new f("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("--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",g({context:`At least one option is required. Only the provided fields are changed; others are left as-is.
638
+ 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 I(e,qt,i);await le({spinner:{loading:"Publishing template...",success:"Template published",fail:"Failed to publish template"},sdkCall:s=>s.templates.publish(n),errorCode:"publish_error",successMsg:`
639
+ Template published: ${n}`},i)});var k_=new h("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").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",g({context:`At least one option is required. Only the provided fields are changed; others are left as-is.
526
640
 
527
641
  --var declares a template variable using the format KEY:type or KEY:type:fallback.
528
642
  Valid types: string, number.
529
- 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","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 "new@domain.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.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, --subject, --text, --text-file, --from, --reply-to, --alias, or --var.",code:"no_changes"},{json:i.json}),t.html&&t.htmlFile&&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=t.html,s=t.text;t.htmlFile&&(n=ge(t.htmlFile,i)),t.textFile&&(t.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
530
- `),s=ge(t.textFile,i)),await W({spinner:{loading:"Updating template...",success:"Template updated",fail:"Failed to update template"},sdkCall:o=>o.templates.update(e,{...t.name!=null&&{name:t.name},...n!=null&&{html:n},...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&&{variables:Pa(t.var)}}),errorCode:"update_error",successMsg:`
531
- Template updated: ${e}`},i)});var H2=new f("templates").description("Manage templates").addHelpText("after",g({context:`Lifecycle:
643
+ 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 "new@domain.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(),n=await I(e,qt,i);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&&O({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&&(t.html||t.htmlFile)&&O({message:"Cannot use --react-email with --html or --html-file",code:"invalid_options"},{json:i.json}),t.html&&t.htmlFile&&O({message:"--html and --html-file are mutually exclusive.",code:"invalid_options"},{json:i.json}),t.htmlFile==="-"&&t.textFile==="-"&&O({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 s=t.html,o=t.text;t.htmlFile&&(s=He(t.htmlFile,i)),t.textFile&&(t.text&&process.stderr.write(`Warning: both --text and --text-file provided; using --text-file
644
+ `),o=He(t.textFile,i)),t.reactEmail&&(s=await Et(t.reactEmail,i)),await le({spinner:{loading:"Updating template...",success:"Template updated",fail:"Failed to update template"},sdkCall:a=>a.templates.update(n,{...t.name!=null&&{name:t.name},...s!=null&&{html:s},...t.subject!=null&&{subject:t.subject},...o!=null&&{text:o},...t.from!=null&&{from:t.from},...t.replyTo!=null&&{replyTo:t.replyTo},...t.alias!=null&&{alias:t.alias},...t.var&&{variables:cu(t.var)}}),errorCode:"update_error",successMsg:`
645
+ Template updated: ${n}`},i)});var E_=new h("templates").description("Manage templates").addHelpText("after",g({context:`Lifecycle:
532
646
  Templates follow a draft \u2192 published workflow:
533
647
  1. create \u2014 creates a draft template
534
648
  2. update \u2014 edits name, subject, HTML, variables, etc.
@@ -542,7 +656,7 @@ Template variables:
542
656
  Each variable must be declared with --var when creating or updating:
543
657
  --var KEY:type e.g. --var NAME:string
544
658
  --var KEY:type:fallback e.g. --var PRICE:number:25
545
- 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(q2).addCommand(R2).addCommand(J2).addCommand(M2,{isDefault:!0}).addCommand(B2).addCommand($2).addCommand(F2).addCommand(z2);var L2=new f("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 be("--default-subscription <mode>","Default subscription state for contacts").choices(["opt_in","opt_out"]).default("opt_in")).addHelpText("after",g({context:`Topics enable fine-grained subscription management. Contacts can opt in or out of
659
+ 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(y_).addCommand(C_).addCommand(O_).addCommand(S_,{isDefault:!0}).addCommand(k_).addCommand(__).addCommand(x_).addCommand(w_);var A_=new h("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 Le("--default-subscription <mode>","Default subscription state for contacts").choices(["opt_in","opt_out"]).default("opt_in")).addHelpText("after",g({context:`Topics enable fine-grained subscription management. Contacts can opt in or out of
546
660
  individual topics. Broadcasts can target only contacts opted into a specific topic.
547
661
 
548
662
  Example topics: "Product Updates", "Security Alerts", "Weekly Digest".
@@ -551,17 +665,17 @@ Example topics: "Product Updates", "Security Alerts", "Weekly Digest".
551
665
  opt_in Contacts receive broadcasts unless they explicitly opt out (default)
552
666
  opt_out Contacts do NOT receive broadcasts unless they explicitly opt in
553
667
 
554
- 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 de(e.name,{message:"Topic name",placeholder:"Product Updates"},{message:"Missing --name flag.",code:"missing_name"},r);await Z({spinner:{loading:"Creating topic...",success:"Topic created",fail:"Failed to create topic"},sdkCall:n=>n.topics.create({name:i,defaultSubscription:e.defaultSubscription,...e.description&&{description:e.description}}),onInteractive:n=>{console.log(`
555
- Topic created: ${n.id}`)}},r)});var N2=new f("delete").alias("rm").description("Delete a topic").argument("<id>","Topic UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",g({context:`Warning: Deleting a topic removes all contact subscriptions to that topic and may affect
668
+ 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 Re(e.name,{message:"Topic name",placeholder:"e.g. Product Updates"},{message:"Missing --name flag.",code:"missing_name"},r);await we({spinner:{loading:"Creating topic...",success:"Topic created",fail:"Failed to create topic"},sdkCall:n=>n.topics.create({name:i,defaultSubscription:e.defaultSubscription,...e.description&&{description:e.description}}),onInteractive:n=>{console.log(`
669
+ Topic created: ${n.id}`)}},r)});var yi={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 P_(e){let t=e.map(r=>[r.name,r.description??"",r.id,r.created_at]);return he(["Name","Description","ID","Created"],t,"(no topics)")}var T_=new h("delete").alias("rm").description("Delete a topic").argument("[id]","Topic UUID").option("--yes","Skip the confirmation prompt (required in non-interactive mode)").addHelpText("after",g({context:`Warning: Deleting a topic removes all contact subscriptions to that topic and may affect
556
670
  broadcasts that reference this topic_id. Contacts themselves are not deleted.
557
671
 
558
- 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();await pe(e,!!t.yes,{confirmMessage:`Delete topic ${e}?
559
- All contact subscriptions and broadcast associations will be removed.`,spinner:{loading:"Deleting topic...",success:"Topic deleted",fail:"Failed to delete topic"},object:"topic",successMsg:"Topic deleted.",sdkCall:n=>n.topics.remove(e)},i)});var G2=new f("get").description("Retrieve a topic by ID").argument("<id>","Topic UUID").addHelpText("after",g({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();await re({spinner:{loading:"Fetching topic...",success:"Topic fetched",fail:"Failed to fetch topic"},sdkCall:n=>n.topics.get(e),onInteractive:n=>{console.log(`
560
- ${n.name}`),console.log(`ID: ${n.id}`),n.description&&console.log(`Description: ${n.description}`),console.log(`Default subscription: ${n.default_subscription}`),console.log(`Created: ${n.created_at}`)}},i)});function U2(e){let t=e.map(r=>[r.name,r.description??"",r.id,r.created_at]);return V(["Name","Description","ID","Created"],t,"(no topics)")}var W2=new f("list").alias("ls").description("List all topics").addHelpText("after",g({context:`Returns all topics in your account. Topic subscription management for individual
561
- 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 L({spinner:{loading:"Fetching topics...",success:"Topics fetched",fail:"Failed to list topics"},sdkCall:i=>i.topics.list(),onInteractive:i=>console.log(U2(i.data))},r)});var V2=new f("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",g({context:`At least one of --name or --description must be provided to update the topic.
672
+ 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 I(e,yi,i);await Me(n,!!t.yes,{confirmMessage:`Delete topic ${n}?
673
+ All contact subscriptions and broadcast associations will be removed.`,spinner:{loading:"Deleting topic...",success:"Topic deleted",fail:"Failed to delete topic"},object:"topic",successMsg:"Topic deleted.",sdkCall:s=>s.topics.remove(n)},i)});var $_=new h("get").description("Retrieve a topic by ID").argument("[id]","Topic UUID").addHelpText("after",g({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 I(e,yi,i);await ke({spinner:{loading:"Fetching topic...",success:"Topic fetched",fail:"Failed to fetch topic"},sdkCall:s=>s.topics.get(n),onInteractive:s=>{console.log(`
674
+ ${s.name}`),console.log(`ID: ${s.id}`),s.description&&console.log(`Description: ${s.description}`),console.log(`Default subscription: ${s.default_subscription}`),console.log(`Created: ${s.created_at}`)}},i)});var j_=new h("list").alias("ls").description("List all topics").addHelpText("after",g({context:`Returns all topics in your account. Topic subscription management for individual
675
+ 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 ue({spinner:{loading:"Fetching topics...",success:"Topics fetched",fail:"Failed to list topics"},sdkCall:i=>i.topics.list(),onInteractive:i=>console.log(P_(i.data))},r)});var D_=new h("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",g({context:`At least one of --name or --description must be provided to update the topic.
562
676
 
563
677
  Note: --default-subscription cannot be changed after creation.
564
- 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();!t.name&&!t.description&&v({message:"Provide at least one option to update: --name or --description.",code:"no_changes"},{json:i.json}),await W({spinner:{loading:"Updating topic...",success:"Topic updated",fail:"Failed to update topic"},sdkCall:n=>n.topics.update({id:e,...t.name&&{name:t.name},...t.description&&{description:t.description}}),errorCode:"update_error",successMsg:`Topic updated: ${e}`},i)});var K2=new f("topics").description("Manage topics for contact subscription preferences").addHelpText("after",g({context:`Topics enable fine-grained subscription management beyond the global unsubscribe flag.
678
+ 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 I(e,yi,i);!t.name&&!t.description&&O({message:"Provide at least one option to update: --name or --description.",code:"no_changes"},{json:i.json}),await le({spinner:{loading:"Updating topic...",success:"Topic updated",fail:"Failed to update topic"},sdkCall:s=>s.topics.update({id:n,...t.name&&{name:t.name},...t.description&&{description:t.description}}),errorCode:"update_error",successMsg:`Topic updated: ${n}`},i)});var I_=new h("topics").description("Manage topics for contact subscription preferences").addHelpText("after",g({context:`Topics enable fine-grained subscription management beyond the global unsubscribe flag.
565
679
  A contact can opt in or out of individual topics independently.
566
680
 
567
681
  Broadcasts can target a topic_id so only contacts who have opted into that topic
@@ -574,11 +688,11 @@ Subscription states:
574
688
 
575
689
  Contact topic subscriptions are managed via the contacts namespace:
576
690
  resend contacts topics <contactId>
577
- 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(L2).addCommand(G2).addCommand(W2,{isDefault:!0}).addCommand(V2).addCommand(N2);G();Mr();yt();var Y2=new f("update").description("Check for available CLI updates").addHelpText("after",g({context:`Checks the latest release on GitHub (bypasses the cache).
691
+ 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(A_).addCommand($_).addCommand(j_,{isDefault:!0}).addCommand(D_).addCommand(T_);ae();nn();fr();var q_=new h("update").description("Check for available CLI updates").addHelpText("after",g({context:`Checks the latest release on GitHub (bypasses the cache).
578
692
  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"}
579
- {"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=w()&&!r.json?$e("Checking for updates..."):null,s=await ol();if(!s){n?.fail("Could not check for updates"),v({message:"Could not reach GitHub releases",code:"fetch_failed"},{json:r.json});return}let o=Aa(Y,s),a=Ea();if(r.json||!w()){$({current:Y,latest:s,update_available:o,...o?{upgrade_command:a}:{}},{json:r.json});return}if(o){let u=a.startsWith("http");n?.warn(`Update available: v${Y} \u2192 v${s}`),console.log(`
580
- ${u?"Visit":"Run"}: \x1B[36m${a}\x1B[0m
581
- `)}else n?.stop(`Already up to date (v${Y})`)});G();var nt=["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 cr(e){return e.flatMap(t=>t.split(",")).map(t=>t.trim()).filter(Boolean)}function Q2(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 V(["Endpoint","Events","Status","ID"],t,"(no webhooks)")}var Z2=new f("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",g({context:`Webhooks deliver real-time event notifications to your HTTPS endpoint.
693
+ {"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=D()&&!r.json?De("Checking for updates..."):null,s=await Yd();if(!s){n?.fail("Could not check for updates"),O({message:"Could not reach GitHub releases",code:"fetch_failed"},{json:r.json});return}let o=au(ve,s),a=lu();if(r.json||!D()){X({current:ve,latest:s,update_available:o,...o?{upgrade_command:a}:{}},{json:r.json});return}if(o){let l=a.startsWith("http");n?.warn(`Update available: v${ve} \u2192 v${s}`),console.log(`
694
+ ${l?"Visit":"Run"}: \x1B[36m${a}\x1B[0m
695
+ `)}else n?.stop(`Already up to date (v${ve})`)});ae();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 _i(e){return e.flatMap(t=>t.split(",")).map(t=>t.trim()).filter(Boolean)}var wi={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 R_(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 he(["Endpoint","Events","Status","ID"],t,"(no webhooks)")}var M_=new h("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",g({context:`Webhooks deliver real-time event notifications to your HTTPS endpoint.
582
696
  Events fire per-recipient: a batch email to 3 recipients generates 3 email.sent events.
583
697
 
584
698
  --endpoint must use HTTPS.
@@ -599,22 +713,22 @@ The signing_secret in the response is shown ONCE \u2014 save it immediately to v
599
713
  webhook payloads using Svix signature headers (svix-id, svix-timestamp, svix-signature).
600
714
  Use resend.webhooks.verify() in your application to validate incoming payloads.
601
715
 
602
- 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 de(e.endpoint,{message:"Webhook endpoint URL",placeholder:"https://your-app.com/webhooks/resend",validate:o=>{if(!o)return"Endpoint URL is required";if(!o.startsWith("https://"))return"Endpoint must use HTTPS"}},{message:"Missing --endpoint flag.",code:"missing_endpoint"},r),n,s=e.events?.length?cr(e.events):void 0;if(s?.includes("all"))n=nt;else if(s?.length)n=s;else{(!w()||r.json)&&v({message:"Missing --events flag.",code:"missing_events"},{json:r.json});let o=await id({message:"Select event types to subscribe to",options:nt.map(a=>({value:a,label:a}))});D(o)&&j("Cancelled."),n=o}await Z({spinner:{loading:"Creating webhook...",success:"Webhook created",fail:"Failed to create webhook"},sdkCall:o=>o.webhooks.create({endpoint:i,events:n}),onInteractive:o=>{console.log(`
716
+ 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 Re(e.endpoint,{message:"Webhook endpoint URL",placeholder:"https://your-app.com/webhooks/resend",validate:o=>{if(!o)return"Endpoint URL is required";if(!o.startsWith("https://"))return"Endpoint must use HTTPS"}},{message:"Missing --endpoint flag.",code:"missing_endpoint"},r),n,s=e.events?.length?_i(e.events):void 0;if(s?.includes("all"))n=Vt;else if(s?.length)n=s;else{(!D()||r.json)&&O({message:"Missing --events flag.",code:"missing_events"},{json:r.json});let o=await Kp({message:"Select event types to subscribe to",options:Vt.map(a=>({value:a,label:a}))});B(o)&&H("Cancelled."),n=o}await we({spinner:{loading:"Creating webhook...",success:"Webhook created",fail:"Failed to create webhook"},sdkCall:o=>o.webhooks.create({endpoint:i,events:n}),onInteractive:o=>{console.log(`
603
717
  Webhook created`),console.log(`ID: ${o.id}`),console.log(`Signing Secret: ${o.signing_secret}`),console.log(`
604
- Save the signing secret \u2014 it is only shown once.`)}},r)});var X2=new f("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",g({context:`Warning: Deleting a webhook immediately stops event delivery to the endpoint.
718
+ Save the signing secret \u2014 it is only shown once.`)}},r)});var z_=new h("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",g({context:`Warning: Deleting a webhook immediately stops event delivery to the endpoint.
605
719
  In-flight events may still be attempted once before the deletion takes effect.
606
720
  To temporarily pause delivery without losing configuration, use:
607
721
  resend webhooks update <id> --status disabled
608
722
 
609
- 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();await pe(e,!!t.yes,{confirmMessage:`Delete webhook ${e}?
610
- Events will no longer be delivered to this endpoint.`,spinner:{loading:"Deleting webhook...",success:"Webhook deleted",fail:"Failed to delete webhook"},object:"webhook",successMsg:"Webhook deleted.",sdkCall:n=>n.webhooks.remove(e)},i)});var ev=new f("get").description("Retrieve a webhook endpoint configuration by ID").argument("<id>","Webhook UUID").addHelpText("after",g({context:`Note: The signing_secret is not returned by the get endpoint.
611
- 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();await re({spinner:{loading:"Fetching webhook...",success:"Webhook fetched",fail:"Failed to fetch webhook"},sdkCall:n=>n.webhooks.get(e),onInteractive:n=>{console.log(`
612
- ${n.endpoint}`),console.log(`ID: ${n.id}`),console.log(`Status: ${n.status}`),console.log(`Events: ${(n.events??[]).join(", ")||"(none)"}`),console.log(`Created: ${n.created_at}`)}},i)});var tv=new f("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",g({context:`Pagination: use --after or --before with a webhook ID as the cursor.
723
+ 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 I(e,wi,i);await Me(n,!!t.yes,{confirmMessage:`Delete webhook ${n}?
724
+ Events will no longer be delivered to this endpoint.`,spinner:{loading:"Deleting webhook...",success:"Webhook deleted",fail:"Failed to delete webhook"},object:"webhook",successMsg:"Webhook deleted.",sdkCall:s=>s.webhooks.remove(n)},i)});var F_=new h("get").description("Retrieve a webhook endpoint configuration by ID").argument("[id]","Webhook UUID").addHelpText("after",g({context:`Note: The signing_secret is not returned by the get endpoint.
725
+ 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 I(e,wi,i);await ke({spinner:{loading:"Fetching webhook...",success:"Webhook fetched",fail:"Failed to fetch webhook"},sdkCall:s=>s.webhooks.get(n),onInteractive:s=>{console.log(`
726
+ ${s.endpoint}`),console.log(`ID: ${s.id}`),console.log(`Status: ${s.status}`),console.log(`Events: ${(s.events??[]).join(", ")||"(none)"}`),console.log(`Created: ${s.created_at}`)}},i)});var J_=new h("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",g({context:`Pagination: use --after or --before with a webhook ID as the cursor.
613
727
  Only one of --after or --before may be used at a time.
614
- 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=ie(e.limit,r),n=ne(i,e.after,e.before);await L({spinner:{loading:"Fetching webhooks...",success:"Webhooks fetched",fail:"Failed to list webhooks"},sdkCall:s=>s.webhooks.list(n),onInteractive:s=>{console.log(Q2(s.data)),se(s,"webhooks list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var iv=require("node:http");var ye=oe(st(),1);G();var nv=["svix-id","svix-timestamp","svix-signature"];function cS(){return new Date().toLocaleTimeString("en-GB",{hour12:!1})}function lS(e){let t=e.type??"unknown",r=e.data??{},i=r.id??"",n="";if(t.startsWith("email.")){let s=r.from??"",o=Array.isArray(r.to)?r.to[0]:"";(s||o)&&(n=`${s} -> ${o}`)}else t.startsWith("domain.")?n=r.name??"":t.startsWith("contact.")&&(n=r.email??"");return{type:t,resourceId:i,detail:n}}function dS(e){let t=`${e} ${pS(e)}`;return e>=200&&e<300?ye.default.green(t):e>=400&&e<500?ye.default.yellow(t):ye.default.red(t)}function pS(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 rv(e,t,r){let i={"content-type":"application/json"};for(let o of nv){let a=r[o];a&&(i[o]=a)}let n=e.startsWith("http")?e:`http://${e}`;return{status:(await fetch(n,{method:"POST",headers:i,body:t})).status}}function mS(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 fS(e,t,r){process.stderr.write(`
728
+ 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=Ae(e.limit,r),n=Pe(i,e.after,e.before);await ue({spinner:{loading:"Fetching webhooks...",success:"Webhooks fetched",fail:"Failed to list webhooks"},sdkCall:s=>s.webhooks.list(n),onInteractive:s=>{console.log(R_(s.data)),Te(s,"webhooks list",{limit:i,before:e.before,apiKey:r.apiKey,profile:r.profile})}},r)});var H_=require("node:http");var Ge=me(Kt(),1);ae();var L_=["svix-id","svix-timestamp","svix-signature"];function Uk(){return new Date().toLocaleTimeString("en-GB",{hour12:!1})}function Wk(e){let t=e.type??"unknown",r=e.data??{},i=r.id??"",n="";if(t.startsWith("email.")){let s=r.from??"",o=Array.isArray(r.to)?r.to[0]:"";(s||o)&&(n=`${s} -> ${o}`)}else t.startsWith("domain.")?n=r.name??"":t.startsWith("contact.")&&(n=r.email??"");return{type:t,resourceId:i,detail:n}}function Vk(e){let t=`${e} ${Kk(e)}`;return e>=200&&e<300?Ge.default.green(t):e>=400&&e<500?Ge.default.yellow(t):Ge.default.red(t)}function Kk(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 B_(e,t,r){let i={"content-type":"application/json"};for(let o of L_){let a=r[o];a&&(i[o]=a)}let n=e.startsWith("http")?e:`http://${e}`;return{status:(await fetch(n,{method:"POST",headers:i,body:t})).status}}function Yk(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 Qk(e,t,r){process.stderr.write(`
615
729
  Cleaning up...`);try{await e.webhooks.remove(t),process.stderr.write(` Webhook ${t} deleted.
616
730
  `)}catch{process.stderr.write(` Failed to delete webhook ${t}.
617
- `)}r.close()}var sv=new f("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",g({context:`Start a local server that receives Resend webhook events in real time.
731
+ `)}r.close()}var N_=new h("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",g({context:`Start a local server that receives Resend webhook events in real time.
618
732
 
619
733
  You must provide a public URL (e.g. from ngrok or localtunnel) that
620
734
  points to the local server port. The CLI will:
@@ -625,26 +739,26 @@ points to the local server port. The CLI will:
625
739
  5. Delete the temporary webhook on exit (Ctrl+C)
626
740
 
627
741
  Important: your tunnel must forward traffic to the same port as --port (default 4318).
628
- 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 de(e.url,{message:"Public tunnel URL",placeholder:"https://example.ngrok-free.app",validate:h=>{if(!h)return"URL is required";if(!h.startsWith("https://")&&!h.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 s=e.events?.length?cr(e.events):void 0,o;s?.includes("all")?o=nt:s?.length?o=s:o=nt;let a=await te(r),u=r.json||!w(),c=(0,iv.createServer)(async(h,b)=>{if(h.method!=="POST"){b.writeHead(405).end("Method not allowed");return}let C=await mS(h),S;try{S=JSON.parse(C)}catch{b.writeHead(400).end("Invalid JSON");return}let O={};for(let P of nv){let x=h.headers[P];O[P]=Array.isArray(x)?x[0]:x}let{type:k,resourceId:T,detail:E}=lS(S);if(u){let P={timestamp:new Date().toISOString(),type:k,resource_id:T,payload:S};if(e.forwardTo)try{let{status:x}=await rv(e.forwardTo,C,O);P.forwarded={url:e.forwardTo,status:x}}catch(x){P.forwarded={url:e.forwardTo,error:x instanceof Error?x.message:"Unknown error"}}console.log(JSON.stringify(P))}else{let P=ye.default.dim(`[${cS()}]`),x=k.padEnd(20),A=T.padEnd(14);if(process.stderr.write(`${P} ${ye.default.bold(x)} ${ye.default.cyan(A)} ${E}
629
- `),e.forwardTo){let F=e.forwardTo.startsWith("http")?e.forwardTo:`http://${e.forwardTo}`;try{let{status:ue}=await rv(e.forwardTo,C,O);process.stderr.write(`${ye.default.dim(" -> POST")} ${F} ${ye.default.dim(`[${dS(ue)}]`)}
630
- `)}catch(ue){let me=ue instanceof Error?ue.message:"Unknown error";process.stderr.write(`${ye.default.dim(" -> POST")} ${F} ${ye.default.red(`[Error: ${me}]`)}
631
- `)}}}b.writeHead(200).end("OK")});try{await new Promise((h,b)=>{c.on("error",b),c.listen(n,h)})}catch(h){v({message:h instanceof Error?`Failed to start local server on port ${n}: ${h.message}`:`Failed to start local server on port ${n}`,code:"server_listen_error"},{json:r.json})}let d=$e("Setting up webhook listener...",r.quiet),l;try{let{data:h,error:b}=await a.webhooks.create({endpoint:i,events:o});(b||!h)&&(d.fail("Failed to create webhook"),c.close(),v({message:b?.message??"Unexpected empty response",code:"create_error"},{json:r.json})),l=h.id}catch(h){d.fail("Failed to create webhook"),c.close(),v({message:h instanceof Error?h.message:"Unknown error",code:"create_error"},{json:r.json})}if(d.stop("Webhook listener ready"),!u){let h=o.length===nt.length?"all events":o.length<=3?o.join(", "):`${o.slice(0,3).join(", ")} (+${o.length-3} more)`;if(process.stderr.write(`
632
- `),process.stderr.write(` ${ye.default.bold("Webhook:")} ${l}
633
- `),process.stderr.write(` ${ye.default.bold("Endpoint:")} ${i}
634
- `),process.stderr.write(` ${ye.default.bold("Events:")} ${h}
635
- `),process.stderr.write(` ${ye.default.bold("Server:")} http://localhost:${n}
636
- `),e.forwardTo){let b=e.forwardTo.startsWith("http")?e.forwardTo:`http://${e.forwardTo}`;process.stderr.write(` ${ye.default.bold("Forward:")} ${b}
742
+ 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 Re(e.url,{message:"Public tunnel URL",placeholder:"https://example.ngrok-free.app",validate:f=>{if(!f)return"URL is required";if(!f.startsWith("https://")&&!f.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)&&O({message:"Invalid port number.",code:"invalid_port"},{json:r.json});let s=e.events?.length?_i(e.events):void 0,o;s?.includes("all")?o=Vt:s?.length?o=s:o=Vt;let a=await _e(r),l=r.json||!D(),u=(0,H_.createServer)(async(f,b)=>{if(f.method!=="POST"){b.writeHead(405).end("Method not allowed");return}let S=await Yk(f),T;try{T=JSON.parse(S)}catch{b.writeHead(400).end("Invalid JSON");return}let x={};for(let _ of L_){let C=f.headers[_];x[_]=Array.isArray(C)?C[0]:C}let{type:E,resourceId:k,detail:w}=Wk(T);if(l){let _={timestamp:new Date().toISOString(),type:E,resource_id:k,payload:T};if(e.forwardTo)try{let{status:C}=await B_(e.forwardTo,S,x);_.forwarded={url:e.forwardTo,status:C}}catch(C){_.forwarded={url:e.forwardTo,error:C instanceof Error?C.message:"Unknown error"}}console.log(JSON.stringify(_))}else{let _=Ge.default.dim(`[${Uk()}]`),C=E.padEnd(20),P=k.padEnd(14);if(process.stderr.write(`${_} ${Ge.default.bold(C)} ${Ge.default.cyan(P)} ${w}
743
+ `),e.forwardTo){let q=e.forwardTo.startsWith("http")?e.forwardTo:`http://${e.forwardTo}`;try{let{status:M}=await B_(e.forwardTo,S,x);process.stderr.write(`${Ge.default.dim(" -> POST")} ${q} ${Ge.default.dim(`[${Vk(M)}]`)}
744
+ `)}catch(M){let $=M instanceof Error?M.message:"Unknown error";process.stderr.write(`${Ge.default.dim(" -> POST")} ${q} ${Ge.default.red(`[Error: ${$}]`)}
745
+ `)}}}b.writeHead(200).end("OK")});try{await new Promise((f,b)=>{u.on("error",b),u.listen(n,f)})}catch(f){O({message:f instanceof Error?`Failed to start local server on port ${n}: ${f.message}`:`Failed to start local server on port ${n}`,code:"server_listen_error"},{json:r.json})}let c=De("Setting up webhook listener...",r.quiet),d;try{let{data:f,error:b}=await a.webhooks.create({endpoint:i,events:o});(b||!f)&&(c.fail("Failed to create webhook"),u.close(),O({message:b?.message??"Unexpected empty response",code:"create_error"},{json:r.json})),d=f.id}catch(f){c.fail("Failed to create webhook"),u.close(),O({message:f instanceof Error?f.message:"Unknown error",code:"create_error"},{json:r.json})}if(c.stop("Webhook listener ready"),!l){let f=o.length===Vt.length?"all events":o.length<=3?o.join(", "):`${o.slice(0,3).join(", ")} (+${o.length-3} more)`;if(process.stderr.write(`
746
+ `),process.stderr.write(` ${Ge.default.bold("Webhook:")} ${d}
747
+ `),process.stderr.write(` ${Ge.default.bold("Endpoint:")} ${i}
748
+ `),process.stderr.write(` ${Ge.default.bold("Events:")} ${f}
749
+ `),process.stderr.write(` ${Ge.default.bold("Server:")} http://localhost:${n}
750
+ `),e.forwardTo){let b=e.forwardTo.startsWith("http")?e.forwardTo:`http://${e.forwardTo}`;process.stderr.write(` ${Ge.default.bold("Forward:")} ${b}
637
751
  `)}process.stderr.write(`
638
752
  Ready! Listening for webhook events. Press Ctrl+C to stop.
639
753
 
640
- `)}let p=!1,y=async()=>{p||(p=!0,await fS(a,l,c),process.exit(nr()))};ya(y),process.on("SIGTERM",y),await new Promise(()=>{})});var ov=new f("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 be("--status <status>","Enable or disable event delivery for this webhook").choices(["enabled","disabled"])).addHelpText("after",g({context:`At least one of --endpoint, --events, or --status must be provided.
754
+ `)}let p=!1,v=async()=>{p||(p=!0,await Qk(a,d,u),process.exit(oi()))};Ml(v),process.on("SIGTERM",v),await new Promise(()=>{})});var G_=new h("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 Le("--status <status>","Enable or disable event delivery for this webhook").choices(["enabled","disabled"])).addHelpText("after",g({context:`At least one of --endpoint, --events, or --status must be provided.
641
755
 
642
756
  --events replaces the entire event list (it is not additive).
643
757
  Use "all" as a shorthand for all 17 event types.
644
758
 
645
759
  --status controls whether events are delivered to this endpoint:
646
760
  enabled Events are delivered (default on creation)
647
- 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();!t.endpoint&&!t.events?.length&&!t.status&&v({message:"Provide at least one option to update: --endpoint, --events, or --status.",code:"no_changes"},{json:i.json});let n=t.events?.length?cr(t.events):void 0,s=n?.includes("all")?nt:n?.length?n:void 0;await W({spinner:{loading:"Updating webhook...",success:"Webhook updated",fail:"Failed to update webhook"},sdkCall:o=>o.webhooks.update(e,{...t.endpoint&&{endpoint:t.endpoint},...s?.length&&{events:s},...t.status&&{status:t.status}}),errorCode:"update_error",successMsg:`Webhook updated: ${e}`},i)});var av=new f("webhooks").description("Manage webhook endpoints for real-time event notifications").addHelpText("after",g({context:`Webhooks let you receive real-time event notifications from Resend at an HTTPS endpoint.
761
+ 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 I(e,wi,i);!t.endpoint&&!t.events?.length&&!t.status&&O({message:"Provide at least one option to update: --endpoint, --events, or --status.",code:"no_changes"},{json:i.json});let s=t.events?.length?_i(t.events):void 0,o=s?.includes("all")?Vt:s?.length?s:void 0;await le({spinner:{loading:"Updating webhook...",success:"Webhook updated",fail:"Failed to update webhook"},sdkCall:a=>a.webhooks.update(n,{...t.endpoint&&{endpoint:t.endpoint},...o?.length&&{events:o},...t.status&&{status:t.status}}),errorCode:"update_error",successMsg:`Webhook updated: ${n}`},i)});var U_=new h("webhooks").description("Manage webhook endpoints for real-time event notifications").addHelpText("after",g({context:`Webhooks let you receive real-time event notifications from Resend at an HTTPS endpoint.
648
762
  Payloads are signed with Svix headers for verification.
649
763
 
650
764
  Event categories (17 total):
@@ -656,20 +770,20 @@ Event categories (17 total):
656
770
 
657
771
  Signature verification (Svix):
658
772
  Each delivery includes headers: svix-id, svix-timestamp, svix-signature
659
- 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(Z2).addCommand(ev).addCommand(sv).addCommand(tv,{isDefault:!0}).addCommand(ov).addCommand(X2);var uv=require("node:path");Ce();G();var cv=new f("whoami").description("Show current authentication status").addHelpText("after",g({setup:!0,context:`Local only \u2014 no network calls.
773
+ 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(M_).addCommand(F_).addCommand(N_).addCommand(J_,{isDefault:!0}).addCommand(G_).addCommand(z_);var W_=require("node:path");We();ae();var V_=new h("whoami").description("Show current authentication status").addHelpText("after",g({setup:!0,context:`Local only \u2014 no network calls.
660
774
  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"}
661
- {"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 it(r.apiKey,i);if(!n){let u=i||rr(i),c=xe(),d=c.some(h=>h.name===u),l=i||process.env.RESEND_PROFILE||process.env.RESEND_TEAM,p=l&&!d?`Profile "${u}" not found.
662
- Available profiles: ${c.map(h=>h.name).join(", ")||"(none)"}`:"Not authenticated.\nRun `resend login` to get started.",y=l&&!d?"profile_not_found":"not_authenticated";if(r.json||!w()){$({authenticated:!1,...l&&!d?{profile:u}:{}},{json:r.json,exitCode:1});return}v({message:p,code:y},{json:!1});return}let s=n.profile??rr(i),o=(0,uv.join)(Ze(),"credentials.json");if(r.json||!w()){$({authenticated:!0,profile:s,api_key:Mt(n.key),source:n.source,config_path:o},{json:r.json});return}let a=n.source==="secure_storage"?"secure storage":n.source==="config"?"config file":n.source==="env"?"environment variable":"flag";console.log(""),console.log(` Profile: ${s}`),console.log(` API Key: ${Mt(n.key)}`),console.log(` Source: ${a}`),console.log(` Config: ${o}`),console.log("")});var hS=[" \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 lv(){process.stdout.write(`
663
- `);for(let e of hS)process.stdout.write(`${e}
775
+ {"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 Dr(r.apiKey,i);if(!n){let u=i||ni(i),c=Ke(),d=c.some(b=>b.name===u),p=i||process.env.RESEND_PROFILE||process.env.RESEND_TEAM,v=p&&!d?`Profile "${u}" not found.
776
+ Available profiles: ${c.map(b=>b.name).join(", ")||"(none)"}`:"Not authenticated.\nRun `resend login` to get started.",f=p&&!d?"profile_not_found":"not_authenticated";if(r.json||!D()){X({authenticated:!1,...p&&!d?{profile:u}:{}},{json:r.json,exitCode:1});return}O({message:v,code:f},{json:!1});return}let s=n.profile??ni(i),o=(0,W_.join)(It(),"credentials.json");if(r.json||!D()){X({authenticated:!0,profile:s,api_key:jr(n.key),source:n.source,...n.permission&&{permission:n.permission},config_path:o},{json:r.json});return}let a=n.source==="secure_storage"?"secure storage":n.source==="config"?"config file":n.source==="env"?"environment variable":"flag",l=n.permission==="sending_access"?"sending access":n.permission==="full_access"?"full access":void 0;console.log(""),console.log(` Profile: ${s}`),console.log(` API Key: ${jr(n.key)}`),console.log(` Source: ${a}`),l&&console.log(` Access: ${l}`),console.log(` Config: ${o}`),console.log("")});var Zk=[" \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 K_(){process.stdout.write(`
777
+ `);for(let e of Zk)process.stdout.write(`${e}
664
778
  `);process.stdout.write(`
665
- `)}dl();Mr();yt();Xb();var pl="",vv=[],_v=[],Bt=new f().name("resend").description("Resend CLI \u2014 email for developers").configureHelp({showGlobalOptions:!0,styleTitle:e=>lr.default.gray(e)}).configureOutput({writeErr:e=>{process.stderr.write(e.replace(/^error:/,()=>lr.default.red("error:")))}}).version(`${od} v${Y}`,"-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());pl=r.join(" ");let i=n=>n.options.filter(s=>n.getOptionValueSource(s.attributeName())==="cli").map(s=>s.long?.replace(/^--/,"")??s.short?.replace(/^-/,"")??"").filter(Boolean);vv=i(t),_v=i(e),t.optsWithGlobals().quiet&&e.setOptionValue("json",!0),t.optsWithGlobals().insecureStorage&&(process.env.RESEND_CREDENTIAL_STORE="file")}).addHelpText("after",`
666
- ${lr.default.gray("Examples:")}
779
+ `)}rp();nn();fr();Uv();var ip="",i1=[],n1=[],Br=new h().name("resend").description("Resend CLI \u2014 email for developers").configureHelp({showGlobalOptions:!0,styleTitle:e=>Ci.default.gray(e)}).configureOutput({writeErr:e=>{process.stderr.write(e.replace(/^error:/,()=>Ci.default.red("error:")))}}).version(`${Zp} v${ve}`,"-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());ip=r.join(" ");let i=n=>n.options.filter(s=>n.getOptionValueSource(s.attributeName())==="cli").map(s=>s.long?.replace(/^--/,"")??s.short?.replace(/^-/,"")??"").filter(Boolean);i1=i(t),n1=i(e),t.optsWithGlobals().quiet&&e.setOptionValue("json",!0),t.optsWithGlobals().insecureStorage&&(process.env.RESEND_CREDENTIAL_STORE="file")}).addHelpText("after",`
780
+ ${Ci.default.gray("Examples:")}
667
781
 
668
782
  - Login to Resend
669
783
 
670
- ${lr.default.blue("$ resend login")}
784
+ ${Ci.default.blue("$ resend login")}
671
785
 
672
786
  - Send an email
673
787
 
674
- ${lr.default.blue("$ resend emails send")}
675
- `).action(()=>{process.stdout.isTTY&&lv();let e=Bt.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}),Bt.help()}).addCommand(Sa).addCommand(k2).addCommand(w0).addCommand(H2).addCommand(U0).addCommand(j0).addCommand(j2).addCommand(K2).addCommand(a2).addCommand(u0).addCommand(av).addCommand(h0).addCommand(xa).addCommand(cv).addCommand(Z0).addCommand(A2).addCommand(Y2).addCommand(ul),yv=new f("telemetry").description("Telemetry management").helpCommand(!1);yv.command("flush").argument("<file>").action(async e=>{let{flushFromFile:t}=await Promise.resolve().then(()=>(dl(),gv));await t(e)});Bt.addCommand(yv,{hidden:!0});var bv=Bt.options.find(e=>e.long==="--team");bv&&(bv.hidden=!0);Bt.parseAsync().then(()=>{let e=Bt.args[0];if(!(e==="update"||e==="telemetry"))return pl&&ll(pl,{...Bt.opts(),flags:vv,globalFlags:_v}),Q0().catch(()=>{})}).catch(e=>{v({message:U(e,"An unexpected error occurred"),code:"unexpected_error"})});
788
+ ${Ci.default.blue("$ resend emails send")}
789
+ `).action(()=>{process.stdout.isTTY&&K_();let e=Br.opts();e.apiKey&&O({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}),Br.help()}).addCommand(Jl).addCommand(d_).addCommand(ty).addCommand(E_).addCommand($y).addCommand(by).addCommand(b_).addCommand(I_).addCommand(Uy).addCommand(i2).addCommand(U_).addCommand(c2).addCommand(Bl).addCommand(V_).addCommand(My).addCommand(p_).addCommand(q_).addCommand(Xd).addCommand(cy),s1=new h("telemetry").description("Telemetry management").helpCommand(!1);s1.command("flush").argument("<file>").action(async e=>{let{flushFromFile:t}=await Promise.resolve().then(()=>(rp(),t1));await t(e)});Br.addCommand(s1,{hidden:!0});var r1=Br.options.find(e=>e.long==="--team");r1&&(r1.hidden=!0);Br.parseAsync().then(()=>{let e=Br.args[0];if(!(e==="update"||e==="telemetry"))return ip&&tp(ip,{...Br.opts(),flags:i1,globalFlags:n1}),Ry().catch(()=>{})}).catch(e=>{O({message:ne(e,"An unexpected error occurred"),code:"unexpected_error"})});