UNPKG

frontlook-react

Version:

128 lines 259 kB
#!/usr/bin/env node
"use strict";var $f=Object.create;var xa=Object.defineProperty;var Bf=Object.getOwnPropertyDescriptor;var qf=Object.getOwnPropertyNames;var jf=Object.getPrototypeOf,Uf=Object.prototype.hasOwnProperty;var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Gf=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of qf(e))!Uf.call(t,s)&&s!==r&&xa(t,s,{get:()=>e[s],enumerable:!(i=Bf(e,s))||i.enumerable});return t};var yr=(t,e,r)=>(r=t!=null?$f(jf(t)):{},Gf(e||!t||!t.__esModule?xa(r,"default",{value:t,enumerable:!0}):r,t));var U=S((Iw,ja)=>{"use strict";var{FORCE_COLOR:sm,NODE_DISABLE_COLORS:nm,TERM:om}=process.env,D={enabled:!nm&&om!=="dumb"&&sm!=="0",reset:P(0,0),bold:P(1,22),dim:P(2,22),italic:P(3,23),underline:P(4,24),inverse:P(7,27),hidden:P(8,28),strikethrough:P(9,29),black:P(30,39),red:P(31,39),green:P(32,39),yellow:P(33,39),blue:P(34,39),magenta:P(35,39),cyan:P(36,39),white:P(37,39),gray:P(90,39),grey:P(90,39),bgBlack:P(40,49),bgRed:P(41,49),bgGreen:P(42,49),bgYellow:P(43,49),bgBlue:P(44,49),bgMagenta:P(45,49),bgCyan:P(46,49),bgWhite:P(47,49)};function qa(t,e){let r=0,i,s="",n="";for(;r<t.length;r++)i=t[r],s+=i.open,n+=i.close,e.includes(i.close)&&(e=e.replace(i.rgx,i.close+i.open));return s+e+n}function am(t,e){let r={has:t,keys:e};return r.reset=D.reset.bind(r),r.bold=D.bold.bind(r),r.dim=D.dim.bind(r),r.italic=D.italic.bind(r),r.underline=D.underline.bind(r),r.inverse=D.inverse.bind(r),r.hidden=D.hidden.bind(r),r.strikethrough=D.strikethrough.bind(r),r.black=D.black.bind(r),r.red=D.red.bind(r),r.green=D.green.bind(r),r.yellow=D.yellow.bind(r),r.blue=D.blue.bind(r),r.magenta=D.magenta.bind(r),r.cyan=D.cyan.bind(r),r.white=D.white.bind(r),r.gray=D.gray.bind(r),r.grey=D.grey.bind(r),r.bgBlack=D.bgBlack.bind(r),r.bgRed=D.bgRed.bind(r),r.bgGreen=D.bgGreen.bind(r),r.bgYellow=D.bgYellow.bind(r),r.bgBlue=D.bgBlue.bind(r),r.bgMagenta=D.bgMagenta.bind(r),r.bgCyan=D.bgCyan.bind(r),r.bgWhite=D.bgWhite.bind(r),r}function P(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),i===void 0?this:D.enabled?qa(this.keys,i+""):i+""):i===void 0?am([t],[r]):D.enabled?qa([r],i+""):i+""}}ja.exports=D});var Ga=S((Mw,Ua)=>{"use strict";Ua.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var ai=S((kw,za)=>{"use strict";za.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var z=S((Dw,Ha)=>{"use strict";var Ts="\x1B",G=`${Ts}[`,lm="\x07",Cs={to(t,e){return e?`${G}${e+1};${t+1}H`:`${G}${t+1}G`},move(t,e){let r="";return t<0?r+=`${G}${-t}D`:t>0&&(r+=`${G}${t}C`),e<0?r+=`${G}${-e}A`:e>0&&(r+=`${G}${e}B`),r},up:(t=1)=>`${G}${t}A`,down:(t=1)=>`${G}${t}B`,forward:(t=1)=>`${G}${t}C`,backward:(t=1)=>`${G}${t}D`,nextLine:(t=1)=>`${G}E`.repeat(t),prevLine:(t=1)=>`${G}F`.repeat(t),left:`${G}G`,hide:`${G}?25l`,show:`${G}?25h`,save:`${Ts}7`,restore:`${Ts}8`},hm={up:(t=1)=>`${G}S`.repeat(t),down:(t=1)=>`${G}T`.repeat(t)},um={screen:`${G}2J`,up:(t=1)=>`${G}1J`.repeat(t),down:(t=1)=>`${G}J`.repeat(t),line:`${G}2K`,lineEnd:`${G}K`,lineStart:`${G}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Cs.up():"");return t&&(e+=Cs.left),e}};Ha.exports={cursor:Cs,scroll:hm,erase:um,beep:lm}});var Ka=S((Nw,Za)=>{"use strict";function cm(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=dm(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var i=0,s=function(){};return{s,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(h){throw h},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,a;return{s:function(){r=r.call(t)},n:function(){var h=r.next();return n=h.done,h},e:function(h){o=!0,a=h},f:function(){try{!n&&r.return!=null&&r.return()}finally{if(o)throw a}}}}function dm(t,e){if(t){if(typeof t=="string")return Ya(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ya(t,e)}}function Ya(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}var fm=ai(),Va=z(),Wa=Va.erase,mm=Va.cursor,pm=t=>[...fm(t)].length;Za.exports=function(t,e){if(!e)return Wa.line+mm.to(0);let r=0,i=t.split(/\r?\n/);var s=cm(i),n;try{for(s.s();!(n=s.n()).done;){let o=n.value;r+=1+Math.floor(Math.max(pm(o)-1,0)/e)}}catch(o){s.e(o)}finally{s.f()}return Wa.lines(r)}});var xs=S((Fw,Xa)=>{"use strict";var wr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},gm={arrowUp:wr.arrowUp,arrowDown:wr.arrowDown,arrowLeft:wr.arrowLeft,arrowRight:wr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},ym=process.platform==="win32"?gm:wr;Xa.exports=ym});var Qa=S((Pw,Ja)=>{"use strict";var qt=U(),bt=xs(),As=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),vm=t=>As[t]||As.default,Sr=Object.freeze({aborted:qt.red(bt.cross),done:qt.green(bt.tick),exited:qt.yellow(bt.cross),default:qt.cyan("?")}),bm=(t,e,r)=>e?Sr.aborted:r?Sr.exited:t?Sr.done:Sr.default,wm=t=>qt.gray(t?bt.ellipsis:bt.pointerSmall),Sm=(t,e)=>qt.gray(t?e?bt.pointerSmall:"+":bt.line);Ja.exports={styles:As,render:vm,symbols:Sr,symbol:bm,delimiter:wm,item:Sm}});var tl=S((Lw,el)=>{"use strict";var Em=ai();el.exports=function(t,e){let r=String(Em(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,s)=>i+s):r.length}});var il=S(($w,rl)=>{"use strict";rl.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return(t||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+r.length>=i||n[n.length-1].length+o.length+1<i?n[n.length-1]+=` ${o}`:n.push(`${r}${o}`),n),[r]).join(`
`)).join(`
`)}});var nl=S((Bw,sl)=>{"use strict";sl.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let s=Math.min(i+r,e);return{startIndex:i,endIndex:s}}});var Ee=S((qw,ol)=>{"use strict";ol.exports={action:Ga(),clear:Ka(),style:Qa(),strip:ai(),figures:xs(),lines:tl(),wrap:il(),entriesToDisplay:nl()}});var Be=S((jw,hl)=>{"use strict";var al=require("readline"),_m=Ee(),Om=_m.action,Rm=require("events"),ll=z(),Tm=ll.beep,Cm=ll.cursor,xm=U(),Is=class extends Rm{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=al.createInterface({input:this.in,escapeCodeTimeout:50});al.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let a=Om(o,i);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(Cm.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Tm)}render(){this.onRender(xm),this.firstRender&&(this.firstRender=!1)}};hl.exports=Is});var ml=S((Uw,fl)=>{"use strict";function ul(t,e,r,i,s,n,o){try{var a=t[n](o),l=a.value}catch(h){r(h);return}a.done?e(l):Promise.resolve(l).then(i,s)}function cl(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(l){ul(n,i,s,o,a,"next",l)}function a(l){ul(n,i,s,o,a,"throw",l)}o(void 0)})}}var li=U(),Am=Be(),dl=z(),Im=dl.erase,Er=dl.cursor,hi=Ee(),Ms=hi.style,ks=hi.clear,Mm=hi.lines,km=hi.figures,Ds=class extends Am{constructor(e={}){super(e),this.transform=Ms.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=ks("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=li.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}validate(){var e=this;return cl(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return cl(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
`),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let i=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${i}${e}${s}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Er.down(Mm(this.outputError,this.out.columns)-1)+ks(this.outputError,this.out.columns)),this.out.write(ks(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Ms.symbol(this.done,this.aborted),li.bold(this.msg),Ms.delimiter(this.done),this.red?li.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,r,i)=>e+`
${i?" ":km.pointerSmall} ${li.red().italic(r)}`,"")),this.out.write(Im.line+Er.to(0)+this.outputText+Er.save+this.outputError+Er.restore+Er.move(this.cursorOffset,0)))}};fl.exports=Ds});var vl=S((Gw,yl)=>{"use strict";var qe=U(),Dm=Be(),_r=Ee(),pl=_r.style,gl=_r.clear,ui=_r.figures,Nm=_r.wrap,Fm=_r.entriesToDisplay,Pm=z(),Lm=Pm.cursor,Ns=class extends Dm{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=gl("",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(Lm.hide):this.out.write(gl(this.outputText,this.out.columns)),super.render();let e=Fm(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,i=e.endIndex;if(this.outputText=[pl.symbol(this.done,this.aborted),qe.bold(this.msg),pl.delimiter(!1),this.done?this.selection.title:this.selection.disabled?qe.yellow(this.warn):qe.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let s=r;s<i;s++){let n,o,a="",l=this.choices[s];s===r&&r>0?o=ui.arrowUp:s===i-1&&i<this.choices.length?o=ui.arrowDown:o=" ",l.disabled?(n=this.cursor===s?qe.gray().underline(l.title):qe.strikethrough().gray(l.title),o=(this.cursor===s?qe.bold().gray(ui.pointer)+" ":"  ")+o):(n=this.cursor===s?qe.cyan().underline(l.title):l.title,o=(this.cursor===s?qe.cyan(ui.pointer)+" ":"  ")+o,l.description&&this.cursor===s&&(a=` - ${l.description}`,(o.length+n.length+a.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(a=`
`+Nm(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${qe.gray(a)}
`}}this.out.write(this.outputText)}};yl.exports=Ns});var Ol=S((zw,_l)=>{"use strict";var ci=U(),$m=Be(),Sl=Ee(),bl=Sl.style,Bm=Sl.clear,El=z(),wl=El.cursor,qm=El.erase,Fs=class extends $m{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(wl.hide):this.out.write(Bm(this.outputText,this.out.columns)),super.render(),this.outputText=[bl.symbol(this.done,this.aborted),ci.bold(this.msg),bl.delimiter(this.done),this.value?this.inactive:ci.cyan().underline(this.inactive),ci.gray("/"),this.value?ci.cyan().underline(this.active):this.active].join(" "),this.out.write(qm.line+wl.to(0)+this.outputText))}};_l.exports=Fs});var xe=S((Hw,Rl)=>{"use strict";var Ps=class t{constructor({token:e,date:r,parts:i,locales:s}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=s||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,s)=>s>r&&i instanceof t)}toString(){return String(this.date)}};Rl.exports=Ps});var Cl=S((Yw,Tl)=>{"use strict";var jm=xe(),Ls=class extends jm{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}};Tl.exports=Ls});var Al=S((Ww,xl)=>{"use strict";var Um=xe(),Gm=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),$s=class extends Um{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+Gm(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};xl.exports=$s});var Ml=S((Vw,Il)=>{"use strict";var zm=xe(),Bs=class extends zm{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}};Il.exports=Bs});var Dl=S((Zw,kl)=>{"use strict";var Hm=xe(),qs=class extends Hm{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)}};kl.exports=qs});var Fl=S((Kw,Nl)=>{"use strict";var Ym=xe(),js=class extends Ym{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}};Nl.exports=js});var Ll=S((Xw,Pl)=>{"use strict";var Wm=xe(),Us=class extends Wm{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)}};Pl.exports=Us});var Bl=S((Jw,$l)=>{"use strict";var Vm=xe(),Gs=class extends Vm{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}};$l.exports=Gs});var jl=S((Qw,ql)=>{"use strict";var Zm=xe(),zs=class extends Zm{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}};ql.exports=zs});var Gl=S((eS,Ul)=>{"use strict";Ul.exports={DatePart:xe(),Meridiem:Cl(),Day:Al(),Hours:Ml(),Milliseconds:Dl(),Minutes:Fl(),Month:Ll(),Seconds:Bl(),Year:jl()}});var Ql=S((tS,Jl)=>{"use strict";function zl(t,e,r,i,s,n,o){try{var a=t[n](o),l=a.value}catch(h){r(h);return}a.done?e(l):Promise.resolve(l).then(i,s)}function Hl(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(l){zl(n,i,s,o,a,"next",l)}function a(l){zl(n,i,s,o,a,"throw",l)}o(void 0)})}}var Hs=U(),Km=Be(),Ws=Ee(),Yl=Ws.style,Wl=Ws.clear,Xm=Ws.figures,Xl=z(),Jm=Xl.erase,Vl=Xl.cursor,je=Gl(),Zl=je.DatePart,Qm=je.Meridiem,ep=je.Day,tp=je.Hours,rp=je.Milliseconds,ip=je.Minutes,sp=je.Month,np=je.Seconds,op=je.Year,ap=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Kl={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new ep(t),3:t=>new sp(t),4:t=>new op(t),5:t=>new Qm(t),6:t=>new tp(t),7:t=>new ip(t),8:t=>new np(t),9:t=>new rp(t)},lp={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(",")},Ys=class extends Km{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(lp,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=Wl("",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=ap.exec(e);){let s=r.shift(),n=r.findIndex(o=>o!=null);this.parts.push(n in Kl?Kl[n]({token:r[n]||s,date:this.date,parts:this.parts,locales:this.locales}):r[n]||s)}let i=this.parts.reduce((s,n)=>(typeof n=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=n:s.push(n),s),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Zl)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}validate(){var e=this;return Hl(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return Hl(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
`),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof Zl)),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(Vl.hide):this.out.write(Wl(this.outputText,this.out.columns)),super.render(),this.outputText=[Yl.symbol(this.done,this.aborted),Hs.bold(this.msg),Yl.delimiter(!1),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?Hs.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((e,r,i)=>e+`
${i?" ":Xm.pointerSmall} ${Hs.red().italic(r)}`,"")),this.out.write(Jm.line+Vl.to(0)+this.outputText))}};Jl.exports=Ys});var oh=S((rS,nh)=>{"use strict";function eh(t,e,r,i,s,n,o){try{var a=t[n](o),l=a.value}catch(h){r(h);return}a.done?e(l):Promise.resolve(l).then(i,s)}function th(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(l){eh(n,i,s,o,a,"next",l)}function a(l){eh(n,i,s,o,a,"throw",l)}o(void 0)})}}var di=U(),hp=Be(),sh=z(),fi=sh.cursor,up=sh.erase,mi=Ee(),Vs=mi.style,cp=mi.figures,rh=mi.clear,dp=mi.lines,fp=/[0-9]/,Zs=t=>t!==void 0,ih=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Ks=class extends hp{constructor(e={}){super(e),this.transform=Vs.render(e.style),this.msg=e.message,this.initial=Zs(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Zs(e.min)?e.min:-1/0,this.max=Zs(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=di.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${ih(e,this.round)}`),this._value=ih(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||fp.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}validate(){var e=this;return th(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return th(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
`),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(fi.down(dp(this.outputError,this.out.columns)-1)+rh(this.outputError,this.out.columns)),this.out.write(rh(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Vs.symbol(this.done,this.aborted),di.bold(this.msg),Vs.delimiter(this.done),!this.done||!this.done&&!this.placeholder?di[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,r,i)=>e+`
${i?" ":cp.pointerSmall} ${di.red().italic(r)}`,"")),this.out.write(up.line+fi.to(0)+this.outputText+fi.save+this.outputError+fi.restore))}};nh.exports=Ks});var Js=S((iS,hh)=>{"use strict";var Ae=U(),mp=z(),pp=mp.cursor,gp=Be(),Or=Ee(),ah=Or.clear,rt=Or.figures,lh=Or.style,yp=Or.wrap,vp=Or.entriesToDisplay,Xs=class extends gp{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=ah("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
    ${rt.arrowUp}/${rt.arrowDown}: Highlight option
    ${rt.arrowLeft}/${rt.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?`    a: Toggle all
`:"")+"    enter/return: Complete answer":""}renderOption(e,r,i,s){let n=(r.selected?Ae.green(rt.radioOn):rt.radioOff)+" "+s+" ",o,a;return r.disabled?o=e===i?Ae.gray().underline(r.title):Ae.strikethrough().gray(r.title):(o=e===i?Ae.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(n.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
`+yp(r.description,{margin:n.length,width:this.out.columns})))),n+o+Ae.gray(a||"")}paginateOptions(e){if(e.length===0)return Ae.red("No matches for this query.");let r=vp(this.cursor,e.length,this.optionsPerPage),i=r.startIndex,s=r.endIndex,n,o=[];for(let a=i;a<s;a++)a===i&&i>0?n=rt.arrowUp:a===s-1&&s<e.length?n=rt.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[a],a,n));return`
`+o.join(`
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ae.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Ae.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(pp.hide),super.render();let e=[lh.symbol(this.done,this.aborted),Ae.bold(this.msg),lh.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ae.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=ah(e,this.out.columns)}};hh.exports=Xs});var gh=S((sS,ph)=>{"use strict";function uh(t,e,r,i,s,n,o){try{var a=t[n](o),l=a.value}catch(h){r(h);return}a.done?e(l):Promise.resolve(l).then(i,s)}function bp(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(l){uh(n,i,s,o,a,"next",l)}function a(l){uh(n,i,s,o,a,"throw",l)}o(void 0)})}}var Rr=U(),wp=Be(),mh=z(),Sp=mh.erase,ch=mh.cursor,Tr=Ee(),Qs=Tr.style,dh=Tr.clear,en=Tr.figures,Ep=Tr.wrap,_p=Tr.entriesToDisplay,fh=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),Op=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),Rp=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},tn=class extends wp{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Rp(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=Qs.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=dh("",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=fh(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return bp(function*(){let i=r.completing=r.suggest(r.input,r.choices),s=yield i;if(r.completing!==i)return;r.suggestions=s.map((o,a,l)=>({title:Op(l,a),value:fh(l,a),description:o.description})),r.completing=!1;let n=Math.max(s.length-1,0);r.moveSelect(Math.min(n,r.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(e,r){let i=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${i}${e}${s}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,i,s){let n,o=i?en.arrowUp:s?en.arrowDown:" ",a=r?Rr.cyan().underline(e.title):e.title;return o=(r?Rr.cyan(en.pointer)+" ":"  ")+o,e.description&&(n=` - ${e.description}`,(o.length+a.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
`+Ep(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Rr.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(ch.hide):this.out.write(dh(this.outputText,this.out.columns)),super.render();let e=_p(this.select,this.choices.length,this.limit),r=e.startIndex,i=e.endIndex;if(this.outputText=[Qs.symbol(this.done,this.aborted,this.exited),Rr.bold(this.msg),Qs.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let s=this.suggestions.slice(r,i).map((n,o)=>this.renderOption(n,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length)).join(`
`);this.outputText+=`
`+(s||Rr.gray(this.fallback.title))}this.out.write(Sp.line+ch.to(0)+this.outputText)}};ph.exports=tn});var wh=S((nS,bh)=>{"use strict";var Ue=U(),Tp=z(),Cp=Tp.cursor,xp=Js(),sn=Ee(),yh=sn.clear,vh=sn.style,jt=sn.figures,rn=class extends xp{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=yh("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
    ${jt.arrowUp}/${jt.arrowDown}: Highlight option
    ${jt.arrowLeft}/${jt.arrowRight}/[space]: Toggle selection
    [a,b,c]/delete: Filter choices
    enter/return: Complete answer
`:""}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:Ue.gray("Enter something to filter")}
`}renderOption(e,r,i){let s;return r.disabled?s=e===i?Ue.gray().underline(r.title):Ue.strikethrough().gray(r.title):s=e===i?Ue.cyan().underline(r.title):r.title,(r.selected?Ue.green(jt.radioOn):jt.radioOff)+"  "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ue.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Ue.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Cp.hide),super.render();let e=[vh.symbol(this.done,this.aborted),Ue.bold(this.msg),vh.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ue.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=yh(e,this.out.columns)}};bh.exports=rn});var Ch=S((oS,Th)=>{"use strict";var Sh=U(),Ap=Be(),Oh=Ee(),Eh=Oh.style,Ip=Oh.clear,Rh=z(),Mp=Rh.erase,_h=Rh.cursor,nn=class extends Ap{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(_h.hide):this.out.write(Ip(this.outputText,this.out.columns)),super.render(),this.outputText=[Eh.symbol(this.done,this.aborted),Sh.bold(this.msg),Eh.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Sh.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Mp.line+_h.to(0)+this.outputText))}};Th.exports=nn});var Ah=S((aS,xh)=>{"use strict";xh.exports={TextPrompt:ml(),SelectPrompt:vl(),TogglePrompt:Ol(),DatePrompt:Ql(),NumberPrompt:oh(),MultiselectPrompt:Js(),AutocompletePrompt:gh(),AutocompleteMultiselectPrompt:wh(),ConfirmPrompt:Ch()}});var Mh=S(Ih=>{"use strict";var ie=Ih,kp=Ah(),pi=t=>t;function Ie(t,e,r={}){return new Promise((i,s)=>{let n=new kp[t](e),o=r.onAbort||pi,a=r.onSubmit||pi,l=r.onExit||pi;n.on("state",e.onState||pi),n.on("submit",h=>i(a(h))),n.on("exit",h=>i(l(h))),n.on("abort",h=>s(o(h)))})}ie.text=t=>Ie("TextPrompt",t);ie.password=t=>(t.style="password",ie.text(t));ie.invisible=t=>(t.style="invisible",ie.text(t));ie.number=t=>Ie("NumberPrompt",t);ie.date=t=>Ie("DatePrompt",t);ie.confirm=t=>Ie("ConfirmPrompt",t);ie.list=t=>{let e=t.separator||",";return Ie("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};ie.toggle=t=>Ie("TogglePrompt",t);ie.select=t=>Ie("SelectPrompt",t);ie.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Ie("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};ie.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Ie("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Dp=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));ie.autocomplete=t=>(t.suggest=t.suggest||Dp,t.choices=[].concat(t.choices||[]),Ie("AutocompletePrompt",t))});var Bh=S((hS,$h)=>{"use strict";function kh(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,i)}return r}function Dh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kh(Object(r),!0).forEach(function(i){Np(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kh(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Np(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fp(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Pp(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var i=0,s=function(){};return{s,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(h){throw h},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,o=!1,a;return{s:function(){r=r.call(t)},n:function(){var h=r.next();return n=h.done,h},e:function(h){o=!0,a=h},f:function(){try{!n&&r.return!=null&&r.return()}finally{if(o)throw a}}}}function Pp(t,e){if(t){if(typeof t=="string")return Nh(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Nh(t,e)}}function Nh(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Fh(t,e,r,i,s,n,o){try{var a=t[n](o),l=a.value}catch(h){r(h);return}a.done?e(l):Promise.resolve(l).then(i,s)}function Ph(t){return function(){var e=this,r=arguments;return new Promise(function(i,s){var n=t.apply(e,r);function o(l){Fh(n,i,s,o,a,"next",l)}function a(l){Fh(n,i,s,o,a,"throw",l)}o(void 0)})}}var on=Mh(),Lp=["suggest","format","onState","validate","onRender","type"],Lh=()=>{};function it(){return an.apply(this,arguments)}function an(){return an=Ph(function*(t=[],{onSubmit:e=Lh,onCancel:r=Lh}={}){let i={},s=it._override||{};t=[].concat(t);let n,o,a,l,h,u,c=function(){var y=Ph(function*(w,_,N=!1){if(!(!N&&w.validate&&w.validate(_)!==!0))return w.format?yield w.format(_,i):_});return function(_,N){return y.apply(this,arguments)}}();var d=Fp(t),f;try{for(d.s();!(f=d.n()).done;){o=f.value;var p=o;if(l=p.name,h=p.type,typeof h=="function"&&(h=yield h(n,Dh({},i),o),o.type=h),!!h){for(let y in o){if(Lp.includes(y))continue;let w=o[y];o[y]=typeof w=="function"?yield w(n,Dh({},i),u):w}if(u=o,typeof o.message!="string")throw new Error("prompt message is required");var g=o;if(l=g.name,h=g.type,on[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(s[o.name]!==void 0&&(n=yield c(o,s[o.name]),n!==void 0)){i[l]=n;continue}try{n=it._injected?$p(it._injected,o.initial):yield on[h](o),i[l]=n=yield c(o,n,!0),a=yield e(o,n,i)}catch{a=!(yield r(o,i))}if(a)return i}}}catch(y){d.e(y)}finally{d.f()}return i}),an.apply(this,arguments)}function $p(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Bp(t){it._injected=(it._injected||[]).concat(t)}function qp(t){it._override=Object.assign({},t)}$h.exports=Object.assign(it,{prompt:it,prompts:on,inject:Bp,override:qp})});var jh=S((uS,qh)=>{"use strict";qh.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var gi=S((cS,Uh)=>{"use strict";Uh.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var Hh=S((dS,zh)=>{"use strict";var jp=gi(),{erase:Gh,cursor:Up}=z(),Gp=t=>[...jp(t)].length;zh.exports=function(t,e){if(!e)return Gh.line+Up.to(0);let r=0,i=t.split(/\r?\n/);for(let s of i)r+=1+Math.floor(Math.max(Gp(s)-1,0)/e);return Gh.lines(r)}});var ln=S((fS,Yh)=>{"use strict";var Cr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},zp={arrowUp:Cr.arrowUp,arrowDown:Cr.arrowDown,arrowLeft:Cr.arrowLeft,arrowRight:Cr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Hp=process.platform==="win32"?zp:Cr;Yh.exports=Hp});var Vh=S((mS,Wh)=>{"use strict";var Ut=U(),wt=ln(),hn=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),Yp=t=>hn[t]||hn.default,xr=Object.freeze({aborted:Ut.red(wt.cross),done:Ut.green(wt.tick),exited:Ut.yellow(wt.cross),default:Ut.cyan("?")}),Wp=(t,e,r)=>e?xr.aborted:r?xr.exited:t?xr.done:xr.default,Vp=t=>Ut.gray(t?wt.ellipsis:wt.pointerSmall),Zp=(t,e)=>Ut.gray(t?e?wt.pointerSmall:"+":wt.line);Wh.exports={styles:hn,render:Yp,symbols:xr,symbol:Wp,delimiter:Vp,item:Zp}});var Kh=S((pS,Zh)=>{"use strict";var Kp=gi();Zh.exports=function(t,e){let r=String(Kp(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,s)=>i+s):r.length}});var Jh=S((gS,Xh)=>{"use strict";Xh.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return(t||"").split(/\r?\n/g).map(s=>s.split(/\s+/g).reduce((n,o)=>(o.length+r.length>=i||n[n.length-1].length+o.length+1<i?n[n.length-1]+=` ${o}`:n.push(`${r}${o}`),n),[r]).join(`
`)).join(`
`)}});var eu=S((yS,Qh)=>{"use strict";Qh.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let s=Math.min(i+r,e);return{startIndex:i,endIndex:s}}});var _e=S((vS,tu)=>{"use strict";tu.exports={action:jh(),clear:Hh(),style:Vh(),strip:gi(),figures:ln(),lines:Kh(),wrap:Jh(),entriesToDisplay:eu()}});var Ge=S((bS,iu)=>{"use strict";var ru=require("readline"),{action:Xp}=_e(),Jp=require("events"),{beep:Qp,cursor:eg}=z(),tg=U(),un=class extends Jp{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=ru.createInterface({input:this.in,escapeCodeTimeout:50});ru.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(n,o)=>{let a=Xp(o,i);a===!1?this._&&this._(n,o):typeof this[a]=="function"?this[a](o):this.bell()};this.close=()=>{this.out.write(eg.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Qp)}render(){this.onRender(tg),this.firstRender&&(this.firstRender=!1)}};iu.exports=un});var nu=S((wS,su)=>{var yi=U(),rg=Ge(),{erase:ig,cursor:Ar}=z(),{style:cn,clear:dn,lines:sg,figures:ng}=_e(),fn=class extends rg{constructor(e={}){super(e),this.transform=cn.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=dn("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=yi.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 i=this.value.slice(0,this.cursor),s=this.value.slice(this.cursor);this.value=`${i}${e}${s}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Ar.down(sg(this.outputError,this.out.columns)-1)+dn(this.outputError,this.out.columns)),this.out.write(dn(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[cn.symbol(this.done,this.aborted),yi.bold(this.msg),cn.delimiter(this.done),this.red?yi.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,r,i)=>e+`
${i?" ":ng.pointerSmall} ${yi.red().italic(r)}`,"")),this.out.write(ig.line+Ar.to(0)+this.outputText+Ar.save+this.outputError+Ar.restore+Ar.move(this.cursorOffset,0)))}};su.exports=fn});var hu=S((SS,lu)=>{"use strict";var ze=U(),og=Ge(),{style:ou,clear:au,figures:vi,wrap:ag,entriesToDisplay:lg}=_e(),{cursor:hg}=z(),mn=class extends og{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=au("",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(hg.hide):this.out.write(au(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=lg(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[ou.symbol(this.done,this.aborted),ze.bold(this.msg),ou.delimiter(!1),this.done?this.selection.title:this.selection.disabled?ze.yellow(this.warn):ze.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let i=e;i<r;i++){let s,n,o="",a=this.choices[i];i===e&&e>0?n=vi.arrowUp:i===r-1&&r<this.choices.length?n=vi.arrowDown:n=" ",a.disabled?(s=this.cursor===i?ze.gray().underline(a.title):ze.strikethrough().gray(a.title),n=(this.cursor===i?ze.bold().gray(vi.pointer)+" ":"  ")+n):(s=this.cursor===i?ze.cyan().underline(a.title):a.title,n=(this.cursor===i?ze.cyan(vi.pointer)+" ":"  ")+n,a.description&&this.cursor===i&&(o=` - ${a.description}`,(n.length+s.length+o.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(o=`
`+ag(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${n} ${s}${ze.gray(o)}
`}}this.out.write(this.outputText)}};lu.exports=mn});var fu=S((ES,du)=>{var bi=U(),ug=Ge(),{style:uu,clear:cg}=_e(),{cursor:cu,erase:dg}=z(),pn=class extends ug{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(cu.hide):this.out.write(cg(this.outputText,this.out.columns)),super.render(),this.outputText=[uu.symbol(this.done,this.aborted),bi.bold(this.msg),uu.delimiter(this.done),this.value?this.inactive:bi.cyan().underline(this.inactive),bi.gray("/"),this.value?bi.cyan().underline(this.active):this.active].join(" "),this.out.write(dg.line+cu.to(0)+this.outputText))}};du.exports=pn});var Me=S((_S,mu)=>{"use strict";var gn=class t{constructor({token:e,date:r,parts:i,locales:s}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=s||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,s)=>s>r&&i instanceof t)}toString(){return String(this.date)}};mu.exports=gn});var gu=S((OS,pu)=>{"use strict";var fg=Me(),yn=class extends fg{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}};pu.exports=yn});var vu=S((RS,yu)=>{"use strict";var mg=Me(),pg=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),vn=class extends mg{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+pg(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};yu.exports=vn});var wu=S((TS,bu)=>{"use strict";var gg=Me(),bn=class extends gg{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}};bu.exports=bn});var Eu=S((CS,Su)=>{"use strict";var yg=Me(),wn=class extends yg{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)}};Su.exports=wn});var Ou=S((xS,_u)=>{"use strict";var vg=Me(),Sn=class extends vg{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}};_u.exports=Sn});var Tu=S((AS,Ru)=>{"use strict";var bg=Me(),En=class extends bg{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)}};Ru.exports=En});var xu=S((IS,Cu)=>{"use strict";var wg=Me(),_n=class extends wg{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}};Cu.exports=_n});var Iu=S((MS,Au)=>{"use strict";var Sg=Me(),On=class extends Sg{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}};Au.exports=On});var ku=S((kS,Mu)=>{"use strict";Mu.exports={DatePart:Me(),Meridiem:gu(),Day:vu(),Hours:wu(),Milliseconds:Eu(),Minutes:Ou(),Month:Tu(),Seconds:xu(),Year:Iu()}});var Bu=S((DS,$u)=>{"use strict";var Rn=U(),Eg=Ge(),{style:Du,clear:Nu,figures:_g}=_e(),{erase:Og,cursor:Fu}=z(),{DatePart:Pu,Meridiem:Rg,Day:Tg,Hours:Cg,Milliseconds:xg,Minutes:Ag,Month:Ig,Seconds:Mg,Year:kg}=ku(),Dg=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Lu={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new Tg(t),3:t=>new Ig(t),4:t=>new kg(t),5:t=>new Rg(t),6:t=>new Cg(t),7:t=>new Ag(t),8:t=>new Mg(t),9:t=>new xg(t)},Ng={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(",")},Tn=class extends Eg{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(Ng,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=Nu("",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=Dg.exec(e);){let s=r.shift(),n=r.findIndex(o=>o!=null);this.parts.push(n in Lu?Lu[n]({token:r[n]||s,date:this.date,parts:this.parts,locales:this.locales}):r[n]||s)}let i=this.parts.reduce((s,n)=>(typeof n=="string"&&typeof s[s.length-1]=="string"?s[s.length-1]+=n:s.push(n),s),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Pu)),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 Pu)),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(Fu.hide):this.out.write(Nu(this.outputText,this.out.columns)),super.render(),this.outputText=[Du.symbol(this.done,this.aborted),Rn.bold(this.msg),Du.delimiter(!1),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?Rn.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
`).reduce((e,r,i)=>e+`
${i?" ":_g.pointerSmall} ${Rn.red().italic(r)}`,"")),this.out.write(Og.line+Fu.to(0)+this.outputText))}};$u.exports=Tn});var Gu=S((NS,Uu)=>{var wi=U(),Fg=Ge(),{cursor:Si,erase:Pg}=z(),{style:Cn,figures:Lg,clear:qu,lines:$g}=_e(),Bg=/[0-9]/,xn=t=>t!==void 0,ju=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},An=class extends Fg{constructor(e={}){super(e),this.transform=Cn.render(e.style),this.msg=e.message,this.initial=xn(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=xn(e.min)?e.min:-1/0,this.max=xn(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=wi.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${ju(e,this.round)}`),this._value=ju(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||Bg.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();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Si.down($g(this.outputError,this.out.columns)-1)+qu(this.outputError,this.out.columns)),this.out.write(qu(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Cn.symbol(this.done,this.aborted),wi.bold(this.msg),Cn.delimiter(this.done),!this.done||!this.done&&!this.placeholder?wi[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
`).reduce((e,r,i)=>e+`
${i?" ":Lg.pointerSmall} ${wi.red().italic(r)}`,"")),this.out.write(Pg.line+Si.to(0)+this.outputText+Si.save+this.outputError+Si.restore))}};Uu.exports=An});var Mn=S((FS,Yu)=>{"use strict";var ke=U(),{cursor:qg}=z(),jg=Ge(),{clear:zu,figures:st,style:Hu,wrap:Ug,entriesToDisplay:Gg}=_e(),In=class extends jg{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=zu("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
    ${st.arrowUp}/${st.arrowDown}: Highlight option
    ${st.arrowLeft}/${st.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?`    a: Toggle all
`:"")+"    enter/return: Complete answer":""}renderOption(e,r,i,s){let n=(r.selected?ke.green(st.radioOn):st.radioOff)+" "+s+" ",o,a;return r.disabled?o=e===i?ke.gray().underline(r.title):ke.strikethrough().gray(r.title):(o=e===i?ke.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(n.length+o.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
`+Ug(r.description,{margin:n.length,width:this.out.columns})))),n+o+ke.gray(a||"")}paginateOptions(e){if(e.length===0)return ke.red("No matches for this query.");let{startIndex:r,endIndex:i}=Gg(this.cursor,e.length,this.optionsPerPage),s,n=[];for(let o=r;o<i;o++)o===r&&r>0?s=st.arrowUp:o===i-1&&i<e.length?s=st.arrowDown:s=" ",n.push(this.renderOption(this.cursor,e[o],o,s));return`
`+n.join(`
`)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[ke.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(ke.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(qg.hide),super.render();let e=[Hu.symbol(this.done,this.aborted),ke.bold(this.msg),Hu.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=ke.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=zu(e,this.out.columns)}};Yu.exports=In});var Xu=S((PS,Ku)=>{"use strict";var Ir=U(),zg=Ge(),{erase:Hg,cursor:Wu}=z(),{style:kn,clear:Vu,figures:Dn,wrap:Yg,entriesToDisplay:Wg}=_e(),Zu=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),Vg=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),Zg=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},Nn=class extends zg{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Zg(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=kn.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Vu("",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=Zu(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),i=await r;if(this.completing!==r)return;this.suggestions=i.map((n,o,a)=>({title:Vg(a,o),value:Zu(a,o),description:n.description})),this.completing=!1;let s=Math.max(i.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 i=this.input.slice(0,this.cursor),s=this.input.slice(this.cursor);this.input=`${i}${e}${s}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,i,s){let n,o=i?Dn.arrowUp:s?Dn.arrowDown:" ",a=r?Ir.cyan().underline(e.title):e.title;return o=(r?Ir.cyan(Dn.pointer)+" ":"  ")+o,e.description&&(n=` - ${e.description}`,(o.length+a.length+n.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(n=`
`+Yg(e.description,{margin:3,width:this.out.columns}))),o+" "+a+Ir.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Wu.hide):this.out.write(Vu(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Wg(this.select,this.choices.length,this.limit);if(this.outputText=[kn.symbol(this.done,this.aborted,this.exited),Ir.bold(this.msg),kn.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 i=this.suggestions.slice(e,r).map((s,n)=>this.renderOption(s,this.select===n+e,n===0&&e>0,n+e===r-1&&r<this.choices.length)).join(`
`);this.outputText+=`
`+(i||Ir.gray(this.fallback.title))}this.out.write(Hg.line+Wu.to(0)+this.outputText)}};Ku.exports=Nn});var tc=S((LS,ec)=>{"use strict";var He=U(),{cursor:Kg}=z(),Xg=Mn(),{clear:Ju,style:Qu,figures:Gt}=_e(),Fn=class extends Xg{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=Ju("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
Instructions:
    ${Gt.arrowUp}/${Gt.arrowDown}: Highlight option
    ${Gt.arrowLeft}/${Gt.arrowRight}/[space]: Toggle selection
    [a,b,c]/delete: Filter choices
    enter/return: Complete answer
`:""}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:He.gray("Enter something to filter")}
`}renderOption(e,r,i){let s;return r.disabled?s=e===i?He.gray().underline(r.title):He.strikethrough().gray(r.title):s=e===i?He.cyan().underline(r.title):r.title,(r.selected?He.green(Gt.radioOn):Gt.radioOff)+"  "+s}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[He.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(He.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Kg.hide),super.render();let e=[Qu.symbol(this.done,this.aborted),He.bold(this.msg),Qu.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=He.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=Ju(e,this.out.columns)}};ec.exports=Fn});var oc=S(($S,nc)=>{var rc=U(),Jg=Ge(),{style:ic,clear:Qg}=_e(),{erase:ey,cursor:sc}=z(),Pn=class extends Jg{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(sc.hide):this.out.write(Qg(this.outputText,this.out.columns)),super.render(),this.outputText=[ic.symbol(this.done,this.aborted),rc.bold(this.msg),ic.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:rc.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(ey.line+sc.to(0)+this.outputText))}};nc.exports=Pn});var lc=S((BS,ac)=>{"use strict";ac.exports={TextPrompt:nu(),SelectPrompt:hu(),TogglePrompt:fu(),DatePrompt:Bu(),NumberPrompt:Gu(),MultiselectPrompt:Mn(),AutocompletePrompt:Xu(),AutocompleteMultiselectPrompt:tc(),ConfirmPrompt:oc()}});var uc=S(hc=>{"use strict";var se=hc,ty=lc(),Ei=t=>t;function De(t,e,r={}){return new Promise((i,s)=>{let n=new ty[t](e),o=r.onAbort||Ei,a=r.onSubmit||Ei,l=r.onExit||Ei;n.on("state",e.onState||Ei),n.on("submit",h=>i(a(h))),n.on("exit",h=>i(l(h))),n.on("abort",h=>s(o(h)))})}se.text=t=>De("TextPrompt",t);se.password=t=>(t.style="password",se.text(t));se.invisible=t=>(t.style="invisible",se.text(t));se.number=t=>De("NumberPrompt",t);se.date=t=>De("DatePrompt",t);se.confirm=t=>De("ConfirmPrompt",t);se.list=t=>{let e=t.separator||",";return De("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};se.toggle=t=>De("TogglePrompt",t);se.select=t=>De("SelectPrompt",t);se.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return De("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};se.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return De("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var ry=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));se.autocomplete=t=>(t.suggest=t.suggest||ry,t.choices=[].concat(t.choices||[]),De("AutocompletePrompt",t))});var fc=S((jS,dc)=>{"use strict";var Ln=uc(),iy=["suggest","format","onState","validate","onRender","type"],cc=()=>{};async function nt(t=[],{onSubmit:e=cc,onCancel:r=cc}={}){let i={},s=nt._override||{};t=[].concat(t);let n,o,a,l,h,u,c=async(d,f,p=!1)=>{if(!(!p&&d.validate&&d.validate(f)!==!0))return d.format?await d.format(f,i):f};for(o of t)if({name:l,type:h}=o,typeof h=="function"&&(h=await h(n,{...i},o),o.type=h),!!h){for(let d in o){if(iy.includes(d))continue;let f=o[d];o[d]=typeof f=="function"?await f(n,{...i},u):f}if(u=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:l,type:h}=o,Ln[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(s[o.name]!==void 0&&(n=await c(o,s[o.name]),n!==void 0)){i[l]=n;continue}try{n=nt._injected?sy(nt._injected,o.initial):await Ln[h](o),i[l]=n=await c(o,n,!0),a=await e(o,n,i)}catch{a=!await r(o,i)}if(a)return i}return i}function sy(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function ny(t){nt._injected=(nt._injected||[]).concat(t)}function oy(t){nt._override=Object.assign({},t)}dc.exports=Object.assign(nt,{prompt:nt,prompts:Ln,inject:ny,override:oy})});var pc=S((US,mc)=>{function ay(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return!1;if(t[e]>r[e])return!0}return!1}mc.exports=ay("8.6.0")?Bh():fc()});var kf=S(gr=>{"use strict";var ly=require("fs"),hy=require("path"),uy=require("events"),cy=require("stream"),dy=require("string_decoder"),fy=require("assert"),my=require("buffer"),py=require("zlib"),gy=require("util"),yy=require("crypto"),vy=require("os"),by=require("tty"),wy=require("constants"),Sy=require("https"),Ey=require("child_process"),_y=require("url"),Oy=require("net"),Ry=require("tls");function X(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var m=X(ly),b=X(hy),hr=X(uy),po=X(cy),Ty=X(dy),O=X(fy),Cy=X(my),go=X(py),Le=X(gy),hd=X(yy),yo=X(vy),vo=X(by),dt=X(wy),xy=X(Sy),Ay=X(Ey),ud=X(_y),Iy=X(Oy),My=X(Ry),ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Re(t){var e={exports:{}};return t(e,e.exports),e.exports}var gc=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]),ei=t=>t?Object.keys(t).map(e=>[gc.has(e)?gc.get(e):e,t[e]]).reduce((e,r)=>(e[r[0]]=r[1],e),Object.create(null)):{},ky=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}},At=I;I.Node=Mt;I.create=I;function I(t){var e=this;if(e instanceof I||(e=new I),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(s){e.push(s)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)e.push(arguments[r]);return e}I.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};I.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};I.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};I.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)Ny(this,arguments[t]);return this.length};I.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)Fy(this,arguments[t]);return this.length};I.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};I.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};I.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,i=0;r!==null;i++)t.call(e,r.value,i,this),r=r.next};I.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,i=this.length-1;r!==null;i--)t.call(e,r.value,i,this),r=r.prev};I.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};I.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};I.prototype.map=function(t,e){e=e||this;for(var r=new I,i=this.head;i!==null;)r.push(t.call(e,i.value,this)),i=i.next;return r};I.prototype.mapReverse=function(t,e){e=e||this;for(var r=new I,i=this.tail;i!==null;)r.push(t.call(e,i.value,this)),i=i.prev;return r};I.prototype.reduce=function(t,e){var r,i=this.head;if(arguments.length>1)r=e;else if(this.head)i=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;i!==null;s++)r=t(r,i.value,s),i=i.next;return r};I.prototype.reduceReverse=function(t,e){var r,i=this.tail;if(arguments.length>1)r=e;else if(this.tail)i=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;i!==null;s--)r=t(r,i.value,s),i=i.prev;return r};I.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};I.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};I.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new I;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,s=this.head;s!==null&&i<t;i++)s=s.next;for(;s!==null&&i<e;i++,s=s.next)r.push(s.value);return r};I.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new I;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,s=this.tail;s!==null&&i>e;i--)s=s.prev;for(;s!==null&&i>t;i--,s=s.prev)r.push(s.value);return r};I.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,s=this.head;s!==null&&i<t;i++)s=s.next;for(var n=[],i=0;s&&i<e;i++)n.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var i=0;i<r.length;i++)s=Dy(this,s,r[i]);return n};I.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var i=r.prev;r.prev=r.next,r.next=i}return this.head=e,this.tail=t,this};function Dy(t,e,r){var i=e===t.head?new Mt(r,null,e,t):new Mt(r,e,e.next,t);return i.next===null&&(t.tail=i),i.prev===null&&(t.head=i),t.length++,i}function Ny(t,e){t.tail=new Mt(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function Fy(t,e){t.head=new Mt(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function Mt(t,e,r,i){if(!(this instanceof Mt))return new Mt(t,e,r,i);this.list=i,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{ky(I)}catch{}var yc=Ty.default.StringDecoder,Ye=Symbol("EOF"),Mr=Symbol("maybeEmitEnd"),ot=Symbol("emittedEnd"),_i=Symbol("emittingEnd"),Oi=Symbol("closed"),vc=Symbol("read"),$n=Symbol("flush"),bc=Symbol("flushChunk"),ne=Symbol("encoding"),We=Symbol("decoder"),Ri=Symbol("flowing"),kr=Symbol("paused"),Dr=Symbol("resume"),te=Symbol("bufferLength"),wc=Symbol("bufferPush"),Bn=Symbol("bufferShift"),Q=Symbol("objectMode"),ee=Symbol("destroyed"),cd=ve._MP_NO_ITERATOR_SYMBOLS_!=="1",Py=cd&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Ly=cd&&Symbol.iterator||Symbol("iterator not implemented"),Sc=t=>t==="end"||t==="finish"||t==="prefinish",$y=t=>t instanceof ArrayBuffer||typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,By=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),ur=class dd extends po.default{constructor(e){super(),this[Ri]=!1,this[kr]=!1,this.pipes=new At,this.buffer=new At,this[Q]=e&&e.objectMode||!1,this[Q]?this[ne]=null:this[ne]=e&&e.encoding||null,this[ne]==="buffer"&&(this[ne]=null),this[We]=this[ne]?new yc(this[ne]):null,this[Ye]=!1,this[ot]=!1,this[_i]=!1,this[Oi]=!1,this.writable=!0,this.readable=!0,this[te]=0,this[ee]=!1}get bufferLength(){return this[te]}get encoding(){return this[ne]}set encoding(e){if(this[Q])throw new Error("cannot set encoding in objectMode");if(this[ne]&&e!==this[ne]&&(this[We]&&this[We].lastNeed||this[te]))throw new Error("cannot change encoding");this[ne]!==e&&(this[We]=e?new yc(e):null,this.buffer.length&&(this.buffer=this.buffer.map(r=>this[We].write(r)))),this[ne]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[Q]}set objectMode(e){this[Q]=this[Q]||!!e}write(e,r,i){if(this[Ye])throw new Error("write after end");return this[ee]?(this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0):(typeof r=="function"&&(i=r,r="utf8"),r||(r="utf8"),!this[Q]&&!Buffer.isBuffer(e)&&(By(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):$y(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),!this.objectMode&&!e.length?(this[te]!==0&&this.emit("readable"),i&&i(),this.flowing):(typeof e=="string"&&!this[Q]&&!(r===this[ne]&&!this[We].lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[ne]&&(e=this[We].write(e)),this.flowing?(this[te]!==0&&this[$n](!0),this.emit("data",e)):this[wc](e),this[te]!==0&&this.emit("readable"),i&&i(),this.flowing))}read(e){if(this[ee])return null;try{return this[te]===0||e===0||e>this[te]?null:(this[Q]&&(e=null),this.buffer.length>1&&!this[Q]&&(this.encoding?this.buffer=new At([Array.from(this.buffer).join("")]):this.buffer=new At([Buffer.concat(Array.from(this.buffer),this[te])])),this[vc](e||null,this.buffer.head.value))}finally{this[Mr]()}}[vc](e,r){return e===r.length||e===null?this[Bn]():(this.buffer.head.value=r.slice(e),r=r.slice(0,e),this[te]-=e),this.emit("data",r),!this.buffer.length&&!this[Ye]&&this.emit("drain"),r}end(e,r,i){return typeof e=="function"&&(i=e,e=null),typeof r=="function"&&(i=r,r="utf8"),e&&this.write(e,r),i&&this.once("end",i),this[Ye]=!0,this.writable=!1,(this.flowing||!this[kr])&&this[Mr](),this}[Dr](){this[ee]||(this[kr]=!1,this[Ri]=!0,this.emit("resume"),this.buffer.length?this[$n]():this[Ye]?this[Mr]():this.emit("drain"))}resume(){return this[Dr]()}pause(){this[Ri]=!1,this[kr]=!0}get destroyed(){return this[ee]}get flowing(){return this[Ri]}get paused(){return this[kr]}[wc](e){return this[Q]?this[te]+=1:this[te]+=e.length,this.buffer.push(e)}[Bn](){return this.buffer.length&&(this[Q]?this[te]-=1:this[te]-=this.buffer.head.value.length),this.buffer.shift()}[$n](e){do;while(this[bc](this[Bn]()));!e&&!this.buffer.length&&!this[Ye]&&this.emit("drain")}[bc](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,r){if(this[ee])return;let i=this[ot];r=r||{},e===process.stdout||e===process.stderr?r.end=!1:r.end=r.end!==!1;let s={dest:e,opts:r,ondrain:n=>this[Dr]()};return this.pipes.push(s),e.on("drain",s.ondrain),this[Dr](),i&&s.opts.end&&s.dest.end(),e}addListener(e,r){return this.on(e,r)}on(e,r){try{return super.on(e,r)}finally{e==="data"&&!this.pipes.length&&!this.flowing?this[Dr]():Sc(e)&&this[ot]&&(super.emit(e),this.removeAllListeners(e))}}get emittedEnd(){return this[ot]}[Mr](){!this[_i]&&!this[ot]&&!this[ee]&&this.buffer.length===0&&this[Ye]&&(this[_i]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Oi]&&this.emit("close"),this[_i]=!1)}emit(e,r){if(e!=="error"&&e!=="close"&&e!==ee&&this[ee])return;if(e==="data"){if(!r)return;this.pipes.length&&this.pipes.forEach(s=>s.dest.write(r)===!1&&this.pause())}else if(e==="end"){if(this[ot]===!0)return;this[ot]=!0,this.readable=!1,this[We]&&(r=this[We].end(),r&&(this.pipes.forEach(s=>s.dest.write(r)),super.emit("data",r))),this.pipes.forEach(s=>{s.dest.removeListener("drain",s.ondrain),s.opts.end&&s.dest.end()})}else if(e==="close"&&(this[Oi]=!0,!this[ot]&&!this[ee]))return;let i=new Array(arguments.length);if(i[0]=e,i[1]=r,arguments.length>2)for(let s=2;s<arguments.length;s++)i[s]=arguments[s];try{return super.emit.apply(this,i)}finally{Sc(e)?this.removeAllListeners(e):this[Mr]()}}collect(){let e=[];this[Q]||(e.dataLength=0);let r=this.promise();return this.on("data",i=>{e.push(i),this[Q]||(e.dataLength+=i.length)}),r.then(()=>e)}concat(){return this[Q]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[Q]?Promise.reject(new Error("cannot concat in objectMode")):this[ne]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,r)=>{this.on(ee,()=>r(new Error("stream destroyed"))),this.on("end",()=>e()),this.on("error",i=>r(i))})}[Py](){return{next:()=>{let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Ye])return Promise.resolve({done:!0});let i=null,s=null,n=h=>{this.removeListener("data",o),this.removeListener("end",a),s(h)},o=h=>{this.removeListener("error",n),this.removeListener("end",a),this.pause(),i({value:h,done:!!this[Ye]})},a=()=>{this.removeListener("error",n),this.removeListener("data",o),i({done:!0})},l=()=>n(new Error("stream destroyed"));return new Promise((h,u)=>{s=u,i=h,this.once(ee,l),this.once("error",n),this.once("end",a),this.once("data",o)})}}}[Ly](){return{next:()=>{let r=this.read();return{value:r,done:r===null}}}}destroy(e){return this[ee]?(e?this.emit("error",e):this.emit(ee),this):(this[ee]=!0,this.buffer=new At,this[te]=0,typeof this.close=="function"&&!this[Oi]&&this.close(),e?this.emit("error",e):this.emit(ee),this)}static isStream(e){return!!e&&(e instanceof dd||e instanceof po.default||e instanceof hr.default&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}},qy=go.default.constants||{ZLIB_VERNUM:4736},jy=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},qy)),fd=Re(function(t,e){let r=Cy.default.Buffer,i=e.constants=jy,s=r.concat,n=Symbol("_superWrite");class o extends Error{constructor(v){super("zlib: "+v.message),this.code=v.code,this.errno=v.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+v.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}let a=Symbol("opts"),l=Symbol("flushFlag"),h=Symbol("finishFlushFlag"),u=Symbol("fullFlushFlag"),c=Symbol("handle"),d=Symbol("onError"),f=Symbol("sawError"),p=Symbol("level"),g=Symbol("strategy"),y=Symbol("ended");class w extends ur{constructor(v,A){if(!v||typeof v!="object")throw new TypeError("invalid options for ZlibBase constructor");super(v),this[f]=!1,this[y]=!1,this[a]=v,this[l]=v.flush,this[h]=v.finishFlush;try{this[c]=new go.default[A](v)}catch(M){throw new o(M)}this[d]=M=>{this[f]||(this[f]=!0,this.close(),this.emit("error",M))},this[c].on("error",M=>this[d](new o(M))),this.once("end",()=>this.close)}close(){this[c]&&(this[c].close(),this[c]=null,this.emit("close"))}reset(){if(!this[f])return O.default(this[c],"zlib binding closed"),this[c].reset()}flush(v){this.ended||(typeof v!="number"&&(v=this[u]),this.write(Object.assign(r.alloc(0),{[l]:v})))}end(v,A,M){return v&&this.write(v,A),this.flush(this[h]),this[y]=!0,super.end(null,null,M)}get ended(){return this[y]}write(v,A,M){if(typeof A=="function"&&(M=A,A="utf8"),typeof v=="string"&&(v=r.from(v,A)),this[f])return;O.default(this[c],"zlib binding closed");let L=this[c]._handle,H=L.close;L.close=()=>{};let J=this[c].close;this[c].close=()=>{},r.concat=we=>we;let q;try{let we=typeof v[l]=="number"?v[l]:this[l];q=this[c]._processChunk(v,we),r.concat=s}catch(we){r.concat=s,this[d](new o(we))}finally{this[c]&&(this[c]._handle=L,L.close=H,this[c].close=J,this[c].removeAllListeners("error"))}this[c]&&this[c].on("error",we=>this[d](new o(we)));let $e;if(q)if(Array.isArray(q)&&q.length>0){$e=this[n](r.from(q[0]));for(let we=1;we<q.length;we++)$e=this[n](q[we])}else $e=this[n](r.from(q));return M&&M(),$e}[n](v){return super.write(v)}}class _ extends w{constructor(v,A){v=v||{},v.flush=v.flush||i.Z_NO_FLUSH,v.finishFlush=v.finishFlush||i.Z_FINISH,super(v,A),this[u]=i.Z_FULL_FLUSH,this[p]=v.level,this[g]=v.strategy}params(v,A){if(!this[f]){if(!this[c])throw new Error("cannot switch params when binding is closed");if(!this[c].params)throw new Error("not supported in this implementation");if(this[p]!==v||this[g]!==A){this.flush(i.Z_SYNC_FLUSH),O.default(this[c],"zlib binding closed");let M=this[c].flush;this[c].flush=(L,H)=>{this.flush(L),H()};try{this[c].params(v,A)}finally{this[c].flush=M}this[c]&&(this[p]=v,this[g]=A)}}}}class N extends _{constructor(v){super(v,"Deflate")}}class C extends _{constructor(v){super(v,"Inflate")}}let Y=Symbol("_portable");class W extends _{constructor(v){super(v,"Gzip"),this[Y]=v&&!!v.portable}[n](v){return this[Y]?(this[Y]=!1,v[9]=255,super[n](v)):super[n](v)}}class ce extends _{constructor(v){super(v,"Gunzip")}}class be extends _{constructor(v){super(v,"DeflateRaw")}}class le extends _{constructor(v){super(v,"InflateRaw")}}class tt extends _{constructor(v){super(v,"Unzip")}}class Te extends w{constructor(v,A){v=v||{},v.flush=v.flush||i.BROTLI_OPERATION_PROCESS,v.finishFlush=v.finishFlush||i.BROTLI_OPERATION_FINISH,super(v,A),this[u]=i.BROTLI_OPERATION_FLUSH}}class T extends Te{constructor(v){super(v,"BrotliCompress")}}class x extends Te{constructor(v){super(v,"BrotliDecompress")}}e.Deflate=N,e.Inflate=C,e.Gzip=W,e.Gunzip=ce,e.DeflateRaw=be,e.InflateRaw=le,e.Unzip=tt,typeof go.default.BrotliCompress=="function"?(e.BrotliCompress=T,e.BrotliDecompress=x):e.BrotliCompress=e.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),qn=Symbol("slurp"),ha=class extends ur{constructor(e,r,i){switch(super(),this.pause(),this.extended=r,this.globalExtended=i,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=e.path,this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath,this.uname=e.uname,this.gname=e.gname,r&&this[qn](r),i&&this[qn](i,!0)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,s=this.blockRemain;return this.remain=Math.max(0,i-r),this.blockRemain=Math.max(0,s-r),this.ignore?!0:i>=r?super.write(e):super.write(e.slice(0,i))}[qn](e,r){for(let i in e)e[i]!==null&&e[i]!==void 0&&!(r&&i==="path")&&(this[i]=e[i])}},qi=Re(function(t,e){e.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),e.code=new Map(Array.from(e.name).map(r=>[r[1],r[0]]))}),Uy=(t,e)=>{if(Number.isSafeInteger(t))t<0?zy(t,e):Gy(t,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},Gy=(t,e)=>{e[0]=128;for(var r=e.length;r>1;r--)e[r-1]=t&255,t=Math.floor(t/256)},zy=(t,e)=>{e[0]=255;var r=!1;t=t*-1;for(var i=e.length;i>1;i--){var s=t&255;t=Math.floor(t/256),r?e[i-1]=md(s):s===0?e[i-1]=0:(r=!0,e[i-1]=pd(s))}},Hy=t=>{let e=t[0],r=e===128?Wy(t.slice(1,t.length)):e===255?Yy(t):null;if(r===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(r))throw Error("parsed number outside of javascript safe integer range");return r},Yy=t=>{for(var e=t.length,r=0,i=!1,s=e-1;s>-1;s--){var n=t[s],o;i?o=md(n):n===0?o=n:(i=!0,o=pd(n)),o!==0&&(r-=o*Math.pow(256,e-s-1))}return r},Wy=t=>{for(var e=t.length,r=0,i=e-1;i>-1;i--){var s=t[i];s!==0&&(r+=s*Math.pow(256,e-i-1))}return r},md=t=>(255^t)&255,pd=t=>(255^t)+1&255,gd={encode:Uy,parse:Hy},zt=b.default.posix,jn=Symbol("slurp"),he=Symbol("type"),bo=class{constructor(e,r,i,s){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[he]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,r||0,i,s):e&&this.set(e)}decode(e,r,i,s){if(r||(r=0),!e||!(e.length>=r+512))throw new Error("need 512 bytes for header");if(this.path=St(e,r,100),this.mode=ht(e,r+100,8),this.uid=ht(e,r+108,8),this.gid=ht(e,r+116,8),this.size=ht(e,r+124,12),this.mtime=Un(e,r+136,12),this.cksum=ht(e,r+148,12),this[jn](i),this[jn](s,!0),this[he]=St(e,r+156,1),this[he]===""&&(this[he]="0"),this[he]==="0"&&this.path.substr(-1)==="/"&&(this[he]="5"),this[he]==="5"&&(this.size=0),this.linkpath=St(e,r+157,100),e.slice(r+257,r+265).toString()==="ustar\x0000")if(this.uname=St(e,r+265,32),this.gname=St(e,r+297,32),this.devmaj=ht(e,r+329,8),this.devmin=ht(e,r+337,8),e[r+475]!==0){let o=St(e,r+345,155);this.path=o+"/"+this.path}else{let o=St(e,r+345,130);o&&(this.path=o+"/"+this.path),this.atime=Un(e,r+476,12),this.ctime=Un(e,r+488,12)}let n=8*32;for(let o=r;o<r+148;o++)n+=e[o];for(let o=r+156;o<r+512;o++)n+=e[o];this.cksumValid=n===this.cksum,this.cksum===null&&n===8*32&&(this.nullBlock=!0)}[jn](e,r){for(let i in e)e[i]!==null&&e[i]!==void 0&&!(r&&i==="path")&&(this[i]=e[i])}encode(e,r){if(e||(e=this.block=Buffer.alloc(512),r=0),r||(r=0),!(e.length>=r+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,s=Vy(this.path||"",i),n=s[0],o=s[1];this.needPax=s[2],this.needPax=Et(e,r,100,n)||this.needPax,this.needPax=ut(e,r+100,8,this.mode)||this.needPax,this.needPax=ut(e,r+108,8,this.uid)||this.needPax,this.needPax=ut(e,r+116,8,this.gid)||this.needPax,this.needPax=ut(e,r+124,12,this.size)||this.needPax,this.needPax=Gn(e,r+136,12,this.mtime)||this.needPax,e[r+156]=this[he].charCodeAt(0),this.needPax=Et(e,r+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",r+257,8),this.needPax=Et(e,r+265,32,this.uname)||this.needPax,this.needPax=Et(e,r+297,32,this.gname)||this.needPax,this.needPax=ut(e,r+329,8,this.devmaj)||this.needPax,this.needPax=ut(e,r+337,8,this.devmin)||this.needPax,this.needPax=Et(e,r+345,i,o)||this.needPax,e[r+475]!==0?this.needPax=Et(e,r+345,155,o)||this.needPax:(this.needPax=Et(e,r+345,130,o)||this.needPax,this.needPax=Gn(e,r+476,12,this.atime)||this.needPax,this.needPax=Gn(e,r+488,12,this.ctime)||this.needPax);let a=8*32;for(let l=r;l<r+148;l++)a+=e[l];for(let l=r+156;l<r+512;l++)a+=e[l];return this.cksum=a,ut(e,r+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let r in e)e[r]!==null&&e[r]!==void 0&&(this[r]=e[r])}get type(){return qi.name.get(this[he])||this[he]}get typeKey(){return this[he]}set type(e){qi.code.has(e)?this[he]=qi.code.get(e):this[he]=e}},Vy=(t,e)=>{let i=t,s="",n,o=zt.parse(t).root||".";if(Buffer.byteLength(i)<100)n=[i,s,!1];else{s=zt.dirname(i),i=zt.basename(i);do Buffer.byteLength(i)<=100&&Buffer.byteLength(s)<=e?n=[i,s,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(s)<=e?n=[i.substr(0,99),s,!0]:(i=zt.join(zt.basename(s),i),s=zt.dirname(s));while(s!==o&&!n);n||(n=[t.substr(0,99),"",!0])}return n},St=(t,e,r)=>t.slice(e,e+r).toString("utf8").replace(/\0.*/,""),Un=(t,e,r)=>Zy(ht(t,e,r)),Zy=t=>t===null?null:new Date(t*1e3),ht=(t,e,r)=>t[e]&128?gd.parse(t.slice(e,e+r)):Xy(t,e,r),Ky=t=>isNaN(t)?null:t,Xy=(t,e,r)=>Ky(parseInt(t.slice(e,e+r).toString("utf8").replace(/\0.*$/,"").trim(),8)),Jy={12:8589934591,8:2097151},ut=(t,e,r,i)=>i===null?!1:i>Jy[r]||i<0?(gd.encode(i,t.slice(e,e+r)),!0):(Qy(t,e,r,i),!1),Qy=(t,e,r,i)=>t.write(e0(i,r),e,r,"ascii"),e0=(t,e)=>t0(Math.floor(t).toString(8),e),t0=(t,e)=>(t.length===e-1?t:new Array(e-t.length-1).join("0")+t+" ")+"\0",Gn=(t,e,r,i)=>i===null?!1:ut(t,e,r,i.getTime()/1e3),r0=new Array(156).join("\0"),Et=(t,e,r,i)=>i===null?!1:(t.write(i+r0,e,r,"utf8"),i.length!==Buffer.byteLength(i)||i.length>r),Ft=bo,Hr=class{constructor(e,r){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=r||!1}encode(){let e=this.encodeBody();if(e==="")return null;let r=Buffer.byteLength(e),i=512*Math.ceil(1+r/512),s=Buffer.allocUnsafe(i);for(let n=0;n<512;n++)s[n]=0;new Ft({path:("PaxHeader/"+b.default.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:r,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(s),s.write(e,512,r,"utf8");for(let n=r+512;n<s.length;n++)s[n]=0;return s}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===null||this[e]===void 0)return"";let r=this[e]instanceof Date?this[e].getTime()/1e3:this[e],i=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+r+`
`,s=Buffer.byteLength(i),n=Math.floor(Math.log(s)/Math.log(10))+1;return s+n>=Math.pow(10,n)&&(n+=1),n+s+i}};Hr.parse=(t,e,r)=>new Hr(i0(s0(t),e),r);var i0=(t,e)=>e?Object.keys(t).reduce((r,i)=>(r[i]=t[i],r),e):t,s0=t=>t.replace(/\n$/,"").split(`
`).reduce(n0,Object.create(null)),n0=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.substr((r+" ").length);let i=e.split("="),s=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!s)return t;let n=i.join("=");return t[s]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(s)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,t},Yr=Hr,ds=t=>class extends t{warn(e,r,i={}){this.file&&(i.file=this.file),this.cwd&&(i.cwd=this.cwd),i.code=r instanceof Error&&r.code||e,i.tarCode=e,!this.strict&&i.recoverable!==!1?(r instanceof Error&&(i=Object.assign(r,i),r=r.message),this.emit("warn",i.tarCode,r,i)):r instanceof Error?this.emit("error",Object.assign(r,i)):this.emit("error",Object.assign(new Error(`${e}: ${r}`),i))}},fs=["|","<",">","?",":"],ua=fs.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),o0=new Map(fs.map((t,e)=>[t,ua[e]])),a0=new Map(ua.map((t,e)=>[t,fs[e]])),wo={encode:t=>fs.reduce((e,r)=>e.split(r).join(o0.get(r)),t),decode:t=>ua.reduce((e,r)=>e.split(r).join(a0.get(r)),t)},yd=(t,e,r)=>(t&=4095,r&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t),l0=16*1024*1024,Ec=Symbol("process"),_c=Symbol("file"),Oc=Symbol("directory"),So=Symbol("symlink"),Rc=Symbol("hardlink"),Nr=Symbol("header"),ji=Symbol("read"),Eo=Symbol("lstat"),Ui=Symbol("onlstat"),_o=Symbol("onread"),Oo=Symbol("onreadlink"),Ro=Symbol("openfile"),To=Symbol("onopenfile"),It=Symbol("close"),es=Symbol("mode"),ms=ds(class extends ur{constructor(e,r){if(r=r||{},super(r),typeof e!="string")throw new TypeError("path is required");this.path=e,this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid(),this.myuser=process.env.USER||"",this.maxReadSize=r.maxReadSize||l0,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=r.cwd||process.cwd(),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let i=!1;if(!this.preservePaths&&b.default.win32.isAbsolute(e)){let s=b.default.win32.parse(e);this.path=e.substr(s.root.length),i=s.root}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=wo.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=r.absolute||b.default.resolve(this.cwd,e),this.path===""&&(this.path="./"),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.statCache.has(this.absolute)?this[Ui](this.statCache.get(this.absolute)):this[Eo]()}[Eo](){m.default.lstat(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[Ui](r)})}[Ui](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=u0(e),this.emit("stat",e),this[Ec]()}[Ec](){switch(this.type){case"File":return this[_c]();case"Directory":return this[Oc]();case"SymbolicLink":return this[So]();default:return this.end()}}[es](e){return yd(e,this.type==="Directory",this.portable)}[Nr](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new Ft({path:this.path,linkpath:this.linkpath,mode:this[es](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&this.write(new Yr({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),this.write(this.header.block)}[Oc](){this.path.substr(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Nr](),this.end()}[So](){m.default.readlink(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[Oo](r)})}[Oo](e){this.linkpath=e.replace(/\\/g,"/"),this[Nr](),this.end()}[Rc](e){this.type="Link",this.linkpath=b.default.relative(this.cwd,e).replace(/\\/g,"/"),this.stat.size=0,this[Nr](),this.end()}[_c](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let r=this.linkCache.get(e);if(r.indexOf(this.cwd)===0)return this[Rc](r)}this.linkCache.set(e,this.absolute)}if(this[Nr](),this.stat.size===0)return this.end();this[Ro]()}[Ro](){m.default.open(this.absolute,"r",(e,r)=>{if(e)return this.emit("error",e);this[To](r)})}[To](e){let r=512*Math.ceil(this.stat.size/512),i=Math.min(r,this.maxReadSize),s=Buffer.allocUnsafe(i);this[ji](e,s,0,s.length,0,this.stat.size,r)}[ji](e,r,i,s,n,o,a){m.default.read(e,r,i,s,n,(l,h)=>{if(l)return this[It](e,()=>this.emit("error",l));this[_o](e,r,i,s,n,o,a,h)})}[It](e,r){m.default.close(e,r)}[_o](e,r,i,s,n,o,a,l){if(l<=0&&o>0){let u=new Error("encountered unexpected EOF");return u.path=this.absolute,u.syscall="read",u.code="EOF",this[It](e,()=>this.emit("error",u))}if(l>o){let u=new Error("did not encounter expected EOF");return u.path=this.absolute,u.syscall="read",u.code="EOF",this[It](e,()=>this.emit("error",u))}if(l===o)for(let u=l;u<s&&l<a;u++)r[u+i]=0,l++,o++;let h=i===0&&l===r.length?r:r.slice(i,i+l);if(o-=l,a-=l,n+=l,i+=l,this.write(h),!o)return a&&this.write(Buffer.alloc(a)),this[It](e,u=>u?this.emit("error",u):this.end());i>=s&&(r=Buffer.allocUnsafe(s),i=0),s=r.length-i,this[ji](e,r,i,s,n,o,a)}}),Co=class extends ms{[Eo](){this[Ui](m.default.lstatSync(this.absolute))}[So](){this[Oo](m.default.readlinkSync(this.absolute))}[Ro](){this[To](m.default.openSync(this.absolute,"r"))}[ji](e,r,i,s,n,o,a){let l=!0;try{let h=m.default.readSync(e,r,i,s,n);this[_o](e,r,i,s,n,o,a,h),l=!1}finally{if(l)try{this[It](e,()=>{})}catch{}}}[It](e,r){m.default.closeSync(e),r()}},h0=ds(class extends ur{constructor(e,r){r=r||{},super(r),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.path=e.path,this.mode=this[es](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:r.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=e.linkpath,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let i=!1;if(b.default.isAbsolute(this.path)&&!this.preservePaths){let s=b.default.parse(this.path);i=s.root,this.path=this.path.substr(s.root.length)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new Ft({path:this.path,linkpath:this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.header.encode()&&!this.noPax&&super.write(new Yr({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this.path,linkpath:this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[es](e){return yd(e,this.type==="Directory",this.portable)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(e)}end(){return this.blockRemain&&this.write(Buffer.alloc(this.blockRemain)),super.end()}});ms.Sync=Co;ms.Tar=h0;var u0=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported",ps=ms,ts=class{constructor(e,r){this.path=e||"./",this.absolute=r,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},c0=ps.Sync,d0=ps.Tar,Tc=Buffer.alloc(1024),Gi=Symbol("onStat"),Ti=Symbol("ended"),Ne=Symbol("queue"),Ht=Symbol("current"),_t=Symbol("process"),Ci=Symbol("processing"),Cc=Symbol("processJob"),Fe=Symbol("jobs"),zn=Symbol("jobDone"),zi=Symbol("addFSEntry"),xc=Symbol("addTarEntry"),xo=Symbol("stat"),Ao=Symbol("readdir"),Hi=Symbol("onreaddir"),Yi=Symbol("pipe"),Ac=Symbol("entry"),Hn=Symbol("entryOpt"),Io=Symbol("writeEntryClass"),vd=Symbol("write"),Yn=Symbol("ondrain"),ca=ds(class extends ur{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(e.prefix||"").replace(/(\\|\/)+$/,""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[Io]=ps,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new fd.Gzip(e.gzip),this.zip.on("data",r=>super.write(r)),this.zip.on("end",r=>super.end()),this.zip.on("drain",r=>this[Yn]()),this.on("resume",r=>this.zip.resume())):this.on("drain",this[Yn]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:r=>!0,this[Ne]=new At,this[Fe]=0,this.jobs=+e.jobs||4,this[Ci]=!1,this[Ti]=!1}[vd](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[Ti]=!0,this[_t](),this}write(e){if(this[Ti])throw new Error("write after end");return e instanceof ha?this[xc](e):this[zi](e),this.flowing}[xc](e){let r=b.default.resolve(this.cwd,e.path);if(this.prefix&&(e.path=this.prefix+"/"+e.path.replace(/^\.(\/+|$)/,"")),!this.filter(e.path,e))e.resume();else{let i=new ts(e.path,r,!1);i.entry=new d0(e,this[Hn](i)),i.entry.on("end",s=>this[zn](i)),this[Fe]+=1,this[Ne].push(i)}this[_t]()}[zi](e){let r=b.default.resolve(this.cwd,e);this.prefix&&(e=this.prefix+"/"+e.replace(/^\.(\/+|$)/,"")),this[Ne].push(new ts(e,r)),this[_t]()}[xo](e){e.pending=!0,this[Fe]+=1;let r=this.follow?"stat":"lstat";m.default[r](e.absolute,(i,s)=>{e.pending=!1,this[Fe]-=1,i?this.emit("error",i):this[Gi](e,s)})}[Gi](e,r){this.statCache.set(e.absolute,r),e.stat=r,this.filter(e.path,r)||(e.ignore=!0),this[_t]()}[Ao](e){e.pending=!0,this[Fe]+=1,m.default.readdir(e.absolute,(r,i)=>{if(e.pending=!1,this[Fe]-=1,r)return this.emit("error",r);this[Hi](e,i)})}[Hi](e,r){this.readdirCache.set(e.absolute,r),e.readdir=r,this[_t]()}[_t](){if(!this[Ci]){this[Ci]=!0;for(let e=this[Ne].head;e!==null&&this[Fe]<this.jobs;e=e.next)if(this[Cc](e.value),e.value.ignore){let r=e.next;this[Ne].removeNode(e),e.next=r}this[Ci]=!1,this[Ti]&&!this[Ne].length&&this[Fe]===0&&(this.zip?this.zip.end(Tc):(super.write(Tc),super.end()))}}get[Ht](){return this[Ne]&&this[Ne].head&&this[Ne].head.value}[zn](e){this[Ne].shift(),this[Fe]-=1,this[_t]()}[Cc](e){if(!e.pending){if(e.entry){e===this[Ht]&&!e.piped&&this[Yi](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[Gi](e,this.statCache.get(e.absolute)):this[xo](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[Hi](e,this.readdirCache.get(e.absolute)):this[Ao](e),!e.readdir))){if(e.entry=this[Ac](e),!e.entry){e.ignore=!0;return}e===this[Ht]&&!e.piped&&this[Yi](e)}}}[Hn](e){return{onwarn:(r,i,s)=>this.warn(r,i,s),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime}}[Ac](e){this[Fe]+=1;try{return new this[Io](e.path,this[Hn](e)).on("end",()=>this[zn](e)).on("error",r=>this.emit("error",r))}catch(r){this.emit("error",r)}}[Yn](){this[Ht]&&this[Ht].entry&&this[Ht].entry.resume()}[Yi](e){e.piped=!0,e.readdir&&e.readdir.forEach(s=>{let n=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[zi](o+s)});let r=e.entry,i=this.zip;i?r.on("data",s=>{i.write(s)||r.pause()}):r.on("data",s=>{super.write(s)||r.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),Mo=class extends ca{constructor(e){super(e),this[Io]=c0}pause(){}resume(){}[xo](e){let r=this.follow?"statSync":"lstatSync";this[Gi](e,m.default[r](e.absolute))}[Ao](e,r){this[Hi](e,m.default.readdirSync(e.absolute))}[Yi](e){let r=e.entry,i=this.zip;e.readdir&&e.readdir.forEach(s=>{let n=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[zi](o+s)}),i?r.on("data",s=>{i.write(s)}):r.on("data",s=>{super[vd](s)})}};ca.Sync=Mo;var Pt=ca,f0=hr.default.EventEmitter,ko=m.default.writev;if(!ko){let t=process.binding("fs"),e=t.FSReqWrap||t.FSReqCallback;ko=(r,i,s,n)=>{let o=(l,h)=>n(l,h,i),a=new e;a.oncomplete=o,t.writeBuffers(r,i,s,a)}}var rr=Symbol("_autoClose"),Oe=Symbol("_close"),Fr=Symbol("_ended"),F=Symbol("_fd"),Ic=Symbol("_finished"),ft=Symbol("_flags"),Wn=Symbol("_flush"),Do=Symbol("_handleChunk"),No=Symbol("_makeBuf"),rs=Symbol("_mode"),xi=Symbol("_needDrain"),Jt=Symbol("_onerror"),ir=Symbol("_onopen"),Vn=Symbol("_onread"),Vt=Symbol("_onwrite"),mt=Symbol("_open"),Je=Symbol("_path"),xt=Symbol("_pos"),Pe=Symbol("_queue"),Zt=Symbol("_read"),Mc=Symbol("_readSize"),ct=Symbol("_reading"),Ai=Symbol("_remain"),kc=Symbol("_size"),Wi=Symbol("_write"),Yt=Symbol("_writing"),Vi=Symbol("_defaultFlag"),Qt=Symbol("_errored"),is=class extends ur{constructor(e,r){if(r=r||{},super(r),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Qt]=!1,this[F]=typeof r.fd=="number"?r.fd:null,this[Je]=e,this[Mc]=r.readSize||16*1024*1024,this[ct]=!1,this[kc]=typeof r.size=="number"?r.size:1/0,this[Ai]=this[kc],this[rr]=typeof r.autoClose=="boolean"?r.autoClose:!0,typeof this[F]=="number"?this[Zt]():this[mt]()}get fd(){return this[F]}get path(){return this[Je]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[mt](){m.default.open(this[Je],"r",(e,r)=>this[ir](e,r))}[ir](e,r){e?this[Jt](e):(this[F]=r,this.emit("open",r),this[Zt]())}[No](){return Buffer.allocUnsafe(Math.min(this[Mc],this[Ai]))}[Zt](){if(!this[ct]){this[ct]=!0;let e=this[No]();if(e.length===0)return process.nextTick(()=>this[Vn](null,0,e));m.default.read(this[F],e,0,e.length,null,(r,i,s)=>this[Vn](r,i,s))}}[Vn](e,r,i){this[ct]=!1,e?this[Jt](e):this[Do](r,i)&&this[Zt]()}[Oe](){if(this[rr]&&typeof this[F]=="number"){let e=this[F];this[F]=null,m.default.close(e,r=>r?this.emit("error",r):this.emit("close"))}}[Jt](e){this[ct]=!0,this[Oe](),this.emit("error",e)}[Do](e,r){let i=!1;return this[Ai]-=e,e>0&&(i=super.write(e<r.length?r.slice(0,e):r)),(e===0||this[Ai]<=0)&&(i=!1,this[Oe](),super.end()),i}emit(e,r){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[F]=="number"&&this[Zt]();break;case"error":return this[Qt]?void 0:(this[Qt]=!0,super.emit(e,r));default:return super.emit(e,r)}}},Fo=class extends is{[mt](){let e=!0;try{this[ir](null,m.default.openSync(this[Je],"r")),e=!1}finally{e&&this[Oe]()}}[Zt](){let e=!0;try{if(!this[ct]){this[ct]=!0;do{let r=this[No](),i=r.length===0?0:m.default.readSync(this[F],r,0,r.length,null);if(!this[Do](i,r))break}while(!0);this[ct]=!1}e=!1}finally{e&&this[Oe]()}}[Oe](){if(this[rr]&&typeof this[F]=="number"){let e=this[F];this[F]=null,m.default.closeSync(e),this.emit("close")}}},ss=class extends f0{constructor(e,r){r=r||{},super(r),this.readable=!1,this.writable=!0,this[Qt]=!1,this[Yt]=!1,this[Fr]=!1,this[xi]=!1,this[Pe]=[],this[Je]=e,this[F]=typeof r.fd=="number"?r.fd:null,this[rs]=r.mode===void 0?438:r.mode,this[xt]=typeof r.start=="number"?r.start:null,this[rr]=typeof r.autoClose=="boolean"?r.autoClose:!0;let i=this[xt]!==null?"r+":"w";this[Vi]=r.flags===void 0,this[ft]=this[Vi]?i:r.flags,this[F]===null&&this[mt]()}emit(e,r){if(e==="error"){if(this[Qt])return;this[Qt]=!0}return super.emit(e,r)}get fd(){return this[F]}get path(){return this[Je]}[Jt](e){this[Oe](),this[Yt]=!0,this.emit("error",e)}[mt](){m.default.open(this[Je],this[ft],this[rs],(e,r)=>this[ir](e,r))}[ir](e,r){this[Vi]&&this[ft]==="r+"&&e&&e.code==="ENOENT"?(this[ft]="w",this[mt]()):e?this[Jt](e):(this[F]=r,this.emit("open",r),this[Wn]())}end(e,r){return e&&this.write(e,r),this[Fr]=!0,!this[Yt]&&!this[Pe].length&&typeof this[F]=="number"&&this[Vt](null,0),this}write(e,r){return typeof e=="string"&&(e=Buffer.from(e,r)),this[Fr]?(this.emit("error",new Error("write() after end()")),!1):this[F]===null||this[Yt]||this[Pe].length?(this[Pe].push(e),this[xi]=!0,!1):(this[Yt]=!0,this[Wi](e),!0)}[Wi](e){m.default.write(this[F],e,0,e.length,this[xt],(r,i)=>this[Vt](r,i))}[Vt](e,r){e?this[Jt](e):(this[xt]!==null&&(this[xt]+=r),this[Pe].length?this[Wn]():(this[Yt]=!1,this[Fr]&&!this[Ic]?(this[Ic]=!0,this[Oe](),this.emit("finish")):this[xi]&&(this[xi]=!1,this.emit("drain"))))}[Wn](){if(this[Pe].length===0)this[Fr]&&this[Vt](null,0);else if(this[Pe].length===1)this[Wi](this[Pe].pop());else{let e=this[Pe];this[Pe]=[],ko(this[F],e,this[xt],(r,i)=>this[Vt](r,i))}}[Oe](){if(this[rr]&&typeof this[F]=="number"){let e=this[F];this[F]=null,m.default.close(e,r=>r?this.emit("error",r):this.emit("close"))}}},Po=class extends ss{[mt](){let e;if(this[Vi]&&this[ft]==="r+")try{e=m.default.openSync(this[Je],this[ft],this[rs])}catch(r){if(r.code==="ENOENT")return this[ft]="w",this[mt]();throw r}else e=m.default.openSync(this[Je],this[ft],this[rs]);this[ir](null,e)}[Oe](){if(this[rr]&&typeof this[F]=="number"){let e=this[F];this[F]=null,m.default.closeSync(e),this.emit("close")}}[Wi](e){let r=!0;try{this[Vt](null,m.default.writeSync(this[F],e,0,e.length,this[xt])),r=!1}finally{if(r)try{this[Oe]()}catch{}}}},m0=is,p0=Fo,g0=ss,y0=Po,vt={ReadStream:m0,ReadStreamSync:p0,WriteStream:g0,WriteStreamSync:y0},v0=1024*1024,Zn=Buffer.from([31,139]),fe=Symbol("state"),Ot=Symbol("writeEntry"),Ve=Symbol("readEntry"),Kn=Symbol("nextEntry"),Dc=Symbol("processEntry"),me=Symbol("extendedHeader"),Pr=Symbol("globalExtendedHeader"),at=Symbol("meta"),Nc=Symbol("emitMeta"),$=Symbol("buffer"),Ze=Symbol("queue"),Rt=Symbol("ended"),Fc=Symbol("emittedEnd"),Tt=Symbol("emit"),oe=Symbol("unzip"),Ii=Symbol("consumeChunk"),Mi=Symbol("consumeChunkSub"),Xn=Symbol("consumeBody"),Pc=Symbol("consumeMeta"),Lc=Symbol("consumeHeader"),ki=Symbol("consuming"),Jn=Symbol("bufferConcat"),Qn=Symbol("maybeEnd"),Lr=Symbol("writing"),lt=Symbol("aborted"),Di=Symbol("onDone"),Ct=Symbol("sawValidEntry"),Ni=Symbol("sawNullBlock"),Fi=Symbol("sawEOF"),b0=t=>!0,gs=ds(class extends hr.default{constructor(e){e=e||{},super(e),this.file=e.file||"",this[Ct]=null,this.on(Di,r=>{(this[fe]==="begin"||this[Ct]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Di,e.ondone):this.on(Di,r=>{this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||v0,this.filter=typeof e.filter=="function"?e.filter:b0,this.writable=!0,this.readable=!1,this[Ze]=new At,this[$]=null,this[Ve]=null,this[Ot]=null,this[fe]="begin",this[at]="",this[me]=null,this[Pr]=null,this[Rt]=!1,this[oe]=null,this[lt]=!1,this[Ni]=!1,this[Fi]=!1,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[Lc](e,r){this[Ct]===null&&(this[Ct]=!1);let i;try{i=new Ft(e,r,this[me],this[Pr])}catch(s){return this.warn("TAR_ENTRY_INVALID",s)}if(i.nullBlock)this[Ni]?(this[Fi]=!0,this[fe]==="begin"&&(this[fe]="header"),this[Tt]("eof")):(this[Ni]=!0,this[Tt]("nullBlock"));else if(this[Ni]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let s=i.type;if(/^(Symbolic)?Link$/.test(s)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(s)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let n=this[Ot]=new ha(i,this[me],this[Pr]);if(!this[Ct])if(n.remain){let o=()=>{n.invalid||(this[Ct]=!0)};n.on("end",o)}else this[Ct]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[Tt]("ignoredEntry",n),this[fe]="ignore",n.resume()):n.size>0&&(this[at]="",n.on("data",o=>this[at]+=o),this[fe]="meta"):(this[me]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[Tt]("ignoredEntry",n),this[fe]=n.remain?"ignore":"header",n.resume()):(n.remain?this[fe]="body":(this[fe]="header",n.end()),this[Ve]?this[Ze].push(n):(this[Ze].push(n),this[Kn]())))}}}[Dc](e){let r=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Ve]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",i=>this[Kn]()),r=!1)):(this[Ve]=null,r=!1),r}[Kn](){do;while(this[Dc](this[Ze].shift()));if(!this[Ze].length){let e=this[Ve];!e||e.flowing||e.size===e.remain?this[Lr]||this.emit("drain"):e.once("drain",i=>this.emit("drain"))}}[Xn](e,r){let i=this[Ot],s=i.blockRemain,n=s>=e.length&&r===0?e:e.slice(r,r+s);return i.write(n),i.blockRemain||(this[fe]="header",this[Ot]=null,i.end()),n.length}[Pc](e,r){let i=this[Ot],s=this[Xn](e,r);return this[Ot]||this[Nc](i),s}[Tt](e,r,i){!this[Ze].length&&!this[Ve]?this.emit(e,r,i):this[Ze].push([e,r,i])}[Nc](e){switch(this[Tt]("meta",this[at]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[me]=Yr.parse(this[at],this[me],!1);break;case"GlobalExtendedHeader":this[Pr]=Yr.parse(this[at],this[Pr],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[me]=this[me]||Object.create(null),this[me].path=this[at].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[me]=this[me]||Object.create(null),this[me].linkpath=this[at].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[lt]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[lt])return;if(this[oe]===null&&e){if(this[$]&&(e=Buffer.concat([this[$],e]),this[$]=null),e.length<Zn.length)return this[$]=e,!0;for(let i=0;this[oe]===null&&i<Zn.length;i++)e[i]!==Zn[i]&&(this[oe]=!1);if(this[oe]===null){let i=this[Rt];this[Rt]=!1,this[oe]=new fd.Unzip,this[oe].on("data",n=>this[Ii](n)),this[oe].on("error",n=>this.abort(n)),this[oe].on("end",n=>{this[Rt]=!0,this[Ii]()}),this[Lr]=!0;let s=this[oe][i?"end":"write"](e);return this[Lr]=!1,s}}this[Lr]=!0,this[oe]?this[oe].write(e):this[Ii](e),this[Lr]=!1;let r=this[Ze].length?!1:this[Ve]?this[Ve].flowing:!0;return!r&&!this[Ze].length&&this[Ve].once("drain",i=>this.emit("drain")),r}[Jn](e){e&&!this[lt]&&(this[$]=this[$]?Buffer.concat([this[$],e]):e)}[Qn](){if(this[Rt]&&!this[Fc]&&!this[lt]&&!this[ki]){this[Fc]=!0;let e=this[Ot];if(e&&e.blockRemain){let r=this[$]?this[$].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${r} available)`,{entry:e}),this[$]&&e.write(this[$]),e.end()}this[Tt](Di)}}[Ii](e){if(this[ki])this[Jn](e);else if(!e&&!this[$])this[Qn]();else{if(this[ki]=!0,this[$]){this[Jn](e);let r=this[$];this[$]=null,this[Mi](r)}else this[Mi](e);for(;this[$]&&this[$].length>=512&&!this[lt]&&!this[Fi];){let r=this[$];this[$]=null,this[Mi](r)}this[ki]=!1}(!this[$]||this[Rt])&&this[Qn]()}[Mi](e){let r=0,i=e.length;for(;r+512<=i&&!this[lt]&&!this[Fi];)switch(this[fe]){case"begin":case"header":this[Lc](e,r),r+=512;break;case"ignore":case"body":r+=this[Xn](e,r);break;case"meta":r+=this[Pc](e,r);break;default:throw new Error("invalid state: "+this[fe])}r<i&&(this[$]?this[$]=Buffer.concat([e.slice(r),this[$]]):this[$]=e.slice(r))}end(e){this[lt]||(this[oe]?this[oe].end(e):(this[Rt]=!0,this.write(e)))}}),ti=(t,e,r)=>{typeof t=="function"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e=="function"&&(r=e,e=null),e?e=Array.from(e):e=[];let i=ei(t);if(i.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return e.length&&S0(i,e),i.noResume||w0(i),i.file&&i.sync?E0(i):i.file?_0(i,r):bd(i)},w0=t=>{let e=t.onentry;t.onentry=e?r=>{e(r),r.resume()}:r=>r.resume()},S0=(t,e)=>{let r=new Map(e.map(n=>[n.replace(/\/+$/,""),!0])),i=t.filter,s=(n,o)=>{let a=o||b.default.parse(n).root||".",l=n===a?!1:r.has(n)?r.get(n):s(b.default.dirname(n),a);return r.set(n,l),l};t.filter=i?(n,o)=>i(n,o)&&s(n.replace(/\/+$/,"")):n=>s(n.replace(/\/+$/,""))},E0=t=>{let e=bd(t),r=t.file,i=!0,s;try{let n=m.default.statSync(r),o=t.maxReadSize||16*1024*1024;if(n.size<o)e.end(m.default.readFileSync(r));else{let a=0,l=Buffer.allocUnsafe(o);for(s=m.default.openSync(r,"r");a<n.size;){let h=m.default.readSync(s,l,0,o,a);a+=h,e.write(l.slice(0,h))}e.end()}i=!1}finally{if(i&&s)try{m.default.closeSync(s)}catch{}}},_0=(t,e)=>{let r=new gs(t),i=t.maxReadSize||16*1024*1024,s=t.file,n=new Promise((o,a)=>{r.on("error",a),r.on("end",o),m.default.stat(s,(l,h)=>{if(l)a(l);else{let u=new vt.ReadStream(s,{readSize:i,size:h.size});u.on("error",a),u.pipe(r)}})});return e?n.then(e,e):n},bd=t=>new gs(t),O0=(t,e,r)=>{if(typeof e=="function"&&(r=e),Array.isArray(t)&&(e=t,t={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let i=ei(t);if(i.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return i.file&&i.sync?R0(i,e):i.file?T0(i,e,r):i.sync?C0(i,e):x0(i,e)},R0=(t,e)=>{let r=new Pt.Sync(t),i=new vt.WriteStreamSync(t.file,{mode:t.mode||438});r.pipe(i),wd(r,e)},T0=(t,e,r)=>{let i=new Pt(t),s=new vt.WriteStream(t.file,{mode:t.mode||438});i.pipe(s);let n=new Promise((o,a)=>{s.on("error",a),s.on("close",o),i.on("error",a)});return da(i,e),r?n.then(r,r):n},wd=(t,e)=>{e.forEach(r=>{r.charAt(0)==="@"?ti({file:b.default.resolve(t.cwd,r.substr(1)),sync:!0,noResume:!0,onentry:i=>t.add(i)}):t.add(r)}),t.end()},da=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)==="@")return ti({file:b.default.resolve(t.cwd,r.substr(1)),noResume:!0,onentry:i=>t.add(i)}).then(i=>da(t,e));t.add(r)}t.end()},C0=(t,e)=>{let r=new Pt.Sync(t);return wd(r,e),r},x0=(t,e)=>{let r=new Pt(t);return da(r,e),r},Sd=(t,e,r)=>{let i=ei(t);if(!i.file)throw new TypeError("file is required");if(i.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),i.sync?A0(i,e):M0(i,e,r)},A0=(t,e)=>{let r=new Pt.Sync(t),i=!0,s,n;try{try{s=m.default.openSync(t.file,"r+")}catch(l){if(l.code==="ENOENT")s=m.default.openSync(t.file,"w+");else throw l}let o=m.default.fstatSync(s),a=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let u=0,c=0;u<512;u+=c){if(c=m.default.readSync(s,a,u,a.length-u,n+u),n===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!c)break e}let l=new Ft(a);if(!l.cksumValid)break;let h=512*Math.ceil(l.size/512);if(n+h+512>o.size)break;n+=h,t.mtimeCache&&t.mtimeCache.set(l.path,l.mtime)}i=!1,I0(t,r,n,s,e)}finally{if(i)try{m.default.closeSync(s)}catch{}}},I0=(t,e,r,i,s)=>{let n=new vt.WriteStreamSync(t.file,{fd:i,start:r});e.pipe(n),k0(e,s)},M0=(t,e,r)=>{e=Array.from(e);let i=new Pt(t),s=(o,a,l)=>{let h=(p,g)=>{p?m.default.close(o,y=>l(p)):l(null,g)},u=0;if(a===0)return h(null,0);let c=0,d=Buffer.alloc(512),f=(p,g)=>{if(p)return h(p);if(c+=g,c<512&&g)return m.default.read(o,d,c,d.length-c,u+c,f);if(u===0&&d[0]===31&&d[1]===139)return h(new Error("cannot append to compressed archives"));if(c<512)return h(null,u);let y=new Ft(d);if(!y.cksumValid)return h(null,u);let w=512*Math.ceil(y.size/512);if(u+w+512>a||(u+=w+512,u>=a))return h(null,u);t.mtimeCache&&t.mtimeCache.set(y.path,y.mtime),c=0,m.default.read(o,d,0,512,u,f)};m.default.read(o,d,0,512,u,f)},n=new Promise((o,a)=>{i.on("error",a);let l="r+",h=(u,c)=>{if(u&&u.code==="ENOENT"&&l==="r+")return l="w+",m.default.open(t.file,l,h);if(u)return a(u);m.default.fstat(c,(d,f)=>{if(d)return a(d);s(c,f.size,(p,g)=>{if(p)return a(p);let y=new vt.WriteStream(t.file,{fd:c,start:g});i.pipe(y),y.on("error",a),y.on("close",o),Ed(i,e)})})};m.default.open(t.file,l,h)});return r?n.then(r,r):n},k0=(t,e)=>{e.forEach(r=>{r.charAt(0)==="@"?ti({file:b.default.resolve(t.cwd,r.substr(1)),sync:!0,noResume:!0,onentry:i=>t.add(i)}):t.add(r)}),t.end()},Ed=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)==="@")return ti({file:b.default.resolve(t.cwd,r.substr(1)),noResume:!0,onentry:i=>t.add(i)}).then(i=>Ed(t,e));t.add(r)}t.end()},D0=(t,e,r)=>{let i=ei(t);if(!i.file)throw new TypeError("file is required");if(i.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),N0(i),Sd(i,e,r)},N0=t=>{let e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(r,i)=>e(r,i)&&!(t.mtimeCache.get(r)>i.mtime):(r,i)=>!(t.mtimeCache.get(r)>i.mtime)},{promisify:$c}=Le.default,F0=t=>{if(!t)t={mode:511,fs:m.default};else if(typeof t=="object")t={mode:511,fs:m.default,...t};else if(typeof t=="number")t={mode:t,fs:m.default};else if(typeof t=="string")t={mode:parseInt(t,8),fs:m.default};else throw new TypeError("invalid options argument");return t.mkdir=t.mkdir||t.fs.mkdir||m.default.mkdir,t.mkdirAsync=$c(t.mkdir),t.stat=t.stat||t.fs.stat||m.default.stat,t.statAsync=$c(t.stat),t.statSync=t.statSync||t.fs.statSync||m.default.statSync,t.mkdirSync=t.mkdirSync||t.fs.mkdirSync||m.default.mkdirSync,t},cr=F0,P0=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:L0,parse:$0}=b.default,B0=t=>{if(/\0/.test(t))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:t,code:"ERR_INVALID_ARG_VALUE"});if(t=L0(t),P0==="win32"){let e=/[*|"<>?:]/,{root:r}=$0(t);if(e.test(t.substr(r.length)))throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}return t},dr=B0,{dirname:_d}=b.default,Od=(t,e,r=void 0)=>r===e?Promise.resolve():t.statAsync(e).then(i=>i.isDirectory()?r:void 0,i=>i.code==="ENOENT"?Od(t,_d(e),e):void 0),Rd=(t,e,r=void 0)=>{if(r!==e)try{return t.statSync(e).isDirectory()?r:void 0}catch(i){return i.code==="ENOENT"?Rd(t,_d(e),e):void 0}},q0={findMade:Od,findMadeSync:Rd},{dirname:Td}=b.default,Lo=(t,e,r)=>{e.recursive=!1;let i=Td(t);return i===t?e.mkdirAsync(t,e).catch(s=>{if(s.code!=="EISDIR")throw s}):e.mkdirAsync(t,e).then(()=>r||t,s=>{if(s.code==="ENOENT")return Lo(i,e).then(n=>Lo(t,e,n));if(s.code!=="EEXIST"&&s.code!=="EROFS")throw s;return e.statAsync(t).then(n=>{if(n.isDirectory())return r;throw s},()=>{throw s})})},$o=(t,e,r)=>{let i=Td(t);if(e.recursive=!1,i===t)try{return e.mkdirSync(t,e)}catch(s){if(s.code!=="EISDIR")throw s;return}try{return e.mkdirSync(t,e),r||t}catch(s){if(s.code==="ENOENT")return $o(t,e,$o(i,e,r));if(s.code!=="EEXIST"&&s.code!=="EROFS")throw s;try{if(!e.statSync(t).isDirectory())throw s}catch{throw s}}},Cd={mkdirpManual:Lo,mkdirpManualSync:$o},{dirname:xd}=b.default,{findMade:j0,findMadeSync:U0}=q0,{mkdirpManual:G0,mkdirpManualSync:z0}=Cd,H0=(t,e)=>(e.recursive=!0,xd(t)===t?e.mkdirAsync(t,e):j0(e,t).then(i=>e.mkdirAsync(t,e).then(()=>i).catch(s=>{if(s.code==="ENOENT")return G0(t,e);throw s}))),Y0=(t,e)=>{if(e.recursive=!0,xd(t)===t)return e.mkdirSync(t,e);let i=U0(e,t);try{return e.mkdirSync(t,e),i}catch(s){if(s.code==="ENOENT")return z0(t,e);throw s}},W0={mkdirpNative:H0,mkdirpNativeSync:Y0},V0=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,eo=V0.replace(/^v/,"").split("."),Ad=+eo[0]>10||+eo[0]==10&&+eo[1]>=12,Z0=Ad?t=>t.mkdir===m.default.mkdir:()=>!1,K0=Ad?t=>t.mkdirSync===m.default.mkdirSync:()=>!1,X0={useNative:Z0,useNativeSync:K0},{mkdirpNative:Id,mkdirpNativeSync:Md}=W0,{mkdirpManual:kd,mkdirpManualSync:Dd}=Cd,{useNative:J0,useNativeSync:Q0}=X0,fr=(t,e)=>(t=dr(t),e=cr(e),J0(e)?Id(t,e):kd(t,e)),ev=(t,e)=>(t=dr(t),e=cr(e),Q0(e)?Md(t,e):Dd(t,e));fr.sync=ev;fr.native=(t,e)=>Id(dr(t),cr(e));fr.manual=(t,e)=>kd(dr(t),cr(e));fr.nativeSync=(t,e)=>Md(dr(t),cr(e));fr.manualSync=(t,e)=>Dd(dr(t),cr(e));var Nd=fr,tv=m.default.lchown?"lchown":"chown",rv=m.default.lchownSync?"lchownSync":"chownSync",Fd=m.default.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Bc=(t,e,r)=>{try{return m.default[rv](t,e,r)}catch(i){if(i.code!=="ENOENT")throw i}},iv=(t,e,r)=>{try{return m.default.chownSync(t,e,r)}catch(i){if(i.code!=="ENOENT")throw i}},sv=Fd?(t,e,r,i)=>s=>{!s||s.code!=="EISDIR"?i(s):m.default.chown(t,e,r,i)}:(t,e,r,i)=>i,Bo=Fd?(t,e,r)=>{try{return Bc(t,e,r)}catch(i){if(i.code!=="EISDIR")throw i;iv(t,e,r)}}:(t,e,r)=>Bc(t,e,r),nv=process.version,Pd=(t,e,r)=>m.default.readdir(t,e,r),ov=(t,e)=>m.default.readdirSync(t,e);/^v4\./.test(nv)&&(Pd=(t,e,r)=>m.default.readdir(t,r));var ns=(t,e,r,i)=>{m.default[tv](t,e,r,sv(t,e,r,s=>{i(s&&s.code!=="ENOENT"?s:null)}))},Ld=(t,e,r,i,s)=>{if(typeof e=="string")return m.default.lstat(b.default.resolve(t,e),(n,o)=>{if(n)return s(n.code!=="ENOENT"?n:null);o.name=e,Ld(t,o,r,i,s)});if(e.isDirectory())fa(b.default.resolve(t,e.name),r,i,n=>{if(n)return s(n);let o=b.default.resolve(t,e.name);ns(o,r,i,s)});else{let n=b.default.resolve(t,e.name);ns(n,r,i,s)}},fa=(t,e,r,i)=>{Pd(t,{withFileTypes:!0},(s,n)=>{if(s){if(s.code==="ENOENT")return i();if(s.code!=="ENOTDIR"&&s.code!=="ENOTSUP")return i(s)}if(s||!n.length)return ns(t,e,r,i);let o=n.length,a=null,l=h=>{if(!a){if(h)return i(a=h);if(--o===0)return ns(t,e,r,i)}};n.forEach(h=>Ld(t,h,e,r,l))})},av=(t,e,r,i)=>{if(typeof e=="string")try{let s=m.default.lstatSync(b.default.resolve(t,e));s.name=e,e=s}catch(s){if(s.code==="ENOENT")return;throw s}e.isDirectory()&&$d(b.default.resolve(t,e.name),r,i),Bo(b.default.resolve(t,e.name),r,i)},$d=(t,e,r)=>{let i;try{i=ov(t,{withFileTypes:!0})}catch(s){if(s.code==="ENOENT")return;if(s.code==="ENOTDIR"||s.code==="ENOTSUP")return Bo(t,e,r);throw s}return i&&i.length&&i.forEach(s=>av(t,s,e,r)),Bo(t,e,r)},Bd=fa;fa.sync=$d;var os=class extends Error{constructor(e,r){super("Cannot extract through symbolic link"),this.path=r,this.symlink=e}get name(){return"SylinkError"}},sr=class extends Error{constructor(e,r){super(r+": Cannot cd into '"+e+"'"),this.path=e,this.code=r}get name(){return"CwdError"}},ma=(t,e,r)=>{let i=e.umask,s=e.mode|448,n=(s&i)!==0,o=e.uid,a=e.gid,l=typeof o=="number"&&typeof a=="number"&&(o!==e.processUid||a!==e.processGid),h=e.preserve,u=e.unlink,c=e.cache,d=e.cwd,f=(y,w)=>{y?r(y):(c.set(t,!0),w&&l?Bd(w,o,a,_=>f(_)):n?m.default.chmod(t,s,r):r())};if(c&&c.get(t)===!0)return f();if(t===d)return m.default.stat(t,(y,w)=>{(y||!w.isDirectory())&&(y=new sr(t,y&&y.code||"ENOTDIR")),f(y)});if(h)return Nd(t,{mode:s}).then(y=>f(null,y),f);let g=b.default.relative(d,t).split(/\/|\\/);as(d,g,s,c,u,d,null,f)},as=(t,e,r,i,s,n,o,a)=>{if(!e.length)return a(null,o);let l=e.shift(),h=t+"/"+l;if(i.get(h))return as(h,e,r,i,s,n,o,a);m.default.mkdir(h,r,qd(h,e,r,i,s,n,o,a))},qd=(t,e,r,i,s,n,o,a)=>l=>{if(l){if(l.path&&b.default.dirname(l.path)===n&&(l.code==="ENOTDIR"||l.code==="ENOENT"))return a(new sr(n,l.code));m.default.lstat(t,(h,u)=>{if(h)a(h);else if(u.isDirectory())as(t,e,r,i,s,n,o,a);else if(s)m.default.unlink(t,c=>{if(c)return a(c);m.default.mkdir(t,r,qd(t,e,r,i,s,n,o,a))});else{if(u.isSymbolicLink())return a(new os(t,t+"/"+e.join("/")));a(l)}})}else o=o||t,as(t,e,r,i,s,n,o,a)},lv=(t,e)=>{let r=e.umask,i=e.mode|448,s=(i&r)!==0,n=e.uid,o=e.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==e.processUid||o!==e.processGid),l=e.preserve,h=e.unlink,u=e.cache,c=e.cwd,d=y=>{u.set(t,!0),y&&a&&Bd.sync(y,n,o),s&&m.default.chmodSync(t,i)};if(u&&u.get(t)===!0)return d();if(t===c){let y=!1,w="ENOTDIR";try{y=m.default.statSync(t).isDirectory()}catch(_){w=_.code}finally{if(!y)throw new sr(t,w)}d();return}if(l)return d(Nd.sync(t,i));let p=b.default.relative(c,t).split(/\/|\\/),g=null;for(let y=p.shift(),w=c;y&&(w+="/"+y);y=p.shift())if(!u.get(w))try{m.default.mkdirSync(w,i),g=g||w,u.set(w,!0)}catch(_){if(_.path&&b.default.dirname(_.path)===c&&(_.code==="ENOTDIR"||_.code==="ENOENT"))return new sr(c,_.code);let N=m.default.lstatSync(w);if(N.isDirectory()){u.set(w,!0);continue}else if(h){m.default.unlinkSync(w),m.default.mkdirSync(w,i),g=g||w,u.set(w,!0);continue}else if(N.isSymbolicLink())return new os(w,w+"/"+p.join("/"))}return d(g)};ma.sync=lv;var hv=()=>{let t=new Map,e=new Map,{join:r}=b.default,i=u=>r(u).split(/[\\/]/).slice(0,-1).reduce((c,d)=>c.length?c.concat(r(c[c.length-1],d)):[d],[]),s=new Set,n=u=>{let c=e.get(u);if(!c)throw new Error("function does not have any path reservations");return{paths:c.paths.map(d=>t.get(d)),dirs:[...c.dirs].map(d=>t.get(d))}},o=u=>{let{paths:c,dirs:d}=n(u);return c.every(f=>f[0]===u)&&d.every(f=>f[0]instanceof Set&&f[0].has(u))},a=u=>s.has(u)||!o(u)?!1:(s.add(u),u(()=>l(u)),!0),l=u=>{if(!s.has(u))return!1;let{paths:c,dirs:d}=e.get(u),f=new Set;return c.forEach(p=>{let g=t.get(p);O.default.equal(g[0],u),g.length===1?t.delete(p):(g.shift(),typeof g[0]=="function"?f.add(g[0]):g[0].forEach(y=>f.add(y)))}),d.forEach(p=>{let g=t.get(p);O.default(g[0]instanceof Set),g[0].size===1&&g.length===1?t.delete(p):g[0].size===1?(g.shift(),f.add(g[0])):g[0].delete(u)}),s.delete(u),f.forEach(p=>a(p)),!0};return{check:o,reserve:(u,c)=>{let d=new Set(u.map(f=>i(f)).reduce((f,p)=>f.concat(p)));return e.set(c,{dirs:d,paths:u}),u.forEach(f=>{let p=t.get(f);p?p.push(c):t.set(f,[c])}),d.forEach(f=>{let p=t.get(f);p?p[p.length-1]instanceof Set?p[p.length-1].add(c):p.push(new Set([c])):t.set(f,[new Set([c])])}),a(c)}}},uv=process.env.__FAKE_PLATFORM__||process.platform,cv=uv==="win32",dv=ve.__FAKE_TESTING_FS__||m.default,{O_CREAT:fv,O_TRUNC:mv,O_WRONLY:pv,UV_FS_O_FILEMAP:jd=0}=dv.constants,gv=cv&&!!jd,yv=512*1024,vv=jd|mv|fv|pv,Ud=gv?t=>t<yv?vv:"w":()=>"w",qc=Symbol("onEntry"),qo=Symbol("checkFs"),jc=Symbol("checkFs2"),jo=Symbol("isReusable"),Xe=Symbol("makeFs"),Uo=Symbol("file"),Go=Symbol("directory"),Zi=Symbol("link"),Uc=Symbol("symlink"),Gc=Symbol("hardlink"),zc=Symbol("unsupported"),Hc=Symbol("checkPath"),er=Symbol("mkdir"),re=Symbol("onError"),Pi=Symbol("pending"),Yc=Symbol("pend"),Wt=Symbol("unpend"),to=Symbol("ended"),ro=Symbol("maybeClose"),zo=Symbol("skip"),jr=Symbol("doChown"),Ur=Symbol("uid"),Gr=Symbol("gid"),Li=()=>{throw new Error("sync function called cb somehow?!?")},bv=(t,e)=>{if(process.platform!=="win32")return m.default.unlink(t,e);let r=t+".DELETE."+hd.default.randomBytes(16).toString("hex");m.default.rename(t,r,i=>{if(i)return e(i);m.default.unlink(r,e)})},wv=t=>{if(process.platform!=="win32")return m.default.unlinkSync(t);let e=t+".DELETE."+hd.default.randomBytes(16).toString("hex");m.default.renameSync(t,e),m.default.unlinkSync(e)},Wc=(t,e,r)=>t===t>>>0?t:e===e>>>0?e:r,Wr=class extends gs{constructor(e){if(e||(e={}),e.ondone=r=>{this[to]=!0,this[ro]()},super(e),this.reservations=hv(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[Pi]=0,this[to]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||process.platform==="win32",this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=b.default.resolve(e.cwd||process.cwd()),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",r=>this[qc](r))}warn(e,r,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,r,i)}[ro](){this[to]&&this[Pi]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close"))}[Hc](e){if(this.strip){let r=e.path.split(/\/|\\/);if(r.length<this.strip)return!1;if(e.path=r.slice(this.strip).join("/"),e.type==="Link"){let i=e.linkpath.split(/\/|\\/);i.length>=this.strip&&(e.linkpath=i.slice(this.strip).join("/"))}}if(!this.preservePaths){let r=e.path;if(r.match(/(^|\/|\\)\.\.(\\|\/|$)/))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:r}),!1;if(b.default.win32.isAbsolute(r)){let i=b.default.win32.parse(r);e.path=r.substr(i.root.length);let s=i.root;this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:e,path:r})}}if(this.win32){let r=b.default.win32.parse(e.path);e.path=r.root===""?wo.encode(e.path):r.root+wo.encode(e.path.substr(r.root.length))}return b.default.isAbsolute(e.path)?e.absolute=e.path:e.absolute=b.default.resolve(this.cwd,e.path),!0}[qc](e){if(!this[Hc](e))return e.resume();switch(O.default.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[qo](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[zc](e)}}[re](e,r){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:r}),this[Wt](),r.resume())}[er](e,r,i){ma(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r,noChmod:this.noChmod},i)}[jr](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[Ur](e){return Wc(this.uid,e.uid,this.processUid)}[Gr](e){return Wc(this.gid,e.gid,this.processGid)}[Uo](e,r){let i=e.mode&4095||this.fmode,s=new vt.WriteStream(e.absolute,{flags:Ud(e.size),mode:i,autoClose:!1});s.on("error",l=>this[re](l,e));let n=1,o=l=>{if(l)return this[re](l,e);--n===0&&m.default.close(s.fd,h=>{r(),h?this[re](h,e):this[Wt]()})};s.on("finish",l=>{let h=e.absolute,u=s.fd;if(e.mtime&&!this.noMtime){n++;let c=e.atime||new Date,d=e.mtime;m.default.futimes(u,c,d,f=>f?m.default.utimes(h,c,d,p=>o(p&&f)):o())}if(this[jr](e)){n++;let c=this[Ur](e),d=this[Gr](e);m.default.fchown(u,c,d,f=>f?m.default.chown(h,c,d,p=>o(p&&f)):o())}o()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>this[re](l,e)),e.pipe(a)),a.pipe(s)}[Go](e,r){let i=e.mode&4095||this.dmode;this[er](e.absolute,i,s=>{if(s)return r(),this[re](s,e);let n=1,o=a=>{--n===0&&(r(),this[Wt](),e.resume())};e.mtime&&!this.noMtime&&(n++,m.default.utimes(e.absolute,e.atime||new Date,e.mtime,o)),this[jr](e)&&(n++,m.default.chown(e.absolute,this[Ur](e),this[Gr](e),o)),o()})}[zc](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Uc](e,r){this[Zi](e,e.linkpath,"symlink",r)}[Gc](e,r){this[Zi](e,b.default.resolve(this.cwd,e.linkpath),"link",r)}[Yc](){this[Pi]++}[Wt](){this[Pi]--,this[ro]()}[zo](e){this[Wt](),e.resume()}[jo](e,r){return e.type==="File"&&!this.unlink&&r.isFile()&&r.nlink<=1&&process.platform!=="win32"}[qo](e){this[Yc]();let r=[e.path];e.linkpath&&r.push(e.linkpath),this.reservations.reserve(r,i=>this[jc](e,i))}[jc](e,r){this[er](b.default.dirname(e.absolute),this.dmode,i=>{if(i)return r(),this[re](i,e);m.default.lstat(e.absolute,(s,n)=>{n&&(this.keep||this.newer&&n.mtime>e.mtime)?(this[zo](e),r()):s||this[jo](e,n)?this[Xe](null,e,r):n.isDirectory()?e.type==="Directory"?!this.noChmod&&(!e.mode||(n.mode&4095)===e.mode)?this[Xe](null,e,r):m.default.chmod(e.absolute,e.mode,o=>this[Xe](o,e,r)):m.default.rmdir(e.absolute,o=>this[Xe](o,e,r)):bv(e.absolute,o=>this[Xe](o,e,r))})})}[Xe](e,r,i){if(e)return this[re](e,r);switch(r.type){case"File":case"OldFile":case"ContiguousFile":return this[Uo](r,i);case"Link":return this[Gc](r,i);case"SymbolicLink":return this[Uc](r,i);case"Directory":case"GNUDumpDir":return this[Go](r,i)}}[Zi](e,r,i,s){m.default[i](r,e.absolute,n=>{if(n)return this[re](n,e);s(),this[Wt](),e.resume()})}},Ho=class extends Wr{[qo](e){let r=this[er](b.default.dirname(e.absolute),this.dmode,Li);if(r)return this[re](r,e);try{let i=m.default.lstatSync(e.absolute);if(this.keep||this.newer&&i.mtime>e.mtime)return this[zo](e);if(this[jo](e,i))return this[Xe](null,e,Li);try{return i.isDirectory()?e.type==="Directory"?!this.noChmod&&e.mode&&(i.mode&4095)!==e.mode&&m.default.chmodSync(e.absolute,e.mode):m.default.rmdirSync(e.absolute):wv(e.absolute),this[Xe](null,e,Li)}catch(s){return this[re](s,e)}}catch{return this[Xe](null,e,Li)}}[Uo](e,r){let i=e.mode&4095||this.fmode,s=a=>{let l;try{m.default.closeSync(n)}catch(h){l=h}(a||l)&&this[re](a||l,e)},n;try{n=m.default.openSync(e.absolute,Ud(e.size),i)}catch(a){return s(a)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",a=>this[re](a,e)),e.pipe(o)),o.on("data",a=>{try{m.default.writeSync(n,a,0,a.length)}catch(l){s(l)}}),o.on("end",a=>{let l=null;if(e.mtime&&!this.noMtime){let h=e.atime||new Date,u=e.mtime;try{m.default.futimesSync(n,h,u)}catch(c){try{m.default.utimesSync(e.absolute,h,u)}catch{l=c}}}if(this[jr](e)){let h=this[Ur](e),u=this[Gr](e);try{m.default.fchownSync(n,h,u)}catch(c){try{m.default.chownSync(e.absolute,h,u)}catch{l=l||c}}}s(l)})}[Go](e,r){let i=e.mode&4095||this.dmode,s=this[er](e.absolute,i);if(s)return this[re](s,e);if(e.mtime&&!this.noMtime)try{m.default.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[jr](e))try{m.default.chownSync(e.absolute,this[Ur](e),this[Gr](e))}catch{}e.resume()}[er](e,r){try{return ma.sync(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r})}catch(i){return i}}[Zi](e,r,i,s){try{m.default[i+"Sync"](r,e.absolute),e.resume()}catch(n){return this[re](n,e)}}};Wr.Sync=Ho;var ri=Wr,Sv=(t,e,r)=>{typeof t=="function"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e=="function"&&(r=e,e=null),e?e=Array.from(e):e=[];let i=ei(t);if(i.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return e.length&&Ev(i,e),i.file&&i.sync?_v(i):i.file?Ov(i,r):i.sync?Rv(i):Tv(i)},Ev=(t,e)=>{let r=new Map(e.map(n=>[n.replace(/\/+$/,""),!0])),i=t.filter,s=(n,o)=>{let a=o||b.default.parse(n).root||".",l=n===a?!1:r.has(n)?r.get(n):s(b.default.dirname(n),a);return r.set(n,l),l};t.filter=i?(n,o)=>i(n,o)&&s(n.replace(/\/+$/,"")):n=>s(n.replace(/\/+$/,""))},_v=t=>{let e=new ri.Sync(t),r=t.file,i=m.default.statSync(r),s=t.maxReadSize||16*1024*1024;new vt.ReadStreamSync(r,{readSize:s,size:i.size}).pipe(e)},Ov=(t,e)=>{let r=new ri(t),i=t.maxReadSize||16*1024*1024,s=t.file,n=new Promise((o,a)=>{r.on("error",a),r.on("close",o),m.default.stat(s,(l,h)=>{if(l)a(l);else{let u=new vt.ReadStream(s,{readSize:i,size:h.size});u.on("error",a),u.pipe(r)}})});return e?n.then(e,e):n},Rv=t=>new ri.Sync(t),Tv=t=>new ri(t),Cv=Re(function(t,e){e.c=e.create=O0,e.r=e.replace=Sd,e.t=e.list=ti,e.u=e.update=D0,e.x=e.extract=Sv,e.Pack=Pt,e.Unpack=ri,e.Parse=gs,e.ReadEntry=ha,e.WriteEntry=ps,e.Header=Ft,e.Pax=Yr,e.types=qi}),Vr={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Gd={};for(let t of Object.keys(Vr))Gd[Vr[t]]=t;var E={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},kt=E;for(let t of Object.keys(E)){if(!("channels"in E[t]))throw new Error("missing channels property: "+t);if(!("labels"in E[t]))throw new Error("missing channel labels property: "+t);if(E[t].labels.length!==E[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=E[t];delete E[t].channels,delete E[t].labels,Object.defineProperty(E[t],"channels",{value:e}),Object.defineProperty(E[t],"labels",{value:r})}E.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,s=Math.min(e,r,i),n=Math.max(e,r,i),o=n-s,a,l;n===s?a=0:e===n?a=(r-i)/o:r===n?a=2+(i-e)/o:i===n&&(a=4+(e-r)/o),a=Math.min(a*60,360),a<0&&(a+=360);let h=(s+n)/2;return n===s?l=0:h<=.5?l=o/(n+s):l=o/(2-n-s),[a,l*100,h*100]};E.rgb.hsv=function(t){let e,r,i,s,n,o=t[0]/255,a=t[1]/255,l=t[2]/255,h=Math.max(o,a,l),u=h-Math.min(o,a,l),c=function(d){return(h-d)/6/u+1/2};return u===0?(s=0,n=0):(n=u/h,e=c(o),r=c(a),i=c(l),o===h?s=i-r:a===h?s=1/3+e-i:l===h&&(s=2/3+r-e),s<0?s+=1:s>1&&(s-=1)),[s*360,n*100,h*100]};E.rgb.hwb=function(t){let e=t[0],r=t[1],i=t[2],s=E.rgb.hsl(t)[0],n=1/255*Math.min(e,Math.min(r,i));return i=1-1/255*Math.max(e,Math.max(r,i)),[s,n*100,i*100]};E.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,s=Math.min(1-e,1-r,1-i),n=(1-e-s)/(1-s)||0,o=(1-r-s)/(1-s)||0,a=(1-i-s)/(1-s)||0;return[n*100,o*100,a*100,s*100]};function xv(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}E.rgb.keyword=function(t){let e=Gd[t];if(e)return e;let r=1/0,i;for(let s of Object.keys(Vr)){let n=Vr[s],o=xv(t,n);o<r&&(r=o,i=s)}return i};E.keyword.rgb=function(t){return Vr[t]};E.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;let s=e*.4124+r*.3576+i*.1805,n=e*.2126+r*.7152+i*.0722,o=e*.0193+r*.1192+i*.9505;return[s*100,n*100,o*100]};E.rgb.lab=function(t){let e=E.rgb.xyz(t),r=e[0],i=e[1],s=e[2];r/=95.047,i/=100,s/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let n=116*i-16,o=500*(r-i),a=200*(i-s);return[n,o,a]};E.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100,s,n,o;if(r===0)return o=i*255,[o,o,o];i<.5?s=i*(1+r):s=i+r-i*r;let a=2*i-s,l=[0,0,0];for(let h=0;h<3;h++)n=e+1/3*-(h-1),n<0&&n++,n>1&&n--,6*n<1?o=a+(s-a)*6*n:2*n<1?o=s:3*n<2?o=a+(s-a)*(2/3-n)*6:o=a,l[h]=o*255;return l};E.hsl.hsv=function(t){let e=t[0],r=t[1]/100,i=t[2]/100,s=r,n=Math.max(i,.01);i*=2,r*=i<=1?i:2-i,s*=n<=1?n:2-n;let o=(i+r)/2,a=i===0?2*s/(n+s):2*r/(i+r);return[e,a*100,o*100]};E.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,i=t[2]/100,s=Math.floor(e)%6,n=e-Math.floor(e),o=255*i*(1-r),a=255*i*(1-r*n),l=255*i*(1-r*(1-n));switch(i*=255,s){case 0:return[i,l,o];case 1:return[a,i,o];case 2:return[o,i,l];case 3:return[o,a,i];case 4:return[l,o,i];case 5:return[i,o,a]}};E.hsv.hsl=function(t){let e=t[0],r=t[1]/100,i=t[2]/100,s=Math.max(i,.01),n,o;o=(2-r)*i;let a=(2-r)*s;return n=r*s,n/=a<=1?a:2-a,n=n||0,o/=2,[e,n*100,o*100]};E.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100,s=r+i,n;s>1&&(r/=s,i/=s);let o=Math.floor(6*e),a=1-i;n=6*e-o,o&1&&(n=1-n);let l=r+n*(a-r),h,u,c;switch(o){default:case 6:case 0:h=a,u=l,c=r;break;case 1:h=l,u=a,c=r;break;case 2:h=r,u=a,c=l;break;case 3:h=r,u=l,c=a;break;case 4:h=l,u=r,c=a;break;case 5:h=a,u=r,c=l;break}return[h*255,u*255,c*255]};E.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,i=t[2]/100,s=t[3]/100,n=1-Math.min(1,e*(1-s)+s),o=1-Math.min(1,r*(1-s)+s),a=1-Math.min(1,i*(1-s)+s);return[n*255,o*255,a*255]};E.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,i=t[2]/100,s,n,o;return s=e*3.2406+r*-1.5372+i*-.4986,n=e*-.9689+r*1.8758+i*.0415,o=e*.0557+r*-.204+i*1.057,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=Math.min(Math.max(0,s),1),n=Math.min(Math.max(0,n),1),o=Math.min(Math.max(0,o),1),[s*255,n*255,o*255]};E.xyz.lab=function(t){let e=t[0],r=t[1],i=t[2];e/=95.047,r/=100,i/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let s=116*r-16,n=500*(e-r),o=200*(r-i);return[s,n,o]};E.lab.xyz=function(t){let e=t[0],r=t[1],i=t[2],s,n,o;n=(e+16)/116,s=r/500+n,o=n-i/200;let a=n**3,l=s**3,h=o**3;return n=a>.008856?a:(n-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,o=h>.008856?h:(o-16/116)/7.787,s*=95.047,n*=100,o*=108.883,[s,n,o]};E.lab.lch=function(t){let e=t[0],r=t[1],i=t[2],s;s=Math.atan2(i,r)*360/2/Math.PI,s<0&&(s+=360);let o=Math.sqrt(r*r+i*i);return[e,o,s]};E.lch.lab=function(t){let e=t[0],r=t[1],s=t[2]/360*2*Math.PI,n=r*Math.cos(s),o=r*Math.sin(s);return[e,n,o]};E.rgb.ansi16=function(t,e=null){let[r,i,s]=t,n=e===null?E.rgb.hsv(t)[2]:e;if(n=Math.round(n/50),n===0)return 30;let o=30+(Math.round(s/255)<<2|Math.round(i/255)<<1|Math.round(r/255));return n===2&&(o+=60),o};E.hsv.ansi16=function(t){return E.rgb.ansi16(E.hsv.rgb(t),t[2])};E.rgb.ansi256=function(t){let e=t[0],r=t[1],i=t[2];return e===r&&r===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)};E.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,i=(e&1)*r*255,s=(e>>1&1)*r*255,n=(e>>2&1)*r*255;return[i,s,n]};E.ansi256.rgb=function(t){if(t>=232){let n=(t-232)*10+8;return[n,n,n]}t-=16;let e,r=Math.floor(t/36)/5*255,i=Math.floor((e=t%36)/6)/5*255,s=e%6/5*255;return[r,i,s]};E.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};E.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let i=parseInt(r,16),s=i>>16&255,n=i>>8&255,o=i&255;return[s,n,o]};E.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,s=Math.max(Math.max(e,r),i),n=Math.min(Math.min(e,r),i),o=s-n,a,l;return o<1?a=n/(1-o):a=0,o<=0?l=0:s===e?l=(r-i)/o%6:s===r?l=2+(i-e)/o:l=4+(e-r)/o,l/=6,l%=1,[l*360,o*100,a*100]};E.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,i=r<.5?2*e*r:2*e*(1-r),s=0;return i<1&&(s=(r-.5*i)/(1-i)),[t[0],i*100,s*100]};E.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,i=e*r,s=0;return i<1&&(s=(r-i)/(1-i)),[t[0],i*100,s*100]};E.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100;if(r===0)return[i*255,i*255,i*255];let s=[0,0,0],n=e%1*6,o=n%1,a=1-o,l=0;switch(Math.floor(n)){case 0:s[0]=1,s[1]=o,s[2]=0;break;case 1:s[0]=a,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=o;break;case 3:s[0]=0,s[1]=a,s[2]=1;break;case 4:s[0]=o,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=a}return l=(1-r)*i,[(r*s[0]+l)*255,(r*s[1]+l)*255,(r*s[2]+l)*255]};E.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,i=e+r*(1-e),s=0;return i>0&&(s=e/i),[t[0],s*100,i*100]};E.hcg.hsl=function(t){let e=t[1]/100,i=t[2]/100*(1-e)+.5*e,s=0;return i>0&&i<.5?s=e/(2*i):i>=.5&&i<1&&(s=e/(2*(1-i))),[t[0],s*100,i*100]};E.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,i=e+r*(1-e);return[t[0],(i-e)*100,(1-i)*100]};E.hwb.hcg=function(t){let e=t[1]/100,i=1-t[2]/100,s=i-e,n=0;return s<1&&(n=(i-s)/(1-s)),[t[0],s*100,n*100]};E.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};E.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};E.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};E.gray.hsl=function(t){return[0,0,t[0]]};E.gray.hsv=E.gray.hsl;E.gray.hwb=function(t){return[0,100,t[0]]};E.gray.cmyk=function(t){return[0,0,0,t[0]]};E.gray.lab=function(t){return[t[0],0,0]};E.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(i.length)+i};E.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};function Av(){let t={},e=Object.keys(kt);for(let r=e.length,i=0;i<r;i++)t[e[i]]={distance:-1,parent:null};return t}function Iv(t){let e=Av(),r=[t];for(e[t].distance=0;r.length;){let i=r.pop(),s=Object.keys(kt[i]);for(let n=s.length,o=0;o<n;o++){let a=s[o],l=e[a];l.distance===-1&&(l.distance=e[i].distance+1,l.parent=i,r.unshift(a))}}return e}function Mv(t,e){return function(r){return e(t(r))}}function kv(t,e){let r=[e[t].parent,t],i=kt[e[t].parent][t],s=e[t].parent;for(;e[s].parent;)r.unshift(e[s].parent),i=Mv(kt[e[s].parent][s],i),s=e[s].parent;return i.conversion=r,i}var Dv=function(t){let e=Iv(t),r={},i=Object.keys(e);for(let s=i.length,n=0;n<s;n++){let o=i[n];e[o].parent!==null&&(r[o]=kv(o,e))}return r},Kt={},Nv=Object.keys(kt);function Fv(t){let e=function(...r){let i=r[0];return i==null?i:(i.length>1&&(r=i),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function Pv(t){let e=function(...r){let i=r[0];if(i==null)return i;i.length>1&&(r=i);let s=t(r);if(typeof s=="object")for(let n=s.length,o=0;o<n;o++)s[o]=Math.round(s[o]);return s};return"conversion"in t&&(e.conversion=t.conversion),e}Nv.forEach(t=>{Kt[t]={},Object.defineProperty(Kt[t],"channels",{value:kt[t].channels}),Object.defineProperty(Kt[t],"labels",{value:kt[t].labels});let e=Dv(t);Object.keys(e).forEach(i=>{let s=e[i];Kt[t][i]=Pv(s),Kt[t][i].raw=Fv(s)})});var Lv=Kt,Zr=Re(function(t){let e=(u,c)=>(...d)=>`\x1B[${u(...d)+c}m`,r=(u,c)=>(...d)=>{let f=u(...d);return`\x1B[${38+c};5;${f}m`},i=(u,c)=>(...d)=>{let f=u(...d);return`\x1B[${38+c};2;${f[0]};${f[1]};${f[2]}m`},s=u=>u,n=(u,c,d)=>[u,c,d],o=(u,c,d)=>{Object.defineProperty(u,c,{get:()=>{let f=d();return Object.defineProperty(u,c,{value:f,enumerable:!0,configurable:!0}),f},enumerable:!0,configurable:!0})},a,l=(u,c,d,f)=>{a===void 0&&(a=Lv);let p=f?10:0,g={};for(let[y,w]of Object.entries(a)){let _=y==="ansi16"?"ansi":y;y===c?g[_]=u(d,p):typeof w=="object"&&(g[_]=u(w[c],p))}return g};function h(){let u=new Map,c={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};c.color.gray=c.color.blackBright,c.bgColor.bgGray=c.bgColor.bgBlackBright,c.color.grey=c.color.blackBright,c.bgColor.bgGrey=c.bgColor.bgBlackBright;for(let[d,f]of Object.entries(c)){for(let[p,g]of Object.entries(f))c[p]={open:`\x1B[${g[0]}m`,close:`\x1B[${g[1]}m`},f[p]=c[p],u.set(g[0],g[1]);Object.defineProperty(c,d,{value:f,enumerable:!1})}return Object.defineProperty(c,"codes",{value:u,enumerable:!1}),c.color.close="\x1B[39m",c.bgColor.close="\x1B[49m",o(c.color,"ansi",()=>l(e,"ansi16",s,!1)),o(c.color,"ansi256",()=>l(r,"ansi256",s,!1)),o(c.color,"ansi16m",()=>l(i,"rgb",n,!1)),o(c.bgColor,"ansi",()=>l(e,"ansi16",s,!0)),o(c.bgColor,"ansi256",()=>l(r,"ansi256",s,!0)),o(c.bgColor,"ansi16m",()=>l(i,"rgb",n,!0)),c}Object.defineProperty(t,"exports",{enumerable:!0,get:h})}),pe=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),s=e.indexOf("--");return i!==-1&&(s===-1||i<s)},{env:Z}=process,pt;pe("no-color")||pe("no-colors")||pe("color=false")||pe("color=never")?pt=0:(pe("color")||pe("colors")||pe("color=true")||pe("color=always"))&&(pt=1);"FORCE_COLOR"in Z&&(Z.FORCE_COLOR==="true"?pt=1:Z.FORCE_COLOR==="false"?pt=0:pt=Z.FORCE_COLOR.length===0?1:Math.min(parseInt(Z.FORCE_COLOR,10),3));function Yo(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Wo(t,e){if(pt===0)return 0;if(pe("color=16m")||pe("color=full")||pe("color=truecolor"))return 3;if(pe("color=256"))return 2;if(t&&!e&&pt===void 0)return 0;let r=pt||0;if(Z.TERM==="dumb")return r;if(process.platform==="win32"){let i=yo.default.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in Z)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in Z)||Z.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in Z)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Z.TEAMCITY_VERSION)?1:0;if(Z.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Z){let i=parseInt((Z.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Z.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Z.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Z.TERM)||"COLORTERM"in Z?1:r}function $v(t){let e=Wo(t,t&&t.isTTY);return Yo(e)}var zd={supportsColor:$v,stdout:Yo(Wo(!0,vo.default.isatty(1))),stderr:Yo(Wo(!0,vo.default.isatty(2)))},Bv=(t,e,r)=>{let i=t.indexOf(e);if(i===-1)return t;let s=e.length,n=0,o="";do o+=t.substr(n,i-n)+e+r,n=i+s,i=t.indexOf(e,n);while(i!==-1);return o+=t.substr(n),o},qv=(t,e,r,i)=>{let s=0,n="";do{let o=t[i-1]==="\r";n+=t.substr(s,(o?i-1:i)-s)+e+(o?`\r
`:`
`)+r,s=i+1,i=t.indexOf(`
`,s)}while(i!==-1);return n+=t.substr(s),n},jv={stringReplaceAll:Bv,stringEncaseCRLFWithFirstIndex:qv},Uv=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Vc=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Gv=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,zv=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,Hv=new Map([["n",`
`],["r","\r"],["t","	"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Hd(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):Hv.get(t)||t}function Yv(t,e){let r=[],i=e.trim().split(/\s*,\s*/g),s;for(let n of i){let o=Number(n);if(!Number.isNaN(o))r.push(o);else if(s=n.match(Gv))r.push(s[2].replace(zv,(a,l,h)=>l?Hd(l):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${t}')`)}return r}function Wv(t){Vc.lastIndex=0;let e=[],r;for(;(r=Vc.exec(t))!==null;){let i=r[1];if(r[2]){let s=Yv(i,r[2]);e.push([i].concat(s))}else e.push([i])}return e}function Zc(t,e){let r={};for(let s of e)for(let n of s.styles)r[n[0]]=s.inverse?null:n.slice(1);let i=t;for(let[s,n]of Object.entries(r))if(Array.isArray(n)){if(!(s in i))throw new Error(`Unknown Chalk style: ${s}`);i=n.length>0?i[s](...n):i[s]}return i}var Vv=(t,e)=>{let r=[],i=[],s=[];if(e.replace(Uv,(n,o,a,l,h,u)=>{if(o)s.push(Hd(o));else if(l){let c=s.join("");s=[],i.push(r.length===0?c:Zc(t,r)(c)),r.push({inverse:a,styles:Wv(l)})}else if(h){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(Zc(t,r)(s.join(""))),s=[],r.pop()}else s.push(u)}),i.push(s.join("")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(n)}return i.join("")},{stdout:Vo,stderr:Zo}=zd,{stringReplaceAll:Zv,stringEncaseCRLFWithFirstIndex:Kv}=jv,{isArray:ls}=Array,Yd=["ansi","ansi","ansi256","ansi16m"],mr=Object.create(null),Xv=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Vo?Vo.level:0;t.level=e.level===void 0?r:e.level},Ko=class{constructor(e){return Wd(e)}},Wd=t=>{let e={};return Xv(e,t),e.template=(...r)=>Zd(e.template,...r),Object.setPrototypeOf(e,ys.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=Ko,e.template};function ys(t){return Wd(t)}for(let[t,e]of Object.entries(Zr))mr[t]={get(){let r=vs(this,pa(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};mr.visible={get(){let t=vs(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var Vd=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of Vd)mr[t]={get(){let{level:e}=this;return function(...r){let i=pa(Zr.color[Yd[e]][t](...r),Zr.color.close,this._styler);return vs(this,i,this._isEmpty)}}};for(let t of Vd){let e="bg"+t[0].toUpperCase()+t.slice(1);mr[e]={get(){let{level:r}=this;return function(...i){let s=pa(Zr.bgColor[Yd[r]][t](...i),Zr.bgColor.close,this._styler);return vs(this,s,this._isEmpty)}}}}var Jv=Object.defineProperties(()=>{},{...mr,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),pa=(t,e,r)=>{let i,s;return r===void 0?(i=t,s=e):(i=r.openAll+t,s=e+r.closeAll),{open:t,close:e,openAll:i,closeAll:s,parent:r}},vs=(t,e,r)=>{let i=(...s)=>ls(s[0])&&ls(s[0].raw)?Kc(i,Zd(i,...s)):Kc(i,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(i,Jv),i._generator=t,i._styler=e,i._isEmpty=r,i},Kc=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:i,closeAll:s}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=Zv(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
`);return n!==-1&&(e=Kv(e,s,i,n)),i+e+s},io,Zd=(t,...e)=>{let[r]=e;if(!ls(r)||!ls(r.raw))return e.join(" ");let i=e.slice(1),s=[r.raw[0]];for(let n=1;n<r.length;n++)s.push(String(i[n-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[n]));return io===void 0&&(io=Vv),io(t,s.join(""))};Object.defineProperties(ys.prototype,mr);var bs=ys();bs.supportsColor=Vo;bs.stderr=ys({level:Zo?Zo.level:0});bs.stderr.supportsColor=Zo;var Ke=bs,Lt=Qv(m.default);function Qv(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:t.__proto__};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var eb=process.cwd,Ki=null,tb=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ki||(Ki=eb.call(process)),Ki};try{process.cwd()}catch{}var rb=process.chdir;process.chdir=function(t){Ki=null,rb.call(process,t)};var ib=sb;function sb(t){dt.default.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&nb(t),t.lutimes||ob(t),t.chown=oo(t.chown),t.fchown=oo(t.fchown),t.lchown=oo(t.lchown),t.chmod=so(t.chmod),t.fchmod=so(t.fchmod),t.lchmod=so(t.lchmod),t.chownSync=ao(t.chownSync),t.fchownSync=ao(t.fchownSync),t.lchownSync=ao(t.lchownSync),t.chmodSync=no(t.chmodSync),t.fchmodSync=no(t.fchmodSync),t.lchmodSync=no(t.lchmodSync),t.stat=lo(t.stat),t.fstat=lo(t.fstat),t.lstat=lo(t.lstat),t.statSync=ho(t.statSync),t.fstatSync=ho(t.fstatSync),t.lstatSync=ho(t.lstatSync),t.lchmod||(t.lchmod=function(e,r,i){i&&process.nextTick(i)},t.lchmodSync=function(){}),t.lchown||(t.lchown=function(e,r,i,s){s&&process.nextTick(s)},t.lchownSync=function(){}),tb==="win32"&&(t.rename=function(e){return function(r,i,s){var n=Date.now(),o=0;e(r,i,function a(l){if(l&&(l.code==="EACCES"||l.code==="EPERM")&&Date.now()-n<6e4){setTimeout(function(){t.stat(i,function(h,u){h&&h.code==="ENOENT"?e(r,i,a):s(l)})},o),o<100&&(o+=10);return}s&&s(l)})}}(t.rename)),t.read=function(e){return function(r,i,s,n,o,a){var l;if(a&&typeof a=="function"){var h=0;l=function(u,c,d){if(u&&u.code==="EAGAIN"&&h<10)return h++,e.call(t,r,i,s,n,o,l);a.apply(this,arguments)}}return e.call(t,r,i,s,n,o,l)}}(t.read),t.readSync=function(e){return function(r,i,s,n,o){for(var a=0;;)try{return e.call(t,r,i,s,n,o)}catch(l){if(l.code==="EAGAIN"&&a<10){a++;continue}throw l}}}(t.readSync)}function nb(t){t.lchmod=function(e,r,i){t.open(e,dt.default.O_WRONLY|dt.default.O_SYMLINK,r,function(s,n){if(s){i&&i(s);return}t.fchmod(n,r,function(o){t.close(n,function(a){i&&i(o||a)})})})},t.lchmodSync=function(e,r){var i=t.openSync(e,dt.default.O_WRONLY|dt.default.O_SYMLINK,r),s=!0,n;try{n=t.fchmodSync(i,r),s=!1}finally{if(s)try{t.closeSync(i)}catch{}else t.closeSync(i)}return n}}function ob(t){dt.default.hasOwnProperty("O_SYMLINK")?(t.lutimes=function(e,r,i,s){t.open(e,dt.default.O_SYMLINK,function(n,o){if(n){s&&s(n);return}t.futimes(o,r,i,function(a){t.close(o,function(l){s&&s(a||l)})})})},t.lutimesSync=function(e,r,i){var s=t.openSync(e,dt.default.O_SYMLINK),n,o=!0;try{n=t.futimesSync(s,r,i),o=!1}finally{if(o)try{t.closeSync(s)}catch{}else t.closeSync(s)}return n}):(t.lutimes=function(e,r,i,s){s&&process.nextTick(s)},t.lutimesSync=function(){})}function so(t){return t&&function(e,r,i){return t.call(Lt,e,r,function(s){ws(s)&&(s=null),i&&i.apply(this,arguments)})}}function no(t){return t&&function(e,r){try{return t.call(Lt,e,r)}catch(i){if(!ws(i))throw i}}}function oo(t){return t&&function(e,r,i,s){return t.call(Lt,e,r,i,function(n){ws(n)&&(n=null),s&&s.apply(this,arguments)})}}function ao(t){return t&&function(e,r,i){try{return t.call(Lt,e,r,i)}catch(s){if(!ws(s))throw s}}}function lo(t){return t&&function(e,r){return t.call(Lt,e,function(i,s){if(!s)return r.apply(this,arguments);s.uid<0&&(s.uid+=4294967296),s.gid<0&&(s.gid+=4294967296),r&&r.apply(this,arguments)})}}function ho(t){return t&&function(e){var r=t.call(Lt,e);return r.uid<0&&(r.uid+=4294967296),r.gid<0&&(r.gid+=4294967296),r}}function ws(t){if(!t||t.code==="ENOSYS")return!0;var e=!process.getuid||process.getuid()!==0;return!!(e&&(t.code==="EINVAL"||t.code==="EPERM"))}var Xc=po.default.Stream,ab=lb;function lb(t){return{ReadStream:e,WriteStream:r};function e(i,s){if(!(this instanceof e))return new e(i,s);Xc.call(this);var n=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var o=Object.keys(s),a=0,l=o.length;a<l;a++){var h=o[a];this[h]=s[h]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){n._read()});return}t.open(this.path,this.flags,this.mode,function(u,c){if(u){n.emit("error",u),n.readable=!1;return}n.fd=c,n.emit("open",c),n._read()})}function r(i,s){if(!(this instanceof r))return new r(i,s);Xc.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var n=Object.keys(s),o=0,a=n.length;o<a;o++){var l=n[o];this[l]=s[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}var ge=Re(function(t){var e=[];function r(){}var i=r;Le.default.debuglog?i=Le.default.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(i=function(){var a=Le.default.format.apply(Le.default,arguments);a="GFS4: "+a.split(/\n/).join(`
GFS4: `),console.error(a)}),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){i(e),O.default.equal(e.length,0)}),t.exports=s(Lt),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&(t.exports=s(m.default)),t.exports.close=m.default.close=function(a){return function(l,h){return a.call(m.default,l,function(u){u||o(),typeof h=="function"&&h.apply(this,arguments)})}}(m.default.close),t.exports.closeSync=m.default.closeSync=function(a){return function(l){var h=a.apply(m.default,arguments);return o(),h}}(m.default.closeSync);function s(a){ib(a),a.gracefulify=s,a.FileReadStream=C,a.FileWriteStream=W,a.createReadStream=be,a.createWriteStream=le;var l=a.readFile;a.readFile=h;function h(T,x,R){return typeof x=="function"&&(R=x,x=null),v(T,x,R);function v(A,M,L){return l(A,M,function(H){H&&(H.code==="EMFILE"||H.code==="ENFILE")?n([v,[A,M,L]]):(typeof L=="function"&&L.apply(this,arguments),o())})}}var u=a.writeFile;a.writeFile=c;function c(T,x,R,v){return typeof R=="function"&&(v=R,R=null),A(T,x,R,v);function A(M,L,H,J){return u(M,L,H,function(q){q&&(q.code==="EMFILE"||q.code==="ENFILE")?n([A,[M,L,H,J]]):(typeof J=="function"&&J.apply(this,arguments),o())})}}var d=a.appendFile;d&&(a.appendFile=f);function f(T,x,R,v){return typeof R=="function"&&(v=R,R=null),A(T,x,R,v);function A(M,L,H,J){return d(M,L,H,function(q){q&&(q.code==="EMFILE"||q.code==="ENFILE")?n([A,[M,L,H,J]]):(typeof J=="function"&&J.apply(this,arguments),o())})}}var p=a.readdir;a.readdir=g;function g(T,x,R){var v=[T];return typeof x!="function"?v.push(x):R=x,v.push(A),y(v);function A(M,L){L&&L.sort&&L.sort(),M&&(M.code==="EMFILE"||M.code==="ENFILE")?n([y,[v]]):(typeof R=="function"&&R.apply(this,arguments),o())}}function y(T){return p.apply(a,T)}if(process.version.substr(0,4)==="v0.8"){var w=ab(a);C=w.ReadStream,W=w.WriteStream}var _=a.ReadStream;C.prototype=Object.create(_.prototype),C.prototype.open=Y;var N=a.WriteStream;W.prototype=Object.create(N.prototype),W.prototype.open=ce,a.ReadStream=C,a.WriteStream=W;function C(T,x){return this instanceof C?(_.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function Y(){var T=this;Te(T.path,T.flags,T.mode,function(x,R){x?(T.autoClose&&T.destroy(),T.emit("error",x)):(T.fd=R,T.emit("open",R),T.read())})}function W(T,x){return this instanceof W?(N.apply(this,arguments),this):W.apply(Object.create(W.prototype),arguments)}function ce(){var T=this;Te(T.path,T.flags,T.mode,function(x,R){x?(T.destroy(),T.emit("error",x)):(T.fd=R,T.emit("open",R))})}function be(T,x){return new C(T,x)}function le(T,x){return new W(T,x)}var tt=a.open;a.open=Te;function Te(T,x,R,v){return typeof R=="function"&&(v=R,R=null),A(T,x,R,v);function A(M,L,H,J){return tt(M,L,H,function(q,$e){q&&(q.code==="EMFILE"||q.code==="ENFILE")?n([A,[M,L,H,J]]):(typeof J=="function"&&J.apply(this,arguments),o())})}}return a}function n(a){i("ENQUEUE",a[0].name,a[1]),e.push(a)}function o(){var a=e.shift();a&&(i("RETRY",a[0].name,a[1]),a[0].apply(null,a[1]))}}),Kd=parseInt("0777",8),hb=tr.mkdirp=tr.mkdirP=tr;function tr(t,e,r,i){typeof e=="function"?(r=e,e={}):(!e||typeof e!="object")&&(e={mode:e});var s=e.mode,n=e.fs||m.default;s===void 0&&(s=Kd&~process.umask()),i||(i=null);var o=r||function(){};t=b.default.resolve(t),n.mkdir(t,s,function(a){if(!a)return i=i||t,o(null,i);switch(a.code){case"ENOENT":tr(b.default.dirname(t),e,function(l,h){l?o(l,h):tr(t,e,o,h)});break;default:n.stat(t,function(l,h){l||!h.isDirectory()?o(a,i):o(null,i)});break}})}tr.sync=function t(e,r,i){(!r||typeof r!="object")&&(r={mode:r});var s=r.mode,n=r.fs||m.default;s===void 0&&(s=Kd&~process.umask()),i||(i=null),e=b.default.resolve(e);try{n.mkdirSync(e,s),i=i||e}catch(a){switch(a.code){case"ENOENT":i=t(b.default.dirname(e),r,i),t(e,r,i);break;default:var o;try{o=n.statSync(e)}catch{throw a}if(!o.isDirectory())throw a;break}}return i};var gt=process.platform==="win32",ub=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function cb(){var t;if(ub){var e=new Error;t=r}else t=i;return t;function r(s){s&&(e.message=s.message,s=e,i(s))}function i(s){if(s){if(process.throwDeprecation)throw s;if(!process.noDeprecation){var n="fs: missing callback "+(s.stack||s.message);process.traceDeprecation?console.trace(n):console.error(n)}}}}function db(t){return typeof t=="function"?t:cb()}b.default.normalize;gt?Qe=/(.*?)(?:[\/\\]+|$)/g:Qe=/(.*?)(?:[\/]+|$)/g;var Qe;gt?ii=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/:ii=/^[\/]*/;var ii,fb=function(e,r){if(e=b.default.resolve(e),r&&Object.prototype.hasOwnProperty.call(r,e))return r[e];var i=e,s={},n={},o,a,l,h;u();function u(){var y=ii.exec(e);o=y[0].length,a=y[0],l=y[0],h="",gt&&!n[l]&&(m.default.lstatSync(l),n[l]=!0)}for(;o<e.length;){Qe.lastIndex=o;var c=Qe.exec(e);if(h=a,a+=c[0],l=h+c[1],o=Qe.lastIndex,!(n[l]||r&&r[l]===l)){var d;if(r&&Object.prototype.hasOwnProperty.call(r,l))d=r[l];else{var f=m.default.lstatSync(l);if(!f.isSymbolicLink()){n[l]=!0,r&&(r[l]=l);continue}var p=null;if(!gt){var g=f.dev.toString(32)+":"+f.ino.toString(32);s.hasOwnProperty(g)&&(p=s[g])}p===null&&(m.default.statSync(l),p=m.default.readlinkSync(l)),d=b.default.resolve(h,p),r&&(r[l]=d),gt||(s[g]=p)}e=b.default.resolve(d,e.slice(o)),u()}}return r&&(r[i]=e),e},mb=function(e,r,i){if(typeof i!="function"&&(i=db(r),r=null),e=b.default.resolve(e),r&&Object.prototype.hasOwnProperty.call(r,e))return process.nextTick(i.bind(null,null,r[e]));var s=e,n={},o={},a,l,h,u;c();function c(){var y=ii.exec(e);a=y[0].length,l=y[0],h=y[0],u="",gt&&!o[h]?m.default.lstat(h,function(w){if(w)return i(w);o[h]=!0,d()}):process.nextTick(d)}function d(){if(a>=e.length)return r&&(r[s]=e),i(null,e);Qe.lastIndex=a;var y=Qe.exec(e);return u=l,l+=y[0],h=u+y[1],a=Qe.lastIndex,o[h]||r&&r[h]===h?process.nextTick(d):r&&Object.prototype.hasOwnProperty.call(r,h)?g(r[h]):m.default.lstat(h,f)}function f(y,w){if(y)return i(y);if(!w.isSymbolicLink())return o[h]=!0,r&&(r[h]=h),process.nextTick(d);if(!gt){var _=w.dev.toString(32)+":"+w.ino.toString(32);if(n.hasOwnProperty(_))return p(null,n[_],h)}m.default.stat(h,function(N){if(N)return i(N);m.default.readlink(h,function(C,Y){gt||(n[_]=Y),p(C,Y)})})}function p(y,w,_){if(y)return i(y);var N=b.default.resolve(u,w);r&&(r[_]=N),g(N)}function g(y){e=b.default.resolve(y,e.slice(a)),c()}},Xd={realpathSync:fb,realpath:mb},Jd=yt;yt.realpath=yt;yt.sync=ga;yt.realpathSync=ga;yt.monkeypatch=gb;yt.unmonkeypatch=yb;var Xo=m.default.realpath,Jo=m.default.realpathSync,pb=process.version,Qd=/^v[0-5]\./.test(pb);function ef(t){return t&&t.syscall==="realpath"&&(t.code==="ELOOP"||t.code==="ENOMEM"||t.code==="ENAMETOOLONG")}function yt(t,e,r){if(Qd)return Xo(t,e,r);typeof e=="function"&&(r=e,e=null),Xo(t,e,function(i,s){ef(i)?Xd.realpath(t,e,r):r(i,s)})}function ga(t,e){if(Qd)return Jo(t,e);try{return Jo(t,e)}catch(r){if(ef(r))return Xd.realpathSync(t,e);throw r}}function gb(){m.default.realpath=yt,m.default.realpathSync=ga}function yb(){m.default.realpath=Xo,m.default.realpathSync=Jo}var vb=function(t,e){for(var r=[],i=0;i<t.length;i++){var s=e(t[i],i);bb(s)?r.push.apply(r,s):r.push(s)}return r},bb=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"},tf=rf;function rf(t,e,r){t instanceof RegExp&&(t=Jc(t,r)),e instanceof RegExp&&(e=Jc(e,r));var i=sf(t,e,r);return i&&{start:i[0],end:i[1],pre:r.slice(0,i[0]),body:r.slice(i[0]+t.length,i[1]),post:r.slice(i[1]+e.length)}}function Jc(t,e){var r=e.match(t);return r?r[0]:null}rf.range=sf;function sf(t,e,r){var i,s,n,o,a,l=r.indexOf(t),h=r.indexOf(e,l+1),u=l;if(l>=0&&h>0){for(i=[],n=r.length;u>=0&&!a;)u==l?(i.push(u),l=r.indexOf(t,u+1)):i.length==1?a=[i.pop(),h]:(s=i.pop(),s<n&&(n=s,o=h),h=r.indexOf(e,u+1)),u=l<h&&l>=0?l:h;i.length&&(a=[n,o])}return a}var wb=_b,nf="\0SLASH"+Math.random()+"\0",of="\0OPEN"+Math.random()+"\0",ya="\0CLOSE"+Math.random()+"\0",af="\0COMMA"+Math.random()+"\0",lf="\0PERIOD"+Math.random()+"\0";function uo(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function Sb(t){return t.split("\\\\").join(nf).split("\\{").join(of).split("\\}").join(ya).split("\\,").join(af).split("\\.").join(lf)}function Eb(t){return t.split(nf).join("\\").split(of).join("{").split(ya).join("}").split(af).join(",").split(lf).join(".")}function hf(t){if(!t)return[""];var e=[],r=tf("{","}",t);if(!r)return t.split(",");var i=r.pre,s=r.body,n=r.post,o=i.split(",");o[o.length-1]+="{"+s+"}";var a=hf(n);return n.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function _b(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),Xt(Sb(t),!0).map(Eb)):[]}function Ob(t){return"{"+t+"}"}function Rb(t){return/^-?0\d/.test(t)}function Tb(t,e){return t<=e}function Cb(t,e){return t>=e}function Xt(t,e){var r=[],i=tf("{","}",t);if(!i||/\$$/.test(i.pre))return[t];var s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),n=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),o=s||n,a=i.body.indexOf(",")>=0;if(!o&&!a)return i.post.match(/,.*\}/)?(t=i.pre+"{"+i.body+ya+i.post,Xt(t)):[t];var l;if(o)l=i.body.split(/\.\./);else if(l=hf(i.body),l.length===1&&(l=Xt(l[0],!1).map(Ob),l.length===1)){var u=i.post.length?Xt(i.post,!1):[""];return u.map(function(Te){return i.pre+l[0]+Te})}var h=i.pre,u=i.post.length?Xt(i.post,!1):[""],c;if(o){var d=uo(l[0]),f=uo(l[1]),p=Math.max(l[0].length,l[1].length),g=l.length==3?Math.abs(uo(l[2])):1,y=Tb,w=f<d;w&&(g*=-1,y=Cb);var _=l.some(Rb);c=[];for(var N=d;y(N,f);N+=g){var C;if(n)C=String.fromCharCode(N),C==="\\"&&(C="");else if(C=String(N),_){var Y=p-C.length;if(Y>0){var W=new Array(Y+1).join("0");N<0?C="-"+W+C.slice(1):C=W+C}}c.push(C)}}else c=vb(l,function(tt){return Xt(tt,!1)});for(var ce=0;ce<c.length;ce++)for(var be=0;be<u.length;be++){var le=h+c[ce]+u[be];(!e||o||le)&&r.push(le)}return r}var va=ye;ye.Minimatch=K;var Kr={sep:"/"};try{Kr=b.default}catch{}var ba=ye.GLOBSTAR=K.GLOBSTAR={},Qc={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},Qo="[^/]",ea=Qo+"*?",xb="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Ab="(?:(?!(?:\\/|^)\\.).)*?",ed=Ib("().*{}+?[]^$\\!");function Ib(t){return t.split("").reduce(function(e,r){return e[r]=!0,e},{})}var uf=/\/+/;ye.filter=Mb;function Mb(t,e){return e=e||{},function(r,i,s){return ye(r,t,e)}}function td(t,e){t=t||{},e=e||{};var r={};return Object.keys(e).forEach(function(i){r[i]=e[i]}),Object.keys(t).forEach(function(i){r[i]=t[i]}),r}ye.defaults=function(t){if(!t||!Object.keys(t).length)return ye;var e=ye,r=function(s,n,o){return e.minimatch(s,n,td(t,o))};return r.Minimatch=function(s,n){return new e.Minimatch(s,td(t,n))},r};K.defaults=function(t){return!t||!Object.keys(t).length?K:ye.defaults(t).Minimatch};function ye(t,e,r){if(typeof e!="string")throw new TypeError("glob pattern string required");return r||(r={}),!r.nocomment&&e.charAt(0)==="#"?!1:e.trim()===""?t==="":new K(e,r).match(t)}function K(t,e){if(!(this instanceof K))return new K(t,e);if(typeof t!="string")throw new TypeError("glob pattern string required");e||(e={}),t=t.trim(),Kr.sep!=="/"&&(t=t.split(Kr.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}K.prototype.debug=function(){};K.prototype.make=kb;function kb(){if(!this._made){var t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate();var r=this.globSet=this.braceExpand();e.debug&&(this.debug=console.error),this.debug(this.pattern,r),r=this.globParts=r.map(function(i){return i.split(uf)}),this.debug(this.pattern,r),r=r.map(function(i,s,n){return i.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(i){return i.indexOf(!1)===-1}),this.debug(this.pattern,r),this.set=r}}K.prototype.parseNegate=Db;function Db(){var t=this.pattern,e=!1,r=this.options,i=0;if(!r.nonegate){for(var s=0,n=t.length;s<n&&t.charAt(s)==="!";s++)e=!e,i++;i&&(this.pattern=t.substr(i)),this.negate=e}}ye.braceExpand=function(t,e){return cf(t,e)};K.prototype.braceExpand=cf;function cf(t,e){if(e||(this instanceof K?e=this.options:e={}),t=typeof t>"u"?this.pattern:t,typeof t>"u")throw new TypeError("undefined pattern");return e.nobrace||!t.match(/\{.*\}/)?[t]:wb(t)}K.prototype.parse=Nb;var $i={};function Nb(t,e){if(t.length>1024*64)throw new TypeError("pattern is too long");var r=this.options;if(!r.noglobstar&&t==="**")return ba;if(t==="")return"";var i="",s=!!r.nocase,n=!1,o=[],a=[],l,h=!1,u=-1,c=-1,d=t.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",f=this;function p(){if(l){switch(l){case"*":i+=ea,s=!0;break;case"?":i+=Qo,s=!0;break;default:i+="\\"+l;break}f.debug("clearStateChar %j %j",l,i),l=!1}}for(var g=0,y=t.length,w;g<y&&(w=t.charAt(g));g++){if(this.debug("%s	%s %s %j",t,g,i,w),n&&ed[w]){i+="\\"+w,n=!1;continue}switch(w){case"/":return!1;case"\\":p(),n=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s	%s %s %j <-- stateChar",t,g,i,w),h){this.debug("  in class"),w==="!"&&g===c+1&&(w="^"),i+=w;continue}f.debug("call clearStateChar %j",l),p(),l=w,r.noext&&p();continue;case"(":if(h){i+="(";continue}if(!l){i+="\\(";continue}o.push({type:l,start:g-1,reStart:i.length,open:Qc[l].open,close:Qc[l].close}),i+=l==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",l,i),l=!1;continue;case")":if(h||!o.length){i+="\\)";continue}p(),s=!0;var _=o.pop();i+=_.close,_.type==="!"&&a.push(_),_.reEnd=i.length;continue;case"|":if(h||!o.length||n){i+="\\|",n=!1;continue}p(),i+="|";continue;case"[":if(p(),h){i+="\\"+w;continue}h=!0,c=g,u=i.length,i+=w;continue;case"]":if(g===c+1||!h){i+="\\"+w,n=!1;continue}if(h){var N=t.substring(c+1,g);try{RegExp("["+N+"]")}catch{var C=this.parse(N,$i);i=i.substr(0,u)+"\\["+C[0]+"\\]",s=s||C[1],h=!1;continue}}s=!0,h=!1,i+=w;continue;default:p(),n?n=!1:ed[w]&&!(w==="^"&&h)&&(i+="\\"),i+=w}}for(h&&(N=t.substr(c+1),C=this.parse(N,$i),i=i.substr(0,u)+"\\["+C[0],s=s||C[1]),_=o.pop();_;_=o.pop()){var Y=i.slice(_.reStart+_.open.length);this.debug("setting tail",i,_),Y=Y.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(J,q,$e){return $e||($e="\\"),q+q+$e+"|"}),this.debug(`tail=%j
   %s`,Y,Y,_,i);var W=_.type==="*"?ea:_.type==="?"?Qo:"\\"+_.type;s=!0,i=i.slice(0,_.reStart)+W+"\\("+Y}p(),n&&(i+="\\\\");var ce=!1;switch(i.charAt(0)){case".":case"[":case"(":ce=!0}for(var be=a.length-1;be>-1;be--){var le=a[be],tt=i.slice(0,le.reStart),Te=i.slice(le.reStart,le.reEnd-8),T=i.slice(le.reEnd-8,le.reEnd),x=i.slice(le.reEnd);T+=x;var R=tt.split("(").length-1,v=x;for(g=0;g<R;g++)v=v.replace(/\)[+*?]?/,"");x=v;var A="";x===""&&e!==$i&&(A="$");var M=tt+Te+x+A+T;i=M}if(i!==""&&s&&(i="(?=.)"+i),ce&&(i=d+i),e===$i)return[i,s];if(!s)return Lb(t);var L=r.nocase?"i":"";try{var H=new RegExp("^"+i+"$",L)}catch{return new RegExp("$.")}return H._glob=t,H._src=i,H}ye.makeRe=function(t,e){return new K(t,e||{}).makeRe()};K.prototype.makeRe=Fb;function Fb(){if(this.regexp||this.regexp===!1)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,r=e.noglobstar?ea:e.dot?xb:Ab,i=e.nocase?"i":"",s=t.map(function(n){return n.map(function(o){return o===ba?r:typeof o=="string"?$b(o):o._src}).join("\\/")}).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,i)}catch{this.regexp=!1}return this.regexp}ye.match=function(t,e,r){r=r||{};var i=new K(e,r);return t=t.filter(function(s){return i.match(s)}),i.options.nonull&&!t.length&&t.push(e),t};K.prototype.match=Pb;function Pb(t,e){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;var r=this.options;Kr.sep!=="/"&&(t=t.split(Kr.sep).join("/")),t=t.split(uf),this.debug(this.pattern,"split",t);var i=this.set;this.debug(this.pattern,"set",i);var s,n;for(n=t.length-1;n>=0&&(s=t[n],!s);n--);for(n=0;n<i.length;n++){var o=i[n],a=t;r.matchBase&&o.length===1&&(a=[s]);var l=this.matchOne(a,o,e);if(l)return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}K.prototype.matchOne=function(t,e,r){var i=this.options;this.debug("matchOne",{this:this,file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var s=0,n=0,o=t.length,a=e.length;s<o&&n<a;s++,n++){this.debug("matchOne loop");var l=e[n],h=t[s];if(this.debug(e,l,h),l===!1)return!1;if(l===ba){this.debug("GLOBSTAR",[e,l,h]);var u=s,c=n+1;if(c===a){for(this.debug("** at the end");s<o;s++)if(t[s]==="."||t[s]===".."||!i.dot&&t[s].charAt(0)===".")return!1;return!0}for(;u<o;){var d=t[u];if(this.debug(`
globstar while`,t,u,e,c,d),this.matchOne(t.slice(u),e.slice(c),r))return this.debug("globstar found match!",u,o,d),!0;if(d==="."||d===".."||!i.dot&&d.charAt(0)==="."){this.debug("dot detected!",t,u,e,c);break}this.debug("globstar swallow a segment, and continue"),u++}return!!(r&&(this.debug(`
>>> no match, partial?`,t,u,e,c),u===o))}var f;if(typeof l=="string"?(i.nocase?f=h.toLowerCase()===l.toLowerCase():f=h===l,this.debug("string match",l,h,f)):(f=h.match(l),this.debug("pattern match",l,h,f)),!f)return!1}if(s===o&&n===a)return!0;if(s===o)return r;if(n===a){var p=s===o-1&&t[s]==="";return p}throw new Error("wtf?")};function Lb(t){return t.replace(/\\(.)/g,"$1")}function $b(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}var Bb=Re(function(t){typeof Object.create=="function"?t.exports=function(r,i){r.super_=i,r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(r,i){r.super_=i;var s=function(){};s.prototype=i.prototype,r.prototype=new s,r.prototype.constructor=r}}),qb=Re(function(t){try{var e=Le.default;if(typeof e.inherits!="function")throw"";t.exports=e.inherits}catch{t.exports=Bb}});function df(t){return t.charAt(0)==="/"}function ff(t){var e=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,r=e.exec(t),i=r[1]||"",s=!!(i&&i.charAt(1)!==":");return!!(r[2]||s)}var ue=process.platform==="win32"?ff:df,jb=df,Ub=ff;ue.posix=jb;ue.win32=Ub;var Gb=gf,zb=pf,Hb=e1,Yb=mf,Wb=Xr,Vb=t1,Zb=r1,Kb=yf,Xb=i1;function mf(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var ta=va.Minimatch;function pf(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())}function gf(t,e){return t.localeCompare(e)}function Jb(t,e){t.ignore=e.ignore||[],Array.isArray(t.ignore)||(t.ignore=[t.ignore]),t.ignore.length&&(t.ignore=t.ignore.map(Qb))}function Qb(t){var e=null;if(t.slice(-3)==="/**"){var r=t.replace(/(\/\*\*)+$/,"");e=new ta(r,{dot:!0})}return{matcher:new ta(t,{dot:!0}),gmatcher:e}}function e1(t,e,r){if(r||(r={}),r.matchBase&&e.indexOf("/")===-1){if(r.noglobstar)throw new Error("base matching requires globstar");e="**/"+e}t.silent=!!r.silent,t.pattern=e,t.strict=r.strict!==!1,t.realpath=!!r.realpath,t.realpathCache=r.realpathCache||Object.create(null),t.follow=!!r.follow,t.dot=!!r.dot,t.mark=!!r.mark,t.nodir=!!r.nodir,t.nodir&&(t.mark=!0),t.sync=!!r.sync,t.nounique=!!r.nounique,t.nonull=!!r.nonull,t.nosort=!!r.nosort,t.nocase=!!r.nocase,t.stat=!!r.stat,t.noprocess=!!r.noprocess,t.absolute=!!r.absolute,t.maxLength=r.maxLength||1/0,t.cache=r.cache||Object.create(null),t.statCache=r.statCache||Object.create(null),t.symlinks=r.symlinks||Object.create(null),Jb(t,r),t.changedCwd=!1;var i=process.cwd();mf(r,"cwd")?(t.cwd=b.default.resolve(r.cwd),t.changedCwd=t.cwd!==i):t.cwd=i,t.root=r.root||b.default.resolve(t.cwd,"/"),t.root=b.default.resolve(t.root),process.platform==="win32"&&(t.root=t.root.replace(/\\/g,"/")),t.cwdAbs=ue(t.cwd)?t.cwd:Xr(t,t.cwd),process.platform==="win32"&&(t.cwdAbs=t.cwdAbs.replace(/\\/g,"/")),t.nomount=!!r.nomount,r.nonegate=!0,r.nocomment=!0,t.minimatch=new ta(e,r),t.options=t.minimatch.options}function t1(t){for(var e=t.nounique,r=e?[]:Object.create(null),i=0,s=t.matches.length;i<s;i++){var n=t.matches[i];if(!n||Object.keys(n).length===0){if(t.nonull){var o=t.minimatch.globSet[i];e?r.push(o):r[o]=!0}}else{var a=Object.keys(n);e?r.push.apply(r,a):a.forEach(function(l){r[l]=!0})}}if(e||(r=Object.keys(r)),t.nosort||(r=r.sort(t.nocase?pf:gf)),t.mark){for(var i=0;i<r.length;i++)r[i]=t._mark(r[i]);t.nodir&&(r=r.filter(function(l){var h=!/\/$/.test(l),u=t.cache[l]||t.cache[Xr(t,l)];return h&&u&&(h=u!=="DIR"&&!Array.isArray(u)),h}))}t.ignore.length&&(r=r.filter(function(l){return!yf(t,l)})),t.found=r}function r1(t,e){var r=Xr(t,e),i=t.cache[r],s=e;if(i){var n=i==="DIR"||Array.isArray(i),o=e.slice(-1)==="/";if(n&&!o?s+="/":!n&&o&&(s=s.slice(0,-1)),s!==e){var a=Xr(t,s);t.statCache[a]=t.statCache[r],t.cache[a]=t.cache[r]}}return s}function Xr(t,e){var r=e;return e.charAt(0)==="/"?r=b.default.join(t.root,e):ue(e)||e===""?r=e:t.changedCwd?r=b.default.resolve(t.cwd,e):r=b.default.resolve(e),process.platform==="win32"&&(r=r.replace(/\\/g,"/")),r}function yf(t,e){return t.ignore.length?t.ignore.some(function(r){return r.matcher.match(e)||!!(r.gmatcher&&r.gmatcher.match(e))}):!1}function i1(t,e){return t.ignore.length?t.ignore.some(function(r){return!!(r.gmatcher&&r.gmatcher.match(e))}):!1}var ae={alphasort:Gb,alphasorti:zb,setopts:Hb,ownProp:Yb,makeAbs:Wb,finish:Vb,mark:Zb,isIgnored:Kb,childrenIgnored:Xb},wa=vf;vf.GlobSync=V;var s1=ae.setopts,ra=ae.ownProp,n1=ae.childrenIgnored,o1=ae.isIgnored;function vf(t,e){if(typeof e=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);return new V(t,e).found}function V(t,e){if(!t)throw new Error("must provide pattern");if(typeof e=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof V))return new V(t,e);if(s1(this,t,e),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var i=0;i<r;i++)this._process(this.minimatch.set[i],i,!1);this._finish()}V.prototype._finish=function(){if(O.default(this instanceof V),this.realpath){var t=this;this.matches.forEach(function(e,r){var i=t.matches[r]=Object.create(null);for(var s in e)try{s=t._makeAbs(s);var n=Jd.realpathSync(s,t.realpathCache);i[n]=!0}catch(o){if(o.syscall==="stat")i[t._makeAbs(s)]=!0;else throw o}})}ae.finish(this)};V.prototype._process=function(t,e,r){O.default(this instanceof V);for(var i=0;typeof t[i]=="string";)i++;var s;switch(i){case t.length:this._processSimple(t.join("/"),e);return;case 0:s=null;break;default:s=t.slice(0,i).join("/");break}var n=t.slice(i),o;s===null?o=".":((ue(s)||ue(t.join("/")))&&(!s||!ue(s))&&(s="/"+s),o=s);var a=this._makeAbs(o);if(!n1(this,o)){var l=n[0]===va.GLOBSTAR;l?this._processGlobStar(s,o,a,n,e,r):this._processReaddir(s,o,a,n,e,r)}};V.prototype._processReaddir=function(t,e,r,i,s,n){var o=this._readdir(r,n);if(o){for(var a=i[0],l=!!this.minimatch.negate,h=a._glob,u=this.dot||h.charAt(0)===".",c=[],d=0;d<o.length;d++){var f=o[d];if(f.charAt(0)!=="."||u){var p;l&&!t?p=!f.match(a):p=f.match(a),p&&c.push(f)}}var g=c.length;if(g!==0){if(i.length===1&&!this.mark&&!this.stat){this.matches[s]||(this.matches[s]=Object.create(null));for(var d=0;d<g;d++){var f=c[d];t&&(t.slice(-1)!=="/"?f=t+"/"+f:f=t+f),f.charAt(0)==="/"&&!this.nomount&&(f=b.default.join(this.root,f)),this._emitMatch(s,f)}return}i.shift();for(var d=0;d<g;d++){var f=c[d],y;t?y=[t,f]:y=[f],this._process(y.concat(i),s,n)}}}};V.prototype._emitMatch=function(t,e){if(!o1(this,e)){var r=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=r),!this.matches[t][e]){if(this.nodir){var i=this.cache[r];if(i==="DIR"||Array.isArray(i))return}this.matches[t][e]=!0,this.stat&&this._stat(e)}}};V.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,!1);var e,r;try{r=m.default.lstatSync(t)}catch(s){if(s.code==="ENOENT")return null}var i=r&&r.isSymbolicLink();return this.symlinks[t]=i,!i&&r&&!r.isDirectory()?this.cache[t]="FILE":e=this._readdir(t,!1),e};V.prototype._readdir=function(t,e){if(e&&!ra(this.symlinks,t))return this._readdirInGlobStar(t);if(ra(this.cache,t)){var r=this.cache[t];if(!r||r==="FILE")return null;if(Array.isArray(r))return r}try{return this._readdirEntries(t,m.default.readdirSync(t))}catch(i){return this._readdirError(t,i),null}};V.prototype._readdirEntries=function(t,e){if(!this.mark&&!this.stat)for(var r=0;r<e.length;r++){var i=e[r];t==="/"?i=t+i:i=t+"/"+i,this.cache[i]=!0}return this.cache[t]=e,e};V.prototype._readdirError=function(t,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(t);if(this.cache[r]="FILE",r===this.cwdAbs){var i=new Error(e.code+" invalid cwd "+this.cwd);throw i.path=this.cwd,i.code=e.code,i}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:if(this.cache[this._makeAbs(t)]=!1,this.strict)throw e;this.silent||console.error("glob error",e);break}};V.prototype._processGlobStar=function(t,e,r,i,s,n){var o=this._readdir(r,n);if(o){var a=i.slice(1),l=t?[t]:[],h=l.concat(a);this._process(h,s,!1);var u=o.length,c=this.symlinks[r];if(!(c&&n))for(var d=0;d<u;d++){var f=o[d];if(!(f.charAt(0)==="."&&!this.dot)){var p=l.concat(o[d],a);this._process(p,s,!0);var g=l.concat(o[d],i);this._process(g,s,!0)}}}};V.prototype._processSimple=function(t,e){var r=this._stat(t);if(this.matches[e]||(this.matches[e]=Object.create(null)),!!r){if(t&&ue(t)&&!this.nomount){var i=/[\/\\]$/.test(t);t.charAt(0)==="/"?t=b.default.join(this.root,t):(t=b.default.resolve(this.root,t),i&&(t+="/"))}process.platform==="win32"&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t)}};V.prototype._stat=function(t){var e=this._makeAbs(t),r=t.slice(-1)==="/";if(t.length>this.maxLength)return!1;if(!this.stat&&ra(this.cache,e)){var n=this.cache[e];if(Array.isArray(n)&&(n="DIR"),!r||n==="DIR")return n;if(r&&n==="FILE")return!1}var i=this.statCache[e];if(!i){var s;try{s=m.default.lstatSync(e)}catch(o){if(o&&(o.code==="ENOENT"||o.code==="ENOTDIR"))return this.statCache[e]=!1,!1}if(s&&s.isSymbolicLink())try{i=m.default.statSync(e)}catch{i=s}else i=s}this.statCache[e]=i;var n=!0;return i&&(n=i.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||n,r&&n==="FILE"?!1:n};V.prototype._mark=function(t){return ae.mark(this,t)};V.prototype._makeAbs=function(t){return ae.makeAbs(this,t)};var Sa=bf;function bf(t,e){if(t&&e)return bf(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(i){r[i]=t[i]}),r;function r(){for(var i=new Array(arguments.length),s=0;s<i.length;s++)i[s]=arguments[s];var n=t.apply(this,i),o=i[i.length-1];return typeof n=="function"&&n!==o&&Object.keys(o).forEach(function(a){n[a]=o[a]}),n}}var Ea=Sa(Xi),a1=Sa(wf);Xi.proto=Xi(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return Xi(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return wf(this)},configurable:!0})});function Xi(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function wf(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}Ea.strict=a1;var zr=Object.create(null),_a=Sa(l1);function l1(t,e){return zr[t]?(zr[t].push(e),null):(zr[t]=[e],h1(t))}function h1(t){return Ea(function e(){var r=zr[t],i=r.length,s=u1(arguments);try{for(var n=0;n<i;n++)r[n].apply(null,s)}finally{r.length>i?(r.splice(0,i),process.nextTick(function(){e.apply(null,s)})):delete zr[t]}})}function u1(t){for(var e=t.length,r=[],i=0;i<e;i++)r[i]=t[i];return r}var c1=Dt,d1=hr.default.EventEmitter,f1=ae.setopts,ia=ae.ownProp,m1=ae.childrenIgnored,p1=ae.isIgnored;function Dt(t,e,r){if(typeof e=="function"&&(r=e,e={}),e||(e={}),e.sync){if(r)throw new TypeError("callback provided to sync glob");return wa(t,e)}return new k(t,e,r)}Dt.sync=wa;var g1=Dt.GlobSync=wa.GlobSync;Dt.glob=Dt;function y1(t,e){if(e===null||typeof e!="object")return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t}Dt.hasMagic=function(t,e){var r=y1({},e);r.noprocess=!0;var i=new k(t,r),s=i.minimatch.set;if(!t)return!1;if(s.length>1)return!0;for(var n=0;n<s[0].length;n++)if(typeof s[0][n]!="string")return!0;return!1};Dt.Glob=k;qb(k,d1);function k(t,e,r){if(typeof e=="function"&&(r=e,e=null),e&&e.sync){if(r)throw new TypeError("callback provided to sync glob");return new g1(t,e)}if(!(this instanceof k))return new k(t,e,r);f1(this,t,e),this._didRealPath=!1;var i=this.minimatch.set.length;this.matches=new Array(i),typeof r=="function"&&(r=Ea(r),this.on("error",r),this.on("end",function(l){r(null,l)}));var s=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(i===0)return a();for(var n=!0,o=0;o<i;o++)this._process(this.minimatch.set[o],o,!1,a);n=!1;function a(){--s._processing,s._processing<=0&&(n?process.nextTick(function(){s._finish()}):s._finish())}}k.prototype._finish=function(){if(O.default(this instanceof k),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();ae.finish(this),this.emit("end",this.found)}};k.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var t=this.matches.length;if(t===0)return this._finish();for(var e=this,r=0;r<this.matches.length;r++)this._realpathSet(r,i);function i(){--t===0&&e._finish()}};k.prototype._realpathSet=function(t,e){var r=this.matches[t];if(!r)return e();var i=Object.keys(r),s=this,n=i.length;if(n===0)return e();var o=this.matches[t]=Object.create(null);i.forEach(function(a,l){a=s._makeAbs(a),Jd.realpath(a,s.realpathCache,function(h,u){h?h.syscall==="stat"?o[a]=!0:s.emit("error",h):o[u]=!0,--n===0&&(s.matches[t]=o,e())})})};k.prototype._mark=function(t){return ae.mark(this,t)};k.prototype._makeAbs=function(t){return ae.makeAbs(this,t)};k.prototype.abort=function(){this.aborted=!0,this.emit("abort")};k.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))};k.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var e=0;e<t.length;e++){var r=t[e];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var i=this._processQueue.slice(0);this._processQueue.length=0;for(var e=0;e<i.length;e++){var s=i[e];this._processing--,this._process(s[0],s[1],s[2],s[3])}}}};k.prototype._process=function(t,e,r,i){if(O.default(this instanceof k),O.default(typeof i=="function"),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([t,e,r,i]);return}for(var s=0;typeof t[s]=="string";)s++;var n;switch(s){case t.length:this._processSimple(t.join("/"),e,i);return;case 0:n=null;break;default:n=t.slice(0,s).join("/");break}var o=t.slice(s),a;n===null?a=".":((ue(n)||ue(t.join("/")))&&(!n||!ue(n))&&(n="/"+n),a=n);var l=this._makeAbs(a);if(m1(this,a))return i();var h=o[0]===va.GLOBSTAR;h?this._processGlobStar(n,a,l,o,e,r,i):this._processReaddir(n,a,l,o,e,r,i)}};k.prototype._processReaddir=function(t,e,r,i,s,n,o){var a=this;this._readdir(r,n,function(l,h){return a._processReaddir2(t,e,r,i,s,n,h,o)})};k.prototype._processReaddir2=function(t,e,r,i,s,n,o,a){if(!o)return a();for(var l=i[0],h=!!this.minimatch.negate,u=l._glob,c=this.dot||u.charAt(0)===".",d=[],f=0;f<o.length;f++){var p=o[f];if(p.charAt(0)!=="."||c){var g;h&&!t?g=!p.match(l):g=p.match(l),g&&d.push(p)}}var y=d.length;if(y===0)return a();if(i.length===1&&!this.mark&&!this.stat){this.matches[s]||(this.matches[s]=Object.create(null));for(var f=0;f<y;f++){var p=d[f];t&&(t!=="/"?p=t+"/"+p:p=t+p),p.charAt(0)==="/"&&!this.nomount&&(p=b.default.join(this.root,p)),this._emitMatch(s,p)}return a()}i.shift();for(var f=0;f<y;f++){var p=d[f];t&&(t!=="/"?p=t+"/"+p:p=t+p),this._process([p].concat(i),s,n,a)}a()};k.prototype._emitMatch=function(t,e){if(!this.aborted&&!p1(this,e)){if(this.paused){this._emitQueue.push([t,e]);return}var r=ue(e)?e:this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=r),!this.matches[t][e]){if(this.nodir){var i=this.cache[r];if(i==="DIR"||Array.isArray(i))return}this.matches[t][e]=!0;var s=this.statCache[r];s&&this.emit("stat",e,s),this.emit("match",e)}}};k.prototype._readdirInGlobStar=function(t,e){if(this.aborted)return;if(this.follow)return this._readdir(t,!1,e);var r="lstat\0"+t,i=this,s=_a(r,n);s&&m.default.lstat(t,s);function n(o,a){if(o&&o.code==="ENOENT")return e();var l=a&&a.isSymbolicLink();i.symlinks[t]=l,!l&&a&&!a.isDirectory()?(i.cache[t]="FILE",e()):i._readdir(t,!1,e)}};k.prototype._readdir=function(t,e,r){if(!this.aborted&&(r=_a("readdir\0"+t+"\0"+e,r),!!r)){if(e&&!ia(this.symlinks,t))return this._readdirInGlobStar(t,r);if(ia(this.cache,t)){var i=this.cache[t];if(!i||i==="FILE")return r();if(Array.isArray(i))return r(null,i)}m.default.readdir(t,v1(this,t,r))}};function v1(t,e,r){return function(i,s){i?t._readdirError(e,i,r):t._readdirEntries(e,s,r)}}k.prototype._readdirEntries=function(t,e,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var i=0;i<e.length;i++){var s=e[i];t==="/"?s=t+s:s=t+"/"+s,this.cache[s]=!0}return this.cache[t]=e,r(null,e)}};k.prototype._readdirError=function(t,e,r){if(!this.aborted){switch(e.code){case"ENOTSUP":case"ENOTDIR":var i=this._makeAbs(t);if(this.cache[i]="FILE",i===this.cwdAbs){var s=new Error(e.code+" invalid cwd "+this.cwd);s.path=this.cwd,s.code=e.code,this.emit("error",s),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:this.cache[this._makeAbs(t)]=!1,this.strict&&(this.emit("error",e),this.abort()),this.silent||console.error("glob error",e);break}return r()}};k.prototype._processGlobStar=function(t,e,r,i,s,n,o){var a=this;this._readdir(r,n,function(l,h){a._processGlobStar2(t,e,r,i,s,n,h,o)})};k.prototype._processGlobStar2=function(t,e,r,i,s,n,o,a){if(!o)return a();var l=i.slice(1),h=t?[t]:[],u=h.concat(l);this._process(u,s,!1,a);var c=this.symlinks[r],d=o.length;if(c&&n)return a();for(var f=0;f<d;f++){var p=o[f];if(!(p.charAt(0)==="."&&!this.dot)){var g=h.concat(o[f],l);this._process(g,s,!0,a);var y=h.concat(o[f],i);this._process(y,s,!0,a)}}a()};k.prototype._processSimple=function(t,e,r){var i=this;this._stat(t,function(s,n){i._processSimple2(t,e,s,n,r)})};k.prototype._processSimple2=function(t,e,r,i,s){if(this.matches[e]||(this.matches[e]=Object.create(null)),!i)return s();if(t&&ue(t)&&!this.nomount){var n=/[\/\\]$/.test(t);t.charAt(0)==="/"?t=b.default.join(this.root,t):(t=b.default.resolve(this.root,t),n&&(t+="/"))}process.platform==="win32"&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t),s()};k.prototype._stat=function(t,e){var r=this._makeAbs(t),i=t.slice(-1)==="/";if(t.length>this.maxLength)return e();if(!this.stat&&ia(this.cache,r)){var s=this.cache[r];if(Array.isArray(s)&&(s="DIR"),!i||s==="DIR")return e(null,s);if(i&&s==="FILE")return e()}var n=this.statCache[r];if(n!==void 0){if(n===!1)return e(null,n);var o=n.isDirectory()?"DIR":"FILE";return i&&o==="FILE"?e():e(null,o,n)}var a=this,l=_a("stat\0"+r,h);l&&m.default.lstat(r,l);function h(u,c){if(c&&c.isSymbolicLink())return m.default.stat(r,function(d,f){d?a._stat2(t,r,null,c,e):a._stat2(t,r,d,f,e)});a._stat2(t,r,u,c,e)}};k.prototype._stat2=function(t,e,r,i,s){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR"))return this.statCache[e]=!1,s();var n=t.slice(-1)==="/";if(this.statCache[e]=i,e.slice(-1)==="/"&&i&&!i.isDirectory())return s(null,!1,i);var o=!0;return i&&(o=i.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||o,n&&o==="FILE"?s():s(null,o,i)};var b1=Oa;Oa.sync=_f;var nr=void 0;try{nr=c1}catch{}var Sf=parseInt("666",8),w1={nosort:!0,silent:!0},co=0,Jr=process.platform==="win32";function Ef(t){var e=["unlink","chmod","stat","lstat","rmdir","readdir"];if(e.forEach(function(r){t[r]=t[r]||m.default[r],r=r+"Sync",t[r]=t[r]||m.default[r]}),t.maxBusyTries=t.maxBusyTries||3,t.emfileWait=t.emfileWait||1e3,t.glob===!1&&(t.disableGlob=!0),t.disableGlob!==!0&&nr===void 0)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");t.disableGlob=t.disableGlob||!1,t.glob=t.glob||w1}function Oa(t,e,r){typeof e=="function"&&(r=e,e={}),O.default(t,"rimraf: missing path"),O.default.equal(typeof t,"string","rimraf: path should be a string"),O.default.equal(typeof r,"function","rimraf: callback function required"),O.default(e,"rimraf: invalid options argument provided"),O.default.equal(typeof e,"object","rimraf: options should be object"),Ef(e);var i=0,s=null,n=0;if(e.disableGlob||!nr.hasMagic(t))return a(null,[t]);e.lstat(t,function(l,h){if(!l)return a(null,[t]);nr(t,e.glob,a)});function o(l){s=s||l,--n===0&&r(s)}function a(l,h){if(l)return r(l);if(n=h.length,n===0)return r();h.forEach(function(u){fo(u,e,function c(d){if(d){if((d.code==="EBUSY"||d.code==="ENOTEMPTY"||d.code==="EPERM")&&i<e.maxBusyTries){i++;var f=i*100;return setTimeout(function(){fo(u,e,c)},f)}if(d.code==="EMFILE"&&co<e.emfileWait)return setTimeout(function(){fo(u,e,c)},co++);d.code==="ENOENT"&&(d=null)}co=0,o(d)})})}}function fo(t,e,r){O.default(t),O.default(e),O.default(typeof r=="function"),e.lstat(t,function(i,s){if(i&&i.code==="ENOENT")return r(null);if(i&&i.code==="EPERM"&&Jr&&rd(t,e,i,r),s&&s.isDirectory())return Ji(t,e,i,r);e.unlink(t,function(n){if(n){if(n.code==="ENOENT")return r(null);if(n.code==="EPERM")return Jr?rd(t,e,n,r):Ji(t,e,n,r);if(n.code==="EISDIR")return Ji(t,e,n,r)}return r(n)})})}function rd(t,e,r,i){O.default(t),O.default(e),O.default(typeof i=="function"),r&&O.default(r instanceof Error),e.chmod(t,Sf,function(s){s?i(s.code==="ENOENT"?null:r):e.stat(t,function(n,o){n?i(n.code==="ENOENT"?null:r):o.isDirectory()?Ji(t,e,r,i):e.unlink(t,i)})})}function id(t,e,r){O.default(t),O.default(e),r&&O.default(r instanceof Error);try{e.chmodSync(t,Sf)}catch(s){if(s.code==="ENOENT")return;throw r}try{var i=e.statSync(t)}catch(s){if(s.code==="ENOENT")return;throw r}i.isDirectory()?Qi(t,e,r):e.unlinkSync(t)}function Ji(t,e,r,i){O.default(t),O.default(e),r&&O.default(r instanceof Error),O.default(typeof i=="function"),e.rmdir(t,function(s){s&&(s.code==="ENOTEMPTY"||s.code==="EEXIST"||s.code==="EPERM")?S1(t,e,i):s&&s.code==="ENOTDIR"?i(r):i(s)})}function S1(t,e,r){O.default(t),O.default(e),O.default(typeof r=="function"),e.readdir(t,function(i,s){if(i)return r(i);var n=s.length;if(n===0)return e.rmdir(t,r);var o;s.forEach(function(a){Oa(b.default.join(t,a),e,function(l){if(!o){if(l)return r(o=l);--n===0&&e.rmdir(t,r)}})})})}function _f(t,e){e=e||{},Ef(e),O.default(t,"rimraf: missing path"),O.default.equal(typeof t,"string","rimraf: path should be a string"),O.default(e,"rimraf: missing options"),O.default.equal(typeof e,"object","rimraf: options should be object");var r;if(e.disableGlob||!nr.hasMagic(t))r=[t];else try{e.lstatSync(t),r=[t]}catch{r=nr.sync(t,e.glob)}if(r.length)for(var i=0;i<r.length;i++){var t=r[i];try{var s=e.lstatSync(t)}catch(o){if(o.code==="ENOENT")return;o.code==="EPERM"&&Jr&&id(t,e,o)}try{s&&s.isDirectory()?Qi(t,e,null):e.unlinkSync(t)}catch(o){if(o.code==="ENOENT")return;if(o.code==="EPERM")return Jr?id(t,e,o):Qi(t,e,o);if(o.code!=="EISDIR")throw o;Qi(t,e,o)}}}function Qi(t,e,r){O.default(t),O.default(e),r&&O.default(r instanceof Error);try{e.rmdirSync(t)}catch(i){if(i.code==="ENOENT")return;if(i.code==="ENOTDIR")throw r;(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")&&E1(t,e)}}function E1(t,e){O.default(t),O.default(e),e.readdirSync(t).forEach(function(o){_f(b.default.join(t,o),e)});var r=Jr?100:1,i=0;do{var s=!0;try{var n=e.rmdirSync(t,e);return s=!1,n}finally{if(++i<r&&s)continue}}while(!0)}function Of(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var _1=Of(hb),O1=Of(b1);function R1(t){return b.default.resolve.apply(null,t)}function sd(t){var e,r;if(typeof t[t.length-1]=="object"){e=t[t.length-1];var i=t.length-1;for(r=new Array(i);i--;)r[i]=t[i]}else e={},r=t;var s=b.default.resolve.apply(null,r);return{options:e,resolvedPath:s}}function T1(){var t=sd(arguments),e=t.resolvedPath,r=t.options;return{to:function(){var s=sd(arguments),n=s.resolvedPath,o=s.options;function a(l,h){_1.sync(h),ge.readdirSync(l).forEach(function(u){var c=l+b.default.sep+u,d=h+b.default.sep+u;if(ge.statSync(c).isDirectory())return a(c,d);var f=ge.readFileSync(c,r);ge.writeFileSync(d,f,o)})}a(e,n)}}}function C1(){O1.sync(R1(arguments))}process.platform;ge.closeSync;ge.fchmodSync;ge.fchownSync;ge.fstatSync;ge.fsyncSync;ge.ftruncateSync;ge.futimesSync;ge.readSync;var Rf=T1,Qr=C1,x1=yo.default.homedir()||yo.default.tmpdir(),or=1e3,ar=or*60,lr=ar*60,Nt=lr*24,A1=Nt*7,I1=Nt*365.25,M1=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return k1(t);if(r==="number"&&isFinite(t))return e.long?N1(t):D1(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function k1(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*I1;case"weeks":case"week":case"w":return r*A1;case"days":case"day":case"d":return r*Nt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*lr;case"minutes":case"minute":case"mins":case"min":case"m":return r*ar;case"seconds":case"second":case"secs":case"sec":case"s":return r*or;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function D1(t){var e=Math.abs(t);return e>=Nt?Math.round(t/Nt)+"d":e>=lr?Math.round(t/lr)+"h":e>=ar?Math.round(t/ar)+"m":e>=or?Math.round(t/or)+"s":t+"ms"}function N1(t){var e=Math.abs(t);return e>=Nt?Bi(t,e,Nt,"day"):e>=lr?Bi(t,e,lr,"hour"):e>=ar?Bi(t,e,ar,"minute"):e>=or?Bi(t,e,or,"second"):t+" ms"}function Bi(t,e,r,i){var s=e>=r*1.5;return Math.round(t/r)+" "+i+(s?"s":"")}function F1(t){r.debug=r,r.default=r,r.coerce=l,r.disable=n,r.enable=s,r.enabled=o,r.humanize=M1,r.destroy=h,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let c=0;for(let d=0;d<u.length;d++)c=(c<<5)-c+u.charCodeAt(d),c|=0;return r.colors[Math.abs(c)%r.colors.length]}r.selectColor=e;function r(u){let c,d=null;function f(...p){if(!f.enabled)return;let g=f,y=Number(new Date),w=y-(c||y);g.diff=w,g.prev=c,g.curr=y,c=y,p[0]=r.coerce(p[0]),typeof p[0]!="string"&&p.unshift("%O");let _=0;p[0]=p[0].replace(/%([a-zA-Z%])/g,(C,Y)=>{if(C==="%%")return"%";_++;let W=r.formatters[Y];if(typeof W=="function"){let ce=p[_];C=W.call(g,ce),p.splice(_,1),_--}return C}),r.formatArgs.call(g,p),(g.log||r.log).apply(g,p)}return f.namespace=u,f.useColors=r.useColors(),f.color=r.selectColor(u),f.extend=i,f.destroy=r.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>d===null?r.enabled(u):d,set:p=>{d=p}}),typeof r.init=="function"&&r.init(f),f}function i(u,c){let d=r(this.namespace+(typeof c>"u"?":":c)+u);return d.log=this.log,d}function s(u){r.save(u),r.names=[],r.skips=[];let c,d=(typeof u=="string"?u:"").split(/[\s,]+/),f=d.length;for(c=0;c<f;c++)d[c]&&(u=d[c].replace(/\*/g,".*?"),u[0]==="-"?r.skips.push(new RegExp("^"+u.substr(1)+"$")):r.names.push(new RegExp("^"+u+"$")))}function n(){let u=[...r.names.map(a),...r.skips.map(a).map(c=>"-"+c)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let c,d;for(c=0,d=r.skips.length;c<d;c++)if(r.skips[c].test(u))return!1;for(c=0,d=r.names.length;c<d;c++)if(r.names[c].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Tf=F1,P1=Re(function(t,e){e.formatArgs=i,e.save=s,e.load=n,e.useColors=r,e.storage=o(),e.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let h="color: "+this.color;l.splice(1,0,h,"color: inherit");let u=0,c=0;l[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(u++,d==="%c"&&(c=u))}),l.splice(c,0,h)}e.log=console.debug||console.log||(()=>{});function s(l){try{l?e.storage.setItem("debug",l):e.storage.removeItem("debug")}catch{}}function n(){let l;try{l=e.storage.getItem("debug")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=process.env.DEBUG),l}function o(){try{return localStorage}catch{}}t.exports=Tf(e);let{formatters:a}=t.exports;a.j=function(l){try{return JSON.stringify(l)}catch(h){return"[UnexpectedJSONParseError]: "+h.message}}}),L1=Re(function(t,e){e.init=l,e.log=n,e.formatArgs=i,e.save=o,e.load=a,e.useColors=r,e.destroy=Le.default.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let u=zd;u&&(u.stderr||u).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(u=>/^debug_/i.test(u)).reduce((u,c)=>{let d=c.substring(6).toLowerCase().replace(/_([a-z])/g,(p,g)=>g.toUpperCase()),f=process.env[c];return/^(yes|on|true|enabled)$/i.test(f)?f=!0:/^(no|off|false|disabled)$/i.test(f)?f=!1:f==="null"?f=null:f=Number(f),u[d]=f,u},{});function r(){return"colors"in e.inspectOpts?!!e.inspectOpts.colors:vo.default.isatty(process.stderr.fd)}function i(u){let{namespace:c,useColors:d}=this;if(d){let f=this.color,p="\x1B[3"+(f<8?f:"8;5;"+f),g=`  ${p};1m${c} \x1B[0m`;u[0]=g+u[0].split(`
`).join(`
`+g),u.push(p+"m+"+t.exports.humanize(this.diff)+"\x1B[0m")}else u[0]=s()+c+" "+u[0]}function s(){return e.inspectOpts.hideDate?"":new Date().toISOString()+" "}function n(...u){return process.stderr.write(Le.default.format(...u)+`
`)}function o(u){u?process.env.DEBUG=u:delete process.env.DEBUG}function a(){return process.env.DEBUG}function l(u){u.inspectOpts={};let c=Object.keys(e.inspectOpts);for(let d=0;d<c.length;d++)u.inspectOpts[c[d]]=e.inspectOpts[c[d]]}t.exports=Tf(e);let{formatters:h}=t.exports;h.o=function(u){return this.inspectOpts.colors=this.useColors,Le.default.inspect(u,this.inspectOpts).split(`
`).map(c=>c.trim()).join(" ")},h.O=function(u){return this.inspectOpts.colors=this.useColors,Le.default.inspect(u,this.inspectOpts)}}),Ra=Re(function(t){typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?t.exports=P1:t.exports=L1});function $1(t){return function(e,r){return new Promise((i,s)=>{t.call(this,e,r,(n,o)=>{n?s(n):i(o)})})}}var B1=$1,q1=Object.defineProperty({default:B1},"__esModule",{value:!0}),Cf=ve&&ve.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},j1=Cf(Ra),U1=Cf(q1),$r=j1.default("agent-base");function G1(t){return!!t&&typeof t.addRequest=="function"}function mo(){let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
`).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function hs(t,e){return new hs.Agent(t,e)}(function(t){class e extends hr.default.EventEmitter{constructor(i,s){super();let n=s;typeof i=="function"?this.callback=i:i&&(n=i),this.timeout=null,n&&typeof n.timeout=="number"&&(this.timeout=n.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:mo()?443:80}set defaultPort(i){this.explicitDefaultPort=i}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:mo()?"https:":"http:"}set protocol(i){this.explicitProtocol=i}callback(i,s,n){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(i,s){let n=Object.assign({},s);typeof n.secureEndpoint!="boolean"&&(n.secureEndpoint=mo()),n.host==null&&(n.host="localhost"),n.port==null&&(n.port=n.secureEndpoint?443:80),n.protocol==null&&(n.protocol=n.secureEndpoint?"https:":"http:"),n.host&&n.path&&delete n.path,delete n.agent,delete n.hostname,delete n._defaultAgent,delete n.defaultPort,delete n.createConnection,i._last=!0,i.shouldKeepAlive=!1;let o=!1,a=null,l=n.timeout||this.timeout,h=f=>{i._hadError||(i.emit("error",f),i._hadError=!0)},u=()=>{a=null,o=!0;let f=new Error(`A "socket" was not created for HTTP request before ${l}ms`);f.code="ETIMEOUT",h(f)},c=f=>{o||(a!==null&&(clearTimeout(a),a=null),h(f))},d=f=>{if(o)return;if(a!=null&&(clearTimeout(a),a=null),G1(f)){$r("Callback returned another Agent instance %o",f.constructor.name),f.addRequest(i,n);return}if(f){f.once("free",()=>{this.freeSocket(f,n)}),i.onSocket(f);return}let p=new Error(`no Duplex stream was returned to agent-base for \`${i.method} ${i.path}\``);h(p)};if(typeof this.callback!="function"){h(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?($r("Converting legacy callback function to promise"),this.promisifiedCallback=U1.default(this.callback)):this.promisifiedCallback=this.callback),typeof l=="number"&&l>0&&(a=setTimeout(u,l)),"port"in n&&typeof n.port!="number"&&(n.port=Number(n.port));try{$r("Resolving socket for %o request: %o",n.protocol,`${i.method} ${i.path}`),Promise.resolve(this.promisifiedCallback(i,n)).then(d,c)}catch(f){Promise.reject(f).catch(c)}}freeSocket(i,s){$r("Freeing socket %o %o",i.constructor.name,s),i.destroy()}destroy(){$r("Destroying agent %o",this.constructor.name)}}t.Agent=e,t.prototype=t.Agent.prototype})(hs||(hs={}));var z1=hs,H1=ve&&ve.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Y1=H1(Ra),Br=Y1.default("https-proxy-agent:parse-proxy-response");function W1(t){return new Promise((e,r)=>{let i=0,s=[];function n(){let c=t.read();c?u(c):t.once("readable",n)}function o(){t.removeListener("end",l),t.removeListener("error",h),t.removeListener("close",a),t.removeListener("readable",n)}function a(c){Br("onclose had error %o",c)}function l(){Br("onend")}function h(c){o(),Br("onerror %o",c),r(c)}function u(c){s.push(c),i+=c.length;let d=Buffer.concat(s,i);if(d.indexOf(`\r
\r
`)===-1){Br("have not received end of HTTP headers yet..."),n();return}let p=d.toString("ascii",0,d.indexOf(`\r
`)),g=+p.split(" ")[1];Br("got proxy server response: %o",p),e({statusCode:g,buffered:d})}t.on("error",h),t.on("close",a),t.on("end",l),n()})}var V1=W1,Z1=Object.defineProperty({default:V1},"__esModule",{value:!0}),K1=ve&&ve.__awaiter||function(t,e,r,i){function s(n){return n instanceof r?n:new r(function(o){o(n)})}return new(r||(r=Promise))(function(n,o){function a(u){try{h(i.next(u))}catch(c){o(c)}}function l(u){try{h(i.throw(u))}catch(c){o(c)}}function h(u){u.done?n(u.value):s(u.value).then(a,l)}h((i=i.apply(t,e||[])).next())})},pr=ve&&ve.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},nd=pr(Iy.default),od=pr(My.default),X1=pr(ud.default),J1=pr(O.default),Q1=pr(Ra),ew=pr(Z1),qr=Q1.default("https-proxy-agent:agent"),sa=class extends z1.Agent{constructor(e){let r;if(typeof e=="string"?r=X1.default.parse(e):r=e,!r)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");qr("creating new HttpsProxyAgent instance: %o",r),super(r);let i=Object.assign({},r);this.secureProxy=r.secureProxy||sw(i.protocol),i.host=i.hostname||i.host,typeof i.port=="string"&&(i.port=parseInt(i.port,10)),!i.port&&i.host&&(i.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in i)&&(i.ALPNProtocols=["http 1.1"]),i.host&&i.path&&(delete i.path,delete i.pathname),this.proxy=i}callback(e,r){return K1(this,void 0,void 0,function*(){let{proxy:i,secureProxy:s}=this,n;s?(qr("Creating `tls.Socket`: %o",i),n=od.default.connect(i)):(qr("Creating `net.Socket`: %o",i),n=nd.default.connect(i));let o=Object.assign({},i.headers),l=`CONNECT ${`${r.host}:${r.port}`} HTTP/1.1\r
`;i.auth&&(o["Proxy-Authorization"]=`Basic ${Buffer.from(i.auth).toString("base64")}`);let{host:h,port:u,secureEndpoint:c}=r;iw(u,c)||(h+=`:${u}`),o.Host=h,o.Connection="close";for(let y of Object.keys(o))l+=`${y}: ${o[y]}\r
`;let d=ew.default(n);n.write(`${l}\r
`);let{statusCode:f,buffered:p}=yield d;if(f===200){if(e.once("socket",rw),r.secureEndpoint){let y=r.servername||r.host;if(!y)throw new Error('Could not determine "servername"');return qr("Upgrading socket connection to TLS"),od.default.connect(Object.assign(Object.assign({},nw(r,"host","hostname","path","port")),{socket:n,servername:y}))}return n}n.destroy();let g=new nd.default.Socket;return g.readable=!0,e.once("socket",y=>{qr("replaying proxy buffer for failed request"),J1.default(y.listenerCount("data")>0),y.push(p),y.push(null)}),g})}},tw=sa;function rw(t){t.resume()}function iw(t,e){return!!(!e&&t===80||e&&t===443)}function sw(t){return typeof t=="string"?/^https:?$/i.test(t):!1}function nw(t,...e){let r={},i;for(i in t)e.includes(i)||(r[i]=t[i]);return r}var ow=Object.defineProperty({default:tw},"__esModule",{value:!0}),aw=ve&&ve.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},na=aw(ow);function oa(t){return new na.default(t)}(function(t){t.HttpsProxyAgent=na.default,t.prototype=na.default.prototype})(oa||(oa={}));var lw=oa,xf="tmp",hw="degit.json",et=class extends Error{constructor(e,r){super(e),Object.assign(this,r)}};function us(t,e){try{return e&&e.clearCache===!0&&delete require.cache[require.resolve(t)],require(t)}catch{return null}}function aa(t){return new Promise((e,r)=>{Ay.default.exec(t,(i,s,n)=>{if(i){r(i);return}e({stdout:s,stderr:n})})})}function cs(t){let e=b.default.dirname(t);if(e!==t){cs(e);try{m.default.mkdirSync(t)}catch(r){if(r.code!=="EEXIST")throw r}}}function Af(t,e,r){return new Promise((i,s)=>{let n=t;if(r){let o=ud.default.parse(t);n={hostname:o.host,path:o.path,agent:new lw(r)}}xy.default.get(n,o=>{let a=o.statusCode;a>=400?s({code:a,message:o.statusMessage}):a>=300?Af(o.headers.location,e,r).then(i,s):o.pipe(m.default.createWriteStream(e)).on("finish",()=>i()).on("error",s)}).on("error",s)})}function uw(t,e){let r=b.default.join(t,xf);Qr(r),cs(r),m.default.readdirSync(e).forEach(i=>{let s=b.default.join(e,i),n=b.default.join(r,i);m.default.lstatSync(s).isDirectory()?(Rf(s).to(n),Qr(s)):(m.default.copyFileSync(s,n),m.default.unlinkSync(s))})}function cw(t,e){let r=b.default.join(t,xf);m.default.readdirSync(r).forEach(i=>{let s=b.default.join(r,i),n=b.default.join(e,i);m.default.lstatSync(s).isDirectory()?(Rf(s).to(n),Qr(s)):(i!=="degit.json"&&m.default.copyFileSync(s,n),m.default.unlinkSync(s))}),Qr(r)}var If=b.default.join(x1,".degit"),ad=new Set(["tar","git"]);function Mf(t,e){return new la(t,e)}var la=class extends hr.default{constructor(e,r={}){if(super(),this.src=e,this.cache=r.cache,this.force=r.force,this.verbose=r.verbose,this.proxy=process.env.https_proxy,this.repo=dw(e),this.mode=r.mode||this.repo.mode,!ad.has(this.mode))throw new Error(`Valid modes are ${Array.from(ad).join(", ")}`);this._hasStashed=!1,this.directiveActions={clone:async(i,s,n)=>{this._hasStashed===!1&&(uw(i,s),this._hasStashed=!0);let o=Object.assign({force:!0},{cache:n.cache,verbose:n.verbose}),a=Mf(n.src,o);a.on("info",l=>{console.error(Ke.cyan(`> ${l.message.replace("options.","--")}`))}),a.on("warn",l=>{console.error(Ke.magenta(`! ${l.message.replace("options.","--")}`))}),await a.clone(s).catch(l=>{console.error(Ke.red(`! ${l.message}`)),process.exit(1)})},remove:this.remove.bind(this)}}_getDirectives(e){let r=b.default.resolve(e,hw),i=us(r,{clearCache:!0})||!1;return i&&m.default.unlinkSync(r),i}async clone(e){this._checkDirIsEmpty(e);let{repo:r}=this,i=b.default.join(If,r.site,r.user,r.name);this.mode==="tar"?await this._cloneWithTar(i,e):await this._cloneWithGit(i,e),this._info({code:"SUCCESS",message:`cloned ${Ke.bold(r.user+"/"+r.name)}#${Ke.bold(r.ref)}${e!=="."?` to ${e}`:""}`,repo:r,dest:e});let s=this._getDirectives(e);if(s){for(let n of s)await this.directiveActions[n.action](i,e,n);this._hasStashed===!0&&cw(i,e)}}remove(e,r,i){let s=i.files;Array.isArray(s)||(s=[s]);let n=s.map(o=>{let a=b.default.resolve(r,o);return m.default.existsSync(a)?m.default.lstatSync(a).isDirectory()?(Qr(a),o+"/"):(m.default.unlinkSync(a),o):(this._warn({code:"FILE_DOES_NOT_EXIST",message:`action wants to remove ${Ke.bold(o)} but it does not exist`}),null)}).filter(o=>o);n.length>0&&this._info({code:"REMOVED",message:`removed: ${Ke.bold(n.map(o=>Ke.bold(o)).join(", "))}`})}_checkDirIsEmpty(e){try{if(m.default.readdirSync(e).length>0)if(this.force)this._info({code:"DEST_NOT_EMPTY",message:"destination directory is not empty. Using options.force, continuing"});else throw new et("destination directory is not empty, aborting. Use options.force to override",{code:"DEST_NOT_EMPTY"});else this._verbose({code:"DEST_IS_EMPTY",message:"destination directory is empty"})}catch(r){if(r.code!=="ENOENT")throw r}}_info(e){this.emit("info",e)}_warn(e){this.emit("warn",e)}_verbose(e){this.verbose&&this._info(e)}async _getHash(e,r){try{let i=await mw(e);return e.ref==="HEAD"?i.find(s=>s.type==="HEAD").hash:this._selectRef(i,e.ref)}catch(i){return this._warn(i),this._verbose(i.original),this._getHashFromCache(e,r)}}_getHashFromCache(e,r){if(e.ref in r){let i=r[e.ref];return this._info({code:"USING_CACHE",message:`using cached commit hash ${i}`}),i}}_selectRef(e,r){for(let i of e)if(i.name===r)return this._verbose({code:"FOUND_MATCH",message:`found matching commit hash: ${i.hash}`}),i.hash;if(r.length<8)return null;for(let i of e)if(i.hash.startsWith(r))return i.hash}async _cloneWithTar(e,r){let{repo:i}=this,s=us(b.default.join(e,"map.json"))||{},n=this.cache?this._getHashFromCache(i,s):await this._getHash(i,s),o=i.subdir?`${i.name}-${n}${i.subdir}`:null;if(!n)throw new et(`could not find commit hash for ${i.ref}`,{code:"MISSING_REF",ref:i.ref});let a=`${e}/${n}.tar.gz`,l=i.site==="gitlab"?`${i.url}/repository/archive.tar.gz?ref=${n}`:i.site==="bitbucket"?`${i.url}/get/${n}.tar.gz`:`${i.url}/archive/${n}.tar.gz`;try{if(!this.cache)try{m.default.statSync(a),this._verbose({code:"FILE_EXISTS",message:`${a} already exists locally`})}catch{cs(b.default.dirname(a)),this.proxy&&this._verbose({code:"PROXY",message:`using proxy ${this.proxy}`}),this._verbose({code:"DOWNLOADING",message:`downloading ${l} to ${a}`}),await Af(l,a,this.proxy)}}catch(h){throw new et(`could not download ${l}`,{code:"COULD_NOT_DOWNLOAD",url:l,original:h})}pw(e,i,n,s),this._verbose({code:"EXTRACTING",message:`extracting ${o?i.subdir+" from ":""}${a} to ${r}`}),cs(r),await fw(a,r,o)}async _cloneWithGit(e,r){await aa(`git clone ${this.repo.ssh} ${r}`),await aa(`rm -rf ${b.default.resolve(r,".git")}`)}},ld=new Set(["github","gitlab","bitbucket","git.sr.ht"]);function dw(t){let e=/^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(t);if(!e)throw new et(`could not parse ${t}`,{code:"BAD_SRC"});let r=(e[1]||e[2]||e[3]||"github").replace(/\.(com|org)$/,"");if(!ld.has(r))throw new et("degit supports GitHub, GitLab, Sourcehut and BitBucket",{code:"UNSUPPORTED_HOST"});let i=e[4],s=e[5].replace(/\.git$/,""),n=e[6],o=e[7]||"HEAD",a=`${r}.${r==="bitbucket"?"org":r==="git.sr.ht"?"":"com"}`,l=`https://${a}/${i}/${s}`,h=`git@${a}:${i}/${s}`,u=ld.has(r)?"tar":"git";return{site:r,user:i,name:s,ref:o,url:l,ssh:h,subdir:n,mode:u}}async function fw(t,e,r=null){return Cv.extract({file:t,strip:r?r.split("/").length:1,C:e},r?[r]:[])}async function mw(t){try{let{stdout:e}=await aa(`git ls-remote ${t.url}`);return e.split(`
`).filter(Boolean).map(r=>{let[i,s]=r.split("	");if(s==="HEAD")return{type:"HEAD",hash:i};let n=/refs\/(\w+)\/(.+)/.exec(s);if(!n)throw new et(`could not parse ${s}`,{code:"BAD_REF"});return{type:n[1]==="heads"?"branch":n[1]==="refs"?"ref":n[1],name:n[2],hash:i}})}catch(e){throw new et(`could not fetch remote ${t.url}`,{code:"COULD_NOT_FETCH",url:t.url,original:e})}}function pw(t,e,r,i){let s=us(b.default.join(t,"access.json"))||{};if(s[e.ref]=new Date().toISOString(),m.default.writeFileSync(b.default.join(t,"access.json"),JSON.stringify(s,null,"  ")),i[e.ref]===r)return;let n=i[e.ref];if(n){let o=!1;for(let a in i)if(i[a]===r){o=!0;break}if(!o)try{m.default.unlinkSync(b.default.join(t,`${n}.tar.gz`))}catch{}}i[e.ref]=r,m.default.writeFileSync(b.default.join(t,"map.json"),JSON.stringify(i,null,"  "))}gr.base=If;gr.createCommonjsModule=Re;gr.degit=Mf;gr.source=Ke;gr.tryRequire=us});var Nf=S((XS,Df)=>{"use strict";require("fs");require("path");var gw=kf();require("events");require("stream");require("string_decoder");require("assert");require("buffer");require("zlib");require("util");require("crypto");require("os");require("tty");require("constants");require("https");require("child_process");require("url");require("net");require("tls");Df.exports=gw.degit});var Aa=(t=0)=>e=>`\x1B[${e+t}m`,Ia=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Ma=(t=0)=>(e,r,i)=>`\x1B[${38+t};2;${e};${r};${i}m`,B={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},ww=Object.keys(B.modifier),zf=Object.keys(B.color),Hf=Object.keys(B.bgColor),Sw=[...zf,...Hf];function Yf(){let t=new Map;for(let[e,r]of Object.entries(B)){for(let[i,s]of Object.entries(r))B[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=B[i],t.set(s[0],s[1]);Object.defineProperty(B,e,{value:r,enumerable:!1})}return Object.defineProperty(B,"codes",{value:t,enumerable:!1}),B.color.close="\x1B[39m",B.bgColor.close="\x1B[49m",B.color.ansi=Aa(),B.color.ansi256=Ia(),B.color.ansi16m=Ma(),B.bgColor.ansi=Aa(10),B.bgColor.ansi256=Ia(10),B.bgColor.ansi16m=Ma(10),Object.defineProperties(B,{rgbToAnsi256:{value(e,r,i){return e===r&&r===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(n=>n+n).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>B.rgbToAnsi256(...B.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,i,s;if(e>=232)r=((e-232)*10+8)/255,i=r,s=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,i=Math.floor(a/6)/5,s=a%6/5}let n=Math.max(r,i,s)*2;if(n===0)return 30;let o=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(r));return n===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,i)=>B.ansi256ToAnsi(B.rgbToAnsi256(e,r,i)),enumerable:!1},hexToAnsi:{value:e=>B.ansi256ToAnsi(B.hexToAnsi256(e)),enumerable:!1}}),B}var Wf=Yf(),Se=Wf;var ni=yr(require("node:process"),1),Da=yr(require("node:os"),1),Es=yr(require("node:tty"),1);function de(t,e=globalThis.Deno?globalThis.Deno.args:ni.default.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),s=e.indexOf("--");return i!==-1&&(s===-1||i<s)}var{env:j}=ni.default,si;de("no-color")||de("no-colors")||de("color=false")||de("color=never")?si=0:(de("color")||de("colors")||de("color=true")||de("color=always"))&&(si=1);function Vf(){if("FORCE_COLOR"in j)return j.FORCE_COLOR==="true"?1:j.FORCE_COLOR==="false"?0:j.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(j.FORCE_COLOR,10),3)}function Zf(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Kf(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let i=Vf();i!==void 0&&(si=i);let s=r?si:i;if(s===0)return 0;if(r){if(de("color=16m")||de("color=full")||de("color=truecolor"))return 3;if(de("color=256"))return 2}if("TF_BUILD"in j&&"AGENT_NAME"in j)return 1;if(t&&!e&&s===void 0)return 0;let n=s||0;if(j.TERM==="dumb")return n;if(ni.default.platform==="win32"){let o=Da.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in j)return"GITHUB_ACTIONS"in j||"GITEA_ACTIONS"in j?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in j)||j.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in j)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(j.TEAMCITY_VERSION)?1:0;if(j.COLORTERM==="truecolor"||j.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in j){let o=Number.parseInt((j.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(j.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(j.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(j.TERM)||"COLORTERM"in j?1:n}function ka(t,e={}){let r=Kf(t,{streamIsTTY:t&&t.isTTY,...e});return Zf(r)}var Xf={stdout:ka({isTTY:Es.default.isatty(1)}),stderr:ka({isTTY:Es.default.isatty(2)})},Na=Xf;function Fa(t,e,r){let i=t.indexOf(e);if(i===-1)return t;let s=e.length,n=0,o="";do o+=t.slice(n,i)+e+r,n=i+s,i=t.indexOf(e,n);while(i!==-1);return o+=t.slice(n),o}function Pa(t,e,r,i){let s=0,n="";do{let o=t[i-1]==="\r";n+=t.slice(s,o?i-1:i)+e+(o?`\r
`:`
`)+r,s=i+1,i=t.indexOf(`
`,s)}while(i!==-1);return n+=t.slice(s),n}var{stdout:La,stderr:$a}=Na,_s=Symbol("GENERATOR"),$t=Symbol("STYLER"),vr=Symbol("IS_EMPTY"),Ba=["ansi","ansi","ansi256","ansi16m"],Bt=Object.create(null),Jf=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=La?La.level:0;t.level=e.level===void 0?r:e.level};var Qf=t=>{let e=(...r)=>r.join(" ");return Jf(e,t),Object.setPrototypeOf(e,br.prototype),e};function br(t){return Qf(t)}Object.setPrototypeOf(br.prototype,Function.prototype);for(let[t,e]of Object.entries(Se))Bt[t]={get(){let r=oi(this,Rs(e.open,e.close,this[$t]),this[vr]);return Object.defineProperty(this,t,{value:r}),r}};Bt.visible={get(){let t=oi(this,this[$t],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var Os=(t,e,r,...i)=>t==="rgb"?e==="ansi16m"?Se[r].ansi16m(...i):e==="ansi256"?Se[r].ansi256(Se.rgbToAnsi256(...i)):Se[r].ansi(Se.rgbToAnsi(...i)):t==="hex"?Os("rgb",e,r,...Se.hexToRgb(...i)):Se[r][t](...i),em=["rgb","hex","ansi256"];for(let t of em){Bt[t]={get(){let{level:r}=this;return function(...i){let s=Rs(Os(t,Ba[r],"color",...i),Se.color.close,this[$t]);return oi(this,s,this[vr])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);Bt[e]={get(){let{level:r}=this;return function(...i){let s=Rs(Os(t,Ba[r],"bgColor",...i),Se.bgColor.close,this[$t]);return oi(this,s,this[vr])}}}}var tm=Object.defineProperties(()=>{},{...Bt,level:{enumerable:!0,get(){return this[_s].level},set(t){this[_s].level=t}}}),Rs=(t,e,r)=>{let i,s;return r===void 0?(i=t,s=e):(i=r.openAll+t,s=e+r.closeAll),{open:t,close:e,openAll:i,closeAll:s,parent:r}},oi=(t,e,r)=>{let i=(...s)=>rm(i,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(i,tm),i[_s]=t,i[$t]=e,i[vr]=r,i},rm=(t,e)=>{if(t.level<=0||!e)return t[vr]?"":e;let r=t[$t];if(r===void 0)return e;let{openAll:i,closeAll:s}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=Fa(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
`);return n!==-1&&(e=Pa(e,s,i,n)),i+e+s};Object.defineProperties(br.prototype,Bt);var im=br(),xw=br({level:$a?$a.level:0});var Ce=im;var Ss=yr(pc(),1),Lf=yr(Nf(),1);var Ta={choice:[{title:Ce.cyanBright("Typescript"),description:"Whole project will run on typescript strict mode (Recommanded)",value:"ts"},{title:Ce.yellow("Javascript"),value:"js"}],hints:"- use an arrows to move and Space/Enter to select"},Ca={choice:[{title:Ce.yellow("Beginner"),description:"[ minimal configuration with vite \u{1F680} ]",value:"bas"},{title:Ce.cyanBright("Intermediate"),description:"[ simplistic configuration with mui & axios \u{1F680} ]",value:"int"},{title:Ce.blueBright("Advance"),description:"[ customized configuration with mui & axios, redux, rtk-query \u{1F680} ]",value:"adv"}],hints:"- use arrows to move and Space/Enter to select"},Ff={choice:[{title:Ce.yellow("tailwind"),value:"tailwind"},{title:Ce.cyanBright("material-ui"),value:"mui"}],hints:"- use arrows to move and Space/Enter to select"};var Pf=console.log;async function yw(){let t={lang:"js",level:"basic",framework:"mui"};Pf(Ce.cyanBright("> Welcome to Frontlook-React \u{1F680}")),Pf("@ Choose Your Preference:"),await(0,Ss.default)({type:"select",name:"lang",message:"Pick a Language",choices:Ta.choice,initial:1,hint:Ta.hints}).then(e=>{e.lang||process.exit(0),t.lang=e.lang}),await(0,Ss.default)({type:"select",name:"level",message:"Choose project level",choices:Ca.choice,initial:1,hint:Ca.hints}).then(e=>{e.level||process.exit(0),t.level=e.level,e.level==="bas"&&(0,Ss.default)({type:"select",name:"css",message:"Choose a css framework",choices:Ff.choice,initial:1}).then(r=>{r.css||process.exit(0),t.framework=r.css,vw(t,"fro")})})}yw();async function vw(t,e){if(t.lang==="js"&&t.framework==="tailwind")try{await(0,Lf.default)("https://github.com/Debangan202Ok/frontlook/packages/frontlook-react/templates/react-tailwind-js",{cache:!1,force:!0}).clone(e)}catch{console.error("Something went wrong! Please try again letter.")}}