🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@vyron/cli

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vyron/cli - npm Package Compare versions

Comparing version
1.1.0
to
1.1.1
+33
-33
dist/index.mjs

@@ -1,42 +0,42 @@

import D from"node:fs";import A from"node:path";import Wt from"child_process";import W from"path";import z from"fs";import zt from"download-git-repo";import Ut from"readline";import Jt from"events";var Kt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Y(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var j={exports:{}},U,ke;function Gt(){if(ke)return U;ke=1,U=e,e.sync=l;var t=z;function o(a,r){var d=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!d||(d=d.split(";"),d.indexOf("")!==-1))return!0;for(var i=0;i<d.length;i++){var n=d[i].toLowerCase();if(n&&a.substr(-n.length).toLowerCase()===n)return!0}return!1}function f(a,r,d){return!a.isSymbolicLink()&&!a.isFile()?!1:o(r,d)}function e(a,r,d){t.stat(a,function(i,n){d(i,i?!1:f(n,a,r))})}function l(a,r){return f(t.statSync(a),a,r)}return U}var J,Ve;function Zt(){if(Ve)return J;Ve=1,J=o,o.sync=f;var t=z;function o(a,r,d){t.stat(a,function(i,n){d(i,i?!1:e(n,r))})}function f(a,r){return e(t.statSync(a),r)}function e(a,r){return a.isFile()&&l(a,r)}function l(a,r){var d=a.mode,i=a.uid,n=a.gid,s=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),h=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),m=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),p=m|c,b=d&u||d&c&&n===h||d&m&&i===s||d&p&&s===0;return b}return J}var K,We;function Xt(){if(We)return K;We=1;var t;process.platform==="win32"||Kt.TESTING_WINDOWS?t=Gt():t=Zt(),K=o,o.sync=f;function o(e,l,a){if(typeof l=="function"&&(a=l,l={}),!a){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,d){o(e,l||{},function(i,n){i?d(i):r(n)})})}t(e,l||{},function(r,d){r&&(r.code==="EACCES"||l&&l.ignoreErrors)&&(r=null,d=!1),a(r,d)})}function f(e,l){try{return t.sync(e,l||{})}catch(a){if(l&&l.ignoreErrors||a.code==="EACCES")return!1;throw a}}return K}var G,ze;function Qt(){if(ze)return G;ze=1;const t=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",o=W,f=t?";":":",e=Xt(),l=i=>Object.assign(new Error(`not found: ${i}`),{code:"ENOENT"}),a=(i,n)=>{const s=n.colon||f,h=i.match(/\//)||t&&i.match(/\\/)?[""]:[...t?[process.cwd()]:[],...(n.path||process.env.PATH||"").split(s)],m=t?n.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",c=t?m.split(s):[""];return t&&i.indexOf(".")!==-1&&c[0]!==""&&c.unshift(""),{pathEnv:h,pathExt:c,pathExtExe:m}},r=(i,n,s)=>{typeof n=="function"&&(s=n,n={}),n||(n={});const{pathEnv:h,pathExt:m,pathExtExe:c}=a(i,n),u=[],p=x=>new Promise((C,S)=>{if(x===h.length)return n.all&&u.length?C(u):S(l(i));const g=h[x],v=/^".*"$/.test(g)?g.slice(1,-1):g,y=o.join(v,i),w=!v&&/^\.[\\\/]/.test(i)?i.slice(0,2)+y:y;C(b(w,x,0))}),b=(x,C,S)=>new Promise((g,v)=>{if(S===m.length)return g(p(C+1));const y=m[S];e(x+y,{pathExt:c},(w,$)=>{if(!w&&$)if(n.all)u.push(x+y);else return g(x+y);return g(b(x,C,S+1))})});return s?p(0).then(x=>s(null,x),s):p(0)},d=(i,n)=>{n=n||{};const{pathEnv:s,pathExt:h,pathExtExe:m}=a(i,n),c=[];for(let u=0;u<s.length;u++){const p=s[u],b=/^".*"$/.test(p)?p.slice(1,-1):p,x=o.join(b,i),C=!b&&/^\.[\\\/]/.test(i)?i.slice(0,2)+x:x;for(let S=0;S<h.length;S++){const g=C+h[S];try{if(e.sync(g,{pathExt:m}))if(n.all)c.push(g);else return g}catch{}}}if(n.all&&c.length)return c;if(n.nothrow)return null;throw l(i)};return G=r,r.sync=d,G}var H={exports:{}},Ue;function ei(){if(Ue)return H.exports;Ue=1;const t=(o={})=>{const f=o.env||process.env;return(o.platform||process.platform)!=="win32"?"PATH":Object.keys(f).reverse().find(l=>l.toUpperCase()==="PATH")||"Path"};return H.exports=t,H.exports.default=t,H.exports}var Z,Je;function ti(){if(Je)return Z;Je=1;const t=W,o=Qt(),f=ei();function e(a,r){const d=a.options.env||process.env,i=process.cwd(),n=a.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(a.options.cwd)}catch{}let h;try{h=o.sync(a.command,{path:d[f({env:d})],pathExt:r?t.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return h&&(h=t.resolve(n?a.options.cwd:"",h)),h}function l(a){return e(a)||e(a,!0)}return Z=l,Z}var L={},Ke;function ii(){if(Ke)return L;Ke=1;const t=/([()\][%!^"`<>&|;, *?])/g;function o(e){return e=e.replace(t,"^$1"),e}function f(e,l){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(t,"^$1"),l&&(e=e.replace(t,"^$1")),e}return L.command=o,L.argument=f,L}var X,Ge;function ri(){return Ge||(Ge=1,X=/^#!(.*)/),X}var Q,Ze;function si(){if(Ze)return Q;Ze=1;const t=ri();return Q=(o="")=>{const f=o.match(t);if(!f)return null;const[e,l]=f[0].replace(/#! ?/,"").split(" "),a=e.split("/").pop();return a==="env"?l:l?`${a} ${l}`:a},Q}var ee,Xe;function ni(){if(Xe)return ee;Xe=1;const t=z,o=si();function f(e){const a=Buffer.alloc(150);let r;try{r=t.openSync(e,"r"),t.readSync(r,a,0,150,0),t.closeSync(r)}catch{}return o(a.toString())}return ee=f,ee}var te,Qe;function oi(){if(Qe)return te;Qe=1;const t=W,o=ti(),f=ii(),e=ni(),l=process.platform==="win32",a=/\.(?:com|exe)$/i,r=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function d(s){s.file=o(s);const h=s.file&&e(s.file);return h?(s.args.unshift(s.file),s.command=h,o(s)):s.file}function i(s){if(!l)return s;const h=d(s),m=!a.test(h);if(s.options.forceShell||m){const c=r.test(h);s.command=t.normalize(s.command),s.command=f.command(s.command),s.args=s.args.map(p=>f.argument(p,c));const u=[s.command].concat(s.args).join(" ");s.args=["/d","/s","/c",`"${u}"`],s.command=process.env.comspec||"cmd.exe",s.options.windowsVerbatimArguments=!0}return s}function n(s,h,m){h&&!Array.isArray(h)&&(m=h,h=null),h=h?h.slice(0):[],m=Object.assign({},m);const c={command:s,args:h,options:m,file:void 0,original:{command:s,args:h}};return m.shell?c:i(c)}return te=n,te}var ie,et;function li(){if(et)return ie;et=1;const t=process.platform==="win32";function o(a,r){return Object.assign(new Error(`${r} ${a.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${a.command}`,path:a.command,spawnargs:a.args})}function f(a,r){if(!t)return;const d=a.emit;a.emit=function(i,n){if(i==="exit"){const s=e(n,r);if(s)return d.call(a,"error",s)}return d.apply(a,arguments)}}function e(a,r){return t&&a===1&&!r.file?o(r.original,"spawn"):null}function l(a,r){return t&&a===1&&!r.file?o(r.original,"spawnSync"):null}return ie={hookChildProcess:f,verifyENOENT:e,verifyENOENTSync:l,notFoundError:o},ie}var tt;function ai(){if(tt)return j.exports;tt=1;const t=Wt,o=oi(),f=li();function e(a,r,d){const i=o(a,r,d),n=t.spawn(i.command,i.args,i.options);return f.hookChildProcess(n,i),n}function l(a,r,d){const i=o(a,r,d),n=t.spawnSync(i.command,i.args,i.options);return n.error=n.error||f.verifyENOENTSync(n.status,i),n}return j.exports=e,j.exports.spawn=e,j.exports.sync=l,j.exports._parse=o,j.exports._enoent=f,j.exports}var hi=ai();const ui=Y(hi);var re,it;function ci(){if(it)return re;it=1;function t(e,l){var a=e;l.slice(0,-1).forEach(function(d){a=a[d]||{}});var r=l[l.length-1];return r in a}function o(e){return typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function f(e,l){return l==="constructor"&&typeof e[l]=="function"||l==="__proto__"}return re=function(e,l){l||(l={});var a={bools:{},strings:{},unknownFn:null};typeof l.unknown=="function"&&(a.unknownFn=l.unknown),typeof l.boolean=="boolean"&&l.boolean?a.allBools=!0:[].concat(l.boolean).filter(Boolean).forEach(function(w){a.bools[w]=!0});var r={};function d(w){return r[w].some(function($){return a.bools[$]})}Object.keys(l.alias||{}).forEach(function(w){r[w]=[].concat(l.alias[w]),r[w].forEach(function($){r[$]=[w].concat(r[w].filter(function(O){return $!==O}))})}),[].concat(l.string).filter(Boolean).forEach(function(w){a.strings[w]=!0,r[w]&&[].concat(r[w]).forEach(function($){a.strings[$]=!0})});var i=l.default||{},n={_:[]};function s(w,$){return a.allBools&&/^--[^=]+$/.test($)||a.strings[w]||a.bools[w]||r[w]}function h(w,$,O){for(var E=w,F=0;F<$.length-1;F++){var R=$[F];if(f(E,R))return;E[R]===void 0&&(E[R]={}),(E[R]===Object.prototype||E[R]===Number.prototype||E[R]===String.prototype)&&(E[R]={}),E[R]===Array.prototype&&(E[R]=[]),E=E[R]}var q=$[$.length-1];f(E,q)||((E===Object.prototype||E===Number.prototype||E===String.prototype)&&(E={}),E===Array.prototype&&(E=[]),E[q]===void 0||a.bools[q]||typeof E[q]=="boolean"?E[q]=O:Array.isArray(E[q])?E[q].push(O):E[q]=[E[q],O])}function m(w,$,O){if(!(O&&a.unknownFn&&!s(w,O)&&a.unknownFn(O)===!1)){var E=!a.strings[w]&&o($)?Number($):$;h(n,w.split("."),E),(r[w]||[]).forEach(function(F){h(n,F.split("."),E)})}}Object.keys(a.bools).forEach(function(w){m(w,i[w]===void 0?!1:i[w])});var c=[];e.indexOf("--")!==-1&&(c=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var u=0;u<e.length;u++){var p=e[u],b,x;if(/^--.+=/.test(p)){var C=p.match(/^--([^=]+)=([\s\S]*)$/);b=C[1];var S=C[2];a.bools[b]&&(S=S!=="false"),m(b,S,p)}else if(/^--no-.+/.test(p))b=p.match(/^--no-(.+)/)[1],m(b,!1,p);else if(/^--.+/.test(p))b=p.match(/^--(.+)/)[1],x=e[u+1],x!==void 0&&!/^(-|--)[^-]/.test(x)&&!a.bools[b]&&!a.allBools&&(!r[b]||!d(b))?(m(b,x,p),u+=1):/^(true|false)$/.test(x)?(m(b,x==="true",p),u+=1):m(b,a.strings[b]?"":!0,p);else if(/^-[^-]+/.test(p)){for(var g=p.slice(1,-1).split(""),v=!1,y=0;y<g.length;y++){if(x=p.slice(y+2),x==="-"){m(g[y],x,p);continue}if(/[A-Za-z]/.test(g[y])&&x[0]==="="){m(g[y],x.slice(1),p),v=!0;break}if(/[A-Za-z]/.test(g[y])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(x)){m(g[y],x,p),v=!0;break}if(g[y+1]&&g[y+1].match(/\W/)){m(g[y],p.slice(y+2),p),v=!0;break}else m(g[y],a.strings[g[y]]?"":!0,p)}b=p.slice(-1)[0],!v&&b!=="-"&&(e[u+1]&&!/^(-|--)[^-]/.test(e[u+1])&&!a.bools[b]&&(!r[b]||!d(b))?(m(b,e[u+1],p),u+=1):e[u+1]&&/^(true|false)$/.test(e[u+1])?(m(b,e[u+1]==="true",p),u+=1):m(b,a.strings[b]?"":!0,p))}else if((!a.unknownFn||a.unknownFn(p)!==!1)&&n._.push(a.strings._||!o(p)?p:Number(p)),l.stopEarly){n._.push.apply(n._,e.slice(u+1));break}}return Object.keys(i).forEach(function(w){t(n,w.split("."))||(h(n,w.split("."),i[w]),(r[w]||[]).forEach(function($){h(n,$.split("."),i[w])}))}),l["--"]?n["--"]=c.slice():c.forEach(function(w){n._.push(w)}),n},re}var di=ci();const fi=Y(di);var k={exports:{}},rt;function mi(){if(rt)return k.exports;rt=1;let t=process||{},o=t.argv||[],f=t.env||{},e=!(f.NO_COLOR||o.includes("--no-color"))&&(!!f.FORCE_COLOR||o.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&f.TERM!=="dumb"||!!f.CI),l=(d,i,n=d)=>s=>{let h=""+s,m=h.indexOf(i,d.length);return~m?d+a(h,i,n,m)+i:d+h+i},a=(d,i,n,s)=>{let h="",m=0;do h+=d.substring(m,s)+n,m=s+i.length,s=d.indexOf(i,m);while(~s);return h+d.substring(m)},r=(d=e)=>{let i=d?l:()=>String;return{isColorSupported:d,reset:i("\x1B[0m","\x1B[0m"),bold:i("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:i("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:i("\x1B[3m","\x1B[23m"),underline:i("\x1B[4m","\x1B[24m"),inverse:i("\x1B[7m","\x1B[27m"),hidden:i("\x1B[8m","\x1B[28m"),strikethrough:i("\x1B[9m","\x1B[29m"),black:i("\x1B[30m","\x1B[39m"),red:i("\x1B[31m","\x1B[39m"),green:i("\x1B[32m","\x1B[39m"),yellow:i("\x1B[33m","\x1B[39m"),blue:i("\x1B[34m","\x1B[39m"),magenta:i("\x1B[35m","\x1B[39m"),cyan:i("\x1B[36m","\x1B[39m"),white:i("\x1B[37m","\x1B[39m"),gray:i("\x1B[90m","\x1B[39m"),bgBlack:i("\x1B[40m","\x1B[49m"),bgRed:i("\x1B[41m","\x1B[49m"),bgGreen:i("\x1B[42m","\x1B[49m"),bgYellow:i("\x1B[43m","\x1B[49m"),bgBlue:i("\x1B[44m","\x1B[49m"),bgMagenta:i("\x1B[45m","\x1B[49m"),bgCyan:i("\x1B[46m","\x1B[49m"),bgWhite:i("\x1B[47m","\x1B[49m"),blackBright:i("\x1B[90m","\x1B[39m"),redBright:i("\x1B[91m","\x1B[39m"),greenBright:i("\x1B[92m","\x1B[39m"),yellowBright:i("\x1B[93m","\x1B[39m"),blueBright:i("\x1B[94m","\x1B[39m"),magentaBright:i("\x1B[95m","\x1B[39m"),cyanBright:i("\x1B[96m","\x1B[39m"),whiteBright:i("\x1B[97m","\x1B[39m"),bgBlackBright:i("\x1B[100m","\x1B[49m"),bgRedBright:i("\x1B[101m","\x1B[49m"),bgGreenBright:i("\x1B[102m","\x1B[49m"),bgYellowBright:i("\x1B[103m","\x1B[49m"),bgBlueBright:i("\x1B[104m","\x1B[49m"),bgMagentaBright:i("\x1B[105m","\x1B[49m"),bgCyanBright:i("\x1B[106m","\x1B[49m"),bgWhiteBright:i("\x1B[107m","\x1B[49m")}};return k.exports=r(),k.exports.createColors=r,k.exports}var pi=mi();const gi=Y(pi);var se={},ne,st;function M(){if(st)return ne;st=1;const{FORCE_COLOR:t,NODE_DISABLE_COLORS:o,TERM:f}=process.env,e={enabled:!o&&f!=="dumb"&&t!=="0",reset:r(0,0),bold:r(1,22),dim:r(2,22),italic:r(3,23),underline:r(4,24),inverse:r(7,27),hidden:r(8,28),strikethrough:r(9,29),black:r(30,39),red:r(31,39),green:r(32,39),yellow:r(33,39),blue:r(34,39),magenta:r(35,39),cyan:r(36,39),white:r(37,39),gray:r(90,39),grey:r(90,39),bgBlack:r(40,49),bgRed:r(41,49),bgGreen:r(42,49),bgYellow:r(43,49),bgBlue:r(44,49),bgMagenta:r(45,49),bgCyan:r(46,49),bgWhite:r(47,49)};function l(d,i){let n=0,s,h="",m="";for(;n<d.length;n++)s=d[n],h+=s.open,m+=s.close,i.includes(s.close)&&(i=i.replace(s.rgx,s.close+s.open));return h+i+m}function a(d,i){let n={has:d,keys:i};return n.reset=e.reset.bind(n),n.bold=e.bold.bind(n),n.dim=e.dim.bind(n),n.italic=e.italic.bind(n),n.underline=e.underline.bind(n),n.inverse=e.inverse.bind(n),n.hidden=e.hidden.bind(n),n.strikethrough=e.strikethrough.bind(n),n.black=e.black.bind(n),n.red=e.red.bind(n),n.green=e.green.bind(n),n.yellow=e.yellow.bind(n),n.blue=e.blue.bind(n),n.magenta=e.magenta.bind(n),n.cyan=e.cyan.bind(n),n.white=e.white.bind(n),n.gray=e.gray.bind(n),n.grey=e.grey.bind(n),n.bgBlack=e.bgBlack.bind(n),n.bgRed=e.bgRed.bind(n),n.bgGreen=e.bgGreen.bind(n),n.bgYellow=e.bgYellow.bind(n),n.bgBlue=e.bgBlue.bind(n),n.bgMagenta=e.bgMagenta.bind(n),n.bgCyan=e.bgCyan.bind(n),n.bgWhite=e.bgWhite.bind(n),n}function r(d,i){let n={open:`\x1B[${d}m`,close:`\x1B[${i}m`,rgx:new RegExp(`\\x1b\\[${i}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(d)||(this.has.push(d),this.keys.push(n)),s===void 0?this:e.enabled?l(this.keys,s+""):s+""):s===void 0?a([d],[n]):e.enabled?l([n],s+""):s+""}}return ne=e,ne}var oe,nt;function bi(){return nt||(nt=1,oe=(t,o)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(o){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}),oe}var le,ot;function ae(){return ot||(ot=1,le=t=>{const o=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),f=new RegExp(o,"g");return typeof t=="string"?t.replace(f,""):t}),le}var he,lt;function P(){if(lt)return he;lt=1;const t="\x1B",o=`${t}[`,f="\x07",e={to(r,d){return d?`${o}${d+1};${r+1}H`:`${o}${r+1}G`},move(r,d){let i="";return r<0?i+=`${o}${-r}D`:r>0&&(i+=`${o}${r}C`),d<0?i+=`${o}${-d}A`:d>0&&(i+=`${o}${d}B`),i},up:(r=1)=>`${o}${r}A`,down:(r=1)=>`${o}${r}B`,forward:(r=1)=>`${o}${r}C`,backward:(r=1)=>`${o}${r}D`,nextLine:(r=1)=>`${o}E`.repeat(r),prevLine:(r=1)=>`${o}F`.repeat(r),left:`${o}G`,hide:`${o}?25l`,show:`${o}?25h`,save:`${t}7`,restore:`${t}8`},l={up:(r=1)=>`${o}S`.repeat(r),down:(r=1)=>`${o}T`.repeat(r)},a={screen:`${o}2J`,up:(r=1)=>`${o}1J`.repeat(r),down:(r=1)=>`${o}J`.repeat(r),line:`${o}2K`,lineEnd:`${o}K`,lineStart:`${o}1K`,lines(r){let d="";for(let i=0;i<r;i++)d+=this.line+(i<r-1?e.up():"");return r&&(d+=e.left),d}};return he={cursor:e,scroll:l,erase:a,beep:f},he}var ue,at;function vi(){if(at)return ue;at=1;const t=ae(),{erase:o,cursor:f}=P(),e=l=>[...t(l)].length;return ue=function(l,a){if(!a)return o.line+f.to(0);let r=0;const d=l.split(/\r?\n/);for(let i of d)r+=1+Math.floor(Math.max(e(i)-1,0)/a);return o.lines(r)},ue}var ce,ht;function ut(){if(ht)return ce;ht=1;const t={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},o={arrowUp:t.arrowUp,arrowDown:t.arrowDown,arrowLeft:t.arrowLeft,arrowRight:t.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return ce=process.platform==="win32"?o:t,ce}var de,ct;function wi(){if(ct)return de;ct=1;const t=M(),o=ut(),f=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),e=i=>f[i]||f.default,l=Object.freeze({aborted:t.red(o.cross),done:t.green(o.tick),exited:t.yellow(o.cross),default:t.cyan("?")});return de={styles:f,render:e,symbols:l,symbol:(i,n,s)=>n?l.aborted:s?l.exited:i?l.done:l.default,delimiter:i=>t.gray(i?o.ellipsis:o.pointerSmall),item:(i,n)=>t.gray(i?n?o.pointerSmall:"+":o.line)},de}var fe,dt;function xi(){if(dt)return fe;dt=1;const t=ae();return fe=function(o,f){let e=String(t(o)||"").split(/\r?\n/);return f?e.map(l=>Math.ceil(l.length/f)).reduce((l,a)=>l+a):e.length},fe}var me,ft;function yi(){return ft||(ft=1,me=(t,o={})=>{const f=Number.isSafeInteger(parseInt(o.margin))?new Array(parseInt(o.margin)).fill(" ").join(""):o.margin||"",e=o.width;return(t||"").split(/\r?\n/g).map(l=>l.split(/\s+/g).reduce((a,r)=>(r.length+f.length>=e||a[a.length-1].length+r.length+1<e?a[a.length-1]+=` ${r}`:a.push(`${f}${r}`),a),[f]).join(`
import D from"node:fs";import A from"node:path";import Wt from"child_process";import W from"path";import z from"fs";import zt from"download-git-repo";import Jt from"readline";import Kt from"events";var Ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Y(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var j={exports:{}},J,ke;function Gt(){if(ke)return J;ke=1,J=e,e.sync=a;var t=z;function o(l,r){var d=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!d||(d=d.split(";"),d.indexOf("")!==-1))return!0;for(var i=0;i<d.length;i++){var n=d[i].toLowerCase();if(n&&l.substr(-n.length).toLowerCase()===n)return!0}return!1}function f(l,r,d){return!l.isSymbolicLink()&&!l.isFile()?!1:o(r,d)}function e(l,r,d){t.stat(l,function(i,n){d(i,i?!1:f(n,l,r))})}function a(l,r){return f(t.statSync(l),l,r)}return J}var K,Ve;function Zt(){if(Ve)return K;Ve=1,K=o,o.sync=f;var t=z;function o(l,r,d){t.stat(l,function(i,n){d(i,i?!1:e(n,r))})}function f(l,r){return e(t.statSync(l),r)}function e(l,r){return l.isFile()&&a(l,r)}function a(l,r){var d=l.mode,i=l.uid,n=l.gid,s=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),h=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),m=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),p=m|u,g=d&c||d&u&&n===h||d&m&&i===s||d&p&&s===0;return g}return K}var U,We;function Xt(){if(We)return U;We=1;var t;process.platform==="win32"||Ut.TESTING_WINDOWS?t=Gt():t=Zt(),U=o,o.sync=f;function o(e,a,l){if(typeof a=="function"&&(l=a,a={}),!l){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,d){o(e,a||{},function(i,n){i?d(i):r(n)})})}t(e,a||{},function(r,d){r&&(r.code==="EACCES"||a&&a.ignoreErrors)&&(r=null,d=!1),l(r,d)})}function f(e,a){try{return t.sync(e,a||{})}catch(l){if(a&&a.ignoreErrors||l.code==="EACCES")return!1;throw l}}return U}var G,ze;function Qt(){if(ze)return G;ze=1;const t=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",o=W,f=t?";":":",e=Xt(),a=i=>Object.assign(new Error(`not found: ${i}`),{code:"ENOENT"}),l=(i,n)=>{const s=n.colon||f,h=i.match(/\//)||t&&i.match(/\\/)?[""]:[...t?[process.cwd()]:[],...(n.path||process.env.PATH||"").split(s)],m=t?n.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",u=t?m.split(s):[""];return t&&i.indexOf(".")!==-1&&u[0]!==""&&u.unshift(""),{pathEnv:h,pathExt:u,pathExtExe:m}},r=(i,n,s)=>{typeof n=="function"&&(s=n,n={}),n||(n={});const{pathEnv:h,pathExt:m,pathExtExe:u}=l(i,n),c=[],p=y=>new Promise((E,v)=>{if(y===h.length)return n.all&&c.length?E(c):v(a(i));const b=h[y],w=/^".*"$/.test(b)?b.slice(1,-1):b,S=o.join(w,i),x=!w&&/^\.[\\\/]/.test(i)?i.slice(0,2)+S:S;E(g(x,y,0))}),g=(y,E,v)=>new Promise((b,w)=>{if(v===m.length)return b(p(E+1));const S=m[v];e(y+S,{pathExt:u},(x,$)=>{if(!x&&$)if(n.all)c.push(y+S);else return b(y+S);return b(g(y,E,v+1))})});return s?p(0).then(y=>s(null,y),s):p(0)},d=(i,n)=>{n=n||{};const{pathEnv:s,pathExt:h,pathExtExe:m}=l(i,n),u=[];for(let c=0;c<s.length;c++){const p=s[c],g=/^".*"$/.test(p)?p.slice(1,-1):p,y=o.join(g,i),E=!g&&/^\.[\\\/]/.test(i)?i.slice(0,2)+y:y;for(let v=0;v<h.length;v++){const b=E+h[v];try{if(e.sync(b,{pathExt:m}))if(n.all)u.push(b);else return b}catch{}}}if(n.all&&u.length)return u;if(n.nothrow)return null;throw a(i)};return G=r,r.sync=d,G}var L={exports:{}},Je;function ei(){if(Je)return L.exports;Je=1;const t=(o={})=>{const f=o.env||process.env;return(o.platform||process.platform)!=="win32"?"PATH":Object.keys(f).reverse().find(a=>a.toUpperCase()==="PATH")||"Path"};return L.exports=t,L.exports.default=t,L.exports}var Z,Ke;function ti(){if(Ke)return Z;Ke=1;const t=W,o=Qt(),f=ei();function e(l,r){const d=l.options.env||process.env,i=process.cwd(),n=l.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(l.options.cwd)}catch{}let h;try{h=o.sync(l.command,{path:d[f({env:d})],pathExt:r?t.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return h&&(h=t.resolve(n?l.options.cwd:"",h)),h}function a(l){return e(l)||e(l,!0)}return Z=a,Z}var H={},Ue;function ii(){if(Ue)return H;Ue=1;const t=/([()\][%!^"`<>&|;, *?])/g;function o(e){return e=e.replace(t,"^$1"),e}function f(e,a){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(t,"^$1"),a&&(e=e.replace(t,"^$1")),e}return H.command=o,H.argument=f,H}var X,Ge;function ri(){return Ge||(Ge=1,X=/^#!(.*)/),X}var Q,Ze;function si(){if(Ze)return Q;Ze=1;const t=ri();return Q=(o="")=>{const f=o.match(t);if(!f)return null;const[e,a]=f[0].replace(/#! ?/,"").split(" "),l=e.split("/").pop();return l==="env"?a:a?`${l} ${a}`:l},Q}var ee,Xe;function ni(){if(Xe)return ee;Xe=1;const t=z,o=si();function f(e){const l=Buffer.alloc(150);let r;try{r=t.openSync(e,"r"),t.readSync(r,l,0,150,0),t.closeSync(r)}catch{}return o(l.toString())}return ee=f,ee}var te,Qe;function oi(){if(Qe)return te;Qe=1;const t=W,o=ti(),f=ii(),e=ni(),a=process.platform==="win32",l=/\.(?:com|exe)$/i,r=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function d(s){s.file=o(s);const h=s.file&&e(s.file);return h?(s.args.unshift(s.file),s.command=h,o(s)):s.file}function i(s){if(!a)return s;const h=d(s),m=!l.test(h);if(s.options.forceShell||m){const u=r.test(h);s.command=t.normalize(s.command),s.command=f.command(s.command),s.args=s.args.map(p=>f.argument(p,u));const c=[s.command].concat(s.args).join(" ");s.args=["/d","/s","/c",`"${c}"`],s.command=process.env.comspec||"cmd.exe",s.options.windowsVerbatimArguments=!0}return s}function n(s,h,m){h&&!Array.isArray(h)&&(m=h,h=null),h=h?h.slice(0):[],m=Object.assign({},m);const u={command:s,args:h,options:m,file:void 0,original:{command:s,args:h}};return m.shell?u:i(u)}return te=n,te}var ie,et;function li(){if(et)return ie;et=1;const t=process.platform==="win32";function o(l,r){return Object.assign(new Error(`${r} ${l.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${l.command}`,path:l.command,spawnargs:l.args})}function f(l,r){if(!t)return;const d=l.emit;l.emit=function(i,n){if(i==="exit"){const s=e(n,r);if(s)return d.call(l,"error",s)}return d.apply(l,arguments)}}function e(l,r){return t&&l===1&&!r.file?o(r.original,"spawn"):null}function a(l,r){return t&&l===1&&!r.file?o(r.original,"spawnSync"):null}return ie={hookChildProcess:f,verifyENOENT:e,verifyENOENTSync:a,notFoundError:o},ie}var tt;function ai(){if(tt)return j.exports;tt=1;const t=Wt,o=oi(),f=li();function e(l,r,d){const i=o(l,r,d),n=t.spawn(i.command,i.args,i.options);return f.hookChildProcess(n,i),n}function a(l,r,d){const i=o(l,r,d),n=t.spawnSync(i.command,i.args,i.options);return n.error=n.error||f.verifyENOENTSync(n.status,i),n}return j.exports=e,j.exports.spawn=e,j.exports.sync=a,j.exports._parse=o,j.exports._enoent=f,j.exports}var hi=ai();const ui=Y(hi);var re,it;function ci(){if(it)return re;it=1;function t(e,a){var l=e;a.slice(0,-1).forEach(function(d){l=l[d]||{}});var r=a[a.length-1];return r in l}function o(e){return typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function f(e,a){return a==="constructor"&&typeof e[a]=="function"||a==="__proto__"}return re=function(e,a){a||(a={});var l={bools:{},strings:{},unknownFn:null};typeof a.unknown=="function"&&(l.unknownFn=a.unknown),typeof a.boolean=="boolean"&&a.boolean?l.allBools=!0:[].concat(a.boolean).filter(Boolean).forEach(function(x){l.bools[x]=!0});var r={};function d(x){return r[x].some(function($){return l.bools[$]})}Object.keys(a.alias||{}).forEach(function(x){r[x]=[].concat(a.alias[x]),r[x].forEach(function($){r[$]=[x].concat(r[x].filter(function(O){return $!==O}))})}),[].concat(a.string).filter(Boolean).forEach(function(x){l.strings[x]=!0,r[x]&&[].concat(r[x]).forEach(function($){l.strings[$]=!0})});var i=a.default||{},n={_:[]};function s(x,$){return l.allBools&&/^--[^=]+$/.test($)||l.strings[x]||l.bools[x]||r[x]}function h(x,$,O){for(var C=x,F=0;F<$.length-1;F++){var R=$[F];if(f(C,R))return;C[R]===void 0&&(C[R]={}),(C[R]===Object.prototype||C[R]===Number.prototype||C[R]===String.prototype)&&(C[R]={}),C[R]===Array.prototype&&(C[R]=[]),C=C[R]}var q=$[$.length-1];f(C,q)||((C===Object.prototype||C===Number.prototype||C===String.prototype)&&(C={}),C===Array.prototype&&(C=[]),C[q]===void 0||l.bools[q]||typeof C[q]=="boolean"?C[q]=O:Array.isArray(C[q])?C[q].push(O):C[q]=[C[q],O])}function m(x,$,O){if(!(O&&l.unknownFn&&!s(x,O)&&l.unknownFn(O)===!1)){var C=!l.strings[x]&&o($)?Number($):$;h(n,x.split("."),C),(r[x]||[]).forEach(function(F){h(n,F.split("."),C)})}}Object.keys(l.bools).forEach(function(x){m(x,i[x]===void 0?!1:i[x])});var u=[];e.indexOf("--")!==-1&&(u=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var c=0;c<e.length;c++){var p=e[c],g,y;if(/^--.+=/.test(p)){var E=p.match(/^--([^=]+)=([\s\S]*)$/);g=E[1];var v=E[2];l.bools[g]&&(v=v!=="false"),m(g,v,p)}else if(/^--no-.+/.test(p))g=p.match(/^--no-(.+)/)[1],m(g,!1,p);else if(/^--.+/.test(p))g=p.match(/^--(.+)/)[1],y=e[c+1],y!==void 0&&!/^(-|--)[^-]/.test(y)&&!l.bools[g]&&!l.allBools&&(!r[g]||!d(g))?(m(g,y,p),c+=1):/^(true|false)$/.test(y)?(m(g,y==="true",p),c+=1):m(g,l.strings[g]?"":!0,p);else if(/^-[^-]+/.test(p)){for(var b=p.slice(1,-1).split(""),w=!1,S=0;S<b.length;S++){if(y=p.slice(S+2),y==="-"){m(b[S],y,p);continue}if(/[A-Za-z]/.test(b[S])&&y[0]==="="){m(b[S],y.slice(1),p),w=!0;break}if(/[A-Za-z]/.test(b[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(y)){m(b[S],y,p),w=!0;break}if(b[S+1]&&b[S+1].match(/\W/)){m(b[S],p.slice(S+2),p),w=!0;break}else m(b[S],l.strings[b[S]]?"":!0,p)}g=p.slice(-1)[0],!w&&g!=="-"&&(e[c+1]&&!/^(-|--)[^-]/.test(e[c+1])&&!l.bools[g]&&(!r[g]||!d(g))?(m(g,e[c+1],p),c+=1):e[c+1]&&/^(true|false)$/.test(e[c+1])?(m(g,e[c+1]==="true",p),c+=1):m(g,l.strings[g]?"":!0,p))}else if((!l.unknownFn||l.unknownFn(p)!==!1)&&n._.push(l.strings._||!o(p)?p:Number(p)),a.stopEarly){n._.push.apply(n._,e.slice(c+1));break}}return Object.keys(i).forEach(function(x){t(n,x.split("."))||(h(n,x.split("."),i[x]),(r[x]||[]).forEach(function($){h(n,$.split("."),i[x])}))}),a["--"]?n["--"]=u.slice():u.forEach(function(x){n._.push(x)}),n},re}var di=ci();const fi=Y(di);var k={exports:{}},rt;function mi(){if(rt)return k.exports;rt=1;let t=process||{},o=t.argv||[],f=t.env||{},e=!(f.NO_COLOR||o.includes("--no-color"))&&(!!f.FORCE_COLOR||o.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&f.TERM!=="dumb"||!!f.CI),a=(d,i,n=d)=>s=>{let h=""+s,m=h.indexOf(i,d.length);return~m?d+l(h,i,n,m)+i:d+h+i},l=(d,i,n,s)=>{let h="",m=0;do h+=d.substring(m,s)+n,m=s+i.length,s=d.indexOf(i,m);while(~s);return h+d.substring(m)},r=(d=e)=>{let i=d?a:()=>String;return{isColorSupported:d,reset:i("\x1B[0m","\x1B[0m"),bold:i("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:i("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:i("\x1B[3m","\x1B[23m"),underline:i("\x1B[4m","\x1B[24m"),inverse:i("\x1B[7m","\x1B[27m"),hidden:i("\x1B[8m","\x1B[28m"),strikethrough:i("\x1B[9m","\x1B[29m"),black:i("\x1B[30m","\x1B[39m"),red:i("\x1B[31m","\x1B[39m"),green:i("\x1B[32m","\x1B[39m"),yellow:i("\x1B[33m","\x1B[39m"),blue:i("\x1B[34m","\x1B[39m"),magenta:i("\x1B[35m","\x1B[39m"),cyan:i("\x1B[36m","\x1B[39m"),white:i("\x1B[37m","\x1B[39m"),gray:i("\x1B[90m","\x1B[39m"),bgBlack:i("\x1B[40m","\x1B[49m"),bgRed:i("\x1B[41m","\x1B[49m"),bgGreen:i("\x1B[42m","\x1B[49m"),bgYellow:i("\x1B[43m","\x1B[49m"),bgBlue:i("\x1B[44m","\x1B[49m"),bgMagenta:i("\x1B[45m","\x1B[49m"),bgCyan:i("\x1B[46m","\x1B[49m"),bgWhite:i("\x1B[47m","\x1B[49m"),blackBright:i("\x1B[90m","\x1B[39m"),redBright:i("\x1B[91m","\x1B[39m"),greenBright:i("\x1B[92m","\x1B[39m"),yellowBright:i("\x1B[93m","\x1B[39m"),blueBright:i("\x1B[94m","\x1B[39m"),magentaBright:i("\x1B[95m","\x1B[39m"),cyanBright:i("\x1B[96m","\x1B[39m"),whiteBright:i("\x1B[97m","\x1B[39m"),bgBlackBright:i("\x1B[100m","\x1B[49m"),bgRedBright:i("\x1B[101m","\x1B[49m"),bgGreenBright:i("\x1B[102m","\x1B[49m"),bgYellowBright:i("\x1B[103m","\x1B[49m"),bgBlueBright:i("\x1B[104m","\x1B[49m"),bgMagentaBright:i("\x1B[105m","\x1B[49m"),bgCyanBright:i("\x1B[106m","\x1B[49m"),bgWhiteBright:i("\x1B[107m","\x1B[49m")}};return k.exports=r(),k.exports.createColors=r,k.exports}var pi=mi();const gi=Y(pi);var se={},ne,st;function M(){if(st)return ne;st=1;const{FORCE_COLOR:t,NODE_DISABLE_COLORS:o,TERM:f}=process.env,e={enabled:!o&&f!=="dumb"&&t!=="0",reset:r(0,0),bold:r(1,22),dim:r(2,22),italic:r(3,23),underline:r(4,24),inverse:r(7,27),hidden:r(8,28),strikethrough:r(9,29),black:r(30,39),red:r(31,39),green:r(32,39),yellow:r(33,39),blue:r(34,39),magenta:r(35,39),cyan:r(36,39),white:r(37,39),gray:r(90,39),grey:r(90,39),bgBlack:r(40,49),bgRed:r(41,49),bgGreen:r(42,49),bgYellow:r(43,49),bgBlue:r(44,49),bgMagenta:r(45,49),bgCyan:r(46,49),bgWhite:r(47,49)};function a(d,i){let n=0,s,h="",m="";for(;n<d.length;n++)s=d[n],h+=s.open,m+=s.close,i.includes(s.close)&&(i=i.replace(s.rgx,s.close+s.open));return h+i+m}function l(d,i){let n={has:d,keys:i};return n.reset=e.reset.bind(n),n.bold=e.bold.bind(n),n.dim=e.dim.bind(n),n.italic=e.italic.bind(n),n.underline=e.underline.bind(n),n.inverse=e.inverse.bind(n),n.hidden=e.hidden.bind(n),n.strikethrough=e.strikethrough.bind(n),n.black=e.black.bind(n),n.red=e.red.bind(n),n.green=e.green.bind(n),n.yellow=e.yellow.bind(n),n.blue=e.blue.bind(n),n.magenta=e.magenta.bind(n),n.cyan=e.cyan.bind(n),n.white=e.white.bind(n),n.gray=e.gray.bind(n),n.grey=e.grey.bind(n),n.bgBlack=e.bgBlack.bind(n),n.bgRed=e.bgRed.bind(n),n.bgGreen=e.bgGreen.bind(n),n.bgYellow=e.bgYellow.bind(n),n.bgBlue=e.bgBlue.bind(n),n.bgMagenta=e.bgMagenta.bind(n),n.bgCyan=e.bgCyan.bind(n),n.bgWhite=e.bgWhite.bind(n),n}function r(d,i){let n={open:`\x1B[${d}m`,close:`\x1B[${i}m`,rgx:new RegExp(`\\x1b\\[${i}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(d)||(this.has.push(d),this.keys.push(n)),s===void 0?this:e.enabled?a(this.keys,s+""):s+""):s===void 0?l([d],[n]):e.enabled?a([n],s+""):s+""}}return ne=e,ne}var oe,nt;function bi(){return nt||(nt=1,oe=(t,o)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(o){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}),oe}var le,ot;function ae(){return ot||(ot=1,le=t=>{const o=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),f=new RegExp(o,"g");return typeof t=="string"?t.replace(f,""):t}),le}var he,lt;function P(){if(lt)return he;lt=1;const t="\x1B",o=`${t}[`,f="\x07",e={to(r,d){return d?`${o}${d+1};${r+1}H`:`${o}${r+1}G`},move(r,d){let i="";return r<0?i+=`${o}${-r}D`:r>0&&(i+=`${o}${r}C`),d<0?i+=`${o}${-d}A`:d>0&&(i+=`${o}${d}B`),i},up:(r=1)=>`${o}${r}A`,down:(r=1)=>`${o}${r}B`,forward:(r=1)=>`${o}${r}C`,backward:(r=1)=>`${o}${r}D`,nextLine:(r=1)=>`${o}E`.repeat(r),prevLine:(r=1)=>`${o}F`.repeat(r),left:`${o}G`,hide:`${o}?25l`,show:`${o}?25h`,save:`${t}7`,restore:`${t}8`},a={up:(r=1)=>`${o}S`.repeat(r),down:(r=1)=>`${o}T`.repeat(r)},l={screen:`${o}2J`,up:(r=1)=>`${o}1J`.repeat(r),down:(r=1)=>`${o}J`.repeat(r),line:`${o}2K`,lineEnd:`${o}K`,lineStart:`${o}1K`,lines(r){let d="";for(let i=0;i<r;i++)d+=this.line+(i<r-1?e.up():"");return r&&(d+=e.left),d}};return he={cursor:e,scroll:a,erase:l,beep:f},he}var ue,at;function vi(){if(at)return ue;at=1;const t=ae(),{erase:o,cursor:f}=P(),e=a=>[...t(a)].length;return ue=function(a,l){if(!l)return o.line+f.to(0);let r=0;const d=a.split(/\r?\n/);for(let i of d)r+=1+Math.floor(Math.max(e(i)-1,0)/l);return o.lines(r)},ue}var ce,ht;function ut(){if(ht)return ce;ht=1;const t={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},o={arrowUp:t.arrowUp,arrowDown:t.arrowDown,arrowLeft:t.arrowLeft,arrowRight:t.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return ce=process.platform==="win32"?o:t,ce}var de,ct;function wi(){if(ct)return de;ct=1;const t=M(),o=ut(),f=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),e=i=>f[i]||f.default,a=Object.freeze({aborted:t.red(o.cross),done:t.green(o.tick),exited:t.yellow(o.cross),default:t.cyan("?")});return de={styles:f,render:e,symbols:a,symbol:(i,n,s)=>n?a.aborted:s?a.exited:i?a.done:a.default,delimiter:i=>t.gray(i?o.ellipsis:o.pointerSmall),item:(i,n)=>t.gray(i?n?o.pointerSmall:"+":o.line)},de}var fe,dt;function xi(){if(dt)return fe;dt=1;const t=ae();return fe=function(o,f){let e=String(t(o)||"").split(/\r?\n/);return f?e.map(a=>Math.ceil(a.length/f)).reduce((a,l)=>a+l):e.length},fe}var me,ft;function yi(){return ft||(ft=1,me=(t,o={})=>{const f=Number.isSafeInteger(parseInt(o.margin))?new Array(parseInt(o.margin)).fill(" ").join(""):o.margin||"",e=o.width;return(t||"").split(/\r?\n/g).map(a=>a.split(/\s+/g).reduce((l,r)=>(r.length+f.length>=e||l[l.length-1].length+r.length+1<e?l[l.length-1]+=` ${r}`:l.push(`${f}${r}`),l),[f]).join(`
`)).join(`
`)}),me}var pe,mt;function Si(){return mt||(mt=1,pe=(t,o,f)=>{f=f||o;let e=Math.min(o-f,t-Math.floor(f/2));e<0&&(e=0);let l=Math.min(e+f,o);return{startIndex:e,endIndex:l}}),pe}var ge,pt;function T(){return pt||(pt=1,ge={action:bi(),clear:vi(),style:wi(),strip:ae(),figures:ut(),lines:xi(),wrap:yi(),entriesToDisplay:Si()}),ge}var be,gt;function I(){if(gt)return be;gt=1;const t=Ut,{action:o}=T(),f=Jt,{beep:e,cursor:l}=P(),a=M();class r extends f{constructor(i={}){super(),this.firstRender=!0,this.in=i.stdin||process.stdin,this.out=i.stdout||process.stdout,this.onRender=(i.onRender||(()=>{})).bind(this);const n=t.createInterface({input:this.in,escapeCodeTimeout:50});t.emitKeypressEvents(this.in,n),this.in.isTTY&&this.in.setRawMode(!0);const s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,h=(m,c)=>{let u=o(c,s);u===!1?this._&&this._(m,c):typeof this[u]=="function"?this[u](c):this.bell()};this.close=()=>{this.out.write(l.show),this.in.removeListener("keypress",h),this.in.isTTY&&this.in.setRawMode(!1),n.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",h)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(e)}render(){this.onRender(a),this.firstRender&&(this.firstRender=!1)}}return be=r,be}var ve,bt;function $i(){if(bt)return ve;bt=1;const t=M(),o=I(),{erase:f,cursor:e}=P(),{style:l,clear:a,lines:r,figures:d}=T();class i extends o{constructor(s={}){super(s),this.transform=l.render(s.style),this.scale=this.transform.scale,this.msg=s.message,this.initial=s.initial||"",this.validator=s.validate||(()=>!0),this.value="",this.errorMsg=s.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=a("",this.out.columns),this.render()}set value(s){!s&&this.initial?(this.placeholder=!0,this.rendered=t.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(s)),this._value=s,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
`)}),me}var pe,mt;function Si(){return mt||(mt=1,pe=(t,o,f)=>{f=f||o;let e=Math.min(o-f,t-Math.floor(f/2));e<0&&(e=0);let a=Math.min(e+f,o);return{startIndex:e,endIndex:a}}),pe}var ge,pt;function T(){return pt||(pt=1,ge={action:bi(),clear:vi(),style:wi(),strip:ae(),figures:ut(),lines:xi(),wrap:yi(),entriesToDisplay:Si()}),ge}var be,gt;function I(){if(gt)return be;gt=1;const t=Jt,{action:o}=T(),f=Kt,{beep:e,cursor:a}=P(),l=M();class r extends f{constructor(i={}){super(),this.firstRender=!0,this.in=i.stdin||process.stdin,this.out=i.stdout||process.stdout,this.onRender=(i.onRender||(()=>{})).bind(this);const n=t.createInterface({input:this.in,escapeCodeTimeout:50});t.emitKeypressEvents(this.in,n),this.in.isTTY&&this.in.setRawMode(!0);const s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,h=(m,u)=>{let c=o(u,s);c===!1?this._&&this._(m,u):typeof this[c]=="function"?this[c](u):this.bell()};this.close=()=>{this.out.write(a.show),this.in.removeListener("keypress",h),this.in.isTTY&&this.in.setRawMode(!1),n.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",h)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(e)}render(){this.onRender(l),this.firstRender&&(this.firstRender=!1)}}return be=r,be}var ve,bt;function $i(){if(bt)return ve;bt=1;const t=M(),o=I(),{erase:f,cursor:e}=P(),{style:a,clear:l,lines:r,figures:d}=T();class i extends o{constructor(s={}){super(s),this.transform=a.render(s.style),this.scale=this.transform.scale,this.msg=s.message,this.initial=s.initial||"",this.validator=s.validate||(()=>!0),this.value="",this.errorMsg=s.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=l("",this.out.columns),this.render()}set value(s){!s&&this.initial?(this.placeholder=!0,this.rendered=t.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(s)),this._value=s,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let s=await this.validator(this.value);typeof s=="string"&&(this.errorMsg=s,s=!1),this.error=!s}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(s){this.placeholder||(this.cursor=this.cursor+s,this.cursorOffset+=s)}_(s,h){let m=this.value.slice(0,this.cursor),c=this.value.slice(this.cursor);this.value=`${m}${s}${c}`,this.red=!1,this.cursor=this.placeholder?0:m.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let s=this.value.slice(0,this.cursor-1),h=this.value.slice(this.cursor);this.value=`${s}${h}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let s=this.value.slice(0,this.cursor),h=this.value.slice(this.cursor+1);this.value=`${s}${h}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(e.down(r(this.outputError,this.out.columns)-1)+a(this.outputError,this.out.columns)),this.out.write(a(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),t.bold(this.msg),l.delimiter(this.done),this.red?t.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(s){this.placeholder||(this.cursor=this.cursor+s,this.cursorOffset+=s)}_(s,h){let m=this.value.slice(0,this.cursor),u=this.value.slice(this.cursor);this.value=`${m}${s}${u}`,this.red=!1,this.cursor=this.placeholder?0:m.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let s=this.value.slice(0,this.cursor-1),h=this.value.slice(this.cursor);this.value=`${s}${h}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let s=this.value.slice(0,this.cursor),h=this.value.slice(this.cursor+1);this.value=`${s}${h}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(e.down(r(this.outputError,this.out.columns)-1)+l(this.outputError,this.out.columns)),this.out.write(l(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[a.symbol(this.done,this.aborted),t.bold(this.msg),a.delimiter(this.done),this.red?t.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((s,h,m)=>s+`
${m?" ":d.pointerSmall} ${t.red().italic(h)}`,"")),this.out.write(f.line+e.to(0)+this.outputText+e.save+this.outputError+e.restore+e.move(this.cursorOffset,0)))}}return ve=i,ve}var we,vt;function Ei(){if(vt)return we;vt=1;const t=M(),o=I(),{style:f,clear:e,figures:l,wrap:a,entriesToDisplay:r}=T(),{cursor:d}=P();class i extends o{constructor(s={}){super(s),this.msg=s.message,this.hint=s.hint||"- Use arrow-keys. Return to submit.",this.warn=s.warn||"- This option is disabled",this.cursor=s.initial||0,this.choices=s.choices.map((h,m)=>(typeof h=="string"&&(h={title:h,value:m}),{title:h&&(h.title||h.value||h),value:h&&(h.value===void 0?m:h.value),description:h&&h.description,selected:h&&h.selected,disabled:h&&h.disabled})),this.optionsPerPage=s.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=e("",this.out.columns),this.render()}moveCursor(s){this.cursor=s,this.value=this.choices[s].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
${m?" ":d.pointerSmall} ${t.red().italic(h)}`,"")),this.out.write(f.line+e.to(0)+this.outputText+e.save+this.outputError+e.restore+e.move(this.cursorOffset,0)))}}return ve=i,ve}var we,vt;function Ei(){if(vt)return we;vt=1;const t=M(),o=I(),{style:f,clear:e,figures:a,wrap:l,entriesToDisplay:r}=T(),{cursor:d}=P();class i extends o{constructor(s={}){super(s),this.msg=s.message,this.hint=s.hint||"- Use arrow-keys. Return to submit.",this.warn=s.warn||"- This option is disabled",this.cursor=s.initial||0,this.choices=s.choices.map((h,m)=>(typeof h=="string"&&(h={title:h,value:m}),{title:h&&(h.title||h.value||h),value:h&&(h.value===void 0?m:h.value),description:h&&h.description,selected:h&&h.selected,disabled:h&&h.disabled})),this.optionsPerPage=s.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=e("",this.out.columns),this.render()}moveCursor(s){this.cursor=s,this.value=this.choices[s].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(s,h){if(s===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(d.hide):this.out.write(e(this.outputText,this.out.columns)),super.render();let{startIndex:s,endIndex:h}=r(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[f.symbol(this.done,this.aborted),t.bold(this.msg),f.delimiter(!1),this.done?this.selection.title:this.selection.disabled?t.yellow(this.warn):t.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let m=s;m<h;m++){let c,u,p="",b=this.choices[m];m===s&&s>0?u=l.arrowUp:m===h-1&&h<this.choices.length?u=l.arrowDown:u=" ",b.disabled?(c=this.cursor===m?t.gray().underline(b.title):t.strikethrough().gray(b.title),u=(this.cursor===m?t.bold().gray(l.pointer)+" ":" ")+u):(c=this.cursor===m?t.cyan().underline(b.title):b.title,u=(this.cursor===m?t.cyan(l.pointer)+" ":" ")+u,b.description&&this.cursor===m&&(p=` - ${b.description}`,(u.length+c.length+p.length>=this.out.columns||b.description.split(/\r?\n/).length>1)&&(p=`
`+a(b.description,{margin:3,width:this.out.columns})))),this.outputText+=`${u} ${c}${t.gray(p)}
`}}this.out.write(this.outputText)}}return we=i,we}var xe,wt;function Ci(){if(wt)return xe;wt=1;const t=M(),o=I(),{style:f,clear:e}=T(),{cursor:l,erase:a}=P();class r extends o{constructor(i={}){super(i),this.msg=i.message,this.value=!!i.initial,this.active=i.active||"on",this.inactive=i.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`;for(let m=s;m<h;m++){let u,c,p="",g=this.choices[m];m===s&&s>0?c=a.arrowUp:m===h-1&&h<this.choices.length?c=a.arrowDown:c=" ",g.disabled?(u=this.cursor===m?t.gray().underline(g.title):t.strikethrough().gray(g.title),c=(this.cursor===m?t.bold().gray(a.pointer)+" ":" ")+c):(u=this.cursor===m?t.cyan().underline(g.title):g.title,c=(this.cursor===m?t.cyan(a.pointer)+" ":" ")+c,g.description&&this.cursor===m&&(p=` - ${g.description}`,(c.length+u.length+p.length>=this.out.columns||g.description.split(/\r?\n/).length>1)&&(p=`
`+l(g.description,{margin:3,width:this.out.columns})))),this.outputText+=`${c} ${u}${t.gray(p)}
`}}this.out.write(this.outputText)}}return we=i,we}var xe,wt;function Ci(){if(wt)return xe;wt=1;const t=M(),o=I(),{style:f,clear:e}=T(),{cursor:a,erase:l}=P();class r extends o{constructor(i={}){super(i),this.msg=i.message,this.value=!!i.initial,this.active=i.active||"on",this.inactive=i.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(i,n){if(i===" ")this.value=!this.value;else if(i==="1")this.value=!0;else if(i==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(e(this.outputText,this.out.columns)),super.render(),this.outputText=[f.symbol(this.done,this.aborted),t.bold(this.msg),f.delimiter(this.done),this.value?this.inactive:t.cyan().underline(this.inactive),t.gray("/"),this.value?t.cyan().underline(this.active):this.active].join(" "),this.out.write(a.line+l.to(0)+this.outputText))}}return xe=r,xe}var ye,xt;function _(){if(xt)return ye;xt=1;class t{constructor({token:f,date:e,parts:l,locales:a}){this.token=f,this.date=e||new Date,this.parts=l||[this],this.locales=a||{}}up(){}down(){}next(){const f=this.parts.indexOf(this);return this.parts.find((e,l)=>l>f&&e instanceof t)}setTo(f){}prev(){let f=[].concat(this.parts).reverse();const e=f.indexOf(this);return f.find((l,a)=>a>e&&l instanceof t)}toString(){return String(this.date)}}return ye=t,ye}var Se,yt;function Oi(){if(yt)return Se;yt=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}}return Se=o,Se}var $e,St;function Mi(){if(St)return $e;St=1;const t=_(),o=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th");class f extends t{constructor(l={}){super(l)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(l){this.date.setDate(parseInt(l.substr(-2)))}toString(){let l=this.date.getDate(),a=this.date.getDay();return this.token==="DD"?String(l).padStart(2,"0"):this.token==="Do"?l+o(l):this.token==="d"?a+1:this.token==="ddd"?this.locales.weekdaysShort[a]:this.token==="dddd"?this.locales.weekdays[a]:l}}return $e=f,$e}var Ee,$t;function Pi(){if($t)return Ee;$t=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}}return Ee=o,Ee}var Ce,Et;function Ri(){if(Et)return Ce;Et=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return Ce=o,Ce}var Oe,Ct;function Ti(){if(Ct)return Oe;Ct=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}}return Oe=o,Oe}var Me,Ot;function qi(){if(Ot)return Me;Ot=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),l=this.token.length;return l===2?String(e+1).padStart(2,"0"):l===3?this.locales.monthsShort[e]:l===4?this.locales.months[e]:String(e+1)}}return Me=o,Me}var Pe,Mt;function Di(){if(Mt)return Pe;Mt=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}}return Pe=o,Pe}var Re,Pt;function _i(){if(Pt)return Re;Pt=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}}return Re=o,Re}var Te,Rt;function Ii(){return Rt||(Rt=1,Te={DatePart:_(),Meridiem:Oi(),Day:Mi(),Hours:Pi(),Milliseconds:Ri(),Minutes:Ti(),Month:qi(),Seconds:Di(),Year:_i()}),Te}var qe,Tt;function Ai(){if(Tt)return qe;Tt=1;const t=M(),o=I(),{style:f,clear:e,figures:l}=T(),{erase:a,cursor:r}=P(),{DatePart:d,Meridiem:i,Day:n,Hours:s,Milliseconds:h,Minutes:m,Month:c,Seconds:u,Year:p}=Ii(),b=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,x={1:({token:g})=>g.replace(/\\(.)/g,"$1"),2:g=>new n(g),3:g=>new c(g),4:g=>new p(g),5:g=>new i(g),6:g=>new s(g),7:g=>new m(g),8:g=>new u(g),9:g=>new h(g)},C={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class S extends o{constructor(v={}){super(v),this.msg=v.message,this.cursor=0,this.typed="",this.locales=Object.assign(C,v.locales),this._date=v.initial||new Date,this.errorMsg=v.error||"Please Enter A Valid Value",this.validator=v.validate||(()=>!0),this.mask=v.mask||"YYYY-MM-DD HH:mm:ss",this.clear=e("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(v){v&&this._date.setTime(v.getTime())}set mask(v){let y;for(this.parts=[];y=b.exec(v);){let $=y.shift(),O=y.findIndex(E=>E!=null);this.parts.push(O in x?x[O]({token:y[O]||$,date:this.date,parts:this.parts,locales:this.locales}):y[O]||$)}let w=this.parts.reduce(($,O)=>(typeof O=="string"&&typeof $[$.length-1]=="string"?$[$.length-1]+=O:$.push(O),$),[]);this.parts.splice(0),this.parts.push(...w),this.reset()}moveCursor(v){this.typed="",this.cursor=v,this.fire()}reset(){this.moveCursor(this.parts.findIndex(v=>v instanceof d)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let v=await this.validator(this.value);typeof v=="string"&&(this.errorMsg=v,v=!1),this.error=!v}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let v=this.parts[this.cursor].prev();if(v==null)return this.bell();this.moveCursor(this.parts.indexOf(v)),this.render()}right(){let v=this.parts[this.cursor].next();if(v==null)return this.bell();this.moveCursor(this.parts.indexOf(v)),this.render()}next(){let v=this.parts[this.cursor].next();this.moveCursor(v?this.parts.indexOf(v):this.parts.findIndex(y=>y instanceof d)),this.render()}_(v){/\d/.test(v)&&(this.typed+=v,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(r.hide):this.out.write(e(this.outputText,this.out.columns)),super.render(),this.outputText=[f.symbol(this.done,this.aborted),t.bold(this.msg),f.delimiter(!1),this.parts.reduce((v,y,w)=>v.concat(w===this.cursor&&!this.done?t.cyan().underline(y.toString()):y),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((v,y,w)=>v+`
${w?" ":l.pointerSmall} ${t.red().italic(y)}`,"")),this.out.write(a.line+r.to(0)+this.outputText))}}return qe=S,qe}var De,qt;function ji(){if(qt)return De;qt=1;const t=M(),o=I(),{cursor:f,erase:e}=P(),{style:l,figures:a,clear:r,lines:d}=T(),i=/[0-9]/,n=m=>m!==void 0,s=(m,c)=>{let u=Math.pow(10,c);return Math.round(m*u)/u};class h extends o{constructor(c={}){super(c),this.transform=l.render(c.style),this.msg=c.message,this.initial=n(c.initial)?c.initial:"",this.float=!!c.float,this.round=c.round||2,this.inc=c.increment||1,this.min=n(c.min)?c.min:-1/0,this.max=n(c.max)?c.max:1/0,this.errorMsg=c.error||"Please Enter A Valid Value",this.validator=c.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(c){!c&&c!==0?(this.placeholder=!0,this.rendered=t.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${s(c,this.round)}`),this._value=s(c,this.round)),this.fire()}get value(){return this._value}parse(c){return this.float?parseFloat(c):parseInt(c)}valid(c){return c==="-"||c==="."&&this.float||i.test(c)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let c=this.value;this.value=c!==""?c:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let c=await this.validator(this.value);typeof c=="string"&&(this.errorMsg=c,c=!1),this.error=!c}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let c=this.value;this.value=c!==""?c:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let c=this.value.toString();if(c.length===0)return this.bell();this.value=this.parse(c=c.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(c,u){if(!this.valid(c))return this.bell();const p=Date.now();if(p-this.lastHit>1e3&&(this.typed=""),this.typed+=c,this.lastHit=p,this.color="cyan",c===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(f.down(d(this.outputError,this.out.columns)-1)+r(this.outputError,this.out.columns)),this.out.write(r(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),t.bold(this.msg),l.delimiter(this.done),!this.done||!this.done&&!this.placeholder?t[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((c,u,p)=>c+`
${p?" ":a.pointerSmall} ${t.red().italic(u)}`,"")),this.out.write(e.line+f.to(0)+this.outputText+f.save+this.outputError+f.restore))}}return De=h,De}var _e,Dt;function _t(){if(Dt)return _e;Dt=1;const t=M(),{cursor:o}=P(),f=I(),{clear:e,figures:l,style:a,wrap:r,entriesToDisplay:d}=T();class i extends f{constructor(s={}){super(s),this.msg=s.message,this.cursor=s.cursor||0,this.scrollIndex=s.cursor||0,this.hint=s.hint||"",this.warn=s.warn||"- This option is disabled -",this.minSelected=s.min,this.showMinError=!1,this.maxChoices=s.max,this.instructions=s.instructions,this.optionsPerPage=s.optionsPerPage||10,this.value=s.choices.map((h,m)=>(typeof h=="string"&&(h={title:h,value:m}),{title:h&&(h.title||h.value||h),description:h&&h.description,value:h&&(h.value===void 0?m:h.value),selected:h&&h.selected,disabled:h&&h.disabled})),this.clear=e("",this.out.columns),s.overrideRender||this.render()}reset(){this.value.map(s=>!s.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(s=>s.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(i,n){if(i===" ")this.value=!this.value;else if(i==="1")this.value=!0;else if(i==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(a.hide):this.out.write(e(this.outputText,this.out.columns)),super.render(),this.outputText=[f.symbol(this.done,this.aborted),t.bold(this.msg),f.delimiter(this.done),this.value?this.inactive:t.cyan().underline(this.inactive),t.gray("/"),this.value?t.cyan().underline(this.active):this.active].join(" "),this.out.write(l.line+a.to(0)+this.outputText))}}return xe=r,xe}var ye,xt;function _(){if(xt)return ye;xt=1;class t{constructor({token:f,date:e,parts:a,locales:l}){this.token=f,this.date=e||new Date,this.parts=a||[this],this.locales=l||{}}up(){}down(){}next(){const f=this.parts.indexOf(this);return this.parts.find((e,a)=>a>f&&e instanceof t)}setTo(f){}prev(){let f=[].concat(this.parts).reverse();const e=f.indexOf(this);return f.find((a,l)=>l>e&&a instanceof t)}toString(){return String(this.date)}}return ye=t,ye}var Se,yt;function Oi(){if(yt)return Se;yt=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}}return Se=o,Se}var $e,St;function Mi(){if(St)return $e;St=1;const t=_(),o=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th");class f extends t{constructor(a={}){super(a)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(a){this.date.setDate(parseInt(a.substr(-2)))}toString(){let a=this.date.getDate(),l=this.date.getDay();return this.token==="DD"?String(a).padStart(2,"0"):this.token==="Do"?a+o(a):this.token==="d"?l+1:this.token==="ddd"?this.locales.weekdaysShort[l]:this.token==="dddd"?this.locales.weekdays[l]:a}}return $e=f,$e}var Ee,$t;function Pi(){if($t)return Ee;$t=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}}return Ee=o,Ee}var Ce,Et;function Ri(){if(Et)return Ce;Et=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return Ce=o,Ce}var Oe,Ct;function Ti(){if(Ct)return Oe;Ct=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}}return Oe=o,Oe}var Me,Ot;function qi(){if(Ot)return Me;Ot=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),a=this.token.length;return a===2?String(e+1).padStart(2,"0"):a===3?this.locales.monthsShort[e]:a===4?this.locales.months[e]:String(e+1)}}return Me=o,Me}var Pe,Mt;function Di(){if(Mt)return Pe;Mt=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}}return Pe=o,Pe}var Re,Pt;function _i(){if(Pt)return Re;Pt=1;const t=_();class o extends t{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}}return Re=o,Re}var Te,Rt;function Ii(){return Rt||(Rt=1,Te={DatePart:_(),Meridiem:Oi(),Day:Mi(),Hours:Pi(),Milliseconds:Ri(),Minutes:Ti(),Month:qi(),Seconds:Di(),Year:_i()}),Te}var qe,Tt;function Ai(){if(Tt)return qe;Tt=1;const t=M(),o=I(),{style:f,clear:e,figures:a}=T(),{erase:l,cursor:r}=P(),{DatePart:d,Meridiem:i,Day:n,Hours:s,Milliseconds:h,Minutes:m,Month:u,Seconds:c,Year:p}=Ii(),g=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,y={1:({token:b})=>b.replace(/\\(.)/g,"$1"),2:b=>new n(b),3:b=>new u(b),4:b=>new p(b),5:b=>new i(b),6:b=>new s(b),7:b=>new m(b),8:b=>new c(b),9:b=>new h(b)},E={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class v extends o{constructor(w={}){super(w),this.msg=w.message,this.cursor=0,this.typed="",this.locales=Object.assign(E,w.locales),this._date=w.initial||new Date,this.errorMsg=w.error||"Please Enter A Valid Value",this.validator=w.validate||(()=>!0),this.mask=w.mask||"YYYY-MM-DD HH:mm:ss",this.clear=e("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(w){w&&this._date.setTime(w.getTime())}set mask(w){let S;for(this.parts=[];S=g.exec(w);){let $=S.shift(),O=S.findIndex(C=>C!=null);this.parts.push(O in y?y[O]({token:S[O]||$,date:this.date,parts:this.parts,locales:this.locales}):S[O]||$)}let x=this.parts.reduce(($,O)=>(typeof O=="string"&&typeof $[$.length-1]=="string"?$[$.length-1]+=O:$.push(O),$),[]);this.parts.splice(0),this.parts.push(...x),this.reset()}moveCursor(w){this.typed="",this.cursor=w,this.fire()}reset(){this.moveCursor(this.parts.findIndex(w=>w instanceof d)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let w=await this.validator(this.value);typeof w=="string"&&(this.errorMsg=w,w=!1),this.error=!w}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let w=this.parts[this.cursor].prev();if(w==null)return this.bell();this.moveCursor(this.parts.indexOf(w)),this.render()}right(){let w=this.parts[this.cursor].next();if(w==null)return this.bell();this.moveCursor(this.parts.indexOf(w)),this.render()}next(){let w=this.parts[this.cursor].next();this.moveCursor(w?this.parts.indexOf(w):this.parts.findIndex(S=>S instanceof d)),this.render()}_(w){/\d/.test(w)&&(this.typed+=w,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(r.hide):this.out.write(e(this.outputText,this.out.columns)),super.render(),this.outputText=[f.symbol(this.done,this.aborted),t.bold(this.msg),f.delimiter(!1),this.parts.reduce((w,S,x)=>w.concat(x===this.cursor&&!this.done?t.cyan().underline(S.toString()):S),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((w,S,x)=>w+`
${x?" ":a.pointerSmall} ${t.red().italic(S)}`,"")),this.out.write(l.line+r.to(0)+this.outputText))}}return qe=v,qe}var De,qt;function ji(){if(qt)return De;qt=1;const t=M(),o=I(),{cursor:f,erase:e}=P(),{style:a,figures:l,clear:r,lines:d}=T(),i=/[0-9]/,n=m=>m!==void 0,s=(m,u)=>{let c=Math.pow(10,u);return Math.round(m*c)/c};class h extends o{constructor(u={}){super(u),this.transform=a.render(u.style),this.msg=u.message,this.initial=n(u.initial)?u.initial:"",this.float=!!u.float,this.round=u.round||2,this.inc=u.increment||1,this.min=n(u.min)?u.min:-1/0,this.max=n(u.max)?u.max:1/0,this.errorMsg=u.error||"Please Enter A Valid Value",this.validator=u.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(u){!u&&u!==0?(this.placeholder=!0,this.rendered=t.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${s(u,this.round)}`),this._value=s(u,this.round)),this.fire()}get value(){return this._value}parse(u){return this.float?parseFloat(u):parseInt(u)}valid(u){return u==="-"||u==="."&&this.float||i.test(u)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let u=this.value;this.value=u!==""?u:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let u=await this.validator(this.value);typeof u=="string"&&(this.errorMsg=u,u=!1),this.error=!u}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let u=this.value;this.value=u!==""?u:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let u=this.value.toString();if(u.length===0)return this.bell();this.value=this.parse(u=u.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(u,c){if(!this.valid(u))return this.bell();const p=Date.now();if(p-this.lastHit>1e3&&(this.typed=""),this.typed+=u,this.lastHit=p,this.color="cyan",u===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(f.down(d(this.outputError,this.out.columns)-1)+r(this.outputError,this.out.columns)),this.out.write(r(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[a.symbol(this.done,this.aborted),t.bold(this.msg),a.delimiter(this.done),!this.done||!this.done&&!this.placeholder?t[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((u,c,p)=>u+`
${p?" ":l.pointerSmall} ${t.red().italic(c)}`,"")),this.out.write(e.line+f.to(0)+this.outputText+f.save+this.outputError+f.restore))}}return De=h,De}var _e,Dt;function _t(){if(Dt)return _e;Dt=1;const t=M(),{cursor:o}=P(),f=I(),{clear:e,figures:a,style:l,wrap:r,entriesToDisplay:d}=T();class i extends f{constructor(s={}){super(s),this.msg=s.message,this.cursor=s.cursor||0,this.scrollIndex=s.cursor||0,this.hint=s.hint||"",this.warn=s.warn||"- This option is disabled -",this.minSelected=s.min,this.showMinError=!1,this.maxChoices=s.max,this.instructions=s.instructions,this.optionsPerPage=s.optionsPerPage||10,this.value=s.choices.map((h,m)=>(typeof h=="string"&&(h={title:h,value:m}),{title:h&&(h.title||h.value||h),description:h&&h.description,value:h&&(h.value===void 0?m:h.value),selected:h&&h.selected,disabled:h&&h.disabled})),this.clear=e("",this.out.columns),s.overrideRender||this.render()}reset(){this.value.map(s=>!s.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(s=>s.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){const s=this.value.filter(h=>h.selected);this.minSelected&&s.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(s=>s.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const s=this.value[this.cursor];if(s.selected)s.selected=!1,this.render();else{if(s.disabled||this.value.filter(h=>h.selected).length>=this.maxChoices)return this.bell();s.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const s=!this.value[this.cursor].selected;this.value.filter(h=>!h.disabled).forEach(h=>h.selected=s),this.render()}_(s,h){if(s===" ")this.handleSpaceToggle();else if(s==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${l.arrowUp}/${l.arrowDown}: Highlight option
${l.arrowLeft}/${l.arrowRight}/[space]: Toggle selection
${a.arrowUp}/${a.arrowDown}: Highlight option
${a.arrowLeft}/${a.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?` a: Toggle all
`:"")+" enter/return: Complete answer":""}renderOption(s,h,m,c){const u=(h.selected?t.green(l.radioOn):l.radioOff)+" "+c+" ";let p,b;return h.disabled?p=s===m?t.gray().underline(h.title):t.strikethrough().gray(h.title):(p=s===m?t.cyan().underline(h.title):h.title,s===m&&h.description&&(b=` - ${h.description}`,(u.length+p.length+b.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(b=`
`+r(h.description,{margin:u.length,width:this.out.columns})))),u+p+t.gray(b||"")}paginateOptions(s){if(s.length===0)return t.red("No matches for this query.");let{startIndex:h,endIndex:m}=d(this.cursor,s.length,this.optionsPerPage),c,u=[];for(let p=h;p<m;p++)p===h&&h>0?c=l.arrowUp:p===m-1&&m<s.length?c=l.arrowDown:c=" ",u.push(this.renderOption(this.cursor,s[p],p,c));return`
`+u.join(`
`)}renderOptions(s){return this.done?"":this.paginateOptions(s)}renderDoneOrInstructions(){if(this.done)return this.value.filter(h=>h.selected).map(h=>h.title).join(", ");const s=[t.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&s.push(t.yellow(this.warn)),s.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(o.hide),super.render();let s=[a.symbol(this.done,this.aborted),t.bold(this.msg),a.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(s+=t.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),s+=this.renderOptions(this.value),this.out.write(this.clear+s),this.clear=e(s,this.out.columns)}}return _e=i,_e}var Ie,It;function Ni(){if(It)return Ie;It=1;const t=M(),o=I(),{erase:f,cursor:e}=P(),{style:l,clear:a,figures:r,wrap:d,entriesToDisplay:i}=T(),n=(c,u)=>c[u]&&(c[u].value||c[u].title||c[u]),s=(c,u)=>c[u]&&(c[u].title||c[u].value||c[u]),h=(c,u)=>{const p=c.findIndex(b=>b.value===u||b.title===u);return p>-1?p:void 0};class m extends o{constructor(u={}){super(u),this.msg=u.message,this.suggest=u.suggest,this.choices=u.choices,this.initial=typeof u.initial=="number"?u.initial:h(u.choices,u.initial),this.select=this.initial||u.cursor||0,this.i18n={noMatches:u.noMatches||"no matches found"},this.fallback=u.fallback||this.initial,this.clearFirst=u.clearFirst||!1,this.suggestions=[],this.input="",this.limit=u.limit||10,this.cursor=0,this.transform=l.render(u.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=a("",this.out.columns),this.complete(this.render),this.render()}set fallback(u){this._fb=Number.isSafeInteger(parseInt(u))?parseInt(u):u}get fallback(){let u;return typeof this._fb=="number"?u=this.choices[this._fb]:typeof this._fb=="string"&&(u={title:this._fb}),u||this._fb||{title:this.i18n.noMatches}}moveSelect(u){this.select=u,this.suggestions.length>0?this.value=n(this.suggestions,u):this.value=this.fallback.value,this.fire()}async complete(u){const p=this.completing=this.suggest(this.input,this.choices),b=await p;if(this.completing!==p)return;this.suggestions=b.map((C,S,g)=>({title:s(g,S),value:n(g,S),description:C.description})),this.completing=!1;const x=Math.max(b.length-1,0);this.moveSelect(Math.min(x,this.select)),u&&u()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`:"")+" enter/return: Complete answer":""}renderOption(s,h,m,u){const c=(h.selected?t.green(a.radioOn):a.radioOff)+" "+u+" ";let p,g;return h.disabled?p=s===m?t.gray().underline(h.title):t.strikethrough().gray(h.title):(p=s===m?t.cyan().underline(h.title):h.title,s===m&&h.description&&(g=` - ${h.description}`,(c.length+p.length+g.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(g=`
`+r(h.description,{margin:c.length,width:this.out.columns})))),c+p+t.gray(g||"")}paginateOptions(s){if(s.length===0)return t.red("No matches for this query.");let{startIndex:h,endIndex:m}=d(this.cursor,s.length,this.optionsPerPage),u,c=[];for(let p=h;p<m;p++)p===h&&h>0?u=a.arrowUp:p===m-1&&m<s.length?u=a.arrowDown:u=" ",c.push(this.renderOption(this.cursor,s[p],p,u));return`
`+c.join(`
`)}renderOptions(s){return this.done?"":this.paginateOptions(s)}renderDoneOrInstructions(){if(this.done)return this.value.filter(h=>h.selected).map(h=>h.title).join(", ");const s=[t.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&s.push(t.yellow(this.warn)),s.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(o.hide),super.render();let s=[l.symbol(this.done,this.aborted),t.bold(this.msg),l.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(s+=t.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),s+=this.renderOptions(this.value),this.out.write(this.clear+s),this.clear=e(s,this.out.columns)}}return _e=i,_e}var Ie,It;function Ni(){if(It)return Ie;It=1;const t=M(),o=I(),{erase:f,cursor:e}=P(),{style:a,clear:l,figures:r,wrap:d,entriesToDisplay:i}=T(),n=(u,c)=>u[c]&&(u[c].value||u[c].title||u[c]),s=(u,c)=>u[c]&&(u[c].title||u[c].value||u[c]),h=(u,c)=>{const p=u.findIndex(g=>g.value===c||g.title===c);return p>-1?p:void 0};class m extends o{constructor(c={}){super(c),this.msg=c.message,this.suggest=c.suggest,this.choices=c.choices,this.initial=typeof c.initial=="number"?c.initial:h(c.choices,c.initial),this.select=this.initial||c.cursor||0,this.i18n={noMatches:c.noMatches||"no matches found"},this.fallback=c.fallback||this.initial,this.clearFirst=c.clearFirst||!1,this.suggestions=[],this.input="",this.limit=c.limit||10,this.cursor=0,this.transform=a.render(c.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=l("",this.out.columns),this.complete(this.render),this.render()}set fallback(c){this._fb=Number.isSafeInteger(parseInt(c))?parseInt(c):c}get fallback(){let c;return typeof this._fb=="number"?c=this.choices[this._fb]:typeof this._fb=="string"&&(c={title:this._fb}),c||this._fb||{title:this.i18n.noMatches}}moveSelect(c){this.select=c,this.suggestions.length>0?this.value=n(this.suggestions,c):this.value=this.fallback.value,this.fire()}async complete(c){const p=this.completing=this.suggest(this.input,this.choices),g=await p;if(this.completing!==p)return;this.suggestions=g.map((E,v,b)=>({title:s(b,v),value:n(b,v),description:E.description})),this.completing=!1;const y=Math.max(g.length-1,0);this.moveSelect(Math.min(y,this.select)),c&&c()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(u,p){let b=this.input.slice(0,this.cursor),x=this.input.slice(this.cursor);this.input=`${b}${u}${x}`,this.cursor=b.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let u=this.input.slice(0,this.cursor-1),p=this.input.slice(this.cursor);this.input=`${u}${p}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let u=this.input.slice(0,this.cursor),p=this.input.slice(this.cursor+1);this.input=`${u}${p}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(u,p,b,x){let C,S=b?r.arrowUp:x?r.arrowDown:" ",g=p?t.cyan().underline(u.title):u.title;return S=(p?t.cyan(r.pointer)+" ":" ")+S,u.description&&(C=` - ${u.description}`,(S.length+g.length+C.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(C=`
`+d(u.description,{margin:3,width:this.out.columns}))),S+" "+g+t.gray(C||"")}render(){if(this.closed)return;this.firstRender?this.out.write(e.hide):this.out.write(a(this.outputText,this.out.columns)),super.render();let{startIndex:u,endIndex:p}=i(this.select,this.choices.length,this.limit);if(this.outputText=[l.symbol(this.done,this.aborted,this.exited),t.bold(this.msg),l.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const b=this.suggestions.slice(u,p).map((x,C)=>this.renderOption(x,this.select===C+u,C===0&&u>0,C+u===p-1&&p<this.choices.length)).join(`
`),this.close()}_(c,p){let g=this.input.slice(0,this.cursor),y=this.input.slice(this.cursor);this.input=`${g}${c}${y}`,this.cursor=g.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let c=this.input.slice(0,this.cursor-1),p=this.input.slice(this.cursor);this.input=`${c}${p}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let c=this.input.slice(0,this.cursor),p=this.input.slice(this.cursor+1);this.input=`${c}${p}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(c,p,g,y){let E,v=g?r.arrowUp:y?r.arrowDown:" ",b=p?t.cyan().underline(c.title):c.title;return v=(p?t.cyan(r.pointer)+" ":" ")+v,c.description&&(E=` - ${c.description}`,(v.length+b.length+E.length>=this.out.columns||c.description.split(/\r?\n/).length>1)&&(E=`
`+d(c.description,{margin:3,width:this.out.columns}))),v+" "+b+t.gray(E||"")}render(){if(this.closed)return;this.firstRender?this.out.write(e.hide):this.out.write(l(this.outputText,this.out.columns)),super.render();let{startIndex:c,endIndex:p}=i(this.select,this.choices.length,this.limit);if(this.outputText=[a.symbol(this.done,this.aborted,this.exited),t.bold(this.msg),a.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const g=this.suggestions.slice(c,p).map((y,E)=>this.renderOption(y,this.select===E+c,E===0&&c>0,E+c===p-1&&p<this.choices.length)).join(`
`);this.outputText+=`
`+(b||t.gray(this.fallback.title))}this.out.write(f.line+e.to(0)+this.outputText)}}return Ie=m,Ie}var Ae,At;function Fi(){if(At)return Ae;At=1;const t=M(),{cursor:o}=P(),f=_t(),{clear:e,style:l,figures:a}=T();class r extends f{constructor(i={}){i.overrideRender=!0,super(i),this.inputValue="",this.clear=e("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(i=>i.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const i=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const n=this.filteredOptions.findIndex(s=>s===i);this.cursor=n<0?0:n,this.render()}handleSpaceToggle(){const i=this.filteredOptions[this.cursor];if(i.selected)i.selected=!1,this.render();else{if(i.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();i.selected=!0,this.render()}}handleInputChange(i){this.inputValue=this.inputValue+i,this.updateFilteredOptions()}_(i,n){i===" "?this.handleSpaceToggle():this.handleInputChange(i)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
`+(g||t.gray(this.fallback.title))}this.out.write(f.line+e.to(0)+this.outputText)}}return Ie=m,Ie}var Ae,At;function Fi(){if(At)return Ae;At=1;const t=M(),{cursor:o}=P(),f=_t(),{clear:e,style:a,figures:l}=T();class r extends f{constructor(i={}){i.overrideRender=!0,super(i),this.inputValue="",this.clear=e("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(i=>i.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const i=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const n=this.filteredOptions.findIndex(s=>s===i);this.cursor=n<0?0:n,this.render()}handleSpaceToggle(){const i=this.filteredOptions[this.cursor];if(i.selected)i.selected=!1,this.render();else{if(i.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();i.selected=!0,this.render()}}handleInputChange(i){this.inputValue=this.inputValue+i,this.updateFilteredOptions()}_(i,n){i===" "?this.handleSpaceToggle():this.handleInputChange(i)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${a.arrowUp}/${a.arrowDown}: Highlight option
${a.arrowLeft}/${a.arrowRight}/[space]: Toggle selection
${l.arrowUp}/${l.arrowDown}: Highlight option
${l.arrowLeft}/${l.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices

@@ -46,5 +46,5 @@ enter/return: Complete answer

Filtered results for: ${this.inputValue?this.inputValue:t.gray("Enter something to filter")}
`}renderOption(i,n,s){let h;return n.disabled?h=i===s?t.gray().underline(n.title):t.strikethrough().gray(n.title):h=i===s?t.cyan().underline(n.title):n.title,(n.selected?t.green(a.radioOn):a.radioOff)+" "+h}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");const i=[t.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&i.push(t.yellow(this.warn)),i.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(o.hide),super.render();let i=[l.symbol(this.done,this.aborted),t.bold(this.msg),l.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(i+=t.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),i+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+i),this.clear=e(i,this.out.columns)}}return Ae=r,Ae}var je,jt;function Bi(){if(jt)return je;jt=1;const t=M(),o=I(),{style:f,clear:e}=T(),{erase:l,cursor:a}=P();class r extends o{constructor(i={}){super(i),this.msg=i.message,this.value=i.initial,this.initialValue=!!i.initial,this.yesMsg=i.yes||"yes",this.yesOption=i.yesOption||"(Y/n)",this.noMsg=i.no||"no",this.noOption=i.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`}renderOption(i,n,s){let h;return n.disabled?h=i===s?t.gray().underline(n.title):t.strikethrough().gray(n.title):h=i===s?t.cyan().underline(n.title):n.title,(n.selected?t.green(l.radioOn):l.radioOff)+" "+h}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");const i=[t.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&i.push(t.yellow(this.warn)),i.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(o.hide),super.render();let i=[a.symbol(this.done,this.aborted),t.bold(this.msg),a.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(i+=t.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),i+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+i),this.clear=e(i,this.out.columns)}}return Ae=r,Ae}var je,jt;function Bi(){if(jt)return je;jt=1;const t=M(),o=I(),{style:f,clear:e}=T(),{erase:a,cursor:l}=P();class r extends o{constructor(i={}){super(i),this.msg=i.message,this.value=i.initial,this.initialValue=!!i.initial,this.yesMsg=i.yes||"yes",this.yesOption=i.yesOption||"(Y/n)",this.noMsg=i.no||"no",this.noOption=i.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(i,n){return i.toLowerCase()==="y"?(this.value=!0,this.submit()):i.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(a.hide):this.out.write(e(this.outputText,this.out.columns)),super.render(),this.outputText=[f.symbol(this.done,this.aborted),t.bold(this.msg),f.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:t.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(l.line+a.to(0)+this.outputText))}}return je=r,je}var Ne,Nt;function Yi(){return Nt||(Nt=1,Ne={TextPrompt:$i(),SelectPrompt:Ei(),TogglePrompt:Ci(),DatePrompt:Ai(),NumberPrompt:ji(),MultiselectPrompt:_t(),AutocompletePrompt:Ni(),AutocompleteMultiselectPrompt:Fi(),ConfirmPrompt:Bi()}),Ne}var Ft;function Hi(){return Ft||(Ft=1,function(t){const o=t,f=Yi(),e=r=>r;function l(r,d,i={}){return new Promise((n,s)=>{const h=new f[r](d),m=i.onAbort||e,c=i.onSubmit||e,u=i.onExit||e;h.on("state",d.onState||e),h.on("submit",p=>n(c(p))),h.on("exit",p=>n(u(p))),h.on("abort",p=>s(m(p)))})}o.text=r=>l("TextPrompt",r),o.password=r=>(r.style="password",o.text(r)),o.invisible=r=>(r.style="invisible",o.text(r)),o.number=r=>l("NumberPrompt",r),o.date=r=>l("DatePrompt",r),o.confirm=r=>l("ConfirmPrompt",r),o.list=r=>{const d=r.separator||",";return l("TextPrompt",r,{onSubmit:i=>i.split(d).map(n=>n.trim())})},o.toggle=r=>l("TogglePrompt",r),o.select=r=>l("SelectPrompt",r),o.multiselect=r=>{r.choices=[].concat(r.choices||[]);const d=i=>i.filter(n=>n.selected).map(n=>n.value);return l("MultiselectPrompt",r,{onAbort:d,onSubmit:d})},o.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const d=i=>i.filter(n=>n.selected).map(n=>n.value);return l("AutocompleteMultiselectPrompt",r,{onAbort:d,onSubmit:d})};const a=(r,d)=>Promise.resolve(d.filter(i=>i.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));o.autocomplete=r=>(r.suggest=r.suggest||a,r.choices=[].concat(r.choices||[]),l("AutocompletePrompt",r))}(se)),se}var Fe,Bt;function Li(){if(Bt)return Fe;Bt=1;const t=Hi(),o=["suggest","format","onState","validate","onRender","type"],f=()=>{};async function e(d=[],{onSubmit:i=f,onCancel:n=f}={}){const s={},h=e._override||{};d=[].concat(d);let m,c,u,p,b,x;const C=async(S,g,v=!1)=>{if(!(!v&&S.validate&&S.validate(g)!==!0))return S.format?await S.format(g,s):g};for(c of d)if({name:p,type:b}=c,typeof b=="function"&&(b=await b(m,{...s},c),c.type=b),!!b){for(let S in c){if(o.includes(S))continue;let g=c[S];c[S]=typeof g=="function"?await g(m,{...s},x):g}if(x=c,typeof c.message!="string")throw new Error("prompt message is required");if({name:p,type:b}=c,t[b]===void 0)throw new Error(`prompt type (${b}) is not defined`);if(h[c.name]!==void 0&&(m=await C(c,h[c.name]),m!==void 0)){s[p]=m;continue}try{m=e._injected?l(e._injected,c.initial):await t[b](c),s[p]=m=await C(c,m,!0),u=await i(c,m,s)}catch{u=!await n(c,s)}if(u)return s}return s}function l(d,i){const n=d.shift();if(n instanceof Error)throw n;return n===void 0?i:n}function a(d){e._injected=(e._injected||[]).concat(d)}function r(d){e._override=Object.assign({},d)}return Fe=Object.assign(e,{prompt:e,prompts:t,inject:a,override:r}),Fe}var ki=Li();const Yt=Y(ki),Vi="1.1.0",{green:V,red:Be,reset:B,yellow:Ht}=gi,N=fi(process.argv.slice(2),{default:{help:!1},alias:{h:"help",t:"template",v:"version"},string:["_"]}),Ye=process.cwd(),Wi=`Usage: vii [OPTION]... [DIRECTORY]
`),this.close()}_(i,n){return i.toLowerCase()==="y"?(this.value=!0,this.submit()):i.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(e(this.outputText,this.out.columns)),super.render(),this.outputText=[f.symbol(this.done,this.aborted),t.bold(this.msg),f.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:t.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(a.line+l.to(0)+this.outputText))}}return je=r,je}var Ne,Nt;function Yi(){return Nt||(Nt=1,Ne={TextPrompt:$i(),SelectPrompt:Ei(),TogglePrompt:Ci(),DatePrompt:Ai(),NumberPrompt:ji(),MultiselectPrompt:_t(),AutocompletePrompt:Ni(),AutocompleteMultiselectPrompt:Fi(),ConfirmPrompt:Bi()}),Ne}var Ft;function Li(){return Ft||(Ft=1,function(t){const o=t,f=Yi(),e=r=>r;function a(r,d,i={}){return new Promise((n,s)=>{const h=new f[r](d),m=i.onAbort||e,u=i.onSubmit||e,c=i.onExit||e;h.on("state",d.onState||e),h.on("submit",p=>n(u(p))),h.on("exit",p=>n(c(p))),h.on("abort",p=>s(m(p)))})}o.text=r=>a("TextPrompt",r),o.password=r=>(r.style="password",o.text(r)),o.invisible=r=>(r.style="invisible",o.text(r)),o.number=r=>a("NumberPrompt",r),o.date=r=>a("DatePrompt",r),o.confirm=r=>a("ConfirmPrompt",r),o.list=r=>{const d=r.separator||",";return a("TextPrompt",r,{onSubmit:i=>i.split(d).map(n=>n.trim())})},o.toggle=r=>a("TogglePrompt",r),o.select=r=>a("SelectPrompt",r),o.multiselect=r=>{r.choices=[].concat(r.choices||[]);const d=i=>i.filter(n=>n.selected).map(n=>n.value);return a("MultiselectPrompt",r,{onAbort:d,onSubmit:d})},o.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const d=i=>i.filter(n=>n.selected).map(n=>n.value);return a("AutocompleteMultiselectPrompt",r,{onAbort:d,onSubmit:d})};const l=(r,d)=>Promise.resolve(d.filter(i=>i.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));o.autocomplete=r=>(r.suggest=r.suggest||l,r.choices=[].concat(r.choices||[]),a("AutocompletePrompt",r))}(se)),se}var Fe,Bt;function Hi(){if(Bt)return Fe;Bt=1;const t=Li(),o=["suggest","format","onState","validate","onRender","type"],f=()=>{};async function e(d=[],{onSubmit:i=f,onCancel:n=f}={}){const s={},h=e._override||{};d=[].concat(d);let m,u,c,p,g,y;const E=async(v,b,w=!1)=>{if(!(!w&&v.validate&&v.validate(b)!==!0))return v.format?await v.format(b,s):b};for(u of d)if({name:p,type:g}=u,typeof g=="function"&&(g=await g(m,{...s},u),u.type=g),!!g){for(let v in u){if(o.includes(v))continue;let b=u[v];u[v]=typeof b=="function"?await b(m,{...s},y):b}if(y=u,typeof u.message!="string")throw new Error("prompt message is required");if({name:p,type:g}=u,t[g]===void 0)throw new Error(`prompt type (${g}) is not defined`);if(h[u.name]!==void 0&&(m=await E(u,h[u.name]),m!==void 0)){s[p]=m;continue}try{m=e._injected?a(e._injected,u.initial):await t[g](u),s[p]=m=await E(u,m,!0),c=await i(u,m,s)}catch{c=!await n(u,s)}if(c)return s}return s}function a(d,i){const n=d.shift();if(n instanceof Error)throw n;return n===void 0?i:n}function l(d){e._injected=(e._injected||[]).concat(d)}function r(d){e._override=Object.assign({},d)}return Fe=Object.assign(e,{prompt:e,prompts:t,inject:l,override:r}),Fe}var ki=Hi();const Yt=Y(ki),Vi="1.1.1",{green:V,red:Be,reset:B,yellow:Lt}=gi,N=fi(process.argv.slice(2),{default:{help:!1},alias:{h:"help",t:"template",v:"version"},string:["_"]}),Ye=process.cwd(),Wi=`Usage: vii [OPTION]... [DIRECTORY]

@@ -59,6 +59,6 @@ Create a new project in JavaScript or TypeScript.

${V("vue-pc")}
${Be("vue-mobile")}`,zi=`${V(`vii current version: v${Vi}`)}`,He=[{name:"vue",display:"Vue",color:V,variants:[{name:"vue-mobile",display:"JavaScript(Mobile)",color:Ht},{name:"vue-pc",display:"JavaScript(PC)",color:Ht},{name:"custom-create-vite",display:"Customize with create-cite \u2197",color:V,customCommand:"pnpm create vite"}]}],Lt=He.map(t=>t.variants.map(o=>o.name)).reduce((t,o)=>t.concat(o),[]),Le="vii-project";async function Ui(){var t;const o=kt(N._[0]),f=N.template||N.t,e=N.version||N.v;if(N.help){console.log(Wi);return}else if(e){console.log(zi);return}let l=o||Le;const a=()=>A.basename(A.resolve(l));let r;Yt.override({overwrite:N.overwrite});try{r=await Yt([{type:o?null:"text",name:"projectName",message:B("Project name:"),initial:Le,onState:g=>{l=kt(g.value)||Le}},{type:()=>!D.existsSync(l)||Ki(l)?null:"select",name:"overwrite",message:()=>(l==="."?"Current directory":`Target directory "${l}"`)+" is not empty. Please choose how to proceed:",initial:0,choices:[{title:"Cancel operation",value:"no"},{title:"Remove existing files and continue",value:"yes"},{title:"Ignore files and continue",value:"ignore"}]},{type:(g,{overwrite:v})=>{if(v==="no")throw new Error(Be("\u2716")+" Operation cancelled");return null},name:"overwriteChecker"},{type:()=>Vt(a())?null:"text",name:"packageName",message:B("Package name:"),initial:()=>Ji(a()),validate:g=>Vt(g)||"Invalid package.json name"},{type:f&&Lt.includes(f)?null:"select",name:"framework",message:typeof f=="string"&&!Lt.includes(f)?B(`"${f}" isn't a valid template. Please choose from below: `):B("Select a framework:"),initial:0,choices:He.map(g=>{const v=g.color;return{title:v(g.display||g.name),value:g}})},{type:g=>typeof g=="object"?"select":null,name:"variant",message:B("Select a variant:"),choices:g=>g.variants.map(v=>{const y=v.color;return{title:y(v.display||v.name),value:v.name}})}],{onCancel:()=>{throw new Error(Be("\u2716")+" Operation cancelled")}})}catch(g){console.log(g.message);return}const{framework:d,overwrite:i,packageName:n,variant:s}=r,h=A.join(Ye,l);i==="yes"?Gi(h):D.existsSync(h)||D.mkdirSync(h,{recursive:!0});const m=s||(d==null?void 0:d.name)||f,c=Zi(process.env.npm_config_user_agent),u=c?c.name:"pnpm",p=u==="yarn"&&(c==null?void 0:c.version.startsWith("1.")),{customCommand:b}=(t=He.flatMap(g=>g.variants).find(g=>g.name===m))!=null?t:{};if(b){const g=b.replace(/^npm create /,()=>u==="bun"?"bun x create-":`${u} create `).replace("@latest",()=>p?"":"@latest").replace(/^npm exec/,()=>u==="pnpm"?"pnpm dlx":u==="yarn"&&!p?"yarn dlx":u==="bun"?"bun x":"npm exec"),[v,...y]=g.split(" "),w=y.map(O=>O.replace("TARGET_DIR",()=>l)),{status:$}=ui.sync(v,w,{stdio:"inherit"});process.exit($!=null?$:0)}console.log(`
Scaffolding project in ${h}...`),await Xi("vfiee/project-boilerplate",h,s);const x=(g,v)=>{const y=A.join(h,g);D.writeFileSync(y,v)},C=JSON.parse(D.readFileSync(A.join(h,"package.json"),"utf-8"));C.name=n||a(),x("package.json",JSON.stringify(C,null,2)+`
`);const S=A.relative(Ye,h);switch(console.log(`
${Be("vue-mobile")}`,zi=`${V(`vii current version: v${Vi}`)}`,Le=[{name:"vue",display:"Vue",color:V,variants:[{name:"vue-mobile",display:"JavaScript(Mobile)",color:Lt},{name:"vue-pc",display:"JavaScript(PC)",color:Lt},{name:"custom-create-vite",display:"Customize with create-cite \u2197",color:V,customCommand:"pnpm create vite"}]}],Ht=Le.map(t=>t.variants.map(o=>o.name)).reduce((t,o)=>t.concat(o),[]),He="vii-project";async function Ji(){const t=kt(N._[0]),o=N.template||N.t,f=N.version||N.v;if(N.help){console.log(Wi);return}else if(f){console.log(zi);return}let e=t||He;const a=()=>A.basename(A.resolve(e));let l;Yt.override({overwrite:N.overwrite});try{l=await Yt([{type:t?null:"text",name:"projectName",message:B("Project name:"),initial:He,onState:v=>{e=kt(v.value)||He}},{type:()=>!D.existsSync(e)||Ui(e)?null:"select",name:"overwrite",message:()=>(e==="."?"Current directory":`Target directory "${e}"`)+" is not empty. Please choose how to proceed:",initial:0,choices:[{title:"Cancel operation",value:"no"},{title:"Remove existing files and continue",value:"yes"},{title:"Ignore files and continue",value:"ignore"}]},{type:(v,{overwrite:b})=>{if(b==="no")throw new Error(Be("\u2716")+" Operation cancelled");return null},name:"overwriteChecker"},{type:()=>Vt(a())?null:"text",name:"packageName",message:B("Package name:"),initial:()=>Ki(a()),validate:v=>Vt(v)||"Invalid package.json name"},{type:o&&Ht.includes(o)?null:"select",name:"framework",message:typeof o=="string"&&!Ht.includes(o)?B(`"${o}" isn't a valid template. Please choose from below: `):B("Select a framework:"),initial:0,choices:Le.map(v=>{const b=v.color;return{title:b(v.display||v.name),value:v}})},{type:v=>typeof v=="object"?"select":null,name:"variant",message:B("Select a variant:"),choices:v=>v.variants.map(b=>{const w=b.color;return{title:w(b.display||b.name),value:b.name}})}],{onCancel:()=>{throw new Error(Be("\u2716")+" Operation cancelled")}})}catch(v){console.log(v.message);return}const{framework:r,overwrite:d,packageName:i,variant:n}=l,s=A.join(Ye,e);d==="yes"?Gi(s):D.existsSync(s)||D.mkdirSync(s,{recursive:!0});const h=n||r?.name||o,m=Zi(process.env.npm_config_user_agent),u=m?m.name:"pnpm",c=u==="yarn"&&m?.version.startsWith("1."),{customCommand:p}=Le.flatMap(v=>v.variants).find(v=>v.name===h)??{};if(p){const v=p.replace(/^npm create /,()=>u==="bun"?"bun x create-":`${u} create `).replace("@latest",()=>c?"":"@latest").replace(/^npm exec/,()=>u==="pnpm"?"pnpm dlx":u==="yarn"&&!c?"yarn dlx":u==="bun"?"bun x":"npm exec"),[b,...w]=v.split(" "),S=w.map($=>$.replace("TARGET_DIR",()=>e)),{status:x}=ui.sync(b,S,{stdio:"inherit"});process.exit(x??0)}console.log(`
Scaffolding project in ${s}...`),await Xi("vfiee/project-boilerplate",s,n);const g=(v,b)=>{const w=A.join(s,v);D.writeFileSync(w,b)},y=JSON.parse(D.readFileSync(A.join(s,"package.json"),"utf-8"));y.name=i||a(),g("package.json",JSON.stringify(y,null,2)+`
`);const E=A.relative(Ye,s);switch(console.log(`
Done. Now run:
`),h!==Ye&&console.log(` cd ${S.includes(" ")?`"${S}"`:S}`),u){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${u} install`),console.log(` ${u} run dev`);break}console.log()}function kt(t){return t==null?void 0:t.trim().replace(/\/+$/g,"")}function Vt(t){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(t)}function Ji(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Ki(t){const o=D.readdirSync(t);return o.length===0||o.length===1&&o[0]===".git"}function Gi(t){if(D.existsSync(t))for(const o of D.readdirSync(t))o!==".git"&&D.rmSync(A.resolve(t,o),{recursive:!0,force:!0})}function Zi(t){if(!t)return;const o=t.split(" ")[0].split("/");return{name:o[0],version:o[1]}}function Xi(t,o,f="main"){const{promise:e,resolve:l,reject:a}=Promise.withResolvers();return zt(`${t}#${f}`,o,r=>{if(r){a(r);return}l(!0)}),e}Ui().catch(t=>{console.error(t)});
`),s!==Ye&&console.log(` cd ${E.includes(" ")?`"${E}"`:E}`),u){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${u} install`),console.log(` ${u} run dev`);break}console.log()}function kt(t){return t?.trim().replace(/\/+$/g,"")}function Vt(t){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(t)}function Ki(t){return t.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Ui(t){const o=D.readdirSync(t);return o.length===0||o.length===1&&o[0]===".git"}function Gi(t){if(D.existsSync(t))for(const o of D.readdirSync(t))o!==".git"&&D.rmSync(A.resolve(t,o),{recursive:!0,force:!0})}function Zi(t){if(!t)return;const o=t.split(" ")[0].split("/");return{name:o[0],version:o[1]}}function Xi(t,o,f="main"){const{promise:e,resolve:a,reject:l}=Qi();return zt(`${t}#${f}`,o,r=>{if(r){l(r);return}a(!0)}),e}Promise.withResolvers();function Qi(){let t,o;return{promise:new Promise((f,e)=>{t=f,o=e}),resolve:t,reject:o}}Ji().catch(t=>{console.error(t)});
{
"name": "@vyron/cli",
"version": "1.1.0",
"version": "1.1.1",
"type": "module",

@@ -5,0 +5,0 @@ "license": "MIT",