@sequenzy/cli 0.0.187 → 0.0.189

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -191,7 +191,7 @@ Check the top-level render call using <`+Be+">."}return de}}function Gr(T,de){{i
191
191
  <%s {...props} />
192
192
  React keys must be passed directly to JSX without using spread:
193
193
  let props = %s;
194
- <%s key={someKey} {...props} />`,Ts,bi,$s,bi),gc[bi+Ts]=!0}}if(T===n)Pr(dn);else No(dn);return dn}}var fr=Rl;Fye.Fragment=n,Fye.jsxDEV=fr})()});var dw={};SZ(dw,{program:()=>sQ,createCommand:()=>aQ,createOption:()=>cQ,createArgument:()=>lQ,Command:()=>uQ,Option:()=>dQ,Argument:()=>pQ,Help:()=>mQ,CommanderError:()=>fQ,InvalidArgumentError:()=>gQ,InvalidOptionArgumentError:()=>AQ},{program:(Y0e)=>sQ=Y0e,createCommand:(Y0e)=>aQ=Y0e,createOption:(Y0e)=>cQ=Y0e,createArgument:(Y0e)=>lQ=Y0e,Command:(Y0e)=>uQ=Y0e,Option:(Y0e)=>dQ=Y0e,Argument:(Y0e)=>pQ=Y0e,Help:(Y0e)=>mQ=Y0e,CommanderError:(Y0e)=>fQ=Y0e,InvalidArgumentError:(Y0e)=>gQ=Y0e,InvalidOptionArgumentError:(Y0e)=>AQ=Y0e});var{Argument:rQ}=mh(),{Command:uw}=nQ(),{CommanderError:t9,InvalidArgumentError:oQ}=jm(),{Help:n9}=sw(),{Option:iQ}=aw();var sQ=new uw,aQ=(e)=>new uw(e),cQ=(e,t)=>new iQ(e,t),lQ=(e,t)=>new rQ(e,t),uQ=uw,dQ=iQ,pQ=rQ,mQ=n9,fQ=t9,gQ=oQ,AQ=oQ;var{program:X0e,createCommand:eDe,createArgument:tDe,createOption:nDe,CommanderError:hQ,InvalidArgumentError:rDe,InvalidOptionArgumentError:oDe,Command:yQ,Argument:iDe,Option:sDe,Help:aDe}=dw;var fh={name:"@sequenzy/cli",version:"0.0.187",description:"Sequenzy CLI for email marketing from the terminal",type:"module",bin:{sequenzy:"./dist/index.js"},main:"./src/index.tsx",types:"./src/index.tsx",exports:{".":"./src/index.tsx"},scripts:{dev:"bun --watch src/index.tsx",build:"bun ../../scripts/build-ink-cli.ts",start:"node dist/index.js",lint:"eslint src","type-check":"bun check",test:"sh ../../scripts/run-package-tests.sh src","test:watch":"bun test --watch",prepublishOnly:"bun run build"},dependencies:{commander:"^12.1.0",ink:"^5.0.1","ink-spinner":"^5.0.0","ink-text-input":"^6.0.0","ink-select-input":"^6.0.0","ink-table":"^3.1.0",open:"^10.1.0",react:"^18.3.1",conf:"^13.0.0"},devDependencies:{"@emailer/shared":"workspace:*","@types/bun":"latest","@types/node":"^22.0.0","@types/react":"^18.3.0","bun-types":"latest",typescript:"^7.0.2"},files:["dist"],keywords:["sequenzy","email","cli","marketing"],license:"MIT",repository:{type:"git",url:"https://github.com/sequenzy/sequenzy"}};import{isDeepStrictEqual as Ace}from"node:util";import d1 from"node:process";import au from"node:fs";import p1 from"node:path";import ff from"node:crypto";import hce from"node:assert";var eu=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")};var pw=new Set(["__proto__","prototype","constructor"]),o9=new Set("0123456789");function gh(e){let t=[],n="",r="start",o=!1;for(let a of e)switch(a){case"\\":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(o)n+=a;r="property",o=!o;break}case".":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="property";break}if(o){o=!1,n+=a;break}if(pw.has(n))return[];t.push(n),n="",r="property";break}case"[":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="index";break}if(o){o=!1,n+=a;break}if(r==="property"){if(pw.has(n))return[];t.push(n),n=""}r="index";break}case"]":{if(r==="index"){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if(r==="indexEnd")throw Error("Invalid character after an index")}default:{if(r==="index"&&!o9.has(a))throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(r==="start")r="property";if(o)o=!1,n+="\\";n+=a}}if(o)n+="\\";switch(r){case"property":{if(pw.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function mw(e,t){if(typeof t!=="number"&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function bQ(e,t){if(mw(e,t))throw Error("Cannot use string index")}function vQ(e,t,n){if(!eu(e)||typeof t!=="string")return n===void 0?e:n;let r=gh(t);if(r.length===0)return n;for(let o=0;o<r.length;o++){let a=r[o];if(mw(e,a))e=o===r.length-1?void 0:null;else e=e[a];if(e===void 0||e===null){if(o!==r.length-1)return n;break}}return e===void 0?n:e}function fw(e,t,n){if(!eu(e)||typeof t!=="string")return e;let r=e,o=gh(t);for(let a=0;a<o.length;a++){let c=o[a];if(bQ(e,c),a===o.length-1)e[c]=n;else if(!eu(e[c]))e[c]=typeof o[a+1]==="number"?[]:{};e=e[c]}return r}function EQ(e,t){if(!eu(e)||typeof t!=="string")return!1;let n=gh(t);for(let r=0;r<n.length;r++){let o=n[r];if(bQ(e,o),r===n.length-1)return delete e[o],!0;if(e=e[o],!eu(e))return!1}}function IQ(e,t){if(!eu(e)||typeof t!=="string")return!1;let n=gh(t);if(n.length===0)return!1;for(let r of n){if(!eu(e)||!(r in e)||mw(e,r))return!1;e=e[r]}return!0}import Yn from"node:path";import CQ from"node:os";import gw from"node:process";var Nc=CQ.homedir(),Aw=CQ.tmpdir(),{env:Cd}=gw,i9=(e)=>{let t=Yn.join(Nc,"Library");return{data:Yn.join(t,"Application Support",e),config:Yn.join(t,"Preferences",e),cache:Yn.join(t,"Caches",e),log:Yn.join(t,"Logs",e),temp:Yn.join(Aw,e)}},s9=(e)=>{let t=Cd.APPDATA||Yn.join(Nc,"AppData","Roaming"),n=Cd.LOCALAPPDATA||Yn.join(Nc,"AppData","Local");return{data:Yn.join(n,e,"Data"),config:Yn.join(t,e,"Config"),cache:Yn.join(n,e,"Cache"),log:Yn.join(n,e,"Log"),temp:Yn.join(Aw,e)}},a9=(e)=>{let t=Yn.basename(Nc);return{data:Yn.join(Cd.XDG_DATA_HOME||Yn.join(Nc,".local","share"),e),config:Yn.join(Cd.XDG_CONFIG_HOME||Yn.join(Nc,".config"),e),cache:Yn.join(Cd.XDG_CACHE_HOME||Yn.join(Nc,".cache"),e),log:Yn.join(Cd.XDG_STATE_HOME||Yn.join(Nc,".local","state"),e),temp:Yn.join(Aw,t,e)}};function hw(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(gw.platform==="darwin")return i9(e);if(gw.platform==="win32")return s9(e);return a9(e)}import g9 from"node:path";import nn from"node:fs";import{promisify as wo}from"node:util";var c9=(e,t)=>{let{onError:n}=t;return function(...o){return e.apply(void 0,o).catch(n)}},ra=c9;var l9=(e,t)=>{let{onError:n}=t;return function(...o){try{return e.apply(void 0,o)}catch(a){return n(a)}}},bs=l9;var wQ=250;var u9=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:a}=o,c=o.interval??wQ,l=Date.now()+a;return function d(...f){return e.apply(void 0,f).catch((h)=>{if(!n(h))throw h;if(Date.now()>=l)throw h;let y=Math.round(c*Math.random());if(y>0)return new Promise((C)=>setTimeout(C,y)).then(()=>d.apply(void 0,f));else return d.apply(void 0,f)})}}},oa=u9;var d9=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:a}=o,c=Date.now()+a;return function(...d){while(!0)try{return e.apply(void 0,d)}catch(f){if(!n(f))throw f;if(Date.now()>=c)throw f;continue}}}},ia=d9;import DQ from"node:process";var zm={isChangeErrorOk:(e)=>{if(!zm.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!SQ&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!zm.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!zm.isNodeError(e))throw e;if(zm.isChangeErrorOk(e))return;throw e}},yw=zm;var Mm={onError:yw.onChangeError},ri={onError:()=>{return}},SQ=DQ.getuid?!DQ.getuid():!1,Ao={isRetriable:yw.isRetriableError};var p9={attempt:{chmod:ra(wo(nn.chmod),Mm),chown:ra(wo(nn.chown),Mm),close:ra(wo(nn.close),ri),fsync:ra(wo(nn.fsync),ri),mkdir:ra(wo(nn.mkdir),ri),realpath:ra(wo(nn.realpath),ri),stat:ra(wo(nn.stat),ri),unlink:ra(wo(nn.unlink),ri),chmodSync:bs(nn.chmodSync,Mm),chownSync:bs(nn.chownSync,Mm),closeSync:bs(nn.closeSync,ri),existsSync:bs(nn.existsSync,ri),fsyncSync:bs(nn.fsync,ri),mkdirSync:bs(nn.mkdirSync,ri),realpathSync:bs(nn.realpathSync,ri),statSync:bs(nn.statSync,ri),unlinkSync:bs(nn.unlinkSync,ri)},retry:{close:oa(wo(nn.close),Ao),fsync:oa(wo(nn.fsync),Ao),open:oa(wo(nn.open),Ao),readFile:oa(wo(nn.readFile),Ao),rename:oa(wo(nn.rename),Ao),stat:oa(wo(nn.stat),Ao),write:oa(wo(nn.write),Ao),writeFile:oa(wo(nn.writeFile),Ao),closeSync:ia(nn.closeSync,Ao),fsyncSync:ia(nn.fsyncSync,Ao),openSync:ia(nn.openSync,Ao),readFileSync:ia(nn.readFileSync,Ao),renameSync:ia(nn.renameSync,Ao),statSync:ia(nn.statSync,Ao),writeSync:ia(nn.writeSync,Ao),writeFileSync:ia(nn.writeFileSync,Ao)}},Xr=p9;import tu from"node:process";var BQ="utf8",bw=438,xQ=511;var _Q={},kQ=tu.geteuid?tu.geteuid():-1,RQ=tu.getegid?tu.getegid():-1;var QQ=1000,TQ=!!tu.getuid,qDe=tu.getuid?!tu.getuid():!1,vw=128;var $Q=(e)=>e instanceof Error&&("code"in e);var Ew=(e)=>typeof e==="string",Ah=(e)=>e===void 0;import f9 from"node:path";import wd from"node:process";import NQ from"node:process";var OQ=NQ.platform==="linux",hh=NQ.platform==="win32";var Iw=["SIGHUP","SIGINT","SIGTERM"];if(!hh)Iw.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(OQ)Iw.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var PQ=Iw;class qQ{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(hh&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))wd.kill(wd.pid,"SIGTERM");else wd.kill(wd.pid,e)},this.hook=()=>{wd.once("exit",()=>this.exit());for(let e of PQ)try{wd.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var FQ=new qQ;var m9=FQ.register,LQ=m9;var Bi={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=Date.now().toString().slice(-10),r="tmp-",o=`.tmp-${n}${t}`;return`${e}${o}`},get:(e,t,n=!0)=>{let r=Bi.truncate(t(e));if(r in Bi.store)return Bi.get(e,t,n);return Bi.store[r]=n,[r,()=>delete Bi.store[r]]},purge:(e)=>{if(!Bi.store[e])return;delete Bi.store[e],Xr.attempt.unlink(e)},purgeSync:(e)=>{if(!Bi.store[e])return;delete Bi.store[e],Xr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Bi.store)Bi.purgeSync(e)},truncate:(e)=>{let t=f9.basename(e);if(t.length<=vw)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-vw;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};LQ(Bi.purgeSyncAll);var Hm=Bi;function Cw(e,t,n=_Q){if(Ew(n))return Cw(e,t,{encoding:n});let o={timeout:n.timeout??QQ},a=null,c=null,l=null;try{let d=Xr.attempt.realpathSync(e),f=!!d;e=d||e,[c,a]=Hm.get(e,n.tmpCreate||Hm.create,n.tmpPurge!==!1);let h=TQ&&Ah(n.chown),y=Ah(n.mode);if(f&&(h||y)){let v=Xr.attempt.statSync(e);if(v){if(n={...n},h)n.chown={uid:v.uid,gid:v.gid};if(y)n.mode=v.mode}}if(!f){let v=g9.dirname(e);Xr.attempt.mkdirSync(v,{mode:xQ,recursive:!0})}if(l=Xr.retry.openSync(o)(c,"w",n.mode||bw),n.tmpCreated)n.tmpCreated(c);if(Ew(t))Xr.retry.writeSync(o)(l,t,0,n.encoding||BQ);else if(!Ah(t))Xr.retry.writeSync(o)(l,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)Xr.retry.fsyncSync(o)(l);else Xr.attempt.fsync(l);if(Xr.retry.closeSync(o)(l),l=null,n.chown&&(n.chown.uid!==kQ||n.chown.gid!==RQ))Xr.attempt.chownSync(c,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==bw)Xr.attempt.chmodSync(c,n.mode);try{Xr.retry.renameSync(o)(c,e)}catch(v){if(!$Q(v))throw v;if(v.code!=="ENAMETOOLONG")throw v;Xr.retry.renameSync(o)(c,Hm.truncate(e))}a(),c=null}finally{if(l)Xr.attempt.closeSync(l);if(c)Hm.purge(c)}}var f1=yt(YP(),1),g1=yt(bq(),1);var lie=(e,t,n,r)=>{if(n==="length"||n==="prototype")return;if(n==="arguments"||n==="caller")return;let o=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);if(!uie(o,a)&&r)return;Object.defineProperty(e,n,a)},uie=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},die=(e,t)=>{let n=Object.getPrototypeOf(t);if(n===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,n)},pie=(e,t)=>`/* Wrapped ${e}*/
194
+ <%s key={someKey} {...props} />`,Ts,bi,$s,bi),gc[bi+Ts]=!0}}if(T===n)Pr(dn);else No(dn);return dn}}var fr=Rl;Fye.Fragment=n,Fye.jsxDEV=fr})()});var dw={};SZ(dw,{program:()=>sQ,createCommand:()=>aQ,createOption:()=>cQ,createArgument:()=>lQ,Command:()=>uQ,Option:()=>dQ,Argument:()=>pQ,Help:()=>mQ,CommanderError:()=>fQ,InvalidArgumentError:()=>gQ,InvalidOptionArgumentError:()=>AQ},{program:(Y0e)=>sQ=Y0e,createCommand:(Y0e)=>aQ=Y0e,createOption:(Y0e)=>cQ=Y0e,createArgument:(Y0e)=>lQ=Y0e,Command:(Y0e)=>uQ=Y0e,Option:(Y0e)=>dQ=Y0e,Argument:(Y0e)=>pQ=Y0e,Help:(Y0e)=>mQ=Y0e,CommanderError:(Y0e)=>fQ=Y0e,InvalidArgumentError:(Y0e)=>gQ=Y0e,InvalidOptionArgumentError:(Y0e)=>AQ=Y0e});var{Argument:rQ}=mh(),{Command:uw}=nQ(),{CommanderError:t9,InvalidArgumentError:oQ}=jm(),{Help:n9}=sw(),{Option:iQ}=aw();var sQ=new uw,aQ=(e)=>new uw(e),cQ=(e,t)=>new iQ(e,t),lQ=(e,t)=>new rQ(e,t),uQ=uw,dQ=iQ,pQ=rQ,mQ=n9,fQ=t9,gQ=oQ,AQ=oQ;var{program:X0e,createCommand:eDe,createArgument:tDe,createOption:nDe,CommanderError:hQ,InvalidArgumentError:rDe,InvalidOptionArgumentError:oDe,Command:yQ,Argument:iDe,Option:sDe,Help:aDe}=dw;var fh={name:"@sequenzy/cli",version:"0.0.189",description:"Sequenzy CLI for email marketing from the terminal",type:"module",bin:{sequenzy:"./dist/index.js"},main:"./src/index.tsx",types:"./src/index.tsx",exports:{".":"./src/index.tsx"},scripts:{dev:"bun --watch src/index.tsx",build:"bun ../../scripts/build-ink-cli.ts",start:"node dist/index.js",lint:"eslint src","type-check":"bun check",test:"sh ../../scripts/run-package-tests.sh src","test:watch":"bun test --watch",prepublishOnly:"bun run build"},dependencies:{commander:"^12.1.0",ink:"^5.0.1","ink-spinner":"^5.0.0","ink-text-input":"^6.0.0","ink-select-input":"^6.0.0","ink-table":"^3.1.0",open:"^10.1.0",react:"^18.3.1",conf:"^13.0.0"},devDependencies:{"@emailer/shared":"workspace:*","@types/bun":"latest","@types/node":"^22.0.0","@types/react":"^18.3.0","bun-types":"latest",typescript:"^7.0.2"},files:["dist"],keywords:["sequenzy","email","cli","marketing"],license:"MIT",repository:{type:"git",url:"https://github.com/sequenzy/sequenzy"}};import{isDeepStrictEqual as Ace}from"node:util";import d1 from"node:process";import au from"node:fs";import p1 from"node:path";import ff from"node:crypto";import hce from"node:assert";var eu=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")};var pw=new Set(["__proto__","prototype","constructor"]),o9=new Set("0123456789");function gh(e){let t=[],n="",r="start",o=!1;for(let a of e)switch(a){case"\\":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(o)n+=a;r="property",o=!o;break}case".":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="property";break}if(o){o=!1,n+=a;break}if(pw.has(n))return[];t.push(n),n="",r="property";break}case"[":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="index";break}if(o){o=!1,n+=a;break}if(r==="property"){if(pw.has(n))return[];t.push(n),n=""}r="index";break}case"]":{if(r==="index"){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if(r==="indexEnd")throw Error("Invalid character after an index")}default:{if(r==="index"&&!o9.has(a))throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(r==="start")r="property";if(o)o=!1,n+="\\";n+=a}}if(o)n+="\\";switch(r){case"property":{if(pw.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function mw(e,t){if(typeof t!=="number"&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function bQ(e,t){if(mw(e,t))throw Error("Cannot use string index")}function vQ(e,t,n){if(!eu(e)||typeof t!=="string")return n===void 0?e:n;let r=gh(t);if(r.length===0)return n;for(let o=0;o<r.length;o++){let a=r[o];if(mw(e,a))e=o===r.length-1?void 0:null;else e=e[a];if(e===void 0||e===null){if(o!==r.length-1)return n;break}}return e===void 0?n:e}function fw(e,t,n){if(!eu(e)||typeof t!=="string")return e;let r=e,o=gh(t);for(let a=0;a<o.length;a++){let c=o[a];if(bQ(e,c),a===o.length-1)e[c]=n;else if(!eu(e[c]))e[c]=typeof o[a+1]==="number"?[]:{};e=e[c]}return r}function EQ(e,t){if(!eu(e)||typeof t!=="string")return!1;let n=gh(t);for(let r=0;r<n.length;r++){let o=n[r];if(bQ(e,o),r===n.length-1)return delete e[o],!0;if(e=e[o],!eu(e))return!1}}function IQ(e,t){if(!eu(e)||typeof t!=="string")return!1;let n=gh(t);if(n.length===0)return!1;for(let r of n){if(!eu(e)||!(r in e)||mw(e,r))return!1;e=e[r]}return!0}import Yn from"node:path";import CQ from"node:os";import gw from"node:process";var Nc=CQ.homedir(),Aw=CQ.tmpdir(),{env:Cd}=gw,i9=(e)=>{let t=Yn.join(Nc,"Library");return{data:Yn.join(t,"Application Support",e),config:Yn.join(t,"Preferences",e),cache:Yn.join(t,"Caches",e),log:Yn.join(t,"Logs",e),temp:Yn.join(Aw,e)}},s9=(e)=>{let t=Cd.APPDATA||Yn.join(Nc,"AppData","Roaming"),n=Cd.LOCALAPPDATA||Yn.join(Nc,"AppData","Local");return{data:Yn.join(n,e,"Data"),config:Yn.join(t,e,"Config"),cache:Yn.join(n,e,"Cache"),log:Yn.join(n,e,"Log"),temp:Yn.join(Aw,e)}},a9=(e)=>{let t=Yn.basename(Nc);return{data:Yn.join(Cd.XDG_DATA_HOME||Yn.join(Nc,".local","share"),e),config:Yn.join(Cd.XDG_CONFIG_HOME||Yn.join(Nc,".config"),e),cache:Yn.join(Cd.XDG_CACHE_HOME||Yn.join(Nc,".cache"),e),log:Yn.join(Cd.XDG_STATE_HOME||Yn.join(Nc,".local","state"),e),temp:Yn.join(Aw,t,e)}};function hw(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(gw.platform==="darwin")return i9(e);if(gw.platform==="win32")return s9(e);return a9(e)}import g9 from"node:path";import nn from"node:fs";import{promisify as wo}from"node:util";var c9=(e,t)=>{let{onError:n}=t;return function(...o){return e.apply(void 0,o).catch(n)}},ra=c9;var l9=(e,t)=>{let{onError:n}=t;return function(...o){try{return e.apply(void 0,o)}catch(a){return n(a)}}},bs=l9;var wQ=250;var u9=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:a}=o,c=o.interval??wQ,l=Date.now()+a;return function d(...f){return e.apply(void 0,f).catch((h)=>{if(!n(h))throw h;if(Date.now()>=l)throw h;let y=Math.round(c*Math.random());if(y>0)return new Promise((C)=>setTimeout(C,y)).then(()=>d.apply(void 0,f));else return d.apply(void 0,f)})}}},oa=u9;var d9=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:a}=o,c=Date.now()+a;return function(...d){while(!0)try{return e.apply(void 0,d)}catch(f){if(!n(f))throw f;if(Date.now()>=c)throw f;continue}}}},ia=d9;import DQ from"node:process";var zm={isChangeErrorOk:(e)=>{if(!zm.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!SQ&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!zm.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!zm.isNodeError(e))throw e;if(zm.isChangeErrorOk(e))return;throw e}},yw=zm;var Mm={onError:yw.onChangeError},ri={onError:()=>{return}},SQ=DQ.getuid?!DQ.getuid():!1,Ao={isRetriable:yw.isRetriableError};var p9={attempt:{chmod:ra(wo(nn.chmod),Mm),chown:ra(wo(nn.chown),Mm),close:ra(wo(nn.close),ri),fsync:ra(wo(nn.fsync),ri),mkdir:ra(wo(nn.mkdir),ri),realpath:ra(wo(nn.realpath),ri),stat:ra(wo(nn.stat),ri),unlink:ra(wo(nn.unlink),ri),chmodSync:bs(nn.chmodSync,Mm),chownSync:bs(nn.chownSync,Mm),closeSync:bs(nn.closeSync,ri),existsSync:bs(nn.existsSync,ri),fsyncSync:bs(nn.fsync,ri),mkdirSync:bs(nn.mkdirSync,ri),realpathSync:bs(nn.realpathSync,ri),statSync:bs(nn.statSync,ri),unlinkSync:bs(nn.unlinkSync,ri)},retry:{close:oa(wo(nn.close),Ao),fsync:oa(wo(nn.fsync),Ao),open:oa(wo(nn.open),Ao),readFile:oa(wo(nn.readFile),Ao),rename:oa(wo(nn.rename),Ao),stat:oa(wo(nn.stat),Ao),write:oa(wo(nn.write),Ao),writeFile:oa(wo(nn.writeFile),Ao),closeSync:ia(nn.closeSync,Ao),fsyncSync:ia(nn.fsyncSync,Ao),openSync:ia(nn.openSync,Ao),readFileSync:ia(nn.readFileSync,Ao),renameSync:ia(nn.renameSync,Ao),statSync:ia(nn.statSync,Ao),writeSync:ia(nn.writeSync,Ao),writeFileSync:ia(nn.writeFileSync,Ao)}},Xr=p9;import tu from"node:process";var BQ="utf8",bw=438,xQ=511;var _Q={},kQ=tu.geteuid?tu.geteuid():-1,RQ=tu.getegid?tu.getegid():-1;var QQ=1000,TQ=!!tu.getuid,qDe=tu.getuid?!tu.getuid():!1,vw=128;var $Q=(e)=>e instanceof Error&&("code"in e);var Ew=(e)=>typeof e==="string",Ah=(e)=>e===void 0;import f9 from"node:path";import wd from"node:process";import NQ from"node:process";var OQ=NQ.platform==="linux",hh=NQ.platform==="win32";var Iw=["SIGHUP","SIGINT","SIGTERM"];if(!hh)Iw.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(OQ)Iw.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var PQ=Iw;class qQ{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(hh&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))wd.kill(wd.pid,"SIGTERM");else wd.kill(wd.pid,e)},this.hook=()=>{wd.once("exit",()=>this.exit());for(let e of PQ)try{wd.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var FQ=new qQ;var m9=FQ.register,LQ=m9;var Bi={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=Date.now().toString().slice(-10),r="tmp-",o=`.tmp-${n}${t}`;return`${e}${o}`},get:(e,t,n=!0)=>{let r=Bi.truncate(t(e));if(r in Bi.store)return Bi.get(e,t,n);return Bi.store[r]=n,[r,()=>delete Bi.store[r]]},purge:(e)=>{if(!Bi.store[e])return;delete Bi.store[e],Xr.attempt.unlink(e)},purgeSync:(e)=>{if(!Bi.store[e])return;delete Bi.store[e],Xr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Bi.store)Bi.purgeSync(e)},truncate:(e)=>{let t=f9.basename(e);if(t.length<=vw)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-vw;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};LQ(Bi.purgeSyncAll);var Hm=Bi;function Cw(e,t,n=_Q){if(Ew(n))return Cw(e,t,{encoding:n});let o={timeout:n.timeout??QQ},a=null,c=null,l=null;try{let d=Xr.attempt.realpathSync(e),f=!!d;e=d||e,[c,a]=Hm.get(e,n.tmpCreate||Hm.create,n.tmpPurge!==!1);let h=TQ&&Ah(n.chown),y=Ah(n.mode);if(f&&(h||y)){let v=Xr.attempt.statSync(e);if(v){if(n={...n},h)n.chown={uid:v.uid,gid:v.gid};if(y)n.mode=v.mode}}if(!f){let v=g9.dirname(e);Xr.attempt.mkdirSync(v,{mode:xQ,recursive:!0})}if(l=Xr.retry.openSync(o)(c,"w",n.mode||bw),n.tmpCreated)n.tmpCreated(c);if(Ew(t))Xr.retry.writeSync(o)(l,t,0,n.encoding||BQ);else if(!Ah(t))Xr.retry.writeSync(o)(l,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)Xr.retry.fsyncSync(o)(l);else Xr.attempt.fsync(l);if(Xr.retry.closeSync(o)(l),l=null,n.chown&&(n.chown.uid!==kQ||n.chown.gid!==RQ))Xr.attempt.chownSync(c,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==bw)Xr.attempt.chmodSync(c,n.mode);try{Xr.retry.renameSync(o)(c,e)}catch(v){if(!$Q(v))throw v;if(v.code!=="ENAMETOOLONG")throw v;Xr.retry.renameSync(o)(c,Hm.truncate(e))}a(),c=null}finally{if(l)Xr.attempt.closeSync(l);if(c)Hm.purge(c)}}var f1=yt(YP(),1),g1=yt(bq(),1);var lie=(e,t,n,r)=>{if(n==="length"||n==="prototype")return;if(n==="arguments"||n==="caller")return;let o=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);if(!uie(o,a)&&r)return;Object.defineProperty(e,n,a)},uie=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},die=(e,t)=>{let n=Object.getPrototypeOf(t);if(n===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,n)},pie=(e,t)=>`/* Wrapped ${e}*/
195
195
  ${t}`,mie=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),fie=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),gie=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=pie.bind(null,r,t.toString());Object.defineProperty(o,"name",fie);let{writable:a,enumerable:c,configurable:l}=mie;Object.defineProperty(e,"toString",{value:o,writable:a,enumerable:c,configurable:l})};function SS(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let o of Reflect.ownKeys(t))lie(e,t,o,n);return die(e,t),gie(e,t,r),e}var Aie=(e,t={})=>{if(typeof e!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:n=0,maxWait:r=Number.POSITIVE_INFINITY,before:o=!1,after:a=!0}=t;if(n<0||r<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!o&&!a)throw Error("Both `before` and `after` are false, function wouldn't be called.");let c,l,d,f=function(...h){let y=this,v=()=>{if(c=void 0,l)clearTimeout(l),l=void 0;if(a)d=e.apply(y,h)},C=()=>{if(l=void 0,c)clearTimeout(c),c=void 0;if(a)d=e.apply(y,h)},R=o&&!c;if(clearTimeout(c),c=setTimeout(v,n),r>0&&r!==Number.POSITIVE_INFINITY&&!l)l=setTimeout(C,r);if(R)d=e.apply(y,h);return d};return SS(f,e),f.cancel=()=>{if(c)clearTimeout(c),c=void 0;if(l)clearTimeout(l),l=void 0},f},DS=Aie;var cu=yt(a1(),1);var lce=Object.prototype.toString;function l1(e,t,n){if(!e)return!1;if(e.constructor===t)return!0;return lce.call(e)===n}function u1(e){return l1(e,Uint8Array,"[object Uint8Array]")}function uce(e){return l1(e,ArrayBuffer,"[object ArrayBuffer]")}function dce(e){return u1(e)||uce(e)}function pce(e){if(!u1(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function mce(e){if(!dce(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function LS(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((o,a)=>o+a.length,0);let n=new Uint8Array(t),r=0;for(let o of e)pce(o),n.set(o,r),r+=o.length;return n}var c1={utf8:new globalThis.TextDecoder("utf8")};function US(e,t="utf8"){return mce(e),c1[t]??=new globalThis.TextDecoder(t),c1[t].decode(e)}function fce(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}var gce=new globalThis.TextEncoder;function _y(e){return fce(e),gce.encode(e)}var Ske=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));var yce=g1.default.default,m1="aes-256-cbc",Yd=()=>Object.create(null),bce=(e)=>e!==void 0&&e!==null,vce=(e,t)=>{let n=new Set(["undefined","symbol","function"]),r=typeof t;if(n.has(r))throw TypeError(`Setting a value of type \`${r}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},ky="__internal__",jS=`${ky}.migrations.version`;class Ry{path;events;#r;#t;#e;#n={};constructor(e={}){let t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!t.cwd){if(!t.projectName)throw Error("Please specify the `projectName` option.");t.cwd=hw(t.projectName,{suffix:t.projectSuffix}).config}if(this.#e=t,t.schema??t.ajvOptions??t.rootSchema){if(t.schema&&typeof t.schema!=="object")throw TypeError("The `schema` option must be an object.");let a=new f1.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});yce(a);let c={...t.rootSchema,type:"object",properties:t.schema};this.#r=a.compile(c);for(let[l,d]of Object.entries(t.schema??{}))if(d?.default)this.#n[l]=d.default}if(t.defaults)this.#n={...this.#n,...t.defaults};if(t.serialize)this._serialize=t.serialize;if(t.deserialize)this._deserialize=t.deserialize;this.events=new EventTarget,this.#t=t.encryptionKey;let n=t.fileExtension?`.${t.fileExtension}`:"";this.path=p1.resolve(t.cwd,`${t.configName??"config"}${n}`);let r=this.store,o=Object.assign(Yd(),t.defaults,r);if(t.migrations){if(!t.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(t.migrations,t.projectVersion,t.beforeEachMigration)}this._validate(o);try{hce.deepEqual(r,o)}catch{this.store=o}if(t.watch)this._watch()}get(e,t){if(this.#e.accessPropertiesByDotNotation)return this._get(e,t);let{store:n}=this;return e in n?n[e]:t}set(e,t){if(typeof e!=="string"&&typeof e!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!=="object"&&t===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw TypeError(`Please don't use the ${ky} key, as it's used to manage this module internal operations.`);let{store:n}=this,r=(o,a)=>{if(vce(o,a),this.#e.accessPropertiesByDotNotation)fw(n,o,a);else n[o]=a};if(typeof e==="object"){let o=e;for(let[a,c]of Object.entries(o))r(a,c)}else r(e,t);this.store=n}has(e){if(this.#e.accessPropertiesByDotNotation)return IQ(this.store,e);return e in this.store}reset(...e){for(let t of e)if(bce(this.#n[t]))this.set(t,this.#n[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)EQ(t,e);else delete t[e];this.store=t}clear(){this.store=Yd();for(let e of Object.keys(this.#n))this.reset(e)}onDidChange(e,t){if(typeof e!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=au.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),n=this._deserialize(t);return this._validate(n),Object.assign(Yd(),n)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Yd();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Yd();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))yield[e,t]}_encryptData(e){if(!this.#t)return typeof e==="string"?e:US(e);try{let t=e.slice(0,16),n=ff.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),r=ff.createDecipheriv(m1,n,t),o=e.slice(17),a=typeof o==="string"?_y(o):o;return US(LS([r.update(a),r.final()]))}catch{}return e.toString()}_handleChange(e,t){let n=e(),r=()=>{let o=n,a=e();if(Ace(a,o))return;n=a,t.call(this,a,o)};return this.events.addEventListener("change",r),()=>{this.events.removeEventListener("change",r)}}_deserialize=(e)=>JSON.parse(e);_serialize=(e)=>JSON.stringify(e,void 0,"\t");_validate(e){if(!this.#r)return;if(this.#r(e)||!this.#r.errors)return;let n=this.#r.errors.map(({instancePath:r,message:o=""})=>`\`${r.slice(1)}\` ${o}`);throw Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){au.mkdirSync(p1.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let n=ff.randomBytes(16),r=ff.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),o=ff.createCipheriv(m1,r,n);t=LS([n,_y(":"),o.update(_y(t)),o.final()])}if(d1.env.SNAP)au.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{Cw(this.path,t,{mode:this.#e.configFileMode})}catch(n){if(n?.code==="EXDEV"){au.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw n}}_watch(){if(this._ensureDirectory(),!au.existsSync(this.path))this._write(Yd());if(d1.platform==="win32")au.watch(this.path,{persistent:!1},DS(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else au.watchFile(this.path,{persistent:!1},DS(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,n){let r=this._get(jS,"0.0.0"),o=Object.keys(e).filter((c)=>this._shouldPerformMigration(c,r,t)),a={...this.store};for(let c of o)try{if(n)n(this,{fromVersion:r,toVersion:c,finalVersion:t,versions:o});let l=e[c];l?.(this),this._set(jS,c),r=c,a={...this.store}}catch(l){throw this.store=a,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${l}`)}if(this._isVersionInRangeFormat(r)||!cu.default.eq(r,t))this._set(jS,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===ky)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${ky}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return cu.default.clean(e)===null}_shouldPerformMigration(e,t,n){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&cu.default.satisfies(t,e))return!1;return cu.default.satisfies(n,e)}if(cu.default.lte(e,t))return!1;if(cu.default.gt(e,n))return!1;return!0}_get(e,t){return vQ(this.store,e,t)}_set(e,t){let{store:n}=this;fw(n,e,t),this.store=n}}var zS="com.sequenzy.cli",MS="api-key",HS=typeof globalThis.Bun<"u",nl=new Ry({projectName:"sequenzy",schema:{userId:{type:"string"},userEmail:{type:"string"},_apiKey:{type:"string"}}});async function GS(){let e=process.env.SEQUENZY_API_KEY;if(e)return e;if(HS)try{let t=await globalThis.Bun.secrets.get({service:zS,name:MS});if(t)return t}catch{}return nl.get("_apiKey")}async function A1(e){if(HS)try{await globalThis.Bun.secrets.set({service:zS,name:MS,value:e,allowUnrestrictedAccess:!1});return}catch{}nl.set("_apiKey",e)}async function h1(){if(HS)try{await globalThis.Bun.secrets.delete({service:zS,name:MS})}catch{}nl.delete("_apiKey")}async function j(){return!!await GS()}function Qy(){return{userId:nl.get("userId"),userEmail:nl.get("userEmail")}}function y1(e){if(e.userId!==void 0)nl.set("userId",e.userId);if(e.userEmail!==void 0)nl.set("userEmail",e.userEmail)}function b1(){nl.clear()}function v1(e,t=Date.now()){if(!e?.trim())return;let n=e.trim();if(/^\d+$/.test(n)){let o=Number(n);return Number.isSafeInteger(o)?o:void 0}if(!/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), \d{2} [A-Z][a-z]{2} \d{4} \d{2}:\d{2}:\d{2} GMT$/.test(n))return;let r=Date.parse(n);if(!Number.isFinite(r)||new Date(r).toUTCString().slice(5)!==n.slice(5))return;return Math.max(0,Math.ceil((r-t)/1000))}function E1(e,t,n){if(e&&/^[A-Z][A-Z0-9_]{1,95}$/.test(e))return e;switch(t){case 0:return"NETWORK_ERROR";case 400:case 422:return"VALIDATION_ERROR";case 401:return"UNAUTHORIZED";case 403:return"FORBIDDEN";case 404:return"NOT_FOUND";case 409:return"CONFLICT";case 429:return"RATE_LIMITED";default:return t!==void 0?t>=500?"SERVER_ERROR":"HTTP_ERROR":n}}var Ece=process.env.SEQUENZY_API_URL??"https://api.sequenzy.com";class A extends Error{statusCode;rawDetails;code;retryAfterSeconds;constructor(e,t,n,r,o){super(e);this.statusCode=t;this.rawDetails=n;this.code=r;this.retryAfterSeconds=o;this.name="ApiError"}}function Ice(e,t){if(typeof e!=="string")return;if(typeof t!=="string"||t==="root")return e;let n=t.slice(1).replaceAll("/",".");return e.includes(`'${n}'`)?e:`${n}: ${e}`}function Cce(e){if(!e.trim())return{message:"Request failed"};try{let t=JSON.parse(e);if(typeof t==="string")return{message:t};if(!t||typeof t!=="object"||Array.isArray(t))return{message:"Request failed"};let n=t,r=n.error&&typeof n.error==="object"?n.error:void 0,o=r?.code??n.code,a=n.type==="validation"?Ice(n.summary,n.property):void 0,c=typeof n.error==="string"?n.error:typeof a==="string"?a:r?.message??n.message;return{message:typeof c==="string"?c:"Request failed",...typeof o==="string"?{code:o}:{}}}catch{return{message:e}}}async function E(e,t,n,r,o){let a=await GS();if(!a)throw new A("Not logged in. Run `sequenzy login` first.",401);let c={"Content-Type":"application/json",Authorization:`Bearer ${a}`,"x-sequenzy-client":`cli/${fh.version}`};if(r)c["x-company-id"]=r;Object.assign(c,o);let l;try{l=await fetch(`${Ece}${t}`,{method:e,headers:c,body:n?JSON.stringify(n):void 0})}catch(d){throw new A(d instanceof Error?d.message:"Failed to reach Sequenzy API",0,void 0,"NETWORK_ERROR")}if(!l.ok){let d=await l.text(),f=Cce(d);throw new A(f.message,l.status,d,f.code,v1(l.headers.get("Retry-After")))}return l.json()}var I1=!1;function JS(e){I1=e}function Ty(){return I1}var KS="https://docs.sequenzy.com",Wa=`${KS}/concepts/cli`,VS=`${KS}/authentication`,C1="https://sequenzy.com/dashboard";function w1(e){if(e instanceof A)return{message:e.message,statusCode:e.statusCode,code:e.code,rawDetails:e.rawDetails};if(e instanceof Error)return{message:e.message};return{message:String(e)}}function wce(e){let t=e.match(/api key is missing required scopes?:\s*(.+)$/i);if(!t?.[1])return[];return[...new Set(t[1].match(/[a-z_]+:[a-z_]+/gi)??[])]}function S1(e){let t=w1(e),n=t.message.trim()||"Unknown error",r=n.toLowerCase(),o=t.rawDetails?.trim()||n;if(t.code==="CLI_AUTH_REQUIRED"||r.includes("not logged in"))return{title:"Authentication required",description:"This command needs a Sequenzy API key, but the CLI could not find one in your local login state or environment.",howToFix:"Run `sequenzy login` and approve the session, or set `SEQUENZY_API_KEY` for non-interactive environments.",docsUrl:Wa,details:o};if(r.includes("already logged in"))return{title:"CLI already authenticated",description:"The CLI already has a saved Sequenzy login for this machine.",howToFix:"Run `sequenzy logout` first if you want to switch accounts, then run `sequenzy login` again.",docsUrl:Wa,details:o};if(t.statusCode===401||t.code==="UNAUTHORIZED")return{title:"Authentication failed",description:"The request reached Sequenzy, but the current API key was rejected.",howToFix:"Run `sequenzy login` again, or replace the key with a valid personal API key that still has access to your account.",docsUrl:VS,details:o};if(t.code==="COMPANY_CREATE_REQUIRES_PERSONAL_KEY")return{title:"Personal account key required",description:"Company creation is account-level and cannot be performed with a company/workspace-scoped API key.",howToFix:"Create or use a personal account key beginning with `seq_user_` from Account → API Keys, replace `SEQUENZY_API_KEY`, and retry the same command; alternatively, create the company in the Sequenzy dashboard. Widening the current company key or switching companies will not fix this restriction.",docsUrl:VS,details:o};let a=wce(n);if(a.length>0){let c=a.map((f)=>`\`${f}\``).join(", "),l=a.every((f)=>f.endsWith(":read"))?"the Read-only or Safer agent access preset":"Safer agent access when it covers the task, or Custom permissions",d=a.includes("api_keys:manage")?` This command manages API keys, so the missing scope cannot be granted through the API by the key that is missing it. If the active key has \`account:read\`, run \`sequenzy api-keys handoff\` (add \`--replaces current\` when rotating) to get a dashboard link that opens the create-key form prefilled, then give it to the workspace owner. It creates nothing and never prints a key. If handoff is also denied because \`account:read\` is missing, open ${C1} directly and choose the matching API Keys page.`:"";return{title:"API key permission required",description:`The current API key is valid, but this operation requires the missing ${a.length===1?"scope":"scopes"}: ${c}.`,howToFix:`Permissions can be widened on the key you are already using - no new key and no re-login. Run \`sequenzy account\` to see the active key, its type, and its API Keys settings URL, then have the key owner enable ${c} there. Personal keys open Account → API Keys; company keys open workspace Settings → API Keys. If account metadata is unavailable, open ${C1} directly and choose the matching API Keys page. When the active key type is \`company\` and it holds \`api_keys:manage\`, run \`sequenzy api-keys list --json\` and then \`sequenzy api-keys update <api-key-id> --scopes\` with the current scopes plus ${c}, or \`--preset\` covering all of them (${l}). Personal keys cannot be changed through \`sequenzy api-keys update\`. Both options replace the whole selection rather than merging. Retry the same command once the key is updated. Issuing a replacement key and swapping \`SEQUENZY_API_KEY\` also works but is not required.${d}`,docsUrl:Wa,details:o}}if(t.statusCode===403||r.includes("access denied"))return{title:"Access denied",description:"The current API key is valid, but it does not have permission to perform this action or access the requested company.",howToFix:"Use an API key with access to the target company, or switch to a company you can access before retrying.",docsUrl:VS,details:o};if(t.statusCode===404||r.includes("not found"))return{title:"Requested resource not found",description:"Sequenzy could not find the company, template, campaign, sequence, or subscriber you asked for.",howToFix:"Double-check the ID or email value and list the resource first before retrying the command.",docsUrl:Wa,details:o};if(t.statusCode===429||r.includes("rate limit"))return{title:"Rate limited",description:"Sequenzy temporarily slowed this request because too many requests were sent in a short period.",howToFix:"Wait a moment and retry. If an agent is looping, reduce the retry frequency before calling the CLI again.",docsUrl:Wa,details:o};if(t.code==="AB_TEST_VARIANT_CONTENT_EDIT"||r.includes("update_ab_test_variant")&&(r.includes("a/b test")||r.includes("ab test")))return{title:"A/B variant copy cannot be edited here",description:n,howToFix:"Use `sequenzy ab-tests update-variant` with the `abTestId` and `variantId` from `sequenzy sequences get` or `sequenzy ab-tests get`. Repeat once per variant for a whole-step rewrite. If the sequence is live or the test has activity, pass `--confirm-live-change`. Do not retry with `sequenzy templates update` or `sequenzy sequences update-node`.",docsUrl:`${KS}/concepts/cli#editing-the-copy-of-a-sequence-ab-step`,details:o};if(r.includes("--subject")||r.includes("--template")||r.includes("is required"))return{title:"Invalid command input",description:"The CLI command arguments are incomplete or incompatible for this action.",howToFix:"Review the flags you passed, add the missing values, and run the command again.",docsUrl:Wa,details:o};if(t.code==="NETWORK_ERROR"||r.includes("fetch failed")||r.includes("failed to initiate login"))return{title:"Network or configuration error",description:"The CLI could not reach the Sequenzy API or app URL from this environment.",howToFix:"Check your network connection and verify `SEQUENZY_API_URL` or `SEQUENZY_APP_URL` if you override them locally.",docsUrl:Wa,details:o};if(t.statusCode&&t.statusCode>=500)return{title:"Sequenzy server error",description:"The request reached Sequenzy, but the server could not complete it successfully.",howToFix:"Retry once. If the error persists, keep the details below and check the docs before escalating.",docsUrl:Wa,details:o};return{title:"Command failed",description:"The CLI could not complete the requested operation.",howToFix:"Review the details below, adjust the command or credentials, and retry.",docsUrl:Wa,details:o}}function M(){return new A("Not logged in. Run `sequenzy login` first.",401,void 0,"CLI_AUTH_REQUIRED")}function gf(e){let t=S1(e);return[`Sequenzy CLI error: ${t.title}`,`Description: ${t.description}`,`How to fix: ${t.howToFix}`,`Docs: ${t.docsUrl}`,`Details: ${t.details}`].join(`
196
196
  `)}function Sce(e){let t=w1(e),n=S1(e),r=(t.rawDetails===t.message?n.description:t.message.trim())||n.description;return{success:!1,error:{code:E1(t.code,t.statusCode,"CLI_ERROR"),message:r.replace(/\bBearer\s+[^\s]+/gi,"Bearer [redacted]").replace(/\bseq_(?:user_)?[A-Za-z0-9_-]{8,}\b/g,"[redacted key]"),...t.statusCode!==void 0?{statusCode:t.statusCode}:{},howToFix:n.howToFix,docsUrl:n.docsUrl,...e instanceof A&&e.retryAfterSeconds!==void 0?{retryAfterSeconds:e.retryAfterSeconds}:{}}}}function k(e,t={}){console.error(t.json??Ty()?JSON.stringify(Sce(e)):gf(e))}import{readFileSync as Dce}from"node:fs";import{isatty as D1}from"node:tty";var rl;function B1(){rl=void 0}function WS(e){if(new Set(e).size>1)throw new A("Only one text input may read stdin (-) per command. Use regular files for the other inputs.",400,void 0,"CLI_INVALID_INPUT")}async function x1(){if(D1(0))throw new A("Pipe text into stdin when using a text file '-'.",400,void 0,"CLI_INVALID_INPUT");try{process.stdin.setEncoding("utf8");let e="";for await(let t of process.stdin)e+=String(t);rl={text:e}}catch(e){throw new A(`Failed to read stdin: ${e instanceof Error?e.message:"Unknown error"}`,400,void 0,"CLI_INPUT_READ_FAILED")}}function _1(e,t){if(e==="-"){if(rl){if(rl.field)WS([rl.field,t]);return rl.field=t,rl.text}if(D1(0))throw new A(`Pipe text into stdin when using ${t} file '-'.`,400,void 0,"CLI_INVALID_INPUT")}try{let n=Dce(e==="-"?0:e,"utf8");if(e==="-")rl={field:t,text:n};return n}catch(n){throw new A(`Failed to read ${t} file '${e}': ${n instanceof Error?n.message:"Unknown error"}`,400,void 0,"CLI_INPUT_READ_FAILED")}}function $y(e){return e.optsWithGlobals().json===!0||e.commands.some($y)}async function Bce(e){JS(e.optsWithGlobals().json===!0),B1();let t=Object.entries(e.optsWithGlobals()).filter(([n,r])=>r==="-"&&n.endsWith("File")||n==="audienceJson"&&r==="@-").map(([n])=>n);if(e.parent?.name()==="subscribers"&&["import","events-import"].includes(e.name())&&e.args[0]==="-")t.push("subscriber import");if(WS(t),t.length>0)await x1()}function k1(e){let t=e.configureOutput().writeErr;e.configureOutput({writeErr:(n)=>{if(!$y(e))t?.(n)}}),e.exitOverride(),e.hook("preAction",(n,r)=>Bce(r))}async function R1(e,t){JS(!1);try{await e.parseAsync(t)}catch(n){if(n instanceof hQ){if(n.exitCode===0)return;if($y(e))k(new A(n.message,400,void 0,"CLI_INVALID_INPUT"),{json:!0});process.exitCode=n.exitCode;return}k(n,{json:$y(e)}),process.exitCode=1}}var Ny="Variant copy is edited with `sequenzy ab-tests update-variant`, not with `sequenzy sequences update-node`.";var Q1;function ce(e,t,n){function r(l,d){if(!l._zod)Object.defineProperty(l,"_zod",{value:{def:d,constr:c,traits:new Set},enumerable:!1});if(l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,d);let f=c.prototype,h=Object.keys(f);for(let y=0;y<h.length;y++){let v=h[y];if(!(v in l))l[v]=f[v].bind(l)}}let o=n?.Parent??Object;class a extends o{}Object.defineProperty(a,"name",{value:e});function c(l){var d;let f=n?.Parent?new a:this;r(f,l),(d=f._zod).deferred??(d.deferred=[]);for(let h of f._zod.deferred)h();return f}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:(l)=>{if(n?.Parent&&l instanceof n.Parent)return!0;return l?._zod?.traits?.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}var cRe=Symbol("zod_brand");class Ya extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Af extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Q1=globalThis).__zod_globalConfig??(Q1.__zod_globalConfig={});var Zd=globalThis.__zod_globalConfig;function Za(e){if(e)Object.assign(Zd,e);return Zd}function Py(e){let t=Object.values(e).filter((r)=>typeof r==="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function yf(e,t){if(typeof t==="bigint")return t.toString();return t}function qy(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function Fy(e){return e===null||e===void 0}function Ly(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}var T1=Symbol("evaluating");function hn(e,t,n){let r=void 0;Object.defineProperty(e,t,{get(){if(r===T1)return;if(r===void 0)r=T1,r=n();return r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function lu(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ol(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ZS(e){return JSON.stringify(e)}function $1(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var XS="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function hf(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var N1=qy(()=>{if(Zd.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Xd(e){if(hf(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let n=t.prototype;if(hf(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function e0(e){if(Xd(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var O1=new Set(["string","number","symbol"]);function il(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function va(e,t,n){let r=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)r._zod.parent=e;return r}function bt(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function P1(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var xce={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function _ce(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let a=ol(e._zod.def,{get shape(){let c={};for(let l in t){if(!(l in n.shape))throw Error(`Unrecognized key: "${l}"`);if(!t[l])continue;c[l]=n.shape[l]}return lu(this,"shape",c),c},checks:[]});return va(e,a)}function kce(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let a=ol(e._zod.def,{get shape(){let c={...e._zod.def.shape};for(let l in t){if(!(l in n.shape))throw Error(`Unrecognized key: "${l}"`);if(!t[l])continue;delete c[l]}return lu(this,"shape",c),c},checks:[]});return va(e,a)}function Rce(e,t){if(!Xd(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let a=e._zod.def.shape;for(let c in t)if(Object.getOwnPropertyDescriptor(a,c)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=ol(e._zod.def,{get shape(){let a={...e._zod.def.shape,...t};return lu(this,"shape",a),a}});return va(e,o)}function Qce(e,t){if(!Xd(t))throw Error("Invalid input to safeExtend: expected a plain object");let n=ol(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return lu(this,"shape",r),r}});return va(e,n)}function Tce(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=ol(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return lu(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return va(e,n)}function $ce(e,t,n){let o=t._zod.def.checks;if(o&&o.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let c=ol(t._zod.def,{get shape(){let l=t._zod.def.shape,d={...l};if(n)for(let f in n){if(!(f in l))throw Error(`Unrecognized key: "${f}"`);if(!n[f])continue;d[f]=e?new e({type:"optional",innerType:l[f]}):l[f]}else for(let f in l)d[f]=e?new e({type:"optional",innerType:l[f]}):l[f];return lu(this,"shape",d),d},checks:[]});return va(t,c)}function Nce(e,t,n){let r=ol(t._zod.def,{get shape(){let o=t._zod.def.shape,a={...o};if(n)for(let c in n){if(!(c in a))throw Error(`Unrecognized key: "${c}"`);if(!n[c])continue;a[c]=new e({type:"nonoptional",innerType:o[c]})}else for(let c in o)a[c]=new e({type:"nonoptional",innerType:o[c]});return lu(this,"shape",a),a}});return va(t,r)}function uu(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function q1(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Uy(e,t){return t.map((n)=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Oy(e){return typeof e==="string"?e:e?.message}function Xa(e,t,n){let r=e.message?e.message:Oy(e.inst?._zod.def?.error?.(e))??Oy(t?.error?.(e))??Oy(n.customError?.(e))??Oy(n.localeError?.(e))??"Invalid input",{inst:o,continue:a,input:c,...l}=e;if(l.path??(l.path=[]),l.message=r,t?.reportInput)l.input=c;return l}function jy(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function du(...e){let[t,n,r]=e;if(typeof t==="string")return{message:t,code:"custom",input:n,inst:r};return{...t}}var F1=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,yf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},zy=ce("$ZodError",F1),t0=ce("$ZodError",F1,{Parent:Error});function L1(e,t=(n)=>n.message){let n={},r=[];for(let o of e.issues)if(o.path.length>0)n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o));else r.push(t(o));return{formErrors:r,fieldErrors:n}}function U1(e,t=(n)=>n.message){let n={_errors:[]},r=(o,a=[])=>{for(let c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map((l)=>r({issues:l},[...a,...c.path]));else if(c.code==="invalid_key")r({issues:c.issues},[...a,...c.path]);else if(c.code==="invalid_element")r({issues:c.issues},[...a,...c.path]);else{let l=[...a,...c.path];if(l.length===0)n._errors.push(t(c));else{let d=n,f=0;while(f<l.length){let h=l[f];if(f!==l.length-1)d[h]=d[h]||{_errors:[]};else d[h]=d[h]||{_errors:[]},d[h]._errors.push(t(c));d=d[h],f++}}}};return r(e),n}var My=(e)=>(t,n,r,o)=>{let a=r?{...r,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},a);if(c instanceof Promise)throw new Ya;if(c.issues.length){let l=new(o?.Err??e)(c.issues.map((d)=>Xa(d,a,Za())));throw XS(l,o?.callee),l}return c.value};var Hy=(e)=>async(t,n,r,o)=>{let a=r?{...r,async:!0}:{async:!0},c=t._zod.run({value:n,issues:[]},a);if(c instanceof Promise)c=await c;if(c.issues.length){let l=new(o?.Err??e)(c.issues.map((d)=>Xa(d,a,Za())));throw XS(l,o?.callee),l}return c.value};var bf=(e)=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new Ya;return a.issues.length?{success:!1,error:new(e??zy)(a.issues.map((c)=>Xa(c,o,Za())))}:{success:!0,data:a.value}},j1=bf(t0),vf=(e)=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)a=await a;return a.issues.length?{success:!1,error:new e(a.issues.map((c)=>Xa(c,o,Za())))}:{success:!0,data:a.value}},z1=vf(t0),M1=(e)=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return My(e)(t,n,o)};var H1=(e)=>(t,n,r)=>My(e)(t,n,r);var G1=(e)=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return Hy(e)(t,n,o)};var J1=(e)=>async(t,n,r)=>Hy(e)(t,n,r);var V1=(e)=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return bf(e)(t,n,o)};var K1=(e)=>(t,n,r)=>bf(e)(t,n,r);var W1=(e)=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return vf(e)(t,n,o)};var Y1=(e)=>async(t,n,r)=>vf(e)(t,n,r);var Z1=/^[cC][0-9a-z]{6,}$/,X1=/^[0-9a-z]+$/,eL=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tL=/^[0-9a-vA-V]{20}$/,nL=/^[A-Za-z0-9]{27}$/,rL=/^[a-zA-Z0-9_-]{21}$/,oL=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var iL=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,n0=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var sL=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Pce="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function aL(){return new RegExp(Pce,"u")}var cL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,lL=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var uL=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,dL=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,pL=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,r0=/^[A-Za-z0-9_-]*$/;var mL=/^https?$/,fL=/^\+[1-9]\d{6,14}$/,gL="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",AL=new RegExp(`^${gL}$`);function hL(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function yL(e){return new RegExp(`^${hL(e)}$`)}function bL(e){let t=hL({precision:e.precision}),n=["Z"];if(e.local)n.push("");if(e.offset)n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${n.join("|")})`;return new RegExp(`^${gL}T(?:${r})$`)}var vL=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var EL=/^[^A-Z]*$/,IL=/^[^a-z]*$/;var xi=ce("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])});var CL=ce("$ZodCheckMaxLength",(e,t)=>{var n;xi.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let o=r.value;return!Fy(o)&&o.length!==void 0}),e._zod.onattach.push((r)=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<o)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let o=r.value;if(o.length<=t.maximum)return;let c=jy(o);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),wL=ce("$ZodCheckMinLength",(e,t)=>{var n;xi.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let o=r.value;return!Fy(o)&&o.length!==void 0}),e._zod.onattach.push((r)=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>o)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let o=r.value;if(o.length>=t.minimum)return;let c=jy(o);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),SL=ce("$ZodCheckLengthEquals",(e,t)=>{var n;xi.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let o=r.value;return!Fy(o)&&o.length!==void 0}),e._zod.onattach.push((r)=>{let o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=(r)=>{let o=r.value,a=o.length;if(a===t.length)return;let c=jy(o),l=a>t.length;r.issues.push({origin:c,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ef=ce("$ZodCheckStringFormat",(e,t)=>{var n,r;if(xi.init(e,t),e._zod.onattach.push((o)=>{let a=o._zod.bag;if(a.format=t.format,t.pattern)a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern)}),t.pattern)(n=e._zod).check??(n.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(r=e._zod).check??(r.check=()=>{})}),DL=ce("$ZodCheckRegex",(e,t)=>{Ef.init(e,t),e._zod.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),BL=ce("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=EL),Ef.init(e,t)}),xL=ce("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=IL),Ef.init(e,t)}),_L=ce("$ZodCheckIncludes",(e,t)=>{xi.init(e,t);let n=il(t.includes),r=new RegExp(typeof t.position==="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push((o)=>{let a=o._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),kL=ce("$ZodCheckStartsWith",(e,t)=>{xi.init(e,t);let n=new RegExp(`^${il(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((r)=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.startsWith(t.prefix))return;r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),RL=ce("$ZodCheckEndsWith",(e,t)=>{xi.init(e,t);let n=new RegExp(`.*${il(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((r)=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.endsWith(t.suffix))return;r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});var QL=ce("$ZodCheckOverwrite",(e,t)=>{xi.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});class o0{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
197
197
  `).filter((a)=>a),r=Math.min(...n.map((a)=>a.length-a.trimStart().length)),o=n.map((a)=>a.slice(r)).map((a)=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map((o)=>` ${o}`)];return new e(...t,r.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenzy/cli",
3
- "version": "0.0.187",
3
+ "version": "0.0.189",
4
4
  "description": "Sequenzy CLI for email marketing from the terminal",
5
5
  "type": "module",
6
6
  "bin": {