vibe-tools
Version:
CLI tools for AI agents
34 lines (32 loc) • 3.2 MB
JavaScript
#!/usr/bin/env node
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
var FSe=Object.create;var tb=Object.defineProperty;var jSe=Object.getOwnPropertyDescriptor;var MSe=Object.getOwnPropertyNames;var zSe=Object.getPrototypeOf,LSe=Object.prototype.hasOwnProperty;var NY=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),FY=e=>{throw TypeError(e)};var a=(e,t)=>tb(e,"name",{value:t,configurable:!0}),$e=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var tt=(e,t)=>()=>(e&&(t=e(e=0)),t);var k=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),da=(e,t)=>{for(var r in t)tb(e,r,{get:t[r],enumerable:!0})},A3=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of MSe(t))!LSe.call(e,n)&&n!==r&&tb(e,n,{get:()=>t[n],enumerable:!(i=jSe(t,n))||i.enumerable});return e},sf=(e,t,r)=>(A3(e,t,"default"),r&&A3(r,t,"default")),od=(e,t,r)=>(r=e!=null?FSe(zSe(e)):{},A3(t||!e||!e.__esModule?tb(r,"default",{value:e,enumerable:!0}):r,e)),To=e=>A3(tb({},"__esModule",{value:!0}),e);var M1=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&FY("Object expected");var i,n;r&&(i=t[NY("asyncDispose")]),i===void 0&&(i=t[NY("dispose")],r&&(n=i)),typeof i!="function"&&FY("Object not disposable"),n&&(i=function(){try{n.call(this)}catch(o){return Promise.reject(o)}}),e.push([r,i,t])}else r&&e.push([r]);return t},z1=(e,t,r)=>{var i=typeof SuppressedError=="function"?SuppressedError:function(s,l,u,c){return c=Error(u),c.name="SuppressedError",c.error=s,c.suppressed=l,c},n=s=>t=r?new i(s,t,"An error was suppressed during disposal"):(r=!0,s),o=s=>{for(;s=e.pop();)try{var l=s[1]&&s[1].call(s[2]);if(s[0])return Promise.resolve(l).then(o,u=>(n(u),o()))}catch(u){n(u)}if(r)throw t};return o()};function R$(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function M$(e,t,r=".",i){if(!R$(t))return M$(e,{},r,i);let n=Object.assign({},t);for(let o in e){if(o==="__proto__"||o==="constructor")continue;let s=e[o];s!=null&&(i&&i(n,o,s,r)||(Array.isArray(s)&&Array.isArray(n[o])?n[o]=[...s,...n[o]]:R$(s)&&R$(n[o])?n[o]=M$(s,n[o],(r?`${r}.`:"")+o.toString(),i):n[o]=s))}return n}function V5e(e){return(...t)=>t.reduce((r,i)=>M$(r,i,"",e),{})}function H5e(e){return Object.prototype.toString.call(e)==="[object Object]"}function G5e(e){return!(!H5e(e)||!e.message&&!e.args||e.stack)}function F$(e,t={},r=3){return e===void 0?r:typeof e=="number"?e:t[e]&&t[e].level!==void 0?t[e].level:r}function TQ(e={}){return new Gi(e)}var lo,j$,Z5e,N$,kQ,Gi,z$=tt(()=>{lo={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},j$={silent:{level:-1},fatal:{level:lo.fatal},error:{level:lo.error},warn:{level:lo.warn},log:{level:lo.log},info:{level:lo.info},success:{level:lo.success},fail:{level:lo.fail},ready:{level:lo.info},start:{level:lo.info},box:{level:lo.info},debug:{level:lo.debug},trace:{level:lo.trace},verbose:{level:lo.verbose}};a(R$,"isPlainObject$1");a(M$,"_defu");a(V5e,"createDefu");Z5e=V5e();a(H5e,"isPlainObject");a(G5e,"isLogObj");N$=!1,kQ=[],Gi=class e{static{a(this,"Consola")}options;_lastLog;_mockFn;constructor(t={}){let r=t.types||j$;this.options=Z5e({...t,defaults:{...t.defaults},level:F$(t.level,r),reporters:[...t.reporters||[]]},{types:j$,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let i in r){let n={type:i,...this.options.defaults,...r[i]};this[i]=this._wrapLogFn(n),this[i].raw=this._wrapLogFn(n,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(t){this.options.level=F$(t,this.options.types,this.options.level)}prompt(t,r){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(t,r)}create(t){let r=new e({...this.options,...t});return this._mockFn&&r.mockTypes(this._mockFn),r}withDefaults(t){return this.create({...this.options,defaults:{...this.options.defaults,...t}})}withTag(t){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+t:t})}addReporter(t){return this.options.reporters.push(t),this}removeReporter(t){if(t){let r=this.options.reporters.indexOf(t);if(r!==-1)return this.options.reporters.splice(r,1)}else this.options.reporters.splice(0);return this}setReporters(t){return this.options.reporters=Array.isArray(t)?t:[t],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let t in this.options.types)console["__"+t]||(console["__"+t]=console[t]),console[t]=this[t].raw}restoreConsole(){for(let t in this.options.types)console["__"+t]&&(console[t]=console["__"+t],delete console["__"+t])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(t,r){t&&(t.__write||(t.__write=t.write),t.write=i=>{this[r].raw(String(i).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}pauseLogs(){N$=!0}resumeLogs(){N$=!1;let t=kQ.splice(0);for(let r of t)r[0]._logFn(r[1],r[2])}mockTypes(t){let r=t||this.options.mockFn;if(this._mockFn=r,typeof r=="function")for(let i in this.options.types)this[i]=r(i,this.options.types[i])||this[i],this[i].raw=this[i]}_wrapLogFn(t,r){return(...i)=>{if(N$){kQ.push([this,t,i,r]);return}return this._logFn(t,i,r)}}_logFn(t,r,i){if((t.level||0)>this.level)return!1;let n={date:new Date,args:[],...t,level:F$(t.level,this.options.types)};!i&&r.length===1&&G5e(r[0])?Object.assign(n,r[0]):n.args=[...r],n.message&&(n.args.unshift(n.message),delete n.message),n.additional&&(Array.isArray(n.additional)||(n.additional=n.additional.split(`
`)),n.args.push(`
`+n.additional.join(`
`)),delete n.additional),n.type=typeof n.type=="string"?n.type.toLowerCase():"log",n.tag=typeof n.tag=="string"?n.tag:"";let o=a((l=!1)=>{let u=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&u>0){let c=[...this._lastLog.object.args];u>1&&c.push(`(repeated ${u} times)`),this._log({...this._lastLog.object,args:c}),this._lastLog.count=1}l&&(this._lastLog.object=n,this._log(n))},"resolveLog");clearTimeout(this._lastLog.timeout);let s=this._lastLog.time&&n.date?n.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=n.date,s<this.options.throttle)try{let l=JSON.stringify([n.type,n.tag,n.args]),u=this._lastLog.serialized===l;if(this._lastLog.serialized=l,u&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(o,this.options.throttle);return}}catch{}o(!0)}_log(t){for(let r of this.options.reporters)r.log(t,{options:this.options})}};a(F$,"_normalizeLogLevel");Gi.prototype.add=Gi.prototype.addReporter;Gi.prototype.remove=Gi.prototype.removeReporter;Gi.prototype.clear=Gi.prototype.removeReporter;Gi.prototype.withScope=Gi.prototype.withTag;Gi.prototype.mock=Gi.prototype.mockTypes;Gi.prototype.pause=Gi.prototype.pauseLogs;Gi.prototype.resume=Gi.prototype.resumeLogs;a(TQ,"createConsola")});import{formatWithOptions as IQ}from"node:util";import{sep as W5e}from"node:path";function q$(e,t){let r=process.cwd()+W5e;return e.split(`
`).splice(t.split(`
`).length).map(n=>n.trim().replace("file://","").replace(r,""))}function J5e(e,t){return(t.__write||t.write).call(t,e)}var L$,Bb,$Q=tt(()=>{a(q$,"parseStack");a(J5e,"writeStream");L$=a(e=>e?`[${e}]`:"","bracket"),Bb=class{static{a(this,"BasicReporter")}formatStack(t,r,i){let n=" ".repeat((i?.errorLevel||0)+1);return n+q$(t,r).join(`
${n}`)}formatError(t,r){let i=t.message??IQ(r,t),n=t.stack?this.formatStack(t.stack,i,r):"",o=r?.errorLevel||0,s=o>0?`${" ".repeat(o)}[cause]: `:"",l=t.cause?`
`+this.formatError(t.cause,{...r,errorLevel:o+1}):"";return s+i+`
`+n+l}formatArgs(t,r){let i=t.map(n=>n&&typeof n.stack=="string"?this.formatError(n,r):n);return IQ(r,...i)}formatDate(t,r){return r.date?t.toLocaleTimeString():""}filterAndJoin(t){return t.filter(Boolean).join(" ")}formatLogObj(t,r){let i=this.formatArgs(t.args,r);return t.type==="box"?`
`+[L$(t.tag),t.title&&t.title,...i.split(`
`)].filter(Boolean).map(n=>" > "+n).join(`
`)+`
`:this.filterAndJoin([L$(t.type),L$(t.tag),i])}log(t,r){let i=this.formatLogObj(t,{columns:r.options.stdout.columns||0,...r.options.formatOptions});return J5e(i+`
`,t.level<2?r.options.stderr||process.stderr:r.options.stdout||process.stdout)}}});import*as z9 from"node:tty";function FQ(e,t,r,i,n=t.slice(0,Math.max(0,e))+i,o=t.slice(Math.max(0,e+r.length)),s=o.indexOf(r)){return n+(s<0?o:FQ(s,o,r,i))}function nxe(e,t,r,i,n){return e<0?r+t+i:r+FQ(e,t,i,n)+i}function ixe(e,t,r=e,i=e.length+1){return n=>n||!(n===""||n===void 0)?nxe((""+n).indexOf(t,i),n,e,t,r):""}function mr(e,t,r){return ixe(`\x1B[${e}m`,`\x1B[${t}m`,r)}function oxe(e=rxe){return e?AQ:Object.fromEntries(Object.keys(AQ).map(t=>[t,String]))}function jQ(e,t="reset"){return se[e]||se[t]}function bd(e){return e.replace(new RegExp(axe,"g"),"")}function U$(e,t={}){let r={...t,style:{...sxe,...t.style}},i=e.split(`
`),n=[],o=jQ(r.style.borderColor),s={...typeof r.style.borderStyle=="string"?OQ[r.style.borderStyle]||OQ.solid:r.style.borderStyle};if(o)for(let f in s)s[f]=o(s[f]);let l=r.style.padding%2===0?r.style.padding:r.style.padding+1,u=i.length+l,c=Math.max(...i.map(f=>bd(f).length),r.title?bd(r.title).length:0)+l,p=c+l,d=r.style.marginLeft>0?" ".repeat(r.style.marginLeft):"";if(r.style.marginTop>0&&n.push("".repeat(r.style.marginTop)),r.title){let f=o?o(r.title):r.title,h=s.h.repeat(Math.floor((c-bd(r.title).length)/2)),g=s.h.repeat(c-bd(r.title).length-bd(h).length+l);n.push(`${d}${s.tl}${h}${f}${g}${s.tr}`)}else n.push(`${d}${s.tl}${s.h.repeat(p)}${s.tr}`);let m=r.style.valign==="center"?Math.floor((u-i.length)/2):r.style.valign==="top"?u-i.length-l:u-i.length;for(let f=0;f<u;f++)if(f<m||f>=m+i.length)n.push(`${d}${s.v}${" ".repeat(p)}${s.v}`);else{let h=i[f-m],g=" ".repeat(l),y=" ".repeat(c-bd(h).length);n.push(`${d}${s.v}${g}${h}${y}${s.v}`)}return n.push(`${d}${s.bl}${s.h.repeat(p)}${s.br}`),r.style.marginBottom>0&&n.push("".repeat(r.style.marginBottom)),n.join(`
`)}var Tf,RQ,K5e,Y5e,X5e,Q5e,NQ,exe,txe,rxe,AQ,se,axe,OQ,sxe,L9=tt(()=>{({env:Tf={},argv:RQ=[],platform:K5e=""}=typeof process>"u"?{}:process),Y5e="NO_COLOR"in Tf||RQ.includes("--no-color"),X5e="FORCE_COLOR"in Tf||RQ.includes("--color"),Q5e=K5e==="win32",NQ=Tf.TERM==="dumb",exe=z9&&z9.isatty&&z9.isatty(1)&&Tf.TERM&&!NQ,txe="CI"in Tf&&("GITHUB_ACTIONS"in Tf||"GITLAB_CI"in Tf||"CIRCLECI"in Tf),rxe=!Y5e&&(X5e||Q5e&&!NQ||exe||txe);a(FQ,"replaceClose");a(nxe,"clearBleed");a(ixe,"filterEmpty");a(mr,"init");AQ={reset:mr(0,0),bold:mr(1,22,"\x1B[22m\x1B[1m"),dim:mr(2,22,"\x1B[22m\x1B[2m"),italic:mr(3,23),underline:mr(4,24),inverse:mr(7,27),hidden:mr(8,28),strikethrough:mr(9,29),black:mr(30,39),red:mr(31,39),green:mr(32,39),yellow:mr(33,39),blue:mr(34,39),magenta:mr(35,39),cyan:mr(36,39),white:mr(37,39),gray:mr(90,39),bgBlack:mr(40,49),bgRed:mr(41,49),bgGreen:mr(42,49),bgYellow:mr(43,49),bgBlue:mr(44,49),bgMagenta:mr(45,49),bgCyan:mr(46,49),bgWhite:mr(47,49),blackBright:mr(90,39),redBright:mr(91,39),greenBright:mr(92,39),yellowBright:mr(93,39),blueBright:mr(94,39),magentaBright:mr(95,39),cyanBright:mr(96,39),whiteBright:mr(97,39),bgBlackBright:mr(100,49),bgRedBright:mr(101,49),bgGreenBright:mr(102,49),bgYellowBright:mr(103,49),bgBlueBright:mr(104,49),bgMagentaBright:mr(105,49),bgCyanBright:mr(106,49),bgWhiteBright:mr(107,49)};a(oxe,"createColors");se=oxe();a(jQ,"getColor");axe=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");a(bd,"stripAnsi");OQ={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},sxe={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};a(U$,"box")});var oee={};da(oee,{kCancel:()=>nee,prompt:()=>iee});import"node:util";import Ll,{stdin as lxe,stdout as uxe}from"node:process";import MQ from"node:readline";import{WriteStream as cxe}from"node:tty";function dxe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function pxe(){if(zQ)return B$;zQ=1;let e="\x1B",t=`${e}[`,r="\x07",i={to(s,l){return l?`${t}${l+1};${s+1}H`:`${t}${s+1}G`},move(s,l){let u="";return s<0?u+=`${t}${-s}D`:s>0&&(u+=`${t}${s}C`),l<0?u+=`${t}${-l}A`:l>0&&(u+=`${t}${l}B`),u},up:a((s=1)=>`${t}${s}A`,"up"),down:a((s=1)=>`${t}${s}B`,"down"),forward:a((s=1)=>`${t}${s}C`,"forward"),backward:a((s=1)=>`${t}${s}D`,"backward"),nextLine:a((s=1)=>`${t}E`.repeat(s),"nextLine"),prevLine:a((s=1)=>`${t}F`.repeat(s),"prevLine"),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${e}7`,restore:`${e}8`},n={up:a((s=1)=>`${t}S`.repeat(s),"up"),down:a((s=1)=>`${t}T`.repeat(s),"down")},o={screen:`${t}2J`,up:a((s=1)=>`${t}1J`.repeat(s),"up"),down:a((s=1)=>`${t}J`.repeat(s),"down"),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(s){let l="";for(let u=0;u<s;u++)l+=this.line+(u<s-1?i.up():"");return s&&(l+=i.left),l}};return B$={cursor:i,scroll:n,erase:o,beep:r},B$}function fxe(){if(LQ)return q9.exports;LQ=1;let e=process||{},t=e.argv||[],r=e.env||{},i=!(r.NO_COLOR||t.includes("--no-color"))&&(!!r.FORCE_COLOR||t.includes("--color")||e.platform==="win32"||(e.stdout||{}).isTTY&&r.TERM!=="dumb"||!!r.CI),n=a((l,u,c=l)=>p=>{let d=""+p,m=d.indexOf(u,l.length);return~m?l+o(d,u,c,m)+u:l+d+u},"formatter"),o=a((l,u,c,p)=>{let d="",m=0;do d+=l.substring(m,p)+c,m=p+u.length,p=l.indexOf(u,m);while(~p);return d+l.substring(m)},"replaceClose"),s=a((l=i)=>{let u=l?n:()=>String;return{isColorSupported:l,reset:u("\x1B[0m","\x1B[0m"),bold:u("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:u("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:u("\x1B[3m","\x1B[23m"),underline:u("\x1B[4m","\x1B[24m"),inverse:u("\x1B[7m","\x1B[27m"),hidden:u("\x1B[8m","\x1B[28m"),strikethrough:u("\x1B[9m","\x1B[29m"),black:u("\x1B[30m","\x1B[39m"),red:u("\x1B[31m","\x1B[39m"),green:u("\x1B[32m","\x1B[39m"),yellow:u("\x1B[33m","\x1B[39m"),blue:u("\x1B[34m","\x1B[39m"),magenta:u("\x1B[35m","\x1B[39m"),cyan:u("\x1B[36m","\x1B[39m"),white:u("\x1B[37m","\x1B[39m"),gray:u("\x1B[90m","\x1B[39m"),bgBlack:u("\x1B[40m","\x1B[49m"),bgRed:u("\x1B[41m","\x1B[49m"),bgGreen:u("\x1B[42m","\x1B[49m"),bgYellow:u("\x1B[43m","\x1B[49m"),bgBlue:u("\x1B[44m","\x1B[49m"),bgMagenta:u("\x1B[45m","\x1B[49m"),bgCyan:u("\x1B[46m","\x1B[49m"),bgWhite:u("\x1B[47m","\x1B[49m"),blackBright:u("\x1B[90m","\x1B[39m"),redBright:u("\x1B[91m","\x1B[39m"),greenBright:u("\x1B[92m","\x1B[39m"),yellowBright:u("\x1B[93m","\x1B[39m"),blueBright:u("\x1B[94m","\x1B[39m"),magentaBright:u("\x1B[95m","\x1B[39m"),cyanBright:u("\x1B[96m","\x1B[39m"),whiteBright:u("\x1B[97m","\x1B[39m"),bgBlackBright:u("\x1B[100m","\x1B[49m"),bgRedBright:u("\x1B[101m","\x1B[49m"),bgGreenBright:u("\x1B[102m","\x1B[49m"),bgYellowBright:u("\x1B[103m","\x1B[49m"),bgBlueBright:u("\x1B[104m","\x1B[49m"),bgMagentaBright:u("\x1B[105m","\x1B[49m"),bgCyanBright:u("\x1B[106m","\x1B[49m"),bgWhiteBright:u("\x1B[107m","\x1B[49m")}},"createColors");return q9.exports=s(),q9.exports.createColors=s,q9.exports}function hxe({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}function YQ(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(gxe,"")}function XQ(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vb(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=YQ(e),e.length===0))return 0;e=e.replace(bxe()," ");let r=t.ambiguousIsNarrow?1:2,i=0;for(let n of e){let o=n.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(vxe.eastAsianWidth(n)){case"F":case"W":i+=2;break;case"A":i+=r;break;default:i+=1}}return i}function xxe(){let e=new Map;for(let[t,r]of Object.entries(On)){for(let[i,n]of Object.entries(r))On[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[i]=On[i],e.set(n[0],n[1]);Object.defineProperty(On,t,{value:r,enumerable:!1})}return Object.defineProperty(On,"codes",{value:e,enumerable:!1}),On.color.close="\x1B[39m",On.bgColor.close="\x1B[49m",On.color.ansi=qQ(),On.color.ansi256=UQ(),On.color.ansi16m=BQ(),On.bgColor.ansi=qQ(V$),On.bgColor.ansi256=UQ(V$),On.bgColor.ansi16m=BQ(V$),Object.defineProperties(On,{rgbToAnsi256:{value:a((t,r,i)=>t===r&&r===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5),"value"),enumerable:!1},hexToRgb:{value:a(t=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(o=>o+o).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},"value"),enumerable:!1},hexToAnsi256:{value:a(t=>On.rgbToAnsi256(...On.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value:a(t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,i,n;if(t>=232)r=((t-232)*10+8)/255,i=r,n=r;else{t-=16;let l=t%36;r=Math.floor(t/36)/5,i=Math.floor(l/6)/5,n=l%6/5}let o=Math.max(r,i,n)*2;if(o===0)return 30;let s=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(r));return o===2&&(s+=60),s},"value"),enumerable:!1},rgbToAnsi:{value:a((t,r,i)=>On.ansi256ToAnsi(On.rgbToAnsi256(t,r,i)),"value"),enumerable:!1},hexToAnsi:{value:a(t=>On.ansi256ToAnsi(On.hexToAnsi256(t)),"value"),enumerable:!1}}),On}function HQ(e,t,r){return String(e).normalize().replace(/\r\n/g,`
`).split(`
`).map(i=>Txe(i,t,r)).join(`
`)}function ree(e,t){if(typeof e=="string")return B9.aliases.get(e)===t;for(let r of e)if(r!==void 0&&ree(r,t))return!0;return!1}function $xe(e,t){if(e===t)return;let r=e.split(`
`),i=t.split(`
`),n=[];for(let o=0;o<Math.max(r.length,i.length);o++)r[o]!==i[o]&&n.push(o);return n}function U9(e,t){let r=e;r.isTTY&&r.setRawMode(t)}function zxe(){return Ll.platform!=="win32"?Ll.env.TERM!=="linux":!!Ll.env.CI||!!Ll.env.WT_SESSION||!!Ll.env.TERMINUS_SUBLIME||Ll.env.ConEmuTask==="{cmd::Cmder}"||Ll.env.TERM_PROGRAM==="Terminus-Sublime"||Ll.env.TERM_PROGRAM==="vscode"||Ll.env.TERM==="xterm-256color"||Ll.env.TERM==="alacritty"||Ll.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}async function iee(e,t={}){let r=a(i=>{if(typeof i!="symbol"||i.toString()!=="Symbol(clack:cancel)")return i;switch(t.cancel){case"reject":{let n=new Error("Prompt cancelled.");throw n.name="ConsolaPromptCancelledError",Error.captureStackTrace&&Error.captureStackTrace(n,iee),n}case"undefined":return;case"null":return null;case"symbol":return nee;default:case"default":return t.default??t.initial}},"handleCancel");if(!t.type||t.type==="text")return await Gxe({message:e,defaultValue:t.default,placeholder:t.placeholder,initialValue:t.initial}).then(r);if(t.type==="confirm")return await Wxe({message:e,initialValue:t.initial}).then(r);if(t.type==="select")return await Jxe({message:e,options:t.options.map(i=>typeof i=="string"?{value:i,label:i}:i),initialValue:t.initial}).then(r);if(t.type==="multiselect")return await Kxe({message:e,options:t.options.map(i=>typeof i=="string"?{value:i,label:i}:i),required:t.required,initialValues:t.initial}).then(r);throw new Error(`Unknown prompt type: ${t.type}`)}var B$,zQ,ql,q9,LQ,mxe,Re,gxe,QQ,yxe,vxe,_xe,bxe,V$,qQ,UQ,BQ,On,wxe,Sxe,Dxe,V9,Exe,X$,eee,Pxe,tee,Q$,VQ,ZQ,Cxe,Z$,kxe,Txe,Ixe,B9,GQ,Axe,Oxe,es,Hy,H$,Rxe,Nxe,WQ,Fxe,jxe,Mxe,JQ,G$,W$,Lxe,Ul,qxe,Uxe,Bxe,Vxe,xn,Gy,J$,K$,Zxe,KQ,Hxe,Z9,Y$,Gxe,Wxe,Jxe,Kxe,nee,aee=tt(()=>{a(dxe,"getDefaultExportFromCjs");a(pxe,"requireSrc");ql=pxe(),q9={exports:{}};a(fxe,"requirePicocolors");mxe=fxe(),Re=dxe(mxe);a(hxe,"J");gxe=hxe();a(YQ,"T$1");a(XQ,"O");QQ={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(i){var n=i.charCodeAt(0),o=i.length==2?i.charCodeAt(1):0,s=n;return 55296<=n&&n<=56319&&56320<=o&&o<=57343&&(n&=1023,o&=1023,s=n<<10|o,s+=65536),s==12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s==8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s==172||s==175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s==161||s==164||167<=s&&s<=168||s==170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s==198||s==208||215<=s&&s<=216||222<=s&&s<=225||s==230||232<=s&&s<=234||236<=s&&s<=237||s==240||242<=s&&s<=243||247<=s&&s<=250||s==252||s==254||s==257||s==273||s==275||s==283||294<=s&&s<=295||s==299||305<=s&&s<=307||s==312||319<=s&&s<=322||s==324||328<=s&&s<=331||s==333||338<=s&&s<=339||358<=s&&s<=359||s==363||s==462||s==464||s==466||s==468||s==470||s==472||s==474||s==476||s==593||s==609||s==708||s==711||713<=s&&s<=715||s==717||s==720||728<=s&&s<=731||s==733||s==735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s==1025||1040<=s&&s<=1103||s==1105||s==8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s==8240||8242<=s&&s<=8243||s==8245||s==8251||s==8254||s==8308||s==8319||8321<=s&&s<=8324||s==8364||s==8451||s==8453||s==8457||s==8467||s==8470||8481<=s&&s<=8482||s==8486||s==8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s==8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s==8658||s==8660||s==8679||s==8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s==8715||s==8719||s==8721||s==8725||s==8730||8733<=s&&s<=8736||s==8739||s==8741||8743<=s&&s<=8748||s==8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s==8776||s==8780||s==8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s==8853||s==8857||s==8869||s==8895||s==8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s==9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s==9711||9733<=s&&s<=9734||s==9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s==9756||s==9758||s==9792||s==9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s==9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s==9955||9960<=s&&s<=9983||s==10045||s==10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s==65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},t.characterLength=function(i){var n=this.eastAsianWidth(i);return n=="F"||n=="W"||n=="A"?2:1};function r(i){return i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}a(r,"F"),t.length=function(i){for(var n=r(i),o=0,s=0;s<n.length;s++)o=o+this.characterLength(n[s]);return o},t.slice=function(i,n,o){textLen=t.length(i),n=n||0,o=o||1,n<0&&(n=textLen+n),o<0&&(o=textLen+o);for(var s="",l=0,u=r(i),c=0;c<u.length;c++){var p=u[c],d=t.length(p);if(l>=n-(d==2?1:0))if(l+d<=o)s+=p;else break;l+=d}return s}})(QQ);yxe=QQ.exports,vxe=XQ(yxe),_xe=a(function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},"uD"),bxe=XQ(_xe);a(Vb,"A$1");V$=10,qQ=a((e=0)=>t=>`\x1B[${t+e}m`,"L$1"),UQ=a((e=0)=>t=>`\x1B[${38+e};5;${t}m`,"N"),BQ=a((e=0)=>(t,r,i)=>`\x1B[${38+e};2;${t};${r};${i}m`,"I"),On={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]}};Object.keys(On.modifier);wxe=Object.keys(On.color),Sxe=Object.keys(On.bgColor);[...wxe,...Sxe];a(xxe,"sD");Dxe=xxe(),V9=new Set(["\x1B","\x9B"]),Exe=39,X$="\x07",eee="[",Pxe="]",tee="m",Q$=`${Pxe}8;;`,VQ=a(e=>`${V9.values().next().value}${eee}${e}${tee}`,"V$1"),ZQ=a(e=>`${V9.values().next().value}${Q$}${e}${X$}`,"z"),Cxe=a(e=>e.split(" ").map(t=>Vb(t)),"ED"),Z$=a((e,t,r)=>{let i=[...t],n=!1,o=!1,s=Vb(YQ(e[e.length-1]));for(let[l,u]of i.entries()){let c=Vb(u);if(s+c<=r?e[e.length-1]+=u:(e.push(u),s=0),V9.has(u)&&(n=!0,o=i.slice(l+1).join("").startsWith(Q$)),n){o?u===X$&&(n=!1,o=!1):u===tee&&(n=!1);continue}s+=c,s===r&&l<i.length-1&&(e.push(""),s=0)}!s&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},"_"),kxe=a(e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(Vb(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"nD"),Txe=a((e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let i="",n,o,s=Cxe(e),l=[""];for(let[c,p]of e.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l[l.length-1].trimStart());let d=Vb(l[l.length-1]);if(c!==0&&(d>=t&&(r.wordWrap===!1||r.trim===!1)&&(l.push(""),d=0),(d>0||r.trim===!1)&&(l[l.length-1]+=" ",d++)),r.hard&&s[c]>t){let m=t-d,f=1+Math.floor((s[c]-m-1)/t);Math.floor((s[c]-1)/t)<f&&l.push(""),Z$(l,p,t);continue}if(d+s[c]>t&&d>0&&s[c]>0){if(r.wordWrap===!1&&d<t){Z$(l,p,t);continue}l.push("")}if(d+s[c]>t&&r.wordWrap===!1){Z$(l,p,t);continue}l[l.length-1]+=p}r.trim!==!1&&(l=l.map(c=>kxe(c)));let u=[...l.join(`
`)];for(let[c,p]of u.entries()){if(i+=p,V9.has(p)){let{groups:m}=new RegExp(`(?:\\${eee}(?<code>\\d+)m|\\${Q$}(?<uri>.*)${X$})`).exec(u.slice(c).join(""))||{groups:{}};if(m.code!==void 0){let f=Number.parseFloat(m.code);n=f===Exe?void 0:f}else m.uri!==void 0&&(o=m.uri.length===0?void 0:m.uri)}let d=Dxe.codes.get(Number(n));u[c+1]===`
`?(o&&(i+=ZQ("")),n&&d&&(i+=VQ(d))):p===`
`&&(n&&d&&(i+=VQ(n)),o&&(i+=ZQ(o)))}return i},"oD");a(HQ,"G");Ixe=["up","down","left","right","space","enter","cancel"],B9={actions:new Set(Ixe),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};a(ree,"k$1");a($xe,"lD");globalThis.process.platform.startsWith("win");GQ=Symbol("clack:cancel");a(U9,"d$1");Axe=Object.defineProperty,Oxe=a((e,t,r)=>t in e?Axe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"pD"),es=a((e,t,r)=>(Oxe(e,typeof t!="symbol"?t+"":t,r),r),"h"),Hy=class{static{a(this,"x")}constructor(t,r=!0){es(this,"input"),es(this,"output"),es(this,"_abortSignal"),es(this,"rl"),es(this,"opts"),es(this,"_render"),es(this,"_track",!1),es(this,"_prevFrame",""),es(this,"_subscribers",new Map),es(this,"_cursor",0),es(this,"state","initial"),es(this,"error",""),es(this,"value");let{input:i=lxe,output:n=uxe,render:o,signal:s,...l}=t;this.opts=l,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=r,this._abortSignal=s,this.input=i,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(t,r){let i=this._subscribers.get(t)??[];i.push(r),this._subscribers.set(t,i)}on(t,r){this.setSubscriber(t,{cb:r})}once(t,r){this.setSubscriber(t,{cb:r,once:!0})}emit(t,...r){let i=this._subscribers.get(t)??[],n=[];for(let o of i)o.cb(...r),o.once&&n.push(()=>i.splice(i.indexOf(o),1));for(let o of n)o()}prompt(){return new Promise((t,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(GQ);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let i=new cxe(0);i._write=(n,o,s)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),s()},this.input.pipe(i),this.rl=MQ.createInterface({input:this.input,output:i,tabSize:2,prompt:"",escapeCodeTimeout:50}),MQ.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),U9(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(ql.cursor.show),this.output.off("resize",this.render),U9(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(ql.cursor.show),this.output.off("resize",this.render),U9(this.input,!1),t(GQ)})})}onKeypress(t,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&B9.aliases.has(r.name)&&this.emit("cursor",B9.aliases.get(r.name)),B9.actions.has(r.name)&&this.emit("cursor",r.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),r?.name==="return"){if(this.opts.validate){let i=this.opts.validate(this.value);i&&(this.error=i instanceof Error?i.message:i,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}ree([t,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
`),U9(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=HQ(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
`).length-1;this.output.write(ql.cursor.move(-999,t*-1))}render(){let t=HQ(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(ql.cursor.hide);else{let r=$xe(this._prevFrame,t);if(this.restoreCursor(),r&&r?.length===1){let i=r[0];this.output.write(ql.cursor.move(0,i)),this.output.write(ql.erase.lines(1));let n=t.split(`
`);this.output.write(n[i]),this._prevFrame=t,this.output.write(ql.cursor.move(0,n.length-i-1));return}if(r&&r?.length>1){let i=r[0];this.output.write(ql.cursor.move(0,i)),this.output.write(ql.erase.down());let n=t.split(`
`).slice(i);this.output.write(n.join(`
`)),this._prevFrame=t;return}this.output.write(ql.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}},H$=class extends Hy{static{a(this,"fD")}get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(ql.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},Rxe=Object.defineProperty,Nxe=a((e,t,r)=>t in e?Rxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"mD"),WQ=a((e,t,r)=>(Nxe(e,typeof t!="symbol"?t+"":t,r),r),"Y"),Fxe=class extends Hy{static{a(this,"wD")}constructor(e){super(e,!1),WQ(this,"options"),WQ(this,"cursor",0),this.options=e.options,this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),0),this.on("key",t=>{t==="a"&&this.toggleAll()}),this.on("cursor",t=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let e=this.value.length===this.options.length;this.value=e?[]:this.options.map(t=>t.value)}toggleValue(){let e=this.value.includes(this._value);this.value=e?this.value.filter(t=>t!==this._value):[...this.value,this._value]}},jxe=Object.defineProperty,Mxe=a((e,t,r)=>t in e?jxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"$D"),JQ=a((e,t,r)=>(Mxe(e,typeof t!="symbol"?t+"":t,r),r),"q"),G$=class extends Hy{static{a(this,"jD")}constructor(t){super(t,!1),JQ(this,"options"),JQ(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:r})=>r===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1