@sequenzy/cli 0.0.52 → 0.0.53
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/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -329,7 +329,7 @@ Check the top-level render call using <`+KA+">."}return p0}}function pB(a,p0){{i
|
|
|
329
329
|
<%s {...props} />
|
|
330
330
|
React keys must be passed directly to JSX without using spread:
|
|
331
331
|
let props = %s;
|
|
332
|
-
<%s key={someKey} {...props} />`,i4,C6,S4,C6),A2[C6+i4]=!0}}if(a===E)jB(sE);else T9(sE);return sE}}var fB=HD;Bj0.Fragment=E,Bj0.jsxDEV=fB})()});var qv=Rx(Kv(),1),{program:CV0,createCommand:FV0,createArgument:IV0,createOption:QV0,CommanderError:yV0,InvalidArgumentError:fV0,InvalidOptionArgumentError:wV0,Command:Mv,Argument:iV0,Option:SV0,Help:$V0}=qv.default;var Yv={name:"@sequenzy/cli",version:"0.0.52",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 build src/index.tsx --outdir dist --target node --minify --define 'process.env.DEV=false'",start:"node dist/index.js","type-check":"tsc --noEmit",test:"bun test","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:"^5.8.0"},files:["dist"],keywords:["sequenzy","email","cli","marketing"],license:"MIT",repository:{type:"git",url:"https://github.com/sequenzy/sequenzy"}};import{isDeepStrictEqual as pI0}from"node:util";import xl from"node:process";import GC from"node:fs";import El from"node:path";import cf from"node:crypto";import dI0 from"node:assert";var CC=(A)=>{let x=typeof A;return A!==null&&(x==="object"||x==="function")};var Nq=new Set(["__proto__","prototype","constructor"]),a80=new Set("0123456789");function _$(A){let x=[],E="",D="start",B=!1;for(let g of A)switch(g){case"\\":{if(D==="index")throw Error("Invalid character in an index");if(D==="indexEnd")throw Error("Invalid character after an index");if(B)E+=g;D="property",B=!B;break}case".":{if(D==="index")throw Error("Invalid character in an index");if(D==="indexEnd"){D="property";break}if(B){B=!1,E+=g;break}if(Nq.has(E))return[];x.push(E),E="",D="property";break}case"[":{if(D==="index")throw Error("Invalid character in an index");if(D==="indexEnd"){D="index";break}if(B){B=!1,E+=g;break}if(D==="property"){if(Nq.has(E))return[];x.push(E),E=""}D="index";break}case"]":{if(D==="index"){x.push(Number.parseInt(E,10)),E="",D="indexEnd";break}if(D==="indexEnd")throw Error("Invalid character after an index")}default:{if(D==="index"&&!a80.has(g))throw Error("Invalid character in an index");if(D==="indexEnd")throw Error("Invalid character after an index");if(D==="start")D="property";if(B)B=!1,E+="\\";E+=g}}if(B)E+="\\";switch(D){case"property":{if(Nq.has(E))return[];x.push(E);break}case"index":throw Error("Index was not closed");case"start":{x.push("");break}}return x}function jq(A,x){if(typeof x!=="number"&&Array.isArray(A)){let E=Number.parseInt(x,10);return Number.isInteger(E)&&A[E]===A[x]}return!1}function uv(A,x){if(jq(A,x))throw Error("Cannot use string index")}function Xv(A,x,E){if(!CC(A)||typeof x!=="string")return E===void 0?A:E;let D=_$(x);if(D.length===0)return E;for(let B=0;B<D.length;B++){let g=D[B];if(jq(A,g))A=B===D.length-1?void 0:null;else A=A[g];if(A===void 0||A===null){if(B!==D.length-1)return E;break}}return A===void 0?E:A}function Pq(A,x,E){if(!CC(A)||typeof x!=="string")return A;let D=A,B=_$(x);for(let g=0;g<B.length;g++){let F=B[g];if(uv(A,F),g===B.length-1)A[F]=E;else if(!CC(A[F]))A[F]=typeof B[g+1]==="number"?[]:{};A=A[F]}return D}function Wv(A,x){if(!CC(A)||typeof x!=="string")return!1;let E=_$(x);for(let D=0;D<E.length;D++){let B=E[D];if(uv(A,B),D===E.length-1)return delete A[B],!0;if(A=A[B],!CC(A))return!1}}function Zv(A,x){if(!CC(A)||typeof x!=="string")return!1;let E=_$(x);if(E.length===0)return!1;for(let D of E){if(!CC(A)||!(D in A)||jq(A,D))return!1;A=A[D]}return!0}import IB from"node:path";import Lv from"node:os";import vq from"node:process";var S1=Lv.homedir(),Vq=Lv.tmpdir(),{env:lI}=vq,p80=(A)=>{let x=IB.join(S1,"Library");return{data:IB.join(x,"Application Support",A),config:IB.join(x,"Preferences",A),cache:IB.join(x,"Caches",A),log:IB.join(x,"Logs",A),temp:IB.join(Vq,A)}},d80=(A)=>{let x=lI.APPDATA||IB.join(S1,"AppData","Roaming"),E=lI.LOCALAPPDATA||IB.join(S1,"AppData","Local");return{data:IB.join(E,A,"Data"),config:IB.join(x,A,"Config"),cache:IB.join(E,A,"Cache"),log:IB.join(E,A,"Log"),temp:IB.join(Vq,A)}},o80=(A)=>{let x=IB.basename(S1);return{data:IB.join(lI.XDG_DATA_HOME||IB.join(S1,".local","share"),A),config:IB.join(lI.XDG_CONFIG_HOME||IB.join(S1,".config"),A),cache:IB.join(lI.XDG_CACHE_HOME||IB.join(S1,".cache"),A),log:IB.join(lI.XDG_STATE_HOME||IB.join(S1,".local","state"),A),temp:IB.join(Vq,x,A)}};function nq(A,{suffix:x="nodejs"}={}){if(typeof A!=="string")throw TypeError(`Expected a string, got ${typeof A}`);if(x)A+=`-${x}`;if(vq.platform==="darwin")return p80(A);if(vq.platform==="win32")return d80(A);return o80(A)}import BB0 from"node:path";import lE from"node:fs";import{promisify as e9}from"node:util";var t80=(A,x)=>{let{onError:E}=x;return function(...B){return A.apply(void 0,B).catch(E)}},u7=t80;var _80=(A,x)=>{let{onError:E}=x;return function(...B){try{return A.apply(void 0,B)}catch(g){return E(g)}}},j4=_80;var zv=250;var s80=(A,x)=>{let{isRetriable:E}=x;return function(B){let{timeout:g}=B,F=B.interval??zv,Q=Date.now()+g;return function w(...S){return A.apply(void 0,S).catch((J)=>{if(!E(J))throw J;if(Date.now()>=Q)throw J;let M=Math.round(F*Math.random());if(M>0)return new Promise((K)=>setTimeout(K,M)).then(()=>w.apply(void 0,S));else return w.apply(void 0,S)})}}},X7=s80;var e80=(A,x)=>{let{isRetriable:E}=x;return function(B){let{timeout:g}=B,F=Date.now()+g;return function(...w){while(!0)try{return A.apply(void 0,w)}catch(S){if(!E(S))throw S;if(Date.now()>=F)throw S;continue}}}},W7=e80;import Nv from"node:process";var If={isChangeErrorOk:(A)=>{if(!If.isNodeError(A))return!1;let{code:x}=A;if(x==="ENOSYS")return!0;if(!Ov&&(x==="EINVAL"||x==="EPERM"))return!0;return!1},isNodeError:(A)=>{return A instanceof Error},isRetriableError:(A)=>{if(!If.isNodeError(A))return!1;let{code:x}=A;if(x==="EMFILE"||x==="ENFILE"||x==="EAGAIN"||x==="EBUSY"||x==="EACCESS"||x==="EACCES"||x==="EACCS"||x==="EPERM")return!0;return!1},onChangeError:(A)=>{if(!If.isNodeError(A))throw A;if(If.isChangeErrorOk(A))return;throw A}},mq=If;var Qf={onError:mq.onChangeError},b6={onError:()=>{return}},Ov=Nv.getuid?!Nv.getuid():!1,z9={isRetriable:mq.isRetriableError};var AB0={attempt:{chmod:u7(e9(lE.chmod),Qf),chown:u7(e9(lE.chown),Qf),close:u7(e9(lE.close),b6),fsync:u7(e9(lE.fsync),b6),mkdir:u7(e9(lE.mkdir),b6),realpath:u7(e9(lE.realpath),b6),stat:u7(e9(lE.stat),b6),unlink:u7(e9(lE.unlink),b6),chmodSync:j4(lE.chmodSync,Qf),chownSync:j4(lE.chownSync,Qf),closeSync:j4(lE.closeSync,b6),existsSync:j4(lE.existsSync,b6),fsyncSync:j4(lE.fsync,b6),mkdirSync:j4(lE.mkdirSync,b6),realpathSync:j4(lE.realpathSync,b6),statSync:j4(lE.statSync,b6),unlinkSync:j4(lE.unlinkSync,b6)},retry:{close:X7(e9(lE.close),z9),fsync:X7(e9(lE.fsync),z9),open:X7(e9(lE.open),z9),readFile:X7(e9(lE.readFile),z9),rename:X7(e9(lE.rename),z9),stat:X7(e9(lE.stat),z9),write:X7(e9(lE.write),z9),writeFile:X7(e9(lE.writeFile),z9),closeSync:W7(lE.closeSync,z9),fsyncSync:W7(lE.fsyncSync,z9),openSync:W7(lE.openSync,z9),readFileSync:W7(lE.readFileSync,z9),renameSync:W7(lE.renameSync,z9),statSync:W7(lE.statSync,z9),writeSync:W7(lE.writeSync,z9),writeFileSync:W7(lE.writeFileSync,z9)}},G9=AB0;import FC from"node:process";var jv="utf8",Tq=438,Pv=511;var vv={},Vv=FC.geteuid?FC.geteuid():-1,nv=FC.getegid?FC.getegid():-1;var mv=1000,Tv=!!FC.getuid,aV0=FC.getuid?!FC.getuid():!1,kq=128;var kv=(A)=>{return A instanceof Error&&"code"in A};var bq=(A)=>{return typeof A==="string"},s$=(A)=>{return A===void 0};import EB0 from"node:path";import cI from"node:process";import bv from"node:process";var hv=bv.platform==="linux",e$=bv.platform==="win32";var hq=["SIGHUP","SIGINT","SIGTERM"];if(!e$)hq.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(hv)hq.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var lv=hq;class cv{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(A)=>{if(this.exited)return;this.exited=!0;for(let x of this.callbacks)x();if(A)if(e$&&(A!=="SIGINT"&&A!=="SIGTERM"&&A!=="SIGKILL"))cI.kill(cI.pid,"SIGTERM");else cI.kill(cI.pid,A)},this.hook=()=>{cI.once("exit",()=>this.exit());for(let A of lv)try{cI.once(A,()=>this.exit(A))}catch{}},this.register=(A)=>{return this.callbacks.add(A),()=>{this.callbacks.delete(A)}},this.hook()}}var rv=new cv;var xB0=rv.register,av=xB0;var U5={store:{},create:(A)=>{let x=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),E=Date.now().toString().slice(-10),D="tmp-",B=`.tmp-${E}${x}`;return`${A}${B}`},get:(A,x,E=!0)=>{let D=U5.truncate(x(A));if(D in U5.store)return U5.get(A,x,E);return U5.store[D]=E,[D,()=>delete U5.store[D]]},purge:(A)=>{if(!U5.store[A])return;delete U5.store[A],G9.attempt.unlink(A)},purgeSync:(A)=>{if(!U5.store[A])return;delete U5.store[A],G9.attempt.unlinkSync(A)},purgeSyncAll:()=>{for(let A in U5.store)U5.purgeSync(A)},truncate:(A)=>{let x=EB0.basename(A);if(x.length<=kq)return A;let E=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(x);if(!E)return A;let D=x.length-kq;return`${A.slice(0,-x.length)}${E[1]}${E[2].slice(0,-D)}${E[3]}`}};av(U5.purgeSyncAll);var yf=U5;function lq(A,x,E=vv){if(bq(E))return lq(A,x,{encoding:E});let B={timeout:E.timeout??mv},g=null,F=null,Q=null;try{let w=G9.attempt.realpathSync(A),S=!!w;A=w||A,[F,g]=yf.get(A,E.tmpCreate||yf.create,E.tmpPurge!==!1);let J=Tv&&s$(E.chown),M=s$(E.mode);if(S&&(J||M)){let q=G9.attempt.statSync(A);if(q){if(E={...E},J)E.chown={uid:q.uid,gid:q.gid};if(M)E.mode=q.mode}}if(!S){let q=BB0.dirname(A);G9.attempt.mkdirSync(q,{mode:Pv,recursive:!0})}if(Q=G9.retry.openSync(B)(F,"w",E.mode||Tq),E.tmpCreated)E.tmpCreated(F);if(bq(x))G9.retry.writeSync(B)(Q,x,0,E.encoding||jv);else if(!s$(x))G9.retry.writeSync(B)(Q,x,0,x.length,0);if(E.fsync!==!1)if(E.fsyncWait!==!1)G9.retry.fsyncSync(B)(Q);else G9.attempt.fsync(Q);if(G9.retry.closeSync(B)(Q),Q=null,E.chown&&(E.chown.uid!==Vv||E.chown.gid!==nv))G9.attempt.chownSync(F,E.chown.uid,E.chown.gid);if(E.mode&&E.mode!==Tq)G9.attempt.chmodSync(F,E.mode);try{G9.retry.renameSync(B)(F,A)}catch(q){if(!kv(q))throw q;if(q.code!=="ENAMETOOLONG")throw q;G9.retry.renameSync(B)(F,yf.truncate(A))}g(),F=null}finally{if(Q)G9.attempt.closeSync(Q);if(F)yf.purge(F)}}var Dl=Rx(Tk(),1),gl=Rx(Fb(),1);var kg0=(A,x,E,D)=>{if(E==="length"||E==="prototype")return;if(E==="arguments"||E==="caller")return;let B=Object.getOwnPropertyDescriptor(A,E),g=Object.getOwnPropertyDescriptor(x,E);if(!bg0(B,g)&&D)return;Object.defineProperty(A,E,g)},bg0=function(A,x){return A===void 0||A.configurable||A.writable===x.writable&&A.enumerable===x.enumerable&&A.configurable===x.configurable&&(A.writable||A.value===x.value)},hg0=(A,x)=>{let E=Object.getPrototypeOf(x);if(E===Object.getPrototypeOf(A))return;Object.setPrototypeOf(A,E)},lg0=(A,x)=>`/* Wrapped ${A}*/
|
|
332
|
+
<%s key={someKey} {...props} />`,i4,C6,S4,C6),A2[C6+i4]=!0}}if(a===E)jB(sE);else T9(sE);return sE}}var fB=HD;Bj0.Fragment=E,Bj0.jsxDEV=fB})()});var qv=Rx(Kv(),1),{program:CV0,createCommand:FV0,createArgument:IV0,createOption:QV0,CommanderError:yV0,InvalidArgumentError:fV0,InvalidOptionArgumentError:wV0,Command:Mv,Argument:iV0,Option:SV0,Help:$V0}=qv.default;var Yv={name:"@sequenzy/cli",version:"0.0.53",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 build src/index.tsx --outdir dist --target node --minify --define 'process.env.DEV=false'",start:"node dist/index.js","type-check":"tsc --noEmit",test:"bun test","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:"^5.8.0"},files:["dist"],keywords:["sequenzy","email","cli","marketing"],license:"MIT",repository:{type:"git",url:"https://github.com/sequenzy/sequenzy"}};import{isDeepStrictEqual as pI0}from"node:util";import xl from"node:process";import GC from"node:fs";import El from"node:path";import cf from"node:crypto";import dI0 from"node:assert";var CC=(A)=>{let x=typeof A;return A!==null&&(x==="object"||x==="function")};var Nq=new Set(["__proto__","prototype","constructor"]),a80=new Set("0123456789");function _$(A){let x=[],E="",D="start",B=!1;for(let g of A)switch(g){case"\\":{if(D==="index")throw Error("Invalid character in an index");if(D==="indexEnd")throw Error("Invalid character after an index");if(B)E+=g;D="property",B=!B;break}case".":{if(D==="index")throw Error("Invalid character in an index");if(D==="indexEnd"){D="property";break}if(B){B=!1,E+=g;break}if(Nq.has(E))return[];x.push(E),E="",D="property";break}case"[":{if(D==="index")throw Error("Invalid character in an index");if(D==="indexEnd"){D="index";break}if(B){B=!1,E+=g;break}if(D==="property"){if(Nq.has(E))return[];x.push(E),E=""}D="index";break}case"]":{if(D==="index"){x.push(Number.parseInt(E,10)),E="",D="indexEnd";break}if(D==="indexEnd")throw Error("Invalid character after an index")}default:{if(D==="index"&&!a80.has(g))throw Error("Invalid character in an index");if(D==="indexEnd")throw Error("Invalid character after an index");if(D==="start")D="property";if(B)B=!1,E+="\\";E+=g}}if(B)E+="\\";switch(D){case"property":{if(Nq.has(E))return[];x.push(E);break}case"index":throw Error("Index was not closed");case"start":{x.push("");break}}return x}function jq(A,x){if(typeof x!=="number"&&Array.isArray(A)){let E=Number.parseInt(x,10);return Number.isInteger(E)&&A[E]===A[x]}return!1}function uv(A,x){if(jq(A,x))throw Error("Cannot use string index")}function Xv(A,x,E){if(!CC(A)||typeof x!=="string")return E===void 0?A:E;let D=_$(x);if(D.length===0)return E;for(let B=0;B<D.length;B++){let g=D[B];if(jq(A,g))A=B===D.length-1?void 0:null;else A=A[g];if(A===void 0||A===null){if(B!==D.length-1)return E;break}}return A===void 0?E:A}function Pq(A,x,E){if(!CC(A)||typeof x!=="string")return A;let D=A,B=_$(x);for(let g=0;g<B.length;g++){let F=B[g];if(uv(A,F),g===B.length-1)A[F]=E;else if(!CC(A[F]))A[F]=typeof B[g+1]==="number"?[]:{};A=A[F]}return D}function Wv(A,x){if(!CC(A)||typeof x!=="string")return!1;let E=_$(x);for(let D=0;D<E.length;D++){let B=E[D];if(uv(A,B),D===E.length-1)return delete A[B],!0;if(A=A[B],!CC(A))return!1}}function Zv(A,x){if(!CC(A)||typeof x!=="string")return!1;let E=_$(x);if(E.length===0)return!1;for(let D of E){if(!CC(A)||!(D in A)||jq(A,D))return!1;A=A[D]}return!0}import IB from"node:path";import Lv from"node:os";import vq from"node:process";var S1=Lv.homedir(),Vq=Lv.tmpdir(),{env:lI}=vq,p80=(A)=>{let x=IB.join(S1,"Library");return{data:IB.join(x,"Application Support",A),config:IB.join(x,"Preferences",A),cache:IB.join(x,"Caches",A),log:IB.join(x,"Logs",A),temp:IB.join(Vq,A)}},d80=(A)=>{let x=lI.APPDATA||IB.join(S1,"AppData","Roaming"),E=lI.LOCALAPPDATA||IB.join(S1,"AppData","Local");return{data:IB.join(E,A,"Data"),config:IB.join(x,A,"Config"),cache:IB.join(E,A,"Cache"),log:IB.join(E,A,"Log"),temp:IB.join(Vq,A)}},o80=(A)=>{let x=IB.basename(S1);return{data:IB.join(lI.XDG_DATA_HOME||IB.join(S1,".local","share"),A),config:IB.join(lI.XDG_CONFIG_HOME||IB.join(S1,".config"),A),cache:IB.join(lI.XDG_CACHE_HOME||IB.join(S1,".cache"),A),log:IB.join(lI.XDG_STATE_HOME||IB.join(S1,".local","state"),A),temp:IB.join(Vq,x,A)}};function nq(A,{suffix:x="nodejs"}={}){if(typeof A!=="string")throw TypeError(`Expected a string, got ${typeof A}`);if(x)A+=`-${x}`;if(vq.platform==="darwin")return p80(A);if(vq.platform==="win32")return d80(A);return o80(A)}import BB0 from"node:path";import lE from"node:fs";import{promisify as e9}from"node:util";var t80=(A,x)=>{let{onError:E}=x;return function(...B){return A.apply(void 0,B).catch(E)}},u7=t80;var _80=(A,x)=>{let{onError:E}=x;return function(...B){try{return A.apply(void 0,B)}catch(g){return E(g)}}},j4=_80;var zv=250;var s80=(A,x)=>{let{isRetriable:E}=x;return function(B){let{timeout:g}=B,F=B.interval??zv,Q=Date.now()+g;return function w(...S){return A.apply(void 0,S).catch((J)=>{if(!E(J))throw J;if(Date.now()>=Q)throw J;let M=Math.round(F*Math.random());if(M>0)return new Promise((K)=>setTimeout(K,M)).then(()=>w.apply(void 0,S));else return w.apply(void 0,S)})}}},X7=s80;var e80=(A,x)=>{let{isRetriable:E}=x;return function(B){let{timeout:g}=B,F=Date.now()+g;return function(...w){while(!0)try{return A.apply(void 0,w)}catch(S){if(!E(S))throw S;if(Date.now()>=F)throw S;continue}}}},W7=e80;import Nv from"node:process";var If={isChangeErrorOk:(A)=>{if(!If.isNodeError(A))return!1;let{code:x}=A;if(x==="ENOSYS")return!0;if(!Ov&&(x==="EINVAL"||x==="EPERM"))return!0;return!1},isNodeError:(A)=>{return A instanceof Error},isRetriableError:(A)=>{if(!If.isNodeError(A))return!1;let{code:x}=A;if(x==="EMFILE"||x==="ENFILE"||x==="EAGAIN"||x==="EBUSY"||x==="EACCESS"||x==="EACCES"||x==="EACCS"||x==="EPERM")return!0;return!1},onChangeError:(A)=>{if(!If.isNodeError(A))throw A;if(If.isChangeErrorOk(A))return;throw A}},mq=If;var Qf={onError:mq.onChangeError},b6={onError:()=>{return}},Ov=Nv.getuid?!Nv.getuid():!1,z9={isRetriable:mq.isRetriableError};var AB0={attempt:{chmod:u7(e9(lE.chmod),Qf),chown:u7(e9(lE.chown),Qf),close:u7(e9(lE.close),b6),fsync:u7(e9(lE.fsync),b6),mkdir:u7(e9(lE.mkdir),b6),realpath:u7(e9(lE.realpath),b6),stat:u7(e9(lE.stat),b6),unlink:u7(e9(lE.unlink),b6),chmodSync:j4(lE.chmodSync,Qf),chownSync:j4(lE.chownSync,Qf),closeSync:j4(lE.closeSync,b6),existsSync:j4(lE.existsSync,b6),fsyncSync:j4(lE.fsync,b6),mkdirSync:j4(lE.mkdirSync,b6),realpathSync:j4(lE.realpathSync,b6),statSync:j4(lE.statSync,b6),unlinkSync:j4(lE.unlinkSync,b6)},retry:{close:X7(e9(lE.close),z9),fsync:X7(e9(lE.fsync),z9),open:X7(e9(lE.open),z9),readFile:X7(e9(lE.readFile),z9),rename:X7(e9(lE.rename),z9),stat:X7(e9(lE.stat),z9),write:X7(e9(lE.write),z9),writeFile:X7(e9(lE.writeFile),z9),closeSync:W7(lE.closeSync,z9),fsyncSync:W7(lE.fsyncSync,z9),openSync:W7(lE.openSync,z9),readFileSync:W7(lE.readFileSync,z9),renameSync:W7(lE.renameSync,z9),statSync:W7(lE.statSync,z9),writeSync:W7(lE.writeSync,z9),writeFileSync:W7(lE.writeFileSync,z9)}},G9=AB0;import FC from"node:process";var jv="utf8",Tq=438,Pv=511;var vv={},Vv=FC.geteuid?FC.geteuid():-1,nv=FC.getegid?FC.getegid():-1;var mv=1000,Tv=!!FC.getuid,aV0=FC.getuid?!FC.getuid():!1,kq=128;var kv=(A)=>{return A instanceof Error&&"code"in A};var bq=(A)=>{return typeof A==="string"},s$=(A)=>{return A===void 0};import EB0 from"node:path";import cI from"node:process";import bv from"node:process";var hv=bv.platform==="linux",e$=bv.platform==="win32";var hq=["SIGHUP","SIGINT","SIGTERM"];if(!e$)hq.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(hv)hq.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var lv=hq;class cv{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(A)=>{if(this.exited)return;this.exited=!0;for(let x of this.callbacks)x();if(A)if(e$&&(A!=="SIGINT"&&A!=="SIGTERM"&&A!=="SIGKILL"))cI.kill(cI.pid,"SIGTERM");else cI.kill(cI.pid,A)},this.hook=()=>{cI.once("exit",()=>this.exit());for(let A of lv)try{cI.once(A,()=>this.exit(A))}catch{}},this.register=(A)=>{return this.callbacks.add(A),()=>{this.callbacks.delete(A)}},this.hook()}}var rv=new cv;var xB0=rv.register,av=xB0;var U5={store:{},create:(A)=>{let x=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),E=Date.now().toString().slice(-10),D="tmp-",B=`.tmp-${E}${x}`;return`${A}${B}`},get:(A,x,E=!0)=>{let D=U5.truncate(x(A));if(D in U5.store)return U5.get(A,x,E);return U5.store[D]=E,[D,()=>delete U5.store[D]]},purge:(A)=>{if(!U5.store[A])return;delete U5.store[A],G9.attempt.unlink(A)},purgeSync:(A)=>{if(!U5.store[A])return;delete U5.store[A],G9.attempt.unlinkSync(A)},purgeSyncAll:()=>{for(let A in U5.store)U5.purgeSync(A)},truncate:(A)=>{let x=EB0.basename(A);if(x.length<=kq)return A;let E=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(x);if(!E)return A;let D=x.length-kq;return`${A.slice(0,-x.length)}${E[1]}${E[2].slice(0,-D)}${E[3]}`}};av(U5.purgeSyncAll);var yf=U5;function lq(A,x,E=vv){if(bq(E))return lq(A,x,{encoding:E});let B={timeout:E.timeout??mv},g=null,F=null,Q=null;try{let w=G9.attempt.realpathSync(A),S=!!w;A=w||A,[F,g]=yf.get(A,E.tmpCreate||yf.create,E.tmpPurge!==!1);let J=Tv&&s$(E.chown),M=s$(E.mode);if(S&&(J||M)){let q=G9.attempt.statSync(A);if(q){if(E={...E},J)E.chown={uid:q.uid,gid:q.gid};if(M)E.mode=q.mode}}if(!S){let q=BB0.dirname(A);G9.attempt.mkdirSync(q,{mode:Pv,recursive:!0})}if(Q=G9.retry.openSync(B)(F,"w",E.mode||Tq),E.tmpCreated)E.tmpCreated(F);if(bq(x))G9.retry.writeSync(B)(Q,x,0,E.encoding||jv);else if(!s$(x))G9.retry.writeSync(B)(Q,x,0,x.length,0);if(E.fsync!==!1)if(E.fsyncWait!==!1)G9.retry.fsyncSync(B)(Q);else G9.attempt.fsync(Q);if(G9.retry.closeSync(B)(Q),Q=null,E.chown&&(E.chown.uid!==Vv||E.chown.gid!==nv))G9.attempt.chownSync(F,E.chown.uid,E.chown.gid);if(E.mode&&E.mode!==Tq)G9.attempt.chmodSync(F,E.mode);try{G9.retry.renameSync(B)(F,A)}catch(q){if(!kv(q))throw q;if(q.code!=="ENAMETOOLONG")throw q;G9.retry.renameSync(B)(F,yf.truncate(A))}g(),F=null}finally{if(Q)G9.attempt.closeSync(Q);if(F)yf.purge(F)}}var Dl=Rx(Tk(),1),gl=Rx(Fb(),1);var kg0=(A,x,E,D)=>{if(E==="length"||E==="prototype")return;if(E==="arguments"||E==="caller")return;let B=Object.getOwnPropertyDescriptor(A,E),g=Object.getOwnPropertyDescriptor(x,E);if(!bg0(B,g)&&D)return;Object.defineProperty(A,E,g)},bg0=function(A,x){return A===void 0||A.configurable||A.writable===x.writable&&A.enumerable===x.enumerable&&A.configurable===x.configurable&&(A.writable||A.value===x.value)},hg0=(A,x)=>{let E=Object.getPrototypeOf(x);if(E===Object.getPrototypeOf(A))return;Object.setPrototypeOf(A,E)},lg0=(A,x)=>`/* Wrapped ${A}*/
|
|
333
333
|
${x}`,cg0=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),rg0=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ag0=(A,x,E)=>{let D=E===""?"":`with ${E.trim()}() `,B=lg0.bind(null,D,x.toString());Object.defineProperty(B,"name",rg0);let{writable:g,enumerable:F,configurable:Q}=cg0;Object.defineProperty(A,"toString",{value:B,writable:g,enumerable:F,configurable:Q})};function DY(A,x,{ignoreNonConfigurable:E=!1}={}){let{name:D}=A;for(let B of Reflect.ownKeys(x))kg0(A,x,B,E);return hg0(A,x),ag0(A,x,D),A}var pg0=(A,x={})=>{if(typeof A!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof A}\``);let{wait:E=0,maxWait:D=Number.POSITIVE_INFINITY,before:B=!1,after:g=!0}=x;if(E<0||D<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!B&&!g)throw Error("Both `before` and `after` are false, function wouldn't be called.");let F,Q,w,S=function(...J){let M=this,q=()=>{if(F=void 0,Q)clearTimeout(Q),Q=void 0;if(g)w=A.apply(M,J)},K=()=>{if(Q=void 0,F)clearTimeout(F),F=void 0;if(g)w=A.apply(M,J)},W=B&&!F;if(clearTimeout(F),F=setTimeout(q,E),D>0&&D!==Number.POSITIVE_INFINITY&&!Q)Q=setTimeout(K,D);if(W)w=A.apply(M,J);return w};return DY(S,A),S.cancel=()=>{if(F)clearTimeout(F),F=void 0;if(Q)clearTimeout(Q),Q=void 0},S},gY=pg0;var HC=Rx(_h(),1);var kI0=Object.prototype.toString;function eh(A,x,E){if(!A)return!1;if(A.constructor===x)return!0;return kI0.call(A)===E}function Al(A){return eh(A,Uint8Array,"[object Uint8Array]")}function bI0(A){return eh(A,ArrayBuffer,"[object ArrayBuffer]")}function hI0(A){return Al(A)||bI0(A)}function lI0(A){if(!Al(A))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof A}\``)}function cI0(A){if(!hI0(A))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof A}\``)}function KY(A,x){if(A.length===0)return new Uint8Array(0);x??=A.reduce((B,g)=>B+g.length,0);let E=new Uint8Array(x),D=0;for(let B of A)lI0(B),E.set(B,D),D+=B.length;return E}var sh={utf8:new globalThis.TextDecoder("utf8")};function qY(A,x="utf8"){return cI0(A),sh[x]??=new globalThis.TextDecoder(x),sh[x].decode(A)}function rI0(A){if(typeof A!=="string")throw TypeError(`Expected \`string\`, got \`${typeof A}\``)}var aI0=new globalThis.TextEncoder;function _G(A){return rI0(A),aI0.encode(A)}var jk0=Array.from({length:256},(A,x)=>x.toString(16).padStart(2,"0"));var oI0=gl.default.default,Bl="aes-256-cbc",CQ=()=>Object.create(null),tI0=(A)=>A!==void 0&&A!==null,_I0=(A,x)=>{let E=new Set(["undefined","symbol","function"]),D=typeof x;if(E.has(D))throw TypeError(`Setting a value of type \`${D}\` for key \`${A}\` is not allowed as it's not supported by JSON`)},sG="__internal__",MY=`${sG}.migrations.version`;class eG{path;events;#B;#x;#A;#E={};constructor(A={}){let x={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...A};if(!x.cwd){if(!x.projectName)throw Error("Please specify the `projectName` option.");x.cwd=nq(x.projectName,{suffix:x.projectSuffix}).config}if(this.#A=x,x.schema??x.ajvOptions??x.rootSchema){if(x.schema&&typeof x.schema!=="object")throw TypeError("The `schema` option must be an object.");let g=new Dl.Ajv2020({allErrors:!0,useDefaults:!0,...x.ajvOptions});oI0(g);let F={...x.rootSchema,type:"object",properties:x.schema};this.#B=g.compile(F);for(let[Q,w]of Object.entries(x.schema??{}))if(w?.default)this.#E[Q]=w.default}if(x.defaults)this.#E={...this.#E,...x.defaults};if(x.serialize)this._serialize=x.serialize;if(x.deserialize)this._deserialize=x.deserialize;this.events=new EventTarget,this.#x=x.encryptionKey;let E=x.fileExtension?`.${x.fileExtension}`:"";this.path=El.resolve(x.cwd,`${x.configName??"config"}${E}`);let D=this.store,B=Object.assign(CQ(),x.defaults,D);if(x.migrations){if(!x.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(x.migrations,x.projectVersion,x.beforeEachMigration)}this._validate(B);try{dI0.deepEqual(D,B)}catch{this.store=B}if(x.watch)this._watch()}get(A,x){if(this.#A.accessPropertiesByDotNotation)return this._get(A,x);let{store:E}=this;return A in E?E[A]:x}set(A,x){if(typeof A!=="string"&&typeof A!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof A}`);if(typeof A!=="object"&&x===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(A))throw TypeError(`Please don't use the ${sG} key, as it's used to manage this module internal operations.`);let{store:E}=this,D=(B,g)=>{if(_I0(B,g),this.#A.accessPropertiesByDotNotation)Pq(E,B,g);else E[B]=g};if(typeof A==="object"){let B=A;for(let[g,F]of Object.entries(B))D(g,F)}else D(A,x);this.store=E}has(A){if(this.#A.accessPropertiesByDotNotation)return Zv(this.store,A);return A in this.store}reset(...A){for(let x of A)if(tI0(this.#E[x]))this.set(x,this.#E[x])}delete(A){let{store:x}=this;if(this.#A.accessPropertiesByDotNotation)Wv(x,A);else delete x[A];this.store=x}clear(){this.store=CQ();for(let A of Object.keys(this.#E))this.reset(A)}onDidChange(A,x){if(typeof A!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof A}`);if(typeof x!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof x}`);return this._handleChange(()=>this.get(A),x)}onDidAnyChange(A){if(typeof A!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof A}`);return this._handleChange(()=>this.store,A)}get size(){return Object.keys(this.store).length}get store(){try{let A=GC.readFileSync(this.path,this.#x?null:"utf8"),x=this._encryptData(A),E=this._deserialize(x);return this._validate(E),Object.assign(CQ(),E)}catch(A){if(A?.code==="ENOENT")return this._ensureDirectory(),CQ();if(this.#A.clearInvalidConfig&&A.name==="SyntaxError")return CQ();throw A}}set store(A){this._ensureDirectory(),this._validate(A),this._write(A),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[A,x]of Object.entries(this.store))yield[A,x]}_encryptData(A){if(!this.#x)return typeof A==="string"?A:qY(A);try{let x=A.slice(0,16),E=cf.pbkdf2Sync(this.#x,x.toString(),1e4,32,"sha512"),D=cf.createDecipheriv(Bl,E,x),B=A.slice(17),g=typeof B==="string"?_G(B):B;return qY(KY([D.update(g),D.final()]))}catch{}return A.toString()}_handleChange(A,x){let E=A(),D=()=>{let B=E,g=A();if(pI0(g,B))return;E=g,x.call(this,g,B)};return this.events.addEventListener("change",D),()=>{this.events.removeEventListener("change",D)}}_deserialize=(A)=>JSON.parse(A);_serialize=(A)=>JSON.stringify(A,void 0,"\t");_validate(A){if(!this.#B)return;if(this.#B(A)||!this.#B.errors)return;let E=this.#B.errors.map(({instancePath:D,message:B=""})=>`\`${D.slice(1)}\` ${B}`);throw Error("Config schema violation: "+E.join("; "))}_ensureDirectory(){GC.mkdirSync(El.dirname(this.path),{recursive:!0})}_write(A){let x=this._serialize(A);if(this.#x){let E=cf.randomBytes(16),D=cf.pbkdf2Sync(this.#x,E.toString(),1e4,32,"sha512"),B=cf.createCipheriv(Bl,D,E);x=KY([E,_G(":"),B.update(_G(x)),B.final()])}if(xl.env.SNAP)GC.writeFileSync(this.path,x,{mode:this.#A.configFileMode});else try{lq(this.path,x,{mode:this.#A.configFileMode})}catch(E){if(E?.code==="EXDEV"){GC.writeFileSync(this.path,x,{mode:this.#A.configFileMode});return}throw E}}_watch(){if(this._ensureDirectory(),!GC.existsSync(this.path))this._write(CQ());if(xl.platform==="win32")GC.watch(this.path,{persistent:!1},gY(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else GC.watchFile(this.path,{persistent:!1},gY(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(A,x,E){let D=this._get(MY,"0.0.0"),B=Object.keys(A).filter((F)=>this._shouldPerformMigration(F,D,x)),g={...this.store};for(let F of B)try{if(E)E(this,{fromVersion:D,toVersion:F,finalVersion:x,versions:B});let Q=A[F];Q?.(this),this._set(MY,F),D=F,g={...this.store}}catch(Q){throw this.store=g,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${Q}`)}if(this._isVersionInRangeFormat(D)||!HC.default.eq(D,x))this._set(MY,x)}_containsReservedKey(A){if(typeof A==="object"){if(Object.keys(A)[0]===sG)return!0}if(typeof A!=="string")return!1;if(this.#A.accessPropertiesByDotNotation){if(A.startsWith(`${sG}.`))return!0;return!1}return!1}_isVersionInRangeFormat(A){return HC.default.clean(A)===null}_shouldPerformMigration(A,x,E){if(this._isVersionInRangeFormat(A)){if(x!=="0.0.0"&&HC.default.satisfies(x,A))return!1;return HC.default.satisfies(E,A)}if(HC.default.lte(A,x))return!1;if(HC.default.gt(A,E))return!1;return!0}_get(A,x){return Xv(this.store,A,x)}_set(A,x){let{store:E}=this;Pq(E,A,x),this.store=E}}var YY="com.sequenzy.cli",uY="api-key",XY=typeof globalThis.Bun<"u",M1=new eG({projectName:"sequenzy",schema:{userId:{type:"string"},userEmail:{type:"string"},_apiKey:{type:"string"}}});async function WY(){let A=process.env.SEQUENZY_API_KEY;if(A)return A;if(XY)try{let x=await globalThis.Bun.secrets.get({service:YY,name:uY});if(x)return x}catch{}return M1.get("_apiKey")}async function Cl(A){if(XY)try{await globalThis.Bun.secrets.set({service:YY,name:uY,value:A,allowUnrestrictedAccess:!1});return}catch{}M1.set("_apiKey",A)}async function Fl(){if(XY)try{await globalThis.Bun.secrets.delete({service:YY,name:uY})}catch{}M1.delete("_apiKey")}async function Ix(){return!!await WY()}function AH(){return{userId:M1.get("userId"),userEmail:M1.get("userEmail")}}function Il(A){if(A.userId!==void 0)M1.set("userId",A.userId);if(A.userEmail!==void 0)M1.set("userEmail",A.userEmail)}function Ql(){M1.clear()}var sI0=process.env.SEQUENZY_API_URL??"https://api.sequenzy.com";class E0 extends Error{statusCode;rawDetails;code;constructor(A,x,E,D){super(A);this.statusCode=x;this.rawDetails=E;this.code=D;this.name="ApiError"}}function eI0(A){if(!A.trim())return{message:"Request failed"};try{let x=JSON.parse(A);if(typeof x==="string")return{message:x};if(typeof x.error==="string")return{message:x.error,code:x.code};if(x.error&&typeof x.error==="object")return{message:x.error.message??x.message??A,code:x.error.code??x.code};return{message:x.message??A,code:x.code}}catch{return{message:A}}}async function M0(A,x,E,D){let B=await WY();if(!B)throw new E0("Not logged in. Run `sequenzy login` first.",401);let g={"Content-Type":"application/json",Authorization:`Bearer ${B}`};if(D)g["x-company-id"]=D;let F;try{F=await fetch(`${sI0}${x}`,{method:A,headers:g,body:E?JSON.stringify(E):void 0})}catch(Q){throw new E0(Q instanceof Error?Q.message:"Failed to reach Sequenzy API",0,void 0,"NETWORK_ERROR")}if(!F.ok){let Q=await F.text(),w=eI0(Q);throw new E0(w.message,F.status,Q,w.code)}return F.json()}var fl="https://docs.sequenzy.com",Y1=`${fl}/concepts/cli`,yl=`${fl}/authentication`;function AQ0(A){if(A instanceof E0)return{message:A.message,statusCode:A.statusCode,code:A.code,rawDetails:A.rawDetails};if(A instanceof Error)return{message:A.message};return{message:String(A)}}function xQ0(A){let x=AQ0(A),E=x.message.trim()||"Unknown error",D=E.toLowerCase(),B=x.rawDetails?.trim()||E;if(x.code==="CLI_AUTH_REQUIRED"||D.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:Y1,details:B};if(D.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:Y1,details:B};if(x.statusCode===401||x.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:yl,details:B};if(x.statusCode===403||D.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:yl,details:B};if(x.statusCode===404||D.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:Y1,details:B};if(x.statusCode===429||D.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:Y1,details:B};if(D.includes("--subject")||D.includes("--template")||D.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:Y1,details:B};if(x.code==="NETWORK_ERROR"||D.includes("fetch failed")||D.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:Y1,details:B};if(x.statusCode&&x.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:Y1,details:B};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:Y1,details:B}}function Sx(){return new E0("Not logged in. Run `sequenzy login` first.",401,void 0,"CLI_AUTH_REQUIRED")}function rf(A){let x=xQ0(A);return[`Sequenzy CLI error: ${x.title}`,`Description: ${x.description}`,`How to fix: ${x.howToFix}`,`Docs: ${x.docsUrl}`,`Details: ${x.details}`].join(`
|
|
334
334
|
`)}function RA(A){console.error(rf(A))}import{readFileSync as EQ0}from"node:fs";import{createInterface as BQ0}from"node:readline/promises";function m0(A){console.log(JSON.stringify(A,null,2))}function bA(A){if(!A)return"None";let x=A instanceof Date?A:new Date(A);if(Number.isNaN(x.getTime()))return String(A);return x.toISOString()}function u1(A,x,E){if(A&&x)throw new E0(`Provide either --${E} or --${E}-file, not both`,400);if(!x)return A;try{return EQ0(x,"utf8")}catch(D){throw new E0(`Failed to read ${E} file '${x}': ${D instanceof Error?D.message:"Unknown error"}`,400)}}function q8(A,x,E){let D=u1(A,x,E);if(!D)return;try{return JSON.parse(D)}catch(B){throw new E0(`Invalid ${E} JSON: ${B instanceof Error?B.message:"Unknown error"}`,400)}}function FQ(A){let x=u1(A.html,A.htmlFile,"html"),E=q8(A.blocksJson,A.blocksFile,"blocks");if(x!==void 0&&E!==void 0)throw new E0("Provide either --html/--html-file or --blocks-json/--blocks-file, not both",400);if(E!==void 0&&!Array.isArray(E))throw new E0("blocks JSON must be an array",400);if(A.required&&x===void 0&&E===void 0)throw new E0(A.requiredMessage??"Provide either --html/--html-file or --blocks-json/--blocks-file",400);return{...x!==void 0&&{html:x},...E!==void 0&&{blocks:E}}}function M8(A,x){if(A===void 0)return;let E=A.trim();if(!/^[+-]?\d+$/.test(E))throw new E0(`${x} must be an integer`,400);let D=Number(E);if(!Number.isInteger(D))throw new E0(`${x} must be an integer`,400);return D}async function q6(A,x){if(x.yes===!0)return!0;if(!process.stdin.isTTY)throw new E0(`${A} Confirmation is required: re-run with --yes when stdin is not interactive`,400);let E=BQ0({input:process.stdin,output:process.stdout});try{let D=(await E.question(`${A} [y/N] `)).trim().toLowerCase();return D==="y"||D==="yes"}finally{E.close()}}function xH(A,x){if(!A||A.trim()==="")throw new E0(`${x} is required`,400);return A}var DQ0=new Set(["open_rate","click_rate"]);function gQ0(A,x){if(typeof A!=="object"||A===null)throw new E0(`${x} must be an object with a subject field`,400);let E=A;if(typeof E.subject!=="string"||E.subject.trim()==="")throw new E0(`${x}.subject must be a non-empty string`,400);if(E.previewText!==void 0&&typeof E.previewText!=="string")throw new E0(`${x}.previewText must be a string`,400);if(E.blocks!==void 0&&!Array.isArray(E.blocks))throw new E0(`${x}.blocks must be an array`,400);return{subject:E.subject,...E.previewText!==void 0&&{previewText:E.previewText},...Array.isArray(E.blocks)&&{blocks:E.blocks}}}function CQ0(A){if(!A.campaignId)throw new E0("Campaign ID is required",400);let x=M8(A.testPercentage,"--test-percentage");if(x!==void 0&&(x<5||x>50))throw new E0("--test-percentage must be an integer between 5 and 50",400);let E=M8(A.durationMinutes,"--duration-minutes");if(E!==void 0&&(E<15||E>1440))throw new E0("--duration-minutes must be an integer between 15 and 1440",400);if(A.winnerCriteria!==void 0&&!DQ0.has(A.winnerCriteria))throw new E0("--winner-criteria must be open_rate or click_rate",400);let D=q8(A.variantsJson,A.variantsFile,"variants"),B;if(D!==void 0){if(!Array.isArray(D))throw new E0("variants JSON must be an array",400);B=D.map((g,F)=>gQ0(g,`variants[${F}]`))}return{campaignId:A.campaignId,...A.name!==void 0&&{name:A.name},...x!==void 0&&{testPercentage:x},...E!==void 0&&{testDurationMinutes:E},...A.winnerCriteria!==void 0&&{winnerCriteria:A.winnerCriteria},...B!==void 0&&{variants:B}}}function FQ0(A){if(!A.subject||A.subject.trim()==="")throw new E0("--subject is required",400);let x=q8(A.blocksJson,A.blocksFile,"blocks");if(x!==void 0&&!Array.isArray(x))throw new E0("blocks JSON must be an array",400);return{subject:A.subject,...A.previewText!==void 0&&{previewText:A.previewText},...x!==void 0&&{blocks:x}}}function IQ0(A){let x=A.isWinner?" winner":"";return` - Variant ${A.label} [${A.id}]${x}`}function af(A){if(console.log(`${A.name??"A/B Test"} [${A.id}]`),console.log(`Status: ${A.status}`),console.log(`Winner criteria: ${A.winnerCriteria}`),console.log(`Updated: ${bA(A.updatedAt)}`),A.campaignId)console.log(`Campaign: ${A.campaignId}`);if(A.automationNodeId)console.log(`Automation node: ${A.automationNodeId}`);console.log(`Variants: ${A.variants.length}`);for(let x of A.variants)console.log(IQ0(x)),console.log(` Email: ${x.emailId}`),console.log(` Subject: ${x.subject||"(no subject)"}`),console.log(` Preview: ${x.previewText??"None"}`),console.log(` Blocks: ${x.blocks.length}`)}function EH(A){return`${A.toFixed(1)}%`}function QQ0(A){let x=A.period??(A.start&&A.end?`${A.start} - ${A.end}`:"all time");console.log(`A/B test stats (${x})`),console.log(`Sent: ${A.stats.sent.toLocaleString()}`),console.log(`Delivered: ${A.stats.delivered.toLocaleString()}`),console.log(`Opened: ${A.stats.opened.toLocaleString()} (${EH(A.stats.openRate)})`),console.log(`Clicked: ${A.stats.clicked.toLocaleString()} (${EH(A.stats.clickRate)})`),console.log(),console.log("Variants:");for(let E of A.variants){let D=E.isWinner?" winner":"";console.log(`- Variant ${E.label} [${E.id}]${D}`),console.log(` Subject: ${E.subject||"(no subject)"}`),console.log(` Sent ${E.stats.sent.toLocaleString()}, opened ${E.stats.opened.toLocaleString()} (${EH(E.stats.openRate)}), clicked ${E.stats.clicked.toLocaleString()} (${EH(E.stats.clickRate)})`)}}async function N7(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let B=new URLSearchParams;if(x.sequence)B.set("sequenceId",x.sequence);let g=await M0("GET",`/api/v1/ab-tests${B.size>0?`?${B.toString()}`:""}`,void 0,x.company);if(x.json){m0(g);return}console.log(`A/B tests (${g.abTests.length})`);for(let F of g.abTests)console.log(`- ${F.name??"A/B Test"} [${F.id}]`),console.log(` Status: ${F.status}`),console.log(` Variants: ${F.variants.length}`);return}if(A==="create"){let B=await M0("POST","/api/v1/ab-tests",CQ0(x),x.company);if(x.json){m0(B);return}console.log("Created A/B test"),af(B.abTest);return}if(!x.id)throw new E0("A/B test ID is required",400);if(A==="add-variant"){let B=await M0("POST",`/api/v1/ab-tests/${x.id}/variants`,FQ0(x),x.company);if(x.json){m0(B);return}console.log(`Added variant to A/B test ${x.id}`),af(B.abTest);return}if(A==="delete-variant"){if(!x.variantId)throw new E0("Variant ID is required",400);if(!await q6(`Delete variant ${x.variantId} from A/B test ${x.id}?`,x)){console.log("Aborted.");return}let B=await M0("DELETE",`/api/v1/ab-tests/${x.id}/variants/${x.variantId}`,void 0,x.company);if(x.json){m0(B);return}console.log(`Removed variant ${x.variantId}`),af(B.abTest);return}if(A==="delete"){if(!await q6(`Delete A/B test ${x.id}?`,x)){console.log("Aborted.");return}let B=await M0("DELETE",`/api/v1/ab-tests/${x.id}`,void 0,x.company);if(x.json){m0(B);return}console.log(`Deleted A/B test: ${x.id}`);return}if(A==="get"){let B=await M0("GET",`/api/v1/ab-tests/${x.id}`,void 0,x.company);if(x.json){m0(B);return}af(B.abTest);return}if(A==="stats"){let B=new URLSearchParams;if(x.period)B.set("period",x.period);if(x.start)B.set("start",x.start);if(x.end)B.set("end",x.end);if(x.includeBots)B.set("includeMachineEngagement","true");let g=await M0("GET",`/api/v1/ab-tests/${x.id}/stats${B.size>0?`?${B.toString()}`:""}`,void 0,x.company);if(x.json){m0(g);return}QQ0(g);return}if(A==="restart"){if(x.testType!==void 0&&x.testType!=="subject"&&x.testType!=="content")throw new E0("--test-type must be subject or content",400);let B=x.testType,g;if(x.variantCount!==void 0)g=Number.parseInt(x.variantCount,10);let F;if(x.winnerThreshold!==void 0)F=Number.parseInt(x.winnerThreshold,10);if(g!==void 0&&(!Number.isInteger(g)||g<2||g>4))throw new E0("--variant-count must be an integer from 2 to 4",400);if(F!==void 0&&(!Number.isInteger(F)||F<10||F>1000))throw new E0("--winner-threshold must be an integer from 10 to 1000",400);let Q=await M0("POST",`/api/v1/ab-tests/${x.id}/restart`,{sourceVariantId:x.sourceVariant,testType:B,winnerThreshold:F,variantCount:g},x.company);if(x.json){m0(Q);return}console.log(`Started new A/B test: ${Q.abTest.id}`),console.log(`Previous test: ${Q.previousAbTestId}`),console.log(`Control variant: ${Q.sourceVariantId}`),af(Q.abTest);return}if(!x.variantId)throw new E0("Variant ID is required",400);let E=FQ({html:x.html,htmlFile:x.htmlFile,blocksJson:x.blocksJson,blocksFile:x.blocksFile});if(x.subject===void 0&&x.previewText===void 0&&E.html===void 0&&E.blocks===void 0)throw new E0("Provide at least one of: --subject, --preview-text, --html, --html-file, --blocks-json, --blocks-file",400);let D=await M0("PATCH",`/api/v1/ab-tests/${x.id}/variants/${x.variantId}`,{subject:x.subject,previewText:x.previewText,html:E.html,blocks:E.blocks},x.company);if(x.json){m0(D);return}console.log(`Updated variant ${D.variant.label}`),console.log(`ID: ${D.variant.id}`),console.log(`Email: ${D.variant.emailId}`),console.log(`Subject: ${D.variant.subject}`)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}var ZY=["product-info","domain","tracking","localization","integrations","products","events","tags","labels","goals","sync-rules","api-keys","widgets","team","danger"],wl={dashboard:"/dashboard/company/{companyId}",campaigns:"/dashboard/company/{companyId}/campaign",campaign:"/dashboard/company/{companyId}/campaign/{campaignId}",campaignPreview:"/dashboard/company/{companyId}/campaign/{campaignId}?step=review",campaignList:"/dashboard/company/{companyId}/campaign/list/{status}",landingPages:"/dashboard/company/{companyId}/landing-pages",landingPage:"/dashboard/company/{companyId}/landing-pages/{landingPageId}",sequences:"/dashboard/company/{companyId}/sequences",sequence:"/dashboard/company/{companyId}/sequences/{sequenceId}",sequenceList:"/dashboard/company/{companyId}/sequences/list/{status}",settings:"/dashboard/company/{companyId}/settings",settingsTab:"/dashboard/company/{companyId}/settings?tab={tab}",emails:"/dashboard/company/{companyId}/emails",email:"/dashboard/company/{companyId}/emails/{emailId}",subscribers:"/dashboard/company/{companyId}/subscribers",sentEmails:"/dashboard/company/{companyId}/sent-emails",emailSend:"/dashboard/company/{companyId}/sent-emails/{emailSendId}",segments:"/dashboard/company/{companyId}/segments",metrics:"/dashboard/company/{companyId}/metrics",transactional:"/dashboard/company/{companyId}/transactional",transactionalEmail:"/dashboard/company/{companyId}/transactional/{transactionalId}",domain:"/dashboard/company/{companyId}/settings/domain/{domainId}",domainVerify:"/dashboard/company/{companyId}/settings/domain/{domainId}/verify"};function yQ0(A){let E=(A??process.env.SEQUENZY_APP_URL??"https://sequenzy.com").trim().replace(/\/+$/,"");return E.length>0?E:"https://sequenzy.com"}function b4(A){let x=A?.trim();return x?x:void 0}function j7(A){return encodeURIComponent(A)}function ZB(A,x){return`${A}${x}`}function LB(A,x=""){return`/dashboard/company/${j7(A)}${x}`}function il(A,x,E){return ZB(A,`${LB(x,"/settings")}?tab=${encodeURIComponent(E)}`)}function fQ0(A,x){let E=ZY.map((D)=>[D,x?il(A,x,D):""]);return Object.fromEntries(E)}function OE(A={},x){let E=yQ0(x),D=b4(A.companyId),B={},g=fQ0(E,D);if(!D)return{appUrl:E,routeTemplates:wl,settingsTabValues:ZY,urls:B,settingsUrls:g};B.dashboard=ZB(E,LB(D)),B.campaigns=ZB(E,LB(D,"/campaign")),B.landingPages=ZB(E,LB(D,"/landing-pages")),B.sequences=ZB(E,LB(D,"/sequences")),B.settings=ZB(E,LB(D,"/settings")),B.emails=ZB(E,LB(D,"/emails")),B.subscribers=ZB(E,LB(D,"/subscribers")),B.sentEmails=ZB(E,LB(D,"/sent-emails")),B.segments=ZB(E,LB(D,"/segments")),B.metrics=ZB(E,LB(D,"/metrics")),B.transactional=ZB(E,LB(D,"/transactional"));let F=b4(A.campaignId);if(F)B.campaign=ZB(E,LB(D,`/campaign/${j7(F)}`)),B.campaignPreview=`${B.campaign}?step=review`;let Q=b4(A.landingPageId);if(Q)B.landingPage=ZB(E,LB(D,`/landing-pages/${j7(Q)}`));let w=b4(A.sequenceId);if(w)B.sequence=ZB(E,LB(D,`/sequences/${j7(w)}`));let S=b4(A.emailId)??b4(A.templateId);if(S)B.email=ZB(E,LB(D,`/emails/${j7(S)}`)),B.template=B.email;let J=b4(A.transactionalId);if(J)B.transactionalEmail=ZB(E,LB(D,`/transactional/${j7(J)}`));let M=b4(A.emailSendId);if(M)B.emailSend=ZB(E,LB(D,`/sent-emails/${j7(M)}`));let q=b4(A.domainId);if(q)B.domain=ZB(E,LB(D,`/settings/domain/${j7(q)}`)),B.domainVerify=`${B.domain}/verify`;let K=b4(A.status);if(K)B.campaignList=ZB(E,LB(D,`/campaign/list/${j7(K)}`)),B.sequenceList=ZB(E,LB(D,`/sequences/list/${j7(K)}`));let W=b4(A.settingsTab);if(W)B.settingsTab=il(E,D,W);return{appUrl:E,routeTemplates:wl,settingsTabValues:ZY,urls:B,settingsUrls:g}}async function zB(A){if(A?.trim())return A.trim();try{return(await M0("GET","/api/v1/account")).currentCompanyId??void 0}catch{return}}async function wQ0(A,x){let E=await zB(x);return OE({...A,companyId:E})}function Wx(A,x){if(x)console.log(`${A}: ${x}`)}function JC(A,x,E,D){let g=OE({...x,companyId:D}).urls[E];return{...A,...g!==void 0&&{url:g}}}async function Sl(A){if(!await Ix())RA(Sx()),process.exit(1);try{let x=await wQ0({campaignId:A.campaign,landingPageId:A.landingPage,sequenceId:A.sequence,emailId:A.email,templateId:A.template,transactionalId:A.transactional,emailSendId:A.emailSend,domainId:A.domain,status:A.status,settingsTab:A.settingsTab},A.company);if(A.company&&!x.urls.dashboard)throw new E0("Company ID is required to build dashboard URLs",400);if(A.json){m0(x);return}if(console.log(`App: ${x.appUrl}`),console.log(""),Object.keys(x.urls).length===0){console.log("No company selected. Pass --company or run `sequenzy account` to find the current company ID."),console.log(""),console.log("Route templates:");for(let[E,D]of Object.entries(x.routeTemplates))console.log(`- ${E}: ${D}`);return}console.log("URLs:");for(let[E,D]of Object.entries(x.urls))console.log(`- ${E}: ${D}`);console.log(""),console.log("Settings tabs:");for(let[E,D]of Object.entries(x.settingsUrls))console.log(`- ${E}: ${D}`)}catch(x){RA(x instanceof E0?x:x),process.exit(1)}}async function $l(A){if(!await Ix())RA(Sx()),process.exit(1);try{let x=await M0("GET","/api/v1/account"),E=x.currentCompanyId!==null?OE({companyId:x.currentCompanyId}):void 0,D=x.companies.map((B)=>{let g=OE({companyId:B.id});return{...B,url:g.urls.dashboard,settingsUrl:g.urls.settings}});if(A.json){console.log(JSON.stringify({...x,companies:D,...E!==void 0&&{appUrls:E.urls,settingsUrls:E.settingsUrls}},null,2));return}if(console.log(`User ID: ${x.user?.id??"Unknown"}`),console.log(`Current company: ${x.currentCompanyId??"None"}`),Wx("Current company URL",E?.urls.dashboard),Wx("Current company settings",E?.urls.settings),console.log(""),x.companies.length===0){console.log(x.message??"No companies found.");return}console.log(`Companies (${x.companies.length})`);for(let B of D){let g=B.id===x.currentCompanyId?" (current)":"";console.log(`- ${B.name} [${B.id}]${g}`),Wx(" URL",B.url),Wx(" Settings",B.settingsUrl)}}catch(x){RA(x instanceof E0?x:x),process.exit(1)}}async function Gl(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{let E=await M0("POST","/api/v1/api-keys",{name:x.name},x.company);if(x.json){m0(E);return}console.log(`Created API key: ${E.apiKey.name}`),console.log(`ID: ${E.apiKey.id}`),console.log(`Prefix: ${E.apiKey.prefix}`),console.log(`Created: ${bA(E.apiKey.createdAt)}`),console.log(""),console.log(E.message),console.log(`Key: ${E.apiKey.key}`),console.log(`Env: ${E.instructions.example}`),console.log(E.instructions.note)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}var Hl=["hourly","daily","weekly"];function iQ0(A){let x=!A.isActive?"paused":A.syncStatus==="error"?"error":A.syncStatus;if(console.log(`- ${A.segmentName??A.segmentId} -> "${A.audienceName}" (${A.adAccountId})`),console.log(` id: ${A.id} | ${A.frequency} | status: ${x} | last sync: ${A.lastSyncAt??"never"} | uploaded: ${A.lastSyncedCount}`),A.lastSyncError)console.log(` last error: ${A.lastSyncError}`)}function Jl(A){if(A===void 0)return"daily";if(!Hl.includes(A))console.error(`Invalid frequency "${A}". Use one of: ${Hl.join(", ")}.`),process.exit(1);return A}function LY(A,x){if(!A||A.trim().length===0)console.error(`${x} is required.`),process.exit(1);return A.trim()}async function UC(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let B=await M0("GET","/api/v1/audience-syncs",void 0,x.company);if(x.json){console.log(JSON.stringify(B,null,2));return}console.log(`Audience syncs (${B.audienceSyncs.length})`);for(let g of B.audienceSyncs)iQ0(g);return}if(A==="ad-accounts"){let B=await M0("GET","/api/v1/ad-accounts",void 0,x.company);if(x.json){console.log(JSON.stringify(B,null,2));return}console.log(`Ad accounts (${B.adAccounts.length})`);for(let g of B.adAccounts)console.log(`- ${g.name} (${g.id})`);return}if(A==="create"){if(x.segment&&x.template)console.error("Provide either --segment or --template, not both."),process.exit(1);if(!x.segment&&!x.template)console.error("Provide --segment <id> or --template <id> (for example --template recent-buyers)."),process.exit(1);let B=await M0("POST","/api/v1/audience-syncs",{...x.segment?{segmentId:x.segment}:{},...x.template?{predefinedSegmentId:x.template}:{},adAccountId:LY(x.adAccount,"--ad-account"),audienceName:LY(x.name,"--name"),frequency:Jl(x.frequency)},x.company);if(x.json){console.log(JSON.stringify(B,null,2));return}console.log(`Created audience sync: ${B.audienceSync.segmentName??B.audienceSync.segmentId} -> "${B.audienceSync.audienceName}"`),console.log(`ID: ${B.audienceSync.id}`),console.log(`Frequency: ${B.audienceSync.frequency}`),console.log("The first upload to Meta is running now.");return}let E=LY(x.id,"--id");if(A==="update"){let B={};if(x.frequency!==void 0)B.frequency=Jl(x.frequency);if(x.active!==void 0){if(x.active!=="true"&&x.active!=="false")console.error('--active must be "true" or "false".'),process.exit(1);B.isActive=x.active==="true"}if(Object.keys(B).length===0)console.error("Provide --frequency and/or --active to update."),process.exit(1);let g=await M0("PATCH",`/api/v1/audience-syncs/${encodeURIComponent(E)}`,B,x.company);if(x.json){console.log(JSON.stringify(g,null,2));return}console.log(`Updated audience sync ${g.audienceSync.id}: ${g.audienceSync.frequency}, ${g.audienceSync.isActive?"active":"paused"}`);return}if(A==="delete"){let B=await M0("DELETE",`/api/v1/audience-syncs/${encodeURIComponent(E)}`,void 0,x.company);if(x.json){console.log(JSON.stringify(B,null,2));return}console.log(`Removed audience sync ${E}. The Meta audience itself is kept.`);return}let D=await M0("POST",`/api/v1/audience-syncs/${encodeURIComponent(E)}/sync`,void 0,x.company);if(x.json){console.log(JSON.stringify(D,null,2));return}console.log(`Queued sync for ${E}.`)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}function Rl(A){let x=A?.trim();return x?x:void 0}function SQ0(A,x){if(!A.name)throw new E0("Campaign name is required",400);let E=Rl(A.prompt);if(A.prompt!==void 0&&E===void 0)throw new E0("--prompt cannot be empty",400);if(E!==void 0&&(x.html!==void 0||x.blocks!==void 0))throw new E0("Provide either --prompt, --html/--html-file, or --blocks-json/--blocks-file, not multiple content sources",400);if(E===void 0&&(A.style!==void 0||A.tone!==void 0))throw new E0("--style and --tone require --prompt",400);if(!A.subject&&E===void 0)throw new E0("Campaign subject is required unless --prompt is provided",400)}function $Q0(A){let x=A.generated?.blocks!==void 0&&Array.isArray(A.generated.blocks)&&A.generated.blocks.length>0?A.generated.blocks:void 0,E=typeof A.generated?.html==="string"&&A.generated.html.trim()!==""?A.generated.html:void 0;return{name:A.name,subject:A.subject,html:x!==void 0?void 0:E??A.content.html,blocks:x??A.content.blocks,labels:A.labels,...A.status!==void 0&&{status:A.status},...A.sentAt!==void 0&&{sentAt:A.sentAt},...A.trackingCode!==void 0&&{trackingCode:A.trackingCode}}}function GQ0(A,x,E={}){if(A.replyTo!==void 0&&A.replyProfile!==void 0)throw new E0("Provide either --reply-to or --reply-profile, not both",400);if(A.name===void 0&&A.subject===void 0&&A.trackingCode===void 0&&x.html===void 0&&x.blocks===void 0&&A.replyTo===void 0&&A.replyProfile===void 0&&A.label===void 0&&E.campaignData===void 0&&E.computedLists===void 0)throw new E0("Provide at least one of: --name, --subject, --tracking-code, --html, --html-file, --blocks-json, --blocks-file, --reply-to, --reply-profile, --label, --campaign-data-json, --campaign-data-file, --computed-lists-json, --computed-lists-file",400);return{name:A.name,subject:A.subject,...A.trackingCode!==void 0&&{trackingCode:A.trackingCode},html:x.html,blocks:x.blocks,replyTo:A.replyTo,replyProfileId:A.replyProfile,labels:A.label,...E.campaignData!==void 0&&{campaignData:E.campaignData},...E.computedLists!==void 0&&{computedLists:E.computedLists}}}function HQ0(A){let x=q8(A.campaignDataJson,A.campaignDataFile,"campaign-data"),E=q8(A.computedListsJson,A.computedListsFile,"computed-lists");if(x!==void 0&&x!==null&&(typeof x!=="object"||Array.isArray(x)))throw new E0("campaign-data JSON must be an object or null",400);if(E!==void 0&&!Array.isArray(E))throw new E0("computed-lists JSON must be an array",400);return{...x!==void 0&&{campaignData:x},...E!==void 0&&{computedLists:E}}}function JQ0(A){let x=q8(A.targetListsJson,A.targetListsFile,"target-lists");if(x!==void 0&&(typeof x!=="object"||x===null||Array.isArray(x)))throw new E0("target-lists JSON must be an object",400);return x}function Kl(A){if(A===void 0)return;let x=Number(A);if(!Number.isInteger(x)||x<1||x>72)throw new E0("--spread-over-hours must be an integer between 1 and 72",400);return x}var UQ0=new Set(["campaign","ab_test","variant"]);function RQ0(A){let x=Kl(A.spreadOverHours);return{...x!==void 0&&{spreadOverHours:x}}}function KQ0(A){let x=A.mode??"campaign";if(!UQ0.has(x))throw new E0("--mode must be one of: campaign, ab_test, variant",400);if(x==="variant"&&!A.variantId)throw new E0("--variant-id is required when --mode is variant",400);if(x!=="variant"&&A.variantId!==void 0)throw new E0("--variant-id requires --mode variant",400);return{mode:x,...A.variantId!==void 0&&{variantId:A.variantId}}}function qQ0(A,x){if(!A.at?.trim())throw new E0("--at is required",400);let E=Kl(A.spreadOverHours);return{scheduledAt:A.at,...x!==void 0&&{targetLists:x},...A.sendTimeOptimization!==void 0&&{sendTimeOptimization:A.sendTimeOptimization},...E!==void 0&&{spreadOverHours:E}}}function Ul(A){if(!A.replyToEmail)return"None";return A.replyToName?`${A.replyToName} <${A.replyToEmail}>`:A.replyToEmail}function BH(A){return A&&A.length>0?A.join(", "):"None"}function MQ0(A,x){if(x===void 0)return A;let E=OE({companyId:x,campaignId:A.id});return{...A,...E.urls.campaign!==void 0&&{url:E.urls.campaign},...E.urls.campaignPreview!==void 0&&{previewUrl:E.urls.campaignPreview}}}async function B4(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let Q=new URLSearchParams;if(x.status)Q.set("status",x.status);if(x.label)for(let q of x.label)Q.append("label",q);let w=await M0("GET",`/api/v1/campaigns${Q.size>0?`?${Q.toString()}`:""}`,void 0,x.company),S=await zB(x.company),J=S!==void 0?OE({companyId:S,status:x.status}):void 0,M=w.campaigns.map((q)=>MQ0(q,S));if(x.json){m0({...w,campaigns:M,...J!==void 0&&{appUrls:J.urls}});return}console.log(`Campaigns (${w.campaigns.length})`);for(let q of M){if(console.log(`- ${q.name} [${q.id}]`),console.log(` Subject: ${q.subject}`),console.log(` Status: ${q.status}`),console.log(` Labels: ${BH(q.labels)}`),console.log(` Created: ${bA(q.createdAt)}`),Wx(" URL",q.url),Wx(" Preview URL",q.previewUrl),q.scheduledAt)console.log(` Scheduled: ${bA(q.scheduledAt)}`);if(q.sentAt)console.log(` Sent: ${bA(q.sentAt)}`)}return}let E=FQ({html:x.html,htmlFile:x.htmlFile,blocksJson:x.blocksJson,blocksFile:x.blocksFile});if(A==="create"){SQ0(x,E);let Q=Rl(x.prompt),w=Q!==void 0?await M0("POST","/api/v1/generate/email",{prompt:Q,...x.style!==void 0&&{style:x.style},...x.tone!==void 0&&{tone:x.tone}},x.company):void 0,S=x.subject??w?.subject;if(!S)throw new E0("Generated email did not include a subject. Provide --subject explicitly.",400);let J=await M0("POST","/api/v1/campaigns",$Q0({name:x.name,subject:S,content:E,generated:w,labels:x.label,trackingCode:x.trackingCode,status:x.status,sentAt:x.sentAt}),x.company),M=await zB(x.company),q=J.campaign?.id??J.campaignId,K=M!==void 0&&q!==void 0?OE({companyId:M,campaignId:q}):void 0;if(x.json){m0({...J,...J.campaign!==void 0&&K?.urls.campaign!==void 0&&{campaign:{...J.campaign,url:K.urls.campaign,previewUrl:K.urls.campaignPreview}},...K!==void 0&&{appUrls:K.urls}});return}if(console.log(`Created campaign: ${J.campaign?.name??x.name}`),console.log(`ID: ${J.campaign?.id??"Unknown"}`),console.log(`Status: ${J.campaign?.status??"Unknown"}`),J.campaign?.sentAt)console.log(`Sent: ${bA(J.campaign.sentAt)}`);if(console.log(`Subject: ${J.campaign?.subject??S}`),console.log(`Labels: ${BH(J.campaign?.labels)}`),w!==void 0)console.log("Content: generated from prompt");Wx("URL",K?.urls.campaign??J.campaign?.url),Wx("Preview URL",K?.urls.campaignPreview??J.campaign?.previewUrl);return}if(!x.id)throw new E0("Campaign ID is required",400);if(A==="cancel"||A==="pause"){let Q=await M0("POST",`/api/v1/campaigns/${x.id}/${A}`,void 0,x.company);if(x.json){m0(Q);return}let w=A==="cancel"?"cancelled":"paused";console.log(`Campaign ${w}: ${Q.campaign?.name??x.id}`),console.log(`ID: ${Q.campaign?.id??x.id}`),console.log(`Status: ${Q.campaign?.status??w}`),Wx("URL",Q.campaign?.url);return}if(A==="resume"){let Q=await M0("POST",`/api/v1/campaigns/${x.id}/resume`,RQ0(x),x.company);if(x.json){m0(Q);return}console.log(`Campaign resumed: ${Q.campaign?.name??x.id}`),console.log(`ID: ${Q.campaign?.id??x.id}`),console.log(`Status: ${Q.campaign?.status??"sending"}`),Wx("URL",Q.campaign?.url);return}if(A==="delete"){if(!await q6(`Delete campaign ${x.id}?`,x)){console.log("Aborted.");return}let Q=await M0("DELETE",`/api/v1/campaigns/${x.id}`,void 0,x.company);if(x.json){m0(Q);return}console.log(`Deleted campaign: ${x.id}`);return}if(A==="duplicate"){let Q=await M0("POST",`/api/v1/campaigns/${x.id}/duplicate`,KQ0(x),x.company);if(x.json){m0(Q);return}if(console.log(`Duplicated campaign: ${Q.campaign?.name??x.id}`),console.log(`New campaign ID: ${Q.campaign?.id??"Unknown"}`),console.log(`Status: ${Q.campaign?.status??"draft"}`),Q.emailId!==void 0)console.log(`New email ID: ${Q.emailId}`);Wx("URL",Q.campaign?.url),Wx("Preview URL",Q.campaign?.previewUrl);return}if(A==="schedule"){let Q=JQ0(x),w=await M0("POST",`/api/v1/campaigns/${x.id}/schedule`,qQ0(x,Q),x.company),S=await zB(x.company),J=S!==void 0?OE({companyId:S,campaignId:x.id}):void 0;if(x.json){m0({...w,...w.campaign!==void 0&&J?.urls.campaign!==void 0&&{campaign:{...w.campaign,url:J.urls.campaign,previewUrl:J.urls.campaignPreview}},previewUrl:w.previewUrl??J?.urls.campaignPreview??void 0,...J!==void 0&&{appUrls:J.urls}});return}console.log(`Scheduled campaign: ${w.campaign?.name??x.id}`),console.log(`ID: ${w.campaign?.id??x.id}`),console.log(`Status: ${w.campaign?.status??"scheduled"}`),console.log(`Scheduled: ${bA(w.scheduledAt??w.campaign?.scheduledAt??null)}`),Wx("URL",J?.urls.campaign??w.campaign?.url),Wx("Preview URL",w.previewUrl??J?.urls.campaignPreview??w.campaign?.previewUrl);return}if(A==="update"){let Q=HQ0(x),w=GQ0(x,E,Q),S=await M0("PUT",`/api/v1/campaigns/${x.id}`,w,x.company),J=await zB(x.company),M=J!==void 0?OE({companyId:J,campaignId:x.id}):void 0;if(x.json){m0({...S,...S.campaign!==void 0&&M?.urls.campaign!==void 0&&{campaign:{...S.campaign,url:M.urls.campaign,previewUrl:M.urls.campaignPreview}},...M!==void 0&&{appUrls:M.urls}});return}if(console.log(`Updated campaign: ${S.campaign?.name??x.id}`),console.log(`ID: ${S.campaign?.id??x.id}`),console.log(`Status: ${S.campaign?.status??"Unknown"}`),console.log(`Labels: ${BH(S.campaign?.labels)}`),Wx("URL",M?.urls.campaign??S.campaign?.url),Wx("Preview URL",M?.urls.campaignPreview??S.campaign?.previewUrl),S.campaign)console.log(`Reply-To: ${Ul(S.campaign)}`);return}if(A==="test"){if(!x.to)throw new E0("--to is required",400);let Q=await M0("POST",`/api/v1/campaigns/${x.id}/test`,{to:x.to},x.company),w=await zB(x.company),S=w!==void 0?OE({companyId:w,campaignId:x.id}):void 0;if(x.json){m0({...Q,...S!==void 0&&{appUrls:S.urls}});return}console.log(Q.message??`Test requested for ${x.id}`),Wx("URL",S?.urls.campaign),Wx("Preview URL",S?.urls.campaignPreview);return}let D=await M0("GET",`/api/v1/campaigns/${x.id}`,void 0,x.company),B=await zB(x.company),g=B!==void 0?OE({companyId:B,campaignId:x.id}):void 0;if(x.json){m0({...D,...g?.urls.campaign!==void 0&&{campaign:{...D.campaign,url:g.urls.campaign,previewUrl:g.urls.campaignPreview}},...g!==void 0&&{appUrls:g.urls}});return}let F=D.campaign;if(console.log(F.name),console.log(`ID: ${F.id}`),Wx("URL",g?.urls.campaign??F.url),Wx("Preview URL",g?.urls.campaignPreview??F.previewUrl),console.log(`Status: ${F.status}`),console.log(`Subject: ${F.subject}`),F.trackingCode)console.log(`Tracking code: ${F.trackingCode}`);if(console.log(`Labels: ${BH(F.labels)}`),console.log(`Preheader: ${F.preheader||"None"}`),F.replyToEmail||F.replyProfileId)console.log(`Reply-To: ${Ul(F)}`);console.log(`Blocks: ${F.blocks.length}`),console.log(`Created: ${bA(F.createdAt)}`),console.log(`Scheduled: ${bA(F.scheduledAt)}`),console.log(`Sent: ${bA(F.sentAt)}`)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}function ql(A){let x=A.supportedLocales.join(", "),E=A.subscriberLocaleAttribute??"not configured";return`${A.primaryLocale} -> [${x}] | fallback ${A.fallbackLocale} | attr ${E} | sync ${A.autoSyncMode}`}async function DH(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let F=await M0("GET","/api/v1/companies"),Q=F.companies.map((S)=>{let J=OE({companyId:S.id});return{...S,url:J.urls.dashboard,settingsUrl:J.urls.settings}}),w=F.currentCompanyId!==null?OE({companyId:F.currentCompanyId}):void 0;if(x.json){m0({...F,companies:Q,...w!==void 0&&{appUrls:w.urls}});return}console.log(`Companies (${F.companies.length})`);for(let S of Q){let J=S.id===F.currentCompanyId?" (current)":"";console.log(`- ${S.name} [${S.id}]${J}`),console.log(` Status: ${S.status}`),console.log(` Website: ${S.websiteUrl??"Not set"}`),Wx(" URL",S.url),Wx(" Settings",S.settingsUrl),console.log(` Localization: ${ql(S.emailLocalizationConfig)}`)}return}if(!x.id){if(A!=="create")throw new E0("Company ID is required",400)}if(A==="create"){if(!x.domain)throw new E0("Domain is required",400);let F=await M0("POST","/api/v1/companies",{domain:x.domain,name:x.name}),Q=OE({companyId:F.company.id});if(x.json){m0({...F,company:{...F.company,url:Q.urls.dashboard,settingsUrl:Q.urls.settings},appUrls:Q.urls,settingsUrls:Q.settingsUrls});return}console.log(F.company.name),console.log(`ID: ${F.company.id}`),Wx("URL",Q.urls.dashboard),Wx("Settings",Q.urls.settings),console.log(`Status: ${F.company.status}`),console.log(`Website: ${F.company.websiteUrl??"Not set"}`),console.log(""),console.log(F.message);return}let E=await M0("GET",`/api/v1/companies/${x.id}`),D=OE({companyId:x.id});if(x.json){m0({...E,company:{...E.company,url:D.urls.dashboard,settingsUrl:D.urls.settings},appUrls:D.urls,settingsUrls:D.settingsUrls});return}let B=E.company;console.log(B.name),console.log(`ID: ${B.id}`),Wx("URL",D.urls.dashboard),Wx("Settings",D.urls.settings),console.log(`Status: ${B.status}`),console.log(`Website: ${B.websiteUrl??"Not set"}`),console.log(`Created: ${bA(B.createdAt)}`),console.log(`Primary language: ${B.language}`),console.log(`Localization: ${ql(B.emailLocalizationConfig)}`);let g=Object.entries(B.emailLocalizationConfig.valueMappings);if(g.length>0){console.log("Mappings:");for(let[F,Q]of g)console.log(`- ${F} -> ${Q}`)}}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}var P7={subscriptionId:"billingSubscriptionId",planId:"billingPlanId",planName:"billingPlanName",amount:"billingAmount",currency:"billingCurrency",interval:"billingInterval",periodStart:"billingPeriodStart",periodEnd:"billingPeriodEnd",canceledAt:"billingCanceledAt",trialEndsAt:"trial_ends_at"},ZQ0=[P7.subscriptionId,P7.planId,P7.planName,P7.amount,P7.currency,P7.interval,P7.periodStart,P7.periodEnd,P7.canceledAt,P7.trialEndsAt],xh0=new Set(["mrr","ltv","stripeCustomerId","stripeEmail",...ZQ0]);var LQ0=["google","microsoft","yahoo","apple","proton","zoho","fastmail","rackspace","amazon","ovh","titan","aol","comcast","hey","gmx","freenet","yandex","qq","naver","daum","netease","sina","sohu","orange","free-fr","laposte","sfr","libero","virgilio","t-online","seznam","ukr-net","docomo","softbank","kddi","nifty","biglobe","ocn","sone","bol","uol","terra","wp","onet","interia","kpn","ziggo","bluewin","skynet","telenet","mailcom","self_hosted","unknown"];var zQ0={google:"Google",microsoft:"Microsoft",yahoo:"Yahoo",apple:"iCloud",proton:"Proton",zoho:"Zoho",fastmail:"Fastmail",rackspace:"Rackspace",amazon:"Amazon WorkMail",ovh:"OVH",titan:"Titan",aol:"AOL",comcast:"Comcast",hey:"HEY",gmx:"GMX",freenet:"Freenet",yandex:"Yandex",qq:"QQ Mail",naver:"Naver",daum:"Daum",netease:"NetEase",sina:"Sina",sohu:"Sohu",orange:"Orange","free-fr":"Free",laposte:"La Poste",sfr:"SFR",libero:"Libero",virgilio:"Virgilio","t-online":"T-Online",seznam:"Seznam","ukr-net":"UKR.NET",docomo:"Docomo",softbank:"SoftBank",kddi:"KDDI au",nifty:"Nifty",biglobe:"BIGLOBE",ocn:"OCN",sone:"So-net",bol:"Bol",uol:"UOL",terra:"Terra",wp:"WP Poczta",onet:"Onet",interia:"Interia",kpn:"KPN Mail",ziggo:"Ziggo",bluewin:"Bluewin",skynet:"Skynet",telenet:"Telenet",mailcom:"Mail.com",self_hosted:"Custom domain",unknown:"Unknown"},OQ0=LQ0.map((A)=>({value:A,label:zQ0[A]}));var zY=104857600,NQ0=["application/pdf","application/epub+zip","application/zip","application/x-zip-compressed","image/png","image/jpeg","image/gif","image/webp","audio/mpeg","audio/wav","video/mp4","text/plain","text/csv"],gh0=new Set(NQ0);var RC={CONTACT_ADDED:"contact_added",TAG_ADDED:"tag_added",SEGMENT_ENTERED:"segment_entered",EVENT_RECEIVED:"event_received",INBOUND_WEBHOOK:"inbound_webhook",INACTIVITY:"inactivity",FREQUENCY:"frequency"},CH=["exists","not_exists","equals","not_equals","one_of","contains","greater_than","less_than"],Il0=[{value:RC.CONTACT_ADDED,label:"Contact added",description:"When a contact is added to a list"},{value:RC.TAG_ADDED,label:"Tag added",description:"When a tag is applied to a contact"},{value:RC.SEGMENT_ENTERED,label:"Segment entered",description:"When a contact newly enters a segment"},{value:RC.EVENT_RECEIVED,label:"Event received",description:"When an event is received via API"},{value:RC.INBOUND_WEBHOOK,label:"External app",description:"Connect Cal.com, Calendly, Typeform, and more"},{value:RC.INACTIVITY,label:"Inactivity",description:"When a contact hasn't triggered an event for X days"},{value:RC.FREQUENCY,label:"Event frequency",description:"When a contact triggers an event X times in Y days"}],r2={HAS_TAG:"has_tag",IN_LIST:"in_list",IN_SEGMENT:"in_segment",EVENT_RECEIVED:"event_received",LINK_CLICKED:"link_clicked",FIELD_EQUALS:"field_equals",FIELD_CONTAINS:"field_contains",FIELD_GREATER_THAN:"field_greater_than",FIELD_LESS_THAN:"field_less_than"},OY={EVER:"ever",THIS_SEQUENCE:"this_sequence",PREVIOUS_EMAIL:"previous_email"},Ql0=[{value:OY.THIS_SEQUENCE,label:"This sequence",description:"Match activity that happened after this contact entered"},{value:OY.PREVIOUS_EMAIL,label:"Previous email",description:"Match activity tied to the last email sent in this sequence"},{value:OY.EVER,label:"Ever",description:"Match activity from the contact's full history"}],yl0=[{value:r2.HAS_TAG,label:"Has tag",description:"Contact has a specific tag",requiresValue:!0,requiresField:!1},{value:r2.IN_LIST,label:"In list",description:"Contact is in a specific list",requiresValue:!0,requiresField:!1},{value:r2.LINK_CLICKED,label:"Clicked link",description:"Contact clicked any link or a matching URL",requiresValue:!1,requiresField:!1},{value:r2.EVENT_RECEIVED,label:"Event received",description:"Contact triggered a specific event",requiresValue:!0,requiresField:!1},{value:r2.IN_SEGMENT,label:"In segment",description:"Contact currently matches a saved segment",requiresValue:!0,requiresField:!1},{value:r2.FIELD_EQUALS,label:"Attribute equals",description:"Subscriber custom attribute equals a value",requiresValue:!0,requiresField:!0},{value:r2.FIELD_CONTAINS,label:"Attribute contains",description:"Subscriber custom attribute contains a value",requiresValue:!0,requiresField:!0},{value:r2.FIELD_GREATER_THAN,label:"Attribute greater than",description:"Subscriber custom attribute is greater than a value",requiresValue:!0,requiresField:!0},{value:r2.FIELD_LESS_THAN,label:"Attribute less than",description:"Subscriber custom attribute is less than a value",requiresValue:!0,requiresField:!0}],gH={EMAIL_OPENED:"email_opened",EMAIL_REPLIED:"email_replied",LINK_CLICKED:"link_clicked",EVENT_RECEIVED:"event_received"},fl0=[{value:gH.EMAIL_OPENED,label:"Email opened",description:"Wait until contact opens an email",requiresName:!1},{value:gH.EMAIL_REPLIED,label:"Email replied",description:"Wait until contact replies to an email",requiresName:!1},{value:gH.LINK_CLICKED,label:"Link clicked",description:"Wait until contact clicks a link",requiresName:!1},{value:gH.EVENT_RECEIVED,label:"Custom event",description:"Wait for a specific event via API",requiresName:!0}],ul={CONTINUE:"continue",EXIT:"exit"},wl0=[{value:ul.CONTINUE,label:"Continue",description:"Continue to the next step"},{value:ul.EXIT,label:"Exit",description:"Exit the sequence"}],xE={TRIGGER_LIST:"trigger_list",TRIGGER_EVENT:"trigger_event",TRIGGER_INBOUND_WEBHOOK:"trigger_inbound_webhook",TRIGGER_INACTIVITY:"trigger_inactivity",TRIGGER_FREQUENCY:"trigger_frequency",ACTION_EMAIL:"action_email",ACTION_WEBHOOK:"action_webhook",ACTION_ADD_TAG:"action_add_tag",ACTION_REMOVE_TAG:"action_remove_tag",ACTION_ADD_TO_LIST:"action_add_to_list",ACTION_REMOVE_FROM_LIST:"action_remove_from_list",ACTION_UPDATE_ATTRIBUTES:"action_update_attributes",ACTION_AB_TEST:"action_ab_test",ACTION_CREATE_DISCOUNT:"action_create_discount",LOGIC_DELAY:"logic_delay",LOGIC_CONDITION:"logic_condition",LOGIC_BRANCH:"logic_branch",LOGIC_WAIT_FOR_EVENT:"logic_wait_for_event"},il0=[xE.ACTION_EMAIL,xE.ACTION_ADD_TAG,xE.ACTION_REMOVE_TAG,xE.ACTION_ADD_TO_LIST,xE.ACTION_REMOVE_FROM_LIST,xE.ACTION_UPDATE_ATTRIBUTES,xE.ACTION_AB_TEST,xE.ACTION_CREATE_DISCOUNT,xE.LOGIC_DELAY,xE.LOGIC_CONDITION,xE.LOGIC_BRANCH,xE.LOGIC_WAIT_FOR_EVENT];var VQ0={trigger:{type:"trigger",nodeType:xE.TRIGGER_LIST,label:"Trigger",description:"Starts the sequence",icon:"Zap",color:"text-amber-600",bgColor:"bg-amber-50 dark:bg-amber-950/30",canAdd:!1},delay:{type:"delay",nodeType:xE.LOGIC_DELAY,label:"Delay",description:"Wait for a period of time",icon:"Clock",color:"text-blue-600",bgColor:"bg-blue-50 dark:bg-blue-950/30",canAdd:!0},send_email:{type:"send_email",nodeType:xE.ACTION_EMAIL,label:"Send Email",description:"Send an email to the contact",icon:"Mail",color:"text-green-600",bgColor:"bg-green-50 dark:bg-green-950/30",canAdd:!0},update_tags:{type:"update_tags",nodeType:xE.ACTION_ADD_TAG,label:"Update Tags",description:"Legacy tag-only subscriber update",icon:"Tags",color:"text-violet-600",bgColor:"bg-violet-50 dark:bg-violet-950/30",canAdd:!1},update_attributes:{type:"update_attributes",nodeType:xE.ACTION_UPDATE_ATTRIBUTES,label:"Update Attributes",description:"Internal subscriber attribute update",icon:"UserRound",color:"text-violet-600",bgColor:"bg-violet-50 dark:bg-violet-950/30",canAdd:!1},update_subscriber:{type:"update_subscriber",nodeType:xE.ACTION_UPDATE_ATTRIBUTES,label:"Update Subscriber",description:"Update lists, tags, or subscriber attributes",icon:"UserRound",color:"text-violet-600",bgColor:"bg-violet-50 dark:bg-violet-950/30",canAdd:!0},update_lists:{type:"update_lists",nodeType:xE.ACTION_ADD_TO_LIST,label:"Update Lists",description:"Add or remove the contact from a subscriber list",icon:"List",color:"text-sky-600",bgColor:"bg-sky-50 dark:bg-sky-950/30",canAdd:!1},ab_test:{type:"ab_test",nodeType:xE.ACTION_AB_TEST,label:"A/B Test",description:"Test email variants to find what works best",icon:"FlaskConical",color:"text-pink-600",bgColor:"bg-pink-50 dark:bg-pink-950/30",canAdd:!0},condition:{type:"condition",nodeType:xE.LOGIC_CONDITION,label:"If",description:"Check a condition before continuing",icon:"GitBranch",color:"text-purple-600",bgColor:"bg-purple-50 dark:bg-purple-950/30",canAdd:!0},branch:{type:"branch",nodeType:xE.LOGIC_BRANCH,label:"If/Else",description:"Split into two conditional paths",icon:"GitFork",color:"text-orange-600",bgColor:"bg-orange-50 dark:bg-orange-950/30",canAdd:!0},wait_for_event:{type:"wait_for_event",nodeType:xE.LOGIC_WAIT_FOR_EVENT,label:"Wait for Event",description:"Wait until an event occurs",icon:"Hourglass",color:"text-cyan-600",bgColor:"bg-cyan-50 dark:bg-cyan-950/30",canAdd:!0},create_discount:{type:"create_discount",nodeType:xE.ACTION_CREATE_DISCOUNT,label:"Create Discount",description:"Generate a payment provider discount code",icon:"BadgePercent",color:"text-emerald-600",bgColor:"bg-emerald-50 dark:bg-emerald-950/30",canAdd:!0},end:{type:"end",nodeType:null,label:"End",description:"End of sequence",icon:"Square",color:"text-gray-600",bgColor:"bg-gray-50 dark:bg-gray-950/30",canAdd:!1}},Sl0=Object.values(VQ0).filter((A)=>A.canAdd);var Rl0=new Set(CH);var PA={SAAS_PURCHASE:"saas.purchase",SAAS_PURCHASE_MONTHLY:"saas.purchase.monthly",SAAS_PURCHASE_YEARLY:"saas.purchase.yearly",SAAS_PAYMENT_FAILED:"saas.payment_failed",SAAS_CANCELLED:"saas.cancelled",SAAS_CHURN:"saas.churn",SAAS_REFUND:"saas.refund",SAAS_UPGRADE:"saas.upgrade",SAAS_DOWNGRADE:"saas.downgrade",SAAS_TRIAL_STARTED:"saas.trial_started",SAAS_TRIAL_WILL_END:"saas.trial_will_end",SAAS_TRIAL_ENDED:"saas.trial_ended",SAAS_CHECKOUT_EXPIRED:"saas.checkout_expired",CONTACT_SUBSCRIBED:"contact.subscribed",CONTACT_UNSUBSCRIBED:"contact.unsubscribed",SEQUENCE_FINISHED:"sequence_finished",SEQUENCE_STOPPED:"sequence_stopped",SEQUENCE_FAILED:"sequence_failed",EMAIL_OPENED:"email.opened",EMAIL_CLICKED:"email.clicked",EMAIL_REPLIED:"email.replied",EMAIL_BOUNCED:"email.bounced",EMAIL_UNSUBSCRIBED:"email.unsubscribed",ECOMMERCE_CART_STARTED:"ecommerce.cart_started",ECOMMERCE_CART_CLEARED:"ecommerce.cart_cleared",ECOMMERCE_ORDER_PLACED:"ecommerce.order_placed",ECOMMERCE_ORDER_CANCELLED:"ecommerce.order_cancelled",ECOMMERCE_ORDER_FULFILLED:"ecommerce.order_fulfilled",ECOMMERCE_ORDER_REFUNDED:"ecommerce.order_refunded",ECOMMERCE_CUSTOMER_CREATED:"ecommerce.customer_created",ECOMMERCE_CHECKOUT_STARTED:"ecommerce.checkout_started",ECOMMERCE_REPLENISHMENT_DUE:"ecommerce.replenishment_due",ECOMMERCE_BACK_IN_STOCK_REQUESTED:"ecommerce.back_in_stock_requested",ECOMMERCE_BACK_IN_STOCK:"ecommerce.back_in_stock",ECOMMERCE_BACK_IN_STOCK_OUT_OF_STOCK:"ecommerce.back_in_stock_out_of_stock"},ql0=[{value:PA.SAAS_PURCHASE,label:"Purchase",category:"SaaS",description:"Customer completed a purchase or subscription"},{value:PA.SAAS_PURCHASE_MONTHLY,label:"Monthly Purchase",category:"SaaS",description:"Customer purchased a monthly subscription"},{value:PA.SAAS_PURCHASE_YEARLY,label:"Yearly Purchase",category:"SaaS",description:"Customer purchased an annual subscription"},{value:PA.SAAS_PAYMENT_FAILED,label:"Payment Failed",category:"SaaS",description:"Payment attempt failed (card declined, expired, etc.)"},{value:PA.SAAS_CANCELLED,label:"Cancelled",category:"SaaS",description:"Customer cancelled but still has access until period ends"},{value:PA.SAAS_CHURN,label:"Churn",category:"SaaS",description:"Subscription ended, customer no longer has access"},{value:PA.SAAS_REFUND,label:"Refund",category:"SaaS",description:"Customer received a refund"},{value:PA.SAAS_UPGRADE,label:"Upgrade",category:"SaaS",description:"Customer upgraded to a higher plan"},{value:PA.SAAS_DOWNGRADE,label:"Downgrade",category:"SaaS",description:"Customer downgraded to a lower plan"},{value:PA.SAAS_TRIAL_STARTED,label:"Trial Started",category:"SaaS",description:"Customer started a free trial"},{value:PA.SAAS_TRIAL_WILL_END,label:"Trial Ending Soon",category:"SaaS",description:"Customer's trial will end in 3 days"},{value:PA.SAAS_TRIAL_ENDED,label:"Trial Ended",category:"SaaS",description:"Customer's trial period ended"},{value:PA.SAAS_CHECKOUT_EXPIRED,label:"Checkout Expired",category:"SaaS",description:"Checkout session expired without completing payment"},{value:PA.CONTACT_SUBSCRIBED,label:"Subscribed",category:"Contact",description:"Contact subscribed to your email list"},{value:PA.CONTACT_UNSUBSCRIBED,label:"Unsubscribed",category:"Contact",description:"Contact unsubscribed from your emails"},{value:PA.SEQUENCE_FINISHED,label:"Sequence Finished",category:"Sequence",description:"Contact reached the end of a sequence"},{value:PA.SEQUENCE_STOPPED,label:"Sequence Stopped",category:"Sequence",description:"Contact was manually stopped from a sequence"},{value:PA.SEQUENCE_FAILED,label:"Sequence Failed",category:"Sequence",description:"Contact's sequence enrollment failed"},{value:PA.EMAIL_OPENED,label:"Email Opened",category:"Email",description:"Contact opened an email"},{value:PA.EMAIL_CLICKED,label:"Email Clicked",category:"Email",description:"Contact clicked a link in an email"},{value:PA.EMAIL_REPLIED,label:"Email Replied",category:"Email",description:"Contact replied to an email"},{value:PA.EMAIL_BOUNCED,label:"Email Bounced",category:"Email",description:"Email bounced (address invalid or inbox full)"},{value:PA.EMAIL_UNSUBSCRIBED,label:"Email Unsubscribed",category:"Email",description:"Contact clicked unsubscribe link in an email"},{value:PA.ECOMMERCE_CART_STARTED,label:"Cart Started",category:"E-Commerce",description:"Customer started a known cart"},{value:PA.ECOMMERCE_CART_CLEARED,label:"Cart Cleared",category:"E-Commerce",description:"Customer cleared all items from a known cart"},{value:PA.ECOMMERCE_ORDER_PLACED,label:"Order Placed",category:"E-Commerce",description:"Customer placed an order"},{value:PA.ECOMMERCE_ORDER_CANCELLED,label:"Order Cancelled",category:"E-Commerce",description:"Customer's order was cancelled"},{value:PA.ECOMMERCE_ORDER_FULFILLED,label:"Order Fulfilled",category:"E-Commerce",description:"Customer's order was shipped/fulfilled"},{value:PA.ECOMMERCE_ORDER_REFUNDED,label:"Order Refunded",category:"E-Commerce",description:"Customer received a refund for an order"},{value:PA.ECOMMERCE_CUSTOMER_CREATED,label:"Customer Created",category:"E-Commerce",description:"New customer created in your store"},{value:PA.ECOMMERCE_CHECKOUT_STARTED,label:"Checkout Started",category:"E-Commerce",description:"Customer started checkout but hasn't completed"},{value:PA.ECOMMERCE_REPLENISHMENT_DUE,label:"Replenishment Due",category:"E-Commerce",description:"Purchased product is likely ready for a repeat order"},{value:PA.ECOMMERCE_BACK_IN_STOCK_REQUESTED,label:"Back In Stock Requested",category:"E-Commerce",description:"Shopper joined a back-in-stock waitlist"},{value:PA.ECOMMERCE_BACK_IN_STOCK,label:"Back In Stock",category:"E-Commerce",description:"A watched Shopify variant became available again"},{value:PA.ECOMMERCE_BACK_IN_STOCK_OUT_OF_STOCK,label:"Back In Stock Out Of Stock",category:"E-Commerce",description:"A watched variant went out of stock after notification"}],pA={LEAD:"lead",CUSTOMER:"customer",CANCELLED:"cancelled",CHURNED:"churned",REFUNDED:"refunded",PAST_DUE:"past-due",VISITED_PAYMENT_PAGE:"visited-payment-page",TRIAL:"trial",SAAS_MONTHLY:"saas.monthly",SAAS_YEARLY:"saas.yearly",ACTIVE:"active",INACTIVE:"inactive",ECOMMERCE_IN_CART:"ecommerce.in_cart",ECOMMERCE_IN_CHECKOUT:"ecommerce.in_checkout",ECOMMERCE_CUSTOMER:"ecommerce.customer"},Ml0=[{value:pA.LEAD,label:"Lead",category:"Status",color:"blue",description:"New contact who hasn't purchased yet"},{value:pA.CUSTOMER,label:"Customer",category:"Status",color:"green",description:"Contact with an active paid subscription"},{value:pA.CANCELLED,label:"Cancelled",category:"Status",color:"amber",description:"Customer who cancelled but still has access until period ends"},{value:pA.CHURNED,label:"Churned",category:"Status",color:"red",description:"Former customer with no active subscription"},{value:pA.REFUNDED,label:"Refunded",category:"Status",color:"orange",description:"Customer who received a refund"},{value:pA.PAST_DUE,label:"Past Due",category:"Status",color:"yellow",description:"Customer with failed payment, at risk of churning"},{value:pA.VISITED_PAYMENT_PAGE,label:"Visited Payment Page",category:"Status",color:"orange",description:"Visited payment/checkout page but did not complete payment"},{value:pA.TRIAL,label:"Trial",category:"Status",color:"purple",description:"Contact currently on a free trial"},{value:pA.ACTIVE,label:"Active",category:"Engagement",color:"emerald",description:"Engaged user who regularly interacts with your product"},{value:pA.INACTIVE,label:"Inactive",category:"Engagement",color:"slate",description:"Dormant user who hasn't engaged recently"},{value:pA.SAAS_MONTHLY,label:"Monthly",category:"Subscription",color:"indigo",description:"Customer on a monthly subscription plan"},{value:pA.SAAS_YEARLY,label:"Yearly",category:"Subscription",color:"violet",description:"Customer on an annual subscription plan"},{value:pA.ECOMMERCE_IN_CART,label:"In Cart",category:"E-Commerce",color:"orange",description:"Contact currently has an active cart"},{value:pA.ECOMMERCE_IN_CHECKOUT,label:"In Checkout",category:"E-Commerce",color:"amber",description:"Contact has started checkout but has not finished"},{value:pA.ECOMMERCE_CUSTOMER,label:"E-Commerce Customer",category:"E-Commerce",color:"green",description:"Customer who has placed at least one order"}],Yl0=[{triggerEvent:PA.SAAS_PURCHASE,actions:{addTags:[pA.CUSTOMER],removeTags:[pA.LEAD,pA.PAST_DUE,pA.CANCELLED,pA.CHURNED,pA.VISITED_PAYMENT_PAGE]}},{triggerEvent:PA.SAAS_PURCHASE_MONTHLY,actions:{addTags:[pA.CUSTOMER,pA.SAAS_MONTHLY],removeTags:[pA.LEAD,pA.PAST_DUE,pA.CANCELLED,pA.CHURNED,pA.SAAS_YEARLY,pA.VISITED_PAYMENT_PAGE]}},{triggerEvent:PA.SAAS_PURCHASE_YEARLY,actions:{addTags:[pA.CUSTOMER,pA.SAAS_YEARLY],removeTags:[pA.LEAD,pA.PAST_DUE,pA.CANCELLED,pA.CHURNED,pA.SAAS_MONTHLY,pA.VISITED_PAYMENT_PAGE]}},{triggerEvent:PA.SAAS_PAYMENT_FAILED,actions:{addTags:[pA.PAST_DUE],removeTags:[]},conditions:{requiresTags:[pA.CUSTOMER]}},{triggerEvent:PA.SAAS_CANCELLED,actions:{addTags:[pA.CANCELLED],removeTags:[]}},{triggerEvent:PA.SAAS_CHURN,actions:{addTags:[pA.CHURNED],removeTags:[pA.CUSTOMER,pA.CANCELLED,pA.TRIAL,pA.PAST_DUE,pA.SAAS_MONTHLY,pA.SAAS_YEARLY]}},{triggerEvent:PA.SAAS_REFUND,actions:{addTags:[pA.REFUNDED],removeTags:[pA.CUSTOMER]}},{triggerEvent:PA.SAAS_TRIAL_STARTED,actions:{addTags:[pA.TRIAL],removeTags:[pA.LEAD]}},{triggerEvent:PA.SAAS_TRIAL_ENDED,actions:{addTags:[],removeTags:[pA.TRIAL]}},{triggerEvent:PA.SAAS_CHECKOUT_EXPIRED,actions:{addTags:[pA.VISITED_PAYMENT_PAGE],removeTags:[]},conditions:{requiresNotTags:[pA.CUSTOMER]}},{triggerEvent:PA.CONTACT_SUBSCRIBED,actions:{addTags:[pA.LEAD],removeTags:[]}},{triggerEvent:PA.ECOMMERCE_CART_STARTED,actions:{addTags:[pA.ECOMMERCE_IN_CART],removeTags:[pA.ECOMMERCE_IN_CHECKOUT]}},{triggerEvent:PA.ECOMMERCE_CART_CLEARED,actions:{addTags:[],removeTags:[pA.ECOMMERCE_IN_CART,pA.ECOMMERCE_IN_CHECKOUT]}},{triggerEvent:PA.ECOMMERCE_CHECKOUT_STARTED,actions:{addTags:[pA.ECOMMERCE_IN_CHECKOUT],removeTags:[pA.ECOMMERCE_IN_CART]}},{triggerEvent:PA.ECOMMERCE_ORDER_PLACED,actions:{addTags:[pA.ECOMMERCE_CUSTOMER],removeTags:[pA.ECOMMERCE_IN_CART,pA.ECOMMERCE_IN_CHECKOUT]}},{triggerEvent:PA.ECOMMERCE_CUSTOMER_CREATED,actions:{addTags:[pA.LEAD],removeTags:[]}},{triggerEvent:PA.ECOMMERCE_ORDER_REFUNDED,actions:{addTags:[pA.REFUNDED],removeTags:[]}}];var jY={provider:"shopify",lineItemId:"123456789",providerProductId:"788032119674292922",providerVariantId:"45123456789123",sku:"VANILLA-1KG",title:"Protein Powder",variantTitle:"Vanilla",quantity:1,priceCents:8850,vendor:"Sequenzy Store",productType:"Supplements",optionValues:["Vanilla"]},PY={provider:"woocommerce",lineItemId:"727",providerProductId:"42",providerVariantId:null,sku:null,title:"Protein Powder",variantTitle:null,quantity:1,priceCents:8850,vendor:null,productType:null,optionValues:[]},Xl={orderId:"820982911946154500",orderNumber:1001,totalPriceCents:8850,currency:"USD",financialStatus:"paid",fulfillmentStatus:null,orderedAt:"2026-04-02T12:00:00.000Z",orderCreatedAt:"2026-04-02T12:00:00.000Z",productNames:["Protein Powder"],itemCount:1,lineItems:[jY],shopifyTopic:"orders/create"},Wl={orderId:727,orderNumber:"727",orderStatus:"processing",totalPriceCents:8850,currency:"USD",productNames:["Protein Powder"],itemCount:1,lineItems:[PY],customerId:115,orderedAt:"2026-04-02T12:00:00.000Z",orderCreatedAt:"2026-04-02T12:00:00.000Z",paidAt:"2026-04-02T12:00:00.000Z"},NY={provider:"shopify",productId:"prod_internal_1",providerProductId:"788032119674292922",providerVariantId:"45123456789123",product:{id:"prod_internal_1",providerId:"788032119674292922",title:"Protein Powder",variantTitle:"Vanilla",imageUrl:"https://cdn.shopify.com/protein-powder.jpg",url:"https://store.example.com/products/protein-powder",price:"$88.50",priceCents:8850,currency:"USD",quantity:1},productTitle:"Protein Powder",variantTitle:"Vanilla",quantity:1,sourceOrderId:"820982911946154500",orderedAt:"2026-03-03T12:00:00.000Z",replenishmentDays:30,replenishmentDueAt:"2026-04-02T12:00:00.000Z",replenishmentKey:"shopify:company:buyer@example.com:788032119674292922:45123456789123:variant",replenishmentScope:"variant"},Ll={provider:"api",lineItemId:"line-1",providerProductId:"SKU-PROTEIN-1KG",providerVariantId:"SKU-PROTEIN-1KG-VANILLA",sku:"VANILLA-1KG",title:"Protein Powder",variantTitle:"Vanilla",quantity:1,priceCents:8850,vendor:null,productType:null,optionValues:["Vanilla"]},Zl={orderId:"order-1001",orderNumber:"1001",totalPriceCents:8850,currency:"USD",productNames:["Protein Powder"],itemCount:1,lineItems:[Ll],orderedAt:"2026-04-02T12:00:00.000Z",orderCreatedAt:"2026-04-02T12:00:00.000Z"},Wl0={"order.completed":PA.ECOMMERCE_ORDER_PLACED,"order.placed":PA.ECOMMERCE_ORDER_PLACED,"order.created":PA.ECOMMERCE_ORDER_PLACED},Zl0={shopify:{[PA.ECOMMERCE_ORDER_PLACED]:Xl,[PA.ECOMMERCE_ORDER_FULFILLED]:{...Xl,shopifyTopic:"orders/fulfilled",fulfillmentStatus:"fulfilled"},[PA.ECOMMERCE_REPLENISHMENT_DUE]:{...NY,provider:"shopify"},[PA.ECOMMERCE_CART_STARTED]:{cartId:"cart-token-abc123",itemCount:1,productNames:["Protein Powder"],lineItems:[jY]},[PA.ECOMMERCE_CHECKOUT_STARTED]:{checkoutId:"checkout-token-xyz789",itemCount:1,totalPriceCents:8850,currency:"USD",productNames:["Protein Powder"],lineItems:[jY]}},woocommerce:{[PA.ECOMMERCE_ORDER_PLACED]:Wl,[PA.ECOMMERCE_ORDER_FULFILLED]:{...Wl,orderStatus:"completed",completedAt:"2026-04-03T12:00:00.000Z"},[PA.ECOMMERCE_REPLENISHMENT_DUE]:{...NY,provider:"woocommerce"},[PA.ECOMMERCE_CART_STARTED]:{cartId:"wc-cart-hash-abc123",itemCount:1,productNames:["Protein Powder"],lineItems:[PY]},[PA.ECOMMERCE_CHECKOUT_STARTED]:{checkoutId:"wc-checkout-xyz789",itemCount:1,totalPriceCents:8850,currency:"USD",productNames:["Protein Powder"],lineItems:[PY]}},api:{[PA.ECOMMERCE_ORDER_PLACED]:Zl,[PA.ECOMMERCE_ORDER_FULFILLED]:{...Zl,fulfilledAt:"2026-04-03T12:00:00.000Z"},[PA.ECOMMERCE_REPLENISHMENT_DUE]:{...NY,provider:"api"},[PA.ECOMMERCE_CHECKOUT_STARTED]:{checkoutId:"checkout-xyz789",itemCount:1,totalPriceCents:8850,currency:"USD",productNames:["Protein Powder"],lineItems:[Ll]}}};var nQ0=String.raw`(?:\.\.\/)*(?:@?[A-Za-z_][A-Za-z0-9_.]*)`,mQ0=String.raw`\{\{\s*(${nQ0})\s*(?:\|\s*([^}]*?))?\s*\}\}`;function pf(A){return new RegExp(mQ0,A)}var TQ0=["if","unless","equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","and","or","not","ifEq","ifNe","ifGt","ifGte","ifLt","ifLte","ifContains"],FH=TQ0.join("|"),jl0=new RegExp([String.raw`\{\{\s*(?:#(?:${FH})\b[\s\S]*?|else(?:\s+if\b[\s\S]*?)?|\/(?:${FH}))\s*\}\}`,String.raw`\{%-?\s*(?:if|unless|elsif|elseif|else\s+if|else|endif|endunless)\b[\s\S]*?-?%\}`,String.raw`\[%\s*(?:if|unless|elsif|elseif|else\s+if|else|endif|endunless)\b[\s\S]*?%\]`,String.raw`\*\|\s*(?:IFNOT|IF|ELSEIF|ELSE|END:IF)\b[\s\S]*?\|\*`,String.raw`%%\[\s*(?:IF|ELSEIF|ELSE\s+IF|ELSE|ENDIF)\b[\s\S]*?\]%%`,String.raw`%\s*(?:IF|ELSEIF|ELSE|\/IF)\b[\s\S]*?%`,String.raw`\[(?:if|elseif):[^\]]*\]`,String.raw`\[(?:else|endif)\]`].join("|"),"gi"),Pl0=new RegExp([String.raw`\{\{\s*(?:#(?:${FH})\b|else\b|\/(?:${FH})\b)`,String.raw`\{%-?\s*(?:if|unless|elsif|elseif|else\s+if|else|endif|endunless)\b`,String.raw`\[%\s*(?:if|unless|elsif|elseif|else\s+if|else|endif|endunless)\b`,String.raw`\*\|\s*(?:IFNOT|IF|ELSEIF|ELSE|END:IF)\b`,String.raw`%%\[\s*(?:IF|ELSEIF|ELSE\s+IF|ELSE|ENDIF)\b`,String.raw`%\s*(?:IF|ELSEIF|ELSE|\/IF)\b`,String.raw`\[(?:if|elseif):`,String.raw`\[(?:else|endif)\]`].join("|"),"i");var hQ0='<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="600" viewBox="0 0 1200 600"><rect width="1200" height="600" fill="#f8fafc"/><rect x="520" y="225" width="160" height="145" rx="24" fill="none" stroke="#cbd5e1" stroke-width="10"/><path d="M560 245c0-48 80-48 80 0" fill="none" stroke="#cbd5e1" stroke-width="10" stroke-linecap="round"/><circle cx="565" cy="292" r="7" fill="#cbd5e1"/><circle cx="635" cy="292" r="7" fill="#cbd5e1"/></svg>',kl0=`data:image/svg+xml,${encodeURIComponent(hQ0)}`;var Pl=[{family:"ABeeZee",category:"Sans Serif"},{family:"Abel",category:"Sans Serif"},{family:"Abhaya Libre",category:"Serif"},{family:"Aboreto",category:"Display"},{family:"Abril Fatface",category:"Display"},{family:"Abyssinica SIL",category:"Serif"},{family:"Aclonica",category:"Sans Serif"},{family:"Acme",category:"Sans Serif"},{family:"Actor",category:"Sans Serif"},{family:"Adamina",category:"Serif"},{family:"ADLaM Display",category:"Display"},{family:"Advent Pro",category:"Sans Serif"},{family:"Afacad",category:"Sans Serif"},{family:"Afacad Flux",category:"Sans Serif"},{family:"Agbalumo",category:"Display"},{family:"Agdasima",category:"Sans Serif"},{family:"Agu Display",category:"Display"},{family:"Aguafina Script",category:"Handwriting"},{family:"Akatab",category:"Sans Serif"},{family:"Akaya Kanadaka",category:"Display"},{family:"Akaya Telivigala",category:"Display"},{family:"Akronim",category:"Display"},{family:"Akshar",category:"Sans Serif"},{family:"Akt",category:"Sans Serif"},{family:"Aladin",category:"Display"},{family:"Alan Sans",category:"Sans Serif"},{family:"Alata",category:"Sans Serif"},{family:"Alatsi",category:"Sans Serif"},{family:"Albert Sans",category:"Sans Serif"},{family:"Aldrich",category:"Sans Serif"},{family:"Alef",category:"Sans Serif"},{family:"Alegreya",category:"Serif"},{family:"Alegreya Sans",category:"Sans Serif"},{family:"Alegreya Sans SC",category:"Sans Serif"},{family:"Alegreya SC",category:"Serif"},{family:"Aleo",category:"Serif"},{family:"Alex Brush",category:"Handwriting"},{family:"Alexandria",category:"Sans Serif"},{family:"Alfa Slab One",category:"Display"},{family:"Alice",category:"Serif"},{family:"Alike",category:"Serif"},{family:"Alike Angular",category:"Serif"},{family:"Alkalami",category:"Serif"},{family:"Alkatra",category:"Display"},{family:"Allan",category:"Display"},{family:"Allerta",category:"Sans Serif"},{family:"Allerta Stencil",category:"Sans Serif"},{family:"Allison",category:"Handwriting"},{family:"Allkin",category:"Display"},{family:"Allura",category:"Handwriting"},{family:"Almarai",category:"Sans Serif"},{family:"Almendra",category:"Serif"},{family:"Almendra Display",category:"Display"},{family:"Almendra SC",category:"Serif"},{family:"Alumni Sans",category:"Sans Serif"},{family:"Alumni Sans Collegiate One",category:"Sans Serif"},{family:"Alumni Sans Inline One",category:"Display"},{family:"Alumni Sans Pinstripe",category:"Sans Serif"},{family:"Alumni Sans SC",category:"Sans Serif"},{family:"Alyamama",category:"Serif"},{family:"Amarante",category:"Display"},{family:"Amaranth",category:"Sans Serif"},{family:"Amarna",category:"Sans Serif"},{family:"Amatic SC",category:"Handwriting"},{family:"Amethysta",category:"Serif"},{family:"Amiko",category:"Sans Serif"},{family:"Amiri",category:"Serif"},{family:"Amiri Quran",category:"Serif"},{family:"Amita",category:"Handwriting"},{family:"Anaheim",category:"Sans Serif"},{family:"Ancizar Sans",category:"Sans Serif"},{family:"Ancizar Serif",category:"Serif"},{family:"Andada Pro",category:"Serif"},{family:"Andika",category:"Sans Serif"},{family:"Anek Bangla",category:"Sans Serif"},{family:"Anek Devanagari",category:"Sans Serif"},{family:"Anek Gujarati",category:"Sans Serif"},{family:"Anek Gurmukhi",category:"Sans Serif"},{family:"Anek Kannada",category:"Sans Serif"},{family:"Anek Latin",category:"Sans Serif"},{family:"Anek Malayalam",category:"Sans Serif"},{family:"Anek Odia",category:"Sans Serif"},{family:"Anek Tamil",category:"Sans Serif"},{family:"Anek Telugu",category:"Sans Serif"},{family:"Angkor",category:"Display"},{family:"Annapurna SIL",category:"Serif"},{family:"Annie Use Your Telescope",category:"Handwriting"},{family:"Anonymous Pro",category:"Monospace"},{family:"Anta",category:"Sans Serif"},{family:"Antic",category:"Sans Serif"},{family:"Antic Didone",category:"Serif"},{family:"Antic Slab",category:"Serif"},{family:"Anton",category:"Sans Serif"},{family:"Anton SC",category:"Sans Serif"},{family:"Antonio",category:"Sans Serif"},{family:"Anuphan",category:"Sans Serif"},{family:"Anybody",category:"Display"},{family:"Aoboshi One",category:"Serif"},{family:"AR One Sans",category:"Sans Serif"},{family:"Arapey",category:"Serif"},{family:"Arbutus",category:"Serif"},{family:"Arbutus Slab",category:"Serif"},{family:"Architects Daughter",category:"Handwriting"},{family:"Archivo",category:"Sans Serif"},{family:"Archivo Black",category:"Sans Serif"},{family:"Archivo Narrow",category:"Sans Serif"},{family:"Are You Serious",category:"Handwriting"},{family:"Aref Ruqaa",category:"Serif"},{family:"Aref Ruqaa Ink",category:"Serif"},{family:"Arima",category:"Display"},{family:"Arimo",category:"Sans Serif"},{family:"Arizonia",category:"Handwriting"},{family:"Armata",category:"Sans Serif"},{family:"Arsenal",category:"Sans Serif"},{family:"Arsenal SC",category:"Sans Serif"},{family:"Artifika",category:"Serif"},{family:"Arvo",category:"Serif"},{family:"Arya",category:"Sans Serif"},{family:"Asap",category:"Sans Serif"},{family:"Asap Condensed",category:"Sans Serif"},{family:"Asar",category:"Serif"},{family:"Asimovian",category:"Sans Serif"},{family:"Asset",category:"Display"},{family:"Assistant",category:"Sans Serif"},{family:"Asta Sans",category:"Sans Serif"},{family:"Astloch",category:"Display"},{family:"Asul",category:"Serif"},{family:"Athiti",category:"Sans Serif"},{family:"Atkinson Hyperlegible",category:"Sans Serif"},{family:"Atkinson Hyperlegible Mono",category:"Sans Serif"},{family:"Atkinson Hyperlegible Next",category:"Sans Serif"},{family:"Atma",category:"Display"},{family:"Atomic Age",category:"Display"},{family:"Aubrey",category:"Display"},{family:"Audiowide",category:"Display"},{family:"Autour One",category:"Display"},{family:"Average",category:"Serif"},{family:"Average Sans",category:"Sans Serif"},{family:"Averia Gruesa Libre",category:"Display"},{family:"Averia Libre",category:"Display"},{family:"Averia Sans Libre",category:"Display"},{family:"Averia Serif Libre",category:"Display"},{family:"Azeret Mono",category:"Monospace"},{family:"B612",category:"Sans Serif"},{family:"B612 Mono",category:"Monospace"},{family:"Babylonica",category:"Handwriting"},{family:"Bacasime Antique",category:"Serif"},{family:"Bad Script",category:"Handwriting"},{family:"Badeen Display",category:"Display"},{family:"Bagel Fat One",category:"Display"},{family:"Bahiana",category:"Display"},{family:"Bahianita",category:"Display"},{family:"Bai Jamjuree",category:"Sans Serif"},{family:"Bakbak One",category:"Display"},{family:"Ballet",category:"Handwriting"},{family:"Baloo 2",category:"Display"},{family:"Baloo Bhai 2",category:"Display"},{family:"Baloo Bhaijaan 2",category:"Display"},{family:"Baloo Bhaina 2",category:"Display"},{family:"Baloo Chettan 2",category:"Display"},{family:"Baloo Da 2",category:"Display"},{family:"Baloo Paaji 2",category:"Display"},{family:"Baloo Tamma 2",category:"Display"},{family:"Baloo Tammudu 2",category:"Display"},{family:"Baloo Thambi 2",category:"Display"},{family:"Balsamiq Sans",category:"Display"},{family:"Balthazar",category:"Serif"},{family:"Bangers",category:"Display"},{family:"Barlow",category:"Sans Serif"},{family:"Barlow Condensed",category:"Sans Serif"},{family:"Barlow Semi Condensed",category:"Sans Serif"},{family:"Barriecito",category:"Display"},{family:"Barrio",category:"Display"},{family:"Basic",category:"Sans Serif"},{family:"Baskervville",category:"Serif"},{family:"Baskervville SC",category:"Serif"},{family:"Battambang",category:"Display"},{family:"Baumans",category:"Display"},{family:"Bayon",category:"Sans Serif"},{family:"BBH Bartle",category:"Sans Serif"},{family:"BBH Bogle",category:"Sans Serif"},{family:"BBH Hegarty",category:"Sans Serif"},{family:"Be Vietnam Pro",category:"Sans Serif"},{family:"Beau Rivage",category:"Handwriting"},{family:"Bebas Neue",category:"Sans Serif"},{family:"Beiruti",category:"Sans Serif"},{family:"Belanosima",category:"Sans Serif"},{family:"Belgrano",category:"Serif"},{family:"Bellefair",category:"Serif"},{family:"Belleza",category:"Sans Serif"},{family:"Bellota",category:"Display"},{family:"Bellota Text",category:"Display"},{family:"BenchNine",category:"Sans Serif"},{family:"Benne",category:"Serif"},{family:"Bentham",category:"Serif"},{family:"Berkshire Swash",category:"Handwriting"},{family:"Besley",category:"Serif"},{family:"Betania Patmos",category:"Handwriting"},{family:"Betania Patmos GDL",category:"Handwriting"},{family:"Betania Patmos In",category:"Handwriting"},{family:"Betania Patmos In GDL",category:"Handwriting"},{family:"Beth Ellen",category:"Handwriting"},{family:"Bevan",category:"Serif"},{family:"BhuTuka Expanded One",category:"Serif"},{family:"Big Shoulders",category:"Display"},{family:"Big Shoulders Inline",category:"Display"},{family:"Big Shoulders Stencil",category:"Display"},{family:"Bigelow Rules",category:"Display"},{family:"Bigshot One",category:"Display"},{family:"Bilbo",category:"Handwriting"},{family:"Bilbo Swash Caps",category:"Handwriting"},{family:"BioRhyme",category:"Serif"},{family:"BioRhyme Expanded",category:"Serif"},{family:"Birthstone",category:"Handwriting"},{family:"Birthstone Bounce",category:"Handwriting"},{family:"Biryani",category:"Sans Serif"},{family:"Bitcount",category:"Display"},{family:"Bitcount Grid Double",category:"Display"},{family:"Bitcount Grid Double Ink",category:"Display"},{family:"Bitcount Grid Single",category:"Display"},{family:"Bitcount Grid Single Ink",category:"Display"},{family:"Bitcount Ink",category:"Display"},{family:"Bitcount Prop Double",category:"Display"},{family:"Bitcount Prop Double Ink",category:"Display"},{family:"Bitcount Prop Single",category:"Display"},{family:"Bitcount Prop Single Ink",category:"Display"},{family:"Bitcount Single",category:"Display"},{family:"Bitcount Single Ink",category:"Display"},{family:"Bitter",category:"Serif"},{family:"BIZ UDGothic",category:"Sans Serif"},{family:"BIZ UDMincho",category:"Serif"},{family:"BIZ UDPGothic",category:"Sans Serif"},{family:"BIZ UDPMincho",category:"Serif"},{family:"BJCree",category:"Serif"},{family:"Black And White Picture",category:"Display"},{family:"Black Han Sans",category:"Sans Serif"},{family:"Black Ops One",category:"Display"},{family:"Blaka",category:"Display"},{family:"Blaka Hollow",category:"Display"},{family:"Blaka Ink",category:"Display"},{family:"Blinker",category:"Sans Serif"},{family:"Bodoni Moda",category:"Serif"},{family:"Bodoni Moda SC",category:"Serif"},{family:"Bokor",category:"Display"},{family:"Boldonse",category:"Display"},{family:"Bona Nova",category:"Serif"},{family:"Bona Nova SC",category:"Serif"},{family:"Bonbon",category:"Handwriting"},{family:"Bonheur Royale",category:"Handwriting"},{family:"Boogaloo",category:"Display"},{family:"Borel",category:"Handwriting"},{family:"Bowlby One",category:"Display"},{family:"Bowlby One SC",category:"Display"},{family:"Bpmf Huninn",category:"Sans Serif"},{family:"Bpmf Iansui",category:"Handwriting"},{family:"Bpmf Zihi Kai Std",category:"Sans Serif"},{family:"Braah One",category:"Sans Serif"},{family:"Brawler",category:"Serif"},{family:"Bree Serif",category:"Serif"},{family:"Bricolage Grotesque",category:"Sans Serif"},{family:"Bruno Ace",category:"Display"},{family:"Bruno Ace SC",category:"Display"},{family:"Brygada 1918",category:"Serif"},{family:"Bubblegum Sans",category:"Display"},{family:"Bubbler One",category:"Sans Serif"},{family:"Buda",category:"Display"},{family:"Buenard",category:"Serif"},{family:"Bungee",category:"Display"},{family:"Bungee Hairline",category:"Display"},{family:"Bungee Inline",category:"Display"},{family:"Bungee Outline",category:"Display"},{family:"Bungee Shade",category:"Display"},{family:"Bungee Spice",category:"Display"},{family:"Bungee Tint",category:"Display"},{family:"Butcherman",category:"Display"},{family:"Butterfly Kids",category:"Handwriting"},{family:"Bytesized",category:"Sans Serif"},{family:"Cabin",category:"Sans Serif"},{family:"Cabin Condensed",category:"Sans Serif"},{family:"Cabin Sketch",category:"Display"},{family:"Cactus Classical Serif",category:"Serif"},{family:"Caesar Dressing",category:"Display"},{family:"Cagliostro",category:"Sans Serif"},{family:"Cairo",category:"Sans Serif"},{family:"Cairo Play",category:"Sans Serif"},{family:"Cal Sans",category:"Sans Serif"},{family:"Caladea",category:"Serif"},{family:"Calistoga",category:"Display"},{family:"Calligraffitti",category:"Handwriting"},{family:"Cambay",category:"Sans Serif"},{family:"Cambo",category:"Serif"},{family:"Candal",category:"Sans Serif"},{family:"Cantarell",category:"Sans Serif"},{family:"Cantata One",category:"Serif"},{family:"Cantora One",category:"Sans Serif"},{family:"Caprasimo",category:"Display"},{family:"Capriola",category:"Sans Serif"},{family:"Caramel",category:"Handwriting"},{family:"Carattere",category:"Handwriting"},{family:"Cardo",category:"Serif"},{family:"Carlito",category:"Sans Serif"},{family:"Carme",category:"Sans Serif"},{family:"Carrois Gothic",category:"Sans Serif"},{family:"Carrois Gothic SC",category:"Sans Serif"},{family:"Carter One",category:"Display"},{family:"Cascadia Code",category:"Sans Serif"},{family:"Cascadia Mono",category:"Sans Serif"},{family:"Castoro",category:"Serif"},{family:"Castoro Titling",category:"Display"},{family:"Catamaran",category:"Sans Serif"},{family:"Caudex",category:"Serif"},{family:"Cause",category:"Handwriting"},{family:"Caveat",category:"Handwriting"},{family:"Caveat Brush",category:"Handwriting"},{family:"Cedarville Cursive",category:"Handwriting"},{family:"Ceviche One",category:"Display"},{family:"Chakra Petch",category:"Sans Serif"},{family:"Changa",category:"Sans Serif"},{family:"Changa One",category:"Display"},{family:"Chango",category:"Display"},{family:"Charis SIL",category:"Serif"},{family:"Charm",category:"Handwriting"},{family:"Charmonman",category:"Handwriting"},{family:"Chathura",category:"Sans Serif"},{family:"Chau Philomene One",category:"Sans Serif"},{family:"Chela One",category:"Display"},{family:"Chelsea Market",category:"Display"},{family:"Chenla",category:"Display"},{family:"Cherish",category:"Handwriting"},{family:"Cherry Bomb One",category:"Display"},{family:"Cherry Cream Soda",category:"Display"},{family:"Cherry Swash",category:"Display"},{family:"Chewy",category:"Display"},{family:"Chicle",category:"Display"},{family:"Chilanka",category:"Handwriting"},{family:"Chiron GoRound TC",category:"Sans Serif"},{family:"Chiron Hei HK",category:"Sans Serif"},{family:"Chiron Sung HK",category:"Serif"},{family:"Chivo",category:"Sans Serif"},{family:"Chivo Mono",category:"Monospace"},{family:"Chocolate Classical Sans",category:"Sans Serif"},{family:"Chokokutai",category:"Display"},{family:"Chonburi",category:"Display"},{family:"Cinzel",category:"Serif"},{family:"Cinzel Decorative",category:"Display"},{family:"Clicker Script",category:"Handwriting"},{family:"Climate Crisis",category:"Display"},{family:"Coda",category:"Display"},{family:"Codystar",category:"Display"},{family:"Coiny",category:"Display"},{family:"Combo",category:"Display"},{family:"Comfortaa",category:"Display"},{family:"Comforter",category:"Handwriting"},{family:"Comforter Brush",category:"Handwriting"},{family:"Comic Neue",category:"Handwriting"},{family:"Comic Relief",category:"Display"},{family:"Coming Soon",category:"Handwriting"},{family:"Comme",category:"Sans Serif"},{family:"Commissioner",category:"Sans Serif"},{family:"Concert One",category:"Display"},{family:"Condiment",category:"Handwriting"},{family:"Content",category:"Display"},{family:"Contrail One",category:"Display"},{family:"Convergence",category:"Sans Serif"},{family:"Cookie",category:"Handwriting"},{family:"Copse",category:"Serif"},{family:"Coral Pixels",category:"Display"},{family:"Corben",category:"Display"},{family:"Corinthia",category:"Handwriting"},{family:"Cormorant",category:"Serif"},{family:"Cormorant Garamond",category:"Serif"},{family:"Cormorant Infant",category:"Serif"},{family:"Cormorant SC",category:"Serif"},{family:"Cormorant Unicase",category:"Serif"},{family:"Cormorant Upright",category:"Serif"},{family:"Cossette Texte",category:"Sans Serif"},{family:"Cossette Titre",category:"Sans Serif"},{family:"Courgette",category:"Handwriting"},{family:"Courier Prime",category:"Monospace"},{family:"Cousine",category:"Monospace"},{family:"Coustard",category:"Serif"},{family:"Covered By Your Grace",category:"Handwriting"},{family:"Crafty Girls",category:"Handwriting"},{family:"Creepster",category:"Display"},{family:"Crete Round",category:"Serif"},{family:"Crimson Pro",category:"Serif"},{family:"Crimson Text",category:"Serif"},{family:"Croissant One",category:"Display"},{family:"Crushed",category:"Display"},{family:"Cuprum",category:"Sans Serif"},{family:"Cute Font",category:"Display"},{family:"Cutive",category:"Serif"},{family:"Cutive Mono",category:"Monospace"},{family:"Dai Banna SIL",category:"Serif"},{family:"Damion",category:"Handwriting"},{family:"Dancing Script",category:"Handwriting"},{family:"Danfo",category:"Serif"},{family:"Dangrek",category:"Display"},{family:"Darker Grotesque",category:"Sans Serif"},{family:"Darumadrop One",category:"Display"},{family:"Datatype",category:"Monospace"},{family:"David Libre",category:"Serif"},{family:"Dawning of a New Day",category:"Handwriting"},{family:"Days One",category:"Sans Serif"},{family:"Dekko",category:"Handwriting"},{family:"Dela Gothic One",category:"Display"},{family:"Delicious Handrawn",category:"Handwriting"},{family:"Delius",category:"Handwriting"},{family:"Delius Swash Caps",category:"Handwriting"},{family:"Delius Unicase",category:"Handwriting"},{family:"Della Respira",category:"Serif"},{family:"Denk One",category:"Sans Serif"},{family:"Devonshire",category:"Handwriting"},{family:"Dhurjati",category:"Sans Serif"},{family:"Didact Gothic",category:"Sans Serif"},{family:"Diphylleia",category:"Serif"},{family:"Diplomata",category:"Display"},{family:"Diplomata SC",category:"Display"},{family:"DM Mono",category:"Monospace"},{family:"DM Sans",category:"Sans Serif"},{family:"DM Serif Display",category:"Serif"},{family:"DM Serif Text",category:"Serif"},{family:"Do Hyeon",category:"Sans Serif"},{family:"Dokdo",category:"Display"},{family:"Domine",category:"Serif"},{family:"Donegal One",category:"Serif"},{family:"Dongle",category:"Sans Serif"},{family:"Doppio One",category:"Sans Serif"},{family:"Dorsa",category:"Sans Serif"},{family:"Dosis",category:"Sans Serif"},{family:"DotGothic16",category:"Sans Serif"},{family:"Doto",category:"Sans Serif"},{family:"Dr Sugiyama",category:"Handwriting"},{family:"Duru Sans",category:"Sans Serif"},{family:"Dynalight",category:"Display"},{family:"DynaPuff",category:"Display"},{family:"Eagle Lake",category:"Handwriting"},{family:"East Sea Dokdo",category:"Handwriting"},{family:"Eater",category:"Display"},{family:"EB Garamond",category:"Serif"},{family:"Economica",category:"Sans Serif"},{family:"Eczar",category:"Serif"},{family:"Edu AU VIC WA NT Arrows",category:"Handwriting"},{family:"Edu AU VIC WA NT Dots",category:"Handwriting"},{family:"Edu AU VIC WA NT Guides",category:"Handwriting"},{family:"Edu AU VIC WA NT Hand",category:"Handwriting"},{family:"Edu AU VIC WA NT Pre",category:"Handwriting"},{family:"Edu NSW ACT Cursive",category:"Handwriting"},{family:"Edu NSW ACT Foundation",category:"Handwriting"},{family:"Edu NSW ACT Hand Pre",category:"Handwriting"},{family:"Edu QLD Beginner",category:"Handwriting"},{family:"Edu QLD Hand",category:"Handwriting"},{family:"Edu SA Beginner",category:"Handwriting"},{family:"Edu SA Hand",category:"Handwriting"},{family:"Edu TAS Beginner",category:"Handwriting"},{family:"Edu VIC WA NT Beginner",category:"Handwriting"},{family:"Edu VIC WA NT Hand",category:"Handwriting"},{family:"Edu VIC WA NT Hand Pre",category:"Handwriting"},{family:"El Messiri",category:"Sans Serif"},{family:"Electrolize",category:"Sans Serif"},{family:"Elms Sans",category:"Sans Serif"},{family:"Elsie",category:"Display"},{family:"Elsie Swash Caps",category:"Display"},{family:"Emblema One",category:"Display"},{family:"Emilys Candy",category:"Display"},{family:"Encode Sans",category:"Sans Serif"},{family:"Encode Sans Condensed",category:"Sans Serif"},{family:"Encode Sans Expanded",category:"Sans Serif"},{family:"Encode Sans SC",category:"Sans Serif"},{family:"Encode Sans Semi Condensed",category:"Sans Serif"},{family:"Encode Sans Semi Expanded",category:"Sans Serif"},{family:"Engagement",category:"Handwriting"},{family:"Englebert",category:"Sans Serif"},{family:"Enriqueta",category:"Serif"},{family:"Ephesis",category:"Handwriting"},{family:"Epilogue",category:"Sans Serif"},{family:"Epunda Sans",category:"Sans Serif"},{family:"Epunda Slab",category:"Serif"},{family:"Erica One",category:"Display"},{family:"Esteban",category:"Serif"},{family:"Estedad",category:"Sans Serif"},{family:"Estonia",category:"Handwriting"},{family:"Euphoria Script",category:"Handwriting"},{family:"Ewert",category:"Display"},{family:"Exile",category:"Display"},{family:"Exo",category:"Sans Serif"},{family:"Exo 2",category:"Sans Serif"},{family:"Expletus Sans",category:"Display"},{family:"Explora",category:"Handwriting"},{family:"Faculty Glyphic",category:"Sans Serif"},{family:"Fahkwang",category:"Sans Serif"},{family:"Familjen Grotesk",category:"Sans Serif"},{family:"Fanwood Text",category:"Serif"},{family:"Farro",category:"Sans Serif"},{family:"Farsan",category:"Display"},{family:"Fascinate",category:"Display"},{family:"Fascinate Inline",category:"Display"},{family:"Faster One",category:"Display"},{family:"Fasthand",category:"Display"},{family:"Fauna One",category:"Serif"},{family:"Faustina",category:"Serif"},{family:"Federant",category:"Display"},{family:"Federo",category:"Sans Serif"},{family:"Felipa",category:"Handwriting"},{family:"Fenix",category:"Serif"},{family:"Festive",category:"Handwriting"},{family:"Figtree",category:"Sans Serif"},{family:"Finger Paint",category:"Display"},{family:"Finlandica Headline",category:"Sans Serif"},{family:"Finlandica Text",category:"Sans Serif"},{family:"Fira Code",category:"Monospace"},{family:"Fira Mono",category:"Monospace"},{family:"Fira Sans",category:"Sans Serif"},{family:"Fira Sans Condensed",category:"Sans Serif"},{family:"Fira Sans Extra Condensed",category:"Sans Serif"},{family:"Fjalla One",category:"Sans Serif"},{family:"Fjord One",category:"Serif"},{family:"Flamenco",category:"Display"},{family:"Flavors",category:"Display"},{family:"Fleur De Leah",category:"Handwriting"},{family:"Flow Block",category:"Display"},{family:"Flow Circular",category:"Display"},{family:"Flow Rounded",category:"Display"},{family:"Foldit",category:"Display"},{family:"Fondamento",category:"Handwriting"},{family:"Fontdiner Swanky",category:"Display"},{family:"Forum",category:"Display"},{family:"Fragment Mono",category:"Monospace"},{family:"Francois One",category:"Sans Serif"},{family:"Frank Ruhl Libre",category:"Serif"},{family:"Fraunces",category:"Serif"},{family:"Freckle Face",category:"Display"},{family:"Fredericka the Great",category:"Display"},{family:"Fredoka",category:"Sans Serif"},{family:"Freehand",category:"Display"},{family:"Freeman",category:"Display"},{family:"Fresca",category:"Sans Serif"},{family:"Frijole",category:"Display"},{family:"Fruktur",category:"Display"},{family:"Fugaz One",category:"Display"},{family:"Fuggles",category:"Handwriting"},{family:"Funnel Display",category:"Display"},{family:"Funnel Sans",category:"Sans Serif"},{family:"Fustat",category:"Sans Serif"},{family:"Fuzzy Bubbles",category:"Handwriting"},{family:"Ga Maamli",category:"Display"},{family:"Gabarito",category:"Display"},{family:"Gabriela",category:"Serif"},{family:"Gaegu",category:"Handwriting"},{family:"Gafata",category:"Sans Serif"},{family:"Gajraj One",category:"Display"},{family:"Galada",category:"Display"},{family:"Galdeano",category:"Sans Serif"},{family:"Galindo",category:"Display"},{family:"Gamja Flower",category:"Handwriting"},{family:"Gantari",category:"Sans Serif"},{family:"Gasoek One",category:"Sans Serif"},{family:"Gayathri",category:"Sans Serif"},{family:"Geist",category:"Sans Serif"},{family:"Geist Mono",category:"Monospace"},{family:"Gelasio",category:"Serif"},{family:"Gemunu Libre",category:"Sans Serif"},{family:"Genos",category:"Sans Serif"},{family:"Gentium Book Plus",category:"Serif"},{family:"Gentium Plus",category:"Serif"},{family:"Geo",category:"Sans Serif"},{family:"Geologica",category:"Sans Serif"},{family:"Geom",category:"Sans Serif"},{family:"Georama",category:"Sans Serif"},{family:"Geostar",category:"Display"},{family:"Geostar Fill",category:"Display"},{family:"Germania One",category:"Display"},{family:"GFS Didot",category:"Serif"},{family:"GFS Neohellenic",category:"Sans Serif"},{family:"Gideon Roman",category:"Display"},{family:"Gidole",category:"Sans Serif"},{family:"Gidugu",category:"Sans Serif"},{family:"Gilda Display",category:"Serif"},{family:"Girassol",category:"Display"},{family:"Give You Glory",category:"Handwriting"},{family:"Glass Antiqua",category:"Display"},{family:"Glegoo",category:"Serif"},{family:"Gloock",category:"Serif"},{family:"Gloria Hallelujah",category:"Handwriting"},{family:"Glory",category:"Sans Serif"},{family:"Gluten",category:"Display"},{family:"Goblin One",category:"Display"},{family:"Gochi Hand",category:"Handwriting"},{family:"Goldman",category:"Display"},{family:"Golos Text",category:"Sans Serif"},{family:"Google Sans",category:"Sans Serif"},{family:"Google Sans Code",category:"Monospace"},{family:"Google Sans Flex",category:"Sans Serif"},{family:"Gorditas",category:"Display"},{family:"Gothic A1",category:"Sans Serif"},{family:"Gotu",category:"Sans Serif"},{family:"Goudy Bookletter 1911",category:"Serif"},{family:"Gowun Batang",category:"Serif"},{family:"Gowun Dodum",category:"Sans Serif"},{family:"Graduate",category:"Serif"},{family:"Grand Hotel",category:"Handwriting"},{family:"Grandiflora One",category:"Serif"},{family:"Grandstander",category:"Display"},{family:"Grape Nuts",category:"Handwriting"},{family:"Gravitas One",category:"Display"},{family:"Great Vibes",category:"Handwriting"},{family:"Grechen Fuemen",category:"Handwriting"},{family:"Grenze",category:"Serif"},{family:"Grenze Gotisch",category:"Display"},{family:"Grey Qo",category:"Handwriting"},{family:"Griffy",category:"Display"},{family:"Gruppo",category:"Sans Serif"},{family:"Gudea",category:"Sans Serif"},{family:"Gugi",category:"Display"},{family:"Gulzar",category:"Serif"},{family:"Gupter",category:"Serif"},{family:"Gurajada",category:"Sans Serif"},{family:"Gveret Levin",category:"Handwriting"},{family:"Gwendolyn",category:"Handwriting"},{family:"Habibi",category:"Serif"},{family:"Hachi Maru Pop",category:"Handwriting"},{family:"Hahmlet",category:"Serif"},{family:"Halant",category:"Serif"},{family:"Hammersmith One",category:"Sans Serif"},{family:"Hanalei",category:"Display"},{family:"Hanalei Fill",category:"Display"},{family:"Handjet",category:"Display"},{family:"Handlee",category:"Handwriting"},{family:"Hanken Grotesk",category:"Sans Serif"},{family:"Hanuman",category:"Serif"},{family:"Happy Monkey",category:"Display"},{family:"Harmattan",category:"Sans Serif"},{family:"Headland One",category:"Serif"},{family:"Hedvig Letters Sans",category:"Sans Serif"},{family:"Hedvig Letters Serif",category:"Serif"},{family:"Heebo",category:"Sans Serif"},{family:"Henny Penny",category:"Display"},{family:"Hepta Slab",category:"Serif"},{family:"Herr Von Muellerhoff",category:"Handwriting"},{family:"Hi Melody",category:"Handwriting"},{family:"Hina Mincho",category:"Serif"},{family:"Hind",category:"Sans Serif"},{family:"Hind Guntur",category:"Sans Serif"},{family:"Hind Madurai",category:"Sans Serif"},{family:"Hind Mysuru",category:"Sans Serif"},{family:"Hind Siliguri",category:"Sans Serif"},{family:"Hind Vadodara",category:"Sans Serif"},{family:"Holtwood One SC",category:"Serif"},{family:"Homemade Apple",category:"Handwriting"},{family:"Homenaje",category:"Sans Serif"},{family:"Honk",category:"Display"},{family:"Host Grotesk",category:"Sans Serif"},{family:"Hubballi",category:"Sans Serif"},{family:"Hubot Sans",category:"Sans Serif"},{family:"Huninn",category:"Sans Serif"},{family:"Hurricane",category:"Handwriting"},{family:"Iansui",category:"Handwriting"},{family:"Ibarra Real Nova",category:"Serif"},{family:"IBM Plex Mono",category:"Monospace"},{family:"IBM Plex Sans",category:"Sans Serif"},{family:"IBM Plex Sans Arabic",category:"Sans Serif"},{family:"IBM Plex Sans Condensed",category:"Sans Serif"},{family:"IBM Plex Sans Devanagari",category:"Sans Serif"},{family:"IBM Plex Sans Hebrew",category:"Sans Serif"},{family:"IBM Plex Sans JP",category:"Sans Serif"},{family:"IBM Plex Sans KR",category:"Sans Serif"},{family:"IBM Plex Sans Thai",category:"Sans Serif"},{family:"IBM Plex Sans Thai Looped",category:"Sans Serif"},{family:"IBM Plex Serif",category:"Serif"},{family:"Iceberg",category:"Display"},{family:"Iceland",category:"Display"},{family:"Idiqlat",category:"Serif"},{family:"IM Fell Double Pica",category:"Serif"},{family:"IM Fell Double Pica SC",category:"Serif"},{family:"IM Fell DW Pica",category:"Serif"},{family:"IM Fell DW Pica SC",category:"Serif"},{family:"IM Fell English",category:"Serif"},{family:"IM Fell English SC",category:"Serif"},{family:"IM Fell French Canon",category:"Serif"},{family:"IM Fell French Canon SC",category:"Serif"},{family:"IM Fell Great Primer",category:"Serif"},{family:"IM Fell Great Primer SC",category:"Serif"},{family:"Imbue",category:"Serif"},{family:"Imperial Script",category:"Handwriting"},{family:"Imprima",category:"Sans Serif"},{family:"Inclusive Sans",category:"Sans Serif"},{family:"Inconsolata",category:"Monospace"},{family:"Inder",category:"Sans Serif"},{family:"Indie Flower",category:"Handwriting"},{family:"Ingrid Darling",category:"Handwriting"},{family:"Inika",category:"Serif"},{family:"Inknut Antiqua",category:"Serif"},{family:"Inria Sans",category:"Sans Serif"},{family:"Inria Serif",category:"Serif"},{family:"Inspiration",category:"Handwriting"},{family:"Instrument Sans",category:"Sans Serif"},{family:"Instrument Serif",category:"Serif"},{family:"Intel One Mono",category:"Monospace"},{family:"Inter",category:"Sans Serif"},{family:"Inter Tight",category:"Sans Serif"},{family:"Iosevka Charon",category:"Monospace"},{family:"Iosevka Charon Mono",category:"Monospace"},{family:"Irish Grover",category:"Display"},{family:"Island Moments",category:"Handwriting"},{family:"Istok Web",category:"Sans Serif"},{family:"Italiana",category:"Sans Serif"},{family:"Italianno",category:"Handwriting"},{family:"Itim",category:"Handwriting"},{family:"Jacquard 12",category:"Display"},{family:"Jacquard 12 Charted",category:"Display"},{family:"Jacquard 24",category:"Display"},{family:"Jacquard 24 Charted",category:"Display"},{family:"Jacquarda Bastarda 9",category:"Display"},{family:"Jacquarda Bastarda 9 Charted",category:"Display"},{family:"Jacques Francois",category:"Serif"},{family:"Jacques Francois Shadow",category:"Display"},{family:"Jaini",category:"Display"},{family:"Jaini Purva",category:"Display"},{family:"Jaldi",category:"Sans Serif"},{family:"Jaro",category:"Sans Serif"},{family:"Jersey 10",category:"Display"},{family:"Jersey 10 Charted",category:"Display"},{family:"Jersey 15",category:"Display"},{family:"Jersey 15 Charted",category:"Display"},{family:"Jersey 20",category:"Display"},{family:"Jersey 20 Charted",category:"Display"},{family:"Jersey 25",category:"Display"},{family:"Jersey 25 Charted",category:"Display"},{family:"JetBrains Mono",category:"Monospace"},{family:"Jim Nightshade",category:"Handwriting"},{family:"Joan",category:"Serif"},{family:"Jockey One",category:"Sans Serif"},{family:"Jolly Lodger",category:"Display"},{family:"Jomhuria",category:"Display"},{family:"Jomolhari",category:"Serif"},{family:"Josefin Sans",category:"Sans Serif"},{family:"Josefin Slab",category:"Serif"},{family:"Jost",category:"Sans Serif"},{family:"Joti One",category:"Display"},{family:"Jua",category:"Sans Serif"},{family:"Judson",category:"Serif"},{family:"Julee",category:"Handwriting"},{family:"Julius Sans One",category:"Sans Serif"},{family:"Junge",category:"Serif"},{family:"Jura",category:"Sans Serif"},{family:"Just Another Hand",category:"Handwriting"},{family:"Just Me Again Down Here",category:"Handwriting"},{family:"K2D",category:"Sans Serif"},{family:"Kablammo",category:"Display"},{family:"Kadwa",category:"Serif"},{family:"Kaisei Decol",category:"Serif"},{family:"Kaisei HarunoUmi",category:"Serif"},{family:"Kaisei Opti",category:"Serif"},{family:"Kaisei Tokumin",category:"Serif"},{family:"Kalam",category:"Handwriting"},{family:"Kalnia",category:"Serif"},{family:"Kalnia Glaze",category:"Display"},{family:"Kameron",category:"Serif"},{family:"Kanchenjunga",category:"Sans Serif"},{family:"Kanit",category:"Sans Serif"},{family:"Kantumruy Pro",category:"Sans Serif"},{family:"Kapakana",category:"Handwriting"},{family:"Karantina",category:"Display"},{family:"Karla",category:"Sans Serif"},{family:"Karla Tamil Inclined",category:"Sans Serif"},{family:"Karla Tamil Upright",category:"Sans Serif"},{family:"Karma",category:"Serif"},{family:"Katibeh",category:"Display"},{family:"Kaushan Script",category:"Handwriting"},{family:"Kavivanar",category:"Handwriting"},{family:"Kavoon",category:"Display"},{family:"Kay Pho Du",category:"Serif"},{family:"Kdam Thmor Pro",category:"Sans Serif"},{family:"Keania One",category:"Display"},{family:"Kedebideri",category:"Sans Serif"},{family:"Kelly Slab",category:"Display"},{family:"Kenia",category:"Display"},{family:"Khand",category:"Sans Serif"},{family:"Khmer",category:"Sans Serif"},{family:"Khula",category:"Sans Serif"},{family:"Kings",category:"Handwriting"},{family:"Kirang Haerang",category:"Display"},{family:"Kite One",category:"Sans Serif"},{family:"Kiwi Maru",category:"Serif"},{family:"Klee One",category:"Handwriting"},{family:"Knewave",category:"Display"},{family:"Kodchasan",category:"Sans Serif"},{family:"Kode Mono",category:"Monospace"},{family:"Koh Santepheap",category:"Serif"},{family:"KoHo",category:"Sans Serif"},{family:"Kolker Brush",category:"Handwriting"},{family:"Konkhmer Sleokchher",category:"Display"},{family:"Kosugi",category:"Sans Serif"},{family:"Kosugi Maru",category:"Sans Serif"},{family:"Kotta One",category:"Serif"},{family:"Koulen",category:"Display"},{family:"Kranky",category:"Display"},{family:"Kreon",category:"Serif"},{family:"Kristi",category:"Handwriting"},{family:"Krona One",category:"Sans Serif"},{family:"Krub",category:"Sans Serif"},{family:"Kufam",category:"Sans Serif"},{family:"Kulim Park",category:"Sans Serif"},{family:"Kumar One",category:"Display"},{family:"Kumar One Outline",category:"Display"},{family:"Kumbh Sans",category:"Sans Serif"},{family:"Kurale",category:"Serif"},{family:"La Belle Aurore",category:"Handwriting"},{family:"Labrada",category:"Serif"},{family:"Lacquer",category:"Display"},{family:"Laila",category:"Serif"},{family:"Lakki Reddy",category:"Handwriting"},{family:"Lalezar",category:"Sans Serif"},{family:"Lancelot",category:"Display"},{family:"Langar",category:"Display"},{family:"Lateef",category:"Serif"},{family:"Lato",category:"Sans Serif"},{family:"Lavishly Yours",category:"Handwriting"},{family:"League Gothic",category:"Sans Serif"},{family:"League Script",category:"Handwriting"},{family:"League Spartan",category:"Sans Serif"},{family:"Leckerli One",category:"Handwriting"},{family:"Ledger",category:"Serif"},{family:"Lekton",category:"Monospace"},{family:"Lemon",category:"Display"},{family:"Lemonada",category:"Display"},{family:"Lexend",category:"Sans Serif"},{family:"Lexend Deca",category:"Sans Serif"},{family:"Lexend Exa",category:"Sans Serif"},{family:"Lexend Giga",category:"Sans Serif"},{family:"Lexend Mega",category:"Sans Serif"},{family:"Lexend Peta",category:"Sans Serif"},{family:"Lexend Tera",category:"Sans Serif"},{family:"Lexend Zetta",category:"Sans Serif"},{family:"Libertinus Keyboard",category:"Display"},{family:"Libertinus Math",category:"Display"},{family:"Libertinus Mono",category:"Monospace"},{family:"Libertinus Sans",category:"Sans Serif"},{family:"Libertinus Serif",category:"Serif"},{family:"Libertinus Serif Display",category:"Display"},{family:"Libre Barcode 128",category:"Display"},{family:"Libre Barcode 128 Text",category:"Display"},{family:"Libre Barcode 39",category:"Display"},{family:"Libre Barcode 39 Extended",category:"Display"},{family:"Libre Barcode 39 Extended Text",category:"Display"},{family:"Libre Barcode 39 Text",category:"Display"},{family:"Libre Barcode EAN13 Text",category:"Display"},{family:"Libre Baskerville",category:"Serif"},{family:"Libre Bodoni",category:"Serif"},{family:"Libre Caslon Display",category:"Serif"},{family:"Libre Caslon Text",category:"Serif"},{family:"Libre Franklin",category:"Sans Serif"},{family:"Licorice",category:"Handwriting"},{family:"Life Savers",category:"Display"},{family:"Lilex",category:"Monospace"},{family:"Lilita One",category:"Display"},{family:"Lily Script One",category:"Display"},{family:"Limelight",category:"Display"},{family:"Linden Hill",category:"Serif"},{family:"LINE Seed JP",category:"Sans Serif"},{family:"Linefont",category:"Display"},{family:"Lisu Bosa",category:"Serif"},{family:"Liter",category:"Sans Serif"},{family:"Literata",category:"Serif"},{family:"Liu Jian Mao Cao",category:"Handwriting"},{family:"Livvic",category:"Sans Serif"},{family:"Lobster",category:"Display"},{family:"Lobster Two",category:"Display"},{family:"Londrina Outline",category:"Display"},{family:"Londrina Shadow",category:"Display"},{family:"Londrina Sketch",category:"Display"},{family:"Londrina Solid",category:"Display"},{family:"Long Cang",category:"Handwriting"},{family:"Lora",category:"Serif"},{family:"Love Light",category:"Handwriting"},{family:"Love Ya Like A Sister",category:"Display"},{family:"Loved by the King",category:"Handwriting"},{family:"Lovers Quarrel",category:"Handwriting"},{family:"Luckiest Guy",category:"Display"},{family:"Lugrasimo",category:"Handwriting"},{family:"Lumanosimo",category:"Handwriting"},{family:"Lunasima",category:"Sans Serif"},{family:"Lusitana",category:"Serif"},{family:"Lustria",category:"Serif"},{family:"Luxurious Roman",category:"Display"},{family:"Luxurious Script",category:"Handwriting"},{family:"LXGW Marker Gothic",category:"Sans Serif"},{family:"LXGW WenKai Mono TC",category:"Monospace"},{family:"LXGW WenKai TC",category:"Handwriting"},{family:"M PLUS 1",category:"Sans Serif"},{family:"M PLUS 1 Code",category:"Monospace"},{family:"M PLUS 1p",category:"Sans Serif"},{family:"M PLUS 2",category:"Sans Serif"},{family:"M PLUS Code Latin",category:"Sans Serif"},{family:"M PLUS Rounded 1c",category:"Sans Serif"},{family:"M PLUS U",category:"Sans Serif"},{family:"Ma Shan Zheng",category:"Handwriting"},{family:"Macondo",category:"Display"},{family:"Macondo Swash Caps",category:"Display"},{family:"Mada",category:"Sans Serif"},{family:"Madimi One",category:"Sans Serif"},{family:"Magra",category:"Sans Serif"},{family:"Maiden Orange",category:"Serif"},{family:"Maitree",category:"Serif"},{family:"Major Mono Display",category:"Monospace"},{family:"Mako",category:"Sans Serif"},{family:"Mali",category:"Handwriting"},{family:"Mallanna",category:"Sans Serif"},{family:"Maname",category:"Serif"},{family:"Mandali",category:"Sans Serif"},{family:"Manjari",category:"Sans Serif"},{family:"Manrope",category:"Sans Serif"},{family:"Mansalva",category:"Handwriting"},{family:"Manuale",category:"Serif"},{family:"Manufacturing Consent",category:"Display"},{family:"Marcellus",category:"Serif"},{family:"Marcellus SC",category:"Serif"},{family:"Marck Script",category:"Handwriting"},{family:"Margarine",category:"Display"},{family:"Marhey",category:"Display"},{family:"Markazi Text",category:"Serif"},{family:"Marko One",category:"Serif"},{family:"Marmelad",category:"Sans Serif"},{family:"Martel",category:"Serif"},{family:"Martel Sans",category:"Sans Serif"},{family:"Martian Mono",category:"Monospace"},{family:"Marvel",category:"Sans Serif"},{family:"Matangi",category:"Sans Serif"},{family:"Mate",category:"Serif"},{family:"Mate SC",category:"Serif"},{family:"Matemasie",category:"Sans Serif"},{family:"Maven Pro",category:"Sans Serif"},{family:"McLaren",category:"Display"},{family:"Mea Culpa",category:"Handwriting"},{family:"Meddon",category:"Handwriting"},{family:"MedievalSharp",category:"Display"},{family:"Medula One",category:"Display"},{family:"Meera Inimai",category:"Sans Serif"},{family:"Megrim",category:"Display"},{family:"Meie Script",category:"Handwriting"},{family:"Menbere",category:"Sans Serif"},{family:"Meow Script",category:"Handwriting"},{family:"Merienda",category:"Handwriting"},{family:"Merriweather",category:"Serif"},{family:"Merriweather Sans",category:"Sans Serif"},{family:"Metal",category:"Display"},{family:"Metal Mania",category:"Display"},{family:"Metamorphous",category:"Display"},{family:"Metrophobic",category:"Sans Serif"},{family:"Michroma",category:"Sans Serif"},{family:"Micro 5",category:"Display"},{family:"Micro 5 Charted",category:"Display"},{family:"Milonga",category:"Display"},{family:"Miltonian",category:"Display"},{family:"Miltonian Tattoo",category:"Display"},{family:"Mina",category:"Sans Serif"},{family:"Mingzat",category:"Sans Serif"},{family:"Miniver",category:"Display"},{family:"Miranda Sans",category:"Sans Serif"},{family:"Miriam Libre",category:"Sans Serif"},{family:"Mirza",category:"Serif"},{family:"Miss Fajardose",category:"Handwriting"},{family:"Mitr",category:"Sans Serif"},{family:"Mochiy Pop One",category:"Sans Serif"},{family:"Mochiy Pop P One",category:"Sans Serif"},{family:"Modak",category:"Display"},{family:"Modern Antiqua",category:"Display"},{family:"Moderustic",category:"Sans Serif"},{family:"Mogra",category:"Display"},{family:"Mohave",category:"Sans Serif"},{family:"Moirai One",category:"Display"},{family:"Molengo",category:"Sans Serif"},{family:"Molle",category:"Handwriting"},{family:"Momo Signature",category:"Sans Serif"},{family:"Momo Trust Display",category:"Sans Serif"},{family:"Momo Trust Sans",category:"Sans Serif"},{family:"Mona Sans",category:"Sans Serif"},{family:"Monda",category:"Sans Serif"},{family:"Monofett",category:"Monospace"},{family:"Monomakh",category:"Display"},{family:"Monomaniac One",category:"Sans Serif"},{family:"Monoton",category:"Display"},{family:"Monsieur La Doulaise",category:"Handwriting"},{family:"Montaga",category:"Serif"},{family:"Montagu Slab",category:"Serif"},{family:"MonteCarlo",category:"Handwriting"},{family:"Montez",category:"Handwriting"},{family:"Montserrat",category:"Sans Serif"},{family:"Montserrat Alternates",category:"Sans Serif"},{family:"Montserrat Underline",category:"Sans Serif"},{family:"Moo Lah Lah",category:"Display"},{family:"Mooli",category:"Sans Serif"},{family:"Moon Dance",category:"Handwriting"},{family:"Moul",category:"Display"},{family:"Moulpali",category:"Sans Serif"},{family:"Mountains of Christmas",category:"Display"},{family:"Mouse Memoirs",category:"Sans Serif"},{family:"Mozilla Headline",category:"Sans Serif"},{family:"Mozilla Text",category:"Sans Serif"},{family:"Mr Bedfort",category:"Handwriting"},{family:"Mr Dafoe",category:"Handwriting"},{family:"Mr De Haviland",category:"Handwriting"},{family:"Mrs Saint Delafield",category:"Handwriting"},{family:"Mrs Sheppards",category:"Handwriting"},{family:"Ms Madi",category:"Handwriting"},{family:"Mukta",category:"Sans Serif"},{family:"Mukta Mahee",category:"Sans Serif"},{family:"Mukta Malar",category:"Sans Serif"},{family:"Mukta Vaani",category:"Sans Serif"},{family:"Mulish",category:"Sans Serif"},{family:"Murecho",category:"Sans Serif"},{family:"MuseoModerno",category:"Display"},{family:"My Soul",category:"Handwriting"},{family:"Mynerve",category:"Handwriting"},{family:"Mystery Quest",category:"Display"},{family:"Nabla",category:"Display"},{family:"Namdhinggo",category:"Serif"},{family:"Nanum Brush Script",category:"Handwriting"},{family:"Nanum Gothic",category:"Sans Serif"},{family:"Nanum Gothic Coding",category:"Handwriting"},{family:"Nanum Myeongjo",category:"Serif"},{family:"Nanum Pen Script",category:"Handwriting"},{family:"Narnoor",category:"Sans Serif"},{family:"Nata Sans",category:"Sans Serif"},{family:"National Park",category:"Sans Serif"},{family:"Neonderthaw",category:"Handwriting"},{family:"Nerko One",category:"Handwriting"},{family:"Neucha",category:"Handwriting"},{family:"Neuton",category:"Serif"},{family:"New Amsterdam",category:"Sans Serif"},{family:"New Rocker",category:"Display"},{family:"New Tegomin",category:"Serif"},{family:"News Cycle",category:"Sans Serif"},{family:"Newsreader",category:"Serif"},{family:"Niconne",category:"Handwriting"},{family:"Niramit",category:"Sans Serif"},{family:"Nixie One",category:"Display"},{family:"Nobile",category:"Sans Serif"},{family:"Nokora",category:"Sans Serif"},{family:"Norican",category:"Handwriting"},{family:"Nosifer",category:"Display"},{family:"Notable",category:"Sans Serif"},{family:"Nothing You Could Do",category:"Handwriting"},{family:"Noticia Text",category:"Serif"},{family:"Noto Color Emoji",category:"Sans Serif"},{family:"Noto Emoji",category:"Sans Serif"},{family:"Noto Kufi Arabic",category:"Sans Serif"},{family:"Noto Music",category:"Sans Serif"},{family:"Noto Naskh Arabic",category:"Serif"},{family:"Noto Nastaliq Urdu",category:"Serif"},{family:"Noto Rashi Hebrew",category:"Serif"},{family:"Noto Sans",category:"Sans Serif"},{family:"Noto Sans Adlam",category:"Sans Serif"},{family:"Noto Sans Adlam Unjoined",category:"Sans Serif"},{family:"Noto Sans Anatolian Hieroglyphs",category:"Sans Serif"},{family:"Noto Sans Arabic",category:"Sans Serif"},{family:"Noto Sans Armenian",category:"Sans Serif"},{family:"Noto Sans Avestan",category:"Sans Serif"},{family:"Noto Sans Balinese",category:"Sans Serif"},{family:"Noto Sans Bamum",category:"Sans Serif"},{family:"Noto Sans Bassa Vah",category:"Sans Serif"},{family:"Noto Sans Batak",category:"Sans Serif"},{family:"Noto Sans Bengali",category:"Sans Serif"},{family:"Noto Sans Bhaiksuki",category:"Sans Serif"},{family:"Noto Sans Brahmi",category:"Sans Serif"},{family:"Noto Sans Buginese",category:"Sans Serif"},{family:"Noto Sans Buhid",category:"Sans Serif"},{family:"Noto Sans Canadian Aboriginal",category:"Sans Serif"},{family:"Noto Sans Carian",category:"Sans Serif"},{family:"Noto Sans Caucasian Albanian",category:"Sans Serif"},{family:"Noto Sans Chakma",category:"Sans Serif"},{family:"Noto Sans Cham",category:"Sans Serif"},{family:"Noto Sans Cherokee",category:"Sans Serif"},{family:"Noto Sans Chorasmian",category:"Sans Serif"},{family:"Noto Sans Coptic",category:"Sans Serif"},{family:"Noto Sans Cuneiform",category:"Sans Serif"},{family:"Noto Sans Cypriot",category:"Sans Serif"},{family:"Noto Sans Cypro Minoan",category:"Sans Serif"},{family:"Noto Sans Deseret",category:"Sans Serif"},{family:"Noto Sans Devanagari",category:"Sans Serif"},{family:"Noto Sans Display",category:"Sans Serif"},{family:"Noto Sans Duployan",category:"Sans Serif"},{family:"Noto Sans Egyptian Hieroglyphs",category:"Sans Serif"},{family:"Noto Sans Elbasan",category:"Sans Serif"},{family:"Noto Sans Elymaic",category:"Sans Serif"},{family:"Noto Sans Ethiopic",category:"Sans Serif"},{family:"Noto Sans Georgian",category:"Sans Serif"},{family:"Noto Sans Glagolitic",category:"Sans Serif"},{family:"Noto Sans Gothic",category:"Sans Serif"},{family:"Noto Sans Grantha",category:"Sans Serif"},{family:"Noto Sans Gujarati",category:"Sans Serif"},{family:"Noto Sans Gunjala Gondi",category:"Sans Serif"},{family:"Noto Sans Gurmukhi",category:"Sans Serif"},{family:"Noto Sans Hanifi Rohingya",category:"Sans Serif"},{family:"Noto Sans Hanunoo",category:"Sans Serif"},{family:"Noto Sans Hatran",category:"Sans Serif"},{family:"Noto Sans Hebrew",category:"Sans Serif"},{family:"Noto Sans HK",category:"Sans Serif"},{family:"Noto Sans Imperial Aramaic",category:"Sans Serif"},{family:"Noto Sans Indic Siyaq Numbers",category:"Sans Serif"},{family:"Noto Sans Inscriptional Pahlavi",category:"Sans Serif"},{family:"Noto Sans Inscriptional Parthian",category:"Sans Serif"},{family:"Noto Sans Javanese",category:"Sans Serif"},{family:"Noto Sans JP",category:"Sans Serif"},{family:"Noto Sans Kaithi",category:"Sans Serif"},{family:"Noto Sans Kannada",category:"Sans Serif"},{family:"Noto Sans Kawi",category:"Sans Serif"},{family:"Noto Sans Kayah Li",category:"Sans Serif"},{family:"Noto Sans Kharoshthi",category:"Sans Serif"},{family:"Noto Sans Khmer",category:"Sans Serif"},{family:"Noto Sans Khojki",category:"Sans Serif"},{family:"Noto Sans Khudawadi",category:"Sans Serif"},{family:"Noto Sans KR",category:"Sans Serif"},{family:"Noto Sans Lao",category:"Sans Serif"},{family:"Noto Sans Lao Looped",category:"Sans Serif"},{family:"Noto Sans Lepcha",category:"Sans Serif"},{family:"Noto Sans Limbu",category:"Sans Serif"},{family:"Noto Sans Linear A",category:"Sans Serif"},{family:"Noto Sans Linear B",category:"Sans Serif"},{family:"Noto Sans Lisu",category:"Sans Serif"},{family:"Noto Sans Lycian",category:"Sans Serif"},{family:"Noto Sans Lydian",category:"Sans Serif"},{family:"Noto Sans Mahajani",category:"Sans Serif"},{family:"Noto Sans Malayalam",category:"Sans Serif"},{family:"Noto Sans Mandaic",category:"Sans Serif"},{family:"Noto Sans Manichaean",category:"Sans Serif"},{family:"Noto Sans Marchen",category:"Sans Serif"},{family:"Noto Sans Masaram Gondi",category:"Sans Serif"},{family:"Noto Sans Math",category:"Sans Serif"},{family:"Noto Sans Mayan Numerals",category:"Sans Serif"},{family:"Noto Sans Medefaidrin",category:"Sans Serif"},{family:"Noto Sans Meetei Mayek",category:"Sans Serif"},{family:"Noto Sans Mende Kikakui",category:"Sans Serif"},{family:"Noto Sans Meroitic",category:"Sans Serif"},{family:"Noto Sans Miao",category:"Sans Serif"},{family:"Noto Sans Modi",category:"Sans Serif"},{family:"Noto Sans Mongolian",category:"Sans Serif"},{family:"Noto Sans Mono",category:"Sans Serif"},{family:"Noto Sans Mro",category:"Sans Serif"},{family:"Noto Sans Multani",category:"Sans Serif"},{family:"Noto Sans Myanmar",category:"Sans Serif"},{family:"Noto Sans Nabataean",category:"Sans Serif"},{family:"Noto Sans Nag Mundari",category:"Sans Serif"},{family:"Noto Sans Nandinagari",category:"Sans Serif"},{family:"Noto Sans New Tai Lue",category:"Sans Serif"},{family:"Noto Sans Newa",category:"Sans Serif"},{family:"Noto Sans NKo",category:"Sans Serif"},{family:"Noto Sans NKo Unjoined",category:"Sans Serif"},{family:"Noto Sans Nushu",category:"Sans Serif"},{family:"Noto Sans Ogham",category:"Sans Serif"},{family:"Noto Sans Ol Chiki",category:"Sans Serif"},{family:"Noto Sans Old Hungarian",category:"Sans Serif"},{family:"Noto Sans Old Italic",category:"Sans Serif"},{family:"Noto Sans Old North Arabian",category:"Sans Serif"},{family:"Noto Sans Old Permic",category:"Sans Serif"},{family:"Noto Sans Old Persian",category:"Sans Serif"},{family:"Noto Sans Old Sogdian",category:"Sans Serif"},{family:"Noto Sans Old South Arabian",category:"Sans Serif"},{family:"Noto Sans Old Turkic",category:"Sans Serif"},{family:"Noto Sans Oriya",category:"Sans Serif"},{family:"Noto Sans Osage",category:"Sans Serif"},{family:"Noto Sans Osmanya",category:"Sans Serif"},{family:"Noto Sans Pahawh Hmong",category:"Sans Serif"},{family:"Noto Sans Palmyrene",category:"Sans Serif"},{family:"Noto Sans Pau Cin Hau",category:"Sans Serif"},{family:"Noto Sans PhagsPa",category:"Sans Serif"},{family:"Noto Sans Phoenician",category:"Sans Serif"},{family:"Noto Sans Psalter Pahlavi",category:"Sans Serif"},{family:"Noto Sans Rejang",category:"Sans Serif"},{family:"Noto Sans Runic",category:"Sans Serif"},{family:"Noto Sans Samaritan",category:"Sans Serif"},{family:"Noto Sans Saurashtra",category:"Sans Serif"},{family:"Noto Sans SC",category:"Sans Serif"},{family:"Noto Sans Sharada",category:"Sans Serif"},{family:"Noto Sans Shavian",category:"Sans Serif"},{family:"Noto Sans Siddham",category:"Sans Serif"},{family:"Noto Sans SignWriting",category:"Sans Serif"},{family:"Noto Sans Sinhala",category:"Sans Serif"},{family:"Noto Sans Sogdian",category:"Sans Serif"},{family:"Noto Sans Sora Sompeng",category:"Sans Serif"},{family:"Noto Sans Soyombo",category:"Sans Serif"},{family:"Noto Sans Sundanese",category:"Sans Serif"},{family:"Noto Sans Sunuwar",category:"Sans Serif"},{family:"Noto Sans Syloti Nagri",category:"Sans Serif"},{family:"Noto Sans Symbols",category:"Sans Serif"},{family:"Noto Sans Symbols 2",category:"Sans Serif"},{family:"Noto Sans Syriac",category:"Sans Serif"},{family:"Noto Sans Syriac Eastern",category:"Sans Serif"},{family:"Noto Sans Syriac Western",category:"Sans Serif"},{family:"Noto Sans Tagalog",category:"Sans Serif"},{family:"Noto Sans Tagbanwa",category:"Sans Serif"},{family:"Noto Sans Tai Le",category:"Sans Serif"},{family:"Noto Sans Tai Tham",category:"Sans Serif"},{family:"Noto Sans Tai Viet",category:"Sans Serif"},{family:"Noto Sans Takri",category:"Sans Serif"},{family:"Noto Sans Tamil",category:"Sans Serif"},{family:"Noto Sans Tamil Supplement",category:"Sans Serif"},{family:"Noto Sans Tangsa",category:"Sans Serif"},{family:"Noto Sans TC",category:"Sans Serif"},{family:"Noto Sans Telugu",category:"Sans Serif"},{family:"Noto Sans Thaana",category:"Sans Serif"},{family:"Noto Sans Thai",category:"Sans Serif"},{family:"Noto Sans Thai Looped",category:"Sans Serif"},{family:"Noto Sans Tifinagh",category:"Sans Serif"},{family:"Noto Sans Tirhuta",category:"Sans Serif"},{family:"Noto Sans Ugaritic",category:"Sans Serif"},{family:"Noto Sans Vai",category:"Sans Serif"},{family:"Noto Sans Vithkuqi",category:"Sans Serif"},{family:"Noto Sans Wancho",category:"Sans Serif"},{family:"Noto Sans Warang Citi",category:"Sans Serif"},{family:"Noto Sans Yi",category:"Sans Serif"},{family:"Noto Sans Zanabazar Square",category:"Sans Serif"},{family:"Noto Serif",category:"Serif"},{family:"Noto Serif Ahom",category:"Serif"},{family:"Noto Serif Armenian",category:"Serif"},{family:"Noto Serif Balinese",category:"Serif"},{family:"Noto Serif Bengali",category:"Serif"},{family:"Noto Serif Devanagari",category:"Serif"},{family:"Noto Serif Display",category:"Serif"},{family:"Noto Serif Dives Akuru",category:"Serif"},{family:"Noto Serif Dogra",category:"Serif"},{family:"Noto Serif Ethiopic",category:"Serif"},{family:"Noto Serif Georgian",category:"Serif"},{family:"Noto Serif Grantha",category:"Serif"},{family:"Noto Serif Gujarati",category:"Serif"},{family:"Noto Serif Gurmukhi",category:"Serif"},{family:"Noto Serif Hebrew",category:"Serif"},{family:"Noto Serif Hentaigana",category:"Serif"},{family:"Noto Serif HK",category:"Serif"},{family:"Noto Serif JP",category:"Serif"},{family:"Noto Serif Kannada",category:"Serif"},{family:"Noto Serif Khitan Small Script",category:"Serif"},{family:"Noto Serif Khmer",category:"Serif"},{family:"Noto Serif Khojki",category:"Serif"},{family:"Noto Serif KR",category:"Serif"},{family:"Noto Serif Lao",category:"Serif"},{family:"Noto Serif Makasar",category:"Serif"},{family:"Noto Serif Malayalam",category:"Serif"},{family:"Noto Serif Myanmar",category:"Serif"},{family:"Noto Serif NP Hmong",category:"Serif"},{family:"Noto Serif Old Uyghur",category:"Serif"},{family:"Noto Serif Oriya",category:"Serif"},{family:"Noto Serif Ottoman Siyaq",category:"Serif"},{family:"Noto Serif SC",category:"Serif"},{family:"Noto Serif Sinhala",category:"Serif"},{family:"Noto Serif Tamil",category:"Serif"},{family:"Noto Serif Tangut",category:"Serif"},{family:"Noto Serif TC",category:"Serif"},{family:"Noto Serif Telugu",category:"Serif"},{family:"Noto Serif Thai",category:"Serif"},{family:"Noto Serif Tibetan",category:"Serif"},{family:"Noto Serif Todhri",category:"Serif"},{family:"Noto Serif Toto",category:"Serif"},{family:"Noto Serif Vithkuqi",category:"Serif"},{family:"Noto Serif Yezidi",category:"Serif"},{family:"Noto Traditional Nushu",category:"Sans Serif"},{family:"Noto Znamenny Musical Notation",category:"Sans Serif"},{family:"Nova Cut",category:"Display"},{family:"Nova Flat",category:"Display"},{family:"Nova Mono",category:"Monospace"},{family:"Nova Oval",category:"Display"},{family:"Nova Round",category:"Display"},{family:"Nova Script",category:"Display"},{family:"Nova Slim",category:"Display"},{family:"Nova Square",category:"Display"},{family:"NTR",category:"Sans Serif"},{family:"Numans",category:"Sans Serif"},{family:"Nunito",category:"Sans Serif"},{family:"Nunito Sans",category:"Sans Serif"},{family:"Nuosu SIL",category:"Sans Serif"},{family:"Odibee Sans",category:"Display"},{family:"Odor Mean Chey",category:"Serif"},{family:"Offside",category:"Display"},{family:"Oi",category:"Display"},{family:"Ojuju",category:"Sans Serif"},{family:"Old Standard TT",category:"Serif"},{family:"Oldenburg",category:"Display"},{family:"Ole",category:"Handwriting"},{family:"Oleo Script",category:"Display"},{family:"Oleo Script Swash Caps",category:"Display"},{family:"Onest",category:"Sans Serif"},{family:"Oooh Baby",category:"Handwriting"},{family:"Open Sans",category:"Sans Serif"},{family:"Oranienbaum",category:"Serif"},{family:"Orbit",category:"Sans Serif"},{family:"Orbitron",category:"Sans Serif"},{family:"Oregano",category:"Display"},{family:"Orelega One",category:"Display"},{family:"Orienta",category:"Sans Serif"},{family:"Original Surfer",category:"Display"},{family:"Oswald",category:"Sans Serif"},{family:"Outfit",category:"Sans Serif"},{family:"Over the Rainbow",category:"Handwriting"},{family:"Overlock",category:"Display"},{family:"Overlock SC",category:"Display"},{family:"Overpass",category:"Sans Serif"},{family:"Overpass Mono",category:"Monospace"},{family:"Ovo",category:"Serif"},{family:"Oxanium",category:"Display"},{family:"Oxygen",category:"Sans Serif"},{family:"Oxygen Mono",category:"Monospace"},{family:"Pacifico",category:"Handwriting"},{family:"Padauk",category:"Sans Serif"},{family:"Padyakke Expanded One",category:"Serif"},{family:"Palanquin",category:"Sans Serif"},{family:"Palanquin Dark",category:"Sans Serif"},{family:"Palette Mosaic",category:"Display"},{family:"Pangolin",category:"Handwriting"},{family:"Paprika",category:"Display"},{family:"Parastoo",category:"Serif"},{family:"Parisienne",category:"Handwriting"},{family:"Parkinsans",category:"Sans Serif"},{family:"Passero One",category:"Display"},{family:"Passion One",category:"Display"},{family:"Passions Conflict",category:"Handwriting"},{family:"Pathway Extreme",category:"Sans Serif"},{family:"Pathway Gothic One",category:"Sans Serif"},{family:"Patrick Hand",category:"Handwriting"},{family:"Patrick Hand SC",category:"Handwriting"},{family:"Pattaya",category:"Sans Serif"},{family:"Patua One",category:"Display"},{family:"Pavanam",category:"Sans Serif"},{family:"Paytone One",category:"Sans Serif"},{family:"Peddana",category:"Serif"},{family:"Peralta",category:"Serif"},{family:"Permanent Marker",category:"Handwriting"},{family:"Petemoss",category:"Handwriting"},{family:"Petit Formal Script",category:"Handwriting"},{family:"Petrona",category:"Serif"},{family:"Phetsarath",category:"Sans Serif"},{family:"Philosopher",category:"Sans Serif"},{family:"Phudu",category:"Display"},{family:"Piazzolla",category:"Serif"},{family:"Piedra",category:"Display"},{family:"Pinyon Script",category:"Handwriting"},{family:"Pirata One",category:"Display"},{family:"Pixelify Sans",category:"Display"},{family:"Plaster",category:"Display"},{family:"Platypi",category:"Serif"},{family:"Play",category:"Sans Serif"},{family:"Playball",category:"Display"},{family:"Playfair",category:"Serif"},{family:"Playfair Display",category:"Serif"},{family:"Playfair Display SC",category:"Serif"},{family:"Playpen Sans",category:"Handwriting"},{family:"Playpen Sans Arabic",category:"Handwriting"},{family:"Playpen Sans Deva",category:"Handwriting"},{family:"Playpen Sans Hebrew",category:"Handwriting"},{family:"Playpen Sans Thai",category:"Handwriting"},{family:"Playwrite AR",category:"Handwriting"},{family:"Playwrite AR Guides",category:"Handwriting"},{family:"Playwrite AT",category:"Handwriting"},{family:"Playwrite AT Guides",category:"Handwriting"},{family:"Playwrite AU NSW",category:"Handwriting"},{family:"Playwrite AU NSW Guides",category:"Handwriting"},{family:"Playwrite AU QLD",category:"Handwriting"},{family:"Playwrite AU QLD Guides",category:"Handwriting"},{family:"Playwrite AU SA",category:"Handwriting"},{family:"Playwrite AU SA Guides",category:"Handwriting"},{family:"Playwrite AU TAS",category:"Handwriting"},{family:"Playwrite AU TAS Guides",category:"Handwriting"},{family:"Playwrite AU VIC",category:"Handwriting"},{family:"Playwrite AU VIC Guides",category:"Handwriting"},{family:"Playwrite BE VLG",category:"Handwriting"},{family:"Playwrite BE VLG Guides",category:"Handwriting"},{family:"Playwrite BE WAL",category:"Handwriting"},{family:"Playwrite BE WAL Guides",category:"Handwriting"},{family:"Playwrite BR",category:"Handwriting"},{family:"Playwrite BR Guides",category:"Handwriting"},{family:"Playwrite CA",category:"Handwriting"},{family:"Playwrite CA Guides",category:"Handwriting"},{family:"Playwrite CL",category:"Handwriting"},{family:"Playwrite CL Guides",category:"Handwriting"},{family:"Playwrite CO",category:"Handwriting"},{family:"Playwrite CO Guides",category:"Handwriting"},{family:"Playwrite CU",category:"Handwriting"},{family:"Playwrite CU Guides",category:"Handwriting"},{family:"Playwrite CZ",category:"Handwriting"},{family:"Playwrite CZ Guides",category:"Handwriting"},{family:"Playwrite DE Grund",category:"Handwriting"},{family:"Playwrite DE Grund Guides",category:"Handwriting"},{family:"Playwrite DE LA",category:"Handwriting"},{family:"Playwrite DE LA Guides",category:"Handwriting"},{family:"Playwrite DE SAS",category:"Handwriting"},{family:"Playwrite DE SAS Guides",category:"Handwriting"},{family:"Playwrite DE VA",category:"Handwriting"},{family:"Playwrite DE VA Guides",category:"Handwriting"},{family:"Playwrite DK Loopet",category:"Handwriting"},{family:"Playwrite DK Loopet Guides",category:"Handwriting"},{family:"Playwrite DK Uloopet",category:"Handwriting"},{family:"Playwrite DK Uloopet Guides",category:"Handwriting"},{family:"Playwrite ES",category:"Handwriting"},{family:"Playwrite ES Deco",category:"Handwriting"},{family:"Playwrite ES Deco Guides",category:"Handwriting"},{family:"Playwrite ES Guides",category:"Handwriting"},{family:"Playwrite FR Moderne",category:"Handwriting"},{family:"Playwrite FR Moderne Guides",category:"Handwriting"},{family:"Playwrite FR Trad",category:"Handwriting"},{family:"Playwrite FR Trad Guides",category:"Handwriting"},{family:"Playwrite GB J",category:"Handwriting"},{family:"Playwrite GB J Guides",category:"Handwriting"},{family:"Playwrite GB S",category:"Handwriting"},{family:"Playwrite GB S Guides",category:"Handwriting"},{family:"Playwrite HR",category:"Handwriting"},{family:"Playwrite HR Guides",category:"Handwriting"},{family:"Playwrite HR Lijeva",category:"Handwriting"},{family:"Playwrite HR Lijeva Guides",category:"Handwriting"},{family:"Playwrite HU",category:"Handwriting"},{family:"Playwrite HU Guides",category:"Handwriting"},{family:"Playwrite ID",category:"Handwriting"},{family:"Playwrite ID Guides",category:"Handwriting"},{family:"Playwrite IE",category:"Handwriting"},{family:"Playwrite IE Guides",category:"Handwriting"},{family:"Playwrite IN",category:"Handwriting"},{family:"Playwrite IN Guides",category:"Handwriting"},{family:"Playwrite IS",category:"Handwriting"},{family:"Playwrite IS Guides",category:"Handwriting"},{family:"Playwrite IT Moderna",category:"Handwriting"},{family:"Playwrite IT Moderna Guides",category:"Handwriting"},{family:"Playwrite IT Trad",category:"Handwriting"},{family:"Playwrite IT Trad Guides",category:"Handwriting"},{family:"Playwrite MX",category:"Handwriting"},{family:"Playwrite MX Guides",category:"Handwriting"},{family:"Playwrite NG Modern",category:"Handwriting"},{family:"Playwrite NG Modern Guides",category:"Handwriting"},{family:"Playwrite NL",category:"Handwriting"},{family:"Playwrite NL Guides",category:"Handwriting"},{family:"Playwrite NO",category:"Handwriting"},{family:"Playwrite NO Guides",category:"Handwriting"},{family:"Playwrite NZ",category:"Handwriting"},{family:"Playwrite NZ Basic",category:"Handwriting"},{family:"Playwrite NZ Basic Guides",category:"Handwriting"},{family:"Playwrite NZ Guides",category:"Handwriting"},{family:"Playwrite PE",category:"Handwriting"},{family:"Playwrite PE Guides",category:"Handwriting"},{family:"Playwrite PL",category:"Handwriting"},{family:"Playwrite PL Guides",category:"Handwriting"},{family:"Playwrite PT",category:"Handwriting"},{family:"Playwrite PT Guides",category:"Handwriting"},{family:"Playwrite RO",category:"Handwriting"},{family:"Playwrite RO Guides",category:"Handwriting"},{family:"Playwrite SK",category:"Handwriting"},{family:"Playwrite SK Guides",category:"Handwriting"},{family:"Playwrite TZ",category:"Handwriting"},{family:"Playwrite TZ Guides",category:"Handwriting"},{family:"Playwrite US Modern",category:"Handwriting"},{family:"Playwrite US Modern Guides",category:"Handwriting"},{family:"Playwrite US Trad",category:"Handwriting"},{family:"Playwrite US Trad Guides",category:"Handwriting"},{family:"Playwrite VN",category:"Handwriting"},{family:"Playwrite VN Guides",category:"Handwriting"},{family:"Playwrite ZA",category:"Handwriting"},{family:"Playwrite ZA Guides",category:"Handwriting"},{family:"Plus Jakarta Sans",category:"Sans Serif"},{family:"Pochaevsk",category:"Display"},{family:"Podkova",category:"Serif"},{family:"Poetsen One",category:"Display"},{family:"Poiret One",category:"Display"},{family:"Poller One",category:"Display"},{family:"Poltawski Nowy",category:"Serif"},{family:"Poly",category:"Serif"},{family:"Pompiere",category:"Display"},{family:"Ponnala",category:"Display"},{family:"Ponomar",category:"Display"},{family:"Pontano Sans",category:"Sans Serif"},{family:"Poor Story",category:"Display"},{family:"Poppins",category:"Sans Serif"},{family:"Port Lligat Sans",category:"Sans Serif"},{family:"Port Lligat Slab",category:"Serif"},{family:"Potta One",category:"Display"},{family:"Pragati Narrow",category:"Sans Serif"},{family:"Praise",category:"Handwriting"},{family:"Prata",category:"Serif"},{family:"Preahvihear",category:"Sans Serif"},{family:"Press Start 2P",category:"Display"},{family:"Pridi",category:"Serif"},{family:"Princess Sofia",category:"Handwriting"},{family:"Prociono",category:"Serif"},{family:"Prompt",category:"Sans Serif"},{family:"Prosto One",category:"Display"},{family:"Protest Guerrilla",category:"Display"},{family:"Protest Revolution",category:"Display"},{family:"Protest Riot",category:"Display"},{family:"Protest Strike",category:"Display"},{family:"Proza Libre",category:"Sans Serif"},{family:"PT Mono",category:"Monospace"},{family:"PT Sans",category:"Sans Serif"},{family:"PT Sans Caption",category:"Sans Serif"},{family:"PT Sans Narrow",category:"Sans Serif"},{family:"PT Serif",category:"Serif"},{family:"PT Serif Caption",category:"Serif"},{family:"Public Sans",category:"Sans Serif"},{family:"Puppies Play",category:"Handwriting"},{family:"Puritan",category:"Sans Serif"},{family:"Purple Purse",category:"Display"},{family:"Qahiri",category:"Sans Serif"},{family:"Quando",category:"Serif"},{family:"Quantico",category:"Sans Serif"},{family:"Quattrocento",category:"Serif"},{family:"Quattrocento Sans",category:"Sans Serif"},{family:"Questrial",category:"Sans Serif"},{family:"Quicksand",category:"Sans Serif"},{family:"Quintessential",category:"Handwriting"},{family:"Qwigley",category:"Handwriting"},{family:"Qwitcher Grypen",category:"Handwriting"},{family:"Racing Sans One",category:"Display"},{family:"Radio Canada",category:"Sans Serif"},{family:"Radio Canada Big",category:"Sans Serif"},{family:"Radley",category:"Serif"},{family:"Rajdhani",category:"Sans Serif"},{family:"Rakkas",category:"Display"},{family:"Raleway",category:"Sans Serif"},{family:"Raleway Dots",category:"Display"},{family:"Ramabhadra",category:"Sans Serif"},{family:"Ramaraja",category:"Serif"},{family:"Rambla",category:"Sans Serif"},{family:"Rammetto One",category:"Display"},{family:"Rampart One",category:"Display"},{family:"Ramsina",category:"Serif"},{family:"Ranchers",category:"Display"},{family:"Rancho",category:"Handwriting"},{family:"Ranga",category:"Display"},{family:"Rasa",category:"Serif"},{family:"Rationale",category:"Sans Serif"},{family:"Ravi Prakash",category:"Display"},{family:"Readex Pro",category:"Sans Serif"},{family:"Recursive",category:"Sans Serif"},{family:"Red Hat Display",category:"Sans Serif"},{family:"Red Hat Mono",category:"Monospace"},{family:"Red Hat Text",category:"Sans Serif"},{family:"Red Rose",category:"Display"},{family:"Redacted",category:"Display"},{family:"Redacted Script",category:"Display"},{family:"Reddit Mono",category:"Monospace"},{family:"Reddit Sans",category:"Sans Serif"},{family:"Reddit Sans Condensed",category:"Sans Serif"},{family:"Redressed",category:"Handwriting"},{family:"Reem Kufi",category:"Sans Serif"},{family:"Reem Kufi Fun",category:"Sans Serif"},{family:"Reem Kufi Ink",category:"Sans Serif"},{family:"Reenie Beanie",category:"Handwriting"},{family:"Reggae One",category:"Display"},{family:"REM",category:"Sans Serif"},{family:"Rethink Sans",category:"Sans Serif"},{family:"Revalia",category:"Display"},{family:"Rhodium Libre",category:"Serif"},{family:"Ribeye",category:"Display"},{family:"Ribeye Marrow",category:"Display"},{family:"Righteous",category:"Display"},{family:"Risque",category:"Display"},{family:"Road Rage",category:"Display"},{family:"Roboto",category:"Sans Serif"},{family:"Roboto Condensed",category:"Sans Serif"},{family:"Roboto Flex",category:"Sans Serif"},{family:"Roboto Mono",category:"Monospace"},{family:"Roboto Serif",category:"Serif"},{family:"Roboto Slab",category:"Serif"},{family:"Rochester",category:"Handwriting"},{family:"Rock 3D",category:"Display"},{family:"Rock Salt",category:"Handwriting"},{family:"RocknRoll One",category:"Sans Serif"},{family:"Rokkitt",category:"Serif"},{family:"Romanesco",category:"Handwriting"},{family:"Ropa Sans",category:"Sans Serif"},{family:"Rosario",category:"Sans Serif"},{family:"Rosarivo",category:"Serif"},{family:"Rouge Script",category:"Handwriting"},{family:"Rowdies",category:"Display"},{family:"Rozha One",category:"Serif"},{family:"Rubik",category:"Sans Serif"},{family:"Rubik 80s Fade",category:"Display"},{family:"Rubik Beastly",category:"Display"},{family:"Rubik Broken Fax",category:"Display"},{family:"Rubik Bubbles",category:"Display"},{family:"Rubik Burned",category:"Display"},{family:"Rubik Dirt",category:"Display"},{family:"Rubik Distressed",category:"Display"},{family:"Rubik Doodle Shadow",category:"Display"},{family:"Rubik Doodle Triangles",category:"Display"},{family:"Rubik Gemstones",category:"Display"},{family:"Rubik Glitch",category:"Display"},{family:"Rubik Glitch Pop",category:"Display"},{family:"Rubik Iso",category:"Display"},{family:"Rubik Lines",category:"Display"},{family:"Rubik Maps",category:"Display"},{family:"Rubik Marker Hatch",category:"Display"},{family:"Rubik Maze",category:"Display"},{family:"Rubik Microbe",category:"Display"},{family:"Rubik Mono One",category:"Sans Serif"},{family:"Rubik Moonrocks",category:"Display"},{family:"Rubik Pixels",category:"Display"},{family:"Rubik Puddles",category:"Display"},{family:"Rubik Scribble",category:"Display"},{family:"Rubik Spray Paint",category:"Display"},{family:"Rubik Storm",category:"Display"},{family:"Rubik Vinyl",category:"Display"},{family:"Rubik Wet Paint",category:"Display"},{family:"Ruda",category:"Sans Serif"},{family:"Rufina",category:"Serif"},{family:"Ruge Boogie",category:"Handwriting"},{family:"Ruluko",category:"Sans Serif"},{family:"Rum Raisin",category:"Sans Serif"},{family:"Ruslan Display",category:"Display"},{family:"Russo One",category:"Sans Serif"},{family:"Ruthie",category:"Handwriting"},{family:"Ruwudu",category:"Serif"},{family:"Rye",category:"Display"},{family:"Sacramento",category:"Handwriting"},{family:"Sahitya",category:"Serif"},{family:"Sail",category:"Display"},{family:"Saira",category:"Sans Serif"},{family:"Saira Condensed",category:"Sans Serif"},{family:"Saira Extra Condensed",category:"Sans Serif"},{family:"Saira Semi Condensed",category:"Sans Serif"},{family:"Saira Stencil",category:"Display"},{family:"Salsa",category:"Display"},{family:"Sanchez",category:"Serif"},{family:"Sancreek",category:"Display"},{family:"Sankofa Display",category:"Sans Serif"},{family:"Sansation",category:"Sans Serif"},{family:"Sansita",category:"Sans Serif"},{family:"Sansita Swashed",category:"Display"},{family:"Sarabun",category:"Sans Serif"},{family:"Sarala",category:"Sans Serif"},{family:"Sarina",category:"Display"},{family:"Sarpanch",category:"Sans Serif"},{family:"Sassy Frass",category:"Handwriting"},{family:"Satisfy",category:"Handwriting"},{family:"Savate",category:"Sans Serif"},{family:"Sawarabi Gothic",category:"Sans Serif"},{family:"Sawarabi Mincho",category:"Serif"},{family:"Scada",category:"Sans Serif"},{family:"Scheherazade New",category:"Serif"},{family:"Schibsted Grotesk",category:"Sans Serif"},{family:"Schoolbell",category:"Handwriting"},{family:"Science Gothic",category:"Sans Serif"},{family:"Scope One",category:"Serif"},{family:"Seaweed Script",category:"Display"},{family:"Secular One",category:"Sans Serif"},{family:"Sedan",category:"Serif"},{family:"Sedan SC",category:"Serif"},{family:"Sedgwick Ave",category:"Handwriting"},{family:"Sedgwick Ave Display",category:"Handwriting"},{family:"Sekuya",category:"Display"},{family:"Sen",category:"Sans Serif"},{family:"Send Flowers",category:"Handwriting"},{family:"Sevillana",category:"Display"},{family:"Seymour One",category:"Sans Serif"},{family:"Shadows Into Light",category:"Handwriting"},{family:"Shadows Into Light Two",category:"Handwriting"},{family:"Shafarik",category:"Display"},{family:"Shalimar",category:"Handwriting"},{family:"Shantell Sans",category:"Display"},{family:"Shanti",category:"Sans Serif"},{family:"Share",category:"Sans Serif"},{family:"Share Tech",category:"Sans Serif"},{family:"Share Tech Mono",category:"Monospace"},{family:"Shippori Antique",category:"Sans Serif"},{family:"Shippori Antique B1",category:"Sans Serif"},{family:"Shippori Mincho",category:"Serif"},{family:"Shippori Mincho B1",category:"Serif"},{family:"Shizuru",category:"Display"},{family:"Shojumaru",category:"Display"},{family:"Short Stack",category:"Handwriting"},{family:"Shrikhand",category:"Display"},{family:"Siemreap",category:"Sans Serif"},{family:"Sigmar",category:"Display"},{family:"Sigmar One",category:"Display"},{family:"Signika",category:"Sans Serif"},{family:"Signika Negative",category:"Sans Serif"},{family:"Silkscreen",category:"Display"},{family:"Simonetta",category:"Display"},{family:"Single Day",category:"Display"},{family:"Sintony",category:"Sans Serif"},{family:"Sirin Stencil",category:"Display"},{family:"Sirivennela",category:"Sans Serif"},{family:"Six Caps",category:"Sans Serif"},{family:"Sixtyfour",category:"Monospace"},{family:"Sixtyfour Convergence",category:"Monospace"},{family:"Skranji",category:"Display"},{family:"Slabo 13px",category:"Serif"},{family:"Slabo 27px",category:"Serif"},{family:"Slackey",category:"Display"},{family:"Slackside One",category:"Handwriting"},{family:"Smokum",category:"Display"},{family:"Smooch",category:"Handwriting"},{family:"Smooch Sans",category:"Sans Serif"},{family:"Smythe",category:"Display"},{family:"SN Pro",category:"Sans Serif"},{family:"Sniglet",category:"Display"},{family:"Snippet",category:"Sans Serif"},{family:"Snowburst One",category:"Display"},{family:"Sofadi One",category:"Display"},{family:"Sofia",category:"Handwriting"},{family:"Sofia Sans",category:"Sans Serif"},{family:"Sofia Sans Condensed",category:"Sans Serif"},{family:"Sofia Sans Extra Condensed",category:"Sans Serif"},{family:"Sofia Sans Semi Condensed",category:"Sans Serif"},{family:"Solitreo",category:"Handwriting"},{family:"Solway",category:"Serif"},{family:"Sometype Mono",category:"Monospace"},{family:"Song Myung",category:"Serif"},{family:"Sono",category:"Sans Serif"},{family:"Sonsie One",category:"Display"},{family:"Sora",category:"Sans Serif"},{family:"Sorts Mill Goudy",category:"Serif"},{family:"Sour Gummy",category:"Sans Serif"},{family:"Source Code Pro",category:"Monospace"},{family:"Source Sans 3",category:"Sans Serif"},{family:"Source Serif 4",category:"Serif"},{family:"Space Grotesk",category:"Sans Serif"},{family:"Space Mono",category:"Monospace"},{family:"Special Elite",category:"Display"},{family:"Special Gothic",category:"Sans Serif"},{family:"Special Gothic Condensed One",category:"Sans Serif"},{family:"Special Gothic Expanded One",category:"Sans Serif"},{family:"Spectral",category:"Serif"},{family:"Spectral SC",category:"Serif"},{family:"Spicy Rice",category:"Display"},{family:"Spinnaker",category:"Sans Serif"},{family:"Spirax",category:"Display"},{family:"Splash",category:"Handwriting"},{family:"Spline Sans",category:"Sans Serif"},{family:"Spline Sans Mono",category:"Monospace"},{family:"Squada One",category:"Display"},{family:"Square Peg",category:"Handwriting"},{family:"Sree Krushnadevaraya",category:"Serif"},{family:"Sriracha",category:"Handwriting"},{family:"Srisakdi",category:"Display"},{family:"Staatliches",category:"Display"},{family:"Stack Sans Headline",category:"Sans Serif"},{family:"Stack Sans Notch",category:"Sans Serif"},{family:"Stack Sans Text",category:"Sans Serif"},{family:"Stalemate",category:"Handwriting"},{family:"Stalinist One",category:"Display"},{family:"Stardos Stencil",category:"Display"},{family:"Stick",category:"Sans Serif"},{family:"Stick No Bills",category:"Sans Serif"},{family:"Stint Ultra Condensed",category:"Serif"},{family:"Stint Ultra Expanded",category:"Serif"},{family:"STIX Two Math",category:"Serif"},{family:"STIX Two Text",category:"Serif"},{family:"Stoke",category:"Serif"},{family:"Story Script",category:"Sans Serif"},{family:"Strait",category:"Sans Serif"},{family:"Strichpunkt Sans",category:"Sans Serif"},{family:"Style Script",category:"Handwriting"},{family:"Stylish",category:"Sans Serif"},{family:"Sue Ellen Francisco",category:"Handwriting"},{family:"Suez One",category:"Serif"},{family:"Sulphur Point",category:"Sans Serif"},{family:"Sumana",category:"Serif"},{family:"Sunflower",category:"Sans Serif"},{family:"Sunshiney",category:"Handwriting"},{family:"Supermercado One",category:"Display"},{family:"Sura",category:"Serif"},{family:"Suranna",category:"Serif"},{family:"Suravaram",category:"Serif"},{family:"SUSE",category:"Sans Serif"},{family:"SUSE Mono",category:"Sans Serif"},{family:"Suwannaphum",category:"Serif"},{family:"Swanky and Moo Moo",category:"Handwriting"},{family:"Syncopate",category:"Sans Serif"},{family:"Syne",category:"Sans Serif"},{family:"Syne Mono",category:"Monospace"},{family:"Syne Tactile",category:"Display"},{family:"Tac One",category:"Sans Serif"},{family:"Tagesschrift",category:"Display"},{family:"Tai Heritage Pro",category:"Serif"},{family:"Tajawal",category:"Sans Serif"},{family:"Tangerine",category:"Handwriting"},{family:"Tapestry",category:"Handwriting"},{family:"Taprom",category:"Display"},{family:"TASA Explorer",category:"Sans Serif"},{family:"TASA Orbiter",category:"Sans Serif"},{family:"Tauri",category:"Sans Serif"},{family:"Taviraj",category:"Serif"},{family:"Teachers",category:"Sans Serif"},{family:"Teko",category:"Sans Serif"},{family:"Tektur",category:"Display"},{family:"Telex",category:"Sans Serif"},{family:"Tenali Ramakrishna",category:"Sans Serif"},{family:"Tenor Sans",category:"Sans Serif"},{family:"Text Me One",category:"Sans Serif"},{family:"Texturina",category:"Serif"},{family:"Thasadith",category:"Sans Serif"},{family:"The Girl Next Door",category:"Handwriting"},{family:"The Nautigal",category:"Handwriting"},{family:"Tienne",category:"Serif"},{family:"TikTok Sans",category:"Sans Serif"},{family:"Tillana",category:"Display"},{family:"Tilt Neon",category:"Display"},{family:"Tilt Prism",category:"Display"},{family:"Tilt Warp",category:"Display"},{family:"Timmana",category:"Sans Serif"},{family:"Tinos",category:"Serif"},{family:"Tiny5",category:"Sans Serif"},{family:"Tiro Bangla",category:"Serif"},{family:"Tiro Devanagari Hindi",category:"Serif"},{family:"Tiro Devanagari Marathi",category:"Serif"},{family:"Tiro Devanagari Sanskrit",category:"Serif"},{family:"Tiro Gurmukhi",category:"Serif"},{family:"Tiro Kannada",category:"Serif"},{family:"Tiro Tamil",category:"Serif"},{family:"Tiro Telugu",category:"Serif"},{family:"Tirra",category:"Sans Serif"},{family:"Titan One",category:"Display"},{family:"Titillium Web",category:"Sans Serif"},{family:"Tomorrow",category:"Sans Serif"},{family:"Tourney",category:"Display"},{family:"Trade Winds",category:"Display"},{family:"Train One",category:"Display"},{family:"Triodion",category:"Display"},{family:"Trirong",category:"Serif"},{family:"Trispace",category:"Sans Serif"},{family:"Trocchi",category:"Serif"},{family:"Trochut",category:"Display"},{family:"Truculenta",category:"Sans Serif"},{family:"Trykker",category:"Serif"},{family:"Tsukimi Rounded",category:"Sans Serif"},{family:"Tuffy",category:"Sans Serif"},{family:"Tulpen One",category:"Display"},{family:"Turret Road",category:"Display"},{family:"Twinkle Star",category:"Handwriting"},{family:"Ubuntu",category:"Sans Serif"},{family:"Ubuntu Condensed",category:"Sans Serif"},{family:"Ubuntu Mono",category:"Monospace"},{family:"Ubuntu Sans",category:"Sans Serif"},{family:"Ubuntu Sans Mono",category:"Monospace"},{family:"Uchen",category:"Serif"},{family:"Ultra",category:"Serif"},{family:"Unbounded",category:"Sans Serif"},{family:"Uncial Antiqua",category:"Display"},{family:"Underdog",category:"Display"},{family:"Unica One",category:"Display"},{family:"UnifrakturCook",category:"Display"},{family:"UnifrakturMaguntia",category:"Display"},{family:"Unkempt",category:"Display"},{family:"Unlock",category:"Display"},{family:"Unna",category:"Serif"},{family:"UoqMunThenKhung",category:"Serif"},{family:"Updock",category:"Handwriting"},{family:"Urbanist",category:"Sans Serif"},{family:"Vampiro One",category:"Display"},{family:"Varela",category:"Sans Serif"},{family:"Varela Round",category:"Sans Serif"},{family:"Varta",category:"Sans Serif"},{family:"Vast Shadow",category:"Serif"},{family:"Vazirmatn",category:"Sans Serif"},{family:"Vend Sans",category:"Sans Serif"},{family:"Vesper Libre",category:"Serif"},{family:"Viaoda Libre",category:"Display"},{family:"Vibes",category:"Display"},{family:"Vibur",category:"Handwriting"},{family:"Victor Mono",category:"Monospace"},{family:"Vidaloka",category:"Serif"},{family:"Viga",category:"Sans Serif"},{family:"Vina Sans",category:"Display"},{family:"Voces",category:"Sans Serif"},{family:"Volkhov",category:"Serif"},{family:"Vollkorn",category:"Serif"},{family:"Vollkorn SC",category:"Serif"},{family:"Voltaire",category:"Sans Serif"},{family:"VT323",category:"Monospace"},{family:"Vujahday Script",category:"Handwriting"},{family:"Waiting for the Sunrise",category:"Handwriting"},{family:"Wallpoet",category:"Display"},{family:"Walter Turncoat",category:"Handwriting"},{family:"Warnes",category:"Display"},{family:"Water Brush",category:"Handwriting"},{family:"Waterfall",category:"Handwriting"},{family:"Wavefont",category:"Display"},{family:"WDXL Lubrifont JP N",category:"Sans Serif"},{family:"WDXL Lubrifont SC",category:"Sans Serif"},{family:"WDXL Lubrifont TC",category:"Sans Serif"},{family:"Wellfleet",category:"Serif"},{family:"Wendy One",category:"Sans Serif"},{family:"Whisper",category:"Handwriting"},{family:"WindSong",category:"Handwriting"},{family:"Winky Rough",category:"Sans Serif"},{family:"Winky Sans",category:"Sans Serif"},{family:"Wire One",category:"Sans Serif"},{family:"Wittgenstein",category:"Serif"},{family:"Wix Madefor Display",category:"Sans Serif"},{family:"Wix Madefor Text",category:"Sans Serif"},{family:"Work Sans",category:"Sans Serif"},{family:"Workbench",category:"Monospace"},{family:"Xanh Mono",category:"Monospace"},{family:"Yaldevi",category:"Sans Serif"},{family:"Yanone Kaffeesatz",category:"Sans Serif"},{family:"Yantramanav",category:"Sans Serif"},{family:"Yarndings 12",category:"Display"},{family:"Yarndings 12 Charted",category:"Display"},{family:"Yarndings 20",category:"Display"},{family:"Yarndings 20 Charted",category:"Display"},{family:"Yatra One",category:"Display"},{family:"Yellowtail",category:"Handwriting"},{family:"Yeon Sung",category:"Display"},{family:"Yeseva One",category:"Display"},{family:"Yesteryear",category:"Handwriting"},{family:"Yomogi",category:"Handwriting"},{family:"Young Serif",category:"Serif"},{family:"Yrsa",category:"Serif"},{family:"Ysabeau",category:"Sans Serif"},{family:"Ysabeau Infant",category:"Sans Serif"},{family:"Ysabeau Office",category:"Sans Serif"},{family:"Ysabeau SC",category:"Sans Serif"},{family:"Yuji Boku",category:"Serif"},{family:"Yuji Hentaigana Akari",category:"Handwriting"},{family:"Yuji Hentaigana Akebono",category:"Handwriting"},{family:"Yuji Mai",category:"Serif"},{family:"Yuji Syuku",category:"Serif"},{family:"Yusei Magic",category:"Sans Serif"},{family:"Zain",category:"Sans Serif"},{family:"Zalando Sans",category:"Sans Serif"},{family:"Zalando Sans Expanded",category:"Sans Serif"},{family:"Zalando Sans SemiExpanded",category:"Sans Serif"},{family:"ZCOOL KuaiLe",category:"Sans Serif"},{family:"ZCOOL QingKe HuangYou",category:"Sans Serif"},{family:"ZCOOL XiaoWei",category:"Sans Serif"},{family:"Zen Antique",category:"Serif"},{family:"Zen Antique Soft",category:"Serif"},{family:"Zen Dots",category:"Display"},{family:"Zen Kaku Gothic Antique",category:"Sans Serif"},{family:"Zen Kaku Gothic New",category:"Sans Serif"},{family:"Zen Kurenaido",category:"Sans Serif"},{family:"Zen Loop",category:"Display"},{family:"Zen Maru Gothic",category:"Sans Serif"},{family:"Zen Old Mincho",category:"Serif"},{family:"Zen Tokyo Zoo",category:"Display"},{family:"Zeyada",category:"Handwriting"},{family:"Zhi Mang Xing",category:"Handwriting"},{family:"Zilla Slab",category:"Serif"},{family:"Zilla Slab Highlight",category:"Serif"}];var kE='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',dQ0='Georgia, "Times New Roman", Times, serif',oQ0='"Courier New", Courier, monospace',tQ0="400;500;600;700",_Q0=80,sQ0=new Set(["cursive","emoji","fangsong","fantasy","inherit","initial","math","monospace","revert","revert-layer","sans-serif","serif","system-ui","ui-monospace","ui-rounded","ui-sans-serif","ui-serif","unset"]),vY=[{id:"system",label:"System",stack:kE,category:"system"},{id:"arial",label:"Arial",stack:'Arial, "Helvetica Neue", Helvetica, sans-serif',category:"system"},{id:"helvetica",label:"Helvetica",stack:"Helvetica, Arial, sans-serif",category:"system"},{id:"georgia",label:"Georgia",stack:'Georgia, "Times New Roman", serif',category:"system"},{id:"times-new-roman",label:"Times New Roman",stack:'"Times New Roman", Times, serif',category:"system"},{id:"verdana",label:"Verdana",stack:"Verdana, Geneva, sans-serif",category:"system"},{id:"trebuchet-ms",label:"Trebuchet MS",stack:'"Trebuchet MS", "Segoe UI", sans-serif',category:"system"},{id:"tahoma",label:"Tahoma",stack:'Tahoma, "Segoe UI", sans-serif',category:"system"},{id:"courier-new",label:"Courier New",stack:'"Courier New", Courier, monospace',category:"system"}];function vl(A){return(A??"").trim().replace(/^["']|["']$/g,"").replace(/\s+/g," ")}function eQ0(A){return A.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function A30(A){let E=A.trim().match(/^\s*(?:"([^"]+)"|'([^']+)'|([^,;]+))/);return vl(E?.[1]??E?.[2]??E?.[3])||void 0}function VY(A){let x=vl(A);if(!x||x.length>_Q0||sQ0.has(x.toLowerCase())||!/^[\p{L}\p{N} _-]+$/u.test(x))return;return x}function x30(A){if(A==="Serif")return dQ0;if(A==="Monospace")return oQ0;return kE}function E30(A,x){let E=VY(A);if(!E)return;return`"${E}", ${x30(x)}`}function B30(A){let x=VY(A);if(!x)return;return`https://fonts.googleapis.com/css2?family=${encodeURIComponent(x).replace(/%20/g,"+")}:wght@${tQ0}&display=swap`}function D30(A,x){let E=VY(A),D=E?B30(E):void 0,B=E?E30(E,x):"";if(!E||!D||!B)return;return{id:`google-${eQ0(E)}`,label:E,stack:B,category:"web",webFontCssUrl:D}}var Ic0=new Set(vY.flatMap((A)=>{let x=A30(A.stack);return x?[A.label.toLowerCase(),x.toLowerCase()]:[]}).concat(["-apple-system","blinkmacsystemfont","arial","courier","cursive","emoji","fangsong","fantasy","georgia","geneva","helvetica","helvetica neue","inherit","initial","math","monospace","revert","revert-layer","sans-serif","segoe ui","serif","system","system-ui","tahoma","times","times new roman","ui-monospace","ui-rounded","ui-sans-serif","ui-serif","unset","verdana"]));var Vl=[{id:"inter",label:"Inter",stack:`"Inter", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"},{id:"roboto",label:"Roboto",stack:`"Roboto", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"},{id:"open-sans",label:"Open Sans",stack:`"Open Sans", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap"},{id:"lato",label:"Lato",stack:`"Lato", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap"},{id:"montserrat",label:"Montserrat",stack:`"Montserrat", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap"},{id:"poppins",label:"Poppins",stack:`"Poppins", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap"},{id:"nunito",label:"Nunito",stack:`"Nunito", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap"},{id:"nunito-sans",label:"Nunito Sans",stack:`"Nunito Sans", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700&display=swap"},{id:"source-sans-3",label:"Source Sans 3",stack:`"Source Sans 3", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap"},{id:"raleway",label:"Raleway",stack:`"Raleway", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;700&display=swap"},{id:"work-sans",label:"Work Sans",stack:`"Work Sans", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap"},{id:"dm-sans",label:"DM Sans",stack:`"DM Sans", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap"},{id:"manrope",label:"Manrope",stack:`"Manrope", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap"},{id:"mulish",label:"Mulish",stack:`"Mulish", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Mulish:wght@400;600;700&display=swap"},{id:"quicksand",label:"Quicksand",stack:`"Quicksand", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap"},{id:"barlow",label:"Barlow",stack:`"Barlow", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&display=swap"},{id:"rubik",label:"Rubik",stack:`"Rubik", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&display=swap"},{id:"karla",label:"Karla",stack:`"Karla", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Karla:wght@400;500;600;700&display=swap"},{id:"cabin",label:"Cabin",stack:`"Cabin", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Cabin:wght@400;500;600;700&display=swap"},{id:"hind",label:"Hind",stack:`"Hind", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Hind:wght@400;500;600;700&display=swap"},{id:"fira-sans",label:"Fira Sans",stack:`"Fira Sans", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400;500;600;700&display=swap"},{id:"titillium-web",label:"Titillium Web",stack:`"Titillium Web", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;600;700&display=swap"},{id:"exo-2",label:"Exo 2",stack:`"Exo 2", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600;700&display=swap"},{id:"outfit",label:"Outfit",stack:`"Outfit", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap"},{id:"plus-jakarta-sans",label:"Plus Jakarta Sans",stack:`"Plus Jakarta Sans", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap"},{id:"space-grotesk",label:"Space Grotesk",stack:`"Space Grotesk", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap"},{id:"sora",label:"Sora",stack:`"Sora", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&display=swap"},{id:"albert-sans",label:"Albert Sans",stack:`"Albert Sans", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Albert+Sans:wght@400;500;600;700&display=swap"},{id:"merriweather",label:"Merriweather",stack:'"Merriweather", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&display=swap"},{id:"playfair-display",label:"Playfair Display",stack:'"Playfair Display", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&display=swap"},{id:"lora",label:"Lora",stack:'"Lora", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Lora:wght@400;600;700&display=swap"},{id:"pt-serif",label:"PT Serif",stack:'"PT Serif", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=PT+Serif:wght@400;700&display=swap"},{id:"source-serif-4",label:"Source Serif 4",stack:'"Source Serif 4", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;600;700&display=swap"},{id:"crimson-text",label:"Crimson Text",stack:'"Crimson Text", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&display=swap"},{id:"libre-baskerville",label:"Libre Baskerville",stack:'"Libre Baskerville", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&display=swap"},{id:"cormorant-garamond",label:"Cormorant Garamond",stack:'"Cormorant Garamond", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&display=swap"},{id:"eb-garamond",label:"EB Garamond",stack:'"EB Garamond", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;600;700&display=swap"},{id:"dm-serif-display",label:"DM Serif Display",stack:'"DM Serif Display", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=DM+Serif+Display&display=swap"},{id:"bitter",label:"Bitter",stack:'"Bitter", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Bitter:wght@400;600;700&display=swap"},{id:"spectral",label:"Spectral",stack:'"Spectral", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Spectral:wght@400;600;700&display=swap"},{id:"fraunces",label:"Fraunces",stack:'"Fraunces", "Times New Roman", serif',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600;700&display=swap"},{id:"bebas-neue",label:"Bebas Neue",stack:`"Bebas Neue", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap"},{id:"oswald",label:"Oswald",stack:`"Oswald", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&display=swap"},{id:"anton",label:"Anton",stack:`"Anton", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Anton&display=swap"},{id:"archivo-black",label:"Archivo Black",stack:`"Archivo Black", ${kE}`,category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Archivo+Black&display=swap"},{id:"roboto-mono",label:"Roboto Mono",stack:'"Roboto Mono", "Courier New", monospace',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;600;700&display=swap"},{id:"source-code-pro",label:"Source Code Pro",stack:'"Source Code Pro", "Courier New", monospace',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600;700&display=swap"},{id:"fira-code",label:"Fira Code",stack:'"Fira Code", "Courier New", monospace',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&display=swap"},{id:"jetbrains-mono",label:"JetBrains Mono",stack:'"JetBrains Mono", "Courier New", monospace',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap"},{id:"space-mono",label:"Space Mono",stack:'"Space Mono", "Courier New", monospace',category:"web",webFontCssUrl:"https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap"}],g30=new Set(Vl.map((A)=>A.label.toLowerCase()));function C30(A){return D30(A.family,A.category)}var F30=Pl.filter((A)=>!g30.has(A.family.toLowerCase())).map(C30).filter((A)=>A!==void 0),Qc0=[...vY,...Vl,...F30],nY=vY[0];var X1="#f97316";function I30(A){return{presetId:A.presetId,colors:{...A.colors},typography:{...A.typography},layout:{...A.layout}}}var Q30={default:{presetId:"default",colors:{primary:X1,background:"#ffffff",surface:"#f3f4f6",text:"#374151",mutedText:"#6b7280",heading:"#111827",border:"#e5e7eb",link:X1},typography:{baseFontSize:14,leadFontSize:16,baseLineHeight:1.4,heading1Size:24,heading2Size:20,heading3Size:18,buttonFontSize:14},layout:{contentWidth:600,containerPaddingX:24,containerPaddingY:16,blockSpacing:16,baseRadius:8,sectionPadding:24,buttonPaddingX:28,buttonPaddingY:12,borderedBlockPadding:12}},soft:{presetId:"soft",colors:{primary:X1,background:"#fffaf5",surface:"#fef3e8",text:"#4b5563",mutedText:"#8b6b55",heading:"#1f2937",border:"#f3dcc7",link:X1},typography:{baseFontSize:15,leadFontSize:17,baseLineHeight:1.7,heading1Size:31,heading2Size:25,heading3Size:19,buttonFontSize:14},layout:{contentWidth:600,containerPaddingX:28,containerPaddingY:20,blockSpacing:20,baseRadius:14,sectionPadding:28,buttonPaddingX:30,buttonPaddingY:13,borderedBlockPadding:14}},editorial:{presetId:"editorial",colors:{primary:X1,background:"#fafafa",surface:"#f4f4f5",text:"#334155",mutedText:"#64748b",heading:"#0f172a",border:"#e2e8f0",link:X1},typography:{baseFontSize:16,leadFontSize:18,baseLineHeight:1.75,heading1Size:34,heading2Size:28,heading3Size:20,buttonFontSize:15},layout:{contentWidth:620,containerPaddingX:32,containerPaddingY:20,blockSpacing:24,baseRadius:6,sectionPadding:28,buttonPaddingX:30,buttonPaddingY:13,borderedBlockPadding:16}},bold:{presetId:"bold",colors:{primary:X1,background:"#ffffff",surface:"#f1f5f9",text:"#1e293b",mutedText:"#475569",heading:"#020617",border:"#cbd5e1",link:X1},typography:{baseFontSize:14,leadFontSize:16,baseLineHeight:1.5,heading1Size:32,heading2Size:24,heading3Size:18,buttonFontSize:14},layout:{contentWidth:580,containerPaddingX:20,containerPaddingY:14,blockSpacing:12,baseRadius:4,sectionPadding:20,buttonPaddingX:26,buttonPaddingY:11,borderedBlockPadding:12}}},W1=I30(Q30.default);function y30(A=W1){return{1:{classes:`font-bold text-[${A.typography.heading1Size}px]`,marginBottom:"mb-2 mt-0",lineHeight:1.3},2:{classes:`font-semibold text-[${A.typography.heading2Size}px]`,marginBottom:"mb-2 mt-0",lineHeight:1.4},3:{classes:`font-semibold text-[${A.typography.heading3Size}px]`,marginBottom:"mb-2 mt-0",lineHeight:1.5}}}var Sc0=y30();function f30(A=W1){return{primary:{paddingX:A.layout.buttonPaddingX,paddingY:A.layout.buttonPaddingY,borderRadius:A.layout.baseRadius,lineHeight:1.2,fontSize:A.typography.buttonFontSize,fontWeight:600,classes:"no-underline"},secondary:{paddingX:Math.max(12,A.layout.buttonPaddingX-4),paddingY:Math.max(8,A.layout.buttonPaddingY-2),borderRadius:A.layout.baseRadius,borderWidth:2,lineHeight:1.2,fontSize:A.typography.buttonFontSize,fontWeight:600,classes:"no-underline bg-transparent"},pill:{paddingX:Math.max(12,A.layout.buttonPaddingX-4),paddingY:Math.max(8,A.layout.buttonPaddingY-2),borderRadius:9999,lineHeight:1.2,fontSize:A.typography.buttonFontSize,fontWeight:600,classes:"no-underline"}}}var $c0=f30();function w30(A=W1){return{default:{fontSize:A.typography.baseFontSize,color:A.colors.text,lineHeight:A.typography.baseLineHeight,marginBottom:Math.max(8,A.layout.blockSpacing-4),marginTop:0,classes:`text-[${A.typography.baseFontSize}px] text-[${A.colors.text}]`,marginBottomClass:`mb-[${Math.max(8,A.layout.blockSpacing-4)}px]`,lineHeightClass:`leading-[${A.typography.baseLineHeight}]`},lead:{fontSize:A.typography.leadFontSize,color:A.colors.mutedText,lineHeight:A.typography.baseLineHeight,marginBottom:Math.max(8,A.layout.blockSpacing-4),classes:`text-[${A.typography.leadFontSize}px] text-[${A.colors.mutedText}]`,marginBottomClass:`mb-[${Math.max(8,A.layout.blockSpacing-4)}px]`,lineHeightClass:`leading-[${A.typography.baseLineHeight}]`}}}var Gc0=w30();function i30(A=W1){return{default:{backgroundColor:A.colors.surface,titleColor:A.colors.heading,contentColor:A.colors.mutedText},feature:{},padding:`p-[${A.layout.sectionPadding}px]`,borderRadius:`rounded-[${A.layout.baseRadius}px]`,titleClasses:`m-0 mb-1 font-semibold text-[${A.typography.heading3Size}px]`,contentClasses:`m-0 text-[${A.typography.baseFontSize}px] leading-[${A.typography.baseLineHeight}]`}}var Hc0=i30();function S30(A=W1){return{containerClasses:`rounded-[${A.layout.baseRadius}px] p-[${Math.max(A.layout.sectionPadding,A.layout.blockSpacing+8)}px] text-center`,titleClasses:`m-0 mb-3 font-semibold text-white text-[${A.typography.heading2Size}px]`,descriptionClasses:`m-0 mb-5 text-white/90 text-[${A.typography.baseFontSize}px] leading-[${A.typography.baseLineHeight}]`,buttonClasses:`inline-block rounded-[${A.layout.baseRadius}px] bg-white px-[${A.layout.buttonPaddingX}px] py-[${A.layout.buttonPaddingY}px] font-semibold no-underline`}}var Jc0=S30();function $30(A=W1){return{maxWidth:A.layout.contentWidth,paddingX:A.layout.containerPaddingX,paddingY:A.layout.containerPaddingY,classes:`mx-auto bg-[${A.colors.background}] max-w-[${A.layout.contentWidth}px] px-[${A.layout.containerPaddingX}px] py-[${A.layout.containerPaddingY}px]`}}var Uc0=$30();function G30(A=W1){return A.layout.borderedBlockPadding}var Rc0=G30();var a2="span|strong|b|em|i|u|s",Yc0=new RegExp(`(?:<(?:${a2})\\b[^>]*>\\s*)+<br\\s*\\/?>(?:\\s*<\\/(?:${a2})>)+`,"gi"),uc0=new RegExp(`(<br\\s*\\/?>\\s*)(?:<(?:${a2})\\b[^>]*>\\s*)+<br\\s*\\/?>(?:\\s*<\\/(?:${a2})>)+(\\s*<br\\s*\\/?>)`,"gi");var QH=String.raw`(?:\s| | | |\u00A0)`,h4=String.raw`${QH}*`,yH=String.raw`<br\s*\/?>`,H30=String.raw`<(?:${a2})\b[^>]*>`,J30=String.raw`<\/(?:${a2})\s*>`,mY=String.raw`(?=${QH}|(?:${h4}${J30})+${h4}(?:${QH}|(?:${H30}${h4})+${QH}))`,TY=String.raw`(?:<(?:${a2})\b[^>]*>${h4})*`,U30=String.raw`(?:[•‣▪▫◦○]|[✓✔☑✅]${mY})`,Xc0=new RegExp(`${yH}${h4}(?:${yH}${h4})+(?=${h4}${TY}${U30})`,"gi"),Wc0=new RegExp(`${yH}${h4}(?:${yH}${h4})+(?=${h4}${TY}\\d+[.)]${mY})`,"gi"),Zc0=new RegExp(`^${h4}${TY}(\\d+)[.)]${mY}`,"i");var nl=String.raw`(?:\s| | | )*(?:<br\s*\/?>)?(?:\s| | | )*`,Lc0=new RegExp(String.raw`(?:\s*<p\b[^>]*>${nl}<\/p>\s*)+$`,"i"),zc0=new RegExp(String.raw`(?:\s*<div\b[^>]*>${nl}<\/div>\s*)+$`,"i"),Oc0=new RegExp(String.raw`(?:\s*(?:<(?:${a2})\b[^>]*>\s*)+<br\s*\/?>(?:\s*<\/(?:${a2})>)+\s*)+$`,"i");var Nc0=String.raw`<link\b(?=[^>]*\bhref\s*=\s*(?:"[^"]*campaign-archive\.com\/css\/archivebar-[^"]*"|'[^']*campaign-archive\.com\/css\/archivebar-[^']*'|[^\s>]*campaign-archive\.com\/css\/archivebar-[^\s>]*))[^>]*\/?>`;var IH=String.raw`(?:\s| | | |\u00A0)*`;var jc0=new RegExp(String.raw`<p\b([^>]*)>((?:(?!<\/p>)[\s\S])*?\S(?:(?!<\/p>)[\s\S])*?)<br\s*\/?>${IH}<\/p>${IH}<p\b[^>]*>${IH}<br\s*\/?>${IH}<\/p>`,"gi");var K30="https://www.sequenzy.com/favicon-32x32.png",dc0=`<table width="100%" cellspacing="0" cellpadding="0" style="margin-top: 32px;">
|
|
335
335
|
<tr>
|
|
@@ -408,7 +408,7 @@ $ npm install --save-dev react-devtools-core
|
|
|
408
408
|
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);else throw Error(`Raw mode is not supported on the stdin provided to Ink.
|
|
409
409
|
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(x.setEncoding("utf8"),A){if(this.rawModeEnabledCount===0)x.ref(),x.setRawMode(!0),x.addListener("readable",this.handleReadable);this.rawModeEnabledCount++;return}if(--this.rawModeEnabledCount===0)x.setRawMode(!1),x.removeListener("readable",this.handleReadable),x.unref()};handleReadable=()=>{let A;while((A=this.props.stdin.read())!==null)this.handleInput(A),this.internal_eventEmitter.emit("input",A)};handleInput=(A)=>{if(A==="\x03"&&this.props.exitOnCtrlC)this.handleExit();if(A===mN0&&this.state.activeFocusId)this.setState({activeFocusId:void 0});if(this.state.isFocusEnabled&&this.state.focusables.length>0){if(A===VN0)this.focusNext();if(A===nN0)this.focusPrevious()}};handleExit=(A)=>{if(this.isRawModeSupported())this.handleSetRawMode(!1);this.props.onExit(A)};enableFocus=()=>{this.setState({isFocusEnabled:!0})};disableFocus=()=>{this.setState({isFocusEnabled:!1})};focus=(A)=>{this.setState((x)=>{if(!x.focusables.some((D)=>D?.id===A))return x;return{activeFocusId:A}})};focusNext=()=>{this.setState((A)=>{let x=A.focusables.find((D)=>D.isActive)?.id;return{activeFocusId:this.findNextFocusable(A)??x}})};focusPrevious=()=>{this.setState((A)=>{let x=A.focusables.findLast((D)=>D.isActive)?.id;return{activeFocusId:this.findPreviousFocusable(A)??x}})};addFocusable=(A,{autoFocus:x})=>{this.setState((E)=>{let D=E.activeFocusId;if(!D&&x)D=A;return{activeFocusId:D,focusables:[...E.focusables,{id:A,isActive:!0}]}})};removeFocusable=(A)=>{this.setState((x)=>({activeFocusId:x.activeFocusId===A?void 0:x.activeFocusId,focusables:x.focusables.filter((E)=>{return E.id!==A})}))};activateFocusable=(A)=>{this.setState((x)=>({focusables:x.focusables.map((E)=>{if(E.id!==A)return E;return{id:A,isActive:!0}})}))};deactivateFocusable=(A)=>{this.setState((x)=>({activeFocusId:x.activeFocusId===A?void 0:x.activeFocusId,focusables:x.focusables.map((E)=>{if(E.id!==A)return E;return{id:A,isActive:!1}})}))};findNextFocusable=(A)=>{let x=A.focusables.findIndex((E)=>{return E.id===A.activeFocusId});for(let E=x+1;E<A.focusables.length;E++){let D=A.focusables[E];if(D?.isActive)return D.id}return};findPreviousFocusable=(A)=>{let x=A.focusables.findIndex((E)=>{return E.id===A.activeFocusId});for(let E=x-1;E>=0;E--){let D=A.focusables[E];if(D?.isActive)return D.id}return}}var wA0=()=>{};class GR{options;log;throttledLog;isUnmounted;lastOutput;container;rootNode;fullStaticOutput;exitPromise;restoreConsole;unsubscribeResize;constructor(A){if(KN(this),this.options=A,this.rootNode=kU("ink-root"),this.rootNode.onComputeLayout=this.calculateLayout,this.rootNode.onRender=A.debug?this.onRender:ZU(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=l00.create(A.stdout),this.throttledLog=A.debug?this.log:ZU(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=I3.createContainer(this.rootNode,0,null,!1,null,"id",()=>{},null),this.unsubscribeExit=SA0.default(this.unmount,{alwaysLast:!1}),TN0.env.DEV==="true")I3.injectIntoDevTools({bundleType:0,version:"16.13.1",rendererPackageName:"ink"});if(A.patchConsole)this.patchConsole();if(!cC)A.stdout.on("resize",this.resized),this.unsubscribeResize=()=>{A.stdout.off("resize",this.resized)}}resized=()=>{this.calculateLayout(),this.onRender()};resolveExitPromise=()=>{};rejectExitPromise=()=>{};unsubscribeExit=()=>{};calculateLayout=()=>{let A=this.options.stdout.columns||80;this.rootNode.yogaNode.setWidth(A),this.rootNode.yogaNode.calculateLayout(void 0,void 0,tA.DIRECTION_LTR)};onRender=()=>{if(this.isUnmounted)return;let{output:A,outputHeight:x,staticOutput:E}=P00(this.rootNode),D=E&&E!==`
|
|
410
410
|
`;if(this.options.debug){if(D)this.fullStaticOutput+=E;this.options.stdout.write(this.fullStaticOutput+A);return}if(cC){if(D)this.options.stdout.write(E);this.lastOutput=A;return}if(D)this.fullStaticOutput+=E;if(x>=this.options.stdout.rows){this.options.stdout.write(lC.clearTerminal+this.fullStaticOutput+A),this.lastOutput=A;return}if(D)this.log.clear(),this.options.stdout.write(E),this.log(A);if(!D&&A!==this.lastOutput)this.throttledLog(A);this.lastOutput=A};render(A){let x=iA0.default.createElement($R,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},A);I3.updateContainer(x,this.container,null,wA0)}writeToStdout(A){if(this.isUnmounted)return;if(this.options.debug){this.options.stdout.write(A+this.fullStaticOutput+this.lastOutput);return}if(cC){this.options.stdout.write(A);return}this.log.clear(),this.options.stdout.write(A),this.log(this.lastOutput)}writeToStderr(A){if(this.isUnmounted)return;if(this.options.debug){this.options.stderr.write(A),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(cC){this.options.stderr.write(A);return}this.log.clear(),this.options.stderr.write(A),this.log(this.lastOutput)}unmount(A){if(this.isUnmounted)return;if(this.calculateLayout(),this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole==="function")this.restoreConsole();if(typeof this.unsubscribeResize==="function")this.unsubscribeResize();if(cC)this.options.stdout.write(this.lastOutput+`
|
|
411
|
-
`);else if(!this.options.debug)this.log.done();if(this.isUnmounted=!0,I3.updateContainer(null,this.container,null,wA0),i3.delete(this.options.stdout),A instanceof Error)this.rejectExitPromise(A);else this.resolveExitPromise()}async waitUntilExit(){return this.exitPromise||=new Promise((A,x)=>{this.resolveExitPromise=A,this.rejectExitPromise=x}),this.exitPromise}clear(){if(!cC&&!this.options.debug)this.log.clear()}patchConsole(){if(this.options.debug)return;this.restoreConsole=Ks((A,x)=>{if(A==="stdout")this.writeToStdout(x);if(A==="stderr"){if(!x.startsWith("The above error occurred"))this.writeToStderr(x)}})}}var bN0=(A,x)=>{let E={stdout:HR.stdout,stdin:HR.stdin,stderr:HR.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0,...hN0(x)},D=lN0(E.stdout,()=>new GR(E));return D.render(A),{rerender:D.render,unmount(){D.unmount()},waitUntilExit:D.waitUntilExit,cleanup:()=>i3.delete(E.stdout),clear:D.clear}},ki=bN0,hN0=(A={})=>{if(A instanceof kN0)return{stdout:A,stdin:HR.stdin};return A},lN0=(A,x)=>{let E=i3.get(A);if(!E)E=x(),i3.set(A,E);return E};var JR=Rx(u8(),1);var cN0=Rx(u8(),1);var rN0=Rx(u8(),1);var aN0=Rx(u8(),1);var tN0=Rx(u8(),1);var pN0={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"},dN0=[...Object.values(pN0),"backspace"];var oN0=Rx(u8(),1);var _N0=Rx(u8(),1);var sN0=Rx(u8(),1);var eN0=Rx(u8(),1);var Oj=Rx(u8(),1);var Aj0=Rx(u8(),1);var S3=Rx(u8(),1);var RA0=Rx(UA0(),1);function Ej0({type:A="dots"}){let[x,E]=S3.useState(0),D=RA0.default[A];return S3.useEffect(()=>{let B=setInterval(()=>{E((g)=>{return g===D.frames.length-1?0:g+1})},D.interval);return()=>{clearInterval(B)}},[D]),S3.default.createElement(jx,null,D.frames[x])}var RR=Ej0;var AF=Rx(u8(),1);var s7=Rx(bi(),1);function gj0(A){return A!==null&&typeof A==="object"&&!Array.isArray(A)}function Cj0(A){let x={};if(A.varsJson){let E;try{E=JSON.parse(A.varsJson)}catch{throw Error("--vars-json must be valid JSON")}if(!gj0(E))throw Error("--vars-json must be a JSON object");x=E}for(let E of A.var??[]){let[D,B]=E.split("=");if(D&&B)x[D]=B}return x}function Fj0(A,x){let E=Cj0(x),D=x.html;if(x.htmlFile)D=Dj0(x.htmlFile,"utf-8");if(x.template&&D)throw Error("Use either --template or --html/--html-file, not both");if(!x.template&&!D)throw Error("Either --template or --html/--html-file is required");if(!x.template&&!x.subject)throw Error("--subject is required when using --html");return x.template?{to:A,slug:x.template,variables:E}:{to:A,subject:x.subject,body:D,variables:E}}function Ij0({email:A,options:x}){let[E,D]=AF.useState(!0),[B,g]=AF.useState(""),[F,Q]=AF.useState(!1);if(AF.useEffect(()=>{async function w(){try{await M0("POST","/api/v1/transactional/send",Fj0(A,x)),Q(!0)}catch(S){g(rf(S))}finally{D(!1)}}w()},[A,x]),AF.useEffect(()=>{if(!E)setTimeout(()=>process.exit(B?1:0),100)},[E,B]),E)return s7.jsxDEV(VE,{padding:1,children:[s7.jsxDEV(jx,{color:"cyan",children:s7.jsxDEV(RR,{type:"dots"},void 0,!1,void 0,this)},void 0,!1,void 0,this),s7.jsxDEV(jx,{children:[" Sending email to ",A,"..."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(B)return s7.jsxDEV(VE,{padding:1,children:s7.jsxDEV(jx,{color:"red",children:[" ",B]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return s7.jsxDEV(VE,{padding:1,children:s7.jsxDEV(jx,{color:"green",children:[" Email sent to ",A]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}async function KA0(A,x){if(!await Ix())RA(Sx()),process.exit(1);await ki(s7.jsxDEV(Ij0,{email:A,options:x},void 0,!1,void 0,this)).waitUntilExit()}var qA0=10,MA0=500,Qj0=new Set(["unlimited","one_time","matching_field"]),yj0={all:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],everyday:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],weekdays:["monday","tuesday","wednesday","thursday","friday"],"working-days":["monday","tuesday","wednesday","thursday","friday"],weekends:["saturday","sunday"]};function YA0(A){if(A===void 0)return;if(!Qj0.has(A))throw new E0("--enrollment-mode must be one of: unlimited, one_time, matching_field",400);return A}function fj0(A){if(A===void 0)return;let x=[];for(let E of A.split(",")){let D=E.trim().toLowerCase();if(!D)continue;let B=yj0[D];if(B){for(let g of B)if(!x.includes(g))x.push(g);continue}if(!x.includes(D))x.push(D)}if(x.length===0)throw new E0("--sending-window-days must include at least one day",400);return x}function wj0(A){let x=A.sendingWindowStart!==void 0||A.sendingWindowEnd!==void 0||A.sendingWindowTimezone!==void 0||A.sendingWindowDays!==void 0;if(A.clearSendingWindow&&x)throw new E0("Use either --clear-sending-window or --sending-window-* options, not both",400);if(A.clearSendingWindow)return null;if(!x)return;let E=A.sendingWindowStart?.trim(),D=A.sendingWindowEnd?.trim(),B=A.sendingWindowTimezone?.trim();if(!E||!D||!B)throw new E0("--sending-window-start, --sending-window-end, and --sending-window-timezone are required together",400);let g=fj0(A.sendingWindowDays);return{enabled:!0,timezone:B,startTime:E,endTime:D,...g!==void 0&&{days:g}}}function KR(A){if(!A)return"Not restricted";return`${A.startTime}-${A.endTime} ${A.timezone} (${(A.days??["every day"]).join(", ")})`}function jj(A,x){let E=A??"Unknown";return x===!0?`${E} (new enrollments paused)`:E}function uA0(A){if(A.pauseNewEnrollments&&A.resumeNewEnrollments)throw new E0("Provide either --pause-new-enrollments or --resume-new-enrollments, not both",400);if((A.branchJson!==void 0||A.branchFile!==void 0)&&(A.insertStepsJson!==void 0||A.insertStepsFile!==void 0))throw new E0("Provide either --branch-json/--branch-file or --insert-steps-json/--insert-steps-file, not both",400);let x=wj0(A);return{...A.name!==void 0&&{name:A.name},...A.trigger!==void 0&&{trigger:A.trigger},...A.goal!==void 0&&A.goal.trim().length>0&&{goal:A.goal.trim()},...M8(A.emailCount,"--email-count")!==void 0&&{emailCount:M8(A.emailCount,"--email-count")},...M8(A.durationDays,"--duration-days")!==void 0&&{durationDays:M8(A.durationDays,"--duration-days")},...A.pauseNewEnrollments===!0&&{enrollmentPaused:!0},...A.resumeNewEnrollments===!0&&{enrollmentPaused:!1},...YA0(A.enrollmentMode)!==void 0&&{enrollmentMode:YA0(A.enrollmentMode)},...A.enrollmentFieldPath!==void 0&&{enrollmentFieldPath:A.enrollmentFieldPath},...x!==void 0&&{sendingWindow:x},...A.listId!==void 0&&{listId:A.listId},...A.tagName!==void 0&&{tagName:A.tagName},...A.segmentId!==void 0&&{segmentId:A.segmentId},...A.eventName!==void 0&&{eventName:A.eventName},...q8(A.propertyFiltersJson,A.propertyFiltersFile,"propertyFilters")!==void 0&&{propertyFilters:q8(A.propertyFiltersJson,A.propertyFiltersFile,"propertyFilters")},...M8(A.inactiveDays,"--inactive-days")!==void 0&&{inactiveDays:M8(A.inactiveDays,"--inactive-days")},...M8(A.minCount,"--min-count")!==void 0&&{minCount:M8(A.minCount,"--min-count")},...M8(A.timeWindowDays,"--time-window-days")!==void 0&&{timeWindowDays:M8(A.timeWindowDays,"--time-window-days")},...q8(A.stepsJson,A.stepsFile,"steps")!==void 0&&{steps:q8(A.stepsJson,A.stepsFile,"steps")},...q8(A.emailsJson,A.emailsFile,"emails")!==void 0&&{emails:q8(A.emailsJson,A.emailsFile,"emails")},...q8(A.branchJson,A.branchFile,"branch")!==void 0&&{branch:q8(A.branchJson,A.branchFile,"branch")},...q8(A.insertStepsJson,A.insertStepsFile,"insertSteps")!==void 0&&{insertSteps:q8(A.insertStepsJson,A.insertStepsFile,"insertSteps")},...q8(A.stopConditionJson,A.stopConditionFile,"stopCondition")!==void 0&&{stopCondition:q8(A.stopConditionJson,A.stopConditionFile,"stopCondition")}}}function ij0(A){return Array.from(new Set((A??"").split(",").map((x)=>x.trim()).filter((x)=>x.length>0)))}function Sj0(A){let x=A.subscriberId?.trim(),E=ij0(A.fieldValues),D=x!==void 0&&x.length>0,B=E.length>0;if(D===B)throw new E0("Provide exactly one target: --subscriber-id or --field-values",400);return{...D&&{subscriberId:x},...A.fieldPath!==void 0&&A.fieldPath.trim().length>0&&{fieldPath:A.fieldPath.trim()},...B&&{fieldValues:E},dryRun:A.apply!==!0,...A.reason!==void 0&&A.reason.trim().length>0&&{reason:A.reason.trim()}}}function $j0(A){let E=Array.isArray(A.email)&&A.email.length>0||A.emailsJson!==void 0||A.emailsFile!==void 0?YU(A):[],D=Array.from(new Set((A.subscriberIds??[]).map((B)=>B.trim()).filter((B)=>B.length>0)));if(E.length===0&&D.length===0)throw new E0("Provide at least one email address or subscriber ID",400);return{...E.length>0&&{emails:E},...D.length>0&&{subscriberIds:D},...A.targetNodeId!==void 0&&{targetNodeId:A.targetNodeId}}}function Gj0(A){let x=[],E=A.emails??[],D=A.subscriberIds??[],B=0,g=0;while(B<E.length||g<D.length){let F=E.slice(B,B+MA0);B+=F.length;let Q=MA0-F.length,w=D.slice(g,g+Q);g+=w.length,x.push({...F.length>0&&{emails:F},...w.length>0&&{subscriberIds:w},...A.targetNodeId!==void 0&&{targetNodeId:A.targetNodeId}})}return x}function Hj0(A){let x=A.goal?.trim(),E=!!x,D=!!A.stepsJson||!!A.stepsFile;if(E&&D)throw new E0("Provide either --goal or --steps-json/--steps-file, not both",400);if(!E&&!D)throw new E0("Provide sequence content with --goal or --steps-json/--steps-file",400);if(A.emailCount!==void 0&&!E)throw new E0("--email-count requires --goal",400);if(A.durationDays!==void 0&&!E)throw new E0("--duration-days requires --goal",400);let B=M8(A.emailCount,"--email-count");if(B!==void 0&&B>qA0)throw new E0(`--email-count must be no more than ${qA0}`,400);let g=M8(A.durationDays,"--duration-days");if(g!==void 0&&g<1)throw new E0("--duration-days must be at least 1",400);return E?{mode:"goal",goal:x}:{mode:"steps"}}async function w4(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let F=await M0("GET","/api/v1/sequences",void 0,x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q}):void 0,S=F.sequences.map((J)=>Q!==void 0?JC(J,{sequenceId:J.id},"sequence",Q):{...J,url:void 0});if(x.json){m0({...F,sequences:S,...w!==void 0&&{appUrls:w.urls}});return}console.log(`Sequences (${F.sequences.length})`);for(let J of S)console.log(`- ${J.name} [${J.id}]`),console.log(` Status: ${jj(J.status,J.enrollmentPaused)}`),console.log(` Trigger: ${J.trigger??"Unknown"}`),console.log(` Sending window: ${KR(J.sendingWindow)}`),console.log(` Created: ${bA(J.createdAt)}`),Wx(" URL",J.url);return}if(A==="create"){if(!x.name)throw new E0("Sequence name is required",400);if(!x.trigger)throw new E0("Sequence trigger is required",400);let F=Hj0(x),Q=await M0("POST","/api/v1/sequences",uA0({...x,...F.goal!==void 0&&{goal:F.goal}}),x.company),w=await zB(x.company),S=Q.sequence?.id??Q.sequenceId,J=w!==void 0&&S!==void 0?OE({companyId:w,sequenceId:S}):void 0;if(x.json){m0({...Q,...Q.sequence!==void 0&&J?.urls.sequence!==void 0&&{sequence:{...Q.sequence,url:J.urls.sequence}},...J!==void 0&&{appUrls:J.urls}});return}if(console.log(`Created sequence: ${Q.sequence?.name??x.name}`),console.log(`ID: ${Q.sequence?.id??"Unknown"}`),Wx("URL",J?.urls.sequence),console.log(`Status: ${jj(Q.sequence?.status,Q.sequence?.enrollmentPaused)}`),Q.sequence?.emailCount!==void 0)console.log(`Emails: ${Q.sequence.emailCount}`);if(Q.sequence?.discountCount!==void 0)console.log(`Discount actions: ${Q.sequence.discountCount}`);if("sendingWindow"in(Q.sequence??{}))console.log(`Sending window: ${KR(Q.sequence?.sendingWindow)}`);if(F.mode==="goal")console.log("Mode: AI-generated");if(Q.message)console.log(Q.message);return}if(!x.id)throw new E0("Sequence ID is required",400);if(A==="update"){if(x.name===void 0&&x.enrollmentMode===void 0&&x.enrollmentFieldPath===void 0&&x.pauseNewEnrollments!==!0&&x.resumeNewEnrollments!==!0&&x.sendingWindowStart===void 0&&x.sendingWindowEnd===void 0&&x.sendingWindowTimezone===void 0&&x.sendingWindowDays===void 0&&x.clearSendingWindow!==!0&&!x.stepsJson&&!x.stepsFile&&!x.emailsJson&&!x.emailsFile&&!x.branchJson&&!x.branchFile&&!x.insertStepsJson&&!x.insertStepsFile&&!x.stopConditionJson&&!x.stopConditionFile)throw new E0("Provide at least one of: --name, --enrollment-mode, --enrollment-field-path, --pause-new-enrollments, --resume-new-enrollments, --sending-window-*, --clear-sending-window, --steps-json, --steps-file, --emails-json, --emails-file, --branch-json, --branch-file, --insert-steps-json, --insert-steps-file, --stop-condition-json, --stop-condition-file",400);let F=await M0("PUT",`/api/v1/sequences/${x.id}`,uA0(x),x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q,sequenceId:x.id}):void 0;if(x.json){m0({...F,...F.sequence!==void 0&&w?.urls.sequence!==void 0&&{sequence:{...F.sequence,url:w.urls.sequence}},...w!==void 0&&{appUrls:w.urls}});return}if(console.log(`Updated sequence: ${F.sequence?.name??x.id}`),console.log(`ID: ${F.sequence?.id??x.id}`),Wx("URL",w?.urls.sequence),console.log(`Status: ${F.sequence?.status??"Unknown"}`),"sendingWindow"in(F.sequence??{}))console.log(`Sending window: ${KR(F.sequence?.sendingWindow)}`);return}if(A==="pause-enrollments"||A==="resume-enrollments"){let F=await M0("POST",`/api/v1/sequences/${x.id}/${A}`,void 0,x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q,sequenceId:x.id}):void 0;if(x.json){m0({...F,...w!==void 0&&{appUrls:w.urls}});return}console.log(F.message??`Updated sequence ${x.id}`),Wx("URL",w?.urls.sequence);return}if(A==="enable"||A==="disable"){let F=await M0("POST",`/api/v1/sequences/${x.id}/${A}`,void 0,x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q,sequenceId:x.id}):void 0;if(x.json){m0({...F,...w!==void 0&&{appUrls:w.urls}});return}console.log(F.message??`${A}d sequence ${x.id}`),Wx("URL",w?.urls.sequence);return}if(A==="enroll"){let F=$j0(x),Q=Gj0(F),w=0,S=0,J=[],M,q;for(let K of Q){let W=await M0("POST",`/api/v1/sequences/${x.id}/enroll`,K,x.company);w+=W.enrolled,S+=W.skipped,J.push(...W.notFound),M??=W.targetNodeId,q??=W.scheduledFor}if(x.json){m0({success:!0,sequenceId:x.id,enrolled:w,skipped:S,notFound:J,...M!==void 0&&{targetNodeId:M},...q!==void 0&&{scheduledFor:q}});return}if(console.log(`Enrolled ${w} subscriber(s) in sequence: ${x.id}`),console.log(`Skipped (already enrolled, inactive, or unavailable): ${S}`),J.length>0){console.log(`Not found: ${J.length}`);for(let K of J.slice(0,10))console.log(`- ${K}`);if(J.length>10)console.log(`...and ${J.length-10} more`)}if(M!==void 0)console.log(`Target node: ${M}`);if(q!==void 0)console.log(`Scheduled for: ${bA(q)}`);return}if(A==="cancel-enrollments"){let F=await M0("POST",`/api/v1/sequences/${x.id}/enrollments/cancel`,Sj0(x),x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q,sequenceId:x.id}):void 0;if(x.json){m0({...F,...w!==void 0&&{appUrls:w.urls}});return}if(console.log(F.message??"Sequence enrollment cancellation done"),console.log(`Matched: ${F.matchedCount}`),console.log(`Cancelled: ${F.cancelledCount}`),console.log(`Dry run: ${F.dryRun?"yes":"no"}`),F.hasMore)console.log("Only the first matching enrollments are shown.");if((F.enrollments?.length??0)>0){console.log("Enrollments:");for(let S of F.enrollments??[])console.log(`- ${S.tokenId} | ${S.subscriberEmail??S.subscriberId} [${S.status}]`)}Wx("URL",w?.urls.sequence);return}if(A==="delete"){let F=await M0("DELETE",`/api/v1/sequences/${x.id}`,void 0,x.company);if(x.json){m0(F);return}console.log(F.message??`Deleted sequence ${x.id}`);return}let E=await M0("GET",`/api/v1/sequences/${x.id}`,void 0,x.company),D=await zB(x.company),B=D!==void 0?OE({companyId:D,sequenceId:x.id}):void 0;if(x.json){m0({...E,...B?.urls.sequence!==void 0&&{sequence:{...E.sequence,url:B.urls.sequence}},...B!==void 0&&{appUrls:B.urls}});return}let g=E.sequence;if(console.log(g.name),console.log(`ID: ${g.id}`),Wx("URL",B?.urls.sequence),console.log(`Status: ${jj(g.status,g.enrollmentPaused)}`),console.log(`Trigger: ${g.trigger??"Unknown"}`),console.log(`Sending window: ${KR(g.sendingWindow)}`),console.log(`Created: ${bA(g.createdAt)}`),console.log(`Enrichment: ${g.enrichmentStatus} (${g.enrichedCount}/${g.emailCount})`),g.emails.length>0){console.log("Emails:");for(let F of g.emails){let Q=F.stepNumber!==null?`Step ${F.stepNumber}`:`Node ${F.nodeId}`;console.log(`- ${Q}`),console.log(` Email ID: ${F.emailId??"None"}`),console.log(` Name: ${F.name??"None"}`),console.log(` Subject: ${F.subject??"None"}`),console.log(` Preview: ${F.previewText??"None"}`),console.log(` Blocks: ${F.blocks.length}`)}}}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}var xF=Rx(u8(),1);var Px=Rx(bi(),1);function Jj0(A){let x=A.stats;return{sent:x.sent,delivered:x.delivered,opened:x.opened,clicked:x.clicked,unsubscribed:x.unsubscribed,openRate:x.openRate,clickRate:x.clickRate,conversions:x.conversions,revenueCents:x.revenueCents,steps:A.steps}}function Pj(A){let x=new URLSearchParams;if(!A.campaign&&!A.sequence)x.set("period",A.period??"7d");if(A.includeBots)x.set("includeMachineEngagement","true");let E=x.toString();return E?`?${E}`:""}function Uj0({options:A}){let[x,E]=xF.useState(!0),[D,B]=xF.useState(""),[g,F]=xF.useState(null);if(xF.useEffect(()=>{async function J(){try{let M;if(A.campaign)M=await M0("GET",`/api/v1/metrics/campaigns/${A.campaign}${Pj(A)}`);else if(A.sequence)M=await M0("GET",`/api/v1/metrics/sequences/${A.sequence}${Pj(A)}`);else M=await M0("GET",`/api/v1/metrics${Pj(A)}`);F(Jj0(M))}catch(M){B(rf(M instanceof E0?M:M))}finally{E(!1)}}J()},[A]),xF.useEffect(()=>{if(!x)setTimeout(()=>process.exit(D?1:0),100)},[x,D]),x)return Px.jsxDEV(VE,{padding:1,children:[Px.jsxDEV(jx,{color:"cyan",children:Px.jsxDEV(RR,{type:"dots"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:" Loading stats..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(D)return Px.jsxDEV(VE,{padding:1,children:Px.jsxDEV(jx,{color:"red",children:[" ",D]},void 0,!0,void 0,this)},void 0,!1,void 0,this);if(!g)return Px.jsxDEV(VE,{padding:1,children:Px.jsxDEV(jx,{dimColor:!0,children:"No stats available"},void 0,!1,void 0,this)},void 0,!1,void 0,this);let Q=A.period??"7d",w=A.campaign?"Campaign Stats":A.sequence?"Sequence Stats":`Stats (${Q})`,S=A.sequence&&g.steps?g.steps.filter((J)=>(J.failedCount??0)>0):[];return Px.jsxDEV(VE,{flexDirection:"column",padding:1,children:[Px.jsxDEV(VE,{marginBottom:1,children:[Px.jsxDEV(jx,{bold:!0,color:"green",children:w},void 0,!1,void 0,this),A.includeBots&&Px.jsxDEV(jx,{dimColor:!0,children:" including bot/scanner engagement"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Px.jsxDEV(VE,{flexDirection:"column",children:[Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Sent: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.sent.toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Delivered: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.delivered.toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Opened: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.opened.toLocaleString()},void 0,!1,void 0,this),Px.jsxDEV(jx,{dimColor:!0,children:[" (",g.openRate.toFixed(1),"%)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Clicked: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.clicked.toLocaleString()},void 0,!1,void 0,this),Px.jsxDEV(jx,{dimColor:!0,children:[" (",g.clickRate.toFixed(1),"%)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Unsubscribed: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.unsubscribed.toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),g.conversions!==void 0&&Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Conversions: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.conversions.toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),g.revenueCents!==void 0&&Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Revenue: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:["$",(g.revenueCents/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S.length>0&&Px.jsxDEV(VE,{flexDirection:"column",marginTop:1,children:[Px.jsxDEV(VE,{marginBottom:1,children:Px.jsxDEV(jx,{bold:!0,children:"Step Failures"},void 0,!1,void 0,this)},void 0,!1,void 0,this),S.map((J)=>Px.jsxDEV(VE,{flexDirection:"column",marginBottom:1,children:[Px.jsxDEV(jx,{children:["Step ",J.step,": ",J.subject??J.nodeId," (",J.failedCount," failed",")"]},void 0,!0,void 0,this),(J.failedSubscribers??[]).map((M)=>Px.jsxDEV(VE,{marginLeft:2,children:Px.jsxDEV(jx,{children:["- ",M.email??M.subscriberId,":"," ",M.failedReason??"Reason unavailable"]},void 0,!0,void 0,this)},`${J.nodeId}-${M.subscriberId}`,!1,void 0,this)),(J.failedCount??0)>(J.failedSubscribers?.length??0)&&Px.jsxDEV(VE,{marginLeft:2,children:Px.jsxDEV(jx,{dimColor:!0,children:["Showing first ",J.failedSubscribers?.length??0," of"," ",J.failedCount," failed subscribers"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},J.nodeId,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}async function XA0(A){if(!await Ix())RA(Sx()),process.exit(1);await ki(Px.jsxDEV(Uj0,{options:A},void 0,!1,void 0,this)).waitUntilExit()}function vj(A){if(!A)return[];return Array.isArray(A)?A:[A]}function WA0(A){if(!A)return[];return Array.isArray(A)?A:[A]}function qR(A){let x={};for(let E of A??[]){let[D,...B]=E.split("="),g=B.join("=");if(D&&g)x[D]=g}return Object.keys(x).length>0?x:void 0}function Rj0(A){let x=A.email?.trim()||void 0,E=A.externalId?.trim()||void 0;return{...x?{email:x}:{},...E?{externalId:E}:{}}}function hi(A){let x=Rj0(A);if(!x.email&&!x.externalId)throw Error("Provide an email or --external-id.");return x}function Vj(A,x){let E=new URLSearchParams;if(x?.includeBots)E.set("includeMachineEngagement","true");let D=E.toString(),B=D?`?${D}`:"";if(A.email)return`/api/v1/subscribers/${encodeURIComponent(A.email)}${B}`;return E.set("externalId",String(A.externalId)),`/api/v1/subscribers/external?${E.toString()}`}function Kj0(A){let x=new URLSearchParams;if(A.segment)x.set("segmentId",A.segment);let E=vj(A.tag);if(E.length>0)x.set("tags",E.join(","));let D=WA0(A.list);if(D.length>0&&D[0])x.set("list",D[0]);return x.set("page",String(A.page)),x.set("limit",String(A.pageSize)),x}async function qj0(A){let x=M8(A.limit,"--limit"),E=Math.min(100,Math.max(1,x??100)),D=[],B=1,g=0,F=0,Q=0;while(!0){let S=Kj0({segment:A.segment,tag:A.tag,list:A.list,page:B,pageSize:E}),J=await M0("GET",`/api/v1/subscribers?${S.toString()}`,void 0,A.company);g=J.pagination?.total??J.subscribers.length,F=J.pagination?.totalPages??1,Q+=1,D.push(...J.subscribers??[]);let M=x!==void 0&&D.length>=x,q=J.pagination?B>=J.pagination.totalPages:(J.subscribers??[]).length<E;if(M||q)break;B+=1}let w=x!==void 0?D.slice(0,x):D;return{success:!0,subscribers:w,pagination:{page:1,limit:E,total:g,totalPages:F,fetchedPages:Q},returned:w.length,truncated:x!==void 0&&g>0&&w.length<g}}function ZA0(A){let x=[A.firstName,A.lastName].map((E)=>E?.trim()).filter((E)=>!!E);return x.length>0?x.join(" "):null}function Mj0(A){let x=A.machine===!0?` [bot:${A.engagementQuality??"machine"}]`:"",E=`${bA(A.eventTime)} ${A.eventType}${x}`;if(A.eventType==="custom"){let D=A.eventName??"unknown",B=A.properties&&Object.keys(A.properties).length>0?` ${JSON.stringify(A.properties)}`:"";return`${E} ${D}${B}`}if(A.clickedUrl)return`${E} ${A.clickedUrl}`;if(A.bounceType)return`${E} ${A.bounceType}`;if(A.campaignId)return`${E} campaign:${A.campaignId}`;return E}function Yj0(A){if(A.subscribers.length===0){console.log("No subscribers found");return}console.log(`Subscribers (${A.returned})`),console.log(A.truncated?`Showing ${A.returned} of ${A.pagination.total} matching subscribers.`:`Fetched ${A.returned} matching subscribers across ${A.pagination.fetchedPages} page(s).`);for(let x of A.subscribers){if(console.log(`- ${x.email} [${x.status}]`),x.externalId)console.log(` External ID: ${x.externalId}`);let E=ZA0(x);if(E)console.log(` Name: ${E}`);if(x.tags.length>0)console.log(` Tags: ${x.tags.join(", ")}`);if(x.emailProvider)console.log(` Email provider: ${x.emailProvider}`);console.log(` Created: ${bA(x.createdAt)}`)}}function uj0(A){if(console.log(`Subscriber: ${A.email}`),console.log(`Status: ${A.status}`),A.externalId)console.log(`External ID: ${A.externalId}`);let x=ZA0(A);if(x)console.log(`Name: ${x}`);if(console.log(`ID: ${A.id}`),console.log(`Created: ${bA(A.createdAt)}`),console.log(`Updated: ${bA(A.updatedAt)}`),console.log(`Email provider: ${A.emailProvider??"None"}`),console.log(`Tags: ${A.tags.length>0?A.tags.join(", "):"None"}`),console.log("Lists:"),(A.lists?.length??0)===0)console.log(" None");else for(let E of A.lists??[])console.log(` - ${E.name}${E.unsubscribedAt?" [inactive]":" [active]"}`),console.log(` Joined: ${bA(E.subscribedAt)}${E.unsubscribedAt?` | Unsubscribed: ${bA(E.unsubscribedAt)}`:""}`);if(console.log("Sequence Enrollments:"),(A.sequenceEnrollments?.length??0)===0)console.log(" None");else for(let E of A.sequenceEnrollments??[])if(console.log(` - ${E.sequenceName} [${E.enrollmentStatus}]`),console.log(` Sequence ID: ${E.sequenceId} | Status: ${E.sequenceStatus}`),console.log(` Current node: ${E.currentNodeLabel??E.currentNodeType??"Unknown"}`),console.log(` Entered: ${bA(E.enteredAt)} | Updated: ${bA(E.updatedAt)}`),E.scheduledFor)console.log(` Scheduled: ${bA(E.scheduledFor)}`);if(console.log("Email Stats:"),!A.emailStats)console.log(" None");else console.log(` Sent ${A.emailStats.sent}, delivered ${A.emailStats.delivered}, opened ${A.emailStats.opened}, clicked ${A.emailStats.clicked}, bounced ${A.emailStats.bounced}, unsubscribed ${A.emailStats.unsubscribed}, complained ${A.emailStats.complained}`);if(console.log("Recent Activity:"),(A.activity?.length??0)===0)console.log(" None");else for(let E of A.activity??[])console.log(` - ${Mj0(E)}`);if(console.log("Custom Attributes:"),!A.customAttributes||Object.keys(A.customAttributes).length===0)console.log(" None");else console.log(JSON.stringify(A.customAttributes,null,2))}async function Xj0(A){let x=await qj0(A);if(A.json){m0(x);return}Yj0(x)}async function Wj0(A){let x=hi(A),E=WA0(A.list),D=await M0("POST","/api/v1/subscribers",{...x,firstName:A.firstName,lastName:A.lastName,tags:vj(A.tag),...A.noLists?{lists:[]}:E.length>0?{lists:E}:{},...A.skipSequences?{enrollInSequences:!1}:{},customAttributes:qR(A.attr)},A.company);if(A.json){m0(D);return}console.log(`Added subscriber: ${x.email??`external:${x.externalId}`}`)}async function Zj0(A){let x=hi(A),E=vj(A.tag),D=qR(A.attr);if(!(A.status!==void 0||E.length>0||D!==void 0))throw Error("Provide at least one of --status, --tag, or --attr.");let g=await M0("PATCH",Vj(x),{...A.status!==void 0&&{status:A.status},...E.length>0&&{tags:E},...D!==void 0&&{customAttributes:D}},A.company);if(A.json){m0(g);return}console.log(`Updated subscriber: ${x.email??`external:${x.externalId}`}`)}async function Lj0(A){let x=hi(A),E=await M0("GET",Vj(x,{includeBots:A.includeBots}),void 0,A.company);if(A.json){m0(E);return}uj0(E.subscriber)}async function zj0(A){let x=hi(A),E=Vj(x),D=x.email??`external:${x.externalId}`;if(A.hard){let g=await M0("DELETE",E,void 0,A.company);if(A.json){m0(g);return}console.log(`Deleted subscriber: ${D}`);return}let B=await M0("PATCH",E,{status:"unsubscribed"},A.company);if(A.json){m0(B);return}console.log(`Unsubscribed: ${D}`)}async function Oj0(A){let x=hi(A),E=A.name?.trim();if(!E)throw Error("--name is required.");let D=await M0("POST","/api/v1/subscribers/events",{...x,event:E,properties:qR(A.property),customAttributes:qR(A.attr)},A.company);if(A.json){m0(D);return}console.log(`Triggered event: ${E} for ${x.email??`external:${x.externalId}`}`)}async function EF(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{switch(A){case"list":await Xj0(x);return;case"add":await Wj0(x);return;case"update":await Zj0(x);return;case"get":await Lj0(x);return;case"event":await Oj0(x);return;case"remove":await zj0(x);return}}catch(E){let D=E instanceof E0?E:new E0(E instanceof Error?E.message:"Unknown error",500);RA(D),process.exit(1)}}function Nj0(A){let x=A.isSystem?" [system]":"";console.log(`- ${A.name} [${A.id}]${x}`),console.log(` Color: ${A.color??"Default"}`)}function jj0(A){if(!A.name||A.name.trim()==="")throw new E0("Tag name is required",400);return{name:A.name,...A.color!==void 0&&{color:A.color}}}async function $3(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let D=await M0("GET","/api/v1/tags",void 0,x.company);if(x.json){m0(D);return}console.log(`Tags (${D.tags.length})`);for(let B of D.tags)Nj0(B);return}if(A==="create"){let D=jj0(x),B=await M0("POST","/api/v1/tags",D,x.company);if(x.json){m0(B);return}if(console.log(`Created tag: ${B.tag?.name??D.name}`),B.tag)console.log(`ID: ${B.tag.id}`),console.log(`Color: ${B.tag.color??"Default"}`);return}if(!x.tagId)throw new E0("Tag ID is required",400);if(A==="update"){if(!x.color||x.color.trim()==="")throw new E0("--color is required",400);let D=await M0("PATCH",`/api/v1/tags/${encodeURIComponent(x.tagId)}`,{color:x.color},x.company);if(x.json){m0(D);return}if(console.log(`Updated tag: ${D.tag?.name??x.tagId}`),D.tag)console.log(`ID: ${D.tag.id}`),console.log(`Color: ${D.tag.color??"Default"}`);return}if(!await q6(`Delete tag ${x.tagId}? It will be removed from all subscribers.`,x)){console.log("Aborted.");return}let E=await M0("DELETE",`/api/v1/tags/${encodeURIComponent(x.tagId)}`,void 0,x.company);if(x.json){m0(E);return}console.log(`Deleted tag: ${x.tagId}`)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}var Pj0=new Set(["admin","viewer"]);function vj0(A){if(!A.email||A.email.trim()==="")throw new E0("Email is required",400);if(!A.role||!Pj0.has(A.role))throw new E0("--role must be admin or viewer",400);return{email:A.email.trim(),role:A.role,...A.billingAccess===!0&&{canManageBilling:!0}}}function Vj0(A){let x=A.user.name?`${A.user.name} <${A.user.email}>`:A.user.email;if(console.log(`- ${x} [${A.id}]`),console.log(` Kind: ${A.kind}`),console.log(` Role: ${A.role}`),console.log(` Status: ${A.status}`),console.log(` Billing access: ${A.canManageBilling?"yes":"no"}`),A.invitedAt)console.log(` Invited: ${bA(A.invitedAt)}`);if(A.expiresAt)console.log(` Expires: ${bA(A.expiresAt)}`);if(A.invitedBy)console.log(` Invited by: ${A.invitedBy.name??A.invitedBy.email}`)}async function MR(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let D=await M0("GET","/api/v1/team",void 0,x.company);if(x.json){m0(D);return}console.log(`Team members (${D.members.length})`);for(let B of D.members)Vj0(B);return}if(A==="invite"){let D=vj0(x),B=await M0("POST","/api/v1/team/invitations",D,x.company);if(x.json){m0(B);return}if(B.invitation){console.log(`Invitation sent to ${B.invitation.email}`),console.log(`ID: ${B.invitation.id}`),console.log(`Role: ${B.invitation.role}`),console.log(`Billing access: ${B.invitation.canManageBilling?"yes":"no"}`),console.log(`Status: ${B.invitation.status}`),console.log(`Expires: ${bA(B.invitation.expiresAt)}`);return}console.log(`Added team member: ${B.member?.email??D.email}`),console.log(`Role: ${B.member?.role??D.role}`),console.log(`Billing access: ${B.member?.canManageBilling?"yes":"no"}`);return}if(!x.invitationId)throw new E0("Invitation ID is required",400);if(!await q6(`Cancel invitation ${x.invitationId}?`,x)){console.log("Aborted.");return}let E=await M0("DELETE",`/api/v1/team/invitations/${encodeURIComponent(x.invitationId)}`,void 0,x.company);if(x.json){m0(E);return}console.log(`Cancelled invitation: ${x.invitationId}`)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}function LA0(A){if(A.length===0)return"none";return A.map((x)=>`${x.locale}:${x.status}`).join(", ")}function YR(A){return A&&A.length>0?A.join(", "):"None"}function nj0(A,x){if(A.name===void 0&&A.subject===void 0&&A.label===void 0&&x.html===void 0&&x.blocks===void 0)throw new E0("Provide at least one of: --name, --subject, --label, --html, --html-file, --blocks-json, --blocks-file",400);return{name:A.name,subject:A.subject,html:x.html,blocks:x.blocks,labels:A.label}}async function G3(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let F=new URLSearchParams;if(x.label)for(let J of x.label)F.append("label",J);let Q=await M0("GET",`/api/v1/templates${F.size>0?`?${F.toString()}`:""}`,void 0,x.company),w=OE({companyId:Q.companyId}),S=Q.templates.map((J)=>JC(J,{emailId:J.id},"email",Q.companyId));if(x.json){m0({...Q,templates:S,appUrls:w.urls});return}if(console.log(`Templates (${Q.templates.length})`),Q.emailLocalizationConfig)console.log(`Primary locale: ${Q.emailLocalizationConfig.primaryLocale}`);for(let J of S)console.log(`- ${J.name} [${J.id}]`),console.log(` Subject: ${J.subject}`),console.log(` Labels: ${YR(J.labels)}`),Wx(" URL",J.url),console.log(` Localizations: ${LA0(J.localizations)}`);return}let E=FQ({html:x.html,htmlFile:x.htmlFile,blocksJson:x.blocksJson,blocksFile:x.blocksFile,...A==="create"?{required:!0,requiredMessage:"Provide either --html/--html-file or --blocks-json/--blocks-file"}:{}});if(A==="create"){if(!x.name)throw new E0("Template name is required",400);if(!x.subject)throw new E0("Template subject is required",400);let F=await M0("POST","/api/v1/templates",{name:x.name,subject:x.subject,html:E.html,blocks:E.blocks,labels:x.label},x.company),Q=await zB(x.company),w=F.template?.id??F.templateId,S=Q!==void 0&&w!==void 0?OE({companyId:Q,emailId:w}):void 0;if(x.json){m0({...F,...F.template!==void 0&&S?.urls.email!==void 0&&{template:{...F.template,url:S.urls.email}},...S!==void 0&&{appUrls:S.urls}});return}console.log(`Created template: ${F.template?.name??x.name}`),console.log(`ID: ${F.template?.id??"Unknown"}`),Wx("URL",S?.urls.email),console.log(`Labels: ${YR(F.template?.labels)}`),console.log(`Subject: ${F.template?.subject??x.subject??"Unknown"}`);return}if(!x.id)throw new E0("Template ID is required",400);if(A==="update"){let F=await M0("PUT",`/api/v1/templates/${x.id}`,nj0(x,E),x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q,emailId:x.id}):void 0;if(x.json){m0({...F,...F.template!==void 0&&w?.urls.email!==void 0&&{template:{...F.template,url:w.urls.email}},...w!==void 0&&{appUrls:w.urls}});return}console.log(`Updated template: ${F.template?.name??x.id}`),console.log(`ID: ${F.template?.id??x.id}`),Wx("URL",w?.urls.email),console.log(`Labels: ${YR(F.template?.labels)}`),console.log(`Subject: ${F.template?.subject??"Unchanged"}`);return}if(A==="delete"){let F=await M0("DELETE",`/api/v1/templates/${x.id}`,void 0,x.company);if(x.json){m0(F);return}console.log(F.message??`Deleted template: ${x.id}`);return}let D=await M0("GET",`/api/v1/templates/${x.id}`,void 0,x.company),B=OE({companyId:D.template.companyId,emailId:x.id});if(x.json){m0({...D,template:{...D.template,url:B.urls.email},appUrls:B.urls});return}let g=D.template;console.log(g.name),console.log(`ID: ${g.id}`),console.log(`Company: ${g.companyId}`),Wx("URL",B.urls.email),console.log(`Subject: ${g.subject}`),console.log(`Labels: ${YR(g.labels)}`),console.log(`Preview: ${g.previewText??"None"}`),console.log(`Blocks: ${g.blocks.length}`),console.log(`Font: ${g.fontFamily??"Default"}`),console.log(`Created: ${bA(g.createdAt)}`),console.log(`Updated: ${bA(g.updatedAt)}`),console.log(`Localizations: ${LA0(g.localizations)}`);for(let F of g.localizations){let Q=F.lastError?` | error: ${F.lastError}`:"";console.log(`- ${F.locale} [${F.status}] blocks=${F.blocks.length}${Q}`)}}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}async function nj(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let B=await M0("GET","/api/v1/transactional",void 0,x.company);if(x.json){m0(B);return}console.log(`Transactional templates (${B.transactional.length})`);for(let g of B.transactional)console.log(`- ${g.name} [${g.slug}] ${g.enabled?"enabled":"disabled"}`);return}if(!x.slug)throw new E0("Transactional template slug is required",400);let E=await M0("GET",`/api/v1/transactional/${encodeURIComponent(x.slug)}`,void 0,x.company);if(x.json){m0(E);return}let D=E.transactional;if(console.log(D.name),console.log(`ID: ${D.id}`),console.log(`Slug: ${D.slug}`),console.log(`Enabled: ${D.enabled?"yes":"no"}`),D.subject)console.log(`Subject: ${D.subject}`);if((D.variables?.length??0)>0)console.log(`Variables: ${D.variables?.join(", ")}`)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}function NA0(A){if(A===void 0||A.length===0)return;let x=new Set(UN);for(let E of A)if(!x.has(E))throw new E0(`Invalid --event value '${E}'. Valid events: ${UN.join(", ")}`,400);return A}function mj0(A){if(!A.name||A.name.trim()==="")throw new E0("--name is required",400);if(!A.url||A.url.trim()==="")throw new E0("--url is required",400);let x=NA0(A.event);return{name:A.name,url:A.url,...x!==void 0&&{events:x}}}function Tj0(A){if(A.enable===!0&&A.disable===!0)throw new E0("Use either --enable or --disable, not both",400);let x=NA0(A.event),E=A.enable===!0?"enabled":A.disable===!0?"disabled":void 0,D={...A.name!==void 0&&{name:A.name},...A.url!==void 0&&{url:A.url},...x!==void 0&&{events:x},...E!==void 0&&{status:E}};if(Object.keys(D).length===0)throw new E0("Provide at least one of: --name, --url, --event, --enable, --disable",400);return D}function zA0(A){if(console.log(`- ${A.name} [${A.id}]`),console.log(` URL: ${A.url}`),console.log(` Status: ${A.status}`),console.log(` Events: ${A.events.join(", ")||"None"}`),A.consecutiveFailures>0)console.log(` Consecutive failures: ${A.consecutiveFailures}`);if(A.lastSuccessAt)console.log(` Last success: ${bA(A.lastSuccessAt)}`);if(A.lastFailureAt)console.log(` Last failure: ${bA(A.lastFailureAt)}`);console.log(` Created: ${bA(A.createdAt)}`)}function OA0(A){if(console.log(`- ${A.id} [${A.status}]`),console.log(` Event: ${A.eventType} (${A.eventId})`),console.log(` Attempts: ${A.attempts}`),A.lastStatusCode!==null)console.log(` Last status code: ${A.lastStatusCode}`);if(A.lastError)console.log(` Last error: ${A.lastError}`);if(A.lastAttemptAt)console.log(` Last attempt: ${bA(A.lastAttemptAt)}`);if(A.nextAttemptAt)console.log(` Next attempt: ${bA(A.nextAttemptAt)}`);console.log(` Created: ${bA(A.createdAt)}`)}async function _1(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let B=await M0("GET","/api/v1/webhooks",void 0,x.company);if(x.json){m0(B);return}console.log(`Webhooks (${B.webhooks.length})`);for(let g of B.webhooks)zA0(g);return}if(A==="create"){let B=await M0("POST","/api/v1/webhooks",mj0(x),x.company);if(x.json){m0(B);return}let g=B.webhook;console.log(`Created webhook: ${g?.name??x.name}`),console.log(`ID: ${g?.id??"Unknown"}`),console.log(`URL: ${g?.url??x.url}`),console.log(`Status: ${g?.status??"enabled"}`),console.log(`Events: ${g?.events.join(", ")??"None"}`),console.log(""),console.log("Signing secret (shown only once - store it somewhere safe now):"),console.log(` ${g?.signingSecret??"Unavailable"}`);return}if(!x.id)throw new E0("Webhook ID is required",400);let E=`/api/v1/webhooks/${encodeURIComponent(x.id)}`;if(A==="update"){let B=await M0("PATCH",E,Tj0(x),x.company);if(x.json){m0(B);return}if(console.log(`Updated webhook: ${B.webhook?.name??x.id}`),B.webhook)zA0(B.webhook);return}if(A==="delete"){if(!await q6(`Permanently delete webhook ${x.id} and its delivery history?`,x)){console.log("Aborted.");return}let B=await M0("DELETE",E,void 0,x.company);if(x.json){m0(B);return}console.log(`Deleted webhook: ${x.id}`);return}if(A==="test"){let B=await M0("POST",`${E}/test`,void 0,x.company);if(x.json){m0(B);return}console.log(`Queued test event for webhook: ${x.id}`),console.log(`Event ID: ${B.eventId}`),console.log(`Queued deliveries: ${B.queuedDeliveries}`);return}if(A==="deliveries"){let B=M8(x.limit,"--limit");if(B!==void 0&&(B<1||B>100))throw new E0("--limit must be an integer between 1 and 100",400);let g=await M0("GET",`${E}/deliveries${B!==void 0?`?limit=${B}`:""}`,void 0,x.company);if(x.json){m0(g);return}console.log(`Deliveries (${g.deliveries.length})`);for(let F of g.deliveries)OA0(F);return}if(!x.deliveryId)throw new E0("Delivery ID is required",400);let D=await M0("POST",`${E}/deliveries/${encodeURIComponent(x.deliveryId)}/replay`,void 0,x.company);if(x.json){m0(D);return}console.log(`Replay queued for delivery: ${x.deliveryId}`),OA0(D.delivery)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}async function li(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let F=await M0("GET","/api/v1/websites",void 0,x.company);if(x.json){m0(F);return}console.log(`Websites (${F.websites.length})`);for(let Q of F.websites)console.log(`- ${Q.domain}`),console.log(` Status: ${Q.status}`),console.log(` Created: ${bA(Q.createdAt)}`);return}if(A==="guide"){let F=await M0("POST","/api/v1/integration-guide",{framework:x.framework,use_case:x.useCase});if(x.json){m0(F);return}if(console.log(`Integration guide: ${F.framework} / ${F.use_case}`),console.log(""),console.log(F.code),F.tip)console.log(""),console.log(`Tip: ${F.tip}`);return}if(!x.domain)throw new E0("Domain is required",400);let E=A==="add"?"POST":"GET",D=A==="add"?"/api/v1/websites":`/api/v1/websites/${encodeURIComponent(x.domain)}`,B=A==="add"?{domain:x.domain}:void 0,g=await M0(E,D,B,x.company);if(x.json){m0(g);return}if(console.log(g.website.domain),console.log(`Status: ${g.website.status}`),g.website.createdAt)console.log(`Created: ${bA(g.website.createdAt)}`);if(g.website.message)console.log(g.website.message);if(g.website.dnsRecords!==void 0)console.log("DNS Records:"),m0(g.website.dnsRecords)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}async function jA0(){if(!await Ix()){RA(Sx());return}let A=AH();console.log(`Email: ${A.userEmail??"Unknown"}`),console.log(`User ID: ${A.userId??"Unknown"}`),console.log(""),console.log("Your API key can access all companies you belong to."),console.log("Use `sequenzy account` to see available companies.")}async function PA0(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="preferences-token"){if(!x.email)throw new E0("Email is required",400);let E=await M0("POST","/api/v1/widgets/preferences/token",{email:x.email},x.company);if(x.json){m0(E);return}console.log(E.token)}}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}function vA0(A,x){if(x.length===0)return"";return`
|
|
411
|
+
`);else if(!this.options.debug)this.log.done();if(this.isUnmounted=!0,I3.updateContainer(null,this.container,null,wA0),i3.delete(this.options.stdout),A instanceof Error)this.rejectExitPromise(A);else this.resolveExitPromise()}async waitUntilExit(){return this.exitPromise||=new Promise((A,x)=>{this.resolveExitPromise=A,this.rejectExitPromise=x}),this.exitPromise}clear(){if(!cC&&!this.options.debug)this.log.clear()}patchConsole(){if(this.options.debug)return;this.restoreConsole=Ks((A,x)=>{if(A==="stdout")this.writeToStdout(x);if(A==="stderr"){if(!x.startsWith("The above error occurred"))this.writeToStderr(x)}})}}var bN0=(A,x)=>{let E={stdout:HR.stdout,stdin:HR.stdin,stderr:HR.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0,...hN0(x)},D=lN0(E.stdout,()=>new GR(E));return D.render(A),{rerender:D.render,unmount(){D.unmount()},waitUntilExit:D.waitUntilExit,cleanup:()=>i3.delete(E.stdout),clear:D.clear}},ki=bN0,hN0=(A={})=>{if(A instanceof kN0)return{stdout:A,stdin:HR.stdin};return A},lN0=(A,x)=>{let E=i3.get(A);if(!E)E=x(),i3.set(A,E);return E};var JR=Rx(u8(),1);var cN0=Rx(u8(),1);var rN0=Rx(u8(),1);var aN0=Rx(u8(),1);var tN0=Rx(u8(),1);var pN0={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"},dN0=[...Object.values(pN0),"backspace"];var oN0=Rx(u8(),1);var _N0=Rx(u8(),1);var sN0=Rx(u8(),1);var eN0=Rx(u8(),1);var Oj=Rx(u8(),1);var Aj0=Rx(u8(),1);var S3=Rx(u8(),1);var RA0=Rx(UA0(),1);function Ej0({type:A="dots"}){let[x,E]=S3.useState(0),D=RA0.default[A];return S3.useEffect(()=>{let B=setInterval(()=>{E((g)=>{return g===D.frames.length-1?0:g+1})},D.interval);return()=>{clearInterval(B)}},[D]),S3.default.createElement(jx,null,D.frames[x])}var RR=Ej0;var AF=Rx(u8(),1);var s7=Rx(bi(),1);function gj0(A){return A!==null&&typeof A==="object"&&!Array.isArray(A)}function Cj0(A){let x={};if(A.varsJson){let E;try{E=JSON.parse(A.varsJson)}catch{throw Error("--vars-json must be valid JSON")}if(!gj0(E))throw Error("--vars-json must be a JSON object");x=E}for(let E of A.var??[]){let[D,B]=E.split("=");if(D&&B)x[D]=B}return x}function Fj0(A,x){let E=Cj0(x),D=x.html;if(x.htmlFile)D=Dj0(x.htmlFile,"utf-8");if(x.template&&D)throw Error("Use either --template or --html/--html-file, not both");if(!x.template&&!D)throw Error("Either --template or --html/--html-file is required");if(!x.template&&!x.subject)throw Error("--subject is required when using --html");return x.template?{to:A,slug:x.template,variables:E}:{to:A,subject:x.subject,body:D,variables:E}}function Ij0({email:A,options:x}){let[E,D]=AF.useState(!0),[B,g]=AF.useState(""),[F,Q]=AF.useState(!1);if(AF.useEffect(()=>{async function w(){try{await M0("POST","/api/v1/transactional/send",Fj0(A,x)),Q(!0)}catch(S){g(rf(S))}finally{D(!1)}}w()},[A,x]),AF.useEffect(()=>{if(!E)setTimeout(()=>process.exit(B?1:0),100)},[E,B]),E)return s7.jsxDEV(VE,{padding:1,children:[s7.jsxDEV(jx,{color:"cyan",children:s7.jsxDEV(RR,{type:"dots"},void 0,!1,void 0,this)},void 0,!1,void 0,this),s7.jsxDEV(jx,{children:[" Sending email to ",A,"..."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(B)return s7.jsxDEV(VE,{padding:1,children:s7.jsxDEV(jx,{color:"red",children:[" ",B]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return s7.jsxDEV(VE,{padding:1,children:s7.jsxDEV(jx,{color:"green",children:[" Email sent to ",A]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}async function KA0(A,x){if(!await Ix())RA(Sx()),process.exit(1);await ki(s7.jsxDEV(Ij0,{email:A,options:x},void 0,!1,void 0,this)).waitUntilExit()}var qA0=10,MA0=500,Qj0=new Set(["unlimited","one_time","matching_field"]),yj0={all:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],everyday:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],weekdays:["monday","tuesday","wednesday","thursday","friday"],"working-days":["monday","tuesday","wednesday","thursday","friday"],weekends:["saturday","sunday"]};function YA0(A){if(A===void 0)return;if(!Qj0.has(A))throw new E0("--enrollment-mode must be one of: unlimited, one_time, matching_field",400);return A}function fj0(A){if(A===void 0)return;let x=[];for(let E of A.split(",")){let D=E.trim().toLowerCase();if(!D)continue;let B=yj0[D];if(B){for(let g of B)if(!x.includes(g))x.push(g);continue}if(!x.includes(D))x.push(D)}if(x.length===0)throw new E0("--sending-window-days must include at least one day",400);return x}function wj0(A){let x=A.sendingWindowStart!==void 0||A.sendingWindowEnd!==void 0||A.sendingWindowTimezone!==void 0||A.sendingWindowDays!==void 0;if(A.clearSendingWindow&&x)throw new E0("Use either --clear-sending-window or --sending-window-* options, not both",400);if(A.clearSendingWindow)return null;if(!x)return;let E=A.sendingWindowStart?.trim(),D=A.sendingWindowEnd?.trim(),B=A.sendingWindowTimezone?.trim();if(!E||!D||!B)throw new E0("--sending-window-start, --sending-window-end, and --sending-window-timezone are required together",400);let g=fj0(A.sendingWindowDays);return{enabled:!0,timezone:B,startTime:E,endTime:D,...g!==void 0&&{days:g}}}function KR(A){if(!A)return"Not restricted";return`${A.startTime}-${A.endTime} ${A.timezone} (${(A.days??["every day"]).join(", ")})`}function jj(A,x){let E=A??"Unknown";return x===!0?`${E} (new enrollments paused)`:E}function uA0(A){if(A.pauseNewEnrollments&&A.resumeNewEnrollments)throw new E0("Provide either --pause-new-enrollments or --resume-new-enrollments, not both",400);if((A.branchJson!==void 0||A.branchFile!==void 0)&&(A.insertStepsJson!==void 0||A.insertStepsFile!==void 0))throw new E0("Provide either --branch-json/--branch-file or --insert-steps-json/--insert-steps-file, not both",400);let x=wj0(A);return{...A.name!==void 0&&{name:A.name},...A.trigger!==void 0&&{trigger:A.trigger},...A.goal!==void 0&&A.goal.trim().length>0&&{goal:A.goal.trim()},...M8(A.emailCount,"--email-count")!==void 0&&{emailCount:M8(A.emailCount,"--email-count")},...M8(A.durationDays,"--duration-days")!==void 0&&{durationDays:M8(A.durationDays,"--duration-days")},...A.pauseNewEnrollments===!0&&{enrollmentPaused:!0},...A.resumeNewEnrollments===!0&&{enrollmentPaused:!1},...A.confirmStructuralChange===!0&&{confirmStructuralChange:!0},...YA0(A.enrollmentMode)!==void 0&&{enrollmentMode:YA0(A.enrollmentMode)},...A.enrollmentFieldPath!==void 0&&{enrollmentFieldPath:A.enrollmentFieldPath},...x!==void 0&&{sendingWindow:x},...A.listId!==void 0&&{listId:A.listId},...A.tagName!==void 0&&{tagName:A.tagName},...A.segmentId!==void 0&&{segmentId:A.segmentId},...A.eventName!==void 0&&{eventName:A.eventName},...q8(A.propertyFiltersJson,A.propertyFiltersFile,"propertyFilters")!==void 0&&{propertyFilters:q8(A.propertyFiltersJson,A.propertyFiltersFile,"propertyFilters")},...M8(A.inactiveDays,"--inactive-days")!==void 0&&{inactiveDays:M8(A.inactiveDays,"--inactive-days")},...M8(A.minCount,"--min-count")!==void 0&&{minCount:M8(A.minCount,"--min-count")},...M8(A.timeWindowDays,"--time-window-days")!==void 0&&{timeWindowDays:M8(A.timeWindowDays,"--time-window-days")},...q8(A.stepsJson,A.stepsFile,"steps")!==void 0&&{steps:q8(A.stepsJson,A.stepsFile,"steps")},...q8(A.emailsJson,A.emailsFile,"emails")!==void 0&&{emails:q8(A.emailsJson,A.emailsFile,"emails")},...q8(A.branchJson,A.branchFile,"branch")!==void 0&&{branch:q8(A.branchJson,A.branchFile,"branch")},...q8(A.insertStepsJson,A.insertStepsFile,"insertSteps")!==void 0&&{insertSteps:q8(A.insertStepsJson,A.insertStepsFile,"insertSteps")},...q8(A.stopConditionJson,A.stopConditionFile,"stopCondition")!==void 0&&{stopCondition:q8(A.stopConditionJson,A.stopConditionFile,"stopCondition")}}}function ij0(A){return Array.from(new Set((A??"").split(",").map((x)=>x.trim()).filter((x)=>x.length>0)))}function Sj0(A){let x=A.subscriberId?.trim(),E=ij0(A.fieldValues),D=x!==void 0&&x.length>0,B=E.length>0;if(D===B)throw new E0("Provide exactly one target: --subscriber-id or --field-values",400);return{...D&&{subscriberId:x},...A.fieldPath!==void 0&&A.fieldPath.trim().length>0&&{fieldPath:A.fieldPath.trim()},...B&&{fieldValues:E},dryRun:A.apply!==!0,...A.reason!==void 0&&A.reason.trim().length>0&&{reason:A.reason.trim()}}}function $j0(A){let E=Array.isArray(A.email)&&A.email.length>0||A.emailsJson!==void 0||A.emailsFile!==void 0?YU(A):[],D=Array.from(new Set((A.subscriberIds??[]).map((B)=>B.trim()).filter((B)=>B.length>0)));if(E.length===0&&D.length===0)throw new E0("Provide at least one email address or subscriber ID",400);return{...E.length>0&&{emails:E},...D.length>0&&{subscriberIds:D},...A.targetNodeId!==void 0&&{targetNodeId:A.targetNodeId}}}function Gj0(A){let x=[],E=A.emails??[],D=A.subscriberIds??[],B=0,g=0;while(B<E.length||g<D.length){let F=E.slice(B,B+MA0);B+=F.length;let Q=MA0-F.length,w=D.slice(g,g+Q);g+=w.length,x.push({...F.length>0&&{emails:F},...w.length>0&&{subscriberIds:w},...A.targetNodeId!==void 0&&{targetNodeId:A.targetNodeId}})}return x}function Hj0(A){let x=A.goal?.trim(),E=!!x,D=!!A.stepsJson||!!A.stepsFile;if(E&&D)throw new E0("Provide either --goal or --steps-json/--steps-file, not both",400);if(!E&&!D)throw new E0("Provide sequence content with --goal or --steps-json/--steps-file",400);if(A.emailCount!==void 0&&!E)throw new E0("--email-count requires --goal",400);if(A.durationDays!==void 0&&!E)throw new E0("--duration-days requires --goal",400);let B=M8(A.emailCount,"--email-count");if(B!==void 0&&B>qA0)throw new E0(`--email-count must be no more than ${qA0}`,400);let g=M8(A.durationDays,"--duration-days");if(g!==void 0&&g<1)throw new E0("--duration-days must be at least 1",400);return E?{mode:"goal",goal:x}:{mode:"steps"}}async function w4(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let F=await M0("GET","/api/v1/sequences",void 0,x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q}):void 0,S=F.sequences.map((J)=>Q!==void 0?JC(J,{sequenceId:J.id},"sequence",Q):{...J,url:void 0});if(x.json){m0({...F,sequences:S,...w!==void 0&&{appUrls:w.urls}});return}console.log(`Sequences (${F.sequences.length})`);for(let J of S)console.log(`- ${J.name} [${J.id}]`),console.log(` Status: ${jj(J.status,J.enrollmentPaused)}`),console.log(` Trigger: ${J.trigger??"Unknown"}`),console.log(` Sending window: ${KR(J.sendingWindow)}`),console.log(` Created: ${bA(J.createdAt)}`),Wx(" URL",J.url);return}if(A==="create"){if(!x.name)throw new E0("Sequence name is required",400);if(!x.trigger)throw new E0("Sequence trigger is required",400);let F=Hj0(x),Q=await M0("POST","/api/v1/sequences",uA0({...x,...F.goal!==void 0&&{goal:F.goal}}),x.company),w=await zB(x.company),S=Q.sequence?.id??Q.sequenceId,J=w!==void 0&&S!==void 0?OE({companyId:w,sequenceId:S}):void 0;if(x.json){m0({...Q,...Q.sequence!==void 0&&J?.urls.sequence!==void 0&&{sequence:{...Q.sequence,url:J.urls.sequence}},...J!==void 0&&{appUrls:J.urls}});return}if(console.log(`Created sequence: ${Q.sequence?.name??x.name}`),console.log(`ID: ${Q.sequence?.id??"Unknown"}`),Wx("URL",J?.urls.sequence),console.log(`Status: ${jj(Q.sequence?.status,Q.sequence?.enrollmentPaused)}`),Q.sequence?.emailCount!==void 0)console.log(`Emails: ${Q.sequence.emailCount}`);if(Q.sequence?.discountCount!==void 0)console.log(`Discount actions: ${Q.sequence.discountCount}`);if("sendingWindow"in(Q.sequence??{}))console.log(`Sending window: ${KR(Q.sequence?.sendingWindow)}`);if(F.mode==="goal")console.log("Mode: AI-generated");if(Q.message)console.log(Q.message);return}if(!x.id)throw new E0("Sequence ID is required",400);if(A==="update"){if(x.name===void 0&&x.enrollmentMode===void 0&&x.enrollmentFieldPath===void 0&&x.pauseNewEnrollments!==!0&&x.resumeNewEnrollments!==!0&&x.sendingWindowStart===void 0&&x.sendingWindowEnd===void 0&&x.sendingWindowTimezone===void 0&&x.sendingWindowDays===void 0&&x.clearSendingWindow!==!0&&!x.stepsJson&&!x.stepsFile&&!x.emailsJson&&!x.emailsFile&&!x.branchJson&&!x.branchFile&&!x.insertStepsJson&&!x.insertStepsFile&&!x.stopConditionJson&&!x.stopConditionFile)throw new E0("Provide at least one of: --name, --enrollment-mode, --enrollment-field-path, --pause-new-enrollments, --resume-new-enrollments, --sending-window-*, --clear-sending-window, --steps-json, --steps-file, --emails-json, --emails-file, --branch-json, --branch-file, --insert-steps-json, --insert-steps-file, --stop-condition-json, --stop-condition-file",400);let F=await M0("PUT",`/api/v1/sequences/${x.id}`,uA0(x),x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q,sequenceId:x.id}):void 0;if(x.json){m0({...F,...F.sequence!==void 0&&w?.urls.sequence!==void 0&&{sequence:{...F.sequence,url:w.urls.sequence}},...w!==void 0&&{appUrls:w.urls}});return}if(console.log(`Updated sequence: ${F.sequence?.name??x.id}`),console.log(`ID: ${F.sequence?.id??x.id}`),Wx("URL",w?.urls.sequence),console.log(`Status: ${F.sequence?.status??"Unknown"}`),"sendingWindow"in(F.sequence??{}))console.log(`Sending window: ${KR(F.sequence?.sendingWindow)}`);return}if(A==="pause-enrollments"||A==="resume-enrollments"){let F=await M0("POST",`/api/v1/sequences/${x.id}/${A}`,void 0,x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q,sequenceId:x.id}):void 0;if(x.json){m0({...F,...w!==void 0&&{appUrls:w.urls}});return}console.log(F.message??`Updated sequence ${x.id}`),Wx("URL",w?.urls.sequence);return}if(A==="enable"||A==="disable"){let F=await M0("POST",`/api/v1/sequences/${x.id}/${A}`,void 0,x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q,sequenceId:x.id}):void 0;if(x.json){m0({...F,...w!==void 0&&{appUrls:w.urls}});return}console.log(F.message??`${A}d sequence ${x.id}`),Wx("URL",w?.urls.sequence);return}if(A==="enroll"){let F=$j0(x),Q=Gj0(F),w=0,S=0,J=[],M,q;for(let K of Q){let W=await M0("POST",`/api/v1/sequences/${x.id}/enroll`,K,x.company);w+=W.enrolled,S+=W.skipped,J.push(...W.notFound),M??=W.targetNodeId,q??=W.scheduledFor}if(x.json){m0({success:!0,sequenceId:x.id,enrolled:w,skipped:S,notFound:J,...M!==void 0&&{targetNodeId:M},...q!==void 0&&{scheduledFor:q}});return}if(console.log(`Enrolled ${w} subscriber(s) in sequence: ${x.id}`),console.log(`Skipped (already enrolled, inactive, or unavailable): ${S}`),J.length>0){console.log(`Not found: ${J.length}`);for(let K of J.slice(0,10))console.log(`- ${K}`);if(J.length>10)console.log(`...and ${J.length-10} more`)}if(M!==void 0)console.log(`Target node: ${M}`);if(q!==void 0)console.log(`Scheduled for: ${bA(q)}`);return}if(A==="cancel-enrollments"){let F=await M0("POST",`/api/v1/sequences/${x.id}/enrollments/cancel`,Sj0(x),x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q,sequenceId:x.id}):void 0;if(x.json){m0({...F,...w!==void 0&&{appUrls:w.urls}});return}if(console.log(F.message??"Sequence enrollment cancellation done"),console.log(`Matched: ${F.matchedCount}`),console.log(`Cancelled: ${F.cancelledCount}`),console.log(`Dry run: ${F.dryRun?"yes":"no"}`),F.hasMore)console.log("Only the first matching enrollments are shown.");if((F.enrollments?.length??0)>0){console.log("Enrollments:");for(let S of F.enrollments??[])console.log(`- ${S.tokenId} | ${S.subscriberEmail??S.subscriberId} [${S.status}]`)}Wx("URL",w?.urls.sequence);return}if(A==="delete"){let F=await M0("DELETE",`/api/v1/sequences/${x.id}`,void 0,x.company);if(x.json){m0(F);return}console.log(F.message??`Deleted sequence ${x.id}`);return}let E=await M0("GET",`/api/v1/sequences/${x.id}`,void 0,x.company),D=await zB(x.company),B=D!==void 0?OE({companyId:D,sequenceId:x.id}):void 0;if(x.json){m0({...E,...B?.urls.sequence!==void 0&&{sequence:{...E.sequence,url:B.urls.sequence}},...B!==void 0&&{appUrls:B.urls}});return}let g=E.sequence;if(console.log(g.name),console.log(`ID: ${g.id}`),Wx("URL",B?.urls.sequence),console.log(`Status: ${jj(g.status,g.enrollmentPaused)}`),console.log(`Trigger: ${g.trigger??"Unknown"}`),console.log(`Sending window: ${KR(g.sendingWindow)}`),console.log(`Created: ${bA(g.createdAt)}`),console.log(`Enrichment: ${g.enrichmentStatus} (${g.enrichedCount}/${g.emailCount})`),g.emails.length>0){console.log("Emails:");for(let F of g.emails){let Q=F.stepNumber!==null?`Step ${F.stepNumber}`:`Node ${F.nodeId}`;console.log(`- ${Q}`),console.log(` Email ID: ${F.emailId??"None"}`),console.log(` Name: ${F.name??"None"}`),console.log(` Subject: ${F.subject??"None"}`),console.log(` Preview: ${F.previewText??"None"}`),console.log(` Blocks: ${F.blocks.length}`)}}}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}var xF=Rx(u8(),1);var Px=Rx(bi(),1);function Jj0(A){let x=A.stats;return{sent:x.sent,delivered:x.delivered,opened:x.opened,clicked:x.clicked,unsubscribed:x.unsubscribed,openRate:x.openRate,clickRate:x.clickRate,conversions:x.conversions,revenueCents:x.revenueCents,steps:A.steps}}function Pj(A){let x=new URLSearchParams;if(!A.campaign&&!A.sequence)x.set("period",A.period??"7d");if(A.includeBots)x.set("includeMachineEngagement","true");let E=x.toString();return E?`?${E}`:""}function Uj0({options:A}){let[x,E]=xF.useState(!0),[D,B]=xF.useState(""),[g,F]=xF.useState(null);if(xF.useEffect(()=>{async function J(){try{let M;if(A.campaign)M=await M0("GET",`/api/v1/metrics/campaigns/${A.campaign}${Pj(A)}`);else if(A.sequence)M=await M0("GET",`/api/v1/metrics/sequences/${A.sequence}${Pj(A)}`);else M=await M0("GET",`/api/v1/metrics${Pj(A)}`);F(Jj0(M))}catch(M){B(rf(M instanceof E0?M:M))}finally{E(!1)}}J()},[A]),xF.useEffect(()=>{if(!x)setTimeout(()=>process.exit(D?1:0),100)},[x,D]),x)return Px.jsxDEV(VE,{padding:1,children:[Px.jsxDEV(jx,{color:"cyan",children:Px.jsxDEV(RR,{type:"dots"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:" Loading stats..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(D)return Px.jsxDEV(VE,{padding:1,children:Px.jsxDEV(jx,{color:"red",children:[" ",D]},void 0,!0,void 0,this)},void 0,!1,void 0,this);if(!g)return Px.jsxDEV(VE,{padding:1,children:Px.jsxDEV(jx,{dimColor:!0,children:"No stats available"},void 0,!1,void 0,this)},void 0,!1,void 0,this);let Q=A.period??"7d",w=A.campaign?"Campaign Stats":A.sequence?"Sequence Stats":`Stats (${Q})`,S=A.sequence&&g.steps?g.steps.filter((J)=>(J.failedCount??0)>0):[];return Px.jsxDEV(VE,{flexDirection:"column",padding:1,children:[Px.jsxDEV(VE,{marginBottom:1,children:[Px.jsxDEV(jx,{bold:!0,color:"green",children:w},void 0,!1,void 0,this),A.includeBots&&Px.jsxDEV(jx,{dimColor:!0,children:" including bot/scanner engagement"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Px.jsxDEV(VE,{flexDirection:"column",children:[Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Sent: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.sent.toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Delivered: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.delivered.toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Opened: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.opened.toLocaleString()},void 0,!1,void 0,this),Px.jsxDEV(jx,{dimColor:!0,children:[" (",g.openRate.toFixed(1),"%)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Clicked: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.clicked.toLocaleString()},void 0,!1,void 0,this),Px.jsxDEV(jx,{dimColor:!0,children:[" (",g.clickRate.toFixed(1),"%)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Unsubscribed: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.unsubscribed.toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),g.conversions!==void 0&&Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Conversions: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:g.conversions.toLocaleString()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),g.revenueCents!==void 0&&Px.jsxDEV(VE,{children:[Px.jsxDEV(jx,{dimColor:!0,children:"Revenue: "},void 0,!1,void 0,this),Px.jsxDEV(jx,{children:["$",(g.revenueCents/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),S.length>0&&Px.jsxDEV(VE,{flexDirection:"column",marginTop:1,children:[Px.jsxDEV(VE,{marginBottom:1,children:Px.jsxDEV(jx,{bold:!0,children:"Step Failures"},void 0,!1,void 0,this)},void 0,!1,void 0,this),S.map((J)=>Px.jsxDEV(VE,{flexDirection:"column",marginBottom:1,children:[Px.jsxDEV(jx,{children:["Step ",J.step,": ",J.subject??J.nodeId," (",J.failedCount," failed",")"]},void 0,!0,void 0,this),(J.failedSubscribers??[]).map((M)=>Px.jsxDEV(VE,{marginLeft:2,children:Px.jsxDEV(jx,{children:["- ",M.email??M.subscriberId,":"," ",M.failedReason??"Reason unavailable"]},void 0,!0,void 0,this)},`${J.nodeId}-${M.subscriberId}`,!1,void 0,this)),(J.failedCount??0)>(J.failedSubscribers?.length??0)&&Px.jsxDEV(VE,{marginLeft:2,children:Px.jsxDEV(jx,{dimColor:!0,children:["Showing first ",J.failedSubscribers?.length??0," of"," ",J.failedCount," failed subscribers"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},J.nodeId,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}async function XA0(A){if(!await Ix())RA(Sx()),process.exit(1);await ki(Px.jsxDEV(Uj0,{options:A},void 0,!1,void 0,this)).waitUntilExit()}function vj(A){if(!A)return[];return Array.isArray(A)?A:[A]}function WA0(A){if(!A)return[];return Array.isArray(A)?A:[A]}function qR(A){let x={};for(let E of A??[]){let[D,...B]=E.split("="),g=B.join("=");if(D&&g)x[D]=g}return Object.keys(x).length>0?x:void 0}function Rj0(A){let x=A.email?.trim()||void 0,E=A.externalId?.trim()||void 0;return{...x?{email:x}:{},...E?{externalId:E}:{}}}function hi(A){let x=Rj0(A);if(!x.email&&!x.externalId)throw Error("Provide an email or --external-id.");return x}function Vj(A,x){let E=new URLSearchParams;if(x?.includeBots)E.set("includeMachineEngagement","true");let D=E.toString(),B=D?`?${D}`:"";if(A.email)return`/api/v1/subscribers/${encodeURIComponent(A.email)}${B}`;return E.set("externalId",String(A.externalId)),`/api/v1/subscribers/external?${E.toString()}`}function Kj0(A){let x=new URLSearchParams;if(A.segment)x.set("segmentId",A.segment);let E=vj(A.tag);if(E.length>0)x.set("tags",E.join(","));let D=WA0(A.list);if(D.length>0&&D[0])x.set("list",D[0]);return x.set("page",String(A.page)),x.set("limit",String(A.pageSize)),x}async function qj0(A){let x=M8(A.limit,"--limit"),E=Math.min(100,Math.max(1,x??100)),D=[],B=1,g=0,F=0,Q=0;while(!0){let S=Kj0({segment:A.segment,tag:A.tag,list:A.list,page:B,pageSize:E}),J=await M0("GET",`/api/v1/subscribers?${S.toString()}`,void 0,A.company);g=J.pagination?.total??J.subscribers.length,F=J.pagination?.totalPages??1,Q+=1,D.push(...J.subscribers??[]);let M=x!==void 0&&D.length>=x,q=J.pagination?B>=J.pagination.totalPages:(J.subscribers??[]).length<E;if(M||q)break;B+=1}let w=x!==void 0?D.slice(0,x):D;return{success:!0,subscribers:w,pagination:{page:1,limit:E,total:g,totalPages:F,fetchedPages:Q},returned:w.length,truncated:x!==void 0&&g>0&&w.length<g}}function ZA0(A){let x=[A.firstName,A.lastName].map((E)=>E?.trim()).filter((E)=>!!E);return x.length>0?x.join(" "):null}function Mj0(A){let x=A.machine===!0?` [bot:${A.engagementQuality??"machine"}]`:"",E=`${bA(A.eventTime)} ${A.eventType}${x}`;if(A.eventType==="custom"){let D=A.eventName??"unknown",B=A.properties&&Object.keys(A.properties).length>0?` ${JSON.stringify(A.properties)}`:"";return`${E} ${D}${B}`}if(A.clickedUrl)return`${E} ${A.clickedUrl}`;if(A.bounceType)return`${E} ${A.bounceType}`;if(A.campaignId)return`${E} campaign:${A.campaignId}`;return E}function Yj0(A){if(A.subscribers.length===0){console.log("No subscribers found");return}console.log(`Subscribers (${A.returned})`),console.log(A.truncated?`Showing ${A.returned} of ${A.pagination.total} matching subscribers.`:`Fetched ${A.returned} matching subscribers across ${A.pagination.fetchedPages} page(s).`);for(let x of A.subscribers){if(console.log(`- ${x.email} [${x.status}]`),x.externalId)console.log(` External ID: ${x.externalId}`);let E=ZA0(x);if(E)console.log(` Name: ${E}`);if(x.tags.length>0)console.log(` Tags: ${x.tags.join(", ")}`);if(x.emailProvider)console.log(` Email provider: ${x.emailProvider}`);console.log(` Created: ${bA(x.createdAt)}`)}}function uj0(A){if(console.log(`Subscriber: ${A.email}`),console.log(`Status: ${A.status}`),A.externalId)console.log(`External ID: ${A.externalId}`);let x=ZA0(A);if(x)console.log(`Name: ${x}`);if(console.log(`ID: ${A.id}`),console.log(`Created: ${bA(A.createdAt)}`),console.log(`Updated: ${bA(A.updatedAt)}`),console.log(`Email provider: ${A.emailProvider??"None"}`),console.log(`Tags: ${A.tags.length>0?A.tags.join(", "):"None"}`),console.log("Lists:"),(A.lists?.length??0)===0)console.log(" None");else for(let E of A.lists??[])console.log(` - ${E.name}${E.unsubscribedAt?" [inactive]":" [active]"}`),console.log(` Joined: ${bA(E.subscribedAt)}${E.unsubscribedAt?` | Unsubscribed: ${bA(E.unsubscribedAt)}`:""}`);if(console.log("Sequence Enrollments:"),(A.sequenceEnrollments?.length??0)===0)console.log(" None");else for(let E of A.sequenceEnrollments??[])if(console.log(` - ${E.sequenceName} [${E.enrollmentStatus}]`),console.log(` Sequence ID: ${E.sequenceId} | Status: ${E.sequenceStatus}`),console.log(` Current node: ${E.currentNodeLabel??E.currentNodeType??"Unknown"}`),console.log(` Entered: ${bA(E.enteredAt)} | Updated: ${bA(E.updatedAt)}`),E.scheduledFor)console.log(` Scheduled: ${bA(E.scheduledFor)}`);if(console.log("Email Stats:"),!A.emailStats)console.log(" None");else console.log(` Sent ${A.emailStats.sent}, delivered ${A.emailStats.delivered}, opened ${A.emailStats.opened}, clicked ${A.emailStats.clicked}, bounced ${A.emailStats.bounced}, unsubscribed ${A.emailStats.unsubscribed}, complained ${A.emailStats.complained}`);if(console.log("Recent Activity:"),(A.activity?.length??0)===0)console.log(" None");else for(let E of A.activity??[])console.log(` - ${Mj0(E)}`);if(console.log("Custom Attributes:"),!A.customAttributes||Object.keys(A.customAttributes).length===0)console.log(" None");else console.log(JSON.stringify(A.customAttributes,null,2))}async function Xj0(A){let x=await qj0(A);if(A.json){m0(x);return}Yj0(x)}async function Wj0(A){let x=hi(A),E=WA0(A.list),D=await M0("POST","/api/v1/subscribers",{...x,firstName:A.firstName,lastName:A.lastName,tags:vj(A.tag),...A.noLists?{lists:[]}:E.length>0?{lists:E}:{},...A.skipSequences?{enrollInSequences:!1}:{},customAttributes:qR(A.attr)},A.company);if(A.json){m0(D);return}console.log(`Added subscriber: ${x.email??`external:${x.externalId}`}`)}async function Zj0(A){let x=hi(A),E=vj(A.tag),D=qR(A.attr);if(!(A.status!==void 0||E.length>0||D!==void 0))throw Error("Provide at least one of --status, --tag, or --attr.");let g=await M0("PATCH",Vj(x),{...A.status!==void 0&&{status:A.status},...E.length>0&&{tags:E},...D!==void 0&&{customAttributes:D}},A.company);if(A.json){m0(g);return}console.log(`Updated subscriber: ${x.email??`external:${x.externalId}`}`)}async function Lj0(A){let x=hi(A),E=await M0("GET",Vj(x,{includeBots:A.includeBots}),void 0,A.company);if(A.json){m0(E);return}uj0(E.subscriber)}async function zj0(A){let x=hi(A),E=Vj(x),D=x.email??`external:${x.externalId}`;if(A.hard){let g=await M0("DELETE",E,void 0,A.company);if(A.json){m0(g);return}console.log(`Deleted subscriber: ${D}`);return}let B=await M0("PATCH",E,{status:"unsubscribed"},A.company);if(A.json){m0(B);return}console.log(`Unsubscribed: ${D}`)}async function Oj0(A){let x=hi(A),E=A.name?.trim();if(!E)throw Error("--name is required.");let D=await M0("POST","/api/v1/subscribers/events",{...x,event:E,properties:qR(A.property),customAttributes:qR(A.attr)},A.company);if(A.json){m0(D);return}console.log(`Triggered event: ${E} for ${x.email??`external:${x.externalId}`}`)}async function EF(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{switch(A){case"list":await Xj0(x);return;case"add":await Wj0(x);return;case"update":await Zj0(x);return;case"get":await Lj0(x);return;case"event":await Oj0(x);return;case"remove":await zj0(x);return}}catch(E){let D=E instanceof E0?E:new E0(E instanceof Error?E.message:"Unknown error",500);RA(D),process.exit(1)}}function Nj0(A){let x=A.isSystem?" [system]":"";console.log(`- ${A.name} [${A.id}]${x}`),console.log(` Color: ${A.color??"Default"}`)}function jj0(A){if(!A.name||A.name.trim()==="")throw new E0("Tag name is required",400);return{name:A.name,...A.color!==void 0&&{color:A.color}}}async function $3(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let D=await M0("GET","/api/v1/tags",void 0,x.company);if(x.json){m0(D);return}console.log(`Tags (${D.tags.length})`);for(let B of D.tags)Nj0(B);return}if(A==="create"){let D=jj0(x),B=await M0("POST","/api/v1/tags",D,x.company);if(x.json){m0(B);return}if(console.log(`Created tag: ${B.tag?.name??D.name}`),B.tag)console.log(`ID: ${B.tag.id}`),console.log(`Color: ${B.tag.color??"Default"}`);return}if(!x.tagId)throw new E0("Tag ID is required",400);if(A==="update"){if(!x.color||x.color.trim()==="")throw new E0("--color is required",400);let D=await M0("PATCH",`/api/v1/tags/${encodeURIComponent(x.tagId)}`,{color:x.color},x.company);if(x.json){m0(D);return}if(console.log(`Updated tag: ${D.tag?.name??x.tagId}`),D.tag)console.log(`ID: ${D.tag.id}`),console.log(`Color: ${D.tag.color??"Default"}`);return}if(!await q6(`Delete tag ${x.tagId}? It will be removed from all subscribers.`,x)){console.log("Aborted.");return}let E=await M0("DELETE",`/api/v1/tags/${encodeURIComponent(x.tagId)}`,void 0,x.company);if(x.json){m0(E);return}console.log(`Deleted tag: ${x.tagId}`)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}var Pj0=new Set(["admin","viewer"]);function vj0(A){if(!A.email||A.email.trim()==="")throw new E0("Email is required",400);if(!A.role||!Pj0.has(A.role))throw new E0("--role must be admin or viewer",400);return{email:A.email.trim(),role:A.role,...A.billingAccess===!0&&{canManageBilling:!0}}}function Vj0(A){let x=A.user.name?`${A.user.name} <${A.user.email}>`:A.user.email;if(console.log(`- ${x} [${A.id}]`),console.log(` Kind: ${A.kind}`),console.log(` Role: ${A.role}`),console.log(` Status: ${A.status}`),console.log(` Billing access: ${A.canManageBilling?"yes":"no"}`),A.invitedAt)console.log(` Invited: ${bA(A.invitedAt)}`);if(A.expiresAt)console.log(` Expires: ${bA(A.expiresAt)}`);if(A.invitedBy)console.log(` Invited by: ${A.invitedBy.name??A.invitedBy.email}`)}async function MR(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let D=await M0("GET","/api/v1/team",void 0,x.company);if(x.json){m0(D);return}console.log(`Team members (${D.members.length})`);for(let B of D.members)Vj0(B);return}if(A==="invite"){let D=vj0(x),B=await M0("POST","/api/v1/team/invitations",D,x.company);if(x.json){m0(B);return}if(B.invitation){console.log(`Invitation sent to ${B.invitation.email}`),console.log(`ID: ${B.invitation.id}`),console.log(`Role: ${B.invitation.role}`),console.log(`Billing access: ${B.invitation.canManageBilling?"yes":"no"}`),console.log(`Status: ${B.invitation.status}`),console.log(`Expires: ${bA(B.invitation.expiresAt)}`);return}console.log(`Added team member: ${B.member?.email??D.email}`),console.log(`Role: ${B.member?.role??D.role}`),console.log(`Billing access: ${B.member?.canManageBilling?"yes":"no"}`);return}if(!x.invitationId)throw new E0("Invitation ID is required",400);if(!await q6(`Cancel invitation ${x.invitationId}?`,x)){console.log("Aborted.");return}let E=await M0("DELETE",`/api/v1/team/invitations/${encodeURIComponent(x.invitationId)}`,void 0,x.company);if(x.json){m0(E);return}console.log(`Cancelled invitation: ${x.invitationId}`)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}function LA0(A){if(A.length===0)return"none";return A.map((x)=>`${x.locale}:${x.status}`).join(", ")}function YR(A){return A&&A.length>0?A.join(", "):"None"}function nj0(A,x){if(A.name===void 0&&A.subject===void 0&&A.label===void 0&&x.html===void 0&&x.blocks===void 0)throw new E0("Provide at least one of: --name, --subject, --label, --html, --html-file, --blocks-json, --blocks-file",400);return{name:A.name,subject:A.subject,html:x.html,blocks:x.blocks,labels:A.label}}async function G3(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let F=new URLSearchParams;if(x.label)for(let J of x.label)F.append("label",J);let Q=await M0("GET",`/api/v1/templates${F.size>0?`?${F.toString()}`:""}`,void 0,x.company),w=OE({companyId:Q.companyId}),S=Q.templates.map((J)=>JC(J,{emailId:J.id},"email",Q.companyId));if(x.json){m0({...Q,templates:S,appUrls:w.urls});return}if(console.log(`Templates (${Q.templates.length})`),Q.emailLocalizationConfig)console.log(`Primary locale: ${Q.emailLocalizationConfig.primaryLocale}`);for(let J of S)console.log(`- ${J.name} [${J.id}]`),console.log(` Subject: ${J.subject}`),console.log(` Labels: ${YR(J.labels)}`),Wx(" URL",J.url),console.log(` Localizations: ${LA0(J.localizations)}`);return}let E=FQ({html:x.html,htmlFile:x.htmlFile,blocksJson:x.blocksJson,blocksFile:x.blocksFile,...A==="create"?{required:!0,requiredMessage:"Provide either --html/--html-file or --blocks-json/--blocks-file"}:{}});if(A==="create"){if(!x.name)throw new E0("Template name is required",400);if(!x.subject)throw new E0("Template subject is required",400);let F=await M0("POST","/api/v1/templates",{name:x.name,subject:x.subject,html:E.html,blocks:E.blocks,labels:x.label},x.company),Q=await zB(x.company),w=F.template?.id??F.templateId,S=Q!==void 0&&w!==void 0?OE({companyId:Q,emailId:w}):void 0;if(x.json){m0({...F,...F.template!==void 0&&S?.urls.email!==void 0&&{template:{...F.template,url:S.urls.email}},...S!==void 0&&{appUrls:S.urls}});return}console.log(`Created template: ${F.template?.name??x.name}`),console.log(`ID: ${F.template?.id??"Unknown"}`),Wx("URL",S?.urls.email),console.log(`Labels: ${YR(F.template?.labels)}`),console.log(`Subject: ${F.template?.subject??x.subject??"Unknown"}`);return}if(!x.id)throw new E0("Template ID is required",400);if(A==="update"){let F=await M0("PUT",`/api/v1/templates/${x.id}`,nj0(x,E),x.company),Q=await zB(x.company),w=Q!==void 0?OE({companyId:Q,emailId:x.id}):void 0;if(x.json){m0({...F,...F.template!==void 0&&w?.urls.email!==void 0&&{template:{...F.template,url:w.urls.email}},...w!==void 0&&{appUrls:w.urls}});return}console.log(`Updated template: ${F.template?.name??x.id}`),console.log(`ID: ${F.template?.id??x.id}`),Wx("URL",w?.urls.email),console.log(`Labels: ${YR(F.template?.labels)}`),console.log(`Subject: ${F.template?.subject??"Unchanged"}`);return}if(A==="delete"){let F=await M0("DELETE",`/api/v1/templates/${x.id}`,void 0,x.company);if(x.json){m0(F);return}console.log(F.message??`Deleted template: ${x.id}`);return}let D=await M0("GET",`/api/v1/templates/${x.id}`,void 0,x.company),B=OE({companyId:D.template.companyId,emailId:x.id});if(x.json){m0({...D,template:{...D.template,url:B.urls.email},appUrls:B.urls});return}let g=D.template;console.log(g.name),console.log(`ID: ${g.id}`),console.log(`Company: ${g.companyId}`),Wx("URL",B.urls.email),console.log(`Subject: ${g.subject}`),console.log(`Labels: ${YR(g.labels)}`),console.log(`Preview: ${g.previewText??"None"}`),console.log(`Blocks: ${g.blocks.length}`),console.log(`Font: ${g.fontFamily??"Default"}`),console.log(`Created: ${bA(g.createdAt)}`),console.log(`Updated: ${bA(g.updatedAt)}`),console.log(`Localizations: ${LA0(g.localizations)}`);for(let F of g.localizations){let Q=F.lastError?` | error: ${F.lastError}`:"";console.log(`- ${F.locale} [${F.status}] blocks=${F.blocks.length}${Q}`)}}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}async function nj(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let B=await M0("GET","/api/v1/transactional",void 0,x.company);if(x.json){m0(B);return}console.log(`Transactional templates (${B.transactional.length})`);for(let g of B.transactional)console.log(`- ${g.name} [${g.slug}] ${g.enabled?"enabled":"disabled"}`);return}if(!x.slug)throw new E0("Transactional template slug is required",400);let E=await M0("GET",`/api/v1/transactional/${encodeURIComponent(x.slug)}`,void 0,x.company);if(x.json){m0(E);return}let D=E.transactional;if(console.log(D.name),console.log(`ID: ${D.id}`),console.log(`Slug: ${D.slug}`),console.log(`Enabled: ${D.enabled?"yes":"no"}`),D.subject)console.log(`Subject: ${D.subject}`);if((D.variables?.length??0)>0)console.log(`Variables: ${D.variables?.join(", ")}`)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}function NA0(A){if(A===void 0||A.length===0)return;let x=new Set(UN);for(let E of A)if(!x.has(E))throw new E0(`Invalid --event value '${E}'. Valid events: ${UN.join(", ")}`,400);return A}function mj0(A){if(!A.name||A.name.trim()==="")throw new E0("--name is required",400);if(!A.url||A.url.trim()==="")throw new E0("--url is required",400);let x=NA0(A.event);return{name:A.name,url:A.url,...x!==void 0&&{events:x}}}function Tj0(A){if(A.enable===!0&&A.disable===!0)throw new E0("Use either --enable or --disable, not both",400);let x=NA0(A.event),E=A.enable===!0?"enabled":A.disable===!0?"disabled":void 0,D={...A.name!==void 0&&{name:A.name},...A.url!==void 0&&{url:A.url},...x!==void 0&&{events:x},...E!==void 0&&{status:E}};if(Object.keys(D).length===0)throw new E0("Provide at least one of: --name, --url, --event, --enable, --disable",400);return D}function zA0(A){if(console.log(`- ${A.name} [${A.id}]`),console.log(` URL: ${A.url}`),console.log(` Status: ${A.status}`),console.log(` Events: ${A.events.join(", ")||"None"}`),A.consecutiveFailures>0)console.log(` Consecutive failures: ${A.consecutiveFailures}`);if(A.lastSuccessAt)console.log(` Last success: ${bA(A.lastSuccessAt)}`);if(A.lastFailureAt)console.log(` Last failure: ${bA(A.lastFailureAt)}`);console.log(` Created: ${bA(A.createdAt)}`)}function OA0(A){if(console.log(`- ${A.id} [${A.status}]`),console.log(` Event: ${A.eventType} (${A.eventId})`),console.log(` Attempts: ${A.attempts}`),A.lastStatusCode!==null)console.log(` Last status code: ${A.lastStatusCode}`);if(A.lastError)console.log(` Last error: ${A.lastError}`);if(A.lastAttemptAt)console.log(` Last attempt: ${bA(A.lastAttemptAt)}`);if(A.nextAttemptAt)console.log(` Next attempt: ${bA(A.nextAttemptAt)}`);console.log(` Created: ${bA(A.createdAt)}`)}async function _1(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let B=await M0("GET","/api/v1/webhooks",void 0,x.company);if(x.json){m0(B);return}console.log(`Webhooks (${B.webhooks.length})`);for(let g of B.webhooks)zA0(g);return}if(A==="create"){let B=await M0("POST","/api/v1/webhooks",mj0(x),x.company);if(x.json){m0(B);return}let g=B.webhook;console.log(`Created webhook: ${g?.name??x.name}`),console.log(`ID: ${g?.id??"Unknown"}`),console.log(`URL: ${g?.url??x.url}`),console.log(`Status: ${g?.status??"enabled"}`),console.log(`Events: ${g?.events.join(", ")??"None"}`),console.log(""),console.log("Signing secret (shown only once - store it somewhere safe now):"),console.log(` ${g?.signingSecret??"Unavailable"}`);return}if(!x.id)throw new E0("Webhook ID is required",400);let E=`/api/v1/webhooks/${encodeURIComponent(x.id)}`;if(A==="update"){let B=await M0("PATCH",E,Tj0(x),x.company);if(x.json){m0(B);return}if(console.log(`Updated webhook: ${B.webhook?.name??x.id}`),B.webhook)zA0(B.webhook);return}if(A==="delete"){if(!await q6(`Permanently delete webhook ${x.id} and its delivery history?`,x)){console.log("Aborted.");return}let B=await M0("DELETE",E,void 0,x.company);if(x.json){m0(B);return}console.log(`Deleted webhook: ${x.id}`);return}if(A==="test"){let B=await M0("POST",`${E}/test`,void 0,x.company);if(x.json){m0(B);return}console.log(`Queued test event for webhook: ${x.id}`),console.log(`Event ID: ${B.eventId}`),console.log(`Queued deliveries: ${B.queuedDeliveries}`);return}if(A==="deliveries"){let B=M8(x.limit,"--limit");if(B!==void 0&&(B<1||B>100))throw new E0("--limit must be an integer between 1 and 100",400);let g=await M0("GET",`${E}/deliveries${B!==void 0?`?limit=${B}`:""}`,void 0,x.company);if(x.json){m0(g);return}console.log(`Deliveries (${g.deliveries.length})`);for(let F of g.deliveries)OA0(F);return}if(!x.deliveryId)throw new E0("Delivery ID is required",400);let D=await M0("POST",`${E}/deliveries/${encodeURIComponent(x.deliveryId)}/replay`,void 0,x.company);if(x.json){m0(D);return}console.log(`Replay queued for delivery: ${x.deliveryId}`),OA0(D.delivery)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}async function li(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="list"){let F=await M0("GET","/api/v1/websites",void 0,x.company);if(x.json){m0(F);return}console.log(`Websites (${F.websites.length})`);for(let Q of F.websites)console.log(`- ${Q.domain}`),console.log(` Status: ${Q.status}`),console.log(` Created: ${bA(Q.createdAt)}`);return}if(A==="guide"){let F=await M0("POST","/api/v1/integration-guide",{framework:x.framework,use_case:x.useCase});if(x.json){m0(F);return}if(console.log(`Integration guide: ${F.framework} / ${F.use_case}`),console.log(""),console.log(F.code),F.tip)console.log(""),console.log(`Tip: ${F.tip}`);return}if(!x.domain)throw new E0("Domain is required",400);let E=A==="add"?"POST":"GET",D=A==="add"?"/api/v1/websites":`/api/v1/websites/${encodeURIComponent(x.domain)}`,B=A==="add"?{domain:x.domain}:void 0,g=await M0(E,D,B,x.company);if(x.json){m0(g);return}if(console.log(g.website.domain),console.log(`Status: ${g.website.status}`),g.website.createdAt)console.log(`Created: ${bA(g.website.createdAt)}`);if(g.website.message)console.log(g.website.message);if(g.website.dnsRecords!==void 0)console.log("DNS Records:"),m0(g.website.dnsRecords)}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}async function jA0(){if(!await Ix()){RA(Sx());return}let A=AH();console.log(`Email: ${A.userEmail??"Unknown"}`),console.log(`User ID: ${A.userId??"Unknown"}`),console.log(""),console.log("Your API key can access all companies you belong to."),console.log("Use `sequenzy account` to see available companies.")}async function PA0(A,x){if(!await Ix())RA(Sx()),process.exit(1);try{if(A==="preferences-token"){if(!x.email)throw new E0("Email is required",400);let E=await M0("POST","/api/v1/widgets/preferences/token",{email:x.email},x.company);if(x.json){m0(E);return}console.log(E.token)}}catch(E){RA(E instanceof E0?E:E),process.exit(1)}}function vA0(A,x){if(x.length===0)return"";return`
|
|
412
412
|
${A}:
|
|
413
413
|
${x.map((E)=>` ${E}`).join(`
|
|
414
414
|
`)}
|
|
@@ -429,4 +429,4 @@ ${VA0}Quick Start${D6}
|
|
|
429
429
|
${e7}$${D6} sequenzy websites guide --framework nextjs --use-case transactional`,F=`
|
|
430
430
|
${VA0}Notes${D6}
|
|
431
431
|
${e7}Generated content should be reviewed before sending.${D6}
|
|
432
|
-
${e7}Use 'sequenzy --help' and '<command> --help' for detailed examples and caveats.${D6}`;console.log(E),console.log(D),console.log(),console.log(B),console.log(g),console.log(F),console.log()}var B8=new Mv;B8.name("sequenzy").description("Sequenzy CLI - Email marketing from the terminal").version(nA0).showHelpAfterError().showSuggestionAfterError().action(cj0);Y0(B8,{notes:["Use --json on data commands when another tool or agent should parse structured output.","Dashboard-aware JSON responses include appUrls when a company ID can be resolved.","Company-scoped commands accept --company for personal API keys that can access multiple companies.","Content commands prefer file flags such as --html-file, --blocks-file, --steps-file, and --emails-file to avoid shell escaping issues.","Sequence creation supports --goal for AI generation or explicit step JSON."],examples:['sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy campaigns update camp_123 --subject "Updated subject" --html-file ./campaign.html',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy urls --company comp_123 --sequence seq_123 --settings-tab integrations","sequenzy websites guide --framework nextjs --use-case transactional",'sequenzy api-keys create --name "CI deploy key" --company comp_123']});var rj0=B8.command("login").description("Log in to your Sequenzy account").action(v_);Y0(rj0,{notes:["Starts device authentication and prints a verification URL plus approval code."],examples:["sequenzy login"]});var aj0=B8.command("logout").description("Log out of your Sequenzy account").action(V_);Y0(aj0,{examples:["sequenzy logout"]});var pj0=B8.command("whoami").description("Show the locally stored Sequenzy identity").action(jA0);Y0(pj0,{notes:["This confirms local CLI auth state. Use 'sequenzy account' when you need company access details too."],examples:["sequenzy whoami"]});var dj0=B8.command("stats").description("Show account, campaign, or sequence metrics").option("-p, --period <period>","Time period (7d, 30d, 90d)","7d").option("--campaign <id>","Get stats for a specific campaign").option("--sequence <id>","Get stats for a specific sequence").option("--include-bots","Include machine-classified bot/scanner opens and clicks").action(XA0);Y0(dj0,{notes:["Use exactly one of: account-level period, --campaign, or --sequence.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement.","Sequence stats include per-step failures when the API reports them."],examples:["sequenzy stats","sequenzy stats --period 30d","sequenzy stats --campaign camp_123","sequenzy stats --campaign camp_123 --include-bots","sequenzy stats --sequence seq_123"]});var oj0=B8.command("urls").description("Generate Sequenzy dashboard URLs for known resource IDs").option("-c, --company <id>","Company ID").option("--campaign <id>","Campaign ID for campaign editor URL").option("--landing-page <id>","Landing page ID for landing page editor URL").option("--sequence <id>","Sequence ID for sequence editor URL").option("--template <id>","Template/email ID for email editor URL").option("--email <id>","Email ID for email editor URL").option("--transactional <id>","Transactional email ID").option("--email-send <id>","Email send ID").option("--domain <id>","Sending domain ID").option("--status <status>","Status for campaign/sequence list URLs").option("--settings-tab <tab>","Settings tab slug, e.g. integrations").option("--json","Print JSON").action(Sl);Y0(oj0,{notes:["Uses SEQUENZY_APP_URL when set, otherwise https://sequenzy.com.","If --company is omitted, the CLI tries the current company from `sequenzy account`.","Useful after creating a campaign or sequence when the user wants a review/edit link."],examples:["sequenzy urls --company comp_123","sequenzy urls --company comp_123 --sequence seq_123","sequenzy urls --company comp_123 --campaign camp_123","sequenzy urls --company comp_123 --landing-page lp_123","sequenzy urls --company comp_123 --email-send send_123","sequenzy urls --company comp_123 --settings-tab integrations","sequenzy urls --company comp_123 --json"]});var s1=B8.command("subscribers").description("Manage subscribers").action(()=>s1.help());Y0(s1,{notes:["Subscriber list fetches every page by default so agents do not silently miss later results.","`subscribers get` includes tags, list memberships, sequence enrollments, email stats, and recent activity.","--attr expects repeated key=value pairs. Example: --attr firstName=Ana --attr plan=pro"],examples:["sequenzy subscribers list --tag vip",'sequenzy subscribers list --list "Master List" --json',"sequenzy subscribers list --tag vip --limit 25 --json","sequenzy subscribers add user@example.com --tag trial --attr firstName=Ana","sequenzy subscribers get user@example.com --json","sequenzy subscribers remove user@example.com --hard"]});var tj0=s1.command("list").description("List subscribers").option("-s, --segment <id>","Filter by segment").option("-t, --tag <tag>","Filter by tag").option("--list <id-or-name>","Filter by subscriber list ID or exact name").option("-l, --limit <number>","Maximum results to return").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>EF("list",A));Y0(tj0,{examples:["sequenzy subscribers list",'sequenzy subscribers list --list "Master List"',"sequenzy subscribers list --segment seg_123","sequenzy subscribers list --tag onboarding --limit 100"]});var _j0=s1.command("add [email]").description("Add or upsert a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--first-name <name>","Subscriber first name").option("--last-name <name>","Subscriber last name").option("-t, --tag <tags...>","Tags to apply").option("-l, --list <ids...>","List IDs to add the subscriber to").option("--no-lists","Add the subscriber to no lists").option("--skip-sequences","Do not enroll the subscriber in matching sequences").option("-a, --attr <attrs...>","Attributes (key=value)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>EF("add",{email:A,...x,noLists:x.lists===!1}));Y0(_j0,{examples:["sequenzy subscribers add user@example.com","sequenzy subscribers add user@example.com --first-name Ana --tag trial --attr plan=pro","sequenzy subscribers add user@example.com --list list_123","sequenzy subscribers add user@example.com --skip-sequences"]});var sj0=s1.command("get [email]").description("Get subscriber details").option("--external-id <id>","Customer-owned subscriber ID").option("--include-bots","Include machine-classified bot/scanner opens and clicks in stats/activity").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>EF("get",{email:A,...x}));Y0(sj0,{notes:["Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy subscribers get user@example.com","sequenzy subscribers get user@example.com --include-bots"]});var ej0=s1.command("update [email]").description("Update subscriber status, tags, or custom attributes").option("--external-id <id>","Customer-owned subscriber ID").option("--status <status>","Subscriber status").option("-t, --tag <tags...>","Replacement tags").option("-a, --attr <attrs...>","Attributes (key=value)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>EF("update",{email:A,...x}));Y0(ej0,{examples:["sequenzy subscribers update user@example.com --status unsubscribed","sequenzy subscribers update user@example.com --tag churned --attr cancelReason=too_expensive"]});var AP0=s1.command("event [email]").description("Trigger an event for a subscriber").option("--external-id <id>","Customer-owned subscriber ID").requiredOption("-n, --name <event>","Event name").option("-p, --property <properties...>","Event properties (key=value)").option("-a, --attr <attrs...>","Subscriber attributes (key=value)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>EF("event",{email:A,...x}));Y0(AP0,{examples:["sequenzy subscribers event user@example.com --name saas.purchase","sequenzy subscribers event user@example.com --name saas.purchase --property plan=pro --property amount=99"]});var xP0=s1.command("remove [email]").description("Unsubscribe or permanently delete a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--hard","Permanently delete (not just unsubscribe)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>EF("remove",{email:A,...x}));Y0(xP0,{examples:["sequenzy subscribers remove user@example.com","sequenzy subscribers remove user@example.com --hard"]});var uR=B8.command("transactional").description("Inspect transactional email templates").action(()=>uR.help());Y0(uR,{notes:["Use the top-level `sequenzy send` command to send email."],examples:["sequenzy transactional list","sequenzy transactional get welcome","sequenzy send user@example.com --template welcome --var firstName=Ana"]});var EP0=uR.command("list").description("List transactional templates").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>nj("list",A));Y0(EP0,{examples:["sequenzy transactional list --company comp_123"]});var BP0=uR.command("get <slug>").description("Get transactional template details by slug").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>nj("get",{slug:A,...x}));Y0(BP0,{examples:["sequenzy transactional get welcome"]});var mj=B8.command("widgets").description("Widget helper commands").action(()=>mj.help());Y0(mj,{examples:["sequenzy widgets preferences-token user@example.com"]});var DP0=mj.command("preferences-token <email>").description("Generate a subscription preferences iframe token").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>PA0("preferences-token",{email:A,...x}));Y0(DP0,{examples:["sequenzy widgets preferences-token user@example.com"]});var Tj=B8.command("email-sends").alias("emailsends").description("Inspect sent email snapshots and delivery events").action(()=>Tj.help());Y0(Tj,{notes:["Email send rows are short-lived; if the row was cleaned up, this falls back to retained ClickHouse events.","Use --html to print the stored HTML body when it is still available."],examples:["sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --json"]});var gP0=Tj.command("get <emailSendId>").description("Get an email send by ID").option("-c, --company <id>","Company ID override for personal API keys").option("--html","Print the full stored HTML body in text output").option("--html-only","Print only the stored HTML body").option("--json","Print raw JSON").action((A,x)=>X_("get",{id:A,...x}));Y0(gP0,{examples:["sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --company comp_123 --json"]});var CP0=B8.command("send <email>").description("Send a transactional email").option("-t, --template <slug>","Transactional template slug to use").option("-s, --subject <subject>","Email subject").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--vars-json <json>","Variables as a JSON object, including nested arrays for repeat blocks").option("-v, --var <vars...>","Variables (key=value)").action(KA0);Y0(CP0,{notes:["Use either --template or --html/--html-file.","--subject is required when sending raw HTML.","--vars-json accepts nested objects and arrays; --var overrides individual scalar keys."],examples:["sequenzy send user@example.com --template welcome --var firstName=Ana",`sequenzy send user@example.com --template welcome --vars-json '{"event":{"items":[{"title":"Plan","description":"Pro"}]}}'`,'sequenzy send user@example.com --subject "Welcome" --html-file ./welcome.html']});var Z5=B8.command("campaigns").description("Manage campaigns").action(()=>Z5.help());Y0(Z5,{notes:["Campaign creation supports HTML, Sequenzy blocks, or prompt-generated content.","Campaign updates support HTML, Sequenzy blocks, subject, name, labels, and reply-to changes.","Campaign scheduling requires a future ISO timestamp and a verified sending domain.","Use cancel to stop a scheduled or sending campaign, and pause/resume to control an active send."],examples:["sequenzy campaigns list --status draft --company comp_123",'sequenzy campaigns create "April Launch" --subject "We shipped" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"',"sequenzy campaigns test camp_123 --to you@example.com","sequenzy campaigns cancel camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test"]});var FP0=Z5.command("list").description("List campaigns").option("-s, --status <status>","Filter by status").option("--label <labels...>","Filter by label name").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>B4("list",A));Y0(FP0,{examples:["sequenzy campaigns list","sequenzy campaigns list --status draft --company comp_123","sequenzy campaigns list --label edm"]});var IP0=Z5.command("get <id>").description("Get campaign details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("get",{id:A,...x}));Y0(IP0,{examples:["sequenzy campaigns get camp_123 --company comp_123"]});var QP0=Z5.command("create <name>").description("Create a campaign").option("-s, --subject <subject>","Email subject").option("--tracking-code <code>","Optional campaign tracking code").option("--status <status>","Initial status: draft or sent").option("--sent-at <iso-date>","Sent timestamp when creating with --status sent").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--prompt <prompt>","Generate campaign blocks from a prompt").option("--style <style>","Prompt generation style: minimal, branded, promotional").option("--tone <tone>","Prompt generation tone: professional, casual, friendly").option("--label <labels...>","Label names to assign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("create",{name:A,...x}));Y0(QP0,{notes:["--subject is required unless --prompt is provided. With --prompt, the generated subject is used unless --subject is also provided.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --status sent only to archive an already-sent campaign; it does not send email or create per-recipient delivery history.","Do not combine prompt, HTML flags, and blocks flags in the same request."],examples:['sequenzy campaigns create "April Launch" --prompt "Announce our new analytics dashboard"','sequenzy campaigns create "April Launch" --subject "We shipped" --html-file ./campaign.html','sequenzy campaigns create "Imported launch" --subject "We shipped" --status sent --sent-at "2026-05-01T14:00:00Z" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns create "Segmented Launch" --subject "We shipped" --blocks-file ./campaign-blocks.json']});var yP0=Z5.command("update <id>").description("Update a draft campaign").option("-n, --name <name>","Campaign name").option("-s, --subject <subject>","Email subject").option("--tracking-code <code>","Optional campaign tracking code").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--campaign-data-json <json>","Inline campaignData JSON object").option("--campaign-data-file <file>","Path to a JSON file with campaignData").option("--computed-lists-json <json>","Inline computedLists JSON array").option("--computed-lists-file <file>","Path to a JSON file with computedLists").option("--reply-to <email>","Set reply-to using an existing reply profile email").option("--reply-profile <id>","Set reply-to using a reply profile ID").option("--label <labels...>","Replace label names").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("update",{id:A,...x}));Y0(yP0,{notes:["Provide at least one update flag, including content, labels, reply-to, campaign data, or computed lists.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --campaign-data-file and --computed-lists-file to upload personalization data for repeat blocks.","Do not combine HTML flags with blocks flags in the same request.","Use either --reply-to or --reply-profile, not both."],examples:['sequenzy campaigns update camp_123 --subject "Updated subject"',"sequenzy campaigns update camp_123 --html-file ./campaign-v2.html","sequenzy campaigns update camp_123 --blocks-file ./campaign-v2-blocks.json","sequenzy campaigns update camp_123 --campaign-data-file ./campaign-data.json --computed-lists-file ./computed-lists.json","sequenzy campaigns update camp_123 --reply-to support@example.com","sequenzy campaigns update camp_123 --label edm api"]});var fP0=Z5.command("schedule <id>").description("Schedule a draft or scheduled campaign").requiredOption("--at <datetime>","Future ISO date/time to send, for example 2026-06-01T14:00:00Z").option("--target-lists-json <json>","Inline campaign targetLists JSON object").option("--target-lists-file <file>","Path to a JSON file with campaign targetLists").option("--send-time-optimization","Enable send-time optimization for the scheduled send").option("--spread-over-hours <hours>","Spread delivery over 1-72 hours. Disables send-time optimization when set.").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("schedule",{id:A,...x}));Y0(fP0,{notes:["The campaign must be draft or already scheduled.","Omit target lists to reuse saved campaign targeting, or default to all active subscribers.",'Target list examples include {"type":"all"}, {"type":"lists","listIds":["list_123"]}, and {"type":"segment","segmentId":"seg_123"}.'],examples:['sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"',`sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-json '{"type":"all"}'`,'sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-file ./target-lists.json','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --spread-over-hours 6']});var wP0=Z5.command("test <id>").description("Send a test email for a campaign").requiredOption("--to <email>","Recipient email for the test").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("test",{id:A,...x}));Y0(wP0,{examples:["sequenzy campaigns test camp_123 --to you@example.com"]});var iP0=Z5.command("cancel <id>").description("Cancel a scheduled, paused, or sending campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("cancel",{id:A,...x}));Y0(iP0,{notes:["Cancelling stops scheduled, paused, waiting-approval, and actively sending campaigns immediately.","No confirmation prompt is shown so a bad send can be stopped fast."],examples:["sequenzy campaigns cancel camp_123"]});var SP0=Z5.command("pause <id>").description("Pause a campaign that is currently sending").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("pause",{id:A,...x}));Y0(SP0,{notes:["Only campaigns in sending status can be paused."],examples:["sequenzy campaigns pause camp_123"]});var $P0=Z5.command("resume <id>").description("Resume a paused campaign").option("--spread-over-hours <hours>","Spread the remaining delivery over 1-72 hours").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("resume",{id:A,...x}));Y0($P0,{notes:["Only paused campaigns can be resumed."],examples:["sequenzy campaigns resume camp_123","sequenzy campaigns resume camp_123 --spread-over-hours 6"]});var GP0=Z5.command("delete <id>").description("Delete a campaign").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("delete",{id:A,...x}));Y0(GP0,{notes:["Sending, scheduled, and paused campaigns must be cancelled before they can be deleted."],examples:["sequenzy campaigns delete camp_123 --yes"]});var HP0=Z5.command("duplicate <id>").description("Duplicate a campaign as a new draft").option("--mode <mode>","Duplicate mode: campaign, ab_test, or variant","campaign").option("--variant-id <id>","A/B test variant to copy when --mode is variant").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("duplicate",{id:A,...x}));Y0(HP0,{notes:["Mode campaign copies the campaign email, ab_test also copies the A/B test with all variants, and variant copies one variant's content as a plain campaign."],examples:["sequenzy campaigns duplicate camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test","sequenzy campaigns duplicate camp_123 --mode variant --variant-id var_b"]});var o4=B8.command("landing-pages").description("Manage landing pages").action(()=>o4.help());Y0(o4,{notes:["Landing pages are created as drafts. Publish only after reviewing the page.","Use --content-json or --content-file for full editor-compatible landing page content.","Custom domains require a CNAME record pointing to pages.sequenzydns.com."],examples:["sequenzy landing-pages list --company comp_123",'sequenzy landing-pages create "Product Waitlist" --template waitlist',"sequenzy landing-pages publish lp_123","sequenzy landing-pages connect-domain pages.example.com"]});var JP0=o4.command("list").description("List landing pages").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>d7("list",A));Y0(JP0,{examples:["sequenzy landing-pages list --company comp_123"]});var UP0=o4.command("get <id>").description("Get landing page details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("get",{id:A,...x}));Y0(UP0,{examples:["sequenzy landing-pages get lp_123 --company comp_123"]});var RP0=o4.command("create [name]").description("Create a draft landing page").option("--slug <slug>","Landing page URL slug").option("--template <template>","Template key, e.g. waitlist").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("create",{name:A,...x}));Y0(RP0,{notes:["When --content-json/--content-file is omitted, a valid default page is generated from --template."],examples:['sequenzy landing-pages create "Product Waitlist" --template waitlist','sequenzy landing-pages create "Launch Page" --slug launch --content-file ./landing-page.json']});var KP0=o4.command("update <id>").description("Edit a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("update",{id:A,...x}));Y0(KP0,{examples:['sequenzy landing-pages update lp_123 --name "Updated page"',"sequenzy landing-pages update lp_123 --content-file ./landing-page.json"]});var qP0=o4.command("publish <id>").description("Publish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("publish",{id:A,...x}));Y0(qP0,{examples:["sequenzy landing-pages publish lp_123"]});var MP0=o4.command("unpublish <id>").description("Unpublish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("unpublish",{id:A,...x}));Y0(MP0,{examples:["sequenzy landing-pages unpublish lp_123"]});var YP0=o4.command("delete <id>").description("Delete a landing page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("delete",{id:A,...x}));Y0(YP0,{examples:["sequenzy landing-pages delete lp_123"]});var uP0=o4.command("connect-domain <domain>").description("Connect a custom landing page domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("connect-domain",{domain:A,...x}));Y0(uP0,{examples:["sequenzy landing-pages connect-domain pages.example.com --company comp_123"]});var XP0=o4.command("update-domain-settings").description("Update or verify landing page domain settings").option("--domain <domain>","Replace the connected landing page domain").option("--verify","Refresh domain verification state").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>d7("update-domain-settings",A));Y0(XP0,{examples:["sequenzy landing-pages update-domain-settings --domain pages.example.com","sequenzy landing-pages update-domain-settings --verify"]});var L5=B8.command("sequences").description("Manage email sequences").action(()=>L5.help());Y0(L5,{notes:["The CLI supports both AI goal-based sequence creation and explicit-step creation.","Trigger-specific options depend on --trigger. For example: contact_added needs --list-id, tag_added needs --tag-name, inactivity needs --event-name and --inactive-days.","Use --goal for AI generation, or --steps-file / --emails-file with JSON arrays that match the API step objects.","Use --enrollment-mode matching_field for product- or variant-specific event sequences.",'Explicit --steps-file input can include discount actions with {"type":"create_discount","discountType":"percent","percentOff":20,"duration":"once","appliesToAllPlans":true}; later emails can use {{discount.code}}.',"Discount action sequences require a connected Stripe integration before enabling."],examples:["sequenzy sequences list --company comp_123",'sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation"',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json","sequenzy sequences enable seq_123"]});var WP0=L5.command("list").description("List sequences").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>w4("list",A));Y0(WP0,{examples:["sequenzy sequences list --company comp_123"]});var ZP0=L5.command("get <id>").description("Get sequence details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("get",{id:A,...x}));Y0(ZP0,{examples:["sequenzy sequences get seq_123 --company comp_123"]});var LP0=L5.command("create <name>").description("Create a sequence from AI goal input or explicit step content").requiredOption("-t, --trigger <trigger>","Sequence trigger type").option("-g, --goal <goal>","AI generation goal for the sequence").option("--email-count <count>","Number of AI-generated emails when using --goal (1-10)").option("--duration-days <days>","Total duration in days for AI-generated sequence delays when using --goal").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--list-id <id>","List ID for contact_added triggers").option("--tag-name <name>","Tag name for tag_added triggers").option("--segment-id <id>","Segment ID for segment_entered triggers").option("--event-name <name>","Event name for event_received, inactivity, and frequency triggers").option("--property-filters-json <json>","Inline JSON array of event property filters for event_received triggers").option("--property-filters-file <file>","Path to a JSON file with event property filters").option("--inactive-days <days>","Days of inactivity for inactivity triggers").option("--min-count <count>","Minimum event count for frequency triggers").option("--time-window-days <days>","Time window for frequency triggers").option("--steps-json <json>","Inline JSON array of sequence steps").option("--steps-file <file>","Path to a JSON file with sequence steps").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("create",{name:A,...x}));Y0(LP0,{notes:["Provide either --goal for AI generation or --steps-json/--steps-file for explicit content, but not both.","Each explicit email step needs subject plus either html or blocks. Discount action steps use type=create_discount and can run before an email that references {{discount.code}}.","Prefer --steps-file for anything non-trivial. The CLI passes the JSON through to the API.","Shopify replenishment and back-in-stock event sequences default to matching_field.","Use --enrollment-field-path for custom event keys such as order.id or product.providerVariantId.","Use --property-filters-json/--property-filters-file with event_received triggers to only start the sequence when the event properties match, e.g. scope a purchase sequence to one product.","Use --sending-window-start/--sending-window-end/--sending-window-timezone to hold every email step until the allowed local send window. Add --sending-window-days weekdays for working days only.","Discount action sequences require a connected Stripe integration before enabling."],examples:['sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation" --email-count 4 --duration-days 10','sequenzy sequences create trial --trigger tag_added --tag-name trial --goal "Convert trial users" --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays',"sequenzy sequences create restock --trigger event_received --event-name ecommerce.back_in_stock --enrollment-mode matching_field --steps-file ./steps.json",`sequenzy sequences create deliver-ebook --trigger event_received --event-name ecommerce.order_placed --property-filters-json '[{"path":"lineItems[].providerProductId","operator":"equals","value":"prod_123"}]' --steps-file ./steps.json`,"sequenzy sequences create post-purchase --trigger event_received --event-name ecommerce.order_placed --enrollment-mode matching_field --enrollment-field-path order.id --steps-file ./steps.json","sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy sequences create rescue --trigger inactivity --event-name login --inactive-days 14 --steps-file ./steps.json"]});var zP0=L5.command("update <id>").description("Update sequence metadata, email step content, stop conditions, or paths").option("-n, --name <name>","Sequence name").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--pause-new-enrollments","Stop new sequence enrollments while current recipients continue").option("--resume-new-enrollments","Resume new sequence enrollments while current recipients continue").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--clear-sending-window","Disable the sequence sending window").option("--steps-json <json>","Inline JSON array of step updates").option("--steps-file <file>","Path to a JSON file with step updates").option("--emails-json <json>","Inline JSON array of email updates").option("--emails-file <file>","Path to a JSON file with email updates").option("--branch-json <json>","Inline JSON object for inserting an if/else branch with path steps").option("--branch-file <file>","Path to a JSON file for inserting an if/else branch with path steps").option("--insert-steps-json <json>","Inline JSON object for inserting new linear steps").option("--insert-steps-file <file>","Path to a JSON file for inserting new linear steps").option("--stop-condition-json <json>","Inline JSON object for updating the sequence stop condition").option("--stop-condition-file <file>","Path to a JSON file for updating the sequence stop condition").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("update",{id:A,...x}));Y0(zP0,{notes:["Use either the steps form or the emails form, not both.","Each update entry can target a step by nodeId, emailId, or by array order.","Use --insert-steps-json/--insert-steps-file to add new linear steps; use --steps-* or --emails-* to edit existing email steps.",'Use --stop-condition-json/--stop-condition-file with values like {"type":"has_tag","value":"customer"}; use {"type":"none","value":null} to clear it.',"Branch condition types include has_tag, in_list, in_segment, event_received, link_clicked, and field_* comparisons. Use activityScope (this_sequence, previous_email, ever) for event and click checks.","Use --clear-sending-window to remove a configured send window."],examples:['sequenzy sequences update seq_123 --name "User Onboarding"',"sequenzy sequences update seq_123 --pause-new-enrollments","sequenzy sequences update seq_123 --resume-new-enrollments","sequenzy sequences update seq_123 --enrollment-mode matching_field","sequenzy sequences update seq_123 --enrollment-field-path order.id","sequenzy sequences update seq_123 --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays","sequenzy sequences update seq_123 --clear-sending-window","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json",`sequenzy sequences update seq_123 --stop-condition-json '{"type":"has_tag","value":"customer"}'`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_email","steps":[{"subject":"Migration check-in","html":"<p>Need help migrating?</p>"}]}'`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_email","branches":[{"conditionType":"link_clicked","linkUrl":"project-invites","activityScope":"previous_email","steps":[{"subject":"Invite accepted","html":"<p>Thanks for accepting.</p>"}]}],"elseSteps":[{"subject":"Reminder","html":"<p>Please accept your invite.</p>"}]}'`,"sequenzy sequences update seq_123 --branch-file ./branch.json"]});var OP0=L5.command("enable <id>").description("Enable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("enable",{id:A,...x}));Y0(OP0,{examples:["sequenzy sequences enable seq_123"]});var NP0=L5.command("disable <id>").description("Disable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("disable",{id:A,...x}));Y0(NP0,{examples:["sequenzy sequences disable seq_123"]});var jP0=L5.command("pause-enrollments <id>").description("Stop new enrollments while current sequence recipients continue").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("pause-enrollments",{id:A,...x}));Y0(jP0,{notes:["The sequence must already be active. Existing active and waiting recipients keep moving through the sequence.","Use sequences disable when you want to freeze current recipients too."],examples:["sequenzy sequences pause-enrollments seq_123"]});var PP0=L5.command("resume-enrollments <id>").description("Resume new enrollments for an active sequence without changing current recipients").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("resume-enrollments",{id:A,...x}));Y0(PP0,{notes:["The sequence must already be active. Use sequences enable to resume a fully disabled sequence."],examples:["sequenzy sequences resume-enrollments seq_123"]});var vP0=L5.command("enroll <id>").description("Manually enroll subscribers in a sequence").option("-e, --email <emails...>","Email addresses to enroll").option("--subscriber-ids <ids...>","Subscriber IDs to enroll").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--target-node-id <nodeId>","Sequence node to enroll at; defaults to the first step after the trigger").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("enroll",{id:A,...x}));Y0(vP0,{notes:["Provide at least one target using --subscriber-ids or exactly one email source: --email, --emails-json, or --emails-file.","Subscribers must be active; unknown emails are reported as not found and inactive, unavailable, or already enrolled subscribers are skipped.","Enrollment requires the sequence to be accepting entrants (enabled and not paused for enrollment)."],examples:["sequenzy sequences enroll seq_123 --email one@example.com two@example.com","sequenzy sequences enroll seq_123 --subscriber-ids sub_123 sub_456 --target-node-id node_email_2","sequenzy sequences enroll seq_123 --emails-file ./vips.csv","sequenzy sequences enroll seq_123 --email one@example.com --target-node-id node_email_2"]});var VP0=L5.command("cancel-enrollments <id>").description("Cancel active or waiting subscriber enrollments in a sequence").option("--subscriber-id <id>","Cancel enrollments for one subscriber ID").option("--field-path <path>","Entry event property dot path to match, such as order.id").option("--field-values <values>","Comma-separated entry field values to match").option("--reason <reason>","Reason stored on cancelled enrollments").option("--apply","Actually cancel matches; otherwise only dry-run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("cancel-enrollments",{id:A,...x}));Y0(VP0,{notes:["sequenceId is always required. Provide exactly one target: --subscriber-id or --field-values.","Without --apply, this command only reports matching enrollments.","When --field-path is omitted, the API uses the sequence enrollmentFieldPath if configured."],examples:["sequenzy sequences cancel-enrollments seq_123 --subscriber-id sub_123 --apply","sequenzy sequences cancel-enrollments seq_123 --field-path order.id --field-values ord_123,ord_456"]});var nP0=L5.command("delete <id>").description("Delete a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("delete",{id:A,...x}));Y0(nP0,{examples:["sequenzy sequences delete seq_123"]});var t4=B8.command("ab-tests").description("Inspect and edit A/B test variants").action(()=>t4.help());Y0(t4,{notes:["Use get to discover variant IDs, then update-variant to edit a specific A/B variant.","Only draft A/B tests can be edited.","create, add-variant, delete-variant, and delete work on campaign A/B tests."],examples:["sequenzy ab-tests list --sequence seq_123","sequenzy ab-tests get ab_123","sequenzy ab-tests stats ab_123 --period 7d","sequenzy ab-tests create camp_123 --test-percentage 20 --winner-criteria open_rate",'sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"',"sequenzy ab-tests restart ab_123 --source-variant var_b",'sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --blocks-file ./variant-b.json"]});var mP0=t4.command("list").description("List A/B tests").option("--sequence <id>","Filter by sequence ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>N7("list",A));Y0(mP0,{examples:["sequenzy ab-tests list --sequence seq_123"]});var TP0=t4.command("get <id>").description("Get A/B test details and variants").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("get",{id:A,...x}));Y0(TP0,{examples:["sequenzy ab-tests get ab_123"]});var kP0=t4.command("stats <id>").description("Get A/B test variant stats").option("-p, --period <period>","Time period (1h, 24h, 7d, 30d, 90d)").option("--start <iso>","Custom range start as ISO 8601").option("--end <iso>","Custom range end as ISO 8601").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("stats",{id:A,...x}));Y0(kP0,{notes:["Use --period or both --start and --end. Custom ranges max at 90 days.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy ab-tests stats ab_123","sequenzy ab-tests stats ab_123 --period 30d","sequenzy ab-tests stats ab_123 --include-bots"]});var bP0=t4.command("restart <id>").description("Run another sequence A/B test from an existing variant").option("--source-variant <id>","Variant to use as the new control. Defaults to the selected winner.").option("--test-type <type>","Test type for generated variants: subject or content").option("--winner-threshold <count>","Subscribers before selecting a winner (10-1000)").option("--variant-count <count>","Total variants including control (2-4)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("restart",{id:A,...x}));Y0(bP0,{notes:["Only sequence A/B tests with a selected winner can be restarted.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:["sequenzy ab-tests restart ab_123","sequenzy ab-tests restart ab_123 --source-variant var_b --test-type content --variant-count 3"]});var hP0=t4.command("update-variant <id> <variantId>").description("Update a draft A/B test variant").option("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--html <html>","Replacement HTML body").option("--html-file <file>","Read replacement HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>N7("update-variant",{id:A,variantId:x,...E}));Y0(hP0,{notes:["Provide either HTML or blocks, not both.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:['sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --html-file ./variant-b.html"]});var lP0=t4.command("create <campaignId>").description("Create an A/B test for a draft campaign").option("-n, --name <name>","A/B test name").option("--test-percentage <percent>","Share of the audience used for testing (5-50, default 20)").option("--duration-minutes <minutes>","Test duration before a winner is selected (15-1440, default 240)").option("--winner-criteria <criteria>","Winner criteria: open_rate or click_rate (default open_rate)").option("--variants-json <json>","Inline JSON array of extra variants ({subject, previewText?, blocks?})").option("--variants-file <file>","Path to a JSON file with extra variants ({subject, previewText?, blocks?})").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("create",{campaignId:A,...x}));Y0(lP0,{notes:["The campaign must be in draft or rejected status and must not already have an A/B test.","Variant A is created automatically from the campaign email; provided variants are added after it."],examples:["sequenzy ab-tests create camp_123","sequenzy ab-tests create camp_123 --test-percentage 30 --duration-minutes 120 --winner-criteria click_rate",`sequenzy ab-tests create camp_123 --variants-json '[{"subject":"Alternative subject"}]'`]});var cP0=t4.command("add-variant <id>").description("Add a variant to a draft campaign A/B test").requiredOption("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("add-variant",{id:A,...x}));Y0(cP0,{notes:["Variants can only be added while the A/B test is in draft status."],examples:['sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"','sequenzy ab-tests add-variant ab_123 --subject "Alternative subject" --blocks-file ./variant.json']});var rP0=t4.command("delete-variant <id> <variantId>").description("Remove a variant from a draft campaign A/B test").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>N7("delete-variant",{id:A,variantId:x,...E}));Y0(rP0,{notes:["Variant A is the control variant and cannot be deleted.","Variants can only be removed while the A/B test is in draft status."],examples:["sequenzy ab-tests delete-variant ab_123 var_b --yes"]});var aP0=t4.command("delete <id>").description("Delete a campaign A/B test").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("delete",{id:A,...x}));Y0(aP0,{notes:["Running A/B tests cannot be deleted; the linked campaign must be draft or rejected."],examples:["sequenzy ab-tests delete ab_123 --yes"]});var BF=B8.command("templates").description("Manage email templates").action(()=>BF.help());Y0(BF,{notes:["Template content can be provided as raw HTML or as Sequenzy blocks JSON.","Templates can be assigned labels and listed by label for integration dashboards.","Use blocks when you need conditional content, per-block styles, or an exact editor-compatible structure."],examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123",'sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json','sequenzy templates update tmpl_123 --subject "Updated" --html-file ./welcome-v2.html']});var pP0=BF.command("list").description("List all templates").option("--label <labels...>","Filter by label name").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>G3("list",A));Y0(pP0,{examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123"]});var dP0=BF.command("get <id>").description("Get template details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>G3("get",{id:A,...x}));Y0(dP0,{examples:["sequenzy templates get tmpl_123 --company comp_123"]});var oP0=BF.command("create <name>").description("Create a template").requiredOption("-s, --subject <subject>","Email subject").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Label names to assign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>G3("create",{name:A,...x}));Y0(oP0,{notes:["Provide either HTML or blocks JSON content.","Use blocks when you need conditional content, per-block styles, or exact editor parity."],examples:['sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json']});var tP0=BF.command("update <id>").description("Update a template").option("-n, --name <name>","Template name").option("-s, --subject <subject>","Email subject").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Replace label names").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>G3("update",{id:A,...x}));Y0(tP0,{notes:["Provide at least one of --name, --subject, --label, --html, --html-file, --blocks-json, or --blocks-file.","Do not combine HTML flags with blocks flags in the same request."],examples:['sequenzy templates update tmpl_123 --subject "Updated"',"sequenzy templates update tmpl_123 --label edm template","sequenzy templates update tmpl_123 --html-file ./welcome-v2.html","sequenzy templates update tmpl_123 --blocks-file ./welcome-v2-blocks.json"]});var _P0=BF.command("delete <id>").description("Delete a template").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>G3("delete",{id:A,...x}));Y0(_P0,{notes:["Deletion fails when the template is still referenced by a campaign or sequence."],examples:["sequenzy templates delete tmpl_123"]});var ci=B8.command("companies").description("Inspect or create companies").action(()=>ci.help());Y0(ci,{notes:["Company creation starts background website processing automatically."],examples:["sequenzy companies list","sequenzy companies get comp_123","sequenzy companies create example.com --name Example"]});var sP0=ci.command("list").description("List accessible companies").option("--json","Print raw JSON").action((A)=>DH("list",A));Y0(sP0,{examples:["sequenzy companies list"]});var eP0=ci.command("get <id>").description("Get company details").option("--json","Print raw JSON").action((A,x)=>DH("get",{id:A,...x}));Y0(eP0,{examples:["sequenzy companies get comp_123"]});var Av0=ci.command("create <domain>").description("Create a company and queue website processing").option("-n, --name <name>","Company name").option("--json","Print raw JSON").action((A,x)=>DH("create",{domain:A,...x}));Y0(Av0,{examples:["sequenzy companies create example.com","sequenzy companies create https://example.com --name Example"]});var ri=B8.command("tags").description("Manage tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>$3("list",A));Y0(ri,{notes:["Running `sequenzy tags` without a subcommand lists tag definitions.","Tag names are normalized to lowercase with dashes; system tags cannot be changed or deleted."],examples:["sequenzy tags --company comp_123","sequenzy tags list","sequenzy tags create vip --color purple","sequenzy tags update tag_123 --color red","sequenzy tags delete tag_123 --yes"]});var xv0=ri.command("list").description("List tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>$3("list",A));Y0(xv0,{examples:["sequenzy tags list --company comp_123"]});var Ev0=ri.command("create <name>").description("Create a tag definition").option("--color <color>","Tag color, e.g. gray, red, green, blue, purple").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>$3("create",{name:A,...x}));Y0(Ev0,{notes:["Names are normalized to lowercase with dashes, so `VIP Customer` becomes `vip-customer`."],examples:["sequenzy tags create vip","sequenzy tags create vip --color purple"]});var Bv0=ri.command("update <tagId>").description("Update a tag definition color").requiredOption("--color <color>","New tag color").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>$3("update",{tagId:A,...x}));Y0(Bv0,{notes:["System tags cannot be updated."],examples:["sequenzy tags update tag_123 --color red"]});var Dv0=ri.command("delete <tagId>").description("Delete a tag definition").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>$3("delete",{tagId:A,...x}));Y0(Dv0,{notes:["Deleting a tag removes it from every subscriber.","Tags used by sequences cannot be deleted until those sequences stop referencing them."],examples:["sequenzy tags delete tag_123 --yes"]});var $D=B8.command("lists").description("Manage subscriber lists").action(()=>$D.help());Y0($D,{examples:["sequenzy lists list --company comp_123",'sequenzy lists create Newsletter --description "Public newsletter list"','sequenzy lists update list_123 --name "Weekly Newsletter" --private',"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv","sequenzy lists remove-subscribers list_123 --email one@example.com","sequenzy lists import list_123 --emails-file ./batch-001.csv","sequenzy lists delete list_123 --yes"]});var gv0=$D.command("list").description("List subscriber lists").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>c1("list",A));Y0(gv0,{examples:["sequenzy lists list --company comp_123"]});var Cv0=$D.command("create <name>").description("Create a subscriber list").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("create",{name:A,...x}));Y0(Cv0,{examples:['sequenzy lists create Newsletter --description "Public newsletter list"',"sequenzy lists create VIP --private --company comp_123"]});var Fv0=$D.command("add-subscribers <listId>").description("Add subscribers to a list from emails, JSON, or a file").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("add-subscribers",{listId:A,...x}));Y0(Fv0,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used.","New subscribers are not enrolled in matching sequences unless --enroll-sequences is set."],examples:["sequenzy lists add-subscribers list_123 --email one@example.com two@example.com",`sequenzy lists add-subscribers list_123 --emails-json '["one@example.com","two@example.com"]'`,"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv"]});var Iv0=$D.command("import <listId>").description("Alias for add-subscribers; import subscribers into a list").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("add-subscribers",{listId:A,...x}));Y0(Iv0,{notes:["`lists import` is an alias for `lists add-subscribers`.","Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used."],examples:["sequenzy lists import list_123 --emails-file ./batch-001.csv",`sequenzy lists import list_123 --emails-json '["one@example.com","two@example.com"]'`]});var Qv0=$D.command("update <listId>").description("Update a subscriber list").option("-n, --name <name>","List name").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("--no-private","Mark the list as public").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("update",{listId:A,...x}));Y0(Qv0,{notes:["Provide at least one of --name, --description, --private, or --no-private."],examples:['sequenzy lists update list_123 --name "Weekly Newsletter"',"sequenzy lists update list_123 --private","sequenzy lists update list_123 --no-private"]});var yv0=$D.command("remove-subscribers <listId>").description("Remove subscribers from a list by email").option("-e, --email <emails...>","Email addresses to remove").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("remove-subscribers",{listId:A,...x}));Y0(yv0,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Subscribers are only removed from the list; they stay in your audience.","Emails that do not match a subscriber are reported as not found."],examples:["sequenzy lists remove-subscribers list_123 --email one@example.com two@example.com","sequenzy lists remove-subscribers list_123 --emails-file ./churned.csv"]});var fv0=$D.command("delete <listId>").description("Delete a subscriber list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("delete",{listId:A,...x}));Y0(fv0,{notes:["Deleting a list removes all of its memberships; subscribers themselves are kept."],examples:["sequenzy lists delete list_123 --yes"]});var DF=B8.command("segments").description("Manage segments").action(()=>DF.help());Y0(DF,{notes:["Use --filter-json for arbitrary segment filters. The CLI will fill in missing filter IDs.","Use --match any to create a segment that matches any filter instead of all filters.",'Engagement filters (emailSent, emailOpened, emailClicked, emailBounced, emailComplained) accept either a time range as the value ("7d", "30d", "90d", "180d", "all") OR a specific campaign ("campaign:<campaign_id>"). Combine multiple engagement filters with --match all to build things like "bounced campaign A but not campaign B".'],examples:["sequenzy segments list --company comp_123",'sequenzy segments create --name "Bought Pro" --stripe-product prod_pro',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`]});var wv0=DF.command("list").description("List all segments").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>rQ("list",A));Y0(wv0,{examples:["sequenzy segments list --company comp_123"]});var iv0=DF.command("create").description("Create a segment").requiredOption("-n, --name <name>","Segment name").option("-c, --company <id>","Company ID override for personal API keys").option("--match <mode>","How filters combine: all or any","all").option("--stripe-product <id>","Stripe product ID to segment on").option("--commerce-product <id>","Commerce product to segment on, as provider:productId (e.g. shopify:42); a bare ID matches any provider").option("--purchase-operator <operator>","Purchase operator (bought, didnt-buy, at-least, less-than)","bought").option("--payments <number>","Payment threshold for at-least/less-than").option("--orders <number>","Order threshold for at-least/less-than with --commerce-product").option("--filter-json <json>","Raw JSON array of segment filters (IDs are optional)").option("--json","Print raw JSON").action((A)=>rQ("create",A));Y0(iv0,{examples:['sequenzy segments create --name "Bought Pro" --stripe-product prod_pro','sequenzy segments create --name "3+ Pro Payments" --stripe-product prod_pro --purchase-operator at-least --payments 3','sequenzy segments create --name "Starter Kit Buyers" --commerce-product api:prod-starter-kit','sequenzy segments create --name "Repeat Kit Buyers" --commerce-product api:prod-starter-kit --purchase-operator at-least --orders 2',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`]});var Sv0=DF.command("count <id>").description("Get subscriber count for a segment").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>rQ("count",{id:A,...x}));Y0(Sv0,{examples:["sequenzy segments count seg_123 --company comp_123"]});var $v0=DF.command("update <id>").description("Update a segment name, filters, or join operator").option("-n, --name <name>","Segment name").option("--filters-json <json>","Raw JSON array of segment filters, or an object with a root group").option("--filters-file <file>","Path to a JSON file with segment filters or a root group").option("--join-operator <operator>","How filters combine: and or or").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>rQ("update",{id:A,...x}));Y0($v0,{notes:["Provide at least one of --name, --filters-json, --filters-file, or --join-operator.","Filters replace the existing filter set; missing filter IDs are filled in by the CLI."],examples:['sequenzy segments update seg_123 --name "Churn Risk"',`sequenzy segments update seg_123 --filters-json '[{"field":"tag","operator":"contains","value":"vip"}]'`,"sequenzy segments update seg_123 --join-operator or"]});var Gv0=DF.command("delete <id>").description("Delete a segment").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>rQ("delete",{id:A,...x}));Y0(Gv0,{examples:["sequenzy segments delete seg_123 --yes"]});var e1=B8.command("audience-syncs").description("Sync segments to Meta custom audiences").action(()=>e1.help());Y0(e1,{notes:["Requires the Meta Ads integration to be connected in the dashboard (Settings -> Integrations).",'Use --template to start from a ready-made segment ("zero-ltv", "no-purchase-1y", "recent-buyers", "high-spenders-ecom", "non-buyers", "engaged"); the segment is created automatically on first use.',"Audiences are add-only: subscribers who leave the segment stay in the Meta audience."],examples:["sequenzy audience-syncs list",'sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"']});var Hv0=e1.command("list").description("List audience syncs with schedule and status").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>UC("list",A));Y0(Hv0,{examples:["sequenzy audience-syncs list --company comp_123"]});var Jv0=e1.command("ad-accounts").description("List the connected Meta ad accounts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>UC("ad-accounts",A));Y0(Jv0,{examples:["sequenzy audience-syncs ad-accounts"]});var Uv0=e1.command("create").description("Create an audience sync (segment -> Meta custom audience)").option("--segment <id>","Existing segment ID to sync").option("--template <id>",'Predefined segment template (for example "recent-buyers", "zero-ltv", "no-purchase-1y")').requiredOption("--ad-account <id>","Meta ad account ID (see `sequenzy audience-syncs ad-accounts`)").requiredOption("-n, --name <name>","Audience name in Meta Ads Manager").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly","daily").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>UC("create",A));Y0(Uv0,{examples:['sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"','sequenzy audience-syncs create --segment seg_123 --ad-account act_123 --name "Sequenzy - VIPs" --frequency hourly']});var Rv0=e1.command("update <id>").description("Change an audience sync's frequency or pause/resume it").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly").option("--active <bool>","true to resume, false to pause").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UC("update",{id:A,...x}));Y0(Rv0,{examples:["sequenzy audience-syncs update sync_123 --frequency weekly","sequenzy audience-syncs update sync_123 --active false"]});var Kv0=e1.command("delete <id>").description("Remove an audience sync (the Meta audience itself is kept)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UC("delete",{id:A,...x}));Y0(Kv0,{examples:["sequenzy audience-syncs delete sync_123"]});var qv0=e1.command("sync <id>").description("Trigger an immediate sync run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UC("sync",{id:A,...x}));Y0(qv0,{examples:["sequenzy audience-syncs sync sync_123"]});var Ag=B8.command("products").description("Manage products and digital delivery files").action(()=>Ag.help());Y0(Ag,{notes:["Products sync from Stripe, Shopify, and WooCommerce integrations.","Attach a deliverable file to a Stripe product, then reference it in purchase sequence emails with {{event.download.url}} and {{event.download.name}}."],examples:["sequenzy products list --provider stripe","sequenzy products sync",'sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --file ./ebook.pdf',"sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/guide.pdf --name guide.pdf","sequenzy products detach-file prod_abc","sequenzy products delete my-ebook"]});var Mv0=Ag.command("list").description("List synced products including attached delivery files").option("-c, --company <id>","Company ID override for personal API keys").option("--provider <provider>","Filter by provider (stripe, shopify, woocommerce, manual)").option("--search <query>","Filter products by title").option("--json","Print raw JSON").action((A)=>bC("list",A));Y0(Mv0,{examples:["sequenzy products list --provider stripe"]});var Yv0=Ag.command("sync").description("Queue a Stripe product catalog sync").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>bC("sync",A));Y0(Yv0,{examples:["sequenzy products sync --company comp_123"]});var uv0=Ag.command("upsert [productId]").description("Create or update products in the catalog (Commerce API, keyed by your productId)").option("--title <title>","Product title (required for single upserts)").option("--description <text>","Product description").option("--price-cents <cents>","Price in the smallest currency unit").option("--currency <code>","ISO currency code, e.g. USD").option("--image-url <url>","Product image URL").option("--product-url <url>","Product page URL").option("--in-stock","Mark the product as in stock").option("--out-of-stock","Mark the product as out of stock").option("--file <path>","Deliverable file to upload and attach in one step").option("--url <link>","External deliverable http(s) link to attach in one step").option("--name <fileName>","Display name for the attached deliverable").option("--products-json <json>","Inline JSON array of products to upsert").option("--products-file <file>","Path to a JSON file with products to upsert").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>bC("upsert",x,A));Y0(uv0,{notes:["Products are keyed by your own productId and stored under the api provider.","Combine --file or --url with a single-product upsert to attach the deliverable file in the same command.","Use --products-json/--products-file for bulk upserts of up to 100 products."],examples:['sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --currency USD --file ./ebook.pdf','sequenzy products upsert my-course --title "The Course" --url https://files.example.com/course.zip',"sequenzy products upsert --products-file ./products.json"]});var Xv0=Ag.command("delete <productId>").description("Delete a product previously pushed via the Commerce API").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>bC("delete",x,A));Y0(Xv0,{examples:["sequenzy products delete my-ebook"]});var Wv0=Ag.command("attach-file <id>").description("Attach the deliverable file buyers receive after purchase").option("--file <path>","Local file to upload (PDF, ePub, ZIP, media)").option("--url <link>","External http(s) link instead of an upload").option("--name <fileName>","Display name for the file (e.g. guide.pdf)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>bC("attach-file",x,A));Y0(Wv0,{examples:["sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/template.zip --name template.zip"]});var Zv0=Ag.command("detach-file <id>").description("Remove the attached delivery file from a product").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>bC("detach-file",x,A));Y0(Zv0,{examples:["sequenzy products detach-file prod_abc"]});var ai=B8.command("team").description("Manage team members and invitations").action(()=>ai.help());Y0(ai,{notes:["Inviting and cancelling invitations requires owner or admin access.","Billing access can only be granted by the company owner."],examples:["sequenzy team list","sequenzy team invite teammate@example.com --role admin","sequenzy team cancel-invitation inv_123"]});var Lv0=ai.command("list").description("List team members and pending invitations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>MR("list",A));Y0(Lv0,{examples:["sequenzy team list --company comp_123"]});var zv0=ai.command("invite <email>").description("Invite a team member or add an existing user").requiredOption("--role <role>","Member role: admin or viewer").option("--billing-access","Allow the member to manage billing (owner only)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>MR("invite",{email:A,...x}));Y0(zv0,{notes:["Existing Sequenzy users are added to the team immediately; everyone else receives an email invitation.","Invitations expire automatically and can be re-sent by inviting the same email again after cancelling."],examples:["sequenzy team invite teammate@example.com --role admin","sequenzy team invite finance@example.com --role viewer --billing-access"]});var Ov0=ai.command("cancel-invitation <invitationId>").description("Cancel a pending team invitation").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>MR("cancel-invitation",{invitationId:A,...x}));Y0(Ov0,{notes:["Run `sequenzy team list` first to find invitation IDs."],examples:["sequenzy team cancel-invitation inv_123 --yes"]});var xg=B8.command("inbox").description("Manage subscriber reply conversations").action(()=>xg.help());Y0(xg,{notes:["The inbox collects subscriber replies to campaigns, sequences, and transactional email.","Use --note on replies to add an internal note instead of emailing the subscriber."],examples:["sequenzy inbox list --status open --unread","sequenzy inbox get conv_123","sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox close conv_123"]});var Nv0=xg.command("list").description("List conversations").option("-s, --status <status>","Filter by status: open, closed, or all").option("--search <query>","Search by subscriber email, name, or subject").option("--unread","Only conversations with unread messages").option("-p, --page <number>","Page number (default 1)").option("-l, --limit <number>","Results per page (1-100, default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>TC("list",A));Y0(Nv0,{examples:["sequenzy inbox list","sequenzy inbox list --status open --unread",'sequenzy inbox list --search "refund" --limit 50']});var jv0=xg.command("get <conversationId>").description("Get a conversation with its full message history").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>TC("get",{conversationId:A,...x}));Y0(jv0,{examples:["sequenzy inbox get conv_123","sequenzy inbox get conv_123 --json"]});var Pv0=xg.command("reply <conversationId>").description("Reply to a conversation or add an internal note").option("-t, --text <text>","Plain text message body").option("--html-file <file>","Read an HTML message body from file").option("-s, --subject <subject>","Override the reply subject").option("--note","Add an internal note instead of emailing the subscriber").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>TC("reply",{conversationId:A,...x}));Y0(Pv0,{notes:["Provide a body with --text and/or --html-file.","Outbound replies are emailed to the subscriber and reopen closed conversations; notes are internal only."],examples:["sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox reply conv_123 --html-file ./reply.html","sequenzy inbox reply conv_123 --text 'Customer asked for a refund' --note"]});var vv0=xg.command("close <conversationId>").description("Close a conversation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>TC("close",{conversationId:A,...x}));Y0(vv0,{examples:["sequenzy inbox close conv_123"]});var Vv0=xg.command("reopen <conversationId>").description("Reopen a closed conversation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>TC("reopen",{conversationId:A,...x}));Y0(Vv0,{examples:["sequenzy inbox reopen conv_123"]});var nv0=xg.command("mark-read <conversationId>").description("Mark all messages in a conversation as read").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>TC("mark-read",{conversationId:A,...x}));Y0(nv0,{examples:["sequenzy inbox mark-read conv_123"]});var GD=B8.command("webhooks").description("Manage outbound webhook endpoints").action(()=>GD.help());Y0(GD,{notes:["Webhook payloads are signed; the signing secret is only shown once at creation time.","Valid events cover email.*, subscriber.*, and sequence.* types; omit --event to use the default set."],examples:["sequenzy webhooks list","sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks deliveries wh_123 --limit 50","sequenzy webhooks replay wh_123 del_456"]});var mv0=GD.command("list").description("List outbound webhook endpoints").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>_1("list",A));Y0(mv0,{examples:["sequenzy webhooks list --company comp_123"]});var Tv0=GD.command("create").description("Create an outbound webhook endpoint").requiredOption("-n, --name <name>","Webhook name").requiredOption("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Event types to deliver, e.g. email.bounced email.replied subscriber.unsubscribed").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>_1("create",A));Y0(Tv0,{notes:["The signing secret is printed once on creation and cannot be retrieved later - store it immediately.","Omit --event to subscribe to the default event set."],examples:["sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks create --name 'All events' --url https://example.com/hook"]});var kv0=GD.command("update <id>").description("Update an outbound webhook endpoint").option("-n, --name <name>","Webhook name").option("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Replacement event types").option("--enable","Enable the webhook").option("--disable","Disable the webhook").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>_1("update",{id:A,...x}));Y0(kv0,{notes:["Provide at least one of --name, --url, --event, --enable, or --disable.","Changing the URL or re-enabling resets the failure circuit breaker."],examples:["sequenzy webhooks update wh_123 --url https://example.com/new-hook","sequenzy webhooks update wh_123 --event email.bounced email.complained","sequenzy webhooks update wh_123 --disable"]});var bv0=GD.command("delete <id>").description("Delete an outbound webhook endpoint").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>_1("delete",{id:A,...x}));Y0(bv0,{examples:["sequenzy webhooks delete wh_123 --yes"]});var hv0=GD.command("test <id>").description("Send a test event to a webhook endpoint").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>_1("test",{id:A,...x}));Y0(hv0,{notes:["The webhook must be enabled to receive a test event."],examples:["sequenzy webhooks test wh_123"]});var lv0=GD.command("deliveries <id>").description("List recent deliveries for a webhook endpoint").option("-l, --limit <number>","Maximum deliveries to return (1-100)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>_1("deliveries",{id:A,...x}));Y0(lv0,{examples:["sequenzy webhooks deliveries wh_123","sequenzy webhooks deliveries wh_123 --limit 50"]});var cv0=GD.command("replay <id> <deliveryId>").description("Replay a webhook delivery").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>_1("replay",{id:A,deliveryId:x,...E}));Y0(cv0,{notes:["Run `sequenzy webhooks deliveries <id>` first to find delivery IDs."],examples:["sequenzy webhooks replay wh_123 del_456"]});var rv0=B8.command("account").description("Show account info").option("--json","Print raw JSON").action($l);Y0(rv0,{examples:["sequenzy account","sequenzy account --json"]});var kj=B8.command("api-keys").description("Create company API keys").action(()=>kj.help());Y0(kj,{notes:["The plain API key is only returned on creation. Save it immediately."],examples:["sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123']});var av0=kj.command("create").description("Create a company API key").option("-n, --name <name>","Human-readable API key name").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>Gl("create",A));Y0(av0,{examples:["sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123']});var H3=B8.command("websites").description("Manage sending domains and integration guides").action(()=>H3.help());Y0(H3,{notes:["Use 'guide' for code examples and 'check' to inspect current DNS verification details."],examples:["sequenzy websites list --company comp_123","sequenzy websites add example.com --company comp_123","sequenzy websites guide --framework nextjs --use-case transactional"]});var pv0=H3.command("list").description("List sending domains for a company").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>li("list",A));Y0(pv0,{examples:["sequenzy websites list --company comp_123"]});var dv0=H3.command("add <domain>").description("Add a sending domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>li("add",{domain:A,...x}));Y0(dv0,{examples:["sequenzy websites add example.com --company comp_123"]});var ov0=H3.command("check <domain>").description("Inspect sending domain verification details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>li("check",{domain:A,...x}));Y0(ov0,{examples:["sequenzy websites check example.com --company comp_123"]});var tv0=H3.command("guide").description("Print framework-specific integration code").option("--framework <name>","Framework name, e.g. nextjs, express, python").option("--use-case <name>","Use case, e.g. transactional, subscribe_form, event_tracking").option("--json","Print raw JSON").action((A)=>li("guide",A));Y0(tv0,{examples:["sequenzy websites guide","sequenzy websites guide --framework nextjs --use-case transactional","sequenzy websites guide --framework python --use-case event_tracking"]});var pi=B8.command("generate").description("Generate email content with AI").action(()=>pi.help());Y0(pi,{notes:["Generated content is returned as draft content. Review it before sending.","Use --json when another tool or agent should parse the generated output."],examples:['sequenzy generate email "Welcome a new user to our analytics product"','sequenzy generate sequence "Onboard a new workspace admin" --count 4 --days 14','sequenzy generate subjects "April product launch" --count 8']});pi.command("email <prompt>").description("Generate email blocks from a prompt").option("-s, --style <style>","Style: minimal, branded, promotional").option("-t, --tone <tone>","Tone: professional, casual, friendly").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>qU("email",{prompt:A,...x}));pi.command("sequence <goal>").description("Generate email sequence content from a goal").option("-c, --count <number>","Number of emails (1-10)","5").option("-d, --days <number>","Duration in days","14").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>qU("sequence",{goal:A,...x}));pi.command("subjects <topic>").description("Generate A/B subject line variants").option("-c, --count <number>","Number of variants","5").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>qU("subjects",{topic:A,...x}));await B8.parseAsync();process.exit(process.exitCode??0);
|
|
432
|
+
${e7}Use 'sequenzy --help' and '<command> --help' for detailed examples and caveats.${D6}`;console.log(E),console.log(D),console.log(),console.log(B),console.log(g),console.log(F),console.log()}var B8=new Mv;B8.name("sequenzy").description("Sequenzy CLI - Email marketing from the terminal").version(nA0).showHelpAfterError().showSuggestionAfterError().action(cj0);Y0(B8,{notes:["Use --json on data commands when another tool or agent should parse structured output.","Dashboard-aware JSON responses include appUrls when a company ID can be resolved.","Company-scoped commands accept --company for personal API keys that can access multiple companies.","Content commands prefer file flags such as --html-file, --blocks-file, --steps-file, and --emails-file to avoid shell escaping issues.","Sequence creation supports --goal for AI generation or explicit step JSON."],examples:['sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy campaigns update camp_123 --subject "Updated subject" --html-file ./campaign.html',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy urls --company comp_123 --sequence seq_123 --settings-tab integrations","sequenzy websites guide --framework nextjs --use-case transactional",'sequenzy api-keys create --name "CI deploy key" --company comp_123']});var rj0=B8.command("login").description("Log in to your Sequenzy account").action(v_);Y0(rj0,{notes:["Starts device authentication and prints a verification URL plus approval code."],examples:["sequenzy login"]});var aj0=B8.command("logout").description("Log out of your Sequenzy account").action(V_);Y0(aj0,{examples:["sequenzy logout"]});var pj0=B8.command("whoami").description("Show the locally stored Sequenzy identity").action(jA0);Y0(pj0,{notes:["This confirms local CLI auth state. Use 'sequenzy account' when you need company access details too."],examples:["sequenzy whoami"]});var dj0=B8.command("stats").description("Show account, campaign, or sequence metrics").option("-p, --period <period>","Time period (7d, 30d, 90d)","7d").option("--campaign <id>","Get stats for a specific campaign").option("--sequence <id>","Get stats for a specific sequence").option("--include-bots","Include machine-classified bot/scanner opens and clicks").action(XA0);Y0(dj0,{notes:["Use exactly one of: account-level period, --campaign, or --sequence.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement.","Sequence stats include per-step failures when the API reports them."],examples:["sequenzy stats","sequenzy stats --period 30d","sequenzy stats --campaign camp_123","sequenzy stats --campaign camp_123 --include-bots","sequenzy stats --sequence seq_123"]});var oj0=B8.command("urls").description("Generate Sequenzy dashboard URLs for known resource IDs").option("-c, --company <id>","Company ID").option("--campaign <id>","Campaign ID for campaign editor URL").option("--landing-page <id>","Landing page ID for landing page editor URL").option("--sequence <id>","Sequence ID for sequence editor URL").option("--template <id>","Template/email ID for email editor URL").option("--email <id>","Email ID for email editor URL").option("--transactional <id>","Transactional email ID").option("--email-send <id>","Email send ID").option("--domain <id>","Sending domain ID").option("--status <status>","Status for campaign/sequence list URLs").option("--settings-tab <tab>","Settings tab slug, e.g. integrations").option("--json","Print JSON").action(Sl);Y0(oj0,{notes:["Uses SEQUENZY_APP_URL when set, otherwise https://sequenzy.com.","If --company is omitted, the CLI tries the current company from `sequenzy account`.","Useful after creating a campaign or sequence when the user wants a review/edit link."],examples:["sequenzy urls --company comp_123","sequenzy urls --company comp_123 --sequence seq_123","sequenzy urls --company comp_123 --campaign camp_123","sequenzy urls --company comp_123 --landing-page lp_123","sequenzy urls --company comp_123 --email-send send_123","sequenzy urls --company comp_123 --settings-tab integrations","sequenzy urls --company comp_123 --json"]});var s1=B8.command("subscribers").description("Manage subscribers").action(()=>s1.help());Y0(s1,{notes:["Subscriber list fetches every page by default so agents do not silently miss later results.","`subscribers get` includes tags, list memberships, sequence enrollments, email stats, and recent activity.","--attr expects repeated key=value pairs. Example: --attr firstName=Ana --attr plan=pro"],examples:["sequenzy subscribers list --tag vip",'sequenzy subscribers list --list "Master List" --json',"sequenzy subscribers list --tag vip --limit 25 --json","sequenzy subscribers add user@example.com --tag trial --attr firstName=Ana","sequenzy subscribers get user@example.com --json","sequenzy subscribers remove user@example.com --hard"]});var tj0=s1.command("list").description("List subscribers").option("-s, --segment <id>","Filter by segment").option("-t, --tag <tag>","Filter by tag").option("--list <id-or-name>","Filter by subscriber list ID or exact name").option("-l, --limit <number>","Maximum results to return").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>EF("list",A));Y0(tj0,{examples:["sequenzy subscribers list",'sequenzy subscribers list --list "Master List"',"sequenzy subscribers list --segment seg_123","sequenzy subscribers list --tag onboarding --limit 100"]});var _j0=s1.command("add [email]").description("Add or upsert a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--first-name <name>","Subscriber first name").option("--last-name <name>","Subscriber last name").option("-t, --tag <tags...>","Tags to apply").option("-l, --list <ids...>","List IDs to add the subscriber to").option("--no-lists","Add the subscriber to no lists").option("--skip-sequences","Do not enroll the subscriber in matching sequences").option("-a, --attr <attrs...>","Attributes (key=value)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>EF("add",{email:A,...x,noLists:x.lists===!1}));Y0(_j0,{examples:["sequenzy subscribers add user@example.com","sequenzy subscribers add user@example.com --first-name Ana --tag trial --attr plan=pro","sequenzy subscribers add user@example.com --list list_123","sequenzy subscribers add user@example.com --skip-sequences"]});var sj0=s1.command("get [email]").description("Get subscriber details").option("--external-id <id>","Customer-owned subscriber ID").option("--include-bots","Include machine-classified bot/scanner opens and clicks in stats/activity").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>EF("get",{email:A,...x}));Y0(sj0,{notes:["Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy subscribers get user@example.com","sequenzy subscribers get user@example.com --include-bots"]});var ej0=s1.command("update [email]").description("Update subscriber status, tags, or custom attributes").option("--external-id <id>","Customer-owned subscriber ID").option("--status <status>","Subscriber status").option("-t, --tag <tags...>","Replacement tags").option("-a, --attr <attrs...>","Attributes (key=value)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>EF("update",{email:A,...x}));Y0(ej0,{examples:["sequenzy subscribers update user@example.com --status unsubscribed","sequenzy subscribers update user@example.com --tag churned --attr cancelReason=too_expensive"]});var AP0=s1.command("event [email]").description("Trigger an event for a subscriber").option("--external-id <id>","Customer-owned subscriber ID").requiredOption("-n, --name <event>","Event name").option("-p, --property <properties...>","Event properties (key=value)").option("-a, --attr <attrs...>","Subscriber attributes (key=value)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>EF("event",{email:A,...x}));Y0(AP0,{examples:["sequenzy subscribers event user@example.com --name saas.purchase","sequenzy subscribers event user@example.com --name saas.purchase --property plan=pro --property amount=99"]});var xP0=s1.command("remove [email]").description("Unsubscribe or permanently delete a subscriber").option("--external-id <id>","Customer-owned subscriber ID").option("--hard","Permanently delete (not just unsubscribe)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>EF("remove",{email:A,...x}));Y0(xP0,{examples:["sequenzy subscribers remove user@example.com","sequenzy subscribers remove user@example.com --hard"]});var uR=B8.command("transactional").description("Inspect transactional email templates").action(()=>uR.help());Y0(uR,{notes:["Use the top-level `sequenzy send` command to send email."],examples:["sequenzy transactional list","sequenzy transactional get welcome","sequenzy send user@example.com --template welcome --var firstName=Ana"]});var EP0=uR.command("list").description("List transactional templates").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>nj("list",A));Y0(EP0,{examples:["sequenzy transactional list --company comp_123"]});var BP0=uR.command("get <slug>").description("Get transactional template details by slug").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>nj("get",{slug:A,...x}));Y0(BP0,{examples:["sequenzy transactional get welcome"]});var mj=B8.command("widgets").description("Widget helper commands").action(()=>mj.help());Y0(mj,{examples:["sequenzy widgets preferences-token user@example.com"]});var DP0=mj.command("preferences-token <email>").description("Generate a subscription preferences iframe token").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>PA0("preferences-token",{email:A,...x}));Y0(DP0,{examples:["sequenzy widgets preferences-token user@example.com"]});var Tj=B8.command("email-sends").alias("emailsends").description("Inspect sent email snapshots and delivery events").action(()=>Tj.help());Y0(Tj,{notes:["Email send rows are short-lived; if the row was cleaned up, this falls back to retained ClickHouse events.","Use --html to print the stored HTML body when it is still available."],examples:["sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --json"]});var gP0=Tj.command("get <emailSendId>").description("Get an email send by ID").option("-c, --company <id>","Company ID override for personal API keys").option("--html","Print the full stored HTML body in text output").option("--html-only","Print only the stored HTML body").option("--json","Print raw JSON").action((A,x)=>X_("get",{id:A,...x}));Y0(gP0,{examples:["sequenzy email-sends get send_123","sequenzy email-sends get send_123 --html","sequenzy email-sends get send_123 --company comp_123 --json"]});var CP0=B8.command("send <email>").description("Send a transactional email").option("-t, --template <slug>","Transactional template slug to use").option("-s, --subject <subject>","Email subject").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--vars-json <json>","Variables as a JSON object, including nested arrays for repeat blocks").option("-v, --var <vars...>","Variables (key=value)").action(KA0);Y0(CP0,{notes:["Use either --template or --html/--html-file.","--subject is required when sending raw HTML.","--vars-json accepts nested objects and arrays; --var overrides individual scalar keys."],examples:["sequenzy send user@example.com --template welcome --var firstName=Ana",`sequenzy send user@example.com --template welcome --vars-json '{"event":{"items":[{"title":"Plan","description":"Pro"}]}}'`,'sequenzy send user@example.com --subject "Welcome" --html-file ./welcome.html']});var Z5=B8.command("campaigns").description("Manage campaigns").action(()=>Z5.help());Y0(Z5,{notes:["Campaign creation supports HTML, Sequenzy blocks, or prompt-generated content.","Campaign updates support HTML, Sequenzy blocks, subject, name, labels, and reply-to changes.","Campaign scheduling requires a future ISO timestamp and a verified sending domain.","Use cancel to stop a scheduled or sending campaign, and pause/resume to control an active send."],examples:["sequenzy campaigns list --status draft --company comp_123",'sequenzy campaigns create "April Launch" --subject "We shipped" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"',"sequenzy campaigns test camp_123 --to you@example.com","sequenzy campaigns cancel camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test"]});var FP0=Z5.command("list").description("List campaigns").option("-s, --status <status>","Filter by status").option("--label <labels...>","Filter by label name").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>B4("list",A));Y0(FP0,{examples:["sequenzy campaigns list","sequenzy campaigns list --status draft --company comp_123","sequenzy campaigns list --label edm"]});var IP0=Z5.command("get <id>").description("Get campaign details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("get",{id:A,...x}));Y0(IP0,{examples:["sequenzy campaigns get camp_123 --company comp_123"]});var QP0=Z5.command("create <name>").description("Create a campaign").option("-s, --subject <subject>","Email subject").option("--tracking-code <code>","Optional campaign tracking code").option("--status <status>","Initial status: draft or sent").option("--sent-at <iso-date>","Sent timestamp when creating with --status sent").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--prompt <prompt>","Generate campaign blocks from a prompt").option("--style <style>","Prompt generation style: minimal, branded, promotional").option("--tone <tone>","Prompt generation tone: professional, casual, friendly").option("--label <labels...>","Label names to assign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("create",{name:A,...x}));Y0(QP0,{notes:["--subject is required unless --prompt is provided. With --prompt, the generated subject is used unless --subject is also provided.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --status sent only to archive an already-sent campaign; it does not send email or create per-recipient delivery history.","Do not combine prompt, HTML flags, and blocks flags in the same request."],examples:['sequenzy campaigns create "April Launch" --prompt "Announce our new analytics dashboard"','sequenzy campaigns create "April Launch" --subject "We shipped" --html-file ./campaign.html','sequenzy campaigns create "Imported launch" --subject "We shipped" --status sent --sent-at "2026-05-01T14:00:00Z" --html-file ./campaign.html','sequenzy campaigns create "API Launch" --subject "We shipped" --label edm api --html-file ./campaign.html','sequenzy campaigns create "Segmented Launch" --subject "We shipped" --blocks-file ./campaign-blocks.json']});var yP0=Z5.command("update <id>").description("Update a draft campaign").option("-n, --name <name>","Campaign name").option("-s, --subject <subject>","Email subject").option("--tracking-code <code>","Optional campaign tracking code").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--campaign-data-json <json>","Inline campaignData JSON object").option("--campaign-data-file <file>","Path to a JSON file with campaignData").option("--computed-lists-json <json>","Inline computedLists JSON array").option("--computed-lists-file <file>","Path to a JSON file with computedLists").option("--reply-to <email>","Set reply-to using an existing reply profile email").option("--reply-profile <id>","Set reply-to using a reply profile ID").option("--label <labels...>","Replace label names").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("update",{id:A,...x}));Y0(yP0,{notes:["Provide at least one update flag, including content, labels, reply-to, campaign data, or computed lists.","Use --blocks-json or --blocks-file when you need editor-compatible blocks, including conditional content and per-block styles.","Use --campaign-data-file and --computed-lists-file to upload personalization data for repeat blocks.","Do not combine HTML flags with blocks flags in the same request.","Use either --reply-to or --reply-profile, not both."],examples:['sequenzy campaigns update camp_123 --subject "Updated subject"',"sequenzy campaigns update camp_123 --html-file ./campaign-v2.html","sequenzy campaigns update camp_123 --blocks-file ./campaign-v2-blocks.json","sequenzy campaigns update camp_123 --campaign-data-file ./campaign-data.json --computed-lists-file ./computed-lists.json","sequenzy campaigns update camp_123 --reply-to support@example.com","sequenzy campaigns update camp_123 --label edm api"]});var fP0=Z5.command("schedule <id>").description("Schedule a draft or scheduled campaign").requiredOption("--at <datetime>","Future ISO date/time to send, for example 2026-06-01T14:00:00Z").option("--target-lists-json <json>","Inline campaign targetLists JSON object").option("--target-lists-file <file>","Path to a JSON file with campaign targetLists").option("--send-time-optimization","Enable send-time optimization for the scheduled send").option("--spread-over-hours <hours>","Spread delivery over 1-72 hours. Disables send-time optimization when set.").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("schedule",{id:A,...x}));Y0(fP0,{notes:["The campaign must be draft or already scheduled.","Omit target lists to reuse saved campaign targeting, or default to all active subscribers.",'Target list examples include {"type":"all"}, {"type":"lists","listIds":["list_123"]}, and {"type":"segment","segmentId":"seg_123"}.'],examples:['sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z"',`sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-json '{"type":"all"}'`,'sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --target-lists-file ./target-lists.json','sequenzy campaigns schedule camp_123 --at "2026-06-01T14:00:00Z" --spread-over-hours 6']});var wP0=Z5.command("test <id>").description("Send a test email for a campaign").requiredOption("--to <email>","Recipient email for the test").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("test",{id:A,...x}));Y0(wP0,{examples:["sequenzy campaigns test camp_123 --to you@example.com"]});var iP0=Z5.command("cancel <id>").description("Cancel a scheduled, paused, or sending campaign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("cancel",{id:A,...x}));Y0(iP0,{notes:["Cancelling stops scheduled, paused, waiting-approval, and actively sending campaigns immediately.","No confirmation prompt is shown so a bad send can be stopped fast."],examples:["sequenzy campaigns cancel camp_123"]});var SP0=Z5.command("pause <id>").description("Pause a campaign that is currently sending").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("pause",{id:A,...x}));Y0(SP0,{notes:["Only campaigns in sending status can be paused."],examples:["sequenzy campaigns pause camp_123"]});var $P0=Z5.command("resume <id>").description("Resume a paused campaign").option("--spread-over-hours <hours>","Spread the remaining delivery over 1-72 hours").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("resume",{id:A,...x}));Y0($P0,{notes:["Only paused campaigns can be resumed."],examples:["sequenzy campaigns resume camp_123","sequenzy campaigns resume camp_123 --spread-over-hours 6"]});var GP0=Z5.command("delete <id>").description("Delete a campaign").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("delete",{id:A,...x}));Y0(GP0,{notes:["Sending, scheduled, and paused campaigns must be cancelled before they can be deleted."],examples:["sequenzy campaigns delete camp_123 --yes"]});var HP0=Z5.command("duplicate <id>").description("Duplicate a campaign as a new draft").option("--mode <mode>","Duplicate mode: campaign, ab_test, or variant","campaign").option("--variant-id <id>","A/B test variant to copy when --mode is variant").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>B4("duplicate",{id:A,...x}));Y0(HP0,{notes:["Mode campaign copies the campaign email, ab_test also copies the A/B test with all variants, and variant copies one variant's content as a plain campaign."],examples:["sequenzy campaigns duplicate camp_123","sequenzy campaigns duplicate camp_123 --mode ab_test","sequenzy campaigns duplicate camp_123 --mode variant --variant-id var_b"]});var o4=B8.command("landing-pages").description("Manage landing pages").action(()=>o4.help());Y0(o4,{notes:["Landing pages are created as drafts. Publish only after reviewing the page.","Use --content-json or --content-file for full editor-compatible landing page content.","Custom domains require a CNAME record pointing to pages.sequenzydns.com."],examples:["sequenzy landing-pages list --company comp_123",'sequenzy landing-pages create "Product Waitlist" --template waitlist',"sequenzy landing-pages publish lp_123","sequenzy landing-pages connect-domain pages.example.com"]});var JP0=o4.command("list").description("List landing pages").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>d7("list",A));Y0(JP0,{examples:["sequenzy landing-pages list --company comp_123"]});var UP0=o4.command("get <id>").description("Get landing page details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("get",{id:A,...x}));Y0(UP0,{examples:["sequenzy landing-pages get lp_123 --company comp_123"]});var RP0=o4.command("create [name]").description("Create a draft landing page").option("--slug <slug>","Landing page URL slug").option("--template <template>","Template key, e.g. waitlist").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("create",{name:A,...x}));Y0(RP0,{notes:["When --content-json/--content-file is omitted, a valid default page is generated from --template."],examples:['sequenzy landing-pages create "Product Waitlist" --template waitlist','sequenzy landing-pages create "Launch Page" --slug launch --content-file ./landing-page.json']});var KP0=o4.command("update <id>").description("Edit a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("update",{id:A,...x}));Y0(KP0,{examples:['sequenzy landing-pages update lp_123 --name "Updated page"',"sequenzy landing-pages update lp_123 --content-file ./landing-page.json"]});var qP0=o4.command("publish <id>").description("Publish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("publish",{id:A,...x}));Y0(qP0,{examples:["sequenzy landing-pages publish lp_123"]});var MP0=o4.command("unpublish <id>").description("Unpublish a landing page").option("-n, --name <name>","Landing page name").option("--slug <slug>","Landing page URL slug").option("--content-json <json>","Inline landing page content JSON").option("--content-file <file>","Path to landing page content JSON").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("unpublish",{id:A,...x}));Y0(MP0,{examples:["sequenzy landing-pages unpublish lp_123"]});var YP0=o4.command("delete <id>").description("Delete a landing page").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("delete",{id:A,...x}));Y0(YP0,{examples:["sequenzy landing-pages delete lp_123"]});var uP0=o4.command("connect-domain <domain>").description("Connect a custom landing page domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>d7("connect-domain",{domain:A,...x}));Y0(uP0,{examples:["sequenzy landing-pages connect-domain pages.example.com --company comp_123"]});var XP0=o4.command("update-domain-settings").description("Update or verify landing page domain settings").option("--domain <domain>","Replace the connected landing page domain").option("--verify","Refresh domain verification state").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>d7("update-domain-settings",A));Y0(XP0,{examples:["sequenzy landing-pages update-domain-settings --domain pages.example.com","sequenzy landing-pages update-domain-settings --verify"]});var L5=B8.command("sequences").description("Manage email sequences").action(()=>L5.help());Y0(L5,{notes:["The CLI supports both AI goal-based sequence creation and explicit-step creation.","Trigger-specific options depend on --trigger. For example: contact_added needs --list-id, tag_added needs --tag-name, inactivity needs --event-name and --inactive-days.","Use --goal for AI generation, or --steps-file / --emails-file with JSON arrays that match the API step objects.","Use --enrollment-mode matching_field for product- or variant-specific event sequences.",'Explicit --steps-file input can include discount actions with {"type":"create_discount","discountType":"percent","percentOff":20,"duration":"once","appliesToAllPlans":true}; later emails can use {{discount.code}}.',"Discount action sequences require a connected Stripe integration before enabling."],examples:["sequenzy sequences list --company comp_123",'sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation"',"sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json","sequenzy sequences enable seq_123"]});var WP0=L5.command("list").description("List sequences").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>w4("list",A));Y0(WP0,{examples:["sequenzy sequences list --company comp_123"]});var ZP0=L5.command("get <id>").description("Get sequence details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("get",{id:A,...x}));Y0(ZP0,{examples:["sequenzy sequences get seq_123 --company comp_123"]});var LP0=L5.command("create <name>").description("Create a sequence from AI goal input or explicit step content").requiredOption("-t, --trigger <trigger>","Sequence trigger type").option("-g, --goal <goal>","AI generation goal for the sequence").option("--email-count <count>","Number of AI-generated emails when using --goal (1-10)").option("--duration-days <days>","Total duration in days for AI-generated sequence delays when using --goal").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--list-id <id>","List ID for contact_added triggers").option("--tag-name <name>","Tag name for tag_added triggers").option("--segment-id <id>","Segment ID for segment_entered triggers").option("--event-name <name>","Event name for event_received, inactivity, and frequency triggers").option("--property-filters-json <json>","Inline JSON array of event property filters for event_received triggers").option("--property-filters-file <file>","Path to a JSON file with event property filters").option("--inactive-days <days>","Days of inactivity for inactivity triggers").option("--min-count <count>","Minimum event count for frequency triggers").option("--time-window-days <days>","Time window for frequency triggers").option("--steps-json <json>","Inline JSON array of sequence steps").option("--steps-file <file>","Path to a JSON file with sequence steps").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("create",{name:A,...x}));Y0(LP0,{notes:["Provide either --goal for AI generation or --steps-json/--steps-file for explicit content, but not both.","Each explicit email step needs subject plus either html or blocks. Discount action steps use type=create_discount and can run before an email that references {{discount.code}}.","Prefer --steps-file for anything non-trivial. The CLI passes the JSON through to the API.","Shopify replenishment and back-in-stock event sequences default to matching_field.","Use --enrollment-field-path for custom event keys such as order.id or product.providerVariantId.","Use --property-filters-json/--property-filters-file with event_received triggers to only start the sequence when the event properties match, e.g. scope a purchase sequence to one product.","Use --sending-window-start/--sending-window-end/--sending-window-timezone to hold every email step until the allowed local send window. Add --sending-window-days weekdays for working days only.","Discount action sequences require a connected Stripe integration before enabling."],examples:['sequenzy sequences create onboarding --trigger event_received --event-name signup.completed --goal "Guide new users to activation" --email-count 4 --duration-days 10','sequenzy sequences create trial --trigger tag_added --tag-name trial --goal "Convert trial users" --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays',"sequenzy sequences create restock --trigger event_received --event-name ecommerce.back_in_stock --enrollment-mode matching_field --steps-file ./steps.json",`sequenzy sequences create deliver-ebook --trigger event_received --event-name ecommerce.order_placed --property-filters-json '[{"path":"lineItems[].providerProductId","operator":"equals","value":"prod_123"}]' --steps-file ./steps.json`,"sequenzy sequences create post-purchase --trigger event_received --event-name ecommerce.order_placed --enrollment-mode matching_field --enrollment-field-path order.id --steps-file ./steps.json","sequenzy sequences create onboarding --trigger contact_added --list-id list_123 --steps-file ./steps.json","sequenzy sequences create rescue --trigger inactivity --event-name login --inactive-days 14 --steps-file ./steps.json"]});var zP0=L5.command("update <id>").description("Update sequence metadata, email step content, stop conditions, or paths").option("-n, --name <name>","Sequence name").option("--enrollment-mode <mode>","Enrollment mode: unlimited, one_time, or matching_field").option("--enrollment-field-path <path>","Event property dot path used by matching_field enrollment").option("--pause-new-enrollments","Stop new sequence enrollments while current recipients continue").option("--resume-new-enrollments","Resume new sequence enrollments while current recipients continue").option("--sending-window-start <time>","Earliest local send time for sequence emails (HH:mm, e.g. 08:00)").option("--sending-window-end <time>","Latest local send cutoff for sequence emails (HH:mm, e.g. 20:00)").option("--sending-window-timezone <timezone>","IANA timezone for the sequence sending window, e.g. Europe/Kiev").option("--sending-window-days <days>","Comma-separated days for sequence sends, e.g. weekdays or mon,tue,wed,thu,fri").option("--clear-sending-window","Disable the sequence sending window").option("--confirm-structural-change","Confirm an insertSteps or branch structural edit to an active sequence").option("--steps-json <json>","Inline JSON array of step updates").option("--steps-file <file>","Path to a JSON file with step updates").option("--emails-json <json>","Inline JSON array of email updates").option("--emails-file <file>","Path to a JSON file with email updates").option("--branch-json <json>","Inline JSON object for inserting an if/else branch with path steps").option("--branch-file <file>","Path to a JSON file for inserting an if/else branch with path steps").option("--insert-steps-json <json>","Inline JSON object for inserting new linear steps").option("--insert-steps-file <file>","Path to a JSON file for inserting new linear steps").option("--stop-condition-json <json>","Inline JSON object for updating the sequence stop condition").option("--stop-condition-file <file>","Path to a JSON file for updating the sequence stop condition").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("update",{id:A,...x}));Y0(zP0,{notes:["Use either the steps form or the emails form, not both.","Each update entry can target a step by nodeId, emailId, or by array order.","Use --insert-steps-json/--insert-steps-file to add new linear steps; use --steps-* or --emails-* to edit existing email steps.","When inserting steps or branches into an active sequence, pass --confirm-structural-change after confirming the live-flow impact.",'Use --stop-condition-json/--stop-condition-file with values like {"type":"has_tag","value":"customer"}; use {"type":"none","value":null} to clear it.',"Branch condition types include has_tag, in_list, in_segment, event_received, link_clicked, and field_* comparisons. Use activityScope (this_sequence, previous_email, ever) for event and click checks.","Use --clear-sending-window to remove a configured send window."],examples:['sequenzy sequences update seq_123 --name "User Onboarding"',"sequenzy sequences update seq_123 --pause-new-enrollments","sequenzy sequences update seq_123 --resume-new-enrollments","sequenzy sequences update seq_123 --enrollment-mode matching_field","sequenzy sequences update seq_123 --enrollment-field-path order.id","sequenzy sequences update seq_123 --sending-window-start 08:00 --sending-window-end 20:00 --sending-window-timezone Europe/Kiev --sending-window-days weekdays","sequenzy sequences update seq_123 --clear-sending-window","sequenzy sequences update seq_123 --steps-file ./sequence-updates.json",`sequenzy sequences update seq_123 --stop-condition-json '{"type":"has_tag","value":"customer"}'`,`sequenzy sequences update seq_123 --insert-steps-json '{"afterNodeId":"node_email","steps":[{"delay":{"days":1},"subject":"Migration check-in","html":"<p>Need help migrating?</p>"}]}' --confirm-structural-change`,`sequenzy sequences update seq_123 --branch-json '{"afterNodeId":"node_email","branches":[{"conditionType":"link_clicked","linkUrl":"project-invites","activityScope":"previous_email","steps":[{"subject":"Invite accepted","html":"<p>Thanks for accepting.</p>"}]}],"elseSteps":[{"subject":"Reminder","html":"<p>Please accept your invite.</p>"}]}'`,"sequenzy sequences update seq_123 --branch-file ./branch.json"]});var OP0=L5.command("enable <id>").description("Enable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("enable",{id:A,...x}));Y0(OP0,{examples:["sequenzy sequences enable seq_123"]});var NP0=L5.command("disable <id>").description("Disable a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("disable",{id:A,...x}));Y0(NP0,{examples:["sequenzy sequences disable seq_123"]});var jP0=L5.command("pause-enrollments <id>").description("Stop new enrollments while current sequence recipients continue").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("pause-enrollments",{id:A,...x}));Y0(jP0,{notes:["The sequence must already be active. Existing active and waiting recipients keep moving through the sequence.","Use sequences disable when you want to freeze current recipients too."],examples:["sequenzy sequences pause-enrollments seq_123"]});var PP0=L5.command("resume-enrollments <id>").description("Resume new enrollments for an active sequence without changing current recipients").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("resume-enrollments",{id:A,...x}));Y0(PP0,{notes:["The sequence must already be active. Use sequences enable to resume a fully disabled sequence."],examples:["sequenzy sequences resume-enrollments seq_123"]});var vP0=L5.command("enroll <id>").description("Manually enroll subscribers in a sequence").option("-e, --email <emails...>","Email addresses to enroll").option("--subscriber-ids <ids...>","Subscriber IDs to enroll").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--target-node-id <nodeId>","Sequence node to enroll at; defaults to the first step after the trigger").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("enroll",{id:A,...x}));Y0(vP0,{notes:["Provide at least one target using --subscriber-ids or exactly one email source: --email, --emails-json, or --emails-file.","Subscribers must be active; unknown emails are reported as not found and inactive, unavailable, or already enrolled subscribers are skipped.","Enrollment requires the sequence to be accepting entrants (enabled and not paused for enrollment)."],examples:["sequenzy sequences enroll seq_123 --email one@example.com two@example.com","sequenzy sequences enroll seq_123 --subscriber-ids sub_123 sub_456 --target-node-id node_email_2","sequenzy sequences enroll seq_123 --emails-file ./vips.csv","sequenzy sequences enroll seq_123 --email one@example.com --target-node-id node_email_2"]});var VP0=L5.command("cancel-enrollments <id>").description("Cancel active or waiting subscriber enrollments in a sequence").option("--subscriber-id <id>","Cancel enrollments for one subscriber ID").option("--field-path <path>","Entry event property dot path to match, such as order.id").option("--field-values <values>","Comma-separated entry field values to match").option("--reason <reason>","Reason stored on cancelled enrollments").option("--apply","Actually cancel matches; otherwise only dry-run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("cancel-enrollments",{id:A,...x}));Y0(VP0,{notes:["sequenceId is always required. Provide exactly one target: --subscriber-id or --field-values.","Without --apply, this command only reports matching enrollments.","When --field-path is omitted, the API uses the sequence enrollmentFieldPath if configured."],examples:["sequenzy sequences cancel-enrollments seq_123 --subscriber-id sub_123 --apply","sequenzy sequences cancel-enrollments seq_123 --field-path order.id --field-values ord_123,ord_456"]});var nP0=L5.command("delete <id>").description("Delete a sequence").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>w4("delete",{id:A,...x}));Y0(nP0,{examples:["sequenzy sequences delete seq_123"]});var t4=B8.command("ab-tests").description("Inspect and edit A/B test variants").action(()=>t4.help());Y0(t4,{notes:["Use get to discover variant IDs, then update-variant to edit a specific A/B variant.","Only draft A/B tests can be edited.","create, add-variant, delete-variant, and delete work on campaign A/B tests."],examples:["sequenzy ab-tests list --sequence seq_123","sequenzy ab-tests get ab_123","sequenzy ab-tests stats ab_123 --period 7d","sequenzy ab-tests create camp_123 --test-percentage 20 --winner-criteria open_rate",'sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"',"sequenzy ab-tests restart ab_123 --source-variant var_b",'sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --blocks-file ./variant-b.json"]});var mP0=t4.command("list").description("List A/B tests").option("--sequence <id>","Filter by sequence ID").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>N7("list",A));Y0(mP0,{examples:["sequenzy ab-tests list --sequence seq_123"]});var TP0=t4.command("get <id>").description("Get A/B test details and variants").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("get",{id:A,...x}));Y0(TP0,{examples:["sequenzy ab-tests get ab_123"]});var kP0=t4.command("stats <id>").description("Get A/B test variant stats").option("-p, --period <period>","Time period (1h, 24h, 7d, 30d, 90d)").option("--start <iso>","Custom range start as ISO 8601").option("--end <iso>","Custom range end as ISO 8601").option("--include-bots","Include machine-classified bot/scanner opens and clicks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("stats",{id:A,...x}));Y0(kP0,{notes:["Use --period or both --start and --end. Custom ranges max at 90 days.","Bot/scanner opens and clicks are excluded by default; pass --include-bots to inspect raw engagement."],examples:["sequenzy ab-tests stats ab_123","sequenzy ab-tests stats ab_123 --period 30d","sequenzy ab-tests stats ab_123 --include-bots"]});var bP0=t4.command("restart <id>").description("Run another sequence A/B test from an existing variant").option("--source-variant <id>","Variant to use as the new control. Defaults to the selected winner.").option("--test-type <type>","Test type for generated variants: subject or content").option("--winner-threshold <count>","Subscribers before selecting a winner (10-1000)").option("--variant-count <count>","Total variants including control (2-4)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("restart",{id:A,...x}));Y0(bP0,{notes:["Only sequence A/B tests with a selected winner can be restarted.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:["sequenzy ab-tests restart ab_123","sequenzy ab-tests restart ab_123 --source-variant var_b --test-type content --variant-count 3"]});var hP0=t4.command("update-variant <id> <variantId>").description("Update a draft A/B test variant").option("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--html <html>","Replacement HTML body").option("--html-file <file>","Read replacement HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>N7("update-variant",{id:A,variantId:x,...E}));Y0(hP0,{notes:["Provide either HTML or blocks, not both.","Run `sequenzy ab-tests get <id>` first to find variant IDs."],examples:['sequenzy ab-tests update-variant ab_123 var_b --subject "New subject"',"sequenzy ab-tests update-variant ab_123 var_b --html-file ./variant-b.html"]});var lP0=t4.command("create <campaignId>").description("Create an A/B test for a draft campaign").option("-n, --name <name>","A/B test name").option("--test-percentage <percent>","Share of the audience used for testing (5-50, default 20)").option("--duration-minutes <minutes>","Test duration before a winner is selected (15-1440, default 240)").option("--winner-criteria <criteria>","Winner criteria: open_rate or click_rate (default open_rate)").option("--variants-json <json>","Inline JSON array of extra variants ({subject, previewText?, blocks?})").option("--variants-file <file>","Path to a JSON file with extra variants ({subject, previewText?, blocks?})").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("create",{campaignId:A,...x}));Y0(lP0,{notes:["The campaign must be in draft or rejected status and must not already have an A/B test.","Variant A is created automatically from the campaign email; provided variants are added after it."],examples:["sequenzy ab-tests create camp_123","sequenzy ab-tests create camp_123 --test-percentage 30 --duration-minutes 120 --winner-criteria click_rate",`sequenzy ab-tests create camp_123 --variants-json '[{"subject":"Alternative subject"}]'`]});var cP0=t4.command("add-variant <id>").description("Add a variant to a draft campaign A/B test").requiredOption("-s, --subject <subject>","Variant subject").option("--preview-text <text>","Variant preview text").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("add-variant",{id:A,...x}));Y0(cP0,{notes:["Variants can only be added while the A/B test is in draft status."],examples:['sequenzy ab-tests add-variant ab_123 --subject "Alternative subject"','sequenzy ab-tests add-variant ab_123 --subject "Alternative subject" --blocks-file ./variant.json']});var rP0=t4.command("delete-variant <id> <variantId>").description("Remove a variant from a draft campaign A/B test").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>N7("delete-variant",{id:A,variantId:x,...E}));Y0(rP0,{notes:["Variant A is the control variant and cannot be deleted.","Variants can only be removed while the A/B test is in draft status."],examples:["sequenzy ab-tests delete-variant ab_123 var_b --yes"]});var aP0=t4.command("delete <id>").description("Delete a campaign A/B test").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>N7("delete",{id:A,...x}));Y0(aP0,{notes:["Running A/B tests cannot be deleted; the linked campaign must be draft or rejected."],examples:["sequenzy ab-tests delete ab_123 --yes"]});var BF=B8.command("templates").description("Manage email templates").action(()=>BF.help());Y0(BF,{notes:["Template content can be provided as raw HTML or as Sequenzy blocks JSON.","Templates can be assigned labels and listed by label for integration dashboards.","Use blocks when you need conditional content, per-block styles, or an exact editor-compatible structure."],examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123",'sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json','sequenzy templates update tmpl_123 --subject "Updated" --html-file ./welcome-v2.html']});var pP0=BF.command("list").description("List all templates").option("--label <labels...>","Filter by label name").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>G3("list",A));Y0(pP0,{examples:["sequenzy templates list --company comp_123","sequenzy templates list --label edm --company comp_123"]});var dP0=BF.command("get <id>").description("Get template details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>G3("get",{id:A,...x}));Y0(dP0,{examples:["sequenzy templates get tmpl_123 --company comp_123"]});var oP0=BF.command("create <name>").description("Create a template").requiredOption("-s, --subject <subject>","Email subject").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Label names to assign").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>G3("create",{name:A,...x}));Y0(oP0,{notes:["Provide either HTML or blocks JSON content.","Use blocks when you need conditional content, per-block styles, or exact editor parity."],examples:['sequenzy templates create welcome --subject "Welcome" --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --label edm template --html-file ./welcome.html','sequenzy templates create welcome --subject "Welcome" --blocks-file ./welcome-blocks.json']});var tP0=BF.command("update <id>").description("Update a template").option("-n, --name <name>","Template name").option("-s, --subject <subject>","Email subject").option("--html <html>","Email HTML content").option("--html-file <file>","Read HTML from file").option("--blocks-json <json>","Inline JSON array of Sequenzy email blocks").option("--blocks-file <file>","Path to a JSON file with Sequenzy email blocks").option("--label <labels...>","Replace label names").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>G3("update",{id:A,...x}));Y0(tP0,{notes:["Provide at least one of --name, --subject, --label, --html, --html-file, --blocks-json, or --blocks-file.","Do not combine HTML flags with blocks flags in the same request."],examples:['sequenzy templates update tmpl_123 --subject "Updated"',"sequenzy templates update tmpl_123 --label edm template","sequenzy templates update tmpl_123 --html-file ./welcome-v2.html","sequenzy templates update tmpl_123 --blocks-file ./welcome-v2-blocks.json"]});var _P0=BF.command("delete <id>").description("Delete a template").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>G3("delete",{id:A,...x}));Y0(_P0,{notes:["Deletion fails when the template is still referenced by a campaign or sequence."],examples:["sequenzy templates delete tmpl_123"]});var ci=B8.command("companies").description("Inspect or create companies").action(()=>ci.help());Y0(ci,{notes:["Company creation starts background website processing automatically."],examples:["sequenzy companies list","sequenzy companies get comp_123","sequenzy companies create example.com --name Example"]});var sP0=ci.command("list").description("List accessible companies").option("--json","Print raw JSON").action((A)=>DH("list",A));Y0(sP0,{examples:["sequenzy companies list"]});var eP0=ci.command("get <id>").description("Get company details").option("--json","Print raw JSON").action((A,x)=>DH("get",{id:A,...x}));Y0(eP0,{examples:["sequenzy companies get comp_123"]});var Av0=ci.command("create <domain>").description("Create a company and queue website processing").option("-n, --name <name>","Company name").option("--json","Print raw JSON").action((A,x)=>DH("create",{domain:A,...x}));Y0(Av0,{examples:["sequenzy companies create example.com","sequenzy companies create https://example.com --name Example"]});var ri=B8.command("tags").description("Manage tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>$3("list",A));Y0(ri,{notes:["Running `sequenzy tags` without a subcommand lists tag definitions.","Tag names are normalized to lowercase with dashes; system tags cannot be changed or deleted."],examples:["sequenzy tags --company comp_123","sequenzy tags list","sequenzy tags create vip --color purple","sequenzy tags update tag_123 --color red","sequenzy tags delete tag_123 --yes"]});var xv0=ri.command("list").description("List tag definitions").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>$3("list",A));Y0(xv0,{examples:["sequenzy tags list --company comp_123"]});var Ev0=ri.command("create <name>").description("Create a tag definition").option("--color <color>","Tag color, e.g. gray, red, green, blue, purple").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>$3("create",{name:A,...x}));Y0(Ev0,{notes:["Names are normalized to lowercase with dashes, so `VIP Customer` becomes `vip-customer`."],examples:["sequenzy tags create vip","sequenzy tags create vip --color purple"]});var Bv0=ri.command("update <tagId>").description("Update a tag definition color").requiredOption("--color <color>","New tag color").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>$3("update",{tagId:A,...x}));Y0(Bv0,{notes:["System tags cannot be updated."],examples:["sequenzy tags update tag_123 --color red"]});var Dv0=ri.command("delete <tagId>").description("Delete a tag definition").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>$3("delete",{tagId:A,...x}));Y0(Dv0,{notes:["Deleting a tag removes it from every subscriber.","Tags used by sequences cannot be deleted until those sequences stop referencing them."],examples:["sequenzy tags delete tag_123 --yes"]});var $D=B8.command("lists").description("Manage subscriber lists").action(()=>$D.help());Y0($D,{examples:["sequenzy lists list --company comp_123",'sequenzy lists create Newsletter --description "Public newsletter list"','sequenzy lists update list_123 --name "Weekly Newsletter" --private',"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv","sequenzy lists remove-subscribers list_123 --email one@example.com","sequenzy lists import list_123 --emails-file ./batch-001.csv","sequenzy lists delete list_123 --yes"]});var gv0=$D.command("list").description("List subscriber lists").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>c1("list",A));Y0(gv0,{examples:["sequenzy lists list --company comp_123"]});var Cv0=$D.command("create <name>").description("Create a subscriber list").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("create",{name:A,...x}));Y0(Cv0,{examples:['sequenzy lists create Newsletter --description "Public newsletter list"',"sequenzy lists create VIP --private --company comp_123"]});var Fv0=$D.command("add-subscribers <listId>").description("Add subscribers to a list from emails, JSON, or a file").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("add-subscribers",{listId:A,...x}));Y0(Fv0,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used.","New subscribers are not enrolled in matching sequences unless --enroll-sequences is set."],examples:["sequenzy lists add-subscribers list_123 --email one@example.com two@example.com",`sequenzy lists add-subscribers list_123 --emails-json '["one@example.com","two@example.com"]'`,"sequenzy lists add-subscribers list_123 --emails-file ./batch-001.csv"]});var Iv0=$D.command("import <listId>").description("Alias for add-subscribers; import subscribers into a list").option("-e, --email <emails...>","Email addresses to add").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("--duplicate-strategy <strategy>","Duplicate strategy: skip, merge, or overwrite","skip").option("--enroll-sequences","Enroll newly created subscribers in matching sequences").option("--opt-in-mode <mode>","Consent mode: default, confirmed, or double_opt_in","default").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("add-subscribers",{listId:A,...x}));Y0(Iv0,{notes:["`lists import` is an alias for `lists add-subscribers`.","Provide exactly one source: --email, --emails-json, or --emails-file.","Files may be newline-separated, CSV with an email column, a JSON email array, or a JSON object with emails/subscribers.","CSV headers named email, e-mail, email address, or mail are detected; otherwise the first column is used."],examples:["sequenzy lists import list_123 --emails-file ./batch-001.csv",`sequenzy lists import list_123 --emails-json '["one@example.com","two@example.com"]'`]});var Qv0=$D.command("update <listId>").description("Update a subscriber list").option("-n, --name <name>","List name").option("-d, --description <text>","List description").option("--private","Mark the list as private").option("--no-private","Mark the list as public").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("update",{listId:A,...x}));Y0(Qv0,{notes:["Provide at least one of --name, --description, --private, or --no-private."],examples:['sequenzy lists update list_123 --name "Weekly Newsletter"',"sequenzy lists update list_123 --private","sequenzy lists update list_123 --no-private"]});var yv0=$D.command("remove-subscribers <listId>").description("Remove subscribers from a list by email").option("-e, --email <emails...>","Email addresses to remove").option("--emails-json <json>","JSON array of emails, or an object with emails/subscribers").option("--emails-file <file>","JSON, CSV, or newline-separated file with subscriber emails").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("remove-subscribers",{listId:A,...x}));Y0(yv0,{notes:["Provide exactly one source: --email, --emails-json, or --emails-file.","Subscribers are only removed from the list; they stay in your audience.","Emails that do not match a subscriber are reported as not found."],examples:["sequenzy lists remove-subscribers list_123 --email one@example.com two@example.com","sequenzy lists remove-subscribers list_123 --emails-file ./churned.csv"]});var fv0=$D.command("delete <listId>").description("Delete a subscriber list").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>c1("delete",{listId:A,...x}));Y0(fv0,{notes:["Deleting a list removes all of its memberships; subscribers themselves are kept."],examples:["sequenzy lists delete list_123 --yes"]});var DF=B8.command("segments").description("Manage segments").action(()=>DF.help());Y0(DF,{notes:["Use --filter-json for arbitrary segment filters. The CLI will fill in missing filter IDs.","Use --match any to create a segment that matches any filter instead of all filters.",'Engagement filters (emailSent, emailOpened, emailClicked, emailBounced, emailComplained) accept either a time range as the value ("7d", "30d", "90d", "180d", "all") OR a specific campaign ("campaign:<campaign_id>"). Combine multiple engagement filters with --match all to build things like "bounced campaign A but not campaign B".'],examples:["sequenzy segments list --company comp_123",'sequenzy segments create --name "Bought Pro" --stripe-product prod_pro',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`]});var wv0=DF.command("list").description("List all segments").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>rQ("list",A));Y0(wv0,{examples:["sequenzy segments list --company comp_123"]});var iv0=DF.command("create").description("Create a segment").requiredOption("-n, --name <name>","Segment name").option("-c, --company <id>","Company ID override for personal API keys").option("--match <mode>","How filters combine: all or any","all").option("--stripe-product <id>","Stripe product ID to segment on").option("--commerce-product <id>","Commerce product to segment on, as provider:productId (e.g. shopify:42); a bare ID matches any provider").option("--purchase-operator <operator>","Purchase operator (bought, didnt-buy, at-least, less-than)","bought").option("--payments <number>","Payment threshold for at-least/less-than").option("--orders <number>","Order threshold for at-least/less-than with --commerce-product").option("--filter-json <json>","Raw JSON array of segment filters (IDs are optional)").option("--json","Print raw JSON").action((A)=>rQ("create",A));Y0(iv0,{examples:['sequenzy segments create --name "Bought Pro" --stripe-product prod_pro','sequenzy segments create --name "3+ Pro Payments" --stripe-product prod_pro --purchase-operator at-least --payments 3','sequenzy segments create --name "Starter Kit Buyers" --commerce-product api:prod-starter-kit','sequenzy segments create --name "Repeat Kit Buyers" --commerce-product api:prod-starter-kit --purchase-operator at-least --orders 2',`sequenzy segments create --name "VIP or Churn Risk" --match any --filter-json '[{"field":"tag","operator":"contains","value":"vip"},{"field":"emailOpened","operator":"is_not","value":"30d"}]'`,`sequenzy segments create --name "Bounced A not B" --filter-json '[{"field":"emailBounced","operator":"is","value":"campaign:cmp_abc"},{"field":"emailBounced","operator":"is_not","value":"campaign:cmp_xyz"}]'`]});var Sv0=DF.command("count <id>").description("Get subscriber count for a segment").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>rQ("count",{id:A,...x}));Y0(Sv0,{examples:["sequenzy segments count seg_123 --company comp_123"]});var $v0=DF.command("update <id>").description("Update a segment name, filters, or join operator").option("-n, --name <name>","Segment name").option("--filters-json <json>","Raw JSON array of segment filters, or an object with a root group").option("--filters-file <file>","Path to a JSON file with segment filters or a root group").option("--join-operator <operator>","How filters combine: and or or").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>rQ("update",{id:A,...x}));Y0($v0,{notes:["Provide at least one of --name, --filters-json, --filters-file, or --join-operator.","Filters replace the existing filter set; missing filter IDs are filled in by the CLI."],examples:['sequenzy segments update seg_123 --name "Churn Risk"',`sequenzy segments update seg_123 --filters-json '[{"field":"tag","operator":"contains","value":"vip"}]'`,"sequenzy segments update seg_123 --join-operator or"]});var Gv0=DF.command("delete <id>").description("Delete a segment").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>rQ("delete",{id:A,...x}));Y0(Gv0,{examples:["sequenzy segments delete seg_123 --yes"]});var e1=B8.command("audience-syncs").description("Sync segments to Meta custom audiences").action(()=>e1.help());Y0(e1,{notes:["Requires the Meta Ads integration to be connected in the dashboard (Settings -> Integrations).",'Use --template to start from a ready-made segment ("zero-ltv", "no-purchase-1y", "recent-buyers", "high-spenders-ecom", "non-buyers", "engaged"); the segment is created automatically on first use.',"Audiences are add-only: subscribers who leave the segment stay in the Meta audience."],examples:["sequenzy audience-syncs list",'sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"']});var Hv0=e1.command("list").description("List audience syncs with schedule and status").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>UC("list",A));Y0(Hv0,{examples:["sequenzy audience-syncs list --company comp_123"]});var Jv0=e1.command("ad-accounts").description("List the connected Meta ad accounts").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>UC("ad-accounts",A));Y0(Jv0,{examples:["sequenzy audience-syncs ad-accounts"]});var Uv0=e1.command("create").description("Create an audience sync (segment -> Meta custom audience)").option("--segment <id>","Existing segment ID to sync").option("--template <id>",'Predefined segment template (for example "recent-buyers", "zero-ltv", "no-purchase-1y")').requiredOption("--ad-account <id>","Meta ad account ID (see `sequenzy audience-syncs ad-accounts`)").requiredOption("-n, --name <name>","Audience name in Meta Ads Manager").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly","daily").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>UC("create",A));Y0(Uv0,{examples:['sequenzy audience-syncs create --template recent-buyers --ad-account act_123 --name "Sequenzy - Recent buyers"','sequenzy audience-syncs create --segment seg_123 --ad-account act_123 --name "Sequenzy - VIPs" --frequency hourly']});var Rv0=e1.command("update <id>").description("Change an audience sync's frequency or pause/resume it").option("--frequency <frequency>","Sync frequency: hourly, daily, or weekly").option("--active <bool>","true to resume, false to pause").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UC("update",{id:A,...x}));Y0(Rv0,{examples:["sequenzy audience-syncs update sync_123 --frequency weekly","sequenzy audience-syncs update sync_123 --active false"]});var Kv0=e1.command("delete <id>").description("Remove an audience sync (the Meta audience itself is kept)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UC("delete",{id:A,...x}));Y0(Kv0,{examples:["sequenzy audience-syncs delete sync_123"]});var qv0=e1.command("sync <id>").description("Trigger an immediate sync run").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>UC("sync",{id:A,...x}));Y0(qv0,{examples:["sequenzy audience-syncs sync sync_123"]});var Ag=B8.command("products").description("Manage products and digital delivery files").action(()=>Ag.help());Y0(Ag,{notes:["Products sync from Stripe, Shopify, and WooCommerce integrations.","Attach a deliverable file to a Stripe product, then reference it in purchase sequence emails with {{event.download.url}} and {{event.download.name}}."],examples:["sequenzy products list --provider stripe","sequenzy products sync",'sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --file ./ebook.pdf',"sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/guide.pdf --name guide.pdf","sequenzy products detach-file prod_abc","sequenzy products delete my-ebook"]});var Mv0=Ag.command("list").description("List synced products including attached delivery files").option("-c, --company <id>","Company ID override for personal API keys").option("--provider <provider>","Filter by provider (stripe, shopify, woocommerce, manual)").option("--search <query>","Filter products by title").option("--json","Print raw JSON").action((A)=>bC("list",A));Y0(Mv0,{examples:["sequenzy products list --provider stripe"]});var Yv0=Ag.command("sync").description("Queue a Stripe product catalog sync").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>bC("sync",A));Y0(Yv0,{examples:["sequenzy products sync --company comp_123"]});var uv0=Ag.command("upsert [productId]").description("Create or update products in the catalog (Commerce API, keyed by your productId)").option("--title <title>","Product title (required for single upserts)").option("--description <text>","Product description").option("--price-cents <cents>","Price in the smallest currency unit").option("--currency <code>","ISO currency code, e.g. USD").option("--image-url <url>","Product image URL").option("--product-url <url>","Product page URL").option("--in-stock","Mark the product as in stock").option("--out-of-stock","Mark the product as out of stock").option("--file <path>","Deliverable file to upload and attach in one step").option("--url <link>","External deliverable http(s) link to attach in one step").option("--name <fileName>","Display name for the attached deliverable").option("--products-json <json>","Inline JSON array of products to upsert").option("--products-file <file>","Path to a JSON file with products to upsert").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>bC("upsert",x,A));Y0(uv0,{notes:["Products are keyed by your own productId and stored under the api provider.","Combine --file or --url with a single-product upsert to attach the deliverable file in the same command.","Use --products-json/--products-file for bulk upserts of up to 100 products."],examples:['sequenzy products upsert my-ebook --title "The Ebook" --price-cents 1900 --currency USD --file ./ebook.pdf','sequenzy products upsert my-course --title "The Course" --url https://files.example.com/course.zip',"sequenzy products upsert --products-file ./products.json"]});var Xv0=Ag.command("delete <productId>").description("Delete a product previously pushed via the Commerce API").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>bC("delete",x,A));Y0(Xv0,{examples:["sequenzy products delete my-ebook"]});var Wv0=Ag.command("attach-file <id>").description("Attach the deliverable file buyers receive after purchase").option("--file <path>","Local file to upload (PDF, ePub, ZIP, media)").option("--url <link>","External http(s) link instead of an upload").option("--name <fileName>","Display name for the file (e.g. guide.pdf)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>bC("attach-file",x,A));Y0(Wv0,{examples:["sequenzy products attach-file prod_abc --file ./guide.pdf","sequenzy products attach-file prod_abc --url https://example.com/template.zip --name template.zip"]});var Zv0=Ag.command("detach-file <id>").description("Remove the attached delivery file from a product").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>bC("detach-file",x,A));Y0(Zv0,{examples:["sequenzy products detach-file prod_abc"]});var ai=B8.command("team").description("Manage team members and invitations").action(()=>ai.help());Y0(ai,{notes:["Inviting and cancelling invitations requires owner or admin access.","Billing access can only be granted by the company owner."],examples:["sequenzy team list","sequenzy team invite teammate@example.com --role admin","sequenzy team cancel-invitation inv_123"]});var Lv0=ai.command("list").description("List team members and pending invitations").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>MR("list",A));Y0(Lv0,{examples:["sequenzy team list --company comp_123"]});var zv0=ai.command("invite <email>").description("Invite a team member or add an existing user").requiredOption("--role <role>","Member role: admin or viewer").option("--billing-access","Allow the member to manage billing (owner only)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>MR("invite",{email:A,...x}));Y0(zv0,{notes:["Existing Sequenzy users are added to the team immediately; everyone else receives an email invitation.","Invitations expire automatically and can be re-sent by inviting the same email again after cancelling."],examples:["sequenzy team invite teammate@example.com --role admin","sequenzy team invite finance@example.com --role viewer --billing-access"]});var Ov0=ai.command("cancel-invitation <invitationId>").description("Cancel a pending team invitation").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>MR("cancel-invitation",{invitationId:A,...x}));Y0(Ov0,{notes:["Run `sequenzy team list` first to find invitation IDs."],examples:["sequenzy team cancel-invitation inv_123 --yes"]});var xg=B8.command("inbox").description("Manage subscriber reply conversations").action(()=>xg.help());Y0(xg,{notes:["The inbox collects subscriber replies to campaigns, sequences, and transactional email.","Use --note on replies to add an internal note instead of emailing the subscriber."],examples:["sequenzy inbox list --status open --unread","sequenzy inbox get conv_123","sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox close conv_123"]});var Nv0=xg.command("list").description("List conversations").option("-s, --status <status>","Filter by status: open, closed, or all").option("--search <query>","Search by subscriber email, name, or subject").option("--unread","Only conversations with unread messages").option("-p, --page <number>","Page number (default 1)").option("-l, --limit <number>","Results per page (1-100, default 20)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>TC("list",A));Y0(Nv0,{examples:["sequenzy inbox list","sequenzy inbox list --status open --unread",'sequenzy inbox list --search "refund" --limit 50']});var jv0=xg.command("get <conversationId>").description("Get a conversation with its full message history").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>TC("get",{conversationId:A,...x}));Y0(jv0,{examples:["sequenzy inbox get conv_123","sequenzy inbox get conv_123 --json"]});var Pv0=xg.command("reply <conversationId>").description("Reply to a conversation or add an internal note").option("-t, --text <text>","Plain text message body").option("--html-file <file>","Read an HTML message body from file").option("-s, --subject <subject>","Override the reply subject").option("--note","Add an internal note instead of emailing the subscriber").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>TC("reply",{conversationId:A,...x}));Y0(Pv0,{notes:["Provide a body with --text and/or --html-file.","Outbound replies are emailed to the subscriber and reopen closed conversations; notes are internal only."],examples:["sequenzy inbox reply conv_123 --text 'Thanks for reaching out!'","sequenzy inbox reply conv_123 --html-file ./reply.html","sequenzy inbox reply conv_123 --text 'Customer asked for a refund' --note"]});var vv0=xg.command("close <conversationId>").description("Close a conversation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>TC("close",{conversationId:A,...x}));Y0(vv0,{examples:["sequenzy inbox close conv_123"]});var Vv0=xg.command("reopen <conversationId>").description("Reopen a closed conversation").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>TC("reopen",{conversationId:A,...x}));Y0(Vv0,{examples:["sequenzy inbox reopen conv_123"]});var nv0=xg.command("mark-read <conversationId>").description("Mark all messages in a conversation as read").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>TC("mark-read",{conversationId:A,...x}));Y0(nv0,{examples:["sequenzy inbox mark-read conv_123"]});var GD=B8.command("webhooks").description("Manage outbound webhook endpoints").action(()=>GD.help());Y0(GD,{notes:["Webhook payloads are signed; the signing secret is only shown once at creation time.","Valid events cover email.*, subscriber.*, and sequence.* types; omit --event to use the default set."],examples:["sequenzy webhooks list","sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks deliveries wh_123 --limit 50","sequenzy webhooks replay wh_123 del_456"]});var mv0=GD.command("list").description("List outbound webhook endpoints").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>_1("list",A));Y0(mv0,{examples:["sequenzy webhooks list --company comp_123"]});var Tv0=GD.command("create").description("Create an outbound webhook endpoint").requiredOption("-n, --name <name>","Webhook name").requiredOption("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Event types to deliver, e.g. email.bounced email.replied subscriber.unsubscribed").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>_1("create",A));Y0(Tv0,{notes:["The signing secret is printed once on creation and cannot be retrieved later - store it immediately.","Omit --event to subscribe to the default event set."],examples:["sequenzy webhooks create --name CI --url https://example.com/hook --event email.bounced","sequenzy webhooks create --name 'All events' --url https://example.com/hook"]});var kv0=GD.command("update <id>").description("Update an outbound webhook endpoint").option("-n, --name <name>","Webhook name").option("-u, --url <url>","HTTPS endpoint URL").option("-e, --event <events...>","Replacement event types").option("--enable","Enable the webhook").option("--disable","Disable the webhook").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>_1("update",{id:A,...x}));Y0(kv0,{notes:["Provide at least one of --name, --url, --event, --enable, or --disable.","Changing the URL or re-enabling resets the failure circuit breaker."],examples:["sequenzy webhooks update wh_123 --url https://example.com/new-hook","sequenzy webhooks update wh_123 --event email.bounced email.complained","sequenzy webhooks update wh_123 --disable"]});var bv0=GD.command("delete <id>").description("Delete an outbound webhook endpoint").option("-y, --yes","Skip the confirmation prompt").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>_1("delete",{id:A,...x}));Y0(bv0,{examples:["sequenzy webhooks delete wh_123 --yes"]});var hv0=GD.command("test <id>").description("Send a test event to a webhook endpoint").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>_1("test",{id:A,...x}));Y0(hv0,{notes:["The webhook must be enabled to receive a test event."],examples:["sequenzy webhooks test wh_123"]});var lv0=GD.command("deliveries <id>").description("List recent deliveries for a webhook endpoint").option("-l, --limit <number>","Maximum deliveries to return (1-100)").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>_1("deliveries",{id:A,...x}));Y0(lv0,{examples:["sequenzy webhooks deliveries wh_123","sequenzy webhooks deliveries wh_123 --limit 50"]});var cv0=GD.command("replay <id> <deliveryId>").description("Replay a webhook delivery").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x,E)=>_1("replay",{id:A,deliveryId:x,...E}));Y0(cv0,{notes:["Run `sequenzy webhooks deliveries <id>` first to find delivery IDs."],examples:["sequenzy webhooks replay wh_123 del_456"]});var rv0=B8.command("account").description("Show account info").option("--json","Print raw JSON").action($l);Y0(rv0,{examples:["sequenzy account","sequenzy account --json"]});var kj=B8.command("api-keys").description("Create company API keys").action(()=>kj.help());Y0(kj,{notes:["The plain API key is only returned on creation. Save it immediately."],examples:["sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123']});var av0=kj.command("create").description("Create a company API key").option("-n, --name <name>","Human-readable API key name").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>Gl("create",A));Y0(av0,{examples:["sequenzy api-keys create",'sequenzy api-keys create --name "CI deploy key" --company comp_123']});var H3=B8.command("websites").description("Manage sending domains and integration guides").action(()=>H3.help());Y0(H3,{notes:["Use 'guide' for code examples and 'check' to inspect current DNS verification details."],examples:["sequenzy websites list --company comp_123","sequenzy websites add example.com --company comp_123","sequenzy websites guide --framework nextjs --use-case transactional"]});var pv0=H3.command("list").description("List sending domains for a company").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A)=>li("list",A));Y0(pv0,{examples:["sequenzy websites list --company comp_123"]});var dv0=H3.command("add <domain>").description("Add a sending domain").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>li("add",{domain:A,...x}));Y0(dv0,{examples:["sequenzy websites add example.com --company comp_123"]});var ov0=H3.command("check <domain>").description("Inspect sending domain verification details").option("-c, --company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>li("check",{domain:A,...x}));Y0(ov0,{examples:["sequenzy websites check example.com --company comp_123"]});var tv0=H3.command("guide").description("Print framework-specific integration code").option("--framework <name>","Framework name, e.g. nextjs, express, python").option("--use-case <name>","Use case, e.g. transactional, subscribe_form, event_tracking").option("--json","Print raw JSON").action((A)=>li("guide",A));Y0(tv0,{examples:["sequenzy websites guide","sequenzy websites guide --framework nextjs --use-case transactional","sequenzy websites guide --framework python --use-case event_tracking"]});var pi=B8.command("generate").description("Generate email content with AI").action(()=>pi.help());Y0(pi,{notes:["Generated content is returned as draft content. Review it before sending.","Use --json when another tool or agent should parse the generated output."],examples:['sequenzy generate email "Welcome a new user to our analytics product"','sequenzy generate sequence "Onboard a new workspace admin" --count 4 --days 14','sequenzy generate subjects "April product launch" --count 8']});pi.command("email <prompt>").description("Generate email blocks from a prompt").option("-s, --style <style>","Style: minimal, branded, promotional").option("-t, --tone <tone>","Tone: professional, casual, friendly").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>qU("email",{prompt:A,...x}));pi.command("sequence <goal>").description("Generate email sequence content from a goal").option("-c, --count <number>","Number of emails (1-10)","5").option("-d, --days <number>","Duration in days","14").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>qU("sequence",{goal:A,...x}));pi.command("subjects <topic>").description("Generate A/B subject line variants").option("-c, --count <number>","Number of variants","5").option("--company <id>","Company ID override for personal API keys").option("--json","Print raw JSON").action((A,x)=>qU("subjects",{topic:A,...x}));await B8.parseAsync();process.exit(process.exitCode??0);
|