UNPKG

@oxog/termstyle

Version:

A powerful, feature-rich CLI text formatting library with zero dependencies. Supports colors, gradients, animations, progress bars, and more.

14 lines 59.2 kB
"use strict";var _e=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var Qe=Object.getOwnPropertyNames;var et=Object.prototype.hasOwnProperty;var tt=(i,e)=>{for(var t in e)_e(i,t,{get:e[t],enumerable:!0})},rt=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Qe(e))!et.call(i,n)&&n!==t&&_e(i,n,{get:()=>e[n],enumerable:!(r=Ze(e,n))||r.enumerable});return i};var nt=i=>rt(_e({},"__esModule",{value:!0}),i);var Ct={};tt(Ct,{Animation:()=>W,ConditionalFormatter:()=>Q,Formatter:()=>F,LogFormatter:()=>ee,MultiProgress:()=>J,ProgressBar:()=>z,Spinner:()=>Y,Style:()=>c,ThemeManager:()=>Z,animate:()=>Le,bar:()=>Ge,box:()=>K,cacheManager:()=>R,conditional:()=>ue,conditionalColor:()=>He,createLogFormatter:()=>Ue,createStatusFormatter:()=>ze,createTemplateTag:()=>be,default:()=>St,defaultTheme:()=>le,getTerminalInfo:()=>ie,gradient:()=>ke,logLevels:()=>ce,multiProgress:()=>De,progressBar:()=>Fe,rainbow:()=>Oe,spinner:()=>Ee,spinners:()=>U,stripAnsi:()=>I,style:()=>Tt,templateParse:()=>$e,terminal:()=>k,themeCreate:()=>ye,themes:()=>X});module.exports=nt(Ct);var ne="\x1B[",Rt=ne+"0m",we=i=>ne+i+"m";var l={reset:0,bold:1,dim:2,italic:3,underline:4,blink:5,rapidBlink:6,inverse:7,hidden:8,strikethrough:9,resetBold:22,resetDim:22,resetItalic:23,resetUnderline:24,resetBlink:25,resetInverse:27,resetHidden:28,resetStrikethrough:29,black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37,defaultColor:39,bgBlack:40,bgRed:41,bgGreen:42,bgYellow:43,bgBlue:44,bgMagenta:45,bgCyan:46,bgWhite:47,bgDefaultColor:49,brightBlack:90,brightRed:91,brightGreen:92,brightYellow:93,brightBlue:94,brightMagenta:95,brightCyan:96,brightWhite:97,bgBrightBlack:100,bgBrightRed:101,bgBrightGreen:102,bgBrightYellow:103,bgBrightBlue:104,bgBrightMagenta:105,bgBrightCyan:106,bgBrightWhite:107},xe=(i,e,t)=>`38;2;${i};${e};${t}`,je=(i,e,t)=>`48;2;${i};${e};${t}`,fe=i=>`38;5;${i}`,Te=i=>`48;5;${i}`,Se=i=>{if(!i||typeof i!="string")return[0,0,0];let e=i.replace("#","");e.length===3&&(e=e.split("").map(s=>s+s).join(""));let t=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16);return[t,r,n]},pe=(i,e,t)=>{if(i===e&&e===t){if(i<8)return 16;if(i>238)return 231;let o=Math.round((i-8)/10);return 232+Math.min(o,23)}let r=Math.round(i/51),n=Math.round(e/51),s=Math.round(t/51);return 16+36*r+6*n+s},I=i=>{if(typeof i!="string")return String(i);let e=/\u001B\[(?:[0-9;]{0,30})?m/g,t=/\u001B\[(?:[0-9;]{0,30})?[A-Za-z]/g;try{return i.replace(e,"").replace(t,"")}catch{let r="",n=0;for(;n<i.length;)if(i[n]==="\x1B"&&i[n+1]==="[")for(n+=2;n<i.length&&(i[n]>="0"&&i[n]<="9"||i[n]===";"||i[n]==="m"||i[n]>="A"&&i[n]<="Z"||i[n]>="a"&&i[n]<="z");){if(i[n]==="m"||i[n]>="A"&&i[n]<="Z"||i[n]>="a"&&i[n]<="z"){n++;break}n++}else r+=i[n],n++;return r}};var D=()=>ne+"2K";var qe=()=>ne+"?25l",Ce=()=>ne+"?25h";var We=require("os"),it=()=>!!(process.env.CI||process.env.CONTINUOUS_INTEGRATION||process.env.BUILD_NUMBER||process.env.RUN_ID),st=()=>{var i,e;try{let t=process.env;if(t.NO_COLOR||t.NODE_DISABLE_COLORS||t.FORCE_COLOR==="0")return 0;if(t.FORCE_COLOR==="1")return 1;if(t.FORCE_COLOR==="2")return 2;if(t.FORCE_COLOR==="3")return 3;if(!process.stdout||!process.stdout.isTTY)return 0;if(process.platform==="win32")try{let r=(0,We.release)().split("."),n=parseInt(r[0],10),s=parseInt(r[2],10);return isNaN(n)||isNaN(s)?1:n>=10&&s>=10586?s>=14931?3:2:1}catch{return 1}return t.COLORTERM==="truecolor"||t.TERM_PROGRAM==="iTerm.app"?3:(i=t.TERM)!=null&&i.includes("256color")?2:(e=t.TERM)!=null&&e.includes("color")?1:0}catch{return 0}},ie=()=>{var i,e,t;try{let r=st(),n=Math.max(1,((i=process.stdout)==null?void 0:i.columns)||80),s=Math.max(1,((e=process.stdout)==null?void 0:e.rows)||24);return{supportsColor:r>0,colorLevel:r,isTTY:!!((t=process.stdout)!=null&&t.isTTY),isCI:it(),width:n,height:s,columns:n,rows:s}}catch{return{supportsColor:!1,colorLevel:0,isTTY:!1,isCI:!1,width:80,height:24,columns:80,rows:24}}},he=null,Re=0,Ie=null,ot=5*60*1e3,k=()=>{let i=Date.now();return(!he||i-Re>ot)&&(he=ie(),Re=i),he},at=()=>{he=ie(),Re=Date.now()};if(typeof process<"u"&&process.stdout&&typeof process.stdout.on=="function")try{Ie||(Ie=at,process.stdout.on("resize",Ie))}catch{}var m=class{static validateColor(e){if(e==null)return{valid:!1,error:"Color input cannot be null or undefined"};if(Array.isArray(e)){let t=e;if(t.length!==3)return{valid:!1,error:`RGB array must have exactly 3 values, got ${t.length}`};let r=[],n=[0,0,0];for(let s=0;s<3;s++){let o=t[s];if(typeof o!="number")return{valid:!1,error:`RGB value at index ${s} must be a number, got ${typeof o}`};if(!Number.isFinite(o))return{valid:!1,error:`RGB value at index ${s} must be finite, got ${o}`};(o<0||o>255)&&r.push(`RGB value ${o} at index ${s} was clamped to 0-255 range`),n[s]=Math.max(0,Math.min(255,Math.round(o)))}return{valid:!0,value:{type:"rgb",value:n,original:e},warnings:r.length>0?r:void 0}}if(typeof e=="number"){if(!Number.isFinite(e))return{valid:!1,error:`Color number must be finite, got ${e}`};let t=[],r=e;(r<0||r>16777215)&&(t.push(`Color number ${r} was clamped to 0x000000-0xFFFFFF range`),r=Math.max(0,Math.min(16777215,Math.floor(r))));let n=r>>16&255,s=r>>8&255,o=r&255;return{valid:!0,value:{type:"number",value:[n,s,o],original:e},warnings:t.length>0?t:void 0}}if(typeof e=="string"){let t=e.trim();if(t.length===0)return{valid:!1,error:"Color string cannot be empty"};if(this.HEX_PATTERN.test(t))return{valid:!0,value:{type:"hex",value:[0,0,0],original:e}};let r=t.match(this.RGB_PATTERN);if(r){let n=parseInt(r[1],10),s=parseInt(r[2],10),o=parseInt(r[3],10);return this.validateColor([n,s,o])}return this.HSL_PATTERN.test(t)?{valid:!0,value:{type:"name",value:[0,0,0],original:e}}:{valid:!0,value:{type:"name",value:[0,0,0],original:e}}}return{valid:!1,error:`Invalid color input type: ${typeof e}`}}static validatePercent(e,t=!1){if(typeof e!="number")return{valid:!1,error:`Percent must be a number, got ${typeof e}`};if(!Number.isFinite(e))return{valid:!1,error:`Percent must be finite, got ${e}`};let r=t?-1:0,n=Math.max(r,Math.min(1,e)),s=n!==e;return{valid:!0,value:{value:n,clamped:s,original:e},warnings:s?[`Percent value ${e} was clamped to ${r}-1 range`]:void 0}}static validateAnimationType(e){let t=["dots","line","star","flip","grow","balloon","noise","bounce","boxing","arc","circle","square","triangle","arrow","bouncingBar","toggle","smiley","monkey","hearts","clock","earth","moon","weather","christmas","grenade","point","layer","betaWave","aesthetic"];if(typeof e!="string")return{valid:!1,error:`Animation type must be a string, got ${typeof e}`};let r=e.trim().toLowerCase(),n=t.find(s=>s.toLowerCase()===r);return n?{valid:!0,value:n}:{valid:!1,error:`Invalid animation type '${e}'. Valid types: ${t.join(", ")}`}}static validateText(e){if(e==null)return{valid:!0,value:{text:"",hasControlChars:!1,hasAnsiCodes:!1,isEmpty:!0}};if(typeof e!="string")try{let o=String(e);return this.validateText(o)}catch{return{valid:!1,error:`Cannot convert ${typeof e} to string`}}let t=this.CONTROL_CHAR_PATTERN.test(e),r=this.ANSI_PATTERN.test(e),n=e.length===0,s=[];return t&&s.push("Text contains control characters that may affect output"),r&&s.push("Text contains ANSI escape codes that will be preserved"),{valid:!0,value:{text:e,hasControlChars:t,hasAnsiCodes:r,isEmpty:n},warnings:s.length>0?s:void 0}}static validateColorArray(e){if(!Array.isArray(e))return{valid:!1,error:"Colors must be an array"};let t=e.filter(u=>u!=null);if(t.length===0)return{valid:!1,error:"Color array cannot be empty or contain only null/undefined values"};let r=[],n=[],s=[],o=e.length-t.length;o>0&&s.push(`Skipped ${o} null/undefined color(s)`);for(let u=0;u<t.length;u++){let a=this.validateColor(t[u]);a.valid?(r.push(a.value),a.warnings&&s.push(...a.warnings.map(d=>`Color at index ${u}: ${d}`))):n.push(`Color at index ${u}: ${a.error}`)}return n.length>0?{valid:!1,error:n.join("; ")}:{valid:!0,value:r,warnings:s.length>0?s:void 0}}static validatePositiveNumber(e,t){return typeof e!="number"?{valid:!1,error:`${t} must be a number, got ${typeof e}`}:Number.isFinite(e)?e<=0?{valid:!1,error:`${t} must be positive, got ${e}`}:{valid:!0,value:e}:{valid:!1,error:`${t} must be finite, got ${e}`}}static validateInteger(e,t,r,n){let s=this.validatePositiveNumber(e,t);return s.valid?Number.isInteger(e)?r!==void 0&&e<r?{valid:!1,error:`${t} must be at least ${r}, got ${e}`}:n!==void 0&&e>n?{valid:!1,error:`${t} must be at most ${n}, got ${e}`}:{valid:!0,value:e}:{valid:!1,error:`${t} must be an integer, got ${e}`}:s}static stripAnsiCodes(e){return e.replace(this.ANSI_PATTERN,"")}static hasAnsiCodes(e){return this.ANSI_PATTERN.test(e)}static sanitizeText(e,t=!0){let r=e.replace(this.CONTROL_CHAR_PATTERN,"");return t||(r=this.stripAnsiCodes(r)),r}};m.HEX_PATTERN=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,m.RGB_PATTERN=/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/,m.HSL_PATTERN=/^hsla?\((\d+),\s*(\d+)%,\s*(\d+)%(?:,\s*[\d.]+)?\)$/,m.ANSI_PATTERN=/\u001b\[[0-9;]*m/g,m.CONTROL_CHAR_PATTERN=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g;var j=class extends Error{constructor(e){super(e.message),this.name=this.constructor.name,this.code=e.code,this.details=e.details,this.cause=e.cause,this.suggestions=e.suggestions,this.timestamp=new Date,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.cause&&this.cause.stack&&(this.stack=`${this.stack}
Caused by: ${this.cause.stack}`)}getFullMessage(){let e=`[${this.code}] ${this.message}`;return this.details&&Object.keys(this.details).length>0&&(e+=`
Details: ${JSON.stringify(this.details,null,2)}`),this.suggestions&&this.suggestions.length>0&&(e+=`
Suggestions:
${this.suggestions.map(t=>`  - ${t}`).join(`
`)}`),e}toJSON(){return{name:this.name,code:this.code,message:this.message,details:this.details,suggestions:this.suggestions,timestamp:this.timestamp.toISOString(),stack:this.stack}}},se=class extends j{constructor(e,t,r){super({code:t,message:e,details:r,suggestions:["Check the input format and type","Refer to the documentation for valid input values","Use the validation methods before passing values"]})}};var E=class extends j{constructor(e,t=4003,r){super({code:t,message:e,details:r,suggestions:["Check if the animation is already running","Ensure the animation type is valid","Verify terminal supports cursor manipulation"]})}},G=class extends j{constructor(e,t=5001,r){super({code:t,message:e,details:r,suggestions:["Review the configuration options","Check for typos in option names","Ensure all required options are provided"]})}},oe=class{static recover(e,t,r=!1){try{return e()}catch(n){return r&&process.env.DEBUG&&console.error("[TermStyle] Error recovered:",n),typeof t=="function"?t():t}}static async retry(e,t=3,r=100){let n;for(let s=0;s<t;s++)try{return await e()}catch(o){if(n=o,s<t-1){let u=r*Math.pow(2,s);await new Promise(a=>setTimeout(a,u))}}throw new j({code:9003,message:`Operation failed after ${t} attempts`,cause:n,details:{maxAttempts:t,initialDelay:r}})}static withErrorBoundary(e,t){return(...r)=>{try{return e(...r)}catch(n){let s=t(n);if(s!==void 0)return s;throw n}}}static makeSafe(e,t){return(...r)=>{try{return e(...r)}catch{return t}}}},Me=class{static add(e,t){this.context.set(e,t)}static remove(e){this.context.delete(e)}static getAll(){let e={};for(let[t,r]of this.context)e[t]=r;return e}static clear(){this.context.clear()}static withContext(e,t){let r=Object.keys(e);for(let n of r)this.add(n,e[n]);try{return t()}finally{for(let n of r)this.remove(n)}}};Me.context=new Map;var V=class{constructor(e){this.cache=new Map;if(e<=0)throw new Error("Cache capacity must be positive");this.capacity=e}get(e){if(!this.cache.has(e))return;let t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(e,t)}has(e){return this.cache.has(e)}delete(e){return this.cache.delete(e)}clear(){this.cache.clear()}get size(){return this.cache.size}getSize(){return this.cache.size}keys(){return Array.from(this.cache.keys())}values(){return Array.from(this.cache.values())}entries(){return Array.from(this.cache.entries())}forEach(e){this.cache.forEach(e)}};var Ne=class i{constructor(){this.stats={color:{hits:0,misses:0},gradient:{hits:0,misses:0},style:{hits:0,misses:0}};this.colorCache=new V(1e3),this.hexCache=new V(500),this.hslCache=new V(500),this.gradientCache=new V(100),this.styleCache=new Map}static getInstance(){return this.instance||(this.instance=new i),this.instance}getColor(e){let t=this.colorCache.get(e);if(t)return this.stats.color.hits++,t;this.stats.color.misses++}setColor(e,t){this.colorCache.set(e,t)}getHexColor(e){let t=this.hexCache.get(e);if(t)return this.stats.color.hits++,t;this.stats.color.misses++}setHexColor(e,t){this.hexCache.set(e,t)}getHslColor(e){let t=this.hslCache.get(e);if(t)return this.stats.color.hits++,t;this.stats.color.misses++}setHslColor(e,t){this.hslCache.set(e,t)}getGradient(e){let t=this.gradientCache.get(e);if(t)return this.stats.gradient.hits++,t;this.stats.gradient.misses++}setGradient(e,t){this.gradientCache.set(e,t)}getStyle(e){let t=this.styleCache.get(e);if(t)return this.stats.style.hits++,t;this.stats.style.misses++}setStyle(e,t){if(this.styleCache.size>=100){let r=this.styleCache.keys().next().value;r&&this.styleCache.delete(r)}this.styleCache.set(e,t)}clear(){this.colorCache.clear(),this.hexCache.clear(),this.hslCache.clear(),this.gradientCache.clear(),this.styleCache.clear(),this.resetStats()}clearColors(){this.colorCache.clear(),this.hexCache.clear(),this.hslCache.clear()}clearGradients(){this.gradientCache.clear()}clearStyles(){this.styleCache.clear()}getStats(){return{color:{hits:this.stats.color.hits,misses:this.stats.color.misses,size:this.colorCache.getSize()+this.hexCache.getSize()+this.hslCache.getSize(),maxSize:2e3},gradient:{hits:this.stats.gradient.hits,misses:this.stats.gradient.misses,size:this.gradientCache.getSize(),maxSize:100},style:{hits:this.stats.style.hits,misses:this.stats.style.misses,size:this.styleCache.size,maxSize:100}}}resetStats(){this.stats={color:{hits:0,misses:0},gradient:{hits:0,misses:0},style:{hits:0,misses:0}}}getHitRate(e){let t=this.stats[e],r=t.hits+t.misses;return r>0?t.hits/r*100:0}},R=Ne.getInstance();var ge={red:"#ff0000",green:"#00ff00",blue:"#0000ff",yellow:"#ffff00",magenta:"#ff00ff",cyan:"#00ffff",white:"#ffffff",black:"#000000",gray:"#808080",grey:"#808080",orange:"#ffa500",purple:"#800080",pink:"#ffc0cb",brown:"#a52a2a",violet:"#ee82ee",indigo:"#4b0082",lime:"#00ff00",olive:"#808000",navy:"#000080",teal:"#008080",silver:"#c0c0c0",maroon:"#800000",fuchsia:"#ff00ff",aqua:"#00ffff",aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",blanchedalmond:"#ffebcd",blueviolet:"#8a2be2",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",limegreen:"#32cd32",linen:"#faf0e6",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",oldlace:"#fdf5e6",olivedrab:"#6b8e23",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",plum:"#dda0dd",powderblue:"#b0e0e6",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",wheat:"#f5deb3",whitesmoke:"#f5f5f5",yellowgreen:"#9acd32"},O=class{static processColor(e){let t=this.getCacheKey(e),r=R.getColor(t);if(r)return r;let n=this.convertColor(e);return R.setColor(t,n),n}static hslToRgb(e,t,r){let n=`hsl(${e},${t},${r})`,s=R.getHslColor(n);if(s)return s;let o=this.computeHslToRgb(e,t,r);return R.setHslColor(n,o),o}static rgbTo256(e,t,r){return this.computeRgbTo256(e,t,r)}static getColorNames(){return Object.keys(ge)}static isValidColorName(e){return e.toLowerCase()in ge}static isValidHex(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}static clearCaches(){R.clearColors()}static getCacheStats(){return R.getStats()}static getCacheKey(e){return Array.isArray(e)?`rgb(${e[0]},${e[1]},${e[2]})`:typeof e=="number"?`num(${e})`:`str(${e})`}static convertColor(e){if(Array.isArray(e))return[Math.max(0,Math.min(255,Math.round(e[0]))),Math.max(0,Math.min(255,Math.round(e[1]))),Math.max(0,Math.min(255,Math.round(e[2])))];if(typeof e=="number"){let t=Math.max(0,Math.min(16777215,Math.floor(e)));return[t>>16&255,t>>8&255,t&255]}if(typeof e=="string"){let t=e.trim().toLowerCase();if(t in ge)return Se(ge[t]);if(this.isValidHex(e))return Se(e);let r=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/);if(r)return[Math.max(0,Math.min(255,parseInt(r[1],10))),Math.max(0,Math.min(255,parseInt(r[2],10))),Math.max(0,Math.min(255,parseInt(r[3],10)))];let n=t.match(/^hsla?\((\d+),\s*(\d+)%,\s*(\d+)%(?:,\s*[\d.]+)?\)$/);if(n)return this.hslToRgb(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10))}return[255,255,255]}static computeHslToRgb(e,t,r){e=(e%360+360)%360,t=Math.max(0,Math.min(100,t))/100,r=Math.max(0,Math.min(100,r))/100;let n=(1-Math.abs(2*r-1))*t,s=n*(1-Math.abs(e/60%2-1)),o=r-n/2,u,a,d;return e<60?[u,a,d]=[n,s,0]:e<120?[u,a,d]=[s,n,0]:e<180?[u,a,d]=[0,n,s]:e<240?[u,a,d]=[0,s,n]:e<300?[u,a,d]=[s,0,n]:[u,a,d]=[n,0,s],[Math.round((u+o)*255),Math.round((a+o)*255),Math.round((d+o)*255)]}static computeRgbTo256(e,t,r){if(e=Math.max(0,Math.min(255,Math.round(e))),t=Math.max(0,Math.min(255,Math.round(t))),r=Math.max(0,Math.min(255,Math.round(r))),e===t&&t===r)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;let n=Math.round(e/255*5),s=Math.round(t/255*5),o=Math.round(r/255*5);return 16+36*n+6*s+o}};var c=class i{constructor(e=[],t=[],r={}){this.codes=[];this.resetCodes=[];this.codes=e,this.resetCodes=t,this.options=r}shouldApplyStyle(){return this.options.force?!0:(this.options.level??k().colorLevel)>0}addStyle(e,t){if(typeof e!="string"||typeof t!="string")return this;let r=[...this.codes],n=[...this.resetCodes];try{let s=parseInt(e.split(";")[0],10);if(isNaN(s))return new i([...r,e],[t,...n],this.options);let o=s>=30&&s<=37||s>=90&&s<=97||e.startsWith("38;"),u=s>=40&&s<=47||s>=100&&s<=107||e.startsWith("48;");if(o){let a=[];for(let d=r.length-1;d>=0;d--){let f=r[d],p=parseInt(f.split(";")[0],10);isNaN(p)||(p>=30&&p<=37||p>=90&&p<=97||f.startsWith("38;"))&&a.push(d)}for(let d=a.length-1;d>=0;d--){let f=a[d];if(f>=0&&f<r.length){r.splice(f,1);let p=Math.min(n.length-1,Math.max(0,n.length-1-d));p>=0&&p<n.length&&n.splice(p,1)}}}if(u){let a=[];for(let d=r.length-1;d>=0;d--){let f=r[d],p=parseInt(f.split(";")[0],10);isNaN(p)||(p>=40&&p<=47||p>=100&&p<=107||f.startsWith("48;"))&&a.push(d)}for(let d=a.length-1;d>=0;d--){let f=a[d];if(f>=0&&f<r.length){r.splice(f,1);let p=Math.min(n.length-1,Math.max(0,n.length-1-d));p>=0&&p<n.length&&n.splice(p,1)}}}return new i([...r,e],[t,...n],this.options)}catch{return new i([...r,e],[t,...n],this.options)}}apply(e){let t=m.validateText(e);if(!t.valid)return"";let r=t.value.text;if(!this.shouldApplyStyle()||this.codes.length===0)return r;let n=this.codes.map(o=>we(o)).join(""),s=this.resetCodes.map(o=>we(o)).join("");return n+r+s}get bold(){return this.addStyle(String(l.bold),String(l.resetBold))}get dim(){return this.addStyle(String(l.dim),String(l.resetDim))}get italic(){return this.addStyle(String(l.italic),String(l.resetItalic))}get underline(){return this.addStyle(String(l.underline),String(l.resetUnderline))}get inverse(){return this.addStyle(String(l.inverse),String(l.resetInverse))}get hidden(){return this.addStyle(String(l.hidden),String(l.resetHidden))}get strikethrough(){return this.addStyle(String(l.strikethrough),String(l.resetStrikethrough))}get black(){return this.addStyle(String(l.black),String(l.defaultColor))}get red(){return this.addStyle(String(l.red),String(l.defaultColor))}get green(){return this.addStyle(String(l.green),String(l.defaultColor))}get yellow(){return this.addStyle(String(l.yellow),String(l.defaultColor))}get blue(){return this.addStyle(String(l.blue),String(l.defaultColor))}get magenta(){return this.addStyle(String(l.magenta),String(l.defaultColor))}get cyan(){return this.addStyle(String(l.cyan),String(l.defaultColor))}get white(){return this.addStyle(String(l.white),String(l.defaultColor))}get gray(){return this.addStyle(String(l.brightBlack),String(l.defaultColor))}get grey(){return this.gray}get bgBlack(){return this.addStyle(String(l.bgBlack),String(l.bgDefaultColor))}get bgRed(){return this.addStyle(String(l.bgRed),String(l.bgDefaultColor))}get bgGreen(){return this.addStyle(String(l.bgGreen),String(l.bgDefaultColor))}get bgYellow(){return this.addStyle(String(l.bgYellow),String(l.bgDefaultColor))}get bgBlue(){return this.addStyle(String(l.bgBlue),String(l.bgDefaultColor))}get bgMagenta(){return this.addStyle(String(l.bgMagenta),String(l.bgDefaultColor))}get bgCyan(){return this.addStyle(String(l.bgCyan),String(l.bgDefaultColor))}get bgWhite(){return this.addStyle(String(l.bgWhite),String(l.bgDefaultColor))}get bgGray(){return this.addStyle(String(l.bgBrightBlack),String(l.bgDefaultColor))}get bgGrey(){return this.bgGray}color(e){let t=this.options.level??k().colorLevel;if(!m.validateColor(e).valid)return this;if(typeof e=="string"){let u={black:l.black,red:l.red,green:l.green,yellow:l.yellow,blue:l.blue,magenta:l.magenta,cyan:l.cyan,white:l.white,gray:l.brightBlack,grey:l.brightBlack},a=e.toLowerCase();if(a in u&&t>=1)return this.addStyle(String(u[a]),String(l.defaultColor));if(/^[0-9a-fA-F]{6}$/.test(e)){let[d,f,p]=O.processColor("#"+e);if(this.options.force||t>=3)return this.addStyle(xe(d,f,p),String(l.defaultColor));if(t>=2){let g=pe(d,f,p);return this.addStyle(fe(g),String(l.defaultColor))}}if(!O.isValidColorName(e)&&!O.isValidHex(e))return this}if(typeof e=="number")return t>=2?this.addStyle(fe(e),String(l.defaultColor)):this;let[n,s,o]=O.processColor(e);if(this.options.force||t>=3)return this.addStyle(xe(n,s,o),String(l.defaultColor));if(t>=2){let u=pe(n,s,o);return this.addStyle(fe(u),String(l.defaultColor))}else if(t>=1)return this;return this}bgColor(e){let t=this.options.level??k().colorLevel;if(!m.validateColor(e).valid)return this;if(typeof e=="string"){let u={black:l.bgBlack,red:l.bgRed,green:l.bgGreen,yellow:l.bgYellow,blue:l.bgBlue,magenta:l.bgMagenta,cyan:l.bgCyan,white:l.bgWhite,gray:l.bgBrightBlack,grey:l.bgBrightBlack},a=e.toLowerCase();if(a in u&&t>=1)return this.addStyle(String(u[a]),String(l.bgDefaultColor))}if(typeof e=="number"&&t>=2)return this.addStyle(Te(e),String(l.bgDefaultColor));let[n,s,o]=O.processColor(e);if(this.options.force||t>=3)return this.addStyle(je(n,s,o),String(l.bgDefaultColor));if(t>=2){let u=pe(n,s,o);return this.addStyle(Te(u),String(l.bgDefaultColor))}else if(t>=1){let u=(n+s+o)/3,a="white";u<64?a="black":n>s&&n>o?a="red":s>n&&s>o?a="green":o>n&&o>s?a="blue":n>128&&s>128?a="yellow":n>128&&o>128?a="magenta":s>128&&o>128&&(a="cyan");let d={black:l.bgBlack,red:l.bgRed,green:l.bgGreen,yellow:l.bgYellow,blue:l.bgBlue,magenta:l.bgMagenta,cyan:l.bgCyan,white:l.bgWhite};return this.addStyle(String(d[a]),String(l.bgDefaultColor))}return this}rgb(e,t,r){return m.validateColor([e,t,r]).valid?this.color([e,t,r]):this}bgRgb(e,t,r){return m.validateColor([e,t,r]).valid?this.bgColor([e,t,r]):this}hex(e){return this.color(e)}bgHex(e){return this.bgColor(e)}};var F=class i{constructor(e={}){this.style=new c([],[],e)}createProxy(e){let t=(...r)=>r.length===0?"":r.length===1&&typeof r[0]=="string"?e.apply(r[0]):Array.isArray(r[0])&&"raw"in r[0]?this.template(e,r[0],...r.slice(1)):e.apply(r.map(String).join(" "));return new Proxy(t,{get:(r,n)=>{if(n==="strip")return this.strip.bind(this);if(n in e){let o=e[n];if(o instanceof c)return this.createProxy(o);if(typeof o=="function")return(...u)=>{let a=o.apply(e,u);return a instanceof c?this.createProxy(a):a}}return r[n]}})}template(e,t,...r){let n="";return t.forEach((s,o)=>{n+=s,o<r.length&&(n+=String(r[o]))}),e.apply(n)}get proxy(){return this.createProxy(this.style)}strip(e){return I(e)}static create(e={}){return new i(e).proxy}};var q=class i{constructor(e){this.chunks=[];this._length=0;e&&this.append(e)}append(e){if(typeof e=="number"){let t=String(e);this.chunks.push(t),this._length+=t.length}else e.length>0&&(this.chunks.push(e),this._length+=e.length);return this}appendLine(e=""){return this.append(e+`
`)}prepend(e){return e.length>0&&(this.chunks.unshift(e),this._length+=e.length),this}insert(e,t){if(e<0||e>this._length)throw new RangeError("Index out of bounds");if(e===0)return this.prepend(t);if(e===this._length)return this.append(t);let r=this.toString();return this.clear(),this.append(r.slice(0,e)),this.append(t),this.append(r.slice(e)),this}clear(){return this.chunks=[],this._length=0,this}toString(){return this.chunks.join("")}get length(){return this._length}isEmpty(){return this._length===0}static create(e){return new i(e)}static ansi(e){return`\x1B[${e.join(";")}m`}static styledText(e,t,r){if(t.length===0)return e;let n=new i;for(let s of t)n.append(`\x1B[${s}m`);n.append(e);for(let s=r.length-1;s>=0;s--)n.append(`\x1B[${r[s]}m`);return n.toString()}},me=class{static acquire(e){let t=this.pool.pop()||new q;return e&&t.append(e),t}static release(e){this.pool.length<this.maxPoolSize&&(e.clear(),this.pool.push(e))}static withBuilder(e){let t=this.acquire();try{return e(t)}finally{this.release(t)}}};me.pool=[],me.maxPoolSize=10;function lt(i,e,t){return(i+e+t)/3<64?30:i>e&&i>t?31:e>i&&e>t?32:i>128&&e>128&&t<64?33:t>i&&t>e?34:i>128&&t>128&&e<64?35:e>128&&t>128&&i<64?36:37}function Ye(i){return O.processColor(i)}function Ae(i,e,t){return Math.round(i+(e-i)*t)}function Ke(i,e,t){i/=255,e/=255,t/=255;let r=Math.max(i,e,t),n=Math.min(i,e,t),s=r-n,o=0,u=r===0?0:s/r,a=r;return s!==0&&(r===i?o=((e-t)/s+(e<t?6:0))/6:r===e?o=((t-i)/s+2)/6:o=((i-e)/s+4)/6),[o*360,u*100,a*100]}function ct(i,e,t){i/=360,e/=100,t/=100;let r=Math.floor(i*6),n=i*6-r,s=t*(1-e),o=t*(1-n*e),u=t*(1-(1-n)*e),a,d,f;switch(r%6){case 0:[a,d,f]=[t,u,s];break;case 1:[a,d,f]=[o,t,s];break;case 2:[a,d,f]=[s,t,u];break;case 3:[a,d,f]=[s,o,t];break;case 4:[a,d,f]=[u,s,t];break;case 5:[a,d,f]=[t,s,o];break;default:[a,d,f]=[0,0,0]}return[Math.round(a*255),Math.round(d*255),Math.round(f*255)]}function ut(i,e,t,r="short"){let[n,s,o]=Ke(i[0],i[1],i[2]),[u,a,d]=Ke(e[0],e[1],e[2]),f=n,p=u;r==="long"?p>f&&p-f>180?f+=360:f>p&&f-p>180&&(p+=360):p>f&&p-f>180?p-=360:f>p&&f-p>180&&(f-=360);let b=(Ae(f,p,t)%360+360)%360,y=Math.max(0,Math.min(100,Ae(s,a,t))),S=Math.max(0,Math.min(100,Ae(o,d,t)));return ct(b,y,S)}function dt(i,e,t){let r=new q;for(let s=0;s<e.length;s++){s>0&&r.append("|");let o=e[s];Array.isArray(o)?r.append(o[0]).append(",").append(o[1]).append(",").append(o[2]):r.append(String(o))}r.append("-").append(i.length).append("-");let n=2166136261;for(let s=0;s<i.length;s++)n^=i.charCodeAt(s),n=Math.imul(n,16777619);return n=Math.abs(n),r.append(n).append("-"),r.append(t.interpolation||"linear").append("-").append(t.hsvSpin||"short"),r.toString()}function ft(i,e,t={}){let r=m.validateText(i);if(!r.valid)return"";let n=r.value.text,s=k();if(!s.supportsColor)return n;let o=m.validateColorArray(e);if(!o.valid)return n;let u=o.value.map(w=>w.original);if(u.length===0)return n;if(u.length===1){let w=u[0],x=Ye(w);return new c([],[],{}).color([x[0],x[1],x[2]]).apply(n)}let a=[...n];if(a.length===0)return n;let d=dt(n,u,t),f=R.getGradient(d);if(f)return f;let p=u.map(Ye),g=Math.max(1,p.length-1),b=a.length/g,y=new q,S="\x1B[39m",te=s.colorLevel,H=t.interpolation==="bezier"||t.hsvSpin;for(let w=0;w<a.length;w++){let x=a[w];if(x===" "||x===`
`||x==="	"){y.append(x);continue}let B=Math.min(Math.floor(w/b),g-1),$=w%b/b,L=p[B],A=p[Math.min(B+1,p.length-1)],h,_,C;if(H?[h,_,C]=ut(L,A,$,t.hsvSpin):(h=Math.round(L[0]+(A[0]-L[0])*$),_=Math.round(L[1]+(A[1]-L[1])*$),C=Math.round(L[2]+(A[2]-L[2])*$)),te>=3)y.append("\x1B[38;2;").append(h).append(";").append(_).append(";").append(C).append("m").append(x).append(S);else if(te>=2){let P=O.rgbTo256(h,_,C);y.append("\x1B[38;5;").append(P).append("m").append(x).append(S)}else{let P=lt(h,_,C);y.append("\x1B[").append(P).append("m").append(x).append(S)}}let de=y.toString();return R.setGradient(d,de),de}function ae(i,e,t={}){return ft(i,e,t)}var ke=Object.assign(function(...e){if(e.length===1&&Array.isArray(e[0])){let t=e[0];return(r,n)=>ae(r,t,n)}else if(e.length>=2){let[t,r,n]=e;return ae(t,r,n)}else if(e.length===1&&typeof e[0]=="string")return e[0];return""},{linear:(i,e)=>ae(i,[e.from,e.to])});function Oe(...i){let e=["#e81416","#ffa500","#faeb36","#79c314","#487de7","#4b369d","#70369d"];if(i.length===0)return(t,r={})=>oe.recover(()=>ae(t,e,r),t,process.env.DEBUG==="true");if(i.length>=1&&typeof i[0]=="string"){let[t,r={}]=i;return oe.recover(()=>ae(t,e,r),t,process.env.DEBUG==="true")}return""}var T=class{static register(e){this.ensureInitialized(),this.resources.add(e)}static unregister(e){this.resources.delete(e)}static disposeAll(){let e=this.isDisposing;if(this.isDisposing=!0,e)return;let t=Array.from(this.resources);this.resources.clear();for(let r of t)try{r.dispose()}catch(n){typeof console<"u"&&console.warn&&console.warn("Error disposing resource:",n)}this.isDisposing=!1}static getResourceCount(){return this.resources.size}static ensureInitialized(){if(this.initialized)return;this.initialized=!0;let e=()=>{this.disposeAll()},t=!1,r=()=>{t||(t=!0,e())};typeof process<"u"&&process.setMaxListeners&&process.getMaxListeners()<20&&process.setMaxListeners(20),typeof process<"u"&&(process.once("exit",r),process.once("SIGINT",r),process.once("SIGTERM",r),process.once("uncaughtException",n=>{console.error("Uncaught exception:",n),r()}),process.once("unhandledRejection",n=>{console.error("Unhandled rejection:",n),r()}))}};T.resources=new Set,T.initialized=!1,T.isDisposing=!1;function Be(i,e,t=0){if(e===0||!isFinite(e)||!isFinite(i))return t;let r=i/e;return isFinite(r)?r:t}function M(i,e,t){try{return i()}catch(r){if(t)try{t(r)}catch{}return e}}var Pe=class i{constructor(){this.hiddenBy=new Set;this.isHidden=!1}static getInstance(){return this.instance||(this.instance=new i),this.instance}hide(e){this.hiddenBy.add(e),this.isHidden||M(()=>{typeof process<"u"&&process.stdout&&(process.stdout.write(qe()),this.isHidden=!0)},void 0)}show(e){this.hiddenBy.delete(e),this.hiddenBy.size===0&&this.isHidden&&M(()=>{typeof process<"u"&&process.stdout&&(process.stdout.write(Ce()),this.isHidden=!1)},void 0)}forceShow(){this.hiddenBy.clear(),this.isHidden&&M(()=>{typeof process<"u"&&process.stdout&&(process.stdout.write(Ce()),this.isHidden=!1)},void 0)}get isCurrentlyHidden(){return this.isHidden}get hiddenByComponents(){return Array.from(this.hiddenBy)}},N=Pe.getInstance();var W=class{constructor(e,t,r={}){this.text=e;this.type=t;this.options=r;this.running=!1;this.isDisposed=!1;this.frameCount=0;this.startTime=0;this.pausedFrame=0;this.pausedIteration=0;let n=m.validateText(e);if(!n.valid)throw new E(n.error,1004,{text:e});if(this.text=n.value.text,r.duration!==void 0){let s=m.validatePositiveNumber(r.duration,"duration");if(!s.valid)throw new E(s.error,1005,{duration:r.duration})}if(r.interval!==void 0){let s=m.validatePositiveNumber(r.interval,"interval");if(!s.valid)throw new E(s.error,1005,{interval:r.interval})}if(r.iterations!==void 0&&r.iterations!==1/0){let s=m.validatePositiveNumber(r.iterations,"iterations");if(!s.valid)throw new E(s.error,1005,{iterations:r.iterations})}this.options={duration:1e3,interval:100,iterations:1/0,...r},this.componentId=`animation-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,T.register(this)}start(){if(this.running||this.isDisposed)return;this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.running=!0,N.hide(this.componentId);let e=this.pausedFrame||1,t=this.pausedIteration||0,r=Math.floor((this.options.duration||1e3)/(this.options.interval||100));this.intervalId=setInterval(()=>{if(this.isDisposed||!this.running){this.stop();return}let n=e%r/r;if(!M(()=>{if(typeof process<"u"&&process.stdout){switch(process.stdout.write("\r"+D()),this.type){case"blink":this.renderBlink(n);break;case"pulse":this.renderPulse(n);break;case"slide":this.renderSlide(n);break;case"typewriter":this.renderTypewriter(n);break;case"fade":this.renderFade(n);break}return!0}return!1},!1)){this.stop();return}e++,e>r&&(t++,e=1,this.options.iterations!==1/0&&this.options.iterations!==void 0&&t>=this.options.iterations&&(this.stop(),this.options.onComplete&&this.options.onComplete())),this.pausedFrame=e,this.pausedIteration=t},this.options.interval)}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.running=!1,this.pausedFrame=0,this.pausedIteration=0,this.isDisposed||N.show(this.componentId)}pause(e,t){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.running=!1,e!==void 0&&(this.pausedFrame=e),t!==void 0&&(this.pausedIteration=t)}resume(){!this.running&&!this.isDisposed&&this.start()}dispose(){this.isDisposed||(this.isDisposed=!0,T.unregister(this),this.stop(),N.show(this.componentId))}renderBlink(e){e<=.5?process.stdout.write(this.text):process.stdout.write(" ".repeat(this.text.length))}renderPulse(e){let t=Math.sin(e*Math.PI)*128+127,r=[t,t,t],n=new c().color(r).apply(this.text);process.stdout.write(n)}renderSlide(e){let t=Math.floor(e*this.text.length),r=this.text.slice(0,t)+" ".repeat(this.text.length-t);process.stdout.write(r)}renderTypewriter(e){let t=Math.floor(e*this.text.length),r=this.text.slice(0,t);process.stdout.write(r+"\u2588")}renderFade(e){let t=e<.5?e*2:(1-e)*2,r=Math.floor(t*255),n=[r,r,r],s=new c().color(n).apply(this.text);process.stdout.write(s)}};function Le(i,e,t){let r=new W(i,e,t);return r.start(),r}var U={dots:{frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],interval:80},dots2:{frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"],interval:80},dots3:{frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"],interval:80},line:{frames:["-","\\","|","/"],interval:130},line2:{frames:["\u2802","-","\u2013","\u2014","\u2013","-"],interval:100},pipe:{frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"],interval:100},star:{frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"],interval:70},toggle:{frames:["\u22B6","\u22B7"],interval:250},box:{frames:["\u25F0","\u25F3","\u25F2","\u25F1"],interval:120},circle:{frames:["\u25D0","\u25D3","\u25D1","\u25D2"],interval:120},arrow:{frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"],interval:100},bounce:{frames:["\u2801","\u2802","\u2804","\u2802"],interval:120},bar:{frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2588","\u2587","\u2586","\u2585","\u2584","\u2583"],interval:80},earth:{frames:["\u{1F30D}","\u{1F30E}","\u{1F30F}"],interval:180},moon:{frames:["\u{1F311}","\u{1F312}","\u{1F313}","\u{1F314}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}"],interval:80},clock:{frames:["\u{1F550}","\u{1F551}","\u{1F552}","\u{1F553}","\u{1F554}","\u{1F555}","\u{1F556}","\u{1F557}","\u{1F558}","\u{1F559}","\u{1F55A}","\u{1F55B}"],interval:100},balloon:{frames:[" ",".","o","O","@","*"," "],interval:140},noise:{frames:["\u2593","\u2592","\u2591"],interval:100},boxBounce:{frames:["\u2596","\u2598","\u259D","\u2597"],interval:120},triangle:{frames:["\u25E2","\u25E3","\u25E4","\u25E5"],interval:50},binary:{frames:["010010","101101","010010","101010"],interval:120},runner:{frames:["\u{1F6B6}","\u{1F3C3}"],interval:140},pong:{frames:["\u2590\u2802       \u258C","\u2590\u2808       \u258C","\u2590 \u2802      \u258C","\u2590 \u2820      \u258C","\u2590  \u2840     \u258C","\u2590  \u2820     \u258C","\u2590   \u2802    \u258C","\u2590   \u2808    \u258C","\u2590    \u2802   \u258C","\u2590    \u2820   \u258C","\u2590     \u2840  \u258C","\u2590     \u2820  \u258C","\u2590      \u2802 \u258C","\u2590      \u2808 \u258C","\u2590       \u2802\u258C","\u2590       \u2820\u258C","\u2590       \u2840\u258C","\u2590      \u2820 \u258C","\u2590      \u2802 \u258C","\u2590     \u2808  \u258C","\u2590     \u2802  \u258C","\u2590    \u2820   \u258C","\u2590    \u2840   \u258C","\u2590   \u2820    \u258C","\u2590   \u2802    \u258C","\u2590  \u2808     \u258C","\u2590  \u2802     \u258C","\u2590 \u2820      \u258C","\u2590 \u2840      \u258C","\u2590\u2820       \u258C"],interval:80},shark:{frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"],interval:120},dqpb:{frames:["d","q","p","b"],interval:100},weather:{frames:["\u2600\uFE0F ","\u26C5 ","\u{1F324} ","\u26C8 ","\u{1F327} ","\u{1F326} ","\u2600\uFE0F "],interval:100},christmas:{frames:["\u{1F332}","\u{1F384}"],interval:400}},Y=class{constructor(e,t,r){this.text=e;this.currentFrame=0;this.running=!1;this.isDisposed=!1;var a,d;let n=m.validateText(e);if(!n.valid)throw new E(n.error,1004,{text:e});this.text=n.value.text;let s="dots",o=80;if(typeof t=="string"?(s=t,o=r??((a=U[s])==null?void 0:a.interval)??80):t&&typeof t=="object"&&(s=t.spinner??"dots",o=t.interval??((d=U[s])==null?void 0:d.interval)??80),o){let f=m.validatePositiveNumber(o,"interval");if(!f.valid)throw new E(f.error,1005,{interval:o})}let u=U[s];u?(this.frames=[...u.frames],this.interval=o):(this.frames=[...U.dots.frames],this.interval=o),this.componentId=`spinner-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,T.register(this)}start(){this.running||this.isDisposed||(this.intervalId&&clearInterval(this.intervalId),this.running=!0,N.hide(this.componentId),this.intervalId=setInterval(()=>{if(this.isDisposed){this.stop();return}M(()=>{if(typeof process<"u"&&process.stdout){let t=this.frames[this.currentFrame];return process.stdout.write(`\r${t} ${this.text}`),this.currentFrame=(this.currentFrame+1)%this.frames.length,!0}return!1},!1)||this.stop()},this.interval))}stop(e){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.running=!1,this.isDisposed||M(()=>{typeof process<"u"&&process.stdout&&(process.stdout.write("\r"+D()),e&&process.stdout.write(e),process.stdout.write(`
`)),N.show(this.componentId)},void 0)}update(e){this.text=e}updateColor(e){}succeed(e){this.stop(`\u2713 ${e||this.text}`)}fail(e){this.stop(`\u2717 ${e||this.text}`)}warn(e){this.stop(`\u26A0 ${e||this.text}`)}info(e){this.stop(`\u2139 ${e||this.text}`)}clear(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.running=!1,this.isDisposed||M(()=>{typeof process<"u"&&process.stdout&&process.stdout.write("\r"+D()),N.show(this.componentId)},void 0)}dispose(){this.isDisposed||(this.isDisposed=!0,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),T.unregister(this),this.clear(),N.show(this.componentId))}};function Ee(i,e){let t=new Y(i,e);return t.start(),t}var ht={single:{topLeft:"\u250C",topRight:"\u2510",bottomLeft:"\u2514",bottomRight:"\u2518",horizontal:"\u2500",vertical:"\u2502"},double:{topLeft:"\u2554",topRight:"\u2557",bottomLeft:"\u255A",bottomRight:"\u255D",horizontal:"\u2550",vertical:"\u2551"},round:{topLeft:"\u256D",topRight:"\u256E",bottomLeft:"\u2570",bottomRight:"\u256F",horizontal:"\u2500",vertical:"\u2502"},bold:{topLeft:"\u250F",topRight:"\u2513",bottomLeft:"\u2517",bottomRight:"\u251B",horizontal:"\u2501",vertical:"\u2503"},ascii:{topLeft:"+",topRight:"+",bottomLeft:"+",bottomRight:"+",horizontal:"-",vertical:"|"}};function Je(i){return typeof i=="number"?{top:i,right:i,bottom:i,left:i}:{top:(i==null?void 0:i.top)??0,right:(i==null?void 0:i.right)??0,bottom:(i==null?void 0:i.bottom)??0,left:(i==null?void 0:i.left)??0}}function gt(i,e){let t=[],r=i.split(" "),n="";for(let s of r){let o=n?`${n} ${s}`:s;I(o).length<=e?n=o:(n&&t.push(n),n=s)}return n&&t.push(n),t}function mt(i,e,t){let r=I(i).length,n=e-r;if(n<=0)return i;switch(t){case"center":{let s=Math.floor(n/2),o=n-s;return" ".repeat(s)+i+" ".repeat(o)}case"right":return" ".repeat(n)+i;default:return i+" ".repeat(n)}}function K(i,e={}){let{padding:t=0,margin:r=0,borderStyle:n="single",borderColor:s,backgroundColor:o,align:u="left",title:a,titleAlignment:d="center",width:f,wrap:p=!0}=e,g=ht[n],b=Je(t),y=Je(r),S=i.split(`
`);f&&p&&(S=S.flatMap(h=>gt(h,f-b.left-b.right-2)));let te=Math.max(...S.map(h=>I(h).length),0),H=0;if(a){let h=I(a).length;h>te?H=h+8:H=h+4}let de=Math.max(te+b.left+b.right,H),w=f?Math.max(f-2,H):de,x=S.map(h=>{let _=mt(h,w-b.left-b.right,u);return" ".repeat(b.left)+_+" ".repeat(b.right)});for(let h=0;h<b.top;h++)x.unshift(" ".repeat(w));for(let h=0;h<b.bottom;h++)x.push(" ".repeat(w));let B=new c;s&&(B=B.color(s));let $=g.topLeft+g.horizontal.repeat(w)+g.topRight;if(a){let h=I(a).length,_=w-h-2,C,P;switch(d){case"center":{let re=Math.ceil(_/2),ve=_-re;C=g.horizontal.repeat(re)+" ",P=" "+g.horizontal.repeat(ve);break}case"left":{C=" ",P=" "+g.horizontal.repeat(_);break}case"right":{C=g.horizontal.repeat(_)+" ",P=" ";break}default:{let re=Math.floor(_/2),ve=_-re;C=g.horizontal.repeat(re)+" ",P=" "+g.horizontal.repeat(ve)}}$=g.topLeft+C+a+P+g.topRight}let L=g.bottomLeft+g.horizontal.repeat(w)+g.bottomRight,A=[];if(A.push(B.apply($)),x.forEach(h=>{let _=B.apply(g.vertical)+h+B.apply(g.vertical);o&&(_=(typeof o=="string"?new c().bgColor(o):new c().bgColor(o)).apply(_)),A.push(_)}),A.push(B.apply(L)),y.top>0)for(let h=0;h<y.top;h++)A.unshift("");if(y.bottom>0)for(let h=0;h<y.bottom;h++)A.push("");return A.map(h=>y.left>0&&h!==""?" ".repeat(y.left)+h:h).join(`
`)}var bt=K,Er=Object.assign(K,{box:K,create:bt});var z=class{constructor(e={}){this.current=0;this.startTime=Date.now();this.lastRender=0;this.isDisposed=!1;if(e.total!==void 0&&(typeof e.total!="number"||!Number.isFinite(e.total)||e.total<0))throw new G("total must be a non-negative number",5001,{option:"total",value:e.total});if(e.width!==void 0){let t=m.validatePositiveNumber(e.width,"width");if(!t.valid)throw new G(t.error,5001,{option:"width",value:e.width})}if(e.renderThrottle!==void 0){let t=m.validatePositiveNumber(e.renderThrottle,"renderThrottle");if(!t.valid)throw new G(t.error,5001,{option:"renderThrottle",value:e.renderThrottle})}if(e.barColor!==void 0){let t=m.validateColor(e.barColor);if(!t.valid)throw new G(t.error,1001,{option:"barColor",value:e.barColor})}if(e.completeColor!==void 0){let t=m.validateColor(e.completeColor);if(!t.valid)throw new G(t.error,1001,{option:"completeColor",value:e.completeColor})}this.options={total:100,width:40,complete:"\u2588",incomplete:"\u2591",head:"",clear:!1,renderThrottle:16,format:":bar :percent :etas",stream:process.stdout,barColor:"",completeColor:"",...e},this.componentId=`progress-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,T.register(this)}tick(e=1,t){if(this.isDisposed)return;if(typeof e!="number"||!Number.isFinite(e))throw new se("Delta must be a finite number",1005,{delta:e});let r=this.current;this.current=Math.min(this.current+e,this.options.total),this.render(t,r!==this.current)}update(e,t){if(!this.isDisposed){if(typeof e!="number"||!Number.isFinite(e))throw new se("Current value must be a finite number",1005,{current:e});this.current=Math.max(0,Math.min(e,this.options.total)),this.render(t)}}render(e,t=!1){if(this.isDisposed)return;let r=Date.now();if(!t&&this.options.renderThrottle>0&&r-this.lastRender<this.options.renderThrottle&&this.current<this.options.total)return;this.lastRender=r;let n=Be(this.current,this.options.total),s=Math.max(0,Math.min(1,n)),o=Math.max(0,Math.floor(this.options.width*s)),u=Math.max(0,this.options.width-o),a=this.options.complete.repeat(Math.max(0,o)),d=this.options.incomplete.repeat(Math.max(0,u));if(this.options.head&&o>0&&o<this.options.width&&(a=a.slice(0,-1)+this.options.head),this.options.barColor){let y=new c;a=typeof this.options.barColor=="string"?y.color(this.options.barColor).apply(a):y.color(this.options.barColor).apply(a)}let f=a+d,p=(r-this.startTime)/1e3,g=s>0?p/s-p:0,b=this.options.format.replace(":bar",f).replace(":percent",`${Math.floor(s*100)}%`).replace(":current",String(this.current)).replace(":total",String(this.options.total)).replace(":elapsed",this.formatTime(p)).replace(":etas",g>0?this.formatTime(g):"").replace(":eta",this.formatTime(g));if(e&&Object.entries(e).forEach(([y,S])=>{b=b.replace(`:${y}`,S)}),this.options.completeColor&&s===1){let y=new c;b=typeof this.options.completeColor=="string"?y.color(this.options.completeColor).apply(b):y.color(this.options.completeColor).apply(b)}M(()=>{N.hide(this.componentId),this.options.stream.write("\r"+D()+b)},void 0,()=>{this.dispose()})}formatTime(e){if(!isFinite(e)||e<0)return"0:00";let t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60);return t>0?`${t}:${r.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${r}:${n.toString().padStart(2,"0")}`}complete(){if(!this.isDisposed){this.current=this.options.total,this.render();try{this.options.stream.write(`
`),N.show(this.componentId),this.options.clear&&this.options.stream.write("\r"+D())}catch{}this.dispose()}}getRenderString(){let e=Be(this.current,this.options.total),t=Math.max(0,Math.floor(this.options.width*e)),r=Math.max(0,this.options.width-t),n=this.options.complete.repeat(t),s=this.options.incomplete.repeat(r);this.options.head&&t>0&&t<this.options.width&&(n=n.slice(0,-1)+this.options.head);let o=n+s,u=(Date.now()-this.startTime)/1e3,a=e>0?u/e-u:0;return this.options.format.replace(":bar",o).replace(":percent",`${Math.floor(e*100)}%`).replace(":current",String(this.current)).replace(":total",String(this.options.total)).replace(":elapsed",this.formatTime(u)).replace(":etas",a>0?this.formatTime(a):"").replace(":eta",this.formatTime(a))}dispose(){this.isDisposed||(this.isDisposed=!0,T.unregister(this),N.show(this.componentId))}},J=class{constructor(e={}){this.bars=[];this.isDisposed=!1;this.options={total:100,width:40,complete:"\u2588",incomplete:"\u2591",stream:process.stdout,...e},T.register(this)}newBar(e,t){if(this.isDisposed)throw new Error("MultiProgress has been disposed");let r=new z({format:e,...this.options,...t,stream:this.options.stream});return this.bars.push(r),r}render(){this.isDisposed||M(()=>{if(this.bars.length>0)for(let e=0;e<this.bars.length;e++)this.options.stream.write("\x1B[1A");this.bars.forEach((e,t)=>{this.options.stream.write("\r"+D()+e.getRenderString()),t<this.bars.length-1&&this.options.stream.write(`
`)})},void 0,()=>{this.dispose()})}update(){this.render()}dispose(){if(this.isDisposed)return;this.isDisposed=!0,T.unregister(this);let e=[...this.bars];this.bars=[],e.forEach(t=>{try{t.dispose()}catch(r){console.warn("Error disposing progress bar:",r)}})}};function Fe(i){return new z(i)}function De(i){return new J(i)}function Ge(i,e,t){let r={...t,total:e},n=e>0?i/e:0,s=r.width||40,o=Math.max(0,Math.min(s,Math.floor(s*n))),u=Math.max(0,s-o),a=r.complete||"\u2588",d=r.incomplete||"\u2591";return a.repeat(o)+d.repeat(u)}function Xe(i,e){let t=i,r=!0;for(;r;){r=!1;let n=/\{([^}]+)\}([^{]*?)\{\/\1\}/g;t=t.replace(n,(s,o,u)=>{let a=e[o];return a instanceof c?(r=!0,a.apply(u)):typeof a=="function"?(r=!0,a([u])):s})}return t}function yt(i,e){let t=/\$\{([^}]+)`([^`]*)`\}/g;return i.replace(t,(r,n,s)=>{try{let o=n.split("."),u=e;for(let a of o)if(u&&typeof u=="object"&&a in u)u=u[a];else if(u&&typeof u=="function")u=u[a];else return r;return typeof u=="function"?u(s):u&&typeof u=="object"&&"apply"in u&&typeof u.apply=="function"?u.apply(s):r}catch{return r}})}function vt(i,e={}){let t={...Ve(),...e};return(r,...n)=>{let s="",o=[...r];return o.forEach((u,a)=>{if(s+=u,a<n.length){let d=n[a];if(d&&typeof d=="object"&&"apply"in d&&typeof d.apply=="function"){let p=(o[a+1]||"").match(/^`([^`]*)`(.*)/);if(p){s+=d.apply(p[1]),o[a+1]=p[2];return}}s+=String(d)}}),s=yt(s,i),s=Xe(s,t),s}}function be(i={}){let e=i.formatter||F.create({force:!0}),t={...Ve(),...i.helpers};return vt(e,t)}function $e(i,e={}){let t=Ve(),r=i;return Object.entries(e).forEach(([n,s])=>{let o=new RegExp(`{{${n}}}`,"g");r=r.replace(o,String(s))}),Xe(r,t)}function Ve(){let i=new c([],[],{force:!0});return{bold:i.bold,dim:i.dim,italic:i.italic,underline:i.underline,inverse:i.inverse,hidden:i.hidden,strikethrough:i.strikethrough,black:i.black,red:i.red,green:i.green,yellow:i.yellow,blue:i.blue,magenta:i.magenta,cyan:i.cyan,white:i.white,gray:i.gray,bgBlack:i.bgBlack,bgRed:i.bgRed,bgGreen:i.bgGreen,bgYellow:i.bgYellow,bgBlue:i.bgBlue,bgMagenta:i.bgMagenta,bgCyan:i.bgCyan,bgWhite:i.bgWhite,bgGray:i.bgGray,success:i.green.bold,error:i.red.bold,warning:i.yellow.bold,info:i.blue.bold,debug:i.gray.dim}}var le={name:"default",colors:{primary:"#0066cc",secondary:"#6c757d",success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8",debug:"#6c757d",muted:"#999999",accent:"#e91e63",highlight:"#ffeb3b"},styles:{heading1:new c([],[],{force:!0}).bold.underline,heading2:new c([],[],{force:!0}).bold,heading3:new c([],[],{force:!0}).underline,text:new c([],[],{force:!0}),bold:new c([],[],{force:!0}).bold,italic:new c([],[],{force:!0}).italic,underline:new c([],[],{force:!0}).underline,code:new c([],[],{force:!0}).bgColor("#2d2d2d").color("#f8f8f2"),link:new c([],[],{force:!0}).underline.color("#0066cc"),quote:new c([],[],{force:!0}).italic.color("#6c757d"),list:new c([],[],{force:!0}).color("#333333")}},X={default:le,dark:{name:"dark",colors:{primary:"#61afef",secondary:"#abb2bf",success:"#98c379",error:"#e06c75",warning:"#e5c07b",info:"#56b6c2",debug:"#5c6370",muted:"#5c6370",accent:"#c678dd",highlight:"#d19a66"},styles:{heading1:new c([],[],{force:!0}).bold.color("#61afef"),heading2:new c([],[],{force:!0}).bold.color("#98c379"),heading3:new c([],[],{force:!0}).color("#e5c07b"),text:new c([],[],{force:!0}).color("#abb2bf"),bold:new c([],[],{force:!0}).bold,italic:new c([],[],{force:!0}).italic,underline:new c([],[],{force:!0}).underline,code:new c([],[],{force:!0}).bgColor("#282c34").color("#abb2bf"),link:new c([],[],{force:!0}).underline.color("#61afef"),quote:new c([],[],{force:!0}).italic.color("#5c6370"),list:new c([],[],{force:!0}).color("#abb2bf")}},ocean:{name:"ocean",colors:{primary:"#0074d9",secondary:"#39cccc",success:"#2ecc40",error:"#ff4136",warning:"#ff851b",info:"#7fdbff",debug:"#b10dc9",muted:"#aaaaaa",accent:"#f012be",highlight:"#ffdc00"},styles:{heading1:new c([],[],{force:!0}).bold.color("#0074d9"),heading2:new c([],[],{force:!0}).bold.color("#39cccc"),heading3:new c([],[],{force:!0}).color("#7fdbff"),text:new c([],[],{force:!0}),bold:new c([],[],{force:!0}).bold,italic:new c([],[],{force:!0}).italic,underline:new c([],[],{force:!0}).underline,code:new c([],[],{force:!0}).bgColor("#001f3f").color("#7fdbff"),link:new c([],[],{force:!0}).underline.color("#0074d9"),quote:new c([],[],{force:!0}).italic.color("#39cccc"),list:new c([],[],{force:!0}).color("#0074d9")}},forest:{name:"forest",colors:{primary:"#228b22",secondary:"#8b4513",success:"#32cd32",error:"#dc143c",warning:"#ffa500",info:"#4682b4",debug:"#696969",muted:"#808080",accent:"#ff1493",highlight:"#ffd700"},styles:{heading1:new c([],[],{force:!0}).bold.color("#228b22"),heading2:new c([],[],{force:!0}).bold.color("#32cd32"),heading3:new c([],[],{force:!0}).color("#8b4513"),text:new c([],[],{force:!0}),bold:new c([],[],{force:!0}).bold,italic:new c([],[],{force:!0}).italic,underline:new c([],[],{force:!0}).underline,code:new c([],[],{force:!0}).bgColor("#013220").color("#90ee90"),link:new c([],[],{force:!0}).underline.color("#228b22"),quote:new c([],[],{force:!0}).italic.color("#8b4513"),list:new c([],[],{force:!0}).color("#228b22")}}};function ye(i){let e=new c([],[],{force:!0}),t={};return Object.entries(i).forEach(([r,n])=>{n&&(t[r]=s=>e.color(n).apply(s))}),t}var Z=class{constructor(e="default"){this.customThemes={};this.currentTheme=X[e]||le}setTheme(e){let t=X[e]||this.customThemes[e];if(t)this.currentTheme=t;else throw new Error(`Theme '${e}' not found`)}getTheme(){return this.currentTheme}registerTheme(e,t){if(typeof e=="string"&&t)this.customThemes[e]={name:e,...t};else if(typeof e=="object"&&"name"in e)this.customThemes[e.name]=e;else throw new Error("Invalid arguments to registerTheme")}getColor(e){return this.currentTheme.colors[e]}getStyle(e){return this.currentTheme.styles[e]}applyTheme(){let e={};return Object.entries(this.currentTheme.colors).forEach(([t,r])=>{r&&(e[t]=n=>new c([],[],{force:!0}).color(r).apply(n))}),Object.entries(this.currentTheme.styles).forEach(([t,r])=>{r&&(e[t]=n=>r.apply(n))}),e}getCurrentTheme(){return this.currentTheme.name}},tn=Object.assign(ye,{create:ye,ThemeManager:Z,themes:X,defaultTheme:le});var Q=class{constructor(e,t){this.conditions=[];let r,n;typeof e=="boolean"?(r=e,n=t||{}):n=e||{},this.options={defaultStyle:new c,fallback:"",...n},n&&typeof n=="object"&&"defaultStyle"in n&&n.defaultStyle===void 0&&(this.options.defaultStyle=void 0),r!==void 0?this.format=ue(r,n):this.format=s=>this.formatText(s)}when(e,t){return this.conditions.push([e,t]),this}elsif(e,t){return this.when(e,t)}else(e){return this.conditions.push([!0,e]),this}formatText(e){for(let[t,r]of this.conditions){let n;try{n=typeof t=="function"?t():t}catch{n=!1}if(n)return typeof r=="string"?r:r.apply(e)}return this.options.defaultStyle?this.options.defaultStyle.apply(e):this.options.fallback||e}};function ue(i,e){if(arguments.length===0)return new Q(e);if(i){let t=new c([],[],{force:!0,...e});return new Proxy(t,{get(n,s){let o=n[s];return o instanceof c?u=>o.apply(u):typeof o=="function"?o.bind(n):o}})}else return _t()}function _t(){let i=()=>t=>t,e=new Proxy(i(),{get:(t,r)=>["red","green","yellow","blue","magenta","cyan","white","gray","black","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","bgGray","bgBlack","bold","dim","italic","underline","inverse","hidden","strikethrough","rgb","hex","bgRgb","bgHex","color","bgColor"].includes(String(r))||r==="apply"?i():e,apply:(t,r,n)=>n[0]||""});return e}var ce={trace:{name:"TRACE",value:10,style:new c().gray,prefix:"\u{1F50D}"},debug:{name:"DEBUG",value:20,style:new c().cyan,prefix:"\u{1F41B}"},info:{name:"INFO",value:30,style:new c().blue,prefix:"\u2139\uFE0F"},warn:{name:"WARN",value:40,style:new c().yellow,prefix:"\u26A0\uFE0F"},error:{name:"ERROR",value:50,style:new c().red,prefix:"\u274C"},fatal:{name:"FATAL",value:60,style:new c().red.bold.inverse,prefix:"\u{1F480}"}},ee=class{constructor(e={}){this.minLevel=ce[e.minLevel||"info"].value,this.usePrefix=e.usePrefix??!0,this.timestamp=e.timestamp??!1}format(e,t){let r=ce[e];if(!r||r.value<this.minLevel)return null;let n="";if(this.timestamp){let s=new Date().toISOString();n+=new c().gray.apply(`[${s}] `)}return this.usePrefix&&r.prefix&&(n+=r.prefix+" "),n+=r.style.apply(`[${r.name}]`)+" ",n+=t,n}trace(e){return this.format("trace",e)}debug(e){return this.format("debug",e)}info(e){return this.format("info",e)}warn(e){return this.format("warn",e)}error(e){return this.format("error",e)}fatal(e){return this.format("fatal",e)}};function Ue(i){return new ee(i)}function ze(){return{success:i=>new c().green.apply("\u2713 ")+i,error:i=>new c().red.apply("\u2717 ")+i,warning:i=>new c().yellow.apply("\u26A0 ")+i,info:i=>new c().blue.apply("\u2139 ")+i,pending:i=>new c().gray.apply("\u25CC ")+i,skipped:i=>new c().gray.dim.apply("\u2298 ")+i}}function He(i,e){return i&&typeof i=="string"&&i.includes("\x1B[")?i:e&&typeof e=="object"&&"apply"in e?e.apply(i):e||i}ue.when=function(i,e,t){try{if(typeof i=="function"){let n=i();return n&&typeof n=="object"&&"then"in n&&typeof n.then=="function"?n.then(o=>o&&t?typeof t=="string"?t:t.apply(e):e).catch(()=>e):n&&t?typeof t=="string"?t:t.apply(e):e}return i&&t?typeof t=="string"?t:t.apply(e):e}catch{return e}};var wt=F.create(),xt=Object.assign(wt,{Style:c,Formatter:F,gradient:ke,rainbow:Oe,animate:Le,Animation:W,spinner:Ee,Spinner:Y,spinners:U,box:K,progressBar:Fe,ProgressBar:z,multiProgress:De,MultiProgress:J,bar:Ge,template:be(),createTemplate:be,templateParse:$e,ThemeManager:Z,themes:X,conditional:ue,ConditionalFormatter:Q,createLogFormatter:Ue,LogFormatter:ee,createStatusFormatter:ze,logLevels:ce,conditionalColor:He,terminal:k,getTerminalInfo:ie,strip:I,stripAnsi:I,create:F.create,get supportsColor(){return k().supportsColor},get level(){return k().colorLevel}}),Tt=new c,St=xt;0&&(module.exports={Animation,ConditionalFormatter,Formatter,LogFormatter,MultiProgress,ProgressBar,Spinner,Style,ThemeManager,animate,bar,box,cacheManager,conditional,conditionalColor,createLogFormatter,createStatusFormatter,createTemplateTag,defaultTheme,getTerminalInfo,gradient,logLevels,multiProgress,progressBar,rainbow,spinner,spinners,stripAnsi,style,templateParse,terminal,themeCreate,themes});
//# sourceMappingURL=index.js.map