create-lik-app 0.0.10 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -1,26 +1,26 @@
1
- import Rt from"readline";import It from"events";import A from"node:fs";import j from"node:path";import wi from"child_process";import re from"path";import ie from"fs";var yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xi(e,t){var n=e;t.slice(0,-1).forEach(function(l){n=n[l]||{}});var r=t[t.length-1];return r in n}function At(e){return typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function jt(e,t){return t==="constructor"&&typeof e[t]=="function"||t==="__proto__"}var $i=function(e,t){t||(t={});var n={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(n.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?n.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(w){n.bools[w]=!0});var r={};function l(w){return r[w].some(function(x){return n.bools[x]})}Object.keys(t.alias||{}).forEach(function(w){r[w]=[].concat(t.alias[w]),r[w].forEach(function(x){r[x]=[w].concat(r[w].filter(function($){return x!==$}))})}),[].concat(t.string).filter(Boolean).forEach(function(w){n.strings[w]=!0,r[w]&&[].concat(r[w]).forEach(function(x){n.strings[x]=!0})});var p=t.default||{},i={_:[]};function g(w,x){return n.allBools&&/^--[^=]+$/.test(x)||n.strings[w]||n.bools[w]||r[w]}function h(w,x,$){for(var O=w,P=0;P<x.length-1;P++){var S=x[P];if(jt(O,S))return;O[S]===void 0&&(O[S]={}),(O[S]===Object.prototype||O[S]===Number.prototype||O[S]===String.prototype)&&(O[S]={}),O[S]===Array.prototype&&(O[S]=[]),O=O[S]}var M=x[x.length-1];jt(O,M)||((O===Object.prototype||O===Number.prototype||O===String.prototype)&&(O={}),O===Array.prototype&&(O=[]),O[M]===void 0||n.bools[M]||typeof O[M]=="boolean"?O[M]=$:Array.isArray(O[M])?O[M].push($):O[M]=[O[M],$])}function u(w,x,$){if(!($&&n.unknownFn&&!g(w,$)&&n.unknownFn($)===!1)){var O=!n.strings[w]&&At(x)?Number(x):x;h(i,w.split("."),O),(r[w]||[]).forEach(function(P){h(i,P.split("."),O)})}}Object.keys(n.bools).forEach(function(w){u(w,p[w]===void 0?!1:p[w])});var s=[];e.indexOf("--")!==-1&&(s=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var d=0;d<e.length;d++){var c=e[d],o,a;if(/^--.+=/.test(c)){var y=c.match(/^--([^=]+)=([\s\S]*)$/);o=y[1];var v=y[2];n.bools[o]&&(v=v!=="false"),u(o,v,c)}else if(/^--no-.+/.test(c))o=c.match(/^--no-(.+)/)[1],u(o,!1,c);else if(/^--.+/.test(c))o=c.match(/^--(.+)/)[1],a=e[d+1],a!==void 0&&!/^(-|--)[^-]/.test(a)&&!n.bools[o]&&!n.allBools&&(!r[o]||!l(o))?(u(o,a,c),d+=1):/^(true|false)$/.test(a)?(u(o,a==="true",c),d+=1):u(o,n.strings[o]?"":!0,c);else if(/^-[^-]+/.test(c)){for(var f=c.slice(1,-1).split(""),m=!1,b=0;b<f.length;b++){if(a=c.slice(b+2),a==="-"){u(f[b],a,c);continue}if(/[A-Za-z]/.test(f[b])&&a[0]==="="){u(f[b],a.slice(1),c),m=!0;break}if(/[A-Za-z]/.test(f[b])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(a)){u(f[b],a,c),m=!0;break}if(f[b+1]&&f[b+1].match(/\W/)){u(f[b],c.slice(b+2),c),m=!0;break}else u(f[b],n.strings[f[b]]?"":!0,c)}o=c.slice(-1)[0],!m&&o!=="-"&&(e[d+1]&&!/^(-|--)[^-]/.test(e[d+1])&&!n.bools[o]&&(!r[o]||!l(o))?(u(o,e[d+1],c),d+=1):e[d+1]&&/^(true|false)$/.test(e[d+1])?(u(o,e[d+1]==="true",c),d+=1):u(o,n.strings[o]?"":!0,c))}else if((!n.unknownFn||n.unknownFn(c)!==!1)&&i._.push(n.strings._||!At(c)?c:Number(c)),t.stopEarly){i._.push.apply(i._,e.slice(d+1));break}}return Object.keys(p).forEach(function(w){xi(i,w.split("."))||(h(i,w.split("."),p[w]),(r[w]||[]).forEach(function(x){h(i,x.split("."),p[w])}))}),t["--"]?i["--"]=s.slice():s.forEach(function(w){i._.push(w)}),i};const Si=Z($i);var se={exports:{}};let X=process||{},Ft=X.argv||[],Q=X.env||{},Oi=!(Q.NO_COLOR||Ft.includes("--no-color"))&&(!!Q.FORCE_COLOR||Ft.includes("--color")||X.platform==="win32"||(X.stdout||{}).isTTY&&Q.TERM!=="dumb"||!!Q.CI),Mi=(e,t,n=e)=>r=>{let l=""+r,p=l.indexOf(t,e.length);return~p?e+Pi(l,t,n,p)+t:e+l+t},Pi=(e,t,n,r)=>{let l="",p=0;do l+=e.substring(p,r)+n,p=r+t.length,r=e.indexOf(t,p);while(~r);return l+e.substring(p)},Nt=(e=Oi)=>{let t=e?Mi:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};se.exports=Nt(),se.exports.createColors=Nt;var Ti=se.exports;const Ei=Z(Ti);var ne={},oe,kt;function E(){if(kt)return oe;kt=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,TERM:n}=process.env,r={enabled:!t&&n!=="dumb"&&e!=="0",reset:i(0,0),bold:i(1,22),dim:i(2,22),italic:i(3,23),underline:i(4,24),inverse:i(7,27),hidden:i(8,28),strikethrough:i(9,29),black:i(30,39),red:i(31,39),green:i(32,39),yellow:i(33,39),blue:i(34,39),magenta:i(35,39),cyan:i(36,39),white:i(37,39),gray:i(90,39),grey:i(90,39),bgBlack:i(40,49),bgRed:i(41,49),bgGreen:i(42,49),bgYellow:i(43,49),bgBlue:i(44,49),bgMagenta:i(45,49),bgCyan:i(46,49),bgWhite:i(47,49)};function l(g,h){let u=0,s,d="",c="";for(;u<g.length;u++)s=g[u],d+=s.open,c+=s.close,h.includes(s.close)&&(h=h.replace(s.rgx,s.close+s.open));return d+h+c}function p(g,h){let u={has:g,keys:h};return u.reset=r.reset.bind(u),u.bold=r.bold.bind(u),u.dim=r.dim.bind(u),u.italic=r.italic.bind(u),u.underline=r.underline.bind(u),u.inverse=r.inverse.bind(u),u.hidden=r.hidden.bind(u),u.strikethrough=r.strikethrough.bind(u),u.black=r.black.bind(u),u.red=r.red.bind(u),u.green=r.green.bind(u),u.yellow=r.yellow.bind(u),u.blue=r.blue.bind(u),u.magenta=r.magenta.bind(u),u.cyan=r.cyan.bind(u),u.white=r.white.bind(u),u.gray=r.gray.bind(u),u.grey=r.grey.bind(u),u.bgBlack=r.bgBlack.bind(u),u.bgRed=r.bgRed.bind(u),u.bgGreen=r.bgGreen.bind(u),u.bgYellow=r.bgYellow.bind(u),u.bgBlue=r.bgBlue.bind(u),u.bgMagenta=r.bgMagenta.bind(u),u.bgCyan=r.bgCyan.bind(u),u.bgWhite=r.bgWhite.bind(u),u}function i(g,h){let u={open:`\x1B[${g}m`,close:`\x1B[${h}m`,rgx:new RegExp(`\\x1b\\[${h}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(g)||(this.has.push(g),this.keys.push(u)),s===void 0?this:r.enabled?l(this.keys,s+""):s+""):s===void 0?p([g],[u]):r.enabled?l([u],s+""):s+""}}return oe=r,oe}var le,Yt;function Ci(){return Yt||(Yt=1,le=(e,t)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(t){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),le}var he,Ht;function ue(){return Ht||(Ht=1,he=e=>{const t=["[\\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("|"),n=new RegExp(t,"g");return typeof e=="string"?e.replace(n,""):e}),he}var ae,Bt;function C(){if(Bt)return ae;Bt=1;const e="\x1B",t=`${e}[`,n="\x07",r={to(i,g){return g?`${t}${g+1};${i+1}H`:`${t}${i+1}G`},move(i,g){let h="";return i<0?h+=`${t}${-i}D`:i>0&&(h+=`${t}${i}C`),g<0?h+=`${t}${-g}A`:g>0&&(h+=`${t}${g}B`),h},up:(i=1)=>`${t}${i}A`,down:(i=1)=>`${t}${i}B`,forward:(i=1)=>`${t}${i}C`,backward:(i=1)=>`${t}${i}D`,nextLine:(i=1)=>`${t}E`.repeat(i),prevLine:(i=1)=>`${t}F`.repeat(i),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${e}7`,restore:`${e}8`},l={up:(i=1)=>`${t}S`.repeat(i),down:(i=1)=>`${t}T`.repeat(i)},p={screen:`${t}2J`,up:(i=1)=>`${t}1J`.repeat(i),down:(i=1)=>`${t}J`.repeat(i),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(i){let g="";for(let h=0;h<i;h++)g+=this.line+(h<i-1?r.up():"");return i&&(g+=r.left),g}};return ae={cursor:r,scroll:l,erase:p,beep:n},ae}var ce,Lt;function _i(){if(Lt)return ce;Lt=1;function e(h,u){var s=typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(!s){if(Array.isArray(h)||(s=t(h))||u&&h&&typeof h.length=="number"){s&&(h=s);var d=0,c=function(){};return{s:c,n:function(){return d>=h.length?{done:!0}:{done:!1,value:h[d++]}},e:function(f){throw f},f:c}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,y;return{s:function(){s=s.call(h)},n:function(){var f=s.next();return o=f.done,f},e:function(f){a=!0,y=f},f:function(){try{!o&&s.return!=null&&s.return()}finally{if(a)throw y}}}}function t(h,u){if(h){if(typeof h=="string")return n(h,u);var s=Object.prototype.toString.call(h).slice(8,-1);if(s==="Object"&&h.constructor&&(s=h.constructor.name),s==="Map"||s==="Set")return Array.from(h);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return n(h,u)}}function n(h,u){(u==null||u>h.length)&&(u=h.length);for(var s=0,d=new Array(u);s<u;s++)d[s]=h[s];return d}const r=ue(),l=C(),p=l.erase,i=l.cursor,g=h=>[...r(h)].length;return ce=function(h,u){if(!u)return p.line+i.to(0);let s=0;const d=h.split(/\r?\n/);var c=e(d),o;try{for(c.s();!(o=c.n()).done;){let a=o.value;s+=1+Math.floor(Math.max(g(a)-1,0)/u)}}catch(a){c.e(a)}finally{c.f()}return p.lines(s)},ce}var de,Vt;function Ut(){if(Vt)return de;Vt=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},t={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return de=process.platform==="win32"?t:e,de}var fe,Gt;function qi(){if(Gt)return fe;Gt=1;const e=E(),t=Ut(),n=Object.freeze({password:{scale:1,render:h=>"*".repeat(h.length)},emoji:{scale:2,render:h=>"\u{1F603}".repeat(h.length)},invisible:{scale:0,render:h=>""},default:{scale:1,render:h=>`${h}`}}),r=h=>n[h]||n.default,l=Object.freeze({aborted:e.red(t.cross),done:e.green(t.tick),exited:e.yellow(t.cross),default:e.cyan("?")});return fe={styles:n,render:r,symbols:l,symbol:(h,u,s)=>u?l.aborted:s?l.exited:h?l.done:l.default,delimiter:h=>e.gray(h?t.ellipsis:t.pointerSmall),item:(h,u)=>e.gray(h?u?t.pointerSmall:"+":t.line)},fe}var pe,zt;function Di(){if(zt)return pe;zt=1;const e=ue();return pe=function(t,n){let r=String(e(t)||"").split(/\r?\n/);return n?r.map(l=>Math.ceil(l.length/n)).reduce((l,p)=>l+p):r.length},pe}var me,Wt;function Ri(){return Wt||(Wt=1,me=(e,t={})=>{const n=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(e||"").split(/\r?\n/g).map(l=>l.split(/\s+/g).reduce((p,i)=>(i.length+n.length>=r||p[p.length-1].length+i.length+1<r?p[p.length-1]+=` ${i}`:p.push(`${n}${i}`),p),[n]).join(`
1
+ import qt from"readline";import Dt from"events";import j from"node:fs";import F from"node:path";import gi from"child_process";import Q from"path";import ee from"fs";var vi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function te(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bi(e,t){var n=e;t.slice(0,-1).forEach(function(l){n=n[l]||{}});var r=t[t.length-1];return r in n}function Rt(e){return typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function It(e,t){return t==="constructor"&&typeof e[t]=="function"||t==="__proto__"}var wi=function(e,t){t||(t={});var n={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(n.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?n.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(w){n.bools[w]=!0});var r={};function l(w){return r[w].some(function(x){return n.bools[x]})}Object.keys(t.alias||{}).forEach(function(w){r[w]=[].concat(t.alias[w]),r[w].forEach(function(x){r[x]=[w].concat(r[w].filter(function($){return x!==$}))})}),[].concat(t.string).filter(Boolean).forEach(function(w){n.strings[w]=!0,r[w]&&[].concat(r[w]).forEach(function(x){n.strings[x]=!0})});var p=t.default||{},i={_:[]};function g(w,x){return n.allBools&&/^--[^=]+$/.test(x)||n.strings[w]||n.bools[w]||r[w]}function h(w,x,$){for(var O=w,P=0;P<x.length-1;P++){var S=x[P];if(It(O,S))return;O[S]===void 0&&(O[S]={}),(O[S]===Object.prototype||O[S]===Number.prototype||O[S]===String.prototype)&&(O[S]={}),O[S]===Array.prototype&&(O[S]=[]),O=O[S]}var M=x[x.length-1];It(O,M)||((O===Object.prototype||O===Number.prototype||O===String.prototype)&&(O={}),O===Array.prototype&&(O=[]),O[M]===void 0||n.bools[M]||typeof O[M]=="boolean"?O[M]=$:Array.isArray(O[M])?O[M].push($):O[M]=[O[M],$])}function u(w,x,$){if(!($&&n.unknownFn&&!g(w,$)&&n.unknownFn($)===!1)){var O=!n.strings[w]&&Rt(x)?Number(x):x;h(i,w.split("."),O),(r[w]||[]).forEach(function(P){h(i,P.split("."),O)})}}Object.keys(n.bools).forEach(function(w){u(w,p[w]===void 0?!1:p[w])});var s=[];e.indexOf("--")!==-1&&(s=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var d=0;d<e.length;d++){var c=e[d],o,a;if(/^--.+=/.test(c)){var y=c.match(/^--([^=]+)=([\s\S]*)$/);o=y[1];var v=y[2];n.bools[o]&&(v=v!=="false"),u(o,v,c)}else if(/^--no-.+/.test(c))o=c.match(/^--no-(.+)/)[1],u(o,!1,c);else if(/^--.+/.test(c))o=c.match(/^--(.+)/)[1],a=e[d+1],a!==void 0&&!/^(-|--)[^-]/.test(a)&&!n.bools[o]&&!n.allBools&&(!r[o]||!l(o))?(u(o,a,c),d+=1):/^(true|false)$/.test(a)?(u(o,a==="true",c),d+=1):u(o,n.strings[o]?"":!0,c);else if(/^-[^-]+/.test(c)){for(var f=c.slice(1,-1).split(""),m=!1,b=0;b<f.length;b++){if(a=c.slice(b+2),a==="-"){u(f[b],a,c);continue}if(/[A-Za-z]/.test(f[b])&&a[0]==="="){u(f[b],a.slice(1),c),m=!0;break}if(/[A-Za-z]/.test(f[b])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(a)){u(f[b],a,c),m=!0;break}if(f[b+1]&&f[b+1].match(/\W/)){u(f[b],c.slice(b+2),c),m=!0;break}else u(f[b],n.strings[f[b]]?"":!0,c)}o=c.slice(-1)[0],!m&&o!=="-"&&(e[d+1]&&!/^(-|--)[^-]/.test(e[d+1])&&!n.bools[o]&&(!r[o]||!l(o))?(u(o,e[d+1],c),d+=1):e[d+1]&&/^(true|false)$/.test(e[d+1])?(u(o,e[d+1]==="true",c),d+=1):u(o,n.strings[o]?"":!0,c))}else if((!n.unknownFn||n.unknownFn(c)!==!1)&&i._.push(n.strings._||!Rt(c)?c:Number(c)),t.stopEarly){i._.push.apply(i._,e.slice(d+1));break}}return Object.keys(p).forEach(function(w){bi(i,w.split("."))||(h(i,w.split("."),p[w]),(r[w]||[]).forEach(function(x){h(i,x.split("."),p[w])}))}),t["--"]?i["--"]=s.slice():s.forEach(function(w){i._.push(w)}),i};const yi=te(wi);var re={exports:{}};let K=process||{},At=K.argv||[],Z=K.env||{},xi=!(Z.NO_COLOR||At.includes("--no-color"))&&(!!Z.FORCE_COLOR||At.includes("--color")||K.platform==="win32"||(K.stdout||{}).isTTY&&Z.TERM!=="dumb"||!!Z.CI),$i=(e,t,n=e)=>r=>{let l=""+r,p=l.indexOf(t,e.length);return~p?e+Si(l,t,n,p)+t:e+l+t},Si=(e,t,n,r)=>{let l="",p=0;do l+=e.substring(p,r)+n,p=r+t.length,r=e.indexOf(t,p);while(~r);return l+e.substring(p)},jt=(e=xi)=>{let t=e?$i:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};re.exports=jt(),re.exports.createColors=jt;var E=re.exports,ie={},se,Ft;function C(){if(Ft)return se;Ft=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,TERM:n}=process.env,r={enabled:!t&&n!=="dumb"&&e!=="0",reset:i(0,0),bold:i(1,22),dim:i(2,22),italic:i(3,23),underline:i(4,24),inverse:i(7,27),hidden:i(8,28),strikethrough:i(9,29),black:i(30,39),red:i(31,39),green:i(32,39),yellow:i(33,39),blue:i(34,39),magenta:i(35,39),cyan:i(36,39),white:i(37,39),gray:i(90,39),grey:i(90,39),bgBlack:i(40,49),bgRed:i(41,49),bgGreen:i(42,49),bgYellow:i(43,49),bgBlue:i(44,49),bgMagenta:i(45,49),bgCyan:i(46,49),bgWhite:i(47,49)};function l(g,h){let u=0,s,d="",c="";for(;u<g.length;u++)s=g[u],d+=s.open,c+=s.close,h.includes(s.close)&&(h=h.replace(s.rgx,s.close+s.open));return d+h+c}function p(g,h){let u={has:g,keys:h};return u.reset=r.reset.bind(u),u.bold=r.bold.bind(u),u.dim=r.dim.bind(u),u.italic=r.italic.bind(u),u.underline=r.underline.bind(u),u.inverse=r.inverse.bind(u),u.hidden=r.hidden.bind(u),u.strikethrough=r.strikethrough.bind(u),u.black=r.black.bind(u),u.red=r.red.bind(u),u.green=r.green.bind(u),u.yellow=r.yellow.bind(u),u.blue=r.blue.bind(u),u.magenta=r.magenta.bind(u),u.cyan=r.cyan.bind(u),u.white=r.white.bind(u),u.gray=r.gray.bind(u),u.grey=r.grey.bind(u),u.bgBlack=r.bgBlack.bind(u),u.bgRed=r.bgRed.bind(u),u.bgGreen=r.bgGreen.bind(u),u.bgYellow=r.bgYellow.bind(u),u.bgBlue=r.bgBlue.bind(u),u.bgMagenta=r.bgMagenta.bind(u),u.bgCyan=r.bgCyan.bind(u),u.bgWhite=r.bgWhite.bind(u),u}function i(g,h){let u={open:`\x1B[${g}m`,close:`\x1B[${h}m`,rgx:new RegExp(`\\x1b\\[${h}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(g)||(this.has.push(g),this.keys.push(u)),s===void 0?this:r.enabled?l(this.keys,s+""):s+""):s===void 0?p([g],[u]):r.enabled?l([u],s+""):s+""}}return se=r,se}var ne,Nt;function Oi(){return Nt||(Nt=1,ne=(e,t)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(t){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),ne}var oe,kt;function le(){return kt||(kt=1,oe=e=>{const t=["[\\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("|"),n=new RegExp(t,"g");return typeof e=="string"?e.replace(n,""):e}),oe}var he,Yt;function _(){if(Yt)return he;Yt=1;const e="\x1B",t=`${e}[`,n="\x07",r={to(i,g){return g?`${t}${g+1};${i+1}H`:`${t}${i+1}G`},move(i,g){let h="";return i<0?h+=`${t}${-i}D`:i>0&&(h+=`${t}${i}C`),g<0?h+=`${t}${-g}A`:g>0&&(h+=`${t}${g}B`),h},up:(i=1)=>`${t}${i}A`,down:(i=1)=>`${t}${i}B`,forward:(i=1)=>`${t}${i}C`,backward:(i=1)=>`${t}${i}D`,nextLine:(i=1)=>`${t}E`.repeat(i),prevLine:(i=1)=>`${t}F`.repeat(i),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${e}7`,restore:`${e}8`},l={up:(i=1)=>`${t}S`.repeat(i),down:(i=1)=>`${t}T`.repeat(i)},p={screen:`${t}2J`,up:(i=1)=>`${t}1J`.repeat(i),down:(i=1)=>`${t}J`.repeat(i),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(i){let g="";for(let h=0;h<i;h++)g+=this.line+(h<i-1?r.up():"");return i&&(g+=r.left),g}};return he={cursor:r,scroll:l,erase:p,beep:n},he}var ue,Ht;function Mi(){if(Ht)return ue;Ht=1;function e(h,u){var s=typeof Symbol<"u"&&h[Symbol.iterator]||h["@@iterator"];if(!s){if(Array.isArray(h)||(s=t(h))||u&&h&&typeof h.length=="number"){s&&(h=s);var d=0,c=function(){};return{s:c,n:function(){return d>=h.length?{done:!0}:{done:!1,value:h[d++]}},e:function(f){throw f},f:c}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,y;return{s:function(){s=s.call(h)},n:function(){var f=s.next();return o=f.done,f},e:function(f){a=!0,y=f},f:function(){try{!o&&s.return!=null&&s.return()}finally{if(a)throw y}}}}function t(h,u){if(h){if(typeof h=="string")return n(h,u);var s=Object.prototype.toString.call(h).slice(8,-1);if(s==="Object"&&h.constructor&&(s=h.constructor.name),s==="Map"||s==="Set")return Array.from(h);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return n(h,u)}}function n(h,u){(u==null||u>h.length)&&(u=h.length);for(var s=0,d=new Array(u);s<u;s++)d[s]=h[s];return d}const r=le(),l=_(),p=l.erase,i=l.cursor,g=h=>[...r(h)].length;return ue=function(h,u){if(!u)return p.line+i.to(0);let s=0;const d=h.split(/\r?\n/);var c=e(d),o;try{for(c.s();!(o=c.n()).done;){let a=o.value;s+=1+Math.floor(Math.max(g(a)-1,0)/u)}}catch(a){c.e(a)}finally{c.f()}return p.lines(s)},ue}var ae,Bt;function Lt(){if(Bt)return ae;Bt=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},t={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return ae=process.platform==="win32"?t:e,ae}var ce,Vt;function Pi(){if(Vt)return ce;Vt=1;const e=C(),t=Lt(),n=Object.freeze({password:{scale:1,render:h=>"*".repeat(h.length)},emoji:{scale:2,render:h=>"\u{1F603}".repeat(h.length)},invisible:{scale:0,render:h=>""},default:{scale:1,render:h=>`${h}`}}),r=h=>n[h]||n.default,l=Object.freeze({aborted:e.red(t.cross),done:e.green(t.tick),exited:e.yellow(t.cross),default:e.cyan("?")});return ce={styles:n,render:r,symbols:l,symbol:(h,u,s)=>u?l.aborted:s?l.exited:h?l.done:l.default,delimiter:h=>e.gray(h?t.ellipsis:t.pointerSmall),item:(h,u)=>e.gray(h?u?t.pointerSmall:"+":t.line)},ce}var de,Ut;function Ti(){if(Ut)return de;Ut=1;const e=le();return de=function(t,n){let r=String(e(t)||"").split(/\r?\n/);return n?r.map(l=>Math.ceil(l.length/n)).reduce((l,p)=>l+p):r.length},de}var fe,Gt;function Ei(){return Gt||(Gt=1,fe=(e,t={})=>{const n=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(e||"").split(/\r?\n/g).map(l=>l.split(/\s+/g).reduce((p,i)=>(i.length+n.length>=r||p[p.length-1].length+i.length+1<r?p[p.length-1]+=` ${i}`:p.push(`${n}${i}`),p),[n]).join(`
3
3
  `)).join(`
4
- `)}),me}var ge,Jt;function Ii(){return Jt||(Jt=1,ge=(e,t,n)=>{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let l=Math.min(r+n,t);return{startIndex:r,endIndex:l}}),ge}var ve,Kt;function k(){return Kt||(Kt=1,ve={action:Ci(),clear:_i(),style:qi(),strip:ue(),figures:Ut(),lines:Di(),wrap:Ri(),entriesToDisplay:Ii()}),ve}var be,Zt;function L(){if(Zt)return be;Zt=1;const e=Rt,t=k(),n=t.action,r=It,l=C(),p=l.beep,i=l.cursor,g=E();class h extends r{constructor(s={}){super(),this.firstRender=!0,this.in=s.stdin||process.stdin,this.out=s.stdout||process.stdout,this.onRender=(s.onRender||(()=>{})).bind(this);const d=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,d),this.in.isTTY&&this.in.setRawMode(!0);const c=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,o=(a,y)=>{let v=n(y,c);v===!1?this._&&this._(a,y):typeof this[v]=="function"?this[v](y):this.bell()};this.close=()=>{this.out.write(i.show),this.in.removeListener("keypress",o),this.in.isTTY&&this.in.setRawMode(!1),d.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",o)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(p)}render(){this.onRender(g),this.firstRender&&(this.firstRender=!1)}}return be=h,be}var we,Xt;function Ai(){if(Xt)return we;Xt=1;function e(o,a,y,v,f,m,b){try{var w=o[m](b),x=w.value}catch($){y($);return}w.done?a(x):Promise.resolve(x).then(v,f)}function t(o){return function(){var a=this,y=arguments;return new Promise(function(v,f){var m=o.apply(a,y);function b(x){e(m,v,f,b,w,"next",x)}function w(x){e(m,v,f,b,w,"throw",x)}b(void 0)})}}const n=E(),r=L(),l=C(),p=l.erase,i=l.cursor,g=k(),h=g.style,u=g.clear,s=g.lines,d=g.figures;class c extends r{constructor(a={}){super(a),this.transform=h.render(a.style),this.scale=this.transform.scale,this.msg=a.message,this.initial=a.initial||"",this.validator=a.validate||(()=>!0),this.value="",this.errorMsg=a.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=u("",this.out.columns),this.render()}set value(a){!a&&this.initial?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(a)),this._value=a,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(`
4
+ `)}),fe}var pe,zt;function Ci(){return zt||(zt=1,pe=(e,t,n)=>{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let l=Math.min(r+n,t);return{startIndex:r,endIndex:l}}),pe}var me,Wt;function Y(){return Wt||(Wt=1,me={action:Oi(),clear:Mi(),style:Pi(),strip:le(),figures:Lt(),lines:Ti(),wrap:Ei(),entriesToDisplay:Ci()}),me}var ge,Jt;function V(){if(Jt)return ge;Jt=1;const e=qt,t=Y(),n=t.action,r=Dt,l=_(),p=l.beep,i=l.cursor,g=C();class h extends r{constructor(s={}){super(),this.firstRender=!0,this.in=s.stdin||process.stdin,this.out=s.stdout||process.stdout,this.onRender=(s.onRender||(()=>{})).bind(this);const d=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,d),this.in.isTTY&&this.in.setRawMode(!0);const c=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,o=(a,y)=>{let v=n(y,c);v===!1?this._&&this._(a,y):typeof this[v]=="function"?this[v](y):this.bell()};this.close=()=>{this.out.write(i.show),this.in.removeListener("keypress",o),this.in.isTTY&&this.in.setRawMode(!1),d.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",o)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(p)}render(){this.onRender(g),this.firstRender&&(this.firstRender=!1)}}return ge=h,ge}var ve,Kt;function _i(){if(Kt)return ve;Kt=1;function e(o,a,y,v,f,m,b){try{var w=o[m](b),x=w.value}catch($){y($);return}w.done?a(x):Promise.resolve(x).then(v,f)}function t(o){return function(){var a=this,y=arguments;return new Promise(function(v,f){var m=o.apply(a,y);function b(x){e(m,v,f,b,w,"next",x)}function w(x){e(m,v,f,b,w,"throw",x)}b(void 0)})}}const n=C(),r=V(),l=_(),p=l.erase,i=l.cursor,g=Y(),h=g.style,u=g.clear,s=g.lines,d=g.figures;class c extends r{constructor(a={}){super(a),this.transform=h.render(a.style),this.scale=this.transform.scale,this.msg=a.message,this.initial=a.initial||"",this.validator=a.validate||(()=>!0),this.value="",this.errorMsg=a.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=u("",this.out.columns),this.render()}set value(a){!a&&this.initial?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(a)),this._value=a,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(`
5
5
  `),this.close()}validate(){var a=this;return t(function*(){let y=yield a.validator(a.value);typeof y=="string"&&(a.errorMsg=y,y=!1),a.error=!y})()}submit(){var a=this;return t(function*(){if(a.value=a.value||a.initial,a.cursorOffset=0,a.cursor=a.rendered.length,yield a.validate(),a.error){a.red=!0,a.fire(),a.render();return}a.done=!0,a.aborted=!1,a.fire(),a.render(),a.out.write(`
6
6
  `),a.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(a){this.placeholder||(this.cursor=this.cursor+a,this.cursorOffset+=a)}_(a,y){let v=this.value.slice(0,this.cursor),f=this.value.slice(this.cursor);this.value=`${v}${a}${f}`,this.red=!1,this.cursor=this.placeholder?0:v.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let a=this.value.slice(0,this.cursor-1),y=this.value.slice(this.cursor);this.value=`${a}${y}`,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 a=this.value.slice(0,this.cursor),y=this.value.slice(this.cursor+1);this.value=`${a}${y}`,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(i.down(s(this.outputError,this.out.columns)-1)+u(this.outputError,this.out.columns)),this.out.write(u(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[h.symbol(this.done,this.aborted),n.bold(this.msg),h.delimiter(this.done),this.red?n.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
7
7
  `).reduce((a,y,v)=>a+`
8
- ${v?" ":d.pointerSmall} ${n.red().italic(y)}`,"")),this.out.write(p.line+i.to(0)+this.outputText+i.save+this.outputError+i.restore+i.move(this.cursorOffset,0)))}}return we=c,we}var ye,Qt;function ji(){if(Qt)return ye;Qt=1;const e=E(),t=L(),n=k(),r=n.style,l=n.clear,p=n.figures,i=n.wrap,g=n.entriesToDisplay,h=C(),u=h.cursor;class s extends t{constructor(c={}){super(c),this.msg=c.message,this.hint=c.hint||"- Use arrow-keys. Return to submit.",this.warn=c.warn||"- This option is disabled",this.cursor=c.initial||0,this.choices=c.choices.map((o,a)=>(typeof o=="string"&&(o={title:o,value:a}),{title:o&&(o.title||o.value||o),value:o&&(o.value===void 0?a:o.value),description:o&&o.description,selected:o&&o.selected,disabled:o&&o.disabled})),this.optionsPerPage=c.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=l("",this.out.columns),this.render()}moveCursor(c){this.cursor=c,this.value=this.choices[c].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(`
8
+ ${v?" ":d.pointerSmall} ${n.red().italic(y)}`,"")),this.out.write(p.line+i.to(0)+this.outputText+i.save+this.outputError+i.restore+i.move(this.cursorOffset,0)))}}return ve=c,ve}var be,Zt;function qi(){if(Zt)return be;Zt=1;const e=C(),t=V(),n=Y(),r=n.style,l=n.clear,p=n.figures,i=n.wrap,g=n.entriesToDisplay,h=_(),u=h.cursor;class s extends t{constructor(c={}){super(c),this.msg=c.message,this.hint=c.hint||"- Use arrow-keys. Return to submit.",this.warn=c.warn||"- This option is disabled",this.cursor=c.initial||0,this.choices=c.choices.map((o,a)=>(typeof o=="string"&&(o={title:o,value:a}),{title:o&&(o.title||o.value||o),value:o&&(o.value===void 0?a:o.value),description:o&&o.description,selected:o&&o.selected,disabled:o&&o.disabled})),this.optionsPerPage=c.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=l("",this.out.columns),this.render()}moveCursor(c){this.cursor=c,this.value=this.choices[c].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(`
9
9
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
10
10
  `),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()}_(c,o){if(c===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(u.hide):this.out.write(l(this.outputText,this.out.columns)),super.render();let c=g(this.cursor,this.choices.length,this.optionsPerPage),o=c.startIndex,a=c.endIndex;if(this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
11
11
  `;for(let y=o;y<a;y++){let v,f,m="",b=this.choices[y];y===o&&o>0?f=p.arrowUp:y===a-1&&a<this.choices.length?f=p.arrowDown:f=" ",b.disabled?(v=this.cursor===y?e.gray().underline(b.title):e.strikethrough().gray(b.title),f=(this.cursor===y?e.bold().gray(p.pointer)+" ":" ")+f):(v=this.cursor===y?e.cyan().underline(b.title):b.title,f=(this.cursor===y?e.cyan(p.pointer)+" ":" ")+f,b.description&&this.cursor===y&&(m=` - ${b.description}`,(f.length+v.length+m.length>=this.out.columns||b.description.split(/\r?\n/).length>1)&&(m=`
12
12
  `+i(b.description,{margin:3,width:this.out.columns})))),this.outputText+=`${f} ${v}${e.gray(m)}
13
- `}}this.out.write(this.outputText)}}return ye=s,ye}var xe,er;function Fi(){if(er)return xe;er=1;const e=E(),t=L(),n=k(),r=n.style,l=n.clear,p=C(),i=p.cursor,g=p.erase;class h extends t{constructor(s={}){super(s),this.msg=s.message,this.value=!!s.initial,this.active=s.active||"on",this.inactive=s.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(`
13
+ `}}this.out.write(this.outputText)}}return be=s,be}var we,Xt;function Di(){if(Xt)return we;Xt=1;const e=C(),t=V(),n=Y(),r=n.style,l=n.clear,p=_(),i=p.cursor,g=p.erase;class h extends t{constructor(s={}){super(s),this.msg=s.message,this.value=!!s.initial,this.active=s.active||"on",this.inactive=s.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(`
14
14
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
15
- `),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()}_(s,d){if(s===" ")this.value=!this.value;else if(s==="1")this.value=!0;else if(s==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(l(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(g.line+i.to(0)+this.outputText))}}return xe=h,xe}var $e,tr;function H(){if(tr)return $e;tr=1;class e{constructor({token:n,date:r,parts:l,locales:p}){this.token=n,this.date=r||new Date,this.parts=l||[this],this.locales=p||{}}up(){}down(){}next(){const n=this.parts.indexOf(this);return this.parts.find((r,l)=>l>n&&r instanceof e)}setTo(n){}prev(){let n=[].concat(this.parts).reverse();const r=n.indexOf(this);return n.find((l,p)=>p>r&&l instanceof e)}toString(){return String(this.date)}}return $e=e,$e}var Se,rr;function Ni(){if(rr)return Se;rr=1;const e=H();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}}return Se=t,Se}var Oe,ir;function ki(){if(ir)return Oe;ir=1;const e=H(),t=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th");class n extends e{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(),p=this.date.getDay();return this.token==="DD"?String(l).padStart(2,"0"):this.token==="Do"?l+t(l):this.token==="d"?p+1:this.token==="ddd"?this.locales.weekdaysShort[p]:this.token==="dddd"?this.locales.weekdays[p]:l}}return Oe=n,Oe}var Me,sr;function Yi(){if(sr)return Me;sr=1;const e=H();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}}return Me=t,Me}var Pe,nr;function Hi(){if(nr)return Pe;nr=1;const e=H();class t extends e{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return Pe=t,Pe}var Te,or;function Bi(){if(or)return Te;or=1;const e=H();class t extends e{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}}return Te=t,Te}var Ee,lr;function Li(){if(lr)return Ee;lr=1;const e=H();class t extends e{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),l=this.token.length;return l===2?String(r+1).padStart(2,"0"):l===3?this.locales.monthsShort[r]:l===4?this.locales.months[r]:String(r+1)}}return Ee=t,Ee}var Ce,hr;function Vi(){if(hr)return Ce;hr=1;const e=H();class t extends e{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}}return Ce=t,Ce}var _e,ur;function Ui(){if(ur)return _e;ur=1;const e=H();class t extends e{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?r.substr(-2):r}}return _e=t,_e}var qe,ar;function Gi(){return ar||(ar=1,qe={DatePart:H(),Meridiem:Ni(),Day:ki(),Hours:Yi(),Milliseconds:Hi(),Minutes:Bi(),Month:Li(),Seconds:Vi(),Year:Ui()}),qe}var De,cr;function zi(){if(cr)return De;cr=1;function e(S,M,T,R,_,q,N){try{var I=S[q](N),D=I.value}catch(U){T(U);return}I.done?M(D):Promise.resolve(D).then(R,_)}function t(S){return function(){var M=this,T=arguments;return new Promise(function(R,_){var q=S.apply(M,T);function N(D){e(q,R,_,N,I,"next",D)}function I(D){e(q,R,_,N,I,"throw",D)}N(void 0)})}}const n=E(),r=L(),l=k(),p=l.style,i=l.clear,g=l.figures,h=C(),u=h.erase,s=h.cursor,d=Gi(),c=d.DatePart,o=d.Meridiem,a=d.Day,y=d.Hours,v=d.Milliseconds,f=d.Minutes,m=d.Month,b=d.Seconds,w=d.Year,x=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,$={1:({token:S})=>S.replace(/\\(.)/g,"$1"),2:S=>new a(S),3:S=>new m(S),4:S=>new w(S),5:S=>new o(S),6:S=>new y(S),7:S=>new f(S),8:S=>new b(S),9:S=>new v(S)},O={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 P extends r{constructor(M={}){super(M),this.msg=M.message,this.cursor=0,this.typed="",this.locales=Object.assign(O,M.locales),this._date=M.initial||new Date,this.errorMsg=M.error||"Please Enter A Valid Value",this.validator=M.validate||(()=>!0),this.mask=M.mask||"YYYY-MM-DD HH:mm:ss",this.clear=i("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(M){M&&this._date.setTime(M.getTime())}set mask(M){let T;for(this.parts=[];T=x.exec(M);){let _=T.shift(),q=T.findIndex(N=>N!=null);this.parts.push(q in $?$[q]({token:T[q]||_,date:this.date,parts:this.parts,locales:this.locales}):T[q]||_)}let R=this.parts.reduce((_,q)=>(typeof q=="string"&&typeof _[_.length-1]=="string"?_[_.length-1]+=q:_.push(q),_),[]);this.parts.splice(0),this.parts.push(...R),this.reset()}moveCursor(M){this.typed="",this.cursor=M,this.fire()}reset(){this.moveCursor(this.parts.findIndex(M=>M instanceof c)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
15
+ `),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()}_(s,d){if(s===" ")this.value=!this.value;else if(s==="1")this.value=!0;else if(s==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(l(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(g.line+i.to(0)+this.outputText))}}return we=h,we}var ye,Qt;function B(){if(Qt)return ye;Qt=1;class e{constructor({token:n,date:r,parts:l,locales:p}){this.token=n,this.date=r||new Date,this.parts=l||[this],this.locales=p||{}}up(){}down(){}next(){const n=this.parts.indexOf(this);return this.parts.find((r,l)=>l>n&&r instanceof e)}setTo(n){}prev(){let n=[].concat(this.parts).reverse();const r=n.indexOf(this);return n.find((l,p)=>p>r&&l instanceof e)}toString(){return String(this.date)}}return ye=e,ye}var xe,er;function Ri(){if(er)return xe;er=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}}return xe=t,xe}var $e,tr;function Ii(){if(tr)return $e;tr=1;const e=B(),t=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th");class n extends e{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(),p=this.date.getDay();return this.token==="DD"?String(l).padStart(2,"0"):this.token==="Do"?l+t(l):this.token==="d"?p+1:this.token==="ddd"?this.locales.weekdaysShort[p]:this.token==="dddd"?this.locales.weekdays[p]:l}}return $e=n,$e}var Se,rr;function Ai(){if(rr)return Se;rr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}}return Se=t,Se}var Oe,ir;function ji(){if(ir)return Oe;ir=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return Oe=t,Oe}var Me,sr;function Fi(){if(sr)return Me;sr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}}return Me=t,Me}var Pe,nr;function Ni(){if(nr)return Pe;nr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),l=this.token.length;return l===2?String(r+1).padStart(2,"0"):l===3?this.locales.monthsShort[r]:l===4?this.locales.months[r]:String(r+1)}}return Pe=t,Pe}var Te,or;function ki(){if(or)return Te;or=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}}return Te=t,Te}var Ee,lr;function Yi(){if(lr)return Ee;lr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?r.substr(-2):r}}return Ee=t,Ee}var Ce,hr;function Hi(){return hr||(hr=1,Ce={DatePart:B(),Meridiem:Ri(),Day:Ii(),Hours:Ai(),Milliseconds:ji(),Minutes:Fi(),Month:Ni(),Seconds:ki(),Year:Yi()}),Ce}var _e,ur;function Bi(){if(ur)return _e;ur=1;function e(S,M,T,I,q,D,k){try{var A=S[D](k),R=A.value}catch(G){T(G);return}A.done?M(R):Promise.resolve(R).then(I,q)}function t(S){return function(){var M=this,T=arguments;return new Promise(function(I,q){var D=S.apply(M,T);function k(R){e(D,I,q,k,A,"next",R)}function A(R){e(D,I,q,k,A,"throw",R)}k(void 0)})}}const n=C(),r=V(),l=Y(),p=l.style,i=l.clear,g=l.figures,h=_(),u=h.erase,s=h.cursor,d=Hi(),c=d.DatePart,o=d.Meridiem,a=d.Day,y=d.Hours,v=d.Milliseconds,f=d.Minutes,m=d.Month,b=d.Seconds,w=d.Year,x=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,$={1:({token:S})=>S.replace(/\\(.)/g,"$1"),2:S=>new a(S),3:S=>new m(S),4:S=>new w(S),5:S=>new o(S),6:S=>new y(S),7:S=>new f(S),8:S=>new b(S),9:S=>new v(S)},O={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 P extends r{constructor(M={}){super(M),this.msg=M.message,this.cursor=0,this.typed="",this.locales=Object.assign(O,M.locales),this._date=M.initial||new Date,this.errorMsg=M.error||"Please Enter A Valid Value",this.validator=M.validate||(()=>!0),this.mask=M.mask||"YYYY-MM-DD HH:mm:ss",this.clear=i("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(M){M&&this._date.setTime(M.getTime())}set mask(M){let T;for(this.parts=[];T=x.exec(M);){let q=T.shift(),D=T.findIndex(k=>k!=null);this.parts.push(D in $?$[D]({token:T[D]||q,date:this.date,parts:this.parts,locales:this.locales}):T[D]||q)}let I=this.parts.reduce((q,D)=>(typeof D=="string"&&typeof q[q.length-1]=="string"?q[q.length-1]+=D:q.push(D),q),[]);this.parts.splice(0),this.parts.push(...I),this.reset()}moveCursor(M){this.typed="",this.cursor=M,this.fire()}reset(){this.moveCursor(this.parts.findIndex(M=>M instanceof c)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
16
16
  `),this.close()}validate(){var M=this;return t(function*(){let T=yield M.validator(M.value);typeof T=="string"&&(M.errorMsg=T,T=!1),M.error=!T})()}submit(){var M=this;return t(function*(){if(yield M.validate(),M.error){M.color="red",M.fire(),M.render();return}M.done=!0,M.aborted=!1,M.fire(),M.render(),M.out.write(`
17
- `),M.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let M=this.parts[this.cursor].prev();if(M==null)return this.bell();this.moveCursor(this.parts.indexOf(M)),this.render()}right(){let M=this.parts[this.cursor].next();if(M==null)return this.bell();this.moveCursor(this.parts.indexOf(M)),this.render()}next(){let M=this.parts[this.cursor].next();this.moveCursor(M?this.parts.indexOf(M):this.parts.findIndex(T=>T instanceof c)),this.render()}_(M){/\d/.test(M)&&(this.typed+=M,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[p.symbol(this.done,this.aborted),n.bold(this.msg),p.delimiter(!1),this.parts.reduce((M,T,R)=>M.concat(R===this.cursor&&!this.done?n.cyan().underline(T.toString()):T),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
18
- `).reduce((M,T,R)=>M+`
19
- ${R?" ":g.pointerSmall} ${n.red().italic(T)}`,"")),this.out.write(u.line+s.to(0)+this.outputText))}}return De=P,De}var Re,dr;function Wi(){if(dr)return Re;dr=1;function e(v,f,m,b,w,x,$){try{var O=v[x]($),P=O.value}catch(S){m(S);return}O.done?f(P):Promise.resolve(P).then(b,w)}function t(v){return function(){var f=this,m=arguments;return new Promise(function(b,w){var x=v.apply(f,m);function $(P){e(x,b,w,$,O,"next",P)}function O(P){e(x,b,w,$,O,"throw",P)}$(void 0)})}}const n=E(),r=L(),l=C(),p=l.cursor,i=l.erase,g=k(),h=g.style,u=g.figures,s=g.clear,d=g.lines,c=/[0-9]/,o=v=>v!==void 0,a=(v,f)=>{let m=Math.pow(10,f);return Math.round(v*m)/m};class y extends r{constructor(f={}){super(f),this.transform=h.render(f.style),this.msg=f.message,this.initial=o(f.initial)?f.initial:"",this.float=!!f.float,this.round=f.round||2,this.inc=f.increment||1,this.min=o(f.min)?f.min:-1/0,this.max=o(f.max)?f.max:1/0,this.errorMsg=f.error||"Please Enter A Valid Value",this.validator=f.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(f){!f&&f!==0?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${a(f,this.round)}`),this._value=a(f,this.round)),this.fire()}get value(){return this._value}parse(f){return this.float?parseFloat(f):parseInt(f)}valid(f){return f==="-"||f==="."&&this.float||c.test(f)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let f=this.value;this.value=f!==""?f:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
17
+ `),M.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let M=this.parts[this.cursor].prev();if(M==null)return this.bell();this.moveCursor(this.parts.indexOf(M)),this.render()}right(){let M=this.parts[this.cursor].next();if(M==null)return this.bell();this.moveCursor(this.parts.indexOf(M)),this.render()}next(){let M=this.parts[this.cursor].next();this.moveCursor(M?this.parts.indexOf(M):this.parts.findIndex(T=>T instanceof c)),this.render()}_(M){/\d/.test(M)&&(this.typed+=M,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[p.symbol(this.done,this.aborted),n.bold(this.msg),p.delimiter(!1),this.parts.reduce((M,T,I)=>M.concat(I===this.cursor&&!this.done?n.cyan().underline(T.toString()):T),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
18
+ `).reduce((M,T,I)=>M+`
19
+ ${I?" ":g.pointerSmall} ${n.red().italic(T)}`,"")),this.out.write(u.line+s.to(0)+this.outputText))}}return _e=P,_e}var qe,ar;function Li(){if(ar)return qe;ar=1;function e(v,f,m,b,w,x,$){try{var O=v[x]($),P=O.value}catch(S){m(S);return}O.done?f(P):Promise.resolve(P).then(b,w)}function t(v){return function(){var f=this,m=arguments;return new Promise(function(b,w){var x=v.apply(f,m);function $(P){e(x,b,w,$,O,"next",P)}function O(P){e(x,b,w,$,O,"throw",P)}$(void 0)})}}const n=C(),r=V(),l=_(),p=l.cursor,i=l.erase,g=Y(),h=g.style,u=g.figures,s=g.clear,d=g.lines,c=/[0-9]/,o=v=>v!==void 0,a=(v,f)=>{let m=Math.pow(10,f);return Math.round(v*m)/m};class y extends r{constructor(f={}){super(f),this.transform=h.render(f.style),this.msg=f.message,this.initial=o(f.initial)?f.initial:"",this.float=!!f.float,this.round=f.round||2,this.inc=f.increment||1,this.min=o(f.min)?f.min:-1/0,this.max=o(f.max)?f.max:1/0,this.errorMsg=f.error||"Please Enter A Valid Value",this.validator=f.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(f){!f&&f!==0?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${a(f,this.round)}`),this._value=a(f,this.round)),this.fire()}get value(){return this._value}parse(f){return this.float?parseFloat(f):parseInt(f)}valid(f){return f==="-"||f==="."&&this.float||c.test(f)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let f=this.value;this.value=f!==""?f:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
20
20
  `),this.close()}validate(){var f=this;return t(function*(){let m=yield f.validator(f.value);typeof m=="string"&&(f.errorMsg=m,m=!1),f.error=!m})()}submit(){var f=this;return t(function*(){if(yield f.validate(),f.error){f.color="red",f.fire(),f.render();return}let m=f.value;f.value=m!==""?m:f.initial,f.done=!0,f.aborted=!1,f.error=!1,f.fire(),f.render(),f.out.write(`
21
21
  `),f.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 f=this.value.toString();if(f.length===0)return this.bell();this.value=this.parse(f=f.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()}_(f,m){if(!this.valid(f))return this.bell();const b=Date.now();if(b-this.lastHit>1e3&&(this.typed=""),this.typed+=f,this.lastHit=b,this.color="cyan",f===".")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(p.down(d(this.outputError,this.out.columns)-1)+s(this.outputError,this.out.columns)),this.out.write(s(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[h.symbol(this.done,this.aborted),n.bold(this.msg),h.delimiter(this.done),!this.done||!this.done&&!this.placeholder?n[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
22
22
  `).reduce((f,m,b)=>f+`
23
- ${b?" ":u.pointerSmall} ${n.red().italic(m)}`,"")),this.out.write(i.line+p.to(0)+this.outputText+p.save+this.outputError+p.restore))}}return Re=y,Re}var Ie,fr;function pr(){if(fr)return Ie;fr=1;const e=E(),t=C(),n=t.cursor,r=L(),l=k(),p=l.clear,i=l.figures,g=l.style,h=l.wrap,u=l.entriesToDisplay;class s extends r{constructor(c={}){super(c),this.msg=c.message,this.cursor=c.cursor||0,this.scrollIndex=c.cursor||0,this.hint=c.hint||"",this.warn=c.warn||"- This option is disabled -",this.minSelected=c.min,this.showMinError=!1,this.maxChoices=c.max,this.instructions=c.instructions,this.optionsPerPage=c.optionsPerPage||10,this.value=c.choices.map((o,a)=>(typeof o=="string"&&(o={title:o,value:a}),{title:o&&(o.title||o.value||o),description:o&&o.description,value:o&&(o.value===void 0?a:o.value),selected:o&&o.selected,disabled:o&&o.disabled})),this.clear=p("",this.out.columns),c.overrideRender||this.render()}reset(){this.value.map(c=>!c.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(c=>c.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
23
+ ${b?" ":u.pointerSmall} ${n.red().italic(m)}`,"")),this.out.write(i.line+p.to(0)+this.outputText+p.save+this.outputError+p.restore))}}return qe=y,qe}var De,cr;function dr(){if(cr)return De;cr=1;const e=C(),t=_(),n=t.cursor,r=V(),l=Y(),p=l.clear,i=l.figures,g=l.style,h=l.wrap,u=l.entriesToDisplay;class s extends r{constructor(c={}){super(c),this.msg=c.message,this.cursor=c.cursor||0,this.scrollIndex=c.cursor||0,this.hint=c.hint||"",this.warn=c.warn||"- This option is disabled -",this.minSelected=c.min,this.showMinError=!1,this.maxChoices=c.max,this.instructions=c.instructions,this.optionsPerPage=c.optionsPerPage||10,this.value=c.choices.map((o,a)=>(typeof o=="string"&&(o={title:o,value:a}),{title:o&&(o.title||o.value||o),description:o&&o.description,value:o&&(o.value===void 0?a:o.value),selected:o&&o.selected,disabled:o&&o.disabled})),this.clear=p("",this.out.columns),c.overrideRender||this.render()}reset(){this.value.map(c=>!c.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(c=>c.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
24
24
  `),this.close()}submit(){const c=this.value.filter(o=>o.selected);this.minSelected&&c.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
25
25
  `),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(c=>c.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const c=this.value[this.cursor];if(c.selected)c.selected=!1,this.render();else{if(c.disabled||this.value.filter(o=>o.selected).length>=this.maxChoices)return this.bell();c.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const c=!this.value[this.cursor].selected;this.value.filter(o=>!o.disabled).forEach(o=>o.selected=c),this.render()}_(c,o){if(c===" ")this.handleSpaceToggle();else if(c==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
26
26
  Instructions:
@@ -30,13 +30,13 @@ Instructions:
30
30
  `:"")+" enter/return: Complete answer":""}renderOption(c,o,a,y){const v=(o.selected?e.green(i.radioOn):i.radioOff)+" "+y+" ";let f,m;return o.disabled?f=c===a?e.gray().underline(o.title):e.strikethrough().gray(o.title):(f=c===a?e.cyan().underline(o.title):o.title,c===a&&o.description&&(m=` - ${o.description}`,(v.length+f.length+m.length>=this.out.columns||o.description.split(/\r?\n/).length>1)&&(m=`
31
31
  `+h(o.description,{margin:v.length,width:this.out.columns})))),v+f+e.gray(m||"")}paginateOptions(c){if(c.length===0)return e.red("No matches for this query.");let o=u(this.cursor,c.length,this.optionsPerPage),a=o.startIndex,y=o.endIndex,v,f=[];for(let m=a;m<y;m++)m===a&&a>0?v=i.arrowUp:m===y-1&&y<c.length?v=i.arrowDown:v=" ",f.push(this.renderOption(this.cursor,c[m],m,v));return`
32
32
  `+f.join(`
33
- `)}renderOptions(c){return this.done?"":this.paginateOptions(c)}renderDoneOrInstructions(){if(this.done)return this.value.filter(o=>o.selected).map(o=>o.title).join(", ");const c=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&c.push(e.yellow(this.warn)),c.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(n.hide),super.render();let c=[g.symbol(this.done,this.aborted),e.bold(this.msg),g.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(c+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),c+=this.renderOptions(this.value),this.out.write(this.clear+c),this.clear=p(c,this.out.columns)}}return Ie=s,Ie}var Ae,mr;function Ji(){if(mr)return Ae;mr=1;function e(f,m,b,w,x,$,O){try{var P=f[$](O),S=P.value}catch(M){b(M);return}P.done?m(S):Promise.resolve(S).then(w,x)}function t(f){return function(){var m=this,b=arguments;return new Promise(function(w,x){var $=f.apply(m,b);function O(S){e($,w,x,O,P,"next",S)}function P(S){e($,w,x,O,P,"throw",S)}O(void 0)})}}const n=E(),r=L(),l=C(),p=l.erase,i=l.cursor,g=k(),h=g.style,u=g.clear,s=g.figures,d=g.wrap,c=g.entriesToDisplay,o=(f,m)=>f[m]&&(f[m].value||f[m].title||f[m]),a=(f,m)=>f[m]&&(f[m].title||f[m].value||f[m]),y=(f,m)=>{const b=f.findIndex(w=>w.value===m||w.title===m);return b>-1?b:void 0};class v extends r{constructor(m={}){super(m),this.msg=m.message,this.suggest=m.suggest,this.choices=m.choices,this.initial=typeof m.initial=="number"?m.initial:y(m.choices,m.initial),this.select=this.initial||m.cursor||0,this.i18n={noMatches:m.noMatches||"no matches found"},this.fallback=m.fallback||this.initial,this.clearFirst=m.clearFirst||!1,this.suggestions=[],this.input="",this.limit=m.limit||10,this.cursor=0,this.transform=h.render(m.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=u("",this.out.columns),this.complete(this.render),this.render()}set fallback(m){this._fb=Number.isSafeInteger(parseInt(m))?parseInt(m):m}get fallback(){let m;return typeof this._fb=="number"?m=this.choices[this._fb]:typeof this._fb=="string"&&(m={title:this._fb}),m||this._fb||{title:this.i18n.noMatches}}moveSelect(m){this.select=m,this.suggestions.length>0?this.value=o(this.suggestions,m):this.value=this.fallback.value,this.fire()}complete(m){var b=this;return t(function*(){const w=b.completing=b.suggest(b.input,b.choices),x=yield w;if(b.completing!==w)return;b.suggestions=x.map((O,P,S)=>({title:a(S,P),value:o(S,P),description:O.description})),b.completing=!1;const $=Math.max(x.length-1,0);b.moveSelect(Math.min($,b.select)),m&&m()})()}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(`
33
+ `)}renderOptions(c){return this.done?"":this.paginateOptions(c)}renderDoneOrInstructions(){if(this.done)return this.value.filter(o=>o.selected).map(o=>o.title).join(", ");const c=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&c.push(e.yellow(this.warn)),c.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(n.hide),super.render();let c=[g.symbol(this.done,this.aborted),e.bold(this.msg),g.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(c+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),c+=this.renderOptions(this.value),this.out.write(this.clear+c),this.clear=p(c,this.out.columns)}}return De=s,De}var Re,fr;function Vi(){if(fr)return Re;fr=1;function e(f,m,b,w,x,$,O){try{var P=f[$](O),S=P.value}catch(M){b(M);return}P.done?m(S):Promise.resolve(S).then(w,x)}function t(f){return function(){var m=this,b=arguments;return new Promise(function(w,x){var $=f.apply(m,b);function O(S){e($,w,x,O,P,"next",S)}function P(S){e($,w,x,O,P,"throw",S)}O(void 0)})}}const n=C(),r=V(),l=_(),p=l.erase,i=l.cursor,g=Y(),h=g.style,u=g.clear,s=g.figures,d=g.wrap,c=g.entriesToDisplay,o=(f,m)=>f[m]&&(f[m].value||f[m].title||f[m]),a=(f,m)=>f[m]&&(f[m].title||f[m].value||f[m]),y=(f,m)=>{const b=f.findIndex(w=>w.value===m||w.title===m);return b>-1?b:void 0};class v extends r{constructor(m={}){super(m),this.msg=m.message,this.suggest=m.suggest,this.choices=m.choices,this.initial=typeof m.initial=="number"?m.initial:y(m.choices,m.initial),this.select=this.initial||m.cursor||0,this.i18n={noMatches:m.noMatches||"no matches found"},this.fallback=m.fallback||this.initial,this.clearFirst=m.clearFirst||!1,this.suggestions=[],this.input="",this.limit=m.limit||10,this.cursor=0,this.transform=h.render(m.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=u("",this.out.columns),this.complete(this.render),this.render()}set fallback(m){this._fb=Number.isSafeInteger(parseInt(m))?parseInt(m):m}get fallback(){let m;return typeof this._fb=="number"?m=this.choices[this._fb]:typeof this._fb=="string"&&(m={title:this._fb}),m||this._fb||{title:this.i18n.noMatches}}moveSelect(m){this.select=m,this.suggestions.length>0?this.value=o(this.suggestions,m):this.value=this.fallback.value,this.fire()}complete(m){var b=this;return t(function*(){const w=b.completing=b.suggest(b.input,b.choices),x=yield w;if(b.completing!==w)return;b.suggestions=x.map((O,P,S)=>({title:a(S,P),value:o(S,P),description:O.description})),b.completing=!1;const $=Math.max(x.length-1,0);b.moveSelect(Math.min($,b.select)),m&&m()})()}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(`
34
34
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
35
35
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
36
36
  `),this.close()}_(m,b){let w=this.input.slice(0,this.cursor),x=this.input.slice(this.cursor);this.input=`${w}${m}${x}`,this.cursor=w.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let m=this.input.slice(0,this.cursor-1),b=this.input.slice(this.cursor);this.input=`${m}${b}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let m=this.input.slice(0,this.cursor),b=this.input.slice(this.cursor+1);this.input=`${m}${b}`,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(m,b,w,x){let $,O=w?s.arrowUp:x?s.arrowDown:" ",P=b?n.cyan().underline(m.title):m.title;return O=(b?n.cyan(s.pointer)+" ":" ")+O,m.description&&($=` - ${m.description}`,(O.length+P.length+$.length>=this.out.columns||m.description.split(/\r?\n/).length>1)&&($=`
37
37
  `+d(m.description,{margin:3,width:this.out.columns}))),O+" "+P+n.gray($||"")}render(){if(this.closed)return;this.firstRender?this.out.write(i.hide):this.out.write(u(this.outputText,this.out.columns)),super.render();let m=c(this.select,this.choices.length,this.limit),b=m.startIndex,w=m.endIndex;if(this.outputText=[h.symbol(this.done,this.aborted,this.exited),n.bold(this.msg),h.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 x=this.suggestions.slice(b,w).map(($,O)=>this.renderOption($,this.select===O+b,O===0&&b>0,O+b===w-1&&w<this.choices.length)).join(`
38
38
  `);this.outputText+=`
39
- `+(x||n.gray(this.fallback.title))}this.out.write(p.line+i.to(0)+this.outputText)}}return Ae=v,Ae}var je,gr;function Ki(){if(gr)return je;gr=1;const e=E(),t=C(),n=t.cursor,r=pr(),l=k(),p=l.clear,i=l.style,g=l.figures;class h extends r{constructor(s={}){s.overrideRender=!0,super(s),this.inputValue="",this.clear=p("",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(s=>s.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 s=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(c=>this.inputValue?!!(typeof c.title=="string"&&c.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof c.value=="string"&&c.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const d=this.filteredOptions.findIndex(c=>c===s);this.cursor=d<0?0:d,this.render()}handleSpaceToggle(){const s=this.filteredOptions[this.cursor];if(s.selected)s.selected=!1,this.render();else{if(s.disabled||this.value.filter(d=>d.selected).length>=this.maxChoices)return this.bell();s.selected=!0,this.render()}}handleInputChange(s){this.inputValue=this.inputValue+s,this.updateFilteredOptions()}_(s,d){s===" "?this.handleSpaceToggle():this.handleInputChange(s)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
39
+ `+(x||n.gray(this.fallback.title))}this.out.write(p.line+i.to(0)+this.outputText)}}return Re=v,Re}var Ie,pr;function Ui(){if(pr)return Ie;pr=1;const e=C(),t=_(),n=t.cursor,r=dr(),l=Y(),p=l.clear,i=l.style,g=l.figures;class h extends r{constructor(s={}){s.overrideRender=!0,super(s),this.inputValue="",this.clear=p("",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(s=>s.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 s=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(c=>this.inputValue?!!(typeof c.title=="string"&&c.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof c.value=="string"&&c.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const d=this.filteredOptions.findIndex(c=>c===s);this.cursor=d<0?0:d,this.render()}handleSpaceToggle(){const s=this.filteredOptions[this.cursor];if(s.selected)s.selected=!1,this.render();else{if(s.disabled||this.value.filter(d=>d.selected).length>=this.maxChoices)return this.bell();s.selected=!0,this.render()}}handleInputChange(s){this.inputValue=this.inputValue+s,this.updateFilteredOptions()}_(s,d){s===" "?this.handleSpaceToggle():this.handleInputChange(s)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
40
40
  Instructions:
41
41
  ${g.arrowUp}/${g.arrowDown}: Highlight option
42
42
  ${g.arrowLeft}/${g.arrowRight}/[space]: Toggle selection
@@ -44,31 +44,31 @@ Instructions:
44
44
  enter/return: Complete answer
45
45
  `:""}renderCurrentInput(){return`
46
46
  Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
47
- `}renderOption(s,d,c){let o;return d.disabled?o=s===c?e.gray().underline(d.title):e.strikethrough().gray(d.title):o=s===c?e.cyan().underline(d.title):d.title,(d.selected?e.green(g.radioOn):g.radioOff)+" "+o}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const s=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&s.push(e.yellow(this.warn)),s.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(n.hide),super.render();let s=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(s+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),s+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+s),this.clear=p(s,this.out.columns)}}return je=h,je}var Fe,vr;function Zi(){if(vr)return Fe;vr=1;const e=E(),t=L(),n=k(),r=n.style,l=n.clear,p=C(),i=p.erase,g=p.cursor;class h extends t{constructor(s={}){super(s),this.msg=s.message,this.value=s.initial,this.initialValue=!!s.initial,this.yesMsg=s.yes||"yes",this.yesOption=s.yesOption||"(Y/n)",this.noMsg=s.no||"no",this.noOption=s.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(`
47
+ `}renderOption(s,d,c){let o;return d.disabled?o=s===c?e.gray().underline(d.title):e.strikethrough().gray(d.title):o=s===c?e.cyan().underline(d.title):d.title,(d.selected?e.green(g.radioOn):g.radioOff)+" "+o}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const s=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&s.push(e.yellow(this.warn)),s.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(n.hide),super.render();let s=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(s+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),s+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+s),this.clear=p(s,this.out.columns)}}return Ie=h,Ie}var Ae,mr;function Gi(){if(mr)return Ae;mr=1;const e=C(),t=V(),n=Y(),r=n.style,l=n.clear,p=_(),i=p.erase,g=p.cursor;class h extends t{constructor(s={}){super(s),this.msg=s.message,this.value=s.initial,this.initialValue=!!s.initial,this.yesMsg=s.yes||"yes",this.yesOption=s.yesOption||"(Y/n)",this.noMsg=s.no||"no",this.noOption=s.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(`
48
48
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
49
- `),this.close()}_(s,d){return s.toLowerCase()==="y"?(this.value=!0,this.submit()):s.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(g.hide):this.out.write(l(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(i.line+g.to(0)+this.outputText))}}return Fe=h,Fe}var Ne,br;function Xi(){return br||(br=1,Ne={TextPrompt:Ai(),SelectPrompt:ji(),TogglePrompt:Fi(),DatePrompt:zi(),NumberPrompt:Wi(),MultiselectPrompt:pr(),AutocompletePrompt:Ji(),AutocompleteMultiselectPrompt:Ki(),ConfirmPrompt:Zi()}),Ne}var wr;function Qi(){return wr||(wr=1,function(e){const t=e,n=Xi(),r=i=>i;function l(i,g,h={}){return new Promise((u,s)=>{const d=new n[i](g),c=h.onAbort||r,o=h.onSubmit||r,a=h.onExit||r;d.on("state",g.onState||r),d.on("submit",y=>u(o(y))),d.on("exit",y=>u(a(y))),d.on("abort",y=>s(c(y)))})}t.text=i=>l("TextPrompt",i),t.password=i=>(i.style="password",t.text(i)),t.invisible=i=>(i.style="invisible",t.text(i)),t.number=i=>l("NumberPrompt",i),t.date=i=>l("DatePrompt",i),t.confirm=i=>l("ConfirmPrompt",i),t.list=i=>{const g=i.separator||",";return l("TextPrompt",i,{onSubmit:h=>h.split(g).map(u=>u.trim())})},t.toggle=i=>l("TogglePrompt",i),t.select=i=>l("SelectPrompt",i),t.multiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("MultiselectPrompt",i,{onAbort:g,onSubmit:g})},t.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("AutocompleteMultiselectPrompt",i,{onAbort:g,onSubmit:g})};const p=(i,g)=>Promise.resolve(g.filter(h=>h.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));t.autocomplete=i=>(i.suggest=i.suggest||p,i.choices=[].concat(i.choices||[]),l("AutocompletePrompt",i))}(ne)),ne}var ke,yr;function es(){if(yr)return ke;yr=1;function e(v,f){var m=Object.keys(v);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(v);f&&(b=b.filter(function(w){return Object.getOwnPropertyDescriptor(v,w).enumerable})),m.push.apply(m,b)}return m}function t(v){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?e(Object(m),!0).forEach(function(b){n(v,b,m[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(m)):e(Object(m)).forEach(function(b){Object.defineProperty(v,b,Object.getOwnPropertyDescriptor(m,b))})}return v}function n(v,f,m){return f in v?Object.defineProperty(v,f,{value:m,enumerable:!0,configurable:!0,writable:!0}):v[f]=m,v}function r(v,f){var m=typeof Symbol<"u"&&v[Symbol.iterator]||v["@@iterator"];if(!m){if(Array.isArray(v)||(m=l(v))||f&&v&&typeof v.length=="number"){m&&(v=m);var b=0,w=function(){};return{s:w,n:function(){return b>=v.length?{done:!0}:{done:!1,value:v[b++]}},e:function(S){throw S},f:w}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
50
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var x=!0,$=!1,O;return{s:function(){m=m.call(v)},n:function(){var S=m.next();return x=S.done,S},e:function(S){$=!0,O=S},f:function(){try{!x&&m.return!=null&&m.return()}finally{if($)throw O}}}}function l(v,f){if(v){if(typeof v=="string")return p(v,f);var m=Object.prototype.toString.call(v).slice(8,-1);if(m==="Object"&&v.constructor&&(m=v.constructor.name),m==="Map"||m==="Set")return Array.from(v);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return p(v,f)}}function p(v,f){(f==null||f>v.length)&&(f=v.length);for(var m=0,b=new Array(f);m<f;m++)b[m]=v[m];return b}function i(v,f,m,b,w,x,$){try{var O=v[x]($),P=O.value}catch(S){m(S);return}O.done?f(P):Promise.resolve(P).then(b,w)}function g(v){return function(){var f=this,m=arguments;return new Promise(function(b,w){var x=v.apply(f,m);function $(P){i(x,b,w,$,O,"next",P)}function O(P){i(x,b,w,$,O,"throw",P)}$(void 0)})}}const h=Qi(),u=["suggest","format","onState","validate","onRender","type"],s=()=>{};function d(){return c.apply(this,arguments)}function c(){return c=g(function*(v=[],{onSubmit:f=s,onCancel:m=s}={}){const b={},w=d._override||{};v=[].concat(v);let x,$,O,P,S,M;const T=function(){var I=g(function*(D,U,Dt=!1){if(!(!Dt&&D.validate&&D.validate(U)!==!0))return D.format?yield D.format(U,b):U});return function(U,Dt){return I.apply(this,arguments)}}();var R=r(v),_;try{for(R.s();!(_=R.n()).done;){$=_.value;var q=$;if(P=q.name,S=q.type,typeof S=="function"&&(S=yield S(x,t({},b),$),$.type=S),!!S){for(let I in $){if(u.includes(I))continue;let D=$[I];$[I]=typeof D=="function"?yield D(x,t({},b),M):D}if(M=$,typeof $.message!="string")throw new Error("prompt message is required");var N=$;if(P=N.name,S=N.type,h[S]===void 0)throw new Error(`prompt type (${S}) is not defined`);if(w[$.name]!==void 0&&(x=yield T($,w[$.name]),x!==void 0)){b[P]=x;continue}try{x=d._injected?o(d._injected,$.initial):yield h[S]($),b[P]=x=yield T($,x,!0),O=yield f($,x,b)}catch{O=!(yield m($,b))}if(O)return b}}}catch(I){R.e(I)}finally{R.f()}return b}),c.apply(this,arguments)}function o(v,f){const m=v.shift();if(m instanceof Error)throw m;return m===void 0?f:m}function a(v){d._injected=(d._injected||[]).concat(v)}function y(v){d._override=Object.assign({},v)}return ke=Object.assign(d,{prompt:d,prompts:h,inject:a,override:y}),ke}var Ye={},He,xr;function ts(){return xr||(xr=1,He=(e,t)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(t){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),He}var Be,$r;function Le(){return $r||($r=1,Be=e=>{const t=["[\\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("|"),n=new RegExp(t,"g");return typeof e=="string"?e.replace(n,""):e}),Be}var Ve,Sr;function rs(){if(Sr)return Ve;Sr=1;const e=Le(),{erase:t,cursor:n}=C(),r=l=>[...e(l)].length;return Ve=function(l,p){if(!p)return t.line+n.to(0);let i=0;const g=l.split(/\r?\n/);for(let h of g)i+=1+Math.floor(Math.max(r(h)-1,0)/p);return t.lines(i)},Ve}var Ue,Or;function Mr(){if(Or)return Ue;Or=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},t={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return Ue=process.platform==="win32"?t:e,Ue}var Ge,Pr;function is(){if(Pr)return Ge;Pr=1;const e=E(),t=Mr(),n=Object.freeze({password:{scale:1,render:h=>"*".repeat(h.length)},emoji:{scale:2,render:h=>"\u{1F603}".repeat(h.length)},invisible:{scale:0,render:h=>""},default:{scale:1,render:h=>`${h}`}}),r=h=>n[h]||n.default,l=Object.freeze({aborted:e.red(t.cross),done:e.green(t.tick),exited:e.yellow(t.cross),default:e.cyan("?")});return Ge={styles:n,render:r,symbols:l,symbol:(h,u,s)=>u?l.aborted:s?l.exited:h?l.done:l.default,delimiter:h=>e.gray(h?t.ellipsis:t.pointerSmall),item:(h,u)=>e.gray(h?u?t.pointerSmall:"+":t.line)},Ge}var ze,Tr;function ss(){if(Tr)return ze;Tr=1;const e=Le();return ze=function(t,n){let r=String(e(t)||"").split(/\r?\n/);return n?r.map(l=>Math.ceil(l.length/n)).reduce((l,p)=>l+p):r.length},ze}var We,Er;function ns(){return Er||(Er=1,We=(e,t={})=>{const n=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(e||"").split(/\r?\n/g).map(l=>l.split(/\s+/g).reduce((p,i)=>(i.length+n.length>=r||p[p.length-1].length+i.length+1<r?p[p.length-1]+=` ${i}`:p.push(`${n}${i}`),p),[n]).join(`
49
+ `),this.close()}_(s,d){return s.toLowerCase()==="y"?(this.value=!0,this.submit()):s.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(g.hide):this.out.write(l(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(i.line+g.to(0)+this.outputText))}}return Ae=h,Ae}var je,gr;function zi(){return gr||(gr=1,je={TextPrompt:_i(),SelectPrompt:qi(),TogglePrompt:Di(),DatePrompt:Bi(),NumberPrompt:Li(),MultiselectPrompt:dr(),AutocompletePrompt:Vi(),AutocompleteMultiselectPrompt:Ui(),ConfirmPrompt:Gi()}),je}var vr;function Wi(){return vr||(vr=1,function(e){const t=e,n=zi(),r=i=>i;function l(i,g,h={}){return new Promise((u,s)=>{const d=new n[i](g),c=h.onAbort||r,o=h.onSubmit||r,a=h.onExit||r;d.on("state",g.onState||r),d.on("submit",y=>u(o(y))),d.on("exit",y=>u(a(y))),d.on("abort",y=>s(c(y)))})}t.text=i=>l("TextPrompt",i),t.password=i=>(i.style="password",t.text(i)),t.invisible=i=>(i.style="invisible",t.text(i)),t.number=i=>l("NumberPrompt",i),t.date=i=>l("DatePrompt",i),t.confirm=i=>l("ConfirmPrompt",i),t.list=i=>{const g=i.separator||",";return l("TextPrompt",i,{onSubmit:h=>h.split(g).map(u=>u.trim())})},t.toggle=i=>l("TogglePrompt",i),t.select=i=>l("SelectPrompt",i),t.multiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("MultiselectPrompt",i,{onAbort:g,onSubmit:g})},t.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("AutocompleteMultiselectPrompt",i,{onAbort:g,onSubmit:g})};const p=(i,g)=>Promise.resolve(g.filter(h=>h.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));t.autocomplete=i=>(i.suggest=i.suggest||p,i.choices=[].concat(i.choices||[]),l("AutocompletePrompt",i))}(ie)),ie}var Fe,br;function Ji(){if(br)return Fe;br=1;function e(v,f){var m=Object.keys(v);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(v);f&&(b=b.filter(function(w){return Object.getOwnPropertyDescriptor(v,w).enumerable})),m.push.apply(m,b)}return m}function t(v){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?e(Object(m),!0).forEach(function(b){n(v,b,m[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(m)):e(Object(m)).forEach(function(b){Object.defineProperty(v,b,Object.getOwnPropertyDescriptor(m,b))})}return v}function n(v,f,m){return f in v?Object.defineProperty(v,f,{value:m,enumerable:!0,configurable:!0,writable:!0}):v[f]=m,v}function r(v,f){var m=typeof Symbol<"u"&&v[Symbol.iterator]||v["@@iterator"];if(!m){if(Array.isArray(v)||(m=l(v))||f&&v&&typeof v.length=="number"){m&&(v=m);var b=0,w=function(){};return{s:w,n:function(){return b>=v.length?{done:!0}:{done:!1,value:v[b++]}},e:function(S){throw S},f:w}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var x=!0,$=!1,O;return{s:function(){m=m.call(v)},n:function(){var S=m.next();return x=S.done,S},e:function(S){$=!0,O=S},f:function(){try{!x&&m.return!=null&&m.return()}finally{if($)throw O}}}}function l(v,f){if(v){if(typeof v=="string")return p(v,f);var m=Object.prototype.toString.call(v).slice(8,-1);if(m==="Object"&&v.constructor&&(m=v.constructor.name),m==="Map"||m==="Set")return Array.from(v);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return p(v,f)}}function p(v,f){(f==null||f>v.length)&&(f=v.length);for(var m=0,b=new Array(f);m<f;m++)b[m]=v[m];return b}function i(v,f,m,b,w,x,$){try{var O=v[x]($),P=O.value}catch(S){m(S);return}O.done?f(P):Promise.resolve(P).then(b,w)}function g(v){return function(){var f=this,m=arguments;return new Promise(function(b,w){var x=v.apply(f,m);function $(P){i(x,b,w,$,O,"next",P)}function O(P){i(x,b,w,$,O,"throw",P)}$(void 0)})}}const h=Wi(),u=["suggest","format","onState","validate","onRender","type"],s=()=>{};function d(){return c.apply(this,arguments)}function c(){return c=g(function*(v=[],{onSubmit:f=s,onCancel:m=s}={}){const b={},w=d._override||{};v=[].concat(v);let x,$,O,P,S,M;const T=function(){var A=g(function*(R,G,_t=!1){if(!(!_t&&R.validate&&R.validate(G)!==!0))return R.format?yield R.format(G,b):G});return function(G,_t){return A.apply(this,arguments)}}();var I=r(v),q;try{for(I.s();!(q=I.n()).done;){$=q.value;var D=$;if(P=D.name,S=D.type,typeof S=="function"&&(S=yield S(x,t({},b),$),$.type=S),!!S){for(let A in $){if(u.includes(A))continue;let R=$[A];$[A]=typeof R=="function"?yield R(x,t({},b),M):R}if(M=$,typeof $.message!="string")throw new Error("prompt message is required");var k=$;if(P=k.name,S=k.type,h[S]===void 0)throw new Error(`prompt type (${S}) is not defined`);if(w[$.name]!==void 0&&(x=yield T($,w[$.name]),x!==void 0)){b[P]=x;continue}try{x=d._injected?o(d._injected,$.initial):yield h[S]($),b[P]=x=yield T($,x,!0),O=yield f($,x,b)}catch{O=!(yield m($,b))}if(O)return b}}}catch(A){I.e(A)}finally{I.f()}return b}),c.apply(this,arguments)}function o(v,f){const m=v.shift();if(m instanceof Error)throw m;return m===void 0?f:m}function a(v){d._injected=(d._injected||[]).concat(v)}function y(v){d._override=Object.assign({},v)}return Fe=Object.assign(d,{prompt:d,prompts:h,inject:a,override:y}),Fe}var Ne={},ke,wr;function Ki(){return wr||(wr=1,ke=(e,t)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(t){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),ke}var Ye,yr;function He(){return yr||(yr=1,Ye=e=>{const t=["[\\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("|"),n=new RegExp(t,"g");return typeof e=="string"?e.replace(n,""):e}),Ye}var Be,xr;function Zi(){if(xr)return Be;xr=1;const e=He(),{erase:t,cursor:n}=_(),r=l=>[...e(l)].length;return Be=function(l,p){if(!p)return t.line+n.to(0);let i=0;const g=l.split(/\r?\n/);for(let h of g)i+=1+Math.floor(Math.max(r(h)-1,0)/p);return t.lines(i)},Be}var Le,$r;function Sr(){if($r)return Le;$r=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},t={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return Le=process.platform==="win32"?t:e,Le}var Ve,Or;function Xi(){if(Or)return Ve;Or=1;const e=C(),t=Sr(),n=Object.freeze({password:{scale:1,render:h=>"*".repeat(h.length)},emoji:{scale:2,render:h=>"\u{1F603}".repeat(h.length)},invisible:{scale:0,render:h=>""},default:{scale:1,render:h=>`${h}`}}),r=h=>n[h]||n.default,l=Object.freeze({aborted:e.red(t.cross),done:e.green(t.tick),exited:e.yellow(t.cross),default:e.cyan("?")});return Ve={styles:n,render:r,symbols:l,symbol:(h,u,s)=>u?l.aborted:s?l.exited:h?l.done:l.default,delimiter:h=>e.gray(h?t.ellipsis:t.pointerSmall),item:(h,u)=>e.gray(h?u?t.pointerSmall:"+":t.line)},Ve}var Ue,Mr;function Qi(){if(Mr)return Ue;Mr=1;const e=He();return Ue=function(t,n){let r=String(e(t)||"").split(/\r?\n/);return n?r.map(l=>Math.ceil(l.length/n)).reduce((l,p)=>l+p):r.length},Ue}var Ge,Pr;function es(){return Pr||(Pr=1,Ge=(e,t={})=>{const n=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(e||"").split(/\r?\n/g).map(l=>l.split(/\s+/g).reduce((p,i)=>(i.length+n.length>=r||p[p.length-1].length+i.length+1<r?p[p.length-1]+=` ${i}`:p.push(`${n}${i}`),p),[n]).join(`
51
51
  `)).join(`
52
- `)}),We}var Je,Cr;function os(){return Cr||(Cr=1,Je=(e,t,n)=>{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let l=Math.min(r+n,t);return{startIndex:r,endIndex:l}}),Je}var Ke,_r;function Y(){return _r||(_r=1,Ke={action:ts(),clear:rs(),style:is(),strip:Le(),figures:Mr(),lines:ss(),wrap:ns(),entriesToDisplay:os()}),Ke}var Ze,qr;function V(){if(qr)return Ze;qr=1;const e=Rt,{action:t}=Y(),n=It,{beep:r,cursor:l}=C(),p=E();class i extends n{constructor(h={}){super(),this.firstRender=!0,this.in=h.stdin||process.stdin,this.out=h.stdout||process.stdout,this.onRender=(h.onRender||(()=>{})).bind(this);const u=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,u),this.in.isTTY&&this.in.setRawMode(!0);const s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,d=(c,o)=>{let a=t(o,s);a===!1?this._&&this._(c,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(l.show),this.in.removeListener("keypress",d),this.in.isTTY&&this.in.setRawMode(!1),u.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",d)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(r)}render(){this.onRender(p),this.firstRender&&(this.firstRender=!1)}}return Ze=i,Ze}var Xe,Dr;function ls(){if(Dr)return Xe;Dr=1;const e=E(),t=V(),{erase:n,cursor:r}=C(),{style:l,clear:p,lines:i,figures:g}=Y();class h extends t{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=p("",this.out.columns),this.render()}set value(s){!s&&this.initial?(this.placeholder=!0,this.rendered=e.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(`
52
+ `)}),Ge}var ze,Tr;function ts(){return Tr||(Tr=1,ze=(e,t,n)=>{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));r<0&&(r=0);let l=Math.min(r+n,t);return{startIndex:r,endIndex:l}}),ze}var We,Er;function H(){return Er||(Er=1,We={action:Ki(),clear:Zi(),style:Xi(),strip:He(),figures:Sr(),lines:Qi(),wrap:es(),entriesToDisplay:ts()}),We}var Je,Cr;function U(){if(Cr)return Je;Cr=1;const e=qt,{action:t}=H(),n=Dt,{beep:r,cursor:l}=_(),p=C();class i extends n{constructor(h={}){super(),this.firstRender=!0,this.in=h.stdin||process.stdin,this.out=h.stdout||process.stdout,this.onRender=(h.onRender||(()=>{})).bind(this);const u=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,u),this.in.isTTY&&this.in.setRawMode(!0);const s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,d=(c,o)=>{let a=t(o,s);a===!1?this._&&this._(c,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(l.show),this.in.removeListener("keypress",d),this.in.isTTY&&this.in.setRawMode(!1),u.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",d)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(r)}render(){this.onRender(p),this.firstRender&&(this.firstRender=!1)}}return Je=i,Je}var Ke,_r;function rs(){if(_r)return Ke;_r=1;const e=C(),t=U(),{erase:n,cursor:r}=_(),{style:l,clear:p,lines:i,figures:g}=H();class h extends t{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=p("",this.out.columns),this.render()}set value(s){!s&&this.initial?(this.placeholder=!0,this.rendered=e.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(`
53
53
  `),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(`
54
54
  `),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,d){let c=this.value.slice(0,this.cursor),o=this.value.slice(this.cursor);this.value=`${c}${s}${o}`,this.red=!1,this.cursor=this.placeholder?0:c.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let s=this.value.slice(0,this.cursor-1),d=this.value.slice(this.cursor);this.value=`${s}${d}`,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),d=this.value.slice(this.cursor+1);this.value=`${s}${d}`,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(r.down(i(this.outputError,this.out.columns)-1)+p(this.outputError,this.out.columns)),this.out.write(p(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),e.bold(this.msg),l.delimiter(this.done),this.red?e.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
55
55
  `).reduce((s,d,c)=>s+`
56
- ${c?" ":g.pointerSmall} ${e.red().italic(d)}`,"")),this.out.write(n.line+r.to(0)+this.outputText+r.save+this.outputError+r.restore+r.move(this.cursorOffset,0)))}}return Xe=h,Xe}var Qe,Rr;function hs(){if(Rr)return Qe;Rr=1;const e=E(),t=V(),{style:n,clear:r,figures:l,wrap:p,entriesToDisplay:i}=Y(),{cursor:g}=C();class h extends t{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((d,c)=>(typeof d=="string"&&(d={title:d,value:c}),{title:d&&(d.title||d.value||d),value:d&&(d.value===void 0?c:d.value),description:d&&d.description,selected:d&&d.selected,disabled:d&&d.disabled})),this.optionsPerPage=s.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=r("",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(`
56
+ ${c?" ":g.pointerSmall} ${e.red().italic(d)}`,"")),this.out.write(n.line+r.to(0)+this.outputText+r.save+this.outputError+r.restore+r.move(this.cursorOffset,0)))}}return Ke=h,Ke}var Ze,qr;function is(){if(qr)return Ze;qr=1;const e=C(),t=U(),{style:n,clear:r,figures:l,wrap:p,entriesToDisplay:i}=H(),{cursor:g}=_();class h extends t{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((d,c)=>(typeof d=="string"&&(d={title:d,value:c}),{title:d&&(d.title||d.value||d),value:d&&(d.value===void 0?c:d.value),description:d&&d.description,selected:d&&d.selected,disabled:d&&d.disabled})),this.optionsPerPage=s.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=r("",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(`
57
57
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
58
58
  `),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,d){if(s===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(g.hide):this.out.write(r(this.outputText,this.out.columns)),super.render();let{startIndex:s,endIndex:d}=i(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
59
59
  `;for(let c=s;c<d;c++){let o,a,y="",v=this.choices[c];c===s&&s>0?a=l.arrowUp:c===d-1&&d<this.choices.length?a=l.arrowDown:a=" ",v.disabled?(o=this.cursor===c?e.gray().underline(v.title):e.strikethrough().gray(v.title),a=(this.cursor===c?e.bold().gray(l.pointer)+" ":" ")+a):(o=this.cursor===c?e.cyan().underline(v.title):v.title,a=(this.cursor===c?e.cyan(l.pointer)+" ":" ")+a,v.description&&this.cursor===c&&(y=` - ${v.description}`,(a.length+o.length+y.length>=this.out.columns||v.description.split(/\r?\n/).length>1)&&(y=`
60
60
  `+p(v.description,{margin:3,width:this.out.columns})))),this.outputText+=`${a} ${o}${e.gray(y)}
61
- `}}this.out.write(this.outputText)}}return Qe=h,Qe}var et,Ir;function us(){if(Ir)return et;Ir=1;const e=E(),t=V(),{style:n,clear:r}=Y(),{cursor:l,erase:p}=C();class i extends t{constructor(h={}){super(h),this.msg=h.message,this.value=!!h.initial,this.active=h.active||"on",this.inactive=h.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(`
61
+ `}}this.out.write(this.outputText)}}return Ze=h,Ze}var Xe,Dr;function ss(){if(Dr)return Xe;Dr=1;const e=C(),t=U(),{style:n,clear:r}=H(),{cursor:l,erase:p}=_();class i extends t{constructor(h={}){super(h),this.msg=h.message,this.value=!!h.initial,this.active=h.active||"on",this.inactive=h.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(`
62
62
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
63
- `),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()}_(h,u){if(h===" ")this.value=!this.value;else if(h==="1")this.value=!0;else if(h==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(p.line+l.to(0)+this.outputText))}}return et=i,et}var tt,Ar;function B(){if(Ar)return tt;Ar=1;class e{constructor({token:n,date:r,parts:l,locales:p}){this.token=n,this.date=r||new Date,this.parts=l||[this],this.locales=p||{}}up(){}down(){}next(){const n=this.parts.indexOf(this);return this.parts.find((r,l)=>l>n&&r instanceof e)}setTo(n){}prev(){let n=[].concat(this.parts).reverse();const r=n.indexOf(this);return n.find((l,p)=>p>r&&l instanceof e)}toString(){return String(this.date)}}return tt=e,tt}var rt,jr;function as(){if(jr)return rt;jr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}}return rt=t,rt}var it,Fr;function cs(){if(Fr)return it;Fr=1;const e=B(),t=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th");class n extends e{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(),p=this.date.getDay();return this.token==="DD"?String(l).padStart(2,"0"):this.token==="Do"?l+t(l):this.token==="d"?p+1:this.token==="ddd"?this.locales.weekdaysShort[p]:this.token==="dddd"?this.locales.weekdays[p]:l}}return it=n,it}var st,Nr;function ds(){if(Nr)return st;Nr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}}return st=t,st}var nt,kr;function fs(){if(kr)return nt;kr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return nt=t,nt}var ot,Yr;function ps(){if(Yr)return ot;Yr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}}return ot=t,ot}var lt,Hr;function ms(){if(Hr)return lt;Hr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),l=this.token.length;return l===2?String(r+1).padStart(2,"0"):l===3?this.locales.monthsShort[r]:l===4?this.locales.months[r]:String(r+1)}}return lt=t,lt}var ht,Br;function gs(){if(Br)return ht;Br=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}}return ht=t,ht}var ut,Lr;function vs(){if(Lr)return ut;Lr=1;const e=B();class t extends e{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?r.substr(-2):r}}return ut=t,ut}var at,Vr;function bs(){return Vr||(Vr=1,at={DatePart:B(),Meridiem:as(),Day:cs(),Hours:ds(),Milliseconds:fs(),Minutes:ps(),Month:ms(),Seconds:gs(),Year:vs()}),at}var ct,Ur;function ws(){if(Ur)return ct;Ur=1;const e=E(),t=V(),{style:n,clear:r,figures:l}=Y(),{erase:p,cursor:i}=C(),{DatePart:g,Meridiem:h,Day:u,Hours:s,Milliseconds:d,Minutes:c,Month:o,Seconds:a,Year:y}=bs(),v=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,f={1:({token:w})=>w.replace(/\\(.)/g,"$1"),2:w=>new u(w),3:w=>new o(w),4:w=>new y(w),5:w=>new h(w),6:w=>new s(w),7:w=>new c(w),8:w=>new a(w),9:w=>new d(w)},m={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 b extends t{constructor(x={}){super(x),this.msg=x.message,this.cursor=0,this.typed="",this.locales=Object.assign(m,x.locales),this._date=x.initial||new Date,this.errorMsg=x.error||"Please Enter A Valid Value",this.validator=x.validate||(()=>!0),this.mask=x.mask||"YYYY-MM-DD HH:mm:ss",this.clear=r("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(x){x&&this._date.setTime(x.getTime())}set mask(x){let $;for(this.parts=[];$=v.exec(x);){let P=$.shift(),S=$.findIndex(M=>M!=null);this.parts.push(S in f?f[S]({token:$[S]||P,date:this.date,parts:this.parts,locales:this.locales}):$[S]||P)}let O=this.parts.reduce((P,S)=>(typeof S=="string"&&typeof P[P.length-1]=="string"?P[P.length-1]+=S:P.push(S),P),[]);this.parts.splice(0),this.parts.push(...O),this.reset()}moveCursor(x){this.typed="",this.cursor=x,this.fire()}reset(){this.moveCursor(this.parts.findIndex(x=>x instanceof g)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
63
+ `),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()}_(h,u){if(h===" ")this.value=!this.value;else if(h==="1")this.value=!0;else if(h==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(p.line+l.to(0)+this.outputText))}}return Xe=i,Xe}var Qe,Rr;function L(){if(Rr)return Qe;Rr=1;class e{constructor({token:n,date:r,parts:l,locales:p}){this.token=n,this.date=r||new Date,this.parts=l||[this],this.locales=p||{}}up(){}down(){}next(){const n=this.parts.indexOf(this);return this.parts.find((r,l)=>l>n&&r instanceof e)}setTo(n){}prev(){let n=[].concat(this.parts).reverse();const r=n.indexOf(this);return n.find((l,p)=>p>r&&l instanceof e)}toString(){return String(this.date)}}return Qe=e,Qe}var et,Ir;function ns(){if(Ir)return et;Ir=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let r=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?r.toUpperCase():r}}return et=t,et}var tt,Ar;function os(){if(Ar)return tt;Ar=1;const e=L(),t=r=>(r=r%10,r===1?"st":r===2?"nd":r===3?"rd":"th");class n extends e{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(),p=this.date.getDay();return this.token==="DD"?String(l).padStart(2,"0"):this.token==="Do"?l+t(l):this.token==="d"?p+1:this.token==="ddd"?this.locales.weekdaysShort[p]:this.token==="dddd"?this.locales.weekdays[p]:l}}return tt=n,tt}var rt,jr;function ls(){if(jr)return rt;jr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(r){this.date.setHours(parseInt(r.substr(-2)))}toString(){let r=this.date.getHours();return/h/.test(this.token)&&(r=r%12||12),this.token.length>1?String(r).padStart(2,"0"):r}}return rt=t,rt}var it,Fr;function hs(){if(Fr)return it;Fr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(r){this.date.setMilliseconds(parseInt(r.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return it=t,it}var st,Nr;function us(){if(Nr)return st;Nr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(r){this.date.setMinutes(parseInt(r.substr(-2)))}toString(){let r=this.date.getMinutes();return this.token.length>1?String(r).padStart(2,"0"):r}}return st=t,st}var nt,kr;function as(){if(kr)return nt;kr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(r){r=parseInt(r.substr(-2))-1,this.date.setMonth(r<0?0:r)}toString(){let r=this.date.getMonth(),l=this.token.length;return l===2?String(r+1).padStart(2,"0"):l===3?this.locales.monthsShort[r]:l===4?this.locales.months[r]:String(r+1)}}return nt=t,nt}var ot,Yr;function cs(){if(Yr)return ot;Yr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(r){this.date.setSeconds(parseInt(r.substr(-2)))}toString(){let r=this.date.getSeconds();return this.token.length>1?String(r).padStart(2,"0"):r}}return ot=t,ot}var lt,Hr;function ds(){if(Hr)return lt;Hr=1;const e=L();class t extends e{constructor(r={}){super(r)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(r){this.date.setFullYear(r.substr(-4))}toString(){let r=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?r.substr(-2):r}}return lt=t,lt}var ht,Br;function fs(){return Br||(Br=1,ht={DatePart:L(),Meridiem:ns(),Day:os(),Hours:ls(),Milliseconds:hs(),Minutes:us(),Month:as(),Seconds:cs(),Year:ds()}),ht}var ut,Lr;function ps(){if(Lr)return ut;Lr=1;const e=C(),t=U(),{style:n,clear:r,figures:l}=H(),{erase:p,cursor:i}=_(),{DatePart:g,Meridiem:h,Day:u,Hours:s,Milliseconds:d,Minutes:c,Month:o,Seconds:a,Year:y}=fs(),v=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,f={1:({token:w})=>w.replace(/\\(.)/g,"$1"),2:w=>new u(w),3:w=>new o(w),4:w=>new y(w),5:w=>new h(w),6:w=>new s(w),7:w=>new c(w),8:w=>new a(w),9:w=>new d(w)},m={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 b extends t{constructor(x={}){super(x),this.msg=x.message,this.cursor=0,this.typed="",this.locales=Object.assign(m,x.locales),this._date=x.initial||new Date,this.errorMsg=x.error||"Please Enter A Valid Value",this.validator=x.validate||(()=>!0),this.mask=x.mask||"YYYY-MM-DD HH:mm:ss",this.clear=r("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(x){x&&this._date.setTime(x.getTime())}set mask(x){let $;for(this.parts=[];$=v.exec(x);){let P=$.shift(),S=$.findIndex(M=>M!=null);this.parts.push(S in f?f[S]({token:$[S]||P,date:this.date,parts:this.parts,locales:this.locales}):$[S]||P)}let O=this.parts.reduce((P,S)=>(typeof S=="string"&&typeof P[P.length-1]=="string"?P[P.length-1]+=S:P.push(S),P),[]);this.parts.splice(0),this.parts.push(...O),this.reset()}moveCursor(x){this.typed="",this.cursor=x,this.fire()}reset(){this.moveCursor(this.parts.findIndex(x=>x instanceof g)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
64
64
  `),this.close()}async validate(){let x=await this.validator(this.value);typeof x=="string"&&(this.errorMsg=x,x=!1),this.error=!x}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(`
65
65
  `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let x=this.parts[this.cursor].prev();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}right(){let x=this.parts[this.cursor].next();if(x==null)return this.bell();this.moveCursor(this.parts.indexOf(x)),this.render()}next(){let x=this.parts[this.cursor].next();this.moveCursor(x?this.parts.indexOf(x):this.parts.findIndex($=>$ instanceof g)),this.render()}_(x){/\d/.test(x)&&(this.typed+=x,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(!1),this.parts.reduce((x,$,O)=>x.concat(O===this.cursor&&!this.done?e.cyan().underline($.toString()):$),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
66
66
  `).reduce((x,$,O)=>x+`
67
- ${O?" ":l.pointerSmall} ${e.red().italic($)}`,"")),this.out.write(p.line+i.to(0)+this.outputText))}}return ct=b,ct}var dt,Gr;function ys(){if(Gr)return dt;Gr=1;const e=E(),t=V(),{cursor:n,erase:r}=C(),{style:l,figures:p,clear:i,lines:g}=Y(),h=/[0-9]/,u=c=>c!==void 0,s=(c,o)=>{let a=Math.pow(10,o);return Math.round(c*a)/a};class d extends t{constructor(o={}){super(o),this.transform=l.render(o.style),this.msg=o.message,this.initial=u(o.initial)?o.initial:"",this.float=!!o.float,this.round=o.round||2,this.inc=o.increment||1,this.min=u(o.min)?o.min:-1/0,this.max=u(o.max)?o.max:1/0,this.errorMsg=o.error||"Please Enter A Valid Value",this.validator=o.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(o){!o&&o!==0?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${s(o,this.round)}`),this._value=s(o,this.round)),this.fire()}get value(){return this._value}parse(o){return this.float?parseFloat(o):parseInt(o)}valid(o){return o==="-"||o==="."&&this.float||h.test(o)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let o=this.value;this.value=o!==""?o:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
67
+ ${O?" ":l.pointerSmall} ${e.red().italic($)}`,"")),this.out.write(p.line+i.to(0)+this.outputText))}}return ut=b,ut}var at,Vr;function ms(){if(Vr)return at;Vr=1;const e=C(),t=U(),{cursor:n,erase:r}=_(),{style:l,figures:p,clear:i,lines:g}=H(),h=/[0-9]/,u=c=>c!==void 0,s=(c,o)=>{let a=Math.pow(10,o);return Math.round(c*a)/a};class d extends t{constructor(o={}){super(o),this.transform=l.render(o.style),this.msg=o.message,this.initial=u(o.initial)?o.initial:"",this.float=!!o.float,this.round=o.round||2,this.inc=o.increment||1,this.min=u(o.min)?o.min:-1/0,this.max=u(o.max)?o.max:1/0,this.errorMsg=o.error||"Please Enter A Valid Value",this.validator=o.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(o){!o&&o!==0?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${s(o,this.round)}`),this._value=s(o,this.round)),this.fire()}get value(){return this._value}parse(o){return this.float?parseFloat(o):parseInt(o)}valid(o){return o==="-"||o==="."&&this.float||h.test(o)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let o=this.value;this.value=o!==""?o:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
68
68
  `),this.close()}async validate(){let o=await this.validator(this.value);typeof o=="string"&&(this.errorMsg=o,o=!1),this.error=!o}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let o=this.value;this.value=o!==""?o:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
69
69
  `),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 o=this.value.toString();if(o.length===0)return this.bell();this.value=this.parse(o=o.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()}_(o,a){if(!this.valid(o))return this.bell();const y=Date.now();if(y-this.lastHit>1e3&&(this.typed=""),this.typed+=o,this.lastHit=y,this.color="cyan",o===".")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(n.down(g(this.outputError,this.out.columns)-1)+i(this.outputError,this.out.columns)),this.out.write(i(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),e.bold(this.msg),l.delimiter(this.done),!this.done||!this.done&&!this.placeholder?e[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
70
70
  `).reduce((o,a,y)=>o+`
71
- ${y?" ":p.pointerSmall} ${e.red().italic(a)}`,"")),this.out.write(r.line+n.to(0)+this.outputText+n.save+this.outputError+n.restore))}}return dt=d,dt}var ft,zr;function Wr(){if(zr)return ft;zr=1;const e=E(),{cursor:t}=C(),n=V(),{clear:r,figures:l,style:p,wrap:i,entriesToDisplay:g}=Y();class h extends n{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((d,c)=>(typeof d=="string"&&(d={title:d,value:c}),{title:d&&(d.title||d.value||d),description:d&&d.description,value:d&&(d.value===void 0?c:d.value),selected:d&&d.selected,disabled:d&&d.disabled})),this.clear=r("",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(`
71
+ ${y?" ":p.pointerSmall} ${e.red().italic(a)}`,"")),this.out.write(r.line+n.to(0)+this.outputText+n.save+this.outputError+n.restore))}}return at=d,at}var ct,Ur;function Gr(){if(Ur)return ct;Ur=1;const e=C(),{cursor:t}=_(),n=U(),{clear:r,figures:l,style:p,wrap:i,entriesToDisplay:g}=H();class h extends n{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((d,c)=>(typeof d=="string"&&(d={title:d,value:c}),{title:d&&(d.title||d.value||d),description:d&&d.description,value:d&&(d.value===void 0?c:d.value),selected:d&&d.selected,disabled:d&&d.disabled})),this.clear=r("",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(`
72
72
  `),this.close()}submit(){const s=this.value.filter(d=>d.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(`
73
73
  `),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(d=>d.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(d=>!d.disabled).forEach(d=>d.selected=s),this.render()}_(s,d){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:`
74
74
  Instructions:
@@ -78,13 +78,13 @@ Instructions:
78
78
  `:"")+" enter/return: Complete answer":""}renderOption(s,d,c,o){const a=(d.selected?e.green(l.radioOn):l.radioOff)+" "+o+" ";let y,v;return d.disabled?y=s===c?e.gray().underline(d.title):e.strikethrough().gray(d.title):(y=s===c?e.cyan().underline(d.title):d.title,s===c&&d.description&&(v=` - ${d.description}`,(a.length+y.length+v.length>=this.out.columns||d.description.split(/\r?\n/).length>1)&&(v=`
79
79
  `+i(d.description,{margin:a.length,width:this.out.columns})))),a+y+e.gray(v||"")}paginateOptions(s){if(s.length===0)return e.red("No matches for this query.");let{startIndex:d,endIndex:c}=g(this.cursor,s.length,this.optionsPerPage),o,a=[];for(let y=d;y<c;y++)y===d&&d>0?o=l.arrowUp:y===c-1&&c<s.length?o=l.arrowDown:o=" ",a.push(this.renderOption(this.cursor,s[y],y,o));return`
80
80
  `+a.join(`
81
- `)}renderOptions(s){return this.done?"":this.paginateOptions(s)}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const s=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&s.push(e.yellow(this.warn)),s.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let s=[p.symbol(this.done,this.aborted),e.bold(this.msg),p.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(s+=e.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=r(s,this.out.columns)}}return ft=h,ft}var pt,Jr;function xs(){if(Jr)return pt;Jr=1;const e=E(),t=V(),{erase:n,cursor:r}=C(),{style:l,clear:p,figures:i,wrap:g,entriesToDisplay:h}=Y(),u=(o,a)=>o[a]&&(o[a].value||o[a].title||o[a]),s=(o,a)=>o[a]&&(o[a].title||o[a].value||o[a]),d=(o,a)=>{const y=o.findIndex(v=>v.value===a||v.title===a);return y>-1?y:void 0};class c extends t{constructor(a={}){super(a),this.msg=a.message,this.suggest=a.suggest,this.choices=a.choices,this.initial=typeof a.initial=="number"?a.initial:d(a.choices,a.initial),this.select=this.initial||a.cursor||0,this.i18n={noMatches:a.noMatches||"no matches found"},this.fallback=a.fallback||this.initial,this.clearFirst=a.clearFirst||!1,this.suggestions=[],this.input="",this.limit=a.limit||10,this.cursor=0,this.transform=l.render(a.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=p("",this.out.columns),this.complete(this.render),this.render()}set fallback(a){this._fb=Number.isSafeInteger(parseInt(a))?parseInt(a):a}get fallback(){let a;return typeof this._fb=="number"?a=this.choices[this._fb]:typeof this._fb=="string"&&(a={title:this._fb}),a||this._fb||{title:this.i18n.noMatches}}moveSelect(a){this.select=a,this.suggestions.length>0?this.value=u(this.suggestions,a):this.value=this.fallback.value,this.fire()}async complete(a){const y=this.completing=this.suggest(this.input,this.choices),v=await y;if(this.completing!==y)return;this.suggestions=v.map((m,b,w)=>({title:s(w,b),value:u(w,b),description:m.description})),this.completing=!1;const f=Math.max(v.length-1,0);this.moveSelect(Math.min(f,this.select)),a&&a()}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(`
81
+ `)}renderOptions(s){return this.done?"":this.paginateOptions(s)}renderDoneOrInstructions(){if(this.done)return this.value.filter(d=>d.selected).map(d=>d.title).join(", ");const s=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&s.push(e.yellow(this.warn)),s.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let s=[p.symbol(this.done,this.aborted),e.bold(this.msg),p.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(s+=e.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=r(s,this.out.columns)}}return ct=h,ct}var dt,zr;function gs(){if(zr)return dt;zr=1;const e=C(),t=U(),{erase:n,cursor:r}=_(),{style:l,clear:p,figures:i,wrap:g,entriesToDisplay:h}=H(),u=(o,a)=>o[a]&&(o[a].value||o[a].title||o[a]),s=(o,a)=>o[a]&&(o[a].title||o[a].value||o[a]),d=(o,a)=>{const y=o.findIndex(v=>v.value===a||v.title===a);return y>-1?y:void 0};class c extends t{constructor(a={}){super(a),this.msg=a.message,this.suggest=a.suggest,this.choices=a.choices,this.initial=typeof a.initial=="number"?a.initial:d(a.choices,a.initial),this.select=this.initial||a.cursor||0,this.i18n={noMatches:a.noMatches||"no matches found"},this.fallback=a.fallback||this.initial,this.clearFirst=a.clearFirst||!1,this.suggestions=[],this.input="",this.limit=a.limit||10,this.cursor=0,this.transform=l.render(a.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=p("",this.out.columns),this.complete(this.render),this.render()}set fallback(a){this._fb=Number.isSafeInteger(parseInt(a))?parseInt(a):a}get fallback(){let a;return typeof this._fb=="number"?a=this.choices[this._fb]:typeof this._fb=="string"&&(a={title:this._fb}),a||this._fb||{title:this.i18n.noMatches}}moveSelect(a){this.select=a,this.suggestions.length>0?this.value=u(this.suggestions,a):this.value=this.fallback.value,this.fire()}async complete(a){const y=this.completing=this.suggest(this.input,this.choices),v=await y;if(this.completing!==y)return;this.suggestions=v.map((m,b,w)=>({title:s(w,b),value:u(w,b),description:m.description})),this.completing=!1;const f=Math.max(v.length-1,0);this.moveSelect(Math.min(f,this.select)),a&&a()}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(`
82
82
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
83
83
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
84
84
  `),this.close()}_(a,y){let v=this.input.slice(0,this.cursor),f=this.input.slice(this.cursor);this.input=`${v}${a}${f}`,this.cursor=v.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let a=this.input.slice(0,this.cursor-1),y=this.input.slice(this.cursor);this.input=`${a}${y}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let a=this.input.slice(0,this.cursor),y=this.input.slice(this.cursor+1);this.input=`${a}${y}`,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(a,y,v,f){let m,b=v?i.arrowUp:f?i.arrowDown:" ",w=y?e.cyan().underline(a.title):a.title;return b=(y?e.cyan(i.pointer)+" ":" ")+b,a.description&&(m=` - ${a.description}`,(b.length+w.length+m.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(m=`
85
85
  `+g(a.description,{margin:3,width:this.out.columns}))),b+" "+w+e.gray(m||"")}render(){if(this.closed)return;this.firstRender?this.out.write(r.hide):this.out.write(p(this.outputText,this.out.columns)),super.render();let{startIndex:a,endIndex:y}=h(this.select,this.choices.length,this.limit);if(this.outputText=[l.symbol(this.done,this.aborted,this.exited),e.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 v=this.suggestions.slice(a,y).map((f,m)=>this.renderOption(f,this.select===m+a,m===0&&a>0,m+a===y-1&&y<this.choices.length)).join(`
86
86
  `);this.outputText+=`
87
- `+(v||e.gray(this.fallback.title))}this.out.write(n.line+r.to(0)+this.outputText)}}return pt=c,pt}var mt,Kr;function $s(){if(Kr)return mt;Kr=1;const e=E(),{cursor:t}=C(),n=Wr(),{clear:r,style:l,figures:p}=Y();class i extends n{constructor(h={}){h.overrideRender=!0,super(h),this.inputValue="",this.clear=r("",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(h=>h.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 h=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 u=this.filteredOptions.findIndex(s=>s===h);this.cursor=u<0?0:u,this.render()}handleSpaceToggle(){const h=this.filteredOptions[this.cursor];if(h.selected)h.selected=!1,this.render();else{if(h.disabled||this.value.filter(u=>u.selected).length>=this.maxChoices)return this.bell();h.selected=!0,this.render()}}handleInputChange(h){this.inputValue=this.inputValue+h,this.updateFilteredOptions()}_(h,u){h===" "?this.handleSpaceToggle():this.handleInputChange(h)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
87
+ `+(v||e.gray(this.fallback.title))}this.out.write(n.line+r.to(0)+this.outputText)}}return dt=c,dt}var ft,Wr;function vs(){if(Wr)return ft;Wr=1;const e=C(),{cursor:t}=_(),n=Gr(),{clear:r,style:l,figures:p}=H();class i extends n{constructor(h={}){h.overrideRender=!0,super(h),this.inputValue="",this.clear=r("",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(h=>h.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 h=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 u=this.filteredOptions.findIndex(s=>s===h);this.cursor=u<0?0:u,this.render()}handleSpaceToggle(){const h=this.filteredOptions[this.cursor];if(h.selected)h.selected=!1,this.render();else{if(h.disabled||this.value.filter(u=>u.selected).length>=this.maxChoices)return this.bell();h.selected=!0,this.render()}}handleInputChange(h){this.inputValue=this.inputValue+h,this.updateFilteredOptions()}_(h,u){h===" "?this.handleSpaceToggle():this.handleInputChange(h)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
88
88
  Instructions:
89
89
  ${p.arrowUp}/${p.arrowDown}: Highlight option
90
90
  ${p.arrowLeft}/${p.arrowRight}/[space]: Toggle selection
@@ -92,28 +92,28 @@ Instructions:
92
92
  enter/return: Complete answer
93
93
  `:""}renderCurrentInput(){return`
94
94
  Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
95
- `}renderOption(h,u,s){let d;return u.disabled?d=h===s?e.gray().underline(u.title):e.strikethrough().gray(u.title):d=h===s?e.cyan().underline(u.title):u.title,(u.selected?e.green(p.radioOn):p.radioOff)+" "+d}renderDoneOrInstructions(){if(this.done)return this.value.filter(u=>u.selected).map(u=>u.title).join(", ");const h=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&h.push(e.yellow(this.warn)),h.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let h=[l.symbol(this.done,this.aborted),e.bold(this.msg),l.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(h+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),h+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+h),this.clear=r(h,this.out.columns)}}return mt=i,mt}var gt,Zr;function Ss(){if(Zr)return gt;Zr=1;const e=E(),t=V(),{style:n,clear:r}=Y(),{erase:l,cursor:p}=C();class i extends t{constructor(h={}){super(h),this.msg=h.message,this.value=h.initial,this.initialValue=!!h.initial,this.yesMsg=h.yes||"yes",this.yesOption=h.yesOption||"(Y/n)",this.noMsg=h.no||"no",this.noOption=h.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(`
95
+ `}renderOption(h,u,s){let d;return u.disabled?d=h===s?e.gray().underline(u.title):e.strikethrough().gray(u.title):d=h===s?e.cyan().underline(u.title):u.title,(u.selected?e.green(p.radioOn):p.radioOff)+" "+d}renderDoneOrInstructions(){if(this.done)return this.value.filter(u=>u.selected).map(u=>u.title).join(", ");const h=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&h.push(e.yellow(this.warn)),h.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let h=[l.symbol(this.done,this.aborted),e.bold(this.msg),l.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(h+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),h+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+h),this.clear=r(h,this.out.columns)}}return ft=i,ft}var pt,Jr;function bs(){if(Jr)return pt;Jr=1;const e=C(),t=U(),{style:n,clear:r}=H(),{erase:l,cursor:p}=_();class i extends t{constructor(h={}){super(h),this.msg=h.message,this.value=h.initial,this.initialValue=!!h.initial,this.yesMsg=h.yes||"yes",this.yesOption=h.yesOption||"(Y/n)",this.noMsg=h.no||"no",this.noOption=h.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(`
96
96
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
97
- `),this.close()}_(h,u){return h.toLowerCase()==="y"?(this.value=!0,this.submit()):h.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(p.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(l.line+p.to(0)+this.outputText))}}return gt=i,gt}var vt,Xr;function Os(){return Xr||(Xr=1,vt={TextPrompt:ls(),SelectPrompt:hs(),TogglePrompt:us(),DatePrompt:ws(),NumberPrompt:ys(),MultiselectPrompt:Wr(),AutocompletePrompt:xs(),AutocompleteMultiselectPrompt:$s(),ConfirmPrompt:Ss()}),vt}var Qr;function Ms(){return Qr||(Qr=1,function(e){const t=e,n=Os(),r=i=>i;function l(i,g,h={}){return new Promise((u,s)=>{const d=new n[i](g),c=h.onAbort||r,o=h.onSubmit||r,a=h.onExit||r;d.on("state",g.onState||r),d.on("submit",y=>u(o(y))),d.on("exit",y=>u(a(y))),d.on("abort",y=>s(c(y)))})}t.text=i=>l("TextPrompt",i),t.password=i=>(i.style="password",t.text(i)),t.invisible=i=>(i.style="invisible",t.text(i)),t.number=i=>l("NumberPrompt",i),t.date=i=>l("DatePrompt",i),t.confirm=i=>l("ConfirmPrompt",i),t.list=i=>{const g=i.separator||",";return l("TextPrompt",i,{onSubmit:h=>h.split(g).map(u=>u.trim())})},t.toggle=i=>l("TogglePrompt",i),t.select=i=>l("SelectPrompt",i),t.multiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("MultiselectPrompt",i,{onAbort:g,onSubmit:g})},t.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("AutocompleteMultiselectPrompt",i,{onAbort:g,onSubmit:g})};const p=(i,g)=>Promise.resolve(g.filter(h=>h.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));t.autocomplete=i=>(i.suggest=i.suggest||p,i.choices=[].concat(i.choices||[]),l("AutocompletePrompt",i))}(Ye)),Ye}var bt,ei;function Ps(){if(ei)return bt;ei=1;const e=Ms(),t=["suggest","format","onState","validate","onRender","type"],n=()=>{};async function r(g=[],{onSubmit:h=n,onCancel:u=n}={}){const s={},d=r._override||{};g=[].concat(g);let c,o,a,y,v,f;const m=async(b,w,x=!1)=>{if(!(!x&&b.validate&&b.validate(w)!==!0))return b.format?await b.format(w,s):w};for(o of g)if({name:y,type:v}=o,typeof v=="function"&&(v=await v(c,{...s},o),o.type=v),!!v){for(let b in o){if(t.includes(b))continue;let w=o[b];o[b]=typeof w=="function"?await w(c,{...s},f):w}if(f=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:y,type:v}=o,e[v]===void 0)throw new Error(`prompt type (${v}) is not defined`);if(d[o.name]!==void 0&&(c=await m(o,d[o.name]),c!==void 0)){s[y]=c;continue}try{c=r._injected?l(r._injected,o.initial):await e[v](o),s[y]=c=await m(o,c,!0),a=await h(o,c,s)}catch{a=!await u(o,s)}if(a)return s}return s}function l(g,h){const u=g.shift();if(u instanceof Error)throw u;return u===void 0?h:u}function p(g){r._injected=(r._injected||[]).concat(g)}function i(g){r._override=Object.assign({},g)}return bt=Object.assign(r,{prompt:r,prompts:e,inject:p,override:i}),bt}function Ts(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,n=process.versions.node.split(".").map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}var Es=Ts("8.6.0")?es():Ps();const Cs=Z(Es);function ti(e){return e?.trim().replace(/\/+$/g,"")}function wt(e){return j.basename(j.resolve(e))}function _s(e){const t=A.readdirSync(e);return t.length===0||t.length===1&&t[0]===".git"}function qs(e){return A.existsSync(e)}function Ds(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function Rs(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Is(e){if(A.existsSync(e))for(const t of A.readdirSync(e))t!==".git"&&A.rmSync(j.resolve(e,t),{recursive:!0,force:!0})}function As(e){if(!e)return;const t=e.split(" ")[0].split("/");return{name:t[0],version:t[1]}}function js(e,t){A.mkdirSync(t,{recursive:!0});for(const n of A.readdirSync(e)){const r=j.resolve(e,n),l=j.resolve(t,n);ri(r,l)}}function ri(e,t){Fs(e)?js(e,t):A.copyFileSync(e,t)}function Fs(e){return A.statSync(e).isDirectory()}var G={exports:{}},yt,ii;function Ns(){if(ii)return yt;ii=1,yt=r,r.sync=l;var e=ie;function t(p,i){var g=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!g||(g=g.split(";"),g.indexOf("")!==-1))return!0;for(var h=0;h<g.length;h++){var u=g[h].toLowerCase();if(u&&p.substr(-u.length).toLowerCase()===u)return!0}return!1}function n(p,i,g){return!p.isSymbolicLink()&&!p.isFile()?!1:t(i,g)}function r(p,i,g){e.stat(p,function(h,u){g(h,h?!1:n(u,p,i))})}function l(p,i){return n(e.statSync(p),p,i)}return yt}var xt,si;function ks(){if(si)return xt;si=1,xt=t,t.sync=n;var e=ie;function t(p,i,g){e.stat(p,function(h,u){g(h,h?!1:r(u,i))})}function n(p,i){return r(e.statSync(p),i)}function r(p,i){return p.isFile()&&l(p,i)}function l(p,i){var g=p.mode,h=p.uid,u=p.gid,s=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),d=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),c=parseInt("100",8),o=parseInt("010",8),a=parseInt("001",8),y=c|o,v=g&a||g&o&&u===d||g&c&&h===s||g&y&&s===0;return v}return xt}var ee;process.platform==="win32"||yi.TESTING_WINDOWS?ee=Ns():ee=ks();var Ys=$t;$t.sync=Hs;function $t(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,l){$t(e,t||{},function(p,i){p?l(p):r(i)})})}ee(e,t||{},function(r,l){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,l=!1),n(r,l)})}function Hs(e,t){try{return ee.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const z=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ni=re,Bs=z?";":":",oi=Ys,li=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),hi=(e,t)=>{const n=t.colon||Bs,r=e.match(/\//)||z&&e.match(/\\/)?[""]:[...z?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],l=z?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",p=z?l.split(n):[""];return z&&e.indexOf(".")!==-1&&p[0]!==""&&p.unshift(""),{pathEnv:r,pathExt:p,pathExtExe:l}},ui=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:r,pathExt:l,pathExtExe:p}=hi(e,t),i=[],g=u=>new Promise((s,d)=>{if(u===r.length)return t.all&&i.length?s(i):d(li(e));const c=r[u],o=/^".*"$/.test(c)?c.slice(1,-1):c,a=ni.join(o,e),y=!o&&/^\.[\\\/]/.test(e)?e.slice(0,2)+a:a;s(h(y,u,0))}),h=(u,s,d)=>new Promise((c,o)=>{if(d===l.length)return c(g(s+1));const a=l[d];oi(u+a,{pathExt:p},(y,v)=>{if(!y&&v)if(t.all)i.push(u+a);else return c(u+a);return c(h(u,s,d+1))})});return n?g(0).then(u=>n(null,u),n):g(0)},Ls=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:r,pathExtExe:l}=hi(e,t),p=[];for(let i=0;i<n.length;i++){const g=n[i],h=/^".*"$/.test(g)?g.slice(1,-1):g,u=ni.join(h,e),s=!h&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<r.length;d++){const c=s+r[d];try{if(oi.sync(c,{pathExt:l}))if(t.all)p.push(c);else return c}catch{}}}if(t.all&&p.length)return p;if(t.nothrow)return null;throw li(e)};var Vs=ui;ui.sync=Ls;var St={exports:{}};const ai=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};St.exports=ai,St.exports.default=ai;var Us=St.exports;const ci=re,Gs=Vs,zs=Us;function di(e,t){const n=e.options.env||process.env,r=process.cwd(),l=e.options.cwd!=null,p=l&&process.chdir!==void 0&&!process.chdir.disabled;if(p)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Gs.sync(e.command,{path:n[zs({env:n})],pathExt:t?ci.delimiter:void 0})}catch{}finally{p&&process.chdir(r)}return i&&(i=ci.resolve(l?e.options.cwd:"",i)),i}function Ws(e){return di(e)||di(e,!0)}var Js=Ws,Ot={};const Mt=/([()\][%!^"`<>&|;, *?])/g;function Ks(e){return e=e.replace(Mt,"^$1"),e}function Zs(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Mt,"^$1"),t&&(e=e.replace(Mt,"^$1")),e}Ot.command=Ks,Ot.argument=Zs;var Xs=/^#!(.*)/;const Qs=Xs;var en=(e="")=>{const t=e.match(Qs);if(!t)return null;const[n,r]=t[0].replace(/#! ?/,"").split(" "),l=n.split("/").pop();return l==="env"?r:r?`${l} ${r}`:l};const Pt=ie,tn=en;function rn(e){const n=Buffer.alloc(150);let r;try{r=Pt.openSync(e,"r"),Pt.readSync(r,n,0,150,0),Pt.closeSync(r)}catch{}return tn(n.toString())}var sn=rn;const nn=re,fi=Js,pi=Ot,on=sn,ln=process.platform==="win32",hn=/\.(?:com|exe)$/i,un=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function an(e){e.file=fi(e);const t=e.file&&on(e.file);return t?(e.args.unshift(e.file),e.command=t,fi(e)):e.file}function cn(e){if(!ln)return e;const t=an(e),n=!hn.test(t);if(e.options.forceShell||n){const r=un.test(t);e.command=nn.normalize(e.command),e.command=pi.command(e.command),e.args=e.args.map(p=>pi.argument(p,r));const l=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${l}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function dn(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:cn(r)}var fn=dn;const Tt=process.platform==="win32";function Et(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function pn(e,t){if(!Tt)return;const n=e.emit;e.emit=function(r,l){if(r==="exit"){const p=mi(l,t);if(p)return n.call(e,"error",p)}return n.apply(e,arguments)}}function mi(e,t){return Tt&&e===1&&!t.file?Et(t.original,"spawn"):null}function mn(e,t){return Tt&&e===1&&!t.file?Et(t.original,"spawnSync"):null}var gn={hookChildProcess:pn,verifyENOENT:mi,verifyENOENTSync:mn,notFoundError:Et};const gi=wi,Ct=fn,_t=gn;function vi(e,t,n){const r=Ct(e,t,n),l=gi.spawn(r.command,r.args,r.options);return _t.hookChildProcess(l,r),l}function vn(e,t,n){const r=Ct(e,t,n),l=gi.spawnSync(r.command,r.args,r.options);return l.error=l.error||_t.verifyENOENTSync(l.status,r),l}G.exports=vi,G.exports.spawn=vi,G.exports.sync=vn,G.exports._parse=Ct,G.exports._enoent=_t;var bn=G.exports;const wn=Z(bn),qt=Si(process.argv.slice(2),{boolean:["help"],string:["_"],default:{help:!1},alias:{h:"help",t:"template"}}),{reset:te,magenta:yn,blue:xn,cyan:bi,green:K,yellowBright:$n,white:Sn,red:W,gray:On,bgRedBright:Mn}=Ei,F={react:bi("React18"),mobx:bi("Mobx"),ts:xn("TS"),vue:K("Vue3"),pinia:K("Pinia"),bun:Sn("Bun"),elysia:W("Elysia"),vite:$n("Vite")},J={frontend:{react:{get label(){return`${this._label} ${this.completed?K("\u2714"):W("\u2718 uncompleted")}`},_label:`${F.react} + ${F.mobx} + ${F.ts} + ${F.vite}`,value:"react",completed:!0},vue:{get label(){return`${this._label} ${this.completed?K("\u2714"):W("\u2718 uncompleted")}`},_label:`${F.vue} + ${F.pinia} + ${F.ts} + ${F.vite}`,value:"vue",completed:!1}},backend:{bun:{get label(){return`${this._label} ${this.completed?K("\u2714"):W("\u2718 uncompleted")}`},_label:`${F.bun} + ${F.elysia} + ${F.ts}`,value:"bun",completed:!1}}},Pn=Object.keys(J).map(e=>` ${On(e)}:
97
+ `),this.close()}_(h,u){return h.toLowerCase()==="y"?(this.value=!0,this.submit()):h.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(p.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(l.line+p.to(0)+this.outputText))}}return pt=i,pt}var mt,Kr;function ws(){return Kr||(Kr=1,mt={TextPrompt:rs(),SelectPrompt:is(),TogglePrompt:ss(),DatePrompt:ps(),NumberPrompt:ms(),MultiselectPrompt:Gr(),AutocompletePrompt:gs(),AutocompleteMultiselectPrompt:vs(),ConfirmPrompt:bs()}),mt}var Zr;function ys(){return Zr||(Zr=1,function(e){const t=e,n=ws(),r=i=>i;function l(i,g,h={}){return new Promise((u,s)=>{const d=new n[i](g),c=h.onAbort||r,o=h.onSubmit||r,a=h.onExit||r;d.on("state",g.onState||r),d.on("submit",y=>u(o(y))),d.on("exit",y=>u(a(y))),d.on("abort",y=>s(c(y)))})}t.text=i=>l("TextPrompt",i),t.password=i=>(i.style="password",t.text(i)),t.invisible=i=>(i.style="invisible",t.text(i)),t.number=i=>l("NumberPrompt",i),t.date=i=>l("DatePrompt",i),t.confirm=i=>l("ConfirmPrompt",i),t.list=i=>{const g=i.separator||",";return l("TextPrompt",i,{onSubmit:h=>h.split(g).map(u=>u.trim())})},t.toggle=i=>l("TogglePrompt",i),t.select=i=>l("SelectPrompt",i),t.multiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("MultiselectPrompt",i,{onAbort:g,onSubmit:g})},t.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const g=h=>h.filter(u=>u.selected).map(u=>u.value);return l("AutocompleteMultiselectPrompt",i,{onAbort:g,onSubmit:g})};const p=(i,g)=>Promise.resolve(g.filter(h=>h.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));t.autocomplete=i=>(i.suggest=i.suggest||p,i.choices=[].concat(i.choices||[]),l("AutocompletePrompt",i))}(Ne)),Ne}var gt,Xr;function xs(){if(Xr)return gt;Xr=1;const e=ys(),t=["suggest","format","onState","validate","onRender","type"],n=()=>{};async function r(g=[],{onSubmit:h=n,onCancel:u=n}={}){const s={},d=r._override||{};g=[].concat(g);let c,o,a,y,v,f;const m=async(b,w,x=!1)=>{if(!(!x&&b.validate&&b.validate(w)!==!0))return b.format?await b.format(w,s):w};for(o of g)if({name:y,type:v}=o,typeof v=="function"&&(v=await v(c,{...s},o),o.type=v),!!v){for(let b in o){if(t.includes(b))continue;let w=o[b];o[b]=typeof w=="function"?await w(c,{...s},f):w}if(f=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:y,type:v}=o,e[v]===void 0)throw new Error(`prompt type (${v}) is not defined`);if(d[o.name]!==void 0&&(c=await m(o,d[o.name]),c!==void 0)){s[y]=c;continue}try{c=r._injected?l(r._injected,o.initial):await e[v](o),s[y]=c=await m(o,c,!0),a=await h(o,c,s)}catch{a=!await u(o,s)}if(a)return s}return s}function l(g,h){const u=g.shift();if(u instanceof Error)throw u;return u===void 0?h:u}function p(g){r._injected=(r._injected||[]).concat(g)}function i(g){r._override=Object.assign({},g)}return gt=Object.assign(r,{prompt:r,prompts:e,inject:p,override:i}),gt}function $s(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,n=process.versions.node.split(".").map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}var Ss=$s("8.6.0")?Ji():xs();const Os=te(Ss);var z={exports:{}},vt,Qr;function Ms(){if(Qr)return vt;Qr=1,vt=r,r.sync=l;var e=ee;function t(p,i){var g=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!g||(g=g.split(";"),g.indexOf("")!==-1))return!0;for(var h=0;h<g.length;h++){var u=g[h].toLowerCase();if(u&&p.substr(-u.length).toLowerCase()===u)return!0}return!1}function n(p,i,g){return!p.isSymbolicLink()&&!p.isFile()?!1:t(i,g)}function r(p,i,g){e.stat(p,function(h,u){g(h,h?!1:n(u,p,i))})}function l(p,i){return n(e.statSync(p),p,i)}return vt}var bt,ei;function Ps(){if(ei)return bt;ei=1,bt=t,t.sync=n;var e=ee;function t(p,i,g){e.stat(p,function(h,u){g(h,h?!1:r(u,i))})}function n(p,i){return r(e.statSync(p),i)}function r(p,i){return p.isFile()&&l(p,i)}function l(p,i){var g=p.mode,h=p.uid,u=p.gid,s=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),d=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),c=parseInt("100",8),o=parseInt("010",8),a=parseInt("001",8),y=c|o,v=g&a||g&o&&u===d||g&c&&h===s||g&y&&s===0;return v}return bt}var X;process.platform==="win32"||vi.TESTING_WINDOWS?X=Ms():X=Ps();var Ts=wt;wt.sync=Es;function wt(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,l){wt(e,t||{},function(p,i){p?l(p):r(i)})})}X(e,t||{},function(r,l){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,l=!1),n(r,l)})}function Es(e,t){try{return X.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const W=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ti=Q,Cs=W?";":":",ri=Ts,ii=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),si=(e,t)=>{const n=t.colon||Cs,r=e.match(/\//)||W&&e.match(/\\/)?[""]:[...W?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],l=W?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",p=W?l.split(n):[""];return W&&e.indexOf(".")!==-1&&p[0]!==""&&p.unshift(""),{pathEnv:r,pathExt:p,pathExtExe:l}},ni=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:r,pathExt:l,pathExtExe:p}=si(e,t),i=[],g=u=>new Promise((s,d)=>{if(u===r.length)return t.all&&i.length?s(i):d(ii(e));const c=r[u],o=/^".*"$/.test(c)?c.slice(1,-1):c,a=ti.join(o,e),y=!o&&/^\.[\\\/]/.test(e)?e.slice(0,2)+a:a;s(h(y,u,0))}),h=(u,s,d)=>new Promise((c,o)=>{if(d===l.length)return c(g(s+1));const a=l[d];ri(u+a,{pathExt:p},(y,v)=>{if(!y&&v)if(t.all)i.push(u+a);else return c(u+a);return c(h(u,s,d+1))})});return n?g(0).then(u=>n(null,u),n):g(0)},_s=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:r,pathExtExe:l}=si(e,t),p=[];for(let i=0;i<n.length;i++){const g=n[i],h=/^".*"$/.test(g)?g.slice(1,-1):g,u=ti.join(h,e),s=!h&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<r.length;d++){const c=s+r[d];try{if(ri.sync(c,{pathExt:l}))if(t.all)p.push(c);else return c}catch{}}}if(t.all&&p.length)return p;if(t.nothrow)return null;throw ii(e)};var qs=ni;ni.sync=_s;var yt={exports:{}};const oi=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};yt.exports=oi,yt.exports.default=oi;var Ds=yt.exports;const li=Q,Rs=qs,Is=Ds;function hi(e,t){const n=e.options.env||process.env,r=process.cwd(),l=e.options.cwd!=null,p=l&&process.chdir!==void 0&&!process.chdir.disabled;if(p)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Rs.sync(e.command,{path:n[Is({env:n})],pathExt:t?li.delimiter:void 0})}catch{}finally{p&&process.chdir(r)}return i&&(i=li.resolve(l?e.options.cwd:"",i)),i}function As(e){return hi(e)||hi(e,!0)}var js=As,xt={};const $t=/([()\][%!^"`<>&|;, *?])/g;function Fs(e){return e=e.replace($t,"^$1"),e}function Ns(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace($t,"^$1"),t&&(e=e.replace($t,"^$1")),e}xt.command=Fs,xt.argument=Ns;var ks=/^#!(.*)/;const Ys=ks;var Hs=(e="")=>{const t=e.match(Ys);if(!t)return null;const[n,r]=t[0].replace(/#! ?/,"").split(" "),l=n.split("/").pop();return l==="env"?r:r?`${l} ${r}`:l};const St=ee,Bs=Hs;function Ls(e){const n=Buffer.alloc(150);let r;try{r=St.openSync(e,"r"),St.readSync(r,n,0,150,0),St.closeSync(r)}catch{}return Bs(n.toString())}var Vs=Ls;const Us=Q,ui=js,ai=xt,Gs=Vs,zs=process.platform==="win32",Ws=/\.(?:com|exe)$/i,Js=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Ks(e){e.file=ui(e);const t=e.file&&Gs(e.file);return t?(e.args.unshift(e.file),e.command=t,ui(e)):e.file}function Zs(e){if(!zs)return e;const t=Ks(e),n=!Ws.test(t);if(e.options.forceShell||n){const r=Js.test(t);e.command=Us.normalize(e.command),e.command=ai.command(e.command),e.args=e.args.map(p=>ai.argument(p,r));const l=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${l}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Xs(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Zs(r)}var Qs=Xs;const Ot=process.platform==="win32";function Mt(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function en(e,t){if(!Ot)return;const n=e.emit;e.emit=function(r,l){if(r==="exit"){const p=ci(l,t);if(p)return n.call(e,"error",p)}return n.apply(e,arguments)}}function ci(e,t){return Ot&&e===1&&!t.file?Mt(t.original,"spawn"):null}function tn(e,t){return Ot&&e===1&&!t.file?Mt(t.original,"spawnSync"):null}var rn={hookChildProcess:en,verifyENOENT:ci,verifyENOENTSync:tn,notFoundError:Mt};const di=gi,Pt=Qs,Tt=rn;function fi(e,t,n){const r=Pt(e,t,n),l=di.spawn(r.command,r.args,r.options);return Tt.hookChildProcess(l,r),l}function sn(e,t,n){const r=Pt(e,t,n),l=di.spawnSync(r.command,r.args,r.options);return l.error=l.error||Tt.verifyENOENTSync(l.status,r),l}z.exports=fi,z.exports.spawn=fi,z.exports.sync=sn,z.exports._parse=Pt,z.exports._enoent=Tt;var nn=z.exports;const on=te(nn),N={react:E.cyan("React18"),mobx:E.cyan("Mobx"),ts:E.blue("TS"),vue:E.green("Vue3"),pinia:E.green("Pinia"),bun:E.white("Bun"),elysia:E.red("Elysia"),vite:E.yellowBright("Vite")},J={frontend:{react:{get label(){return`${this._label} ${this.completed?E.green("\u2714"):E.red("\u2718 uncompleted")}`},_label:`${N.react} + ${N.mobx} + ${N.ts} + ${N.vite}`,value:"react",completed:!0},vue:{get label(){return`${this._label} ${this.completed?E.green("\u2714"):E.red("\u2718 uncompleted")}`},_label:`${N.vue} + ${N.pinia} + ${N.ts} + ${N.vite}`,value:"vue",completed:!1}},backend:{bun:{get label(){return`${this._label} ${this.completed?E.green("\u2714"):E.red("\u2718 uncompleted")}`},_label:`${N.bun} + ${N.elysia} + ${N.ts}`,value:"bun",completed:!1}}};function pi(e){return e?.trim().replace(/\/+$/g,"")}function Et(e){return F.basename(F.resolve(e))}function ln(e){const t=j.readdirSync(e);return t.length===0||t.length===1&&t[0]===".git"}function hn(e){return j.existsSync(e)}function un(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function an(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function cn(e){if(j.existsSync(e))for(const t of j.readdirSync(e))t!==".git"&&j.rmSync(F.resolve(e,t),{recursive:!0,force:!0})}function dn(e){if(!e)return;const t=e.split(" ")[0].split("/");return{name:t[0],version:t[1]}}function fn(e,t){j.mkdirSync(t,{recursive:!0});for(const n of j.readdirSync(e)){const r=F.resolve(e,n),l=F.resolve(t,n);mi(r,l)}}function mi(e,t){pn(e)?fn(e,t):j.copyFileSync(e,t)}function pn(e){return j.statSync(e).isDirectory()}const Ct=yi(process.argv.slice(2),{boolean:["help"],string:["_"],default:{help:!1},alias:{h:"help",t:"template"}}),mn=Object.keys(J).map(e=>` ${E.gray(e)}:
98
98
  ${Object.values(J[e]).map(t=>` ${t.label}
99
99
  `).join("")}`).join(`
100
- `),Tn=`
100
+ `),gn=`
101
101
  Create a new project from lik's template.
102
102
 
103
103
  Usage:
104
- ${yn("lik-create")} [OPTIONS]... [DIRECTORY]
104
+ ${E.magenta("lik-create")} [OPTIONS]... [DIRECTORY]
105
105
 
106
106
  Options:
107
107
  -h, --help Show this help message and exit.
108
108
  -t, --template Specify the template to use.
109
109
 
110
110
  Avaliable templates:
111
- ${Pn}
111
+ ${mn}
112
112
 
113
113
  Thx create-vite.
114
- `,En=()=>console.log(Tn),Cn=Object.values(J).flatMap(e=>Object.keys(e)),_n=async()=>{if(qt.help)return En();const e="lik-create-template",t=qt._[0];let n=ti(t)||e;const r=n===".",l=qt.template;try{const p=await Cs([{type:t?null:"text",name:"projectName",message:te("Project name: "),initial:e,onState:b=>{n=ti(b.value)||e}},{type:!qs(n)||_s(n)?null:"select",name:"overwrite",message:()=>(r?"Current directory":`Target directory "${n}"`)+"is not empty. Pick an option to continue:",choices:[{title:"Cancel operation",value:"no"},{title:"Remove existing files and continue",value:"yes"},{title:"Ignore files and continue",value:"ignore"}]},{type:(b,w)=>{if(w.overwrite==="no")throw new Error(W("\u2716")+" Operation cancelled");return null},name:"overwriteChecker",message:"Overwrite?"},{type:()=>Ds(wt(n))?null:"text",initial:()=>Rs(wt(n)),name:"packageName",message:te("Package name:")},{type:l&&Cn.includes(l)?null:"select",name:"end",message:te("Select type:"),choices:Object.keys(J).map(b=>({title:b,value:b}))},{type:b=>b&&J[b]?"select":null,name:"template",message:te("Select a template:"),choices:b=>Object.entries(J[b]).map(([w,x])=>({title:x.label,value:w,disabled:!x.completed}))}],{onCancel:()=>{throw new Error(W("\u2716")+" Operation cancelled")}}),{overwrite:i,template:g,packageName:h}=p,u=process.cwd(),s=j.join(u,n);i==="yes"?Is(s):A.existsSync(s)||A.mkdirSync(s,{recursive:!0});const d=As(process.env.npm_config_user_agent),c=g||l,o=j.join(import.meta.dirname,"../templates",`template-${c}`),a={_gitignore:".gitignore"},y=(b,w)=>{const x=j.join(s,a[b]||b);w?A.writeFileSync(x,w):ri(j.join(o,b),x)},v=A.readdirSync(o);for(const b of v.filter(w=>w!=="package.json"))y(b);const f=JSON.parse(A.readFileSync(j.join(o,"package.json"),"utf-8"));f.name=h||wt(n),y("package.json",JSON.stringify(f,null,2)+`
115
- `);const m=j.relative(u,s);switch(console.log(`${Mn(" Attention:")}
114
+ `,vn=()=>console.log(gn),bn=Object.values(J).flatMap(e=>Object.values(e)),wn=async()=>{if(Ct.help)return vn();const e="lik-create-template",t=Ct._[0];let n=pi(t)||e;const r=n===".",l=Ct.template;try{const p=await Os([{type:t?null:"text",name:"projectName",message:E.reset("Project name: "),initial:e,onState:b=>{n=pi(b.value)||e}},{type:!hn(n)||ln(n)?null:"select",name:"overwrite",message:()=>(r?"Current directory":`Target directory "${n}"`)+"is not empty. Pick an option to continue:",choices:[{title:"Cancel operation",value:"no"},{title:"Remove existing files and continue",value:"yes"},{title:"Ignore files and continue",value:"ignore"}]},{type:(b,w)=>{if(w.overwrite==="no")throw new Error(E.red("\u2716")+" Operation cancelled");return null},name:"overwriteChecker",message:"Overwrite?"},{type:()=>un(Et(n))?null:"text",initial:()=>an(Et(n)),name:"packageName",message:E.reset("Package name:")},{type:()=>{if(!l)return"select";const b=bn.find(w=>w.value===l);if(b&&b.completed)return null;throw new Error(E.red("\u2716")+"This template is not available/complete, plz check by `--help`")},name:"end",message:E.reset("Select type:"),choices:Object.keys(J).map(b=>({title:b,value:b}))},{type:b=>b&&J[b]?"select":null,name:"template",message:E.reset("Select a template:"),choices:b=>Object.entries(J[b]).map(([w,x])=>({title:x.label,value:w,disabled:!x.completed}))}],{onCancel:()=>{throw new Error(E.red("\u2716")+" Operation cancelled")}}),{overwrite:i,template:g,packageName:h}=p,u=process.cwd(),s=F.join(u,n);i==="yes"?cn(s):j.existsSync(s)||j.mkdirSync(s,{recursive:!0});const d=dn(process.env.npm_config_user_agent),c=g||l,o=F.join(import.meta.dirname,"../templates",`template-${c}`),a={_gitignore:".gitignore"},y=(b,w)=>{const x=F.join(s,a[b]||b);w?j.writeFileSync(x,w):mi(F.join(o,b),x)},v=j.readdirSync(o);for(const b of v.filter(w=>w!=="package.json"))y(b);const f=JSON.parse(j.readFileSync(F.join(o,"package.json"),"utf-8"));f.name=h||Et(n),y("package.json",JSON.stringify(f,null,2)+`
115
+ `);const m=F.relative(u,s);switch(console.log(`${E.bgRedBright(" Attention:")}
116
116
  git had init, if you want to use husky, please exec before git operation or remove husky:
117
117
  `),console.log(`
118
118
  Done. Now run:
119
- `),s!==u&&console.log(` cd ${m.includes(" ")?`"${m}"`:m}`),wn("git",["init"],{cwd:s}),d?.name){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${d?.name} install`),console.log(` ${d?.name} run dev`);break}console.log()}catch(p){console.log(p.message)}};_n();
119
+ `),s!==u&&console.log(` cd ${m.includes(" ")?`"${m}"`:m}`),on("git",["init"],{cwd:s}),d?.name){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${d?.name} install`),console.log(` ${d?.name} run dev`);break}console.log()}catch(p){console.log(p.message)}};wn();