create-ts-vite-project 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.min.js +55 -54
  2. package/package.json +1 -1
package/dist/index.min.js CHANGED
@@ -1,97 +1,98 @@
1
- "use strict";var Jn=Object.create;var Zt=Object.defineProperty;var Gn=Object.getOwnPropertyDescriptor;var Bn=Object.getOwnPropertyNames;var zn=Object.getPrototypeOf,Zn=Object.prototype.hasOwnProperty;var u=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Wn=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Bn(e))!Zn.call(i,r)&&r!==t&&Zt(i,r,{get:()=>e[r],enumerable:!(s=Gn(e,r))||s.enumerable});return i};var $=(i,e,t)=>(t=i!=null?Jn(zn(i)):{},Wn(e||!i||!i.__esModule?Zt(t,"default",{value:i,enumerable:!0}):t,i));var f=u((ou,ti)=>{"use strict";var{FORCE_COLOR:Kn,NODE_DISABLE_COLORS:Xn,TERM:Qn}=process.env,c={enabled:!Xn&&Qn!=="dumb"&&Kn!=="0",reset:d(0,0),bold:d(1,22),dim:d(2,22),italic:d(3,23),underline:d(4,24),inverse:d(7,27),hidden:d(8,28),strikethrough:d(9,29),black:d(30,39),red:d(31,39),green:d(32,39),yellow:d(33,39),blue:d(34,39),magenta:d(35,39),cyan:d(36,39),white:d(37,39),gray:d(90,39),grey:d(90,39),bgBlack:d(40,49),bgRed:d(41,49),bgGreen:d(42,49),bgYellow:d(43,49),bgBlue:d(44,49),bgMagenta:d(45,49),bgCyan:d(46,49),bgWhite:d(47,49)};function ei(i,e){let t=0,s,r="",o="";for(;t<i.length;t++)s=i[t],r+=s.open,o+=s.close,e.includes(s.close)&&(e=e.replace(s.rgx,s.close+s.open));return r+e+o}function eo(i,e){let t={has:i,keys:e};return t.reset=c.reset.bind(t),t.bold=c.bold.bind(t),t.dim=c.dim.bind(t),t.italic=c.italic.bind(t),t.underline=c.underline.bind(t),t.inverse=c.inverse.bind(t),t.hidden=c.hidden.bind(t),t.strikethrough=c.strikethrough.bind(t),t.black=c.black.bind(t),t.red=c.red.bind(t),t.green=c.green.bind(t),t.yellow=c.yellow.bind(t),t.blue=c.blue.bind(t),t.magenta=c.magenta.bind(t),t.cyan=c.cyan.bind(t),t.white=c.white.bind(t),t.gray=c.gray.bind(t),t.grey=c.grey.bind(t),t.bgBlack=c.bgBlack.bind(t),t.bgRed=c.bgRed.bind(t),t.bgGreen=c.bgGreen.bind(t),t.bgYellow=c.bgYellow.bind(t),t.bgBlue=c.bgBlue.bind(t),t.bgMagenta=c.bgMagenta.bind(t),t.bgCyan=c.bgCyan.bind(t),t.bgWhite=c.bgWhite.bind(t),t}function d(i,e){let t={open:`\x1B[${i}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(i)||(this.has.push(i),this.keys.push(t)),s===void 0?this:c.enabled?ei(this.keys,s+""):s+""):s===void 0?eo([i],[t]):c.enabled?ei([t],s+""):s+""}}ti.exports=c});var si=u((hu,ii)=>{"use strict";ii.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var me=u((lu,ri)=>{"use strict";ri.exports=i=>{let e=["[\\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("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var p=u((uu,ni)=>{"use strict";var ke={to(i,e){return e?`\x1B[${e+1};${i+1}H`:`\x1B[${i+1}G`},move(i,e){let t="";return i<0?t+=`\x1B[${-i}D`:i>0&&(t+=`\x1B[${i}C`),e<0?t+=`\x1B[${-e}A`:e>0&&(t+=`\x1B[${e}B`),t},up:(i=1)=>`\x1B[${i}A`,down:(i=1)=>`\x1B[${i}B`,forward:(i=1)=>`\x1B[${i}C`,backward:(i=1)=>`\x1B[${i}D`,nextLine:(i=1)=>"\x1B[E".repeat(i),prevLine:(i=1)=>"\x1B[F".repeat(i),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},to={up:(i=1)=>"\x1B[S".repeat(i),down:(i=1)=>"\x1B[T".repeat(i)},io={screen:"\x1B[2J",up:(i=1)=>"\x1B[1J".repeat(i),down:(i=1)=>"\x1B[J".repeat(i),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(i){let e="";for(let t=0;t<i;t++)e+=this.line+(t<i-1?ke.up():"");return i&&(e+=ke.left),e}};ni.exports={cursor:ke,scroll:to,erase:io,beep:"\x07"}});var ai=u((au,ui)=>{"use strict";function so(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=ro(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}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,n=!1,h;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return o=a.done,a},e:function(a){n=!0,h=a},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(n)throw h}}}}function ro(i,e){if(i){if(typeof i=="string")return oi(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oi(i,e)}}function oi(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}var no=me(),li=p(),hi=li.erase,oo=li.cursor,ho=i=>[...no(i)].length;ui.exports=function(i,e){if(!e)return hi.line+oo.to(0);let t=0,s=i.split(/\r?\n/);var r=so(s),o;try{for(r.s();!(o=r.n()).done;){let n=o.value;t+=1+Math.floor(Math.max(ho(n)-1,0)/e)}}catch(n){r.e(n)}finally{r.f()}return hi.lines(t)}});var Ee=u((cu,ci)=>{"use strict";var se={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},lo={arrowUp:se.arrowUp,arrowDown:se.arrowDown,arrowLeft:se.arrowLeft,arrowRight:se.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},uo=process.platform==="win32"?lo:se;ci.exports=uo});var fi=u((du,di)=>{"use strict";var K=f(),G=Ee(),Ae=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),ao=i=>Ae[i]||Ae.default,re=Object.freeze({aborted:K.red(G.cross),done:K.green(G.tick),exited:K.yellow(G.cross),default:K.cyan("?")}),co=(i,e,t)=>e?re.aborted:t?re.exited:i?re.done:re.default,fo=i=>K.gray(i?G.ellipsis:G.pointerSmall),po=(i,e)=>K.gray(i?e?G.pointerSmall:"+":G.line);di.exports={styles:Ae,render:ao,symbols:re,symbol:co,delimiter:fo,item:po}});var mi=u((fu,pi)=>{"use strict";var mo=me();pi.exports=function(i,e){let t=String(mo(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var vi=u((pu,gi)=>{"use strict";gi.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((o,n)=>(n.length+t.length>=s||o[o.length-1].length+n.length+1<s?o[o.length-1]+=` ${n}`:o.push(`${t}${n}`),o),[t]).join(`
1
+ "use strict";var Un=Object.create;var Wt=Object.defineProperty;var Jn=Object.getOwnPropertyDescriptor;var Gn=Object.getOwnPropertyNames;var Bn=Object.getPrototypeOf,zn=Object.prototype.hasOwnProperty;var u=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Zn=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Gn(e))!zn.call(i,r)&&r!==t&&Wt(i,r,{get:()=>e[r],enumerable:!(s=Jn(e,r))||s.enumerable});return i};var F=(i,e,t)=>(t=i!=null?Un(Bn(i)):{},Zn(e||!i||!i.__esModule?Wt(t,"default",{value:i,enumerable:!0}):t,i));var f=u((nu,ei)=>{"use strict";var{FORCE_COLOR:Wn,NODE_DISABLE_COLORS:Kn,TERM:Xn}=process.env,c={enabled:!Kn&&Xn!=="dumb"&&Wn!=="0",reset:d(0,0),bold:d(1,22),dim:d(2,22),italic:d(3,23),underline:d(4,24),inverse:d(7,27),hidden:d(8,28),strikethrough:d(9,29),black:d(30,39),red:d(31,39),green:d(32,39),yellow:d(33,39),blue:d(34,39),magenta:d(35,39),cyan:d(36,39),white:d(37,39),gray:d(90,39),grey:d(90,39),bgBlack:d(40,49),bgRed:d(41,49),bgGreen:d(42,49),bgYellow:d(43,49),bgBlue:d(44,49),bgMagenta:d(45,49),bgCyan:d(46,49),bgWhite:d(47,49)};function Qt(i,e){let t=0,s,r="",o="";for(;t<i.length;t++)s=i[t],r+=s.open,o+=s.close,e.includes(s.close)&&(e=e.replace(s.rgx,s.close+s.open));return r+e+o}function Qn(i,e){let t={has:i,keys:e};return t.reset=c.reset.bind(t),t.bold=c.bold.bind(t),t.dim=c.dim.bind(t),t.italic=c.italic.bind(t),t.underline=c.underline.bind(t),t.inverse=c.inverse.bind(t),t.hidden=c.hidden.bind(t),t.strikethrough=c.strikethrough.bind(t),t.black=c.black.bind(t),t.red=c.red.bind(t),t.green=c.green.bind(t),t.yellow=c.yellow.bind(t),t.blue=c.blue.bind(t),t.magenta=c.magenta.bind(t),t.cyan=c.cyan.bind(t),t.white=c.white.bind(t),t.gray=c.gray.bind(t),t.grey=c.grey.bind(t),t.bgBlack=c.bgBlack.bind(t),t.bgRed=c.bgRed.bind(t),t.bgGreen=c.bgGreen.bind(t),t.bgYellow=c.bgYellow.bind(t),t.bgBlue=c.bgBlue.bind(t),t.bgMagenta=c.bgMagenta.bind(t),t.bgCyan=c.bgCyan.bind(t),t.bgWhite=c.bgWhite.bind(t),t}function d(i,e){let t={open:`\x1B[${i}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(i)||(this.has.push(i),this.keys.push(t)),s===void 0?this:c.enabled?Qt(this.keys,s+""):s+""):s===void 0?Qn([i],[t]):c.enabled?Qt([t],s+""):s+""}}ei.exports=c});var ii=u((ou,ti)=>{"use strict";ti.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var ge=u((hu,si)=>{"use strict";si.exports=i=>{let e=["[\\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("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var p=u((lu,ri)=>{"use strict";var Ee={to(i,e){return e?`\x1B[${e+1};${i+1}H`:`\x1B[${i+1}G`},move(i,e){let t="";return i<0?t+=`\x1B[${-i}D`:i>0&&(t+=`\x1B[${i}C`),e<0?t+=`\x1B[${-e}A`:e>0&&(t+=`\x1B[${e}B`),t},up:(i=1)=>`\x1B[${i}A`,down:(i=1)=>`\x1B[${i}B`,forward:(i=1)=>`\x1B[${i}C`,backward:(i=1)=>`\x1B[${i}D`,nextLine:(i=1)=>"\x1B[E".repeat(i),prevLine:(i=1)=>"\x1B[F".repeat(i),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},eo={up:(i=1)=>"\x1B[S".repeat(i),down:(i=1)=>"\x1B[T".repeat(i)},to={screen:"\x1B[2J",up:(i=1)=>"\x1B[1J".repeat(i),down:(i=1)=>"\x1B[J".repeat(i),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(i){let e="";for(let t=0;t<i;t++)e+=this.line+(t<i-1?Ee.up():"");return i&&(e+=Ee.left),e}};ri.exports={cursor:Ee,scroll:eo,erase:to,beep:"\x07"}});var ui=u((uu,li)=>{"use strict";function io(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=so(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}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,n=!1,h;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return o=a.done,a},e:function(a){n=!0,h=a},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(n)throw h}}}}function so(i,e){if(i){if(typeof i=="string")return ni(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ni(i,e)}}function ni(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}var ro=ge(),hi=p(),oi=hi.erase,no=hi.cursor,oo=i=>[...ro(i)].length;li.exports=function(i,e){if(!e)return oi.line+no.to(0);let t=0,s=i.split(/\r?\n/);var r=io(s),o;try{for(r.s();!(o=r.n()).done;){let n=o.value;t+=1+Math.floor(Math.max(oo(n)-1,0)/e)}}catch(n){r.e(n)}finally{r.f()}return oi.lines(t)}});var Ae=u((au,ai)=>{"use strict";var re={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},ho={arrowUp:re.arrowUp,arrowDown:re.arrowDown,arrowLeft:re.arrowLeft,arrowRight:re.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},lo=process.platform==="win32"?ho:re;ai.exports=lo});var di=u((cu,ci)=>{"use strict";var X=f(),B=Ae(),Re=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),uo=i=>Re[i]||Re.default,ne=Object.freeze({aborted:X.red(B.cross),done:X.green(B.tick),exited:X.yellow(B.cross),default:X.cyan("?")}),ao=(i,e,t)=>e?ne.aborted:t?ne.exited:i?ne.done:ne.default,co=i=>X.gray(i?B.ellipsis:B.pointerSmall),fo=(i,e)=>X.gray(i?e?B.pointerSmall:"+":B.line);ci.exports={styles:Re,render:uo,symbols:ne,symbol:ao,delimiter:co,item:fo}});var pi=u((du,fi)=>{"use strict";var po=ge();fi.exports=function(i,e){let t=String(po(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var gi=u((fu,mi)=>{"use strict";mi.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((o,n)=>(n.length+t.length>=s||o[o.length-1].length+n.length+1<s?o[o.length-1]+=` ${n}`:o.push(`${t}${n}`),o),[t]).join(`
3
3
  `)).join(`
4
- `)}});var yi=u((mu,bi)=>{"use strict";bi.exports=(i,e,t)=>{t=t||e;let s=Math.min(e-t,i-Math.floor(t/2));s<0&&(s=0);let r=Math.min(s+t,e);return{startIndex:s,endIndex:r}}});var w=u((gu,wi)=>{"use strict";wi.exports={action:si(),clear:ai(),style:fi(),strip:me(),figures:Ee(),lines:mi(),wrap:vi(),entriesToDisplay:yi()}});var C=u((vu,qi)=>{"use strict";var xi=require("readline"),go=w(),vo=go.action,bo=require("events"),Si=p(),yo=Si.beep,wo=Si.cursor,xo=f(),Re=class extends bo{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=xi.createInterface({input:this.in,escapeCodeTimeout:50});xi.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(o,n)=>{let h=vo(n,s);h===!1?this._&&this._(o,n):typeof this[h]=="function"?this[h](n):this.bell()};this.close=()=>{this.out.write(wo.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(yo)}render(){this.onRender(xo),this.firstRender&&(this.firstRender=!1)}};qi.exports=Re});var Ti=u((bu,Ii)=>{"use strict";function Oi(i,e,t,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Mi(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var o=i.apply(e,t);function n(l){Oi(o,s,r,n,h,"next",l)}function h(l){Oi(o,s,r,n,h,"throw",l)}n(void 0)})}}var ge=f(),So=C(),Pi=p(),qo=Pi.erase,ne=Pi.cursor,ve=w(),Fe=ve.style,Ve=ve.clear,Oo=ve.lines,Mo=ve.figures,He=class extends So{constructor(e={}){super(e),this.transform=Fe.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=Ve("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=ge.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,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
- `),this.close()}validate(){var e=this;return Mi(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Mi(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
6
- `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,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 e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,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(ne.down(Oo(this.outputError,this.out.columns)-1)+Ve(this.outputError,this.out.columns)),this.out.write(Ve(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Fe.symbol(this.done,this.aborted),ge.bold(this.msg),Fe.delimiter(this.done),this.red?ge.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
4
+ `)}});var bi=u((pu,vi)=>{"use strict";vi.exports=(i,e,t)=>{t=t||e;let s=Math.min(e-t,i-Math.floor(t/2));s<0&&(s=0);let r=Math.min(s+t,e);return{startIndex:s,endIndex:r}}});var x=u((mu,yi)=>{"use strict";yi.exports={action:ii(),clear:ui(),style:di(),strip:ge(),figures:Ae(),lines:pi(),wrap:gi(),entriesToDisplay:bi()}});var C=u((gu,Si)=>{"use strict";var wi=require("readline"),mo=x(),go=mo.action,vo=require("events"),xi=p(),bo=xi.beep,yo=xi.cursor,wo=f(),Fe=class extends vo{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=wi.createInterface({input:this.in,escapeCodeTimeout:50});wi.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(o,n)=>{let h=go(n,s);h===!1?this._&&this._(o,n):typeof this[h]=="function"?this[h](n):this.bell()};this.close=()=>{this.out.write(yo.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(bo)}render(){this.onRender(wo),this.firstRender&&(this.firstRender=!1)}};Si.exports=Fe});var Ii=u((vu,Pi)=>{"use strict";function qi(i,e,t,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Oi(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var o=i.apply(e,t);function n(l){qi(o,s,r,n,h,"next",l)}function h(l){qi(o,s,r,n,h,"throw",l)}n(void 0)})}}var ve=f(),xo=C(),Mi=p(),So=Mi.erase,oe=Mi.cursor,be=x(),Ve=be.style,He=be.clear,qo=be.lines,Oo=be.figures,Ye=class extends xo{constructor(e={}){super(e),this.transform=Ve.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=He("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=ve.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,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
+ `),this.close()}validate(){var e=this;return Oi(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return Oi(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
6
+ `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,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 e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,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(oe.down(qo(this.outputError,this.out.columns)-1)+He(this.outputError,this.out.columns)),this.out.write(He(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ve.symbol(this.done,this.aborted),ve.bold(this.msg),Ve.delimiter(this.done),this.red?ve.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
7
7
  `).reduce((e,t,s)=>e+`
8
- ${s?" ":Mo.pointerSmall} ${ge.red().italic(t)}`,"")),this.out.write(qo.line+ne.to(0)+this.outputText+ne.save+this.outputError+ne.restore+ne.move(this.cursorOffset,0)))}};Ii.exports=He});var Di=u((yu,_i)=>{"use strict";var _=f(),Po=C(),oe=w(),$i=oe.style,Ci=oe.clear,be=oe.figures,Io=oe.wrap,To=oe.entriesToDisplay,$o=p(),Co=$o.cursor,Ye=class extends Po{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Ci("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].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
+ ${s?" ":Oo.pointerSmall} ${ve.red().italic(t)}`,"")),this.out.write(So.line+oe.to(0)+this.outputText+oe.save+this.outputError+oe.restore+oe.move(this.cursorOffset,0)))}};Pi.exports=Ye});var _i=u((bu,Ci)=>{"use strict";var _=f(),Mo=C(),he=x(),Ti=he.style,$i=he.clear,ye=he.figures,Po=he.wrap,Io=he.entriesToDisplay,To=p(),$o=To.cursor,Le=class extends Mo{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=$i("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].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
- `),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()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Co.hide):this.out.write(Ci(this.outputText,this.out.columns)),super.render();let e=To(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,s=e.endIndex;if(this.outputText=[$i.symbol(this.done,this.aborted),_.bold(this.msg),$i.delimiter(!1),this.done?this.selection.title:this.selection.disabled?_.yellow(this.warn):_.gray(this.hint)].join(" "),!this.done){this.outputText+=`
11
- `;for(let r=t;r<s;r++){let o,n,h="",l=this.choices[r];r===t&&t>0?n=be.arrowUp:r===s-1&&s<this.choices.length?n=be.arrowDown:n=" ",l.disabled?(o=this.cursor===r?_.gray().underline(l.title):_.strikethrough().gray(l.title),n=(this.cursor===r?_.bold().gray(be.pointer)+" ":" ")+n):(o=this.cursor===r?_.cyan().underline(l.title):l.title,n=(this.cursor===r?_.cyan(be.pointer)+" ":" ")+n,l.description&&this.cursor===r&&(h=` - ${l.description}`,(n.length+o.length+h.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(h=`
12
- `+Io(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${o}${_.gray(h)}
13
- `}}this.out.write(this.outputText)}};_i.exports=Ye});var Fi=u((wu,Ri)=>{"use strict";var ye=f(),_o=C(),Ei=w(),ji=Ei.style,Do=Ei.clear,Ai=p(),ki=Ai.cursor,jo=Ai.erase,Le=class extends _o{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.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(`
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()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write($o.hide):this.out.write($i(this.outputText,this.out.columns)),super.render();let e=Io(this.cursor,this.choices.length,this.optionsPerPage),t=e.startIndex,s=e.endIndex;if(this.outputText=[Ti.symbol(this.done,this.aborted),_.bold(this.msg),Ti.delimiter(!1),this.done?this.selection.title:this.selection.disabled?_.yellow(this.warn):_.gray(this.hint)].join(" "),!this.done){this.outputText+=`
11
+ `;for(let r=t;r<s;r++){let o,n,h="",l=this.choices[r];r===t&&t>0?n=ye.arrowUp:r===s-1&&s<this.choices.length?n=ye.arrowDown:n=" ",l.disabled?(o=this.cursor===r?_.gray().underline(l.title):_.strikethrough().gray(l.title),n=(this.cursor===r?_.bold().gray(ye.pointer)+" ":" ")+n):(o=this.cursor===r?_.cyan().underline(l.title):l.title,n=(this.cursor===r?_.cyan(ye.pointer)+" ":" ")+n,l.description&&this.cursor===r&&(h=` - ${l.description}`,(n.length+o.length+h.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(h=`
12
+ `+Po(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${o}${_.gray(h)}
13
+ `}}this.out.write(this.outputText)}};Ci.exports=Le});var Ri=u((yu,Ai)=>{"use strict";var we=f(),Co=C(),ki=x(),Di=ki.style,_o=ki.clear,Ei=p(),ji=Ei.cursor,Do=Ei.erase,Ne=class extends Co{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.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()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(ki.hide):this.out.write(Do(this.outputText,this.out.columns)),super.render(),this.outputText=[ji.symbol(this.done,this.aborted),ye.bold(this.msg),ji.delimiter(this.done),this.value?this.inactive:ye.cyan().underline(this.inactive),ye.gray("/"),this.value?ye.cyan().underline(this.active):this.active].join(" "),this.out.write(jo.line+ki.to(0)+this.outputText))}};Ri.exports=Le});var S=u((xu,Vi)=>{"use strict";var Ne=class i{constructor({token:e,date:t,parts:s,locales:r}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof i)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof i)}toString(){return String(this.date)}};Vi.exports=Ne});var Yi=u((Su,Hi)=>{"use strict";var ko=S(),Ue=class extends ko{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};Hi.exports=Ue});var Ni=u((qu,Li)=>{"use strict";var Eo=S(),Ao=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),Je=class extends Eo{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Ao(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};Li.exports=Je});var Ji=u((Ou,Ui)=>{"use strict";var Ro=S(),Ge=class extends Ro{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Ui.exports=Ge});var Bi=u((Mu,Gi)=>{"use strict";var Fo=S(),Be=class extends Fo{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Gi.exports=Be});var Zi=u((Pu,zi)=>{"use strict";var Vo=S(),ze=class extends Vo{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};zi.exports=ze});var Ki=u((Iu,Wi)=>{"use strict";var Ho=S(),Ze=class extends Ho{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Wi.exports=Ze});var Qi=u((Tu,Xi)=>{"use strict";var Yo=S(),We=class extends Yo{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Xi.exports=We});var ts=u(($u,es)=>{"use strict";var Lo=S(),Ke=class extends Lo{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};es.exports=Ke});var ss=u((Cu,is)=>{"use strict";is.exports={DatePart:S(),Meridiem:Yi(),Day:Ni(),Hours:Ji(),Milliseconds:Bi(),Minutes:Zi(),Month:Ki(),Seconds:Qi(),Year:ts()}});var fs=u((_u,ds)=>{"use strict";function rs(i,e,t,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function ns(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var o=i.apply(e,t);function n(l){rs(o,s,r,n,h,"next",l)}function h(l){rs(o,s,r,n,h,"throw",l)}n(void 0)})}}var Xe=f(),No=C(),et=w(),os=et.style,hs=et.clear,Uo=et.figures,cs=p(),Jo=cs.erase,ls=cs.cursor,D=ss(),us=D.DatePart,Go=D.Meridiem,Bo=D.Day,zo=D.Hours,Zo=D.Milliseconds,Wo=D.Minutes,Ko=D.Month,Xo=D.Seconds,Qo=D.Year,eh=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,as={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new Bo(i),3:i=>new Ko(i),4:i=>new Qo(i),5:i=>new Go(i),6:i=>new zo(i),7:i=>new Wo(i),8:i=>new Xo(i),9:i=>new Zo(i)},th={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(",")},Qe=class extends No{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(th,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=hs("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=eh.exec(e);){let r=t.shift(),o=t.findIndex(n=>n!=null);this.parts.push(o in as?as[o]({token:t[o]||r,date:this.date,parts:this.parts,locales:this.locales}):t[o]||r)}let s=this.parts.reduce((r,o)=>(typeof o=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=o:r.push(o),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof us)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
16
- `),this.close()}validate(){var e=this;return ns(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return ns(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
17
- `),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof us)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(ls.hide):this.out.write(hs(this.outputText,this.out.columns)),super.render(),this.outputText=[os.symbol(this.done,this.aborted),Xe.bold(this.msg),os.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?Xe.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
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()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(ji.hide):this.out.write(_o(this.outputText,this.out.columns)),super.render(),this.outputText=[Di.symbol(this.done,this.aborted),we.bold(this.msg),Di.delimiter(this.done),this.value?this.inactive:we.cyan().underline(this.inactive),we.gray("/"),this.value?we.cyan().underline(this.active):this.active].join(" "),this.out.write(Do.line+ji.to(0)+this.outputText))}};Ai.exports=Ne});var q=u((wu,Fi)=>{"use strict";var Ue=class i{constructor({token:e,date:t,parts:s,locales:r}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof i)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof i)}toString(){return String(this.date)}};Fi.exports=Ue});var Hi=u((xu,Vi)=>{"use strict";var jo=q(),Je=class extends jo{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};Vi.exports=Je});var Li=u((Su,Yi)=>{"use strict";var ko=q(),Eo=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),Ge=class extends ko{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Eo(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};Yi.exports=Ge});var Ui=u((qu,Ni)=>{"use strict";var Ao=q(),Be=class extends Ao{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Ni.exports=Be});var Gi=u((Ou,Ji)=>{"use strict";var Ro=q(),ze=class extends Ro{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Ji.exports=ze});var zi=u((Mu,Bi)=>{"use strict";var Fo=q(),Ze=class extends Fo{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Bi.exports=Ze});var Wi=u((Pu,Zi)=>{"use strict";var Vo=q(),We=class extends Vo{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Zi.exports=We});var Xi=u((Iu,Ki)=>{"use strict";var Ho=q(),Ke=class extends Ho{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Ki.exports=Ke});var es=u((Tu,Qi)=>{"use strict";var Yo=q(),Xe=class extends Yo{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Qi.exports=Xe});var is=u(($u,ts)=>{"use strict";ts.exports={DatePart:q(),Meridiem:Hi(),Day:Li(),Hours:Ui(),Milliseconds:Gi(),Minutes:zi(),Month:Wi(),Seconds:Xi(),Year:es()}});var ds=u((Cu,cs)=>{"use strict";function ss(i,e,t,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function rs(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var o=i.apply(e,t);function n(l){ss(o,s,r,n,h,"next",l)}function h(l){ss(o,s,r,n,h,"throw",l)}n(void 0)})}}var Qe=f(),Lo=C(),tt=x(),ns=tt.style,os=tt.clear,No=tt.figures,as=p(),Uo=as.erase,hs=as.cursor,D=is(),ls=D.DatePart,Jo=D.Meridiem,Go=D.Day,Bo=D.Hours,zo=D.Milliseconds,Zo=D.Minutes,Wo=D.Month,Ko=D.Seconds,Xo=D.Year,Qo=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,us={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new Go(i),3:i=>new Wo(i),4:i=>new Xo(i),5:i=>new Jo(i),6:i=>new Bo(i),7:i=>new Zo(i),8:i=>new Ko(i),9:i=>new zo(i)},eh={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(",")},et=class extends Lo{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(eh,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=os("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=Qo.exec(e);){let r=t.shift(),o=t.findIndex(n=>n!=null);this.parts.push(o in us?us[o]({token:t[o]||r,date:this.date,parts:this.parts,locales:this.locales}):t[o]||r)}let s=this.parts.reduce((r,o)=>(typeof o=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=o:r.push(o),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof ls)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
16
+ `),this.close()}validate(){var e=this;return rs(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return rs(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
17
+ `),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof ls)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(hs.hide):this.out.write(os(this.outputText,this.out.columns)),super.render(),this.outputText=[ns.symbol(this.done,this.aborted),Qe.bold(this.msg),ns.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?Qe.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
18
18
  `).reduce((e,t,s)=>e+`
19
- ${s?" ":Uo.pointerSmall} ${Xe.red().italic(t)}`,"")),this.out.write(Jo.line+ls.to(0)+this.outputText))}};ds.exports=Qe});var ws=u((Du,ys)=>{"use strict";function ps(i,e,t,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function ms(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var o=i.apply(e,t);function n(l){ps(o,s,r,n,h,"next",l)}function h(l){ps(o,s,r,n,h,"throw",l)}n(void 0)})}}var we=f(),ih=C(),bs=p(),xe=bs.cursor,sh=bs.erase,Se=w(),tt=Se.style,rh=Se.figures,gs=Se.clear,nh=Se.lines,oh=/[0-9]/,it=i=>i!==void 0,vs=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},st=class extends ih{constructor(e={}){super(e),this.transform=tt.render(e.style),this.msg=e.message,this.initial=it(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=it(e.min)?e.min:-1/0,this.max=it(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=we.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${vs(e,this.round)}`),this._value=vs(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||oh.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
20
- `),this.close()}validate(){var e=this;return ms(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return ms(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let t=e.value;e.value=t!==""?t:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
21
- `),e.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 e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.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()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")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(xe.down(nh(this.outputError,this.out.columns)-1)+gs(this.outputError,this.out.columns)),this.out.write(gs(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[tt.symbol(this.done,this.aborted),we.bold(this.msg),tt.delimiter(this.done),!this.done||!this.done&&!this.placeholder?we[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
19
+ ${s?" ":No.pointerSmall} ${Qe.red().italic(t)}`,"")),this.out.write(Uo.line+hs.to(0)+this.outputText))}};cs.exports=et});var ys=u((_u,bs)=>{"use strict";function fs(i,e,t,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function ps(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var o=i.apply(e,t);function n(l){fs(o,s,r,n,h,"next",l)}function h(l){fs(o,s,r,n,h,"throw",l)}n(void 0)})}}var xe=f(),th=C(),vs=p(),Se=vs.cursor,ih=vs.erase,qe=x(),it=qe.style,sh=qe.figures,ms=qe.clear,rh=qe.lines,nh=/[0-9]/,st=i=>i!==void 0,gs=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},rt=class extends th{constructor(e={}){super(e),this.transform=it.render(e.style),this.msg=e.message,this.initial=st(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=st(e.min)?e.min:-1/0,this.max=st(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=xe.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${gs(e,this.round)}`),this._value=gs(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||nh.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
20
+ `),this.close()}validate(){var e=this;return ps(function*(){let t=yield e.validator(e.value);typeof t=="string"&&(e.errorMsg=t,t=!1),e.error=!t})()}submit(){var e=this;return ps(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let t=e.value;e.value=t!==""?t:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
21
+ `),e.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 e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.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()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")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(Se.down(rh(this.outputError,this.out.columns)-1)+ms(this.outputError,this.out.columns)),this.out.write(ms(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[it.symbol(this.done,this.aborted),xe.bold(this.msg),it.delimiter(this.done),!this.done||!this.done&&!this.placeholder?xe[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
22
22
  `).reduce((e,t,s)=>e+`
23
- ${s?" ":rh.pointerSmall} ${we.red().italic(t)}`,"")),this.out.write(sh.line+xe.to(0)+this.outputText+xe.save+this.outputError+xe.restore))}};ys.exports=st});var nt=u((ju,qs)=>{"use strict";var q=f(),hh=p(),lh=hh.cursor,uh=C(),he=w(),xs=he.clear,F=he.figures,Ss=he.style,ah=he.wrap,ch=he.entriesToDisplay,rt=class extends uh{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=xs("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
23
+ ${s?" ":sh.pointerSmall} ${xe.red().italic(t)}`,"")),this.out.write(ih.line+Se.to(0)+this.outputText+Se.save+this.outputError+Se.restore))}};bs.exports=rt});var ot=u((Du,Ss)=>{"use strict";var O=f(),oh=p(),hh=oh.cursor,lh=C(),le=x(),ws=le.clear,V=le.figures,xs=le.style,uh=le.wrap,ah=le.entriesToDisplay,nt=class extends lh{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=ws("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
24
24
  `),this.close()}submit(){let e=this.value.filter(t=>t.selected);this.minSelected&&e.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(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(t=>!t.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
26
26
  Instructions:
27
- ${F.arrowUp}/${F.arrowDown}: Highlight option
28
- ${F.arrowLeft}/${F.arrowRight}/[space]: Toggle selection
27
+ ${V.arrowUp}/${V.arrowDown}: Highlight option
28
+ ${V.arrowLeft}/${V.arrowRight}/[space]: Toggle selection
29
29
  `+(this.maxChoices===void 0?` a: Toggle all
30
- `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,r){let o=(t.selected?q.green(F.radioOn):F.radioOff)+" "+r+" ",n,h;return t.disabled?n=e===s?q.gray().underline(t.title):q.strikethrough().gray(t.title):(n=e===s?q.cyan().underline(t.title):t.title,e===s&&t.description&&(h=` - ${t.description}`,(o.length+n.length+h.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(h=`
31
- `+ah(t.description,{margin:o.length,width:this.out.columns})))),o+n+q.gray(h||"")}paginateOptions(e){if(e.length===0)return q.red("No matches for this query.");let t=ch(this.cursor,e.length,this.optionsPerPage),s=t.startIndex,r=t.endIndex,o,n=[];for(let h=s;h<r;h++)h===s&&s>0?o=F.arrowUp:h===r-1&&r<e.length?o=F.arrowDown:o=" ",n.push(this.renderOption(this.cursor,e[h],h,o));return`
30
+ `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,r){let o=(t.selected?O.green(V.radioOn):V.radioOff)+" "+r+" ",n,h;return t.disabled?n=e===s?O.gray().underline(t.title):O.strikethrough().gray(t.title):(n=e===s?O.cyan().underline(t.title):t.title,e===s&&t.description&&(h=` - ${t.description}`,(o.length+n.length+h.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(h=`
31
+ `+uh(t.description,{margin:o.length,width:this.out.columns})))),o+n+O.gray(h||"")}paginateOptions(e){if(e.length===0)return O.red("No matches for this query.");let t=ah(this.cursor,e.length,this.optionsPerPage),s=t.startIndex,r=t.endIndex,o,n=[];for(let h=s;h<r;h++)h===s&&s>0?o=V.arrowUp:h===r-1&&r<e.length?o=V.arrowDown:o=" ",n.push(this.renderOption(this.cursor,e[h],h,o));return`
32
32
  `+n.join(`
33
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[q.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(q.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(lh.hide),super.render();let e=[Ss.symbol(this.done,this.aborted),q.bold(this.msg),Ss.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=q.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=xs(e,this.out.columns)}};qs.exports=rt});var Cs=u((ku,$s)=>{"use strict";function Os(i,e,t,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function dh(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var o=i.apply(e,t);function n(l){Os(o,s,r,n,h,"next",l)}function h(l){Os(o,s,r,n,h,"throw",l)}n(void 0)})}}var le=f(),fh=C(),Ts=p(),ph=Ts.erase,Ms=Ts.cursor,ue=w(),ot=ue.style,Ps=ue.clear,ht=ue.figures,mh=ue.wrap,gh=ue.entriesToDisplay,Is=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),vh=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),bh=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},lt=class extends fh{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:bh(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=ot.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Ps("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=Is(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return dh(function*(){let s=t.completing=t.suggest(t.input,t.choices),r=yield s;if(t.completing!==s)return;t.suggestions=r.map((n,h,l)=>({title:vh(l,h),value:Is(l,h),description:n.description})),t.completing=!1;let o=Math.max(r.length-1,0);t.moveSelect(Math.min(o,t.select)),e&&e()})()}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(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[O.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(O.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(hh.hide),super.render();let e=[xs.symbol(this.done,this.aborted),O.bold(this.msg),xs.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=O.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=ws(e,this.out.columns)}};Ss.exports=nt});var $s=u((ju,Ts)=>{"use strict";function qs(i,e,t,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function ch(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var o=i.apply(e,t);function n(l){qs(o,s,r,n,h,"next",l)}function h(l){qs(o,s,r,n,h,"throw",l)}n(void 0)})}}var ue=f(),dh=C(),Is=p(),fh=Is.erase,Os=Is.cursor,ae=x(),ht=ae.style,Ms=ae.clear,lt=ae.figures,ph=ae.wrap,mh=ae.entriesToDisplay,Ps=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),gh=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),vh=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},ut=class extends dh{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:vh(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=ht.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Ms("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=Ps(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var t=this;return ch(function*(){let s=t.completing=t.suggest(t.input,t.choices),r=yield s;if(t.completing!==s)return;t.suggestions=r.map((n,h,l)=>({title:gh(l,h),value:Ps(l,h),description:n.description})),t.completing=!1;let o=Math.max(r.length-1,0);t.moveSelect(Math.min(o,t.select)),e&&e()})()}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
- `),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${s}${e}${r}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,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(e,t,s,r){let o,n=s?ht.arrowUp:r?ht.arrowDown:" ",h=t?le.cyan().underline(e.title):e.title;return n=(t?le.cyan(ht.pointer)+" ":" ")+n,e.description&&(o=` - ${e.description}`,(n.length+h.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
37
- `+mh(e.description,{margin:3,width:this.out.columns}))),n+" "+h+le.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Ms.hide):this.out.write(Ps(this.outputText,this.out.columns)),super.render();let e=gh(this.select,this.choices.length,this.limit),t=e.startIndex,s=e.endIndex;if(this.outputText=[ot.symbol(this.done,this.aborted,this.exited),le.bold(this.msg),ot.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let r=this.suggestions.slice(t,s).map((o,n)=>this.renderOption(o,this.select===n+t,n===0&&t>0,n+t===s-1&&s<this.choices.length)).join(`
36
+ `),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${s}${e}${r}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,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(e,t,s,r){let o,n=s?lt.arrowUp:r?lt.arrowDown:" ",h=t?ue.cyan().underline(e.title):e.title;return n=(t?ue.cyan(lt.pointer)+" ":" ")+n,e.description&&(o=` - ${e.description}`,(n.length+h.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
37
+ `+ph(e.description,{margin:3,width:this.out.columns}))),n+" "+h+ue.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Os.hide):this.out.write(Ms(this.outputText,this.out.columns)),super.render();let e=mh(this.select,this.choices.length,this.limit),t=e.startIndex,s=e.endIndex;if(this.outputText=[ht.symbol(this.done,this.aborted,this.exited),ue.bold(this.msg),ht.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let r=this.suggestions.slice(t,s).map((o,n)=>this.renderOption(o,this.select===n+t,n===0&&t>0,n+t===s-1&&s<this.choices.length)).join(`
38
38
  `);this.outputText+=`
39
- `+(r||le.gray(this.fallback.title))}this.out.write(ph.line+Ms.to(0)+this.outputText)}};$s.exports=lt});var ks=u((Eu,js)=>{"use strict";var j=f(),yh=p(),wh=yh.cursor,xh=nt(),at=w(),_s=at.clear,Ds=at.style,X=at.figures,ut=class extends xh{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=_s("",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(e=>e.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(){let e=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);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
39
+ `+(r||ue.gray(this.fallback.title))}this.out.write(fh.line+Os.to(0)+this.outputText)}};Ts.exports=ut});var js=u((ku,Ds)=>{"use strict";var j=f(),bh=p(),yh=bh.cursor,wh=ot(),ct=x(),Cs=ct.clear,_s=ct.style,Q=ct.figures,at=class extends wh{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=Cs("",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(e=>e.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(){let e=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);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
40
40
  Instructions:
41
- ${X.arrowUp}/${X.arrowDown}: Highlight option
42
- ${X.arrowLeft}/${X.arrowRight}/[space]: Toggle selection
41
+ ${Q.arrowUp}/${Q.arrowDown}: Highlight option
42
+ ${Q.arrowLeft}/${Q.arrowRight}/[space]: Toggle selection
43
43
  [a,b,c]/delete: Filter choices
44
44
  enter/return: Complete answer
45
45
  `:""}renderCurrentInput(){return`
46
46
  Filtered results for: ${this.inputValue?this.inputValue:j.gray("Enter something to filter")}
47
- `}renderOption(e,t,s){let r;return t.disabled?r=e===s?j.gray().underline(t.title):j.strikethrough().gray(t.title):r=e===s?j.cyan().underline(t.title):t.title,(t.selected?j.green(X.radioOn):X.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[j.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(j.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(wh.hide),super.render();let e=[Ds.symbol(this.done,this.aborted),j.bold(this.msg),Ds.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=j.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=_s(e,this.out.columns)}};js.exports=ut});var Ys=u((Au,Hs)=>{"use strict";var Es=f(),Sh=C(),Fs=w(),As=Fs.style,qh=Fs.clear,Vs=p(),Oh=Vs.erase,Rs=Vs.cursor,ct=class extends Sh{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.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(e,t,s){let r;return t.disabled?r=e===s?j.gray().underline(t.title):j.strikethrough().gray(t.title):r=e===s?j.cyan().underline(t.title):t.title,(t.selected?j.green(Q.radioOn):Q.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[j.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(j.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(yh.hide),super.render();let e=[_s.symbol(this.done,this.aborted),j.bold(this.msg),_s.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=j.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Cs(e,this.out.columns)}};Ds.exports=at});var Hs=u((Eu,Vs)=>{"use strict";var ks=f(),xh=C(),Rs=x(),Es=Rs.style,Sh=Rs.clear,Fs=p(),qh=Fs.erase,As=Fs.cursor,dt=class extends xh{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.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()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Rs.hide):this.out.write(qh(this.outputText,this.out.columns)),super.render(),this.outputText=[As.symbol(this.done,this.aborted),Es.bold(this.msg),As.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Es.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Oh.line+Rs.to(0)+this.outputText))}};Hs.exports=ct});var Ns=u((Ru,Ls)=>{"use strict";Ls.exports={TextPrompt:Ti(),SelectPrompt:Di(),TogglePrompt:Fi(),DatePrompt:fs(),NumberPrompt:ws(),MultiselectPrompt:nt(),AutocompletePrompt:Cs(),AutocompleteMultiselectPrompt:ks(),ConfirmPrompt:Ys()}});var Js=u(Us=>{"use strict";var v=Us,Mh=Ns(),qe=i=>i;function O(i,e,t={}){return new Promise((s,r)=>{let o=new Mh[i](e),n=t.onAbort||qe,h=t.onSubmit||qe,l=t.onExit||qe;o.on("state",e.onState||qe),o.on("submit",a=>s(h(a))),o.on("exit",a=>s(l(a))),o.on("abort",a=>r(n(a)))})}v.text=i=>O("TextPrompt",i);v.password=i=>(i.style="password",v.text(i));v.invisible=i=>(i.style="invisible",v.text(i));v.number=i=>O("NumberPrompt",i);v.date=i=>O("DatePrompt",i);v.confirm=i=>O("ConfirmPrompt",i);v.list=i=>{let e=i.separator||",";return O("TextPrompt",i,{onSubmit:t=>t.split(e).map(s=>s.trim())})};v.toggle=i=>O("TogglePrompt",i);v.select=i=>O("SelectPrompt",i);v.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return O("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};v.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return O("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var Ph=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));v.autocomplete=i=>(i.suggest=i.suggest||Ph,i.choices=[].concat(i.choices||[]),O("AutocompletePrompt",i))});var Qs=u((Vu,Xs)=>{"use strict";function Gs(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,s)}return t}function Bs(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gs(Object(t),!0).forEach(function(s){Ih(i,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Gs(Object(t)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))})}return i}function Ih(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Th(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=$h(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}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 o=!0,n=!1,h;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return o=a.done,a},e:function(a){n=!0,h=a},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(n)throw h}}}}function $h(i,e){if(i){if(typeof i=="string")return zs(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return zs(i,e)}}function zs(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}function Zs(i,e,t,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Ws(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var o=i.apply(e,t);function n(l){Zs(o,s,r,n,h,"next",l)}function h(l){Zs(o,s,r,n,h,"throw",l)}n(void 0)})}}var dt=Js(),Ch=["suggest","format","onState","validate","onRender","type"],Ks=()=>{};function V(){return ft.apply(this,arguments)}function ft(){return ft=Ws(function*(i=[],{onSubmit:e=Ks,onCancel:t=Ks}={}){let s={},r=V._override||{};i=[].concat(i);let o,n,h,l,a,z,Z=(function(){var y=Ws(function*(T,pe,zt=!1){if(!(!zt&&T.validate&&T.validate(pe)!==!0))return T.format?yield T.format(pe,s):pe});return function(pe,zt){return y.apply(this,arguments)}})();var m=Th(i),g;try{for(m.s();!(g=m.n()).done;){n=g.value;var N=n;if(l=N.name,a=N.type,typeof a=="function"&&(a=yield a(o,Bs({},s),n),n.type=a),!!a){for(let y in n){if(Ch.includes(y))continue;let T=n[y];n[y]=typeof T=="function"?yield T(o,Bs({},s),z):T}if(z=n,typeof n.message!="string")throw new Error("prompt message is required");var U=n;if(l=U.name,a=U.type,dt[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[n.name]!==void 0&&(o=yield Z(n,r[n.name]),o!==void 0)){s[l]=o;continue}try{o=V._injected?_h(V._injected,n.initial):yield dt[a](n),s[l]=o=yield Z(n,o,!0),h=yield e(n,o,s)}catch{h=!(yield t(n,s))}if(h)return s}}}catch(y){m.e(y)}finally{m.f()}return s}),ft.apply(this,arguments)}function _h(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function Dh(i){V._injected=(V._injected||[]).concat(i)}function jh(i){V._override=Object.assign({},i)}Xs.exports=Object.assign(V,{prompt:V,prompts:dt,inject:Dh,override:jh})});var tr=u((Hu,er)=>{"use strict";er.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var Oe=u((Yu,ir)=>{"use strict";ir.exports=i=>{let e=["[\\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("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var nr=u((Lu,rr)=>{"use strict";var kh=Oe(),{erase:sr,cursor:Eh}=p(),Ah=i=>[...kh(i)].length;rr.exports=function(i,e){if(!e)return sr.line+Eh.to(0);let t=0,s=i.split(/\r?\n/);for(let r of s)t+=1+Math.floor(Math.max(Ah(r)-1,0)/e);return sr.lines(t)}});var pt=u((Nu,or)=>{"use strict";var ae={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Rh={arrowUp:ae.arrowUp,arrowDown:ae.arrowDown,arrowLeft:ae.arrowLeft,arrowRight:ae.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Fh=process.platform==="win32"?Rh:ae;or.exports=Fh});var lr=u((Uu,hr)=>{"use strict";var Q=f(),B=pt(),mt=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),Vh=i=>mt[i]||mt.default,ce=Object.freeze({aborted:Q.red(B.cross),done:Q.green(B.tick),exited:Q.yellow(B.cross),default:Q.cyan("?")}),Hh=(i,e,t)=>e?ce.aborted:t?ce.exited:i?ce.done:ce.default,Yh=i=>Q.gray(i?B.ellipsis:B.pointerSmall),Lh=(i,e)=>Q.gray(i?e?B.pointerSmall:"+":B.line);hr.exports={styles:mt,render:Vh,symbols:ce,symbol:Hh,delimiter:Yh,item:Lh}});var ar=u((Ju,ur)=>{"use strict";var Nh=Oe();ur.exports=function(i,e){let t=String(Nh(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var dr=u((Gu,cr)=>{"use strict";cr.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((o,n)=>(n.length+t.length>=s||o[o.length-1].length+n.length+1<s?o[o.length-1]+=` ${n}`:o.push(`${t}${n}`),o),[t]).join(`
49
+ `),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(As.hide):this.out.write(Sh(this.outputText,this.out.columns)),super.render(),this.outputText=[Es.symbol(this.done,this.aborted),ks.bold(this.msg),Es.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:ks.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(qh.line+As.to(0)+this.outputText))}};Vs.exports=dt});var Ls=u((Au,Ys)=>{"use strict";Ys.exports={TextPrompt:Ii(),SelectPrompt:_i(),TogglePrompt:Ri(),DatePrompt:ds(),NumberPrompt:ys(),MultiselectPrompt:ot(),AutocompletePrompt:$s(),AutocompleteMultiselectPrompt:js(),ConfirmPrompt:Hs()}});var Us=u(Ns=>{"use strict";var v=Ns,Oh=Ls(),Oe=i=>i;function M(i,e,t={}){return new Promise((s,r)=>{let o=new Oh[i](e),n=t.onAbort||Oe,h=t.onSubmit||Oe,l=t.onExit||Oe;o.on("state",e.onState||Oe),o.on("submit",a=>s(h(a))),o.on("exit",a=>s(l(a))),o.on("abort",a=>r(n(a)))})}v.text=i=>M("TextPrompt",i);v.password=i=>(i.style="password",v.text(i));v.invisible=i=>(i.style="invisible",v.text(i));v.number=i=>M("NumberPrompt",i);v.date=i=>M("DatePrompt",i);v.confirm=i=>M("ConfirmPrompt",i);v.list=i=>{let e=i.separator||",";return M("TextPrompt",i,{onSubmit:t=>t.split(e).map(s=>s.trim())})};v.toggle=i=>M("TogglePrompt",i);v.select=i=>M("SelectPrompt",i);v.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return M("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};v.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return M("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var Mh=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));v.autocomplete=i=>(i.suggest=i.suggest||Mh,i.choices=[].concat(i.choices||[]),M("AutocompletePrompt",i))});var Xs=u((Fu,Ks)=>{"use strict";function Js(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,s)}return t}function Gs(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Js(Object(t),!0).forEach(function(s){Ph(i,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Js(Object(t)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(t,s))})}return i}function Ph(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Ih(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=Th(i))||e&&i&&typeof i.length=="number"){t&&(i=t);var s=0,r=function(){};return{s:r,n:function(){return s>=i.length?{done:!0}:{done:!1,value:i[s++]}},e:function(a){throw a},f:r}}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 o=!0,n=!1,h;return{s:function(){t=t.call(i)},n:function(){var a=t.next();return o=a.done,a},e:function(a){n=!0,h=a},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(n)throw h}}}}function Th(i,e){if(i){if(typeof i=="string")return Bs(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Bs(i,e)}}function Bs(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=i[t];return s}function zs(i,e,t,s,r,o,n){try{var h=i[o](n),l=h.value}catch(a){t(a);return}h.done?e(l):Promise.resolve(l).then(s,r)}function Zs(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var o=i.apply(e,t);function n(l){zs(o,s,r,n,h,"next",l)}function h(l){zs(o,s,r,n,h,"throw",l)}n(void 0)})}}var ft=Us(),$h=["suggest","format","onState","validate","onRender","type"],Ws=()=>{};function H(){return pt.apply(this,arguments)}function pt(){return pt=Zs(function*(i=[],{onSubmit:e=Ws,onCancel:t=Ws}={}){let s={},r=H._override||{};i=[].concat(i);let o,n,h,l,a,Z,W=(function(){var w=Zs(function*($,me,Zt=!1){if(!(!Zt&&$.validate&&$.validate(me)!==!0))return $.format?yield $.format(me,s):me});return function(me,Zt){return w.apply(this,arguments)}})();var m=Ih(i),g;try{for(m.s();!(g=m.n()).done;){n=g.value;var U=n;if(l=U.name,a=U.type,typeof a=="function"&&(a=yield a(o,Gs({},s),n),n.type=a),!!a){for(let w in n){if($h.includes(w))continue;let $=n[w];n[w]=typeof $=="function"?yield $(o,Gs({},s),Z):$}if(Z=n,typeof n.message!="string")throw new Error("prompt message is required");var J=n;if(l=J.name,a=J.type,ft[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[n.name]!==void 0&&(o=yield W(n,r[n.name]),o!==void 0)){s[l]=o;continue}try{o=H._injected?Ch(H._injected,n.initial):yield ft[a](n),s[l]=o=yield W(n,o,!0),h=yield e(n,o,s)}catch{h=!(yield t(n,s))}if(h)return s}}}catch(w){m.e(w)}finally{m.f()}return s}),pt.apply(this,arguments)}function Ch(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function _h(i){H._injected=(H._injected||[]).concat(i)}function Dh(i){H._override=Object.assign({},i)}Ks.exports=Object.assign(H,{prompt:H,prompts:ft,inject:_h,override:Dh})});var er=u((Vu,Qs)=>{"use strict";Qs.exports=(i,e)=>{if(!(i.meta&&i.name!=="escape")){if(i.ctrl){if(i.name==="a")return"first";if(i.name==="c"||i.name==="d")return"abort";if(i.name==="e")return"last";if(i.name==="g")return"reset"}if(e){if(i.name==="j")return"down";if(i.name==="k")return"up"}return i.name==="return"||i.name==="enter"?"submit":i.name==="backspace"?"delete":i.name==="delete"?"deleteForward":i.name==="abort"?"abort":i.name==="escape"?"exit":i.name==="tab"?"next":i.name==="pagedown"?"nextPage":i.name==="pageup"?"prevPage":i.name==="home"?"home":i.name==="end"?"end":i.name==="up"?"up":i.name==="down"?"down":i.name==="right"?"right":i.name==="left"?"left":!1}}});var Me=u((Hu,tr)=>{"use strict";tr.exports=i=>{let e=["[\\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("|"),t=new RegExp(e,"g");return typeof i=="string"?i.replace(t,""):i}});var rr=u((Yu,sr)=>{"use strict";var jh=Me(),{erase:ir,cursor:kh}=p(),Eh=i=>[...jh(i)].length;sr.exports=function(i,e){if(!e)return ir.line+kh.to(0);let t=0,s=i.split(/\r?\n/);for(let r of s)t+=1+Math.floor(Math.max(Eh(r)-1,0)/e);return ir.lines(t)}});var mt=u((Lu,nr)=>{"use strict";var ce={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Ah={arrowUp:ce.arrowUp,arrowDown:ce.arrowDown,arrowLeft:ce.arrowLeft,arrowRight:ce.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Rh=process.platform==="win32"?Ah:ce;nr.exports=Rh});var hr=u((Nu,or)=>{"use strict";var ee=f(),z=mt(),gt=Object.freeze({password:{scale:1,render:i=>"*".repeat(i.length)},emoji:{scale:2,render:i=>"\u{1F603}".repeat(i.length)},invisible:{scale:0,render:i=>""},default:{scale:1,render:i=>`${i}`}}),Fh=i=>gt[i]||gt.default,de=Object.freeze({aborted:ee.red(z.cross),done:ee.green(z.tick),exited:ee.yellow(z.cross),default:ee.cyan("?")}),Vh=(i,e,t)=>e?de.aborted:t?de.exited:i?de.done:de.default,Hh=i=>ee.gray(i?z.ellipsis:z.pointerSmall),Yh=(i,e)=>ee.gray(i?e?z.pointerSmall:"+":z.line);or.exports={styles:gt,render:Fh,symbols:de,symbol:Vh,delimiter:Hh,item:Yh}});var ur=u((Uu,lr)=>{"use strict";var Lh=Me();lr.exports=function(i,e){let t=String(Lh(i)||"").split(/\r?\n/);return e?t.map(s=>Math.ceil(s.length/e)).reduce((s,r)=>s+r):t.length}});var cr=u((Ju,ar)=>{"use strict";ar.exports=(i,e={})=>{let t=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",s=e.width;return(i||"").split(/\r?\n/g).map(r=>r.split(/\s+/g).reduce((o,n)=>(n.length+t.length>=s||o[o.length-1].length+n.length+1<s?o[o.length-1]+=` ${n}`:o.push(`${t}${n}`),o),[t]).join(`
51
51
  `)).join(`
52
- `)}});var pr=u((Bu,fr)=>{"use strict";fr.exports=(i,e,t)=>{t=t||e;let s=Math.min(e-t,i-Math.floor(t/2));s<0&&(s=0);let r=Math.min(s+t,e);return{startIndex:s,endIndex:r}}});var x=u((zu,mr)=>{"use strict";mr.exports={action:tr(),clear:nr(),style:lr(),strip:Oe(),figures:pt(),lines:ar(),wrap:dr(),entriesToDisplay:pr()}});var k=u((Zu,vr)=>{"use strict";var gr=require("readline"),{action:Uh}=x(),Jh=require("events"),{beep:Gh,cursor:Bh}=p(),zh=f(),gt=class extends Jh{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=gr.createInterface({input:this.in,escapeCodeTimeout:50});gr.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(o,n)=>{let h=Uh(n,s);h===!1?this._&&this._(o,n):typeof this[h]=="function"?this[h](n):this.bell()};this.close=()=>{this.out.write(Bh.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Gh)}render(){this.onRender(zh),this.firstRender&&(this.firstRender=!1)}};vr.exports=gt});var yr=u((Wu,br)=>{var Me=f(),Zh=k(),{erase:Wh,cursor:de}=p(),{style:vt,clear:bt,lines:Kh,figures:Xh}=x(),yt=class extends Zh{constructor(e={}){super(e),this.transform=vt.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=bt("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Me.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,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
+ `)}});var fr=u((Gu,dr)=>{"use strict";dr.exports=(i,e,t)=>{t=t||e;let s=Math.min(e-t,i-Math.floor(t/2));s<0&&(s=0);let r=Math.min(s+t,e);return{startIndex:s,endIndex:r}}});var S=u((Bu,pr)=>{"use strict";pr.exports={action:er(),clear:rr(),style:hr(),strip:Me(),figures:mt(),lines:ur(),wrap:cr(),entriesToDisplay:fr()}});var k=u((zu,gr)=>{"use strict";var mr=require("readline"),{action:Nh}=S(),Uh=require("events"),{beep:Jh,cursor:Gh}=p(),Bh=f(),vt=class extends Uh{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let t=mr.createInterface({input:this.in,escapeCodeTimeout:50});mr.emitKeypressEvents(this.in,t),this.in.isTTY&&this.in.setRawMode(!0);let s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,r=(o,n)=>{let h=Nh(n,s);h===!1?this._&&this._(o,n):typeof this[h]=="function"?this[h](n):this.bell()};this.close=()=>{this.out.write(Gh.show),this.in.removeListener("keypress",r),this.in.isTTY&&this.in.setRawMode(!1),t.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",r)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Jh)}render(){this.onRender(Bh),this.firstRender&&(this.firstRender=!1)}};gr.exports=vt});var br=u((Zu,vr)=>{var Pe=f(),zh=k(),{erase:Zh,cursor:fe}=p(),{style:bt,clear:yt,lines:Wh,figures:Kh}=S(),wt=class extends zh{constructor(e={}){super(e),this.transform=bt.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=yt("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Pe.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,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 e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}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
- `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,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 e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,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(de.down(Kh(this.outputError,this.out.columns)-1)+bt(this.outputError,this.out.columns)),this.out.write(bt(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[vt.symbol(this.done,this.aborted),Me.bold(this.msg),vt.delimiter(this.done),this.red?Me.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
54
+ `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let s=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${s}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:s.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,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 e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,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(fe.down(Wh(this.outputError,this.out.columns)-1)+yt(this.outputError,this.out.columns)),this.out.write(yt(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[bt.symbol(this.done,this.aborted),Pe.bold(this.msg),bt.delimiter(this.done),this.red?Pe.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
55
55
  `).reduce((e,t,s)=>e+`
56
- ${s?" ":Xh.pointerSmall} ${Me.red().italic(t)}`,"")),this.out.write(Wh.line+de.to(0)+this.outputText+de.save+this.outputError+de.restore+de.move(this.cursorOffset,0)))}};br.exports=yt});var qr=u((Ku,Sr)=>{"use strict";var E=f(),Qh=k(),{style:wr,clear:xr,figures:Pe,wrap:el,entriesToDisplay:tl}=x(),{cursor:il}=p(),wt=class extends Qh{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=xr("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].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
+ ${s?" ":Kh.pointerSmall} ${Pe.red().italic(t)}`,"")),this.out.write(Zh.line+fe.to(0)+this.outputText+fe.save+this.outputError+fe.restore+fe.move(this.cursorOffset,0)))}};vr.exports=wt});var Sr=u((Wu,xr)=>{"use strict";var E=f(),Xh=k(),{style:yr,clear:wr,figures:Ie,wrap:Qh,entriesToDisplay:el}=S(),{cursor:tl}=p(),xt=class extends Xh{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),value:t&&(t.value===void 0?s:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=wr("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].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
- `),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()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(il.hide):this.out.write(xr(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=tl(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[wr.symbol(this.done,this.aborted),E.bold(this.msg),wr.delimiter(!1),this.done?this.selection.title:this.selection.disabled?E.yellow(this.warn):E.gray(this.hint)].join(" "),!this.done){this.outputText+=`
59
- `;for(let s=e;s<t;s++){let r,o,n="",h=this.choices[s];s===e&&e>0?o=Pe.arrowUp:s===t-1&&t<this.choices.length?o=Pe.arrowDown:o=" ",h.disabled?(r=this.cursor===s?E.gray().underline(h.title):E.strikethrough().gray(h.title),o=(this.cursor===s?E.bold().gray(Pe.pointer)+" ":" ")+o):(r=this.cursor===s?E.cyan().underline(h.title):h.title,o=(this.cursor===s?E.cyan(Pe.pointer)+" ":" ")+o,h.description&&this.cursor===s&&(n=` - ${h.description}`,(o.length+r.length+n.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(n=`
60
- `+el(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${r}${E.gray(n)}
61
- `}}this.out.write(this.outputText)}};Sr.exports=wt});var Ir=u((Xu,Pr)=>{var Ie=f(),sl=k(),{style:Or,clear:rl}=x(),{cursor:Mr,erase:nl}=p(),xt=class extends sl{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.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(`
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()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(tl.hide):this.out.write(wr(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=el(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[yr.symbol(this.done,this.aborted),E.bold(this.msg),yr.delimiter(!1),this.done?this.selection.title:this.selection.disabled?E.yellow(this.warn):E.gray(this.hint)].join(" "),!this.done){this.outputText+=`
59
+ `;for(let s=e;s<t;s++){let r,o,n="",h=this.choices[s];s===e&&e>0?o=Ie.arrowUp:s===t-1&&t<this.choices.length?o=Ie.arrowDown:o=" ",h.disabled?(r=this.cursor===s?E.gray().underline(h.title):E.strikethrough().gray(h.title),o=(this.cursor===s?E.bold().gray(Ie.pointer)+" ":" ")+o):(r=this.cursor===s?E.cyan().underline(h.title):h.title,o=(this.cursor===s?E.cyan(Ie.pointer)+" ":" ")+o,h.description&&this.cursor===s&&(n=` - ${h.description}`,(o.length+r.length+n.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(n=`
60
+ `+Qh(h.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${r}${E.gray(n)}
61
+ `}}this.out.write(this.outputText)}};xr.exports=xt});var Pr=u((Ku,Mr)=>{var Te=f(),il=k(),{style:qr,clear:sl}=S(),{cursor:Or,erase:rl}=p(),St=class extends il{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.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()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Mr.hide):this.out.write(rl(this.outputText,this.out.columns)),super.render(),this.outputText=[Or.symbol(this.done,this.aborted),Ie.bold(this.msg),Or.delimiter(this.done),this.value?this.inactive:Ie.cyan().underline(this.inactive),Ie.gray("/"),this.value?Ie.cyan().underline(this.active):this.active].join(" "),this.out.write(nl.line+Mr.to(0)+this.outputText))}};Pr.exports=xt});var M=u((Qu,Tr)=>{"use strict";var St=class i{constructor({token:e,date:t,parts:s,locales:r}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof i)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof i)}toString(){return String(this.date)}};Tr.exports=St});var Cr=u((ea,$r)=>{"use strict";var ol=M(),qt=class extends ol{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};$r.exports=qt});var Dr=u((ta,_r)=>{"use strict";var hl=M(),ll=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),Ot=class extends hl{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+ll(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};_r.exports=Ot});var kr=u((ia,jr)=>{"use strict";var ul=M(),Mt=class extends ul{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};jr.exports=Mt});var Ar=u((sa,Er)=>{"use strict";var al=M(),Pt=class extends al{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Er.exports=Pt});var Fr=u((ra,Rr)=>{"use strict";var cl=M(),It=class extends cl{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Rr.exports=It});var Hr=u((na,Vr)=>{"use strict";var dl=M(),Tt=class extends dl{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Vr.exports=Tt});var Lr=u((oa,Yr)=>{"use strict";var fl=M(),$t=class extends fl{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Yr.exports=$t});var Ur=u((ha,Nr)=>{"use strict";var pl=M(),Ct=class extends pl{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Nr.exports=Ct});var Gr=u((la,Jr)=>{"use strict";Jr.exports={DatePart:M(),Meridiem:Cr(),Day:Dr(),Hours:kr(),Milliseconds:Ar(),Minutes:Fr(),Month:Hr(),Seconds:Lr(),Year:Ur()}});var Qr=u((ua,Xr)=>{"use strict";var _t=f(),ml=k(),{style:Br,clear:zr,figures:gl}=x(),{erase:vl,cursor:Zr}=p(),{DatePart:Wr,Meridiem:bl,Day:yl,Hours:wl,Milliseconds:xl,Minutes:Sl,Month:ql,Seconds:Ol,Year:Ml}=Gr(),Pl=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Kr={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new yl(i),3:i=>new ql(i),4:i=>new Ml(i),5:i=>new bl(i),6:i=>new wl(i),7:i=>new Sl(i),8:i=>new Ol(i),9:i=>new xl(i)},Il={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(",")},Dt=class extends ml{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(Il,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=zr("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=Pl.exec(e);){let r=t.shift(),o=t.findIndex(n=>n!=null);this.parts.push(o in Kr?Kr[o]({token:t[o]||r,date:this.date,parts:this.parts,locales:this.locales}):t[o]||r)}let s=this.parts.reduce((r,o)=>(typeof o=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=o:r.push(o),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Wr)),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()}_(e,t){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Or.hide):this.out.write(sl(this.outputText,this.out.columns)),super.render(),this.outputText=[qr.symbol(this.done,this.aborted),Te.bold(this.msg),qr.delimiter(this.done),this.value?this.inactive:Te.cyan().underline(this.inactive),Te.gray("/"),this.value?Te.cyan().underline(this.active):this.active].join(" "),this.out.write(rl.line+Or.to(0)+this.outputText))}};Mr.exports=St});var P=u((Xu,Ir)=>{"use strict";var qt=class i{constructor({token:e,date:t,parts:s,locales:r}){this.token=e,this.date=t||new Date,this.parts=s||[this],this.locales=r||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((t,s)=>s>e&&t instanceof i)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),t=e.indexOf(this);return e.find((s,r)=>r>t&&s instanceof i)}toString(){return String(this.date)}};Ir.exports=qt});var $r=u((Qu,Tr)=>{"use strict";var nl=P(),Ot=class extends nl{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};Tr.exports=Ot});var _r=u((ea,Cr)=>{"use strict";var ol=P(),hl=i=>(i=i%10,i===1?"st":i===2?"nd":i===3?"rd":"th"),Mt=class extends ol{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+hl(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}};Cr.exports=Mt});var jr=u((ta,Dr)=>{"use strict";var ll=P(),Pt=class extends ll{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Dr.exports=Pt});var Er=u((ia,kr)=>{"use strict";var ul=P(),It=class extends ul{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};kr.exports=It});var Rr=u((sa,Ar)=>{"use strict";var al=P(),Tt=class extends al{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Ar.exports=Tt});var Vr=u((ra,Fr)=>{"use strict";var cl=P(),$t=class extends cl{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}};Fr.exports=$t});var Yr=u((na,Hr)=>{"use strict";var dl=P(),Ct=class extends dl{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Hr.exports=Ct});var Nr=u((oa,Lr)=>{"use strict";var fl=P(),_t=class extends fl{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Lr.exports=_t});var Jr=u((ha,Ur)=>{"use strict";Ur.exports={DatePart:P(),Meridiem:$r(),Day:_r(),Hours:jr(),Milliseconds:Er(),Minutes:Rr(),Month:Vr(),Seconds:Yr(),Year:Nr()}});var Xr=u((la,Kr)=>{"use strict";var Dt=f(),pl=k(),{style:Gr,clear:Br,figures:ml}=S(),{erase:gl,cursor:zr}=p(),{DatePart:Zr,Meridiem:vl,Day:bl,Hours:yl,Milliseconds:wl,Minutes:xl,Month:Sl,Seconds:ql,Year:Ol}=Jr(),Ml=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Wr={1:({token:i})=>i.replace(/\\(.)/g,"$1"),2:i=>new bl(i),3:i=>new Sl(i),4:i=>new Ol(i),5:i=>new vl(i),6:i=>new yl(i),7:i=>new xl(i),8:i=>new ql(i),9:i=>new wl(i)},Pl={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(",")},jt=class extends pl{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(Pl,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Br("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=Ml.exec(e);){let r=t.shift(),o=t.findIndex(n=>n!=null);this.parts.push(o in Wr?Wr[o]({token:t[o]||r,date:this.date,parts:this.parts,locales:this.locales}):t[o]||r)}let s=this.parts.reduce((r,o)=>(typeof o=="string"&&typeof r[r.length-1]=="string"?r[r.length-1]+=o:r.push(o),r),[]);this.parts.splice(0),this.parts.push(...s),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Zr)),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 e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}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
- `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof Wr)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Zr.hide):this.out.write(zr(this.outputText,this.out.columns)),super.render(),this.outputText=[Br.symbol(this.done,this.aborted),_t.bold(this.msg),Br.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?_t.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
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 e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(t=>t instanceof Zr)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(zr.hide):this.out.write(Br(this.outputText,this.out.columns)),super.render(),this.outputText=[Gr.symbol(this.done,this.aborted),Dt.bold(this.msg),Gr.delimiter(!1),this.parts.reduce((e,t,s)=>e.concat(s===this.cursor&&!this.done?Dt.cyan().underline(t.toString()):t),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
66
66
  `).reduce((e,t,s)=>e+`
67
- ${s?" ":gl.pointerSmall} ${_t.red().italic(t)}`,"")),this.out.write(vl.line+Zr.to(0)+this.outputText))}};Xr.exports=Dt});var rn=u((aa,sn)=>{var Te=f(),Tl=k(),{cursor:$e,erase:$l}=p(),{style:jt,figures:Cl,clear:en,lines:_l}=x(),Dl=/[0-9]/,kt=i=>i!==void 0,tn=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},Et=class extends Tl{constructor(e={}){super(e),this.transform=jt.render(e.style),this.msg=e.message,this.initial=kt(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=kt(e.min)?e.min:-1/0,this.max=kt(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Te.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${tn(e,this.round)}`),this._value=tn(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||Dl.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
67
+ ${s?" ":ml.pointerSmall} ${Dt.red().italic(t)}`,"")),this.out.write(gl.line+zr.to(0)+this.outputText))}};Kr.exports=jt});var sn=u((ua,tn)=>{var $e=f(),Il=k(),{cursor:Ce,erase:Tl}=p(),{style:kt,figures:$l,clear:Qr,lines:Cl}=S(),_l=/[0-9]/,Et=i=>i!==void 0,en=(i,e)=>{let t=Math.pow(10,e);return Math.round(i*t)/t},At=class extends Il{constructor(e={}){super(e),this.transform=kt.render(e.style),this.msg=e.message,this.initial=Et(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Et(e.min)?e.min:-1/0,this.max=Et(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=$e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${en(e,this.round)}`),this._value=en(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||_l.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
68
68
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
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 e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.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()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")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($e.down(_l(this.outputError,this.out.columns)-1)+en(this.outputError,this.out.columns)),this.out.write(en(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[jt.symbol(this.done,this.aborted),Te.bold(this.msg),jt.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Te[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
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 e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.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()}_(e,t){if(!this.valid(e))return this.bell();let s=Date.now();if(s-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=s,this.color="cyan",e===".")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(Ce.down(Cl(this.outputError,this.out.columns)-1)+Qr(this.outputError,this.out.columns)),this.out.write(Qr(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[kt.symbol(this.done,this.aborted),$e.bold(this.msg),kt.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((e,t,s)=>e+`
71
- ${s?" ":Cl.pointerSmall} ${Te.red().italic(t)}`,"")),this.out.write($l.line+$e.to(0)+this.outputText+$e.save+this.outputError+$e.restore))}};sn.exports=Et});var Rt=u((ca,hn)=>{"use strict";var P=f(),{cursor:jl}=p(),kl=k(),{clear:nn,figures:H,style:on,wrap:El,entriesToDisplay:Al}=x(),At=class extends kl{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=nn("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
71
+ ${s?" ":$l.pointerSmall} ${$e.red().italic(t)}`,"")),this.out.write(Tl.line+Ce.to(0)+this.outputText+Ce.save+this.outputError+Ce.restore))}};tn.exports=At});var Ft=u((aa,on)=>{"use strict";var I=f(),{cursor:Dl}=p(),jl=k(),{clear:rn,figures:Y,style:nn,wrap:kl,entriesToDisplay:El}=S(),Rt=class extends jl{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((t,s)=>(typeof t=="string"&&(t={title:t,value:s}),{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===void 0?s:t.value),selected:t&&t.selected,disabled:t&&t.disabled})),this.clear=rn("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
72
72
  `),this.close()}submit(){let e=this.value.filter(t=>t.selected);this.minSelected&&e.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(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(t=>!t.disabled).forEach(t=>t.selected=e),this.render()}_(e,t){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
74
74
  Instructions:
75
- ${H.arrowUp}/${H.arrowDown}: Highlight option
76
- ${H.arrowLeft}/${H.arrowRight}/[space]: Toggle selection
75
+ ${Y.arrowUp}/${Y.arrowDown}: Highlight option
76
+ ${Y.arrowLeft}/${Y.arrowRight}/[space]: Toggle selection
77
77
  `+(this.maxChoices===void 0?` a: Toggle all
78
- `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,r){let o=(t.selected?P.green(H.radioOn):H.radioOff)+" "+r+" ",n,h;return t.disabled?n=e===s?P.gray().underline(t.title):P.strikethrough().gray(t.title):(n=e===s?P.cyan().underline(t.title):t.title,e===s&&t.description&&(h=` - ${t.description}`,(o.length+n.length+h.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(h=`
79
- `+El(t.description,{margin:o.length,width:this.out.columns})))),o+n+P.gray(h||"")}paginateOptions(e){if(e.length===0)return P.red("No matches for this query.");let{startIndex:t,endIndex:s}=Al(this.cursor,e.length,this.optionsPerPage),r,o=[];for(let n=t;n<s;n++)n===t&&t>0?r=H.arrowUp:n===s-1&&s<e.length?r=H.arrowDown:r=" ",o.push(this.renderOption(this.cursor,e[n],n,r));return`
78
+ `:"")+" enter/return: Complete answer":""}renderOption(e,t,s,r){let o=(t.selected?I.green(Y.radioOn):Y.radioOff)+" "+r+" ",n,h;return t.disabled?n=e===s?I.gray().underline(t.title):I.strikethrough().gray(t.title):(n=e===s?I.cyan().underline(t.title):t.title,e===s&&t.description&&(h=` - ${t.description}`,(o.length+n.length+h.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(h=`
79
+ `+kl(t.description,{margin:o.length,width:this.out.columns})))),o+n+I.gray(h||"")}paginateOptions(e){if(e.length===0)return I.red("No matches for this query.");let{startIndex:t,endIndex:s}=El(this.cursor,e.length,this.optionsPerPage),r,o=[];for(let n=t;n<s;n++)n===t&&t>0?r=Y.arrowUp:n===s-1&&s<e.length?r=Y.arrowDown:r=" ",o.push(this.renderOption(this.cursor,e[n],n,r));return`
80
80
  `+o.join(`
81
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[P.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(P.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(jl.hide),super.render();let e=[on.symbol(this.done,this.aborted),P.bold(this.msg),on.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=P.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=nn(e,this.out.columns)}};hn.exports=At});var dn=u((da,cn)=>{"use strict";var fe=f(),Rl=k(),{erase:Fl,cursor:ln}=p(),{style:Ft,clear:un,figures:Vt,wrap:Vl,entriesToDisplay:Hl}=x(),an=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),Yl=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),Ll=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},Ht=class extends Rl{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Ll(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=Ft.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=un("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=an(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),s=await t;if(this.completing!==t)return;this.suggestions=s.map((o,n,h)=>({title:Yl(h,n),value:an(h,n),description:o.description})),this.completing=!1;let r=Math.max(s.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}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(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[I.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(I.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Dl.hide),super.render();let e=[nn.symbol(this.done,this.aborted),I.bold(this.msg),nn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=I.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=rn(e,this.out.columns)}};on.exports=Rt});var cn=u((ca,an)=>{"use strict";var pe=f(),Al=k(),{erase:Rl,cursor:hn}=p(),{style:Vt,clear:ln,figures:Ht,wrap:Fl,entriesToDisplay:Vl}=S(),un=(i,e)=>i[e]&&(i[e].value||i[e].title||i[e]),Hl=(i,e)=>i[e]&&(i[e].title||i[e].value||i[e]),Yl=(i,e)=>{let t=i.findIndex(s=>s.value===e||s.title===e);return t>-1?t:void 0},Yt=class extends Al{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Yl(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=Vt.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=ln("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=un(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let t=this.completing=this.suggest(this.input,this.choices),s=await t;if(this.completing!==t)return;this.suggestions=s.map((o,n,h)=>({title:Hl(h,n),value:un(h,n),description:o.description})),this.completing=!1;let r=Math.max(s.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}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
- `),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${s}${e}${r}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,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(e,t,s,r){let o,n=s?Vt.arrowUp:r?Vt.arrowDown:" ",h=t?fe.cyan().underline(e.title):e.title;return n=(t?fe.cyan(Vt.pointer)+" ":" ")+n,e.description&&(o=` - ${e.description}`,(n.length+h.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
85
- `+Vl(e.description,{margin:3,width:this.out.columns}))),n+" "+h+fe.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(ln.hide):this.out.write(un(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=Hl(this.select,this.choices.length,this.limit);if(this.outputText=[Ft.symbol(this.done,this.aborted,this.exited),fe.bold(this.msg),Ft.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let s=this.suggestions.slice(e,t).map((r,o)=>this.renderOption(r,this.select===o+e,o===0&&e>0,o+e===t-1&&t<this.choices.length)).join(`
84
+ `),this.close()}_(e,t){let s=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${s}${e}${r}`,this.cursor=s.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,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(e,t,s,r){let o,n=s?Ht.arrowUp:r?Ht.arrowDown:" ",h=t?pe.cyan().underline(e.title):e.title;return n=(t?pe.cyan(Ht.pointer)+" ":" ")+n,e.description&&(o=` - ${e.description}`,(n.length+h.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
85
+ `+Fl(e.description,{margin:3,width:this.out.columns}))),n+" "+h+pe.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(hn.hide):this.out.write(ln(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:t}=Vl(this.select,this.choices.length,this.limit);if(this.outputText=[Vt.symbol(this.done,this.aborted,this.exited),pe.bold(this.msg),Vt.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let s=this.suggestions.slice(e,t).map((r,o)=>this.renderOption(r,this.select===o+e,o===0&&e>0,o+e===t-1&&t<this.choices.length)).join(`
86
86
  `);this.outputText+=`
87
- `+(s||fe.gray(this.fallback.title))}this.out.write(Fl.line+ln.to(0)+this.outputText)}};cn.exports=Ht});var gn=u((fa,mn)=>{"use strict";var A=f(),{cursor:Nl}=p(),Ul=Rt(),{clear:fn,style:pn,figures:ee}=x(),Yt=class extends Ul{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=fn("",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(e=>e.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(){let e=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);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
87
+ `+(s||pe.gray(this.fallback.title))}this.out.write(Rl.line+hn.to(0)+this.outputText)}};an.exports=Yt});var mn=u((da,pn)=>{"use strict";var A=f(),{cursor:Ll}=p(),Nl=Ft(),{clear:dn,style:fn,figures:te}=S(),Lt=class extends Nl{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=dn("",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(e=>e.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(){let e=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);let t=this.filteredOptions.findIndex(s=>s===e);this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
88
88
  Instructions:
89
- ${ee.arrowUp}/${ee.arrowDown}: Highlight option
90
- ${ee.arrowLeft}/${ee.arrowRight}/[space]: Toggle selection
89
+ ${te.arrowUp}/${te.arrowDown}: Highlight option
90
+ ${te.arrowLeft}/${te.arrowRight}/[space]: Toggle selection
91
91
  [a,b,c]/delete: Filter choices
92
92
  enter/return: Complete answer
93
93
  `:""}renderCurrentInput(){return`
94
94
  Filtered results for: ${this.inputValue?this.inputValue:A.gray("Enter something to filter")}
95
- `}renderOption(e,t,s){let r;return t.disabled?r=e===s?A.gray().underline(t.title):A.strikethrough().gray(t.title):r=e===s?A.cyan().underline(t.title):t.title,(t.selected?A.green(ee.radioOn):ee.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[A.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(A.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Nl.hide),super.render();let e=[pn.symbol(this.done,this.aborted),A.bold(this.msg),pn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=A.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=fn(e,this.out.columns)}};mn.exports=Yt});var xn=u((pa,wn)=>{var vn=f(),Jl=k(),{style:bn,clear:Gl}=x(),{erase:Bl,cursor:yn}=p(),Lt=class extends Jl{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.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(e,t,s){let r;return t.disabled?r=e===s?A.gray().underline(t.title):A.strikethrough().gray(t.title):r=e===s?A.cyan().underline(t.title):t.title,(t.selected?A.green(te.radioOn):te.radioOff)+" "+r}renderDoneOrInstructions(){if(this.done)return this.value.filter(t=>t.selected).map(t=>t.title).join(", ");let e=[A.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(A.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Ll.hide),super.render();let e=[fn.symbol(this.done,this.aborted),A.bold(this.msg),fn.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=A.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=dn(e,this.out.columns)}};pn.exports=Lt});var wn=u((fa,yn)=>{var gn=f(),Ul=k(),{style:vn,clear:Jl}=S(),{erase:Gl,cursor:bn}=p(),Nt=class extends Ul{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.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()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(yn.hide):this.out.write(Gl(this.outputText,this.out.columns)),super.render(),this.outputText=[bn.symbol(this.done,this.aborted),vn.bold(this.msg),bn.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:vn.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Bl.line+yn.to(0)+this.outputText))}};wn.exports=Lt});var qn=u((ma,Sn)=>{"use strict";Sn.exports={TextPrompt:yr(),SelectPrompt:qr(),TogglePrompt:Ir(),DatePrompt:Qr(),NumberPrompt:rn(),MultiselectPrompt:Rt(),AutocompletePrompt:dn(),AutocompleteMultiselectPrompt:gn(),ConfirmPrompt:xn()}});var Mn=u(On=>{"use strict";var b=On,zl=qn(),Ce=i=>i;function I(i,e,t={}){return new Promise((s,r)=>{let o=new zl[i](e),n=t.onAbort||Ce,h=t.onSubmit||Ce,l=t.onExit||Ce;o.on("state",e.onState||Ce),o.on("submit",a=>s(h(a))),o.on("exit",a=>s(l(a))),o.on("abort",a=>r(n(a)))})}b.text=i=>I("TextPrompt",i);b.password=i=>(i.style="password",b.text(i));b.invisible=i=>(i.style="invisible",b.text(i));b.number=i=>I("NumberPrompt",i);b.date=i=>I("DatePrompt",i);b.confirm=i=>I("ConfirmPrompt",i);b.list=i=>{let e=i.separator||",";return I("TextPrompt",i,{onSubmit:t=>t.split(e).map(s=>s.trim())})};b.toggle=i=>I("TogglePrompt",i);b.select=i=>I("SelectPrompt",i);b.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return I("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};b.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return I("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var Zl=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));b.autocomplete=i=>(i.suggest=i.suggest||Zl,i.choices=[].concat(i.choices||[]),I("AutocompletePrompt",i))});var Tn=u((va,In)=>{"use strict";var Nt=Mn(),Wl=["suggest","format","onState","validate","onRender","type"],Pn=()=>{};async function Y(i=[],{onSubmit:e=Pn,onCancel:t=Pn}={}){let s={},r=Y._override||{};i=[].concat(i);let o,n,h,l,a,z,Z=async(m,g,N=!1)=>{if(!(!N&&m.validate&&m.validate(g)!==!0))return m.format?await m.format(g,s):g};for(n of i)if({name:l,type:a}=n,typeof a=="function"&&(a=await a(o,{...s},n),n.type=a),!!a){for(let m in n){if(Wl.includes(m))continue;let g=n[m];n[m]=typeof g=="function"?await g(o,{...s},z):g}if(z=n,typeof n.message!="string")throw new Error("prompt message is required");if({name:l,type:a}=n,Nt[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[n.name]!==void 0&&(o=await Z(n,r[n.name]),o!==void 0)){s[l]=o;continue}try{o=Y._injected?Kl(Y._injected,n.initial):await Nt[a](n),s[l]=o=await Z(n,o,!0),h=await e(n,o,s)}catch{h=!await t(n,s)}if(h)return s}return s}function Kl(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function Xl(i){Y._injected=(Y._injected||[]).concat(i)}function Ql(i){Y._override=Object.assign({},i)}In.exports=Object.assign(Y,{prompt:Y,prompts:Nt,inject:Xl,override:Ql})});var _e=u((ba,$n)=>{function eu(i){i=(Array.isArray(i)?i:i.split(".")).map(Number);let e=0,t=process.versions.node.split(".").map(Number);for(;e<i.length;e++){if(t[e]>i[e])return!1;if(i[e]>t[e])return!0}return!1}$n.exports=eu("8.6.0")?Qs():Tn()});var Bt=$(require("path"));var Wt=$(require("readline")),Kt=Wt.default.createInterface({input:process.stdin,output:process.stdout});function J(i){console.log("");for(let e of i)console.log(e);console.log("")}var W=require("fs"),Xt=$(require("path"));function Qt(i,e){let t=Xt.default.join(i,"package.json");if((0,W.existsSync)(t)){let s=JSON.parse((0,W.readFileSync)(t,"utf8"));s.name=e.name,e.version&&(s.version=e.version),e.productName&&(s.productName=e.productName),e.description&&(s.description=e.description),e.repository&&(s.repository=e.repository),e.author&&(s.author=e.author),(0,W.writeFileSync)(t,JSON.stringify(s,null,2))}}var Cn=$(_e());async function te(i,e=!1){return(await(0,Cn.default)({type:"toggle",name:"value",message:i,initial:e,active:"yes",inactive:"no"})).value}var Dn=$(require("path"));var _n=require("fs"),Ut=$(require("path"));function De(i,e,t){(0,_n.copyFileSync)(Ut.default.join(e,i),Ut.default.join(t,i))}var L=require("fs"),Jt=$(require("path"));function Gt(i,e){let t=(0,L.readdirSync)(i);for(let s of t){let r=Jt.default.join(i,s),o=Jt.default.join(e,s);(0,L.statSync)(r).isDirectory()?((0,L.mkdirSync)(o,{recursive:!0}),Gt(r,o)):(0,L.copyFileSync)(r,o)}}async function jn(i,e){Gt(Dn.default.join(i,"template"),e),De(".gitignore",i,e),De("LICENSE",i,e),De("README.md",i,e)}var Fn=require("child_process");var kn=require("child_process");function En(){let i=["npm"];try{(0,kn.execSync)("yarn --version",{stdio:"ignore"}),i.unshift("yarn")}catch(e){console.error("\u274C Detect package manager error",e)}return i}var An=$(_e());async function Rn(i,e){let t=e.map(r=>({title:r,value:r.toLowerCase()}));return(await(0,An.default)({type:"select",name:"value",message:i,choices:t,initial:0})).value}async function Vn(i){try{process.chdir(i);let e=En(),t=e[0];e.length>1&&(t=await Rn("Package manager",e)),J([`\u{1F4E6} Using package manager: ${t}`,"\u{1F4E6} Installing dependencies..."]),(0,Fn.execSync)(`${t} install`,{stdio:"inherit"}),J(["\u2705 Dependencies installed"])}catch(e){console.error("\u274C Error executing next steps",e)}}var je=require("fs");var ie=require("fs");function Hn(i){try{return(0,ie.existsSync)(i)?(0,ie.statSync)(i).isDirectory()?(0,ie.readdirSync)(i).length===0:(console.error(`\u274C Path is not a directory: ${i}`),!1):!0}catch(e){return console.error("\u274C Error checking directory",e),!1}}async function Yn(i){if(!Hn(i)){if(!await te(`Directory "${i}" already exists. Overwrite?`)){console.error("\u274C Operation cancelled");return}(0,je.rmSync)(i,{recursive:!0,force:!0})}try{(0,je.mkdirSync)(i,{recursive:!0})}catch(e){console.error("\u274C Error executing next steps",e);return}}var Ln={name:"ts-vite-project",version:"0.1.0",productName:"TS Vite Project",description:"TypeScript Vite application",license:"MIT",author:"",repository:"",homepage:""};var Nn=$(_e());async function R(i,e=""){return(await(0,Nn.default)({type:"text",name:"value",message:i,initial:e})).value||""}async function Un(i){let{name:e,version:t,productName:s,description:r,license:o,author:n,repository:h,bugs:l,homepage:a}=Ln;if(i.length?(s=i.map(m=>`${m.slice(0,1).toUpperCase()}${m.slice(1)}`).join(" "),e=i.map(m=>m.toLowerCase()).join("-")):(s=(await R("Product name",s)).trim(),e=s.split(" ").map(m=>m.toLowerCase()).join("-"),e=(await R("Project name",e)).trim()),await te("Config extended project params?")){let g=(await R("Version",t)).trim().split(".");for(let y=g.length;y<3;y++)g.push("0");t=g.join("."),r=(await R("Description",r)).trim()||r,o=(await R("License",o)).trim()||o,n={},n.name=(await R("Author")).trim(),n.email=(await R("Email")).trim(),h={};let N=`https://github.com/${n.name}/${e}.git`,U=(await R("Repository url",N)).trim()||N;U&&(h.url=`git+${U}`,l={},n.email&&(l.email=n.email),l.url=`${U}/issues`,a=`${U}#readme`)}return{name:e,version:t,productName:s,description:r,license:o,author:n,repository:h,bugs:l,homepage:a}}async function tu(){J(["\u{1F680} Creating TypeScript + Vite Project","(will be installed in project name folder)"]);let i=process.argv.slice(2),e=await Un(i),t=Bt.default.resolve(e.name),s=Bt.default.resolve(__dirname,"..");await Yn(t);try{await jn(s,t),Qt(t,e),J(["\u2705 Project created successfully!"]),await te("Install dependencies?")&&await Vn(t),J(["Next steps:",`\u{1F4C1} cd ${e.name}`,"\u{1F4E6} npm install","\u2B50 npm run dev","","Happy coding! \u{1F44B}"])}catch(r){console.error("\u274C Error creating project:",r)}finally{Kt.close()}}tu().catch(console.error);
97
+ `),this.close()}_(e,t){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(bn.hide):this.out.write(Jl(this.outputText,this.out.columns)),super.render(),this.outputText=[vn.symbol(this.done,this.aborted),gn.bold(this.msg),vn.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:gn.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Gl.line+bn.to(0)+this.outputText))}};yn.exports=Nt});var Sn=u((pa,xn)=>{"use strict";xn.exports={TextPrompt:br(),SelectPrompt:Sr(),TogglePrompt:Pr(),DatePrompt:Xr(),NumberPrompt:sn(),MultiselectPrompt:Ft(),AutocompletePrompt:cn(),AutocompleteMultiselectPrompt:mn(),ConfirmPrompt:wn()}});var On=u(qn=>{"use strict";var b=qn,Bl=Sn(),_e=i=>i;function T(i,e,t={}){return new Promise((s,r)=>{let o=new Bl[i](e),n=t.onAbort||_e,h=t.onSubmit||_e,l=t.onExit||_e;o.on("state",e.onState||_e),o.on("submit",a=>s(h(a))),o.on("exit",a=>s(l(a))),o.on("abort",a=>r(n(a)))})}b.text=i=>T("TextPrompt",i);b.password=i=>(i.style="password",b.text(i));b.invisible=i=>(i.style="invisible",b.text(i));b.number=i=>T("NumberPrompt",i);b.date=i=>T("DatePrompt",i);b.confirm=i=>T("ConfirmPrompt",i);b.list=i=>{let e=i.separator||",";return T("TextPrompt",i,{onSubmit:t=>t.split(e).map(s=>s.trim())})};b.toggle=i=>T("TogglePrompt",i);b.select=i=>T("SelectPrompt",i);b.multiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return T("MultiselectPrompt",i,{onAbort:e,onSubmit:e})};b.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);let e=t=>t.filter(s=>s.selected).map(s=>s.value);return T("AutocompleteMultiselectPrompt",i,{onAbort:e,onSubmit:e})};var zl=(i,e)=>Promise.resolve(e.filter(t=>t.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));b.autocomplete=i=>(i.suggest=i.suggest||zl,i.choices=[].concat(i.choices||[]),T("AutocompletePrompt",i))});var In=u((ga,Pn)=>{"use strict";var Ut=On(),Zl=["suggest","format","onState","validate","onRender","type"],Mn=()=>{};async function L(i=[],{onSubmit:e=Mn,onCancel:t=Mn}={}){let s={},r=L._override||{};i=[].concat(i);let o,n,h,l,a,Z,W=async(m,g,U=!1)=>{if(!(!U&&m.validate&&m.validate(g)!==!0))return m.format?await m.format(g,s):g};for(n of i)if({name:l,type:a}=n,typeof a=="function"&&(a=await a(o,{...s},n),n.type=a),!!a){for(let m in n){if(Zl.includes(m))continue;let g=n[m];n[m]=typeof g=="function"?await g(o,{...s},Z):g}if(Z=n,typeof n.message!="string")throw new Error("prompt message is required");if({name:l,type:a}=n,Ut[a]===void 0)throw new Error(`prompt type (${a}) is not defined`);if(r[n.name]!==void 0&&(o=await W(n,r[n.name]),o!==void 0)){s[l]=o;continue}try{o=L._injected?Wl(L._injected,n.initial):await Ut[a](n),s[l]=o=await W(n,o,!0),h=await e(n,o,s)}catch{h=!await t(n,s)}if(h)return s}return s}function Wl(i,e){let t=i.shift();if(t instanceof Error)throw t;return t===void 0?e:t}function Kl(i){L._injected=(L._injected||[]).concat(i)}function Xl(i){L._override=Object.assign({},i)}Pn.exports=Object.assign(L,{prompt:L,prompts:Ut,inject:Kl,override:Xl})});var De=u((va,Tn)=>{function Ql(i){i=(Array.isArray(i)?i:i.split(".")).map(Number);let e=0,t=process.versions.node.split(".").map(Number);for(;e<i.length;e++){if(t[e]>i[e])return!1;if(i[e]>t[e])return!0}return!1}Tn.exports=Ql("8.6.0")?Xs():In()});var zt=F(require("path"));function y(i,e){console.error(`
98
+ \u274C ${i}`),e&&console.error(e),process.exit(1)}function G(i){console.log("");for(let e of i)console.log(e);console.log("")}var K=require("fs"),Kt=F(require("path"));function Xt(i,e){let t=Kt.default.join(i,"package.json");if((0,K.existsSync)(t)){let s=JSON.parse((0,K.readFileSync)(t,"utf8"));s.name=e.name,e.version&&(s.version=e.version),e.productName&&(s.productName=e.productName),e.description&&(s.description=e.description),e.repository&&(s.repository=e.repository),e.author&&(s.author=e.author),(0,K.writeFileSync)(t,JSON.stringify(s,null,2))}}var $n=F(De());async function ie(i,e=!1){return(await(0,$n.default)({type:"toggle",name:"value",message:i,initial:e,active:"yes",inactive:"no"})).value}var _n=F(require("path"));var Cn=require("fs"),Jt=F(require("path"));function je(i,e,t){(0,Cn.copyFileSync)(Jt.default.join(e,i),Jt.default.join(t,i))}var N=require("fs"),Gt=F(require("path"));function Bt(i,e){let t=(0,N.readdirSync)(i);for(let s of t){let r=Gt.default.join(i,s),o=Gt.default.join(e,s);(0,N.statSync)(r).isDirectory()?((0,N.mkdirSync)(o,{recursive:!0}),Bt(r,o)):(0,N.copyFileSync)(r,o)}}async function Dn(i,e){Bt(_n.default.join(i,"template"),e),je(".gitignore",i,e),je("LICENSE",i,e),je("README.md",i,e)}var Rn=require("child_process");var jn=require("child_process");function kn(){let i=["npm"];try{(0,jn.execSync)("yarn --version",{stdio:"ignore"}),i.unshift("yarn")}catch(e){y("Detect package manager error",e)}return i}var En=F(De());async function An(i,e){let t=e.map(r=>({title:r,value:r.toLowerCase()}));return(await(0,En.default)({type:"select",name:"value",message:i,choices:t,initial:0})).value}async function Fn(i){try{process.chdir(i);let e=kn(),t=e[0];e.length>1&&(t=await An("Package manager",e)),G([`\u{1F4E6} Using package manager: ${t}`,"\u{1F4E6} Installing dependencies..."]),(0,Rn.execSync)(`${t} install`,{stdio:"inherit"}),G(["\u2705 Dependencies installed"])}catch(e){y("Error executing next steps",e)}}var ke=require("fs");var se=require("fs");function Vn(i){try{return(0,se.existsSync)(i)?(0,se.statSync)(i).isDirectory()?(0,se.readdirSync)(i).length===0:(y(`Path is not a directory: ${i}`,null),!1):!0}catch(e){return y("Error checking directory",e),!1}}async function Hn(i){Vn(i)||(await ie(`Directory "${i}" already exists. Overwrite?`)||y("Operation cancelled",null),(0,ke.rmSync)(i,{recursive:!0,force:!0}));try{(0,ke.mkdirSync)(i,{recursive:!0})}catch(e){y("Error executing next steps",e)}}var Yn={name:"ts-vite-project",version:"0.1.0",productName:"TS Vite Project",description:"TypeScript Vite application",license:"MIT",author:"",repository:"",homepage:""};var Ln=F(De());async function R(i,e=""){return(await(0,Ln.default)({type:"text",name:"value",message:i,initial:e})).value||""}async function Nn(i){let{name:e,version:t,productName:s,description:r,license:o,author:n,repository:h,bugs:l,homepage:a}=Yn;if(i.length?(s=i.map(m=>`${m.slice(0,1).toUpperCase()}${m.slice(1)}`).join(" "),e=i.map(m=>m.toLowerCase()).join("-")):(s=(await R("Product name",s)).trim(),e=s.split(" ").map(m=>m.toLowerCase()).join("-"),e=(await R("Project name",e)).trim()),await ie("Config extended project params?")){let g=(await R("Version",t)).trim().split(".");for(let w=g.length;w<3;w++)g.push("0");t=g.join("."),r=(await R("Description",r)).trim()||r,o=(await R("License",o)).trim()||o,n={},n.name=(await R("Author")).trim(),n.email=(await R("Email")).trim(),h={};let U=`https://github.com/${n.name}/${e}.git`,J=(await R("Repository url",U)).trim()||U;J&&(h.url=`git+${J}`,l={},n.email&&(l.email=n.email),l.url=`${J}/issues`,a=`${J}#readme`)}return{name:e,version:t,productName:s,description:r,license:o,author:n,repository:h,bugs:l,homepage:a}}async function eu(){G(["\u{1F680} Creating TypeScript + Vite Project","(will be installed in project name folder)"]);let i=process.argv.slice(2),e=await Nn(i),t=zt.default.resolve(e.name),s=zt.default.resolve(__dirname,"..");await Hn(t);try{await Dn(s,t),Xt(t,e),G(["\u2705 Project created successfully!"]),await ie("Install dependencies?")&&await Fn(t),G(["Next steps:",`\u{1F4C1} cd ${e.name}`,"\u{1F4E6} npm install","\u2B50 npm run dev","","Happy coding! \u{1F44B}"])}catch(r){y("Error creating project",r)}}eu().catch(console.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ts-vite-project",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "productName": "TS Vite Project Template Creator",
5
5
  "description": "Template for projects based typescript, vite, vitest, eslint, prettier, electron, tauri",
6
6
  "license": "MIT",