vite-plugin-local
Version:
A Vite plugin to enable a development environment for minimalists.
58 lines • 482 kB
JavaScript
var Jn=Object.create;var{getPrototypeOf:es,defineProperty:fu,getOwnPropertyNames:ts}=Object;var rs=Object.prototype.hasOwnProperty;var us=(t,n,u)=>{u=t!=null?Jn(es(t)):{};let r=n||!t||!t.__esModule?fu(u,"default",{value:t,enumerable:!0}):u;for(let i of ts(t))if(!rs.call(r,i))fu(r,i,{get:()=>t[i],enumerable:!0});return r};var is=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports);var di=(t,n)=>{for(var u in n)fu(t,u,{get:n[u],enumerable:!0,configurable:!0,set:(r)=>n[u]=()=>r})};var kr=(t,n)=>()=>(t&&(n=t(t=0)),n);import{createRequire as as}from"node:module";var ns,ss,gi,os,Ds,hu=(t,n,u)=>{u=t!=null?ns(ss(t)):{};let r=n||!t||!t.__esModule?gi(u,"default",{value:t,enumerable:!0}):u;for(let i of os(t))if(!Ds.call(r,i))gi(r,i,{get:()=>t[i],enumerable:!0});return r},Ei=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),yi;var ar=kr(()=>{ns=Object.create,{getPrototypeOf:ss,defineProperty:gi,getOwnPropertyNames:os}=Object,Ds=Object.prototype.hasOwnProperty,yi=as(import.meta.url)});var Oi={};di(Oi,{prompt:()=>Hs});import{stdin as ls,stdout as cs}from"node:process";import Fi from"node:readline";import{WriteStream as fs}from"node:tty";import hs from"tty";function Fs({onlyFirst:t=!1}={}){let n=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(n,t?void 0:"g")}function _i(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Fs(),"")}function dr(t,n={}){if(typeof t!="string"||t.length===0||(n={ambiguousIsNarrow:!0,...n},t=_i(t),t.length===0))return 0;t=t.replace(Bs()," ");let u=n.ambiguousIsNarrow?1:2,r=0;for(let i of t){let c=i.codePointAt(0);if(c<=31||c>=127&&c<=159||c>=768&&c<=879)continue;switch(vs.eastAsianWidth(i)){case"F":case"W":r+=2;break;case"A":r+=u;break;default:r+=1}}return r}function Ss(){let t=new Map;for(let[n,u]of Object.entries(Ie)){for(let[r,i]of Object.entries(u))Ie[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},u[r]=Ie[r],t.set(i[0],i[1]);Object.defineProperty(Ie,n,{value:u,enumerable:!1})}return Object.defineProperty(Ie,"codes",{value:t,enumerable:!1}),Ie.color.close="\x1B[39m",Ie.bgColor.close="\x1B[49m",Ie.color.ansi=mi(),Ie.color.ansi256=vi(),Ie.color.ansi16m=Bi(),Ie.bgColor.ansi=mi(Cu),Ie.bgColor.ansi256=vi(Cu),Ie.bgColor.ansi16m=Bi(Cu),Object.defineProperties(Ie,{rgbToAnsi256:{value:(n,u,r)=>n===u&&u===r?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(u/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:(n)=>{let u=/[a-f\d]{6}|[a-f\d]{3}/i.exec(n.toString(16));if(!u)return[0,0,0];let[r]=u;r.length===3&&(r=[...r].map((c)=>c+c).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:(n)=>Ie.rgbToAnsi256(...Ie.hexToRgb(n)),enumerable:!1},ansi256ToAnsi:{value:(n)=>{if(n<8)return 30+n;if(n<16)return 90+(n-8);let u,r,i;if(n>=232)u=((n-232)*10+8)/255,r=u,i=u;else{n-=16;let h=n%36;u=Math.floor(n/36)/5,r=Math.floor(h/6)/5,i=h%6/5}let c=Math.max(u,r,i)*2;if(c===0)return 30;let e=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(u));return c===2&&(e+=60),e},enumerable:!1},rgbToAnsi:{value:(n,u,r)=>Ie.ansi256ToAnsi(Ie.rgbToAnsi256(n,u,r)),enumerable:!1},hexToAnsi:{value:(n)=>Ie.ansi256ToAnsi(Ie.hexToAnsi256(n)),enumerable:!1}}),Ie}function bi(t,n,u){return String(t).normalize().replace(/\r\n/g,`
`).split(`
`).map((r)=>_s(r,n,u)).join(`
`)}function ks(t,n){if(t===n)return;let u=t.split(`
`),r=n.split(`
`),i=[];for(let c=0;c<Math.max(u.length,r.length);c++)u[c]!==r[c]&&i.push(c);return i}function Rr(t,n){t.isTTY&&t.setRawMode(n)}class gr{constructor({render:t,input:n=ls,output:u=cs,...r},i=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=t.bind(this),this._track=i,this.input=n,this.output=u}prompt(){let t=new fs(0);return t._write=(n,u,r)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),r()},this.input.pipe(t),this.rl=Fi.createInterface({input:this.input,output:t,tabSize:2,prompt:"",escapeCodeTimeout:50}),Fi.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),Rr(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((n,u)=>{this.once("submit",()=>{this.output.write(St.cursor.show),this.output.off("resize",this.render),Rr(this.input,!1),n(this.value)}),this.once("cancel",()=>{this.output.write(St.cursor.show),this.output.off("resize",this.render),Rr(this.input,!1),n(Rs)})})}on(t,n){let u=this.subscribers.get(t)??[];u.push({cb:n}),this.subscribers.set(t,u)}once(t,n){let u=this.subscribers.get(t)??[];u.push({cb:n,once:!0}),this.subscribers.set(t,u)}emit(t,...n){let u=this.subscribers.get(t)??[],r=[];for(let i of u)i.cb(...n),i.once&&r.push(()=>u.splice(u.indexOf(i),1));for(let i of r)i()}unsubscribe(){this.subscribers.clear()}onKeypress(t,n){if(this.state==="error"&&(this.state="active"),n?.name&&!this._track&&Ti.has(n.name)&&this.emit("cursor",Ti.get(n.name)),n?.name&&Ls.has(n.name)&&this.emit("cursor",n.name),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t&&this.emit("key",t.toLowerCase()),n?.name==="return"){if(this.opts.validate){let u=this.opts.validate(this.value);u&&(this.error=u,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}t==="\x03"&&(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(`
`),Rr(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=bi(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
`).length-1;this.output.write(St.cursor.move(-999,t*-1))}render(){let t=bi(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(St.cursor.hide);else{let n=ks(this._prevFrame,t);if(this.restoreCursor(),n&&n?.length===1){let u=n[0];this.output.write(St.cursor.move(0,u)),this.output.write(St.erase.lines(1));let r=t.split(`
`);this.output.write(r[u]),this._prevFrame=t,this.output.write(St.cursor.move(0,r.length-u-1));return}else if(n&&n?.length>1){let u=n[0];this.output.write(St.cursor.move(0,u)),this.output.write(St.erase.down());let r=t.split(`
`).slice(u);this.output.write(r.join(`
`)),this._prevFrame=t;return}this.output.write(St.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}}async function Hs(t,n={}){if(!n.type||n.type==="text")return await Ks({message:t,defaultValue:n.default,placeholder:n.placeholder,initialValue:n.initial});if(n.type==="confirm")return await js({message:t,initialValue:n.initial});if(n.type==="select")return await Gs({message:t,options:n.options.map((u)=>typeof u==="string"?{value:u,label:u}:u)});if(n.type==="multiselect")return await qs({message:t,options:n.options.map((u)=>typeof u==="string"?{value:u,label:u}:u),required:n.required});throw new Error(`Unknown prompt type: ${n.type}`)}var gu="\x1B",ke,ps="\x07",Eu,Cs,ds,St,vu,gs,Es,Te=(t,n,u=t)=>(r)=>{let i=""+r,c=i.indexOf(n,t.length);return~c?t+wi(i,n,u,c)+n:t+i+n},wi=(t,n,u,r)=>{let i=t.substring(0,r)+u,c=t.substring(r+n.length),e=c.indexOf(n);return~e?i+wi(c,n,u,e):i+c},Ni=(t=Es)=>({isColorSupported:t,reset:t?(n)=>`\x1B[0m${n}\x1B[0m`:String,bold:t?Te("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:t?Te("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:t?Te("\x1B[3m","\x1B[23m"):String,underline:t?Te("\x1B[4m","\x1B[24m"):String,inverse:t?Te("\x1B[7m","\x1B[27m"):String,hidden:t?Te("\x1B[8m","\x1B[28m"):String,strikethrough:t?Te("\x1B[9m","\x1B[29m"):String,black:t?Te("\x1B[30m","\x1B[39m"):String,red:t?Te("\x1B[31m","\x1B[39m"):String,green:t?Te("\x1B[32m","\x1B[39m"):String,yellow:t?Te("\x1B[33m","\x1B[39m"):String,blue:t?Te("\x1B[34m","\x1B[39m"):String,magenta:t?Te("\x1B[35m","\x1B[39m"):String,cyan:t?Te("\x1B[36m","\x1B[39m"):String,white:t?Te("\x1B[37m","\x1B[39m"):String,gray:t?Te("\x1B[90m","\x1B[39m"):String,bgBlack:t?Te("\x1B[40m","\x1B[49m"):String,bgRed:t?Te("\x1B[41m","\x1B[49m"):String,bgGreen:t?Te("\x1B[42m","\x1B[49m"):String,bgYellow:t?Te("\x1B[43m","\x1B[49m"):String,bgBlue:t?Te("\x1B[44m","\x1B[49m"):String,bgMagenta:t?Te("\x1B[45m","\x1B[49m"):String,bgCyan:t?Te("\x1B[46m","\x1B[49m"):String,bgWhite:t?Te("\x1B[47m","\x1B[49m"):String}),ys,pu,yu,ms,vs,Bs=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},Cu=10,mi=(t=0)=>(n)=>`\x1B[${n+t}m`,vi=(t=0)=>(n)=>`\x1B[${38+t};5;${n}m`,Bi=(t=0)=>(n,u,r)=>`\x1B[${38+t};2;${n};${u};${r}m`,Ie,As,Zc,bs,Lr,Ts=39,Bu="\x07",ki="[",Is="]",Ri="m",Au,Ai=(t)=>`${Lr.values().next().value}${ki}${t}${Ri}`,Si=(t)=>`${Lr.values().next().value}${Au}${t}${Bu}`,ws=(t)=>t.split(" ").map((n)=>dr(n)),du=(t,n,u)=>{let r=[...n],i=!1,c=!1,e=dr(_i(t[t.length-1]));for(let[h,o]of r.entries()){let a=dr(o);if(e+a<=u?t[t.length-1]+=o:(t.push(o),e=0),Lr.has(o)&&(i=!0,c=r.slice(h+1).join("").startsWith(Au)),i){c?o===Bu&&(i=!1,c=!1):o===Ri&&(i=!1);continue}e+=a,e===u&&h<r.length-1&&(t.push(""),e=0)}!e&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},Ns=(t)=>{let n=t.split(" "),u=n.length;for(;u>0&&!(dr(n[u-1])>0);)u--;return u===n.length?t:n.slice(0,u).join(" ")+n.slice(u).join("")},_s=(t,n,u={})=>{if(u.trim!==!1&&t.trim()==="")return"";let r="",i,c,e=ws(t),h=[""];for(let[a,C]of t.split(" ").entries()){u.trim!==!1&&(h[h.length-1]=h[h.length-1].trimStart());let f=dr(h[h.length-1]);if(a!==0&&(f>=n&&(u.wordWrap===!1||u.trim===!1)&&(h.push(""),f=0),(f>0||u.trim===!1)&&(h[h.length-1]+=" ",f++)),u.hard&&e[a]>n){let B=n-f,b=1+Math.floor((e[a]-B-1)/n);Math.floor((e[a]-1)/n)<b&&h.push(""),du(h,C,n);continue}if(f+e[a]>n&&f>0&&e[a]>0){if(u.wordWrap===!1&&f<n){du(h,C,n);continue}h.push("")}if(f+e[a]>n&&u.wordWrap===!1){du(h,C,n);continue}h[h.length-1]+=C}u.trim!==!1&&(h=h.map((a)=>Ns(a)));let o=[...h.join(`
`)];for(let[a,C]of o.entries()){if(r+=C,Lr.has(C)){let{groups:B}=new RegExp(`(?:\\${ki}(?<code>\\d+)m|\\${Au}(?<uri>.*)${Bu})`).exec(o.slice(a).join(""))||{groups:{}};if(B.code!==void 0){let b=Number.parseFloat(B.code);i=b===Ts?void 0:b}else B.uri!==void 0&&(c=B.uri.length===0?void 0:B.uri)}let f=bs.codes.get(Number(i));o[a+1]===`
`?(c&&(r+=Si("")),i&&f&&(r+=Ai(f))):C===`
`&&(i&&f&&(r+=Ai(i)),c&&(r+=Si(c)))}return r},Rs,Ti,Ls,Li,xi,Ui,Pi,xs,$t=(t,n)=>xs?t:n,Us,Ps,Os,$s,Se="",nr="",Fu,mu,Vs,Ii,Ms,xr=(t)=>{switch(t){case"initial":case"active":return Z.cyan(Us);case"cancel":return Z.red(Ps);case"error":return Z.yellow(Os);case"submit":return Z.green($s)}},Ks=(t)=>{return new Pi({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let n=`${Z.gray(Se)}
${xr(this.state)} ${t.message}
`,u=t.placeholder?Z.inverse(t.placeholder[0])+Z.dim(t.placeholder.slice(1)):Z.inverse(Z.hidden("_")),r=this.value?this.valueWithCursor:u;switch(this.state){case"error":return`${n.trim()}
${Z.yellow(Se)} ${r}
${Z.yellow(nr)} ${Z.yellow(this.error)}
`;case"submit":return`${n}${Z.gray(Se)} ${Z.dim(this.value||t.placeholder)}`;case"cancel":return`${n}${Z.gray(Se)} ${Z.strikethrough(Z.dim(this.value??""))}${this.value?.trim()?`
`+Z.gray(Se):""}`;default:return`${n}${Z.cyan(Se)} ${r}
${Z.cyan(nr)}
`}}}).prompt()},js=(t)=>{let n=t.active??"Yes",u=t.inactive??"No";return new Li({active:n,inactive:u,initialValue:t.initialValue??!0,render(){let r=`${Z.gray(Se)}
${xr(this.state)} ${t.message}
`,i=this.value?n:u;switch(this.state){case"submit":return`${r}${Z.gray(Se)} ${Z.dim(i)}`;case"cancel":return`${r}${Z.gray(Se)} ${Z.strikethrough(Z.dim(i))}
${Z.gray(Se)}`;default:return`${r}${Z.cyan(Se)} ${this.value?`${Z.green(Fu)} ${n}`:`${Z.dim(mu)} ${Z.dim(n)}`} ${Z.dim("/")} ${this.value?`${Z.dim(mu)} ${Z.dim(u)}`:`${Z.green(Fu)} ${u}`}
${Z.cyan(nr)}
`}}}).prompt()},Gs=(t)=>{let n=(u,r)=>{let i=u.label??String(u.value);switch(r){case"active":return`${Z.green(Fu)} ${i} ${u.hint?Z.dim(`(${u.hint})`):""}`;case"selected":return`${Z.dim(i)}`;case"cancelled":return`${Z.strikethrough(Z.dim(i))}`}return`${Z.dim(mu)} ${Z.dim(i)}`};return new Ui({options:t.options,initialValue:t.initialValue,render(){let u=`${Z.gray(Se)}
${xr(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${u}${Z.gray(Se)} ${n(this.options[this.cursor],"selected")}`;case"cancel":return`${u}${Z.gray(Se)} ${n(this.options[this.cursor],"cancelled")}
${Z.gray(Se)}`;default:return`${u}${Z.cyan(Se)} ${this.options.map((r,i)=>n(r,i===this.cursor?"active":"inactive")).join(`
${Z.cyan(Se)} `)}
${Z.cyan(nr)}
`}}}).prompt()},qs=(t)=>{let n=(u,r)=>{let i=u.label??String(u.value);switch(r){case"active":return`${Z.cyan(Vs)} ${i} ${u.hint?Z.dim(`(${u.hint})`):""}`;case"selected":return`${Z.green(Ii)} ${Z.dim(i)}`;case"cancelled":return`${Z.strikethrough(Z.dim(i))}`;case"active-selected":return`${Z.green(Ii)} ${i} ${u.hint?Z.dim(`(${u.hint})`):""}`;case"submitted":return`${Z.dim(i)}`}return`${Z.dim(Ms)} ${Z.dim(i)}`};return new xi({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(u){if(this.required&&u.length===0)return`Please select at least one option.
${Z.reset(Z.dim(`Press ${Z.gray(Z.bgWhite(Z.inverse(" space ")))} to select, ${Z.gray(Z.bgWhite(Z.inverse(" enter ")))} to submit`))}`},render(){let u=`${Z.gray(Se)}
${xr(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${u}${Z.gray(Se)} ${this.options.filter(({value:r})=>this.value.includes(r)).map((r)=>n(r,"submitted")).join(Z.dim(", "))||Z.dim("none")}`;case"cancel":{let r=this.options.filter(({value:i})=>this.value.includes(i)).map((i)=>n(i,"cancelled")).join(Z.dim(", "));return`${u}${Z.gray(Se)} ${r.trim()?`${r}
${Z.gray(Se)}`:""}`}case"error":{let r=this.error.split(`
`).map((i,c)=>c===0?`${Z.yellow(nr)} ${Z.yellow(i)}`:` ${i}`).join(`
`);return u+Z.yellow(Se)+" "+this.options.map((i,c)=>{let e=this.value.includes(i.value),h=c===this.cursor;if(h&&e)return n(i,"active-selected");if(e)return n(i,"selected");return n(i,h?"active":"inactive")}).join(`
${Z.yellow(Se)} `)+`
`+r+`
`}default:return`${u}${Z.cyan(Se)} ${this.options.map((r,i)=>{let c=this.value.includes(r.value),e=i===this.cursor;if(e&&c)return n(r,"active-selected");if(c)return n(r,"selected");return n(r,e?"active":"inactive")}).join(`
${Z.cyan(Se)} `)}
${Z.cyan(nr)}
`}}}).prompt()};var $i=kr(()=>{Ur();ar();ke=`${gu}[`,Eu={to(t,n){if(!n)return`${ke}${t+1}G`;return`${ke}${n+1};${t+1}H`},move(t,n){let u="";if(t<0)u+=`${ke}${-t}D`;else if(t>0)u+=`${ke}${t}C`;if(n<0)u+=`${ke}${-n}A`;else if(n>0)u+=`${ke}${n}B`;return u},up:(t=1)=>`${ke}${t}A`,down:(t=1)=>`${ke}${t}B`,forward:(t=1)=>`${ke}${t}C`,backward:(t=1)=>`${ke}${t}D`,nextLine:(t=1)=>`${ke}E`.repeat(t),prevLine:(t=1)=>`${ke}F`.repeat(t),left:`${ke}G`,hide:`${ke}?25l`,show:`${ke}?25h`,save:`${gu}7`,restore:`${gu}8`},Cs={up:(t=1)=>`${ke}S`.repeat(t),down:(t=1)=>`${ke}T`.repeat(t)},ds={screen:`${ke}2J`,up:(t=1)=>`${ke}1J`.repeat(t),down:(t=1)=>`${ke}J`.repeat(t),line:`${ke}2K`,lineEnd:`${ke}K`,lineStart:`${ke}1K`,lines(t){let n="";for(let u=0;u<t;u++)n+=this.line+(u<t-1?Eu.up():"");if(t)n+=Eu.left;return n}},St={cursor:Eu,scroll:Cs,erase:ds,beep:ps},vu={exports:{}},gs=hs,Es=!(("NO_COLOR"in process.env)||process.argv.includes("--no-color"))&&(("FORCE_COLOR"in process.env)||process.argv.includes("--color")||process.platform==="win32"||gs.isatty(1)&&process.env.TERM!=="dumb"||("CI"in process.env));vu.exports=Ni();vu.exports.createColors=Ni;ys=vu.exports,pu=Su(ys);yu={},ms={get exports(){return yu},set exports(t){yu=t}};(function(t){var n={};t.exports=n,n.eastAsianWidth=function(r){var i=r.charCodeAt(0),c=r.length==2?r.charCodeAt(1):0,e=i;return 55296<=i&&i<=56319&&56320<=c&&c<=57343&&(i&=1023,c&=1023,e=i<<10|c,e+=65536),e==12288||65281<=e&&e<=65376||65504<=e&&e<=65510?"F":e==8361||65377<=e&&e<=65470||65474<=e&&e<=65479||65482<=e&&e<=65487||65490<=e&&e<=65495||65498<=e&&e<=65500||65512<=e&&e<=65518?"H":4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12289<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||110592<=e&&e<=110593||127488<=e&&e<=127490||127504<=e&&e<=127546||127552<=e&&e<=127560||127568<=e&&e<=127569||131072<=e&&e<=194367||177984<=e&&e<=196605||196608<=e&&e<=262141?"W":32<=e&&e<=126||162<=e&&e<=163||165<=e&&e<=166||e==172||e==175||10214<=e&&e<=10221||10629<=e&&e<=10630?"Na":e==161||e==164||167<=e&&e<=168||e==170||173<=e&&e<=174||176<=e&&e<=180||182<=e&&e<=186||188<=e&&e<=191||e==198||e==208||215<=e&&e<=216||222<=e&&e<=225||e==230||232<=e&&e<=234||236<=e&&e<=237||e==240||242<=e&&e<=243||247<=e&&e<=250||e==252||e==254||e==257||e==273||e==275||e==283||294<=e&&e<=295||e==299||305<=e&&e<=307||e==312||319<=e&&e<=322||e==324||328<=e&&e<=331||e==333||338<=e&&e<=339||358<=e&&e<=359||e==363||e==462||e==464||e==466||e==468||e==470||e==472||e==474||e==476||e==593||e==609||e==708||e==711||713<=e&&e<=715||e==717||e==720||728<=e&&e<=731||e==733||e==735||768<=e&&e<=879||913<=e&&e<=929||931<=e&&e<=937||945<=e&&e<=961||963<=e&&e<=969||e==1025||1040<=e&&e<=1103||e==1105||e==8208||8211<=e&&e<=8214||8216<=e&&e<=8217||8220<=e&&e<=8221||8224<=e&&e<=8226||8228<=e&&e<=8231||e==8240||8242<=e&&e<=8243||e==8245||e==8251||e==8254||e==8308||e==8319||8321<=e&&e<=8324||e==8364||e==8451||e==8453||e==8457||e==8467||e==8470||8481<=e&&e<=8482||e==8486||e==8491||8531<=e&&e<=8532||8539<=e&&e<=8542||8544<=e&&e<=8555||8560<=e&&e<=8569||e==8585||8592<=e&&e<=8601||8632<=e&&e<=8633||e==8658||e==8660||e==8679||e==8704||8706<=e&&e<=8707||8711<=e&&e<=8712||e==8715||e==8719||e==8721||e==8725||e==8730||8733<=e&&e<=8736||e==8739||e==8741||8743<=e&&e<=8748||e==8750||8756<=e&&e<=8759||8764<=e&&e<=8765||e==8776||e==8780||e==8786||8800<=e&&e<=8801||8804<=e&&e<=8807||8810<=e&&e<=8811||8814<=e&&e<=8815||8834<=e&&e<=8835||8838<=e&&e<=8839||e==8853||e==8857||e==8869||e==8895||e==8978||9312<=e&&e<=9449||9451<=e&&e<=9547||9552<=e&&e<=9587||9600<=e&&e<=9615||9618<=e&&e<=9621||9632<=e&&e<=9633||9635<=e&&e<=9641||9650<=e&&e<=9651||9654<=e&&e<=9655||9660<=e&&e<=9661||9664<=e&&e<=9665||9670<=e&&e<=9672||e==9675||9678<=e&&e<=9681||9698<=e&&e<=9701||e==9711||9733<=e&&e<=9734||e==9737||9742<=e&&e<=9743||9748<=e&&e<=9749||e==9756||e==9758||e==9792||e==9794||9824<=e&&e<=9825||9827<=e&&e<=9829||9831<=e&&e<=9834||9836<=e&&e<=9837||e==9839||9886<=e&&e<=9887||9918<=e&&e<=9919||9924<=e&&e<=9933||9935<=e&&e<=9953||e==9955||9960<=e&&e<=9983||e==10045||e==10071||10102<=e&&e<=10111||11093<=e&&e<=11097||12872<=e&&e<=12879||57344<=e&&e<=63743||65024<=e&&e<=65039||e==65533||127232<=e&&e<=127242||127248<=e&&e<=127277||127280<=e&&e<=127337||127344<=e&&e<=127386||917760<=e&&e<=917999||983040<=e&&e<=1048573||1048576<=e&&e<=1114109?"A":"N"},n.characterLength=function(r){var i=this.eastAsianWidth(r);return i=="F"||i=="W"||i=="A"?2:1};function u(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}n.length=function(r){for(var i=u(r),c=0,e=0;e<i.length;e++)c=c+this.characterLength(i[e]);return c},n.slice=function(r,i,c){textLen=n.length(r),i=i||0,c=c||1,i<0&&(i=textLen+i),c<0&&(c=textLen+c);for(var e="",h=0,o=u(r),a=0;a<o.length;a++){var C=o[a],f=n.length(C);if(h>=i-(f==2?1:0))if(h+f<=c)e+=C;else break;h+=f}return e}})(ms);vs=yu;Ie={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(Ie.modifier);As=Object.keys(Ie.color),Zc=Object.keys(Ie.bgColor);[...As];bs=Ss(),Lr=new Set(["\x1B",""]),Au=`${Is}8;;`;Rs=Symbol("clack:cancel");Ti=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),Ls=new Set(["up","down","left","right","space","enter"]);Li=class Li extends gr{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",(n)=>{this.output.write(St.cursor.move(0,-1)),this.value=n,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};xi=class xi extends gr{constructor(t){super(t,!1),this.cursor=0,this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:n})=>n===t.cursorAt),0),this.on("key",(n)=>{n==="a"&&this.toggleAll()}),this.on("cursor",(n)=>{switch(n){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 t=this.value.length===this.options.length;this.value=t?[]:this.options.map((n)=>n.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter((n)=>n!==this._value):[...this.value,this._value]}};Ui=class Ui extends gr{constructor(t){super(t,!1),this.cursor=0,this.options=t.options,this.cursor=this.options.findIndex(({value:n})=>n===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(n)=>{switch(n){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}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};Pi=class Pi extends gr{constructor(t){super(t),this.valueWithCursor="",this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${pu.inverse(pu.hidden("_"))}`;else{let n=this.value.slice(0,this.cursor),u=this.value.slice(this.cursor);this.valueWithCursor=`${n}${pu.inverse(u[0])}${u.slice(1)}`}})}get cursor(){return this._cursor}};xs=bu(),Us=$t("❯",">"),Ps=$t("■","x"),Os=$t("▲","x"),$s=$t("✔","√"),Fu=$t("●",">"),mu=$t("○"," "),Vs=$t("◻","[•]"),Ii=$t("◼","[+]"),Ms=$t("◻","[ ]")});import{createRequire as Ws}from"node:module";import{formatWithOptions as zs}from"node:util";import{sep as Ys}from"node:path";import*as Or from"node:tty";import bt from"node:process";function Tu(t){return t!==null&&typeof t==="object"}function _u(t,n,u=".",r){if(!Tu(n))return _u(t,{},u,r);let i=Object.assign({},n);for(let c in t){if(c==="__proto__"||c==="constructor")continue;let e=t[c];if(e===null||e===void 0)continue;if(r&&r(i,c,e,u))continue;if(Array.isArray(e)&&Array.isArray(i[c]))i[c]=[...e,...i[c]];else if(Tu(e)&&Tu(i[c]))i[c]=_u(e,i[c],(u?`${u}.`:"")+c.toString(),r);else i[c]=e}return i}function eo(t){return(...n)=>n.reduce((u,r)=>_u(u,r,"",t),{})}function ro(t){return Object.prototype.toString.call(t)==="[object Object]"}function uo(t){if(!ro(t))return!1;if(!t.message&&!t.args)return!1;if(t.stack)return!1;return!0}class nt{constructor(t={}){let n=t.types||Mi;this.options=to({...t,defaults:{...t.defaults},level:wu(t.level,n),reporters:[...t.reporters||[]]},{types:Mi,throttle:1000,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let u in n){let r={type:u,...this.options.defaults,...n[u]};this[u]=this._wrapLogFn(r),this[u].raw=this._wrapLogFn(r,!0)}if(this.options.mockFn)this.mockTypes();this._lastLog={}}get level(){return this.options.level}set level(t){this.options.level=wu(t,this.options.types,this.options.level)}prompt(t,n){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(t,n)}create(t){let n=new nt({...this.options,...t});if(this._mockFn)n.mockTypes(this._mockFn);return n}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 n=this.options.reporters.indexOf(t);if(n>=0)return this.options.reporters.splice(n,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){if(!console["__"+t])console["__"+t]=console[t];console[t]=this[t].raw}}restoreConsole(){for(let t in this.options.types)if(console["__"+t])console[t]=console["__"+t],delete console["__"+t]}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(t,n){if(!t)return;if(!t.__write)t.__write=t.write;t.write=(u)=>{this[n].raw(String(u).trim())}}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(t){if(!t)return;if(t.__write)t.write=t.__write,delete t.__write}pauseLogs(){Iu=!0}resumeLogs(){Iu=!1;let t=Ki.splice(0);for(let n of t)n[0]._logFn(n[1],n[2])}mockTypes(t){let n=t||this.options.mockFn;if(this._mockFn=n,typeof n!=="function")return;for(let u in this.options.types)this[u]=n(u,this.options.types[u])||this[u],this[u].raw=this[u]}_wrapLogFn(t,n){return(...u)=>{if(Iu){Ki.push([this,t,u,n]);return}return this._logFn(t,u,n)}}_logFn(t,n,u){if((t.level||0)>this.level)return!1;let r={date:new Date,args:[],...t,level:wu(t.level,this.options.types)};if(!u&&n.length===1&&uo(n[0]))Object.assign(r,n[0]);else r.args=[...n];if(r.message)r.args.unshift(r.message),delete r.message;if(r.additional){if(!Array.isArray(r.additional))r.additional=r.additional.split(`
`);r.args.push(`
`+r.additional.join(`
`)),delete r.additional}r.type=typeof r.type==="string"?r.type.toLowerCase():"log",r.tag=typeof r.tag==="string"?r.tag:"";let i=(e=!1)=>{let h=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&h>0){let o=[...this._lastLog.object.args];if(h>1)o.push(`(repeated ${h} times)`);this._log({...this._lastLog.object,args:o}),this._lastLog.count=1}if(e)this._lastLog.object=r,this._log(r)};clearTimeout(this._lastLog.timeout);let c=this._lastLog.time&&r.date?r.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=r.date,c<this.options.throttle)try{let e=JSON.stringify([r.type,r.tag,r.args]),h=this._lastLog.serialized===e;if(this._lastLog.serialized=e,h){if(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin){this._lastLog.timeout=setTimeout(i,this.options.throttle);return}}}catch{}i(!0)}_log(t){for(let n of this.options.reporters)n.log(t,{options:this.options})}}function wu(t,n={},u=3){if(t===void 0)return u;if(typeof t==="number")return t;if(n[t]&&n[t].level!==void 0)return n[t].level;return u}function io(t={}){return new nt(t)}function Wi(t){let n=process.cwd()+Ys;return t.split(`
`).splice(1).map((u)=>u.trim().replace("file://","").replace(n,""))}function ao(t,n){return(n.__write||n.write).call(n,t)}class Ru{formatStack(t,n){return" "+Wi(t).join(`
`)}formatArgs(t,n){let u=t.map((r)=>{if(r&&typeof r.stack==="string")return r.message+`
`+this.formatStack(r.stack,n);return r});return zs(n,...u)}formatDate(t,n){return n.date?t.toLocaleTimeString():""}filterAndJoin(t){return t.filter(Boolean).join(" ")}formatLogObj(t,n){let u=this.formatArgs(t.args,n);if(t.type==="box")return`
`+[Nu(t.tag),t.title&&t.title,...u.split(`
`)].filter(Boolean).map((r)=>" > "+r).join(`
`)+`
`;return this.filterAndJoin([Nu(t.type),Nu(t.tag),u])}log(t,n){let u=this.formatLogObj(t,{columns:n.options.stdout.columns||0,...n.options.formatOptions});return ao(u+`
`,t.level<2?n.options.stderr||process.stderr:n.options.stdout||process.stdout)}}function Qi(t,n,u,r,i=n.slice(0,Math.max(0,t))+r,c=n.slice(Math.max(0,t+u.length)),e=c.indexOf(u)){return i+(e<0?c:Qi(e,c,u,r))}function ho(t,n,u,r,i){return t<0?u+n+r:u+Qi(t,n,r,i)+r}function po(t,n,u=t,r=t.length+1){return(i)=>i||!(i===""||i===void 0)?ho((""+i).indexOf(n,r),i,t,n,u):""}function Ce(t,n,u){return po(`\x1B[${t}m`,`\x1B[${n}m`,u)}function Co(t=fo){return t?ji:Object.fromEntries(Object.keys(ji).map((n)=>[n,String]))}function go(t,n="reset"){return Z[t]||Z[n]}function Er(t){return t.replace(new RegExp(Eo,"g"),"")}function Fo(t,n={}){let u={...n,style:{...yo,...n.style}},r=t.split(`
`),i=[],c=go(u.style.borderColor),e={...typeof u.style.borderStyle==="string"?Gi[u.style.borderStyle]||Gi.solid:u.style.borderStyle};if(c)for(let b in e)e[b]=c(e[b]);let h=u.style.padding%2===0?u.style.padding:u.style.padding+1,o=r.length+h,a=Math.max(...r.map((b)=>b.length))+h,C=a+h,f=u.style.marginLeft>0?" ".repeat(u.style.marginLeft):"";if(u.style.marginTop>0)i.push("".repeat(u.style.marginTop));if(u.title){let b=e.h.repeat(Math.floor((a-Er(u.title).length)/2)),v=e.h.repeat(a-Er(u.title).length-Er(b).length+h);i.push(`${f}${e.tl}${b}${u.title}${v}${e.tr}`)}else i.push(`${f}${e.tl}${e.h.repeat(C)}${e.tr}`);let B=u.style.valign==="center"?Math.floor((o-r.length)/2):u.style.valign==="top"?o-r.length-h:o-r.length;for(let b=0;b<o;b++)if(b<B||b>=B+r.length)i.push(`${f}${e.v}${" ".repeat(C)}${e.v}`);else{let v=r[b-B],d=" ".repeat(h),F=" ".repeat(a-Er(v).length);i.push(`${f}${e.v}${d}${v}${F}${e.v}`)}if(i.push(`${f}${e.bl}${e.h.repeat(C)}${e.br}`),u.style.marginBottom>0)i.push("".repeat(u.style.marginBottom));return i.join(`
`)}function vo(t){for(let n of mo){let u=n[1]||n[0];if(t[u])return{name:n[0].toLowerCase(),...n[2]}}if(t.SHELL&&t.SHELL==="/bin/jsh")return{name:"stackblitz",ci:!1};return{name:"",ci:!1}}function Fr(t){return t?t!=="false":!1}function bo({onlyFirst:t=!1}={}){let n=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(n,t?void 0:"g")}function Io(t){if(typeof t!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(To,"")}function Su(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ko(t,n){if(typeof t!=="string"||t.length===0)return 0;if(n={ambiguousIsNarrow:!0,countAnsiEscapeCodes:!1,...n},!n.countAnsiEscapeCodes)t=Io(t);if(t.length===0)return 0;let u=n.ambiguousIsNarrow?1:2,r=0;for(let{segment:i}of new Intl.Segmenter().segment(t)){let c=i.codePointAt(0);if(c<=31||c>=127&&c<=159)continue;if(c>=768&&c<=879)continue;if(_o().test(i)){r+=2;continue}switch(No.eastAsianWidth(i)){case"F":case"W":{r+=2;break}case"A":{r+=u;break}default:r+=1}}return r}function bu(){if(bt.platform!=="win32")return bt.env.TERM!=="linux";return Boolean(bt.env.CI)||Boolean(bt.env.WT_SESSION)||Boolean(bt.env.TERMINUS_SUBLIME)||bt.env.ConEmuTask==="{cmd::Cmder}"||bt.env.TERM_PROGRAM==="Terminus-Sublime"||bt.env.TERM_PROGRAM==="vscode"||bt.env.TERM==="xterm-256color"||bt.env.TERM==="alacritty"||bt.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function Hi(t){if(!Intl.Segmenter)return Er(t).length;return ko(t)}function Pr(t){return t.replace(/`([^`]+)`/gm,(n,u)=>Z.cyan(u)).replace(/\s+_([^_]+)_\s+/gm,(n,u)=>` ${Z.underline(u)} `)}function Uo(t="white"){return Z[t]||Z.white}function Po(t="bgWhite"){return Z[`bg${t[0].toUpperCase()}${t.slice(1)}`]||Z.bgWhite}function Oo(t={}){let n=$o();if(process.env.CONSOLA_LEVEL)n=Number.parseInt(process.env.CONSOLA_LEVEL)??n;return io({level:n,defaults:{level:n},stdout:process.stdout,stderr:process.stderr,prompt:(...u)=>Promise.resolve().then(() => ($i(),Oi)).then((r)=>r.prompt(...u)),reporters:t.reporters||[t.fancy??!(Ao||Zi)?new ea:new Ru],...t})}function $o(){if(So)return lt.debug;if(Zi)return lt.warn;return lt.info}var Qs,Xs,Vi,Zs,Js,ku=(t,n,u)=>{u=t!=null?Qs(Xs(t)):{};let r=n||!t||!t.__esModule?Vi(u,"default",{value:t,enumerable:!0}):u;for(let i of Zs(t))if(!Js.call(r,i))Vi(r,i,{get:()=>t[i],enumerable:!0});return r},fe=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),Vr,lt,Mi,to,Iu=!1,Ki,Nu=(t)=>t?`[${t}]`:"",Ht,zi,no,so,oo,Do,Yi,lo,co,fo,ji,Z,Eo,Gi,yo,mo,$r,yr,Xi,Bo,Ao,i0,So,Zi,To,Ji,wo,No,_o=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?