buddy-bot
Version:
Automated & optimized dependency updates for JavaScript & TypeScript projects. Like Renovate & Dependabot.
54 lines • 320 kB
JavaScript
#!/usr/bin/env bun
// @bun
import{d as N,e as y1}from"../chunk-tpe7vkbz.js";import"../chunk-r1rkcs0b.js";import"../chunk-j0phfedr.js";import"../chunk-ma13sjrm.js";import"../chunk-p0vny2x9.js";import"../chunk-1z74sgbm.js";import"../chunk-b5gyp8hn.js";import"../chunk-3j3vxazw.js";import"../chunk-f5bh0qas.js";import"../chunk-72vxav2c.js";import"../chunk-knkqp939.js";import"../chunk-jah7r3bb.js";import"../chunk-32dgq3f4.js";import"../chunk-8wk4nc61.js";import"../chunk-vd04qkw4.js";import{ua as w,va as D,wa as E}from"../chunk-pvk7bcsa.js";var x=D((zG,hZ)=>{var{FORCE_COLOR:r6,NODE_DISABLE_COLORS:t6,TERM:o6}=process.env,S={enabled:!t6&&o6!=="dumb"&&r6!=="0",reset:k(0,0),bold:k(1,22),dim:k(2,22),italic:k(3,23),underline:k(4,24),inverse:k(7,27),hidden:k(8,28),strikethrough:k(9,29),black:k(30,39),red:k(31,39),green:k(32,39),yellow:k(33,39),blue:k(34,39),magenta:k(35,39),cyan:k(36,39),white:k(37,39),gray:k(90,39),grey:k(90,39),bgBlack:k(40,49),bgRed:k(41,49),bgGreen:k(42,49),bgYellow:k(43,49),bgBlue:k(44,49),bgMagenta:k(45,49),bgCyan:k(46,49),bgWhite:k(47,49)};function bZ($,Z){let Y=0,Q,J="",X="";for(;Y<$.length;Y++)if(Q=$[Y],J+=Q.open,X+=Q.close,Z.includes(Q.close))Z=Z.replace(Q.rgx,Q.close+Q.open);return J+Z+X}function e6($,Z){let Y={has:$,keys:Z};return Y.reset=S.reset.bind(Y),Y.bold=S.bold.bind(Y),Y.dim=S.dim.bind(Y),Y.italic=S.italic.bind(Y),Y.underline=S.underline.bind(Y),Y.inverse=S.inverse.bind(Y),Y.hidden=S.hidden.bind(Y),Y.strikethrough=S.strikethrough.bind(Y),Y.black=S.black.bind(Y),Y.red=S.red.bind(Y),Y.green=S.green.bind(Y),Y.yellow=S.yellow.bind(Y),Y.blue=S.blue.bind(Y),Y.magenta=S.magenta.bind(Y),Y.cyan=S.cyan.bind(Y),Y.white=S.white.bind(Y),Y.gray=S.gray.bind(Y),Y.grey=S.grey.bind(Y),Y.bgBlack=S.bgBlack.bind(Y),Y.bgRed=S.bgRed.bind(Y),Y.bgGreen=S.bgGreen.bind(Y),Y.bgYellow=S.bgYellow.bind(Y),Y.bgBlue=S.bgBlue.bind(Y),Y.bgMagenta=S.bgMagenta.bind(Y),Y.bgCyan=S.bgCyan.bind(Y),Y.bgWhite=S.bgWhite.bind(Y),Y}function k($,Z){let Y={open:`\x1B[${$}m`,close:`\x1B[${Z}m`,rgx:new RegExp(`\\x1b\\[${Z}m`,"g")};return function(Q){if(this!==void 0&&this.has!==void 0)return this.has.includes($)||(this.has.push($),this.keys.push(Y)),Q===void 0?this:S.enabled?bZ(this.keys,Q+""):Q+"";return Q===void 0?e6([$],[Y]):S.enabled?bZ([Y],Q+""):Q+""}}hZ.exports=S});var vZ=D((HG,yZ)=>{yZ.exports=($,Z)=>{if($.meta&&$.name!=="escape")return;if($.ctrl){if($.name==="a")return"first";if($.name==="c")return"abort";if($.name==="d")return"abort";if($.name==="e")return"last";if($.name==="g")return"reset"}if(Z){if($.name==="j")return"down";if($.name==="k")return"up"}if($.name==="return")return"submit";if($.name==="enter")return"submit";if($.name==="backspace")return"delete";if($.name==="delete")return"deleteForward";if($.name==="abort")return"abort";if($.name==="escape")return"exit";if($.name==="tab")return"next";if($.name==="pagedown")return"nextPage";if($.name==="pageup")return"prevPage";if($.name==="home")return"home";if($.name==="end")return"end";if($.name==="up")return"up";if($.name==="down")return"down";if($.name==="right")return"right";if($.name==="left")return"left";return!1}});var V0=D((UG,xZ)=>{xZ.exports=($)=>{let Z=["[\\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("|"),Y=new RegExp(Z,"g");return typeof $==="string"?$.replace(Y,""):$}});var f=D((GG,fZ)=>{var M$={to($,Z){if(!Z)return`\x1B[${$+1}G`;return`\x1B[${Z+1};${$+1}H`},move($,Z){let Y="";if($<0)Y+=`\x1B[${-$}D`;else if($>0)Y+=`\x1B[${$}C`;if(Z<0)Y+=`\x1B[${-Z}A`;else if(Z>0)Y+=`\x1B[${Z}B`;return Y},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},$5={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},Z5={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let Z="";for(let Y=0;Y<$;Y++)Z+=this.line+(Y<$-1?M$.up():"");if($)Z+=M$.left;return Z}};fZ.exports={cursor:M$,scroll:$5,erase:Z5,beep:"\x07"}});var cZ=D((KG,mZ)=>{function Y5($,Z){var Y=typeof Symbol<"u"&&$[Symbol.iterator]||$["@@iterator"];if(!Y){if(Array.isArray($)||(Y=Q5($))||Z&&$&&typeof $.length==="number"){if(Y)$=Y;var Q=0,J=function(){};return{s:J,n:function(){if(Q>=$.length)return{done:!0};return{done:!1,value:$[Q++]}},e:function(G){throw G},f:J}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var X=!0,z=!1,H;return{s:function(){Y=Y.call($)},n:function(){var G=Y.next();return X=G.done,G},e:function(G){z=!0,H=G},f:function(){try{if(!X&&Y.return!=null)Y.return()}finally{if(z)throw H}}}}function Q5($,Z){if(!$)return;if(typeof $==="string")return dZ($,Z);var Y=Object.prototype.toString.call($).slice(8,-1);if(Y==="Object"&&$.constructor)Y=$.constructor.name;if(Y==="Map"||Y==="Set")return Array.from($);if(Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y))return dZ($,Z)}function dZ($,Z){if(Z==null||Z>$.length)Z=$.length;for(var Y=0,Q=Array(Z);Y<Z;Y++)Q[Y]=$[Y];return Q}var J5=V0(),gZ=f(),uZ=gZ.erase,X5=gZ.cursor,z5=($)=>[...J5($)].length;mZ.exports=function($,Z){if(!Z)return uZ.line+X5.to(0);let Y=0,Q=$.split(/\r?\n/);var J=Y5(Q),X;try{for(J.s();!(X=J.n()).done;){let z=X.value;Y+=1+Math.floor(Math.max(z5(z)-1,0)/Z)}}catch(z){J.e(z)}finally{J.f()}return uZ.lines(Y)}});var L$=D((WG,lZ)=>{var o1={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},H5={arrowUp:o1.arrowUp,arrowDown:o1.arrowDown,arrowLeft:o1.arrowLeft,arrowRight:o1.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},U5=process.platform==="win32"?H5:o1;lZ.exports=U5});var nZ=D((qG,pZ)=>{var x1=x(),_1=L$(),B$=Object.freeze({password:{scale:1,render:($)=>"*".repeat($.length)},emoji:{scale:2,render:($)=>"\uD83D\uDE03".repeat($.length)},invisible:{scale:0,render:($)=>""},default:{scale:1,render:($)=>`${$}`}}),G5=($)=>B$[$]||B$.default,e1=Object.freeze({aborted:x1.red(_1.cross),done:x1.green(_1.tick),exited:x1.yellow(_1.cross),default:x1.cyan("?")}),K5=($,Z,Y)=>Z?e1.aborted:Y?e1.exited:$?e1.done:e1.default,W5=($)=>x1.gray($?_1.ellipsis:_1.pointerSmall),q5=($,Z)=>x1.gray($?Z?_1.pointerSmall:"+":_1.line);pZ.exports={styles:B$,render:G5,symbols:e1,symbol:K5,delimiter:W5,item:q5}});var aZ=D((FG,iZ)=>{var F5=V0();iZ.exports=function($,Z){let Y=String(F5($)||"").split(/\r?\n/);if(!Z)return Y.length;return Y.map((Q)=>Math.ceil(Q.length/Z)).reduce((Q,J)=>Q+J)}});var rZ=D((jG,sZ)=>{sZ.exports=($,Z={})=>{let Y=Number.isSafeInteger(parseInt(Z.margin))?Array(parseInt(Z.margin)).fill(" ").join(""):Z.margin||"",Q=Z.width;return($||"").split(/\r?\n/g).map((J)=>J.split(/\s+/g).reduce((X,z)=>{if(z.length+Y.length>=Q||X[X.length-1].length+z.length+1<Q)X[X.length-1]+=` ${z}`;else X.push(`${Y}${z}`);return X},[Y]).join(`
`)).join(`
`)}});var oZ=D((DG,tZ)=>{tZ.exports=($,Z,Y)=>{Y=Y||Z;let Q=Math.min(Z-Y,$-Math.floor(Y/2));if(Q<0)Q=0;let J=Math.min(Q+Y,Z);return{startIndex:Q,endIndex:J}}});var J1=D((MG,eZ)=>{eZ.exports={action:vZ(),clear:cZ(),style:nZ(),strip:V0(),figures:L$(),lines:aZ(),wrap:rZ(),entriesToDisplay:oZ()}});var j1=D((LG,QY)=>{var $Y=E("readline"),j5=J1(),D5=j5.action,M5=E("events"),ZY=f(),L5=ZY.beep,B5=ZY.cursor,V5=x();class YY extends M5{constructor($={}){super();this.firstRender=!0,this.in=$.stdin||process.stdin,this.out=$.stdout||process.stdout,this.onRender=($.onRender||(()=>{return})).bind(this);let Z=$Y.createInterface({input:this.in,escapeCodeTimeout:50});if($Y.emitKeypressEvents(this.in,Z),this.in.isTTY)this.in.setRawMode(!0);let Y=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,Q=(J,X)=>{let z=D5(X,Y);if(z===!1)this._&&this._(J,X);else if(typeof this[z]==="function")this[z](X);else this.bell()};this.close=()=>{if(this.out.write(B5.show),this.in.removeListener("keypress",Q),this.in.isTTY)this.in.setRawMode(!1);Z.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",Q)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(L5)}render(){if(this.onRender(V5),this.firstRender)this.firstRender=!1}}QY.exports=YY});var GY=D((BG,UY)=>{function JY($,Z,Y,Q,J,X,z){try{var H=$[X](z),U=H.value}catch(G){Y(G);return}if(H.done)Z(U);else Promise.resolve(U).then(Q,J)}function XY($){return function(){var Z=this,Y=arguments;return new Promise(function(Q,J){var X=$.apply(Z,Y);function z(U){JY(X,Q,J,z,H,"next",U)}function H(U){JY(X,Q,J,z,H,"throw",U)}z(void 0)})}}var A0=x(),A5=j1(),zY=f(),R5=zY.erase,$0=zY.cursor,R0=J1(),V$=R0.style,A$=R0.clear,O5=R0.lines,I5=R0.figures;class HY extends A5{constructor($={}){super($);this.transform=V$.render($.style),this.scale=this.transform.scale,this.msg=$.message,this.initial=$.initial||"",this.validator=$.validate||(()=>!0),this.value="",this.errorMsg=$.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=A$("",this.out.columns),this.render()}set value($){if(!$&&this.initial)this.placeholder=!0,this.rendered=A0.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render($);this._value=$,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!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 $=this;return XY(function*(){let Z=yield $.validator($.value);if(typeof Z==="string")$.errorMsg=Z,Z=!1;$.error=!Z})()}submit(){var $=this;return XY(function*(){if($.value=$.value||$.initial,$.cursorOffset=0,$.cursor=$.rendered.length,yield $.validate(),$.error){$.red=!0,$.fire(),$.render();return}$.done=!0,$.aborted=!1,$.fire(),$.render(),$.out.write(`
`),$.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor($){if(this.placeholder)return;this.cursor=this.cursor+$,this.cursorOffset+=$}_($,Z){let Y=this.value.slice(0,this.cursor),Q=this.value.slice(this.cursor);this.value=`${Y}${$}${Q}`,this.red=!1,this.cursor=this.placeholder?0:Y.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let $=this.value.slice(0,this.cursor-1),Z=this.value.slice(this.cursor);if(this.value=`${$}${Z}`,this.red=!1,this.isCursorAtStart())this.cursorOffset=0;else this.cursorOffset++,this.moveCursor(-1);this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let $=this.value.slice(0,this.cursor),Z=this.value.slice(this.cursor+1);if(this.value=`${$}${Z}`,this.red=!1,this.isCursorAtEnd())this.cursorOffset=0;else 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(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write($0.down(O5(this.outputError,this.out.columns)-1)+A$(this.outputError,this.out.columns));this.out.write(A$(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[V$.symbol(this.done,this.aborted),A0.bold(this.msg),V$.delimiter(this.done),this.red?A0.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
`).reduce(($,Z,Y)=>$+`
${Y?" ":I5.pointerSmall} ${A0.red().italic(Z)}`,"");this.out.write(R5.line+$0.to(0)+this.outputText+$0.save+this.outputError+$0.restore+$0.move(this.cursorOffset,0))}}UY.exports=HY});var jY=D((VG,FY)=>{var D1=x(),N5=j1(),Z0=J1(),KY=Z0.style,WY=Z0.clear,O0=Z0.figures,E5=Z0.wrap,T5=Z0.entriesToDisplay,w5=f(),C5=w5.cursor;class qY extends N5{constructor($={}){super($);this.msg=$.message,this.hint=$.hint||"- Use arrow-keys. Return to submit.",this.warn=$.warn||"- This option is disabled",this.cursor=$.initial||0,this.choices=$.choices.map((Z,Y)=>{if(typeof Z==="string")Z={title:Z,value:Y};return{title:Z&&(Z.title||Z.value||Z),value:Z&&(Z.value===void 0?Y:Z.value),description:Z&&Z.description,selected:Z&&Z.selected,disabled:Z&&Z.disabled}}),this.optionsPerPage=$.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=WY("",this.out.columns),this.render()}moveCursor($){this.cursor=$,this.value=this.choices[$].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(){if(!this.selection.disabled)this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close();else this.bell()}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){if(this.cursor===0)this.moveCursor(this.choices.length-1);else this.moveCursor(this.cursor-1);this.render()}down(){if(this.cursor===this.choices.length-1)this.moveCursor(0);else this.moveCursor(this.cursor+1);this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_($,Z){if($===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(C5.hide);else this.out.write(WY(this.outputText,this.out.columns));super.render();let $=T5(this.cursor,this.choices.length,this.optionsPerPage),Z=$.startIndex,Y=$.endIndex;if(this.outputText=[KY.symbol(this.done,this.aborted),D1.bold(this.msg),KY.delimiter(!1),this.done?this.selection.title:this.selection.disabled?D1.yellow(this.warn):D1.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let Q=Z;Q<Y;Q++){let J,X,z="",H=this.choices[Q];if(Q===Z&&Z>0)X=O0.arrowUp;else if(Q===Y-1&&Y<this.choices.length)X=O0.arrowDown;else X=" ";if(H.disabled)J=this.cursor===Q?D1.gray().underline(H.title):D1.strikethrough().gray(H.title),X=(this.cursor===Q?D1.bold().gray(O0.pointer)+" ":" ")+X;else if(J=this.cursor===Q?D1.cyan().underline(H.title):H.title,X=(this.cursor===Q?D1.cyan(O0.pointer)+" ":" ")+X,H.description&&this.cursor===Q){if(z=` - ${H.description}`,X.length+J.length+z.length>=this.out.columns||H.description.split(/\r?\n/).length>1)z=`
`+E5(H.description,{margin:3,width:this.out.columns})}this.outputText+=`${X} ${J}${D1.gray(z)}
`}}this.out.write(this.outputText)}}FY.exports=qY});var RY=D((AG,AY)=>{var I0=x(),S5=j1(),LY=J1(),DY=LY.style,P5=LY.clear,BY=f(),MY=BY.cursor,k5=BY.erase;class VY extends S5{constructor($={}){super($);this.msg=$.message,this.value=!!$.initial,this.active=$.active||"on",this.inactive=$.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()}_($,Z){if($===" ")this.value=!this.value;else if($==="1")this.value=!0;else if($==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(MY.hide);else this.out.write(P5(this.outputText,this.out.columns));super.render(),this.outputText=[DY.symbol(this.done,this.aborted),I0.bold(this.msg),DY.delimiter(this.done),this.value?this.inactive:I0.cyan().underline(this.inactive),I0.gray("/"),this.value?I0.cyan().underline(this.active):this.active].join(" "),this.out.write(k5.line+MY.to(0)+this.outputText)}}AY.exports=VY});var H1=D((RG,OY)=>{class N0{constructor({token:$,date:Z,parts:Y,locales:Q}){this.token=$,this.date=Z||new Date,this.parts=Y||[this],this.locales=Q||{}}up(){}down(){}next(){let $=this.parts.indexOf(this);return this.parts.find((Z,Y)=>Y>$&&Z instanceof N0)}setTo($){}prev(){let $=[].concat(this.parts).reverse(),Z=$.indexOf(this);return $.find((Y,Q)=>Q>Z&&Y instanceof N0)}toString(){return String(this.date)}}OY.exports=N0});var EY=D((OG,NY)=>{var _5=H1();class IY extends _5{constructor($={}){super($)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let $=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?$.toUpperCase():$}}NY.exports=IY});var CY=D((IG,wY)=>{var b5=H1(),h5=($)=>{return $=$%10,$===1?"st":$===2?"nd":$===3?"rd":"th"};class TY extends b5{constructor($={}){super($)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo($){this.date.setDate(parseInt($.substr(-2)))}toString(){let $=this.date.getDate(),Z=this.date.getDay();return this.token==="DD"?String($).padStart(2,"0"):this.token==="Do"?$+h5($):this.token==="d"?Z+1:this.token==="ddd"?this.locales.weekdaysShort[Z]:this.token==="dddd"?this.locales.weekdays[Z]:$}}wY.exports=TY});var kY=D((NG,PY)=>{var y5=H1();class SY extends y5{constructor($={}){super($)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo($){this.date.setHours(parseInt($.substr(-2)))}toString(){let $=this.date.getHours();if(/h/.test(this.token))$=$%12||12;return this.token.length>1?String($).padStart(2,"0"):$}}PY.exports=SY});var hY=D((EG,bY)=>{var v5=H1();class _Y extends v5{constructor($={}){super($)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo($){this.date.setMilliseconds(parseInt($.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}bY.exports=_Y});var xY=D((TG,vY)=>{var x5=H1();class yY extends x5{constructor($={}){super($)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo($){this.date.setMinutes(parseInt($.substr(-2)))}toString(){let $=this.date.getMinutes();return this.token.length>1?String($).padStart(2,"0"):$}}vY.exports=yY});var uY=D((wG,dY)=>{var f5=H1();class fY extends f5{constructor($={}){super($)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo($){$=parseInt($.substr(-2))-1,this.date.setMonth($<0?0:$)}toString(){let $=this.date.getMonth(),Z=this.token.length;return Z===2?String($+1).padStart(2,"0"):Z===3?this.locales.monthsShort[$]:Z===4?this.locales.months[$]:String($+1)}}dY.exports=fY});var cY=D((CG,mY)=>{var d5=H1();class gY extends d5{constructor($={}){super($)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo($){this.date.setSeconds(parseInt($.substr(-2)))}toString(){let $=this.date.getSeconds();return this.token.length>1?String($).padStart(2,"0"):$}}mY.exports=gY});var nY=D((SG,pY)=>{var u5=H1();class lY extends u5{constructor($={}){super($)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo($){this.date.setFullYear($.substr(-4))}toString(){let $=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?$.substr(-2):$}}pY.exports=lY});var aY=D((PG,iY)=>{iY.exports={DatePart:H1(),Meridiem:EY(),Day:CY(),Hours:kY(),Milliseconds:hY(),Minutes:xY(),Month:uY(),Seconds:cY(),Year:nY()}});var XQ=D((kG,JQ)=>{function sY($,Z,Y,Q,J,X,z){try{var H=$[X](z),U=H.value}catch(G){Y(G);return}if(H.done)Z(U);else Promise.resolve(U).then(Q,J)}function rY($){return function(){var Z=this,Y=arguments;return new Promise(function(Q,J){var X=$.apply(Z,Y);function z(U){sY(X,Q,J,z,H,"next",U)}function H(U){sY(X,Q,J,z,H,"throw",U)}z(void 0)})}}var R$=x(),g5=j1(),O$=J1(),tY=O$.style,oY=O$.clear,m5=O$.figures,YQ=f(),c5=YQ.erase,eY=YQ.cursor,M1=aY(),$Q=M1.DatePart,l5=M1.Meridiem,p5=M1.Day,n5=M1.Hours,i5=M1.Milliseconds,a5=M1.Minutes,s5=M1.Month,r5=M1.Seconds,t5=M1.Year,o5=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,ZQ={1:({token:$})=>$.replace(/\\(.)/g,"$1"),2:($)=>new p5($),3:($)=>new s5($),4:($)=>new t5($),5:($)=>new l5($),6:($)=>new n5($),7:($)=>new a5($),8:($)=>new r5($),9:($)=>new i5($)},e5={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class QQ extends g5{constructor($={}){super($);this.msg=$.message,this.cursor=0,this.typed="",this.locales=Object.assign(e5,$.locales),this._date=$.initial||new Date,this.errorMsg=$.error||"Please Enter A Valid Value",this.validator=$.validate||(()=>!0),this.mask=$.mask||"YYYY-MM-DD HH:mm:ss",this.clear=oY("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date($){if($)this._date.setTime($.getTime())}set mask($){let Z;this.parts=[];while(Z=o5.exec($)){let Q=Z.shift(),J=Z.findIndex((X)=>X!=null);this.parts.push(J in ZQ?ZQ[J]({token:Z[J]||Q,date:this.date,parts:this.parts,locales:this.locales}):Z[J]||Q)}let Y=this.parts.reduce((Q,J)=>{if(typeof J==="string"&&typeof Q[Q.length-1]==="string")Q[Q.length-1]+=J;else Q.push(J);return Q},[]);this.parts.splice(0),this.parts.push(...Y),this.reset()}moveCursor($){this.typed="",this.cursor=$,this.fire()}reset(){this.moveCursor(this.parts.findIndex(($)=>$ instanceof $Q)),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 $=this;return rY(function*(){let Z=yield $.validator($.value);if(typeof Z==="string")$.errorMsg=Z,Z=!1;$.error=!Z})()}submit(){var $=this;return rY(function*(){if(yield $.validate(),$.error){$.color="red",$.fire(),$.render();return}$.done=!0,$.aborted=!1,$.fire(),$.render(),$.out.write(`
`),$.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let $=this.parts[this.cursor].prev();if($==null)return this.bell();this.moveCursor(this.parts.indexOf($)),this.render()}right(){let $=this.parts[this.cursor].next();if($==null)return this.bell();this.moveCursor(this.parts.indexOf($)),this.render()}next(){let $=this.parts[this.cursor].next();this.moveCursor($?this.parts.indexOf($):this.parts.findIndex((Z)=>Z instanceof $Q)),this.render()}_($){if(/\d/.test($))this.typed+=$,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(eY.hide);else this.out.write(oY(this.outputText,this.out.columns));if(super.render(),this.outputText=[tY.symbol(this.done,this.aborted),R$.bold(this.msg),tY.delimiter(!1),this.parts.reduce(($,Z,Y)=>$.concat(Y===this.cursor&&!this.done?R$.cyan().underline(Z.toString()):Z),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split(`
`).reduce(($,Z,Y)=>$+`
${Y?" ":m5.pointerSmall} ${R$.red().italic(Z)}`,"");this.out.write(c5.line+eY.to(0)+this.outputText)}}JQ.exports=QQ});var FQ=D((_G,qQ)=>{function zQ($,Z,Y,Q,J,X,z){try{var H=$[X](z),U=H.value}catch(G){Y(G);return}if(H.done)Z(U);else Promise.resolve(U).then(Q,J)}function HQ($){return function(){var Z=this,Y=arguments;return new Promise(function(Q,J){var X=$.apply(Z,Y);function z(U){zQ(X,Q,J,z,H,"next",U)}function H(U){zQ(X,Q,J,z,H,"throw",U)}z(void 0)})}}var E0=x(),$9=j1(),KQ=f(),T0=KQ.cursor,Z9=KQ.erase,w0=J1(),I$=w0.style,Y9=w0.figures,UQ=w0.clear,Q9=w0.lines,J9=/[0-9]/,N$=($)=>$!==void 0,GQ=($,Z)=>{let Y=Math.pow(10,Z);return Math.round($*Y)/Y};class WQ extends $9{constructor($={}){super($);this.transform=I$.render($.style),this.msg=$.message,this.initial=N$($.initial)?$.initial:"",this.float=!!$.float,this.round=$.round||2,this.inc=$.increment||1,this.min=N$($.min)?$.min:-1/0,this.max=N$($.max)?$.max:1/0,this.errorMsg=$.error||"Please Enter A Valid Value",this.validator=$.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value($){if(!$&&$!==0)this.placeholder=!0,this.rendered=E0.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${GQ($,this.round)}`),this._value=GQ($,this.round);this.fire()}get value(){return this._value}parse($){return this.float?parseFloat($):parseInt($)}valid($){return $==="-"||$==="."&&this.float||J9.test($)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let $=this.value;this.value=$!==""?$:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}validate(){var $=this;return HQ(function*(){let Z=yield $.validator($.value);if(typeof Z==="string")$.errorMsg=Z,Z=!1;$.error=!Z})()}submit(){var $=this;return HQ(function*(){if(yield $.validate(),$.error){$.color="red",$.fire(),$.render();return}let Z=$.value;$.value=Z!==""?Z:$.initial,$.done=!0,$.aborted=!1,$.error=!1,$.fire(),$.render(),$.out.write(`
`),$.close()})()}up(){if(this.typed="",this.value==="")this.value=this.min-this.inc;if(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;if(this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let $=this.value.toString();if($.length===0)return this.bell();if(this.value=this.parse($=$.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()}_($,Z){if(!this.valid($))return this.bell();let Y=Date.now();if(Y-this.lastHit>1000)this.typed="";if(this.typed+=$,this.lastHit=Y,this.color="cyan",$===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire(),this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(T0.down(Q9(this.outputError,this.out.columns)-1)+UQ(this.outputError,this.out.columns));this.out.write(UQ(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[I$.symbol(this.done,this.aborted),E0.bold(this.msg),I$.delimiter(this.done),!this.done||!this.done&&!this.placeholder?E0[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
`).reduce(($,Z,Y)=>$+`
${Y?" ":Y9.pointerSmall} ${E0.red().italic(Z)}`,"");this.out.write(Z9.line+T0.to(0)+this.outputText+T0.save+this.outputError+T0.restore)}}qQ.exports=WQ});var E$=D((bG,LQ)=>{var U1=x(),X9=f(),z9=X9.cursor,H9=j1(),Y0=J1(),jQ=Y0.clear,w1=Y0.figures,DQ=Y0.style,U9=Y0.wrap,G9=Y0.entriesToDisplay;class MQ extends H9{constructor($={}){super($);if(this.msg=$.message,this.cursor=$.cursor||0,this.scrollIndex=$.cursor||0,this.hint=$.hint||"",this.warn=$.warn||"- This option is disabled -",this.minSelected=$.min,this.showMinError=!1,this.maxChoices=$.max,this.instructions=$.instructions,this.optionsPerPage=$.optionsPerPage||10,this.value=$.choices.map((Z,Y)=>{if(typeof Z==="string")Z={title:Z,value:Y};return{title:Z&&(Z.title||Z.value||Z),description:Z&&Z.description,value:Z&&(Z.value===void 0?Y:Z.value),selected:Z&&Z.selected,disabled:Z&&Z.disabled}}),this.clear=jQ("",this.out.columns),!$.overrideRender)this.render()}reset(){this.value.map(($)=>!$.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(($)=>$.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){let $=this.value.filter((Z)=>Z.selected);if(this.minSelected&&$.length<this.minSelected)this.showMinError=!0,this.render();else 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(){if(this.cursor===0)this.cursor=this.value.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.value.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(($)=>$.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let $=this.value[this.cursor];if($.selected)$.selected=!1,this.render();else if($.disabled||this.value.filter((Z)=>Z.selected).length>=this.maxChoices)return this.bell();else $.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let $=!this.value[this.cursor].selected;this.value.filter((Z)=>!Z.disabled).forEach((Z)=>Z.selected=$),this.render()}_($,Z){if($===" ")this.handleSpaceToggle();else if($==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
Instructions:
${w1.arrowUp}/${w1.arrowDown}: Highlight option
${w1.arrowLeft}/${w1.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?` a: Toggle all
`:"")+" enter/return: Complete answer"}return""}renderOption($,Z,Y,Q){let J=(Z.selected?U1.green(w1.radioOn):w1.radioOff)+" "+Q+" ",X,z;if(Z.disabled)X=$===Y?U1.gray().underline(Z.title):U1.strikethrough().gray(Z.title);else if(X=$===Y?U1.cyan().underline(Z.title):Z.title,$===Y&&Z.description){if(z=` - ${Z.description}`,J.length+X.length+z.length>=this.out.columns||Z.description.split(/\r?\n/).length>1)z=`
`+U9(Z.description,{margin:J.length,width:this.out.columns})}return J+X+U1.gray(z||"")}paginateOptions($){if($.length===0)return U1.red("No matches for this query.");let Z=G9(this.cursor,$.length,this.optionsPerPage),Y=Z.startIndex,Q=Z.endIndex,J,X=[];for(let z=Y;z<Q;z++){if(z===Y&&Y>0)J=w1.arrowUp;else if(z===Q-1&&Q<$.length)J=w1.arrowDown;else J=" ";X.push(this.renderOption(this.cursor,$[z],z,J))}return`
`+X.join(`
`)}renderOptions($){if(!this.done)return this.paginateOptions($);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter((Z)=>Z.selected).map((Z)=>Z.title).join(", ");let $=[U1.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)$.push(U1.yellow(this.warn));return $.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(z9.hide);super.render();let $=[DQ.symbol(this.done,this.aborted),U1.bold(this.msg),DQ.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)$+=U1.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;$+=this.renderOptions(this.value),this.out.write(this.clear+$),this.clear=jQ($,this.out.columns)}}LQ.exports=MQ});var EQ=D((hG,NQ)=>{function BQ($,Z,Y,Q,J,X,z){try{var H=$[X](z),U=H.value}catch(G){Y(G);return}if(H.done)Z(U);else Promise.resolve(U).then(Q,J)}function K9($){return function(){var Z=this,Y=arguments;return new Promise(function(Q,J){var X=$.apply(Z,Y);function z(U){BQ(X,Q,J,z,H,"next",U)}function H(U){BQ(X,Q,J,z,H,"throw",U)}z(void 0)})}}var Q0=x(),W9=j1(),OQ=f(),q9=OQ.erase,VQ=OQ.cursor,J0=J1(),T$=J0.style,AQ=J0.clear,w$=J0.figures,F9=J0.wrap,j9=J0.entriesToDisplay,RQ=($,Z)=>$[Z]&&($[Z].value||$[Z].title||$[Z]),D9=($,Z)=>$[Z]&&($[Z].title||$[Z].value||$[Z]),M9=($,Z)=>{let Y=$.findIndex((Q)=>Q.value===Z||Q.title===Z);return Y>-1?Y:void 0};class IQ extends W9{constructor($={}){super($);this.msg=$.message,this.suggest=$.suggest,this.choices=$.choices,this.initial=typeof $.initial==="number"?$.initial:M9($.choices,$.initial),this.select=this.initial||$.cursor||0,this.i18n={noMatches:$.noMatches||"no matches found"},this.fallback=$.fallback||this.initial,this.clearFirst=$.clearFirst||!1,this.suggestions=[],this.input="",this.limit=$.limit||10,this.cursor=0,this.transform=T$.render($.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=AQ("",this.out.columns),this.complete(this.render),this.render()}set fallback($){this._fb=Number.isSafeInteger(parseInt($))?parseInt($):$}get fallback(){let $;if(typeof this._fb==="number")$=this.choices[this._fb];else if(typeof this._fb==="string")$={title:this._fb};return $||this._fb||{title:this.i18n.noMatches}}moveSelect($){if(this.select=$,this.suggestions.length>0)this.value=RQ(this.suggestions,$);else this.value=this.fallback.value;this.fire()}complete($){var Z=this;return K9(function*(){let Y=Z.completing=Z.suggest(Z.input,Z.choices),Q=yield Y;if(Z.completing!==Y)return;Z.suggestions=Q.map((X,z,H)=>({title:D9(H,z),value:RQ(H,z),description:X.description})),Z.completing=!1;let J=Math.max(Q.length-1,0);Z.moveSelect(Math.min(J,Z.select)),$&&$()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){if(this.clearFirst&&this.input.length>0)this.reset();else 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()}_($,Z){let Y=this.input.slice(0,this.cursor),Q=this.input.slice(this.cursor);this.input=`${Y}${$}${Q}`,this.cursor=Y.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let $=this.input.slice(0,this.cursor-1),Z=this.input.slice(this.cursor);this.input=`${$}${Z}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let $=this.input.slice(0,this.cursor),Z=this.input.slice(this.cursor+1);this.input=`${$}${Z}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){if(this.select===0)this.moveSelect(this.suggestions.length-1);else this.moveSelect(this.select-1);this.render()}down(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}next(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else 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($,Z,Y,Q){let J,X=Y?w$.arrowUp:Q?w$.arrowDown:" ",z=Z?Q0.cyan().underline($.title):$.title;if(X=(Z?Q0.cyan(w$.pointer)+" ":" ")+X,$.description){if(J=` - ${$.description}`,X.length+z.length+J.length>=this.out.columns||$.description.split(/\r?\n/).length>1)J=`
`+F9($.description,{margin:3,width:this.out.columns})}return X+" "+z+Q0.gray(J||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(VQ.hide);else this.out.write(AQ(this.outputText,this.out.columns));super.render();let $=j9(this.select,this.choices.length,this.limit),Z=$.startIndex,Y=$.endIndex;if(this.outputText=[T$.symbol(this.done,this.aborted,this.exited),Q0.bold(this.msg),T$.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 Q=this.suggestions.slice(Z,Y).map((J,X)=>this.renderOption(J,this.select===X+Z,X===0&&Z>0,X+Z===Y-1&&Y<this.choices.length)).join(`
`);this.outputText+=`
`+(Q||Q0.gray(this.fallback.title))}this.out.write(q9.line+VQ.to(0)+this.outputText)}}NQ.exports=IQ});var PQ=D((yG,SQ)=>{var L1=x(),L9=f(),B9=L9.cursor,V9=E$(),C$=J1(),TQ=C$.clear,wQ=C$.style,f1=C$.figures;class CQ extends V9{constructor($={}){$.overrideRender=!0;super($);this.inputValue="",this.clear=TQ("",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(){if(this.cursor===0)this.cursor=this.filteredOptions.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.filteredOptions.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(($)=>$.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){let $=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((Y)=>{if(this.inputValue){if(typeof Y.title==="string"){if(Y.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof Y.value==="string"){if(Y.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});let Z=this.filteredOptions.findIndex((Y)=>Y===$);this.cursor=Z<0?0:Z,this.render()}handleSpaceToggle(){let $=this.filteredOptions[this.cursor];if($.selected)$.selected=!1,this.render();else if($.disabled||this.value.filter((Z)=>Z.selected).length>=this.maxChoices)return this.bell();else $.selected=!0,this.render()}handleInputChange($){this.inputValue=this.inputValue+$,this.updateFilteredOptions()}_($,Z){if($===" ")this.handleSpaceToggle();else this.handleInputChange($)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
Instructions:
${f1.arrowUp}/${f1.arrowDown}: Highlight option
${f1.arrowLeft}/${f1.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`}return""}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:L1.gray("Enter something to filter")}
`}renderOption($,Z,Y){let Q;if(Z.disabled)Q=$===Y?L1.gray().underline(Z.title):L1.strikethrough().gray(Z.title);else Q=$===Y?L1.cyan().underline(Z.title):Z.title;return(Z.selected?L1.green(f1.radioOn):f1.radioOff)+" "+Q}renderDoneOrInstructions(){if(this.done)return this.value.filter((Z)=>Z.selected).map((Z)=>Z.title).join(", ");let $=[L1.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)$.push(L1.yellow(this.warn));return $.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(B9.hide);super.render();let $=[wQ.symbol(this.done,this.aborted),L1.bold(this.msg),wQ.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)$+=L1.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;$+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+$),this.clear=TQ($,this.out.columns)}}SQ.exports=CQ});var fQ=D((vG,xQ)=>{var kQ=x(),A9=j1(),hQ=J1(),_Q=hQ.style,R9=hQ.clear,yQ=f(),O9=yQ.erase,bQ=yQ.cursor;class vQ extends A9{constructor($={}){super($);this.msg=$.message,this.value=$.initial,this.initialValue=!!$.initial,this.yesMsg=$.yes||"yes",this.yesOption=$.yesOption||"(Y/n)",this.noMsg=$.no||"no",this.noOption=$.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()}_($,Z){if($.toLowerCase()==="y")return this.value=!0,this.submit();if($.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(bQ.hide);else this.out.write(R9(this.outputText,this.out.columns));super.render(),this.outputText=[_Q.symbol(this.done,this.aborted),kQ.bold(this.msg),_Q.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:kQ.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(O9.line+bQ.to(0)+this.outputText)}}xQ.exports=vQ});var uQ=D((xG,dQ)=>{dQ.exports={TextPrompt:GY(),SelectPrompt:jY(),TogglePrompt:RY(),DatePrompt:XQ(),NumberPrompt:FQ(),MultiselectPrompt:E$(),AutocompletePrompt:EQ(),AutocompleteMultiselectPrompt:PQ(),ConfirmPrompt:fQ()}});var mQ=D((gQ)=>{var o=gQ,I9=uQ(),C0=($)=>$;function G1($,Z,Y={}){return new Promise((Q,J)=>{let X=new I9[$](Z),z=Y.onAbort||C0,H=Y.onSubmit||C0,U=Y.onExit||C0;X.on("state",Z.onState||C0),X.on("submit",(G)=>Q(H(G))),X.on("exit",(G)=>Q(U(G))),X.on("abort",(G)=>J(z(G)))})}o.text=($)=>G1("TextPrompt",$);o.password=($)=>{return $.style="password",o.text($)};o.invisible=($)=>{return $.style="invisible",o.text($)};o.number=($)=>G1("NumberPrompt",$);o.date=($)=>G1("DatePrompt",$);o.confirm=($)=>G1("ConfirmPrompt",$);o.list=($)=>{let Z=$.separator||",";return G1("TextPrompt",$,{onSubmit:(Y)=>Y.split(Z).map((Q)=>Q.trim())})};o.toggle=($)=>G1("TogglePrompt",$);o.select=($)=>G1("SelectPrompt",$);o.multiselect=($)=>{$.choices=[].concat($.choices||[]);let Z=(Y)=>Y.filter((Q)=>Q.selected).map((Q)=>Q.value);return G1("MultiselectPrompt",$,{onAbort:Z,onSubmit:Z})};o.autocompleteMultiselect=($)=>{$.choices=[].concat($.choices||[]);let Z=(Y)=>Y.filter((Q)=>Q.selected).map((Q)=>Q.value);return G1("AutocompleteMultiselectPrompt",$,{onAbort:Z,onSubmit:Z})};var N9=($,Z)=>Promise.resolve(Z.filter((Y)=>Y.title.slice(0,$.length).toLowerCase()===$.toLowerCase()));o.autocomplete=($)=>{return $.suggest=$.suggest||N9,$.choices=[].concat($.choices||[]),G1("AutocompletePrompt",$)}});var rQ=D((dG,sQ)=>{function cQ($,Z){var Y=Object.keys($);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols($);if(Z)Q=Q.filter(function(J){return Object.getOwnPropertyDescriptor($,J).enumerable});Y.push.apply(Y,Q)}return Y}function lQ($){for(var Z=1;Z<arguments.length;Z++){var Y=arguments[Z]!=null?arguments[Z]:{};if(Z%2)cQ(Object(Y),!0).forEach(function(Q){E9($,Q,Y[Q])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties($,Object.getOwnPropertyDescriptors(Y));else cQ(Object(Y)).forEach(function(Q){Object.defineProperty($,Q,Object.getOwnPropertyDescriptor(Y,Q))})}return $}function E9($,Z,Y){if(Z in $)Object.defineProperty($,Z,{value:Y,enumerable:!0,configurable:!0,writable:!0});else $[Z]=Y;return $}function T9($,Z){var Y=typeof Symbol<"u"&&$[Symbol.iterator]||$["@@iterator"];if(!Y){if(Array.isArray($)||(Y=w9($))||Z&&$&&typeof $.length==="number"){if(Y)$=Y;var Q=0,J=function(){};return{s:J,n:function(){if(Q>=$.length)return{done:!0};return{done:!1,value:$[Q++]}},e:function(G){throw G},f:J}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var X=!0,z=!1,H;return{s:function(){Y=Y.call($)},n:function(){var G=Y.next();return X=G.done,G},e:function(G){z=!0,H=G},f:function(){try{if(!X&&Y.return!=null)Y.return()}finally{if(z)throw H}}}}function w9($,Z){if(!$)return;if(typeof $==="string")return pQ($,Z);var Y=Object.prototype.toString.call($).slice(8,-1);if(Y==="Object"&&$.constructor)Y=$.constructor.name;if(Y==="Map"||Y==="Set")return Array.from($);if(Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y))return pQ($,Z)}function pQ($,Z){if(Z==null||Z>$.length)Z=$.length;for(var Y=0,Q=Array(Z);Y<Z;Y++)Q[Y]=$[Y];return Q}function nQ($,Z,Y,Q,J,X,z){try{var H=$[X](z),U=H.value}catch(G){Y(G);return}if(H.done)Z(U);else Promise.resolve(U).then(Q,J)}function iQ($){return function(){var Z=this,Y=arguments;return new Promise(function(Q,J){var X=$.apply(Z,Y);function z(U){nQ(X,Q,J,z,H,"next",U)}function H(U){nQ(X,Q,J,z,H,"throw",U)}z(void 0)})}}var S$=mQ(),C9=["suggest","format","onState","validate","onRender","type"],aQ=()=>{};function C1(){return P$.apply(this,arguments)}function P$(){return P$=iQ(function*($=[],{onSubmit:Z=aQ,onCancel:Y=aQ}={}){let Q={},J=C1._override||{};$=[].concat($);let X,z,H,U,G,K,W=function(){var R=iQ(function*(B,A,I=!1){if(!I&&B.validate&&B.validate(A)!==!0)return;return B.format?yield B.format(A,Q):A});return function(A,I){return R.apply(this,arguments)}}();var q=T9($),F;try{for(q.s();!(F=q.n()).done;){z=F.value;var j=z;if(U=j.name,G=j.type,typeof G==="function")G=yield G(X,lQ({},Q),z),z.type=G;if(!G)continue;for(let R in z){if(C9.includes(R))continue;let B=z[R];z[R]=typeof B==="function"?yield B(X,lQ({},Q),K):B}if(K=z,typeof z.message!=="string")throw Error("prompt message is required");var L=z;if(U=L.name,G=L.type,S$[G]===void 0)throw Error(`prompt type (${G}) is not defined`);if(J[z.name]!==void 0){if(X=yield W(z,J[z.name]),X!==void 0){Q[U]=X;continue}}try{X=C1._injected?S9(C1._injected,z.initial):yield S$[G](z),Q[U]=X=yield W(z,X,!0),H=yield Z(z,X,Q)}catch(R){H=!(yield Y(z,Q))}if(H)return Q}}catch(R){q.e(R)}finally{q.f()}return Q}),P$.apply(this,arguments)}function S9($,Z){let Y=$.shift();if(Y instanceof Error)throw Y;return Y===void 0?Z:Y}function P9($){C1._injected=(C1._injected||[]).concat($)}function k9($){C1._override=Object.assign({},$)}sQ.exports=Object.assign(C1,{prompt:C1,prompts:S$,inject:P9,override:k9})});var oQ=D((uG,tQ)=>{tQ.exports=($,Z)=>{if($.meta&&$.name!=="escape")return;if($.ctrl){if($.name==="a")return"first";if($.name==="c")return"abort";if($.name==="d")return"abort";if($.name==="e")return"last";if($.name==="g")return"reset"}if(Z){if($.name==="j")return"down";if($.name==="k")return"up"}if($.name==="return")return"submit";if($.name==="enter")return"submit";if($.name==="backspace")return"delete";if($.name==="delete")return"deleteForward";if($.name==="abort")return"abort";if($.name==="escape")return"exit";if($.name==="tab")return"next";if($.name==="pagedown")return"nextPage";if($.name==="pageup")return"prevPage";if($.name==="home")return"home";if($.name==="end")return"end";if($.name==="up")return"up";if($.name==="down")return"down";if($.name==="right")return"right";if($.name==="left")return"left";return!1}});var S0=D((gG,eQ)=>{eQ.exports=($)=>{let Z=["[\\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("|"),Y=new RegExp(Z,"g");return typeof $==="string"?$.replace(Y,""):$}});var YJ=D((mG,ZJ)=>{var _9=S0(),{erase:$J,cursor:b9}=f(),h9=($)=>[..._9($)].length;ZJ.exports=function($,Z){if(!Z)return $J.line+b9.to(0);let Y=0,Q=$.split(/\r?\n/);for(let J of Q)Y+=1+Math.floor(Math.max(h9(J)-1,0)/Z);return $J.lines(Y)}});var k$=D((cG,QJ)=>{var X0={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},y9={arrowUp:X0.arrowUp,arrowDown:X0.arrowDown,arrowLeft:X0.arrowLeft,arrowRight:X0.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},v9=process.platform==="win32"?y9:X0;QJ.exports=v9});var XJ=D((lG,JJ)=>{var d1=x(),b1=k$(),_$=Object.freeze({password:{scale:1,render:($)=>"*".repeat($.length)},emoji:{scale:2,render:($)=>"\uD83D\uDE03".repeat($.length)},invisible:{scale:0,render:($)=>""},default:{scale:1,render:($)=>`${$}`}}),x9=($)=>_$[$]||_$.default,z0=Object.freeze({aborted:d1.red(b1.cross),done:d1.green(b1.tick),exited:d1.yellow(b1.cross),default:d1.cyan("?")}),f9=($,Z,Y)=>Z?z0.aborted:Y?z0.exited:$?z0.done:z0.default,d9=($)=>d1.gray($?b1.ellipsis:b1.pointerSmall),u9=($,Z)=>d1.gray($?Z?b1.pointerSmall:"+":b1.line);JJ.exports={styles:_$,render:x9,symbols:z0,symbol:f9,delimiter:d9,item:u9}});var HJ=D((pG,zJ)=>{var g9=S0();zJ.exports=function($,Z){let Y=String(g9($)||"").split(/\r?\n/);if(!Z)return Y.length;return Y.map((Q)=>Math.ceil(Q.length/Z)).reduce((Q,J)=>Q+J)}});var GJ=D((nG,UJ)=>{UJ.exports=($,Z={})=>{let Y=Number.isSafeInteger(parseInt(Z.margin))?Array(parseInt(Z.margin)).fill(" ").join(""):Z.margin||"",Q=Z.width;return($||"").split(/\r?\n/g).map((J)=>J.split(/\s+/g).reduce((X,z)=>{if(z.length+Y.length>=Q||X[X.length-1].length+z.length+1<Q)X[X.length-1]+=` ${z}`;else X.push(`${Y}${z}`);return X},[Y]).join(`
`)).join(`
`)}});var WJ=D((iG,KJ)=>{KJ.exports=($,Z,Y)=>{Y=Y||Z;let Q=Math.min(Z-Y,$-Math.floor(Y/2));if(Q<0)Q=0;let J=Math.min(Q+Y,Z);return{startIndex:Q,endIndex:J}}});var X1=D((aG,qJ)=>{qJ.exports={action:oQ(),clear:YJ(),style:XJ(),strip:S0(),figures:k$(),lines:HJ(),wrap:GJ(),entriesToDisplay:WJ()}});var B1=D((sG,DJ)=>{var FJ=E("readline"),{action:m9}=X1(),c9=E("events"),{beep:l9,cursor:p9}=f(),n9=x();class jJ extends c9{constructor($={}){super();this.firstRender=