vuetty 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -54
- package/dist/build/compiler-core.js +117 -0
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRenderer as e}from"@vue/runtime-core";import{reactive as t,h as n,ref as r,watch as i,onUnmounted as o,nextTick as s,inject as l,computed as a,provide as c,onMounted as h}from"vue";import u from"chalk";import d from"string-width";import p from"terminal-image";import f from"figlet";import{readFileSync as g}from"fs";import{dirname as m,join as v}from"path";import b from"gradient-string";import{marked as y}from"marked";import{highlight as w}from"cli-highlight";import x from"yoga-layout";import{fileURLToPath as S}from"url";class C{constructor(e){this.type=e,this.props={},this.children=[],this.parent=null,this.text="",this.isDirty=!0,this.childrenDirty=!0,this.renderVersion=0,this.cachedOutput=null,this.cachedChildrenOutput=null,this.isLayoutDirty=!0,this.cachedLayoutMetrics=null,this._renderWidth=void 0,this.componentId=null,this.clickable=!1}appendChild(e){e.parent&&e.parent.removeChild(e),e.parent=this,this.children.push(e)}removeChild(e){const t=this.children.indexOf(e);-1!==t&&(this.children.splice(t,1),e.parent=null,e.clearCaches())}insertBefore(e,t){e.parent&&e.parent.removeChild(e),e.parent=this;const n=this.children.indexOf(t);-1!==n?this.children.splice(n,0,e):this.children.push(e)}setText(e){this.text=e}setProps(e){Object.assign(this.props,e)}markDirty(){this.isDirty=!0,this.cachedOutput=null,this.renderVersion++}markLayoutDirty(){this.isLayoutDirty=!0,this.renderVersion++,this.parent&&this.parent.markLayoutDirty()}invalidateChildrenCache(){this.childrenDirty=!0,this.cachedChildrenOutput=null,this.cachedOutput=null}canSkipRender(){return!this.isDirty&&!this.childrenDirty&&null!==this.cachedOutput}clearCaches(){this.cachedOutput=null,this.cachedChildrenOutput=null,this.cachedLayoutMetrics=null,this.isDirty=!0,this.childrenDirty=!0,this.isLayoutDirty=!0}cleanup(){this.clearCaches(),this.parent=null,this.props={},this.text="",this.componentId=null;for(let e=0;e<this.children.length;e++)this.children[e].cleanup();this.children=[]}}class M extends C{constructor(e=""){super("text"),this.text=e}}class k extends C{constructor(e=""){super("comment"),this.text=e}}function I(e,t){if(!e.children||0===e.children.length)return"";if(!e.childrenDirty&&null!==e.cachedChildrenOutput)return e.cachedChildrenOutput;const n=e.children,r=n.length,i=new Array(r);let o=!1;for(let e=0;e<r;e++){const r=n[e],s=r.cachedOutput;i[e]=t(r),i[e]!==s&&(o=!0)}return(o||null===e.cachedChildrenOutput)&&(e.cachedChildrenOutput=i.join("")),e.childrenDirty=!1,e.cachedChildrenOutput}function _(e){if(!e)return;e.isDirty=!0,e.cachedOutput=null;let t=e.parent;for(;t&&!t.childrenDirty;)t.childrenDirty=!0,t.cachedOutput=null,t=t.parent}function L(e,t=!1){if(!e)return;if(!t)return e.isDirty=!0,e.childrenDirty=!0,e.renderVersion++,e.cachedOutput=null,e.cachedChildrenOutput=null,void(e.cachedLayoutMetrics=null);const n=[e];let r=0;for(;n.length>0&&r<1e4;){const e=n.shift();r++,e.isDirty=!0,e.childrenDirty=!0,e.renderVersion++,e.cachedOutput=null,e.cachedChildrenOutput=null,e.cachedLayoutMetrics=null;const t=e.children;if(t)for(let e=0;e<t.length;e++)n.push(t[e])}}const E=new Set(["width","height","flex","flexGrow","flexShrink","flexBasis","flexDirection","gap","padding","paddingLeft","paddingRight","paddingTop","paddingBottom","margin","marginLeft","marginRight","marginTop","marginBottom","border","borderStyle","rows","headers","options","showHeader","minWidth","maxWidth","minHeight","maxHeight","justifyContent","alignItems","alignSelf","alignContent","flexWrap","responsive","_injectedWidth","_viewportVersion","label","hint","validationError","isFocused","disabled","direction","autoResize","minRows","maxRows","font","length","imageLines","count","lines","text"]);const T=t({terminalWidth:80,terminalHeight:24});function B(e){e&&(T.terminalWidth=e.terminalWidth,T.terminalHeight=e.terminalHeight)}let O=[],H=!1;function R(){O=[],H=!0}function A(){H=!1;const e=O;return O=[],e}let D=class{constructor(e=5e3){this.maxSize=e,this.cache=new Map}get(e){if(!this.cache.has(e))return null;const 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),this.cache.set(e,t),this.cache.size>this.maxSize){const e=this.cache.keys().next().value;this.cache.delete(e)}}has(e){return this.cache.has(e)}clear(){this.cache.clear()}get size(){return this.cache.size}};const N=new class{constructor(e={}){this.textMeasurementCache=new D(e.textCacheSize||5e3),this.layoutMetricsCache=new WeakMap,this._metricsEntryCount=0}measureText(e){return this.textMeasurementCache.get(e)}setMeasurement(e,t){this.textMeasurementCache.set(e,t)}hasMeasurement(e){return this.textMeasurementCache.has(e)}getLayoutMetrics(e,t){if(!this.layoutMetricsCache.has(e))return null;return this.layoutMetricsCache.get(e).get(t)||null}setLayoutMetrics(e,t,n){this.layoutMetricsCache.has(e)||this.layoutMetricsCache.set(e,new Map);const r=this.layoutMetricsCache.get(e);if(r.has(t)||this._metricsEntryCount++,r.set(t,n),r.size>3){const e=r.keys().next().value;r.delete(e),this._metricsEntryCount--}}invalidateLayoutMetrics(e){if(this.layoutMetricsCache.has(e)){const t=this.layoutMetricsCache.get(e);this._metricsEntryCount-=t.size,this.layoutMetricsCache.delete(e)}}clearAll(){this.textMeasurementCache.clear(),this._metricsEntryCount=0}getStats(){return{textMeasurements:this.textMeasurementCache.size,textCacheMaxSize:this.textMeasurementCache.maxSize,metricsEntries:this._metricsEntryCount,metricsMaxPerNode:3}}},W=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/,$=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i,F={black:[0,0,0],red:[205,49,49],green:[13,188,121],yellow:[229,229,16],blue:[36,114,200],magenta:[188,63,188],cyan:[17,168,205],white:[229,229,229],gray:[102,102,102],grey:[102,102,102],brightRed:[241,76,76],brightGreen:[35,209,139],brightYellow:[245,245,67],brightBlue:[59,142,234],brightMagenta:[214,112,214],brightCyan:[41,184,219],brightWhite:[255,255,255]},z=new Map;function j(e){if(!e)return u.white;const t=function(e){if(!e||"string"!=typeof e)return"";if(e.startsWith("#"))return e.toLowerCase();if(e.startsWith("rgb("))return e.replace(/\s+/g,"");return e}(e);let n=z.get(t);if(n)return n;if(n=P(e)||u.white,z.size>=50){const e=z.keys().next().value;z.delete(e)}return z.set(t,n),n}function P(e,t=u){if(!e)return null;if(t[e])return t[e];if(W.test(e))return t.hex(e);const n=e.match($);if(n){const[,e,r,i]=n,o=parseInt(e),s=parseInt(r),l=parseInt(i);if(o>=0&&o<=255&&s>=0&&s<=255&&l>=0&&l<=255)return t.rgb(o,s,l)}return null}function V(e){if(!e)return null;if(F[e]){const[t,n,r]=F[e];return`[48;2;${t};${n};${r}m`}if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length){const e=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);if(!isNaN(e)&&!isNaN(n)&&!isNaN(r))return`[48;2;${e};${n};${r}m`}}const t=e.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(t){return`[48;2;${parseInt(t[1],10)};${parseInt(t[2],10)};${parseInt(t[3],10)}m`}return null}const G=/^\x1b\[[0-9;]*m/,U=/\x1b\[[0-9;]*m/g,Y=/^\x1b\[0?m$/,X=(()=>{const e=new Array(201);e[0]="";for(let t=1;t<=200;t++)e[t]=" ".repeat(t);return e})();function q(e){return e<=0?"":X[e]??" ".repeat(e)}function J(e){const t=N.measureText(e);if(null!=t)return t;const n=d(e);return N.setMeasurement(e,n),n}function K(e,t){if(!e||t<=0)return"";let n=0,r="",i=0;const o=e.length;let s=!1;for(;i<o&&n<t;){const o=e.slice(i).match(G);if(o){const e=o[0];r+=e,i+=e.length,s=!Y.test(e);continue}const l=e[i],a=d(l);if(!(n+a<=t))break;r+=l,n+=a,i++}return i<o&&s&&(r+="[0m"),r}function Z(e,t){if(!t||t<=0)return e;const n=e.split("\n"),r=[];for(let e=0;e<n.length;e++){const i=n[e];if(J(i)<=t){r.push(i);continue}let o=i,s=[];for(;o.length>0;){if(J(o)<=t){r.push(o);break}let e=0,n=0,i=-1,l=0,a="";for(;n<o.length&&e<t;){const r=o.slice(n).match(G);if(r){const e=r[0];a+=e,Y.test(e)?s=[]:s.push(e),n+=e.length;continue}const c=o[n],h=d(c);if(!(e+h<=t))break;a+=c,e+=h," "===c&&(i=n,l=e),n++}let c=a,h=n;if(i>=0&&l>.3*t){c="";let e=0;for(;e<=i;){const t=o.slice(e).match(G);t?(c+=t[0],e+=t[0].length):(c+=o[e],e++)}h=i+1}s.length>0&&(c+="[0m"),r.push(c.trimEnd()),o=o.slice(h),s.length>0&&o.length>0&&(o=s.join("")+o)}}return r.join("\n")}function Q(e,t){if(!(t.bold||t.italic||t.underline||t.dim||t.color||t.bg))return e;let n=u;if(t.bold&&(n=n.bold),t.italic&&(n=n.italic),t.underline&&(n=n.underline),t.dim&&(n=n.dim),t.color){const e=P(t.color,n);e&&(n=e)}if(t.bg){const e=function(e,t=u){if(!e)return null;const n=`bg${e.charAt(0).toUpperCase()}${e.slice(1)}`;if(t[n])return t[n];if(W.test(e))return t.bgHex(e);const r=e.match($);if(r){const[,e,n,i]=r,o=parseInt(e),s=parseInt(n),l=parseInt(i);if(o>=0&&o<=255&&s>=0&&s<=255&&l>=0&&l<=255)return t.bgRgb(o,s,l)}return null}(t.bg,n);e&&(n=e)}return n(e)}class ee{constructor({node:e,depth:t,absX:n,absY:r,inRow:i,renderNodeFn:o}){this.node=e,this.depth=t,this.absX=n,this.absY=r,this.inRow=i,this._renderNode=o}get props(){return this.node.props||{}}get text(){return this.node.text||""}get children(){return this.node.children||[]}get metrics(){return this.node.cachedLayoutMetrics}getEffectiveWidth(){return void 0!==this.node._renderWidth?this.node._renderWidth:null!=this.node.props?.width?this.node.props.width:this.metrics?.width?this.metrics.width:null}renderChild(e,t={}){return this._renderNode(e,this.depth+1,{parentAbsX:t.parentAbsX??this.absX,parentAbsY:this.absY,yOffset:t.yOffset??0,inRow:t.inRow??this.inRow})}}class te{render(e){throw new Error("render() must be implemented")}}const ne=new class{constructor(){this.handlers=new Map}register(e,t){this.handlers.set(e,t)}get(e){return this.handlers.get(e)||null}has(e){return this.handlers.has(e)}unregister(e){this.handlers.delete(e)}},re={flex:{type:[Number,String],default:null},flexGrow:{type:Number,default:null},flexShrink:{type:Number,default:null},flexBasis:{type:[Number,String],default:null},alignSelf:{type:String,default:null,validator:e=>null===e||["auto","flex-start","flex-end","center","stretch","baseline"].includes(e)}},ie={width:{type:[Number,String],default:null},height:{type:[Number,String],default:null},minWidth:{type:Number,default:null},maxWidth:{type:Number,default:null},minHeight:{type:Number,default:null},maxHeight:{type:Number,default:null}},oe={padding:{type:Number,default:null},paddingLeft:{type:Number,default:null},paddingRight:{type:Number,default:null},paddingTop:{type:Number,default:null},paddingBottom:{type:Number,default:null}},se={margin:{type:Number,default:null},marginLeft:{type:Number,default:null},marginRight:{type:Number,default:null},marginTop:{type:Number,default:null},marginBottom:{type:Number,default:null}},le={...{justifyContent:{type:String,default:null,validator:e=>null===e||["flex-start","flex-end","center","space-between","space-around","space-evenly"].includes(e)},alignItems:{type:String,default:null,validator:e=>null===e||["flex-start","flex-end","center","stretch","baseline"].includes(e)},alignContent:{type:String,default:null,validator:e=>null===e||["flex-start","flex-end","center","stretch","space-between","space-around"].includes(e)},flexWrap:{type:String,default:null,validator:e=>null===e||["nowrap","wrap","wrap-reverse"].includes(e)},flexDirection:{type:String,default:null,validator:e=>null===e||["row","column","row-reverse","column-reverse"].includes(e)},gap:{type:Number,default:null}},...re,...ie,...oe,...se},ae={...re,...ie,...oe,...se};var ce={name:"Divider",props:{char:{type:String,default:"─"},length:{type:Number,default:40},color:String,...ae},setup:e=>()=>n("divider",e)};ne.register("divider",new class extends te{render(e){return function(e){const{char:t="─",length:n=40}=e;return Q(t.repeat(n)+"\n",e)}(e.props)}});const he={dots:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],line:["-","\\","|","/"],arc:["◐","◓","◑","◒"],arrow:["▹","▸","▹","▸"],bounce:["⠁","⠈","⠐","⠠","⢀","⡀","⠄","⠂"],clock:["🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚","🕛"],box:["▖","▘","▝","▗"]};var ue={name:"Spinner",props:{type:{type:String,default:"dots",validator:e=>["dots","line","arc","arrow","bounce","clock","box"].includes(e)},modelValue:{type:Boolean,default:!0},interval:{type:Number,default:100,validator:e=>e>0},label:{type:String,default:""},labelPosition:{type:String,default:"right",validator:e=>["left","right"].includes(e)},color:String,bold:Boolean,italic:Boolean,underline:Boolean,dim:Boolean,...ae},emits:["update:modelValue"],setup(e){const t=r(0),l=r(!1);let a=null;function c(){l.value||(l.value=!0,t.value=0,u())}function h(){l.value=!1,null!==a&&(clearTimeout(a),a=null),t.value=0}function u(){if(!l.value)return;const n=he[e.type]||he.dots;t.value=(t.value+1)%n.length,s(()=>{l.value&&(a=setTimeout(u,e.interval))})}return i(()=>e.modelValue,e=>{e?c():h()},{immediate:!0}),i(()=>e.type,()=>{l.value&&(t.value=0)}),i(()=>e.interval,()=>{l.value&&(h(),c())}),o(()=>{h()}),()=>n("spinner",{...e,frame:t.value})}};ne.register("spinner",new class extends te{render(e){return function(e){const{type:t="dots",frame:n=0,label:r="",labelPosition:i="right"}=e,o=he[t]||he.dots,s=o[n%o.length];return Q(("left"===i?[r,r?" ":"",s]:[s,r?" ":"",r]).join(""),e)}(e.props)}});var de={name:"Spacer",props:{count:{type:Number,default:1}},setup:e=>()=>n("spacer",e)};ne.register("spacer",new class extends te{render(e){return t=e.props," ".repeat(t&&t.count||1);var t}});var pe={name:"Newline",props:{count:{type:Number,default:1}},setup:e=>()=>n("newline",e)};ne.register("newline",new class extends te{render(e){return function(e){const t=e&&e.count||1;return"\n".repeat(t)}(e.props)}});const fe="vuetty:inputManager",ge="vuetty:viewportState",me="vuetty:instance",ve="vuetty:theme",be=Symbol("vuettyWidthContext");var ye={name:"ProgressBar",props:{value:{type:Number,required:!0,default:0},max:{type:Number,default:100},width:{type:Number,default:40},char:{type:String,default:"█"},emptyChar:{type:String,default:"░"},showPercentage:{type:Boolean,default:!0},label:{type:String,default:""},labelPosition:{type:String,default:"left",validator:e=>["left","right","above","below"].includes(e)},brackets:{type:Boolean,default:!0},color:String,emptyColor:String,percentageColor:String,bold:Boolean,italic:Boolean,underline:Boolean,dim:Boolean,...ae},setup(e){const t=l(ge,null),r=l(be,null);return()=>{const i="function"==typeof r?r():r,o={...e,_injectedWidth:i,_viewportVersion:t?t.version:0};return n("progressbar",o)}}};ne.register("progressbar",new class extends te{render(e){return function(e){const{value:t=0,max:n=100,width:r=40,char:i="█",emptyChar:o="░",showPercentage:s=!0,label:l="",labelPosition:a="left",brackets:c=!0,color:h="green",emptyColor:u="white",percentageColor:d="white"}=e,p=Math.min(100,Math.max(0,t/n*100)),f=Math.round(p/100*r),g=r-f;let m=Q(i.repeat(f),{color:h,bold:e.bold})+Q(o.repeat(g),{color:u,dim:!0});c&&(m="["+m+"]");let v="";s&&(v=Q(` ${p.toFixed(0)}%`,{color:d}));const b=m+v;return"above"===a?Q(l,e)+"\n"+b:"below"===a?b+"\n"+Q(l,e):"left"===a?Q(l,e)+(l?" ":"")+b:b+(l?" ":"")+Q(l,e)}(e.props)}});const we="up",xe="down",Se="left",Ce="right",Me="enter",ke="backspace",Ie="delete",_e="escape",Le="home",Ee="end",Te="pageup",Be="pagedown",Oe="ctrl_c",He="ctrl_d",Re="ctrl_a",Ae="ctrl_e",De="ctrl_enter",Ne={"[A":we,"[B":xe,"[C":Ce,"[D":Se,"[1;2A":we,"[1;2B":xe,"[1;2C":Ce,"[1;2D":Se,"[H":Le,"[F":Ee,"[1~":Le,"[4~":Ee,"[5~":Te,"[6~":Be,"[3~":Ie,"\r":Me,"\n":Me,"":ke,"\b":ke,"\t":"tab","":_e,"":Oe,"":He,"":Re,"":Ae,"\v":"ctrl_k","":"ctrl_w","\r":De,"\n":De};function We(e){return"char"===e.key&&null!==e.char}const $e=0,Fe=1,ze=2,je=64,Pe=65,Ve=4,Ge=8,Ue=16,Ye=32;function Xe(e){let t=e.match(/^\x1b\[<(\d+);(\d+);(\d+)([Mm])$/),n=!0;if(!t&&(t=e.match(/^\x1b\[(\d+);(\d+);(\d+)M$/),n=!1,!t))return null;const r=parseInt(t[1],10),i=parseInt(t[2],10),o=parseInt(t[3],10),s=n&&"m"===t[4],l=-61&r;let a;return a=l===je?"wheel_up":l===Pe?"wheel_down":0!==(r&Ye)&&l<=ze?"drag":l===$e?s?"left_release":"left_click":l===Fe?s?"middle_release":"middle_click":l===ze?s?"right_release":"right_click":"unknown",{type:"mouse",action:a,button:l,x:i,y:o,shift:0!==(r&Ve),ctrl:0!==(r&Ue),alt:0!==(r&Ge)}}let qe=0;var Je={name:"Table",props:{modelValue:{type:Number,default:null},headers:{type:Array,required:!0,default:()=>[]},rows:{type:Array,required:!0,default:()=>[]},label:{type:String,default:""},height:{type:Number,default:10},columnWidths:{type:Array,default:null},striped:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},color:String,bg:String,focusColor:{type:String,default:"cyan"},selectedColor:{type:String,default:"green"},highlightColor:{type:String,default:"yellow"},headerColor:{type:String,default:"white"},stripedColor:{type:String,default:"black"},bold:Boolean,dim:Boolean,...ae},emits:["update:modelValue","change","focus","blur","select"],setup(e,{emit:t}){const s=l(fe),c=l(me,null),h=l(ge,null),u=l(be,null),d="table-"+ ++qe,p=r(0),f=r(0),g=a(()=>null===e.modelValue||void 0===e.modelValue?-1:e.modelValue),m=a(()=>s&&s.isFocused(d));function v(){p.value<f.value?f.value=p.value:p.value>=f.value+e.height&&(f.value=p.value-e.height+1)}function b(){p.value>0&&(p.value--,v())}function y(){p.value<e.rows.length-1&&(p.value++,v())}function w(){p.value=0,v()}return i(m,(e,n)=>{e&&!n?t("focus"):!e&&n&&t("blur")}),i(()=>e.rows,()=>{p.value>=e.rows.length&&(p.value=Math.max(0,e.rows.length-1),v())}),s&&s.registerComponent(d,function(n){if(!e.disabled)if(n.key!==we)if(n.key!==xe)if(n.key!==Le){if(n.key===Ee)return p.value=e.rows.length-1,void v();if(n.key!==Te)if(n.key!==Be)n.key!==Me&&" "!==n.char||0!==e.rows.length&&(t("update:modelValue",p.value),t("change",p.value),t("select",{index:p.value,row:e.rows[p.value]}));else for(let t=0;t<e.height;t++)y();else for(let t=0;t<e.height;t++)b()}else w();else y();else b()},{disabled:e.disabled}),c&&c.registerClickHandler(d,function(t){e.disabled||s.focus(d)}),g.value>=0&&g.value<e.rows.length?(p.value=g.value,v()):e.rows.length>0&&w(),o(()=>{s&&s.unregisterComponent(d),c&&c.unregisterClickHandler(d)}),i(()=>e.disabled,e=>{s&&s.setComponentDisabled(d,e)}),()=>{const t="function"==typeof u?u():u,r=e.rows,i=e.headers;return n("table",{...e,rows:Array.isArray(r)?[...r]:r,headers:Array.isArray(i)?[...i]:i,highlightedIndex:p.value,selectedIndex:g.value,scrollOffset:f.value,isFocused:m.value,_componentId:d,_clickable:!0,_injectedWidth:t,_viewportVersion:h?h.version:0})}}};function Ke(e,t,n,r,i,o,s){const{highlightColor:l,selectedColor:a,isFocused:c,disabled:h}=s;let d=n("│");for(let s=0;s<t.length;s++){const p=String(e[s]||""),f=t[s]-2;let g=p;J(p)>f&&(g=p.substring(0,f-1)+"…");const m=J(g);g=" "+g+" ".repeat(f-m+1);let v=g;if(r&&c&&!h){v=(u[l]?u[l].bold.inverse:u.bold.inverse)(g)}else if(i){v=(u[a]?u[a].bold:u.bold)(g)}else o&&(v=u.bgBlack(g));d+=v+n("│")}return d+"\n"}function Ze(e,t){let n=t("│");for(let r=0;r<e.length;r++)n+=" ".repeat(e[r])+t("│");return n+"\n"}function Qe(e){const{headers:t=[],rows:n=[],label:r="",height:i=10,highlightedIndex:o=0,selectedIndex:s=-1,scrollOffset:l=0,isFocused:a=!1,showHeader:c=!0,striped:h=!0,columnWidths:d=null,focusColor:p="cyan",selectedColor:f="green",highlightColor:g="yellow",headerColor:m="white",stripedColor:v="black",disabled:b=!1}=e;let y="";if(r){y+=Q(a&&!b?u.bold(r):r,e)+"\n"}if(0===t.length&&0===n.length)return y+function(e,t,n){const r=e?t:n.color||"white",i=e?(u[r]||u).bold:u[r]||u;let o="";return o+=i("┌"+"─".repeat(22)+"┐")+"\n",o+=i("│")+" No data".padEnd(22," ")+i("│")+"\n",o+=i("└"+"─".repeat(22)+"┘")+"\n",o}(a,p,e);const w=function(e,t,n){if(n&&n.length>0)return n;const r=Math.max(e.length,...t.map(e=>e.length)),i=Array.from({length:r},()=>0);for(let t=0;t<e.length;t++){const n=String(e[t]||"");i[t]=Math.max(i[t],J(n))}for(const e of t)for(let t=0;t<e.length;t++){const n=String(e[t]||"");i[t]=Math.max(i[t],J(n))}return i.map(e=>e+2)}(t,n,d),x=a&&!b?p:e.color||"white",S=a&&!b?(u[x]||u).bold:u[x]||u;y+=function(e,t){let n="┌";for(let t=0;t<e.length;t++)n+="─".repeat(e[t]),t<e.length-1&&(n+="┬");return n+="┐",t(n)+"\n"}(w,S),c&&t.length>0&&(y+=function(e,t,n,r){let i=n("│");for(let o=0;o<t.length;o++){const s=String(e[o]||""),l=t[o]-2;let a=s;J(s)>l&&(a=s.substring(0,l-1)+"…");const c=J(a);a=" "+a+" ".repeat(l-c+1),i+=(u[r]?u[r].bold:u.bold)(a)+n("│")}return i+"\n"}(t,w,S,m),y+=function(e,t){let n="├";for(let t=0;t<e.length;t++)n+="─".repeat(e[t]),t<e.length-1&&(n+="┼");return n+="┤",t(n)+"\n"}(w,S));const C=n.slice(l,l+i);for(let e=0;e<i;e++){const t=l+e,n=C[e];if(n){y+=Ke(n,w,S,a&&t===o,t===s,h&&t%2==1,{highlightColor:g,selectedColor:f,isFocused:a,disabled:b})}else y+=Ze(w,S)}if(y+=function(e,t){let n="└";for(let t=0;t<e.length;t++)n+="─".repeat(e[t]),t<e.length-1&&(n+="┴");return n+="┘",t(n)+"\n"}(w,S),a&&!b&&(y+=u.dim("↑↓ Navigate • Enter/Space to select • Tab to next field")+"\n"),n.length>i){const e=Math.round(l/Math.max(1,n.length-i)*100);y+=u.dim(`[${e}% - showing ${l+1}-${Math.min(l+i,n.length)} of ${n.length} rows]`)+"\n"}return y}function et(e,t){if(!e||t<=0)return"";const n=e.split("\n"),r=n.length;if(r===t)return e;if(r<t){const e=t-r;for(let t=0;t<e;t++)n.push("");return n.join("\n")}return n.slice(0,t).join("\n")}ne.register("table",new class extends te{render(e){return Qe(e.props)}});const tt=Symbol("vuettyHeightContext"),nt=/\n+$/;class rt{constructor(e=30){this.lines=new Array(e),this.index=0}append(e){if(this.index>=this.lines.length){const e=new Array(2*this.lines.length);for(let t=0;t<this.lines.length;t++)e[t]=this.lines[t];this.lines=e}this.lines[this.index++]=e}toString(){if(0===this.index)return"";if(1===this.index)return this.lines[0];let e=this.lines[0];for(let t=1;t<this.index;t++)e+="\n"+this.lines[t];return e}clear(){for(let e=0;e<this.index;e++)this.lines[e]=null;this.index=0}}const it=[];const ot=new Map;const st={rounded:{topLeft:"╭",topRight:"╮",bottomLeft:"╰",bottomRight:"╯",horizontal:"─",vertical:"│"},square:{topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",horizontal:"─",vertical:"│"},double:{topLeft:"╔",topRight:"╗",bottomLeft:"╚",bottomRight:"╝",horizontal:"═",vertical:"║"},classic:{topLeft:"+",topRight:"+",bottomLeft:"+",bottomRight:"+",horizontal:"-",vertical:"|"},bold:{topLeft:"┏",topRight:"┓",bottomLeft:"┗",bottomRight:"┛",horizontal:"━",vertical:"┃"},dashed:{topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",horizontal:"╌",vertical:"╎"},sparse:{topLeft:"·",topRight:"·",bottomLeft:"·",bottomRight:"·",horizontal:"·",vertical:"·"},light:{topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",horizontal:" ",vertical:" "},button:{topLeft:"╭",topRight:"╮",bottomLeft:"╰",bottomRight:"╯",horizontal:"─",vertical:"│"}};var lt={name:"Box",props:{border:{type:Boolean,default:!0},borderStyle:{type:[String,Object],default:"rounded"},color:String,bg:String,bold:Boolean,italic:Boolean,underline:Boolean,dim:Boolean,title:{type:String,default:null},titleAlign:{type:String,default:"left",validator:e=>["left","center","right"].includes(e)},titlePadding:{type:Number,default:1},...ae,padding:{type:Number,default:0}},setup(e,{slots:t}){const r=l(be,null),i=l(tt,null),o=l(ge,null),s=l(ve,null);let a,h;c(be,()=>{const t=(null!==e.width&&void 0!==e.width?e.width:"function"==typeof r?r():r||T.terminalWidth||process.stdout.columns||80)-(e.border?2:0)-2*e.padding;return t>0?t:null}),c(tt,()=>{const t=null!==e.height&&void 0!==e.height?e.height:"function"==typeof i?i():i;if(null==t)return null;const n=t-(e.border?2:0)-2*e.padding;return n>0?n:null});let u=-1,d=null;return()=>{const l=t.default?t.default():[],c="function"==typeof r?r():r,p="function"==typeof i?i():i,f=o?o.version:0;if(c!==a||p!==h||f!==u||!d){a=c,h=p,u=f;const t=void 0!==e.color?e.color:s?.components?.box?.color,n=void 0!==e.bg?e.bg:s?.components?.box?.bg;d={...e,_injectedWidth:c,_injectedHeight:p,_viewportVersion:f},null!=t&&(d.color=t),null!=n&&(d.bg=n)}return n("box",d,l)}}};function at(e,t){return t&&e?e.replace(/\x1b\[0m/g,"[0m"+t):e}function ct(e,t,n){const{border:r=!1,borderStyle:i="rounded",padding:o=0,paddingLeft:s,paddingRight:l,paddingTop:a,paddingBottom:c,width:h,_injectedWidth:u,_targetHeight:d,title:p=null,titleAlign:f="left",titlePadding:g=1,bg:m,color:v}=t,b=null!=s?s:o,y=null!=l?l:o,w=null!=a?a:o,x=null!=c?c:o;let S=null;if(void 0!==d&&d>0){const e=r?2:0,t=w+x;S=Math.max(0,d-e-t)}const C=m;if(!r&&0===b&&0===y&&0===w&&0===x&&!C)return null!=h?Z(e,h):null!=u?Z(e,u):e.replace(nt,"");const M=r?"string"==typeof i?st[i]||st.rounded:i:{topLeft:" ",topRight:" ",bottomLeft:" ",bottomRight:" ",horizontal:" ",vertical:" "},k=r?2:0,I=b+y;let _,L,E=0;if(p&&p.trim()){E=J(p)+2*g+4}if(null!=h)_=Math.max(0,h-k),E>0&&(_=Math.max(_,E)),L=Math.max(0,_-I);else if(null!=u)L=Math.max(0,u),_=L+I,E>0&&(_=Math.max(_,E),L=Math.max(0,_-I));else{const t=e.split("\n");let n=0;for(let e=0;e<t.length;e++){const r=t[e];if(""!==r.trim()){const e=J(r);e>n&&(n=e)}}_=Math.max(n+I,E),L=Math.max(0,_-I)}let T=e;L>0&&(null!=h||null!=u)&&(T=Z(e,L)),null!==S&&S>0&&(T=et(T,S));let B=T.split("\n");if(null===S||0===S)for(;B.length>0&&""===B[B.length-1].trim();)B.pop();const O=q(b),H=q(y),R=it.pop()||new rt(30),A=C?V(C):null,D=A||"",N=v?function(e){if(!e)return null;const t={black:"[30m",red:"[31m",green:"[32m",yellow:"[33m",blue:"[34m",magenta:"[35m",cyan:"[36m",white:"[37m",gray:"[90m",grey:"[90m",brightRed:"[91m",brightGreen:"[92m",brightYellow:"[93m",brightBlue:"[94m",brightMagenta:"[95m",brightCyan:"[96m",brightWhite:"[97m"};if(t[e])return t[e];if(e.startsWith("#")){let t=e.slice(1);if(3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length){const e=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);if(!isNaN(e)&&!isNaN(n)&&!isNaN(r))return`[38;2;${e};${n};${r}m`}}const n=e.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n)return`[38;2;${parseInt(n[1],10)};${parseInt(n[2],10)};${parseInt(n[3],10)}m`;return null}(v):"";try{if(r){let e;if(p&&p.trim()){const n=q(g)+p+q(g),r=J(n);if(r>_-4){const n=_-4-2*g,r=K(p,Math.max(1,n-1))+"…",i=q(g)+r+q(g),o=_-J(i);let s=Q(i,t);A&&(s=at(s,A));const l=M.topLeft+M.horizontal.repeat(2);e=D+N+l+"[0m"+s+D+N+(M.horizontal.repeat(Math.max(0,o-2))+M.topRight)+"[0m"}else{const i=_-r;let o,s;switch(f){case"right":o=i-2,s=2;break;case"center":o=Math.floor(i/2),s=i-o;break;default:o=2,s=i-2}let l=Q(n,t);A&&(l=at(l,A));const a=M.topLeft+M.horizontal.repeat(Math.max(0,o));e=D+N+a+"[0m"+l+D+N+(M.horizontal.repeat(Math.max(0,s))+M.topRight)+"[0m"}}else e=M.topLeft+M.horizontal.repeat(_)+M.topRight,e=D+N+e+"[0m";R.append(e)}if(w>0){let e;if(r){const t=q(_);e=D+N+M.vertical+"[0m"+D+t+"[0m"+D+N+M.vertical+"[0m"}else e=D+q(_)+"[0m";for(let t=0;t<w;t++)R.append(e)}for(let e=0;e<B.length;e++){const t=B[e],n=J(t),i=q(Math.max(0,L-n)),o=A?at(t,A):t;let s;s=r?D+N+M.vertical+"[0m"+D+O+o+D+i+H+"[0m"+D+N+M.vertical:D+O+o+D+i+H,R.append(s+"[0m")}if(0===B.length&&(r||A)){let e;if(r){const t=q(_);e=D+N+M.vertical+D+t+D+N+M.vertical}else e=D+q(_);R.append(e+"[0m")}if(x>0){let e;if(r){const t=q(_);e=D+N+M.vertical+"[0m"+D+t+"[0m"+D+N+M.vertical+"[0m"}else e=D+q(_)+"[0m";for(let t=0;t<x;t++)R.append(e)}if(r){const e=M.bottomLeft+M.horizontal.repeat(_)+M.bottomRight;R.append(D+N+e+"[0m")}return R.toString()}finally{!function(e){e.clear(),it.length<5&&it.push(e)}(R)}}function ht(e){if(!e)return 0;let t=1;for(let n=0;n<e.length;n++)10===e.charCodeAt(n)&&t++;return t}ne.register("box",new class extends te{render(e){const{node:t,depth:n,absX:r}=e,i=e.props,o=!1!==i.border,s=i.paddingTop??i.padding??0,l=i.paddingLeft??i.padding??0,a=(o?1:0)+s,c=(o?1:0)+l;let h;if(e.children.length>0){if(!e.children.some(e=>"newline"===e.type)&&e.children.length>1){const t=[];let n=0;for(const i of e.children){if("comment"===i.type)continue;const o=e.renderChild(i,{parentAbsX:r+c,yOffset:a+n,inRow:!1});o&&(t.push(o),n+=ht(o))}h=t.join("\n")}else{let n=0;h=I(t,t=>{const i=e.renderChild(t,{parentAbsX:r+c,yOffset:a+n,inRow:!1});return n+=ht(i),i})}}else h=e.text;const u=e.getEffectiveWidth(),d=null!==u&&null==i.width;d&&(t.props.width=u);const p=ct(h,i);return d&&delete t.props.width,p}});var ut={name:"TextBox",props:{color:String,bg:String,bold:Boolean,italic:Boolean,underline:Boolean,dim:Boolean,...ae},setup(e,{slots:t}){const r=l(ge,null),i=l(be,null),o=l(ve,null);let s,a=-1,c="",h=null;return()=>{const l=t.default?t.default():[],u="function"==typeof i?i():i,d=r?r.version:0,p=`${e.color}|${e.bg}|${e.bold}|${e.italic}|${e.underline}|${e.dim}|${e.width}`;if(u!==s||d!==a||p!==c||!h){s=u,a=d,c=p;const t=void 0!==e.color?e.color:o?.foreground,n=void 0!==e.bg?e.bg:o?.components?.textBox?.bg;h={bold:e.bold,italic:e.italic,underline:e.underline,dim:e.dim,width:e.width,padding:e.padding,paddingLeft:e.paddingLeft,paddingRight:e.paddingRight,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,_injectedWidth:u,_viewportVersion:d},null!=t&&(h.color=t),null!=n&&(h.bg=n)}return n("textbox",h,l)}}};ne.register("textbox",new class extends te{render(e){const{node:t}=e;let n=e.text;if(!n){let r=0;n=I(t,t=>{const n=e.renderChild(t,{yOffset:r});return r+=function(e){if(!e)return 0;let t=1;for(let n=0;n<e.length;n++)10===e.charCodeAt(n)&&t++;return t}(n),n})}const r=e.getEffectiveWidth(),i=null!==r&&null==e.props.width;i&&(t.props.width=r);const o=function(e,t){if(!e)return"";const{_injectedWidth:n,_targetHeight:r,width:i,paddingTop:o,paddingBottom:s,paddingLeft:l,paddingRight:a,padding:c=0}=t||{},h=null!=l?l:c,u=null!=a?a:c,d=null!=o?o:c,p=null!=s?s:c,f=null!=i?i:n;let g=e;f&&f>0&&(g=Z(g,Math.max(0,f-h-u)));if(void 0!==r&&r>0){const e=Math.max(0,r-d-p);e>0&&(g=et(g,e))}if(g=Q(g,t||{}),h>0||u>0){const e=g.split("\n"),t=q(h);g=e.map(e=>{const n=J(e),r=q(u+(f?Math.max(0,f-h-u-n):0));return t+e+r}).join("\n")}if(d>0||p>0){const e=g.split("\n"),t=q(f||(e.length>0?J(e[0]):0));for(let n=0;n<d;n++)e.unshift(t);for(let n=0;n<p;n++)e.push(t);g=e.join("\n")}return g}(n,e.props);return i&&delete t.props.width,o}});const dt=new Map;var pt={name:"Image",props:{src:{type:[String,Object],required:!0},width:{type:[Number,String],default:null},height:{type:[Number,String],default:null},preserveAspectRatio:{type:Boolean,default:!0},alt:{type:String,default:""},errorColor:{type:String,default:"red"},errorBorderStyle:{type:String,default:"rounded"},...ae},setup(e){const t=r(null),o=r(!0),s=r(null),l=r(!1),a=r(1);async function c(){o.value=!0,s.value=null;try{l.value=Buffer.isBuffer(e.src);const s=function(){const t=process.stdout.columns||80;if(!e.width&&!e.height){const n=e.maxWidth||t;return Math.min(n,t)}if(e.width){if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("%"))return Math.floor(t*parseFloat(e.width)/100)}return t}(),h=(n=e.src,r=s,i=e.height,c=e.preserveAspectRatio,`${Buffer.isBuffer(n)?`buffer:${n.length}:${n.slice(0,16).toString("hex")}`:`file:${n}`}|${r}|${i}|${c}`),u=dt.get(h);if(u)return t.value=u.data,a.value=u.lines,void(o.value=!1);let d;if(l.value)d=e.src;else{const t=Bun.file(e.src);if(!await t.exists())throw new Error("File not found");d=Buffer.from(await t.arrayBuffer())}const f={width:s,preserveAspectRatio:e.preserveAspectRatio},g=await p.buffer(d,{...f,preferNativeRender:!1}),m=g.split("\n").length;if(dt.size>=20){const e=dt.keys().next().value;dt.delete(e)}dt.set(h,{data:g,lines:m}),a.value=m,t.value=g,o.value=!1}catch(t){s.value={message:t.message||"Failed to load image",path:l.value?"[Buffer]":e.src,code:t.code},o.value=!1}var n,r,i,c}return h(()=>{c()}),i(()=>e.src,()=>{c()}),i(()=>[e.width,e.height,e.maxWidth],()=>{t.value&&!o.value&&c()}),()=>s.value?n(lt,{border:!0,borderStyle:e.errorBorderStyle,padding:1,color:e.errorColor,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth},{default:()=>[n(ut,{color:e.errorColor,bold:!0},{default:()=>"✗ Image Load Error"}),n(pe),n(pe),n(ut,{dim:!0},{default:()=>`Path: ${s.value.path}`}),n(pe),n(ut,{},{default:()=>`Error: ${s.value.message}`}),...e.alt?[n(pe),n(pe),n(ut,{italic:!0},{default:()=>`Alt text: ${e.alt}`})]:[]]}):o.value?n(ut,{dim:!0},{default:()=>"Loading image..."}):n("image",{imageData:t.value,imageLines:a.value,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth})}};ne.register("image",new class extends te{render(e){return function(e){const{imageData:t=""}=e;return t||""}(e.props)}});const ft="├",gt="└",mt="│",vt="──";var bt={name:"Tree",props:{data:{type:Array,required:!0,default:()=>[]},color:String,bg:String,branchColor:{type:String,default:"gray"},folderColor:{type:String,default:"blue"},fileColor:{type:String,default:null},bold:Boolean,dim:Boolean,indent:{type:Number,default:4},showIcons:{type:Boolean,default:!1},...ae},setup(e,{slots:t}){const r=l(be,null),i=l(ge,null),o=l(ve,null);return()=>{const s="function"==typeof r?r():r,l=t.node||t.default||null,a=t.icon||null,c=e.branchColor??o?.components?.tree?.branchColor??"gray",h=e.folderColor??o?.components?.tree?.folderColor??"blue",u=e.fileColor??o?.components?.tree?.fileColor??e.color??null;return n("tree",{...e,branchColor:c,folderColor:h,fileColor:u,_injectedWidth:s,_viewportVersion:i?i.version:0,_nodeSlot:l,_iconSlot:a})}}};ne.register("tree",new class extends te{render(e){return function(e){const{data:t=[],branchColor:n="gray",folderColor:r="blue",fileColor:i=null,showIcons:o=!1}=e;if(!t||0===t.length)return"";const s=[],l=P(n)||u,a=P(r)||u,c=P(i)||u;function h(e,t,n,r){const i=e.children&&e.children.length>0,d=i;let p="";r>0&&(p=l(n?gt+vt+" ":ft+vt+" "));let f="";o&&(f=d?"📁 ":"📄 ");const g=e.name||"";let m;if(e.color){const t=P(e.color)||u;m=d?t.bold(g):t(g)}else m=d?a.bold(g):c(g);if(s.push(t+p+f+m),i){const i=e.children.length;for(let o=0;o<i;o++){const s=e.children[o],a=o===i-1;let c;c=0===r?"":t+(n?" ":l(mt)+" "),h(s,c,a,r+1)}}}const d=t.length;for(let e=0;e<d;e++)h(t[e],"",!0,0);return s.join("\n")}(e.props)}});class yt{constructor(e=100){this.maxSize=e,this.cache=new Map}get(e){if(!this.cache.has(e))return null;const 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),this.cache.size>=this.maxSize){const e=this.cache.keys().next().value;this.cache.delete(e)}this.cache.set(e,t)}has(e){return this.cache.has(e)}clear(){this.cache.clear()}get size(){return this.cache.size}}function wt(e){if(!f.figFonts||!f.figFonts[e])try{let t;try{const n=import.meta.resolve?.("figlet")||"";if(n){const r=m(n.replace("file://","")),i=v(r,"fonts",`${e}.flf`);t=g(i,"utf-8")}}catch{}if(!t)try{const n=v(process.cwd(),"node_modules","figlet","fonts",`${e}.flf`);t=g(n,"utf-8")}catch{}t&&f.parseFont(e,t)}catch(t){console.warn(`Could not preload font "${e}":`,t.message)}}const xt=["Terrace","Standard","Big","Slant"];for(const e of xt)wt(e);const St=new yt(50),Ct=new yt(100);var Mt={name:"BigText",props:{font:{type:String,default:"Standard"},horizontalLayout:{type:String,default:"default"},align:{type:String,default:"left",validator:e=>["left","center","right"].includes(e)},color:String,bg:String,bold:Boolean,italic:Boolean,underline:Boolean,dim:Boolean,...ae},setup:(e,{slots:t})=>()=>{const r=t.default?t.default():[];return n("bigtext",e,r)}};function kt(e,t){if(!e)return"";const{font:n="Standard",horizontalLayout:r="default",align:i="left"}=t||{},o=function(e,t){const{font:n="Standard",horizontalLayout:r="default",align:i="left"}=t||{};return`${e}|${n}|${r}|${i}|${[t?.color||"",t?.bg||"",t?.bold?"B":"",t?.italic?"I":"",t?.underline?"U":"",t?.dim?"D":""].join("")}`}(e,t),s=Ct.get(o);if(null!==s)return s;const l=function(e,t,n){return`${e}|${t}|${n}`}(e,n,r);let a=St.get(l);if(null===a){a=f.textSync(e,{font:n,horizontalLayout:r});const t=a.split("\n");for(;t.length>0&&""===t[t.length-1].trim();)t.pop();a=t.join("\n"),St.set(l,a)}if("left"!==i){const e=a.split("\n"),t=Math.max(...e.map(e=>J(e))),n=e.map(e=>function(e,t,n="left"){const r=t-J(e);if(r<=0)return e;switch(n){case"right":return q(r)+e;case"center":{const t=r>>1;return q(t)+e+q(r-t)}default:return e+q(r)}}(e,t,i));a=n.join("\n")}let c=a;return t&&(t.color||t.bg||t.bold||t.italic||t.underline||t.dim)&&(c=Q(a,t)),Ct.set(o,c),c}function It(){St.clear(),Ct.clear()}function _t(){return{figlet:{size:St.size,maxSize:50},final:{size:Ct.size,maxSize:100}}}ne.register("bigtext",new class extends te{render(e){const{node:t}=e;return kt(e.text||I(t,t=>e.renderChild(t)),e.props)}});const Lt={fire:["#8B0000","#FF4500","#FFD700"],ocean:["#001F3F","#0074D9","#7FDBFF"],sunset:["#4A148C","#FF6F00","#FFD54F"],forest:["#1B5E20","#66BB6A","#C5E1A5"],night:["#1A237E","#5E35B1","#EC407A"]},Et=new Map;var Tt={name:"Gradient",props:{name:{type:String,default:null},colors:{type:Array,default:null},interpolation:{type:String,default:"hsv",validator:e=>["rgb","hsv"].includes(e)},...ae},setup:(e,{slots:t})=>()=>{const r=t.default?t.default():[];return n("gradient",e,r)}};function Bt(e,t){if(!e)return"";const{name:n=null,colors:r=null,interpolation:i="hsv"}=t||{},o=e.replace(U,"");const s=function(e,t,n){const r=t?`custom:${t.join(",")}:${n}`:`preset:${e}:${n}`;let i=Et.get(r);if(i)return i;const o={interpolation:n};if(i=t&&Array.isArray(t)&&t.length>0?b(t,o):e&&b[e]?b[e]:e&&Lt[e]?b(Lt[e],o):b.rainbow,Et.size>50){const e=Et.keys().next().value;Et.delete(e)}return Et.set(r,i),i}(n,r,i);return o.includes("\n")?s.multiline(o):s(o)}ne.register("gradient",new class extends te{render(e){const{node:t}=e;return Bt(e.text||I(t,t=>e.renderChild(t)),e.props)}});let Ot=0;const Ht=[];function Rt(e){e.length=0,Ht.length<5&&Ht.push(e)}const At={topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",horizontal:"─",vertical:"│"},Dt=new Set([1,5,4,11,23,13,10]);var Nt={name:"TextInput",props:{modelValue:{type:String,default:""},multiline:{type:Boolean,default:!1},rows:{type:Number,default:3},minRows:{type:Number,default:1},maxRows:{type:Number,default:void 0},autoResize:{type:Boolean,default:!0},wrapLines:{type:Boolean,default:!0},label:{type:String,default:""},placeholder:{type:String,default:""},hint:{type:[String,Boolean],default:"default"},color:String,borderColor:String,bg:String,focusColor:{type:String,default:"cyan"},errorColor:{type:String,default:"red"},bold:Boolean,italic:Boolean,dim:Boolean,pattern:RegExp,required:Boolean,maxLength:Number,disabled:Boolean,readonly:Boolean,...ae},emits:["update:modelValue","change","focus","blur","validate"],setup(e,{emit:r}){const s=l(fe),c=l(me,null),h=l(ve,null),u=l(ge,null),d=l(be,null),p="textinput-"+ ++Ot,f=t({text:e.modelValue||"",cursor:(e.modelValue||"").length,scrollOffset:0,validationError:null,isFocused:!1});let g=e.modelValue||"";function m(){f.cursor>f.text.length?f.cursor=f.text.length:f.cursor<0&&(f.cursor=0),b(),w(),f.text!==g&&(g=f.text,r("update:modelValue",f.text))}const v=a(()=>s&&s.isFocused(p));function b(){const t=[],n=f.text;e.required&&!n.trim()&&t.push("Required"),e.maxLength&&n.length>e.maxLength&&t.push(`Max ${e.maxLength}`),e.pattern&&!e.pattern.test(n)&&t.push("Invalid format");const i=0===t.length;return f.validationError=i?null:t[0],r("validate",{valid:i,errors:t}),i}function y(){const t=(()=>{const t="function"==typeof d?d():d;let n;return n=void 0!==e.width&&null!==e.width?e.width:null!=t?t:40,n})(),n=Wt(f.text,t),r=f.cursor;for(let e=0;e<n.length;e++){const i=n[e];if(r>=i.startIndex&&r<=i.endIndex){const o=i.text.length>=t;if(r===i.endIndex&&o&&e<n.length-1)continue;return r===i.endIndex&&o&&e===n.length-1?{row:e+1,col:0,visualLines:n}:{row:e,col:r-i.startIndex,visualLines:n}}}const i=n[n.length-1]||{startIndex:0};return{row:n.length-1,col:r-i.startIndex,visualLines:n}}function w(){const{row:t,visualLines:n}=y();let r=e.rows;if(e.autoResize&&(r=Math.max(e.minRows,n.length),e.maxRows&&(r=Math.min(r,e.maxRows))),t<f.scrollOffset?f.scrollOffset=t:t>=f.scrollOffset+r&&(f.scrollOffset=t-r+1),f.scrollOffset>0){const e=Math.max(0,n.length-r);f.scrollOffset>e&&(f.scrollOffset=e)}Rt(n)}function x(e){const{row:t,col:n,visualLines:r}=y(),i=t+e;if(i>=0&&i<r.length){const e=r[i],t=Math.min(n,e.text.length);f.cursor=e.startIndex+t}Rt(r)}i(v,e=>{f.isFocused=e,r(e?"focus":"blur")}),s.registerComponent(p,function(t){if(e.disabled||e.readonly)return!1;const{key:n,char:i}=t,o=f.text;if(t.ctrl&&i){const e=i.charCodeAt(0);if(e<32&&!Dt.has(e))return!0}if(n===Se)return f.cursor>0&&f.cursor--,m(),!0;if(n===Ce)return f.cursor<o.length&&f.cursor++,m(),!0;if(n===we)return x(-1),m(),!0;if(n===xe)return x(1),m(),!0;if(n===Le||n===Re){const e=o.lastIndexOf("\n",f.cursor-1);return f.cursor=-1===e?0:e+1,m(),!0}if(n===Ee||n===Ae){const e=o.indexOf("\n",f.cursor);return f.cursor=-1===e?o.length:e,m(),!0}if(n===ke){if(f.cursor>0){const e=f.cursor;f.text=o.slice(0,e-1)+o.slice(e),f.cursor--}return m(),!0}if(n===Ie||n===He){if(f.cursor<o.length){const e=f.cursor;f.text=o.slice(0,e)+o.slice(e+1)}return m(),!0}if(n===Me){if(e.multiline&&t.shift){const e=f.cursor;f.text=o.slice(0,e)+"\n"+o.slice(e),f.cursor++}else r("change",f.text);return m(),!0}if(n===De)return r("change",f.text),m(),!0;if(We(t)){if(e.maxLength&&o.length>=e.maxLength)return!0;const t=f.cursor;return f.text=o.slice(0,t)+i+o.slice(t),f.cursor+=i.length,m(),!0}return!1},{disabled:e.disabled}),c&&c.registerClickHandler(p,function(t){e.disabled||e.readonly||s.focus(p)}),o(()=>{s&&s.unregisterComponent(p),c&&c.unregisterClickHandler(p)}),i(()=>e.disabled,e=>{s.setComponentDisabled(p,e)}),i(()=>e.modelValue,e=>{const t=e||"";t!==f.text&&(f.text=t,f.cursor=Math.min(f.cursor,f.text.length),g=t,b(),w())},{immediate:!0});let S,C=null,M="",k=-1;return()=>{const t=`${f.text}:${f.cursor}:${f.scrollOffset}:${f.isFocused}:${f.validationError}`,r="function"==typeof d?d():d,i=u?u.version:0;if(t!==M||r!==S||i!==k||!C){M=t,S=r,k=i;const n=e.focusColor||h?.components?.textInput?.focusColor||"cyan",o=e.errorColor||h?.components?.textInput?.errorColor||"red",s=void 0!==e.color?e.color:h?.components?.textInput?.color,l=void 0!==e.borderColor?e.borderColor:h?.components?.textInput?.borderColor??h?.components?.textInput?.color,a=void 0!==e.bg?e.bg:h?.components?.textInput?.bg??h?.background;C={multiline:e.multiline,rows:e.rows,minRows:e.minRows,maxRows:e.maxRows,autoResize:e.autoResize,wrapLines:e.wrapLines,label:e.label,placeholder:e.placeholder,hint:e.hint,color:s,borderColor:l,bg:a,focusColor:n,errorColor:o,bold:e.bold,italic:e.italic,dim:e.dim,disabled:e.disabled,readonly:e.readonly,_componentId:p,_clickable:!0,text:f.text,cursor:f.cursor,scrollOffset:f.scrollOffset,isFocused:f.isFocused,validationError:f.validationError,_injectedWidth:r,_viewportVersion:i},void 0!==e.width&&null!==e.width&&(C.width=e.width)}return n("textinput",C)}}};function Wt(e,t){const n=Ht.pop()||[],r=e.split("\n");let i=0;for(let e=0;e<r.length;e++){const o=r[e];if(0===o.length){n.push({text:"",startIndex:i,endIndex:i}),i+=1;continue}let s=o,l=i;for(;s.length>0;){let e,r;if(s.length<=t)e=s,r=e.length;else{let n=t;const i=s.lastIndexOf(" ",t);i>.3*t&&(n=i+1),e=s.slice(0,n),r=e.length}n.push({text:e,startIndex:l,endIndex:l+r}),l+=r,s=s.slice(r)}i+=o.length+1}return n}ne.register("textinput",new class extends te{render(e){const{node:t}=e,n=e.getEffectiveWidth();null!==n&&(t.props.width=Math.max(1,n-2));const r=function(e){let{text:t="",width:n,_injectedWidth:r,rows:i=3,minRows:o=1,maxRows:s,autoResize:l=!1,cursor:a=0,scrollOffset:c=0,label:h="",placeholder:d="",isFocused:p=!1,validationError:f=null,disabled:g=!1,color:m,borderColor:v,bg:b,focusColor:y="cyan",errorColor:w="red",multiline:x=!1,hint:S="default"}=e;t=null==t?"":String(t);const C=null!=n?n:null!=r?r:40,M=[];if(h){const e=p?u.bold:e=>e;M.push(e(h))}let k=v||"white";f?k=w:p&&(k=y);const I=j(k),_=m?j(m):u,L=V(b),E=L||"",T=e=>{return L?E+(t=e,(n=L)&&t?t.replace(/\x1b\[0m/g,"[0m"+n):t)+"[0m":e;var t,n};M.push(T(I(At.topLeft+At.horizontal.repeat(C)+At.topRight)));const B=Wt(t,C);let O=-1,H=-1;for(let e=0;e<B.length;e++){const t=B[e];if(a>=t.startIndex&&a<=t.endIndex){const n=t.text.length>=C;if(a===t.endIndex&&n&&e<B.length-1)continue;a===t.endIndex&&n&&e===B.length-1?(O=e+1,H=0):(O=e,H=a-t.startIndex);break}}let R=i;if(l){let e=B.length;O===B.length&&e++,R=Math.max(o,e),s&&(R=Math.min(R,s))}const A=j(y);for(let e=0;e<R;e++){const n=c+e,r=(n<B.length?B[n].text:"").padEnd(C);let i;if(p&&!g&&n===O){const e=Math.min(H,C-1);if(0===t.length&&d&&0===n)i=A.inverse(d[0]||" ")+_.dim(d.slice(1).padEnd(C-1));else{const t=r[e]||" ",n=r.slice(0,e),o=r.slice(e+1);i=_(n)+A.inverse(t)+_(o)}}else i=0===t.length&&d&&0===n?_.dim(d.padEnd(C)):_(r);M.push(T(I(At.vertical)+i+I(At.vertical)))}if(Rt(B),M.push(T(I(At.bottomLeft+At.horizontal.repeat(C)+At.bottomRight))),f)M.push(j(w)("✗ "+f));else if(p&&!g){let e="";"default"===S?e=x?"Enter to submit, Shift+Enter for new line":"Enter to submit":S&&!1!==S&&""!==S&&(e=S),e&&M.push(_.dim(e))}return M.join("\n")}(e.props);return null!==n&&delete t.props.width,r}});let $t=0;var Ft={name:"SelectInput",props:{modelValue:{type:[String,Number,Object],default:null},options:{type:Array,required:!0,default:()=>[]},label:{type:String,default:""},height:{type:Number,default:10},width:{type:Number,default:void 0},disabled:{type:Boolean,default:!1},color:String,bg:String,focusColor:{type:String,default:"cyan"},selectedColor:{type:String,default:"green"},highlightColor:{type:String,default:"yellow"},bold:Boolean,dim:Boolean,...ae},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:t}){const s=l(fe),c=l(me,null),h=l(ge,null),u=l(be,null),d="selectinput-"+ ++$t,p=r(0),f=r(0),g=a(()=>null===e.modelValue||void 0===e.modelValue?-1:e.options.findIndex(t=>t.value===e.modelValue)),m=a(()=>s&&s.isFocused(d));function v(){p.value<f.value?f.value=p.value:p.value>=f.value+e.height&&(f.value=p.value-e.height+1)}function b(){if(p.value>0){for(p.value--;p.value>0&&e.options[p.value]?.disabled;)p.value--;v()}}function y(){if(p.value<e.options.length-1){for(p.value++;p.value<e.options.length-1&&e.options[p.value]?.disabled;)p.value++;v()}}function w(){for(p.value=0;p.value<e.options.length-1&&e.options[p.value]?.disabled;)p.value++;v()}return i(m,(e,n)=>{e&&!n?t("focus"):!e&&n&&t("blur")}),i(()=>e.options,()=>{p.value>=e.options.length&&(p.value=Math.max(0,e.options.length-1),v())}),s&&s.registerComponent(d,function(n){if(!e.disabled)if(n.key!==we)if(n.key!==xe)if(n.key!==Le)if(n.key!==Ee)if(n.key!==Te)if(n.key!==Be)n.key!==Me&&" "!==n.char?We(n)&&" "!==n.char&&function(t){const n=t.toLowerCase(),r=p.value;for(let t=r+1;t<e.options.length;t++){const r=e.options[t];if((r.label||String(r.value)).toLowerCase().startsWith(n)&&!r.disabled)return p.value=t,void v()}for(let t=0;t<=r;t++){const r=e.options[t];if((r.label||String(r.value)).toLowerCase().startsWith(n)&&!r.disabled)return p.value=t,void v()}}(n.char):function(){const n=e.options[p.value];n&&!n.disabled&&(t("update:modelValue",n.value),t("change",n.value))}();else for(let t=0;t<e.height;t++)y();else for(let t=0;t<e.height;t++)b();else!function(){for(p.value=e.options.length-1;p.value>0&&e.options[p.value]?.disabled;)p.value--;v()}();else w();else y();else b()},{disabled:e.disabled}),c&&c.registerClickHandler(d,function(t){e.disabled||s.focus(d)}),g.value>=0?(p.value=g.value,v()):w(),o(()=>{s&&s.unregisterComponent(d),c&&c.unregisterClickHandler(d)}),i(()=>e.disabled,e=>{s&&s.setComponentDisabled(d,e)}),()=>{const t="function"==typeof u?u():u;return n("selectinput",{...e,_componentId:d,_clickable:!0,highlightedIndex:p.value,selectedIndex:g.value,scrollOffset:f.value,isFocused:m.value,_injectedWidth:t,_viewportVersion:h?h.version:0})}}};ne.register("selectinput",new class extends te{render(e){const{node:t}=e,n=e.getEffectiveWidth();null!==n&&(t.props.width=n);const r=function(e){const{options:t=[],modelValue:n=null,label:r="",height:i=10,highlightedIndex:o=0,selectedIndex:s=-1,scrollOffset:l=0,isFocused:a=!1,focusColor:c="cyan",selectedColor:h="green",highlightColor:d="yellow",disabled:p=!1}=e;let f="";r&&(f+=Q(a&&!p?`${u.bold(r)}`:r,e)+"\n");if(0===t.length){const t=20,n=a&&!p?c:e.color||"white",r=a&&!p?(u[n]||u).bold:u[n]||u;return f+=r("┌"+"─".repeat(t+2)+"┐")+"\n",f+=r("│")+" No options".padEnd(t+2," ")+r("│")+"\n",f+=r("└"+"─".repeat(t+2)+"┘")+"\n",f}const g=Math.max(20,...t.map(e=>J(e.label||String(e.value)))),m=e.width?e.width:g+4,v=m-2,b=a&&!p?c:e.color||"white",y=a&&!p?(u[b]||u).bold:u[b]||u;f+=y("┌"+"─".repeat(m)+"┐")+"\n";for(let e=0;e<Math.min(i,t.length);e++){const r=l+e,i=t[r];if(i){const e=a&&r===o,t=r===s||i.value===n,l=i.label||String(i.value);let c=" ";t?c=u[h].bold("● "):e&&(c=u[d].bold("▸ "));let g=l.padEnd(v," ");J(l)>v&&(g=l.substring(0,v)),e&&a&&!p?g=u[d].bold.inverse(g):t?g=u[h].bold(g):i.disabled&&(g=u.dim(g)),f+=y("│")+c+g+y("│")+"\n"}else f+=y("│")+" ".repeat(m)+y("│")+"\n"}if(f+=y("└"+"─".repeat(m)+"┘"),a&&!p&&(f+="\n"+u.dim("↑↓ Navigate • Enter to select • Tab to next field")),t.length>i){const e=Math.round(l/Math.max(1,t.length-i)*100);f+="\n"+u.dim(`[${e}% - showing ${l+1}-${Math.min(l+i,t.length)} of ${t.length}]`)}return f}(e.props);return null!==n&&delete t.props.width,r}});let zt=0;var jt={name:"Checkbox",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,required:!0,default:()=>[]},label:{type:String,default:""},direction:{type:String,default:"vertical",validator:e=>["vertical","horizontal"].includes(e)},height:{type:Number,default:10},width:{type:Number,default:null},itemSpacing:{type:Number,default:2},disabled:{type:Boolean,default:!1},color:String,bg:String,focusColor:{type:String,default:"cyan"},selectedColor:{type:String,default:"green"},highlightColor:{type:String,default:"yellow"},bold:Boolean,dim:Boolean,...ae},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:t}){const s=l(fe),c=l(me,null),h=l(ge,null),u=l(be,null),d="checkbox-"+ ++zt,p=r(0),f=r(0),g=a(()=>s&&s.isFocused(d));function m(){p.value<f.value?f.value=p.value:p.value>=f.value+e.height&&(f.value=p.value-e.height+1)}function v(){if(p.value>0){for(p.value--;p.value>0&&e.options[p.value]?.disabled;)p.value--;m()}}function b(){if(p.value<e.options.length-1){for(p.value++;p.value<e.options.length-1&&e.options[p.value]?.disabled;)p.value++;m()}}function y(){for(p.value=0;p.value<e.options.length-1&&e.options[p.value]?.disabled;)p.value++;m()}return i(g,(e,n)=>{e&&!n?t("focus"):!e&&n&&t("blur")}),i(()=>e.options,()=>{p.value>=e.options.length&&(p.value=Math.max(0,e.options.length-1),m())},{deep:!0}),s&&s.registerComponent(d,function(n){if(e.disabled)return;const r="vertical"===e.direction;if(r&&n.key===we||!r&&n.key===Se)v();else if(r&&n.key===xe||!r&&n.key===Ce)b();else if(n.key!==Le)if(n.key!==Ee)if(n.key===Te&&r)for(let t=0;t<e.height;t++)v();else if(n.key===Be&&r)for(let t=0;t<e.height;t++)b();else n.key!==Me&&" "!==n.char?We(n)&&" "!==n.char&&function(t){const n=t.toLowerCase(),r=p.value;for(let t=r+1;t<e.options.length;t++){const r=e.options[t];if((r.label||String(r.value)).toLowerCase().startsWith(n)&&!r.disabled)return p.value=t,void m()}for(let t=0;t<=r;t++){const r=e.options[t];if((r.label||String(r.value)).toLowerCase().startsWith(n)&&!r.disabled)return p.value=t,void m()}}(n.char):function(){const n=e.options[p.value];if(!n||n.disabled)return;const r=[...e.modelValue||[]],i=r.indexOf(n.value);i>=0?r.splice(i,1):r.push(n.value),t("update:modelValue",r),t("change",r)}();else!function(){for(p.value=e.options.length-1;p.value>0&&e.options[p.value]?.disabled;)p.value--;m()}();else y()},{disabled:e.disabled}),c&&c.registerClickHandler(d,function(t){e.disabled||s.focus(d)}),y(),o(()=>{s&&s.unregisterComponent(d),c&&c.unregisterClickHandler(d)}),i(()=>e.disabled,e=>{s&&s.setComponentDisabled(d,e)}),()=>{const t="function"==typeof u?u():u;return n("checkbox",{...e,_componentId:d,_clickable:!0,highlightedIndex:p.value,scrollOffset:f.value,isFocused:g.value,modelValue:e.modelValue,_injectedWidth:t,_viewportVersion:h?h.version:0})}}};function Pt(e){const{direction:t="vertical"}=e;return"horizontal"===t?function(e){const{options:t=[],modelValue:n=[],label:r="",highlightedIndex:i=0,isFocused:o=!1,selectedColor:s="green",highlightColor:l="yellow",disabled:a=!1,width:c=null,itemSpacing:h=2}=e;let d="";r&&(d+=Q(o&&!a?`${u.bold(r)}`:r,e)+"\n");if(0===t.length)return d+=u.dim("No options")+"\n",d;const p=c||process.stdout.columns||80,f=[];let g=[],m=0;for(let e=0;e<t.length;e++){const r=t[e],c=o&&e===i,d=n.includes(r.value),v=r.label||String(r.value);let b;b=d?u[s].bold("[✓]"):"[ ]";let y=`${b} ${v}`;c&&o&&!a?y=u[l].bold.inverse(y):d?y=u[s].bold(y):r.disabled&&(y=u.dim(y));const w=J(y);0===g.length||m+w+h<=p?(g.push(y),m+=w+(g.length>1?h:0)):(f.push(g),g=[y],m=w)}g.length>0&&f.push(g);for(let e=0;e<f.length;e++)e>0&&(d+="\n"),d+=f[e].join(" ".repeat(h));return o&&!a&&(d+="\n"+u.dim("←→ Navigate • Space/Enter to toggle • Tab to next field")),d}(e):function(e){const{options:t=[],modelValue:n=[],label:r="",height:i=10,highlightedIndex:o=0,scrollOffset:s=0,isFocused:l=!1,focusColor:a="cyan",selectedColor:c="green",highlightColor:h="yellow",disabled:d=!1}=e;let p="";r&&(p+=Q(l&&!d?`${u.bold(r)}`:r,e)+"\n");if(0===t.length){const t=20,n=l&&!d?a:e.color||"white",r=l&&!d?(u[n]||u).bold:u[n]||u;return p+=r("┌"+"─".repeat(t+2)+"┐")+"\n",p+=r("│")+" No options".padEnd(t+2," ")+r("│")+"\n",p+=r("└"+"─".repeat(t+2)+"┘")+"\n",p}const f=Math.max(20,...t.map(e=>J(e.label||String(e.value)))),g=e.width?e.width:f+6,m=Math.max(1,g-6),v=l&&!d?a:e.color||"white",b=l&&!d?(u[v]||u).bold:u[v]||u;p+=b("┌"+"─".repeat(g)+"┐")+"\n";for(let e=0;e<Math.min(i,t.length);e++){const r=s+e,i=t[r];if(i){const e=l&&r===o,t=n.includes(i.value),s=i.label||String(i.value);let a=" ";a=t?u[c].bold("[✓]"):"[ ]";let f=s.padEnd(m," ");J(s)>m&&(f=s.substring(0,m)),e&&l&&!d?f=u[h].bold.inverse(f):t?f=u[c].bold(f):i.disabled&&(f=u.dim(f)),p+=b("│")+" "+a+" "+f+b(" │")+"\n"}else p+=b("│")+" ".repeat(g)+b("│")+"\n"}if(p+=b("└"+"─".repeat(g)+"┘"),l&&!d){const t="vertical"===e.direction?"↑↓ Navigate • Space/Enter to toggle • Tab to next field":"←→ Navigate • Space/Enter to toggle • Tab to next field";p+="\n"+u.dim(t)}if(t.length>i){const e=Math.round(s/Math.max(1,t.length-i)*100);p+="\n"+u.dim(`[${e}% - showing ${s+1}-${Math.min(s+i,t.length)} of ${t.length}]`)}return p}(e)}ne.register("checkbox",new class extends te{render(e){const{node:t}=e,n=e.getEffectiveWidth();null!==n&&(t.props.width=Math.max(1,n-2));const r=Pt(e.props);return null!==n&&delete t.props.width,r}});let Vt=0;var Gt={name:"Radiobox",props:{modelValue:{type:[String,Number,Object],default:null},options:{type:Array,required:!0,default:()=>[]},label:{type:String,default:""},direction:{type:String,default:"vertical",validator:e=>["vertical","horizontal"].includes(e)},height:{type:Number,default:10},width:{type:Number,default:null},itemSpacing:{type:Number,default:2},disabled:{type:Boolean,default:!1},color:String,bg:String,focusColor:{type:String,default:"cyan"},selectedColor:{type:String,default:"green"},highlightColor:{type:String,default:"yellow"},bold:Boolean,dim:Boolean,...ae},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:t}){const s=l(fe),c=l(me,null),h="radiobox-"+ ++Vt,u=r(0),d=r(0),p=a(()=>null===e.modelValue||void 0===e.modelValue?-1:e.options.findIndex(t=>t.value===e.modelValue)),f=a(()=>s&&s.isFocused(h));function g(){u.value<d.value?d.value=u.value:u.value>=d.value+e.height&&(d.value=u.value-e.height+1)}function m(){if(u.value>0){for(u.value--;u.value>0&&e.options[u.value]?.disabled;)u.value--;g()}}function v(){if(u.value<e.options.length-1){for(u.value++;u.value<e.options.length-1&&e.options[u.value]?.disabled;)u.value++;g()}}function b(){for(u.value=0;u.value<e.options.length-1&&e.options[u.value]?.disabled;)u.value++;g()}return i(f,(e,n)=>{e&&!n?t("focus"):!e&&n&&t("blur")}),i(()=>e.options,()=>{u.value>=e.options.length&&(u.value=Math.max(0,e.options.length-1),g())},{deep:!0}),s&&s.registerComponent(h,function(n){if(e.disabled)return;const r="vertical"===e.direction;if(r&&n.key===we||!r&&n.key===Se)m();else if(r&&n.key===xe||!r&&n.key===Ce)v();else if(n.key!==Le)if(n.key!==Ee)if(n.key===Te&&r)for(let t=0;t<e.height;t++)m();else if(n.key===Be&&r)for(let t=0;t<e.height;t++)v();else n.key!==Me&&" "!==n.char?We(n)&&" "!==n.char&&function(t){const n=t.toLowerCase(),r=u.value;for(let t=r+1;t<e.options.length;t++){const r=e.options[t];if((r.label||String(r.value)).toLowerCase().startsWith(n)&&!r.disabled)return u.value=t,void g()}for(let t=0;t<=r;t++){const r=e.options[t];if((r.label||String(r.value)).toLowerCase().startsWith(n)&&!r.disabled)return u.value=t,void g()}}(n.char):function(){const n=e.options[u.value];n&&!n.disabled&&(t("update:modelValue",n.value),t("change",n.value))}();else!function(){for(u.value=e.options.length-1;u.value>0&&e.options[u.value]?.disabled;)u.value--;g()}();else b()},{disabled:e.disabled}),c&&c.registerClickHandler(h,function(t){e.disabled||s.focus(h)}),p.value>=0?(u.value=p.value,g()):b(),o(()=>{s&&s.unregisterComponent(h),c&&c.unregisterClickHandler(h)}),i(()=>e.disabled,e=>{s&&s.setComponentDisabled(h,e)}),()=>n("radiobox",{...e,_componentId:h,_clickable:!0,highlightedIndex:u.value,selectedIndex:p.value,scrollOffset:d.value,isFocused:f.value})}};function Ut(e){const{direction:t="vertical"}=e;return"horizontal"===t?function(e){const{options:t=[],modelValue:n=null,label:r="",highlightedIndex:i=0,selectedIndex:o=-1,isFocused:s=!1,selectedColor:l="green",highlightColor:a="yellow",disabled:c=!1,width:h=null,itemSpacing:d=2}=e;let p="";r&&(p+=Q(s&&!c?`${u.bold(r)}`:r,e)+"\n");if(0===t.length)return p+=u.dim("No options")+"\n",p;const f=h||process.stdout.columns||80,g=[];let m=[],v=0;for(let e=0;e<t.length;e++){const r=t[e],h=s&&e===i,p=e===o||r.value===n,b=r.label||String(r.value);let y;y=p?u[l].bold("(●)"):"( )";let w=`${y} ${b}`;h&&s&&!c?w=u[a].bold.inverse(w):p?w=u[l].bold(w):r.disabled&&(w=u.dim(w));const x=J(w);0===m.length||v+x+d<=f?(m.push(w),v+=x+(m.length>1?d:0)):(g.push(m),m=[w],v=x)}m.length>0&&g.push(m);for(let e=0;e<g.length;e++)e>0&&(p+="\n"),p+=g[e].join(" ".repeat(d));return s&&!c&&(p+="\n"+u.dim("←→ Navigate • Space/Enter to select • Tab to next field")),p}(e):function(e){const{options:t=[],modelValue:n=null,label:r="",height:i=10,highlightedIndex:o=0,selectedIndex:s=-1,scrollOffset:l=0,isFocused:a=!1,focusColor:c="cyan",selectedColor:h="green",highlightColor:d="yellow",disabled:p=!1}=e;let f="";r&&(f+=Q(a&&!p?`${u.bold(r)}`:r,e)+"\n");if(0===t.length){const t=20,n=a&&!p?c:e.color||"white",r=a&&!p?(u[n]||u).bold:u[n]||u;return f+=r("┌"+"─".repeat(t+2)+"┐")+"\n",f+=r("│")+" No options".padEnd(t+2," ")+r("│")+"\n",f+=r("└"+"─".repeat(t+2)+"┘")+"\n",f}const g=Math.max(20,...t.map(e=>J(e.label||String(e.value)))),m=e.width?e.width:g+6,v=Math.max(1,m-6),b=a&&!p?c:e.color||"white",y=a&&!p?(u[b]||u).bold:u[b]||u;f+=y("┌"+"─".repeat(m)+"┐")+"\n";for(let e=0;e<Math.min(i,t.length);e++){const r=l+e,i=t[r];if(i){const e=a&&r===o,t=r===s||i.value===n,l=i.label||String(i.value);let c=" ";c=t?u[h].bold("(●)"):"( )";let g=l.padEnd(v," ");J(l)>v&&(g=l.substring(0,v)),e&&a&&!p?g=u[d].bold.inverse(g):t?g=u[h].bold(g):i.disabled&&(g=u.dim(g)),f+=y("│")+" "+c+" "+g+y(" │")+"\n"}else f+=y("│")+" ".repeat(m)+y("│")+"\n"}if(f+=y("└"+"─".repeat(m)+"┘"),a&&!p){const t="vertical"===e.direction?"↑↓ Navigate • Space/Enter to select • Tab to next field":"←→ Navigate • Space/Enter to select • Tab to next field";f+="\n"+u.dim(t)}if(t.length>i){const e=Math.round(l/Math.max(1,t.length-i)*100);f+="\n"+u.dim(`[${e}% - showing ${l+1}-${Math.min(l+i,t.length)} of ${t.length}]`)}return f}(e)}ne.register("radiobox",new class extends te{render(e){const{node:t}=e,n=e.getEffectiveWidth();null!==n&&(t.props.width=Math.max(1,n-2));const r=Ut(e.props);return null!==n&&delete t.props.width,r}});let Yt=0;const Xt={primary:{bg:"brightBlue",color:"white",bold:!0,focusBg:"blue"},secondary:{bg:"brightWhite",color:"white",bold:!1,focusBg:"white"},danger:{bg:"brightRed",color:"white",bold:!0,focusBg:"red"},warning:{bg:"brightYellow",color:"black",bold:!0,focusBg:"yellow"},info:{bg:"brightCyan",color:"black",bold:!1,focusBg:"cyan"},success:{bg:"brightGreen",color:"white",bold:!0,focusBg:"green"}};var qt={name:"Button",props:{label:{type:String,required:!0},variant:{type:String,default:"primary",validator:e=>["primary","secondary","danger","warning","info","success"].includes(e)},color:String,bg:String,bold:Boolean,italic:Boolean,dim:Boolean,disabled:{type:Boolean,default:!1},focusColor:{type:String,default:"brightYellow"},focusBg:{type:String,default:null},fullWidth:{type:Boolean,default:!1},...ae},emits:["click","focus","blur"],setup(e,{emit:t}){const s=l(fe),c=l(ge,null),h=l(be,null),u=l(me,null),d=l(ve,null),p="button-"+ ++Yt,f=r(!1),g=a(()=>s&&s.isFocused(p));return i(g,(e,n)=>{e&&!n?t("focus"):!e&&n&&t("blur")}),s.registerComponent(p,function(n){return!e.disabled&&((n.key===Me||" "===n.char)&&(f.value=!0,t("click"),setTimeout(()=>{f.value=!1},250),!0))},{disabled:e.disabled}),u.registerClickHandler(p,function(n){e.disabled||("left_release"!==n.action?(f.value=!0,t("click",{source:"mouse",x:n.x,y:n.y,shift:n.shift,ctrl:n.ctrl,alt:n.alt}),setTimeout(()=>{f.value=!1},250)):f.value=!1)}),o(()=>{s.unregisterComponent(p),u.unregisterClickHandler(p)}),i(()=>e.disabled,e=>{s.setComponentDisabled(p,e)}),()=>{const t="function"==typeof h?h():h,r=d?.components?.button?.variants?{...Xt,...d.components.button.variants}:Xt;return n("button",{...e,_componentId:p,_clickable:!0,_variants:r,isFocused:g.value,isPressed:f.value,_injectedWidth:t,_viewportVersion:c?c.version:0})}}};function Jt(e,t,n){const{paddingTop:r,paddingBottom:i,padding:o=0}=e.props||{},s=null!=r?r:o||0,l=null!=i?i:o||0;if(!e.children||0===e.children.length){if(s>0||l>0){const e=[];for(let t=0;t<s+l;t++)e.push("");return e.join("\n")}return""}const a=e.cachedLayoutMetrics||{children:[]},c=e.children,h=c.length,u=[];let d=0;for(let e=0;e<h;e++){const r=c[e];if("comment"===r.type)continue;const i=a.children[d++];if(!i){u.push({rendered:n(r,t+1,{yOffset:s}),x:0,width:0,height:1,y:0});continue}const o=i.width>0&&("col"===r.type||"box"===r.type||void 0!==r.props.flex||void 0!==r.props.width)?Qt(r,i.width,t+1,n,{yOffset:s}):n(r,t+1,{yOffset:s});u.push({rendered:o,x:i.x,y:i.y,width:i.width,height:i.height})}const p=e.props?.flexWrap||"nowrap",f=e.props?.responsive;let g;if(("wrap"===p||"wrap-reverse"===p||f)&&u.length>1){const e=function(e){if(0===e.length)return[];const t=e.slice().sort((e,t)=>e.y-t.y),n=[];let r=[t[0]],i=t[0].y+(t[0].height||1);for(let e=1;e<t.length;e++){const o=t[e],s=o.height||1;o.y>=i?(n.push(r),r=[o],i=o.y+s):(r.push(o),i=Math.max(i,o.y+s))}return n.push(r),n}(u);g=e.length>1?function(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.sort((e,t)=>e.x-t.x);const i=new Array(r.length);let o=0;for(let e=0;e<r.length;e++){const t=r[e].rendered.split("\n");i[e]={lines:t,x:r[e].x},t.length>o&&(o=t.length)}for(let e=0;e<o;e++){let n="",r=0;for(let t=0;t<i.length;t++){const o=i[t],s=o.lines[e]||"",l=o.x;l>r&&(n+=" ".repeat(l-r),r=l),n+=s,r+=J(s)}t.push(n)}}return t.join("\n")}(e):Zt(u)}else g=Zt(u);if(s>0||l>0){const e=g?g.split("\n"):[];for(let t=0;t<s;t++)e.unshift("");for(let t=0;t<l;t++)e.push("");g=e.join("\n")}return g}function Kt(e){if(!e)return 0;let t=1;for(let n=0;n<e.length;n++)10===e.charCodeAt(n)&&t++;return t}function Zt(e){const t=e.length,n=new Array(t);let r=0;for(let i=0;i<t;i++){const t=e[i].rendered.split("\n");n[i]={lines:t,x:e[i].x},t.length>r&&(r=t.length)}const i=new Array(r);for(let e=0;e<r;e++){let r="",o=0;for(let i=0;i<t;i++){const t=n[i],s=t.lines[e]||"",l=t.x;l>o&&(r+=" ".repeat(l-o),o=l),r+=s,o+=J(s)}i[e]=r}return i.join("\n")}function Qt(e,t,n,r,i={}){const o=e._renderWidth;return e._renderWidth=t,o!==t&&null!==e.cachedOutput&&(e.isDirty=!0,e.cachedOutput=null),r(e,n,i)}function en(e,t,n,r,i={}){const o=e.props.width;e.props.width=t;const s=r(e,n,i);return e.props.width=o,s}ne.register("button",new class extends te{render(e){const{node:t}=e,n=e.props,r=n.width;n.fullWidth||delete t.props.width;const i=function(e){const{label:t="",variant:n="primary",color:r,bg:i,bold:o,italic:s,dim:l,disabled:a=!1,isFocused:c=!1,isPressed:h=!1,_variants:d,_injectedWidth:p,width:f,fullWidth:g=!1}=e,m=d||Xt,v=m[n]||m.primary;let b=i||v.bg;const y=void 0!==o?o:v.bold;let w=r||b,x=t,S=r||b;if(!c||a||r||(S="white"),S){const e=P(S);e&&(x=e(x))}return(c&&!a||y)&&(x=u.bold(x)),s&&(x=u.italic(x)),(a||l)&&(x=u.dim(x)),h&&!a&&(x=u.inverse(x)),ct(x,{border:!0,borderStyle:"button",bg:i||null,color:w,paddingLeft:1,paddingRight:1,paddingTop:0,paddingBottom:0,bold:c&&!a,width:g?f||p:f})}(n);return void 0!==r&&(t.props.width=r),i}});function tn(e){if(!e)return 0;let t=1;for(let n=0;n<e.length;n++)10===e.charCodeAt(n)&&t++;return t}function nn(e,t,n,r,i=null){if(!H)return;const o=e.props||{},s=o._clickable||e.clickable,l=o._componentId||e.componentId;if(!s||!l)return;let a=0,c=0;if(i){const e=function(e){if(!e)return{width:0,height:0};const t=e.split("\n"),n=t.length;let r=0;for(const e of t){const t=J(e);t>r&&(r=t)}return{width:r,height:n}}(i);a=e.width,c=e.height}else{const t=e.cachedLayoutMetrics;a=t?.width||0,c=t?.height||0}var h;a>0&&c>0&&(h={componentId:l,x:Math.round(t),y:Math.round(n),width:Math.round(a),height:Math.round(c),depth:r,nodeType:e.type},H&&h.width>0&&h.height>0&&O.push(h))}function rn(e,t=0,n={}){if(!e)return"";const{parentAbsX:r=0,parentAbsY:i=0,yOffset:o=0,inRow:s=!1}=n;if("comment"===e.type)return"";const l=e.cachedLayoutMetrics,a=r+(l?.x||0),c=i+o;if(function(e){return!!e&&!e.isDirty&&!e.childrenDirty&&null!==e.cachedOutput}(e)){const n=e.cachedOutput;return nn(e,a,c,t,n),n}const h=new ee({node:e,depth:t,absX:a,absY:c,inRow:s,renderNodeFn:rn}),u=ne.get(e.type);let d;if(u)d=u.render(h);else{let n=0;const r=I(e,e=>{const r=rn(e,t+1,{parentAbsX:a,parentAbsY:c,yOffset:n,inRow:s});return n+=tn(r),r});d=e.text||r}return e.actualRenderedHeight=tn(d),nn(e,a,c,t,d),function(e,t){e&&(e.cachedOutput=t,e.isDirty=!1)}(e,d),d}function on(e){if(!e)return"";performance.now();let t;if(R(),e.children?.length>0){const n=[];let r=0;for(const t of e.children){if("comment"===t.type)continue;const e=rn(t,0,{parentAbsX:0,parentAbsY:0,yOffset:r,inRow:!1});e&&(n.push(e),r+=tn(e))}t=n.join("\n")}else t=rn(e,0,{parentAbsX:0,parentAbsY:0,yOffset:0,inRow:!1});const n=A();return e._clickRegions=n,performance.now(),t.endsWith("\n")?t:t+"\n"}function sn(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function ln(t={}){const{onUpdate:n=()=>{},rootContainer:r=null,beforeRender:i=()=>{},afterRender:o=()=>{}}=t,s=e({createElement:e=>new C(e),createText:e=>new M(e),createComment:e=>new k(e),setText(e,t){e.text!==t&&(e.setText(t),_(e)),h()},setElementText(e,t){e.text!==t&&(e.setText(t),_(e)),h()},insert(e,t,n=null){n?t.insertBefore(e,n):t.appendChild(e),_(e),t.invalidateChildrenCache(),t.markLayoutDirty(),h()},remove(e){const t=e.parent;t&&(t.removeChild(e),t.invalidateChildrenCache(),_(t),t.markLayoutDirty(),h())},patchProp(e,t,n,r){if("_componentId"===t)return void(e.componentId=r);if("_clickable"===t)return void(e.clickable=r);let i=n!==r;if(!i&&Array.isArray(r)&&Array.isArray(n))i=n.length!==r.length||n.some((e,t)=>e!==r[t]);else if(!i&&sn(r)&&sn(n)){const e=Object.keys(n),t=Object.keys(r);i=e.length!==t.length||t.some(e=>n[e]!==r[e])}var o;null==r?delete e.props[t]:e.props[t]=r,i&&(_(e),o=t,E.has(o)&&e.markLayoutDirty()),h()},parentNode:e=>e.parent,nextSibling(e){if(!e.parent)return null;const t=e.parent.children,n=t.indexOf(e);return t[n+1]||null},querySelector:()=>null,setScopeId(){},cloneNode(e){const t=new C(e.type);return t.props={...e.props},t.text=e.text,t},insertStaticContent(e,t,n){const r=new M(e);return n?t.insertBefore(r,n):t.appendChild(r),t.invalidateChildrenCache(),h(),[r,r]}});let l=!1,a=!1,c="";function h(){a=!0,l||u()}function u(){l||(l=!0,Promise.resolve().then(d))}function d(){const e=performance.now();if(l=!1,a=!1,r){i(r);const t=on(r);if(o(r),t!==c&&(c=t,n(t),s.vuettyInstance?.debugServer)){const n=performance.now()-e;s.vuettyInstance.debugServer.captureRenderComplete({duration:n,outputLength:t.length,rootContainer:r})}}a&&u()}return s.forceUpdate=()=>{c="",h()},s.vuettyInstance=null,s}ne.register("row",new class extends te{render(e){const{node:t,depth:n,absX:r}=e;return Jt(t,n,(t,n,i={})=>{const o=i.yOffset||0;return e.renderChild(t,{parentAbsX:r,yOffset:o,inRow:!0})})}}),ne.register("col",new class extends te{render(e){const{node:t,depth:n,absX:r}=e;return function(e,t,n){const{gap:r=0,paddingTop:i,paddingBottom:o,padding:s=0}=e.props||{},l=null!=i?i:s||0,a=null!=o?o:s||0;if(!e.children||0===e.children.length){if(l>0||a>0){const e=[];for(let t=0;t<l+a;t++)e.push("");return e.join("\n")}return""}const c=e.props?.width,h=e.props?._injectedWidth,u=e._renderWidth,d=null!=c?c:void 0!==u?u:h,p=e.cachedLayoutMetrics||{children:[]},f=[];let g,m=0,v=l;for(const i of e.children){if("comment"===i.type)continue;const e=p.children[m];if(m++,f.length>0&&r>0&&(v+=r),!e){const e=n(i,t+1,{yOffset:v});f.push(e),v+=Kt(e);continue}const o=i.props||{},s=e.height>0&&(void 0!==o.flex||void 0!==o.flexGrow||void 0!==o.height||void 0!==o._injectedHeight||"col"===i.type||"row"===i.type),l=null!=d?d:e.width,a=s&&("box"===i.type||"row"===i.type);if(a){const r=i.props._targetHeight;i.props._targetHeight=e.height,r!==e.height&&null!==i.cachedOutput&&(i.isDirty=!0,i.cachedOutput=null);const o=en(i,l,t+1,n,{yOffset:v});void 0!==r?i.props._targetHeight=r:delete i.props._targetHeight,f.push(o),v+=Kt(o);continue}const c=en(i,l,t+1,n,{yOffset:v}),h=s&&!a?et(c,e.height):c;f.push(h),v+=Kt(h)}if(r>0){const e="\n"+"\n".repeat(r);g=f.join(e)}else g=f.join("\n");if(l>0||a>0){const e=g?g.split("\n"):[];for(let t=0;t<l;t++)e.unshift("");for(let t=0;t<a;t++)e.push("");g=e.join("\n")}return g}(t,n,(t,n,i={})=>{const o=i.yOffset||0;return e.renderChild(t,{parentAbsX:r,yOffset:o,inRow:!1})})}});class an{constructor(e={}){this.components=new Map,this.componentOrder=[],this.focusedId=r(null),this.enabled=!1,this.onInputChange=e.onInputChange||(()=>{}),this.onExit=e.onExit||(()=>{}),this.viewportHandler=null,this.vuettyInstance=null,this.handleData=this.handleData.bind(this),this.buffer=""}enable(){this.enabled||(process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding("utf8"),process.stdin.on("data",this.handleData),this.enabled=!0)}disable(){this.enabled&&(process.stdin.removeListener("data",this.handleData),process.stdin.pause(),process.stdin.isTTY&&process.stdin.setRawMode(!1),this.enabled=!1)}registerComponent(e,t,n={}){this.components.set(e,{handler:t,disabled:n.disabled||!1,focusable:void 0===n.focusable||n.focusable}),this.componentOrder.push(e),this.focusedId.value||n.disabled||!1===n.focusable||this.focus(e)}unregisterComponent(e){this.components.delete(e);const t=this.componentOrder.indexOf(e);-1!==t&&this.componentOrder.splice(t,1),this.focusedId.value===e&&(this.focusedId.value=null,this.focusNext())}setComponentDisabled(e,t){const n=this.components.get(e);n&&(n.disabled=t,t&&this.focusedId.value===e&&this.focusNext())}setViewportHandler(e){this.viewportHandler=e}setVuettyInstance(e){this.vuettyInstance=e}blur(){return!!this.focusedId.value&&(this.focusedId.value=null,this.onInputChange(),!0)}focus(e){const t=this.components.get(e);return!(!t||t.disabled)&&(this.focusedId.value!==e&&(this.focusedId.value=e,this.onInputChange(),!0))}focusNext(){if(0===this.componentOrder.length)return!1;let e=(this.componentOrder.indexOf(this.focusedId.value)+1)%this.componentOrder.length,t=0;for(;t<this.componentOrder.length;){const n=this.componentOrder[e],r=this.components.get(n);if(r&&!r.disabled&&!1!==r.focusable)return this.focus(n);e=(e+1)%this.componentOrder.length,t++}return this.focusedId.value=null,!1}focusPrevious(){if(0===this.componentOrder.length)return!1;const e=this.componentOrder.indexOf(this.focusedId.value);let t=e<=0?this.componentOrder.length-1:e-1,n=0;for(;n<this.componentOrder.length;){const e=this.componentOrder[t],r=this.components.get(e);if(r&&!r.disabled&&!1!==r.focusable)return this.focus(e);t=t<=0?this.componentOrder.length-1:t-1,n++}return this.focusedId.value=null,!1}isFocused(e){return this.focusedId.value===e}handleData(e){for(this.buffer+=e;this.buffer.length>0;)if(this.buffer.startsWith("")){let e=-1;if(this.buffer.startsWith("[<")){const e=this.buffer.match(/^\x1b\[<\d+;\d+;\d+[Mm]/);if(e){const t=e[0];this.buffer=this.buffer.slice(t.length),this.handleMouseEvent(t);continue}if(this.buffer.match(/^\x1b\[<[\d;]*$/))break}const t=this.buffer.match(/^\x1b\[\d+;\d+;\d+M/);if(t){const e=t[0];this.buffer=this.buffer.slice(e.length),this.handleMouseEvent(e);continue}if(this.buffer.length>=2&&"["===this.buffer[1])for(let t=2;t<this.buffer.length;t++){const n=this.buffer.charCodeAt(t);if(n>=65&&n<=90||n>=97&&n<=122||126===n){e=t+1;break}}else this.buffer.length>=2&&(e=2);if(e>0){const t=this.buffer.slice(0,e);this.buffer=this.buffer.slice(e),this.handleKeyPress(t)}else{if(1!==this.buffer.length)break;this.buffer="",this.handleKeyPress("")}}else{const e=this.buffer[0];this.buffer=this.buffer.slice(1),this.handleKeyPress(e)}}handleKeyPress(e){if(Xe(e))return void this.handleMouseEvent(e);const t=function(e){const t=e.match(/^\x1b\[1;(\d+)([A-Z~])$/);if(t){const e=parseInt(t[1],10),n=t[2],r=e-1;return{key:{A:we,B:xe,C:Ce,D:Se,H:Le,F:Ee}[n]||"unknown",char:null,shift:!!(1&r),ctrl:!!(4&r),alt:!1}}if(Ne[e]){const t=e.includes(";2");return{key:Ne[e],char:null,ctrl:!1,shift:t||"\n"===e,alt:!1}}if(2===e.length&&27===e.charCodeAt(0)){const t=e[1];if(t.charCodeAt(0)>=32&&t.charCodeAt(0)<=126)return{key:t.toLowerCase(),char:t,ctrl:!1,alt:!0,shift:t!==t.toLowerCase()}}return 1===e.length&&e.charCodeAt(0)<32?{key:"char",char:e,ctrl:!0,shift:!1,alt:!1}:1===e.length&&e.charCodeAt(0)>=32&&e.charCodeAt(0)<=126?{key:"char",char:e,ctrl:!1,shift:e!==e.toLowerCase(),alt:!1}:e.length>=1&&!e.startsWith("")?{key:"char",char:e,ctrl:!1,shift:!1,alt:!1}:{key:"unknown",char:e,ctrl:!1,shift:!1,alt:!1}}(e);if(this.vuettyInstance?.debugServer&&this.vuettyInstance.debugServer.captureEvent("input.key",{key:t.key,char:t.char,shift:t.shift,ctrl:t.ctrl,alt:t.alt}),t.key!==Oe)if(t.alt&&"m"===t.key)this.vuettyInstance&&this.vuettyInstance.toggleMouseTracking();else if("tab"!==t.key){if(this.viewportHandler){if(this.viewportHandler(t))return}if(this.focusedId.value){const e=this.components.get(this.focusedId.value);if(e&&!e.disabled&&e.handler){if(e.handler(t))return void this.onInputChange()}}for(const e of this.componentOrder){const n=this.components.get(e);if(!n||n.disabled||!1!==n.focusable)continue;if(n.handler(t))return void this.onInputChange()}}else t.shift?this.focusPrevious():this.focusNext();else this.onExit()}handleMouseEvent(e){const t=Xe(e);if(t&&(this.vuettyInstance?.debugServer&&this.vuettyInstance.debugServer.captureEvent("input.mouse",{action:t.action,x:t.x,y:t.y,button:t.button}),this.viewportHandler)){if(this.viewportHandler(t))return}}getFocusedId(){return this.focusedId.value}getComponentCount(){return this.components.size}clear(){this.components.clear(),this.componentOrder=[],this.focusedId.value=null}}var cn={name:"Row",props:{...le,gap:{type:Number,default:0},justifyContent:{type:String,default:"flex-start",validator:e=>["flex-start","flex-end","center","space-between","space-around","space-evenly"].includes(e)},alignItems:{type:String,default:"stretch",validator:e=>["flex-start","flex-end","center","stretch","baseline"].includes(e)},flexWrap:{type:String,default:"nowrap",validator:e=>["nowrap","wrap","wrap-reverse"].includes(e)},responsive:{type:Boolean,default:!1}},setup(e,{slots:t}){const r=l(be,null),i=l(tt,null),o=l(ge,null);return c(tt,()=>{if(void 0!==e.height&&null!==e.height)return e.height;const t="function"==typeof i?i():i;return null!=t?t:null}),()=>{const s="function"==typeof r?r():r,l="function"==typeof i?i():i,a={...e,_injectedWidth:s,_injectedHeight:l,_viewportVersion:o?o.version:0};return n("row",a,t.default?.())}}},hn={name:"Col",props:{...le,flex:{type:[Number,String],default:"1"},gap:{type:Number,default:0},justifyContent:{type:String,default:"flex-start",validator:e=>["flex-start","flex-end","center","space-between","space-around","space-evenly"].includes(e)},alignItems:{type:String,default:"stretch",validator:e=>["flex-start","flex-end","center","stretch","baseline"].includes(e)},flexWrap:{type:String,default:"nowrap",validator:e=>["nowrap","wrap","wrap-reverse"].includes(e)},responsive:{type:Boolean,default:!1}},setup(e,{slots:t}){const r=l(be,null),i=l(tt,null),o=l(ge,null);return c(tt,()=>{if(void 0!==e.height&&null!==e.height)return e.height;const t="function"==typeof i?i():i;return null!=t?t:null}),()=>{const s=t.default?t.default():[],l="function"==typeof r?r():r,a="function"==typeof i?i():i,c={...e,_injectedWidth:l,_injectedHeight:a,_viewportVersion:o?o.version:0};return n("col",c,s)}}};const un=Object.freeze({}),dn=new Map;function pn(e){if(!e||0===Object.keys(e).length)return un;const t=Object.keys(e).sort().map(t=>`${t}:${e[t]}`).join("|");let n=dn.get(t);if(n)return n;if(n=Object.freeze({...e}),dn.size>=30){const e=dn.keys().next().value;dn.delete(e)}return dn.set(t,n),n}function fn(e){if(!e||!Array.isArray(e))return"";const t=[];for(const n of e)switch(n.type){case"text":n.text&&t.push(n.text);break;case"strong":case"em":t.push(n.tokens?fn(n.tokens):n.text||"");break;case"codespan":t.push(` ${n.text} `);break;case"link":t.push(`${n.text} (${n.href})`);break;case"del":t.push(`~~${n.text}~~`);break;case"br":t.push("\n");break;default:n.raw&&t.push(n.raw)}return t.join("")}function gn(e,t,r){if(!e||!Array.isArray(e))return[];const{TextBox:i}=t,o=[];for(const s of e)switch(s.type){case"text":s.text&&o.push(n(i,{bg:r.bg},{default:()=>s.text}));break;case"strong":o.push(n(i,{bold:!0,color:r.strongColor,bg:r.bg},{default:()=>s.tokens?gn(s.tokens,t,r):s.text}));break;case"em":o.push(n(i,{italic:!0,color:r.emphasisColor,bg:r.bg},{default:()=>s.tokens?gn(s.tokens,t,r):s.text}));break;case"codespan":o.push(n(i,{color:r.codeColor,bg:r.codeBg},{default:()=>` ${s.text} `}));break;case"link":o.push(n(i,{color:r.linkColor,underline:!0,bg:r.bg},{default:()=>`${s.text} (${s.href})`}));break;case"del":o.push(n(i,{dim:!0,bg:r.bg},{default:()=>`~~${s.text}~~`}));break;case"br":o.push(n(t.Newline));break;default:s.raw&&o.push(n(i,{bg:r.bg},{default:()=>s.raw}))}return o}function mn(e,t,r,i){const{TextBox:o,Newline:s}=t;if(!i||i<=0)return[...gn(e.tokens,t,r),n(s)];const l=bn(vn(e.tokens,r),i),a=[];for(let e=0;e<l.length;e++){const t=l[e];for(const e of t)a.push(n(o,e.style,{default:()=>e.text}));e<l.length-1&&a.push(n(s))}return a.push(n(s)),a}function vn(e,t,n=null){const r=[];if(!e||!Array.isArray(e))return r;const i=n||un;for(const n of e)switch(n.type){case"text":n.text&&r.push({text:n.text,style:i});break;case"strong":if(n.tokens){const e=pn({...i,bold:!0,color:t.strongColor});r.push(...vn(n.tokens,t,e))}else n.text&&r.push({text:n.text,style:pn({...i,bold:!0,color:t.strongColor})});break;case"em":if(n.tokens){const e=pn({...i,italic:!0,color:t.emphasisColor});r.push(...vn(n.tokens,t,e))}else n.text&&r.push({text:n.text,style:pn({...i,italic:!0,color:t.emphasisColor})});break;case"codespan":r.push({text:` ${n.text} `,style:pn({...i,color:t.codeColor,bg:t.codeBg})});break;case"link":r.push({text:`${n.text} (${n.href})`,style:pn({...i,color:t.linkColor,underline:!0})});break;case"del":r.push({text:`~~${n.text}~~`,style:pn({...i,dim:!0})});break;default:n.raw&&r.push({text:n.raw,style:i})}return r}function bn(e,t){const n=[[]];let r=0;for(const i of e){const e=i.text.split(/(\s+)/);for(const o of e){if(!o)continue;const e=J(o);if(r+e<=t){n[n.length-1].push({text:o,style:i.style}),r+=e}else if(e>t){let e=o;for(;e.length>0;){const o=t-r;if(o<=0){n.push([]),r=0;continue}let s="",l=0;for(const t of e){const e=J(t);if(!(l+e<=o))break;s+=t,l+=e}s&&(n[n.length-1].push({text:s,style:i.style}),r+=l,e=e.slice(s.length)),e.length>0&&(n.push([]),r=0)}}else n.push([{text:o,style:i.style}]),r=e}}return n.filter(e=>e.length>0).map(e=>e.length>0&&e[0].text.match(/^\s+$/)?e.slice(1):(e.length>0&&(e[0]={...e[0],text:e[0].text.trimStart()}),e)).filter(e=>e.length>0)}function yn(e,t,r,i=0,o=null){const{TextBox:s,Newline:l}=t,a=[],c=" ".repeat(i),h=2*i;return e.items.forEach((u,d)=>{const p=e.ordered?`${e.start+d}. `:"• ",f=J(p);let g="",m=0;u.task&&(g=u.checked?"[✓] ":"[ ] ",m=J(g));const v=o?o-h-f-m:null;if(a.push(n(s,{color:r.listBulletColor},{default:()=>c+g+p})),u.tokens)for(const e of u.tokens)if("text"===e.type)if(v&&e.text){bn(vn(e.tokens||[{type:"text",text:e.text}],r),v).forEach((e,t)=>{t>0&&(a.push(n(l)),a.push(n(s,{},{default:()=>" ".repeat(h+f+m)})));for(const t of e)a.push(n(s,t.style,{default:()=>t.text}))})}else a.push(...gn(e.tokens||[{type:"text",text:e.text}],t,r));else if("list"===e.type)a.push(n(l)),a.push(...yn(e,t,r,i+1,o));else if("paragraph"===e.type)if(v){const n=mn(e,t,r,v);for(;n.length>0&&n[n.length-1].type===l;)n.pop();a.push(...n)}else a.push(...gn(e.tokens,t,r));a.push(n(l))}),a}function wn(e){if(!e||!Array.isArray(e))return"";let t="";for(const n of e)n.text?t+=n.text:n.tokens?t+=wn(n.tokens):n.raw&&(t+=n.raw);return t}const xn=2166136261,Sn=16777619;function Cn(e,t=0){if(!e)return 0;let n=xn;const r=e.type||"";for(let e=0;e<r.length;e++)n^=r.charCodeAt(e),n=Math.imul(n,Sn);const i=e.text;if(i){n^=i.length,n=Math.imul(n,Sn);const e=Math.min(i.length,50);for(let t=0;t<e;t++)n^=i.charCodeAt(t),n=Math.imul(n,Sn)}const o=e.props;if(o)for(const e of E){const t=o[e];if(void 0!==t)if("number"==typeof t)n^=0|t,n=Math.imul(n,Sn);else if("boolean"==typeof t)n^=t?1:0,n=Math.imul(n,Sn);else if("string"==typeof t){const e=Math.min(t.length,30);for(let r=0;r<e;r++)n^=t.charCodeAt(r),n=Math.imul(n,Sn)}else Array.isArray(t)&&(n^=t.length,n=Math.imul(n,Sn))}const s=e.children;if(s&&s.length>0&&t<10){n^=s.length,n=Math.imul(n,Sn);const e=s.length;if(e<=20)for(let r=0;r<e;r++){n^=Cn(s[r],t+1),n=Math.imul(n,Sn)}else{const r=[0,1,2,3,4,Math.floor(e/2)-2,Math.floor(e/2)-1,Math.floor(e/2),Math.floor(e/2)+1,Math.floor(e/2)+2,e-5,e-4,e-3,e-2,e-1];for(const i of r)if(i>=0&&i<e){n^=Cn(s[i],t+1),n=Math.imul(n,Sn)}}}else s&&s.length>0&&(n^=s.length,n=Math.imul(n,Sn));return n>>>0}function Mn(e,t=null,n=1/0){const r=function(e,t=1/0){if(!e)return 0;let n=xn;const r=t===1/0?e.length:Math.min(e.length,t);let i=0;const o=r-3;for(;i<o;)n^=e.charCodeAt(i),n=Math.imul(n,Sn),n^=e.charCodeAt(i+1),n=Math.imul(n,Sn),n^=e.charCodeAt(i+2),n=Math.imul(n,Sn),n^=e.charCodeAt(i+3),n=Math.imul(n,Sn),i+=4;for(;i<r;)n^=e.charCodeAt(i++),n=Math.imul(n,Sn);return n>>>0}(e,n);return`${r}:${null!=t?String(t):"auto"}`}let kn=null;class In{constructor(e=5,t=500){this.maxSize=e,this.maxTotalTokens=t,this.cache=new Map,this.totalTokens=0}_countTokens(e){if(!Array.isArray(e))return 0;let t=e.length;for(const n of e)if(n.tokens&&(t+=this._countTokens(n.tokens)),n.items)for(const e of n.items)e.tokens&&(t+=this._countTokens(e.tokens));return t}get(e){const t=this.cache.get(e);return t?(this.cache.delete(e),this.cache.set(e,t),t.tokens):null}set(e,t){const n=this.cache.get(e);n&&(this.totalTokens-=n.count,this.cache.delete(e));const r=this._countTokens(t);for(;this.totalTokens+r>this.maxTotalTokens&&this.cache.size>0;){const e=this.cache.keys().next().value,t=this.cache.get(e);this.totalTokens-=t.count,this.cache.delete(e)}for(;this.cache.size>=this.maxSize;){const e=this.cache.keys().next().value,t=this.cache.get(e);this.totalTokens-=t.count,this.cache.delete(e)}this.cache.set(e,{tokens:t,count:r}),this.totalTokens+=r}clear(){this.cache.clear(),this.totalTokens=0}get size(){return this.cache.size}}var _n={name:"Markdown",props:{content:{type:String,required:!0,default:""},h1Color:{type:String,default:"cyan"},h2Color:{type:String,default:"cyan"},h3Color:{type:String,default:"blue"},h4Color:{type:String,default:"blue"},h5Color:{type:String,default:"blue"},h6Color:{type:String,default:"blue"},codeColor:{type:String,default:"yellow"},codeBg:{type:String,default:"#1a1a24"},linkColor:{type:String,default:"blue"},emphasisColor:{type:String,default:"white"},strongColor:{type:String,default:"white"},blockquoteColor:{type:String,default:"gray"},blockquoteBorderColor:{type:String,default:"gray"},listBulletColor:{type:String,default:"green"},listNumberColor:{type:String,default:"green"},hrColor:{type:String,default:"gray"},hrChar:{type:String,default:"─"},hrLength:{type:Number,default:60},tableHeaderColor:{type:String,default:"cyan"},tableBorderColor:{type:String,default:"white"},color:String,bg:String,bold:Boolean,italic:Boolean,dim:Boolean,...ae,padding:{type:Number,default:0}},setup(e){const t={TextBox:ut,Box:lt,Divider:ce,Newline:pe,Table:Je,Row:cn},r=l(be,null),i=new In(5,500);kn=i;let o="",s=null;function a(){if(null!==e.width&&void 0!==e.width)return e.width;if(null!==r){const e="function"==typeof r?r():r;if(null!=e&&e>0)return e}return null}function c(e,t,r,i,o){const{TextBox:s,Divider:l,Newline:a}=t,c=[];switch(e.type){case"heading":{const i="#".repeat(e.depth)+" ",o=r[`h${e.depth}Color`];c.push(n(s,{bold:!0,color:o,bg:r.bg},{default:()=>[i,...gn(e.tokens,t,r)]})),c.push(n(a));break}case"paragraph":if(!(e.tokens&&e.tokens.some(e=>"strong"===e.type||"em"===e.type||"codespan"===e.type))&&e.tokens){const t=fn(e.tokens);c.push(n(s,{bg:r.bg},{default:()=>t}))}else c.push(...mn(e,t,r,o));break;case"code":c.push(...function(e,t,r,i=null){const{TextBox:o,Box:s,Newline:l}=t,a=e.text,c=e.lang||"text",h=[];"text"!==c&&(h.push(n(o,{color:r.codeColor,dim:!0},{default:()=>`[${c}]`})),h.push(n(l)));const u=i?i-4:null;let d,p=a;if(u&&u>0){const e=a.split("\n").map(e=>J(e)>u?Z(e,u):e);p=e.join("\n")}try{const e=w(p,{language:c,ignoreIllegals:!0});d=n(o,{},{default:()=>e})}catch(e){d=n(o,{color:r.codeColor},{default:()=>p})}const f={border:!0,padding:1,color:r.tableBorderColor,bg:r.codeBg};return i&&(f.width=i),h.push(n(s,f,{default:()=>d})),h}(e,t,r)),c.push(n(a));break;case"blockquote":c.push(function(e,t,r,i,o=null){const{Box:s}=t,l=o?o-4:null,a=e.tokens.map(e=>i(e,t,r,i,l)).flat();for(;a.length>0&&a[a.length-1].type===t.Newline;)a.pop();const c={border:!0,padding:1,color:r.blockquoteBorderColor};return o&&(c.width=o),n(s,c,{default:()=>a})}(e,t,r,i)),c.push(n(a));break;case"list":c.push(...yn(e,t,r,0,o));break;case"table":c.push(function(e,t,r,i=null){const{TextBox:o,Newline:s}=t,l=e.header.map(e=>wn(e.tokens)),a=e.rows.map(e=>e.map(e=>wn(e.tokens)));let c=l.map((e,t)=>{const n=J(e),r=Math.max(...a.map(e=>J(e[t]||"")),0);return Math.max(n,r)+2});if(i&&c.reduce((e,t)=>e+t,0)+c.length+1>i){const e=i-c.length-1,t=c.reduce((e,t)=>e+t,0);if(e>0){const n=e/t;c=c.map(e=>Math.max(4,Math.floor(e*n)))}}const h=[],u=(e,t)=>{const n=String(e||""),r=J(n),i=t-2;if(r>i){let e="",t=0;for(const r of n){const n=J(r);if(t+n>i-1)break;e+=r,t+=n}return" "+e+"…"+" ".repeat(Math.max(0,i-t-1))}return" "+n+" ".repeat(Math.max(0,i-r+1))};let d="┌";c.forEach((e,t)=>{d+="─".repeat(e),d+=t<c.length-1?"┬":"┐"}),h.push(n(o,{color:r.tableBorderColor},{default:()=>d})),h.push(n(s)),h.push(n(o,{color:r.tableBorderColor},{default:()=>"│"})),l.forEach((e,t)=>{h.push(n(o,{color:r.tableHeaderColor,bold:!0},{default:()=>u(e,c[t])})),h.push(n(o,{color:r.tableBorderColor},{default:()=>"│"}))}),h.push(n(s));let p="├";c.forEach((e,t)=>{p+="─".repeat(e),p+=t<c.length-1?"┼":"┤"}),h.push(n(o,{color:r.tableBorderColor},{default:()=>p})),h.push(n(s)),a.forEach(e=>{h.push(n(o,{color:r.tableBorderColor},{default:()=>"│"})),e.forEach((e,t)=>{h.push(n(o,{},{default:()=>u(e,c[t])})),h.push(n(o,{color:r.tableBorderColor},{default:()=>"│"}))}),h.push(n(s))});let f="└";return c.forEach((e,t)=>{f+="─".repeat(e),f+=t<c.length-1?"┴":"┘"}),h.push(n(o,{color:r.tableBorderColor},{default:()=>f})),h}(e,t,r)),c.push(n(a));break;case"hr":{const e=o||r.hrLength;c.push(n(l,{char:r.hrChar,length:e,color:r.hrColor})),c.push(n(a));break}case"html":c.push(n(s,{dim:!0},{default:()=>e.text})),c.push(n(a));break;case"space":c.push(n(a));break;default:e.raw&&(c.push(n(s,{},{default:()=>e.raw})),c.push(n(a)))}return c}return()=>{const r=function(){const t=a();if(null===t)return null;const n=2*e.padding;return Math.max(0,t-n)}(),l=e.content||"";l!==o&&(o=l,s=function(e){if(!e||""===e.trim())return[];const t=Mn(e,null,1e4),n=i.get(t);if(n)return n;try{const n=y.lexer(e);return i.set(t,n),n}catch(e){return console.error("Markdown parse error:",e),[]}}(l));const h=e.bg,u=function(r,i,o){if(!r||0===r.length)return[n(ut,{bg:o},{default:()=>""})];const s={...e,bg:o},l=[];for(const e of r)l.push(...c(e,t,s,c,i));for(;l.length>0&&l[l.length-1].type===pe;)l.pop();return l.length>0?l:[n(ut,{bg:o},{default:()=>""})]}(s,r,h),d={padding:e.padding,width:a(),color:e.color,bg:h,bold:e.bold,italic:e.italic,dim:e.dim,border:!1};return n(lt,d,{default:()=>u})}}},Ln=Object.freeze({__proto__:null,BigText:Mt,Box:lt,Button:qt,Checkbox:jt,Col:hn,Divider:ce,Gradient:Tt,Image:pt,Markdown:_n,Newline:pe,ProgressBar:ye,Radiobox:Gt,Row:cn,SelectInput:Ft,Spacer:de,Spinner:ue,Table:Je,TextBox:ut,TextInput:Nt,Tree:bt,clearBigTextCache:It,getBigTextCacheStats:_t});const En="[2K";class Tn{static cursorCache=(()=>{const e=new Array(500);for(let t=0;t<500;t++)e[t]=`[${t+1};1H`;return e})();static cursorTo(e){return Tn.cursorCache[e]??`[${e+1};1H`}constructor(e=process.stdout){this.stream=e,this.previousLines=[],this.previousLineCount=0,this.previousContent="",this.bufferParts=[]}_detectChangeRegion(e,t){const n=[],r=Math.max(e.length,t.length);for(let i=0;i<r;i++)e[i]!==t[i]&&n.push(i);return 0===n.length?null:{firstChanged:n[0],lastChanged:n[n.length-1],totalChanged:n.length}}render(e){if(e===this.previousContent)return;this.previousContent=e;const t=e.split("\n"),n=this.previousLines,r=t.length,i=n.length;if(!this._detectChangeRegion(t,n))return this.previousLines=t,void(this.previousLineCount=r);this.bufferParts.length=0,this.bufferParts.push("[?2026h"),0===i||Math.abs(r-i)>20?this._fullRedraw(t):this._incrementalUpdate(t,n),this.bufferParts.push("[?2026l"),this.stream.write(this.bufferParts.join("")),this.previousLines=t,this.previousLineCount=r}_fullRedraw(e){this.bufferParts.push("[H");const t=e.length;for(let n=0;n<t;n++)n>0&&this.bufferParts.push("\n"),this.bufferParts.push(En,e[n]);this.bufferParts.push("[J")}_incrementalUpdate(e,t){const n=e.length,r=t.length,i=Math.max(n,r);let o=0;for(let n=0;n<i;n++)e[n]!==t[n]&&o++;if(o>.7*i)this._fullRedraw(e);else{for(let r=0;r<i;r++){const i=e[r],o=t[r];r>=n?this.bufferParts.push(Tn.cursorTo(r),En):i!==o&&this.bufferParts.push(Tn.cursorTo(r),En,i)}n<r&&this.bufferParts.push(Tn.cursorTo(n),"[J")}}renderScroll(e){this.render(e)}clear(){this.previousLines=[],this.previousLineCount=0,this.previousContent=""}done(){this.stream.write("[?25h"),this.clear()}}function Bn(e,t){if(!e)return 0;if(t<=0)return 1;if(!(-1!==e.indexOf("\n"))){const n=J(e);return n<=t?1:Math.ceil(n/t)}const n=e.split("\n");let r=0;for(let e=0;e<n.length;e++){const i=n[e];if(0===i.length){r+=1;continue}const o=J(i);r+=o<=t?1:Math.ceil(o/t)}return Math.max(1,r)}function On(e){if(!e)return"";if(e.text)return e.text;if(e.props?.text)return e.props.text;const t=e.children;if(!t||0===t.length)return"";if(1===t.length){const e=t[0];return"string"==typeof e?e:"text"===e?.type?e.text||"":On(e)}const n=[];for(let e=0;e<t.length;e++){const r=t[e];if("string"==typeof r)n.push(r);else if("text"===r?.type)r.text&&n.push(r.text);else if(r){const e=On(r);e&&n.push(e)}}return n.join("")}class Hn{applyLayout(e,t,n){return{}}}class Rn extends Hn{applyLayout(e,t,n){const{containerWidth:r,containerHeight:i}=n;return e.setFlexDirection(x.FLEX_DIRECTION_COLUMN),e.setWidth(r),i&&i!==1/0&&(e.setHeight(i),e.setMaxHeight(i)),e.setAlignItems(x.ALIGN_STRETCH),{}}}class An extends Hn{applyLayout(e,t,n){const r=t.props||{};return e.setFlexDirection(x.FLEX_DIRECTION_ROW),void 0!==r.width&&null!==r.width||e.setWidthPercent(100),void 0!==r.height?"string"==typeof r.height&&r.height.endsWith("%")?e.setHeightPercent(parseFloat(r.height)):(e.setHeight(r.height),e.setMinHeight(r.height),e.setMaxHeight(r.height)):void 0!==r._injectedHeight&&null!==r._injectedHeight&&(e.setMaxHeight(r._injectedHeight),process.env.DEBUG_FLEX&&console.log(`[DEBUG] ${t.type}Handler: setting maxHeight=${r._injectedHeight} (from injected)`)),{}}}class Dn extends Hn{applyLayout(e,t,n){e.setFlexDirection(x.FLEX_DIRECTION_COLUMN);const r=t.props||{},{containerHeight:i}=n;return void 0!==r.height?"string"==typeof r.height&&r.height.endsWith("%")?e.setHeightPercent(parseFloat(r.height)):(e.setHeight(r.height),e.setMinHeight(r.height),e.setMaxHeight(r.height),process.env.DEBUG_FLEX&&console.log(`[DEBUG] ColHandler: setting height=${r.height} (min/max enforced)`)):void 0!==r._injectedHeight&&null!==r._injectedHeight?(e.setMaxHeight(r._injectedHeight),process.env.DEBUG_FLEX&&console.log(`[DEBUG] ColHandler: setting maxHeight=${r._injectedHeight} (from injected)`)):i&&i!==1/0&&(e.setHeight(i),e.setMaxHeight(i),process.env.DEBUG_FLEX&&console.log(`[DEBUG] ColHandler: setting height+maxHeight=${i} (from containerHeight)`)),{}}}class Nn extends Hn{applyLayout(e,t,n){const r=J(t.text||"");return e.setWidth(r),e.setHeight(1),{}}}class Wn extends Hn{applyLayout(e,t,n){const{containerWidth:r}=n,i=t.props||{},o=On(t);let s=r;null!=i.width?s="string"==typeof i.width&&i.width.endsWith("%")?Math.floor(r*parseFloat(i.width)/100):i.width:void 0!==i._injectedWidth&&null!==i._injectedWidth&&(s=i._injectedWidth);const l=Bn(o,s);return e.setHeight(l),{hasTextBoxes:!0}}}class $n extends Hn{applyLayout(e,t,n){const r=t.props||{},i=function(e,t){return e?{Standard:6,Big:8,Slant:6,Small:5,Banner:8,Block:8,Bubble:7,Digital:6,Ivrit:6,Lean:7,Mini:4,Script:6,Shadow:7,Smscript:5,Smshadow:6,Smslant:5,Terrace:6,Thick:6}[t]||6:0}(On(t),r.font||"Standard");return e.setHeight(i),void 0===r.width&&void 0===r.flex&&e.setWidthPercent(100),{}}}class Fn extends Hn{applyLayout(e,t,n){const r=t.props||{};return e.setHeight(1),void 0!==r.length?e.setWidth(r.length):void 0===r.width&&void 0===r.flex&&e.setWidthPercent(100),{}}}class zn extends Hn{applyLayout(e,t,n){const r=t.props||{},i=r.label||"",o=r.height||10,s=r.headers||[],l=r.rows||[],a=!1!==r.showHeader,c=r.isFocused||!1,h=r.disabled||!1;if(0===s.length&&0===l.length){let t=3;i&&(t+=1),e.setHeight(t)}else{let t=1;i&&(t+=1),a&&s.length>0&&(t+=2),t+=o,t+=1,c&&!h&&(t+=1),l.length>o&&(t+=1),e.setHeight(t)}return void 0===r.width&&void 0===r.flex&&e.setWidthPercent(100),{}}}class jn extends Hn{applyLayout(e,t,n){const r=t.props||{},i=r.imageLines||1;return e.setHeight(i),void 0===r.width&&void 0===r.flex&&e.setWidthPercent(100),{}}}class Pn extends Hn{applyLayout(e,t,n){const r=(t.props||{}).count||1;return e.setHeight(Math.max(1,r)),{}}}class Vn extends Hn{applyLayout(e,t,n){const r=(t.props||{}).lines||1;return e.setHeight(Math.max(1,r)),{}}}class Gn extends Hn{applyLayout(e,t,n){const r=t.props||{},i=4+J(r.label||"");return e.setHeight(1),void 0===r.width&&void 0===r.flex&&e.setWidth(i),{}}}class Un extends Hn{applyLayout(e,t,n){const{containerWidth:r}=n,i=t.props||{},o=i.label||"",s=i.rows||3,l=i.minRows||1,a=i.maxRows,c=i.autoResize||!1,h=i.text||"",u=i.hint,d=i.validationError,p=i.isFocused||!1,f=i.disabled||!1;let g=r;null!=i.width?g="string"==typeof i.width&&i.width.endsWith("%")?Math.floor(r*parseFloat(i.width)/100):i.width:void 0!==i._injectedWidth&&null!==i._injectedWidth&&(g=i._injectedWidth);let m=s;if(c){const e=h?Bn(h,g):l;m=Math.max(l,e),a&&(m=Math.min(m,a))}let v=1+m+1;return o&&(v+=1),(d||p&&!f&&!1!==u&&""!==u)&&(v+=1),e.setHeight(v),null!=i.width&&("string"==typeof i.width&&i.width.endsWith("%")?e.setWidthPercent(parseFloat(i.width)):e.setWidth(i.width+2)),{}}}class Yn extends Hn{applyLayout(e,t,n){const r=t.props||{},i=r.label||"",o=r.height||10,s=r.options||[],l=r.isFocused||!1,a=r.disabled||!1;if("vertical"===(r.direction||"vertical")){let t=1+(0===s.length?1:Math.min(o,s.length))+1;if(i&&(t+=1),l&&!a&&(t+=1),s.length>o&&(t+=1),e.setHeight(t),void 0===r.width&&void 0===r.flex){let t=20;for(let e=0;e<s.length;e++){const n=J(s[e].label||String(s[e].value));n>t&&(t=n)}e.setWidth(t+8)}}else e.setHeight(i?4:3);return{}}}class Xn extends Hn{applyLayout(e,t,n){const r=t.props||{},i=r.label||"",o=r.height||10,s=r.options||[],l=r.isFocused||!1,a=r.disabled||!1;if("vertical"===(r.direction||"vertical")){let t=1+(0===s.length?1:Math.min(o,s.length))+1;if(i&&(t+=1),l&&!a&&(t+=1),s.length>o&&(t+=1),e.setHeight(t),void 0===r.width&&void 0===r.flex){let t=20;for(let e=0;e<s.length;e++){const n=J(s[e].label||String(s[e].value));n>t&&(t=n)}e.setWidth(t+8)}}else e.setHeight(i?4:3);return{}}}class qn extends Hn{applyLayout(e,t,n){const r=t.props||{},i=r.label||"",o=r.height||10,s=r.options||[],l=r.isFocused||!1,a=r.disabled||!1;let c=1+(0===s.length?1:Math.min(o,s.length))+1;if(i&&(c+=1),l&&!a&&(c+=1),s.length>o&&(c+=1),e.setHeight(c),void 0===r.width&&void 0===r.flex){let t=20;for(let e=0;e<s.length;e++){const n=J(s[e].label||String(s[e].value));n>t&&(t=n)}e.setWidth(t+4)}return{}}}class Jn extends Hn{applyLayout(e,t,n){const r=t.props||{},i=r.border,o=r.padding||0,s=!1!==i,l=!!r.bg;if((s||0!==o||l)&&(s?e.setBorder(x.EDGE_ALL,1):l&&(e.setPadding(x.EDGE_TOP,1),e.setPadding(x.EDGE_BOTTOM,1))),void 0!==r.maxHeight){const t=s||l?2:0,n=2*o,i=r.maxHeight+t+n;e.setMaxHeight(i)}return{}}}class Kn extends Hn{applyLayout(e,t,n){const r=t.props||{};const i=function e(t){if(!t||0===t.length)return 0;let n=0;for(const r of t)n++,r.children&&r.children.length>0&&(n+=e(r.children));return n}(r.data||[]);return e.setHeight(Math.max(1,i)),void 0===r.width&&void 0===r.flex&&e.setWidthPercent(100),{}}}const Zn=new class{constructor(){this.handlers=new Map,this._registerDefaultHandlers()}_registerDefaultHandlers(){this.register("root",new Rn),this.register("row",new An),this.register("col",new Dn),this.register("text",new Nn),this.register("textbox",new Wn),this.register("bigtext",new $n),this.register("divider",new Fn),this.register("table",new zn),this.register("image",new jn),this.register("newline",new Pn),this.register("spacer",new Vn),this.register("button",new Gn),this.register("textinput",new Un),this.register("checkbox",new Yn),this.register("radiobox",new Xn),this.register("selectinput",new qn),this.register("box",new Jn),this.register("tree",new Kn)}register(e,t){this.handlers.set(e,t)}get(e){return this.handlers.get(e)||null}has(e){return this.handlers.has(e)}};class Qn{constructor(){this.cache=N,this._lastCacheKey=null}computeLayout(e,t,n){if(!e)return{width:0,height:0,x:0,y:0,children:[]};const r=`${t}:${n}:${Cn(e)}`,i=this.cache.getLayoutMetrics(e,r);if(i)return this.restoreCachedMetrics(e,i),e.isLayoutDirty=!1,i;this._hasTextBoxes=!1;const o=this.buildYogaTree(e,t,n,null,0,0);try{if(o.calculateLayout(t,n,x.DIRECTION_LTR),this._hasTextBoxes){this.updateTextHeights(o,e)&&o.calculateLayout(t,n,x.DIRECTION_LTR)}const i=this.extractMetrics(o,e);return this.cache.setLayoutMetrics(e,r,i),e.cachedLayoutMetrics=i,e.isLayoutDirty=!1,i}finally{this.freeYogaTree(o)}}updateTextHeights(e,t){let n=!1;if("textbox"===t.type){const r=e.getComputedWidth(),i=Bn(On(t),r),o=e.getComputedHeight();i!==o&&Math.abs(i-o)>.5&&(e.setHeight(i),n=!0)}const r=t.children;if(r&&r.length>0){let t=0;for(let i=0;i<r.length;i++){const o=r[i];if("comment"!==o.type){const r=e.getChild(t);r&&this.updateTextHeights(r,o)&&(n=!0),t++}}}return n}restoreCachedMetrics(e,t){if(e.cachedLayoutMetrics===t)return;e.cachedLayoutMetrics=t;const n=e.children,r=t.children;if(r&&n){let e=0;for(let t=0;t<n.length;t++){const i=n[t];if("comment"!==i.type){const t=r[e];t&&this.restoreCachedMetrics(i,t),e++}}}}_getComponentType(e,t){return"row"===t.flexDirection?"row":"column"===t.flexDirection?"col":e.type}_applyFlexProperties(e,t){if(void 0!==t.flex)if("number"==typeof t.flex)e.setFlexGrow(t.flex),e.setFlexShrink(1);else if("string"==typeof t.flex){const n=t.flex.split(/\s+/);if(1!==n.length||isNaN(parseFloat(n[0])))n[0]&&e.setFlexGrow(parseFloat(n[0])||0),n[1]&&e.setFlexShrink(parseFloat(n[1])||1),n[2]&&"auto"!==n[2]&&e.setFlexBasis(parseFloat(n[2])||0);else{const t=parseFloat(n[0]);e.setFlexGrow(t),e.setFlexShrink(1),0!==t&&e.setFlexBasis(0)}}if(void 0!==t.flexGrow&&null!==t.flexGrow&&e.setFlexGrow(t.flexGrow),void 0!==t.flexShrink&&null!==t.flexShrink&&e.setFlexShrink(t.flexShrink),void 0!==t.flexBasis&&null!==t.flexBasis&&e.setFlexBasis(t.flexBasis),t.justifyContent){const n={"flex-start":x.JUSTIFY_FLEX_START,"flex-end":x.JUSTIFY_FLEX_END,center:x.JUSTIFY_CENTER,"space-between":x.JUSTIFY_SPACE_BETWEEN,"space-around":x.JUSTIFY_SPACE_AROUND,"space-evenly":x.JUSTIFY_SPACE_EVENLY}[t.justifyContent];void 0!==n&&e.setJustifyContent(n)}if(t.alignItems){const n={"flex-start":x.ALIGN_FLEX_START,"flex-end":x.ALIGN_FLEX_END,center:x.ALIGN_CENTER,stretch:x.ALIGN_STRETCH,baseline:x.ALIGN_BASELINE}[t.alignItems];void 0!==n&&e.setAlignItems(n)}if(t.alignSelf){const n={auto:x.ALIGN_AUTO,"flex-start":x.ALIGN_FLEX_START,"flex-end":x.ALIGN_FLEX_END,center:x.ALIGN_CENTER,stretch:x.ALIGN_STRETCH,baseline:x.ALIGN_BASELINE}[t.alignSelf];void 0!==n&&e.setAlignSelf(n)}if(t.responsive)e.setFlexWrap(x.WRAP_WRAP);else if(t.flexWrap){const n={wrap:x.WRAP_WRAP,nowrap:x.WRAP_NO_WRAP,"wrap-reverse":x.WRAP_WRAP_REVERSE}[t.flexWrap];void 0!==n&&e.setFlexWrap(n)}if(t.alignContent){const n={"flex-start":x.ALIGN_FLEX_START,"flex-end":x.ALIGN_FLEX_END,center:x.ALIGN_CENTER,stretch:x.ALIGN_STRETCH,"space-between":x.ALIGN_SPACE_BETWEEN,"space-around":x.ALIGN_SPACE_AROUND}[t.alignContent];void 0!==n&&e.setAlignContent(n)}}_applyPaddingProperties(e,t){void 0!==t.padding&&null!==t.padding&&e.setPadding(x.EDGE_ALL,t.padding),void 0!==t.paddingLeft&&null!==t.paddingLeft&&e.setPadding(x.EDGE_LEFT,t.paddingLeft),void 0!==t.paddingRight&&null!==t.paddingRight&&e.setPadding(x.EDGE_RIGHT,t.paddingRight),void 0!==t.paddingTop&&null!==t.paddingTop&&e.setPadding(x.EDGE_TOP,t.paddingTop),void 0!==t.paddingBottom&&null!==t.paddingBottom&&e.setPadding(x.EDGE_BOTTOM,t.paddingBottom)}_applyMarginProperties(e,t,n,r,i,o){if(void 0!==t.margin){const s=n>0&&r>0&&i?n:0,l=n>0&&r>0&&o?n:0;e.setMargin(x.EDGE_LEFT,s+t.margin),e.setMargin(x.EDGE_RIGHT,t.margin),e.setMargin(x.EDGE_TOP,l+t.margin),e.setMargin(x.EDGE_BOTTOM,t.margin)}else{if(void 0!==t.marginLeft){const o=n>0&&r>0&&i?n:0;e.setMargin(x.EDGE_LEFT,o+t.marginLeft)}if(void 0!==t.marginRight&&e.setMargin(x.EDGE_RIGHT,t.marginRight),void 0!==t.marginTop){const i=n>0&&r>0&&o?n:0;e.setMargin(x.EDGE_TOP,i+t.marginTop)}void 0!==t.marginBottom&&e.setMargin(x.EDGE_BOTTOM,t.marginBottom)}}buildYogaTree(e,t,n,r=null,i=0,o=0){const s=x.Node.create(),l=e.props||{},a=r?.props||{},c=a.gap||0,h="row"===r?.type||"row"===a.flexDirection,u="col"===r?.type||"column"===a.flexDirection;c>0&&i>0&&(h?s.setMargin(x.EDGE_LEFT,c):u&&s.setMargin(x.EDGE_TOP,c)),this._applyFlexProperties(s,l),this._applyPaddingProperties(s,l),this._applyMarginProperties(s,l,c,i,h,u),null!=l.width&&("string"==typeof l.width&&l.width.endsWith("%")?s.setWidthPercent(parseFloat(l.width)):s.setWidth(l.width)),void 0!==l.minWidth&&s.setMinWidth(l.minWidth),void 0!==l.maxWidth&&s.setMaxWidth(l.maxWidth),void 0!==l.minHeight&&s.setMinHeight(l.minHeight),void 0!==l.maxHeight&&s.setMaxHeight(l.maxHeight);const d=this._getComponentType(e,l),p=Zn.get(d);if(p){p.applyLayout(s,e,{containerWidth:t,containerHeight:n,parentNode:r,childIndex:i,siblingCount:o}).hasTextBoxes&&(this._hasTextBoxes=!0)}void 0===l.height||p||("string"==typeof l.height&&l.height.endsWith("%")?s.setHeightPercent(parseFloat(l.height)):s.setHeight(l.height)),void 0===l.flex&&"col"===e.type&&void 0===l.height&&(s.setFlexGrow(1),s.setFlexShrink(1),s.setFlexBasis(0));let f=t;if("box"===e.type){const e=!1!==l.border?2:0,n=2*(l.padding||0),r=l.width||l._injectedWidth||t;f=Math.max(0,r-e-n)}"col"!==e.type&&"row"!==e.type||!l.width||(f=l.width);let g=n;if("box"===e.type){const e=!1!==l.border?2:0,t=2*(l.padding||0),r=l.height||l._injectedHeight||n;g=Math.max(0,r-e-t)}"col"!==e.type&&"row"!==e.type||!l.height||(g=l.height);let m=0;for(let t=0;t<e.children.length;t++)"comment"!==e.children[t].type&&m++;let v=0;for(const t of e.children)if("comment"!==t.type){const n=this.buildYogaTree(t,f,g,e,v,m);s.insertChild(n,v),v++}return s}extractMetrics(e,t){const n=e.getComputedLayout(),r=t.children;let i=0;if(r)for(let e=0;e<r.length;e++)"comment"!==r[e].type&&i++;const o={width:Math.round(n.width),height:Math.round(n.height),x:Math.round(n.left),y:Math.round(n.top),children:i>0?new Array(i):[]};if(r&&i>0){let t=0;for(let n=0;n<r.length;n++){const i=r[n];if("comment"!==i.type){const n=e.getChild(t),r=this.extractMetrics(n,i);o.children[t]=r,i.cachedLayoutMetrics=r,t++}}}return o}freeYogaTree(e){if(!e)return;for(let t=e.getChildCount()-1;t>=0;t--){const n=e.getChild(t);this.freeYogaTree(n)}e.freeRecursive()}invalidateLayout(e){if(!e)return;const t=[e];let n=0;for(;t.length>0&&n<1e4;){const e=t.shift();n++,e.isLayoutDirty=!0,this.cache.invalidateLayoutMetrics(e);const r=e.children;if(r)for(let e=0;e<r.length;e++)t.push(r[e])}}clearCache(){this.cache.clearAll()}getStats(){return this.cache.getStats()}}class er{constructor(e=2e3){this.maxSize=e,this.cache=new Map}get(e){const t=this.cache.get(e);if(void 0!==t)return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){if(this.cache.delete(e),this.cache.set(e,t),this.cache.size>this.maxSize){const e=this.cache.keys().next().value;this.cache.delete(e)}}clear(){this.cache.clear()}get size(){return this.cache.size}}const tr=new er(2e3),nr=new Map;function rr(e,t){let n=tr.get(e);return void 0===n&&(n=t(e),tr.set(e,n)),n}function ir(e,t,n){let r=nr.get(t);if(!r){if(nr.size>=5){const e=nr.keys().next().value;nr.delete(e)}r=new er(500),nr.set(t,r)}let i=r.get(e);return void 0===i&&(i=n(e,t),r.set(e,i)),i}function or(e,t,n,r,i=null){const o=e.length,s=new Array(o);for(let l=0;l<o;l++){const o=e[l],a=rr(o,n);let c;if(c=a>t?ir(o,t,r):o,i){const e=a>t?t:a,n=Math.max(0,t-e);s[l]=i+c+i+" ".repeat(n)+"[0m"}else s[l]=c}return s}function sr(){tr.clear(),nr.clear()}class lr{constructor(){this.regions=[],this.isDirty=!0,this._scrollOffset=0,this.viewportHeight=0,this.debugServer=null}build(e,t=0,n=0){const r=e._clickRegions||[];this._scrollOffset=t,this.viewportHeight=n;this.regions=[];for(const e of r){const r=e.y-t;r<n+50&&r+e.height>-50&&this.regions.push({componentId:e.componentId,x:e.x,absY:e.y,screenY:r,width:e.width,height:e.height,depth:e.depth,nodeType:e.nodeType})}this.regions.length>500&&(this.regions=this.regions.slice(-500)),this.isDirty=!1,this.debugServer&&this.debugServer.captureEvent("clickmap.build",{sourceCount:r.length,filteredCount:this.regions.length,scrollOffset:t,viewportHeight:n})}hitTest(e,t){const n=e-1,r=t-1;this.debugServer&&this.debugServer.captureEvent("clickmap.hittest",{terminalX:e,terminalY:t,layoutX:n,layoutY:r,scrollOffset:this._scrollOffset,regionCount:this.regions.length});for(let e=this.regions.length-1;e>=0;e--){const t=this.regions[e],i=n>=t.x&&n<t.x+t.width,o=r>=t.screenY&&r<t.screenY+t.height;if(i&&o)return this.debugServer&&this.debugServer.captureEvent("clickmap.hit",{componentId:t.componentId,nodeType:t.nodeType,region:{x:t.x,screenY:t.screenY,width:t.width,height:t.height}}),t.componentId}return this.debugServer&&this.debugServer.captureEvent("clickmap.miss",{layoutX:n,layoutY:r}),null}adjustForScroll(e){if(this._scrollOffset===e)return;const t=e-this._scrollOffset;this._scrollOffset=e;for(let e=0;e<this.regions.length;e++)this.regions[e].screenY-=t;this.debugServer&&this.debugServer.captureEvent("clickmap.scroll",{delta:t,newScrollOffset:e,regionCount:this.regions.length})}invalidate(){this.isDirty=!0}clear(){this.regions.length=0,this.isDirty=!0,this._scrollOffset=0,this.viewportHeight=0}setDebugServer(e){this.debugServer=e}getRegions(){return this.regions}getStats(){return{regionCount:this.regions.length,maxRegions:500,isDirty:this.isDirty,scrollOffset:this._scrollOffset,viewportHeight:this.viewportHeight}}debugPrint(){console.error("=== ClickMap Debug ==="),console.error(`Scroll: ${this._scrollOffset}, Viewport: ${this.viewportHeight}, Dirty: ${this.isDirty}`),console.error(`Regions (${this.regions.length}):`);for(let e=0;e<this.regions.length;e++){const t=this.regions[e];console.error(` [${e}] ${t.nodeType} "${t.componentId}" x:${t.x}-${t.x+t.width} screenY:${t.screenY}-${t.screenY+t.height} (absY:${t.absY})`)}console.error("======================")}}const ar={background:"#0a0a0f",foreground:"#e6e8f0",primary:"#3d5eff",secondary:"#969ebd",success:"#4ecca3",warning:"#c97945",danger:"#d64d64",info:"#5eb3d6",components:{box:{color:"#4a4f6a",bg:null},textBox:{color:"#e6e8f0",bg:null},textInput:{color:"#e6e8f0",borderColor:"#3d5eff",bg:null,focusColor:"#7d5fff",errorColor:"#d64d64"},button:{variants:{primary:{bg:"#3d5eff",color:"#ffffff",bold:!0},secondary:{bg:"#5a617a",color:"#e6e8f0",bold:!1},danger:{bg:"#d64d64",color:"#ffffff",bold:!0},warning:{bg:"#c97945",color:"#ffffff",bold:!0},info:{bg:"#5eb3d6",color:"#0a0a0f",bold:!1},success:{bg:"#4ecca3",color:"#0a0a0f",bold:!0}}},checkbox:{color:"#5a617a",checkedColor:"#7d5fff",uncheckedColor:"#4a4f6a"},radiobox:{color:"#5a617a",selectedColor:"#7d5fff",unselectedColor:"#4a4f6a"}}};function cr(e,t){const n={...e};for(const r in t)void 0!==t[r]&&null!==t[r]&&("object"!=typeof t[r]||Array.isArray(t[r])?n[r]=t[r]:n[r]=cr(e[r]||{},t[r]));return n}function hr(e={}){return e&&"object"==typeof e?cr(ar,e):{...ar}}function ur(e,t){if(!e||!t)return null;const n=t.split(".");let r=e;for(const e of n){if(!r||"object"!=typeof r||!(e in r))return null;r=r[e]}return"string"==typeof r?r:null}class dr{constructor(e={}){var n;this.config={...e},e.forceColors&&(u.level=3),this.theme=hr(e.theme||{}),this.themeBgCode=(n=this.theme?.background,V(n)),this.debugServer=null,this.debugServerConfig=this.config.debugServer,this.rootContainer=new C("root"),this.rootContainer.vuettyViewport=this.viewport,this.viewportState=t({version:0,width:0,height:0}),this.app=null,this.renderer=null,this.currentOutput="",this.resizeHandler=null,this.cleanupHandler=null,this.resizeTimeout=null,this.layoutEngine=null,this.logUpdate=null,this.scrollThrottleMs=16,this.lastScrollTime=0,this.pendingScrollRender=null,this.lastScrollOffset=0,this.accumulatedScrollDelta=0,this.visibleLinesCache={offset:-1,lines:null,output:null},this.viewport={scrollOffset:0,contentHeight:0,terminalHeight:0,terminalWidth:0,enabled:!0,autoScrollToBottom:!0,mouseWheelEnabled:!0,mouseWheelScrollLines:3,scrollIndicatorMode:e.scrollIndicatorMode||"reserved",mouseTrackingEnabled:!0,...e.viewport},this.inputManager=new an({onExit:()=>this.handleExit()}),this.clickMap=new lr,this.clickHandlers=new Map,this._handlerOrder=[]}use(e,...t){if(!this.app)throw new Error("No app created. Call createApp() first.");return this.app.use(e,...t),this}handleExit(){this.unmount(),process.exit(0)}enableMouseTracking(){this.viewport.mouseTrackingEnabled||(process.stdout.write("[?1000h"),process.stdout.write("[?1006h"),this.viewport.mouseTrackingEnabled=!0,this.render())}disableMouseTracking(){this.viewport.mouseTrackingEnabled&&(process.stdout.write("[?1006l"),process.stdout.write("[?1000l"),this.viewport.mouseTrackingEnabled=!1,this.render())}toggleMouseTracking(){this.viewport.mouseTrackingEnabled?this.disableMouseTracking():this.enableMouseTracking()}handleResize(){this.resizeTimeout&&clearTimeout(this.resizeTimeout),this._resizeStartTime||(this._resizeStartTime=Date.now());const e=Date.now()-this._resizeStartTime<500?100:50;this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=null,this._resizeStartTime=null,this.performResize()},e)}performResize(){this.viewport.terminalHeight=process.stdout.rows||24,this.viewport.terminalWidth=process.stdout.columns||80,"reserved"===this.viewport.scrollIndicatorMode&&(this.viewport.terminalHeight-=1),this.updateMaxScrollOffset(),B(this.viewport),this.clampScrollOffset(),this.viewportState.version++,this.viewportState.width=this.viewport.terminalWidth,this.viewportState.height=this.viewport.terminalHeight,this.debugServer&&this.debugServer.captureEvent("vuetty.resize",{width:this.viewport.terminalWidth,height:this.viewport.terminalHeight,version:this.viewportState.version}),this.logUpdate.clear(),sr(),this.visibleLinesCache={offset:-1,lines:null,output:null},this.layoutEngine&&this.rootContainer&&this.layoutEngine.invalidateLayout(this.rootContainer),this.rootContainer&&L(this.rootContainer,!0),this.clickMap.invalidate(),this.renderer&&this.renderer.forceUpdate&&this.renderer.forceUpdate()}scrollUp(e=1){const t=Date.now(),n=Math.max(0,this.viewport.scrollOffset-e);if(n!==this.viewport.scrollOffset){if(this.viewport.scrollOffset=n,this.clickMap.isDirty||this.clickMap.adjustForScroll(n),t-this.lastScrollTime<this.scrollThrottleMs)return this.accumulatedScrollDelta-=e,void(this.pendingScrollRender||(this.pendingScrollRender=setTimeout(()=>{this.pendingScrollRender=null;const e=this.accumulatedScrollDelta;this.accumulatedScrollDelta=0,this.renderScrollSafe(e)},this.scrollThrottleMs)));this.lastScrollTime=t,this.accumulatedScrollDelta=0,this.renderScroll(-e)}}scrollDown(e=1){const t=Date.now(),n=this.viewport.maxScrollOffset,r=Math.min(n,this.viewport.scrollOffset+e);if(r!==this.viewport.scrollOffset){if(this.viewport.scrollOffset=r,this.clickMap.isDirty||this.clickMap.adjustForScroll(r),t-this.lastScrollTime<this.scrollThrottleMs)return this.accumulatedScrollDelta+=e,void(this.pendingScrollRender||(this.pendingScrollRender=setTimeout(()=>{this.pendingScrollRender=null;const e=this.accumulatedScrollDelta;this.accumulatedScrollDelta=0,this.renderScrollSafe(e)},this.scrollThrottleMs)));this.lastScrollTime=t,this.accumulatedScrollDelta=0,this.renderScroll(e)}}renderScrollSafe(e){Math.abs(e)>this.viewport.terminalHeight/2?(this.logUpdate.clear(),this.render()):this.renderScroll(e)}renderScroll(e=0){const t=this.currentOutput,n=this.visibleLinesCache;let r;n.output===t?r=n.lines:(r=t.split("\n"),n.output=t,n.lines=r),this.viewport.contentHeight=r.length,this.updateMaxScrollOffset(),this.clampScrollOffset();const i=this.viewport.scrollOffset,o=Math.min(this.viewport.scrollOffset+this.viewport.terminalHeight,this.viewport.contentHeight),s=r.slice(i,o),l=this.shouldShowScrollIndicator(),a=or(s,this.viewport.terminalWidth,J,K,this.themeBgCode);let c=a.join("\n");const h=a.length;l&&(c+="\n"+this.getScrollIndicator()),this.logUpdate.renderScroll(c,e,h),this.lastScrollOffset=this.viewport.scrollOffset}scrollToTop(){0!==this.viewport.scrollOffset&&(this.viewport.scrollOffset=0,!this.clickMap.isDirty&&this.clickMap.regions.length>0&&this.clickMap.adjustForScroll(0),this.render())}scrollToBottom(){const e=this.viewport.maxScrollOffset;this.viewport.scrollOffset!==e&&(this.viewport.scrollOffset=e,!this.clickMap.isDirty&&this.clickMap.regions.length>0&&this.clickMap.adjustForScroll(e),this.render())}pageUp(){this.scrollUp(this.viewport.terminalHeight)}pageDown(){this.scrollDown(this.viewport.terminalHeight)}clampScrollOffset(){const e=this.viewport.maxScrollOffset;this.viewport.scrollOffset=Math.max(0,Math.min(this.viewport.scrollOffset,e))}isAtBottom(){const e=this.viewport.maxScrollOffset;return this.viewport.scrollOffset>=e}handleViewportKey(e){const t=null!==this.inputManager.getFocusedId();if(e.shift&&e.key===we)return this.scrollUp(),!0;if(e.shift&&e.key===xe)return this.scrollDown(),!0;if(!t){if(e.key===Te)return this.pageUp(),!0;if(e.key===Be)return this.pageDown(),!0;if(e.key===we)return this.scrollUp(),!0;if(e.key===xe)return this.scrollDown(),!0;if(e.key===Le)return this.scrollToTop(),!0;if(e.key===Ee)return this.scrollToBottom(),!0}return!(e.key!==_e||!t)&&(this.inputManager.blur(),!0)}registerClickHandler(e,t){const n=this._handlerOrder.indexOf(e);for(-1!==n&&this._handlerOrder.splice(n,1),this._handlerOrder.push(e);this._handlerOrder.length>200;){const e=this._handlerOrder.shift();this.clickHandlers.delete(e)}this.clickHandlers.set(e,t)}unregisterClickHandler(e){this.clickHandlers.delete(e);const t=this._handlerOrder.indexOf(e);-1!==t&&this._handlerOrder.splice(t,1)}handleClick(e,t,n){this.clickMap.isDirty&&this.clickMap.build(this.rootContainer,this.viewport.scrollOffset,this.viewport.terminalHeight);const r=this.clickMap.hitTest(e,t);if(this.debugServer&&this.debugServer.captureEvent("input.click",{x:e,y:t,componentId:r,handled:!!r}),r){const e=this.clickHandlers.get(r);if(e)return this._pressedComponentId=r,e(n),this.inputManager.onInputChange(),!0}return!1}handleRelease(e,t,n){if(!this._pressedComponentId)return!1;const r=this._pressedComponentId;this._pressedComponentId=null,this.debugServer&&this.debugServer.captureEvent("input.release",{x:e,y:t,componentId:r});const i=this.clickHandlers.get(r);return!!i&&(i({...n,action:"left_release"}),this.inputManager.onInputChange(),!0)}handleViewportMouse(e){return!!this.viewport.mouseWheelEnabled&&("wheel_up"===e.action?(this.scrollUp(this.viewport.mouseWheelScrollLines),!0):"wheel_down"===e.action?(this.scrollDown(this.viewport.mouseWheelScrollLines),!0):"left_click"===e.action?this.handleClick(e.x,e.y,e):"left_release"===e.action&&this.handleRelease(e.x,e.y,e))}provideRouter(e){if(!this.app)throw new Error("No app created. Call createApp() first.");this.app.provide("vuetty:router",e)}setupCleanupHandlers(){const e=()=>{this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),process.stdout.write("[?25h"),process.stdout.write("[?1049l")};this.cleanupHandler=e,process.on("exit",this.cleanupHandler),process.on("SIGTERM",()=>{e(),process.exit(0)}),process.on("SIGHUP",()=>{e(),process.exit(0)}),process.on("uncaughtException",t=>{e(),console.error("Uncaught exception:",t),process.exit(1)}),process.on("unhandledRejection",(t,n)=>{e(),console.error("Unhandled rejection at:",n,"reason:",t),process.exit(1)})}createApp(e,t=null){return this.renderer=ln({onUpdate:e=>this.handleUpdate(e),rootContainer:this.rootContainer,beforeRender:e=>{this.debugServer&&this.debugServer.captureEvent("layout.compute",{width:this.viewport.terminalWidth,height:this.viewport.terminalHeight});const t=e.isLayoutDirty||e.childrenDirty;this.layoutEngine.computeLayout(e,this.viewport.terminalWidth,this.viewport.terminalHeight),t&&this.clickMap.invalidate()},afterRender:e=>{this.clickMap.isDirty&&this.clickMap.build(e,this.viewport.scrollOffset,this.viewport.terminalHeight)}}),this.renderer.vuettyInstance=this,this.app=this.renderer.createApp(e,t),this.debugServer&&this.debugServer.interceptVueWarnings(this.app),this.app}mount(){if(!this.app)throw new Error("No app created. Call createApp() first.");let e="";if(e+="[?1049h[2J[H",this.theme?.background){const t=function(e){if(!e)return null;let t,n,r;if(F[e])[t,n,r]=F[e];else if(W.test(e)){let i=e.slice(1);3===i.length&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]),6===i.length&&(t=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),r=parseInt(i.slice(4,6),16))}else{const i=e.match($);i&&(t=parseInt(i[1],10),n=parseInt(i[2],10),r=parseInt(i[3],10))}if(void 0===t||void 0===n||void 0===r)return null;if(t<0||t>255||n<0||n>255||r<0||r>255)return null;const i=t.toString(16).padStart(2,"0"),o=n.toString(16).padStart(2,"0"),s=r.toString(16).padStart(2,"0");return`rgb:${i+i}/${o+o}/${s+s}`}(this.theme.background);t&&(e+=`]11;${t}`)}return e+="[?25l",this.viewport.mouseTrackingEnabled&&(e+="[?1000h",e+="[?1006h"),process.stdout.write(e),this.viewport.terminalHeight=process.stdout.rows||24,this.viewport.terminalWidth=process.stdout.columns||80,"reserved"===this.viewport.scrollIndicatorMode&&(this.viewport.terminalHeight-=1),this.logUpdate=new Tn(process.stdout),this.layoutEngine=new Qn,this.setupCleanupHandlers(),this.viewportState.width=this.viewport.terminalWidth,this.viewportState.height=this.viewport.terminalHeight,B(this.viewport),this.app.provide(fe,this.inputManager),this.app.provide("vuetty:renderer",this.renderer),this.app.provide(ge,this.viewportState),this.app.provide(me,this),this.app.provide(ve,this.theme),this.app.mount(this.rootContainer),this.inputManager.setVuettyInstance(this),this.inputManager.setViewportHandler(e=>e.action?this.handleViewportMouse(e):this.handleViewportKey(e)),this.inputManager.enable(),this.registerGlobalComponents(),this.resizeHandler=()=>this.handleResize(),process.on("SIGWINCH",this.resizeHandler),this.debugServerConfig?.enabled&&Promise.resolve().then(function(){return wr}).then(async({DebugServer:e})=>{const{serializeViewport:t}=await Promise.resolve().then(function(){return vr});this.debugServer=new e(this.debugServerConfig),this.debugServer.setVuettyInstance(this),this.clickMap.setDebugServer(this.debugServer);try{await this.debugServer.start(),this.debugServer.consoleInterceptor?.isActive||console.log(`Debug server running at http://${this.debugServer.config.host}:${this.debugServer.config.port}`),this.debugServer.captureEvent("vuetty.mount",{viewport:t(this.viewport)})}catch(e){console.error("[Vuetty] Failed to start debug server:",e)}}),this}unmount(){return this.pendingScrollRender&&(clearTimeout(this.pendingScrollRender),this.pendingScrollRender=null),this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.inputManager.disable(),this.inputManager.clear(),this.resizeHandler&&(process.removeListener("SIGWINCH",this.resizeHandler),this.resizeHandler=null),this.cleanupHandler&&(process.removeListener("exit",this.cleanupHandler),process.removeListener("SIGTERM",this.cleanupHandler),process.removeListener("SIGHUP",this.cleanupHandler),process.removeListener("uncaughtException",this.cleanupHandler),process.removeListener("unhandledRejection",this.cleanupHandler),this.cleanupHandler=null),this.app&&this.app.unmount(),this.logUpdate&&(this.logUpdate.done(),this.logUpdate=null),this.layoutEngine&&(this.layoutEngine.clearCache(),this.layoutEngine=null),this.clickHandlers.clear(),this._handlerOrder.length=0,this.clickMap&&this.clickMap.clear(),this.rootContainer&&this.rootContainer.cleanup(),this.visibleLinesCache={offset:-1,lines:null,output:null},this.viewport.mouseTrackingEnabled&&(process.stdout.write("[?1006l"),process.stdout.write("[?1000l")),this.debugServer&&(this.debugServer.captureEvent("vuetty.unmount",{}),this.debugServer.stop()),process.stdout.write("]111"),process.stdout.write("[?1049l"),process.stdout.write("[?25h"),this}registerGlobalComponents(){try{Object.entries(Ln).filter(([e,t])=>t&&"object"==typeof t&&t.name&&"function"==typeof t.setup).forEach(([e,t])=>{this.app&&"function"==typeof this.app.component&&this.app.component(t.name,t)})}catch(e){this.debugServer&&this.debugServer.captureEvent("vue.error",{message:"Failed to register global components",error:e.message,stack:e.stack})}}handleUpdate(e){const t=this.currentOutput!==e;this.currentOutput=e,this.visibleLinesCache.output=null,t&&this.clickMap.invalidate(),this.render()}shouldShowScrollIndicator(){const e="reserved"===this.viewport.scrollIndicatorMode?this.viewport.terminalHeight:process.stdout.rows||24;return this.viewport.contentHeight>e}render(){const e=this.currentOutput,t=this.visibleLinesCache;let n;t.output===e&&t.lines?n=t.lines:(n=e.split("\n"),t.output=e,t.lines=n);const r=this.viewport.contentHeight;if(this.viewport.contentHeight=n.length,this.updateMaxScrollOffset(),this.viewport.autoScrollToBottom&&r>0){if(this.viewport.scrollOffset>=Math.max(0,r-this.viewport.terminalHeight)-1&&this.viewport.contentHeight>r){const e=Math.max(0,this.viewport.contentHeight-this.viewport.terminalHeight);this.viewport.scrollOffset=e}}this.clampScrollOffset();const i=this.viewport.scrollOffset,o=Math.min(this.viewport.scrollOffset+this.viewport.terminalHeight,this.viewport.contentHeight),s=n.slice(i,o),l=this.shouldShowScrollIndicator();let a=or(s,this.viewport.terminalWidth,J,K,this.themeBgCode).join("\n");l&&(a+="\n"+this.getScrollIndicator()),this.logUpdate.render(a),this.clickMap.isDirty?this.clickMap.build(this.rootContainer,this.viewport.scrollOffset,this.viewport.terminalHeight):this.clickMap.regions.length>0&&this.clickMap._scrollOffset!==this.viewport.scrollOffset&&this.clickMap.adjustForScroll(this.viewport.scrollOffset)}getScrollIndicator(){const{scrollOffset:e,contentHeight:t,terminalHeight:n,mouseTrackingEnabled:r}=this.viewport,i=e+1,o=Math.min(e+n,t),s=Math.max(0,t-n),l=s>0?Math.round(e/s*100):0,a=0===e,c=e>=s;let h="";h=a&&c?`Lines ${i}-${o} of ${t}`:a?`[Top] ↓ Lines ${i}-${o} of ${t}`:c?`↑ [Bottom] Lines ${i}-${o} of ${t}`:`↑ ${l}% ↓ Lines ${i}-${o} of ${t}`;h+=(r?" [Scroll]":" [Select]")+" (Alt+M)";const u=J(h),d=Math.max(0,this.viewport.terminalWidth-u),p=h+" ".repeat(d);return this.themeBgCode?this.themeBgCode+"[2m"+p+"[0m":"[2m"+p+"[0m"}clear(){process.stdout.write("[2J[0f"),this.logUpdate.clear()}getOutput(){return this.currentOutput}updateMaxScrollOffset(){this.viewport.maxScrollOffset=Math.max(0,this.viewport.contentHeight-this.viewport.terminalHeight)}getMemoryStats(){const e={timestamp:Date.now(),caches:{},nodeTree:{},viewport:{},process:{}};this.layoutEngine&&(e.caches.layoutEngine=this.layoutEngine.getStats());try{e.caches.lineCache=function(){let e=0;for(const t of nr.values())e+=t.size;return{widthCacheSize:tr.size,widthCacheMaxSize:2e3,truncateBuckets:nr.size,truncateBucketsMaxSize:5,truncateCacheSize:e,truncateMaxPerBucket:500,maxPossibleMemory:4500}}()}catch(t){e.caches.lineCache={error:t.message}}if(this.clickMap&&(e.caches.clickMap=this.clickMap.getStats?this.clickMap.getStats():{regions:this.clickMap.regions?.length||0,isDirty:this.clickMap.isDirty}),e.caches.clickHandlers=this.clickHandlers?.size||0,this.rootContainer&&(e.nodeTree=this._countNodes(this.rootContainer)),e.viewport={contentHeight:this.viewport.contentHeight,outputLength:this.currentOutput?.length||0,visibleLinesCached:null!==this.visibleLinesCache?.output},"undefined"!=typeof process&&process.memoryUsage){const t=process.memoryUsage();e.process={heapUsedMB:Math.round(t.heapUsed/1024/1024*100)/100,heapTotalMB:Math.round(t.heapTotal/1024/1024*100)/100,rssMB:Math.round(t.rss/1024/1024*100)/100,externalMB:Math.round((t.external||0)/1024/1024*100)/100}}return e}clearAllCaches(){return this.layoutEngine&&this.layoutEngine.clearCache(),sr(),ot.clear(),it.length=0,kn&&kn.clear(),dn.clear(),this.visibleLinesCache={offset:-1,lines:null,output:null},this.rootContainer&&L(this.rootContainer,!0),this.clickMap&&this.clickMap.clear(),this.logUpdate&&this.logUpdate.clear(),"undefined"!=typeof global&&global.gc&&global.gc(),this.getMemoryStats()}_countNodes(e,t=0){if(!e)return{total:0,maxDepth:0,withCache:0,withLayoutCache:0};let n=1,r=t,i=null!==e.cachedOutput?1:0,o=null!==e.cachedLayoutMetrics?1:0;if(e.children)for(const s of e.children){const e=this._countNodes(s,t+1);n+=e.total,r=Math.max(r,e.maxDepth),i+=e.withCache,o+=e.withLayoutCache}return{total:n,maxDepth:r,withCache:i,withLayoutCache:o}}}function pr(e){return new dr(e)}function fr(e,t={}){const n=new dr(t);return n.createApp(e),n.mount(),n}class gr{constructor(e){this.debugServer=e,this.originalConsole={log:console.log,error:console.error,warn:console.warn},this.isActive=!1}activate(){if(this.isActive)return;const e=this;console.log=(...t)=>{e.debugServer.captureEvent("console.log",{args:t.map(t=>e.serialize(t))})},console.error=(...t)=>{e.debugServer.captureEvent("console.error",{args:t.map(t=>e.serialize(t))})},console.warn=(...t)=>{e.debugServer.captureEvent("console.warn",{args:t.map(t=>e.serialize(t))})},this.isActive=!0}deactivate(){this.isActive&&(console.log=this.originalConsole.log,console.error=this.originalConsole.error,console.warn=this.originalConsole.warn,this.isActive=!1)}interceptVueWarnings(e){const t=this;e.config.warnHandler=(e,n,r)=>{t.debugServer.captureEvent("vue.warn",{message:e,trace:r||"",component:n?.$options?.name||n?.__name||"Anonymous"})},e.config.errorHandler=(e,n,r)=>{t.debugServer.captureEvent("vue.error",{message:e.message||String(e),stack:e.stack||"",info:r||"",component:n?.$options?.name||n?.__name||"Anonymous"})}}serialize(e){if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);if(null===e)return"null";if(void 0===e)return"undefined";if(e instanceof Error)return`${e.name}: ${e.message}\n${e.stack||""}`;try{return JSON.stringify(e,null,2)}catch(t){return String(e)}}}function mr(e){return e?{scrollOffset:e.scrollOffset||0,contentHeight:e.contentHeight||0,terminalHeight:e.terminalHeight||0,terminalWidth:e.terminalWidth||0,autoScrollToBottom:!1!==e.autoScrollToBottom,mouseWheelEnabled:!1!==e.mouseWheelEnabled,mouseWheelScrollLines:e.mouseWheelScrollLines||3,scrollIndicatorMode:e.scrollIndicatorMode||"reserved",mouseTrackingEnabled:!1!==e.mouseTrackingEnabled}:null}var vr=Object.freeze({__proto__:null,serializeNodeTree:function e(t,n=0,r=5){if(!t||n>r)return null;const i={type:t.type,text:t.text||null,isDirty:t.isDirty||!1,isLayoutDirty:t.isLayoutDirty||!1};if(t.props&&Object.keys(t.props).length>0){i.props={};for(const[e,n]of Object.entries(t.props))null==n||"string"==typeof n||"number"==typeof n||"boolean"==typeof n?i.props[e]=n:Array.isArray(n)?i.props[e]=`[Array(${n.length})]`:"object"==typeof n?i.props[e]="[Object]":"function"==typeof n&&(i.props[e]="[Function]")}return t.cachedLayoutMetrics&&(i.layout={x:t.cachedLayoutMetrics.left||0,y:t.cachedLayoutMetrics.top||0,width:t.cachedLayoutMetrics.width||0,height:t.cachedLayoutMetrics.height||0}),t.children&&t.children.length>0&&(i.children=t.children.map(t=>e(t,n+1,r)).filter(e=>null!==e)),i},serializeViewport:mr});const br=S(import.meta.url),yr=m(br);var wr=Object.freeze({__proto__:null,DebugServer:class{constructor(e={}){this.config={port:3e3,host:"localhost",captureConsole:!0,treeCaptureIntervalMs:2e3,treeMaxDepth:4,memoryStatsIntervalMs:5e3,...e},this.clients=new Set,this.eventBuffer=[],this.maxBufferSize=500,this.server=null,this.vuettyInstance=null,this.consoleInterceptor=null,this.latestLayoutTree=null,this.lastTreeCapture=0,this.latestMemoryStats=null,this.memoryStatsInterval=null,this.cleanupInterval=null}shallowSerialize(e){if(null==e)return e;if("object"!=typeof e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return{error:"Serialization failed"}}}setVuettyInstance(e){this.vuettyInstance=e}async start(){if(this.server)return;const e=this,t=v(yr,"static");try{this.server=Bun.serve({port:this.config.port,hostname:this.config.host,fetch(e,n){if(n.upgrade(e))return;const r=new URL(e.url),i={"/":"index.html","/debug.js":"debug.js","/debug.css":"debug.css","/favicon.ico":"favicon.ico"},o=i[r.pathname];if(!o){const e=`404: ${r.pathname}\nAvailable routes: ${Object.keys(i).join(", ")}`;return new Response(e,{status:404})}const s=v(t,o),l=Bun.file(s);return new Response(l)},websocket:{open(t){e.clients.add(t);const n=e.eventBuffer.slice(-50);t.send(JSON.stringify({type:"init",data:{viewport:e.vuettyInstance?mr(e.vuettyInstance.viewport):null,buffer:n,layoutTree:e.latestLayoutTree,memory:e.latestMemoryStats}}))},close(t){e.clients.delete(t)},message(t,n){try{"clear"===JSON.parse(n).type&&(e.eventBuffer=[],e.broadcast({type:"cleared",data:{}}))}catch(e){}}}}),this.config.captureConsole&&(this.consoleInterceptor=new gr(this),this.consoleInterceptor.activate()),this.startMemoryStats(),this.startCleanupInterval(),this.captureEvent("debug.server.started",{port:this.config.port,host:this.config.host,url:`http://${this.config.host}:${this.config.port}`})}catch(e){throw new Error(`Failed to start debug server: ${e.message}`)}}stop(){if(this.server){this.stopMemoryStats(),this.stopCleanupInterval(),this.consoleInterceptor&&(this.consoleInterceptor.deactivate(),this.consoleInterceptor=null);for(const e of this.clients)e.close();this.clients.clear(),this.server.stop(),this.server=null,this.eventBuffer=[],this.latestLayoutTree=null,this.latestMemoryStats=null}}interceptVueWarnings(e){this.consoleInterceptor&&this.consoleInterceptor.interceptVueWarnings(e)}captureRenderComplete({duration:e,outputLength:t,rootContainer:n}){if(this.captureEvent("render.complete",{duration:e,outputLength:t}),!n)return;const r=Date.now();r-this.lastTreeCapture<this.config.treeCaptureIntervalMs||(this.lastTreeCapture=r,Promise.resolve().then(function(){return vr}).then(({serializeNodeTree:e})=>{const t=e(n,0,this.config.treeMaxDepth);this.latestLayoutTree=t,this.broadcast({timestamp:Date.now(),type:"layout.tree",data:{tree:t}})}).catch(()=>{}))}startMemoryStats(){this.memoryStatsInterval||!this.config.memoryStatsIntervalMs||this.config.memoryStatsIntervalMs<=0||(this.memoryStatsInterval=setInterval(()=>{if(!this.vuettyInstance||"function"!=typeof this.vuettyInstance.getMemoryStats)return;const e=this.vuettyInstance.getMemoryStats();this.latestMemoryStats=e,this.broadcast({timestamp:e.timestamp||Date.now(),type:"vuetty.memory",data:e})},this.config.memoryStatsIntervalMs))}stopMemoryStats(){this.memoryStatsInterval&&(clearInterval(this.memoryStatsInterval),this.memoryStatsInterval=null)}startCleanupInterval(){this.cleanupInterval||(this.cleanupInterval=setInterval(()=>{this.eventBuffer.length>200&&(this.eventBuffer=this.eventBuffer.slice(-200))},3e4))}stopCleanupInterval(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}captureEvent(e,t){const n={timestamp:Date.now(),type:e,data:this.shallowSerialize(t)};this.eventBuffer.push(n),this.eventBuffer.length>this.maxBufferSize&&this.eventBuffer.shift(),this.broadcast(n)}broadcast(e){const t=JSON.stringify(e);for(const e of this.clients)try{e.send(t)}catch(t){this.clients.delete(e)}}}});export{Mt as BigText,lt as Box,qt as Button,jt as Checkbox,hn as Col,k as CommentNode,ar as DEFAULT_THEME,ce as Divider,Tt as Gradient,pt as Image,_n as Markdown,pe as Newline,ye as ProgressBar,Gt as Radiobox,ee as RenderContext,te as RenderHandler,cn as Row,Ft as SelectInput,de as Spacer,ue as Spinner,C as TUINode,Je as Table,ut as TextBox,Nt as TextInput,M as TextNode,bt as Tree,fe as VUETTY_INPUT_MANAGER_KEY,ve as VUETTY_THEME_KEY,dr as Vuetty,It as clearBigTextCache,ln as createTUIRenderer,hr as createTheme,pr as createVuetty,_t as getBigTextCacheStats,ne as renderHandlerRegistry,on as renderToString,ur as resolveThemeColor,fr as vuetty};
|
|
1
|
+
import{createRenderer as e}from"@vue/runtime-core";import{reactive as o,h as t,ref as r,watch as l,onUnmounted as n,nextTick as c,inject as a,computed as s,provide as f,onMounted as i}from"vue";import d from"chalk";import u from"string-width";import b from"terminal-image";import h from"figlet";import{readFileSync as g}from"fs";import{dirname as p,join as m}from"path";import x from"gradient-string";import{marked as y}from"marked";import{highlight as C}from"cli-highlight";import v from"yoga-layout";import{fileURLToPath as w}from"url";class k{constructor(e){this.type=e,this.props={},this.children=[],this.parent=null,this.text="",this.isDirty=!0,this.childrenDirty=!0,this.renderVersion=0,this.cachedOutput=null,this.cachedChildrenOutput=null,this.isLayoutDirty=!0,this.cachedLayoutMetrics=null,this._renderWidth=void 0,this.componentId=null,this.clickable=!1}appendChild(e){e.parent&&e.parent.removeChild(e),e.parent=this,this.children.push(e)}removeChild(e){const o=this.children.indexOf(e);-1!==o&&(this.children.splice(o,1),e.parent=null,e.clearCaches())}insertBefore(e,o){e.parent&&e.parent.removeChild(e),e.parent=this;const t=this.children.indexOf(o);-1!==t?this.children.splice(t,0,e):this.children.push(e)}setText(e){this.text=e}setProps(e){Object.assign(this.props,e)}markDirty(){this.isDirty=!0,this.cachedOutput=null,this.renderVersion++}markLayoutDirty(){this.isLayoutDirty=!0,this.renderVersion++,this.parent&&this.parent.markLayoutDirty()}invalidateChildrenCache(){this.childrenDirty=!0,this.cachedChildrenOutput=null,this.cachedOutput=null}canSkipRender(){return!this.isDirty&&!this.childrenDirty&&null!==this.cachedOutput}clearCaches(){this.cachedOutput=null,this.cachedChildrenOutput=null,this.cachedLayoutMetrics=null,this.isDirty=!0,this.childrenDirty=!0,this.isLayoutDirty=!0}cleanup(){this.clearCaches(),this.parent=null,this.props={},this.text="",this.componentId=null;for(let e=0;e<this.children.length;e++)this.children[e].cleanup();this.children=[]}}class S extends k{constructor(e=""){super("text"),this.text=e}}class _ extends k{constructor(e=""){super("comment"),this.text=e}}function O(e,o){if(!e.children||0===e.children.length)return"";if(!e.childrenDirty&&null!==e.cachedChildrenOutput)return e.cachedChildrenOutput;const t=e.children,r=t.length,l=new Array(r);let n=!1;for(let e=0;e<r;e++){const r=t[e],c=r.cachedOutput;l[e]=o(r),l[e]!==c&&(n=!0)}return(n||null===e.cachedChildrenOutput)&&(e.cachedChildrenOutput=l.join("")),e.childrenDirty=!1,e.cachedChildrenOutput}function I(e){if(!e)return;e.isDirty=!0,e.cachedOutput=null;let o=e.parent;for(;o&&!o.childrenDirty;)o.childrenDirty=!0,o.cachedOutput=null,o=o.parent}function E(e,o=!1){if(!e)return;if(!o)return e.isDirty=!0,e.childrenDirty=!0,e.renderVersion++,e.cachedOutput=null,e.cachedChildrenOutput=null,void(e.cachedLayoutMetrics=null);const t=[e];let r=0;for(;t.length>0&&r<1e4;){const e=t.shift();r++,e.isDirty=!0,e.childrenDirty=!0,e.renderVersion++,e.cachedOutput=null,e.cachedChildrenOutput=null,e.cachedLayoutMetrics=null;const o=e.children;if(o)for(let e=0;e<o.length;e++)t.push(o[e])}}const T=o({terminalWidth:80,terminalHeight:24});function N(e){e&&(T.terminalWidth=e.terminalWidth,T.terminalHeight=e.terminalHeight)}let A=[],B=!1;function L(){A=[],B=!0}function R(){B=!1;const e=A;return A=[],e}let M=class{constructor(e=5e3){this.maxSize=e,this.cache=new Map}get(e){if(!this.cache.has(e))return null;const o=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,o),o}set(e,o){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,o),this.cache.size>this.maxSize){const e=this.cache.keys().next().value;this.cache.delete(e)}}has(e){return this.cache.has(e)}clear(){this.cache.clear()}get size(){return this.cache.size}};const H=new class{constructor(e={}){this.textMeasurementCache=new M(e.textCacheSize||5e3),this.layoutMetricsCache=new WeakMap,this._metricsEntryCount=0}measureText(e){return this.textMeasurementCache.get(e)}setMeasurement(e,o){this.textMeasurementCache.set(e,o)}hasMeasurement(e){return this.textMeasurementCache.has(e)}getLayoutMetrics(e,o){if(!this.layoutMetricsCache.has(e))return null;return this.layoutMetricsCache.get(e).get(o)||null}setLayoutMetrics(e,o,t){this.layoutMetricsCache.has(e)||this.layoutMetricsCache.set(e,new Map);const r=this.layoutMetricsCache.get(e);if(r.has(o)||this._metricsEntryCount++,r.set(o,t),r.size>3){const e=r.keys().next().value;r.delete(e),this._metricsEntryCount--}}invalidateLayoutMetrics(e){if(this.layoutMetricsCache.has(e)){const o=this.layoutMetricsCache.get(e);this._metricsEntryCount-=o.size,this.layoutMetricsCache.delete(e)}}clearAll(){this.textMeasurementCache.clear(),this._metricsEntryCount=0}getStats(){return{textMeasurements:this.textMeasurementCache.size,textCacheMaxSize:this.textMeasurementCache.maxSize,metricsEntries:this._metricsEntryCount,metricsMaxPerNode:3}}},D=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/,F=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i,G={black:[0,0,0],red:[205,49,49],green:[13,188,121],yellow:[229,229,16],blue:[36,114,200],magenta:[188,63,188],cyan:[17,168,205],white:[229,229,229],gray:[102,102,102],grey:[102,102,102],brightRed:[241,76,76],brightGreen:[35,209,139],brightYellow:[245,245,67],brightBlue:[59,142,234],brightMagenta:[214,112,214],brightCyan:[41,184,219],brightWhite:[255,255,255]},U=new Map;function W(e){if(!e)return d.white;const o=z(e);let t=U.get(o);if(t)return t;if(t=P(e)||d.white,U.size>=50){const e=U.keys().next().value;U.delete(e)}return U.set(o,t),t}function P(e,o=d){if(!e)return null;if(o[e])return o[e];if(D.test(e))return o.hex(e);const t=e.match(F);if(t){const[,e,r,l]=t,n=parseInt(e),c=parseInt(r),a=parseInt(l);if(n>=0&&n<=255&&c>=0&&c<=255&&a>=0&&a<=255)return o.rgb(n,c,a)}return null}function $(e,o=d){if(!e)return null;const t=`bg${e.charAt(0).toUpperCase()}${e.slice(1)}`;if(o[t])return o[t];if(D.test(e))return o.bgHex(e);const r=e.match(F);if(r){const[,e,t,l]=r,n=parseInt(e),c=parseInt(t),a=parseInt(l);if(n>=0&&n<=255&&c>=0&&c<=255&&a>=0&&a<=255)return o.bgRgb(n,c,a)}return null}function z(e){return e&&"string"==typeof e?e.startsWith("#")?e.toLowerCase():e.startsWith("rgb(")?e.replace(/\s+/g,""):e:""}function K(e){if(!e)return null;const o={black:"[30m",red:"[31m",green:"[32m",yellow:"[33m",blue:"[34m",magenta:"[35m",cyan:"[36m",white:"[37m",gray:"[90m",grey:"[90m",brightRed:"[91m",brightGreen:"[92m",brightYellow:"[93m",brightBlue:"[94m",brightMagenta:"[95m",brightCyan:"[96m",brightWhite:"[97m"};if(o[e])return o[e];if(e.startsWith("#")){let o=e.slice(1);if(3===o.length&&(o=o[0]+o[0]+o[1]+o[1]+o[2]+o[2]),6===o.length){const e=parseInt(o.slice(0,2),16),t=parseInt(o.slice(2,4),16),r=parseInt(o.slice(4,6),16);if(!isNaN(e)&&!isNaN(t)&&!isNaN(r))return`[38;2;${e};${t};${r}m`}}const t=e.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(t){return`[38;2;${parseInt(t[1],10)};${parseInt(t[2],10)};${parseInt(t[3],10)}m`}return null}function j(e){if(!e)return null;if(G[e]){const[o,t,r]=G[e];return`[48;2;${o};${t};${r}m`}if(e.startsWith("#")){let o=e.slice(1);if(3===o.length&&(o=o[0]+o[0]+o[1]+o[1]+o[2]+o[2]),6===o.length){const e=parseInt(o.slice(0,2),16),t=parseInt(o.slice(2,4),16),r=parseInt(o.slice(4,6),16);if(!isNaN(e)&&!isNaN(t)&&!isNaN(r))return`[48;2;${e};${t};${r}m`}}const o=e.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(o){return`[48;2;${parseInt(o[1],10)};${parseInt(o[2],10)};${parseInt(o[3],10)}m`}return null}function V(e){return j(e)}function Y(e){if(!e)return null;let o,t,r;if(G[e])[o,t,r]=G[e];else if(D.test(e)){let l=e.slice(1);3===l.length&&(l=l[0]+l[0]+l[1]+l[1]+l[2]+l[2]),6===l.length&&(o=parseInt(l.slice(0,2),16),t=parseInt(l.slice(2,4),16),r=parseInt(l.slice(4,6),16))}else{const l=e.match(F);l&&(o=parseInt(l[1],10),t=parseInt(l[2],10),r=parseInt(l[3],10))}if(void 0===o||void 0===t||void 0===r)return null;if(o<0||o>255||t<0||t>255||r<0||r>255)return null;const l=o.toString(16).padStart(2,"0"),n=t.toString(16).padStart(2,"0"),c=r.toString(16).padStart(2,"0");return`rgb:${l+l}/${n+n}/${c+c}`}var X=Object.freeze({__proto__:null,colorToAnsiBg:V,colorToOSC11:Y,getAnsiBgCode:j,getAnsiFgCode:K,getChalkBgChain:$,getChalkColor:W,getChalkColorChain:P,normalizeColorForCache:z});const Z=/^\x1b\[[0-9;]*m/,J=/\x1b\[[0-9;]*m/g,q=/^\x1b\[0?m$/,Q=(()=>{const e=new Array(201);e[0]="";for(let o=1;o<=200;o++)e[o]=" ".repeat(o);return e})();function ee(e){return e<=0?"":Q[e]??" ".repeat(e)}function oe(e){const o=H.measureText(e);if(null!=o)return o;const t=u(e);return H.setMeasurement(e,t),t}function te(e,o){if(!e||o<=0)return"";let t=0,r="",l=0;const n=e.length;let c=!1;for(;l<n&&t<o;){const n=e.slice(l).match(Z);if(n){const e=n[0];r+=e,l+=e.length,c=!q.test(e);continue}const a=e[l],s=u(a);if(!(t+s<=o))break;r+=a,t+=s,l++}return l<n&&c&&(r+="[0m"),r}function re(e,o){if(!o||o<=0)return e;const t=e.split("\n"),r=[];for(let e=0;e<t.length;e++){const l=t[e];if(oe(l)<=o){r.push(l);continue}let n=l,c=[];for(;n.length>0;){if(oe(n)<=o){r.push(n);break}let e=0,t=0,l=-1,a=0,s="";for(;t<n.length&&e<o;){const r=n.slice(t).match(Z);if(r){const e=r[0];s+=e,q.test(e)?c=[]:c.push(e),t+=e.length;continue}const f=n[t],i=u(f);if(!(e+i<=o))break;s+=f,e+=i," "===f&&(l=t,a=e),t++}let f=s,i=t;if(l>=0&&a>.3*o){f="";let e=0;for(;e<=l;){const o=n.slice(e).match(Z);o?(f+=o[0],e+=o[0].length):(f+=n[e],e++)}i=l+1}c.length>0&&(f+="[0m"),r.push(f.trimEnd()),n=n.slice(i),c.length>0&&n.length>0&&(n=c.join("")+n)}}return r.join("\n")}function le(e,o){if(!(o.bold||o.italic||o.underline||o.dim||o.color||o.bg))return e;let t=d;if(o.bold&&(t=t.bold),o.italic&&(t=t.italic),o.underline&&(t=t.underline),o.dim&&(t=t.dim),o.color){const e=P(o.color,t);e&&(t=e)}if(o.bg){const e=$(o.bg,t);e&&(t=e)}return t(e)}class ne{constructor({node:e,depth:o,absX:t,absY:r,inRow:l,renderNodeFn:n}){this.node=e,this.depth=o,this.absX=t,this.absY=r,this.inRow=l,this._renderNode=n}get props(){return this.node.props||{}}get text(){return this.node.text||""}get children(){return this.node.children||[]}get metrics(){return this.node.cachedLayoutMetrics}getEffectiveWidth(){return void 0!==this.node._renderWidth?this.node._renderWidth:null!=this.node.props?.width?this.node.props.width:this.metrics?.width?this.metrics.width:null}renderChild(e,o={}){return this._renderNode(e,this.depth+1,{parentAbsX:o.parentAbsX??this.absX,parentAbsY:this.absY,yOffset:o.yOffset??0,inRow:o.inRow??this.inRow})}}class ce{render(e){throw new Error("render() must be implemented")}}const ae=new class{constructor(){this.handlers=new Map}register(e,o){this.handlers.set(e,o)}get(e){return this.handlers.get(e)||null}has(e){return this.handlers.has(e)}unregister(e){this.handlers.delete(e)}},se={flex:{type:[Number,String],default:null},flexGrow:{type:Number,default:null},flexShrink:{type:Number,default:null},flexBasis:{type:[Number,String],default:null},alignSelf:{type:String,default:null,validator:e=>null===e||["auto","flex-start","flex-end","center","stretch","baseline"].includes(e)}},fe={width:{type:[Number,String],default:null},height:{type:[Number,String],default:null},minWidth:{type:Number,default:null},maxWidth:{type:Number,default:null},minHeight:{type:Number,default:null},maxHeight:{type:Number,default:null}},ie={padding:{type:Number,default:null},paddingLeft:{type:Number,default:null},paddingRight:{type:Number,default:null},paddingTop:{type:Number,default:null},paddingBottom:{type:Number,default:null}},de={margin:{type:Number,default:null},marginLeft:{type:Number,default:null},marginRight:{type:Number,default:null},marginTop:{type:Number,default:null},marginBottom:{type:Number,default:null}},ue={...{justifyContent:{type:String,default:null,validator:e=>null===e||["flex-start","flex-end","center","space-between","space-around","space-evenly"].includes(e)},alignItems:{type:String,default:null,validator:e=>null===e||["flex-start","flex-end","center","stretch","baseline"].includes(e)},alignContent:{type:String,default:null,validator:e=>null===e||["flex-start","flex-end","center","stretch","space-between","space-around"].includes(e)},flexWrap:{type:String,default:null,validator:e=>null===e||["nowrap","wrap","wrap-reverse"].includes(e)},flexDirection:{type:String,default:null,validator:e=>null===e||["row","column","row-reverse","column-reverse"].includes(e)},gap:{type:Number,default:null}},...se,...fe,...ie,...de},be={...se,...fe,...ie,...de};var he={name:"Divider",props:{char:{type:String,default:"─"},length:{type:Number,default:40},color:String,...be},setup:e=>()=>t("divider",e)};ae.register("divider",new class extends ce{render(e){return function(e){const{char:o="─",length:t=40}=e;return le(o.repeat(t)+"\n",e)}(e.props)}});const ge={dots:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],line:["-","\\","|","/"],arc:["◐","◓","◑","◒"],arrow:["▹","▸","▹","▸"],bounce:["⠁","⠈","⠐","⠠","⢀","⡀","⠄","⠂"],clock:["🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚","🕛"],box:["▖","▘","▝","▗"]};var pe={name:"Spinner",props:{type:{type:String,default:"dots",validator:e=>["dots","line","arc","arrow","bounce","clock","box"].includes(e)},modelValue:{type:Boolean,default:!0},interval:{type:Number,default:100,validator:e=>e>0},label:{type:String,default:""},labelPosition:{type:String,default:"right",validator:e=>["left","right"].includes(e)},color:String,bold:Boolean,italic:Boolean,underline:Boolean,dim:Boolean,...be},emits:["update:modelValue"],setup(e){const o=r(0),a=r(!1);let s=null;function f(){a.value||(a.value=!0,o.value=0,d())}function i(){a.value=!1,null!==s&&(clearTimeout(s),s=null),o.value=0}function d(){if(!a.value)return;const t=ge[e.type]||ge.dots;o.value=(o.value+1)%t.length,c(()=>{a.value&&(s=setTimeout(d,e.interval))})}return l(()=>e.modelValue,e=>{e?f():i()},{immediate:!0}),l(()=>e.type,()=>{a.value&&(o.value=0)}),l(()=>e.interval,()=>{a.value&&(i(),f())}),n(()=>{i()}),()=>t("spinner",{...e,frame:o.value})}};ae.register("spinner",new class extends ce{render(e){return function(e){const{type:o="dots",frame:t=0,label:r="",labelPosition:l="right"}=e,n=ge[o]||ge.dots,c=n[t%n.length];return le(("left"===l?[r,r?" ":"",c]:[c,r?" ":"",r]).join(""),e)}(e.props)}});var me={name:"Spacer",props:{count:{type:Number,default:1}},setup:e=>()=>t("spacer",e)};ae.register("spacer",new class extends ce{render(e){return o=e.props," ".repeat(o&&o.count||1);var o}});var xe={name:"Newline",props:{count:{type:Number,default:1}},setup:e=>()=>t("newline",e)};ae.register("newline",new class extends ce{render(e){return function(e){const o=e&&e.count||1;return"\n".repeat(o)}(e.props)}});const ye="vuetty:inputManager",Ce="vuetty:router",ve="vuetty:renderer",we="vuetty:viewportState",ke="vuetty:instance",Se="vuetty:theme",_e=Symbol("vuettyWidthContext");var Oe={name:"ProgressBar",props:{value:{type:Number,default:0},max:{type:Number,default:100},width:{type:Number,default:40},char:{type:String,default:"█"},emptyChar:{type:String,default:"░"},showPercentage:{type:Boolean,default:!0},label:{type:String,default:""},labelPosition:{type:String,default:"left",validator:e=>["left","right","above","below"].includes(e)},brackets:{type:Boolean,default:!0},color:String,emptyColor:String,percentageColor:String,bold:Boolean,italic:Boolean,underline:Boolean,dim:Boolean,...be},setup(e){const o=a(we,null),r=a(_e,null);return()=>{const l="function"==typeof r?r():r,n={...e,_injectedWidth:l,_viewportVersion:o?o.version:0};return t("progressbar",n)}}};ae.register("progressbar",new class extends ce{render(e){return function(e){const{value:o=0,max:t=100,width:r=40,char:l="█",emptyChar:n="░",showPercentage:c=!0,label:a="",labelPosition:s="left",brackets:f=!0,color:i="green",emptyColor:d="white",percentageColor:u="white"}=e,b=Math.min(100,Math.max(0,o/t*100)),h=Math.round(b/100*r),g=r-h;let p=le(l.repeat(h),{color:i,bold:e.bold})+le(n.repeat(g),{color:d,dim:!0});f&&(p="["+p+"]");let m="";c&&(m=le(` ${b.toFixed(0)}%`,{color:u}));const x=p+m;return"above"===s?le(a,e)+"\n"+x:"below"===s?x+"\n"+le(a,e):"left"===s?le(a,e)+(a?" ":"")+x:x+(a?" ":"")+le(a,e)}(e.props)}});const Ie="up",Ee="down",Te="left",Ne="right",Ae="enter",Be="backspace",Le="delete",Re="escape",Me="home",He="end",De="pageup",Fe="pagedown",Ge="ctrl_c",Ue="ctrl_d",We="ctrl_a",Pe="ctrl_e",$e="ctrl_enter",ze={"[A":Ie,"[B":Ee,"[C":Ne,"[D":Te,"[1;2A":Ie,"[1;2B":Ee,"[1;2C":Ne,"[1;2D":Te,"[H":Me,"[F":He,"[1~":Me,"[4~":He,"[5~":De,"[6~":Fe,"[3~":Le,"\r":Ae,"\n":Ae,"":Be,"\b":Be,"\t":"tab","":Re,"":Ge,"":Ue,"":We,"":Pe,"\v":"ctrl_k","":"ctrl_w","\r":$e,"\n":$e};function Ke(e){return"char"===e.key&&null!==e.char}const je=0,Ve=1,Ye=2,Xe=64,Ze=65,Je=4,qe=8,Qe=16,eo=32;function oo(e){let o=e.match(/^\x1b\[<(\d+);(\d+);(\d+)([Mm])$/),t=!0;if(!o&&(o=e.match(/^\x1b\[(\d+);(\d+);(\d+)M$/),t=!1,!o))return null;const r=parseInt(o[1],10),l=parseInt(o[2],10),n=parseInt(o[3],10),c=t&&"m"===o[4],a=-61&r;let s;return s=a===Xe?"wheel_up":a===Ze?"wheel_down":0!==(r&eo)&&a<=Ye?"drag":a===je?c?"left_release":"left_click":a===Ve?c?"middle_release":"middle_click":a===Ye?c?"right_release":"right_click":"unknown",{type:"mouse",action:s,button:a,x:l,y:n,shift:0!==(r&Je),ctrl:0!==(r&Qe),alt:0!==(r&qe)}}let to=0;var ro={name:"Table",props:{modelValue:{type:Number,default:null},headers:{type:Array,default:()=>[]},rows:{type:Array,default:()=>[]},label:{type:String,default:""},height:{type:Number,default:10},columnWidths:{type:Array,default:null},striped:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},color:String,bg:String,focusColor:{type:String,default:"cyan"},selectedColor:{type:String,default:"green"},highlightColor:{type:String,default:"yellow"},headerColor:{type:String,default:"white"},stripedColor:{type:String,default:"black"},bold:Boolean,dim:Boolean,hint:{type:[String,Boolean],default:"default"},...be},emits:["update:modelValue","change","focus","blur","select"],setup(e,{emit:o}){const c=a(ye),f=a(ke,null),i=a(we,null),d=a(_e,null),u="table-"+ ++to,b=r(0),h=r(0),g=s(()=>null===e.modelValue||void 0===e.modelValue?-1:e.modelValue),p=s(()=>c&&c.isFocused(u));function m(){b.value<h.value?h.value=b.value:b.value>=h.value+e.height&&(h.value=b.value-e.height+1)}function x(){b.value>0&&(b.value--,m())}function y(){b.value<e.rows.length-1&&(b.value++,m())}function C(){b.value=0,m()}return l(p,(e,t)=>{e&&!t?o("focus"):!e&&t&&o("blur")}),l(()=>e.rows,()=>{b.value>=e.rows.length&&(b.value=Math.max(0,e.rows.length-1),m())}),c&&c.registerComponent(u,function(t){if(!e.disabled)if(t.key!==Ie)if(t.key!==Ee)if(t.key!==Me){if(t.key===He)return b.value=e.rows.length-1,void m();if(t.key!==De)if(t.key!==Fe)t.key!==Ae&&" "!==t.char||0!==e.rows.length&&(o("update:modelValue",b.value),o("change",b.value),o("select",{index:b.value,row:e.rows[b.value]}));else for(let o=0;o<e.height;o++)y();else for(let o=0;o<e.height;o++)x()}else C();else y();else x()},{disabled:e.disabled}),f&&f.registerClickHandler(u,function(o){e.disabled||c.focus(u)}),g.value>=0&&g.value<e.rows.length?(b.value=g.value,m()):e.rows.length>0&&C(),n(()=>{c&&c.unregisterComponent(u),f&&f.unregisterClickHandler(u)}),l(()=>e.disabled,e=>{c&&c.setComponentDisabled(u,e)}),()=>{const o="function"==typeof d?d():d,r=e.rows,l=e.headers;return t("table",{...e,rows:Array.isArray(r)?[...r]:r,headers:Array.isArray(l)?[...l]:l,highlightedIndex:b.value,selectedIndex:g.value,scrollOffset:h.value,isFocused:p.value,_componentId:u,_clickable:!0,_injectedWidth:o,_viewportVersion:i?i.version:0})}}};function lo(e,o,t,r,l,n,c){const{highlightColor:a,selectedColor:s,isFocused:f,disabled:i}=c;let u=t("│");for(let c=0;c<o.length;c++){const b=String(e[c]||""),h=o[c]-2;let g=b;oe(b)>h&&(g=b.substring(0,h-1)+"…");const p=oe(g);g=" "+g+" ".repeat(h-p+1);let m=g;if(r&&f&&!i){m=(d[a]?d[a].bold.inverse:d.bold.inverse)(g)}else if(l){m=(d[s]?d[s].bold:d.bold)(g)}else n&&(m=d.bgBlack(g));u+=m+t("│")}return u+"\n"}function no(e,o){let t=o("│");for(let r=0;r<e.length;r++)t+=" ".repeat(e[r])+o("│");return t+"\n"}function co(e){const{headers:o=[],rows:t=[],label:r="",height:l=10,highlightedIndex:n=0,selectedIndex:c=-1,scrollOffset:a=0,isFocused:s=!1,showHeader:f=!0,striped:i=!0,columnWidths:u=null,focusColor:b="cyan",selectedColor:h="green",highlightColor:g="yellow",headerColor:p="white",stripedColor:m="black",disabled:x=!1,hint:y="default"}=e;let C="";if(r){C+=le(s&&!x?d.bold(r):r,e)+"\n"}if(0===o.length&&0===t.length)return C+function(e,o,t){const r=e?o:t.color||"white",l=e?(d[r]||d).bold:d[r]||d;let n="";return n+=l("┌"+"─".repeat(22)+"┐")+"\n",n+=l("│")+" No data".padEnd(22," ")+l("│")+"\n",n+=l("└"+"─".repeat(22)+"┘")+"\n",n}(s,b,e);const v=function(e,o,t){if(t&&t.length>0)return t;const r=Math.max(e.length,...o.map(e=>e.length)),l=Array.from({length:r},()=>0);for(let o=0;o<e.length;o++){const t=String(e[o]||"");l[o]=Math.max(l[o],oe(t))}for(const e of o)for(let o=0;o<e.length;o++){const t=String(e[o]||"");l[o]=Math.max(l[o],oe(t))}return l.map(e=>e+2)}(o,t,u),w=s&&!x?b:e.color||"white",k=s&&!x?(d[w]||d).bold:d[w]||d;C+=function(e,o){let t="┌";for(let o=0;o<e.length;o++)t+="─".repeat(e[o]),o<e.length-1&&(t+="┬");return t+="┐",o(t)+"\n"}(v,k),f&&o.length>0&&(C+=function(e,o,t,r){let l=t("│");for(let n=0;n<o.length;n++){const c=String(e[n]||""),a=o[n]-2;let s=c;oe(c)>a&&(s=c.substring(0,a-1)+"…");const f=oe(s);s=" "+s+" ".repeat(a-f+1),l+=(d[r]?d[r].bold:d.bold)(s)+t("│")}return l+"\n"}(o,v,k,p),C+=function(e,o){let t="├";for(let o=0;o<e.length;o++)t+="─".repeat(e[o]),o<e.length-1&&(t+="┼");return t+="┤",o(t)+"\n"}(v,k));const S=t.slice(a,a+l);for(let e=0;e<l;e++){const o=a+e,t=S[e];if(t){C+=lo(t,v,k,s&&o===n,o===c,i&&o%2==1,{highlightColor:g,selectedColor:h,isFocused:s,disabled:x})}else C+=no(v,k)}if(C+=function(e,o){let t="└";for(let o=0;o<e.length;o++)t+="─".repeat(e[o]),o<e.length-1&&(t+="┴");return t+="┘",o(t)+"\n"}(v,k),s&&!x&&!1!==y){let e="";"default"===y?e="↑↓ Navigate • Enter/Space to select • Tab to next field":y&&""!==y&&(e=y),e&&(C+=d.dim(e)+"\n")}if(t.length>l){const e=Math.round(a/Math.max(1,t.length-l)*100);C+=d.dim(`[${e}% - showing ${a+1}-${Math.min(a+l,t.length)} of ${t.length} rows]`)+"\n"}return C}function ao(e,o){if(!e||o<=0)return"";const t=e.split("\n"),r=t.length;if(r===o)return e;if(r<o){const e=o-r;for(let o=0;o<e;o++)t.push("");return t.join("\n")}return t.slice(0,o).join("\n")}ae.register("table",new class extends ce{render(e){return co(e.props)}});const so=Symbol("vuettyHeightContext"),fo=/\n+$/;class io{constructor(e=30){this.lines=new Array(e),this.index=0}append(e){if(this.index>=this.lines.length){const e=new Array(2*this.lines.length);for(let o=0;o<this.lines.length;o++)e[o]=this.lines[o];this.lines=e}this.lines[this.index++]=e}toString(){if(0===this.index)return"";if(1===this.index)return this.lines[0];let e=this.lines[0];for(let o=1;o<this.index;o++)e+="\n"+this.lines[o];return e}clear(){for(let e=0;e<this.index;e++)this.lines[e]=null;this.index=0}}const uo=[];const bo={rounded:{topLeft:"╭",topRight:"╮",bottomLeft:"╰",bottomRight:"╯",horizontal:"─",vertical:"│"},square:{topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",horizontal:"─",vertical:"│"},double:{topLeft:"╔",topRight:"╗",bottomLeft:"╚",bottomRight:"╝",horizontal:"═",vertical:"║"},classic:{topLeft:"+",topRight:"+",bottomLeft:"+",bottomRight:"+",horizontal:"-",vertical:"|"},bold:{topLeft:"┏",topRight:"┓",bottomLeft:"┗",bottomRight:"┛",horizontal:"━",vertical:"┃"},dashed:{topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",horizontal:"╌",vertical:"╎"},sparse:{topLeft:"·",topRight:"·",bottomLeft:"·",bottomRight:"·",horizontal:"·",vertical:"·"},light:{topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",horizontal:" ",vertical:" "},button:{topLeft:"╭",topRight:"╮",bottomLeft:"╰",bottomRight:"╯",horizontal:"─",vertical:"│"}};var ho={name:"Box",props:{border:{type:Boolean,default:!0},borderStyle:{type:[String,Object],default:"rounded"},color:String,bg:String,bold:Boolean,italic:Boolean,underline:Boolean,dim:Boolean,title:{type:String,default:null},titleAlign:{type:String,default:"left",validator:e=>["left","center","right"].includes(e)},titlePadding:{type:Number,default:1},...be,padding:{type:Number,default:0}},setup(e,{slots:o}){const r=a(_e,null),l=a(so,null),n=a(we,null),c=a(Se,null);let s,i;f(_e,()=>{const o=(null!==e.width&&void 0!==e.width?e.width:"function"==typeof r?r():r||T.terminalWidth||process.stdout.columns||80)-(e.border?2:0)-2*e.padding;return o>0?o:null}),f(so,()=>{const o=null!==e.height&&void 0!==e.height?e.height:"function"==typeof l?l():l;if(null==o)return null;const t=o-(e.border?2:0)-2*e.padding;return t>0?t:null});let d=-1,u=null;return()=>{const a=o.default?o.default():[],f="function"==typeof r?r():r,b="function"==typeof l?l():l,h=n?n.version:0;if(f!==s||b!==i||h!==d||!u){s=f,i=b,d=h;const o=void 0!==e.color?e.color:c?.components?.box?.color,t=void 0!==e.bg?e.bg:c?.components?.box?.bg;u={...e,_injectedWidth:f,_injectedHeight:b,_viewportVersion:h},null!=o&&(u.color=o),null!=t&&(u.bg=t)}return t("box",u,a)}}};function go(e,o){return o&&e?e.replace(/\x1b\[0m/g,"[0m"+o):e}function po(e,o,t){const{border:r=!1,borderStyle:l="rounded",padding:n=0,paddingLeft:c,paddingRight:a,paddingTop:s,paddingBottom:f,width:i,_injectedWidth:d,_targetHeight:u,title:b=null,titleAlign:h="left",titlePadding:g=1,bg:p,color:m,align:x="left"}=o,y=null!=c?c:n,C=null!=a?a:n,v=null!=s?s:n,w=null!=f?f:n;let k=null;if(void 0!==u&&u>0){const e=r?2:0,o=v+w;k=Math.max(0,u-e-o)}const S=p;if(!r&&0===y&&0===C&&0===v&&0===w&&!S)return null!=i?re(e,i):null!=d?re(e,d):e.replace(fo,"");const _=r?"string"==typeof l?bo[l]||bo.rounded:l:{topLeft:" ",topRight:" ",bottomLeft:" ",bottomRight:" ",horizontal:" ",vertical:" "},O=r?2:0,I=y+C;let E,T,N=0;if(b&&b.trim()){N=oe(b)+2*g+4}if(null!=i)E=Math.max(0,i-O),N>0&&(E=Math.max(E,N)),T=Math.max(0,E-I);else if(null!=d)T=Math.max(0,d),E=T+I,N>0&&(E=Math.max(E,N),T=Math.max(0,E-I));else{const o=e.split("\n");let t=0;for(let e=0;e<o.length;e++){const r=o[e];if(""!==r.trim()){const e=oe(r);e>t&&(t=e)}}E=Math.max(t+I,N),T=Math.max(0,E-I)}let A=e;T>0&&(null!=i||null!=d)&&(A=re(e,T)),null!==k&&k>0&&(A=ao(A,k));let B=A.split("\n");if(null===k||0===k)for(;B.length>0&&""===B[B.length-1].trim();)B.pop();const L=ee(y),R=ee(C),M=uo.pop()||new io(30),H=S?j(S):null,D=H||"",F=m?K(m):"";try{if(r){let e;if(b&&b.trim()){const t=ee(g)+b+ee(g),r=oe(t);if(r>E-4){const t=E-4-2*g,r=te(b,Math.max(1,t-1))+"…",l=ee(g)+r+ee(g),n=E-oe(l);let c=le(l,o);H&&(c=go(c,H));const a=_.topLeft+_.horizontal.repeat(2);e=D+F+a+"[0m"+c+D+F+(_.horizontal.repeat(Math.max(0,n-2))+_.topRight)+"[0m"}else{const l=E-r;let n,c;switch(h){case"right":n=l-2,c=2;break;case"center":n=Math.floor(l/2),c=l-n;break;default:n=2,c=l-2}let a=le(t,o);H&&(a=go(a,H));const s=_.topLeft+_.horizontal.repeat(Math.max(0,n));e=D+F+s+"[0m"+a+D+F+(_.horizontal.repeat(Math.max(0,c))+_.topRight)+"[0m"}}else e=_.topLeft+_.horizontal.repeat(E)+_.topRight,e=D+F+e+"[0m";M.append(e)}if(v>0){let e;if(r){const o=ee(E);e=D+F+_.vertical+"[0m"+D+o+"[0m"+D+F+_.vertical+"[0m"}else e=D+ee(E)+"[0m";for(let o=0;o<v;o++)M.append(e)}for(let e=0;e<B.length;e++){const o=B[e],t=oe(o),l=Math.max(0,T-t);let n,c;if("center"===x){const e=Math.floor(l/2),o=l-e;n=ee(e),c=ee(o)}else"right"===x?(n=ee(l),c=""):(n="",c=ee(l));const a=H?go(o,H):o;let s;s=r?D+F+_.vertical+"[0m"+D+L+n+a+D+c+R+"[0m"+D+F+_.vertical:D+L+n+a+D+c+R,M.append(s+"[0m")}if(0===B.length&&(r||H)){let e;if(r){const o=ee(E);e=D+F+_.vertical+D+o+D+F+_.vertical}else e=D+ee(E);M.append(e+"[0m")}if(w>0){let e;if(r){const o=ee(E);e=D+F+_.vertical+"[0m"+D+o+"[0m"+D+F+_.vertical+"[0m"}else e=D+ee(E)+"[0m";for(let o=0;o<w;o++)M.append(e)}if(r){const e=_.bottomLeft+_.horizontal.repeat(E)+_.bottomRight;M.append(D+F+e+"[0m")}return M.toString()}finally{!function(e){e.clear(),uo.length<5&&uo.push(e)}(M)}}function mo(e){if(!e)return 0;let o=1;for(let t=0;t<e.length;t++)10===e.charCodeAt(t)&&o++;return o}ae.register("box",new class extends ce{render(e){const{node:o,depth:t,absX:r}=e,l=e.props,n=!1!==l.border,c=l.paddingTop??l.padding??0,a=l.paddingLeft??l.padding??0,s=(n?1:0)+c,f=(n?1:0)+a;let i;if(e.children.length>0){if(!e.children.some(e=>"newline"===e.type)&&e.children.length>1){const o=[];let t=0;for(const l of e.children){if("comment"===l.type)continue;const n=e.renderChild(l,{parentAbsX:r+f,yOffset:s+t,inRow:!1});n&&(o.push(n),t+=mo(n))}i=o.join("\n")}else{let t=0;i=O(o,o=>{const l=e.renderChild(o,{parentAbsX:r+f,yOffset:s+t,inRow:!1});return t+=mo(l),l})}}else i=e.text;const d=e.getEffectiveWidth(),u=null!==d&&null==l.width;u&&(o.props.width=d);const b=po(i,l);return u&&delete o.props.width,b}});var xo={name:"TextBox",props:{color:String,bg:String,bold:Boolean,italic:Boolean,underline:Boolean,dim:Boolean,...be},setup(e,{slots:o}){const r=a(we,null),l=a(_e,null),n=a(Se,null);let c,s=-1,f="",i=null;return()=>{const a=o.default?o.default():[],d="function"==typeof l?l():l,u=r?r.version:0,b=`${e.color}|${e.bg}|${e.bold}|${e.italic}|${e.underline}|${e.dim}|${e.width}`;if(d!==c||u!==s||b!==f||!i){c=d,s=u,f=b;const o=void 0!==e.color?e.color:n?.foreground,t=void 0!==e.bg?e.bg:n?.components?.textBox?.bg;i={bold:e.bold,italic:e.italic,underline:e.underline,dim:e.dim,width:e.width,padding:e.padding,paddingLeft:e.paddingLeft,paddingRight:e.paddingRight,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,_injectedWidth:d,_viewportVersion:u},null!=o&&(i.color=o),null!=t&&(i.bg=t)}return t("textbox",i,a)}}};ae.register("textbox",new class extends ce{render(e){const{node:o}=e;let t=e.text;if(!t){let r=0;t=O(o,o=>{const t=e.renderChild(o,{yOffset:r});return r+=function(e){if(!e)return 0;let o=1;for(let t=0;t<e.length;t++)10===e.charCodeAt(t)&&o++;return o}(t),t})}const r=e.getEffectiveWidth(),l=null!==r&&null==e.props.width;l&&(o.props.width=r);const n=function(e,o){if(!e)return"";const{_injectedWidth:t,_targetHeight:r,width:l,paddingTop:n,paddingBottom:c,paddingLeft:a,paddingRight:s,padding:f=0}=o||{},i=null!=a?a:f,d=null!=s?s:f,u=null!=n?n:f,b=null!=c?c:f,h=null!=l?l:t;let g=e;h&&h>0&&(g=re(g,Math.max(0,h-i-d)));if(void 0!==r&&r>0){const e=Math.max(0,r-u-b);e>0&&(g=ao(g,e))}if(g=le(g,o||{}),i>0||d>0){const e=g.split("\n"),o=ee(i);g=e.map(e=>{const t=oe(e),r=ee(d+(h?Math.max(0,h-i-d-t):0));return o+e+r}).join("\n")}if(u>0||b>0){const e=g.split("\n"),o=ee(h||(e.length>0?oe(e[0]):0));for(let t=0;t<u;t++)e.unshift(o);for(let t=0;t<b;t++)e.push(o);g=e.join("\n")}return g}(t,e.props);return l&&delete o.props.width,n}});const yo=new Map;var Co={name:"Image",props:{src:{type:[String,Object],required:!0},width:{type:[Number,String],default:null},height:{type:[Number,String],default:null},preserveAspectRatio:{type:Boolean,default:!0},alt:{type:String,default:""},errorColor:{type:String,default:"red"},errorBorderStyle:{type:String,default:"rounded"},...be},setup(e){const o=r(null),n=r(!0),c=r(null),a=r(!1),s=r(1);async function f(){n.value=!0,c.value=null;try{a.value=Buffer.isBuffer(e.src);const c=function(){const o=process.stdout.columns||80;if(!e.width&&!e.height){const t=e.maxWidth||o;return Math.min(t,o)}if(e.width){if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("%"))return Math.floor(o*parseFloat(e.width)/100)}return o}(),i=(t=e.src,r=c,l=e.height,f=e.preserveAspectRatio,`${Buffer.isBuffer(t)?`buffer:${t.length}:${t.slice(0,16).toString("hex")}`:`file:${t}`}|${r}|${l}|${f}`),d=yo.get(i);if(d)return o.value=d.data,s.value=d.lines,void(n.value=!1);let u;if(a.value)u=e.src;else{const o=Bun.file(e.src);if(!await o.exists())throw new Error("File not found");u=Buffer.from(await o.arrayBuffer())}const h={width:c,preserveAspectRatio:e.preserveAspectRatio},g=await b.buffer(u,{...h,preferNativeRender:!1}),p=g.split("\n").length;if(yo.size>=20){const e=yo.keys().next().value;yo.delete(e)}yo.set(i,{data:g,lines:p}),s.value=p,o.value=g,n.value=!1}catch(o){c.value={message:o.message||"Failed to load image",path:a.value?"[Buffer]":e.src,code:o.code},n.value=!1}var t,r,l,f}return i(()=>{f()}),l(()=>e.src,()=>{f()}),l(()=>[e.width,e.height,e.maxWidth],()=>{o.value&&!n.value&&f()}),()=>c.value?t(ho,{border:!0,borderStyle:e.errorBorderStyle,padding:1,color:e.errorColor,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth},{default:()=>[t(xo,{color:e.errorColor,bold:!0},{default:()=>"✗ Image Load Error"}),t(xe),t(xe),t(xo,{dim:!0},{default:()=>`Path: ${c.value.path}`}),t(xe),t(xo,{},{default:()=>`Error: ${c.value.message}`}),...e.alt?[t(xe),t(xe),t(xo,{italic:!0},{default:()=>`Alt text: ${e.alt}`})]:[]]}):n.value?t(xo,{dim:!0},{default:()=>"Loading image..."}):t("image",{imageData:o.value,imageLines:s.value,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth})}};ae.register("image",new class extends ce{render(e){return function(e){const{imageData:o=""}=e;return o||""}(e.props)}});const vo={default:{branch:"├",last:"└",vertical:"│",horizontal:"──"},rounded:{branch:"├",last:"└",vertical:"│",horizontal:"──"},bold:{branch:"┣",last:"┗",vertical:"┃",horizontal:"━━"},double:{branch:"╠",last:"╚",vertical:"║",horizontal:"══"},classic:{branch:"+",last:"+",vertical:"|",horizontal:"--"}};var wo={name:"Tree",props:{data:{type:Array,default:()=>[]},color:String,bg:String,branchColor:{type:String,default:"gray"},folderColor:{type:String,default:"blue"},fileColor:{type:String,default:null},showIcons:{type:Boolean,default:!1},treeStyle:{type:[String,Object],default:"default"},...be},setup(e,{slots:o}){const r=a(_e,null),l=a(we,null),n=a(Se,null);return()=>{const c="function"==typeof r?r():r,a=o.node||o.default||null,s=o.icon||null,f=e.branchColor??n?.components?.tree?.branchColor??"gray",i=e.folderColor??n?.components?.tree?.folderColor??"blue",d=e.fileColor??n?.components?.tree?.fileColor??e.color??null,u=e.treeStyle??n?.components?.tree?.treeStyle??"default";return t("tree",{...e,branchColor:f,folderColor:i,fileColor:d,treeStyle:u,_injectedWidth:c,_viewportVersion:l?l.version:0,_nodeSlot:a,_iconSlot:s})}}};ae.register("tree",new class extends ce{render(e){return function(e){const{data:o=[],branchColor:t="gray",folderColor:r="blue",fileColor:l=null,showIcons:n=!1,treeStyle:c="default"}=e;if(!o||0===o.length)return"";const a="string"==typeof c?vo[c]||vo.default:c,s=[],f=P(t)||d,i=P(r)||d,u=P(l)||d;function b(e,o,t,r){const l=e.children&&e.children.length>0,c=l;let h="";r>0&&(h=f(t?a.last+a.horizontal+" ":a.branch+a.horizontal+" "));let g="";n&&(g=c?"📁 ":"📄 ");const p=e.name||"";let m;if(e.color){const o=P(e.color)||d;m=c?o.bold(p):o(p)}else m=c?i.bold(p):u(p);if(s.push(o+h+g+m),l){const l=e.children.length;for(let n=0;n<l;n++){const c=e.children[n],s=n===l-1;let i;i=0===r?"":o+(t?" ":f(a.vertical)+" "),b(c,i,s,r+1)}}}const h=o.length;for(let e=0;e<h;e++)b(o[e],"",!0,0);return s.join("\n")}(e.props)}});class ko{constructor(e=100){this.maxSize=e,this.cache=new Map}get(e){if(!this.cache.has(e))return null;const o=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,o),o}set(e,o){if(this.cache.has(e)&&this.cache.delete(e),this.cache.size>=this.maxSize){const e=this.cache.keys().next().value;this.cache.delete(e)}this.cache.set(e,o)}has(e){return this.cache.has(e)}clear(){this.cache.clear()}get size(){return this.cache.size}}function So(e){if(!h.figFonts||!h.figFonts[e])try{let o;try{const t=import.meta.resolve?.("figlet")||"";if(t){const r=p(t.replace("file://","")),l=m(r,"fonts",`${e}.flf`);o=g(l,"utf-8")}}catch{}if(!o)try{const t=m(process.cwd(),"node_modules","figlet","fonts",`${e}.flf`);o=g(t,"utf-8")}catch{}o&&h.parseFont(e,o)}catch(o){console.warn(`Could not preload font "${e}":`,o.message)}}const _o=["Terrace","Standard","Big","Slant"];for(const e of _o)So(e);const Oo=new ko(50),Io=new ko(100);var Eo={name:"BigText",props:{font:{type:String,default:"Standard"},horizontalLayout:{type:String,default:"default"},align:{type:String,default:"left",validator:e=>["left","center","right"].includes(e)},color:String,bg:String,bold:Boolean,italic:Boolean,underline:Boolean,dim:Boolean,...be},setup:(e,{slots:o})=>()=>{const r=o.default?o.default():[];return t("bigtext",e,r)}};function To(e,o){if(!e)return"";const{font:t="Standard",horizontalLayout:r="default",align:l="left"}=o||{},n=function(e,o){const{font:t="Standard",horizontalLayout:r="default",align:l="left"}=o||{};return`${e}|${t}|${r}|${l}|${[o?.color||"",o?.bg||"",o?.bold?"B":"",o?.italic?"I":"",o?.underline?"U":"",o?.dim?"D":""].join("")}`}(e,o),c=Io.get(n);if(null!==c)return c;const a=function(e,o,t){return`${e}|${o}|${t}`}(e,t,r);let s=Oo.get(a);if(null===s){s=h.textSync(e,{font:t,horizontalLayout:r});const o=s.split("\n");for(;o.length>0&&""===o[o.length-1].trim();)o.pop();s=o.join("\n"),Oo.set(a,s)}if("left"!==l){const e=s.split("\n"),o=Math.max(...e.map(e=>oe(e))),t=e.map(e=>function(e,o,t="left"){const r=o-oe(e);if(r<=0)return e;switch(t){case"right":return ee(r)+e;case"center":{const o=r>>1;return ee(o)+e+ee(r-o)}default:return e+ee(r)}}(e,o,l));s=t.join("\n")}let f=s;return o&&(o.color||o.bg||o.bold||o.italic||o.underline||o.dim)&&(f=le(s,o)),Io.set(n,f),f}function No(){Oo.clear(),Io.clear()}function Ao(){return{figlet:{size:Oo.size,maxSize:50},final:{size:Io.size,maxSize:100}}}ae.register("bigtext",new class extends ce{render(e){const{node:o}=e;return To(e.text||O(o,o=>e.renderChild(o)),e.props)}});const Bo={fire:["#8B0000","#FF4500","#FFD700"],ocean:["#001F3F","#0074D9","#7FDBFF"],sunset:["#4A148C","#FF6F00","#FFD54F"],forest:["#1B5E20","#66BB6A","#C5E1A5"],night:["#1A237E","#5E35B1","#EC407A"]},Lo=new Map;var Ro={name:"Gradient",props:{name:{type:String,default:null},colors:{type:Array,default:null},interpolation:{type:String,default:"hsv",validator:e=>["rgb","hsv"].includes(e)},...be},setup:(e,{slots:o})=>()=>{const r=o.default?o.default():[];return t("gradient",e,r)}};function Mo(e,o){if(!e)return"";const{name:t=null,colors:r=null,interpolation:l="hsv"}=o||{},n=e.replace(J,"");const c=function(e,o,t){const r=o?`custom:${o.join(",")}:${t}`:`preset:${e}:${t}`;let l=Lo.get(r);if(l)return l;const n={interpolation:t};if(l=o&&Array.isArray(o)&&o.length>0?x(o,n):e&&x[e]?x[e]:e&&Bo[e]?x(Bo[e],n):x.rainbow,Lo.size>50){const e=Lo.keys().next().value;Lo.delete(e)}return Lo.set(r,l),l}(t,r,l);return n.includes("\n")?c.multiline(n):c(n)}ae.register("gradient",new class extends ce{render(e){const{node:o}=e;return Mo(e.text||O(o,o=>e.renderChild(o)),e.props)}});let Ho=0;const Do=[];function Fo(e){e.length=0,Do.length<5&&Do.push(e)}const Go={topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",horizontal:"─",vertical:"│"},Uo=new Set([1,5,4,11,23,13,10]);var Wo={name:"TextInput",props:{modelValue:{type:String,default:""},multiline:{type:Boolean,default:!1},rows:{type:Number,default:3},minRows:{type:Number,default:1},maxRows:{type:Number,default:void 0},autoResize:{type:Boolean,default:!0},wrapLines:{type:Boolean,default:!0},label:{type:String,default:""},placeholder:{type:String,default:""},hint:{type:[String,Boolean],default:"default"},color:String,borderColor:String,bg:String,focusColor:{type:String,default:"cyan"},errorColor:{type:String,default:"red"},bold:Boolean,italic:Boolean,dim:Boolean,pattern:RegExp,required:Boolean,maxLength:Number,disabled:Boolean,readonly:Boolean,...be},emits:["update:modelValue","change","focus","blur","validate"],setup(e,{emit:r}){const c=a(ye),f=a(ke,null),i=a(Se,null),d=a(we,null),u=a(_e,null),b="textinput-"+ ++Ho,h=o({text:e.modelValue||"",cursor:(e.modelValue||"").length,scrollOffset:0,validationError:null,isFocused:!1});let g=e.modelValue||"";function p(){h.cursor>h.text.length?h.cursor=h.text.length:h.cursor<0&&(h.cursor=0),x(),C(),h.text!==g&&(g=h.text,r("update:modelValue",h.text))}const m=s(()=>c&&c.isFocused(b));function x(){const o=[],t=h.text;e.required&&!t.trim()&&o.push("Required"),e.maxLength&&t.length>e.maxLength&&o.push(`Max ${e.maxLength}`),e.pattern&&!e.pattern.test(t)&&o.push("Invalid format");const l=0===o.length;return h.validationError=l?null:o[0],r("validate",{valid:l,errors:o}),l}function y(){const o=(()=>{const o="function"==typeof u?u():u;let t;return t=void 0!==e.width&&null!==e.width?e.width:null!=o?o:40,t})(),t=Po(h.text,o),r=h.cursor;for(let e=0;e<t.length;e++){const l=t[e];if(r>=l.startIndex&&r<=l.endIndex){const n=l.text.length>=o;if(r===l.endIndex&&n&&e<t.length-1)continue;return r===l.endIndex&&n&&e===t.length-1?{row:e+1,col:0,visualLines:t}:{row:e,col:r-l.startIndex,visualLines:t}}}const l=t[t.length-1]||{startIndex:0};return{row:t.length-1,col:r-l.startIndex,visualLines:t}}function C(){const{row:o,visualLines:t}=y();let r=e.rows;if(e.autoResize&&(r=Math.max(e.minRows,t.length),e.maxRows&&(r=Math.min(r,e.maxRows))),o<h.scrollOffset?h.scrollOffset=o:o>=h.scrollOffset+r&&(h.scrollOffset=o-r+1),h.scrollOffset>0){const e=Math.max(0,t.length-r);h.scrollOffset>e&&(h.scrollOffset=e)}Fo(t)}function v(e){const{row:o,col:t,visualLines:r}=y(),l=o+e;if(l>=0&&l<r.length){const e=r[l],o=Math.min(t,e.text.length);h.cursor=e.startIndex+o}Fo(r)}l(m,e=>{h.isFocused=e,r(e?"focus":"blur")}),c.registerComponent(b,function(o){if(e.disabled||e.readonly)return!1;const{key:t,char:l}=o,n=h.text;if(o.ctrl&&l){const e=l.charCodeAt(0);if(e<32&&!Uo.has(e))return!0}if(t===Te)return h.cursor>0&&h.cursor--,p(),!0;if(t===Ne)return h.cursor<n.length&&h.cursor++,p(),!0;if(t===Ie)return v(-1),p(),!0;if(t===Ee)return v(1),p(),!0;if(t===Me||t===We){const e=n.lastIndexOf("\n",h.cursor-1);return h.cursor=-1===e?0:e+1,p(),!0}if(t===He||t===Pe){const e=n.indexOf("\n",h.cursor);return h.cursor=-1===e?n.length:e,p(),!0}if(t===Be){if(h.cursor>0){const e=h.cursor;h.text=n.slice(0,e-1)+n.slice(e),h.cursor--}return p(),!0}if(t===Le||t===Ue){if(h.cursor<n.length){const e=h.cursor;h.text=n.slice(0,e)+n.slice(e+1)}return p(),!0}if(t===Ae){if(e.multiline&&o.shift){const e=h.cursor;h.text=n.slice(0,e)+"\n"+n.slice(e),h.cursor++}else r("change",h.text);return p(),!0}if(t===$e)return r("change",h.text),p(),!0;if(Ke(o)){if(e.maxLength&&n.length>=e.maxLength)return!0;const o=h.cursor;return h.text=n.slice(0,o)+l+n.slice(o),h.cursor+=l.length,p(),!0}return!1},{disabled:e.disabled}),f&&f.registerClickHandler(b,function(o){e.disabled||e.readonly||c.focus(b)}),n(()=>{c&&c.unregisterComponent(b),f&&f.unregisterClickHandler(b)}),l(()=>e.disabled,e=>{c.setComponentDisabled(b,e)}),l(()=>e.modelValue,e=>{const o=e||"";o!==h.text&&(h.text=o,h.cursor=Math.min(h.cursor,h.text.length),g=o,x(),C())},{immediate:!0});let w,k=null,S="",_=-1;return()=>{const o=`${h.text}:${h.cursor}:${h.scrollOffset}:${h.isFocused}:${h.validationError}`,r="function"==typeof u?u():u,l=d?d.version:0;if(o!==S||r!==w||l!==_||!k){S=o,w=r,_=l;const t=e.focusColor||i?.components?.textInput?.focusColor||"cyan",n=e.errorColor||i?.components?.textInput?.errorColor||"red",c=void 0!==e.color?e.color:i?.components?.textInput?.color,a=void 0!==e.borderColor?e.borderColor:i?.components?.textInput?.borderColor??i?.components?.textInput?.color,s=void 0!==e.bg?e.bg:i?.components?.textInput?.bg??i?.background;k={multiline:e.multiline,rows:e.rows,minRows:e.minRows,maxRows:e.maxRows,autoResize:e.autoResize,wrapLines:e.wrapLines,label:e.label,placeholder:e.placeholder,hint:e.hint,color:c,borderColor:a,bg:s,focusColor:t,errorColor:n,bold:e.bold,italic:e.italic,dim:e.dim,disabled:e.disabled,readonly:e.readonly,_componentId:b,_clickable:!0,text:h.text,cursor:h.cursor,scrollOffset:h.scrollOffset,isFocused:h.isFocused,validationError:h.validationError,_injectedWidth:r,_viewportVersion:l},void 0!==e.width&&null!==e.width&&(k.width=e.width)}return t("textinput",k)}}};function Po(e,o){const t=Do.pop()||[],r=e.split("\n");let l=0;for(let e=0;e<r.length;e++){const n=r[e];if(0===n.length){t.push({text:"",startIndex:l,endIndex:l}),l+=1;continue}let c=n,a=l;for(;c.length>0;){let e,r;if(c.length<=o)e=c,r=e.length;else{let t=o;const l=c.lastIndexOf(" ",o);l>.3*o&&(t=l+1),e=c.slice(0,t),r=e.length}t.push({text:e,startIndex:a,endIndex:a+r}),a+=r,c=c.slice(r)}l+=n.length+1}return t}ae.register("textinput",new class extends ce{render(e){const{node:o}=e,t=e.getEffectiveWidth();null!==t&&(o.props.width=Math.max(1,t-2));const r=function(e){let{text:o="",width:t,_injectedWidth:r,rows:l=3,minRows:n=1,maxRows:c,autoResize:a=!1,cursor:s=0,scrollOffset:f=0,label:i="",placeholder:u="",isFocused:b=!1,validationError:h=null,disabled:g=!1,color:p,borderColor:m,bg:x,focusColor:y="cyan",errorColor:C="red",multiline:v=!1,hint:w="default"}=e;o=null==o?"":String(o);const k=null!=t?t:null!=r?r:40,S=[];if(i){const e=b?d.bold:e=>e;S.push(e(i))}let _=m||"white";h?_=C:b&&(_=y);const O=W(_),I=p?W(p):d,E=j(x),T=E||"",N=e=>{return E?T+(o=e,(t=E)&&o?o.replace(/\x1b\[0m/g,"[0m"+t):o)+"[0m":e;var o,t};S.push(N(O(Go.topLeft+Go.horizontal.repeat(k)+Go.topRight)));const A=Po(o,k);let B=-1,L=-1;for(let e=0;e<A.length;e++){const o=A[e];if(s>=o.startIndex&&s<=o.endIndex){const t=o.text.length>=k;if(s===o.endIndex&&t&&e<A.length-1)continue;s===o.endIndex&&t&&e===A.length-1?(B=e+1,L=0):(B=e,L=s-o.startIndex);break}}let R=l;if(a){let e=A.length;B===A.length&&e++,R=Math.max(n,e),c&&(R=Math.min(R,c))}const M=W(y);for(let e=0;e<R;e++){const t=f+e,r=(t<A.length?A[t].text:"").padEnd(k);let l;if(b&&!g&&t===B){const e=Math.min(L,k-1);if(0===o.length&&u&&0===t)l=M.inverse(u[0]||" ")+I.dim(u.slice(1).padEnd(k-1));else{const o=r[e]||" ",t=r.slice(0,e),n=r.slice(e+1);l=I(t)+M.inverse(o)+I(n)}}else l=0===o.length&&u&&0===t?I.dim(u.padEnd(k)):I(r);S.push(N(O(Go.vertical)+l+O(Go.vertical)))}if(Fo(A),S.push(N(O(Go.bottomLeft+Go.horizontal.repeat(k)+Go.bottomRight))),h)S.push(W(C)("✗ "+h));else if(b&&!g){let e="";"default"===w?e=v?"Enter to submit, Shift+Enter for new line":"Enter to submit":w&&!1!==w&&""!==w&&(e=w),e&&S.push(I.dim(e))}return S.join("\n")}(e.props);return null!==t&&delete o.props.width,r}});let $o=0;var zo={name:"SelectInput",props:{modelValue:{type:[String,Number,Object],default:null},options:{type:Array,default:()=>[]},label:{type:String,default:""},height:{type:Number,default:10},width:{type:Number,default:void 0},disabled:{type:Boolean,default:!1},color:String,bg:String,focusColor:{type:String,default:"cyan"},selectedColor:{type:String,default:"green"},highlightColor:{type:String,default:"yellow"},bold:Boolean,dim:Boolean,hint:{type:[String,Boolean],default:"default"},...be},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:o}){const c=a(ye),f=a(ke,null),i=a(we,null),d=a(_e,null),u="selectinput-"+ ++$o,b=r(0),h=r(0),g=s(()=>null===e.modelValue||void 0===e.modelValue?-1:e.options.findIndex(o=>o.value===e.modelValue)),p=s(()=>c&&c.isFocused(u));function m(){b.value<h.value?h.value=b.value:b.value>=h.value+e.height&&(h.value=b.value-e.height+1)}function x(){if(b.value>0){for(b.value--;b.value>0&&e.options[b.value]?.disabled;)b.value--;m()}}function y(){if(b.value<e.options.length-1){for(b.value++;b.value<e.options.length-1&&e.options[b.value]?.disabled;)b.value++;m()}}function C(){for(b.value=0;b.value<e.options.length-1&&e.options[b.value]?.disabled;)b.value++;m()}return l(p,(e,t)=>{e&&!t?o("focus"):!e&&t&&o("blur")}),l(()=>e.options,()=>{b.value>=e.options.length&&(b.value=Math.max(0,e.options.length-1),m())}),c&&c.registerComponent(u,function(t){if(!e.disabled)if(t.key!==Ie)if(t.key!==Ee)if(t.key!==Me)if(t.key!==He)if(t.key!==De)if(t.key!==Fe)t.key!==Ae&&" "!==t.char?Ke(t)&&" "!==t.char&&function(o){const t=o.toLowerCase(),r=b.value;for(let o=r+1;o<e.options.length;o++){const r=e.options[o];if((r.label||String(r.value)).toLowerCase().startsWith(t)&&!r.disabled)return b.value=o,void m()}for(let o=0;o<=r;o++){const r=e.options[o];if((r.label||String(r.value)).toLowerCase().startsWith(t)&&!r.disabled)return b.value=o,void m()}}(t.char):function(){const t=e.options[b.value];t&&!t.disabled&&(o("update:modelValue",t.value),o("change",t.value))}();else for(let o=0;o<e.height;o++)y();else for(let o=0;o<e.height;o++)x();else!function(){for(b.value=e.options.length-1;b.value>0&&e.options[b.value]?.disabled;)b.value--;m()}();else C();else y();else x()},{disabled:e.disabled}),f&&f.registerClickHandler(u,function(o){e.disabled||c.focus(u)}),g.value>=0?(b.value=g.value,m()):C(),n(()=>{c&&c.unregisterComponent(u),f&&f.unregisterClickHandler(u)}),l(()=>e.disabled,e=>{c&&c.setComponentDisabled(u,e)}),()=>{const o="function"==typeof d?d():d;return t("selectinput",{...e,_componentId:u,_clickable:!0,highlightedIndex:b.value,selectedIndex:g.value,scrollOffset:h.value,isFocused:p.value,_injectedWidth:o,_viewportVersion:i?i.version:0})}}};ae.register("selectinput",new class extends ce{render(e){const{node:o}=e,t=e.getEffectiveWidth();null!==t&&(o.props.width=t);const r=function(e){const{options:o=[],modelValue:t=null,label:r="",height:l=10,highlightedIndex:n=0,selectedIndex:c=-1,scrollOffset:a=0,isFocused:s=!1,focusColor:f="cyan",selectedColor:i="green",highlightColor:u="yellow",disabled:b=!1,hint:h="default"}=e;let g="";r&&(g+=le(s&&!b?`${d.bold(r)}`:r,e)+"\n");if(0===o.length){const o=20,t=s&&!b?f:e.color||"white",r=s&&!b?(d[t]||d).bold:d[t]||d;return g+=r("┌"+"─".repeat(o+2)+"┐")+"\n",g+=r("│")+" No options".padEnd(o+2," ")+r("│")+"\n",g+=r("└"+"─".repeat(o+2)+"┘")+"\n",g}const p=Math.max(20,...o.map(e=>oe(e.label||String(e.value)))),m=e.width?e.width:p+4,x=m-2,y=s&&!b?f:e.color||"white",C=s&&!b?(d[y]||d).bold:d[y]||d;g+=C("┌"+"─".repeat(m)+"┐")+"\n";for(let e=0;e<Math.min(l,o.length);e++){const r=a+e,l=o[r];if(l){const e=s&&r===n,o=r===c||l.value===t,a=l.label||String(l.value);let f=" ";o?f=d[i].bold("● "):e&&(f=d[u].bold("▸ "));let h=a.padEnd(x," ");oe(a)>x&&(h=a.substring(0,x)),e&&s&&!b?h=d[u].bold.inverse(h):o?h=d[i].bold(h):l.disabled&&(h=d.dim(h)),g+=C("│")+f+h+C("│")+"\n"}else g+=C("│")+" ".repeat(m)+C("│")+"\n"}if(g+=C("└"+"─".repeat(m)+"┘"),s&&!b&&!1!==h){let e="";"default"===h?e="↑↓ Navigate • Enter to select • Tab to next field":h&&""!==h&&(e=h),e&&(g+="\n"+d.dim(e))}if(o.length>l){const e=Math.round(a/Math.max(1,o.length-l)*100),t=a+1,r=Math.min(a+l,o.length),n=o.length;g+="\n"+d.dim(`[${e}% - showing ${t}-${r} of ${n}]`)}return g}(e.props);return null!==t&&delete o.props.width,r}});let Ko=0;var jo={name:"Checkbox",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},label:{type:String,default:""},direction:{type:String,default:"vertical",validator:e=>["vertical","horizontal"].includes(e)},height:{type:Number,default:10},width:{type:Number,default:null},itemSpacing:{type:Number,default:2},disabled:{type:Boolean,default:!1},color:String,bg:String,focusColor:{type:String,default:"cyan"},selectedColor:{type:String,default:"green"},highlightColor:{type:String,default:"yellow"},bold:Boolean,dim:Boolean,hint:{type:[String,Boolean],default:"default"},...be},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:o}){const c=a(ye),f=a(ke,null),i=a(we,null),d=a(_e,null),u="checkbox-"+ ++Ko,b=r(0),h=r(0),g=s(()=>c&&c.isFocused(u));function p(){b.value<h.value?h.value=b.value:b.value>=h.value+e.height&&(h.value=b.value-e.height+1)}function m(){if(b.value>0){for(b.value--;b.value>0&&e.options[b.value]?.disabled;)b.value--;p()}}function x(){if(b.value<e.options.length-1){for(b.value++;b.value<e.options.length-1&&e.options[b.value]?.disabled;)b.value++;p()}}function y(){for(b.value=0;b.value<e.options.length-1&&e.options[b.value]?.disabled;)b.value++;p()}return l(g,(e,t)=>{e&&!t?o("focus"):!e&&t&&o("blur")}),l(()=>e.options,()=>{b.value>=e.options.length&&(b.value=Math.max(0,e.options.length-1),p())},{deep:!0}),c&&c.registerComponent(u,function(t){if(e.disabled)return;const r="vertical"===e.direction;if(r&&t.key===Ie||!r&&t.key===Te)m();else if(r&&t.key===Ee||!r&&t.key===Ne)x();else if(t.key!==Me)if(t.key!==He)if(t.key===De&&r)for(let o=0;o<e.height;o++)m();else if(t.key===Fe&&r)for(let o=0;o<e.height;o++)x();else t.key!==Ae&&" "!==t.char?Ke(t)&&" "!==t.char&&function(o){const t=o.toLowerCase(),r=b.value;for(let o=r+1;o<e.options.length;o++){const r=e.options[o];if((r.label||String(r.value)).toLowerCase().startsWith(t)&&!r.disabled)return b.value=o,void p()}for(let o=0;o<=r;o++){const r=e.options[o];if((r.label||String(r.value)).toLowerCase().startsWith(t)&&!r.disabled)return b.value=o,void p()}}(t.char):function(){const t=e.options[b.value];if(!t||t.disabled)return;const r=[...e.modelValue||[]],l=r.indexOf(t.value);l>=0?r.splice(l,1):r.push(t.value),o("update:modelValue",r),o("change",r)}();else!function(){for(b.value=e.options.length-1;b.value>0&&e.options[b.value]?.disabled;)b.value--;p()}();else y()},{disabled:e.disabled}),f&&f.registerClickHandler(u,function(o){e.disabled||c.focus(u)}),y(),n(()=>{c&&c.unregisterComponent(u),f&&f.unregisterClickHandler(u)}),l(()=>e.disabled,e=>{c&&c.setComponentDisabled(u,e)}),()=>{const o="function"==typeof d?d():d;return t("checkbox",{...e,_componentId:u,_clickable:!0,highlightedIndex:b.value,scrollOffset:h.value,isFocused:g.value,modelValue:e.modelValue,_injectedWidth:o,_viewportVersion:i?i.version:0})}}};function Vo(e){const{direction:o="vertical"}=e;return"horizontal"===o?function(e){const{options:o=[],modelValue:t=[],label:r="",highlightedIndex:l=0,isFocused:n=!1,selectedColor:c="green",highlightColor:a="yellow",disabled:s=!1,width:f=null,itemSpacing:i=2,hint:u="default",direction:b="horizontal"}=e;let h="";r&&(h+=le(n&&!s?`${d.bold(r)}`:r,e)+"\n");if(0===o.length)return h+=d.dim("No options")+"\n",h;const g=f||process.stdout.columns||80,p=[];let m=[],x=0;for(let e=0;e<o.length;e++){const r=o[e],f=n&&e===l,u=t.includes(r.value),b=r.label||String(r.value);let h;h=u?d[c].bold("[✓]"):"[ ]";let y=`${h} ${b}`;f&&n&&!s?y=d[a].bold.inverse(y):u?y=d[c].bold(y):r.disabled&&(y=d.dim(y));const C=oe(y);0===m.length||x+C+i<=g?(m.push(y),x+=C+(m.length>1?i:0)):(p.push(m),m=[y],x=C)}m.length>0&&p.push(m);for(let e=0;e<p.length;e++)e>0&&(h+="\n"),h+=p[e].join(" ".repeat(i));if(n&&!s&&!1!==u){let e="";"default"===u?e="horizontal"===b?"←→ Navigate • Space/Enter to toggle • Tab to next field":"↑↓ Navigate • Space/Enter to toggle • Tab to next field":u&&""!==u&&(e=u),e&&(h+="\n"+d.dim(e))}return h}(e):function(e){const{options:o=[],modelValue:t=[],label:r="",height:l=10,highlightedIndex:n=0,scrollOffset:c=0,isFocused:a=!1,focusColor:s="cyan",selectedColor:f="green",highlightColor:i="yellow",disabled:u=!1,hint:b="default"}=e;let h="";r&&(h+=le(a&&!u?`${d.bold(r)}`:r,e)+"\n");if(0===o.length){const o=20,t=a&&!u?s:e.color||"white",r=a&&!u?(d[t]||d).bold:d[t]||d;return h+=r("┌"+"─".repeat(o+2)+"┐")+"\n",h+=r("│")+" No options".padEnd(o+2," ")+r("│")+"\n",h+=r("└"+"─".repeat(o+2)+"┘")+"\n",h}const g=Math.max(20,...o.map(e=>oe(e.label||String(e.value)))),p=e.width?e.width:g+6,m=Math.max(1,p-6),x=a&&!u?s:e.color||"white",y=a&&!u?(d[x]||d).bold:d[x]||d;h+=y("┌"+"─".repeat(p)+"┐")+"\n";for(let e=0;e<Math.min(l,o.length);e++){const r=c+e,l=o[r];if(l){const e=a&&r===n,o=t.includes(l.value),c=l.label||String(l.value);let s=" ";s=o?d[f].bold("[✓]"):"[ ]";let b=c.padEnd(m," ");oe(c)>m&&(b=c.substring(0,m)),e&&a&&!u?b=d[i].bold.inverse(b):o?b=d[f].bold(b):l.disabled&&(b=d.dim(b)),h+=y("│")+" "+s+" "+b+y(" │")+"\n"}else h+=y("│")+" ".repeat(p)+y("│")+"\n"}if(h+=y("└"+"─".repeat(p)+"┘"),a&&!u&&!1!==b){let o="";"default"===b?o="vertical"===e.direction?"↑↓ Navigate • Space/Enter to toggle • Tab to next field":"←→ Navigate • Space/Enter to toggle • Tab to next field":b&&""!==b&&(o=b),o&&(h+="\n"+d.dim(o))}if(o.length>l){const e=Math.round(c/Math.max(1,o.length-l)*100),t=c+1,r=Math.min(c+l,o.length),n=o.length;h+="\n"+d.dim(`[${e}% - showing ${t}-${r} of ${n}]`)}return h}(e)}ae.register("checkbox",new class extends ce{render(e){const{node:o}=e,t=e.getEffectiveWidth();null!==t&&(o.props.width=Math.max(1,t-2));const r=Vo(e.props);return null!==t&&delete o.props.width,r}});let Yo=0;var Xo={name:"Radiobox",props:{modelValue:{type:[String,Number,Object],default:null},options:{type:Array,default:()=>[]},label:{type:String,default:""},direction:{type:String,default:"vertical",validator:e=>["vertical","horizontal"].includes(e)},height:{type:Number,default:10},width:{type:Number,default:null},itemSpacing:{type:Number,default:2},disabled:{type:Boolean,default:!1},color:String,bg:String,focusColor:{type:String,default:"cyan"},selectedColor:{type:String,default:"green"},highlightColor:{type:String,default:"yellow"},bold:Boolean,dim:Boolean,hint:{type:[String,Boolean],default:"default"},...be},emits:["update:modelValue","change","focus","blur"],setup(e,{emit:o}){const c=a(ye),f=a(ke,null),i="radiobox-"+ ++Yo,d=r(0),u=r(0),b=s(()=>null===e.modelValue||void 0===e.modelValue?-1:e.options.findIndex(o=>o.value===e.modelValue)),h=s(()=>c&&c.isFocused(i));function g(){d.value<u.value?u.value=d.value:d.value>=u.value+e.height&&(u.value=d.value-e.height+1)}function p(){if(d.value>0){for(d.value--;d.value>0&&e.options[d.value]?.disabled;)d.value--;g()}}function m(){if(d.value<e.options.length-1){for(d.value++;d.value<e.options.length-1&&e.options[d.value]?.disabled;)d.value++;g()}}function x(){for(d.value=0;d.value<e.options.length-1&&e.options[d.value]?.disabled;)d.value++;g()}return l(h,(e,t)=>{e&&!t?o("focus"):!e&&t&&o("blur")}),l(()=>e.options,()=>{d.value>=e.options.length&&(d.value=Math.max(0,e.options.length-1),g())},{deep:!0}),c&&c.registerComponent(i,function(t){if(e.disabled)return;const r="vertical"===e.direction;if(r&&t.key===Ie||!r&&t.key===Te)p();else if(r&&t.key===Ee||!r&&t.key===Ne)m();else if(t.key!==Me)if(t.key!==He)if(t.key===De&&r)for(let o=0;o<e.height;o++)p();else if(t.key===Fe&&r)for(let o=0;o<e.height;o++)m();else t.key!==Ae&&" "!==t.char?Ke(t)&&" "!==t.char&&function(o){const t=o.toLowerCase(),r=d.value;for(let o=r+1;o<e.options.length;o++){const r=e.options[o];if((r.label||String(r.value)).toLowerCase().startsWith(t)&&!r.disabled)return d.value=o,void g()}for(let o=0;o<=r;o++){const r=e.options[o];if((r.label||String(r.value)).toLowerCase().startsWith(t)&&!r.disabled)return d.value=o,void g()}}(t.char):function(){const t=e.options[d.value];t&&!t.disabled&&(o("update:modelValue",t.value),o("change",t.value))}();else!function(){for(d.value=e.options.length-1;d.value>0&&e.options[d.value]?.disabled;)d.value--;g()}();else x()},{disabled:e.disabled}),f&&f.registerClickHandler(i,function(o){e.disabled||c.focus(i)}),b.value>=0?(d.value=b.value,g()):x(),n(()=>{c&&c.unregisterComponent(i),f&&f.unregisterClickHandler(i)}),l(()=>e.disabled,e=>{c&&c.setComponentDisabled(i,e)}),()=>t("radiobox",{...e,_componentId:i,_clickable:!0,highlightedIndex:d.value,selectedIndex:b.value,scrollOffset:u.value,isFocused:h.value})}};function Zo(e){const{direction:o="vertical"}=e;return"horizontal"===o?function(e){const{options:o=[],modelValue:t=null,label:r="",highlightedIndex:l=0,selectedIndex:n=-1,isFocused:c=!1,selectedColor:a="green",highlightColor:s="yellow",disabled:f=!1,width:i=null,itemSpacing:u=2,hint:b="default",direction:h="horizontal"}=e;let g="";r&&(g+=le(c&&!f?`${d.bold(r)}`:r,e)+"\n");if(0===o.length)return g+=d.dim("No options")+"\n",g;const p=i||process.stdout.columns||80,m=[];let x=[],y=0;for(let e=0;e<o.length;e++){const r=o[e],i=c&&e===l,b=e===n||r.value===t,h=r.label||String(r.value);let g;g=b?d[a].bold("(●)"):"( )";let C=`${g} ${h}`;i&&c&&!f?C=d[s].bold.inverse(C):b?C=d[a].bold(C):r.disabled&&(C=d.dim(C));const v=oe(C);0===x.length||y+v+u<=p?(x.push(C),y+=v+(x.length>1?u:0)):(m.push(x),x=[C],y=v)}x.length>0&&m.push(x);for(let e=0;e<m.length;e++)e>0&&(g+="\n"),g+=m[e].join(" ".repeat(u));if(c&&!f&&!1!==b){let e="";"default"===b?e="horizontal"===h?"←→ Navigate • Space/Enter to select • Tab to next field":"↑↓ Navigate • Space/Enter to select • Tab to next field":b&&""!==b&&(e=b),e&&(g+="\n"+d.dim(e))}return g}(e):function(e){const{options:o=[],modelValue:t=null,label:r="",height:l=10,highlightedIndex:n=0,selectedIndex:c=-1,scrollOffset:a=0,isFocused:s=!1,focusColor:f="cyan",selectedColor:i="green",highlightColor:u="yellow",disabled:b=!1,hint:h="default"}=e;let g="";r&&(g+=le(s&&!b?`${d.bold(r)}`:r,e)+"\n");if(0===o.length){const o=20,t=s&&!b?f:e.color||"white",r=s&&!b?(d[t]||d).bold:d[t]||d;return g+=r("┌"+"─".repeat(o+2)+"┐")+"\n",g+=r("│")+" No options".padEnd(o+2," ")+r("│")+"\n",g+=r("└"+"─".repeat(o+2)+"┘")+"\n",g}const p=Math.max(20,...o.map(e=>oe(e.label||String(e.value)))),m=e.width?e.width:p+6,x=Math.max(1,m-6),y=s&&!b?f:e.color||"white",C=s&&!b?(d[y]||d).bold:d[y]||d;g+=C("┌"+"─".repeat(m)+"┐")+"\n";for(let e=0;e<Math.min(l,o.length);e++){const r=a+e,l=o[r];if(l){const e=s&&r===n,o=r===c||l.value===t,a=l.label||String(l.value);let f=" ";f=o?d[i].bold("(●)"):"( )";let h=a.padEnd(x," ");oe(a)>x&&(h=a.substring(0,x)),e&&s&&!b?h=d[u].bold.inverse(h):o?h=d[i].bold(h):l.disabled&&(h=d.dim(h)),g+=C("│")+" "+f+" "+h+C(" │")+"\n"}else g+=C("│")+" ".repeat(m)+C("│")+"\n"}if(g+=C("└"+"─".repeat(m)+"┘"),s&&!b&&!1!==h){let o="";"default"===h?o="vertical"===e.direction?"↑↓ Navigate • Space/Enter to select • Tab to next field":"←→ Navigate • Space/Enter to select • Tab to next field":h&&""!==h&&(o=h),o&&(g+="\n"+d.dim(o))}if(o.length>l){const e=Math.round(a/Math.max(1,o.length-l)*100),t=a+1,r=Math.min(a+l,o.length),n=o.length;g+="\n"+d.dim(`[${e}% - showing ${t}-${r} of ${n}]`)}return g}(e)}ae.register("radiobox",new class extends ce{render(e){const{node:o}=e,t=e.getEffectiveWidth();null!==t&&(o.props.width=Math.max(1,t-2));const r=Zo(e.props);return null!==t&&delete o.props.width,r}});let Jo=0;const qo={primary:{bg:"brightBlue",color:"white",bold:!0,focusBg:"blue"},secondary:{bg:"brightWhite",color:"white",bold:!1,focusBg:"white"},danger:{bg:"brightRed",color:"white",bold:!0,focusBg:"red"},warning:{bg:"brightYellow",color:"black",bold:!0,focusBg:"yellow"},info:{bg:"brightCyan",color:"black",bold:!1,focusBg:"cyan"},success:{bg:"brightGreen",color:"white",bold:!0,focusBg:"green"}};var Qo={name:"Button",props:{label:{type:String,required:!0},variant:{type:String,default:"primary",validator:e=>["primary","secondary","danger","warning","info","success"].includes(e)},color:String,bg:String,bold:Boolean,italic:Boolean,dim:Boolean,disabled:{type:Boolean,default:!1},focusColor:{type:String,default:"brightYellow"},focusBg:{type:String,default:null},fullWidth:{type:Boolean,default:!1},...be},emits:["click","focus","blur"],setup(e,{emit:o}){const c=a(ye),f=a(we,null),i=a(_e,null),d=a(ke,null),u=a(Se,null),b="button-"+ ++Jo,h=r(!1),g=s(()=>c&&c.isFocused(b));return l(g,(e,t)=>{e&&!t?o("focus"):!e&&t&&o("blur")}),c.registerComponent(b,function(t){return!e.disabled&&((t.key===Ae||" "===t.char)&&(h.value=!0,o("click"),setTimeout(()=>{h.value=!1},250),!0))},{disabled:e.disabled}),d.registerClickHandler(b,function(t){e.disabled||("left_release"!==t.action?(h.value=!0,o("click",{source:"mouse",x:t.x,y:t.y,shift:t.shift,ctrl:t.ctrl,alt:t.alt}),setTimeout(()=>{h.value=!1},250)):h.value=!1)}),n(()=>{c.unregisterComponent(b),d.unregisterClickHandler(b)}),l(()=>e.disabled,e=>{c.setComponentDisabled(b,e)}),()=>{const o="function"==typeof i?i():i,r=u?.components?.button?.variants?{...qo,...u.components.button.variants}:qo;return t("button",{...e,_componentId:b,_clickable:!0,_variants:r,isFocused:g.value,isPressed:h.value,_injectedWidth:o,_viewportVersion:f?f.version:0})}}};function et(e,o,t){const{paddingTop:r,paddingBottom:l,padding:n=0}=e.props||{},c=null!=r?r:n||0,a=null!=l?l:n||0;if(!e.children||0===e.children.length){if(c>0||a>0){const e=[];for(let o=0;o<c+a;o++)e.push("");return e.join("\n")}return""}const s=e.cachedLayoutMetrics||{children:[]},f=e.children,i=f.length,d=[];let u=0;for(let e=0;e<i;e++){const r=f[e];if("comment"===r.type)continue;const l=s.children[u++];if(!l){d.push({rendered:t(r,o+1,{yOffset:c}),x:0,width:0,height:1,y:0});continue}const n=l.width>0&&("col"===r.type||"box"===r.type||void 0!==r.props.flex||void 0!==r.props.width)?rt(r,l.width,o+1,t,{yOffset:c}):t(r,o+1,{yOffset:c});d.push({rendered:n,x:l.x,y:l.y,width:l.width,height:l.height})}const b=e.props?.flexWrap||"nowrap",h=e.props?.responsive;let g;if(("wrap"===b||"wrap-reverse"===b||h)&&d.length>1){const e=function(e){if(0===e.length)return[];const o=e.slice().sort((e,o)=>e.y-o.y),t=[];let r=[o[0]],l=o[0].y+(o[0].height||1);for(let e=1;e<o.length;e++){const n=o[e],c=n.height||1;n.y>=l?(t.push(r),r=[n],l=n.y+c):(r.push(n),l=Math.max(l,n.y+c))}return t.push(r),t}(d);g=e.length>1?function(e){const o=[];for(let t=0;t<e.length;t++){const r=e[t];r.sort((e,o)=>e.x-o.x);const l=new Array(r.length);let n=0;for(let e=0;e<r.length;e++){const o=r[e].rendered.split("\n");l[e]={lines:o,x:r[e].x},o.length>n&&(n=o.length)}for(let e=0;e<n;e++){let t="",r=0;for(let o=0;o<l.length;o++){const n=l[o],c=n.lines[e]||"",a=n.x;a>r&&(t+=" ".repeat(a-r),r=a),t+=c,r+=oe(c)}o.push(t)}}return o.join("\n")}(e):tt(d)}else g=tt(d);if(c>0||a>0){const e=g?g.split("\n"):[];for(let o=0;o<c;o++)e.unshift("");for(let o=0;o<a;o++)e.push("");g=e.join("\n")}return g}function ot(e){if(!e)return 0;let o=1;for(let t=0;t<e.length;t++)10===e.charCodeAt(t)&&o++;return o}function tt(e){const o=e.length,t=new Array(o);let r=0;for(let l=0;l<o;l++){const o=e[l].rendered.split("\n");t[l]={lines:o,x:e[l].x},o.length>r&&(r=o.length)}const l=new Array(r);for(let e=0;e<r;e++){let r="",n=0;for(let l=0;l<o;l++){const o=t[l],c=o.lines[e]||"",a=o.x;a>n&&(r+=" ".repeat(a-n),n=a),r+=c,n+=oe(c)}l[e]=r}return l.join("\n")}function rt(e,o,t,r,l={}){const n=e._renderWidth;return e._renderWidth=o,n!==o&&null!==e.cachedOutput&&(e.isDirty=!0,e.cachedOutput=null),r(e,t,l)}function lt(e,o,t,r,l={}){const n=e.props.width;e.props.width=o;const c=r(e,t,l);return e.props.width=n,c}ae.register("button",new class extends ce{render(e){const{node:o}=e,t=e.props,r=t.width;t.fullWidth||delete o.props.width;const l=function(e){const{label:o="",variant:t="primary",color:r,bg:l,bold:n,italic:c,dim:a,disabled:s=!1,isFocused:f=!1,isPressed:i=!1,_variants:u,_injectedWidth:b,width:h,fullWidth:g=!1}=e,p=u||qo,m=p[t]||p.primary;let x=l||m.bg;const y=void 0!==n?n:m.bold;let C=r||x,v=o,w=r||x;if(!f||s||r||(w="white"),w){const e=P(w);e&&(v=e(v))}return(f&&!s||y)&&(v=d.bold(v)),c&&(v=d.italic(v)),(s||a)&&(v=d.dim(v)),i&&!s&&(v=d.inverse(v)),po(v,{border:!0,borderStyle:"button",bg:l||null,color:C,paddingLeft:1,paddingRight:1,paddingTop:0,paddingBottom:0,bold:f&&!s,width:g?h||b:h,align:g?"center":void 0})}(t);return void 0!==r&&(o.props.width=r),l}});function nt(e){if(!e)return 0;let o=1;for(let t=0;t<e.length;t++)10===e.charCodeAt(t)&&o++;return o}function ct(e,o,t,r,l=null){if(!B)return;const n=e.props||{},c=n._clickable||e.clickable,a=n._componentId||e.componentId;if(!c||!a)return;let s=0,f=0;if(l){const e=function(e){if(!e)return{width:0,height:0};const o=e.split("\n"),t=o.length;let r=0;for(const e of o){const o=oe(e);o>r&&(r=o)}return{width:r,height:t}}(l);s=e.width,f=e.height}else{const o=e.cachedLayoutMetrics;s=o?.width||0,f=o?.height||0}var i;s>0&&f>0&&(i={componentId:a,x:Math.round(o),y:Math.round(t),width:Math.round(s),height:Math.round(f),depth:r,nodeType:e.type},B&&i.width>0&&i.height>0&&A.push(i))}function at(e,o=0,t={}){if(!e)return"";const{parentAbsX:r=0,parentAbsY:l=0,yOffset:n=0,inRow:c=!1}=t;if("comment"===e.type)return"";const a=e.cachedLayoutMetrics,s=r+(a?.x||0),f=l+n;if(function(e){return!!e&&!e.isDirty&&!e.childrenDirty&&null!==e.cachedOutput}(e)){const t=e.cachedOutput;return ct(e,s,f,o,t),t}const i=new ne({node:e,depth:o,absX:s,absY:f,inRow:c,renderNodeFn:at}),d=ae.get(e.type);let u;if(d)u=d.render(i);else{let t=0;const r=O(e,e=>{const r=at(e,o+1,{parentAbsX:s,parentAbsY:f,yOffset:t,inRow:c});return t+=nt(r),r});u=e.text||r}return e.actualRenderedHeight=nt(u),ct(e,s,f,o,u),function(e,o){e&&(e.cachedOutput=o,e.isDirty=!1)}(e,u),u}function st(e){if(!e)return"";performance.now();let o;if(L(),e.children?.length>0){const t=[];let r=0;for(const o of e.children){if("comment"===o.type)continue;const e=at(o,0,{parentAbsX:0,parentAbsY:0,yOffset:r,inRow:!1});e&&(t.push(e),r+=nt(e))}o=t.join("\n")}else o=at(e,0,{parentAbsX:0,parentAbsY:0,yOffset:0,inRow:!1});const t=R();return e._clickRegions=t,performance.now(),o.endsWith("\n")?o:o+"\n"}ae.register("row",new class extends ce{render(e){const{node:o,depth:t,absX:r}=e;return et(o,t,(o,t,l={})=>{const n=l.yOffset||0;return e.renderChild(o,{parentAbsX:r,yOffset:n,inRow:!0})})}}),ae.register("col",new class extends ce{render(e){const{node:o,depth:t,absX:r}=e;return function(e,o,t){const{gap:r=0,paddingTop:l,paddingBottom:n,padding:c=0}=e.props||{},a=null!=l?l:c||0,s=null!=n?n:c||0;if(!e.children||0===e.children.length){if(a>0||s>0){const e=[];for(let o=0;o<a+s;o++)e.push("");return e.join("\n")}return""}const f=e.props?.width,i=e.props?._injectedWidth,d=e._renderWidth,u=null!=f?f:void 0!==d?d:i,b=e.cachedLayoutMetrics||{children:[]},h=[];let g,p=0,m=a;for(const l of e.children){if("comment"===l.type)continue;const e=b.children[p];if(p++,h.length>0&&r>0&&(m+=r),!e){const e=t(l,o+1,{yOffset:m});h.push(e),m+=ot(e);continue}const n=l.props||{},c=e.height>0&&(void 0!==n.flex||void 0!==n.flexGrow||void 0!==n.height||void 0!==n._injectedHeight||"col"===l.type||"row"===l.type),a=null!=u?u:e.width,s=c&&("box"===l.type||"row"===l.type);if(s){const r=l.props._targetHeight;l.props._targetHeight=e.height,r!==e.height&&null!==l.cachedOutput&&(l.isDirty=!0,l.cachedOutput=null);const n=lt(l,a,o+1,t,{yOffset:m});void 0!==r?l.props._targetHeight=r:delete l.props._targetHeight,h.push(n),m+=ot(n);continue}const f=lt(l,a,o+1,t,{yOffset:m}),i=c&&!s?ao(f,e.height):f;h.push(i),m+=ot(i)}if(r>0){const e="\n"+"\n".repeat(r);g=h.join(e)}else g=h.join("\n");if(a>0||s>0){const e=g?g.split("\n"):[];for(let o=0;o<a;o++)e.unshift("");for(let o=0;o<s;o++)e.push("");g=e.join("\n")}return g}(o,t,(o,t,l={})=>{const n=l.yOffset||0;return e.renderChild(o,{parentAbsX:r,yOffset:n,inRow:!1})})}});const ft=new Set(Object.keys(ue)),it=new Set(["border","borderStyle","responsive","_injectedWidth","_viewportVersion","text"]),dt=new Set(["label","hint","validationError","isFocused","disabled"]),ut=new Set(["rows","headers","options","showHeader","minRows","maxRows","autoResize","imageLines","count","lines","direction","font","length"]),bt=new Set([...ft,...it,...dt,...ut]);function ht(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function gt(o={}){const{onUpdate:t=()=>{},rootContainer:r=null,beforeRender:l=()=>{},afterRender:n=()=>{}}=o,c=e({createElement:e=>new k(e),createText:e=>new S(e),createComment:e=>new _(e),setText(e,o){e.text!==o&&(e.setText(o),I(e)),i()},setElementText(e,o){e.text!==o&&(e.setText(o),I(e)),i()},insert(e,o,t=null){t?o.insertBefore(e,t):o.appendChild(e),I(e),o.invalidateChildrenCache(),o.markLayoutDirty(),i()},remove(e){const o=e.parent;o&&(o.removeChild(e),o.invalidateChildrenCache(),I(o),o.markLayoutDirty(),i())},patchProp(e,o,t,r){if("_componentId"===o)return void(e.componentId=r);if("_clickable"===o)return void(e.clickable=r);let l=t!==r;if(!l&&Array.isArray(r)&&Array.isArray(t))l=t.length!==r.length||t.some((e,o)=>e!==r[o]);else if(!l&&ht(r)&&ht(t)){const e=Object.keys(t),o=Object.keys(r);l=e.length!==o.length||o.some(e=>t[e]!==r[e])}var n;null==r?delete e.props[o]:e.props[o]=r,l&&(I(e),n=o,bt.has(n)&&e.markLayoutDirty()),i()},parentNode:e=>e.parent,nextSibling(e){if(!e.parent)return null;const o=e.parent.children,t=o.indexOf(e);return o[t+1]||null},querySelector:()=>null,setScopeId(){},cloneNode(e){const o=new k(e.type);return o.props={...e.props},o.text=e.text,o},insertStaticContent(e,o,t){const r=new S(e);return t?o.insertBefore(r,t):o.appendChild(r),o.invalidateChildrenCache(),i(),[r,r]}});let a=!1,s=!1,f="";function i(){s=!0,a||d()}function d(){a||(a=!0,Promise.resolve().then(u))}function u(){const e=performance.now();if(a=!1,s=!1,r){l(r);const o=st(r);if(n(r),o!==f&&(f=o,t(o),c.vuettyInstance?.debugServer)){const t=performance.now()-e;c.vuettyInstance.debugServer.captureRenderComplete({duration:t,outputLength:o.length,rootContainer:r})}}s&&d()}return c.forceUpdate=()=>{f="",i()},c.vuettyInstance=null,c}class pt{constructor(e={}){this.components=new Map,this.componentOrder=[],this.focusedId=r(null),this.enabled=!1,this.onInputChange=e.onInputChange||(()=>{}),this.onExit=e.onExit||(()=>{}),this.viewportHandler=null,this.vuettyInstance=null,this.handleData=this.handleData.bind(this),this.buffer=""}enable(){this.enabled||(process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding("utf8"),process.stdin.on("data",this.handleData),this.enabled=!0)}disable(){this.enabled&&(process.stdin.removeListener("data",this.handleData),process.stdin.pause(),process.stdin.isTTY&&process.stdin.setRawMode(!1),this.enabled=!1)}registerComponent(e,o,t={}){this.components.set(e,{handler:o,disabled:t.disabled||!1,focusable:void 0===t.focusable||t.focusable}),this.componentOrder.push(e),this.focusedId.value||t.disabled||!1===t.focusable||this.focus(e)}unregisterComponent(e){this.components.delete(e);const o=this.componentOrder.indexOf(e);-1!==o&&this.componentOrder.splice(o,1),this.focusedId.value===e&&(this.focusedId.value=null,this.focusNext())}setComponentDisabled(e,o){const t=this.components.get(e);t&&(t.disabled=o,o&&this.focusedId.value===e&&this.focusNext())}setViewportHandler(e){this.viewportHandler=e}setVuettyInstance(e){this.vuettyInstance=e}blur(){return!!this.focusedId.value&&(this.focusedId.value=null,this.onInputChange(),!0)}focus(e){const o=this.components.get(e);return!(!o||o.disabled)&&(this.focusedId.value!==e&&(this.focusedId.value=e,this.onInputChange(),!0))}focusNext(){if(0===this.componentOrder.length)return!1;let e=(this.componentOrder.indexOf(this.focusedId.value)+1)%this.componentOrder.length,o=0;for(;o<this.componentOrder.length;){const t=this.componentOrder[e],r=this.components.get(t);if(r&&!r.disabled&&!1!==r.focusable)return this.focus(t);e=(e+1)%this.componentOrder.length,o++}return this.focusedId.value=null,!1}focusPrevious(){if(0===this.componentOrder.length)return!1;const e=this.componentOrder.indexOf(this.focusedId.value);let o=e<=0?this.componentOrder.length-1:e-1,t=0;for(;t<this.componentOrder.length;){const e=this.componentOrder[o],r=this.components.get(e);if(r&&!r.disabled&&!1!==r.focusable)return this.focus(e);o=o<=0?this.componentOrder.length-1:o-1,t++}return this.focusedId.value=null,!1}isFocused(e){return this.focusedId.value===e}handleData(e){for(this.buffer+=e;this.buffer.length>0;)if(this.buffer.startsWith("")){let e=-1;if(this.buffer.startsWith("[<")){const e=this.buffer.match(/^\x1b\[<\d+;\d+;\d+[Mm]/);if(e){const o=e[0];this.buffer=this.buffer.slice(o.length),this.handleMouseEvent(o);continue}if(this.buffer.match(/^\x1b\[<[\d;]*$/))break}const o=this.buffer.match(/^\x1b\[\d+;\d+;\d+M/);if(o){const e=o[0];this.buffer=this.buffer.slice(e.length),this.handleMouseEvent(e);continue}if(this.buffer.length>=2&&"["===this.buffer[1])for(let o=2;o<this.buffer.length;o++){const t=this.buffer.charCodeAt(o);if(t>=65&&t<=90||t>=97&&t<=122||126===t){e=o+1;break}}else this.buffer.length>=2&&(e=2);if(e>0){const o=this.buffer.slice(0,e);this.buffer=this.buffer.slice(e),this.handleKeyPress(o)}else{if(1!==this.buffer.length)break;this.buffer="",this.handleKeyPress("")}}else{const e=this.buffer[0];this.buffer=this.buffer.slice(1),this.handleKeyPress(e)}}handleKeyPress(e){if(oo(e))return void this.handleMouseEvent(e);const o=function(e){const o=e.match(/^\x1b\[1;(\d+)([A-Z~])$/);if(o){const e=parseInt(o[1],10),t=o[2],r=e-1;return{key:{A:Ie,B:Ee,C:Ne,D:Te,H:Me,F:He}[t]||"unknown",char:null,shift:!!(1&r),ctrl:!!(4&r),alt:!1}}if(ze[e]){const o=e.includes(";2");return{key:ze[e],char:null,ctrl:!1,shift:o||"\n"===e,alt:!1}}if(2===e.length&&27===e.charCodeAt(0)){const o=e[1];if(o.charCodeAt(0)>=32&&o.charCodeAt(0)<=126)return{key:o.toLowerCase(),char:o,ctrl:!1,alt:!0,shift:o!==o.toLowerCase()}}return 1===e.length&&e.charCodeAt(0)<32?{key:"char",char:e,ctrl:!0,shift:!1,alt:!1}:1===e.length&&e.charCodeAt(0)>=32&&e.charCodeAt(0)<=126?{key:"char",char:e,ctrl:!1,shift:e!==e.toLowerCase(),alt:!1}:e.length>=1&&!e.startsWith("")?{key:"char",char:e,ctrl:!1,shift:!1,alt:!1}:{key:"unknown",char:e,ctrl:!1,shift:!1,alt:!1}}(e);if(this.vuettyInstance?.debugServer&&this.vuettyInstance.debugServer.captureEvent("input.key",{key:o.key,char:o.char,shift:o.shift,ctrl:o.ctrl,alt:o.alt}),o.key!==Ge)if(o.alt&&"m"===o.key)this.vuettyInstance&&this.vuettyInstance.toggleMouseTracking();else if("tab"!==o.key){if(this.viewportHandler){if(this.viewportHandler(o))return}if(this.focusedId.value){const e=this.components.get(this.focusedId.value);if(e&&!e.disabled&&e.handler){if(e.handler(o))return void this.onInputChange()}}for(const e of this.componentOrder){const t=this.components.get(e);if(!t||t.disabled||!1!==t.focusable)continue;if(t.handler(o))return void this.onInputChange()}}else o.shift?this.focusPrevious():this.focusNext();else this.onExit()}handleMouseEvent(e){const o=oo(e);if(o&&(this.vuettyInstance?.debugServer&&this.vuettyInstance.debugServer.captureEvent("input.mouse",{action:o.action,x:o.x,y:o.y,button:o.button}),this.viewportHandler)){if(this.viewportHandler(o))return}}getFocusedId(){return this.focusedId.value}getComponentCount(){return this.components.size}clear(){this.components.clear(),this.componentOrder=[],this.focusedId.value=null}}var mt={name:"Row",props:{...ue,gap:{type:Number,default:0},justifyContent:{type:String,default:"flex-start",validator:e=>["flex-start","flex-end","center","space-between","space-around","space-evenly"].includes(e)},alignItems:{type:String,default:"stretch",validator:e=>["flex-start","flex-end","center","stretch","baseline"].includes(e)},flexWrap:{type:String,default:"nowrap",validator:e=>["nowrap","wrap","wrap-reverse"].includes(e)},responsive:{type:Boolean,default:!1}},setup(e,{slots:o}){const r=a(_e,null),l=a(so,null),n=a(we,null);return f(so,()=>{if(void 0!==e.height&&null!==e.height)return e.height;const o="function"==typeof l?l():l;return null!=o?o:null}),()=>{const c="function"==typeof r?r():r,a="function"==typeof l?l():l,s={...e,_injectedWidth:c,_injectedHeight:a,_viewportVersion:n?n.version:0};return t("row",s,o.default?.())}}},xt={name:"Col",props:{...ue,flex:{type:[Number,String],default:"1"},gap:{type:Number,default:0},justifyContent:{type:String,default:"flex-start",validator:e=>["flex-start","flex-end","center","space-between","space-around","space-evenly"].includes(e)},alignItems:{type:String,default:"stretch",validator:e=>["flex-start","flex-end","center","stretch","baseline"].includes(e)},flexWrap:{type:String,default:"nowrap",validator:e=>["nowrap","wrap","wrap-reverse"].includes(e)},responsive:{type:Boolean,default:!1}},setup(e,{slots:o}){const r=a(_e,null),l=a(so,null),n=a(we,null);return f(so,()=>{if(void 0!==e.height&&null!==e.height)return e.height;const o="function"==typeof l?l():l;return null!=o?o:null}),()=>{const c=o.default?o.default():[],a="function"==typeof r?r():r,s="function"==typeof l?l():l,f={...e,_injectedWidth:a,_injectedHeight:s,_viewportVersion:n?n.version:0};return t("col",f,c)}}};const yt=Object.freeze({}),Ct=new Map;function vt(e){if(!e||0===Object.keys(e).length)return yt;const o=Object.keys(e).sort().map(o=>`${o}:${e[o]}`).join("|");let t=Ct.get(o);if(t)return t;if(t=Object.freeze({...e}),Ct.size>=30){const e=Ct.keys().next().value;Ct.delete(e)}return Ct.set(o,t),t}function wt(e){if(!e||!Array.isArray(e))return"";const o=[];for(const t of e)switch(t.type){case"text":t.text&&o.push(t.text);break;case"strong":case"em":o.push(t.tokens?wt(t.tokens):t.text||"");break;case"codespan":o.push(` ${t.text} `);break;case"link":o.push(`${t.text} (${t.href})`);break;case"del":o.push(`~~${t.text}~~`);break;case"br":o.push("\n");break;default:t.raw&&o.push(t.raw)}return o.join("")}function kt(e,o,r){if(!e||!Array.isArray(e))return[];const{TextBox:l}=o,n=[];for(const c of e)switch(c.type){case"text":c.text&&n.push(t(l,{bg:r.bg},{default:()=>c.text}));break;case"strong":n.push(t(l,{bold:!0,color:r.strongColor,bg:r.bg},{default:()=>c.tokens?kt(c.tokens,o,r):c.text}));break;case"em":n.push(t(l,{italic:!0,color:r.emphasisColor,bg:r.bg},{default:()=>c.tokens?kt(c.tokens,o,r):c.text}));break;case"codespan":n.push(t(l,{color:r.codeColor,bg:r.codeBg},{default:()=>` ${c.text} `}));break;case"link":n.push(t(l,{color:r.linkColor,underline:!0,bg:r.bg},{default:()=>`${c.text} (${c.href})`}));break;case"del":n.push(t(l,{dim:!0,bg:r.bg},{default:()=>`~~${c.text}~~`}));break;case"br":n.push(t(o.Newline));break;default:c.raw&&n.push(t(l,{bg:r.bg},{default:()=>c.raw}))}return n}function St(e,o,r,l){const{TextBox:n,Newline:c}=o;if(!l||l<=0)return[...kt(e.tokens,o,r),t(c)];const a=Ot(_t(e.tokens,r),l),s=[];for(let e=0;e<a.length;e++){const o=a[e];for(const e of o)s.push(t(n,e.style,{default:()=>e.text}));e<a.length-1&&s.push(t(c))}return s.push(t(c)),s}function _t(e,o,t=null){const r=[];if(!e||!Array.isArray(e))return r;const l=t||yt;for(const t of e)switch(t.type){case"text":t.text&&r.push({text:t.text,style:l});break;case"strong":if(t.tokens){const e=vt({...l,bold:!0,color:o.strongColor});r.push(..._t(t.tokens,o,e))}else t.text&&r.push({text:t.text,style:vt({...l,bold:!0,color:o.strongColor})});break;case"em":if(t.tokens){const e=vt({...l,italic:!0,color:o.emphasisColor});r.push(..._t(t.tokens,o,e))}else t.text&&r.push({text:t.text,style:vt({...l,italic:!0,color:o.emphasisColor})});break;case"codespan":r.push({text:` ${t.text} `,style:vt({...l,color:o.codeColor,bg:o.codeBg})});break;case"link":r.push({text:`${t.text} (${t.href})`,style:vt({...l,color:o.linkColor,underline:!0})});break;case"del":r.push({text:`~~${t.text}~~`,style:vt({...l,dim:!0})});break;default:t.raw&&r.push({text:t.raw,style:l})}return r}function Ot(e,o){const t=[[]];let r=0;for(const l of e){const e=l.text.split(/(\s+)/);for(const n of e){if(!n)continue;const e=oe(n);if(r+e<=o){t[t.length-1].push({text:n,style:l.style}),r+=e}else if(e>o){let e=n;for(;e.length>0;){const n=o-r;if(n<=0){t.push([]),r=0;continue}let c="",a=0;for(const o of e){const e=oe(o);if(!(a+e<=n))break;c+=o,a+=e}c&&(t[t.length-1].push({text:c,style:l.style}),r+=a,e=e.slice(c.length)),e.length>0&&(t.push([]),r=0)}}else t.push([{text:n,style:l.style}]),r=e}}return t.filter(e=>e.length>0).map(e=>e.length>0&&e[0].text.match(/^\s+$/)?e.slice(1):(e.length>0&&(e[0]={...e[0],text:e[0].text.trimStart()}),e)).filter(e=>e.length>0)}function It(e,o,r,l=0,n=null){const{TextBox:c,Newline:a}=o,s=[],f=" ".repeat(l),i=2*l;return e.items.forEach((d,u)=>{const b=e.ordered?`${e.start+u}. `:"• ",h=oe(b);let g="",p=0;d.task&&(g=d.checked?"[✓] ":"[ ] ",p=oe(g));const m=n?n-i-h-p:null;if(s.push(t(c,{color:r.listBulletColor},{default:()=>f+g+b})),d.tokens)for(const e of d.tokens)if("text"===e.type)if(m&&e.text){Ot(_t(e.tokens||[{type:"text",text:e.text}],r),m).forEach((e,o)=>{o>0&&(s.push(t(a)),s.push(t(c,{},{default:()=>" ".repeat(i+h+p)})));for(const o of e)s.push(t(c,o.style,{default:()=>o.text}))})}else s.push(...kt(e.tokens||[{type:"text",text:e.text}],o,r));else if("list"===e.type)s.push(t(a)),s.push(...It(e,o,r,l+1,n));else if("paragraph"===e.type)if(m){const t=St(e,o,r,m);for(;t.length>0&&t[t.length-1].type===a;)t.pop();s.push(...t)}else s.push(...kt(e.tokens,o,r));s.push(t(a))}),s}function Et(e){if(!e||!Array.isArray(e))return"";let o="";for(const t of e)t.text?o+=t.text:t.tokens?o+=Et(t.tokens):t.raw&&(o+=t.raw);return o}const Tt=2166136261,Nt=16777619;function At(e,o=0){if(!e)return 0;let t=Tt;const r=e.type||"";for(let e=0;e<r.length;e++)t^=r.charCodeAt(e),t=Math.imul(t,Nt);const l=e.text;if(l){t^=l.length,t=Math.imul(t,Nt);const e=Math.min(l.length,50);for(let o=0;o<e;o++)t^=l.charCodeAt(o),t=Math.imul(t,Nt)}const n=e.props;if(n)for(const e of bt){const o=n[e];if(void 0!==o)if("number"==typeof o)t^=0|o,t=Math.imul(t,Nt);else if("boolean"==typeof o)t^=o?1:0,t=Math.imul(t,Nt);else if("string"==typeof o){const e=Math.min(o.length,30);for(let r=0;r<e;r++)t^=o.charCodeAt(r),t=Math.imul(t,Nt)}else Array.isArray(o)&&(t^=o.length,t=Math.imul(t,Nt))}const c=e.children;if(c&&c.length>0&&o<10){t^=c.length,t=Math.imul(t,Nt);const e=c.length;if(e<=20)for(let r=0;r<e;r++){t^=At(c[r],o+1),t=Math.imul(t,Nt)}else{const r=[0,1,2,3,4,Math.floor(e/2)-2,Math.floor(e/2)-1,Math.floor(e/2),Math.floor(e/2)+1,Math.floor(e/2)+2,e-5,e-4,e-3,e-2,e-1];for(const l of r)if(l>=0&&l<e){t^=At(c[l],o+1),t=Math.imul(t,Nt)}}}else c&&c.length>0&&(t^=c.length,t=Math.imul(t,Nt));return t>>>0}function Bt(e,o=null,t=1/0){const r=function(e,o=1/0){if(!e)return 0;let t=Tt;const r=o===1/0?e.length:Math.min(e.length,o);let l=0;const n=r-3;for(;l<n;)t^=e.charCodeAt(l),t=Math.imul(t,Nt),t^=e.charCodeAt(l+1),t=Math.imul(t,Nt),t^=e.charCodeAt(l+2),t=Math.imul(t,Nt),t^=e.charCodeAt(l+3),t=Math.imul(t,Nt),l+=4;for(;l<r;)t^=e.charCodeAt(l++),t=Math.imul(t,Nt);return t>>>0}(e,t);return`${r}:${null!=o?String(o):"auto"}`}let Lt=null;class Rt{constructor(e=5,o=500){this.maxSize=e,this.maxTotalTokens=o,this.cache=new Map,this.totalTokens=0}_countTokens(e){if(!Array.isArray(e))return 0;let o=e.length;for(const t of e)if(t.tokens&&(o+=this._countTokens(t.tokens)),t.items)for(const e of t.items)e.tokens&&(o+=this._countTokens(e.tokens));return o}get(e){const o=this.cache.get(e);return o?(this.cache.delete(e),this.cache.set(e,o),o.tokens):null}set(e,o){const t=this.cache.get(e);t&&(this.totalTokens-=t.count,this.cache.delete(e));const r=this._countTokens(o);for(;this.totalTokens+r>this.maxTotalTokens&&this.cache.size>0;){const e=this.cache.keys().next().value,o=this.cache.get(e);this.totalTokens-=o.count,this.cache.delete(e)}for(;this.cache.size>=this.maxSize;){const e=this.cache.keys().next().value,o=this.cache.get(e);this.totalTokens-=o.count,this.cache.delete(e)}this.cache.set(e,{tokens:o,count:r}),this.totalTokens+=r}clear(){this.cache.clear(),this.totalTokens=0}get size(){return this.cache.size}}var Mt={name:"Markdown",props:{content:{type:String,default:""},h1Color:{type:String,default:"cyan"},h2Color:{type:String,default:"cyan"},h3Color:{type:String,default:"blue"},h4Color:{type:String,default:"blue"},h5Color:{type:String,default:"blue"},h6Color:{type:String,default:"blue"},codeColor:{type:String,default:"yellow"},codeBg:{type:String,default:"#1a1a24"},linkColor:{type:String,default:"blue"},emphasisColor:{type:String,default:"white"},strongColor:{type:String,default:"white"},blockquoteColor:{type:String,default:"gray"},blockquoteBorderColor:{type:String,default:"gray"},listBulletColor:{type:String,default:"green"},listNumberColor:{type:String,default:"green"},hrColor:{type:String,default:"gray"},hrChar:{type:String,default:"─"},hrLength:{type:Number,default:60},tableHeaderColor:{type:String,default:"cyan"},tableBorderColor:{type:String,default:"white"},color:String,bg:String,bold:Boolean,italic:Boolean,dim:Boolean,...be,padding:{type:Number,default:0}},setup(e){const o={TextBox:xo,Box:ho,Divider:he,Newline:xe,Table:ro,Row:mt},r=a(_e,null),l=new Rt(5,500);Lt=l;let n="",c=null;function s(){if(null!==e.width&&void 0!==e.width)return e.width;if(null!==r){const e="function"==typeof r?r():r;if(null!=e&&e>0)return e}return null}function f(e,o,r,l,n){const{TextBox:c,Divider:a,Newline:s}=o,f=[];switch(e.type){case"heading":{const l="#".repeat(e.depth)+" ",n=r[`h${e.depth}Color`];f.push(t(c,{bold:!0,color:n,bg:r.bg},{default:()=>[l,...kt(e.tokens,o,r)]})),f.push(t(s));break}case"paragraph":if(!(e.tokens&&e.tokens.some(e=>"strong"===e.type||"em"===e.type||"codespan"===e.type))&&e.tokens){const o=wt(e.tokens);f.push(t(c,{bg:r.bg},{default:()=>o}))}else f.push(...St(e,o,r,n));break;case"code":f.push(...function(e,o,r,l=null){const{TextBox:n,Box:c,Newline:a}=o,s=e.text,f=e.lang||"text",i=[];"text"!==f&&(i.push(t(n,{color:r.codeColor,dim:!0},{default:()=>`[${f}]`})),i.push(t(a)));const d=l?l-4:null;let u,b=s;if(d&&d>0){const e=s.split("\n").map(e=>oe(e)>d?re(e,d):e);b=e.join("\n")}try{const e=C(b,{language:f,ignoreIllegals:!0});u=t(n,{},{default:()=>e})}catch(e){u=t(n,{color:r.codeColor},{default:()=>b})}const h={border:!0,padding:1,color:r.tableBorderColor,bg:r.codeBg};return l&&(h.width=l),i.push(t(c,h,{default:()=>u})),i}(e,o,r)),f.push(t(s));break;case"blockquote":f.push(function(e,o,r,l,n=null){const{Box:c}=o,a=n?n-4:null,s=e.tokens.map(e=>l(e,o,r,l,a)).flat();for(;s.length>0&&s[s.length-1].type===o.Newline;)s.pop();const f={border:!0,padding:1,color:r.blockquoteBorderColor};return n&&(f.width=n),t(c,f,{default:()=>s})}(e,o,r,l)),f.push(t(s));break;case"list":f.push(...It(e,o,r,0,n));break;case"table":f.push(function(e,o,r,l=null){const{TextBox:n,Newline:c}=o,a=e.header.map(e=>Et(e.tokens)),s=e.rows.map(e=>e.map(e=>Et(e.tokens)));let f=a.map((e,o)=>{const t=oe(e),r=Math.max(...s.map(e=>oe(e[o]||"")),0);return Math.max(t,r)+2});if(l&&f.reduce((e,o)=>e+o,0)+f.length+1>l){const e=l-f.length-1,o=f.reduce((e,o)=>e+o,0);if(e>0){const t=e/o;f=f.map(e=>Math.max(4,Math.floor(e*t)))}}const i=[],d=(e,o)=>{const t=String(e||""),r=oe(t),l=o-2;if(r>l){let e="",o=0;for(const r of t){const t=oe(r);if(o+t>l-1)break;e+=r,o+=t}return" "+e+"…"+" ".repeat(Math.max(0,l-o-1))}return" "+t+" ".repeat(Math.max(0,l-r+1))};let u="┌";f.forEach((e,o)=>{u+="─".repeat(e),u+=o<f.length-1?"┬":"┐"}),i.push(t(n,{color:r.tableBorderColor},{default:()=>u})),i.push(t(c)),i.push(t(n,{color:r.tableBorderColor},{default:()=>"│"})),a.forEach((e,o)=>{i.push(t(n,{color:r.tableHeaderColor,bold:!0},{default:()=>d(e,f[o])})),i.push(t(n,{color:r.tableBorderColor},{default:()=>"│"}))}),i.push(t(c));let b="├";f.forEach((e,o)=>{b+="─".repeat(e),b+=o<f.length-1?"┼":"┤"}),i.push(t(n,{color:r.tableBorderColor},{default:()=>b})),i.push(t(c)),s.forEach(e=>{i.push(t(n,{color:r.tableBorderColor},{default:()=>"│"})),e.forEach((e,o)=>{i.push(t(n,{},{default:()=>d(e,f[o])})),i.push(t(n,{color:r.tableBorderColor},{default:()=>"│"}))}),i.push(t(c))});let h="└";return f.forEach((e,o)=>{h+="─".repeat(e),h+=o<f.length-1?"┴":"┘"}),i.push(t(n,{color:r.tableBorderColor},{default:()=>h})),i}(e,o,r)),f.push(t(s));break;case"hr":{const e=n||r.hrLength;f.push(t(a,{char:r.hrChar,length:e,color:r.hrColor})),f.push(t(s));break}case"html":f.push(t(c,{dim:!0},{default:()=>e.text})),f.push(t(s));break;case"space":f.push(t(s));break;default:e.raw&&(f.push(t(c,{},{default:()=>e.raw})),f.push(t(s)))}return f}return()=>{const r=function(){const o=s();if(null===o)return null;const t=2*e.padding;return Math.max(0,o-t)}(),a=e.content||"";a!==n&&(n=a,c=function(e){if(!e||""===e.trim())return[];const o=Bt(e,null,1e4),t=l.get(o);if(t)return t;try{const t=y.lexer(e);return l.set(o,t),t}catch(e){return console.error("Markdown parse error:",e),[]}}(a));const i=e.bg,d=function(r,l,n){if(!r||0===r.length)return[t(xo,{bg:n},{default:()=>""})];const c={...e,bg:n},a=[];for(const e of r)a.push(...f(e,o,c,f,l));for(;a.length>0&&a[a.length-1].type===xe;)a.pop();return a.length>0?a:[t(xo,{bg:n},{default:()=>""})]}(c,r,i),u={padding:e.padding,width:s(),color:e.color,bg:i,bold:e.bold,italic:e.italic,dim:e.dim,border:!1};return t(ho,u,{default:()=>d})}}},Ht=Object.freeze({__proto__:null,BigText:Eo,Box:ho,Button:Qo,Checkbox:jo,Col:xt,Divider:he,Gradient:Ro,Image:Co,Markdown:Mt,Newline:xe,ProgressBar:Oe,Radiobox:Xo,Row:mt,SelectInput:zo,Spacer:me,Spinner:pe,Table:ro,TextBox:xo,TextInput:Wo,Tree:wo,clearBigTextCache:No,getBigTextCacheStats:Ao});const Dt="[2K";class Ft{static cursorCache=(()=>{const e=new Array(500);for(let o=0;o<500;o++)e[o]=`[${o+1};1H`;return e})();static cursorTo(e){return Ft.cursorCache[e]??`[${e+1};1H`}constructor(e=process.stdout){this.stream=e,this.previousLines=[],this.previousLineCount=0,this.previousContent="",this.bufferParts=[]}_detectChangeRegion(e,o){const t=[],r=Math.max(e.length,o.length);for(let l=0;l<r;l++)e[l]!==o[l]&&t.push(l);return 0===t.length?null:{firstChanged:t[0],lastChanged:t[t.length-1],totalChanged:t.length}}render(e){if(e===this.previousContent)return;this.previousContent=e;const o=e.split("\n"),t=this.previousLines,r=o.length,l=t.length;if(!this._detectChangeRegion(o,t))return this.previousLines=o,void(this.previousLineCount=r);this.bufferParts.length=0,this.bufferParts.push("[?2026h"),0===l||Math.abs(r-l)>20?this._fullRedraw(o):this._incrementalUpdate(o,t),this.bufferParts.push("[?2026l"),this.stream.write(this.bufferParts.join("")),this.previousLines=o,this.previousLineCount=r}_fullRedraw(e){this.bufferParts.push("[H");const o=e.length;for(let t=0;t<o;t++)t>0&&this.bufferParts.push("\n"),this.bufferParts.push(Dt,e[t]);this.bufferParts.push("[J")}_incrementalUpdate(e,o){const t=e.length,r=o.length,l=Math.max(t,r);let n=0;for(let t=0;t<l;t++)e[t]!==o[t]&&n++;if(n>.7*l)this._fullRedraw(e);else{for(let r=0;r<l;r++){const l=e[r],n=o[r];r>=t?this.bufferParts.push(Ft.cursorTo(r),Dt):l!==n&&this.bufferParts.push(Ft.cursorTo(r),Dt,l)}t<r&&this.bufferParts.push(Ft.cursorTo(t),"[J")}}renderScroll(e){this.render(e)}clear(){this.previousLines=[],this.previousLineCount=0,this.previousContent=""}done(){this.stream.write("[?25h"),this.clear()}}function Gt(e,o){if(!e)return 0;if(o<=0)return 1;if(!(-1!==e.indexOf("\n"))){const t=oe(e);return t<=o?1:Math.ceil(t/o)}const t=e.split("\n");let r=0;for(let e=0;e<t.length;e++){const l=t[e];if(0===l.length){r+=1;continue}const n=oe(l);r+=n<=o?1:Math.ceil(n/o)}return Math.max(1,r)}function Ut(e){if(!e)return"";if(e.text)return e.text;if(e.props?.text)return e.props.text;const o=e.children;if(!o||0===o.length)return"";if(1===o.length){const e=o[0];return"string"==typeof e?e:"text"===e?.type?e.text||"":Ut(e)}const t=[];for(let e=0;e<o.length;e++){const r=o[e];if("string"==typeof r)t.push(r);else if("text"===r?.type)r.text&&t.push(r.text);else if(r){const e=Ut(r);e&&t.push(e)}}return t.join("")}class Wt{applyLayout(e,o,t){return{}}}class Pt extends Wt{applyLayout(e,o,t){const{containerWidth:r,containerHeight:l}=t;return e.setFlexDirection(v.FLEX_DIRECTION_COLUMN),e.setWidth(r),l&&l!==1/0&&(e.setHeight(l),e.setMaxHeight(l)),e.setAlignItems(v.ALIGN_STRETCH),{}}}class $t extends Wt{applyLayout(e,o,t){const r=o.props||{};return e.setFlexDirection(v.FLEX_DIRECTION_ROW),void 0!==r.width&&null!==r.width||e.setWidthPercent(100),void 0!==r.height?"string"==typeof r.height&&r.height.endsWith("%")?e.setHeightPercent(parseFloat(r.height)):(e.setHeight(r.height),e.setMinHeight(r.height),e.setMaxHeight(r.height)):void 0!==r._injectedHeight&&null!==r._injectedHeight&&(e.setMaxHeight(r._injectedHeight),process.env.DEBUG_FLEX&&console.log(`[DEBUG] ${o.type}Handler: setting maxHeight=${r._injectedHeight} (from injected)`)),{}}}class zt extends Wt{applyLayout(e,o,t){e.setFlexDirection(v.FLEX_DIRECTION_COLUMN);const r=o.props||{},{containerHeight:l}=t;return void 0!==r.height?"string"==typeof r.height&&r.height.endsWith("%")?e.setHeightPercent(parseFloat(r.height)):(e.setHeight(r.height),e.setMinHeight(r.height),e.setMaxHeight(r.height),process.env.DEBUG_FLEX&&console.log(`[DEBUG] ColHandler: setting height=${r.height} (min/max enforced)`)):void 0!==r._injectedHeight&&null!==r._injectedHeight?(e.setMaxHeight(r._injectedHeight),process.env.DEBUG_FLEX&&console.log(`[DEBUG] ColHandler: setting maxHeight=${r._injectedHeight} (from injected)`)):l&&l!==1/0&&(e.setHeight(l),e.setMaxHeight(l),process.env.DEBUG_FLEX&&console.log(`[DEBUG] ColHandler: setting height+maxHeight=${l} (from containerHeight)`)),{}}}class Kt extends Wt{applyLayout(e,o,t){const r=oe(o.text||"");return e.setWidth(r),e.setHeight(1),{}}}class jt extends Wt{applyLayout(e,o,t){const{containerWidth:r}=t,l=o.props||{},n=Ut(o);let c=r;null!=l.width?c="string"==typeof l.width&&l.width.endsWith("%")?Math.floor(r*parseFloat(l.width)/100):l.width:void 0!==l._injectedWidth&&null!==l._injectedWidth&&(c=l._injectedWidth);const a=Gt(n,c);return e.setHeight(a),{hasTextBoxes:!0}}}class Vt extends Wt{applyLayout(e,o,t){const r=o.props||{},l=function(e,o){return e?{Standard:6,Big:8,Slant:6,Small:5,Banner:8,Block:8,Bubble:7,Digital:6,Ivrit:6,Lean:7,Mini:4,Script:6,Shadow:7,Smscript:5,Smshadow:6,Smslant:5,Terrace:6,Thick:6}[o]||6:0}(Ut(o),r.font||"Standard");return e.setHeight(l),void 0===r.width&&void 0===r.flex&&e.setWidthPercent(100),{}}}class Yt extends Wt{applyLayout(e,o,t){const r=o.props||{};return e.setHeight(1),void 0!==r.length?e.setWidth(r.length):void 0===r.width&&void 0===r.flex&&e.setWidthPercent(100),{}}}class Xt extends Wt{applyLayout(e,o,t){const r=o.props||{},l=r.label||"",n=r.height||10,c=r.headers||[],a=r.rows||[],s=!1!==r.showHeader,f=r.isFocused||!1,i=r.disabled||!1;if(0===c.length&&0===a.length){let o=3;l&&(o+=1),e.setHeight(o)}else{let o=1;l&&(o+=1),s&&c.length>0&&(o+=2),o+=n,o+=1,f&&!i&&(o+=1),a.length>n&&(o+=1),e.setHeight(o)}return void 0===r.width&&void 0===r.flex&&e.setWidthPercent(100),{}}}class Zt extends Wt{applyLayout(e,o,t){const r=o.props||{},l=r.imageLines||1;return e.setHeight(l),void 0===r.width&&void 0===r.flex&&e.setWidthPercent(100),{}}}class Jt extends Wt{applyLayout(e,o,t){const r=(o.props||{}).count||1;return e.setHeight(Math.max(1,r)),{}}}class qt extends Wt{applyLayout(e,o,t){const r=(o.props||{}).lines||1;return e.setHeight(Math.max(1,r)),{}}}class Qt extends Wt{applyLayout(e,o,t){const r=o.props||{},l=4+oe(r.label||"");return e.setHeight(1),void 0===r.width&&void 0===r.flex&&e.setWidth(l),{}}}class er extends Wt{applyLayout(e,o,t){const{containerWidth:r}=t,l=o.props||{},n=l.label||"",c=l.rows||3,a=l.minRows||1,s=l.maxRows,f=l.autoResize||!1,i=l.text||"",d=l.hint,u=l.validationError,b=l.isFocused||!1,h=l.disabled||!1;let g=r;null!=l.width?g="string"==typeof l.width&&l.width.endsWith("%")?Math.floor(r*parseFloat(l.width)/100):l.width:void 0!==l._injectedWidth&&null!==l._injectedWidth&&(g=l._injectedWidth);let p=c;if(f){const e=i?Gt(i,g):a;p=Math.max(a,e),s&&(p=Math.min(p,s))}let m=1+p+1;return n&&(m+=1),(u||b&&!h&&!1!==d&&""!==d)&&(m+=1),e.setHeight(m),null!=l.width&&("string"==typeof l.width&&l.width.endsWith("%")?e.setWidthPercent(parseFloat(l.width)):e.setWidth(l.width+2)),{}}}class or extends Wt{applyLayout(e,o,t){const r=o.props||{},l=r.label||"",n=r.height||10,c=r.options||[],a=r.isFocused||!1,s=r.disabled||!1;if("vertical"===(r.direction||"vertical")){let o=1+(0===c.length?1:Math.min(n,c.length))+1;if(l&&(o+=1),a&&!s&&(o+=1),c.length>n&&(o+=1),e.setHeight(o),void 0===r.width&&void 0===r.flex){let o=20;for(let e=0;e<c.length;e++){const t=oe(c[e].label||String(c[e].value));t>o&&(o=t)}e.setWidth(o+8)}}else e.setHeight(l?4:3);return{}}}class tr extends Wt{applyLayout(e,o,t){const r=o.props||{},l=r.label||"",n=r.height||10,c=r.options||[],a=r.isFocused||!1,s=r.disabled||!1;if("vertical"===(r.direction||"vertical")){let o=1+(0===c.length?1:Math.min(n,c.length))+1;if(l&&(o+=1),a&&!s&&(o+=1),c.length>n&&(o+=1),e.setHeight(o),void 0===r.width&&void 0===r.flex){let o=20;for(let e=0;e<c.length;e++){const t=oe(c[e].label||String(c[e].value));t>o&&(o=t)}e.setWidth(o+8)}}else e.setHeight(l?4:3);return{}}}class rr extends Wt{applyLayout(e,o,t){const r=o.props||{},l=r.label||"",n=r.height||10,c=r.options||[],a=r.isFocused||!1,s=r.disabled||!1;let f=1+(0===c.length?1:Math.min(n,c.length))+1;if(l&&(f+=1),a&&!s&&(f+=1),c.length>n&&(f+=1),e.setHeight(f),void 0===r.width&&void 0===r.flex){let o=20;for(let e=0;e<c.length;e++){const t=oe(c[e].label||String(c[e].value));t>o&&(o=t)}e.setWidth(o+4)}return{}}}class lr extends Wt{applyLayout(e,o,t){const r=o.props||{},l=r.border,n=r.padding||0,c=!1!==l,a=!!r.bg;if((c||0!==n||a)&&(c?e.setBorder(v.EDGE_ALL,1):a&&(e.setPadding(v.EDGE_TOP,1),e.setPadding(v.EDGE_BOTTOM,1))),void 0!==r.maxHeight){const o=c||a?2:0,t=2*n,l=r.maxHeight+o+t;e.setMaxHeight(l)}return{}}}class nr extends Wt{applyLayout(e,o,t){const r=o.props||{};const l=function e(o){if(!o||0===o.length)return 0;let t=0;for(const r of o)t++,r.children&&r.children.length>0&&(t+=e(r.children));return t}(r.data||[]);return e.setHeight(Math.max(1,l)),void 0===r.width&&void 0===r.flex&&e.setWidthPercent(100),{}}}const cr=new class{constructor(){this.handlers=new Map,this._registerDefaultHandlers()}_registerDefaultHandlers(){this.register("root",new Pt),this.register("row",new $t),this.register("col",new zt),this.register("text",new Kt),this.register("textbox",new jt),this.register("bigtext",new Vt),this.register("divider",new Yt),this.register("table",new Xt),this.register("image",new Zt),this.register("newline",new Jt),this.register("spacer",new qt),this.register("button",new Qt),this.register("textinput",new er),this.register("checkbox",new or),this.register("radiobox",new tr),this.register("selectinput",new rr),this.register("box",new lr),this.register("tree",new nr)}register(e,o){this.handlers.set(e,o)}get(e){return this.handlers.get(e)||null}has(e){return this.handlers.has(e)}};class ar{constructor(){this.cache=H,this._lastCacheKey=null}computeLayout(e,o,t){if(!e)return{width:0,height:0,x:0,y:0,children:[]};const r=`${o}:${t}:${At(e)}`,l=this.cache.getLayoutMetrics(e,r);if(l)return this.restoreCachedMetrics(e,l),e.isLayoutDirty=!1,l;this._hasTextBoxes=!1;const n=this.buildYogaTree(e,o,t,null,0,0);try{if(n.calculateLayout(o,t,v.DIRECTION_LTR),this._hasTextBoxes){this.updateTextHeights(n,e)&&n.calculateLayout(o,t,v.DIRECTION_LTR)}const l=this.extractMetrics(n,e);return this.cache.setLayoutMetrics(e,r,l),e.cachedLayoutMetrics=l,e.isLayoutDirty=!1,l}finally{this.freeYogaTree(n)}}updateTextHeights(e,o){let t=!1;if("textbox"===o.type){const r=e.getComputedWidth(),l=Gt(Ut(o),r),n=e.getComputedHeight();l!==n&&Math.abs(l-n)>.5&&(e.setHeight(l),t=!0)}const r=o.children;if(r&&r.length>0){let o=0;for(let l=0;l<r.length;l++){const n=r[l];if("comment"!==n.type){const r=e.getChild(o);r&&this.updateTextHeights(r,n)&&(t=!0),o++}}}return t}restoreCachedMetrics(e,o){if(e.cachedLayoutMetrics===o)return;e.cachedLayoutMetrics=o;const t=e.children,r=o.children;if(r&&t){let e=0;for(let o=0;o<t.length;o++){const l=t[o];if("comment"!==l.type){const o=r[e];o&&this.restoreCachedMetrics(l,o),e++}}}}_getComponentType(e,o){return"row"===o.flexDirection?"row":"column"===o.flexDirection?"col":e.type}_applyFlexProperties(e,o){if(void 0!==o.flex)if("number"==typeof o.flex)e.setFlexGrow(o.flex),e.setFlexShrink(1);else if("string"==typeof o.flex){const t=o.flex.split(/\s+/);if(1!==t.length||isNaN(parseFloat(t[0])))t[0]&&e.setFlexGrow(parseFloat(t[0])||0),t[1]&&e.setFlexShrink(parseFloat(t[1])||1),t[2]&&"auto"!==t[2]&&e.setFlexBasis(parseFloat(t[2])||0);else{const o=parseFloat(t[0]);e.setFlexGrow(o),e.setFlexShrink(1),0!==o&&e.setFlexBasis(0)}}if(void 0!==o.flexGrow&&null!==o.flexGrow&&e.setFlexGrow(o.flexGrow),void 0!==o.flexShrink&&null!==o.flexShrink&&e.setFlexShrink(o.flexShrink),void 0!==o.flexBasis&&null!==o.flexBasis&&e.setFlexBasis(o.flexBasis),o.justifyContent){const t={"flex-start":v.JUSTIFY_FLEX_START,"flex-end":v.JUSTIFY_FLEX_END,center:v.JUSTIFY_CENTER,"space-between":v.JUSTIFY_SPACE_BETWEEN,"space-around":v.JUSTIFY_SPACE_AROUND,"space-evenly":v.JUSTIFY_SPACE_EVENLY}[o.justifyContent];void 0!==t&&e.setJustifyContent(t)}if(o.alignItems){const t={"flex-start":v.ALIGN_FLEX_START,"flex-end":v.ALIGN_FLEX_END,center:v.ALIGN_CENTER,stretch:v.ALIGN_STRETCH,baseline:v.ALIGN_BASELINE}[o.alignItems];void 0!==t&&e.setAlignItems(t)}if(o.alignSelf){const t={auto:v.ALIGN_AUTO,"flex-start":v.ALIGN_FLEX_START,"flex-end":v.ALIGN_FLEX_END,center:v.ALIGN_CENTER,stretch:v.ALIGN_STRETCH,baseline:v.ALIGN_BASELINE}[o.alignSelf];void 0!==t&&e.setAlignSelf(t)}if(o.responsive)e.setFlexWrap(v.WRAP_WRAP);else if(o.flexWrap){const t={wrap:v.WRAP_WRAP,nowrap:v.WRAP_NO_WRAP,"wrap-reverse":v.WRAP_WRAP_REVERSE}[o.flexWrap];void 0!==t&&e.setFlexWrap(t)}if(o.alignContent){const t={"flex-start":v.ALIGN_FLEX_START,"flex-end":v.ALIGN_FLEX_END,center:v.ALIGN_CENTER,stretch:v.ALIGN_STRETCH,"space-between":v.ALIGN_SPACE_BETWEEN,"space-around":v.ALIGN_SPACE_AROUND}[o.alignContent];void 0!==t&&e.setAlignContent(t)}}_applyPaddingProperties(e,o){void 0!==o.padding&&null!==o.padding&&e.setPadding(v.EDGE_ALL,o.padding),void 0!==o.paddingLeft&&null!==o.paddingLeft&&e.setPadding(v.EDGE_LEFT,o.paddingLeft),void 0!==o.paddingRight&&null!==o.paddingRight&&e.setPadding(v.EDGE_RIGHT,o.paddingRight),void 0!==o.paddingTop&&null!==o.paddingTop&&e.setPadding(v.EDGE_TOP,o.paddingTop),void 0!==o.paddingBottom&&null!==o.paddingBottom&&e.setPadding(v.EDGE_BOTTOM,o.paddingBottom)}_applyMarginProperties(e,o,t,r,l,n){if(void 0!==o.margin){const c=t>0&&r>0&&l?t:0,a=t>0&&r>0&&n?t:0;e.setMargin(v.EDGE_LEFT,c+o.margin),e.setMargin(v.EDGE_RIGHT,o.margin),e.setMargin(v.EDGE_TOP,a+o.margin),e.setMargin(v.EDGE_BOTTOM,o.margin)}else{if(void 0!==o.marginLeft){const n=t>0&&r>0&&l?t:0;e.setMargin(v.EDGE_LEFT,n+o.marginLeft)}if(void 0!==o.marginRight&&e.setMargin(v.EDGE_RIGHT,o.marginRight),void 0!==o.marginTop){const l=t>0&&r>0&&n?t:0;e.setMargin(v.EDGE_TOP,l+o.marginTop)}void 0!==o.marginBottom&&e.setMargin(v.EDGE_BOTTOM,o.marginBottom)}}buildYogaTree(e,o,t,r=null,l=0,n=0){const c=v.Node.create(),a=e.props||{},s=r?.props||{},f=s.gap||0,i="row"===r?.type||"row"===s.flexDirection,d="col"===r?.type||"column"===s.flexDirection;f>0&&l>0&&(i?c.setMargin(v.EDGE_LEFT,f):d&&c.setMargin(v.EDGE_TOP,f)),this._applyFlexProperties(c,a),this._applyPaddingProperties(c,a),this._applyMarginProperties(c,a,f,l,i,d),null!=a.width&&("string"==typeof a.width&&a.width.endsWith("%")?c.setWidthPercent(parseFloat(a.width)):c.setWidth(a.width)),void 0!==a.minWidth&&c.setMinWidth(a.minWidth),void 0!==a.maxWidth&&c.setMaxWidth(a.maxWidth),void 0!==a.minHeight&&c.setMinHeight(a.minHeight),void 0!==a.maxHeight&&c.setMaxHeight(a.maxHeight);const u=this._getComponentType(e,a),b=cr.get(u);if(b){b.applyLayout(c,e,{containerWidth:o,containerHeight:t,parentNode:r,childIndex:l,siblingCount:n}).hasTextBoxes&&(this._hasTextBoxes=!0)}void 0===a.height||b||("string"==typeof a.height&&a.height.endsWith("%")?c.setHeightPercent(parseFloat(a.height)):c.setHeight(a.height)),void 0===a.flex&&"col"===e.type&&void 0===a.height&&(c.setFlexGrow(1),c.setFlexShrink(1),c.setFlexBasis(0));let h=o;if("box"===e.type){const e=!1!==a.border?2:0,t=2*(a.padding||0),r=a.width||a._injectedWidth||o;h=Math.max(0,r-e-t)}"col"!==e.type&&"row"!==e.type||!a.width||(h=a.width);let g=t;if("box"===e.type){const e=!1!==a.border?2:0,o=2*(a.padding||0),r=a.height||a._injectedHeight||t;g=Math.max(0,r-e-o)}"col"!==e.type&&"row"!==e.type||!a.height||(g=a.height);let p=0;for(let o=0;o<e.children.length;o++)"comment"!==e.children[o].type&&p++;let m=0;for(const o of e.children)if("comment"!==o.type){const t=this.buildYogaTree(o,h,g,e,m,p);c.insertChild(t,m),m++}return c}extractMetrics(e,o){const t=e.getComputedLayout(),r=o.children;let l=0;if(r)for(let e=0;e<r.length;e++)"comment"!==r[e].type&&l++;const n={width:Math.round(t.width),height:Math.round(t.height),x:Math.round(t.left),y:Math.round(t.top),children:l>0?new Array(l):[]};if(r&&l>0){let o=0;for(let t=0;t<r.length;t++){const l=r[t];if("comment"!==l.type){const t=e.getChild(o),r=this.extractMetrics(t,l);n.children[o]=r,l.cachedLayoutMetrics=r,o++}}}return n}freeYogaTree(e){if(!e)return;for(let o=e.getChildCount()-1;o>=0;o--){const t=e.getChild(o);this.freeYogaTree(t)}e.freeRecursive()}invalidateLayout(e){if(!e)return;const o=[e];let t=0;for(;o.length>0&&t<1e4;){const e=o.shift();t++,e.isLayoutDirty=!0,this.cache.invalidateLayoutMetrics(e);const r=e.children;if(r)for(let e=0;e<r.length;e++)o.push(r[e])}}clearCache(){this.cache.clearAll()}getStats(){return this.cache.getStats()}}class sr{constructor(e=2e3){this.maxSize=e,this.cache=new Map}get(e){const o=this.cache.get(e);if(void 0!==o)return this.cache.delete(e),this.cache.set(e,o),o}set(e,o){if(this.cache.delete(e),this.cache.set(e,o),this.cache.size>this.maxSize){const e=this.cache.keys().next().value;this.cache.delete(e)}}clear(){this.cache.clear()}get size(){return this.cache.size}}const fr=new sr(2e3),ir=new Map;function dr(e,o){let t=fr.get(e);return void 0===t&&(t=o(e),fr.set(e,t)),t}function ur(e,o,t){let r=ir.get(o);if(!r){if(ir.size>=5){const e=ir.keys().next().value;ir.delete(e)}r=new sr(500),ir.set(o,r)}let l=r.get(e);return void 0===l&&(l=t(e,o),r.set(e,l)),l}function br(e,o,t,r,l=null){const n=e.length,c=new Array(n);for(let a=0;a<n;a++){const n=e[a],s=dr(n,t);let f;if(f=s>o?ur(n,o,r):n,l){const e=s>o?o:s,t=Math.max(0,o-e);c[a]=l+f+l+" ".repeat(t)+"[0m"}else c[a]=f}return c}function hr(){fr.clear(),ir.clear()}class gr{constructor(){this.regions=[],this.isDirty=!0,this._scrollOffset=0,this.viewportHeight=0,this.debugServer=null}build(e,o=0,t=0){const r=e._clickRegions||[];this._scrollOffset=o,this.viewportHeight=t;this.regions=[];for(const e of r){const r=e.y-o;r<t+50&&r+e.height>-50&&this.regions.push({componentId:e.componentId,x:e.x,absY:e.y,screenY:r,width:e.width,height:e.height,depth:e.depth,nodeType:e.nodeType})}this.regions.length>500&&(this.regions=this.regions.slice(-500)),this.isDirty=!1,this.debugServer&&this.debugServer.captureEvent("clickmap.build",{sourceCount:r.length,filteredCount:this.regions.length,scrollOffset:o,viewportHeight:t})}hitTest(e,o){const t=e-1,r=o-1;this.debugServer&&this.debugServer.captureEvent("clickmap.hittest",{terminalX:e,terminalY:o,layoutX:t,layoutY:r,scrollOffset:this._scrollOffset,regionCount:this.regions.length});for(let e=this.regions.length-1;e>=0;e--){const o=this.regions[e],l=t>=o.x&&t<o.x+o.width,n=r>=o.screenY&&r<o.screenY+o.height;if(l&&n)return this.debugServer&&this.debugServer.captureEvent("clickmap.hit",{componentId:o.componentId,nodeType:o.nodeType,region:{x:o.x,screenY:o.screenY,width:o.width,height:o.height}}),o.componentId}return this.debugServer&&this.debugServer.captureEvent("clickmap.miss",{layoutX:t,layoutY:r}),null}adjustForScroll(e){if(this._scrollOffset===e)return;const o=e-this._scrollOffset;this._scrollOffset=e;for(let e=0;e<this.regions.length;e++)this.regions[e].screenY-=o;this.debugServer&&this.debugServer.captureEvent("clickmap.scroll",{delta:o,newScrollOffset:e,regionCount:this.regions.length})}invalidate(){this.isDirty=!0}clear(){this.regions.length=0,this.isDirty=!0,this._scrollOffset=0,this.viewportHeight=0}setDebugServer(e){this.debugServer=e}getRegions(){return this.regions}getStats(){return{regionCount:this.regions.length,maxRegions:500,isDirty:this.isDirty,scrollOffset:this._scrollOffset,viewportHeight:this.viewportHeight}}debugPrint(){console.error("=== ClickMap Debug ==="),console.error(`Scroll: ${this._scrollOffset}, Viewport: ${this.viewportHeight}, Dirty: ${this.isDirty}`),console.error(`Regions (${this.regions.length}):`);for(let e=0;e<this.regions.length;e++){const o=this.regions[e];console.error(` [${e}] ${o.nodeType} "${o.componentId}" x:${o.x}-${o.x+o.width} screenY:${o.screenY}-${o.screenY+o.height} (absY:${o.absY})`)}console.error("======================")}}const pr={background:"#0a0a0f",foreground:"#e6e8f0",primary:"#3d5eff",secondary:"#969ebd",success:"#4ecca3",warning:"#c97945",danger:"#d64d64",info:"#5eb3d6",components:{box:{color:"#4a4f6a",bg:null},textBox:{color:"#e6e8f0",bg:null},textInput:{color:"#e6e8f0",borderColor:"#3d5eff",bg:null,focusColor:"#7d5fff",errorColor:"#d64d64"},button:{variants:{primary:{bg:"#3d5eff",color:"#ffffff",bold:!0},secondary:{bg:"#5a617a",color:"#e6e8f0",bold:!1},danger:{bg:"#d64d64",color:"#ffffff",bold:!0},warning:{bg:"#c97945",color:"#ffffff",bold:!0},info:{bg:"#5eb3d6",color:"#0a0a0f",bold:!1},success:{bg:"#4ecca3",color:"#0a0a0f",bold:!0}}},checkbox:{color:"#5a617a",checkedColor:"#7d5fff",uncheckedColor:"#4a4f6a"},radiobox:{color:"#5a617a",selectedColor:"#7d5fff",unselectedColor:"#4a4f6a"}}};function mr(e,o){const t={...e};for(const r in o)void 0!==o[r]&&null!==o[r]&&("object"!=typeof o[r]||Array.isArray(o[r])?t[r]=o[r]:t[r]=mr(e[r]||{},o[r]));return t}function xr(e={}){return e&&"object"==typeof e?mr(pr,e):{...pr}}function yr(e,o){if(!e||!o)return null;const t=o.split(".");let r=e;for(const e of t){if(!r||"object"!=typeof r||!(e in r))return null;r=r[e]}return"string"==typeof r?r:null}class Cr{constructor(e={}){this.config={...e},e.forceColors&&(d.level=3),this.theme=xr(e.theme||{}),this.themeBgCode=V(this.theme?.background),this.debugServer=null,this.debugServerConfig=this.config.debugServer,this.rootContainer=new k("root"),this.rootContainer.vuettyViewport=this.viewport,this.viewportState=o({version:0,width:0,height:0}),this.app=null,this.renderer=null,this.currentOutput="",this.resizeHandler=null,this.cleanupHandler=null,this.resizeTimeout=null,this.layoutEngine=null,this.logUpdate=null,this.scrollThrottleMs=e.scrollThrottleMs??16,this.lastScrollTime=0,this.pendingScrollRender=null,this.lastScrollOffset=0,this.accumulatedScrollDelta=0,this.visibleLinesCache={offset:-1,lines:null,output:null},this.viewport={scrollOffset:0,contentHeight:0,terminalHeight:0,terminalWidth:0,enabled:!0,autoScrollToBottom:!0,mouseWheelEnabled:!0,mouseWheelScrollLines:e.mouseWheelScrollLines??3,scrollIndicatorMode:e.scrollIndicatorMode||"reserved",mouseTrackingEnabled:e.mouseTrackingEnabled??!0,...e.viewport},this.inputManager=new pt({onExit:()=>this.handleExit()}),this.clickMap=new gr,this.clickHandlers=new Map,this._handlerOrder=[]}use(e,...o){if(!this.app)throw new Error("No app created. Call createApp() first.");return this.app.use(e,...o),this}handleExit(){this.unmount(),process.exit(0)}enableMouseTracking(){this.viewport.mouseTrackingEnabled||(process.stdout.write("[?1000h"),process.stdout.write("[?1006h"),this.viewport.mouseTrackingEnabled=!0,this.render())}disableMouseTracking(){this.viewport.mouseTrackingEnabled&&(process.stdout.write("[?1006l"),process.stdout.write("[?1000l"),this.viewport.mouseTrackingEnabled=!1,this.render())}toggleMouseTracking(){this.viewport.mouseTrackingEnabled?this.disableMouseTracking():this.enableMouseTracking()}handleResize(){this.resizeTimeout&&clearTimeout(this.resizeTimeout),this._resizeStartTime||(this._resizeStartTime=Date.now());const e=Date.now()-this._resizeStartTime<500?100:50;this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=null,this._resizeStartTime=null,this.performResize()},e)}performResize(){this.viewport.terminalHeight=process.stdout.rows||24,this.viewport.terminalWidth=process.stdout.columns||80,"reserved"===this.viewport.scrollIndicatorMode&&(this.viewport.terminalHeight-=1),this.updateMaxScrollOffset(),N(this.viewport),this.clampScrollOffset(),this.viewportState.version++,this.viewportState.width=this.viewport.terminalWidth,this.viewportState.height=this.viewport.terminalHeight,this.debugServer&&this.debugServer.captureEvent("vuetty.resize",{width:this.viewport.terminalWidth,height:this.viewport.terminalHeight,version:this.viewportState.version}),this.logUpdate.clear(),hr(),this.visibleLinesCache={offset:-1,lines:null,output:null},this.layoutEngine&&this.rootContainer&&this.layoutEngine.invalidateLayout(this.rootContainer),this.rootContainer&&E(this.rootContainer,!0),this.clickMap.invalidate(),this.renderer&&this.renderer.forceUpdate&&this.renderer.forceUpdate()}scrollUp(e=1){const o=Date.now(),t=Math.max(0,this.viewport.scrollOffset-e);if(t!==this.viewport.scrollOffset){if(this.viewport.scrollOffset=t,this.clickMap.isDirty||this.clickMap.adjustForScroll(t),o-this.lastScrollTime<this.scrollThrottleMs)return this.accumulatedScrollDelta-=e,void(this.pendingScrollRender||(this.pendingScrollRender=setTimeout(()=>{this.pendingScrollRender=null;const e=this.accumulatedScrollDelta;this.accumulatedScrollDelta=0,this.renderScrollSafe(e)},this.scrollThrottleMs)));this.lastScrollTime=o,this.accumulatedScrollDelta=0,this.renderScroll(-e)}}scrollDown(e=1){const o=Date.now(),t=this.viewport.maxScrollOffset,r=Math.min(t,this.viewport.scrollOffset+e);if(r!==this.viewport.scrollOffset){if(this.viewport.scrollOffset=r,this.clickMap.isDirty||this.clickMap.adjustForScroll(r),o-this.lastScrollTime<this.scrollThrottleMs)return this.accumulatedScrollDelta+=e,void(this.pendingScrollRender||(this.pendingScrollRender=setTimeout(()=>{this.pendingScrollRender=null;const e=this.accumulatedScrollDelta;this.accumulatedScrollDelta=0,this.renderScrollSafe(e)},this.scrollThrottleMs)));this.lastScrollTime=o,this.accumulatedScrollDelta=0,this.renderScroll(e)}}renderScrollSafe(e){Math.abs(e)>this.viewport.terminalHeight/2?(this.logUpdate.clear(),this.render()):this.renderScroll(e)}renderScroll(e=0){const o=this.currentOutput,t=this.visibleLinesCache;let r;t.output===o?r=t.lines:(r=o.split("\n"),t.output=o,t.lines=r),this.viewport.contentHeight=r.length,this.updateMaxScrollOffset(),this.clampScrollOffset();const l=this.viewport.scrollOffset,n=Math.min(this.viewport.scrollOffset+this.viewport.terminalHeight,this.viewport.contentHeight),c=r.slice(l,n),a=this.shouldShowScrollIndicator(),s=br(c,this.viewport.terminalWidth,oe,te,this.themeBgCode);let f=s.join("\n");const i=s.length;a&&(f+="\n"+this.getScrollIndicator()),this.logUpdate.renderScroll(f,e,i),this.lastScrollOffset=this.viewport.scrollOffset}scrollToTop(){0!==this.viewport.scrollOffset&&(this.viewport.scrollOffset=0,!this.clickMap.isDirty&&this.clickMap.regions.length>0&&this.clickMap.adjustForScroll(0),this.render())}scrollToBottom(){const e=this.viewport.maxScrollOffset;this.viewport.scrollOffset!==e&&(this.viewport.scrollOffset=e,!this.clickMap.isDirty&&this.clickMap.regions.length>0&&this.clickMap.adjustForScroll(e),this.render())}pageUp(){this.scrollUp(this.viewport.terminalHeight)}pageDown(){this.scrollDown(this.viewport.terminalHeight)}clampScrollOffset(){const e=this.viewport.maxScrollOffset;this.viewport.scrollOffset=Math.max(0,Math.min(this.viewport.scrollOffset,e))}isAtBottom(){const e=this.viewport.maxScrollOffset;return this.viewport.scrollOffset>=e}handleViewportKey(e){const o=null!==this.inputManager.getFocusedId();if(e.shift&&e.key===Ie)return this.scrollUp(),!0;if(e.shift&&e.key===Ee)return this.scrollDown(),!0;if(!o){if(e.key===De)return this.pageUp(),!0;if(e.key===Fe)return this.pageDown(),!0;if(e.key===Ie)return this.scrollUp(),!0;if(e.key===Ee)return this.scrollDown(),!0;if(e.key===Me)return this.scrollToTop(),!0;if(e.key===He)return this.scrollToBottom(),!0}return!(e.key!==Re||!o)&&(this.inputManager.blur(),!0)}registerClickHandler(e,o){const t=this._handlerOrder.indexOf(e);for(-1!==t&&this._handlerOrder.splice(t,1),this._handlerOrder.push(e);this._handlerOrder.length>200;){const e=this._handlerOrder.shift();this.clickHandlers.delete(e)}this.clickHandlers.set(e,o)}unregisterClickHandler(e){this.clickHandlers.delete(e);const o=this._handlerOrder.indexOf(e);-1!==o&&this._handlerOrder.splice(o,1)}handleClick(e,o,t){this.clickMap.isDirty&&this.clickMap.build(this.rootContainer,this.viewport.scrollOffset,this.viewport.terminalHeight);const r=this.clickMap.hitTest(e,o);if(this.debugServer&&this.debugServer.captureEvent("input.click",{x:e,y:o,componentId:r,handled:!!r}),r){const e=this.clickHandlers.get(r);if(e)return this._pressedComponentId=r,e(t),this.inputManager.onInputChange(),!0}return!1}handleRelease(e,o,t){if(!this._pressedComponentId)return!1;const r=this._pressedComponentId;this._pressedComponentId=null,this.debugServer&&this.debugServer.captureEvent("input.release",{x:e,y:o,componentId:r});const l=this.clickHandlers.get(r);return!!l&&(l({...t,action:"left_release"}),this.inputManager.onInputChange(),!0)}handleViewportMouse(e){return!!this.viewport.mouseWheelEnabled&&("wheel_up"===e.action?(this.scrollUp(this.viewport.mouseWheelScrollLines),!0):"wheel_down"===e.action?(this.scrollDown(this.viewport.mouseWheelScrollLines),!0):"left_click"===e.action?this.handleClick(e.x,e.y,e):"left_release"===e.action&&this.handleRelease(e.x,e.y,e))}provideRouter(e){if(!this.app)throw new Error("No app created. Call createApp() first.");this.app.provide(Ce,e)}setupCleanupHandlers(){const e=()=>{this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),process.stdout.write("[?25h"),process.stdout.write("[?1049l")};this.cleanupHandler=e,process.on("exit",this.cleanupHandler),process.on("SIGTERM",()=>{e(),process.exit(0)}),process.on("SIGHUP",()=>{e(),process.exit(0)}),process.on("uncaughtException",o=>{e(),console.error("Uncaught exception:",o),process.exit(1)}),process.on("unhandledRejection",(o,t)=>{e(),console.error("Unhandled rejection at:",t,"reason:",o),process.exit(1)})}createApp(e,o=null){return this.renderer=gt({onUpdate:e=>this.handleUpdate(e),rootContainer:this.rootContainer,beforeRender:e=>{this.debugServer&&this.debugServer.captureEvent("layout.compute",{width:this.viewport.terminalWidth,height:this.viewport.terminalHeight});const o=e.isLayoutDirty||e.childrenDirty;this.layoutEngine.computeLayout(e,this.viewport.terminalWidth,this.viewport.terminalHeight),o&&this.clickMap.invalidate()},afterRender:e=>{this.clickMap.isDirty&&this.clickMap.build(e,this.viewport.scrollOffset,this.viewport.terminalHeight)}}),this.renderer.vuettyInstance=this,this.app=this.renderer.createApp(e,o),this.debugServer&&this.debugServer.interceptVueWarnings(this.app),this.app}mount(){if(!this.app)throw new Error("No app created. Call createApp() first.");let e="";if(e+="[?1049h[2J[H",this.theme?.background){const o=Y(this.theme.background);o&&(e+=`]11;${o}`)}return e+="[?25l",this.viewport.mouseTrackingEnabled&&(e+="[?1000h",e+="[?1006h"),process.stdout.write(e),this.viewport.terminalHeight=process.stdout.rows||24,this.viewport.terminalWidth=process.stdout.columns||80,"reserved"===this.viewport.scrollIndicatorMode&&(this.viewport.terminalHeight-=1),this.logUpdate=new Ft(process.stdout),this.layoutEngine=new ar,this.setupCleanupHandlers(),this.viewportState.width=this.viewport.terminalWidth,this.viewportState.height=this.viewport.terminalHeight,N(this.viewport),this.app.provide(ye,this.inputManager),this.app.provide(ve,this.renderer),this.app.provide(we,this.viewportState),this.app.provide(ke,this),this.app.provide(Se,this.theme),this.app.mount(this.rootContainer),this.inputManager.setVuettyInstance(this),this.inputManager.setViewportHandler(e=>e.action?this.handleViewportMouse(e):this.handleViewportKey(e)),this.inputManager.enable(),this.registerGlobalComponents(),this.resizeHandler=()=>this.handleResize(),process.on("SIGWINCH",this.resizeHandler),this.debugServerConfig?.enabled&&Promise.resolve().then(function(){return Hn}).then(async({DebugServer:e})=>{const{serializeViewport:o}=await Promise.resolve().then(function(){return Ln});this.debugServer=new e(this.debugServerConfig),this.debugServer.setVuettyInstance(this),this.clickMap.setDebugServer(this.debugServer);try{await this.debugServer.start(),this.debugServer.consoleInterceptor?.isActive||console.log(`Debug server running at http://${this.debugServer.config.host}:${this.debugServer.config.port}`),this.debugServer.captureEvent("vuetty.mount",{viewport:o(this.viewport)})}catch(e){console.error("[Vuetty] Failed to start debug server:",e)}}),this}unmount(){return this.pendingScrollRender&&(clearTimeout(this.pendingScrollRender),this.pendingScrollRender=null),this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.inputManager.disable(),this.inputManager.clear(),this.resizeHandler&&(process.removeListener("SIGWINCH",this.resizeHandler),this.resizeHandler=null),this.cleanupHandler&&(process.removeListener("exit",this.cleanupHandler),process.removeListener("SIGTERM",this.cleanupHandler),process.removeListener("SIGHUP",this.cleanupHandler),process.removeListener("uncaughtException",this.cleanupHandler),process.removeListener("unhandledRejection",this.cleanupHandler),this.cleanupHandler=null),this.app&&this.app.unmount(),this.logUpdate&&(this.logUpdate.done(),this.logUpdate=null),this.layoutEngine&&(this.layoutEngine.clearCache(),this.layoutEngine=null),this.clickHandlers.clear(),this._handlerOrder.length=0,this.clickMap&&this.clickMap.clear(),this.rootContainer&&this.rootContainer.cleanup(),this.visibleLinesCache={offset:-1,lines:null,output:null},this.viewport.mouseTrackingEnabled&&(process.stdout.write("[?1006l"),process.stdout.write("[?1000l")),this.debugServer&&(this.debugServer.captureEvent("vuetty.unmount",{}),this.debugServer.stop()),process.stdout.write("]111"),process.stdout.write("[?1049l"),process.stdout.write("[?25h"),this}registerGlobalComponents(){try{Object.entries(Ht).filter(([e,o])=>o&&"object"==typeof o&&o.name&&"function"==typeof o.setup).forEach(([e,o])=>{this.app&&"function"==typeof this.app.component&&this.app.component(o.name,o)})}catch(e){this.debugServer&&this.debugServer.captureEvent("vue.error",{message:"Failed to register global components",error:e.message,stack:e.stack})}}handleUpdate(e){const o=this.currentOutput!==e;this.currentOutput=e,this.visibleLinesCache.output=null,o&&this.clickMap.invalidate(),this.render()}shouldShowScrollIndicator(){const e="reserved"===this.viewport.scrollIndicatorMode?this.viewport.terminalHeight:process.stdout.rows||24;return this.viewport.contentHeight>e}render(){const e=this.currentOutput,o=this.visibleLinesCache;let t;o.output===e&&o.lines?t=o.lines:(t=e.split("\n"),o.output=e,o.lines=t);const r=this.viewport.contentHeight;if(this.viewport.contentHeight=t.length,this.updateMaxScrollOffset(),this.viewport.autoScrollToBottom&&r>0){if(this.viewport.scrollOffset>=Math.max(0,r-this.viewport.terminalHeight)-1&&this.viewport.contentHeight>r){const e=Math.max(0,this.viewport.contentHeight-this.viewport.terminalHeight);this.viewport.scrollOffset=e}}this.clampScrollOffset();const l=this.viewport.scrollOffset,n=Math.min(this.viewport.scrollOffset+this.viewport.terminalHeight,this.viewport.contentHeight),c=t.slice(l,n),a=this.shouldShowScrollIndicator();let s=br(c,this.viewport.terminalWidth,oe,te,this.themeBgCode).join("\n");a&&(s+="\n"+this.getScrollIndicator()),this.logUpdate.render(s),this.clickMap.isDirty?this.clickMap.build(this.rootContainer,this.viewport.scrollOffset,this.viewport.terminalHeight):this.clickMap.regions.length>0&&this.clickMap._scrollOffset!==this.viewport.scrollOffset&&this.clickMap.adjustForScroll(this.viewport.scrollOffset)}getScrollIndicator(){const{scrollOffset:e,contentHeight:o,terminalHeight:t,mouseTrackingEnabled:r}=this.viewport,l=e+1,n=Math.min(e+t,o),c=Math.max(0,o-t),a=c>0?Math.round(e/c*100):0,s=0===e,f=e>=c;let i="";i=s&&f?`Lines ${l}-${n} of ${o}`:s?`[Top] ↓ Lines ${l}-${n} of ${o}`:f?`↑ [Bottom] Lines ${l}-${n} of ${o}`:`↑ ${a}% ↓ Lines ${l}-${n} of ${o}`;i+=(r?" [Scroll]":" [Select]")+" (Alt+M)";const d=oe(i),u=Math.max(0,this.viewport.terminalWidth-d),b=i+" ".repeat(u);return this.themeBgCode?this.themeBgCode+"[2m"+b+"[0m":"[2m"+b+"[0m"}clear(){process.stdout.write("[2J[0f"),this.logUpdate.clear()}getOutput(){return this.currentOutput}updateMaxScrollOffset(){this.viewport.maxScrollOffset=Math.max(0,this.viewport.contentHeight-this.viewport.terminalHeight)}getMemoryStats(){const e={timestamp:Date.now(),caches:{},nodeTree:{},viewport:{},process:{}};this.layoutEngine&&(e.caches.layoutEngine=this.layoutEngine.getStats());try{e.caches.lineCache=function(){let e=0;for(const o of ir.values())e+=o.size;return{widthCacheSize:fr.size,widthCacheMaxSize:2e3,truncateBuckets:ir.size,truncateBucketsMaxSize:5,truncateCacheSize:e,truncateMaxPerBucket:500,maxPossibleMemory:4500}}()}catch(o){e.caches.lineCache={error:o.message}}if(this.clickMap&&(e.caches.clickMap=this.clickMap.getStats?this.clickMap.getStats():{regions:this.clickMap.regions?.length||0,isDirty:this.clickMap.isDirty}),e.caches.clickHandlers=this.clickHandlers?.size||0,this.rootContainer&&(e.nodeTree=this._countNodes(this.rootContainer)),e.viewport={contentHeight:this.viewport.contentHeight,outputLength:this.currentOutput?.length||0,visibleLinesCached:null!==this.visibleLinesCache?.output},"undefined"!=typeof process&&process.memoryUsage){const o=process.memoryUsage();e.process={heapUsedMB:Math.round(o.heapUsed/1024/1024*100)/100,heapTotalMB:Math.round(o.heapTotal/1024/1024*100)/100,rssMB:Math.round(o.rss/1024/1024*100)/100,externalMB:Math.round((o.external||0)/1024/1024*100)/100}}return e}clearAllCaches(){return this.layoutEngine&&this.layoutEngine.clearCache(),hr(),uo.length=0,Lt&&Lt.clear(),Ct.clear(),this.visibleLinesCache={offset:-1,lines:null,output:null},this.rootContainer&&E(this.rootContainer,!0),this.clickMap&&this.clickMap.clear(),this.logUpdate&&this.logUpdate.clear(),"undefined"!=typeof global&&global.gc&&global.gc(),this.getMemoryStats()}_countNodes(e,o=0){if(!e)return{total:0,maxDepth:0,withCache:0,withLayoutCache:0};let t=1,r=o,l=null!==e.cachedOutput?1:0,n=null!==e.cachedLayoutMetrics?1:0;if(e.children)for(const c of e.children){const e=this._countNodes(c,o+1);t+=e.total,r=Math.max(r,e.maxDepth),l+=e.withCache,n+=e.withLayoutCache}return{total:t,maxDepth:r,withCache:l,withLayoutCache:n}}}function vr(e){return new Cr(e)}function wr(e,o={}){const t=new Cr(o);return t.createApp(e),t.mount(),t}const kr={name:"TOMORROW_NIGHT_EIGHTIES",background:"#2d2d2d",foreground:"#cccccc",primary:"#6699cc",secondary:"#000000",success:"#99cc99",warning:"#ffcc66",danger:"#f2777a",info:"#66cccc",components:{box:{color:"#000000",bg:null},textBox:{color:"#cccccc",bg:null},textInput:{color:"#cccccc",bg:"#2d2d2d",focusColor:"#cc99cc",errorColor:"#f2777a"},button:{variants:{primary:{bg:"#6699cc",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#cccccc",bold:!1},danger:{bg:"#f2777a",color:"#ffffff",bold:!0},warning:{bg:"#ffcc66",color:"#ffffff",bold:!0},info:{bg:"#66cccc",color:"#2d2d2d",bold:!1},success:{bg:"#99cc99",color:"#2d2d2d",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#cc99cc",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#cc99cc",unselectedColor:"#000000"}}},Sr={name:"GITHUB_LIGHT",background:"#f6f8fa",foreground:"#1f2328",primary:"#0969da",secondary:"#24292f",success:"#116329",warning:"#4d2d00",danger:"#cf222e",info:"#1b7c83",components:{box:{color:"#24292f",bg:null},textBox:{color:"#1f2328",bg:null},textInput:{color:"#1f2328",bg:"#f6f8fa",focusColor:"#a475f9",errorColor:"#cf222e"},button:{variants:{primary:{bg:"#0969da",color:"#ffffff",bold:!0},secondary:{bg:"#24292f",color:"#1f2328",bold:!1},danger:{bg:"#cf222e",color:"#ffffff",bold:!0},warning:{bg:"#4d2d00",color:"#ffffff",bold:!0},info:{bg:"#1b7c83",color:"#f6f8fa",bold:!1},success:{bg:"#116329",color:"#f6f8fa",bold:!0}}},checkbox:{color:"#24292f",checkedColor:"#a475f9",uncheckedColor:"#24292f"},radiobox:{color:"#24292f",selectedColor:"#a475f9",unselectedColor:"#24292f"}}},_r={name:"DEUS_DEFAULT",background:"#2c323b",foreground:"#eaeaea",primary:"#83a598",secondary:"#242a32",success:"#98c379",warning:"#e5c07b",danger:"#d54e53",info:"#70c0ba",components:{box:{color:"#242a32",bg:null},textBox:{color:"#eaeaea",bg:null},textInput:{color:"#eaeaea",bg:"#2c323b",focusColor:"#c858e9",errorColor:"#d54e53"},button:{variants:{primary:{bg:"#83a598",color:"#ffffff",bold:!0},secondary:{bg:"#242a32",color:"#eaeaea",bold:!1},danger:{bg:"#d54e53",color:"#ffffff",bold:!0},warning:{bg:"#e5c07b",color:"#ffffff",bold:!0},info:{bg:"#70c0ba",color:"#2c323b",bold:!1},success:{bg:"#98c379",color:"#2c323b",bold:!0}}},checkbox:{color:"#242a32",checkedColor:"#c858e9",uncheckedColor:"#242a32"},radiobox:{color:"#242a32",selectedColor:"#c858e9",unselectedColor:"#242a32"}}},Or={name:"DRACULA_SOFT",background:"#282a36",foreground:"#f6f6f4",primary:"#bf9eee",secondary:"#262626",success:"#62e884",warning:"#e7ee98",danger:"#ee6666",info:"#97e1f1",components:{box:{color:"#262626",bg:null},textBox:{color:"#f6f6f4",bg:null},textInput:{color:"#f6f6f4",bg:"#282a36",focusColor:"#f49dda",errorColor:"#ee6666"},button:{variants:{primary:{bg:"#bf9eee",color:"#ffffff",bold:!0},secondary:{bg:"#262626",color:"#f6f6f4",bold:!1},danger:{bg:"#ee6666",color:"#ffffff",bold:!0},warning:{bg:"#e7ee98",color:"#ffffff",bold:!0},info:{bg:"#97e1f1",color:"#282a36",bold:!1},success:{bg:"#62e884",color:"#282a36",bold:!0}}},checkbox:{color:"#262626",checkedColor:"#f49dda",uncheckedColor:"#262626"},radiobox:{color:"#262626",selectedColor:"#f49dda",unselectedColor:"#262626"}}},Ir={name:"GRUVBOX_DARK_SOFT_CONTRAST",background:"#32302f",foreground:"#ebdbb2",primary:"#458588",secondary:"#32302f",success:"#98971a",warning:"#d79921",danger:"#cc241d",info:"#689d6a",components:{box:{color:"#32302f",bg:null},textBox:{color:"#ebdbb2",bg:null},textInput:{color:"#ebdbb2",bg:"#32302f",focusColor:"#d3869b",errorColor:"#cc241d"},button:{variants:{primary:{bg:"#458588",color:"#ffffff",bold:!0},secondary:{bg:"#32302f",color:"#ebdbb2",bold:!1},danger:{bg:"#cc241d",color:"#ffffff",bold:!0},warning:{bg:"#d79921",color:"#ffffff",bold:!0},info:{bg:"#689d6a",color:"#32302f",bold:!1},success:{bg:"#98971a",color:"#32302f",bold:!0}}},checkbox:{color:"#32302f",checkedColor:"#d3869b",uncheckedColor:"#32302f"},radiobox:{color:"#32302f",selectedColor:"#d3869b",unselectedColor:"#32302f"}}},Er={name:"NOCTIS_OBSCURO",background:"#020c0e",foreground:"#b2cacd",primary:"#49ace9",secondary:"#324a4d",success:"#49e9a6",warning:"#e4b781",danger:"#e66533",info:"#49d6e9",components:{box:{color:"#324a4d",bg:null},textBox:{color:"#b2cacd",bg:null},textInput:{color:"#b2cacd",bg:"#020c0e",focusColor:"#e798b3",errorColor:"#e66533"},button:{variants:{primary:{bg:"#49ace9",color:"#ffffff",bold:!0},secondary:{bg:"#324a4d",color:"#b2cacd",bold:!1},danger:{bg:"#e66533",color:"#ffffff",bold:!0},warning:{bg:"#e4b781",color:"#ffffff",bold:!0},info:{bg:"#49d6e9",color:"#020c0e",bold:!1},success:{bg:"#49e9a6",color:"#020c0e",bold:!0}}},checkbox:{color:"#324a4d",checkedColor:"#e798b3",uncheckedColor:"#324a4d"},radiobox:{color:"#324a4d",selectedColor:"#e798b3",unselectedColor:"#324a4d"}}},Tr={name:"GOTHAM_DEFAULT",background:"#0c1014",foreground:"#99d1ce",primary:"#195466",secondary:"#0c1014",success:"#2aa889",warning:"#edb443",danger:"#c23127",info:"#33859e",components:{box:{color:"#0c1014",bg:null},textBox:{color:"#99d1ce",bg:null},textInput:{color:"#99d1ce",bg:"#0c1014",focusColor:"#4e5166",errorColor:"#c23127"},button:{variants:{primary:{bg:"#195466",color:"#ffffff",bold:!0},secondary:{bg:"#0c1014",color:"#99d1ce",bold:!1},danger:{bg:"#c23127",color:"#ffffff",bold:!0},warning:{bg:"#edb443",color:"#ffffff",bold:!0},info:{bg:"#33859e",color:"#0c1014",bold:!1},success:{bg:"#2aa889",color:"#0c1014",bold:!0}}},checkbox:{color:"#0c1014",checkedColor:"#4e5166",uncheckedColor:"#0c1014"},radiobox:{color:"#0c1014",selectedColor:"#4e5166",unselectedColor:"#0c1014"}}},Nr={name:"ZENBONES_TOKYOBONES_LIGHT",background:"#d6d7dc",foreground:"#333a57",primary:"#34548c",secondary:"#d6d7dc",success:"#34645d",warning:"#8f5e14",danger:"#8b4351",info:"#176775",components:{box:{color:"#d6d7dc",bg:null},textBox:{color:"#333a57",bg:null},textInput:{color:"#333a57",bg:"#d6d7dc",focusColor:"#503875",errorColor:"#8b4351"},button:{variants:{primary:{bg:"#34548c",color:"#ffffff",bold:!0},secondary:{bg:"#d6d7dc",color:"#333a57",bold:!1},danger:{bg:"#8b4351",color:"#ffffff",bold:!0},warning:{bg:"#8f5e14",color:"#ffffff",bold:!0},info:{bg:"#176775",color:"#d6d7dc",bold:!1},success:{bg:"#34645d",color:"#d6d7dc",bold:!0}}},checkbox:{color:"#d6d7dc",checkedColor:"#503875",uncheckedColor:"#d6d7dc"},radiobox:{color:"#d6d7dc",selectedColor:"#503875",unselectedColor:"#d6d7dc"}}},Ar={name:"NOCTIS_HIBERNUS",background:"#e1eeef",foreground:"#005661",primary:"#0094f0",secondary:"#003b42",success:"#00b368",warning:"#f49725",danger:"#e34e1c",info:"#00bdd6",components:{box:{color:"#003b42",bg:null},textBox:{color:"#005661",bg:null},textInput:{color:"#005661",bg:"#e1eeef",focusColor:"#ff6b9f",errorColor:"#e34e1c"},button:{variants:{primary:{bg:"#0094f0",color:"#ffffff",bold:!0},secondary:{bg:"#003b42",color:"#005661",bold:!1},danger:{bg:"#e34e1c",color:"#ffffff",bold:!0},warning:{bg:"#f49725",color:"#ffffff",bold:!0},info:{bg:"#00bdd6",color:"#e1eeef",bold:!1},success:{bg:"#00b368",color:"#e1eeef",bold:!0}}},checkbox:{color:"#003b42",checkedColor:"#ff6b9f",uncheckedColor:"#003b42"},radiobox:{color:"#003b42",selectedColor:"#ff6b9f",unselectedColor:"#003b42"}}},Br={name:"GRUVBOX_LIGHT_SOFT_CONTRAST",background:"#f2e5bc",foreground:"#3c3836",primary:"#458588",secondary:"#f2e5bc",success:"#98971a",warning:"#d79921",danger:"#cc241d",info:"#689d6a",components:{box:{color:"#f2e5bc",bg:null},textBox:{color:"#3c3836",bg:null},textInput:{color:"#3c3836",bg:"#f2e5bc",focusColor:"#8f3f71",errorColor:"#cc241d"},button:{variants:{primary:{bg:"#458588",color:"#ffffff",bold:!0},secondary:{bg:"#f2e5bc",color:"#3c3836",bold:!1},danger:{bg:"#cc241d",color:"#ffffff",bold:!0},warning:{bg:"#d79921",color:"#ffffff",bold:!0},info:{bg:"#689d6a",color:"#f2e5bc",bold:!1},success:{bg:"#98971a",color:"#f2e5bc",bold:!0}}},checkbox:{color:"#f2e5bc",checkedColor:"#8f3f71",uncheckedColor:"#f2e5bc"},radiobox:{color:"#f2e5bc",selectedColor:"#8f3f71",unselectedColor:"#f2e5bc"}}},Lr={name:"SONOKAI_ATLANTIS",background:"#2a2f38",foreground:"#e1e3e4",primary:"#72cce8",secondary:"#181a1c",success:"#9dd274",warning:"#eacb64",danger:"#ff6578",info:"#f69c5e",components:{box:{color:"#181a1c",bg:null},textBox:{color:"#e1e3e4",bg:null},textInput:{color:"#e1e3e4",bg:"#2a2f38",focusColor:"#ba9cf3",errorColor:"#ff6578"},button:{variants:{primary:{bg:"#72cce8",color:"#ffffff",bold:!0},secondary:{bg:"#181a1c",color:"#e1e3e4",bold:!1},danger:{bg:"#ff6578",color:"#ffffff",bold:!0},warning:{bg:"#eacb64",color:"#ffffff",bold:!0},info:{bg:"#f69c5e",color:"#2a2f38",bold:!1},success:{bg:"#9dd274",color:"#2a2f38",bold:!0}}},checkbox:{color:"#181a1c",checkedColor:"#ba9cf3",uncheckedColor:"#181a1c"},radiobox:{color:"#181a1c",selectedColor:"#ba9cf3",unselectedColor:"#181a1c"}}},Rr={name:"TOKYO_NIGHT_DAY",background:"#e1e2e7",foreground:"#3760bf",primary:"#2e7de9",secondary:"#b4b5b9",success:"#587539",warning:"#8c6c3e",danger:"#f52a65",info:"#007197",components:{box:{color:"#b4b5b9",bg:null},textBox:{color:"#3760bf",bg:null},textInput:{color:"#3760bf",bg:"#e1e2e7",focusColor:"#9854f1",errorColor:"#f52a65"},button:{variants:{primary:{bg:"#2e7de9",color:"#ffffff",bold:!0},secondary:{bg:"#b4b5b9",color:"#3760bf",bold:!1},danger:{bg:"#f52a65",color:"#ffffff",bold:!0},warning:{bg:"#8c6c3e",color:"#ffffff",bold:!0},info:{bg:"#007197",color:"#e1e2e7",bold:!1},success:{bg:"#587539",color:"#e1e2e7",bold:!0}}},checkbox:{color:"#b4b5b9",checkedColor:"#9854f1",uncheckedColor:"#b4b5b9"},radiobox:{color:"#b4b5b9",selectedColor:"#9854f1",unselectedColor:"#b4b5b9"}}},Mr={name:"ZENBONES_TOKYOBONES_DARK",background:"#1a1b26",foreground:"#c0caf5",primary:"#7ba2f7",secondary:"#1a1b26",success:"#74dbcb",warning:"#e1b068",danger:"#f77890",info:"#2bc4de",components:{box:{color:"#1a1b26",bg:null},textBox:{color:"#c0caf5",bg:null},textInput:{color:"#c0caf5",bg:"#1a1b26",focusColor:"#c6acfa",errorColor:"#f77890"},button:{variants:{primary:{bg:"#7ba2f7",color:"#ffffff",bold:!0},secondary:{bg:"#1a1b26",color:"#c0caf5",bold:!1},danger:{bg:"#f77890",color:"#ffffff",bold:!0},warning:{bg:"#e1b068",color:"#ffffff",bold:!0},info:{bg:"#2bc4de",color:"#1a1b26",bold:!1},success:{bg:"#74dbcb",color:"#1a1b26",bold:!0}}},checkbox:{color:"#1a1b26",checkedColor:"#c6acfa",uncheckedColor:"#1a1b26"},radiobox:{color:"#1a1b26",selectedColor:"#c6acfa",unselectedColor:"#1a1b26"}}},Hr={name:"TOMORROW_DEFAULT",background:"#ffffff",foreground:"#4d4d4c",primary:"#4271ae",secondary:"#000000",success:"#718c00",warning:"#eab700",danger:"#c82829",info:"#3e999f",components:{box:{color:"#000000",bg:null},textBox:{color:"#4d4d4c",bg:null},textInput:{color:"#4d4d4c",bg:"#ffffff",focusColor:"#8959a8",errorColor:"#c82829"},button:{variants:{primary:{bg:"#4271ae",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#4d4d4c",bold:!1},danger:{bg:"#c82829",color:"#ffffff",bold:!0},warning:{bg:"#eab700",color:"#ffffff",bold:!0},info:{bg:"#3e999f",color:"#ffffff",bold:!1},success:{bg:"#718c00",color:"#ffffff",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#8959a8",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#8959a8",unselectedColor:"#000000"}}},Dr={name:"NIGHTFOX_DAWNFOX",background:"#faf4ed",foreground:"#575279",primary:"#286983",secondary:"#575279",success:"#618774",warning:"#ea9d34",danger:"#b4637a",info:"#56949f",components:{box:{color:"#575279",bg:null},textBox:{color:"#575279",bg:null},textInput:{color:"#575279",bg:"#faf4ed",focusColor:"#9a80b9",errorColor:"#b4637a"},button:{variants:{primary:{bg:"#286983",color:"#ffffff",bold:!0},secondary:{bg:"#575279",color:"#575279",bold:!1},danger:{bg:"#b4637a",color:"#ffffff",bold:!0},warning:{bg:"#ea9d34",color:"#ffffff",bold:!0},info:{bg:"#56949f",color:"#faf4ed",bold:!1},success:{bg:"#618774",color:"#faf4ed",bold:!0}}},checkbox:{color:"#575279",checkedColor:"#9a80b9",uncheckedColor:"#575279"},radiobox:{color:"#575279",selectedColor:"#9a80b9",unselectedColor:"#575279"}}},Fr={name:"ZENBONES_ROSEBONES_LIGHT",background:"#fbf6f0",foreground:"#724341",primary:"#5795a0",secondary:"#fbf6f0",success:"#286a84",warning:"#ec9d33",danger:"#b5637a",info:"#5795a0",components:{box:{color:"#fbf6f0",bg:null},textBox:{color:"#724341",bg:null},textInput:{color:"#724341",bg:"#fbf6f0",focusColor:"#855aac",errorColor:"#b5637a"},button:{variants:{primary:{bg:"#5795a0",color:"#ffffff",bold:!0},secondary:{bg:"#fbf6f0",color:"#724341",bold:!1},danger:{bg:"#b5637a",color:"#ffffff",bold:!0},warning:{bg:"#ec9d33",color:"#ffffff",bold:!0},info:{bg:"#5795a0",color:"#fbf6f0",bold:!1},success:{bg:"#286a84",color:"#fbf6f0",bold:!0}}},checkbox:{color:"#fbf6f0",checkedColor:"#855aac",uncheckedColor:"#fbf6f0"},radiobox:{color:"#fbf6f0",selectedColor:"#855aac",unselectedColor:"#fbf6f0"}}},Gr={name:"PANDA_DEFAULT",background:"#292a2b",foreground:"#cccccc",primary:"#45a9f9",secondary:"#000000",success:"#19f9d8",warning:"#ffb86c",danger:"#ff2c6d",info:"#b084eb",components:{box:{color:"#000000",bg:null},textBox:{color:"#cccccc",bg:null},textInput:{color:"#cccccc",bg:"#292a2b",focusColor:"#ff9ac1",errorColor:"#ff2c6d"},button:{variants:{primary:{bg:"#45a9f9",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#cccccc",bold:!1},danger:{bg:"#ff2c6d",color:"#ffffff",bold:!0},warning:{bg:"#ffb86c",color:"#ffffff",bold:!0},info:{bg:"#b084eb",color:"#292a2b",bold:!1},success:{bg:"#19f9d8",color:"#292a2b",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#ff9ac1",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#ff9ac1",unselectedColor:"#000000"}}},Ur={name:"SOLARIZED_DARK",background:"#002b36",foreground:"#839496",primary:"#268bd2",secondary:"#073642",success:"#859900",warning:"#b58900",danger:"#dc322f",info:"#2aa198",components:{box:{color:"#073642",bg:null},textBox:{color:"#839496",bg:null},textInput:{color:"#839496",bg:"#002b36",focusColor:"#6c71c4",errorColor:"#dc322f"},button:{variants:{primary:{bg:"#268bd2",color:"#ffffff",bold:!0},secondary:{bg:"#073642",color:"#839496",bold:!1},danger:{bg:"#dc322f",color:"#ffffff",bold:!0},warning:{bg:"#b58900",color:"#ffffff",bold:!0},info:{bg:"#2aa198",color:"#002b36",bold:!1},success:{bg:"#859900",color:"#002b36",bold:!0}}},checkbox:{color:"#073642",checkedColor:"#6c71c4",uncheckedColor:"#073642"},radiobox:{color:"#073642",selectedColor:"#6c71c4",unselectedColor:"#073642"}}},Wr={name:"NORD_DEFAULT",background:"#2e3440",foreground:"#d8dee9",primary:"#81a1c1",secondary:"#3b4252",success:"#a3be8c",warning:"#ebcb8b",danger:"#bf616a",info:"#88c0d0",components:{box:{color:"#3b4252",bg:null},textBox:{color:"#d8dee9",bg:null},textInput:{color:"#d8dee9",bg:"#2e3440",focusColor:"#b48ead",errorColor:"#bf616a"},button:{variants:{primary:{bg:"#81a1c1",color:"#ffffff",bold:!0},secondary:{bg:"#3b4252",color:"#d8dee9",bold:!1},danger:{bg:"#bf616a",color:"#ffffff",bold:!0},warning:{bg:"#ebcb8b",color:"#ffffff",bold:!0},info:{bg:"#88c0d0",color:"#2e3440",bold:!1},success:{bg:"#a3be8c",color:"#2e3440",bold:!0}}},checkbox:{color:"#3b4252",checkedColor:"#b48ead",uncheckedColor:"#3b4252"},radiobox:{color:"#3b4252",selectedColor:"#b48ead",unselectedColor:"#3b4252"}}},Pr={name:"NIGHTFOX_TERAFOX",background:"#152528",foreground:"#e6eaea",primary:"#5a93aa",secondary:"#2f3239",success:"#7aa4a1",warning:"#fda47f",danger:"#e85c51",info:"#a1cdd8",components:{box:{color:"#2f3239",bg:null},textBox:{color:"#e6eaea",bg:null},textInput:{color:"#e6eaea",bg:"#152528",focusColor:"#b97490",errorColor:"#e85c51"},button:{variants:{primary:{bg:"#5a93aa",color:"#ffffff",bold:!0},secondary:{bg:"#2f3239",color:"#e6eaea",bold:!1},danger:{bg:"#e85c51",color:"#ffffff",bold:!0},warning:{bg:"#fda47f",color:"#ffffff",bold:!0},info:{bg:"#a1cdd8",color:"#152528",bold:!1},success:{bg:"#7aa4a1",color:"#152528",bold:!0}}},checkbox:{color:"#2f3239",checkedColor:"#b97490",uncheckedColor:"#2f3239"},radiobox:{color:"#2f3239",selectedColor:"#b97490",unselectedColor:"#2f3239"}}},$r={name:"MIASMA_DEFAULT",background:"#222222",foreground:"#c2c2b0",primary:"#78824b",secondary:"#000000",success:"#5f875f",warning:"#b36d43",danger:"#685742",info:"#c9a554",components:{box:{color:"#000000",bg:null},textBox:{color:"#c2c2b0",bg:null},textInput:{color:"#c2c2b0",bg:"#222222",focusColor:"#bb7744",errorColor:"#685742"},button:{variants:{primary:{bg:"#78824b",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#c2c2b0",bold:!1},danger:{bg:"#685742",color:"#ffffff",bold:!0},warning:{bg:"#b36d43",color:"#ffffff",bold:!0},info:{bg:"#c9a554",color:"#222222",bold:!1},success:{bg:"#5f875f",color:"#222222",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#bb7744",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#bb7744",unselectedColor:"#000000"}}},zr={name:"SEOUL256_DARK",background:"#3a3a3a",foreground:"#d0d0d0",primary:"#85add4",secondary:"#4e4e4e",success:"#5f865f",warning:"#d8af5f",danger:"#d68787",info:"#87afaf",components:{box:{color:"#4e4e4e",bg:null},textBox:{color:"#d0d0d0",bg:null},textInput:{color:"#d0d0d0",bg:"#3a3a3a",focusColor:"#ffafaf",errorColor:"#d68787"},button:{variants:{primary:{bg:"#85add4",color:"#ffffff",bold:!0},secondary:{bg:"#4e4e4e",color:"#d0d0d0",bold:!1},danger:{bg:"#d68787",color:"#ffffff",bold:!0},warning:{bg:"#d8af5f",color:"#ffffff",bold:!0},info:{bg:"#87afaf",color:"#3a3a3a",bold:!1},success:{bg:"#5f865f",color:"#3a3a3a",bold:!0}}},checkbox:{color:"#4e4e4e",checkedColor:"#ffafaf",uncheckedColor:"#4e4e4e"},radiobox:{color:"#4e4e4e",selectedColor:"#ffafaf",unselectedColor:"#4e4e4e"}}},Kr={name:"GITHUB_LIGHT_LEGACY",background:"#f6f8fa",foreground:"#586069",primary:"#0366d6",secondary:"#24292e",success:"#28a745",warning:"#dbab09",danger:"#d73a49",info:"#1b7c83",components:{box:{color:"#24292e",bg:null},textBox:{color:"#586069",bg:null},textInput:{color:"#586069",bg:"#f6f8fa",focusColor:"#5a32a3",errorColor:"#d73a49"},button:{variants:{primary:{bg:"#0366d6",color:"#ffffff",bold:!0},secondary:{bg:"#24292e",color:"#586069",bold:!1},danger:{bg:"#d73a49",color:"#ffffff",bold:!0},warning:{bg:"#dbab09",color:"#ffffff",bold:!0},info:{bg:"#1b7c83",color:"#f6f8fa",bold:!1},success:{bg:"#28a745",color:"#f6f8fa",bold:!0}}},checkbox:{color:"#24292e",checkedColor:"#5a32a3",uncheckedColor:"#24292e"},radiobox:{color:"#24292e",selectedColor:"#5a32a3",unselectedColor:"#24292e"}}},jr={name:"ONE_HALF_DARK",background:"#282c34",foreground:"#dcdfe4",primary:"#61afef",secondary:"#282c34",success:"#98c379",warning:"#e5c07b",danger:"#e06c75",info:"#56b6c2",components:{box:{color:"#282c34",bg:null},textBox:{color:"#dcdfe4",bg:null},textInput:{color:"#dcdfe4",bg:"#282c34",focusColor:"#c678dd",errorColor:"#e06c75"},button:{variants:{primary:{bg:"#61afef",color:"#ffffff",bold:!0},secondary:{bg:"#282c34",color:"#dcdfe4",bold:!1},danger:{bg:"#e06c75",color:"#ffffff",bold:!0},warning:{bg:"#e5c07b",color:"#ffffff",bold:!0},info:{bg:"#56b6c2",color:"#282c34",bold:!1},success:{bg:"#98c379",color:"#282c34",bold:!0}}},checkbox:{color:"#282c34",checkedColor:"#c678dd",uncheckedColor:"#282c34"},radiobox:{color:"#282c34",selectedColor:"#c678dd",unselectedColor:"#282c34"}}},Vr={name:"ICEBERG_LIGHT",background:"#e8e9ec",foreground:"#33374c",primary:"#2d539e",secondary:"#dcdfe7",success:"#668e3d",warning:"#c57339",danger:"#cc517a",info:"#3f83a6",components:{box:{color:"#dcdfe7",bg:null},textBox:{color:"#33374c",bg:null},textInput:{color:"#33374c",bg:"#e8e9ec",focusColor:"#6845ad",errorColor:"#cc517a"},button:{variants:{primary:{bg:"#2d539e",color:"#ffffff",bold:!0},secondary:{bg:"#dcdfe7",color:"#33374c",bold:!1},danger:{bg:"#cc517a",color:"#ffffff",bold:!0},warning:{bg:"#c57339",color:"#ffffff",bold:!0},info:{bg:"#3f83a6",color:"#e8e9ec",bold:!1},success:{bg:"#668e3d",color:"#e8e9ec",bold:!0}}},checkbox:{color:"#dcdfe7",checkedColor:"#6845ad",uncheckedColor:"#dcdfe7"},radiobox:{color:"#dcdfe7",selectedColor:"#6845ad",unselectedColor:"#dcdfe7"}}},Yr={name:"SRCERY_DEFAULT",background:"#1c1b19",foreground:"#fce8c3",primary:"#2c78bf",secondary:"#1c1b19",success:"#519f50",warning:"#fbb829",danger:"#ef2f27",info:"#0aaeb3",components:{box:{color:"#1c1b19",bg:null},textBox:{color:"#fce8c3",bg:null},textInput:{color:"#fce8c3",bg:"#1c1b19",focusColor:"#ff5c8f",errorColor:"#ef2f27"},button:{variants:{primary:{bg:"#2c78bf",color:"#ffffff",bold:!0},secondary:{bg:"#1c1b19",color:"#fce8c3",bold:!1},danger:{bg:"#ef2f27",color:"#ffffff",bold:!0},warning:{bg:"#fbb829",color:"#ffffff",bold:!0},info:{bg:"#0aaeb3",color:"#1c1b19",bold:!1},success:{bg:"#519f50",color:"#1c1b19",bold:!0}}},checkbox:{color:"#1c1b19",checkedColor:"#ff5c8f",uncheckedColor:"#1c1b19"},radiobox:{color:"#1c1b19",selectedColor:"#ff5c8f",unselectedColor:"#1c1b19"}}},Xr={name:"TOMORROW_NIGHT",background:"#1d1f21",foreground:"#c5c8c6",primary:"#81a2be",secondary:"#000000",success:"#b5bd68",warning:"#f0c674",danger:"#cc6666",info:"#8abeb7",components:{box:{color:"#000000",bg:null},textBox:{color:"#c5c8c6",bg:null},textInput:{color:"#c5c8c6",bg:"#1d1f21",focusColor:"#b294bb",errorColor:"#cc6666"},button:{variants:{primary:{bg:"#81a2be",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#c5c8c6",bold:!1},danger:{bg:"#cc6666",color:"#ffffff",bold:!0},warning:{bg:"#f0c674",color:"#ffffff",bold:!0},info:{bg:"#8abeb7",color:"#1d1f21",bold:!1},success:{bg:"#b5bd68",color:"#1d1f21",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#b294bb",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#b294bb",unselectedColor:"#000000"}}},Zr={name:"ZENBONES_NEOBONES_LIGHT",background:"#e5ede6",foreground:"#202e18",primary:"#286486",secondary:"#e5ede6",success:"#567a30",warning:"#944927",danger:"#a8334c",info:"#3b8992",components:{box:{color:"#e5ede6",bg:null},textBox:{color:"#202e18",bg:null},textInput:{color:"#202e18",bg:"#e5ede6",focusColor:"#7b3b70",errorColor:"#a8334c"},button:{variants:{primary:{bg:"#286486",color:"#ffffff",bold:!0},secondary:{bg:"#e5ede6",color:"#202e18",bold:!1},danger:{bg:"#a8334c",color:"#ffffff",bold:!0},warning:{bg:"#944927",color:"#ffffff",bold:!0},info:{bg:"#3b8992",color:"#e5ede6",bold:!1},success:{bg:"#567a30",color:"#e5ede6",bold:!0}}},checkbox:{color:"#e5ede6",checkedColor:"#7b3b70",uncheckedColor:"#e5ede6"},radiobox:{color:"#e5ede6",selectedColor:"#7b3b70",unselectedColor:"#e5ede6"}}},Jr={name:"KANAGAWA_WAVE",background:"#1f1f28",foreground:"#dcd7ba",primary:"#7e9cd8",secondary:"#16161d",success:"#76946a",warning:"#c0a36e",danger:"#c34043",info:"#6a9589",components:{box:{color:"#16161d",bg:null},textBox:{color:"#dcd7ba",bg:null},textInput:{color:"#dcd7ba",bg:"#1f1f28",focusColor:"#938aa9",errorColor:"#c34043"},button:{variants:{primary:{bg:"#7e9cd8",color:"#ffffff",bold:!0},secondary:{bg:"#16161d",color:"#dcd7ba",bold:!1},danger:{bg:"#c34043",color:"#ffffff",bold:!0},warning:{bg:"#c0a36e",color:"#ffffff",bold:!0},info:{bg:"#6a9589",color:"#1f1f28",bold:!1},success:{bg:"#76946a",color:"#1f1f28",bold:!0}}},checkbox:{color:"#16161d",checkedColor:"#938aa9",uncheckedColor:"#16161d"},radiobox:{color:"#16161d",selectedColor:"#938aa9",unselectedColor:"#16161d"}}},qr={name:"NIGHTFOX_NORDFOX",background:"#2e3440",foreground:"#cdcecf",primary:"#81a1c1",secondary:"#3b4252",success:"#a3be8c",warning:"#ebcb8b",danger:"#bf616a",info:"#88c0d0",components:{box:{color:"#3b4252",bg:null},textBox:{color:"#cdcecf",bg:null},textInput:{color:"#cdcecf",bg:"#2e3440",focusColor:"#c895bf",errorColor:"#bf616a"},button:{variants:{primary:{bg:"#81a1c1",color:"#ffffff",bold:!0},secondary:{bg:"#3b4252",color:"#cdcecf",bold:!1},danger:{bg:"#bf616a",color:"#ffffff",bold:!0},warning:{bg:"#ebcb8b",color:"#ffffff",bold:!0},info:{bg:"#88c0d0",color:"#2e3440",bold:!1},success:{bg:"#a3be8c",color:"#2e3440",bold:!0}}},checkbox:{color:"#3b4252",checkedColor:"#c895bf",uncheckedColor:"#3b4252"},radiobox:{color:"#3b4252",selectedColor:"#c895bf",unselectedColor:"#3b4252"}}},Qr={name:"ZENBONES_DUCKBONES",background:"#0e101a",foreground:"#ebefc0",primary:"#00a3cb",secondary:"#0e101a",success:"#5dcd97",warning:"#e39500",danger:"#e03600",info:"#00a3cb",components:{box:{color:"#0e101a",bg:null},textBox:{color:"#ebefc0",bg:null},textInput:{color:"#ebefc0",bg:"#0e101a",focusColor:"#b3a1e6",errorColor:"#e03600"},button:{variants:{primary:{bg:"#00a3cb",color:"#ffffff",bold:!0},secondary:{bg:"#0e101a",color:"#ebefc0",bold:!1},danger:{bg:"#e03600",color:"#ffffff",bold:!0},warning:{bg:"#e39500",color:"#ffffff",bold:!0},info:{bg:"#00a3cb",color:"#0e101a",bold:!1},success:{bg:"#5dcd97",color:"#0e101a",bold:!0}}},checkbox:{color:"#0e101a",checkedColor:"#b3a1e6",uncheckedColor:"#0e101a"},radiobox:{color:"#0e101a",selectedColor:"#b3a1e6",unselectedColor:"#0e101a"}}},el={name:"SONOKAI_DEFAULT",background:"#2c2e34",foreground:"#e2e2e3",primary:"#76cce0",secondary:"#181819",success:"#9ed072",warning:"#e7c664",danger:"#fc5d7c",info:"#f39660",components:{box:{color:"#181819",bg:null},textBox:{color:"#e2e2e3",bg:null},textInput:{color:"#e2e2e3",bg:"#2c2e34",focusColor:"#b39df3",errorColor:"#fc5d7c"},button:{variants:{primary:{bg:"#76cce0",color:"#ffffff",bold:!0},secondary:{bg:"#181819",color:"#e2e2e3",bold:!1},danger:{bg:"#fc5d7c",color:"#ffffff",bold:!0},warning:{bg:"#e7c664",color:"#ffffff",bold:!0},info:{bg:"#f39660",color:"#2c2e34",bold:!1},success:{bg:"#9ed072",color:"#2c2e34",bold:!0}}},checkbox:{color:"#181819",checkedColor:"#b39df3",uncheckedColor:"#181819"},radiobox:{color:"#181819",selectedColor:"#b39df3",unselectedColor:"#181819"}}},ol={name:"GRUVBOX_LIGHT_HARD_CONTRAST",background:"#f9f5d7",foreground:"#3c3836",primary:"#458588",secondary:"#f9f5d7",success:"#98971a",warning:"#d79921",danger:"#cc241d",info:"#689d6a",components:{box:{color:"#f9f5d7",bg:null},textBox:{color:"#3c3836",bg:null},textInput:{color:"#3c3836",bg:"#f9f5d7",focusColor:"#8f3f71",errorColor:"#cc241d"},button:{variants:{primary:{bg:"#458588",color:"#ffffff",bold:!0},secondary:{bg:"#f9f5d7",color:"#3c3836",bold:!1},danger:{bg:"#cc241d",color:"#ffffff",bold:!0},warning:{bg:"#d79921",color:"#ffffff",bold:!0},info:{bg:"#689d6a",color:"#f9f5d7",bold:!1},success:{bg:"#98971a",color:"#f9f5d7",bold:!0}}},checkbox:{color:"#f9f5d7",checkedColor:"#8f3f71",uncheckedColor:"#f9f5d7"},radiobox:{color:"#f9f5d7",selectedColor:"#8f3f71",unselectedColor:"#f9f5d7"}}},tl={name:"SONOKAI_ESPRESSO",background:"#312c2b",foreground:"#e4e3e1",primary:"#81d0c9",secondary:"#1f1e1c",success:"#a6cd77",warning:"#f0c66f",danger:"#f86882",info:"#f08d71",components:{box:{color:"#1f1e1c",bg:null},textBox:{color:"#e4e3e1",bg:null},textInput:{color:"#e4e3e1",bg:"#312c2b",focusColor:"#9fa0e1",errorColor:"#f86882"},button:{variants:{primary:{bg:"#81d0c9",color:"#ffffff",bold:!0},secondary:{bg:"#1f1e1c",color:"#e4e3e1",bold:!1},danger:{bg:"#f86882",color:"#ffffff",bold:!0},warning:{bg:"#f0c66f",color:"#ffffff",bold:!0},info:{bg:"#f08d71",color:"#312c2b",bold:!1},success:{bg:"#a6cd77",color:"#312c2b",bold:!0}}},checkbox:{color:"#1f1e1c",checkedColor:"#9fa0e1",uncheckedColor:"#1f1e1c"},radiobox:{color:"#1f1e1c",selectedColor:"#9fa0e1",unselectedColor:"#1f1e1c"}}},rl={name:"TOKYO_NIGHT_STORM",background:"#24283b",foreground:"#c0caf5",primary:"#7aa2f7",secondary:"#1d202f",success:"#9ece6a",warning:"#e0af68",danger:"#f7768e",info:"#7dcfff",components:{box:{color:"#1d202f",bg:null},textBox:{color:"#c0caf5",bg:null},textInput:{color:"#c0caf5",bg:"#24283b",focusColor:"#bb9af7",errorColor:"#f7768e"},button:{variants:{primary:{bg:"#7aa2f7",color:"#ffffff",bold:!0},secondary:{bg:"#1d202f",color:"#c0caf5",bold:!1},danger:{bg:"#f7768e",color:"#ffffff",bold:!0},warning:{bg:"#e0af68",color:"#ffffff",bold:!0},info:{bg:"#7dcfff",color:"#24283b",bold:!1},success:{bg:"#9ece6a",color:"#24283b",bold:!0}}},checkbox:{color:"#1d202f",checkedColor:"#bb9af7",uncheckedColor:"#1d202f"},radiobox:{color:"#1d202f",selectedColor:"#bb9af7",unselectedColor:"#1d202f"}}},ll={name:"SONOKAI_SHUSIA",background:"#2d2a2e",foreground:"#e3e1e4",primary:"#7accd7",secondary:"#1a181a",success:"#9ecd6f",warning:"#e5c463",danger:"#f85e84",info:"#ef9062",components:{box:{color:"#1a181a",bg:null},textBox:{color:"#e3e1e4",bg:null},textInput:{color:"#e3e1e4",bg:"#2d2a2e",focusColor:"#ab9df2",errorColor:"#f85e84"},button:{variants:{primary:{bg:"#7accd7",color:"#ffffff",bold:!0},secondary:{bg:"#1a181a",color:"#e3e1e4",bold:!1},danger:{bg:"#f85e84",color:"#ffffff",bold:!0},warning:{bg:"#e5c463",color:"#ffffff",bold:!0},info:{bg:"#ef9062",color:"#2d2a2e",bold:!1},success:{bg:"#9ecd6f",color:"#2d2a2e",bold:!0}}},checkbox:{color:"#1a181a",checkedColor:"#ab9df2",uncheckedColor:"#1a181a"},radiobox:{color:"#1a181a",selectedColor:"#ab9df2",unselectedColor:"#1a181a"}}},nl={name:"AYU_MIRAGE",background:"#1f2430",foreground:"#cccac2",primary:"#6dcbfa",secondary:"#171b24",success:"#87d96c",warning:"#facc6e",danger:"#ed8274",info:"#90e1c6",components:{box:{color:"#171b24",bg:null},textBox:{color:"#cccac2",bg:null},textInput:{color:"#cccac2",bg:"#1f2430",focusColor:"#dfbfff",errorColor:"#ed8274"},button:{variants:{primary:{bg:"#6dcbfa",color:"#ffffff",bold:!0},secondary:{bg:"#171b24",color:"#cccac2",bold:!1},danger:{bg:"#ed8274",color:"#ffffff",bold:!0},warning:{bg:"#facc6e",color:"#ffffff",bold:!0},info:{bg:"#90e1c6",color:"#1f2430",bold:!1},success:{bg:"#87d96c",color:"#1f2430",bold:!0}}},checkbox:{color:"#171b24",checkedColor:"#dfbfff",uncheckedColor:"#171b24"},radiobox:{color:"#171b24",selectedColor:"#dfbfff",unselectedColor:"#171b24"}}},cl={name:"ZENBONES_VIMBONES",background:"#f0f0ca",foreground:"#353535",primary:"#286486",secondary:"#f0f0ca",success:"#4f6c31",warning:"#944927",danger:"#a8334c",info:"#3b8992",components:{box:{color:"#f0f0ca",bg:null},textBox:{color:"#353535",bg:null},textInput:{color:"#353535",bg:"#f0f0ca",focusColor:"#7b3b70",errorColor:"#a8334c"},button:{variants:{primary:{bg:"#286486",color:"#ffffff",bold:!0},secondary:{bg:"#f0f0ca",color:"#353535",bold:!1},danger:{bg:"#a8334c",color:"#ffffff",bold:!0},warning:{bg:"#944927",color:"#ffffff",bold:!0},info:{bg:"#3b8992",color:"#f0f0ca",bold:!1},success:{bg:"#4f6c31",color:"#f0f0ca",bold:!0}}},checkbox:{color:"#f0f0ca",checkedColor:"#7b3b70",uncheckedColor:"#f0f0ca"},radiobox:{color:"#f0f0ca",selectedColor:"#7b3b70",unselectedColor:"#f0f0ca"}}},al={name:"SONOKAI_ANDROMEDA",background:"#2b2d3a",foreground:"#e1e3e4",primary:"#6dcae8",secondary:"#181a1c",success:"#9ed06c",warning:"#edc763",danger:"#fb617e",info:"#f89860",components:{box:{color:"#181a1c",bg:null},textBox:{color:"#e1e3e4",bg:null},textInput:{color:"#e1e3e4",bg:"#2b2d3a",focusColor:"#bb97ee",errorColor:"#fb617e"},button:{variants:{primary:{bg:"#6dcae8",color:"#ffffff",bold:!0},secondary:{bg:"#181a1c",color:"#e1e3e4",bold:!1},danger:{bg:"#fb617e",color:"#ffffff",bold:!0},warning:{bg:"#edc763",color:"#ffffff",bold:!0},info:{bg:"#f89860",color:"#2b2d3a",bold:!1},success:{bg:"#9ed06c",color:"#2b2d3a",bold:!0}}},checkbox:{color:"#181a1c",checkedColor:"#bb97ee",uncheckedColor:"#181a1c"},radiobox:{color:"#181a1c",selectedColor:"#bb97ee",unselectedColor:"#181a1c"}}},sl={name:"NOCTIS_DEFAULT",background:"#03191b",foreground:"#b2cacd",primary:"#49ace9",secondary:"#324a4d",success:"#49e9a6",warning:"#e4b781",danger:"#e66533",info:"#49d6e9",components:{box:{color:"#324a4d",bg:null},textBox:{color:"#b2cacd",bg:null},textInput:{color:"#b2cacd",bg:"#03191b",focusColor:"#e798b3",errorColor:"#e66533"},button:{variants:{primary:{bg:"#49ace9",color:"#ffffff",bold:!0},secondary:{bg:"#324a4d",color:"#b2cacd",bold:!1},danger:{bg:"#e66533",color:"#ffffff",bold:!0},warning:{bg:"#e4b781",color:"#ffffff",bold:!0},info:{bg:"#49d6e9",color:"#03191b",bold:!1},success:{bg:"#49e9a6",color:"#03191b",bold:!0}}},checkbox:{color:"#324a4d",checkedColor:"#e798b3",uncheckedColor:"#324a4d"},radiobox:{color:"#324a4d",selectedColor:"#e798b3",unselectedColor:"#324a4d"}}},fl={name:"AYU_LIGHT",background:"#f8f9fa",foreground:"#5c6166",primary:"#3199e1",secondary:"#000000",success:"#6cbf43",warning:"#eca944",danger:"#ea6c6d",info:"#46ba94",components:{box:{color:"#000000",bg:null},textBox:{color:"#5c6166",bg:null},textInput:{color:"#5c6166",bg:"#f8f9fa",focusColor:"#a37acc",errorColor:"#ea6c6d"},button:{variants:{primary:{bg:"#3199e1",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#5c6166",bold:!1},danger:{bg:"#ea6c6d",color:"#ffffff",bold:!0},warning:{bg:"#eca944",color:"#ffffff",bold:!0},info:{bg:"#46ba94",color:"#f8f9fa",bold:!1},success:{bg:"#6cbf43",color:"#f8f9fa",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#a37acc",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#a37acc",unselectedColor:"#000000"}}},il={name:"GRUVBOX_DARK_HARD_CONTRAST",background:"#1d2021",foreground:"#ebdbb2",primary:"#458588",secondary:"#1d2021",success:"#98971a",warning:"#d79921",danger:"#cc241d",info:"#689d6a",components:{box:{color:"#1d2021",bg:null},textBox:{color:"#ebdbb2",bg:null},textInput:{color:"#ebdbb2",bg:"#1d2021",focusColor:"#d3869b",errorColor:"#cc241d"},button:{variants:{primary:{bg:"#458588",color:"#ffffff",bold:!0},secondary:{bg:"#1d2021",color:"#ebdbb2",bold:!1},danger:{bg:"#cc241d",color:"#ffffff",bold:!0},warning:{bg:"#d79921",color:"#ffffff",bold:!0},info:{bg:"#689d6a",color:"#1d2021",bold:!1},success:{bg:"#98971a",color:"#1d2021",bold:!0}}},checkbox:{color:"#1d2021",checkedColor:"#d3869b",uncheckedColor:"#1d2021"},radiobox:{color:"#1d2021",selectedColor:"#d3869b",unselectedColor:"#1d2021"}}},dl={name:"SHADES_OF_PURPLE_DEFAULT",background:"#1e1e3f",foreground:"#ffffff",primary:"#7857fe",secondary:"#000000",success:"#3ad900",warning:"#fad000",danger:"#e43937",info:"#80fcff",components:{box:{color:"#000000",bg:null},textBox:{color:"#ffffff",bg:null},textInput:{color:"#ffffff",bg:"#1e1e3f",focusColor:"#fb94ff",errorColor:"#e43937"},button:{variants:{primary:{bg:"#7857fe",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#ffffff",bold:!1},danger:{bg:"#e43937",color:"#ffffff",bold:!0},warning:{bg:"#fad000",color:"#ffffff",bold:!0},info:{bg:"#80fcff",color:"#1e1e3f",bold:!1},success:{bg:"#3ad900",color:"#1e1e3f",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#fb94ff",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#fb94ff",unselectedColor:"#000000"}}},ul={name:"JELLYBEANS_DEFAULT",background:"#121212",foreground:"#dedede",primary:"#97bedc",secondary:"#929292",success:"#94b979",warning:"#ffba7b",danger:"#e27373",info:"#00988e",components:{box:{color:"#929292",bg:null},textBox:{color:"#dedede",bg:null},textInput:{color:"#dedede",bg:"#121212",focusColor:"#fbdaff",errorColor:"#e27373"},button:{variants:{primary:{bg:"#97bedc",color:"#ffffff",bold:!0},secondary:{bg:"#929292",color:"#dedede",bold:!1},danger:{bg:"#e27373",color:"#ffffff",bold:!0},warning:{bg:"#ffba7b",color:"#ffffff",bold:!0},info:{bg:"#00988e",color:"#121212",bold:!1},success:{bg:"#94b979",color:"#121212",bold:!0}}},checkbox:{color:"#929292",checkedColor:"#fbdaff",uncheckedColor:"#929292"},radiobox:{color:"#929292",selectedColor:"#fbdaff",unselectedColor:"#929292"}}},bl={name:"NIGHTFOX_CARBONFOX",background:"#161616",foreground:"#f2f4f8",primary:"#78a9ff",secondary:"#282828",success:"#25be6a",warning:"#08bdba",danger:"#ee5396",info:"#33b1ff",components:{box:{color:"#282828",bg:null},textBox:{color:"#f2f4f8",bg:null},textInput:{color:"#f2f4f8",bg:"#161616",focusColor:"#c8a5ff",errorColor:"#ee5396"},button:{variants:{primary:{bg:"#78a9ff",color:"#ffffff",bold:!0},secondary:{bg:"#282828",color:"#f2f4f8",bold:!1},danger:{bg:"#ee5396",color:"#ffffff",bold:!0},warning:{bg:"#08bdba",color:"#ffffff",bold:!0},info:{bg:"#33b1ff",color:"#161616",bold:!1},success:{bg:"#25be6a",color:"#161616",bold:!0}}},checkbox:{color:"#282828",checkedColor:"#c8a5ff",uncheckedColor:"#282828"},radiobox:{color:"#282828",selectedColor:"#c8a5ff",unselectedColor:"#282828"}}},hl={name:"MOONFLY_DEFAULT",background:"#080808",foreground:"#bdbdbd",primary:"#80a0ff",secondary:"#323437",success:"#8cc85f",warning:"#e3c78a",danger:"#ff5454",info:"#79dac8",components:{box:{color:"#323437",bg:null},textBox:{color:"#bdbdbd",bg:null},textInput:{color:"#bdbdbd",bg:"#080808",focusColor:"#ae81ff",errorColor:"#ff5454"},button:{variants:{primary:{bg:"#80a0ff",color:"#ffffff",bold:!0},secondary:{bg:"#323437",color:"#bdbdbd",bold:!1},danger:{bg:"#ff5454",color:"#ffffff",bold:!0},warning:{bg:"#e3c78a",color:"#ffffff",bold:!0},info:{bg:"#79dac8",color:"#080808",bold:!1},success:{bg:"#8cc85f",color:"#080808",bold:!0}}},checkbox:{color:"#323437",checkedColor:"#ae81ff",uncheckedColor:"#323437"},radiobox:{color:"#323437",selectedColor:"#ae81ff",unselectedColor:"#323437"}}},gl={name:"SONOKAI_MAIA",background:"#273136",foreground:"#e1e2e3",primary:"#78cee9",secondary:"#1c1e1f",success:"#9cd57b",warning:"#e3d367",danger:"#f76c7c",info:"#f3a96a",components:{box:{color:"#1c1e1f",bg:null},textBox:{color:"#e1e2e3",bg:null},textInput:{color:"#e1e2e3",bg:"#273136",focusColor:"#baa0f8",errorColor:"#f76c7c"},button:{variants:{primary:{bg:"#78cee9",color:"#ffffff",bold:!0},secondary:{bg:"#1c1e1f",color:"#e1e2e3",bold:!1},danger:{bg:"#f76c7c",color:"#ffffff",bold:!0},warning:{bg:"#e3d367",color:"#ffffff",bold:!0},info:{bg:"#f3a96a",color:"#273136",bold:!1},success:{bg:"#9cd57b",color:"#273136",bold:!0}}},checkbox:{color:"#1c1e1f",checkedColor:"#baa0f8",uncheckedColor:"#1c1e1f"},radiobox:{color:"#1c1e1f",selectedColor:"#baa0f8",unselectedColor:"#1c1e1f"}}},pl={name:"ZENBONES_FORESTBONES_LIGHT",background:"#faf3e1",foreground:"#4f5b62",primary:"#3a94c4",secondary:"#faf3e1",success:"#8da200",warning:"#dea000",danger:"#f85550",info:"#36a87e",components:{box:{color:"#faf3e1",bg:null},textBox:{color:"#4f5b62",bg:null},textInput:{color:"#4f5b62",bg:"#faf3e1",focusColor:"#ca43a3",errorColor:"#f85550"},button:{variants:{primary:{bg:"#3a94c4",color:"#ffffff",bold:!0},secondary:{bg:"#faf3e1",color:"#4f5b62",bold:!1},danger:{bg:"#f85550",color:"#ffffff",bold:!0},warning:{bg:"#dea000",color:"#ffffff",bold:!0},info:{bg:"#36a87e",color:"#faf3e1",bold:!1},success:{bg:"#8da200",color:"#faf3e1",bold:!0}}},checkbox:{color:"#faf3e1",checkedColor:"#ca43a3",uncheckedColor:"#faf3e1"},radiobox:{color:"#faf3e1",selectedColor:"#ca43a3",unselectedColor:"#faf3e1"}}},ml={name:"NOCTIS_LUX",background:"#f6edda",foreground:"#005661",primary:"#0094f0",secondary:"#003b42",success:"#00b368",warning:"#f49725",danger:"#e34e1c",info:"#00bdd6",components:{box:{color:"#003b42",bg:null},textBox:{color:"#005661",bg:null},textInput:{color:"#005661",bg:"#f6edda",focusColor:"#ff6b9f",errorColor:"#e34e1c"},button:{variants:{primary:{bg:"#0094f0",color:"#ffffff",bold:!0},secondary:{bg:"#003b42",color:"#005661",bold:!1},danger:{bg:"#e34e1c",color:"#ffffff",bold:!0},warning:{bg:"#f49725",color:"#ffffff",bold:!0},info:{bg:"#00bdd6",color:"#f6edda",bold:!1},success:{bg:"#00b368",color:"#f6edda",bold:!0}}},checkbox:{color:"#003b42",checkedColor:"#ff6b9f",uncheckedColor:"#003b42"},radiobox:{color:"#003b42",selectedColor:"#ff6b9f",unselectedColor:"#003b42"}}},xl={name:"CATPPUCCIN_LATTE",background:"#eff1f5",foreground:"#4c4f69",primary:"#1e66f5",secondary:"#5c5f77",success:"#40a02b",warning:"#df8e1d",danger:"#d20f39",info:"#179299",components:{box:{color:"#5c5f77",bg:null},textBox:{color:"#4c4f69",bg:null},textInput:{color:"#4c4f69",bg:"#eff1f5",focusColor:"#fe85d8",errorColor:"#d20f39"},button:{variants:{primary:{bg:"#1e66f5",color:"#ffffff",bold:!0},secondary:{bg:"#5c5f77",color:"#4c4f69",bold:!1},danger:{bg:"#d20f39",color:"#ffffff",bold:!0},warning:{bg:"#df8e1d",color:"#ffffff",bold:!0},info:{bg:"#179299",color:"#eff1f5",bold:!1},success:{bg:"#40a02b",color:"#eff1f5",bold:!0}}},checkbox:{color:"#5c5f77",checkedColor:"#fe85d8",uncheckedColor:"#5c5f77"},radiobox:{color:"#5c5f77",selectedColor:"#fe85d8",unselectedColor:"#5c5f77"}}},yl={name:"ONE_HALF_LIGHT",background:"#fafafa",foreground:"#383a42",primary:"#0184bc",secondary:"#383a42",success:"#50a14f",warning:"#c18401",danger:"#e45649",info:"#0997b3",components:{box:{color:"#383a42",bg:null},textBox:{color:"#383a42",bg:null},textInput:{color:"#383a42",bg:"#fafafa",focusColor:"#c678dd",errorColor:"#e45649"},button:{variants:{primary:{bg:"#0184bc",color:"#ffffff",bold:!0},secondary:{bg:"#383a42",color:"#383a42",bold:!1},danger:{bg:"#e45649",color:"#ffffff",bold:!0},warning:{bg:"#c18401",color:"#ffffff",bold:!0},info:{bg:"#0997b3",color:"#fafafa",bold:!1},success:{bg:"#50a14f",color:"#fafafa",bold:!0}}},checkbox:{color:"#383a42",checkedColor:"#c678dd",uncheckedColor:"#383a42"},radiobox:{color:"#383a42",selectedColor:"#c678dd",unselectedColor:"#383a42"}}},Cl={name:"NIGHTFOX_DEFAULT",background:"#192330",foreground:"#cdcecf",primary:"#719cd6",secondary:"#393b44",success:"#81b29a",warning:"#dbc074",danger:"#c94f6d",info:"#63cdcf",components:{box:{color:"#393b44",bg:null},textBox:{color:"#cdcecf",bg:null},textInput:{color:"#cdcecf",bg:"#192330",focusColor:"#baa1e2",errorColor:"#c94f6d"},button:{variants:{primary:{bg:"#719cd6",color:"#ffffff",bold:!0},secondary:{bg:"#393b44",color:"#cdcecf",bold:!1},danger:{bg:"#c94f6d",color:"#ffffff",bold:!0},warning:{bg:"#dbc074",color:"#ffffff",bold:!0},info:{bg:"#63cdcf",color:"#192330",bold:!1},success:{bg:"#81b29a",color:"#192330",bold:!0}}},checkbox:{color:"#393b44",checkedColor:"#baa1e2",uncheckedColor:"#393b44"},radiobox:{color:"#393b44",selectedColor:"#baa1e2",unselectedColor:"#393b44"}}},vl={name:"COBALT2_DEFAULT",background:"#122738",foreground:"#ffffff",primary:"#0088ff",secondary:"#000000",success:"#3ad900",warning:"#ffc600",danger:"#ff628c",info:"#80fcff",components:{box:{color:"#000000",bg:null},textBox:{color:"#ffffff",bg:null},textInput:{color:"#ffffff",bg:"#122738",focusColor:"#fb94ff",errorColor:"#ff628c"},button:{variants:{primary:{bg:"#0088ff",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#ffffff",bold:!1},danger:{bg:"#ff628c",color:"#ffffff",bold:!0},warning:{bg:"#ffc600",color:"#ffffff",bold:!0},info:{bg:"#80fcff",color:"#122738",bold:!1},success:{bg:"#3ad900",color:"#122738",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#fb94ff",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#fb94ff",unselectedColor:"#000000"}}},wl={name:"POSTERPOLE_DEFAULT",background:"#25222a",foreground:"#c6c0b9",primary:"#6c7f93",secondary:"#2c2c30",success:"#778c73",warning:"#cc9166",danger:"#a97070",info:"#8ea4a2",components:{box:{color:"#2c2c30",bg:null},textBox:{color:"#c6c0b9",bg:null},textInput:{color:"#c6c0b9",bg:"#25222a",focusColor:"#ccb3c6",errorColor:"#a97070"},button:{variants:{primary:{bg:"#6c7f93",color:"#ffffff",bold:!0},secondary:{bg:"#2c2c30",color:"#c6c0b9",bold:!1},danger:{bg:"#a97070",color:"#ffffff",bold:!0},warning:{bg:"#cc9166",color:"#ffffff",bold:!0},info:{bg:"#8ea4a2",color:"#25222a",bold:!1},success:{bg:"#778c73",color:"#25222a",bold:!0}}},checkbox:{color:"#2c2c30",checkedColor:"#ccb3c6",uncheckedColor:"#2c2c30"},radiobox:{color:"#2c2c30",selectedColor:"#ccb3c6",unselectedColor:"#2c2c30"}}},kl={name:"ONE_DARK",background:"#282c34",foreground:"#abb2bf",primary:"#61afef",secondary:"#1e2127",success:"#98c379",warning:"#d19a66",danger:"#e06c75",info:"#56b6c2",components:{box:{color:"#1e2127",bg:null},textBox:{color:"#abb2bf",bg:null},textInput:{color:"#abb2bf",bg:"#282c34",focusColor:"#c678dd",errorColor:"#e06c75"},button:{variants:{primary:{bg:"#61afef",color:"#ffffff",bold:!0},secondary:{bg:"#1e2127",color:"#abb2bf",bold:!1},danger:{bg:"#e06c75",color:"#ffffff",bold:!0},warning:{bg:"#d19a66",color:"#ffffff",bold:!0},info:{bg:"#56b6c2",color:"#282c34",bold:!1},success:{bg:"#98c379",color:"#282c34",bold:!0}}},checkbox:{color:"#1e2127",checkedColor:"#c678dd",uncheckedColor:"#1e2127"},radiobox:{color:"#1e2127",selectedColor:"#c678dd",unselectedColor:"#1e2127"}}},Sl={name:"NIGHTFLY_DEFAULT",background:"#011627",foreground:"#bdc1c6",primary:"#82aaff",secondary:"#1d3b53",success:"#a1cd5e",warning:"#e7d37a",danger:"#fc514e",info:"#7fdbca",components:{box:{color:"#1d3b53",bg:null},textBox:{color:"#bdc1c6",bg:null},textInput:{color:"#bdc1c6",bg:"#011627",focusColor:"#ae81ff",errorColor:"#fc514e"},button:{variants:{primary:{bg:"#82aaff",color:"#ffffff",bold:!0},secondary:{bg:"#1d3b53",color:"#bdc1c6",bold:!1},danger:{bg:"#fc514e",color:"#ffffff",bold:!0},warning:{bg:"#e7d37a",color:"#ffffff",bold:!0},info:{bg:"#7fdbca",color:"#011627",bold:!1},success:{bg:"#a1cd5e",color:"#011627",bold:!0}}},checkbox:{color:"#1d3b53",checkedColor:"#ae81ff",uncheckedColor:"#1d3b53"},radiobox:{color:"#1d3b53",selectedColor:"#ae81ff",unselectedColor:"#1d3b53"}}},_l={name:"TOKYO_NIGHT_MOON",background:"#222436",foreground:"#c8d3f5",primary:"#82aaff",secondary:"#1b1d2b",success:"#c3e88d",warning:"#ffc777",danger:"#ff757f",info:"#86e1fc",components:{box:{color:"#1b1d2b",bg:null},textBox:{color:"#c8d3f5",bg:null},textInput:{color:"#c8d3f5",bg:"#222436",focusColor:"#c099ff",errorColor:"#ff757f"},button:{variants:{primary:{bg:"#82aaff",color:"#ffffff",bold:!0},secondary:{bg:"#1b1d2b",color:"#c8d3f5",bold:!1},danger:{bg:"#ff757f",color:"#ffffff",bold:!0},warning:{bg:"#ffc777",color:"#ffffff",bold:!0},info:{bg:"#86e1fc",color:"#222436",bold:!1},success:{bg:"#c3e88d",color:"#222436",bold:!0}}},checkbox:{color:"#1b1d2b",checkedColor:"#c099ff",uncheckedColor:"#1b1d2b"},radiobox:{color:"#1b1d2b",selectedColor:"#c099ff",unselectedColor:"#1b1d2b"}}},Ol={name:"NOCTIS_MINIMUS",background:"#0e1920",foreground:"#c5cdd3",primary:"#6196b8",secondary:"#182a35",success:"#72c09f",warning:"#c8a984",danger:"#c08872",info:"#72b7c0",components:{box:{color:"#182a35",bg:null},textBox:{color:"#c5cdd3",bg:null},textInput:{color:"#c5cdd3",bg:"#0e1920",focusColor:"#c88da2",errorColor:"#c08872"},button:{variants:{primary:{bg:"#6196b8",color:"#ffffff",bold:!0},secondary:{bg:"#182a35",color:"#c5cdd3",bold:!1},danger:{bg:"#c08872",color:"#ffffff",bold:!0},warning:{bg:"#c8a984",color:"#ffffff",bold:!0},info:{bg:"#72b7c0",color:"#0e1920",bold:!1},success:{bg:"#72c09f",color:"#0e1920",bold:!0}}},checkbox:{color:"#182a35",checkedColor:"#c88da2",uncheckedColor:"#182a35"},radiobox:{color:"#182a35",selectedColor:"#c88da2",unselectedColor:"#182a35"}}},Il={name:"NIGHTFOX_DUSKFOX",background:"#232136",foreground:"#e0def4",primary:"#569fba",secondary:"#393552",success:"#a3be8c",warning:"#f6c177",danger:"#eb6f92",info:"#9ccfd8",components:{box:{color:"#393552",bg:null},textBox:{color:"#e0def4",bg:null},textInput:{color:"#e0def4",bg:"#232136",focusColor:"#ccb1ed",errorColor:"#eb6f92"},button:{variants:{primary:{bg:"#569fba",color:"#ffffff",bold:!0},secondary:{bg:"#393552",color:"#e0def4",bold:!1},danger:{bg:"#eb6f92",color:"#ffffff",bold:!0},warning:{bg:"#f6c177",color:"#ffffff",bold:!0},info:{bg:"#9ccfd8",color:"#232136",bold:!1},success:{bg:"#a3be8c",color:"#232136",bold:!0}}},checkbox:{color:"#393552",checkedColor:"#ccb1ed",uncheckedColor:"#393552"},radiobox:{color:"#393552",selectedColor:"#ccb1ed",unselectedColor:"#393552"}}},El={name:"SEOUL256_LIGHT",background:"#dadada",foreground:"#4e4e4e",primary:"#5f87ae",secondary:"#4e4e4e",success:"#5f885f",warning:"#af8760",danger:"#af5f5f",info:"#5f8787",components:{box:{color:"#4e4e4e",bg:null},textBox:{color:"#4e4e4e",bg:null},textInput:{color:"#4e4e4e",bg:"#dadada",focusColor:"#87025f",errorColor:"#af5f5f"},button:{variants:{primary:{bg:"#5f87ae",color:"#ffffff",bold:!0},secondary:{bg:"#4e4e4e",color:"#4e4e4e",bold:!1},danger:{bg:"#af5f5f",color:"#ffffff",bold:!0},warning:{bg:"#af8760",color:"#ffffff",bold:!0},info:{bg:"#5f8787",color:"#dadada",bold:!1},success:{bg:"#5f885f",color:"#dadada",bold:!0}}},checkbox:{color:"#4e4e4e",checkedColor:"#87025f",uncheckedColor:"#4e4e4e"},radiobox:{color:"#4e4e4e",selectedColor:"#87025f",unselectedColor:"#4e4e4e"}}},Tl={name:"NOCTIS_BORDO",background:"#272022",foreground:"#cbbec2",primary:"#49ace9",secondary:"#47393e",success:"#49e9a6",warning:"#e4b781",danger:"#e66533",info:"#49d6e9",components:{box:{color:"#47393e",bg:null},textBox:{color:"#cbbec2",bg:null},textInput:{color:"#cbbec2",bg:"#272022",focusColor:"#e798b3",errorColor:"#e66533"},button:{variants:{primary:{bg:"#49ace9",color:"#ffffff",bold:!0},secondary:{bg:"#47393e",color:"#cbbec2",bold:!1},danger:{bg:"#e66533",color:"#ffffff",bold:!0},warning:{bg:"#e4b781",color:"#ffffff",bold:!0},info:{bg:"#49d6e9",color:"#272022",bold:!1},success:{bg:"#49e9a6",color:"#272022",bold:!0}}},checkbox:{color:"#47393e",checkedColor:"#e798b3",uncheckedColor:"#47393e"},radiobox:{color:"#47393e",selectedColor:"#e798b3",unselectedColor:"#47393e"}}},Nl={name:"SHADES_OF_PURPLE_SUPER_DARK",background:"#15152b",foreground:"#ffffff",primary:"#7857fe",secondary:"#000000",success:"#3ad900",warning:"#fad000",danger:"#e33937",info:"#80fcff",components:{box:{color:"#000000",bg:null},textBox:{color:"#ffffff",bg:null},textInput:{color:"#ffffff",bg:"#15152b",focusColor:"#fb94ff",errorColor:"#e33937"},button:{variants:{primary:{bg:"#7857fe",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#ffffff",bold:!1},danger:{bg:"#e33937",color:"#ffffff",bold:!0},warning:{bg:"#fad000",color:"#ffffff",bold:!0},info:{bg:"#80fcff",color:"#15152b",bold:!1},success:{bg:"#3ad900",color:"#15152b",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#fb94ff",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#fb94ff",unselectedColor:"#000000"}}},Al={name:"ZENBONES_NEOBONES_DARK",background:"#0f191f",foreground:"#c6d5cf",primary:"#8190d4",secondary:"#0f191f",success:"#90ff6b",warning:"#b77e64",danger:"#de6e7c",info:"#66a5ad",components:{box:{color:"#0f191f",bg:null},textBox:{color:"#c6d5cf",bg:null},textInput:{color:"#c6d5cf",bg:"#0f191f",focusColor:"#cf86c1",errorColor:"#de6e7c"},button:{variants:{primary:{bg:"#8190d4",color:"#ffffff",bold:!0},secondary:{bg:"#0f191f",color:"#c6d5cf",bold:!1},danger:{bg:"#de6e7c",color:"#ffffff",bold:!0},warning:{bg:"#b77e64",color:"#ffffff",bold:!0},info:{bg:"#66a5ad",color:"#0f191f",bold:!1},success:{bg:"#90ff6b",color:"#0f191f",bold:!0}}},checkbox:{color:"#0f191f",checkedColor:"#cf86c1",uncheckedColor:"#0f191f"},radiobox:{color:"#0f191f",selectedColor:"#cf86c1",unselectedColor:"#0f191f"}}},Bl={name:"NOCTIS_SERENO",background:"#041d20",foreground:"#b2cacd",primary:"#49ace9",secondary:"#324a4d",success:"#49e9a6",warning:"#e4b781",danger:"#e66533",info:"#49d6e9",components:{box:{color:"#324a4d",bg:null},textBox:{color:"#b2cacd",bg:null},textInput:{color:"#b2cacd",bg:"#041d20",focusColor:"#e798b3",errorColor:"#e66533"},button:{variants:{primary:{bg:"#49ace9",color:"#ffffff",bold:!0},secondary:{bg:"#324a4d",color:"#b2cacd",bold:!1},danger:{bg:"#e66533",color:"#ffffff",bold:!0},warning:{bg:"#e4b781",color:"#ffffff",bold:!0},info:{bg:"#49d6e9",color:"#041d20",bold:!1},success:{bg:"#49e9a6",color:"#041d20",bold:!0}}},checkbox:{color:"#324a4d",checkedColor:"#e798b3",uncheckedColor:"#324a4d"},radiobox:{color:"#324a4d",selectedColor:"#e798b3",unselectedColor:"#324a4d"}}},Ll={name:"GRUVBOX_DARK",background:"#282828",foreground:"#ebdbb2",primary:"#458588",secondary:"#282828",success:"#98971a",warning:"#d79921",danger:"#cc241d",info:"#689d6a",components:{box:{color:"#282828",bg:null},textBox:{color:"#ebdbb2",bg:null},textInput:{color:"#ebdbb2",bg:"#282828",focusColor:"#d3869b",errorColor:"#cc241d"},button:{variants:{primary:{bg:"#458588",color:"#ffffff",bold:!0},secondary:{bg:"#282828",color:"#ebdbb2",bold:!1},danger:{bg:"#cc241d",color:"#ffffff",bold:!0},warning:{bg:"#d79921",color:"#ffffff",bold:!0},info:{bg:"#689d6a",color:"#282828",bold:!1},success:{bg:"#98971a",color:"#282828",bold:!0}}},checkbox:{color:"#282828",checkedColor:"#d3869b",uncheckedColor:"#282828"},radiobox:{color:"#282828",selectedColor:"#d3869b",unselectedColor:"#282828"}}},Rl={name:"SOLARIZED_LIGHT",background:"#fdf6e3",foreground:"#657b83",primary:"#268bd2",secondary:"#073642",success:"#859900",warning:"#b58900",danger:"#dc322f",info:"#2aa198",components:{box:{color:"#073642",bg:null},textBox:{color:"#657b83",bg:null},textInput:{color:"#657b83",bg:"#fdf6e3",focusColor:"#6c71c4",errorColor:"#dc322f"},button:{variants:{primary:{bg:"#268bd2",color:"#ffffff",bold:!0},secondary:{bg:"#073642",color:"#657b83",bold:!1},danger:{bg:"#dc322f",color:"#ffffff",bold:!0},warning:{bg:"#b58900",color:"#ffffff",bold:!0},info:{bg:"#2aa198",color:"#fdf6e3",bold:!1},success:{bg:"#859900",color:"#fdf6e3",bold:!0}}},checkbox:{color:"#073642",checkedColor:"#6c71c4",uncheckedColor:"#073642"},radiobox:{color:"#073642",selectedColor:"#6c71c4",unselectedColor:"#073642"}}},Ml={name:"ZENBONES_ZENWRITTEN_LIGHT",background:"#eeeeee",foreground:"#353535",primary:"#286486",secondary:"#eeeeee",success:"#4f6c31",warning:"#944927",danger:"#a8334c",info:"#3b8992",components:{box:{color:"#eeeeee",bg:null},textBox:{color:"#353535",bg:null},textInput:{color:"#353535",bg:"#eeeeee",focusColor:"#7b3b70",errorColor:"#a8334c"},button:{variants:{primary:{bg:"#286486",color:"#ffffff",bold:!0},secondary:{bg:"#eeeeee",color:"#353535",bold:!1},danger:{bg:"#a8334c",color:"#ffffff",bold:!0},warning:{bg:"#944927",color:"#ffffff",bold:!0},info:{bg:"#3b8992",color:"#eeeeee",bold:!1},success:{bg:"#4f6c31",color:"#eeeeee",bold:!0}}},checkbox:{color:"#eeeeee",checkedColor:"#7b3b70",uncheckedColor:"#eeeeee"},radiobox:{color:"#eeeeee",selectedColor:"#7b3b70",unselectedColor:"#eeeeee"}}},Hl={name:"NIGHT_OWL_DARK",background:"#011627",foreground:"#cccccc",primary:"#82aaff",secondary:"#011627",success:"#22da6e",warning:"#c5e478",danger:"#ef5350",info:"#21c7a8",components:{box:{color:"#011627",bg:null},textBox:{color:"#cccccc",bg:null},textInput:{color:"#cccccc",bg:"#011627",focusColor:"#c792ea",errorColor:"#ef5350"},button:{variants:{primary:{bg:"#82aaff",color:"#ffffff",bold:!0},secondary:{bg:"#011627",color:"#cccccc",bold:!1},danger:{bg:"#ef5350",color:"#ffffff",bold:!0},warning:{bg:"#c5e478",color:"#ffffff",bold:!0},info:{bg:"#21c7a8",color:"#011627",bold:!1},success:{bg:"#22da6e",color:"#011627",bold:!0}}},checkbox:{color:"#011627",checkedColor:"#c792ea",uncheckedColor:"#011627"},radiobox:{color:"#011627",selectedColor:"#c792ea",unselectedColor:"#011627"}}},Dl={name:"NIGHT_OWL_LIGHT",background:"#f6f6f6",foreground:"#403f53",primary:"#288ed7",secondary:"#403f53",success:"#08916a",warning:"#e0af02",danger:"#de3d3b",info:"#2aa298",components:{box:{color:"#403f53",bg:null},textBox:{color:"#403f53",bg:null},textInput:{color:"#403f53",bg:"#f6f6f6",focusColor:"#d6438a",errorColor:"#de3d3b"},button:{variants:{primary:{bg:"#288ed7",color:"#ffffff",bold:!0},secondary:{bg:"#403f53",color:"#403f53",bold:!1},danger:{bg:"#de3d3b",color:"#ffffff",bold:!0},warning:{bg:"#e0af02",color:"#ffffff",bold:!0},info:{bg:"#2aa298",color:"#f6f6f6",bold:!1},success:{bg:"#08916a",color:"#f6f6f6",bold:!0}}},checkbox:{color:"#403f53",checkedColor:"#d6438a",uncheckedColor:"#403f53"},radiobox:{color:"#403f53",selectedColor:"#d6438a",unselectedColor:"#403f53"}}},Fl={name:"POSTERPOLE_GRAY",background:"#1f1f1f",foreground:"#c6c0b9",primary:"#6c7f93",secondary:"#2c2c30",success:"#778c73",warning:"#cc9166",danger:"#a97070",info:"#8ea4a2",components:{box:{color:"#2c2c30",bg:null},textBox:{color:"#c6c0b9",bg:null},textInput:{color:"#c6c0b9",bg:"#1f1f1f",focusColor:"#ccb3c6",errorColor:"#a97070"},button:{variants:{primary:{bg:"#6c7f93",color:"#ffffff",bold:!0},secondary:{bg:"#2c2c30",color:"#c6c0b9",bold:!1},danger:{bg:"#a97070",color:"#ffffff",bold:!0},warning:{bg:"#cc9166",color:"#ffffff",bold:!0},info:{bg:"#8ea4a2",color:"#1f1f1f",bold:!1},success:{bg:"#778c73",color:"#1f1f1f",bold:!0}}},checkbox:{color:"#2c2c30",checkedColor:"#ccb3c6",uncheckedColor:"#2c2c30"},radiobox:{color:"#2c2c30",selectedColor:"#ccb3c6",unselectedColor:"#2c2c30"}}},Gl={name:"APPRENTICE_DEFAULT",background:"#262626",foreground:"#bcbcbc",primary:"#5f87af",secondary:"#1c1c1c",success:"#5f875f",warning:"#87875f",danger:"#af5f5f",info:"#5f8787",components:{box:{color:"#1c1c1c",bg:null},textBox:{color:"#bcbcbc",bg:null},textInput:{color:"#bcbcbc",bg:"#262626",focusColor:"#8787af",errorColor:"#af5f5f"},button:{variants:{primary:{bg:"#5f87af",color:"#ffffff",bold:!0},secondary:{bg:"#1c1c1c",color:"#bcbcbc",bold:!1},danger:{bg:"#af5f5f",color:"#ffffff",bold:!0},warning:{bg:"#87875f",color:"#ffffff",bold:!0},info:{bg:"#5f8787",color:"#262626",bold:!1},success:{bg:"#5f875f",color:"#262626",bold:!0}}},checkbox:{color:"#1c1c1c",checkedColor:"#8787af",uncheckedColor:"#1c1c1c"},radiobox:{color:"#1c1c1c",selectedColor:"#8787af",unselectedColor:"#1c1c1c"}}},Ul={name:"ZENBONES_KANAGAWABONES",background:"#1f1f28",foreground:"#ddd8bb",primary:"#7eb3c9",secondary:"#1f1f28",success:"#98bc6d",warning:"#e5c283",danger:"#e46a78",info:"#7eb3c9",components:{box:{color:"#1f1f28",bg:null},textBox:{color:"#ddd8bb",bg:null},textInput:{color:"#ddd8bb",bg:"#1f1f28",focusColor:"#a98fd2",errorColor:"#e46a78"},button:{variants:{primary:{bg:"#7eb3c9",color:"#ffffff",bold:!0},secondary:{bg:"#1f1f28",color:"#ddd8bb",bold:!1},danger:{bg:"#e46a78",color:"#ffffff",bold:!0},warning:{bg:"#e5c283",color:"#ffffff",bold:!0},info:{bg:"#7eb3c9",color:"#1f1f28",bold:!1},success:{bg:"#98bc6d",color:"#1f1f28",bold:!0}}},checkbox:{color:"#1f1f28",checkedColor:"#a98fd2",uncheckedColor:"#1f1f28"},radiobox:{color:"#1f1f28",selectedColor:"#a98fd2",unselectedColor:"#1f1f28"}}},Wl={name:"EVERFOREST_DARK",background:"#2d353b",foreground:"#d3c6aa",primary:"#7fbbb3",secondary:"#343f44",success:"#a7c080",warning:"#dbbc7f",danger:"#e67e80",info:"#83c092",components:{box:{color:"#343f44",bg:null},textBox:{color:"#d3c6aa",bg:null},textInput:{color:"#d3c6aa",bg:"#2d353b",focusColor:"#d699b6",errorColor:"#e67e80"},button:{variants:{primary:{bg:"#7fbbb3",color:"#ffffff",bold:!0},secondary:{bg:"#343f44",color:"#d3c6aa",bold:!1},danger:{bg:"#e67e80",color:"#ffffff",bold:!0},warning:{bg:"#dbbc7f",color:"#ffffff",bold:!0},info:{bg:"#83c092",color:"#2d353b",bold:!1},success:{bg:"#a7c080",color:"#2d353b",bold:!0}}},checkbox:{color:"#343f44",checkedColor:"#d699b6",uncheckedColor:"#343f44"},radiobox:{color:"#343f44",selectedColor:"#d699b6",unselectedColor:"#343f44"}}},Pl={name:"ROSE_PINE_MOON",background:"#2a273f",foreground:"#e0def4",primary:"#9ccfd8",secondary:"#393552",success:"#3e8fb0",warning:"#f6c177",danger:"#eb6f92",info:"#ea9a97",components:{box:{color:"#393552",bg:null},textBox:{color:"#e0def4",bg:null},textInput:{color:"#e0def4",bg:"#2a273f",focusColor:"#c4a7e7",errorColor:"#eb6f92"},button:{variants:{primary:{bg:"#9ccfd8",color:"#ffffff",bold:!0},secondary:{bg:"#393552",color:"#e0def4",bold:!1},danger:{bg:"#eb6f92",color:"#ffffff",bold:!0},warning:{bg:"#f6c177",color:"#ffffff",bold:!0},info:{bg:"#ea9a97",color:"#2a273f",bold:!1},success:{bg:"#3e8fb0",color:"#2a273f",bold:!0}}},checkbox:{color:"#393552",checkedColor:"#c4a7e7",uncheckedColor:"#393552"},radiobox:{color:"#393552",selectedColor:"#c4a7e7",unselectedColor:"#393552"}}},$l={name:"NOCTIS_UVA",background:"#1f1d30",foreground:"#c5c2d6",primary:"#49ace9",secondary:"#302f3d",success:"#49e9a6",warning:"#e4b781",danger:"#e66533",info:"#49d6e9",components:{box:{color:"#302f3d",bg:null},textBox:{color:"#c5c2d6",bg:null},textInput:{color:"#c5c2d6",bg:"#1f1d30",focusColor:"#e798b3",errorColor:"#e66533"},button:{variants:{primary:{bg:"#49ace9",color:"#ffffff",bold:!0},secondary:{bg:"#302f3d",color:"#c5c2d6",bold:!1},danger:{bg:"#e66533",color:"#ffffff",bold:!0},warning:{bg:"#e4b781",color:"#ffffff",bold:!0},info:{bg:"#49d6e9",color:"#1f1d30",bold:!1},success:{bg:"#49e9a6",color:"#1f1d30",bold:!0}}},checkbox:{color:"#302f3d",checkedColor:"#e798b3",uncheckedColor:"#302f3d"},radiobox:{color:"#302f3d",selectedColor:"#e798b3",unselectedColor:"#302f3d"}}},zl={name:"TOMORROW_NIGHT_BRIGHT",background:"#000000",foreground:"#eaeaea",primary:"#7aa6da",secondary:"#000000",success:"#b9ca4a",warning:"#e7c547",danger:"#d54e53",info:"#70c0b1",components:{box:{color:"#000000",bg:null},textBox:{color:"#eaeaea",bg:null},textInput:{color:"#eaeaea",bg:"#000000",focusColor:"#c397d8",errorColor:"#d54e53"},button:{variants:{primary:{bg:"#7aa6da",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#eaeaea",bold:!1},danger:{bg:"#d54e53",color:"#ffffff",bold:!0},warning:{bg:"#e7c547",color:"#ffffff",bold:!0},info:{bg:"#70c0b1",color:"#000000",bold:!1},success:{bg:"#b9ca4a",color:"#000000",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#c397d8",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#c397d8",unselectedColor:"#000000"}}},Kl={name:"EVERFOREST_LIGHT",background:"#fdf6e3",foreground:"#5c6a72",primary:"#3a94c5",secondary:"#5c6a72",success:"#8da101",warning:"#dfa000",danger:"#f85552",info:"#35a77c",components:{box:{color:"#5c6a72",bg:null},textBox:{color:"#5c6a72",bg:null},textInput:{color:"#5c6a72",bg:"#fdf6e3",focusColor:"#df69ba",errorColor:"#f85552"},button:{variants:{primary:{bg:"#3a94c5",color:"#ffffff",bold:!0},secondary:{bg:"#5c6a72",color:"#5c6a72",bold:!1},danger:{bg:"#f85552",color:"#ffffff",bold:!0},warning:{bg:"#dfa000",color:"#ffffff",bold:!0},info:{bg:"#35a77c",color:"#fdf6e3",bold:!1},success:{bg:"#8da101",color:"#fdf6e3",bold:!0}}},checkbox:{color:"#5c6a72",checkedColor:"#df69ba",uncheckedColor:"#5c6a72"},radiobox:{color:"#5c6a72",selectedColor:"#df69ba",unselectedColor:"#5c6a72"}}},jl={name:"GITHUB_LIGHT_HIGH_CONTRAST",background:"#ffffff",foreground:"#0e1116",primary:"#0349b4",secondary:"#0e1116",success:"#024c1a",warning:"#3f2200",danger:"#a0111f",info:"#1b7c83",components:{box:{color:"#0e1116",bg:null},textBox:{color:"#0e1116",bg:null},textInput:{color:"#0e1116",bg:"#ffffff",focusColor:"#844ae7",errorColor:"#a0111f"},button:{variants:{primary:{bg:"#0349b4",color:"#ffffff",bold:!0},secondary:{bg:"#0e1116",color:"#0e1116",bold:!1},danger:{bg:"#a0111f",color:"#ffffff",bold:!0},warning:{bg:"#3f2200",color:"#ffffff",bold:!0},info:{bg:"#1b7c83",color:"#ffffff",bold:!1},success:{bg:"#024c1a",color:"#ffffff",bold:!0}}},checkbox:{color:"#0e1116",checkedColor:"#844ae7",uncheckedColor:"#0e1116"},radiobox:{color:"#0e1116",selectedColor:"#844ae7",unselectedColor:"#0e1116"}}},Vl={name:"CATPPUCCIN_MOCHA",background:"#1e1e2e",foreground:"#cdd6f4",primary:"#89b4fa",secondary:"#45475a",success:"#a6e3a1",warning:"#f9e2af",danger:"#f38ba8",info:"#94e2d5",components:{box:{color:"#45475a",bg:null},textBox:{color:"#cdd6f4",bg:null},textInput:{color:"#cdd6f4",bg:"#1e1e2e",focusColor:"#f2aede",errorColor:"#f38ba8"},button:{variants:{primary:{bg:"#89b4fa",color:"#ffffff",bold:!0},secondary:{bg:"#45475a",color:"#cdd6f4",bold:!1},danger:{bg:"#f38ba8",color:"#ffffff",bold:!0},warning:{bg:"#f9e2af",color:"#ffffff",bold:!0},info:{bg:"#94e2d5",color:"#1e1e2e",bold:!1},success:{bg:"#a6e3a1",color:"#1e1e2e",bold:!0}}},checkbox:{color:"#45475a",checkedColor:"#f2aede",uncheckedColor:"#45475a"},radiobox:{color:"#45475a",selectedColor:"#f2aede",unselectedColor:"#45475a"}}},Yl={name:"ONE_LIGHT",background:"#f8f8f8",foreground:"#2a2b33",primary:"#2f5af3",secondary:"#000000",success:"#3e953a",warning:"#d2b67b",danger:"#de3d35",info:"#3e953a",components:{box:{color:"#000000",bg:null},textBox:{color:"#2a2b33",bg:null},textInput:{color:"#2a2b33",bg:"#f8f8f8",focusColor:"#a00095",errorColor:"#de3d35"},button:{variants:{primary:{bg:"#2f5af3",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#2a2b33",bold:!1},danger:{bg:"#de3d35",color:"#ffffff",bold:!0},warning:{bg:"#d2b67b",color:"#ffffff",bold:!0},info:{bg:"#3e953a",color:"#f8f8f8",bold:!1},success:{bg:"#3e953a",color:"#f8f8f8",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#a00095",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#a00095",unselectedColor:"#000000"}}},Xl={name:"GITHUB_DARK_LEGACY",background:"#1f2428",foreground:"#d1d5da",primary:"#2188ff",secondary:"#586069",success:"#34d058",warning:"#ffea7f",danger:"#ea4a5a",info:"#39c5cf",components:{box:{color:"#586069",bg:null},textBox:{color:"#d1d5da",bg:null},textInput:{color:"#d1d5da",bg:"#1f2428",focusColor:"#b392f0",errorColor:"#ea4a5a"},button:{variants:{primary:{bg:"#2188ff",color:"#ffffff",bold:!0},secondary:{bg:"#586069",color:"#d1d5da",bold:!1},danger:{bg:"#ea4a5a",color:"#ffffff",bold:!0},warning:{bg:"#ffea7f",color:"#ffffff",bold:!0},info:{bg:"#39c5cf",color:"#1f2428",bold:!1},success:{bg:"#34d058",color:"#1f2428",bold:!0}}},checkbox:{color:"#586069",checkedColor:"#b392f0",uncheckedColor:"#586069"},radiobox:{color:"#586069",selectedColor:"#b392f0",unselectedColor:"#586069"}}},Zl={name:"ICEBERG_DARK",background:"#161821",foreground:"#c6c8d1",primary:"#84a0c6",secondary:"#1e2132",success:"#b4be82",warning:"#e2a478",danger:"#e27878",info:"#89b8c2",components:{box:{color:"#1e2132",bg:null},textBox:{color:"#c6c8d1",bg:null},textInput:{color:"#c6c8d1",bg:"#161821",focusColor:"#ada0d3",errorColor:"#e27878"},button:{variants:{primary:{bg:"#84a0c6",color:"#ffffff",bold:!0},secondary:{bg:"#1e2132",color:"#c6c8d1",bold:!1},danger:{bg:"#e27878",color:"#ffffff",bold:!0},warning:{bg:"#e2a478",color:"#ffffff",bold:!0},info:{bg:"#89b8c2",color:"#161821",bold:!1},success:{bg:"#b4be82",color:"#161821",bold:!0}}},checkbox:{color:"#1e2132",checkedColor:"#ada0d3",uncheckedColor:"#1e2132"},radiobox:{color:"#1e2132",selectedColor:"#ada0d3",unselectedColor:"#1e2132"}}},Jl={name:"TOKYO_NIGHT_DEFAULT",background:"#1a1b26",foreground:"#c0caf5",primary:"#7aa2f7",secondary:"#15161e",success:"#9ece6a",warning:"#e0af68",danger:"#f7768e",info:"#7dcfff",components:{box:{color:"#15161e",bg:null},textBox:{color:"#c0caf5",bg:null},textInput:{color:"#c0caf5",bg:"#1a1b26",focusColor:"#bb9af7",errorColor:"#f7768e"},button:{variants:{primary:{bg:"#7aa2f7",color:"#ffffff",bold:!0},secondary:{bg:"#15161e",color:"#c0caf5",bold:!1},danger:{bg:"#f7768e",color:"#ffffff",bold:!0},warning:{bg:"#e0af68",color:"#ffffff",bold:!0},info:{bg:"#7dcfff",color:"#1a1b26",bold:!1},success:{bg:"#9ece6a",color:"#1a1b26",bold:!0}}},checkbox:{color:"#15161e",checkedColor:"#bb9af7",uncheckedColor:"#15161e"},radiobox:{color:"#15161e",selectedColor:"#bb9af7",unselectedColor:"#15161e"}}},ql={name:"CATPPUCCIN_MACCHIATO",background:"#24273a",foreground:"#cad3f5",primary:"#8aadf4",secondary:"#494d64",success:"#a6da95",warning:"#eed49f",danger:"#ed8796",info:"#8bd5ca",components:{box:{color:"#494d64",bg:null},textBox:{color:"#cad3f5",bg:null},textInput:{color:"#cad3f5",bg:"#24273a",focusColor:"#f2a9dd",errorColor:"#ed8796"},button:{variants:{primary:{bg:"#8aadf4",color:"#ffffff",bold:!0},secondary:{bg:"#494d64",color:"#cad3f5",bold:!1},danger:{bg:"#ed8796",color:"#ffffff",bold:!0},warning:{bg:"#eed49f",color:"#ffffff",bold:!0},info:{bg:"#8bd5ca",color:"#24273a",bold:!1},success:{bg:"#a6da95",color:"#24273a",bold:!0}}},checkbox:{color:"#494d64",checkedColor:"#f2a9dd",uncheckedColor:"#494d64"},radiobox:{color:"#494d64",selectedColor:"#f2a9dd",unselectedColor:"#494d64"}}},Ql={name:"NIGHTFOX_DAYFOX",background:"#f6f2ee",foreground:"#3d2b5a",primary:"#2848a9",secondary:"#352c24",success:"#396847",warning:"#ac5402",danger:"#a5222f",info:"#287980",components:{box:{color:"#352c24",bg:null},textBox:{color:"#3d2b5a",bg:null},textInput:{color:"#3d2b5a",bg:"#f6f2ee",focusColor:"#8452d5",errorColor:"#a5222f"},button:{variants:{primary:{bg:"#2848a9",color:"#ffffff",bold:!0},secondary:{bg:"#352c24",color:"#3d2b5a",bold:!1},danger:{bg:"#a5222f",color:"#ffffff",bold:!0},warning:{bg:"#ac5402",color:"#ffffff",bold:!0},info:{bg:"#287980",color:"#f6f2ee",bold:!1},success:{bg:"#396847",color:"#f6f2ee",bold:!0}}},checkbox:{color:"#352c24",checkedColor:"#8452d5",uncheckedColor:"#352c24"},radiobox:{color:"#352c24",selectedColor:"#8452d5",unselectedColor:"#352c24"}}},en={name:"NOCTIS_LILAC",background:"#e9e7f3",foreground:"#0c006b",primary:"#0094f0",secondary:"#0c006b",success:"#00b368",warning:"#f49725",danger:"#e34e1c",info:"#00bdd6",components:{box:{color:"#0c006b",bg:null},textBox:{color:"#0c006b",bg:null},textInput:{color:"#0c006b",bg:"#e9e7f3",focusColor:"#ff6b9f",errorColor:"#e34e1c"},button:{variants:{primary:{bg:"#0094f0",color:"#ffffff",bold:!0},secondary:{bg:"#0c006b",color:"#0c006b",bold:!1},danger:{bg:"#e34e1c",color:"#ffffff",bold:!0},warning:{bg:"#f49725",color:"#ffffff",bold:!0},info:{bg:"#00bdd6",color:"#e9e7f3",bold:!1},success:{bg:"#00b368",color:"#e9e7f3",bold:!0}}},checkbox:{color:"#0c006b",checkedColor:"#ff6b9f",uncheckedColor:"#0c006b"},radiobox:{color:"#0c006b",selectedColor:"#ff6b9f",unselectedColor:"#0c006b"}}},on={name:"GITHUB_DARK_COLORBLIND",background:"#010409",foreground:"#c9d1d9",primary:"#58a6ff",secondary:"#484f58",success:"#58a6ff",warning:"#d29922",danger:"#ec8e2c",info:"#39c5cf",components:{box:{color:"#484f58",bg:null},textBox:{color:"#c9d1d9",bg:null},textInput:{color:"#c9d1d9",bg:"#010409",focusColor:"#d2a8ff",errorColor:"#ec8e2c"},button:{variants:{primary:{bg:"#58a6ff",color:"#ffffff",bold:!0},secondary:{bg:"#484f58",color:"#c9d1d9",bold:!1},danger:{bg:"#ec8e2c",color:"#ffffff",bold:!0},warning:{bg:"#d29922",color:"#ffffff",bold:!0},info:{bg:"#39c5cf",color:"#010409",bold:!1},success:{bg:"#58a6ff",color:"#010409",bold:!0}}},checkbox:{color:"#484f58",checkedColor:"#d2a8ff",uncheckedColor:"#484f58"},radiobox:{color:"#484f58",selectedColor:"#d2a8ff",unselectedColor:"#484f58"}}},tn={name:"ZENBONES_SEOULBONES_LIGHT",background:"#e2e2e2",foreground:"#555555",primary:"#0084a3",secondary:"#e2e2e2",success:"#628562",warning:"#c48562",danger:"#dc5284",info:"#008586",components:{box:{color:"#e2e2e2",bg:null},textBox:{color:"#555555",bg:null},textInput:{color:"#555555",bg:"#e2e2e2",focusColor:"#7f4c7e",errorColor:"#dc5284"},button:{variants:{primary:{bg:"#0084a3",color:"#ffffff",bold:!0},secondary:{bg:"#e2e2e2",color:"#555555",bold:!1},danger:{bg:"#dc5284",color:"#ffffff",bold:!0},warning:{bg:"#c48562",color:"#ffffff",bold:!0},info:{bg:"#008586",color:"#e2e2e2",bold:!1},success:{bg:"#628562",color:"#e2e2e2",bold:!0}}},checkbox:{color:"#e2e2e2",checkedColor:"#7f4c7e",uncheckedColor:"#e2e2e2"},radiobox:{color:"#e2e2e2",selectedColor:"#7f4c7e",unselectedColor:"#e2e2e2"}}},rn={name:"ZENBONES_NORDBONES",background:"#2f3541",foreground:"#ebeef3",primary:"#8fbcba",secondary:"#2f3541",success:"#a4be8d",warning:"#cf866f",danger:"#c1616a",info:"#87bfce",components:{box:{color:"#2f3541",bg:null},textBox:{color:"#ebeef3",bg:null},textInput:{color:"#ebeef3",bg:"#2f3541",focusColor:"#cf97c5",errorColor:"#c1616a"},button:{variants:{primary:{bg:"#8fbcba",color:"#ffffff",bold:!0},secondary:{bg:"#2f3541",color:"#ebeef3",bold:!1},danger:{bg:"#c1616a",color:"#ffffff",bold:!0},warning:{bg:"#cf866f",color:"#ffffff",bold:!0},info:{bg:"#87bfce",color:"#2f3541",bold:!1},success:{bg:"#a4be8d",color:"#2f3541",bold:!0}}},checkbox:{color:"#2f3541",checkedColor:"#cf97c5",uncheckedColor:"#2f3541"},radiobox:{color:"#2f3541",selectedColor:"#cf97c5",unselectedColor:"#2f3541"}}},ln={name:"GITHUB_DARK",background:"#010409",foreground:"#e6edf3",primary:"#58a6ff",secondary:"#484f58",success:"#3fb950",warning:"#d29922",danger:"#ff7b72",info:"#39c5cf",components:{box:{color:"#484f58",bg:null},textBox:{color:"#e6edf3",bg:null},textInput:{color:"#e6edf3",bg:"#010409",focusColor:"#d2a8ff",errorColor:"#ff7b72"},button:{variants:{primary:{bg:"#58a6ff",color:"#ffffff",bold:!0},secondary:{bg:"#484f58",color:"#e6edf3",bold:!1},danger:{bg:"#ff7b72",color:"#ffffff",bold:!0},warning:{bg:"#d29922",color:"#ffffff",bold:!0},info:{bg:"#39c5cf",color:"#010409",bold:!1},success:{bg:"#3fb950",color:"#010409",bold:!0}}},checkbox:{color:"#484f58",checkedColor:"#d2a8ff",uncheckedColor:"#484f58"},radiobox:{color:"#484f58",selectedColor:"#d2a8ff",unselectedColor:"#484f58"}}},nn={name:"ROSE_PINE_DAWN",background:"#fffaf3",foreground:"#575279",primary:"#56949f",secondary:"#f2e9e1",success:"#286983",warning:"#ea9d34",danger:"#b4637a",info:"#d7827e",components:{box:{color:"#f2e9e1",bg:null},textBox:{color:"#575279",bg:null},textInput:{color:"#575279",bg:"#fffaf3",focusColor:"#907aa9",errorColor:"#b4637a"},button:{variants:{primary:{bg:"#56949f",color:"#ffffff",bold:!0},secondary:{bg:"#f2e9e1",color:"#575279",bold:!1},danger:{bg:"#b4637a",color:"#ffffff",bold:!0},warning:{bg:"#ea9d34",color:"#ffffff",bold:!0},info:{bg:"#d7827e",color:"#fffaf3",bold:!1},success:{bg:"#286983",color:"#fffaf3",bold:!0}}},checkbox:{color:"#f2e9e1",checkedColor:"#907aa9",uncheckedColor:"#f2e9e1"},radiobox:{color:"#f2e9e1",selectedColor:"#907aa9",unselectedColor:"#f2e9e1"}}},cn={name:"TENDER_DEFAULT",background:"#282828",foreground:"#eeeeee",primary:"#b3deef",secondary:"#282828",success:"#c9d05c",warning:"#ffc24b",danger:"#f43753",info:"#73cef4",components:{box:{color:"#282828",bg:null},textBox:{color:"#eeeeee",bg:null},textInput:{color:"#eeeeee",bg:"#282828",focusColor:"#d3b987",errorColor:"#f43753"},button:{variants:{primary:{bg:"#b3deef",color:"#ffffff",bold:!0},secondary:{bg:"#282828",color:"#eeeeee",bold:!1},danger:{bg:"#f43753",color:"#ffffff",bold:!0},warning:{bg:"#ffc24b",color:"#ffffff",bold:!0},info:{bg:"#73cef4",color:"#282828",bold:!1},success:{bg:"#c9d05c",color:"#282828",bold:!0}}},checkbox:{color:"#282828",checkedColor:"#d3b987",uncheckedColor:"#282828"},radiobox:{color:"#282828",selectedColor:"#d3b987",unselectedColor:"#282828"}}},an={name:"ZENBONES_SEOULBONES_DARK",background:"#4b4b4b",foreground:"#dddddd",primary:"#97bdde",secondary:"#4b4b4b",success:"#98bd99",warning:"#ffdf9b",danger:"#e388a3",info:"#6fbdbe",components:{box:{color:"#4b4b4b",bg:null},textBox:{color:"#dddddd",bg:null},textInput:{color:"#dddddd",bg:"#4b4b4b",focusColor:"#b2b3da",errorColor:"#e388a3"},button:{variants:{primary:{bg:"#97bdde",color:"#ffffff",bold:!0},secondary:{bg:"#4b4b4b",color:"#dddddd",bold:!1},danger:{bg:"#e388a3",color:"#ffffff",bold:!0},warning:{bg:"#ffdf9b",color:"#ffffff",bold:!0},info:{bg:"#6fbdbe",color:"#4b4b4b",bold:!1},success:{bg:"#98bd99",color:"#4b4b4b",bold:!0}}},checkbox:{color:"#4b4b4b",checkedColor:"#b2b3da",uncheckedColor:"#4b4b4b"},radiobox:{color:"#4b4b4b",selectedColor:"#b2b3da",unselectedColor:"#4b4b4b"}}},sn={name:"GITHUB_DARK_HIGH_CONTRAST",background:"#010409",foreground:"#f0f3f6",primary:"#71b7ff",secondary:"#7a828e",success:"#26cd4d",warning:"#f0b72f",danger:"#ff9492",info:"#39c5cf",components:{box:{color:"#7a828e",bg:null},textBox:{color:"#f0f3f6",bg:null},textInput:{color:"#f0f3f6",bg:"#010409",focusColor:"#dbb7ff",errorColor:"#ff9492"},button:{variants:{primary:{bg:"#71b7ff",color:"#ffffff",bold:!0},secondary:{bg:"#7a828e",color:"#f0f3f6",bold:!1},danger:{bg:"#ff9492",color:"#ffffff",bold:!0},warning:{bg:"#f0b72f",color:"#ffffff",bold:!0},info:{bg:"#39c5cf",color:"#010409",bold:!1},success:{bg:"#26cd4d",color:"#010409",bold:!0}}},checkbox:{color:"#7a828e",checkedColor:"#dbb7ff",uncheckedColor:"#7a828e"},radiobox:{color:"#7a828e",selectedColor:"#dbb7ff",unselectedColor:"#7a828e"}}},fn={name:"GITHUB_DARK_DIMMED",background:"#1c2128",foreground:"#adbac7",primary:"#539bf5",secondary:"#545d68",success:"#57ab5a",warning:"#c69026",danger:"#f47067",info:"#39c5cf",components:{box:{color:"#545d68",bg:null},textBox:{color:"#adbac7",bg:null},textInput:{color:"#adbac7",bg:"#1c2128",focusColor:"#dcbdfb",errorColor:"#f47067"},button:{variants:{primary:{bg:"#539bf5",color:"#ffffff",bold:!0},secondary:{bg:"#545d68",color:"#adbac7",bold:!1},danger:{bg:"#f47067",color:"#ffffff",bold:!0},warning:{bg:"#c69026",color:"#ffffff",bold:!0},info:{bg:"#39c5cf",color:"#1c2128",bold:!1},success:{bg:"#57ab5a",color:"#1c2128",bold:!0}}},checkbox:{color:"#545d68",checkedColor:"#dcbdfb",uncheckedColor:"#545d68"},radiobox:{color:"#545d68",selectedColor:"#dcbdfb",unselectedColor:"#545d68"}}},dn={name:"ZENBONES_ROSEBONES_DARK",background:"#1a1825",foreground:"#e1d4d4",primary:"#9ccfd8",secondary:"#1a1825",success:"#317490",warning:"#f6c074",danger:"#eb7193",info:"#9ccfd8",components:{box:{color:"#1a1825",bg:null},textBox:{color:"#e1d4d4",bg:null},textInput:{color:"#e1d4d4",bg:"#1a1825",focusColor:"#ceb3ef",errorColor:"#eb7193"},button:{variants:{primary:{bg:"#9ccfd8",color:"#ffffff",bold:!0},secondary:{bg:"#1a1825",color:"#e1d4d4",bold:!1},danger:{bg:"#eb7193",color:"#ffffff",bold:!0},warning:{bg:"#f6c074",color:"#ffffff",bold:!0},info:{bg:"#9ccfd8",color:"#1a1825",bold:!1},success:{bg:"#317490",color:"#1a1825",bold:!0}}},checkbox:{color:"#1a1825",checkedColor:"#ceb3ef",uncheckedColor:"#1a1825"},radiobox:{color:"#1a1825",selectedColor:"#ceb3ef",unselectedColor:"#1a1825"}}},un={name:"TOMORROW_NIGHT_BLUE",background:"#002451",foreground:"#ffffff",primary:"#bbdaff",secondary:"#000000",success:"#d1f1a9",warning:"#ffeead",danger:"#ff9da4",info:"#99ffff",components:{box:{color:"#000000",bg:null},textBox:{color:"#ffffff",bg:null},textInput:{color:"#ffffff",bg:"#002451",focusColor:"#ebbbff",errorColor:"#ff9da4"},button:{variants:{primary:{bg:"#bbdaff",color:"#ffffff",bold:!0},secondary:{bg:"#000000",color:"#ffffff",bold:!1},danger:{bg:"#ff9da4",color:"#ffffff",bold:!0},warning:{bg:"#ffeead",color:"#ffffff",bold:!0},info:{bg:"#99ffff",color:"#002451",bold:!1},success:{bg:"#d1f1a9",color:"#002451",bold:!0}}},checkbox:{color:"#000000",checkedColor:"#ebbbff",uncheckedColor:"#000000"},radiobox:{color:"#000000",selectedColor:"#ebbbff",unselectedColor:"#000000"}}},bn={name:"NOCTIS_AZUREUS",background:"#051b29",foreground:"#becfda",primary:"#49ace9",secondary:"#28353e",success:"#49e9a6",warning:"#e4b781",danger:"#e66533",info:"#49d6e9",components:{box:{color:"#28353e",bg:null},textBox:{color:"#becfda",bg:null},textInput:{color:"#becfda",bg:"#051b29",focusColor:"#e798b3",errorColor:"#e66533"},button:{variants:{primary:{bg:"#49ace9",color:"#ffffff",bold:!0},secondary:{bg:"#28353e",color:"#becfda",bold:!1},danger:{bg:"#e66533",color:"#ffffff",bold:!0},warning:{bg:"#e4b781",color:"#ffffff",bold:!0},info:{bg:"#49d6e9",color:"#051b29",bold:!1},success:{bg:"#49e9a6",color:"#051b29",bold:!0}}},checkbox:{color:"#28353e",checkedColor:"#e798b3",uncheckedColor:"#28353e"},radiobox:{color:"#28353e",selectedColor:"#e798b3",unselectedColor:"#28353e"}}},hn={name:"ZENBONES_FORESTBONES_DARK",background:"#2c343a",foreground:"#e7dcc4",primary:"#7fbcb4",secondary:"#2c343a",success:"#a9c181",warning:"#ddbd7f",danger:"#e67c7f",info:"#83c193",components:{box:{color:"#2c343a",bg:null},textBox:{color:"#e7dcc4",bg:null},textInput:{color:"#e7dcc4",bg:"#2c343a",focusColor:"#e5a7c4",errorColor:"#e67c7f"},button:{variants:{primary:{bg:"#7fbcb4",color:"#ffffff",bold:!0},secondary:{bg:"#2c343a",color:"#e7dcc4",bold:!1},danger:{bg:"#e67c7f",color:"#ffffff",bold:!0},warning:{bg:"#ddbd7f",color:"#ffffff",bold:!0},info:{bg:"#83c193",color:"#2c343a",bold:!1},success:{bg:"#a9c181",color:"#2c343a",bold:!0}}},checkbox:{color:"#2c343a",checkedColor:"#e5a7c4",uncheckedColor:"#2c343a"},radiobox:{color:"#2c343a",selectedColor:"#e5a7c4",unselectedColor:"#2c343a"}}},gn={name:"ROSE_PINE_DEFAULT",background:"#1f1d2e",foreground:"#e0def4",primary:"#9ccfd8",secondary:"#26233a",success:"#31748f",warning:"#f6c177",danger:"#eb6f92",info:"#ebbcba",components:{box:{color:"#26233a",bg:null},textBox:{color:"#e0def4",bg:null},textInput:{color:"#e0def4",bg:"#1f1d2e",focusColor:"#c4a7e7",errorColor:"#eb6f92"},button:{variants:{primary:{bg:"#9ccfd8",color:"#ffffff",bold:!0},secondary:{bg:"#26233a",color:"#e0def4",bold:!1},danger:{bg:"#eb6f92",color:"#ffffff",bold:!0},warning:{bg:"#f6c177",color:"#ffffff",bold:!0},info:{bg:"#ebbcba",color:"#1f1d2e",bold:!1},success:{bg:"#31748f",color:"#1f1d2e",bold:!0}}},checkbox:{color:"#26233a",checkedColor:"#c4a7e7",uncheckedColor:"#26233a"},radiobox:{color:"#26233a",selectedColor:"#c4a7e7",unselectedColor:"#26233a"}}},pn={name:"LUCARIO_DEFAULT",background:"#2b3e50",foreground:"#f8f8f2",primary:"#5c98cd",secondary:"#19242f",success:"#199c4b",warning:"#f0cc04",danger:"#e94b35",info:"#8be0fd",components:{box:{color:"#19242f",bg:null},textBox:{color:"#f8f8f2",bg:null},textInput:{color:"#f8f8f2",bg:"#2b3e50",focusColor:"#d4a9ff",errorColor:"#e94b35"},button:{variants:{primary:{bg:"#5c98cd",color:"#ffffff",bold:!0},secondary:{bg:"#19242f",color:"#f8f8f2",bold:!1},danger:{bg:"#e94b35",color:"#ffffff",bold:!0},warning:{bg:"#f0cc04",color:"#ffffff",bold:!0},info:{bg:"#8be0fd",color:"#2b3e50",bold:!1},success:{bg:"#199c4b",color:"#2b3e50",bold:!0}}},checkbox:{color:"#19242f",checkedColor:"#d4a9ff",uncheckedColor:"#19242f"},radiobox:{color:"#19242f",selectedColor:"#d4a9ff",unselectedColor:"#19242f"}}},mn={name:"NOCTIS_VIOLA",background:"#291d35",foreground:"#ccbfd9",primary:"#49ace9",secondary:"#362f3d",success:"#49e9a6",warning:"#e4b781",danger:"#e66533",info:"#49d6e9",components:{box:{color:"#362f3d",bg:null},textBox:{color:"#ccbfd9",bg:null},textInput:{color:"#ccbfd9",bg:"#291d35",focusColor:"#e798b3",errorColor:"#e66533"},button:{variants:{primary:{bg:"#49ace9",color:"#ffffff",bold:!0},secondary:{bg:"#362f3d",color:"#ccbfd9",bold:!1},danger:{bg:"#e66533",color:"#ffffff",bold:!0},warning:{bg:"#e4b781",color:"#ffffff",bold:!0},info:{bg:"#49d6e9",color:"#291d35",bold:!1},success:{bg:"#49e9a6",color:"#291d35",bold:!0}}},checkbox:{color:"#362f3d",checkedColor:"#e798b3",uncheckedColor:"#362f3d"},radiobox:{color:"#362f3d",selectedColor:"#e798b3",unselectedColor:"#362f3d"}}},xn={name:"NORDIC_DEFAULT",background:"#242933",foreground:"#bbc3d4",primary:"#5e81ac",secondary:"#191d24",success:"#a3be8c",warning:"#ebcb8b",danger:"#bf616a",info:"#8fbcbb",components:{box:{color:"#191d24",bg:null},textBox:{color:"#bbc3d4",bg:null},textInput:{color:"#bbc3d4",bg:"#242933",focusColor:"#be9d88",errorColor:"#bf616a"},button:{variants:{primary:{bg:"#5e81ac",color:"#ffffff",bold:!0},secondary:{bg:"#191d24",color:"#bbc3d4",bold:!1},danger:{bg:"#bf616a",color:"#ffffff",bold:!0},warning:{bg:"#ebcb8b",color:"#ffffff",bold:!0},info:{bg:"#8fbcbb",color:"#242933",bold:!1},success:{bg:"#a3be8c",color:"#242933",bold:!0}}},checkbox:{color:"#191d24",checkedColor:"#be9d88",uncheckedColor:"#191d24"},radiobox:{color:"#191d24",selectedColor:"#be9d88",unselectedColor:"#191d24"}}},yn={name:"GITHUB_LIGHT_COLORBLIND",background:"#f6f8fa",foreground:"#24292f",primary:"#0969da",secondary:"#24292f",success:"#0550ae",warning:"#4d2d00",danger:"#b35900",info:"#1b7c83",components:{box:{color:"#24292f",bg:null},textBox:{color:"#24292f",bg:null},textInput:{color:"#24292f",bg:"#f6f8fa",focusColor:"#a475f9",errorColor:"#b35900"},button:{variants:{primary:{bg:"#0969da",color:"#ffffff",bold:!0},secondary:{bg:"#24292f",color:"#24292f",bold:!1},danger:{bg:"#b35900",color:"#ffffff",bold:!0},warning:{bg:"#4d2d00",color:"#ffffff",bold:!0},info:{bg:"#1b7c83",color:"#f6f8fa",bold:!1},success:{bg:"#0550ae",color:"#f6f8fa",bold:!0}}},checkbox:{color:"#24292f",checkedColor:"#a475f9",uncheckedColor:"#24292f"},radiobox:{color:"#24292f",selectedColor:"#a475f9",unselectedColor:"#24292f"}}},Cn={name:"KANAGAWA_LOTUS",background:"#f2ecbc",foreground:"#545464",primary:"#4d699b",secondary:"#1f1f28",success:"#6f894e",warning:"#77713f",danger:"#c84053",info:"#597b75",components:{box:{color:"#1f1f28",bg:null},textBox:{color:"#545464",bg:null},textInput:{color:"#545464",bg:"#f2ecbc",focusColor:"#624c83",errorColor:"#c84053"},button:{variants:{primary:{bg:"#4d699b",color:"#ffffff",bold:!0},secondary:{bg:"#1f1f28",color:"#545464",bold:!1},danger:{bg:"#c84053",color:"#ffffff",bold:!0},warning:{bg:"#77713f",color:"#ffffff",bold:!0},info:{bg:"#597b75",color:"#f2ecbc",bold:!1},success:{bg:"#6f894e",color:"#f2ecbc",bold:!0}}},checkbox:{color:"#1f1f28",checkedColor:"#624c83",uncheckedColor:"#1f1f28"},radiobox:{color:"#1f1f28",selectedColor:"#624c83",unselectedColor:"#1f1f28"}}},vn={name:"DRACULA_DEFAULT",background:"#282a36",foreground:"#f8f8f2",primary:"#bd93f9",secondary:"#21222c",success:"#50fa7b",warning:"#f1fa8c",danger:"#ff5555",info:"#8be9fd",components:{box:{color:"#21222c",bg:null},textBox:{color:"#f8f8f2",bg:null},textInput:{color:"#f8f8f2",bg:"#282a36",focusColor:"#ff92df",errorColor:"#ff5555"},button:{variants:{primary:{bg:"#bd93f9",color:"#ffffff",bold:!0},secondary:{bg:"#21222c",color:"#f8f8f2",bold:!1},danger:{bg:"#ff5555",color:"#ffffff",bold:!0},warning:{bg:"#f1fa8c",color:"#ffffff",bold:!0},info:{bg:"#8be9fd",color:"#282a36",bold:!1},success:{bg:"#50fa7b",color:"#282a36",bold:!0}}},checkbox:{color:"#21222c",checkedColor:"#ff92df",uncheckedColor:"#21222c"},radiobox:{color:"#21222c",selectedColor:"#ff92df",unselectedColor:"#21222c"}}},wn={name:"KANAGAWA_DRAGON",background:"#181616",foreground:"#c5c9c5",primary:"#8ba4b0",secondary:"#0d0c0c",success:"#8a9a7b",warning:"#c4b28a",danger:"#c4746e",info:"#8ea4a2",components:{box:{color:"#0d0c0c",bg:null},textBox:{color:"#c5c9c5",bg:null},textInput:{color:"#c5c9c5",bg:"#181616",focusColor:"#938aa9",errorColor:"#c4746e"},button:{variants:{primary:{bg:"#8ba4b0",color:"#ffffff",bold:!0},secondary:{bg:"#0d0c0c",color:"#c5c9c5",bold:!1},danger:{bg:"#c4746e",color:"#ffffff",bold:!0},warning:{bg:"#c4b28a",color:"#ffffff",bold:!0},info:{bg:"#8ea4a2",color:"#181616",bold:!1},success:{bg:"#8a9a7b",color:"#181616",bold:!0}}},checkbox:{color:"#0d0c0c",checkedColor:"#938aa9",uncheckedColor:"#0d0c0c"},radiobox:{color:"#0d0c0c",selectedColor:"#938aa9",unselectedColor:"#0d0c0c"}}},kn={name:"ZENBONES_ZENBURNED",background:"#404040",foreground:"#f0e4cf",primary:"#6099c0",secondary:"#404040",success:"#819b69",warning:"#b77e64",danger:"#e3716e",info:"#66a5ad",components:{box:{color:"#404040",bg:null},textBox:{color:"#f0e4cf",bg:null},textInput:{color:"#f0e4cf",bg:"#404040",focusColor:"#cf86c1",errorColor:"#e3716e"},button:{variants:{primary:{bg:"#6099c0",color:"#ffffff",bold:!0},secondary:{bg:"#404040",color:"#f0e4cf",bold:!1},danger:{bg:"#e3716e",color:"#ffffff",bold:!0},warning:{bg:"#b77e64",color:"#ffffff",bold:!0},info:{bg:"#66a5ad",color:"#404040",bold:!1},success:{bg:"#819b69",color:"#404040",bold:!0}}},checkbox:{color:"#404040",checkedColor:"#cf86c1",uncheckedColor:"#404040"},radiobox:{color:"#404040",selectedColor:"#cf86c1",unselectedColor:"#404040"}}},Sn={name:"AYU_DARK",background:"#0b0e14",foreground:"#bfbdb6",primary:"#53bdfa",secondary:"#1e232b",success:"#7fd962",warning:"#f9af4f",danger:"#ea6c73",info:"#90e1c6",components:{box:{color:"#1e232b",bg:null},textBox:{color:"#bfbdb6",bg:null},textInput:{color:"#bfbdb6",bg:"#0b0e14",focusColor:"#d2a6ff",errorColor:"#ea6c73"},button:{variants:{primary:{bg:"#53bdfa",color:"#ffffff",bold:!0},secondary:{bg:"#1e232b",color:"#bfbdb6",bold:!1},danger:{bg:"#ea6c73",color:"#ffffff",bold:!0},warning:{bg:"#f9af4f",color:"#ffffff",bold:!0},info:{bg:"#90e1c6",color:"#0b0e14",bold:!1},success:{bg:"#7fd962",color:"#0b0e14",bold:!0}}},checkbox:{color:"#1e232b",checkedColor:"#d2a6ff",uncheckedColor:"#1e232b"},radiobox:{color:"#1e232b",selectedColor:"#d2a6ff",unselectedColor:"#1e232b"}}},_n={name:"ZENBONES_ZENWRITTEN_DARK",background:"#191919",foreground:"#bbbbbb",primary:"#6099c0",secondary:"#191919",success:"#819b69",warning:"#b77e64",danger:"#de6e7c",info:"#66a5ad",components:{box:{color:"#191919",bg:null},textBox:{color:"#bbbbbb",bg:null},textInput:{color:"#bbbbbb",bg:"#191919",focusColor:"#cf86c1",errorColor:"#de6e7c"},button:{variants:{primary:{bg:"#6099c0",color:"#ffffff",bold:!0},secondary:{bg:"#191919",color:"#bbbbbb",bold:!1},danger:{bg:"#de6e7c",color:"#ffffff",bold:!0},warning:{bg:"#b77e64",color:"#ffffff",bold:!0},info:{bg:"#66a5ad",color:"#191919",bold:!1},success:{bg:"#819b69",color:"#191919",bold:!0}}},checkbox:{color:"#191919",checkedColor:"#cf86c1",uncheckedColor:"#191919"},radiobox:{color:"#191919",selectedColor:"#cf86c1",unselectedColor:"#191919"}}},On={name:"GRUVBOX_LIGHT",background:"#fbf1c7",foreground:"#3c3836",primary:"#458588",secondary:"#fbf1c7",success:"#98971a",warning:"#d79921",danger:"#cc241d",info:"#689d6a",components:{box:{color:"#fbf1c7",bg:null},textBox:{color:"#3c3836",bg:null},textInput:{color:"#3c3836",bg:"#fbf1c7",focusColor:"#8f3f71",errorColor:"#cc241d"},button:{variants:{primary:{bg:"#458588",color:"#ffffff",bold:!0},secondary:{bg:"#fbf1c7",color:"#3c3836",bold:!1},danger:{bg:"#cc241d",color:"#ffffff",bold:!0},warning:{bg:"#d79921",color:"#ffffff",bold:!0},info:{bg:"#689d6a",color:"#fbf1c7",bold:!1},success:{bg:"#98971a",color:"#fbf1c7",bold:!0}}},checkbox:{color:"#fbf1c7",checkedColor:"#8f3f71",uncheckedColor:"#fbf1c7"},radiobox:{color:"#fbf1c7",selectedColor:"#8f3f71",unselectedColor:"#fbf1c7"}}},In={name:"CATPPUCCIN_FRAPPE",background:"#303446",foreground:"#c6d0f5",primary:"#8caaee",secondary:"#51576d",success:"#a6d189",warning:"#e5c890",danger:"#e78284",info:"#81c8be",components:{box:{color:"#51576d",bg:null},textBox:{color:"#c6d0f5",bg:null},textInput:{color:"#c6d0f5",bg:"#303446",focusColor:"#f2a4db",errorColor:"#e78284"},button:{variants:{primary:{bg:"#8caaee",color:"#ffffff",bold:!0},secondary:{bg:"#51576d",color:"#c6d0f5",bold:!1},danger:{bg:"#e78284",color:"#ffffff",bold:!0},warning:{bg:"#e5c890",color:"#ffffff",bold:!0},info:{bg:"#81c8be",color:"#303446",bold:!1},success:{bg:"#a6d189",color:"#303446",bold:!0}}},checkbox:{color:"#51576d",checkedColor:"#f2a4db",uncheckedColor:"#51576d"},radiobox:{color:"#51576d",selectedColor:"#f2a4db",unselectedColor:"#51576d"}}},En={TOMORROW_NIGHT_EIGHTIES:kr,GITHUB_LIGHT:Sr,DEUS_DEFAULT:_r,DRACULA_SOFT:Or,GRUVBOX_DARK_SOFT_CONTRAST:Ir,NOCTIS_OBSCURO:Er,GOTHAM_DEFAULT:Tr,ZENBONES_TOKYOBONES_LIGHT:Nr,NOCTIS_HIBERNUS:Ar,GRUVBOX_LIGHT_SOFT_CONTRAST:Br,SONOKAI_ATLANTIS:Lr,TOKYO_NIGHT_DAY:Rr,ZENBONES_TOKYOBONES_DARK:Mr,TOMORROW_DEFAULT:Hr,NIGHTFOX_DAWNFOX:Dr,ZENBONES_ROSEBONES_LIGHT:Fr,PANDA_DEFAULT:Gr,SOLARIZED_DARK:Ur,NORD_DEFAULT:Wr,NIGHTFOX_TERAFOX:Pr,MIASMA_DEFAULT:$r,SEOUL256_DARK:zr,GITHUB_LIGHT_LEGACY:Kr,ONE_HALF_DARK:jr,ICEBERG_LIGHT:Vr,SRCERY_DEFAULT:Yr,TOMORROW_NIGHT:Xr,ZENBONES_NEOBONES_LIGHT:Zr,KANAGAWA_WAVE:Jr,NIGHTFOX_NORDFOX:qr,ZENBONES_DUCKBONES:Qr,SONOKAI_DEFAULT:el,GRUVBOX_LIGHT_HARD_CONTRAST:ol,SONOKAI_ESPRESSO:tl,TOKYO_NIGHT_STORM:rl,SONOKAI_SHUSIA:ll,AYU_MIRAGE:nl,ZENBONES_VIMBONES:cl,SONOKAI_ANDROMEDA:al,NOCTIS_DEFAULT:sl,AYU_LIGHT:fl,GRUVBOX_DARK_HARD_CONTRAST:il,SHADES_OF_PURPLE_DEFAULT:dl,JELLYBEANS_DEFAULT:ul,NIGHTFOX_CARBONFOX:bl,MOONFLY_DEFAULT:hl,SONOKAI_MAIA:gl,ZENBONES_FORESTBONES_LIGHT:pl,NOCTIS_LUX:ml,CATPPUCCIN_LATTE:xl,ONE_HALF_LIGHT:yl,NIGHTFOX_DEFAULT:Cl,COBALT2_DEFAULT:vl,POSTERPOLE_DEFAULT:wl,ONE_DARK:kl,NIGHTFLY_DEFAULT:Sl,TOKYO_NIGHT_MOON:_l,NOCTIS_MINIMUS:Ol,NIGHTFOX_DUSKFOX:Il,SEOUL256_LIGHT:El,NOCTIS_BORDO:Tl,SHADES_OF_PURPLE_SUPER_DARK:Nl,ZENBONES_NEOBONES_DARK:Al,NOCTIS_SERENO:Bl,GRUVBOX_DARK:Ll,SOLARIZED_LIGHT:Rl,ZENBONES_ZENWRITTEN_LIGHT:Ml,NIGHT_OWL_DARK:Hl,NIGHT_OWL_LIGHT:Dl,POSTERPOLE_GRAY:Fl,APPRENTICE_DEFAULT:Gl,ZENBONES_KANAGAWABONES:Ul,EVERFOREST_DARK:Wl,ROSE_PINE_MOON:Pl,NOCTIS_UVA:$l,TOMORROW_NIGHT_BRIGHT:zl,EVERFOREST_LIGHT:Kl,GITHUB_LIGHT_HIGH_CONTRAST:jl,CATPPUCCIN_MOCHA:Vl,ONE_LIGHT:Yl,GITHUB_DARK_LEGACY:Xl,ICEBERG_DARK:Zl,TOKYO_NIGHT_DEFAULT:Jl,CATPPUCCIN_MACCHIATO:ql,NIGHTFOX_DAYFOX:Ql,NOCTIS_LILAC:en,GITHUB_DARK_COLORBLIND:on,ZENBONES_SEOULBONES_LIGHT:tn,ZENBONES_NORDBONES:rn,GITHUB_DARK:ln,ROSE_PINE_DAWN:nn,TENDER_DEFAULT:cn,ZENBONES_SEOULBONES_DARK:an,GITHUB_DARK_HIGH_CONTRAST:sn,GITHUB_DARK_DIMMED:fn,ZENBONES_ROSEBONES_DARK:dn,TOMORROW_NIGHT_BLUE:un,NOCTIS_AZUREUS:bn,ZENBONES_FORESTBONES_DARK:hn,ROSE_PINE_DEFAULT:gn,LUCARIO_DEFAULT:pn,NOCTIS_VIOLA:mn,NORDIC_DEFAULT:xn,GITHUB_LIGHT_COLORBLIND:yn,KANAGAWA_LOTUS:Cn,DRACULA_DEFAULT:vn,KANAGAWA_DRAGON:wn,ZENBONES_ZENBURNED:kn,AYU_DARK:Sn,ZENBONES_ZENWRITTEN_DARK:_n,GRUVBOX_LIGHT:On,CATPPUCCIN_FRAPPE:In};var Tn=Object.freeze({__proto__:null,APPRENTICE_DEFAULT:Gl,AYU_DARK:Sn,AYU_LIGHT:fl,AYU_MIRAGE:nl,CATPPUCCIN_FRAPPE:In,CATPPUCCIN_LATTE:xl,CATPPUCCIN_MACCHIATO:ql,CATPPUCCIN_MOCHA:Vl,COBALT2_DEFAULT:vl,DEUS_DEFAULT:_r,DRACULA_DEFAULT:vn,DRACULA_SOFT:Or,EVERFOREST_DARK:Wl,EVERFOREST_LIGHT:Kl,GITHUB_DARK:ln,GITHUB_DARK_COLORBLIND:on,GITHUB_DARK_DIMMED:fn,GITHUB_DARK_HIGH_CONTRAST:sn,GITHUB_DARK_LEGACY:Xl,GITHUB_LIGHT:Sr,GITHUB_LIGHT_COLORBLIND:yn,GITHUB_LIGHT_HIGH_CONTRAST:jl,GITHUB_LIGHT_LEGACY:Kr,GOTHAM_DEFAULT:Tr,GRUVBOX_DARK:Ll,GRUVBOX_DARK_HARD_CONTRAST:il,GRUVBOX_DARK_SOFT_CONTRAST:Ir,GRUVBOX_LIGHT:On,GRUVBOX_LIGHT_HARD_CONTRAST:ol,GRUVBOX_LIGHT_SOFT_CONTRAST:Br,ICEBERG_DARK:Zl,ICEBERG_LIGHT:Vr,JELLYBEANS_DEFAULT:ul,KANAGAWA_DRAGON:wn,KANAGAWA_LOTUS:Cn,KANAGAWA_WAVE:Jr,LUCARIO_DEFAULT:pn,MIASMA_DEFAULT:$r,MOONFLY_DEFAULT:hl,NIGHTFLY_DEFAULT:Sl,NIGHTFOX_CARBONFOX:bl,NIGHTFOX_DAWNFOX:Dr,NIGHTFOX_DAYFOX:Ql,NIGHTFOX_DEFAULT:Cl,NIGHTFOX_DUSKFOX:Il,NIGHTFOX_NORDFOX:qr,NIGHTFOX_TERAFOX:Pr,NIGHT_OWL_DARK:Hl,NIGHT_OWL_LIGHT:Dl,NOCTIS_AZUREUS:bn,NOCTIS_BORDO:Tl,NOCTIS_DEFAULT:sl,NOCTIS_HIBERNUS:Ar,NOCTIS_LILAC:en,NOCTIS_LUX:ml,NOCTIS_MINIMUS:Ol,NOCTIS_OBSCURO:Er,NOCTIS_SERENO:Bl,NOCTIS_UVA:$l,NOCTIS_VIOLA:mn,NORDIC_DEFAULT:xn,NORD_DEFAULT:Wr,ONE_DARK:kl,ONE_HALF_DARK:jr,ONE_HALF_LIGHT:yl,ONE_LIGHT:Yl,PANDA_DEFAULT:Gr,POSTERPOLE_DEFAULT:wl,POSTERPOLE_GRAY:Fl,ROSE_PINE_DAWN:nn,ROSE_PINE_DEFAULT:gn,ROSE_PINE_MOON:Pl,SEOUL256_DARK:zr,SEOUL256_LIGHT:El,SHADES_OF_PURPLE_DEFAULT:dl,SHADES_OF_PURPLE_SUPER_DARK:Nl,SOLARIZED_DARK:Ur,SOLARIZED_LIGHT:Rl,SONOKAI_ANDROMEDA:al,SONOKAI_ATLANTIS:Lr,SONOKAI_DEFAULT:el,SONOKAI_ESPRESSO:tl,SONOKAI_MAIA:gl,SONOKAI_SHUSIA:ll,SRCERY_DEFAULT:Yr,TENDER_DEFAULT:cn,THEMES:En,TOKYO_NIGHT_DAY:Rr,TOKYO_NIGHT_DEFAULT:Jl,TOKYO_NIGHT_MOON:_l,TOKYO_NIGHT_STORM:rl,TOMORROW_DEFAULT:Hr,TOMORROW_NIGHT:Xr,TOMORROW_NIGHT_BLUE:un,TOMORROW_NIGHT_BRIGHT:zl,TOMORROW_NIGHT_EIGHTIES:kr,ZENBONES_DUCKBONES:Qr,ZENBONES_FORESTBONES_DARK:hn,ZENBONES_FORESTBONES_LIGHT:pl,ZENBONES_KANAGAWABONES:Ul,ZENBONES_NEOBONES_DARK:Al,ZENBONES_NEOBONES_LIGHT:Zr,ZENBONES_NORDBONES:rn,ZENBONES_ROSEBONES_DARK:dn,ZENBONES_ROSEBONES_LIGHT:Fr,ZENBONES_SEOULBONES_DARK:an,ZENBONES_SEOULBONES_LIGHT:tn,ZENBONES_TOKYOBONES_DARK:Mr,ZENBONES_TOKYOBONES_LIGHT:Nr,ZENBONES_VIMBONES:cl,ZENBONES_ZENBURNED:kn,ZENBONES_ZENWRITTEN_DARK:_n,ZENBONES_ZENWRITTEN_LIGHT:Ml,getTheme:function(e){return En[e.toUpperCase()]},listThemes:function(){return Object.keys(En)}});function Nn(){const e=a(Se,null),o=a(ke,null),t=()=>Object.keys(Tn),r=e=>Tn[e]||null;return{theme:s(()=>e),themeName:s(()=>e?.name||null),isThemeSet:s(()=>null!==e),setTheme:l=>{const n=r(l);if(!n){const e=t().join(", ");throw new Error(`Theme '${l}' not found. Available themes: ${e}`)}e&&(Object.keys(e).forEach(o=>delete e[o]),Object.assign(e,n)),o&&Promise.resolve().then(function(){return X}).then(({colorToAnsiBg:e,colorToOSC11:t})=>{if(o.themeBgCode=e(n.background),n.background){const e=t(n.background);e&&process.stdout.write(`]11;${e}`)}o.logUpdate&&o.logUpdate.clear(),o.visibleLinesCache={offset:-1,lines:null,output:null},o.renderer&&o.renderer.forceUpdate&&o.renderer.forceUpdate()})},getTheme:r,listThemes:t,getAllThemes:()=>({...Tn}),findThemes:e=>{const o=new RegExp(e,"i");return t().filter(e=>o.test(e)).map(e=>({name:e,theme:r(e)}))}}}class An{constructor(e){this.debugServer=e,this.originalConsole={log:console.log,error:console.error,warn:console.warn},this.isActive=!1}activate(){if(this.isActive)return;const e=this;console.log=(...o)=>{e.debugServer.captureEvent("console.log",{args:o.map(o=>e.serialize(o))})},console.error=(...o)=>{e.debugServer.captureEvent("console.error",{args:o.map(o=>e.serialize(o))})},console.warn=(...o)=>{e.debugServer.captureEvent("console.warn",{args:o.map(o=>e.serialize(o))})},this.isActive=!0}deactivate(){this.isActive&&(console.log=this.originalConsole.log,console.error=this.originalConsole.error,console.warn=this.originalConsole.warn,this.isActive=!1)}interceptVueWarnings(e){const o=this;e.config.warnHandler=(e,t,r)=>{o.debugServer.captureEvent("vue.warn",{message:e,trace:r||"",component:t?.$options?.name||t?.__name||"Anonymous"})},e.config.errorHandler=(e,t,r)=>{o.debugServer.captureEvent("vue.error",{message:e.message||String(e),stack:e.stack||"",info:r||"",component:t?.$options?.name||t?.__name||"Anonymous"})}}serialize(e){if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);if(null===e)return"null";if(void 0===e)return"undefined";if(e instanceof Error)return`${e.name}: ${e.message}\n${e.stack||""}`;try{return JSON.stringify(e,null,2)}catch(o){return String(e)}}}function Bn(e){return e?{scrollOffset:e.scrollOffset||0,contentHeight:e.contentHeight||0,terminalHeight:e.terminalHeight||0,terminalWidth:e.terminalWidth||0,autoScrollToBottom:!1!==e.autoScrollToBottom,mouseWheelEnabled:!1!==e.mouseWheelEnabled,mouseWheelScrollLines:e.mouseWheelScrollLines||3,scrollIndicatorMode:e.scrollIndicatorMode||"reserved",mouseTrackingEnabled:!1!==e.mouseTrackingEnabled}:null}var Ln=Object.freeze({__proto__:null,serializeNodeTree:function e(o,t=0,r=5){if(!o||t>r)return null;const l={type:o.type,text:o.text||null,isDirty:o.isDirty||!1,isLayoutDirty:o.isLayoutDirty||!1};if(o.props&&Object.keys(o.props).length>0){l.props={};for(const[e,t]of Object.entries(o.props))null==t||"string"==typeof t||"number"==typeof t||"boolean"==typeof t?l.props[e]=t:Array.isArray(t)?l.props[e]=`[Array(${t.length})]`:"object"==typeof t?l.props[e]="[Object]":"function"==typeof t&&(l.props[e]="[Function]")}return o.cachedLayoutMetrics&&(l.layout={x:o.cachedLayoutMetrics.left||0,y:o.cachedLayoutMetrics.top||0,width:o.cachedLayoutMetrics.width||0,height:o.cachedLayoutMetrics.height||0}),o.children&&o.children.length>0&&(l.children=o.children.map(o=>e(o,t+1,r)).filter(e=>null!==e)),l},serializeViewport:Bn});const Rn=w(import.meta.url),Mn=p(Rn);var Hn=Object.freeze({__proto__:null,DebugServer:class{constructor(e={}){this.config={port:3e3,host:"localhost",captureConsole:!0,treeCaptureIntervalMs:2e3,treeMaxDepth:4,memoryStatsIntervalMs:5e3,...e},this.clients=new Set,this.eventBuffer=[],this.maxBufferSize=500,this.server=null,this.vuettyInstance=null,this.consoleInterceptor=null,this.latestLayoutTree=null,this.lastTreeCapture=0,this.latestMemoryStats=null,this.memoryStatsInterval=null,this.cleanupInterval=null}shallowSerialize(e){if(null==e)return e;if("object"!=typeof e)return e;try{return JSON.parse(JSON.stringify(e))}catch{return{error:"Serialization failed"}}}setVuettyInstance(e){this.vuettyInstance=e}async start(){if(this.server)return;const e=this,o=m(Mn,"static");try{this.server=Bun.serve({port:this.config.port,hostname:this.config.host,fetch(e,t){if(t.upgrade(e))return;const r=new URL(e.url),l={"/":"index.html","/debug.js":"debug.js","/debug.css":"debug.css","/favicon.ico":"favicon.ico"},n=l[r.pathname];if(!n){const e=`404: ${r.pathname}\nAvailable routes: ${Object.keys(l).join(", ")}`;return new Response(e,{status:404})}const c=m(o,n),a=Bun.file(c);return new Response(a)},websocket:{open(o){e.clients.add(o);const t=e.eventBuffer.slice(-50);o.send(JSON.stringify({type:"init",data:{viewport:e.vuettyInstance?Bn(e.vuettyInstance.viewport):null,buffer:t,layoutTree:e.latestLayoutTree,memory:e.latestMemoryStats}}))},close(o){e.clients.delete(o)},message(o,t){try{"clear"===JSON.parse(t).type&&(e.eventBuffer=[],e.broadcast({type:"cleared",data:{}}))}catch(e){}}}}),this.config.captureConsole&&(this.consoleInterceptor=new An(this),this.consoleInterceptor.activate()),this.startMemoryStats(),this.startCleanupInterval(),this.captureEvent("debug.server.started",{port:this.config.port,host:this.config.host,url:`http://${this.config.host}:${this.config.port}`})}catch(e){throw new Error(`Failed to start debug server: ${e.message}`)}}stop(){if(this.server){this.stopMemoryStats(),this.stopCleanupInterval(),this.consoleInterceptor&&(this.consoleInterceptor.deactivate(),this.consoleInterceptor=null);for(const e of this.clients)e.close();this.clients.clear(),this.server.stop(),this.server=null,this.eventBuffer=[],this.latestLayoutTree=null,this.latestMemoryStats=null}}interceptVueWarnings(e){this.consoleInterceptor&&this.consoleInterceptor.interceptVueWarnings(e)}captureRenderComplete({duration:e,outputLength:o,rootContainer:t}){if(this.captureEvent("render.complete",{duration:e,outputLength:o}),!t)return;const r=Date.now();r-this.lastTreeCapture<this.config.treeCaptureIntervalMs||(this.lastTreeCapture=r,Promise.resolve().then(function(){return Ln}).then(({serializeNodeTree:e})=>{const o=e(t,0,this.config.treeMaxDepth);this.latestLayoutTree=o,this.broadcast({timestamp:Date.now(),type:"layout.tree",data:{tree:o}})}).catch(()=>{}))}startMemoryStats(){this.memoryStatsInterval||!this.config.memoryStatsIntervalMs||this.config.memoryStatsIntervalMs<=0||(this.memoryStatsInterval=setInterval(()=>{if(!this.vuettyInstance||"function"!=typeof this.vuettyInstance.getMemoryStats)return;const e=this.vuettyInstance.getMemoryStats();this.latestMemoryStats=e,this.broadcast({timestamp:e.timestamp||Date.now(),type:"vuetty.memory",data:e})},this.config.memoryStatsIntervalMs))}stopMemoryStats(){this.memoryStatsInterval&&(clearInterval(this.memoryStatsInterval),this.memoryStatsInterval=null)}startCleanupInterval(){this.cleanupInterval||(this.cleanupInterval=setInterval(()=>{this.eventBuffer.length>200&&(this.eventBuffer=this.eventBuffer.slice(-200))},3e4))}stopCleanupInterval(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}captureEvent(e,o){const t={timestamp:Date.now(),type:e,data:this.shallowSerialize(o)};this.eventBuffer.push(t),this.eventBuffer.length>this.maxBufferSize&&this.eventBuffer.shift(),this.broadcast(t)}broadcast(e){const o=JSON.stringify(e);for(const e of this.clients)try{e.send(o)}catch(o){this.clients.delete(e)}}}});export{Eo as BigText,ho as Box,Qo as Button,jo as Checkbox,xt as Col,_ as CommentNode,pr as DEFAULT_THEME,he as Divider,Ro as Gradient,Co as Image,Mt as Markdown,xe as Newline,Oe as ProgressBar,Xo as Radiobox,ne as RenderContext,ce as RenderHandler,mt as Row,zo as SelectInput,me as Spacer,pe as Spinner,k as TUINode,ro as Table,xo as TextBox,Wo as TextInput,S as TextNode,wo as Tree,ye as VUETTY_INPUT_MANAGER_KEY,ke as VUETTY_INSTANCE_KEY,ve as VUETTY_RENDERER_KEY,Ce as VUETTY_ROUTER_KEY,Se as VUETTY_THEME_KEY,we as VUETTY_VIEWPORT_STATE_KEY,Cr as Vuetty,No as clearBigTextCache,gt as createTUIRenderer,xr as createTheme,vr as createVuetty,Ao as getBigTextCacheStats,ae as renderHandlerRegistry,st as renderToString,yr as resolveThemeColor,Nn as useTheme,wr as vuetty};
|