create-update
Version:
Create Update app with one command
52 lines • 410 kB
JavaScript
"use strict";var g_=Object.create;var an=Object.defineProperty;var w_=Object.getOwnPropertyDescriptor;var b_=Object.getOwnPropertyNames;var E_=Object.getPrototypeOf,__=Object.prototype.hasOwnProperty;var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),F_=(t,e)=>{for(var r in e)an(t,r,{get:e[r],enumerable:!0})},Ql=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of b_(e))!__.call(t,s)&&s!==r&&an(t,s,{get:()=>e[s],enumerable:!(i=w_(e,s))||i.enumerable});return t};var F=(t,e,r)=>(r=t!=null?g_(E_(t)):{},Ql(e||!t||!t.__esModule?an(r,"default",{value:t,enumerable:!0}):r,t)),x_=t=>Ql(an({},"__esModule",{value:!0}),t);var U=y((Lk,tf)=>{"use strict";var{FORCE_COLOR:S_,NODE_DISABLE_COLORS:C_,TERM:v_}=process.env,P={enabled:!C_&&v_!=="dumb"&&S_!=="0",reset:I(0,0),bold:I(1,22),dim:I(2,22),italic:I(3,23),underline:I(4,24),inverse:I(7,27),hidden:I(8,28),strikethrough:I(9,29),black:I(30,39),red:I(31,39),green:I(32,39),yellow:I(33,39),blue:I(34,39),magenta:I(35,39),cyan:I(36,39),white:I(37,39),gray:I(90,39),grey:I(90,39),bgBlack:I(40,49),bgRed:I(41,49),bgGreen:I(42,49),bgYellow:I(43,49),bgBlue:I(44,49),bgMagenta:I(45,49),bgCyan:I(46,49),bgWhite:I(47,49)};function ef(t,e){let r=0,i,s="",n="";for(;r<t.length;r++)i=t[r],s+=i.open,n+=i.close,e.includes(i.close)&&(e=e.replace(i.rgx,i.close+i.open));return s+e+n}function T_(t,e){let r={has:t,keys:e};return r.reset=P.reset.bind(r),r.bold=P.bold.bind(r),r.dim=P.dim.bind(r),r.italic=P.italic.bind(r),r.underline=P.underline.bind(r),r.inverse=P.inverse.bind(r),r.hidden=P.hidden.bind(r),r.strikethrough=P.strikethrough.bind(r),r.black=P.black.bind(r),r.red=P.red.bind(r),r.green=P.green.bind(r),r.yellow=P.yellow.bind(r),r.blue=P.blue.bind(r),r.magenta=P.magenta.bind(r),r.cyan=P.cyan.bind(r),r.white=P.white.bind(r),r.gray=P.gray.bind(r),r.grey=P.grey.bind(r),r.bgBlack=P.bgBlack.bind(r),r.bgRed=P.bgRed.bind(r),r.bgGreen=P.bgGreen.bind(r),r.bgYellow=P.bgYellow.bind(r),r.bgBlue=P.bgBlue.bind(r),r.bgMagenta=P.bgMagenta.bind(r),r.bgCyan=P.bgCyan.bind(r),r.bgWhite=P.bgWhite.bind(r),r}function I(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),i===void 0?this:P.enabled?ef(this.keys,i+""):i+""):i===void 0?T_([t],[r]):P.enabled?ef([r],i+""):i+""}}tf.exports=P});var sf=y((Mk,rf)=>{"use strict";rf.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var un=y((qk,nf)=>{"use strict";nf.exports=t=>{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("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var H=y((jk,of)=>{"use strict";var wa="\x1B",$=`${wa}[`,A_="\x07",ba={to(t,e){return e?`${$}${e+1};${t+1}H`:`${$}${t+1}G`},move(t,e){let r="";return t<0?r+=`${$}${-t}D`:t>0&&(r+=`${$}${t}C`),e<0?r+=`${$}${-e}A`:e>0&&(r+=`${$}${e}B`),r},up:(t=1)=>`${$}${t}A`,down:(t=1)=>`${$}${t}B`,forward:(t=1)=>`${$}${t}C`,backward:(t=1)=>`${$}${t}D`,nextLine:(t=1)=>`${$}E`.repeat(t),prevLine:(t=1)=>`${$}F`.repeat(t),left:`${$}G`,hide:`${$}?25l`,show:`${$}?25h`,save:`${wa}7`,restore:`${wa}8`},O_={up:(t=1)=>`${$}S`.repeat(t),down:(t=1)=>`${$}T`.repeat(t)},R_={screen:`${$}2J`,up:(t=1)=>`${$}1J`.repeat(t),down:(t=1)=>`${$}J`.repeat(t),line:`${$}2K`,lineEnd:`${$}K`,lineStart:`${$}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?ba.up():"");return t&&(e+=ba.left),e}};of.exports={cursor:ba,scroll:O_,erase:R_,beep:A_}});var lf=y((Uk,cf)=>{"use strict";function k_(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=P_(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var i=0,s=function(){};return{s,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(h){throw h},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,a;return{s:function(){r=r.call(t)},n:function(){var h=r.next();return n=h.done,h},e:function(h){o=!0,a=h},f:function(){try{!n&&r.return!=null&&r.return()}finally{if(o)throw a}}}}function P_(t,e){if(t){if(typeof t=="string")return af(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return af(t,e)}}function af(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}var B_=un(),hf=H(),uf=hf.erase,I_=hf.cursor,N_=t=>[...B_(t)].length;cf.exports=function(t,e){if(!e)return uf.line+I_.to(0);let r=0,i=t.split(/\r?\n/);var s=k_(i),n;try{for(s.s();!(n=s.n()).done;){let o=n.value;r+=1+Math.floor(Math.max(N_(o)-1,0)/e)}}catch(o){s.e(o)}finally{s.f()}return uf.lines(r)}});var Ea=y(($k,ff)=>{"use strict";var Ai={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},L_={arrowUp:Ai.arrowUp,arrowDown:Ai.arrowDown,arrowLeft:Ai.arrowLeft,arrowRight:Ai.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},M_=process.platform==="win32"?L_:Ai;ff.exports=M_});var mf=y((Hk,df)=>{"use strict";var Mr=U(),ur=Ea(),_a=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),q_=t=>_a[t]||_a.default,Oi=Object.freeze({aborted:Mr.red(ur.cross),done:Mr.green(ur.tick),exited:Mr.yellow(ur.cross),default:Mr.cyan("?")}),j_=(t,e,r)=>e?Oi.aborted:r?Oi.exited:t?Oi.done:Oi.default,U_=t=>Mr.gray(t?ur.ellipsis:ur.pointerSmall),$_=(t,e)=>Mr.gray(t?e?ur.pointerSmall:"+":ur.line);df.exports={styles:_a,render:q_,symbols:Oi,symbol:j_,delimiter:U_,item:$_}});var yf=y((zk,pf)=>{"use strict";var H_=un();pf.exports=function(t,e){let r=String(H_(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,s)=>i+s):r.length}});var gf=y((Wk,Df)=>{"use strict";Df.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return(t||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+r.length>=i||n[n.length-1].length+o.length+1<i?n[n.length-1]+=` ${o}`:n.push(`${r}${o}`),n),[r]).join(`
`)).join(`
`)}});var bf=y((Gk,wf)=>{"use strict";wf.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let s=Math.min(i+r,e);return{startIndex:i,endIndex:s}}});var Ie=y((Vk,Ef)=>{"use strict";Ef.exports={action:sf(),clear:lf(),style:mf(),strip:un(),figures:Ea(),lines:yf(),wrap:gf(),entriesToDisplay:bf()}});var mt=y((Yk,xf)=>{"use strict";var _f=require("readline"),z_=Ie(),W_=z_.action,G_=require("events"),Ff=H(),V_=Ff.beep,Y_=Ff.cursor,K_=U(),Fa=class extends G_{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 r=_f.createInterface({input:this.in,escapeCodeTimeout:50});_f.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let a=W_(o,i);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(Y_.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(V_)}render(){this.onRender(K_),this.firstRender&&(this.firstRender=!1)}};xf.exports=Fa});var Af=y((Kk,Tf)=>{"use strict";function Sf(t,e,r,i,s,n,o){try{var a=t[n](o),u=a.value}catch(h){r(h);return}a.done?e(u):Promise.resolve(u).then(i,s)}function Cf(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(u){Sf(n,i,s,o,a,"next",u)}function a(u){Sf(n,i,s,o,a,"throw",u)}o(void 0)})}}var hn=U(),J_=mt(),vf=H(),Z_=vf.erase,Ri=vf.cursor,cn=Ie(),xa=cn.style,Sa=cn.clear,X_=cn.lines,Q_=cn.figures,Ca=class extends J_{constructor(e={}){super(e),this.transform=xa.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=Sa("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=hn.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(`
`),this.close()}validate(){var e=this;return Cf(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return Cf(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(`
`),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,r){let i=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${i}${e}${s}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,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),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,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(Ri.down(X_(this.outputError,this.out.columns)-1)+Sa(this.outputError,this.out.columns)),this.out.write(Sa(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[xa.symbol(this.done,this.aborted),hn.bold(this.msg),xa.delimiter(this.done),this.red?hn.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,r,i)=>e+`
${i?" ":Q_.pointerSmall} ${hn.red().italic(r)}`,"")),this.out.write(Z_.line+Ri.to(0)+this.outputText+Ri.save+this.outputError+Ri.restore+Ri.move(this.cursorOffset,0)))}};Tf.exports=Ca});var Pf=y((Jk,kf)=>{"use strict";var pt=U(),eF=mt(),ki=Ie(),Of=ki.style,Rf=ki.clear,ln=ki.figures,tF=ki.wrap,rF=ki.entriesToDisplay,iF=H(),sF=iF.cursor,va=class extends eF{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((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Rf("",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(`
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(sF.hide):this.out.write(Rf(this.outputText,this.out.columns)),super.render();let e=rF(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,i=e.endIndex;if(this.outputText=[Of.symbol(this.done,this.aborted),pt.bold(this.msg),Of.delimiter(!1),this.done?this.selection.title:this.selection.disabled?pt.yellow(this.warn):pt.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let s=r;s<i;s++){let n,o,a="",u=this.choices[s];s===r&&r>0?o=ln.arrowUp:s===i-1&&i<this.choices.length?o=ln.arrowDown:o=" ",u.disabled?(n=this.cursor===s?pt.gray().underline(u.title):pt.strikethrough().gray(u.title),o=(this.cursor===s?pt.bold().gray(ln.pointer)+" ":" ")+o):(n=this.cursor===s?pt.cyan().underline(u.title):u.title,o=(this.cursor===s?pt.cyan(ln.pointer)+" ":" ")+o,u.description&&this.cursor===s&&(a=` - ${u.description}`,(o.length+n.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
`+tF(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${pt.gray(a)}
`}}this.out.write(this.outputText)}};kf.exports=va});var qf=y((Zk,Mf)=>{"use strict";var fn=U(),nF=mt(),Nf=Ie(),Bf=Nf.style,oF=Nf.clear,Lf=H(),If=Lf.cursor,aF=Lf.erase,Ta=class extends nF{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(`
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){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(If.hide):this.out.write(oF(this.outputText,this.out.columns)),super.render(),this.outputText=[Bf.symbol(this.done,this.aborted),fn.bold(this.msg),Bf.delimiter(this.done),this.value?this.inactive:fn.cyan().underline(this.inactive),fn.gray("/"),this.value?fn.cyan().underline(this.active):this.active].join(" "),this.out.write(aF.line+If.to(0)+this.outputText))}};Mf.exports=Ta});var Je=y((Xk,jf)=>{"use strict";var Aa=class t{constructor({token:e,date:r,parts:i,locales:s}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=s||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,s)=>s>r&&i instanceof t)}toString(){return String(this.date)}};jf.exports=Aa});var $f=y((Qk,Uf)=>{"use strict";var uF=Je(),Oa=class extends uF{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}};Uf.exports=Oa});var zf=y((eP,Hf)=>{"use strict";var hF=Je(),cF=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),Ra=class extends hF{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(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+cF(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};Hf.exports=Ra});var Gf=y((tP,Wf)=>{"use strict";var lF=Je(),ka=class extends lF{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}};Wf.exports=ka});var Yf=y((rP,Vf)=>{"use strict";var fF=Je(),Pa=class extends fF{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)}};Vf.exports=Pa});var Jf=y((iP,Kf)=>{"use strict";var dF=Je(),Ba=class extends dF{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}};Kf.exports=Ba});var Xf=y((sP,Zf)=>{"use strict";var mF=Je(),Ia=class extends mF{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(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};Zf.exports=Ia});var ed=y((nP,Qf)=>{"use strict";var pF=Je(),Na=class extends pF{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}};Qf.exports=Na});var rd=y((oP,td)=>{"use strict";var yF=Je(),La=class extends yF{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}};td.exports=La});var sd=y((aP,id)=>{"use strict";id.exports={DatePart:Je(),Meridiem:$f(),Day:zf(),Hours:Gf(),Milliseconds:Yf(),Minutes:Jf(),Month:Xf(),Seconds:ed(),Year:rd()}});var md=y((uP,dd)=>{"use strict";function nd(t,e,r,i,s,n,o){try{var a=t[n](o),u=a.value}catch(h){r(h);return}a.done?e(u):Promise.resolve(u).then(i,s)}function od(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(u){nd(n,i,s,o,a,"next",u)}function a(u){nd(n,i,s,o,a,"throw",u)}o(void 0)})}}var Ma=U(),DF=mt(),ja=Ie(),ad=ja.style,ud=ja.clear,gF=ja.figures,fd=H(),wF=fd.erase,hd=fd.cursor,yt=sd(),cd=yt.DatePart,bF=yt.Meridiem,EF=yt.Day,_F=yt.Hours,FF=yt.Milliseconds,xF=yt.Minutes,SF=yt.Month,CF=yt.Seconds,vF=yt.Year,TF=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,ld={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new EF(t),3:t=>new SF(t),4:t=>new vF(t),5:t=>new bF(t),6:t=>new _F(t),7:t=>new xF(t),8:t=>new CF(t),9:t=>new FF(t)},AF={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(",")},qa=class extends DF{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(AF,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=ud("",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 r;for(this.parts=[];r=TF.exec(e);){let s=r.shift(),n=r.findIndex(o=>o!=null);this.parts.push(n in ld?ld[n]({token:r[n]||s,date:this.date,parts:this.parts,locales:this.locales}):r[n]||s)}let i=this.parts.reduce((s,n)=>(typeof n=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=n:s.push(n),s),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof cd)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}validate(){var e=this;return od(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return od(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(`
`),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(r=>r instanceof cd)),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(hd.hide):this.out.write(ud(this.outputText,this.out.columns)),super.render(),this.outputText=[ad.symbol(this.done,this.aborted),Ma.bold(this.msg),ad.delimiter(!1),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?Ma.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((e,r,i)=>e+`
${i?" ":gF.pointerSmall} ${Ma.red().italic(r)}`,"")),this.out.write(wF.line+hd.to(0)+this.outputText))}};dd.exports=qa});var Ed=y((hP,bd)=>{"use strict";function pd(t,e,r,i,s,n,o){try{var a=t[n](o),u=a.value}catch(h){r(h);return}a.done?e(u):Promise.resolve(u).then(i,s)}function yd(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(u){pd(n,i,s,o,a,"next",u)}function a(u){pd(n,i,s,o,a,"throw",u)}o(void 0)})}}var dn=U(),OF=mt(),wd=H(),mn=wd.cursor,RF=wd.erase,pn=Ie(),Ua=pn.style,kF=pn.figures,Dd=pn.clear,PF=pn.lines,BF=/[0-9]/,$a=t=>t!==void 0,gd=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Ha=class extends OF{constructor(e={}){super(e),this.transform=Ua.render(e.style),this.msg=e.message,this.initial=$a(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=$a(e.min)?e.min:-1/0,this.max=$a(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=dn.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${gd(e,this.round)}`),this._value=gd(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||BF.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(`
`),this.close()}validate(){var e=this;return yd(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return yd(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
`),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,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,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(mn.down(PF(this.outputError,this.out.columns)-1)+Dd(this.outputError,this.out.columns)),this.out.write(Dd(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ua.symbol(this.done,this.aborted),dn.bold(this.msg),Ua.delimiter(this.done),!this.done||!this.done&&!this.placeholder?dn[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,r,i)=>e+`
${i?" ":kF.pointerSmall} ${dn.red().italic(r)}`,"")),this.out.write(RF.line+mn.to(0)+this.outputText+mn.save+this.outputError+mn.restore))}};bd.exports=Ha});var Wa=y((cP,xd)=>{"use strict";var Ze=U(),IF=H(),NF=IF.cursor,LF=mt(),Pi=Ie(),_d=Pi.clear,Nt=Pi.figures,Fd=Pi.style,MF=Pi.wrap,qF=Pi.entriesToDisplay,za=class extends LF{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((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=_d("",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(`
`),this.close()}submit(){let e=this.value.filter(r=>r.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(`
`),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(r=>r.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(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){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:`
Instructions:
${Nt.arrowUp}/${Nt.arrowDown}: Highlight option
${Nt.arrowLeft}/${Nt.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?` a: Toggle all
`:"")+" enter/return: Complete answer":""}renderOption(e,r,i,s){let n=(r.selected?Ze.green(Nt.radioOn):Nt.radioOff)+" "+s+" ",o,a;return r.disabled?o=e===i?Ze.gray().underline(r.title):Ze.strikethrough().gray(r.title):(o=e===i?Ze.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(n.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
`+MF(r.description,{margin:n.length,width:this.out.columns})))),n+o+Ze.gray(a||"")}paginateOptions(e){if(e.length===0)return Ze.red("No matches for this query.");let r=qF(this.cursor,e.length,this.optionsPerPage),i=r.startIndex,s=r.endIndex,n,o=[];for(let a=i;a<s;a++)a===i&&i>0?n=Nt.arrowUp:a===s-1&&s<e.length?n=Nt.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[a],a,n));return`
`+o.join(`
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ze.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Ze.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(NF.hide),super.render();let e=[Fd.symbol(this.done,this.aborted),Ze.bold(this.msg),Fd.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ze.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=_d(e,this.out.columns)}};xd.exports=za});var Rd=y((lP,Od)=>{"use strict";function Sd(t,e,r,i,s,n,o){try{var a=t[n](o),u=a.value}catch(h){r(h);return}a.done?e(u):Promise.resolve(u).then(i,s)}function jF(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(u){Sd(n,i,s,o,a,"next",u)}function a(u){Sd(n,i,s,o,a,"throw",u)}o(void 0)})}}var Bi=U(),UF=mt(),Ad=H(),$F=Ad.erase,Cd=Ad.cursor,Ii=Ie(),Ga=Ii.style,vd=Ii.clear,Va=Ii.figures,HF=Ii.wrap,zF=Ii.entriesToDisplay,Td=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),WF=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),GF=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},Ya=class extends UF{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:GF(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=Ga.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=vd("",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=Td(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return jF(function*(){let i=r.completing=r.suggest(r.input,r.choices),s=yield i;if(r.completing!==i)return;r.suggestions=s.map((o,a,u)=>({title:WF(u,a),value:Td(u,a),description:o.description})),r.completing=!1;let n=Math.max(s.length-1,0);r.moveSelect(Math.min(n,r.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(`
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(e,r){let i=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${i}${e}${s}`,this.cursor=i.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),r=this.input.slice(this.cursor);this.input=`${e}${r}`,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),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,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,r,i,s){let n,o=i?Va.arrowUp:s?Va.arrowDown:" ",a=r?Bi.cyan().underline(e.title):e.title;return o=(r?Bi.cyan(Va.pointer)+" ":" ")+o,e.description&&(n=` - ${e.description}`,(o.length+a.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
`+HF(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Bi.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Cd.hide):this.out.write(vd(this.outputText,this.out.columns)),super.render();let e=zF(this.select,this.choices.length,this.limit),r=e.startIndex,i=e.endIndex;if(this.outputText=[Ga.symbol(this.done,this.aborted,this.exited),Bi.bold(this.msg),Ga.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(r,i).map((n,o)=>this.renderOption(n,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length)).join(`
`);this.outputText+=`
`+(s||Bi.gray(this.fallback.title))}this.out.write($F.line+Cd.to(0)+this.outputText)}};Od.exports=Ya});var Id=y((fP,Bd)=>{"use strict";var Dt=U(),VF=H(),YF=VF.cursor,KF=Wa(),Ja=Ie(),kd=Ja.clear,Pd=Ja.style,qr=Ja.figures,Ka=class extends KF{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=kd("",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(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
${qr.arrowUp}/${qr.arrowDown}: Highlight option
${qr.arrowLeft}/${qr.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`:""}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:Dt.gray("Enter something to filter")}
`}renderOption(e,r,i){let s;return r.disabled?s=e===i?Dt.gray().underline(r.title):Dt.strikethrough().gray(r.title):s=e===i?Dt.cyan().underline(r.title):r.title,(r.selected?Dt.green(qr.radioOn):qr.radioOff)+" "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Dt.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Dt.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(YF.hide),super.render();let e=[Pd.symbol(this.done,this.aborted),Dt.bold(this.msg),Pd.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Dt.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=kd(e,this.out.columns)}};Bd.exports=Ka});var $d=y((dP,Ud)=>{"use strict";var Nd=U(),JF=mt(),qd=Ie(),Ld=qd.style,ZF=qd.clear,jd=H(),XF=jd.erase,Md=jd.cursor,Za=class extends JF{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(`
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(e,r){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(Md.hide):this.out.write(ZF(this.outputText,this.out.columns)),super.render(),this.outputText=[Ld.symbol(this.done,this.aborted),Nd.bold(this.msg),Ld.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Nd.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(XF.line+Md.to(0)+this.outputText))}};Ud.exports=Za});var zd=y((mP,Hd)=>{"use strict";Hd.exports={TextPrompt:Af(),SelectPrompt:Pf(),TogglePrompt:qf(),DatePrompt:md(),NumberPrompt:Ed(),MultiselectPrompt:Wa(),AutocompletePrompt:Rd(),AutocompleteMultiselectPrompt:Id(),ConfirmPrompt:$d()}});var Gd=y(Wd=>{"use strict";var Ee=Wd,QF=zd(),yn=t=>t;function Xe(t,e,r={}){return new Promise((i,s)=>{let n=new QF[t](e),o=r.onAbort||yn,a=r.onSubmit||yn,u=r.onExit||yn;n.on("state",e.onState||yn),n.on("submit",h=>i(a(h))),n.on("exit",h=>i(u(h))),n.on("abort",h=>s(o(h)))})}Ee.text=t=>Xe("TextPrompt",t);Ee.password=t=>(t.style="password",Ee.text(t));Ee.invisible=t=>(t.style="invisible",Ee.text(t));Ee.number=t=>Xe("NumberPrompt",t);Ee.date=t=>Xe("DatePrompt",t);Ee.confirm=t=>Xe("ConfirmPrompt",t);Ee.list=t=>{let e=t.separator||",";return Xe("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};Ee.toggle=t=>Xe("TogglePrompt",t);Ee.select=t=>Xe("SelectPrompt",t);Ee.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Xe("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Ee.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Xe("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var ex=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Ee.autocomplete=t=>(t.suggest=t.suggest||ex,t.choices=[].concat(t.choices||[]),Xe("AutocompletePrompt",t))});var em=y((yP,Qd)=>{"use strict";function Vd(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,i)}return r}function Yd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vd(Object(r),!0).forEach(function(i){tx(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vd(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function tx(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rx(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ix(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var i=0,s=function(){};return{s,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(h){throw h},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,a;return{s:function(){r=r.call(t)},n:function(){var h=r.next();return n=h.done,h},e:function(h){o=!0,a=h},f:function(){try{!n&&r.return!=null&&r.return()}finally{if(o)throw a}}}}function ix(t,e){if(t){if(typeof t=="string")return Kd(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kd(t,e)}}function Kd(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Jd(t,e,r,i,s,n,o){try{var a=t[n](o),u=a.value}catch(h){r(h);return}a.done?e(u):Promise.resolve(u).then(i,s)}function Zd(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(u){Jd(n,i,s,o,a,"next",u)}function a(u){Jd(n,i,s,o,a,"throw",u)}o(void 0)})}}var Xa=Gd(),sx=["suggest","format","onState","validate","onRender","type"],Xd=()=>{};function Lt(){return Qa.apply(this,arguments)}function Qa(){return Qa=Zd(function*(t=[],{onSubmit:e=Xd,onCancel:r=Xd}={}){let i={},s=Lt._override||{};t=[].concat(t);let n,o,a,u,h,c,d=function(){var w=Zd(function*(D,x,_=!1){if(!(!_&&D.validate&&D.validate(x)!==!0))return D.format?yield D.format(x,i):x});return function(x,_){return w.apply(this,arguments)}}();var f=rx(t),m;try{for(f.s();!(m=f.n()).done;){o=m.value;var g=o;if(u=g.name,h=g.type,typeof h=="function"&&(h=yield h(n,Yd({},i),o),o.type=h),!!h){for(let w in o){if(sx.includes(w))continue;let D=o[w];o[w]=typeof D=="function"?yield D(n,Yd({},i),c):D}if(c=o,typeof o.message!="string")throw new Error("prompt message is required");var p=o;if(u=p.name,h=p.type,Xa[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(s[o.name]!==void 0&&(n=yield d(o,s[o.name]),n!==void 0)){i[u]=n;continue}try{n=Lt._injected?nx(Lt._injected,o.initial):yield Xa[h](o),i[u]=n=yield d(o,n,!0),a=yield e(o,n,i)}catch{a=!(yield r(o,i))}if(a)return i}}}catch(w){f.e(w)}finally{f.f()}return i}),Qa.apply(this,arguments)}function nx(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function ox(t){Lt._injected=(Lt._injected||[]).concat(t)}function ax(t){Lt._override=Object.assign({},t)}Qd.exports=Object.assign(Lt,{prompt:Lt,prompts:Xa,inject:ox,override:ax})});var rm=y((DP,tm)=>{"use strict";tm.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var Dn=y((gP,im)=>{"use strict";im.exports=t=>{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("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var om=y((wP,nm)=>{"use strict";var ux=Dn(),{erase:sm,cursor:hx}=H(),cx=t=>[...ux(t)].length;nm.exports=function(t,e){if(!e)return sm.line+hx.to(0);let r=0,i=t.split(/\r?\n/);for(let s of i)r+=1+Math.floor(Math.max(cx(s)-1,0)/e);return sm.lines(r)}});var eu=y((bP,am)=>{"use strict";var Ni={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},lx={arrowUp:Ni.arrowUp,arrowDown:Ni.arrowDown,arrowLeft:Ni.arrowLeft,arrowRight:Ni.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},fx=process.platform==="win32"?lx:Ni;am.exports=fx});var hm=y((EP,um)=>{"use strict";var jr=U(),hr=eu(),tu=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),dx=t=>tu[t]||tu.default,Li=Object.freeze({aborted:jr.red(hr.cross),done:jr.green(hr.tick),exited:jr.yellow(hr.cross),default:jr.cyan("?")}),mx=(t,e,r)=>e?Li.aborted:r?Li.exited:t?Li.done:Li.default,px=t=>jr.gray(t?hr.ellipsis:hr.pointerSmall),yx=(t,e)=>jr.gray(t?e?hr.pointerSmall:"+":hr.line);um.exports={styles:tu,render:dx,symbols:Li,symbol:mx,delimiter:px,item:yx}});var lm=y((_P,cm)=>{"use strict";var Dx=Dn();cm.exports=function(t,e){let r=String(Dx(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,s)=>i+s):r.length}});var dm=y((FP,fm)=>{"use strict";fm.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return(t||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+r.length>=i||n[n.length-1].length+o.length+1<i?n[n.length-1]+=` ${o}`:n.push(`${r}${o}`),n),[r]).join(`
`)).join(`
`)}});var pm=y((xP,mm)=>{"use strict";mm.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let s=Math.min(i+r,e);return{startIndex:i,endIndex:s}}});var Ne=y((SP,ym)=>{"use strict";ym.exports={action:rm(),clear:om(),style:hm(),strip:Dn(),figures:eu(),lines:lm(),wrap:dm(),entriesToDisplay:pm()}});var gt=y((CP,gm)=>{"use strict";var Dm=require("readline"),{action:gx}=Ne(),wx=require("events"),{beep:bx,cursor:Ex}=H(),_x=U(),ru=class extends wx{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 r=Dm.createInterface({input:this.in,escapeCodeTimeout:50});Dm.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let a=gx(o,i);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):t