npm-check-updates
Version:
Find newer versions of dependencies than what your package.json allows
48 lines • 1.08 MB
JavaScript
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const be=require("node:path"),z$=require("node:readline"),Sr=require("node:events"),$w=require("node:child_process"),mt=require("node:fs"),nr=require("node:os"),Ni=require("node:util"),Ge=require("node:fs/promises"),xt=require("node:url"),Xc=require("node:http"),a0=require("node:https"),u0=require("node:assert"),c0=require("node:buffer"),jr=require("node:stream"),la=require("node:string_decoder"),Rw=require("node:zlib"),xw=require("node:module"),l0=require("node:dns"),Tw=require("node:crypto"),Bs=require("node:net"),Jc=require("node:tls"),Ow=require("node:tty"),q$=require("node:timers/promises"),V$=require("node:querystring"),Y$=require("node:stream/consumers");var ue=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function st(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function K$(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}),r}var Bw={};let Zd,Iw,kw,Pw,Lw=!0;typeof process<"u"&&({FORCE_COLOR:Zd,NODE_DISABLE_COLORS:Iw,NO_COLOR:kw,TERM:Pw}=process.env||{},Lw=process.stdout&&process.stdout.isTTY);const qe={enabled:!Iw&&kw==null&&Pw!=="dumb"&&(Zd!=null&&Zd!=="0"||Lw),reset:Qe(0,0),bold:Qe(1,22),dim:Qe(2,22),italic:Qe(3,23),underline:Qe(4,24),inverse:Qe(7,27),hidden:Qe(8,28),strikethrough:Qe(9,29),black:Qe(30,39),red:Qe(31,39),green:Qe(32,39),yellow:Qe(33,39),blue:Qe(34,39),magenta:Qe(35,39),cyan:Qe(36,39),white:Qe(37,39),gray:Qe(90,39),grey:Qe(90,39),bgBlack:Qe(40,49),bgRed:Qe(41,49),bgGreen:Qe(42,49),bgYellow:Qe(43,49),bgBlue:Qe(44,49),bgMagenta:Qe(45,49),bgCyan:Qe(46,49),bgWhite:Qe(47,49)};function Zm(t,e){let r=0,n,s="",o="";for(;r<t.length;r++)n=t[r],s+=n.open,o+=n.close,~e.indexOf(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return s+e+o}function Z$(t,e){let r={has:t,keys:e};return r.reset=qe.reset.bind(r),r.bold=qe.bold.bind(r),r.dim=qe.dim.bind(r),r.italic=qe.italic.bind(r),r.underline=qe.underline.bind(r),r.inverse=qe.inverse.bind(r),r.hidden=qe.hidden.bind(r),r.strikethrough=qe.strikethrough.bind(r),r.black=qe.black.bind(r),r.red=qe.red.bind(r),r.green=qe.green.bind(r),r.yellow=qe.yellow.bind(r),r.blue=qe.blue.bind(r),r.magenta=qe.magenta.bind(r),r.cyan=qe.cyan.bind(r),r.white=qe.white.bind(r),r.gray=qe.gray.bind(r),r.grey=qe.grey.bind(r),r.bgBlack=qe.bgBlack.bind(r),r.bgRed=qe.bgRed.bind(r),r.bgGreen=qe.bgGreen.bind(r),r.bgYellow=qe.bgYellow.bind(r),r.bgBlue=qe.bgBlue.bind(r),r.bgMagenta=qe.bgMagenta.bind(r),r.bgCyan=qe.bgCyan.bind(r),r.bgWhite=qe.bgWhite.bind(r),r}function Qe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:qe.enabled?Zm(this.keys,n+""):n+""):n===void 0?Z$([t],[r]):qe.enabled?Zm([r],n+""):n+""}}var Hr=qe,X$=(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}},h0=t=>{const 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};const Xd="\x1B",ut=`${Xd}[`,J$="\x07",Jd={to(t,e){return e?`${ut}${e+1};${t+1}H`:`${ut}${t+1}G`},move(t,e){let r="";return t<0?r+=`${ut}${-t}D`:t>0&&(r+=`${ut}${t}C`),e<0?r+=`${ut}${-e}A`:e>0&&(r+=`${ut}${e}B`),r},up:(t=1)=>`${ut}${t}A`,down:(t=1)=>`${ut}${t}B`,forward:(t=1)=>`${ut}${t}C`,backward:(t=1)=>`${ut}${t}D`,nextLine:(t=1)=>`${ut}E`.repeat(t),prevLine:(t=1)=>`${ut}F`.repeat(t),left:`${ut}G`,hide:`${ut}?25l`,show:`${ut}?25h`,save:`${Xd}7`,restore:`${Xd}8`},Q$={up:(t=1)=>`${ut}S`.repeat(t),down:(t=1)=>`${ut}T`.repeat(t)},eR={screen:`${ut}2J`,up:(t=1)=>`${ut}1J`.repeat(t),down:(t=1)=>`${ut}J`.repeat(t),line:`${ut}2K`,lineEnd:`${ut}K`,lineStart:`${ut}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Jd.up():"");return t&&(e+=Jd.left),e}};var Ur={cursor:Jd,scroll:Q$,erase:eR,beep:J$};const tR=h0,{erase:Xm,cursor:rR}=Ur,iR=t=>[...tR(t)].length;var nR=function(t,e){if(!e)return Xm.line+rR.to(0);let r=0;const n=t.split(/\r?\n/);for(let s of n)r+=1+Math.floor(Math.max(iR(s)-1,0)/e);return Xm.lines(r)};const To={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},sR={arrowUp:To.arrowUp,arrowDown:To.arrowDown,arrowLeft:To.arrowLeft,arrowRight:To.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},oR=process.platform==="win32"?sR:To;var Nw=oR;const ps=Hr,Nn=Nw,Qd=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),aR=t=>Qd[t]||Qd.default,Oo=Object.freeze({aborted:ps.red(Nn.cross),done:ps.green(Nn.tick),exited:ps.yellow(Nn.cross),default:ps.cyan("?")}),uR=(t,e,r)=>e?Oo.aborted:r?Oo.exited:t?Oo.done:Oo.default,cR=t=>ps.gray(t?Nn.ellipsis:Nn.pointerSmall),lR=(t,e)=>ps.gray(t?e?Nn.pointerSmall:"+":Nn.line);var hR={styles:Qd,render:aR,symbols:Oo,symbol:uR,delimiter:cR,item:lR};const fR=h0;var dR=function(t,e){let r=String(fR(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,s)=>n+s):r.length},pR=(t,e={})=>{const r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((o,a)=>(a.length+r.length>=n||o[o.length-1].length+a.length+1<n?o[o.length-1]+=` ${a}`:o.push(`${r}${a}`),o),[r]).join(`
`)).join(`
`)},gR=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let s=Math.min(n+r,e);return{startIndex:n,endIndex:s}},oi={action:X$,clear:nR,style:hR,strip:h0,figures:Nw,lines:dR,wrap:pR,entriesToDisplay:gR};const Jm=z$,{action:mR}=oi,yR=Sr,{beep:DR,cursor:ER}=Ur,vR=Hr;let bR=class extends yR{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);const r=Jm.createInterface({input:this.in,escapeCodeTimeout:50});Jm.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);const n=(s,o)=>{let a=mR(o,this.isSelect);a===!1?this._&&this._(s,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(ER.show),this.in.removeListener("keypress",n),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",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(DR)}render(){this.onRender(vR),this.firstRender&&(this.firstRender=!1)}};var dn=bR;const tu=Hr,wR=dn,{erase:_R,cursor:Xs}=Ur,{style:ch,clear:lh,lines:AR,figures:SR}=oi;class CR extends wR{constructor(e={}){super(e),this.transform=ch.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=lh("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=tu.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()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${n}${e}${s}`,this.red=!1,this.cursor=this.placeholder?0:n.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(Xs.down(AR(this.outputError,this.out.columns)-1)+lh(this.outputError,this.out.columns)),this.out.write(lh(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ch.symbol(this.done,this.aborted),tu.bold(this.msg),ch.delimiter(this.done),this.red?tu.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,r,n)=>e+`
${n?" ":SR.pointerSmall} ${tu.red().italic(r)}`,"")),this.out.write(_R.line+Xs.to(0)+this.outputText+Xs.save+this.outputError+Xs.restore+Xs.move(this.cursorOffset,0)))}}var FR=CR;const ci=Hr,$R=dn,{style:Qm,clear:e1,figures:ru,wrap:RR,entriesToDisplay:xR}=oi,{cursor:TR}=Ur;class OR extends $R{constructor(e={}){super(e),this.isSelect=!0,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,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n: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=e1("",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(TR.hide):this.out.write(e1(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=xR(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[Qm.symbol(this.done,this.aborted),ci.bold(this.msg),Qm.delimiter(!1),this.done?this.selection.title:this.selection.disabled?ci.yellow(this.warn):ci.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let n=e;n<r;n++){let s,o,a="",u=this.choices[n];n===e&&e>0?o=ru.arrowUp:n===r-1&&r<this.choices.length?o=ru.arrowDown:o=" ",u.disabled?(s=this.cursor===n?ci.gray().underline(u.title):ci.strikethrough().gray(u.title),o=(this.cursor===n?ci.bold().gray(ru.pointer)+" ":" ")+o):(s=this.cursor===n?ci.cyan().underline(u.title):u.title,o=(this.cursor===n?ci.cyan(ru.pointer)+" ":" ")+o,u.description&&this.cursor===n&&(a=` - ${u.description}`,(o.length+s.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
`+RR(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${s}${ci.gray(a)}
`}}this.out.write(this.outputText)}}var BR=OR;const iu=Hr,IR=dn,{style:t1,clear:kR}=oi,{cursor:r1,erase:PR}=Ur;class LR extends IR{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(r1.hide):this.out.write(kR(this.outputText,this.out.columns)),super.render(),this.outputText=[t1.symbol(this.done,this.aborted),iu.bold(this.msg),t1.delimiter(this.done),this.value?this.inactive:iu.cyan().underline(this.inactive),iu.gray("/"),this.value?iu.cyan().underline(this.active):this.active].join(" "),this.out.write(PR.line+r1.to(0)+this.outputText))}}var NR=LR;let MR=class ep{constructor({token:e,date:r,parts:n,locales:s}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=s||{}}up(){}down(){}next(){const e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof ep)}setTo(e){}prev(){let e=[].concat(this.parts).reverse();const r=e.indexOf(this);return e.find((n,s)=>s>r&&n instanceof ep)}toString(){return String(this.date)}};var Mi=MR;const jR=Mi;let HR=class extends jR{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}};var UR=HR;const GR=Mi,WR=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");let zR=class extends GR{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+WR(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};var qR=zR;const VR=Mi;let YR=class extends VR{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}};var KR=YR;const ZR=Mi;let XR=class extends ZR{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)}};var JR=XR;const QR=Mi;let e8=class extends QR{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}};var t8=e8;const r8=Mi;let i8=class extends r8{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)}};var n8=i8;const s8=Mi;let o8=class extends s8{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}};var a8=o8;const u8=Mi;let c8=class extends u8{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}};var l8=c8,h8={DatePart:Mi,Meridiem:UR,Day:qR,Hours:KR,Milliseconds:JR,Minutes:t8,Month:n8,Seconds:a8,Year:l8};const hh=Hr,f8=dn,{style:i1,clear:n1,figures:d8}=oi,{erase:p8,cursor:s1}=Ur,{DatePart:o1,Meridiem:g8,Day:m8,Hours:y8,Milliseconds:D8,Minutes:E8,Month:v8,Seconds:b8,Year:w8}=h8,_8=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,a1={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new m8(t),3:t=>new v8(t),4:t=>new w8(t),5:t=>new g8(t),6:t=>new y8(t),7:t=>new E8(t),8:t=>new b8(t),9:t=>new D8(t)},A8={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 S8 extends f8{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(A8,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=n1("",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=_8.exec(e);){let s=r.shift(),o=r.findIndex(a=>a!=null);this.parts.push(o in a1?a1[o]({token:r[o]||s,date:this.date,parts:this.parts,locales:this.locales}):r[o]||s)}let n=this.parts.reduce((s,o)=>(typeof o=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=o:s.push(o),s),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof o1)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof o1)),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(s1.hide):this.out.write(n1(this.outputText,this.out.columns)),super.render(),this.outputText=[i1.symbol(this.done,this.aborted),hh.bold(this.msg),i1.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?hh.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((e,r,n)=>e+`
${n?" ":d8.pointerSmall} ${hh.red().italic(r)}`,"")),this.out.write(p8.line+s1.to(0)+this.outputText))}}var C8=S8;const nu=Hr,F8=dn,{cursor:su,erase:$8}=Ur,{style:fh,figures:R8,clear:u1,lines:x8}=oi,T8=/[0-9]/,dh=t=>t!==void 0,c1=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r};class O8 extends F8{constructor(e={}){super(e),this.transform=fh.render(e.style),this.msg=e.message,this.initial=dh(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=dh(e.min)?e.min:-1/0,this.max=dh(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=nu.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${c1(e,this.round)}`),this._value=c1(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||T8.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()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();const n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,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(su.down(x8(this.outputError,this.out.columns)-1)+u1(this.outputError,this.out.columns)),this.out.write(u1(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[fh.symbol(this.done,this.aborted),nu.bold(this.msg),fh.delimiter(this.done),!this.done||!this.done&&!this.placeholder?nu[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,r,n)=>e+`
${n?" ":R8.pointerSmall} ${nu.red().italic(r)}`,"")),this.out.write($8.line+su.to(0)+this.outputText+su.save+this.outputError+su.restore))}}var B8=O8;const zr=Hr,{cursor:I8}=Ur,k8=dn,{clear:l1,figures:Gi,style:h1,wrap:P8,entriesToDisplay:L8}=oi;let N8=class extends k8{constructor(e={}){super(e),this.isSelect=!0,this.msg=e.message,this.cursorStart=e.choices.findIndex(r=>!r.heading),this.cursor=e.cursor||this.cursorStart,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,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled,heading:r&&r.heading})),this.clear=l1("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=this.cursorStart,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(){const 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=this.cursorStart,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.value[this.cursor].heading&&this.next(),this.render()}up(){this.cursor===this.cursorStart?this.cursor=this.value.length-1:(this.cursor--,this.value[this.cursor].heading&&this.up()),this.render()}down(){this.cursor===this.value.length-1?this.cursor=this.cursorStart:(this.cursor++,this.value[this.cursor].heading&&this.down()),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(){const 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();const e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled&&!r.heading).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:
${Gi.arrowUp}/${Gi.arrowDown}: Highlight option
${Gi.arrowLeft}/${Gi.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?` a: Toggle all
`:"")+" enter/return: Complete answer":""}renderOption(e,r,n,s){const o=(e===n?"❯ ":" ")+(r.selected?zr.green(Gi.radioOn):Gi.radioOff)+" ";let a,u;if(r.disabled)a=e===n?zr.gray(r.title):zr.strikethrough().gray(r.title);else{if(r.heading)return a=r.title,a+zr.gray(u||"");a=r.title,e===n&&r.description&&(u=` - ${r.description}`,(o.length+a.length+u.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(u=`
`+P8(r.description,{margin:o.length,width:this.out.columns})))}return o+a+zr.gray(u||"")}paginateOptions(e){if(e.length===0)return zr.red("No matches for this query.");let{startIndex:r,endIndex:n}=L8(this.cursor,e.length,this.optionsPerPage),s,o=[];for(let a=r;a<n;a++)a===r&&r>0?s=Gi.arrowUp:a===n-1&&n<e.length?s=Gi.arrowDown:s=" ",o.push(this.renderOption(this.cursor,e[a],a,s));return`
`+o.join(`
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return"";const e=[zr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(zr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(I8.hide),super.render();let e=[h1.symbol(this.done,this.aborted),zr.bold(this.msg),h1.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=zr.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=l1(e,this.out.columns)}};var Mw=N8;const Js=Hr,M8=dn,{erase:j8,cursor:f1}=Ur,{style:ph,clear:d1,figures:gh,wrap:H8,entriesToDisplay:U8}=oi,p1=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),G8=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),W8=(t,e)=>{const r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0};class z8 extends M8{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:W8(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=ph.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=d1("",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=p1(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){const r=this.completing=this.suggest(this.input,this.choices),n=await r;if(this.completing!==r)return;this.suggestions=n.map((o,a,u)=>({title:G8(u,a),value:p1(u,a),description:o.description})),this.completing=!1;const s=Math.max(n.length-1,0);this.moveSelect(Math.min(s,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),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 n=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${n}${e}${s}`,this.cursor=n.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,n,s){let o,a=n?gh.arrowUp:s?gh.arrowDown:" ",u=r?Js.cyan().underline(e.title):e.title;return a=(r?Js.cyan(gh.pointer)+" ":" ")+a,e.description&&(o=` - ${e.description}`,(a.length+u.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
`+H8(e.description,{margin:3,width:this.out.columns}))),a+" "+u+Js.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(f1.hide):this.out.write(d1(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=U8(this.select,this.choices.length,this.limit);if(this.outputText=[ph.symbol(this.done,this.aborted,this.exited),Js.bold(this.msg),ph.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const n=this.suggestions.slice(e,r).map((s,o)=>this.renderOption(s,this.select===o+e,o===0&&e>0,o+e===r-1&&r<this.choices.length)).join(`
`);this.outputText+=`
`+(n||Js.gray(this.fallback.title))}this.out.write(j8.line+f1.to(0)+this.outputText)}}var q8=z8;const li=Hr,{cursor:V8}=Ur,Y8=Mw,{clear:g1,style:m1,figures:Xn}=oi;class K8 extends Y8{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=g1("",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(){const e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){const 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:
${Xn.arrowUp}/${Xn.arrowDown}: Highlight option
${Xn.arrowLeft}/${Xn.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`:""}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:li.gray("Enter something to filter")}
`}renderOption(e,r,n,s){const o=(r.selected?li.green(Xn.radioOn):Xn.radioOff)+" "+s+" ";let a;return r.disabled?a=e===n?li.gray().underline(r.title):li.strikethrough().gray(r.title):a=e===n?li.cyan().underline(r.title):r.title,o+a}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");const e=[li.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(li.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(V8.hide),super.render();let e=[m1.symbol(this.done,this.aborted),li.bold(this.msg),m1.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=li.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=g1(e,this.out.columns)}}var Z8=K8;const y1=Hr,X8=dn,{style:D1,clear:J8}=oi,{erase:Q8,cursor:E1}=Ur;class ex extends X8{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(){if(this.closed)return;this.firstRender?this.out.write(E1.hide):this.out.write(J8(this.outputText,this.out.columns)),super.render();const e=this.aborted||this.done&&!this.value;this.outputText=[D1.symbol(this.done,e),y1.bold(this.msg),D1.delimiter(this.done),this.done?this.value&&!this.aborted?this.yesMsg:this.noMsg:y1.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Q8.line+E1.to(0)+this.outputText)}}var tx=ex,rx={TextPrompt:FR,SelectPrompt:BR,TogglePrompt:NR,DatePrompt:C8,NumberPrompt:B8,MultiselectPrompt:Mw,AutocompletePrompt:q8,AutocompleteMultiselectPrompt:Z8,ConfirmPrompt:tx};(function(t){const e=t,r=rx,n=a=>a;function s(a,u,c={}){return new Promise((l,h)=>{const d=new r[a](u),f=c.onAbort||n,g=c.onSubmit||n,p=c.onExit||n;d.on("state",u.onState||n),d.on("submit",m=>l(g(m))),d.on("exit",m=>l(p(m))),d.on("abort",m=>h(f(m)))})}e.text=a=>s("TextPrompt",a),e.password=a=>(a.style="password",e.text(a)),e.invisible=a=>(a.style="invisible",e.text(a)),e.number=a=>s("NumberPrompt",a),e.date=a=>s("DatePrompt",a),e.confirm=a=>s("ConfirmPrompt",a),e.list=a=>{const u=a.separator||",";return s("TextPrompt",a,{onSubmit:c=>c.split(u).map(l=>l.trim())})},e.toggle=a=>s("TogglePrompt",a),e.select=a=>s("SelectPrompt",a),e.multiselect=a=>{a.choices=[].concat(a.choices||[]);const u=c=>c.filter(l=>l.selected).map(l=>l.value);return s("MultiselectPrompt",a,{onAbort:u,onSubmit:u})},e.autocompleteMultiselect=a=>{a.choices=[].concat(a.choices||[]);const u=c=>c.filter(l=>l.selected).map(l=>l.value);return s("AutocompleteMultiselectPrompt",a,{onAbort:u,onSubmit:u})};const o=(a,u)=>Promise.resolve(u.filter(c=>c.title.slice(0,a.length).toLowerCase()===a.toLowerCase()));e.autocomplete=a=>(a.suggest=a.suggest||o,a.choices=[].concat(a.choices||[]),s("AutocompletePrompt",a))})(Bw);const tp=Bw,ix=["suggest","format","onState","validate","onRender","type"],v1=()=>{};async function en(t=[],{onSubmit:e=v1,onCancel:r=v1}={}){const n={},s=en._override||{};t=[].concat(t);let o,a,u,c,l,h;const d=async(f,g,p=!1)=>{if(!(!p&&f.validate&&f.validate(g)!==!0))return f.format?await f.format(g,n):g};for(a of t)if({name:c,type:l}=a,typeof l=="function"&&(l=await l(o,{...n},a),a.type=l),!!l){for(let f in a){if(ix.includes(f))continue;let g=a[f];a[f]=typeof g=="function"?await g(o,{...n},h):g}if(h=a,typeof a.message!="string")throw new Error("prompt message is required");if({name:c,type:l}=a,tp[l]===void 0)throw new Error(`prompt type (${l}) is not defined`);if(s[a.name]!==void 0&&(o=await d(a,s[a.name]),o!==void 0)){n[c]=o;continue}try{o=en._injected?nx(en._injected,a.initial):await tp[l](a),n[c]=o=await d(a,o,!0),u=await e(a,o,n)}catch{u=!await r(a,n)}if(u)return n}return n}function nx(t,e){const r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function sx(t){en._injected=(en._injected||[]).concat(t)}function ox(t){en._override=Object.assign({},t)}var ax=Object.assign(en,{prompt:en,prompts:tp,inject:sx,override:ox}),ux=ax;const bc=st(ux);var Is={exports:{}},mh,b1;function cx(){if(b1)return mh;b1=1,mh=n,n.sync=s;var t=mt;function e(o,a){var u=a.pathExt!==void 0?a.pathExt:process.env.PATHEXT;if(!u||(u=u.split(";"),u.indexOf("")!==-1))return!0;for(var c=0;c<u.length;c++){var l=u[c].toLowerCase();if(l&&o.substr(-l.length).toLowerCase()===l)return!0}return!1}function r(o,a,u){return!o.isSymbolicLink()&&!o.isFile()?!1:e(a,u)}function n(o,a,u){t.stat(o,function(c,l){u(c,c?!1:r(l,o,a))})}function s(o,a){return r(t.statSync(o),o,a)}return mh}var yh,w1;function lx(){if(w1)return yh;w1=1,yh=e,e.sync=r;var t=mt;function e(o,a,u){t.stat(o,function(c,l){u(c,c?!1:n(l,a))})}function r(o,a){return n(t.statSync(o),a)}function n(o,a){return o.isFile()&&s(o,a)}function s(o,a){var u=o.mode,c=o.uid,l=o.gid,h=a.uid!==void 0?a.uid:process.getuid&&process.getuid(),d=a.gid!==void 0?a.gid:process.getgid&&process.getgid(),f=parseInt("100",8),g=parseInt("010",8),p=parseInt("001",8),m=f|g,E=u&p||u&g&&l===d||u&f&&c===h||u&m&&h===0;return E}return yh}var wc;process.platform==="win32"||ue.TESTING_WINDOWS?wc=cx():wc=lx();var hx=f0;f0.sync=fx;function f0(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,s){f0(t,e||{},function(o,a){o?s(o):n(a)})})}wc(t,e||{},function(n,s){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,s=!1),r(n,s)})}function fx(t,e){try{return wc.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}const as=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",jw=be,dx=as?";":":",Hw=hx,Uw=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Gw=(t,e)=>{const r=e.colon||dx,n=t.match(/\//)||as&&t.match(/\\/)?[""]:[...as?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],s=as?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=as?s.split(r):[""];return as&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:s}},Ww=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});const{pathEnv:n,pathExt:s,pathExtExe:o}=Gw(t,e),a=[],u=l=>new Promise((h,d)=>{if(l===n.length)return e.all&&a.length?h(a):d(Uw(t));const f=n[l],g=/^".*"$/.test(f)?f.slice(1,-1):f,p=jw.join(g,t),m=!g&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;h(c(m,l,0))}),c=(l,h,d)=>new Promise((f,g)=>{if(d===s.length)return f(u(h+1));const p=s[d];Hw(l+p,{pathExt:o},(m,E)=>{if(!m&&E)if(e.all)a.push(l+p);else return f(l+p);return f(c(l,h,d+1))})});return r?u(0).then(l=>r(null,l),r):u(0)},px=(t,e)=>{e=e||{};const{pathEnv:r,pathExt:n,pathExtExe:s}=Gw(t,e),o=[];for(let a=0;a<r.length;a++){const u=r[a],c=/^".*"$/.test(u)?u.slice(1,-1):u,l=jw.join(c,t),h=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+l:l;for(let d=0;d<n.length;d++){const f=h+n[d];try{if(Hw.sync(f,{pathExt:s}))if(e.all)o.push(f);else return f}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw Uw(t)};var gx=Ww;Ww.sync=px;var d0={exports:{}};const zw=(t={})=>{const e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};d0.exports=zw;d0.exports.default=zw;var mx=d0.exports;const _1=be,yx=gx,Dx=mx;function A1(t,e){const r=t.options.env||process.env,n=process.cwd(),s=t.options.cwd!=null,o=s&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let a;try{a=yx.sync(t.command,{path:r[Dx({env:r})],pathExt:e?_1.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return a&&(a=_1.resolve(s?t.options.cwd:"",a)),a}function Ex(t){return A1(t)||A1(t,!0)}var vx=Ex,p0={};const rp=/([()\][%!^"`<>&|;, *?])/g;function bx(t){return t=t.replace(rp,"^$1"),t}function wx(t,e){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(rp,"^$1"),e&&(t=t.replace(rp,"^$1")),t}p0.command=bx;p0.argument=wx;var _x=/^#!(.*)/;const Ax=_x;var Sx=(t="")=>{const e=t.match(Ax);if(!e)return null;const[r,n]=e[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?n:n?`${s} ${n}`:s};const Dh=mt,Cx=Sx;function Fx(t){const r=Buffer.alloc(150);let n;try{n=Dh.openSync(t,"r"),Dh.readSync(n,r,0,150,0),Dh.closeSync(n)}catch{}return Cx(r.toString())}var $x=Fx;const Rx=be,S1=vx,C1=p0,xx=$x,Tx=process.platform==="win32",Ox=/\.(?:com|exe)$/i,Bx=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Ix(t){t.file=S1(t);const e=t.file&&xx(t.file);return e?(t.args.unshift(t.file),t.command=e,S1(t)):t.file}function kx(t){if(!Tx)return t;const e=Ix(t),r=!Ox.test(e);if(t.options.forceShell||r){const n=Bx.test(e);t.command=Rx.normalize(t.command),t.command=C1.command(t.command),t.args=t.args.map(o=>C1.argument(o,n));const s=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${s}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function Px(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);const n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:kx(n)}var Lx=Px;const g0=process.platform==="win32";function m0(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function Nx(t,e){if(!g0)return;const r=t.emit;t.emit=function(n,s){if(n==="exit"){const o=qw(s,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function qw(t,e){return g0&&t===1&&!e.file?m0(e.original,"spawn"):null}function Mx(t,e){return g0&&t===1&&!e.file?m0(e.original,"spawnSync"):null}var jx={hookChildProcess:Nx,verifyENOENT:qw,verifyENOENTSync:Mx,notFoundError:m0};const Vw=$w,y0=Lx,D0=jx;function Yw(t,e,r){const n=y0(t,e,r),s=Vw.spawn(n.command,n.args,n.options);return D0.hookChildProcess(s,n),s}function Hx(t,e,r){const n=y0(t,e,r),s=Vw.spawnSync(n.command,n.args,n.options);return s.error=s.error||D0.verifyENOENTSync(s.status,n),s}Is.exports=Yw;Is.exports.spawn=Yw;Is.exports.sync=Hx;Is.exports._parse=y0;Is.exports._enoent=D0;var Ux=Is.exports;const Gx=Ux,Wx=(t,e,r={},n={})=>{r.rejectOnError===void 0&&(r.rejectOnError=!0);let s="",o="";const a=Gx(t,e,n);return new Promise((u,c)=>{r.stdin!==void 0&&r.stdin!=null&&a.stdin.write(r.stdin),a.stdin.end(),a.stdout.on("data",l=>{s+=l,r.stdout&&r.stdout(l)}),a.stderr.on("data",l=>{o+=l,r.stderr&&r.stderr(l)}),r.rejectOnError&&a.addListener("error",c),a.on("close",l=>{l!==0&&r.rejectOnError?c(o):u({stdout:s,stderr:o})})})};var zx=Wx;const ir=st(zx),qx="npm-check-updates",Vx="17.1.11",Yx="Tomas Junnonen <tomas1@gmail.com>",Kx="Apache-2.0",Zx=["Raine Revere (https://github.com/raineorshine)","Imamuzzaki Abu Salam <imamuzzaki@gmail.com>"],Xx="Find newer versions of dependencies than what your package.json allows",Jx=["dependencies","npm","package.json","update","upgrade","versions"],Qx={node:"^18.18.0 || >=20.0.0",npm:">=8.12.1"},e3="build/index.js",t3="build/index.d.ts",r3={build:"rimraf build && npm run build:options && vite build","build:options":"vite-node src/scripts/build-options.ts","build:analyze":"rimraf build && npm run build:options && ANALYZER=true vite build",lint:"cross-env FORCE_COLOR=1 npm-run-all --parallel --aggregate-output lint:*","lint:lockfile":"lockfile-lint","lint:markdown":'markdownlint "**/*.md" --ignore "**/node_modules/**/*.md" --ignore build --config .markdownlint.js',"lint:src":"eslint --cache --cache-location node_modules/.cache/.eslintcache --ignore-path .gitignore --report-unused-disable-directives .",prepare:"src/scripts/install-hooks",prepublishOnly:"npm run build",prettier:"prettier . --check",test:"npm run test:unit && npm run test:e2e","test:bun":"test/bun-install.sh && mocha test/bun","test:unit":"mocha test test/package-managers/*","test:e2e":"./test/e2e.sh",ncu:"node build/cli.js"},i3={"npm-check-updates":"build/cli.js",ncu:"build/cli.js"},n3={type:"git",url:"git+https://github.com/raineorshine/npm-check-updates.git"},s3="https://github.com/raineorshine/npm-check-updates",o3={url:"https://github.com/raineorshine/npm-check-updates/issues"},a3={ip:"2.0.1",jsonparse:"https://github.com/ARitz-Cracker/jsonparse/tree/patch-1","@yarnpkg/parsers":"2.6.0"},u3={"@trivago/prettier-plugin-sort-imports":"^4.3.0","@types/chai":"^4.3.19","@types/chai-as-promised":"^8.0.0","@types/chai-string":"^1.4.5","@types/cli-table":"^0.3.4","@types/hosted-git-info":"^3.0.5","@types/ini":"^4.1.1","@types/js-yaml":"^4.0.9","@types/json-parse-helpfulerror":"^1.0.3","@types/jsonlines":"^0.1.5","@types/lodash":"^4.17.10","@types/mocha":"^10.0.9","@types/node":"^22.7.5","@types/npm-registry-fetch":"^8.0.7","@types/parse-github-url":"^1.0.3","@types/picomatch":"^3.0.1","@types/progress":"^2.0.7","@types/prompts":"^2.4.9","@types/remote-git-tags":"^4.0.2","@types/semver":"^7.5.8","@types/semver-utils":"^1.1.3","@types/sinon":"^17.0.3","@types/update-notifier":"^6